Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2011-11-01 21:20:09 +0000
committernhauge2011-11-01 21:20:09 +0000
commitb57365b6d936e7d6e8c09ea6c577c938c4f03072 (patch)
treec5e309cbee97d1e7206f2a3cfeedb55d7ba1a865
parent2746feaf38160c0d7b308f540fea5625165b9e67 (diff)
downloadwebtools.dali-201111010000.tar.gz
webtools.dali-201111010000.tar.xz
webtools.dali-201111010000.zip
This commit was manufactured by cvs2svn to create tag 'v201111010000'.v201111010000
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/.cvsignore2
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/build.properties0
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/feature.properties50
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/feature.xml60
-rw-r--r--assembly/features/org.eclipse.jpt.patch/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.patch/build.properties10
-rw-r--r--assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html20
-rw-r--r--assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.patch/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.patch/feature.properties143
-rw-r--r--assembly/features/org.eclipse.jpt.patch/feature.xml35
-rw-r--r--assembly/features/org.eclipse.jpt.patch/license.html93
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/.cvsignore4
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/build.properties15
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/feature.properties170
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/feature.xml42
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/license.html107
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/.cvsignore3
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/build.properties0
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.properties50
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.xml46
-rw-r--r--assembly/features/org.eclipse.jpt.tests/.project5
-rw-r--r--assembly/features/org.eclipse.jpt/.project5
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/.cvsignore4
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/.project17
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/build.properties0
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.properties50
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.xml60
-rw-r--r--assembly/plugins/org.eclipse.jpt/.cvsignore2
-rw-r--r--assembly/plugins/org.eclipse.jpt/.project22
-rw-r--r--assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF7
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.html34
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.ini44
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.mappings6
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.properties24
-rw-r--r--assembly/plugins/org.eclipse.jpt/build.properties19
-rw-r--r--assembly/plugins/org.eclipse.jpt/component.xml12
-rw-r--r--assembly/plugins/org.eclipse.jpt/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--assembly/plugins/org.eclipse.jpt/eclipse32.pngbin4594 -> 0 bytes
-rw-r--r--assembly/plugins/org.eclipse.jpt/plugin.properties13
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/.project17
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/build.properties13
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/feature.properties43
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/feature.xml41
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/build.properties14
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.cvsignore2
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.project17
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/build.properties15
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.properties43
-rw-r--r--common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.xml30
-rw-r--r--common/features/org.eclipse.jpt.common.feature/.project17
-rw-r--r--common/features/org.eclipse.jpt.common.feature/build.properties13
-rw-r--r--common/features/org.eclipse.jpt.common.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/feature.properties43
-rw-r--r--common/features/org.eclipse.jpt.common.feature/feature.xml51
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.html27
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.ini31
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.properties26
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/build.properties21
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/license.html86
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/build.properties14
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.html27
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/license.html86
-rw-r--r--common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--common/features/org.eclipse.jpt.common.tests.feature/.cvsignore1
-rw-r--r--common/features/org.eclipse.jpt.common.tests.feature/.project17
-rw-r--r--common/features/org.eclipse.jpt.common.tests.feature/build.properties17
-rw-r--r--common/features/org.eclipse.jpt.common.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common.tests.feature/feature.properties51
-rw-r--r--common/features/org.eclipse.jpt.common.tests.feature/feature.xml38
-rw-r--r--common/features/org.eclipse.jpt.common_sdk.feature/.cvsignore2
-rw-r--r--common/features/org.eclipse.jpt.common_sdk.feature/.project17
-rw-r--r--common/features/org.eclipse.jpt.common_sdk.feature/build.properties15
-rw-r--r--common/features/org.eclipse.jpt.common_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--common/features/org.eclipse.jpt.common_sdk.feature/feature.properties43
-rw-r--r--common/features/org.eclipse.jpt.common_sdk.feature/feature.xml30
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/.cvsignore1
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/.project22
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/META-INF/MANIFEST.MF7
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/about.html34
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/about.ini44
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/about.mappings6
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/about.properties24
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/build.properties17
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/component.xml9
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.branding/plugin.properties13
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/.classpath13
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/.cvsignore1
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/.project28
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/META-INF/MANIFEST.MF57
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/about.html34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/build.properties19
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/plugin.properties31
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/plugin.xml156
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/property_files/jpt_common_core.properties23
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd139
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/schema/resourceLocators.exsd191
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/AnnotationProvider.java84
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/GenericAnnotationProvider.java136
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/IResourcePart.java34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptCommonCorePlugin.java174
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModel.java44
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModelListener.java34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceType.java99
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptCommonCoreMessages.java43
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/ResourceAdapterFactory.java48
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java369
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java45
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java45
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/LibraryProviderPropertyTester.java41
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibValUtil.java92
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java97
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorManager.java149
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java137
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/JptFileCreationDataModelProperties.java33
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java79
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java93
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java167
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorManager.java167
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java152
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/WebModuleResourceLocator.java54
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/AbstractJavaResourceNode.java109
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/NullAnnotation.java94
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAbstractType.java227
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotatedElement.java332
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotation.java96
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAttribute.java426
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryClassFile.java77
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnum.java128
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnumConstant.java84
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryField.java82
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMember.java279
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMethod.java184
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNamedAnnotation.java32
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNode.java62
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragment.java135
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java115
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryType.java308
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryTypeCache.java157
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryNode.java82
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAbstractType.java200
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java582
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotation.java248
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAttribute.java384
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java177
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnum.java220
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnumConstant.java93
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceField.java61
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMember.java180
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMethod.java171
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNamedAnnotation.java42
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNode.java347
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackage.java103
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java122
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceType.java531
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java190
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/CallbackJobSynchronizer.java154
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ICUStringCollator.java63
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JDTTools.java319
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobCommand.java96
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobSynchronizer.java198
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java108
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleSchedulingRule.java38
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleTextRange.java44
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/XPointTools.java139
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ASTTools.java311
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractAnnotationAdapter.java165
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractDeclarationAnnotationAdapter.java153
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractExpressionConverter.java82
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractJDTType.java200
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java403
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotatedElementAnnotationElementAdapter.java99
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java120
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/BooleanExpressionConverter.java51
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CharacterStringExpressionConverter.java53
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java500
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java159
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/DefaultAnnotationEditFormatter.java219
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementAnnotationAdapter.java27
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementIndexedAnnotationAdapter.java74
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.java150
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java119
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java327
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/GenericVisitor.java791
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/IndexedConversionDeclarationAnnotationElementAdapter.java43
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTAnnotatedElement.java201
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnum.java132
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnumConstant.java123
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTFieldAttribute.java221
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMember.java90
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMethodAttribute.java268
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTModifiedDeclaration.java584
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTPackage.java61
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTType.java207
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JPTTools.java283
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NameStringExpressionConverter.java57
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java90
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java325
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullAnnotationEditFormatter.java42
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationAdapter.java82
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationElementAdapter.java60
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullExpressionConverter.java54
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NumberIntegerExpressionConverter.java51
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/PrimitiveTypeStringExpressionConverter.java61
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java104
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java43
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleDeclarationAnnotationAdapter.java62
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleTypeStringExpressionConverter.java63
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringArrayExpressionConverter.java112
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringExpressionConverter.java52
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/TypeStringExpressionConverter.java55
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/BooleanTranslator.java36
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EmptyTagBooleanTranslator.java53
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EnumeratedValueTranslator.java45
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleRootTranslator.java92
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleTranslator.java135
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libprov/JptLibraryProviderInstallOperationConfig.java34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libval/LibraryValidator.java31
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/ResourceLocator.java50
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/Annotation.java60
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/AnnotationDefinition.java64
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAbstractType.java92
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAnnotatedElement.java223
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAttribute.java121
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceClassFile.java34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceCompilationUnit.java74
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnum.java38
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnumConstant.java32
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceField.java27
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMember.java77
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMethod.java63
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceNode.java97
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackage.java32
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragment.java50
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragmentRoot.java39
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageInfoCompilationUnit.java30
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceType.java82
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceTypeCache.java48
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotation.java34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotationDefinition.java54
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/AbstractTextRange.java84
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/BodySourceWriter.java303
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/TextRange.java103
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AbstractType.java38
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedElement.java82
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedPackage.java40
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationAdapter.java63
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationEditFormatter.java34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationElementAdapter.java68
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Attribute.java46
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationAdapter.java72
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationElementAdapter.java63
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Enum.java39
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/EnumConstant.java41
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ExpressionConverter.java44
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/FieldAttribute.java39
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedAnnotationAdapter.java37
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java37
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationElementAdapter.java37
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedExpressionConverter.java34
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Member.java39
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/MethodAttribute.java45
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ModifiedDeclaration.java105
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Type.java56
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/.cvsignore1
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/.project22
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.html34
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.ini44
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.mappings6
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.properties24
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/build.properties17
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/component.xml7
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.branding/plugin.properties13
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/.classpath12
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/.cvsignore1
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/.project28
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/META-INF/MANIFEST.MF23
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/about.html34
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/build.properties19
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.properties23
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml155
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/property_files/jpt_common_eclipselink_core.properties15
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_0.xsd3128
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_1.xsd3248
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_2.xsd3519
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_0.xsd3625
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_1.xsd4108
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_2.xsd4778
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_3.xsd5479
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_0.xsd260
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_1.xsd462
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_2.xsd562
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_3.xsd589
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.0.xsd4109
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.1.xsd4183
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.2.xsd4253
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.0.xsd4253
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.3.xsd4307
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.0.xsd1477
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.1.xsd1585
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.2.xsd1586
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.0.xsd1591
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.1.xsd1598
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/JptCommonEclipseLinkCorePlugin.java90
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/JptCommonEclipseLinkCoreMessages.java35
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/libval/EclipseLinkLibValUtil.java84
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/.classpath13
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/.cvsignore1
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/.project28
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/META-INF/MANIFEST.MF73
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/about.html34
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/build.properties17
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/plugin.properties23
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/property_files/jpt_common_ui.properties30
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiPlugin.java65
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java240
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptCommonUiMessages.java55
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java161
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/dialogs/OptionalMessageDialog.java107
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemLabelProvider.java224
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractTreeItemContentProvider.java204
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ArchiveFileViewerFilter.java71
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/DelegatingTreeContentAndLabelProvider.java58
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java47
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullLabelProvider.java60
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullTreeContentProvider.java60
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java265
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java151
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTListChangeListenerWrapper.java201
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java82
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTStateChangeListenerWrapper.java79
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTTreeChangeListenerWrapper.java151
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/properties/JptProjectPropertiesPage.java427
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java704
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ColumnAdapter.java55
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ComboModelAdapter.java210
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/DateTimeModelAdapter.java352
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/SpinnerModelAdapter.java214
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java209
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java746
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TriStateCheckBoxModelAdapter.java188
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlAligner.java913
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlSwitcher.java147
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledButton.java64
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControl.java37
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControlUpdater.java130
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledLabel.java64
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneEnabler.java175
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneVisibilityEnabler.java173
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java447
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/StateController.java320
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/TableLayoutComposite.java207
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/AsynchronousUiCommandExecutor.java49
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/SynchronousUiCommandExecutor.java49
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/AbstractListWidgetAdapter.java42
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanButtonModelBinding.java190
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanStateController.java188
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/DropDownListBoxSelectionBinding.java283
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListBoxSelectionBinding.java305
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListWidgetModelBinding.java428
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/MultiControlBooleanStateController.java157
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTComboAdapter.java67
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTListAdapter.java49
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTTools.java392
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SimpleBooleanStateController.java68
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/TextFieldModelBinding.java196
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java554
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java923
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveTablePane.java314
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java167
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserComboPane.java92
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java373
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ComboPane.java289
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java260
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java350
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java109
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java369
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumDialogComboViewer.java77
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumFormComboViewer.java77
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserComboPane.java105
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserPane.java167
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserComboPane.java106
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserPane.java140
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java338
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java188
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java166
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java179
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java146
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NullPostExecution.java56
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PackageChooserPane.java241
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java3746
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PostExecution.java31
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PropertySheetWidgetFactory.java61
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/TriStateCheckBox.java287
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java233
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/wizards/JavaProjectWizardPage.java256
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/DelegatingContentAndLabelProvider.java207
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProvider.java36
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProviderFactory.java26
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java47
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProviderFactory.java26
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProvider.java40
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProviderFactory.java26
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/.classpath13
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/.cvsignore1
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/.project28
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/META-INF/MANIFEST.MF21
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/about.html34
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/build.properties16
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/plugin.properties23
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/JptCommonCoreTests.java30
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestFacetedProject.java85
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestJavaProject.java121
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestPlatformProject.java79
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JavaResourceModelTestCase.java197
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JptCommonCoreResourceJavaTests.java28
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/SourceAttributeTests.java135
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/ASTToolsTests.java196
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java1065
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java744
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java75
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java65
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java36
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java1298
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MiscTests.java48
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java763
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java2229
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java274
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeTests.java52
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/test.xml45
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/.classpath12
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/.cvsignore1
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/.project28
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/META-INF/MANIFEST.MF21
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/build.properties13
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/plugin.properties23
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java34
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java602
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java563
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/AbstractComboModelAdapterTest.java777
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/ComboModelAdapterTest.java78
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/JptUiSWTTests.java38
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/SpinnerModelAdapterTest.java342
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TableModelAdapterTest.java1201
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java319
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlAlignerTest.java803
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlEnablerTest.java85
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java189
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlVisibilityEnablerTest.java85
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/JptUiUtilTests.java44
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledButtonTest.java122
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledControlUpdaterTest.java124
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledLabelTest.java122
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneEnablerTest.java93
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java93
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/BooleanStateControllerUITest.java278
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/CheckBoxModelBindingUITest.java318
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java664
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java626
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/TextFieldModelBindingUITest.java252
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/.classpath11
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/.cvsignore1
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/.project28
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/META-INF/MANIFEST.MF21
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/about.html34
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/build.properties16
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/plugin.properties24
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/resource/ClassTools.java1680
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java3523
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/AsynchronousCommandExecutorTests.java42
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BagTests.java82
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiFilterTests.java88
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiStringConverterTests.java115
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiTransformerTests.java73
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BitToolsTests.java262
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BooleanToolsTests.java89
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClassNameTests.java368
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClasspathTests.java402
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CollectionToolsTests.java2418
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandExecutorTests.java113
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandRunnableTests.java55
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandTests.java137
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CompositeCommandTests.java61
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ExceptionHandlerTests.java51
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FileToolsTests.java593
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FilterTests.java79
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/HashBagTests.java555
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IdentityHashBagTests.java573
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IndentingPrintWriterTests.java109
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JDBCTypeTests.java67
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JavaTypeTests.java252
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JptCommonUtilityTests.java91
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/KeyedSetTests.java124
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java194
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MethodSignatureTests.java208
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MultiThreadedTestCase.java141
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NameToolsTests.java226
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NotNullFilterTests.java37
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/RangeTests.java74
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReflectionToolsTests.java440
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReverseComparatorTests.java102
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleAssociationTests.java112
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleBooleanReferenceTests.java110
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleIntReferenceTests.java314
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleObjectReferenceTests.java88
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleQueueTests.java149
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleStackTests.java148
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java1871
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedBooleanTests.java341
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedIntTests.java362
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedObjectTests.java239
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedQueueTests.java256
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedStackTests.java257
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/TestTools.java184
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ToolsTests.java63
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/VersionComparatorTests.java205
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/XMLStringEncoderTests.java136
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/EmptyEnumerationTests.java55
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/IteratorEnumerationTests.java100
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/JptUtilityEnumerationsTests.java34
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayIterableTests.java79
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayListIterableTests.java92
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ChainIterableTests.java84
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CloneIterableTests.java144
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeIterableTests.java115
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeListIterableTests.java117
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyIterableTests.java39
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyListIterableTests.java39
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/FilteringIterableTests.java98
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/GraphIterableTests.java167
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/JptUtilityIterablesTests.java57
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneIterableTests.java71
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneListIterableTests.java131
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/PeekableIterableTests.java47
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/QueueIterableTests.java48
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyCompositeListIterableTests.java127
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyIterableTests.java68
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyListIterableTests.java74
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementIterableTests.java66
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementListIterableTests.java70
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneIterableTests.java71
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneListIterableTests.java131
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/StackIterableTests.java50
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SuperIterableWrapperTests.java50
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationIterableTests.java104
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationListIterableTests.java104
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TreeIterableTests.java155
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayIteratorTests.java135
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayListIteratorTests.java140
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ChainIteratorTests.java133
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneIteratorTests.java237
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneListIteratorTests.java397
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeIteratorTests.java351
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeListIteratorTests.java331
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyIteratorTests.java64
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyListIteratorTests.java128
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EnumerationIteratorTests.java120
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/FilteringIteratorTests.java266
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/GraphIteratorTests.java197
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/JptUtilityIteratorsTests.java56
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/PeekableIteratorTests.java141
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java205
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyIteratorTests.java119
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java204
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementIteratorTests.java72
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementListIteratorTests.java112
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SuperIteratorWrapperTests.java52
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedIteratorTests.java310
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedListIteratorTests.java524
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationIteratorTests.java230
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationListIteratorTests.java322
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TreeIteratorTests.java211
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/ChangeSupportTests.java4575
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/JptUtilityModelTests.java37
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/NewEventTests.java181
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/SingleAspectChangeSupportTests.java192
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java34
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java331
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java498
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java176
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java145
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java362
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java504
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java241
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java253
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionAspectAdapterTests.java372
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java247
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java240
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeBooleanPropertyValueModelTests.java201
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java415
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeListValueModelTests.java1248
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositePropertyValueModelTests.java199
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedBag.java163
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedList.java264
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java313
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java348
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java191
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java243
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java244
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java335
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java306
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/JptUtilityModelValueTests.java78
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListAspectAdapterTests.java476
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java282
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCuratorTests.java348
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullCollectionValueModelTests.java44
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullListValueModelTests.java54
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullPropertyValueModelTests.java40
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyAspectAdapterTests.java344
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java162
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java211
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ReadOnlyWritablePropertyValueModelWrapperTests.java157
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SetCollectionValueModelTests.java328
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java443
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleListValueModelTests.java378
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimplePropertyValueModelTests.java97
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java222
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelWrapperTests.java237
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticCollectionValueModelTests.java62
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticListValueModelTests.java65
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticValueModelTests.java47
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java339
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java189
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TreeAspectAdapterTests.java362
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueCollectionAdapterTests.java159
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueListAdapterTests.java169
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValuePropertyAdapterTests.java145
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueStateAdapterTests.java145
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java31
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java398
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java312
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesTestCase.java82
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java135
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java314
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java111
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java393
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java75
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java160
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterTests.java159
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java256
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java42
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterTests.java320
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java370
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java134
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java148
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java205
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java198
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java230
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java260
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java39
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java118
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java344
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java641
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java733
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java812
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java425
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java495
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/JptUtilityNodeTests.java29
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/AsynchronousSynchronizerTests.java443
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/JptUtilitySynchronizersTests.java35
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronizerTests.java41
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java756
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/test.xml38
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml63
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore2
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties5
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml30
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml63
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore2
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties5
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml30
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/build.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml55
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties12
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties12
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore1
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties7
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties51
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml32
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore2
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties5
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java241
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gifbin587 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gifbin574 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gifbin351 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gifbin349 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gifbin82 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gifbin1834 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java156
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java111
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java275
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java186
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java216
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java355
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java142
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java38
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java195
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java287
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml319
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties84
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd221
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java1038
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java153
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java92
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java403
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java497
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbBasicMapping.java87
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java124
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java82
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java92
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java127
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java87
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java114
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java84
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlList.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java208
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java505
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java169
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java1653
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java143
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JaxbPlatformTester.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java163
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java580
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java147
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java189
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java147
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java122
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java279
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java338
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java478
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java206
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java678
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java498
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java1076
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java467
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java163
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java309
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java141
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java423
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java455
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java131
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java526
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java257
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java390
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java290
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java410
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java295
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java249
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java346
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java275
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java472
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java83
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java115
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java109
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java111
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java238
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java214
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java344
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java242
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java67
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java95
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java277
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java359
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java121
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java287
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java212
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java38
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java93
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java170
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java109
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java137
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java253
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java139
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java161
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java136
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java221
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java236
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java167
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java162
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java81
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java112
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java101
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java228
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java173
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java196
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java381
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java345
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java314
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java122
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java234
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java255
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java153
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java147
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java304
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java274
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java169
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java342
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java143
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java158
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java119
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java159
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java111
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java124
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java97
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java187
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java83
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java154
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java152
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java223
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java249
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java290
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.properties28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gifbin908 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gifbin908 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java105
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gifbin364 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gifbin220 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gifbin612 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gifbin598 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gifbin574 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gifbin351 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gifbin124 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gifbin1005 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gifbin220 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gifbin981 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gifbin1010 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gifbin1007 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.icobin1150 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gifbin983 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.icobin1150 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gifbin911 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gifbin950 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gifbin124 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gifbin193 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gifbin349 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gifbin951 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gifbin973 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gifbin937 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gifbin995 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gifbin978 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gifbin960 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gifbin940 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gifbin886 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gifbin880 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gifbin82 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gifbin3162 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gifbin2787 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gifbin3213 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml301
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties173
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd139
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java228
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java185
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java79
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java186
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/OpenJaxbResourceAction.java91
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemContentProvider.java82
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java131
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemContentProvider.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java113
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorActionProvider.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java232
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java138
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java133
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java320
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java962
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java246
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java221
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java770
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java431
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java779
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java215
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java192
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java145
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java195
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java198
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java90
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java856
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java213
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java266
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java439
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java35
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath13
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore1
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project28
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF31
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/about.html34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/build.properties16
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.properties23
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java57
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java31
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java82
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java122
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java517
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java98
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java32
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java185
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java2138
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java413
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java137
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java381
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java793
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java160
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java197
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java173
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java153
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java533
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java632
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java958
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java594
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java415
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java371
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java169
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java669
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java206
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java152
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java149
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java52
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java103
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java94
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java76
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java63
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java60
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java94
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java66
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java106
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java136
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java174
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java305
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java280
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java237
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java290
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java203
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java380
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java89
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java109
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java49
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java267
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java111
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java108
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java49
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java131
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java263
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java156
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java240
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java144
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java49
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java340
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml35
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath14
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore1
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project28
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF24
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/about.html34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties15
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties23
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java68
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/JaxbEclipseLinkCoreTests.java30
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/JaxbEclipseLinkCoreResourceModelTests.java33
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java48
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java33
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java107
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml91
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties51
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml32
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties5
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml30
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/build.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/feature.xml128
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties51
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml38
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties5
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml37
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF9
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.htm43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.html43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/build.properties136
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml44
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml88
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm60
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml646
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css21
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm11
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm80
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm105
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm204
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.pngbin14825 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.pngbin11473 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.pngbin4148 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.pngbin21428 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.pngbin21454 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.pngbin27589 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.pngbin24998 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.pngbin10563 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.pngbin13762 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.pngbin16127 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.pngbin11583 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.pngbin361 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.pngbin476 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.pngbin11615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.pngbin3359 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.pngbin8101 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.pngbin8380 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.pngbin18846 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.pngbin7864 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.pngbin14896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.pngbin19392 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.pngbin15128 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.pngbin14985 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.pngbin15162 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.pngbin28047 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.pngbin332 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.pngbin700 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.pngbin477 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.pngbin321 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.pngbin461 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.pngbin311 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.pngbin316 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.pngbin682 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.pngbin681 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.pngbin325 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.pngbin270 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.pngbin303 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.pngbin373 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.pngbin27810 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.pngbin387 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.pngbin26056 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.pngbin667 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.pngbin615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.pngbin568 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.pngbin8746 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.pngbin29075 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.pngbin9676 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.pngbin4408 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.pngbin20222 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.pngbin20446 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.pngbin22231 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.pngbin20015 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.pngbin21639 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.pngbin10643 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.pngbin26207 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.pngbin9169 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.pngbin9338 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.pngbin5208 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/index.xml668
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/legal.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties32
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml37
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm115
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm117
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm77
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm89
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm96
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm56
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm122
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm272
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm104
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm126
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm56
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm82
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm142
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm98
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm79
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference.htm60
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm122
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm80
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm113
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm82
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm71
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm98
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm106
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm116
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm76
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm183
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm221
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm185
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm241
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm170
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm143
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm108
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm125
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm60
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm160
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm141
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm138
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm64
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm222
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm77
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm85
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm96
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm70
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm183
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm97
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm91
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm176
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm179
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm167
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm197
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm146
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm136
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm95
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm92
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm68
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/toc.xml155
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java535
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java358
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java412
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java488
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java311
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel652
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore833
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml186
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java237
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java193
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java1136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java180
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java281
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java655
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java335
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java177
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java354
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java264
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java729
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java174
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java356
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java444
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java252
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java805
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java172
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java308
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java229
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java610
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java386
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java332
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java751
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java462
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java586
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java676
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java870
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java408
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java328
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java443
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java231
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java450
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkConvertAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkConvertAnnotation.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java217
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java487
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java172
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java282
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java533
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java1199
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java12962
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java1693
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java451
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java451
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java1029
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java299
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java251
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterHolder.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertersHolder.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java2654
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java1589
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java470
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java469
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java3763
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java1368
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java360
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java1256
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java563
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java2182
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java1478
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java3988
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java399
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java644
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java477
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java2361
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java1643
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java224
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java374
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java406
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java654
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java590
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java363
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java264
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java404
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java446
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java474
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java339
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java1219
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java1135
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java696
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java1526
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java258
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java2567
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddable_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddedId_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbedded_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlId_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTransformation_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlVersion_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java4649
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java281
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java2464
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java1099
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java388
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java273
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java419
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java824
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java1037
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java329
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java648
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath13
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/META-INF/MANIFEST.MF23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties17
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java21
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java163
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath15
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF45
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java61
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java65
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java234
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java411
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java172
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java313
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java935
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java447
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java261
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java997
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java322
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java844
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java459
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java171
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java656
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java861
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java3437
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java151
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java716
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java550
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java1179
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java1183
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java964
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java289
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java433
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java334
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java1163
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java1516
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java304
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java731
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java236
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java672
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java611
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java250
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java401
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java59
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java1066
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java319
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java574
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java267
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java711
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java280
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java835
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java456
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java295
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java923
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java943
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java2803
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java136
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java753
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java506
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java1365
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java1064
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java617
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java386
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java358
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java273
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java1057
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java1195
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java253
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java122
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java767
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java172
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java609
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java827
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java305
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java489
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java69
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java369
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java104
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java113
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java98
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java134
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java361
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java1245
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java46
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java45
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java580
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java417
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java107
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java723
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java2615
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java368
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java1608
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java2057
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java423
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java1953
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java682
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java2214
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java1141
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java162
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java863
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java197
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java352
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java534
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java753
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java1711
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java1734
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java1972
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java1197
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java673
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java1486
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java990
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java565
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java285
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java91
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java186
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java520
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java30
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java58
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java177
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java861
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java949
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java499
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java170
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java29
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java410
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java403
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java109
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java405
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java358
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java448
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java90
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java87
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java413
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java463
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java253
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java116
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java262
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java77
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java96
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java129
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java128
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java251
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java344
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java163
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java298
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java152
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java405
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java212
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java124
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java90
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java134
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java103
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java479
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java718
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java173
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java679
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java353
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java446
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java656
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java395
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java388
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java425
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java341
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java339
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java259
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java398
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java448
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java273
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java65
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java436
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java503
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java234
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java502
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java346
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml35
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF19
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java1030
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java482
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java417
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java397
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java486
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java443
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF32
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java122
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java166
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java724
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java2280
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java1804
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java1411
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java326
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java529
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java1531
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java814
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java631
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java742
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java225
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java223
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java254
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java388
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java324
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java349
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java645
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java582
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java449
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java222
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java314
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java435
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java293
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java753
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java1639
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java1807
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java1070
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java589
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java2377
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java1186
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java910
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java546
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java677
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java390
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java497
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java195
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java1037
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java2395
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java390
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java384
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java322
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java2149
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java530
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java747
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java456
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java195
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java262
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java388
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java371
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java60
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java448
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java443
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java173
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java431
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java519
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java541
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java760
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java174
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java104
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java161
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java339
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java161
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java379
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java160
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java253
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java153
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java231
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java494
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java132
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java156
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java330
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java138
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java112
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java427
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java156
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java156
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java159
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java215
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml49
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java143
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml49
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties13
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java65
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.project5
-rw-r--r--jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/.project11
-rw-r--r--jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/pom.xml59
-rw-r--r--jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/.project17
-rw-r--r--jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/pom.xml28
-rw-r--r--jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/site.xml7
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.cvsignore1
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.project17
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/build.properties13
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.properties43
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.xml49
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/pom.xml16
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.properties15
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/build.properties11
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/license.html86
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/plugin.properties2
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/build.properties4
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/feature.properties38
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.properties16
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/build.properties11
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/plugin.properties3
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.cvsignore2
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.project17
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/build.properties7
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.properties43
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.xml34
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.cvsignore2
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.project17
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/build.properties5
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.properties43
-rw-r--r--jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.xml30
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.cvsignore1
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.project22
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/META-INF/MANIFEST.MF7
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.html34
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.ini33
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.mappings6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.properties13
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/build.properties8
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/component.xml7
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/plugin.properties2
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/.project22
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/META-INF/MANIFEST.MF8
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/about.html34
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/build.properties9
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/getting_started.html67
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/reference_project_page.html69
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_20_support.html48
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_configuring_editor.html66
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_manage_entities.html107
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_diagram.html62
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_miniature_view.html43
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_refactor_entities.html105
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_remove_entities.html57
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/toc.html13
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_delete_attribute.gifbin5379 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_editor.gifbin11668 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_entity_operations.gifbin7342 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_miniature_view.gifbin6940 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpaeditor_entity.gifbin1775 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.properties13
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.xml16
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/toc.xml31
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.classpath7
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.cvsignore1
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.project28
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/META-INF/MANIFEST.MF44
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/about.html47
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/build.properties18
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/component.xml1
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/CompoundKey.gifbin923 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/EJB_15x16.gifbin140 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/cmpEntity_obj.gifbin581 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_attribute.gifbin913 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_entity.gifbin1013 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/basic.gifbin897 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embeddable.gifbin1003 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded-id.gifbin953 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded.gifbin905 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity-mappings.gifbin974 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity.gifbin1010 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/id.gifbin938 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-content.gifbin896 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-file.gifbin968 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-1-dir.gifbin933 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-2-dir.gifbin935 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many.gifbin328 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-1-dir.gifbin917 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-2-dir.gifbin923 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one.gifbin307 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/mapped-superclass.gifbin1005 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-attribute-mapping.gifbin911 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-type-mapping.gifbin586 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many-1-dir.gifbin915 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many.gifbin306 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-1-dir.gifbin889 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-2-dir.gifbin896 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one.gifbin283 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence-unit.gifbin931 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence.gifbin961 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/remove_attribute.gifbin918 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/transient.gifbin892 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/version.gifbin321 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/warning.gifbin338 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/restore.gifbin224 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save.gifbin914 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save_and_remove.gifbin905 -> 0 bytes
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.properties31
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.xml149
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/pom.xml16
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java319
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditorPlugin.java129
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/dialog/SelectTypeDialog.java265
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/DisplayFacade.java27
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/EclipseFacade.java47
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/JavaCoreFacade.java29
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/StaticIDE.java38
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAllEntitiesFeature.java180
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java117
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java447
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java295
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java98
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java119
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseAllEntitiesFeature.java84
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseCompartmentShapeFeature.java94
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseEntityFeature.java101
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFeature.java178
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFromMappedSuperclassFeature.java98
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyBiDirRelationFeature.java64
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyRelationFeature.java28
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyUniDirRelationFeature.java56
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneBiDirRelationFeature.java64
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneRelationFeature.java27
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneUniDirRelationFeature.java56
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyRelationFeature.java27
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyUniDirRelationFeature.java58
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneBiDirRelationFeature.java63
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneRelationFeature.java26
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneUniDirRelationFeature.java58
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateRelationFeature.java93
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteJPAEntityFeature.java109
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java136
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java132
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java167
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DiscardAndRemoveAllEntitiesFeature.java65
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandAllEntitiesFeature.java91
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandCompartmentShapeFeature.java114
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandEntityFeature.java108
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java143
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java154
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/JPAMoveConnectionDecoratorFeature.java31
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/LayoutJPAEntityFeature.java227
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveAttributeFeature.java50
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityFeature.java47
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityShapeFeature.java72
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenJPADetailsViewFeature.java52
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenMiniatureViewFeature.java52
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java102
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java363
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAllEntitiesFeature.java65
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java70
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java161
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java131
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveRelationFeature.java136
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityFeature.java48
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityWithoutUIFeature.java45
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeAttributeFeature.java44
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeJPAEntityFeature.java76
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RestoreEntityFeature.java75
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveAndRemoveAllEntitiesFeature.java64
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveEntityFeature.java51
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/UpdateAttributeFeature.java147
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/JPAEditorMessages.java268
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/messages.properties215
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPADiagramEditorInput.java142
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPAEditorMatchingStrategy.java133
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/OpenJpaDiagramActionDelegate.java210
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/CreateDiagramJob.java70
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/IModelIntegrationUtil.java23
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtil.java371
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtilImpl.java26
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferenceInitializer.java77
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferencesPage.java313
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertypage/JPADiagramPropertyPage.java631
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertytester/JpaProjectFacetVersionPropertyTester.java26
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/AddEntityContext.java54
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IAddEntityContext.java26
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java102
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorImageCreator.java49
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorContextMenuProvider.java45
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorDiagramTypeProvider.java317
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java641
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageCreator.java110
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageProvider.java95
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java619
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java127
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/BidirectionalRelation.java30
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java57
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java117
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyRelation.java30
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java79
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java106
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneRelation.java30
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java76
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyRelation.java30
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java77
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java103
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneRelation.java31
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java75
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/UnidirectionalRelation.java26
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntitiesCoordinatesXML.java243
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java199
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdater.java198
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdaterImpl.java26
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IDisplayFacade.java21
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IEclipseFacade.java29
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IGraphicsUpdater.java24
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPADiagramEditorInput.java27
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPAEditorUtil.java75
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJavaCoreFacade.java24
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJpaSolver.java27
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IPeServiceUtil.java35
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IStaticIDE.java24
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPACheckSum.java120
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorConstants.java226
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java1486
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtilImpl.java104
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java1473
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java2285
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/PeServiceUtilImpl.java46
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/ResourceChangeListener.java55
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/SizePosition.java53
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/Wrp.java30
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.classpath12
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.cvsignore1
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.project28
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/META-INF/MANIFEST.MF39
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/about.html34
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/build.properties16
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/plugin.properties14
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/pom.xml42
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/AllJpaEditorTests.java120
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java633
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPAEditorTestsActivator.java61
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/CreateDiagramTest.java63
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/EditorTest.java171
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java188
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddJPAEntityFeatureTest.java277
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddRelationFeatureTest.java329
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/ClickAddFeatureTest.java119
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateDeleteOnlyAttributeTest.java229
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java572
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DeleteRelationFeatureTest.java76
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java114
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/LayoutEntityFeatureTest.java60
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/OpenMiniatureViewFeatureTest.java63
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java96
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java112
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java120
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/UpdateAttributeFeatureTest.java120
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/listener/JPAProjectListenerTest.java147
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/ui/ModelIntegrationTest.java237
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/util/ModelIntegrationUtilTest.java91
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferenceInitializerTest.java38
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferencesPageTest.java86
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java169
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java252
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java620
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java508
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java564
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java122
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/IEditor.java22
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java418
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPASolverTest.java167
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java204
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/URLEscaper.java18
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/test.xml48
3367 files changed, 0 insertions, 599910 deletions
diff --git a/assembly/features/org.eclipse.jpt.assembly.feature/.cvsignore b/assembly/features/org.eclipse.jpt.assembly.feature/.cvsignore
deleted file mode 100644
index de8b73fb72..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.*
diff --git a/assembly/features/org.eclipse.jpt.assembly.feature/.project b/assembly/features/org.eclipse.jpt.assembly.feature/.project
deleted file mode 100644
index 1e211aff8d..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.assembly.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.assembly.feature/build.properties b/assembly/features/org.eclipse.jpt.assembly.feature/build.properties
deleted file mode 100644
index e69de29bb2..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/build.properties
+++ /dev/null
diff --git a/assembly/features/org.eclipse.jpt.assembly.feature/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.assembly.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.assembly.feature/feature.properties b/assembly/features/org.eclipse.jpt.assembly.feature/feature.properties
deleted file mode 100644
index 67207bfc0c..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/feature.properties
+++ /dev/null
@@ -1,50 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - Runtime
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt.assembly.feature/feature.xml b/assembly/features/org.eclipse.jpt.assembly.feature/feature.xml
deleted file mode 100644
index eb5e52803e..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/feature.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.assembly.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <includes
- id="org.eclipse.jpt.common.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.common.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.dbws.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpadiagrameditor.feature"
- version="0.0.0"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.patch/.project b/assembly/features/org.eclipse.jpt.patch/.project
deleted file mode 100644
index b7a2bf552d..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.patch</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.patch/build.properties b/assembly/features/org.eclipse.jpt.patch/build.properties
deleted file mode 100644
index c381fb22bb..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-src.includes = eclipse_update_120.jpg,\
- epl-v10.html,\
- feature.properties,\
- feature.xml,\
- license.html
diff --git a/assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html b/assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html
deleted file mode 100644
index 0d115f43fb..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/buildnotes_org.eclipse.jpt.patch.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Build" content="Build">
- <title>Java Persistence Tools (JTP) 1.0.2 Patches</title>
-</head>
-
-<body>
-
-<h1>JTP 2.0.2 Patches</h1>
-
-<h2>Feature Patched: org.eclipse.jpt.patch</h2>
-<h3>Plugin(s) replaced:</h3>
-<ul><li>org.eclipse.jpt.gen</li></ul>
-<p>Bug <a href='https://bugs.eclipse.org/220297'>220297</a>. Entity generation creates Embeddables with compile errors in some cases.</p>
-
-
-</body></html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.patch/epl-v10.html b/assembly/features/org.eclipse.jpt.patch/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.patch/feature.properties b/assembly/features/org.eclipse.jpt.patch/feature.properties
deleted file mode 100644
index a8457ea0cc..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/feature.properties
+++ /dev/null
@@ -1,143 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence Tools (JTP) Patches
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=\
-Patch(s) for Java Persistence API (JPA) Tools. \n\
-See bug 220297 (https://bugs.eclipse.org/bugs/220297) Entity generation creates Embeddables with compile errors in some cases \n\
-
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-08 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt.patch/feature.xml b/assembly/features/org.eclipse.jpt.patch/feature.xml
deleted file mode 100644
index 4fae92b5fa..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/feature.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.patch"
- label="%featureName"
- version="1.0.2.qualifier"
- provider-name="%providerName">
-
- <description url="http://download.eclipse.org/webtools/patches/">
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <url>
- <update label="Web Tools Platform (WTP) Patches" url="http://download.eclipse.org/webtools/patches/"/>
- </url>
-
- <requires>
- <import feature="org.eclipse.jpt.feature" version="1.0.2.v200802140100-77-7_CYQCD2CaLYCHCD" patch="true"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.patch/license.html b/assembly/features/org.eclipse.jpt.patch/license.html
deleted file mode 100644
index 2347060ef3..0000000000
--- a/assembly/features/org.eclipse.jpt.patch/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>January 28, 2005</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI></UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/assembly/features/org.eclipse.jpt.sdk/.cvsignore b/assembly/features/org.eclipse.jpt.sdk/.cvsignore
deleted file mode 100644
index bc2abf75c1..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.bin.dist.zip
-build.xml
-features
-plugins
diff --git a/assembly/features/org.eclipse.jpt.sdk/.project b/assembly/features/org.eclipse.jpt.sdk/.project
deleted file mode 100644
index 821d453136..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.sdk</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.sdk/build.properties b/assembly/features/org.eclipse.jpt.sdk/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html b/assembly/features/org.eclipse.jpt.sdk/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.sdk/feature.properties b/assembly/features/org.eclipse.jpt.sdk/feature.properties
deleted file mode 100644
index 64b1fab799..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/feature.properties
+++ /dev/null
@@ -1,170 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools project SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools project SDK
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-Eclipse Foundation Software User Agreement\n\
-April 14, 2010\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the\n\
-Eclipse Foundation is provided to you under the terms and conditions of\n\
-the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
-provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse Foundation source code\n\
-repository ("Repository") in software modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
-Update License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties" found within a Feature.\n\
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
-terms and conditions (or references to such terms and conditions) that\n\
-govern your use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-\n\Use of Provisioning Technology\n\
-\n\
-The Eclipse Foundation makes available provisioning software, examples of which include,\n\
-but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
-the purpose of allowing users to install software, documentation, information and/or\n\
-other materials (collectively "Installable Software"). This capability is provided with\n\
-the intent of allowing such users to install, extend and update Eclipse-based products.\n\
-Information about packaging Installable Software is available at\n\
-http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
-\n\
-You may use Provisioning Technology to allow other parties to install Installable Software.\n\
-You shall be responsible for enabling the applicable license agreements relating to the\n\
-Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
-in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
-making it available in accordance with the Specification, you further acknowledge your\n\
-agreement to, and the acquisition of all necessary rights to permit the following:\n\
-\n\
- 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
- the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
- extending or updating the functionality of an Eclipse-based product.\n\
- 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
- Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
- 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
- govern the use of the Installable Software ("Installable Software Agreement") and such\n\
- Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
- with the Specification. Such Installable Software Agreement must inform the user of the\n\
- terms and conditions that govern the Installable Software and must solicit acceptance by\n\
- the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
- indication of agreement by the user, the provisioning Technology will complete installation\n\
- of the Installable Software.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use, and\n\
-re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt.sdk/feature.xml b/assembly/features/org.eclipse.jpt.sdk/feature.xml
deleted file mode 100644
index 28dc74f6c8..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/feature.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.sdk"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <includes
- id="org.eclipse.jpt_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.eclipselink_sdk.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.sdk/license.html b/assembly/features/org.eclipse.jpt.sdk/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/license.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>April 14, 2010</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
- repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
- href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- (&quot;Specification&quot;).</p>
-
-<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
- in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
- Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
- on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
- Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
- the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
- indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-</body>
-</html>
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/.cvsignore b/assembly/features/org.eclipse.jpt.tests.assembly.feature/.cvsignore
deleted file mode 100644
index 2544693f86..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.bin.dist.zip
-build.xml
-org.eclipse.jpt.tests_1.0.0.* \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/.project b/assembly/features/org.eclipse.jpt.tests.assembly.feature/.project
deleted file mode 100644
index f34899cb8b..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests.assembly.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/.settings/org.eclipse.core.resources.prefs b/assembly/features/org.eclipse.jpt.tests.assembly.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 17acb651a8..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:05 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/build.properties b/assembly/features/org.eclipse.jpt.tests.assembly.feature/build.properties
deleted file mode 100644
index e69de29bb2..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/build.properties
+++ /dev/null
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.tests.assembly.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.properties b/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.properties
deleted file mode 100644
index 0f26029475..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.properties
+++ /dev/null
@@ -1,50 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools project Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.xml b/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.xml
deleted file mode 100644
index 9bbdf953d2..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.tests.assembly.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <includes
- id="org.eclipse.jpt.common.tests.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.tests.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.eclipselink.tests.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.tests.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpadiagrameditor.tests.feature"
- version="0.0.0"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.tests/.project b/assembly/features/org.eclipse.jpt.tests/.project
deleted file mode 100644
index c9a282f03f..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests</name>
- <comment>Unused Project</comment>
-</projectDescription> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt/.project b/assembly/features/org.eclipse.jpt/.project
deleted file mode 100644
index 7a69c2f3bf..0000000000
--- a/assembly/features/org.eclipse.jpt/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt</name>
- <comment>Unused Project</comment>
-</projectDescription> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/.cvsignore b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/.cvsignore
deleted file mode 100644
index bc2abf75c1..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.bin.dist.zip
-build.xml
-features
-plugins
diff --git a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/.project b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/.project
deleted file mode 100644
index e901372085..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt_sdk.assembly.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/build.properties b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/build.properties
deleted file mode 100644
index e69de29bb2..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/build.properties
+++ /dev/null
diff --git a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.properties b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.properties
deleted file mode 100644
index afcb117163..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.properties
+++ /dev/null
@@ -1,50 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools project SDK
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.xml b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.xml
deleted file mode 100644
index 91dbc3a498..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt_sdk.assembly.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <includes
- id="org.eclipse.jpt.common_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.common.eclipselink_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.eclipselink_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.eclipselink_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.dbws.eclipselink_sdk.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpadiagrameditor_sdk.feature"
- version="0.0.0"/>
-
-</feature>
diff --git a/assembly/plugins/org.eclipse.jpt/.cvsignore b/assembly/plugins/org.eclipse.jpt/.cvsignore
deleted file mode 100644
index c9401a2c83..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.* \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/.project b/assembly/plugins/org.eclipse.jpt/.project
deleted file mode 100644
index f51b04cc90..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs b/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:09 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF b/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF
deleted file mode 100644
index a5fbedd077..0000000000
--- a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt; singleton:=true
-Bundle-Version: 2.3.1.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/assembly/plugins/org.eclipse.jpt/about.html b/assembly/plugins/org.eclipse.jpt/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/about.ini b/assembly/plugins/org.eclipse.jpt/about.ini
deleted file mode 100644
index 588a325a8f..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/assembly/plugins/org.eclipse.jpt/about.mappings b/assembly/plugins/org.eclipse.jpt/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/about.properties b/assembly/plugins/org.eclipse.jpt/about.properties
deleted file mode 100644
index c74a186a13..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2006. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/assembly/plugins/org.eclipse.jpt/build.properties b/assembly/plugins/org.eclipse.jpt/build.properties
deleted file mode 100644
index 0ccfb0ebb8..0000000000
--- a/assembly/plugins/org.eclipse.jpt/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- eclipse32.png,\
- plugin.properties,\
- component.xml
diff --git a/assembly/plugins/org.eclipse.jpt/component.xml b/assembly/plugins/org.eclipse.jpt/component.xml
deleted file mode 100644
index 11f133f65a..0000000000
--- a/assembly/plugins/org.eclipse.jpt/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt" fragment="false"/>
-<plugin id="org.eclipse.jpt.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.db" fragment="false"/>
-<plugin id="org.eclipse.jpt.db.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.gen" fragment="false"/>
-<plugin id="org.eclipse.jpt.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.utility" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.gif b/assembly/plugins/org.eclipse.jpt/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/assembly/plugins/org.eclipse.jpt/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.png b/assembly/plugins/org.eclipse.jpt/eclipse32.png
deleted file mode 100644
index 568fac1d05..0000000000
--- a/assembly/plugins/org.eclipse.jpt/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jpt/plugin.properties b/assembly/plugins/org.eclipse.jpt/plugin.properties
deleted file mode 100644
index c3c055a778..0000000000
--- a/assembly/plugins/org.eclipse.jpt/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools
-providerName = Eclipse.org
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/.project b/common/features/org.eclipse.jpt.common.eclipselink.feature/.project
deleted file mode 100644
index 04b106dcd1..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/build.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/build.properties
deleted file mode 100644
index 4f50d146f4..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/feature.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/feature.properties
deleted file mode 100644
index 8a0aad2c52..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink Common
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - EclipseLink Common
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/feature.xml b/common/features/org.eclipse.jpt.common.eclipselink.feature/feature.xml
deleted file mode 100644
index 7038a8a5ed..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.common.eclipselink.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.common.eclipselink.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.common.eclipselink.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.common.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.html b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.ini b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.mappings b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 243586dc0f..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - EclipseLink Common Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/build.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 1c3e2eb73b..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/license.html b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/plugin.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 11a79f2639..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink Common
-providerName = Eclipse Web Tools Platform
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/build.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/feature.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 33b324c9b1..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink Common
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools EclipseLink Common
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.html b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.ini b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.mappings b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index b16ba1fbf9..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - EclipseLink Common Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/build.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/license.html b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 11a79f2639..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink Common
-providerName = Eclipse Web Tools Platform
diff --git a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.cvsignore b/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.project b/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.project
deleted file mode 100644
index 0b7335445e..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/build.properties b/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index 6f317aefa0..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.common.eclipselink.feature.source=org.eclipse.jpt.common.eclipselink.feature
diff --git a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.properties b/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index 465b51a640..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink Common SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - EclipseLink Common
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.xml b/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index 04d49b12e6..0000000000
--- a/common/features/org.eclipse.jpt.common.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.common.eclipselink_sdk.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.common.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.common.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/common/features/org.eclipse.jpt.common.feature/.project b/common/features/org.eclipse.jpt.common.feature/.project
deleted file mode 100644
index d3dad03e08..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/common/features/org.eclipse.jpt.common.feature/build.properties b/common/features/org.eclipse.jpt.common.feature/build.properties
deleted file mode 100644
index b6886beb14..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/common/features/org.eclipse.jpt.common.feature/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/feature.properties b/common/features/org.eclipse.jpt.common.feature/feature.properties
deleted file mode 100644
index 05d3200141..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - Common
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - Common
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/common/features/org.eclipse.jpt.common.feature/feature.xml b/common/features/org.eclipse.jpt.common.feature/feature.xml
deleted file mode 100644
index 32c1805e6c..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/feature.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.common.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.common.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <plugin
- id="org.eclipse.jpt.common.utility"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.common.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.common.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.common.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.html b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.ini b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.mappings b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index e40c332da8..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - Common Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/build.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 1c3e2eb73b..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.gif b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.png b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/epl-v10.html b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/license.html b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/plugin.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 5d10675de1..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - Common
-providerName = Eclipse Web Tools Platform
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/build.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/feature.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index c96ff3f69b..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - Common
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools Common
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.html b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.ini b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.mappings b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index e40c332da8..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - Common Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/build.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.gif b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.png b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/epl-v10.html b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/license.html b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/plugin.properties b/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 5d10675de1..0000000000
--- a/common/features/org.eclipse.jpt.common.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - Common
-providerName = Eclipse Web Tools Platform
diff --git a/common/features/org.eclipse.jpt.common.tests.feature/.cvsignore b/common/features/org.eclipse.jpt.common.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/common/features/org.eclipse.jpt.common.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/common/features/org.eclipse.jpt.common.tests.feature/.project b/common/features/org.eclipse.jpt.common.tests.feature/.project
deleted file mode 100644
index 89783a78c1..0000000000
--- a/common/features/org.eclipse.jpt.common.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/common/features/org.eclipse.jpt.common.tests.feature/build.properties b/common/features/org.eclipse.jpt.common.tests.feature/build.properties
deleted file mode 100644
index 34b9c1ac57..0000000000
--- a/common/features/org.eclipse.jpt.common.tests.feature/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/common/features/org.eclipse.jpt.common.tests.feature/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common.tests.feature/feature.properties b/common/features/org.eclipse.jpt.common.tests.feature/feature.properties
deleted file mode 100644
index 54ef2287a3..0000000000
--- a/common/features/org.eclipse.jpt.common.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - Common JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools Common JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/common/features/org.eclipse.jpt.common.tests.feature/feature.xml b/common/features/org.eclipse.jpt.common.tests.feature/feature.xml
deleted file mode 100644
index 70d5612786..0000000000
--- a/common/features/org.eclipse.jpt.common.tests.feature/feature.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.common.tests.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.common.utility.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.common.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/common/features/org.eclipse.jpt.common_sdk.feature/.cvsignore b/common/features/org.eclipse.jpt.common_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/common/features/org.eclipse.jpt.common_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/common/features/org.eclipse.jpt.common_sdk.feature/.project b/common/features/org.eclipse.jpt.common_sdk.feature/.project
deleted file mode 100644
index 24b45742af..0000000000
--- a/common/features/org.eclipse.jpt.common_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/common/features/org.eclipse.jpt.common_sdk.feature/build.properties b/common/features/org.eclipse.jpt.common_sdk.feature/build.properties
deleted file mode 100644
index 1be2ea1e6a..0000000000
--- a/common/features/org.eclipse.jpt.common_sdk.feature/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.common.feature.source=org.eclipse.jpt.common.feature
diff --git a/common/features/org.eclipse.jpt.common_sdk.feature/eclipse_update_120.jpg b/common/features/org.eclipse.jpt.common_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/common/features/org.eclipse.jpt.common_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/common/features/org.eclipse.jpt.common_sdk.feature/feature.properties b/common/features/org.eclipse.jpt.common_sdk.feature/feature.properties
deleted file mode 100644
index 8578168b7a..0000000000
--- a/common/features/org.eclipse.jpt.common_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - Common SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - Common
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/common/features/org.eclipse.jpt.common_sdk.feature/feature.xml b/common/features/org.eclipse.jpt.common_sdk.feature/feature.xml
deleted file mode 100644
index 4433094fa4..0000000000
--- a/common/features/org.eclipse.jpt.common_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.common_sdk.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.common.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.common.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/common/plugins/org.eclipse.jpt.common.branding/.cvsignore b/common/plugins/org.eclipse.jpt.common.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/common/plugins/org.eclipse.jpt.common.branding/.project b/common/plugins/org.eclipse.jpt.common.branding/.project
deleted file mode 100644
index d794011572..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/common/plugins/org.eclipse.jpt.common.branding/META-INF/MANIFEST.MF b/common/plugins/org.eclipse.jpt.common.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 98296d0a02..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.common.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/common/plugins/org.eclipse.jpt.common.branding/about.html b/common/plugins/org.eclipse.jpt.common.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.branding/about.ini b/common/plugins/org.eclipse.jpt.common.branding/about.ini
deleted file mode 100644
index 6c107d466d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/common/plugins/org.eclipse.jpt.common.branding/about.mappings b/common/plugins/org.eclipse.jpt.common.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.branding/about.properties b/common/plugins/org.eclipse.jpt.common.branding/about.properties
deleted file mode 100644
index 5d9827f286..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - Common\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/common/plugins/org.eclipse.jpt.common.branding/build.properties b/common/plugins/org.eclipse.jpt.common.branding/build.properties
deleted file mode 100644
index 6c20e3b027..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties
diff --git a/common/plugins/org.eclipse.jpt.common.branding/component.xml b/common/plugins/org.eclipse.jpt.common.branding/component.xml
deleted file mode 100644
index f437ec94d5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/component.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.common.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.common.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.branding/icons/WTP_icon_x32_v2.png b/common/plugins/org.eclipse.jpt.common.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/common/plugins/org.eclipse.jpt.common.branding/plugin.properties b/common/plugins/org.eclipse.jpt.common.branding/plugin.properties
deleted file mode 100644
index 58b4eea0ab..0000000000
--- a/common/plugins/org.eclipse.jpt.common.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - Common
-providerName = Eclipse Web Tools Platform
diff --git a/common/plugins/org.eclipse.jpt.common.core/.classpath b/common/plugins/org.eclipse.jpt.common.core/.classpath
deleted file mode 100644
index 934fb38085..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/plugins/org.eclipse.jpt.common.core/.cvsignore b/common/plugins/org.eclipse.jpt.common.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/common/plugins/org.eclipse.jpt.common.core/.project b/common/plugins/org.eclipse.jpt.common.core/.project
deleted file mode 100644
index 5513a1552d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/common/plugins/org.eclipse.jpt.common.core/.settings/org.eclipse.jdt.core.prefs b/common/plugins/org.eclipse.jpt.common.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index c84cdadbd2..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Fri Apr 01 17:14:35 EDT 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/common/plugins/org.eclipse.jpt.common.core/META-INF/MANIFEST.MF b/common/plugins/org.eclipse.jpt.common.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 2b26df13ba..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,57 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.common.core;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.common.core.JptCommonCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.pde.core;bundle-version="[3.6.0,4.0.0)";resolution:=optional,
- org.eclipse.text;bundle-version="[3.5.100,4.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,2.0.0)"
-Dali-Comment: We friend 'utility' to all non-EclipseLink, non-test bundles
-Export-Package: org.eclipse.jpt.common.core,
- org.eclipse.jpt.common.core.internal;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.gen;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.libprov;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.libval;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.operations;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.resource;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.resource.java;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.resource.java.binary;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.resource.java.source;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.internal.utility;
- x-friends:="org.eclipse.jpt.common.ui,
- org.eclipse.jpt.jaxb.core,
- org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.core,
- org.eclipse.jpt.jpa.db,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.gen,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.core.internal.utility.jdt;x-friends:="org.eclipse.jpt.jaxb.core,org.eclipse.jpt.jpa.core",
- org.eclipse.jpt.common.core.internal.utility.translators;x-friends:="org.eclipse.jpt.jpa.core,org.eclipse.jpt.jaxb.core",
- org.eclipse.jpt.common.core.libprov,
- org.eclipse.jpt.common.core.libval,
- org.eclipse.jpt.common.core.resource,
- org.eclipse.jpt.common.core.resource.java,
- org.eclipse.jpt.common.core.utility,
- org.eclipse.jpt.common.core.utility.jdt
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/common/plugins/org.eclipse.jpt.common.core/about.html b/common/plugins/org.eclipse.jpt.common.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/common/plugins/org.eclipse.jpt.common.core/build.properties b/common/plugins/org.eclipse.jpt.common.core/build.properties
deleted file mode 100644
index 559c6fab57..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = schema/
diff --git a/common/plugins/org.eclipse.jpt.common.core/plugin.properties b/common/plugins/org.eclipse.jpt.common.core/plugin.properties
deleted file mode 100644
index a38a4a43c3..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/plugin.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Common Core
-providerName = Eclipse Web Tools Platform
-
-LIBRARY_VALIDATORS=Library Validators
-RESOURCE_LOCATORS=Resource Locators
-
-JAR_CONTENT = JAR Content
-JAVA_PACKAGE_INFO_CONTENT = package-info.java
-
-NO_OP_LIBRARY_PROVIDER_WARNING = Library configuration is disabled. The user may need to configure further classpath changes later.
diff --git a/common/plugins/org.eclipse.jpt.common.core/plugin.xml b/common/plugins/org.eclipse.jpt.common.core/plugin.xml
deleted file mode 100644
index 0fe4f7e514..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/plugin.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2011 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="org.eclipse.jpt.common.core.libraryValidators"
- name="%LIBRARY_VALIDATORS"
- schema="schema/libraryValidators.exsd"/>
-
-
- <extension-point
- id="org.eclipse.jpt.common.core.resourceLocators"
- name="%RESOURCE_LOCATORS"
- schema="schema/resourceLocators.exsd"/>
-
-
- <!-- ***** Eclipse core extensions ***** -->
-
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
-
- <!-- JAR content type -->
- <content-type
- id="org.eclipse.jpt.common.core.content.jar"
- name="%JAR_CONTENT"
- file-extensions="jar, zip">
- <describer
- class="org.eclipse.core.runtime.content.BinarySignatureDescriber">
- <parameter name="signature" value="50 4B 03 04"/>
- </describer>
- </content-type>
-
- <!-- package-info.java content type (for package annotations) -->
- <content-type
- id="org.eclipse.jpt.common.core.content.javaPackageInfo"
- name="%JAVA_PACKAGE_INFO_CONTENT"
- base-type="org.eclipse.jdt.core.javaSource"
- file-names="package-info.java"
- priority="normal">
- </content-type>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <factory
- class="org.eclipse.jpt.common.core.internal.ResourceAdapterFactory"
- adaptableType="org.eclipse.core.resources.IResource">
- <adapter type="org.eclipse.jpt.common.core.IResourcePart"/>
- </factory>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
-
- <propertyTester
- id="org.eclipse.jpt.common.core.propertyTester.libraryProvider"
- type="org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider"
- namespace="org.eclipse.jpt.common.core"
- properties="id, extendsId"
- class="org.eclipse.jpt.common.core.internal.libprov.LibraryProviderPropertyTester"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.common.core.resourceLocators">
-
- <resourceLocator
- id="simpleJavaResourceLocator"
- class="org.eclipse.jpt.common.core.internal.resource.SimpleJavaResourceLocator"
- priority="lowest">
- <enablement>
- <with variable="project">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="java"
- forcePluginActivation="true"/>
- </with>
- </enablement>
- </resourceLocator>
-
- <resourceLocator
- id="moduleResourceLocator"
- class="org.eclipse.jpt.common.core.internal.resource.ModuleResourceLocator"
- priority="lower">
- <enablement>
- <with variable="project">
- <test
- property="org.eclipse.core.resources.projectNature"
- value="org.eclipse.wst.common.modulecore.ModuleCoreNature"
- forcePluginActivation="true"/>
- </with>
- </enablement>
- </resourceLocator>
-
- <resourceLocator
- id="webModuleResourceLocator"
- class="org.eclipse.jpt.common.core.internal.resource.WebModuleResourceLocator"
- priority="low">
- <enablement>
- <with variable="project">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web"
- forcePluginActivation="true"/>
- </with>
- </enablement>
- </resourceLocator>
-
- <resourceLocator
- id="pluginResourceLocator"
- class="org.eclipse.jpt.common.core.internal.resource.PluginResourceLocator"
- priority="normal">
- <enablement>
- <with variable="project">
- <test
- property="org.eclipse.core.resources.projectNature"
- value="org.eclipse.pde.PluginNature"
- forcePluginActivation="true"/>
- </with>
- </enablement>
- </resourceLocator>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider
- id="jpt-no-op-library-provider"
- extends="no-op-library-provider"
- abstract="true">
- <param name="warning" value="%NO_OP_LIBRARY_PROVIDER_WARNING"/>
- </provider>
-
- </extension>
-
-</plugin>
diff --git a/common/plugins/org.eclipse.jpt.common.core/property_files/jpt_common_core.properties b/common/plugins/org.eclipse.jpt.common.core/property_files/jpt_common_core.properties
deleted file mode 100644
index e474609500..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/property_files/jpt_common_core.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-DALI_EVENT_HANDLER_THREAD_NAME=Dali Event Handler
-GENERATION_CREATING_LAUNCH_CONFIG_TASK=Creating launch configuration
-GENERATION_SAVING_LAUNCH_CONFIG_TASK=Saving launch configuration
-GENERATION_LAUNCHING_CONFIG_TASK=Launching configuration
-REGISTRY_MISSING_ATTRIBUTE=Missing required attribute ''{0}'' for element ''{1}'' in extension ''{1}'' from plug-in ''{2}''.
-REGISTRY_INVALID_VALUE=Invalid value ''{0}'' for ''{1}'' in extension ''{2}'' from plug-in ''{3}''.
-REGISTRY_DUPLICATE=An extension of ''{0}'' with the ''{1}'' value of ''{2}'' is already registered.
-REGISTRY_FAILED_CLASS_LOAD=Unable to load the class ''{0}'' declared for the extension point ''{1}'' in the plug-in ''{2}''.
-REGISTRY_FAILED_INTERFACE_ASSIGNMENT=Unable to assign the class ''{0}'' declared for the extension point ''{1}'' in the plug-in ''{2}'' to the interface ''{3}''.
-REGISTRY_FAILED_INSTANTIATION=Unable to instantiate the class ''{0}'' declared for the extension point ''{1}'' in the plug-in ''{2}''.
-USER_LIBRARY_VALIDATOR__CLASS_NOT_FOUND=The class ''{0}'' is required to be in the selected libraries.
-VALIDATE_CONTAINER_NOT_SPECIFIED=Parent folder must be specified
-VALIDATE_FILE_NAME_NOT_SPECIFIED=File name must be specified
-VALIDATE_FILE_ALREADY_EXISTS=File already exist \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd b/common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd
deleted file mode 100644
index 52dacbb094..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.common.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.common.core" id="libraryValidators" name="Library Validators"/>
- </appinfo>
- <documentation>
- Used to provide custom library validation to JPT project configuration.
- </documentation>
- </annotation>
-
- <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="libraryValidator" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="libraryValidator">
- <annotation>
- <documentation>
- Declares a library validator. See &lt;samp&gt;org.eclipse.jpt.common.core.libval.LibraryValidator&lt;/samp&gt; for more information on library validators.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="enablement" minOccurs="0" maxOccurs="1"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- A unique identifier for the declared library validator.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The implementation class, which implements &lt;samp&gt;org.eclipse.jpt.common.core.libval.LibraryValidator&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.core.libval.LibraryValidator"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- JPT 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;
-The following example is the included generic library validator, which is used for user library validation for projects of the generic JPA platform group.
-&lt;p&gt;
-&lt;pre&gt;
-&lt;extension
- point=&quot;org.eclipse.jpt.common.core.libraryValidators&quot;&gt;
- &lt;libraryValidator
- id=&quot;genericUserLibraryValidator&quot;
- class=&quot;org.eclipse.jpt.core.internal.libval.GenericJpaUserLibraryValidator&quot;&gt;
- &lt;enablement&gt;
- &lt;with variable=&quot;libraryProvider&quot;&gt;
- &lt;test property=&quot;org.eclipse.jpt.core.extendsId&quot; value=&quot;jpa-user-library-provider&quot;/&gt;
- &lt;/with&gt;
- &lt;/enablement&gt;
- &lt;/libraryValidator&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- &lt;p&gt;
-The enablement variables include:
-&lt;ul&gt;
-&lt;li&gt;&quot;libraryProvider&quot; which gives the current ILibraryProvider.&lt;/li&gt;
-&lt;li&gt;&quot;config&quot; which gives the current JptLibraryProviderInstallOperationConfig.&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2010, 2011 Oracle. All rights reserved.
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0, which accompanies this distribution
-and is available at http://www.eclipse.org/legal/epl-v10.html.
-
-Contributors:
-Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/common/plugins/org.eclipse.jpt.common.core/schema/resourceLocators.exsd b/common/plugins/org.eclipse.jpt.common.core/schema/resourceLocators.exsd
deleted file mode 100644
index 5eaf59b07a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/schema/resourceLocators.exsd
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.common.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.common.core" id="resourceLocators" name="Resource Locators"/>
- </appinfo>
- <documentation>
- Used to provide custom (non-java) resource location logic to JPT projects.
- </documentation>
- </annotation>
-
- <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="resourceLocator" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="resourceLocator">
- <annotation>
- <documentation>
- Declares a resource locator. See &lt;samp&gt;org.eclipse.jpt.common.core.resource.ResourceLocator&lt;/samp&gt; for more information on resource locators.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="enablement" minOccurs="0" maxOccurs="1"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- A unique identifier for the declared resource locator.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The implementation class, which implements &lt;samp&gt;org.eclipse.jpt.common.core.resource.ResourceLocator&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.common.core.resource.ResourceLocator"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="priority">
- <annotation>
- <documentation>
- Indicates the relative priority of this extension to other extensions. Used by the resource locator manager to determine which extension should be used in the case that multiple extensions apply to a given project. Defaults to &quot;normal&quot;.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="lowest">
- </enumeration>
- <enumeration value="lower">
- </enumeration>
- <enumeration value="low">
- </enumeration>
- <enumeration value="normal">
- </enumeration>
- <enumeration value="high">
- </enumeration>
- <enumeration value="higher">
- </enumeration>
- <enumeration value="highest">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- JPT 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;
-The following example is the included simple java resource locator, which is used for simple java projects. It is of &quot;lowest&quot; priority, since all JPT projects will at their roots be simple java projects.
-&lt;p&gt;
-&lt;pre&gt;
-&lt;extension
- point=&quot;org.eclipse.jpt.common.core.resourceLocators&quot;&gt;
- &lt;resourceLocator
- id=&quot;simpleJavaResourceLocator&quot;
- class=&quot;org.eclipse.jpt.common.core.internal.resource.SimpleJavaResourceLocator&quot;
- priority=&quot;lowest&quot;
- &lt;enablement&gt;
- &lt;with variable=&quot;project&quot;&gt;
- &lt;test property=&quot;org.eclipse.wst.common.project.facet.core.projectFacet&quot; value=&quot;java&quot; forcePluginActivation=&quot;true&quot;/&gt;
- &lt;/with&gt;
- &lt;/enablement&gt;
- &lt;/resourceLocator&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- &lt;p&gt;
-The contributed resource locator class must implement &lt;code&gt;org.eclipse.jpt.co9mmon.core.resource.ResourceLocator&lt;/code&gt;.
-&lt;p&gt;
-The enablement variables include:
-&lt;ul&gt;
-&lt;li&gt;&quot;project&quot; which gives the current IProject.&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- &lt;p&gt;The org.eclipse.jpt.common.core plug-in provides the following resource locators:
-&lt;ul&gt;
-&lt;li&gt;simpleJavaResourceLocator&lt;/li&gt;
-&lt;li&gt;moduleResourceLocator&lt;/li&gt;
-&lt;li&gt;webModuleResourceLocator&lt;/li&gt;
-&lt;li&gt;pluginResourceLocator&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2011 Oracle. All rights reserved.
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0, which accompanies this distribution
-and is available at http://www.eclipse.org/legal/epl-v10.html.
-
-Contributors:
-Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/AnnotationProvider.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/AnnotationProvider.java
deleted file mode 100644
index 5551329f03..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/AnnotationProvider.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-
-/**
- * This is used to provide annotations and nestable annotations. An exception will
- * be thrown on an attempt to build an annotation that does not exist.
- *
- * This interface is not intended to be implemented.
- *
- * @version 3.0
- * @since 3.0
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AnnotationProvider {
-
- /**
- * Return the names of the annotations.
- */
- Iterable<String> getAnnotationNames();
-
- Iterable<String> getContainerAnnotationNames();
-
- Iterable<String> getNestableAnnotationNames();
-
- String getNestableAnnotationName(String containerAnnotationName);
-
- String getContainerAnnotationName(String nestableAnnotationName);
-
- String getNestableElementName(String nestableAnnotationName);
-
- /**
- * Build an annotation with the specified name.
- * Throw an IllegalArgumentException if the specified name is unsupported.
- * @see #getAnnotationNames()
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName);
-
- /**
- * Build a nestable annotation with the specified name and index.
- * Throw an IllegalArgumentException if the specified name is unsupported.
- * @see #getNestableAnnotationNames()
- */
- NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName, int index);
-
- /**
- * Build an annotation for the specified JDT annotation.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #getAnnotationNames()
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation);
-
- /**
- * Build a nestable annotation for the specified JDT annotation and index.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #getNestableAnnotationNames()
- */
- NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index);
-
- /**
- * Build a null annotation with the specified name.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #getAnnotationNames()
- */
- Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent, String annotationName);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/GenericAnnotationProvider.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/GenericAnnotationProvider.java
deleted file mode 100644
index 3eee738f74..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/GenericAnnotationProvider.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-/**
- * Delegate to annotation definition providers.
- * The platform factory will build an instance of this annotation provider,
- * passing in the appropriate array of annotation definition providers necessary
- * to build the annotations for the platform (vendor and/or version).
- */
-public final class GenericAnnotationProvider
- implements AnnotationProvider
-{
- private final AnnotationDefinition[] annotationDefinitions;
-
- private final NestableAnnotationDefinition[] nestableAnnotationDefinitions;
-
- public GenericAnnotationProvider(AnnotationDefinition[] annotationDefinitions, NestableAnnotationDefinition[] nestableAnnotationDefinitions) {
- super();
- this.annotationDefinitions = annotationDefinitions;
- this.nestableAnnotationDefinitions = nestableAnnotationDefinitions;
- }
-
-
- protected Iterable<AnnotationDefinition> getAnnotationDefinitions() {
- return new ArrayIterable<AnnotationDefinition>(this.annotationDefinitions);
- }
-
- protected AnnotationDefinition getAnnotationDefinition(String annotationName) {
- for (AnnotationDefinition annotationDefinition : this.annotationDefinitions) {
- if (annotationDefinition.getAnnotationName().equals(annotationName)) {
- return annotationDefinition;
- }
- }
- return null;
- }
-
- public Iterable<String> getAnnotationNames() {
- return new TransformationIterable<AnnotationDefinition, String>(getAnnotationDefinitions()) {
- @Override
- protected String transform(AnnotationDefinition annotationDefinition) {
- return annotationDefinition.getAnnotationName();
- }
- };
- }
-
- public Iterable<String> getContainerAnnotationNames() {
- return new TransformationIterable<NestableAnnotationDefinition, String>(getNestableAnnotationDefinitions()) {
- @Override
- protected String transform(NestableAnnotationDefinition annotationDefinition) {
- return annotationDefinition.getContainerAnnotationName();
- }
- };
- }
-
- public Iterable<String> getNestableAnnotationNames() {
- return new TransformationIterable<NestableAnnotationDefinition, String>(getNestableAnnotationDefinitions()) {
- @Override
- protected String transform(NestableAnnotationDefinition annotationDefinition) {
- return annotationDefinition.getNestableAnnotationName();
- }
- };
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName) {
- return this.getAnnotationDefinition(annotationName).buildAnnotation(parent, element);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return this.getAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return this.getNestableAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation, index);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent, String annotationName) {
- return this.getAnnotationDefinition(annotationName).buildNullAnnotation(parent);
- }
-
- protected Iterable<NestableAnnotationDefinition> getNestableAnnotationDefinitions() {
- return new ArrayIterable<NestableAnnotationDefinition>(this.nestableAnnotationDefinitions);
- }
-
- protected NestableAnnotationDefinition getNestableAnnotationDefinition(String annotationName) {
- for (NestableAnnotationDefinition annotationDefinition : this.nestableAnnotationDefinitions) {
- if (annotationDefinition.getNestableAnnotationName().equals(annotationName)) {
- return annotationDefinition;
- }
- }
- return null;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName, int index) {
- return this.getNestableAnnotationDefinition(annotationName).buildAnnotation(parent, element, index);
- }
-
- public String getNestableAnnotationName(String containerAnnotationName) {
- return getNestableAnnotationDefinitionForContainer(containerAnnotationName).getNestableAnnotationName();
- }
-
- public String getContainerAnnotationName(String nestableAnnotationName) {
- return getNestableAnnotationDefinition(nestableAnnotationName).getContainerAnnotationName();
- }
-
- public String getNestableElementName(String nestableAnnotationName) {
- return getNestableAnnotationDefinition(nestableAnnotationName).getElementName();
- }
-
- private NestableAnnotationDefinition getNestableAnnotationDefinitionForContainer(String containerAnnotationName) {
- for (NestableAnnotationDefinition nestableAnnotationDefinition : getNestableAnnotationDefinitions()) {
- if (nestableAnnotationDefinition.getContainerAnnotationName().equals(containerAnnotationName)) {
- return nestableAnnotationDefinition;
- }
- }
- return null;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/IResourcePart.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/IResourcePart.java
deleted file mode 100644
index e5e6a4251a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/IResourcePart.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core;
-
-import org.eclipse.core.resources.IResource;
-
-
-/**
- * Represents an object that can be described as being part of an {@link IResource}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface IResourcePart
-{
- /**
- * Return the resource of which this object is a part
- */
- IResource getResource();
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptCommonCorePlugin.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptCommonCorePlugin.java
deleted file mode 100644
index 1dfc996b70..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptCommonCorePlugin.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.internal.libval.LibraryValidatorManager;
-import org.eclipse.jpt.common.core.internal.resource.ResourceLocatorManager;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.core.resource.ResourceLocator;
-import org.osgi.framework.BundleContext;
-
-public class JptCommonCorePlugin
- extends Plugin
-{
-
- // ********** public constants **********
-
- /**
- * The plug-in identifier of the jpt common core support
- * (value <code>"org.eclipse.jpt.common.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.common.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
-
- /**
- * The content type for Java source code files.
- */
- public static final IContentType JAVA_SOURCE_CONTENT_TYPE = getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE);
-
- /**
- * The resource type for Java source code files
- */
- public static final JptResourceType JAVA_SOURCE_RESOURCE_TYPE = new JptResourceType(JAVA_SOURCE_CONTENT_TYPE);
-
- /**
- * The content type for Java archives (JARs).
- */
- public static final IContentType JAR_CONTENT_TYPE = getJptContentType("jar"); //$NON-NLS-1$
-
- /**
- * The resource type for Java archives (JARs).
- */
- public static final JptResourceType JAR_RESOURCE_TYPE = new JptResourceType(JptCommonCorePlugin.JAR_CONTENT_TYPE);
-
- /**
- * The content type for package-info Java code files.
- */
- public static final IContentType JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE = getJptContentType("javaPackageInfo"); //$NON-NLS-1$
-
- /**
- * The resource type for package-info Java code files
- */
- public static final JptResourceType JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE = new JptResourceType(JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE);
-
-
- private static final String JPT_CONTENT_PREFIX = PLUGIN_ID_ + "content"; //$NON-NLS-1$
-
- private static final String JPT_CONTENT_PREFIX_ = JPT_CONTENT_PREFIX + '.';
-
- private static IContentType getJptContentType(String jptContentType) {
- return getContentType(JPT_CONTENT_PREFIX_ + jptContentType);
- }
-
- private static IContentType getContentType(String contentType) {
- return Platform.getContentTypeManager().getContentType(contentType);
- }
-
- public static ResourceLocator getResourceLocator(IProject project) {
- return ResourceLocatorManager.instance().getResourceLocator(project);
- }
-
- public static IFile getPlatformFile(IProject project, IPath runtimePath) {
- ResourceLocator resourceLocator = getResourceLocator(project);
- if (resourceLocator == null) {
- return null;
- }
- IPath sourcePath = resourceLocator.getResourcePath(project, runtimePath);
- if (sourcePath == null) {
- return null;
- }
- return project.getWorkspace().getRoot().getFile(sourcePath);
- }
-
- public static Iterable<LibraryValidator> getLibraryValidators(
- JptLibraryProviderInstallOperationConfig config) {
- return LibraryValidatorManager.instance().getLibraryValidators(config);
- }
-
- // ********** singleton **********
-
- private static JptCommonCorePlugin INSTANCE;
-
- /**
- * Return the singleton jpt common core plug-in.
- */
- public static JptCommonCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void log(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
-
- // ********** plug-in implementation **********
-
- public JptCommonCorePlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // nothing yet...
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- // nothing yet...
- }
-
-}
-
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModel.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModel.java
deleted file mode 100644
index d43f22cc7c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core;
-
-/**
- * Listeners are notified whenever anything in the JPT resource model changes.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.2
- */
-public interface JptResourceModel {
-
- /**
- * Return the resource type of the model. This may potentially change.
- * Return null if it cannot be determined, the content type or version is null.
- */
- JptResourceType getResourceType();
-
- /**
- * Changes to the resource model result in events.
- * In particular, the JPA project performs an "update" whenever a resource
- * model changes.
- */
- void addResourceModelListener(JptResourceModelListener listener);
-
- /**
- * @see #addResourceModelListener(JptResourceModelListener)
- */
- void removeResourceModelListener(JptResourceModelListener listener);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModelListener.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModelListener.java
deleted file mode 100644
index a0d0d3f046..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceModelListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core;
-
-import java.util.EventListener;
-
-/**
- * The listener is notified whenever anything in the JPA resource model changes.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.2
- */
-public interface JptResourceModelListener
- extends EventListener
-{
- void resourceModelChanged(JptResourceModel jpaResourceModel);
-
- void resourceModelReverted(JptResourceModel jpaResourceModel);
-
- void resourceModelUnloaded(JptResourceModel jpaResourceModel);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceType.java
deleted file mode 100644
index e86355e266..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/JptResourceType.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core;
-
-import org.eclipse.core.runtime.content.IContentType;
-
-/**
- * Describes the file content type and version for JPA resources.
- * This is a value object that defines an {@link #equals(Object)} method.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public class JptResourceType
-{
- private final IContentType contentType;
-
- private final String version;
-
-
- /**
- * Version used when version can not be determined or when there is no
- * sense of version (e.g. Java).
- */
- public static final String UNDETERMINED_VERSION = "<undetermined>"; //$NON-NLS-1$
-
-
- public JptResourceType(IContentType contentType) {
- this(contentType, UNDETERMINED_VERSION);
- }
-
- public JptResourceType(IContentType contentType, String version) {
- super();
- if (contentType == null) {
- throw new NullPointerException("content type"); //$NON-NLS-1$
- }
- if (version == null) {
- throw new NullPointerException("version"); //$NON-NLS-1$
- }
- this.contentType = contentType;
- this.version = version;
- }
-
-
- public IContentType getContentType() {
- return this.contentType;
- }
-
- public String getVersion() {
- return this.version;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if ((obj == null) || (obj.getClass() != this.getClass())) {
- return false;
- }
- JptResourceType other = (JptResourceType) obj;
- return this.contentType.equals(other.contentType) && this.version.equals(other.version);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int hash = 17;
- hash = hash * prime + this.contentType.hashCode();
- hash = hash * prime + this.version.hashCode();
- return hash;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.getClass().getSimpleName());
- sb.append("(content = "); //$NON-NLS-1$
- sb.append(this.contentType);
- sb.append(", "); //$NON-NLS-1$
- sb.append("version = "); //$NON-NLS-1$
- sb.append(this.version);
- sb.append(')');
- return sb.toString();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptCommonCoreMessages.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptCommonCoreMessages.java
deleted file mode 100644
index b962c61115..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/JptCommonCoreMessages.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali common core.
- */
-public class JptCommonCoreMessages {
-
- public static String DALI_EVENT_HANDLER_THREAD_NAME;
- public static String GENERATION_CREATING_LAUNCH_CONFIG_TASK;
- public static String GENERATION_SAVING_LAUNCH_CONFIG_TASK;
- public static String GENERATION_LAUNCHING_CONFIG_TASK;
- public static String REGISTRY_MISSING_ATTRIBUTE;
- public static String REGISTRY_INVALID_VALUE;
- public static String REGISTRY_DUPLICATE;
- public static String REGISTRY_FAILED_CLASS_LOAD;
- public static String REGISTRY_FAILED_INTERFACE_ASSIGNMENT;
- public static String REGISTRY_FAILED_INSTANTIATION;
- public static String USER_LIBRARY_VALIDATOR__CLASS_NOT_FOUND;
- public static String VALIDATE_CONTAINER_NOT_SPECIFIED;
- public static String VALIDATE_FILE_NAME_NOT_SPECIFIED;
- public static String VALIDATE_FILE_ALREADY_EXISTS;
-
- private static final String BUNDLE_NAME = "jpt_common_core"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptCommonCoreMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptCommonCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/ResourceAdapterFactory.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/ResourceAdapterFactory.java
deleted file mode 100644
index 6514e060f1..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/ResourceAdapterFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.common.core.IResourcePart;
-
-/**
- * Factory to build adapters for converting Eclipse resources to Dali
- * resource parts.
- * <p>
- * See <code>org.eclipse.jpt.common.core plugin.xml</code>.
- */
-public class ResourceAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { IResourcePart.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IResource) {
- return this.getAdapter((IResource) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(final IResource resource, Class <?>adapterType) {
- if (adapterType == IResourcePart.class) {
- return new IResourcePart() {
- public IResource getResource() {
- return resource;
- }
- };
- }
- return null;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
deleted file mode 100644
index 0d3a9b4f47..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/gen/AbstractJptGenerator.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.common.core.internal.gen;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
-import org.eclipse.osgi.service.datalocation.Location;
-import org.osgi.framework.Bundle;
-
-public abstract class AbstractJptGenerator
-{
- public static final String PLUGINS_DIR = "plugins/"; //$NON-NLS-1$
-
- private IVMInstall jre;
- protected ILaunchConfigurationWorkingCopy launchConfig;
- private ILaunch launch;
-
- protected final IJavaProject javaProject;
- protected final String projectLocation;
-
- private final boolean isDebug = false;
-
- // ********** constructors **********
-
- protected AbstractJptGenerator(IJavaProject javaProject) {
- super();
- this.javaProject = javaProject;
- this.projectLocation = javaProject.getProject().getLocation().toString();
- this.initialize();
- }
-
- // ********** abstract methods **********
-
- protected abstract String getMainType();
-
- protected abstract String getLaunchConfigName();
-
- protected String getBootstrapJarPrefix() {
- throw new RuntimeException("Bootstrap JAR not specified."); //$NON-NLS-1$;
- }
-
- protected abstract void specifyProgramArguments();
-
- protected abstract List<String> buildClasspath() throws CoreException;
-
- // ********** behavior **********
-
- protected void initialize() {
- try {
- this.jre = this.getProjectJRE();
- if (this.jre == null) {
- String message = "Could not identify the VM."; //$NON-NLS-1$
- throw new RuntimeException(message);
- }
- this.launchConfig = this.buildLaunchConfiguration();
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- protected void generate(IProgressMonitor monitor) {
- SubMonitor sm = SubMonitor.convert(monitor, 10);
- this.preGenerate(sm.newChild(2));
- if (sm.isCanceled()) {
- throw new OperationCanceledException();
- }
- sm.subTask(JptCommonCoreMessages.GENERATION_CREATING_LAUNCH_CONFIG_TASK);
- this.initializeLaunchConfiguration();
- sm.worked(1);
- if (sm.isCanceled()) {
- throw new OperationCanceledException();
- }
-
- this.addLaunchListener();
- sm.worked(1);
-
- if (sm.isCanceled()) {
- throw new OperationCanceledException();
- }
- this.launch = this.saveAndLaunchConfig(sm.newChild(6));
- }
-
- private void initializeLaunchConfiguration() {
- this.specifyJRE();
-
- this.specifyProject();
- this.specifyMainType();
-
- this.specifyProgramArguments();
- this.specifyWorkingDir();
-
- this.specifyClasspathProperties();
- }
-
- private void addLaunchListener() {
-
- this.getLaunchManager().addLaunchListener(this.buildLaunchListener());
- }
-
- protected abstract void preGenerate(IProgressMonitor monitor);
-
- protected void postGenerate() {
- try {
- if( ! this.isDebug) {
- this.removeLaunchConfiguration();
- }
- }
- catch(CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- private ILaunchesListener2 buildLaunchListener() {
- return new ILaunchesListener2() {
-
- public void launchesTerminated(ILaunch[] launches) {
- for(int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- if (launch.equals(AbstractJptGenerator.this.getLaunch())) {
-
- AbstractJptGenerator.this.postGenerate();
- return;
- }
- }
- }
-
- public void launchesAdded(ILaunch[] launches) {
- // not interested to this event
- }
-
- public void launchesChanged(ILaunch[] launches) {
- // not interested to this event
- }
-
- public void launchesRemoved(ILaunch[] launches) {
- // not interested to this event
- }
- };
- }
-
- // ********** Setting Launch Configuration **********
-
- protected void specifyJRE() {
- String jreName = this.jre.getName();
- String vmId = this.jre.getVMInstallType().getId();
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreName);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmId);
- }
-
- private void specifyProject() {
- String projectName = this.getProject().getName();
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
- }
-
- protected IProject getProject() {
- return this.javaProject.getProject();
- }
-
- private void specifyMainType() {
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, this.getMainType());
- }
-
- protected void specifyClasspathProperties() {
- List<String> classpath;
- try {
- classpath = this.buildClasspath();
- }
- catch (CoreException e) {
- throw new RuntimeException("An error occured generating a memento", e); //$NON-NLS-1$
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
- }
-
- // ********** ClasspathEntry **********
-
- protected IRuntimeClasspathEntry getSystemLibraryClasspathEntry() throws CoreException {
-
- IPath systemLibsPath = new Path(JavaRuntime.JRE_CONTAINER);
- return JavaRuntime.newRuntimeContainerClasspathEntry(systemLibsPath, IRuntimeClasspathEntry.STANDARD_CLASSES);
- }
-
- protected IRuntimeClasspathEntry getDefaultProjectClasspathEntry() {
-
- IRuntimeClasspathEntry projectEntry = JavaRuntime.newDefaultProjectClasspathEntry(this.javaProject);
- projectEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
-
- return projectEntry;
- }
-
- protected static IRuntimeClasspathEntry getArchiveClasspathEntry(IPath archivePath) {
- IRuntimeClasspathEntry archiveEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(archivePath);
- archiveEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
-
- return archiveEntry;
- }
-
-
- // ********** LaunchConfig **********
-
- private ILaunch saveAndLaunchConfig(IProgressMonitor monitor) {
- SubMonitor sm = SubMonitor.convert(monitor, 10);
- ILaunchConfiguration configuration = null;
- ILaunch result = null;
- try {
- sm.subTask(JptCommonCoreMessages.GENERATION_SAVING_LAUNCH_CONFIG_TASK);
- configuration = this.launchConfig.doSave();
- }
- catch (CoreException saveException) {
- throw new RuntimeException("Could not save LaunchConfig", saveException); //$NON-NLS-1$
- }
- sm.worked(1);
- if (sm.isCanceled()) {
- throw new OperationCanceledException();
- }
- try {
- sm.subTask(JptCommonCoreMessages.GENERATION_LAUNCHING_CONFIG_TASK);
- result = configuration.launch(ILaunchManager.RUN_MODE, sm.newChild(9));
- }
- catch (CoreException launchException) {
- throw new RuntimeException("An error occured during launch", launchException); //$NON-NLS-1$
- }
- return result;
- }
-
- // ********** Main arguments **********
-
- protected void appendDebugArgument(StringBuffer sb) {
- if (this.isDebug) {
- sb.append(" -debug"); //$NON-NLS-1$
- }
- }
-
- // ********** Queries **********
-
- protected ILaunch getLaunch() {
- return this.launch;
- }
-
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- private IVMInstall getProjectJRE() throws CoreException {
- return JavaRuntime.getVMInstall(this.javaProject);
- }
-
- // ********** Utilities **********
-
- protected IRuntimeClasspathEntry getBootstrapJarClasspathEntry() {
- return getArchiveClasspathEntry(this.buildBootstrapJarPath());
- }
-
- protected IPath buildBootstrapJarPath() {
- return this.findGenJarStartingWith(this.getBootstrapJarPrefix());
- }
-
- protected IPath findGenJarStartingWith(String genJarName) {
- try {
- File jarInstallDir = this.getBundleParentDir(JptCommonCorePlugin.PLUGIN_ID);
-
- List<File> result = new ArrayList<File>();
- this.findFileStartingWith(genJarName, jarInstallDir, result);
- if (result.isEmpty()) {
- throw new RuntimeException("Could not find: " + genJarName + "#.#.#v###.jar in: " + jarInstallDir); //$NON-NLS-1$ //$NON-NLS-2$
- }
- File genJarFile = result.get(0);
- String genJarPath = genJarFile.getCanonicalPath();
- return new Path(genJarPath);
- }
- catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** private methods **********
-
- private File getBundleParentDir(String bundleName) throws IOException {
-
- if (Platform.inDevelopmentMode()) {
- Location eclipseHomeLoc = Platform.getInstallLocation();
- String eclipseHome = eclipseHomeLoc.getURL().getPath();
- if ( ! eclipseHome.endsWith(PLUGINS_DIR)) {
- eclipseHome += PLUGINS_DIR;
- }
- return new File(eclipseHome);
- }
- Bundle bundle = Platform.getBundle(bundleName);
- return FileLocator.getBundleFile(bundle).getParentFile();
- }
-
- private ILaunchConfigurationWorkingCopy buildLaunchConfiguration() throws CoreException {
- this.removeLaunchConfiguration();
-
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
-
- return type.newInstance(null, this.getLaunchConfigName());
- }
-
- private void removeLaunchConfiguration() throws CoreException {
-
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
-
- ILaunchConfiguration[] configurations = manager.getLaunchConfigurations(type);
- for (int i = 0; i < configurations.length; i++) {
- ILaunchConfiguration configuration = configurations[i];
- if (configuration.getName().equals(this.getLaunchConfigName())) {
- configuration.delete();
- break;
- }
- }
- }
-
- private void findFileStartingWith(String fileName, File directory, List<? super File> list) {
- if(directory.listFiles() == null) {
- throw new RuntimeException("Could not find directory: " + directory); //$NON-NLS-1$
- }
- for (File file : directory.listFiles()) {
- if (file.getName().startsWith(fileName)) {
- list.add(file);
- }
- if (file.isDirectory()) {
- this.findFileStartingWith(fileName, file, list);
- }
- }
- }
-
- private void specifyWorkingDir() {
- File workingDir = new Path(this.projectLocation).toFile();
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, workingDir.getAbsolutePath());
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index b91c73b440..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptOsgiBundlesLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.libprov;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperationConfig;
-
-
-public abstract class JptOsgiBundlesLibraryProviderInstallOperationConfig
- extends WtpOsgiBundlesLibraryProviderInstallOperationConfig
- implements JptLibraryProviderInstallOperationConfig {
-
- protected JptOsgiBundlesLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- @Override
- public synchronized IStatus validate() {
- IStatus status = super.validate();
- if (! status.isOK()) {
- return status;
- }
-
- for (LibraryValidator libraryValidator : JptCommonCorePlugin.getLibraryValidators(this)) {
- status = libraryValidator.validate(this);
- if (! status.isOK()) {
- return status;
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 224f52afe2..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/JptUserLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.libprov;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperationConfig;
-
-
-public abstract class JptUserLibraryProviderInstallOperationConfig
- extends WtpUserLibraryProviderInstallOperationConfig
- implements JptLibraryProviderInstallOperationConfig {
-
- protected JptUserLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- @Override
- public synchronized IStatus validate() {
- IStatus status = super.validate();
- if (! status.isOK()) {
- return status;
- }
-
- for (LibraryValidator libraryValidator : JptCommonCorePlugin.getLibraryValidators(this)) {
- status = libraryValidator.validate(this);
- if (! status.isOK()) {
- return status;
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/LibraryProviderPropertyTester.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/LibraryProviderPropertyTester.java
deleted file mode 100644
index e3bb569eed..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libprov/LibraryProviderPropertyTester.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.libprov;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-
-public class LibraryProviderPropertyTester
- extends PropertyTester {
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (! (property.equals("id") || property.equals("extendsId")) //$NON-NLS-1$ //$NON-NLS-2$
- || ! (receiver instanceof ILibraryProvider)
- || ! (expectedValue instanceof String)) {
- return false;
- }
-
- ILibraryProvider libraryProvider = (ILibraryProvider) receiver;
-
- if (property.equals("id")) { //$NON-NLS-1$
- return libraryProvider.getId().equals(expectedValue);
- }
- else if (property.equals("extendsId")) { //$NON-NLS-1$
- while (libraryProvider != null) {
- if (libraryProvider.getId().equals(expectedValue)) {
- return true;
- }
- libraryProvider = libraryProvider.getBaseProvider();
- }
- }
-
- return false;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibValUtil.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibValUtil.java
deleted file mode 100644
index 34afb0c83b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibValUtil.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.libval;
-
-import static org.eclipse.jst.common.project.facet.core.internal.FacetedProjectFrameworkJavaPlugin.PLUGIN_ID;
-import java.io.File;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
-import org.eclipse.osgi.util.NLS;
-
-
-public class LibValUtil {
-
- public static IStatus validate(Iterable<IPath> libraryPaths, Set<String> classNames) {
- Set<String> classFileNames = new HashSet<String>();
- Map<String,String> classFileNameToClassName = new HashMap<String,String>();
- for (String className : classNames) {
- String classFileName = className.replace('.', '/') + ".class"; //$NON-NLS-1$
- classFileNames.add(classFileName);
- classFileNameToClassName.put(classFileName, className);
- }
-
- final Map<String,Integer> classAppearanceCounts = new HashMap<String,Integer>();
-
- for (String classFileName : classFileNames) {
- classAppearanceCounts.put(classFileName, 0);
- }
-
- for (IPath libraryPath : libraryPaths) {
- final File file = libraryPath.toFile();
-
- if (file.exists()) {
- ZipFile zip = null;
-
- try {
- zip = new ZipFile(file);
-
- for (Enumeration<? extends ZipEntry> itr = zip.entries(); itr.hasMoreElements(); ) {
- final ZipEntry zipEntry = itr.nextElement();
- final String name = zipEntry.getName();
-
- Integer count = classAppearanceCounts.get(name);
-
- if (count != null) {
- classAppearanceCounts.put(name, count + 1);
- }
- }
- }
- catch (IOException e) {}
- finally {
- if (zip != null) {
- try {
- zip.close();
- }
- catch (IOException e) {}
- }
- }
- }
- }
-
- for (Map.Entry<String,Integer> entry : classAppearanceCounts.entrySet()) {
- final int count = entry.getValue();
-
- if (count == 0) {
- final String classFileName = entry.getKey();
- final String className = classFileNameToClassName.get(classFileName);
- final String message =
- NLS.bind(JptCommonCoreMessages.USER_LIBRARY_VALIDATOR__CLASS_NOT_FOUND, className);
- return new Status(IStatus.ERROR, PLUGIN_ID, message);
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java
deleted file mode 100644
index 27a84ae9ba..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorConfig.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.libval;
-
-import static org.eclipse.jst.common.project.facet.core.internal.FacetedProjectFrameworkJavaPlugin.log;
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.EvaluationResult;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-
-public class LibraryValidatorConfig {
-
- public static final String CONFIG_EXPR_VAR = "config"; //$NON-NLS-1$
- public static final String LIBRARY_PROVIDER_EXPR_VAR = "libraryProvider"; //$NON-NLS-1$
-
-
- private String id;
- private String pluginId;
- private String className;
- private Expression enablementCondition;
-
-
- LibraryValidatorConfig() {
- super();
- }
-
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getClassName() {
- return this.className;
- }
-
- void setClassName(String className) {
- this.className = className;
- }
-
- public Expression getEnablementCondition() {
- return this.enablementCondition;
- }
-
- void setEnablementCondition(Expression enablementCondition) {
- this.enablementCondition = enablementCondition;
- }
-
- public LibraryValidator getLibraryValidator() {
- return XPointTools.instantiate(
- this.pluginId, LibraryValidatorManager.QUALIFIED_EXTENSION_POINT_ID,
- this.className, LibraryValidator.class);
- }
-
- public boolean isEnabledFor(JptLibraryProviderInstallOperationConfig config) {
- EvaluationContext evalContext = new EvaluationContext(null, config);
- evalContext.setAllowPluginActivation(true);
- evalContext.addVariable(CONFIG_EXPR_VAR, config);
- evalContext.addVariable(LIBRARY_PROVIDER_EXPR_VAR, config.getLibraryProvider());
-
- if (this.enablementCondition != null) {
- try {
- EvaluationResult evalResult = this.enablementCondition.evaluate(evalContext);
-
- if (evalResult == EvaluationResult.FALSE) {
- return false;
- }
- }
- catch (CoreException e) {
- log(e);
- }
- }
-
- return true;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorManager.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorManager.java
deleted file mode 100644
index ce7c2eb179..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/libval/LibraryValidatorManager.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.libval;
-
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.ExpressionConverter;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.utility.internal.KeyedSet;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-public class LibraryValidatorManager {
-
- public static final String EXTENSION_POINT_ID = "libraryValidators"; //$NON-NLS-1$
- public static final String QUALIFIED_EXTENSION_POINT_ID = JptCommonCorePlugin.PLUGIN_ID_ + EXTENSION_POINT_ID;
- public static final String LIBRARY_VALIDATOR_ELEMENT = "libraryValidator"; //$NON-NLS-1$
- public static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
- public static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
- public static final String ENABLEMENT_ELEMENT = "enablement"; //$NON-NLS-1$
-
-
- private static LibraryValidatorManager INSTANCE = new LibraryValidatorManager();
-
-
- public static LibraryValidatorManager instance() {
- return INSTANCE;
- }
-
-
- private KeyedSet<String, LibraryValidatorConfig> libraryValidatorConfigs;
-
-
- private LibraryValidatorManager() {
- this.libraryValidatorConfigs = new KeyedSet<String, LibraryValidatorConfig>();
- readExtensions();
- }
-
-
- /**
- * Return the {@link LibraryValidator}s
- */
- public Iterable<LibraryValidator> getLibraryValidators(final JptLibraryProviderInstallOperationConfig config) {
- return new FilteringIterable<LibraryValidator>(
- new TransformationIterable<LibraryValidatorConfig, LibraryValidator>(
- new FilteringIterable<LibraryValidatorConfig>(
- this.libraryValidatorConfigs.getItemSet()) {
- @Override
- protected boolean accept(LibraryValidatorConfig o) {
- return o.isEnabledFor(config);
- }
- }) {
- @Override
- protected LibraryValidator transform(LibraryValidatorConfig o) {
- return o.getLibraryValidator();
- }
- }) {
- @Override
- protected boolean accept(LibraryValidator o) {
- return o != null;
- }
- };
- }
-
- private void readExtensions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint xpoint
- = registry.getExtensionPoint(QUALIFIED_EXTENSION_POINT_ID);
-
- if (xpoint == null) {
- throw new IllegalStateException();
- }
-
- final List<IConfigurationElement> configs = new ArrayList<IConfigurationElement>();
-
- for (IExtension extension : xpoint.getExtensions()) {
- for (IConfigurationElement element : extension.getConfigurationElements()) {
- configs.add(element);
- }
- }
-
- for (IConfigurationElement element : configs) {
- if (element.getName().equals(LIBRARY_VALIDATOR_ELEMENT)) {
- readExtension(element);
- }
- }
- }
-
- private void readExtension(IConfigurationElement element) {
- try {
- final LibraryValidatorConfig lvConfig = new LibraryValidatorConfig();
-
- // plug-in id
- lvConfig.setPluginId(element.getContributor().getName());
-
- // resource locator id
- lvConfig.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.libraryValidatorConfigs.containsKey(lvConfig.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, lvConfig.getId());
- throw new XPointException();
- }
-
- // resource locator class name
- lvConfig.setClassName(findRequiredAttribute(element, CLASS_ATTRIBUTE));
-
- // enablement
- for (IConfigurationElement child : element.getChildren()) {
- String childName = child.getName();
- if (childName.equals(ENABLEMENT_ELEMENT)) {
- Expression expr;
- try {
- expr = ExpressionConverter.getDefault().perform(child);
- }
- catch (CoreException e) {
- log(e);
- throw new XPointException();
- }
- lvConfig.setEnablementCondition(expr);
- }
- }
-
- this.libraryValidatorConfigs.addItem(lvConfig.getId(), lvConfig);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java
deleted file mode 100644
index e15e98011a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/AbstractJptFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.operations;
-
-import java.util.Set;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public abstract class AbstractJptFileCreationDataModelProvider
- extends AbstractDataModelProvider
- implements JptFileCreationDataModelProperties
-{
- protected AbstractJptFileCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public Set<String> getPropertyNames() {
- @SuppressWarnings("unchecked")
- Set<String> propertyNames = super.getPropertyNames();
- propertyNames.add(PROJECT);
- propertyNames.add(CONTAINER_PATH);
- propertyNames.add(FILE_NAME);
- return propertyNames;
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(CONTAINER_PATH)) {
- IContainer sourceLocation = getDefaultContainer();
- if (sourceLocation != null && sourceLocation.exists()) {
- return sourceLocation.getFullPath();
- }
- }
- else if (propertyName.equals(FILE_NAME)) {
- return getDefaultFileName();
- }
- return super.getDefaultProperty(propertyName);
- }
-
- protected abstract String getDefaultFileName();
-
-
- // **************** validation *********************************************
-
- @Override
- public IStatus validate(String propertyName) {
- IStatus status = Status.OK_STATUS;
- if (propertyName.equals(CONTAINER_PATH)
- || propertyName.equals(FILE_NAME)) {
- status = validateContainerPathAndFileName();
- }
- if (! status.isOK()) {
- return status;
- }
-
- return status;
- }
-
- protected IStatus validateContainerPathAndFileName() {
- IContainer container = getContainer();
- if (container == null) {
- // verifies container has been specified, but should be unnecessary in most cases.
- // there is almost always a default, and the new file wizard does this validation as well.
- return new Status(
- IStatus.ERROR, JptCommonCorePlugin.PLUGIN_ID,
- JptCommonCoreMessages.VALIDATE_CONTAINER_NOT_SPECIFIED);
- }
- String fileName = getStringProperty(FILE_NAME);
- if (StringTools.stringIsEmpty(fileName)) {
- // verifies file name has been specified, but should be unnecessary in most cases.
- // there is almost always a default, and the new file wizard does this validation as well.
- return new Status(
- IStatus.ERROR, JptCommonCorePlugin.PLUGIN_ID,
- JptCommonCoreMessages.VALIDATE_FILE_NAME_NOT_SPECIFIED);
- }
- if (container.getFile(new Path(fileName)).exists()) {
- // verifies file does not exist, but should be unnecessary in most cases.
- // the new file wizard does this validation as well.
- return new Status(
- IStatus.ERROR, JptCommonCorePlugin.PLUGIN_ID,
- JptCommonCoreMessages.VALIDATE_FILE_ALREADY_EXISTS);
- }
- return Status.OK_STATUS;
- }
-
-
- // **************** helper methods *****************************************
-
- protected IPath getContainerPath() {
- return (IPath) this.model.getProperty(CONTAINER_PATH);
- }
-
- protected IContainer getContainer() {
- IPath containerPath = getContainerPath();
- if (containerPath == null) {
- return null;
- }
- return PlatformTools.getContainer(containerPath);
- }
-
- protected IProject getProject() {
- return getProject(getContainer());
- }
-
- protected IProject getProject(IContainer container) {
- return (container == null) ? null : container.getProject();
- }
-
- /**
- * Return a best guess source location for the for the specified project
- */
- protected IContainer getDefaultContainer() {
- IProject project = (IProject) this.model.getProperty(PROJECT);
- if (project != null) {
- return JptCommonCorePlugin.getResourceLocator(project).getDefaultResourceLocation(project);
- }
- return null;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/JptFileCreationDataModelProperties.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/JptFileCreationDataModelProperties.java
deleted file mode 100644
index 5c635c98c8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/operations/JptFileCreationDataModelProperties.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.operations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-
-public interface JptFileCreationDataModelProperties
-{
- /**
- * Optional, type {@link IProject}, gives a clue as to the default container path
- */
- String PROJECT = "JptFileCreationDataModelProperties.PROJECT"; //$NON-NLS-1$
-
- /**
- * Required, type {@link IPath}, identifies the full path to the container in which
- * the file should be created
- */
- String CONTAINER_PATH = "JptFileCreationDataModelProperties.CONTAINER_PATH"; //$NON-NLS-1$
-
- /**
- * Required, type {@link String}, identifies the file name
- */
- String FILE_NAME = "JptFileCreationDataModelProperties.FILE_NAME"; //$NON-NLS-1$
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java
deleted file mode 100644
index 104081ec57..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ModuleResourceLocator.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class ModuleResourceLocator
- extends SimpleJavaResourceLocator {
-
- /**
- * Return the folder representing the "META-INF" runtime location
- */
- @Override
- public IContainer getDefaultResourceLocation(IProject project) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- return component.getRootFolder().getFolder(META_INF_PATH).getUnderlyingFolder();
- }
-
- @Override
- public IPath getResourcePath(IProject project, IPath runtimePath) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- return component.getRootFolder().getFile(runtimePath).getWorkspaceRelativePath();
- }
-
- @Override
- public IPath getRuntimePath(IProject project, IPath resourcePath) {
- IFile file = PlatformTools.getFile(resourcePath);
- IVirtualComponent component = ComponentCore.createComponent(project);
- IVirtualFolder root = component.getRootFolder();
- IVirtualFile vFile = findVirtualFile(root, file);
- if (vFile != null) {
- return vFile.getRuntimePath().makeRelative();
- }
- // couldn't find it. try the super-case
- return super.getRuntimePath(project, resourcePath);
- }
-
- private IVirtualFile findVirtualFile(IVirtualFolder vFolder, IFile file) {
- try {
- for (IVirtualResource vResource : vFolder.members()) {
- if (vResource.getType() == IVirtualResource.FILE) {
- IVirtualFile vFile = (IVirtualFile) vResource;
- if (file.equals(vFile.getUnderlyingResource())) {
- return vFile;
- }
- }
- else if (vResource.getType() == IVirtualResource.FOLDER) {
- IVirtualFile vFile = findVirtualFile((IVirtualFolder) vResource, file);
- if (vFile != null) {
- return vFile;
- }
- }
- }
- }
- catch (CoreException ce) {
- // fall through
- JptCommonCorePlugin.log(ce);
- }
- return null;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java
deleted file mode 100644
index 4dcd3fd221..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/PluginResourceLocator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.pde.core.project.IBundleProjectDescription;
-import org.eclipse.pde.core.project.IBundleProjectService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-public class PluginResourceLocator
- extends SimpleJavaResourceLocator {
-
- @Override
- public IContainer getDefaultResourceLocation(IProject project) {
- try {
- IContainer root = getBundleRoot(project);
- return root.getFolder(META_INF_PATH);
- }
- catch (CoreException ce) {
- // fall through
- JptCommonCorePlugin.log(ce);
- }
- return super.getDefaultResourceLocation(project);
- }
-
- @Override
- public IPath getResourcePath(IProject project, IPath runtimePath) {
- try {
- IContainer root = getBundleRoot(project);
- IPath resourcePath = root.getFullPath().append(runtimePath);
- if (project.getWorkspace().getRoot().getFile(resourcePath).exists()) {
- return resourcePath;
- }
- }
- catch (CoreException ce) {
- // fall through
- JptCommonCorePlugin.log(ce);
- }
- return super.getResourcePath(project, runtimePath);
- }
-
- @Override
- public IPath getRuntimePath(IProject project, IPath resourcePath) {
- IFile file = PlatformTools.getFile(resourcePath);
- try {
- IContainer root = getBundleRoot(project);
- if (root.contains(file)) {
- return resourcePath.makeRelativeTo(root.getFullPath());
- }
- }
- catch (CoreException ce) {
- // fall through
- JptCommonCorePlugin.log(ce);
- }
- return super.getRuntimePath(project, resourcePath);
- }
-
- protected IContainer getBundleRoot(IProject project)
- throws CoreException {
-
- IBundleProjectService service = getBundleProjectService();
- IBundleProjectDescription description = service.getDescription(project);
- IPath path = description.getBundleRoot();
- return (path == null) ? project : project.getFolder(path);
- }
-
- protected IBundleProjectService getBundleProjectService() {
- BundleContext context = JptCommonCorePlugin.instance().getBundle().getBundleContext();
- ServiceReference<IBundleProjectService> reference = context.getServiceReference(IBundleProjectService.class);
- if (reference == null) {
- return null;
- }
- IBundleProjectService service = context.getService(reference);
- if (service != null) {
- context.ungetService(reference);
- }
- return service;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java
deleted file mode 100644
index 22a1b192af..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorConfig.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource;
-
-import static org.eclipse.jst.common.project.facet.core.internal.FacetedProjectFrameworkJavaPlugin.log;
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.EvaluationResult;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools;
-import org.eclipse.jpt.common.core.resource.ResourceLocator;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-public class ResourceLocatorConfig
- implements Comparable<ResourceLocatorConfig> {
-
- public static final String PROJECT_ENABLEMENT_VARIABLE = "project"; //$NON-NLS-1$
-
- private String id;
- private String pluginId;
- private String className;
- private Priority priority;
- private Expression enablementCondition;
-
-
- ResourceLocatorConfig() {
- super();
- }
-
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getClassName() {
- return this.className;
- }
-
- void setClassName(String className) {
- this.className = className;
- }
-
- public Priority getPriority() {
- return this.priority;
- }
-
- void setPriority(Priority priority) {
- this.priority = priority;
- }
-
- public Expression getEnablementCondition() {
- return this.enablementCondition;
- }
-
- void setEnablementCondition(Expression enablementCondition) {
- this.enablementCondition = enablementCondition;
- }
-
- public ResourceLocator getResourceLocator() {
- return XPointTools.instantiate(
- this.pluginId, ResourceLocatorManager.QUALIFIED_EXTENSION_POINT_ID,
- this.className, ResourceLocator.class);
- }
-
- public boolean isEnabledFor(IProject project) {
- EvaluationContext evalContext = new EvaluationContext(null, project);
- evalContext.setAllowPluginActivation(true);
- evalContext.addVariable(PROJECT_ENABLEMENT_VARIABLE, project);
-
- if (this.enablementCondition != null) {
- try {
- EvaluationResult evalResult = this.enablementCondition.evaluate(evalContext);
-
- if (evalResult == EvaluationResult.FALSE) {
- return false;
- }
- }
- catch (CoreException e) {
- log(e);
- }
- }
-
- return true;
- }
-
- public int compareTo(ResourceLocatorConfig other) {
- return Priority.compare(this.priority, other.priority);
- }
-
-
- public static enum Priority {
-
- /* The lowest priority for a resource locator */
- LOWEST(6, "lowest"), //$NON-NLS-1$
-
- /* The second lowest priority for a resource locator */
- LOWER(5, "lower"), //$NON-NLS-1$
-
- /* The third lowest priority for a resource locator */
- LOW(4, "low"), //$NON-NLS-1$
-
- /* The default priority for a resource locator */
- NORMAL(3, "normal"), //$NON-NLS-1$
-
- /* The third highest priority for a resource locator */
- HIGH(2, "high"), //$NON-NLS-1$
-
- /* The second highest priority for a resource locator */
- HIGHER(1, "higher"), //$NON-NLS-1$
-
- /* The highest priority for a resource locator */
- HIGHEST(0, "highest"); //$NON-NLS-1$
-
-
- public static int compare(Priority priority1, Priority priority2) {
- return priority1.value.compareTo(priority2.value);
- }
-
- public static Priority get(String literal) {
- if (literal == null) {
- return NORMAL;
- }
- for (Priority priority : values()) {
- if (StringTools.stringsAreEqual(literal, priority.literal)) {
- return priority;
- }
- }
- return null;
- }
-
-
- private Integer value;
- private String literal;
-
-
- private Priority(int value, String literal) {
- this.value = Integer.valueOf(value);
- this.literal = literal;
- }
-
-
- @Override
- public String toString() {
- return this.literal;
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorManager.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorManager.java
deleted file mode 100644
index 51fb9d5820..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/ResourceLocatorManager.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource;
-
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.findRequiredAttribute;
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.log;
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.logDuplicateExtension;
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.logInvalidValue;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.TreeSet;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.ExpressionConverter;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.resource.ResourceLocatorConfig.Priority;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
-import org.eclipse.jpt.common.core.resource.ResourceLocator;
-import org.eclipse.jpt.common.utility.internal.KeyedSet;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-public class ResourceLocatorManager {
-
- public static final String EXTENSION_POINT_ID = "resourceLocators"; //$NON-NLS-1$
- public static final String QUALIFIED_EXTENSION_POINT_ID = JptCommonCorePlugin.PLUGIN_ID_ + EXTENSION_POINT_ID;
- public static final String RESOURCE_LOCATOR_ELEMENT = "resourceLocator"; //$NON-NLS-1$
- public static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
- public static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
- public static final String PRIORITY_ATTRIBUTE = "priority"; //$NON-NLS-1$
- public static final String ENABLEMENT_ELEMENT = "enablement"; //$NON-NLS-1$
-
-
- private static ResourceLocatorManager INSTANCE = new ResourceLocatorManager();
-
-
- public static ResourceLocatorManager instance() {
- return INSTANCE;
- }
-
-
- private KeyedSet<String, ResourceLocatorConfig> resourceLocatorConfigs;
-
-
- private ResourceLocatorManager() {
- this.resourceLocatorConfigs = new KeyedSet<String, ResourceLocatorConfig>();
- readExtensions();
- }
-
-
- /**
- * Return the {@link ResourceLocator} of highest priority that is acceptable
- * for the given project
- */
- public ResourceLocator getResourceLocator(final IProject project) {
- Iterator<ResourceLocator> stream = new FilteringIterable<ResourceLocator>(
- new TransformationIterable<ResourceLocatorConfig, ResourceLocator>(
- new FilteringIterable<ResourceLocatorConfig>(
- new TreeSet<ResourceLocatorConfig>(this.resourceLocatorConfigs.getItemSet())) {
- @Override
- protected boolean accept(ResourceLocatorConfig o) {
- return o.isEnabledFor(project);
- }
- }) {
- @Override
- protected ResourceLocator transform(ResourceLocatorConfig o) {
- return o.getResourceLocator();
- }
- }) {
- @Override
- protected boolean accept(ResourceLocator o) {
- return o != null;
- }
- }.iterator();
- return (stream.hasNext()) ? stream.next() : null;
- }
-
- private void readExtensions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint xpoint
- = registry.getExtensionPoint(QUALIFIED_EXTENSION_POINT_ID);
-
- if (xpoint == null) {
- throw new IllegalStateException();
- }
-
- final List<IConfigurationElement> configs = new ArrayList<IConfigurationElement>();
-
- for (IExtension extension : xpoint.getExtensions()) {
- for (IConfigurationElement element : extension.getConfigurationElements()) {
- configs.add(element);
- }
- }
-
- for (IConfigurationElement element : configs) {
- if (element.getName().equals(RESOURCE_LOCATOR_ELEMENT)) {
- readExtension(element);
- }
- }
- }
-
- private void readExtension(IConfigurationElement element) {
- try {
- final ResourceLocatorConfig rlConfig = new ResourceLocatorConfig();
-
- // plug-in id
- rlConfig.setPluginId(element.getContributor().getName());
-
- // resource locator id
- rlConfig.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.resourceLocatorConfigs.containsKey(rlConfig.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, rlConfig.getId());
- throw new XPointException();
- }
-
- // resource locator class name
- rlConfig.setClassName(findRequiredAttribute(element, CLASS_ATTRIBUTE));
-
- // priority
- String priorityString = element.getAttribute(PRIORITY_ATTRIBUTE).trim();
- Priority priority = Priority.get(priorityString);
- if (priority == null) {
- logInvalidValue(element, PRIORITY_ATTRIBUTE, priorityString);
- throw new XPointException();
- }
- rlConfig.setPriority(priority);
-
- // enablement
- for (IConfigurationElement child : element.getChildren()) {
- String childName = child.getName();
- if (childName.equals(ENABLEMENT_ELEMENT)) {
- Expression expr;
- try {
- expr = ExpressionConverter.getDefault().perform(child);
- }
- catch (CoreException e) {
- log(e);
- throw new XPointException();
- }
- rlConfig.setEnablementCondition(expr);
- }
- }
-
- this.resourceLocatorConfigs.addItem(rlConfig.getId(), rlConfig);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java
deleted file mode 100644
index 2050f09006..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/SimpleJavaResourceLocator.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.resource.ResourceLocator;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-
-public class SimpleJavaResourceLocator
- implements ResourceLocator {
-
- protected static IPath META_INF_PATH = new Path(J2EEConstants.META_INF);
-
- /**
- * Simply ensure the container is either:
- * - on the java project classpath
- * or
- * - in the non-java resources, but not in the project output location
- */
- public boolean acceptResourceLocation(IProject project, IContainer container) {
- IJavaProject javaProject = getJavaProject(project);
- if (javaProject.isOnClasspath(container)) {
- return true;
- }
- try {
- IPath outputLocation = javaProject.getOutputLocation();
- if (container.equals(project) && outputLocation.isPrefixOf(container.getFullPath())) {
- return true;
- }
- for (Object resource : javaProject.getNonJavaResources()) {
- if (resource instanceof IFolder) {
- IFolder folder = (IFolder) resource;
- if ((folder.equals(container) || folder.contains(container))
- && ! outputLocation.isPrefixOf(container.getFullPath())) {
- return true;
- }
- }
- }
- }
- catch (JavaModelException jme) {
- JptCommonCorePlugin.log(jme);
- // only happens if the java project doesn't exist. fall through.
- }
- return false;
- }
-
- /**
- * Return
- * - the first package fragment root (source folder) META-INF folder if it exists,
- * or
- * - the project rooted META-INF folder if it exists
- * or
- * - the non-existent META-INF folder in the first package fragment root (source folder)
- */
- public IContainer getDefaultResourceLocation(IProject project) {
- IJavaProject javaProject = getJavaProject(project);
- IContainer defaultLocation = null;
- try {
- for (IPackageFragmentRoot root : javaProject.getPackageFragmentRoots()) {
- if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
- IContainer rootContainer = (IContainer) root.getUnderlyingResource();
- IFolder metaInfFolder = rootContainer.getFolder(META_INF_PATH);
- if (metaInfFolder.exists()) {
- return metaInfFolder;
- }
- if (defaultLocation == null) {
- // hold on to this in case the META-INF folder can't be found
- defaultLocation = metaInfFolder;
- }
- }
- }
- IFolder metaInfFolder = project.getFolder(META_INF_PATH);
- if (metaInfFolder.exists()) {
- return metaInfFolder;
- }
- }
- catch (JavaModelException jme) {
- // only happens if the java project doesn't exist or there is some problem with the
- // java resources. fall through.
- JptCommonCorePlugin.log(jme);
- }
-
- return defaultLocation;
- }
-
- public IPath getResourcePath(IProject project, IPath runtimePath) {
- IJavaProject javaProject = getJavaProject(project);
- IPath firstResourcePath = null;
- try {
- for (IPackageFragmentRoot root : javaProject.getPackageFragmentRoots()) {
- if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
- IContainer rootContainer = (IContainer) root.getUnderlyingResource();
- IPath resourcePath = rootContainer.getFullPath().append(runtimePath);
- if (firstResourcePath == null) {
- firstResourcePath = resourcePath;
- }
- IFile file = project.getWorkspace().getRoot().getFile(resourcePath);
- if (file.exists()) {
- return file.getFullPath();
- }
- }
- }
- }
- catch (JavaModelException jme) {
- JptCommonCorePlugin.log(jme);
- return null;
- }
- return firstResourcePath;
- }
-
- public IPath getRuntimePath(IProject project, IPath resourcePath) {
- IJavaProject javaProject = getJavaProject(project);
- IFile file = PlatformTools.getFile(resourcePath);
- try {
- for (IPackageFragmentRoot root : javaProject.getPackageFragmentRoots()) {
- if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
- IContainer rootContainer = (IContainer) root.getUnderlyingResource();
- if (rootContainer.contains(file)) {
- return resourcePath.makeRelativeTo(rootContainer.getFullPath());
- }
- }
- }
- }
- catch (JavaModelException jme) {
- // fall through
- JptCommonCorePlugin.log(jme);
- }
- return resourcePath.makeRelativeTo(project.getFullPath());
- }
-
- private IJavaProject getJavaProject(IProject project) {
- return JavaCore.create(project);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/WebModuleResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/WebModuleResourceLocator.java
deleted file mode 100644
index a7fffe7e8c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/WebModuleResourceLocator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-
-public class WebModuleResourceLocator
- extends ModuleResourceLocator{
-
- protected static IPath WEB_INF_CLASSES_PATH = new Path(J2EEConstants.WEB_INF_CLASSES);
-
- /**
- * Return the folder representing the "WEB-INF/classes/META-INF" location
- */
- @Override
- public IContainer getDefaultResourceLocation(IProject project) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- return component.getRootFolder().getFolder(WEB_INF_CLASSES_PATH.append(META_INF_PATH)).getUnderlyingFolder();
- }
-
- /**
- * Return the full resource path representing the given runtime location appended
- * to the "WEB-INF/classes" location
- */
- @Override
- public IPath getResourcePath(IProject project, IPath runtimePath) {
- return super.getResourcePath(project, WEB_INF_CLASSES_PATH.append(runtimePath));
- }
-
- /**
- *
- */
- @Override
- public IPath getRuntimePath(IProject project, IPath resourcePath) {
- IPath runtimePath = super.getRuntimePath(project, resourcePath);
- if (WEB_INF_CLASSES_PATH.isPrefixOf(runtimePath)) {
- return runtimePath.makeRelativeTo(WEB_INF_CLASSES_PATH);
- }
- return runtimePath;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/AbstractJavaResourceNode.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/AbstractJavaResourceNode.java
deleted file mode 100644
index d5aad36057..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/AbstractJavaResourceNode.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.AspectChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-
-/**
- * Java resource containment hierarchy
- */
-public abstract class AbstractJavaResourceNode
- extends AbstractModel
- implements JavaResourceNode
-{
- protected final JavaResourceNode parent;
-
-
- // ********** constructor **********
-
- protected AbstractJavaResourceNode(JavaResourceNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
- public JavaResourceNode getParent() {
- return this.parent;
- }
-
- // ********** parent **********
-
- protected void checkParent(JavaResourceNode p) {
- if (p == null) {
- if (this.requiresParent()) {
- throw new IllegalArgumentException("'parent' cannot be null"); //$NON-NLS-1$
- }
- } else {
- if (this.forbidsParent()) {
- throw new IllegalArgumentException("'parent' must be null"); //$NON-NLS-1$
- }
- }
- }
-
- protected boolean requiresParent() {
- return true;
- }
-
- protected boolean forbidsParent() {
- return ! this.requiresParent(); // assume 'parent' is not optional
- }
-
-
- // ********** change support callback hook **********
-
- @Override
- protected final ChangeSupport buildChangeSupport() {
- return new AspectChangeSupport(this, this.buildChangeSupportListener());
- }
-
- private AspectChangeSupport.Listener buildChangeSupportListener() {
- return new AspectChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractJavaResourceNode.this.aspectChanged(aspectName);
- }
- };
- }
-
- /**
- * ignore the aspect name, we notify listeners of *every* change
- */
- protected void aspectChanged(@SuppressWarnings("unused") String aspectName) {
- this.getRoot().resourceModelChanged();
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- /**
- * @see org.eclipse.jpt.common.core.internal.resource.java.source.core.internal.resource.java.source.SourceCompilationUnit#getRoot()
- * @see org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryPackageFragmentRoot#getRoot()
- * @see org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryTypeCache#getRoot()
- */
- public Root getRoot() {
- return this.parent.getRoot();
- }
-
- public IFile getFile() {
- return this.getRoot().getFile();
- }
-
-
- // ********** convenience methods **********
-
- protected AnnotationProvider getAnnotationProvider() {
- return this.getRoot().getAnnotationProvider();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/NullAnnotation.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/NullAnnotation.java
deleted file mode 100644
index 5a7e7b775e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/NullAnnotation.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Simplify null annotation classes
- */
-public abstract class NullAnnotation<A extends Annotation>
- extends AbstractJavaResourceNode
- implements Annotation
-{
-
- protected NullAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isMappingAnnotation() {
- return false;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void moveAnnotation(int index) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isUnset() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Convenience method: Cast the annotation's parent to a
- * persistent member.
- */
- protected JavaResourceAnnotatedElement getAnnotatedElement() {
- return (JavaResourceAnnotatedElement) this.parent;
- }
-
- /**
- * Convenience method: Add the type or attribute's annotation
- * and return it.
- * Pre-condition: The annotation's parent must be a persistent member
- * (type or attribute).
- */
- protected A addAnnotation() {
- return this.addAnnotation_();
- }
-
- @SuppressWarnings("unchecked")
- protected A addAnnotation_() {
- return (A) this.getAnnotatedElement().addAnnotation(this.getAnnotationName());
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAbstractType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAbstractType.java
deleted file mode 100644
index fa594465fd..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAbstractType.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeParameter;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-
-/**
- * binary persistent type
- */
-abstract class BinaryAbstractType
- extends BinaryMember
- implements JavaResourceAbstractType
-{
- private String name;
-
- private String qualifiedName;
-
- private String packageName;
-
- private String declaringTypeName;
-
- private boolean memberType;
-
-
- // ********** construction/initialization **********
-
- protected BinaryAbstractType(JavaResourceNode parent, IType type) {
- super(parent, new TypeAdapter(type));
- this.name = this.buildName();
- this.qualifiedName = this.buildQualifiedName();
- this.packageName = this.buildPackageName();
- this.declaringTypeName = this.buildDeclaringTypeName();
- this.memberType = this.buildMemberType();
- }
-
-
- // ********** overrides **********
-
- @Override
- public void update() {
- super.update();
- this.setName(this.buildName());
- this.setQualifiedName(this.buildQualifiedName());
- this.setPackageName(this.buildPackageName());
- this.setDeclaringTypeName(this.buildDeclaringTypeName());
- this.setMemberType(this.buildMemberType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** JavaResourceAbstractType implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return this.getMember().getElementName();
- }
-
- // ***** qualified name
- public String getQualifiedName() {
- return this.qualifiedName;
- }
-
- private void setQualifiedName(String qualifiedName) {
- String old = this.qualifiedName;
- this.qualifiedName = qualifiedName;
- this.firePropertyChanged(QUALIFIED_NAME_PROPERTY, old, qualifiedName);
- }
-
- private String buildQualifiedName() {
- return this.getMember().getFullyQualifiedName('.'); // no parameters are included here
- }
-
- // ***** package
- public String getPackageName() {
- return this.packageName;
- }
-
- private void setPackageName(String packageName) {
- String old = this.packageName;
- this.packageName = packageName;
- this.firePropertyChanged(PACKAGE_NAME_PROPERTY, old, packageName);
- }
-
- private String buildPackageName() {
- return this.getMember().getPackageFragment().getElementName();
- }
-
- public boolean isIn(IPackageFragment packageFragment) {
- return StringTools.stringsAreEqual(packageFragment.getElementName(), this.packageName);
- }
-
- // ***** source folder
- public boolean isIn(IPackageFragmentRoot sourceFolder) {
- return getSourceFolder().equals(sourceFolder);
- }
-
- private IPackageFragmentRoot getSourceFolder() {
- return (IPackageFragmentRoot) this.getMember().getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
-
- // ***** declaring type name
- public String getDeclaringTypeName() {
- return this.declaringTypeName;
- }
-
- private void setDeclaringTypeName(String declaringTypeName) {
- String old = this.declaringTypeName;
- this.declaringTypeName = declaringTypeName;
- this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, declaringTypeName);
- }
-
- private String buildDeclaringTypeName() {
- IType declaringType = this.getMember().getDeclaringType();
- return (declaringType == null) ? null : declaringType.getFullyQualifiedName('.'); // no parameters are included here
- }
-
-
- // ***** member
- public boolean isMemberType() {
- return this.memberType;
- }
-
- private void setMemberType(boolean memberType) {
- boolean old = this.memberType;
- this.memberType = memberType;
- this.firePropertyChanged(MEMBER_TYPE_PROPERTY, old, memberType);
- }
-
- private boolean buildMemberType() {
- try {
- return this.getMember().isMember();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public IType getMember() {
- return (IType) super.getMember();
- }
-
- public Iterable<JavaResourceType> getTypes() {
- throw new UnsupportedOperationException();
- }
-
- public Iterable<JavaResourceEnum> getEnums() {
- throw new UnsupportedOperationException();
- }
-
- public Iterable<JavaResourceType> getAllTypes() {
- throw new UnsupportedOperationException();
- }
-
- public Iterable<JavaResourceEnum> getAllEnums() {
- throw new UnsupportedOperationException();
- }
-
- // ********** IType adapter **********
-
- static class TypeAdapter
- implements Adapter {
-
- private final IType type;
-
- TypeAdapter(IType type) {
- super();
- this.type = type;
- }
-
- public IType getElement() {
- return this.type;
- }
-
- public Iterable<ITypeParameter> getTypeParameters() {
- try {
- return new ArrayIterable<ITypeParameter>(this.type.getTypeParameters());
- }
- catch (JavaModelException jme) {
- JptCommonCorePlugin.log(jme);
- }
- return EmptyIterable.instance();
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.type.getAnnotations();
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotatedElement.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotatedElement.java
deleted file mode 100644
index 293156f479..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotatedElement.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMemberValuePair;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-/**
- * binary annotated element
- */
-abstract class BinaryAnnotatedElement
- extends BinaryNode
- implements JavaResourceAnnotatedElement
-{
- /** JDT annotated element adapter */
- final Adapter adapter;
-
- /** annotations */
- final Vector<Annotation> annotations = new Vector<Annotation>();
-
- /**
- * Annotation containers keyed on nestable annotation name.
- * This is used to store annotations that can be both standalone and nested
- * and are moved back and forth between the 2.
- */
- final Map<String, AnnotationContainer> annotationContainers = new HashMap<String, AnnotationContainer>();
-
- /**
- * these are built as needed
- */
- private final HashMap<String, Annotation> nullAnnotationsCache = new HashMap<String, Annotation>();
-
-
- // ********** construction/initialization **********
-
- public BinaryAnnotatedElement(JavaResourceNode parent, Adapter adapter) {
- super(parent);
- this.adapter = adapter;
- this.initializeAnnotations();
- }
-
- private void initializeAnnotations() {
- for (IAnnotation annotation : this.getJdtAnnotations()) {
- this.addAnnotation(annotation);
- }
- }
-
- private void addAnnotation(IAnnotation jdtAnnotation) {
- String jdtAnnotationName = jdtAnnotation.getElementName();
- if (this.annotationIsValid(jdtAnnotationName)) {
- this.annotations.add(this.getAnnotationProvider().buildAnnotation(this, jdtAnnotation));
- }
- if (this.annotationIsValidNestable(jdtAnnotationName)) {
- AnnotationContainer container = new AnnotationContainer(jdtAnnotation);
- this.annotationContainers.put(jdtAnnotationName, container);
- }
- if (this.annotationIsValidContainer(jdtAnnotationName)) {
- String nestableAnnotationName = this.getNestableAnnotationName(jdtAnnotationName);
- AnnotationContainer container = new AnnotationContainer(jdtAnnotation);
- this.annotationContainers.put(nestableAnnotationName, container);
- }
- }
-
- private boolean annotationIsValid(String annotationName) {
- return CollectionTools.contains(this.getValidAnnotationNames(), annotationName);
- }
-
- private boolean annotationIsValidContainer(String annotationName) {
- return CollectionTools.contains(this.getValidContainerAnnotationNames(), annotationName);
- }
-
- private boolean annotationIsValidNestable(String annotationName) {
- return CollectionTools.contains(this.getValidNestableAnnotationNames(), annotationName);
- }
-
- Iterable<String> getValidAnnotationNames() {
- return this.getAnnotationProvider().getAnnotationNames();
- }
-
- Iterable<String> getValidContainerAnnotationNames() {
- return this.getAnnotationProvider().getContainerAnnotationNames();
- }
-
- Iterable<String> getValidNestableAnnotationNames() {
- return this.getAnnotationProvider().getNestableAnnotationNames();
- }
-
-
- private String getNestableAnnotationName(String containerAnnotationName) {
- return getAnnotationProvider().getNestableAnnotationName(containerAnnotationName);
- }
-
-
- // ********** updating **********
-
- @Override
- public void update() {
- super.update();
- this.updateAnnotations();
- }
-
- // TODO
- private void updateAnnotations() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** annotations **********
-
- public Iterable<Annotation> getAnnotations() {
- return new LiveCloneIterable<Annotation>(this.annotations);
- }
-
- public int getAnnotationsSize() {
- return this.annotations.size();
- }
-
- protected Iterable<NestableAnnotation> getNestableAnnotations() {
- return new CompositeIterable<NestableAnnotation>(this.getNestableAnnotationLists());
- }
-
- private Iterable<Iterable<NestableAnnotation>> getNestableAnnotationLists() {
- return new TransformationIterable<AnnotationContainer, Iterable<NestableAnnotation>>(this.annotationContainers.values()) {
- @Override
- protected Iterable<NestableAnnotation> transform(AnnotationContainer container) {
- return container.getNestedAnnotations();
- }
- };
- }
-
- public Annotation getAnnotation(String annotationName) {
- return this.selectAnnotationNamed(this.getAnnotations(), annotationName);
- }
-
- public Annotation getNonNullAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- return (annotation != null) ? annotation : this.getNullAnnotation(annotationName);
- }
-
- private synchronized Annotation getNullAnnotation(String annotationName) {
- Annotation annotation = this.nullAnnotationsCache.get(annotationName);
- if (annotation == null) {
- annotation = this.buildNullAnnotation(annotationName);
- this.nullAnnotationsCache.put(annotationName, annotation);
- }
- return annotation;
- }
-
- private Annotation buildNullAnnotation(String annotationName) {
- return getAnnotationProvider().buildNullAnnotation(this, annotationName);
- }
-
- // ********** nestable annotations **********
-
- public ListIterable<NestableAnnotation> getAnnotations(String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container != null ? container.getNestedAnnotations() : EmptyListIterable.<NestableAnnotation> instance();
- }
-
-
- public int getAnnotationsSize(String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container == null ? 0 : container.getNestedAnnotationsSize();
- }
-
- public NestableAnnotation getAnnotation(int index, String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container == null ? null : container.nestedAnnotationAt(index);
- }
-
- // ********** simple state **********
-
- public boolean isAnnotated() {
- return ! this.annotations.isEmpty();
- }
-
- public boolean isAnnotatedWith(Iterable<String> annotationNames) {
- for (Annotation annotation : this.getAnnotations()) {
- if (CollectionTools.contains(annotationNames, annotation.getAnnotationName())) {
- return true;
- }
- }
- for (Annotation annotation : this.getNestableAnnotations()) {
- if (CollectionTools.contains(annotationNames, annotation.getAnnotationName())) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** misc **********
-
- IJavaElement getAnnotatedElement() {
- return this.adapter.getElement();
- }
-
- private Annotation selectAnnotationNamed(Iterable<Annotation> annotationList, String annotationName) {
- for (Annotation annotation : annotationList) {
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- private IAnnotation[] getJdtAnnotations() {
- try {
- return this.adapter.getAnnotations();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EMPTY_JDT_ANNOTATION_ARRAY;
- }
- }
- private static final IAnnotation[] EMPTY_JDT_ANNOTATION_ARRAY = new IAnnotation[0];
-
-
- // ********** IJavaElement adapter **********
-
- interface Adapter {
- /**
- * Return the adapter's JDT element (IPackageFragment, IType, IField, IMethod).
- */
- IJavaElement getElement();
-
- /**
- * Return the adapter's element's JDT annotations.
- */
- IAnnotation[] getAnnotations() throws JavaModelException;
- }
-
-
- // ********** unsupported JavaResourcePersistentMember implementation **********
-
- public Annotation addAnnotation(String annotationName) {
- throw new UnsupportedOperationException();
- }
-
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void moveAnnotation(int targetIndex, int sourceIndex, String nestableAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation(String annotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation(int index, String nestableAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(String nestableAnnotationName, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- private static final IMemberValuePair[] EMPTY_MEMBER_VALUE_PAIR_ARRAY = new IMemberValuePair[0];
-
- class AnnotationContainer
- {
- private final IAnnotation containerAnnotation;
-
- /** annotations */
- final Vector<NestableAnnotation> nestedAnnotations = new Vector<NestableAnnotation>();
-
- protected AnnotationContainer(IAnnotation containerAnnotation) {
- super();
- this.containerAnnotation = containerAnnotation;
- }
-
- protected void initializeNestedAnnotations() {
- int index = 0;
- for(IMemberValuePair valuePair : this.getJdtMemberValuePairs()) {
- IAnnotation nestedAnnotation = (IAnnotation) valuePair.getValue();
- this.nestedAnnotations.add(getAnnotationProvider().buildAnnotation(BinaryAnnotatedElement.this, nestedAnnotation, index++));
- }
- }
-
- public ListIterable<NestableAnnotation> getNestedAnnotations() {
- return new LiveCloneListIterable<NestableAnnotation>(this.nestedAnnotations);
- }
-
- public int getNestedAnnotationsSize() {
- return this.nestedAnnotations.size();
- }
-
- public NestableAnnotation nestedAnnotationAt(int index) {
- return this.nestedAnnotations.get(index);
- }
-
- private IMemberValuePair[] getJdtMemberValuePairs() {
- try {
- return this.containerAnnotation.getMemberValuePairs();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EMPTY_MEMBER_VALUE_PAIR_ARRAY;
- }
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotation.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotation.java
deleted file mode 100644
index 63af604399..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAnnotation.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IMemberValuePair;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-
-/**
- * JAR annotation
- */
-public abstract class BinaryAnnotation
- extends BinaryNode
- implements Annotation
-{
- final IAnnotation jdtAnnotation;
-
- protected BinaryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent);
- this.jdtAnnotation = jdtAnnotation;
- }
-
- // ********** convenience methods **********
-
- /**
- * Return the values of the JDT annotation's member with the specified name.
- */
- protected Object[] getJdtMemberValues(String memberName) {
- Object[] values = (Object[]) this.getJdtMemberValue(memberName);
- return (values != null) ? values : EMPTY_OBJECT_ARRAY;
- }
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
- /**
- * Return the value of the JDT annotation's member with the specified name.
- */
- protected Object getJdtMemberValue(String memberName) {
- IMemberValuePair pair = this.getJdtMemberValuePair(memberName);
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * Return the JDT annotation's member-value pair with the specified name.
- */
- private IMemberValuePair getJdtMemberValuePair(String memberName) {
- for (IMemberValuePair pair : this.getJdtMemberValuePairs()) {
- if (pair.getMemberName().equals(memberName)) {
- return pair;
- }
- }
- return null;
- }
-
- private IMemberValuePair[] getJdtMemberValuePairs() {
- try {
- return this.jdtAnnotation.getMemberValuePairs();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EMPTY_MEMBER_VALUE_PAIR_ARRAY;
- }
- }
- private static final IMemberValuePair[] EMPTY_MEMBER_VALUE_PAIR_ARRAY = new IMemberValuePair[0];
-
-
- // ********** Annotation implementation **********
-
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
- public boolean isUnset() {
- throw new UnsupportedOperationException();
- }
-
- // ********** NestableAnnotation implementation **********
- public void moveAnnotation(@SuppressWarnings("unused") int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAttribute.java
deleted file mode 100644
index 4db7f3edb6..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryAttribute.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeParameter;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-
-/**
- * binary attribute (field or property)
- */
-abstract class BinaryAttribute
- extends BinaryMember
- implements JavaResourceAttribute
-{
- private int modifiers;
-
- private String typeName;
-
- private boolean typeIsInterface;
-
- private boolean typeIsEnum;
-
- private boolean typeIsArray;
-
- private int typeArrayDimensionality;
-
- private String typeArrayComponentTypeName;
-
- private final Vector<String> typeSuperclassNames = new Vector<String>();
-
- private final Vector<String> typeInterfaceNames = new Vector<String>();
-
- private final Vector<String> typeTypeArgumentNames = new Vector<String>();
-
-
- protected BinaryAttribute(JavaResourceType parent, Adapter adapter) {
- super(parent, adapter);
- this.modifiers = this.buildModifiers();
-
- String typeSignature = getTypeSignature();
- Iterable<ITypeParameter> typeParameters = getAdapter().getTypeParameters();
- this.typeName = buildTypeName(typeSignature, typeParameters);
- this.typeIsArray = buildTypeIsArray(typeSignature);
- this.typeArrayDimensionality = buildTypeArrayDimensionality(typeSignature);
- this.typeArrayComponentTypeName = buildTypeArrayComponentTypeName(typeSignature, typeParameters);
- this.typeTypeArgumentNames.addAll(buildTypeTypeArgumentNames(typeSignature, typeParameters));
-
- IType type = getType();
- // if the type is an array, then the following will be false or empty
- this.typeIsInterface = this.buildTypeIsInterface(type);
- this.typeIsEnum = this.buildTypeIsEnum(type);
- this.typeSuperclassNames.addAll(this.buildTypeSuperclassNames(type));
- this.typeInterfaceNames.addAll(this.buildTypeInterfaceNames(type));
- }
-
-
- // ******** overrides ********
-
- @Override
- public void update() {
- super.update();
- this.setModifiers(this.buildModifiers());
-
- String typeSignature = getTypeSignature();
- Iterable<ITypeParameter> typeParameters = getAdapter().getTypeParameters();
- setTypeName(buildTypeName(typeSignature, typeParameters));
- setTypeIsArray(buildTypeIsArray(typeSignature));
- setTypeArrayDimensionality(buildTypeArrayDimensionality(typeSignature));
- setTypeArrayComponentTypeName(buildTypeArrayComponentTypeName(typeSignature, typeParameters));
- setTypeTypeArgumentNames(buildTypeTypeArgumentNames(typeSignature, typeParameters));
-
- IType type = this.getType(); // if the type is an array, then the following will be false or empty
- this.setTypeIsInterface(this.buildTypeIsInterface(type));
- this.setTypeIsEnum(this.buildTypeIsEnum(type));
- this.setTypeSuperclassNames(this.buildTypeSuperclassNames(type));
- this.setTypeInterfaceNames(this.buildTypeInterfaceNames(type));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ********** BinaryPersistentMember implementation **********
-
- private Adapter getAdapter() {
- return (Adapter) this.adapter;
- }
-
-
- // ********** JavaResourceAttribute implementation **********
-
- @Override
- public JavaResourceType getParent() {
- return (JavaResourceType) super.getParent();
- }
-
- public JavaResourceType getResourceType() {
- return this.getParent();
- }
-
- public String getName() {
- return this.getAdapter().getAttributeName();
- }
-
- public boolean typeIsSubTypeOf(String tn) {
- return ((this.typeName != null) && this.typeName.equals(tn))
- || this.typeInterfaceNames.contains(tn)
- || this.typeSuperclassNames.contains(tn);
- }
-
- public boolean typeIsVariablePrimitive() {
- return (this.typeName != null) && ClassName.isVariablePrimitive(this.typeName);
- }
-
- // ***** modifiers
- public int getModifiers() {
- return this.modifiers;
- }
-
- private void setModifiers(int modifiers) {
- int old = this.modifiers;
- this.modifiers = modifiers;
- this.firePropertyChanged(MODIFIERS_PROPERTY, old, modifiers);
- }
-
- /**
- * zero seems like a reasonable default...
- */
- private int buildModifiers() {
- try {
- return this.getMember().getFlags();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return 0;
- }
- }
-
- // ***** type name
- public String getTypeName() {
- return this.typeName;
- }
-
- private void setTypeName(String typeName) {
- String old = this.typeName;
- this.typeName = typeName;
- this.firePropertyChanged(TYPE_NAME_PROPERTY, old, typeName);
- }
-
- private String buildTypeName(String typeSignature, Iterable<ITypeParameter> typeParameters) {
- return convertTypeSignatureToTypeName(typeSignature, typeParameters);
- }
-
- // ***** type is interface
- public boolean typeIsInterface() {
- return this.typeIsInterface;
- }
-
- private void setTypeIsInterface(boolean typeIsInterface) {
- boolean old = this.typeIsInterface;
- this.typeIsInterface = typeIsInterface;
- this.firePropertyChanged(TYPE_IS_INTERFACE_PROPERTY, old, typeIsInterface);
- }
-
- private boolean buildTypeIsInterface(IType type) {
- try {
- return (type != null) && type.isInterface();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** type is enum
- public boolean typeIsEnum() {
- return this.typeIsEnum;
- }
-
- private void setTypeIsEnum(boolean typeIsEnum) {
- boolean old = this.typeIsEnum;
- this.typeIsEnum = typeIsEnum;
- this.firePropertyChanged(TYPE_IS_ENUM_PROPERTY, old, typeIsEnum);
- }
-
- private boolean buildTypeIsEnum(IType type) {
- try {
- return (type != null) && type.isEnum();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** type is array
- public boolean typeIsArray() {
- return this.typeIsArray;
- }
-
- private void setTypeIsArray(boolean typeIsArray) {
- boolean old = this.typeIsArray;
- this.typeIsArray = typeIsArray;
- this.firePropertyChanged(TYPE_IS_ARRAY_PROPERTY, old, typeIsArray);
- }
-
- private boolean buildTypeIsArray(String typeSignature) {
- return convertTypeSignatureToTypeIsArray(typeSignature);
- }
-
- // ***** type array dimensionality
- public int getTypeArrayDimensionality() {
- return this.typeArrayDimensionality;
- }
-
- private void setTypeArrayDimensionality(int typeArrayDimensionality) {
- int old = this.typeArrayDimensionality;
- this.typeArrayDimensionality = typeArrayDimensionality;
- firePropertyChanged(TYPE_ARRAY_DIMENSIONALITY_PROPERTY, old, typeArrayDimensionality);
- }
-
- private int buildTypeArrayDimensionality(String typeSignature) {
- return convertTypeSignatureToTypeArrayDimensionality(typeSignature);
- }
-
- // ***** type array component type name
- public String getTypeArrayComponentTypeName() {
- return this.typeArrayComponentTypeName;
- }
-
- private void setTypeArrayComponentTypeName(String typeArrayComponentTypeName) {
- String old = this.typeArrayComponentTypeName;
- this.typeArrayComponentTypeName = typeArrayComponentTypeName;
- firePropertyChanged(TYPE_ARRAY_COMPONENT_TYPE_NAME_PROPERTY, old, typeArrayComponentTypeName);
- }
-
- private String buildTypeArrayComponentTypeName(String typeSignature, Iterable<ITypeParameter> typeParameters) {
- int arrayDimensionality = convertTypeSignatureToTypeArrayDimensionality(typeSignature);
- return (arrayDimensionality == 0) ? null : convertTypeSignatureToTypeArrayComponentTypeName(typeSignature, typeParameters);
- }
-
- // ***** type superclass hierarchy
- public ListIterable<String> getTypeSuperclassNames() {
- return new LiveCloneListIterable<String>(this.typeSuperclassNames);
- }
-
- public boolean typeSuperclassNamesContains(String superclassName) {
- return this.typeSuperclassNames.contains(superclassName);
- }
-
- private void setTypeSuperclassNames(List<String> typeSuperclassNames) {
- this.synchronizeList(typeSuperclassNames, this.typeSuperclassNames, TYPE_SUPERCLASS_NAMES_LIST);
- }
-
- private List<String> buildTypeSuperclassNames(IType type) {
- if (type == null) {
- return Collections.emptyList();
- }
-
- ArrayList<String> names = new ArrayList<String>();
- type = this.findSuperclass(type);
- while (type != null) {
- names.add(type.getFullyQualifiedName('.')); // no parameters are included here
- type = this.findSuperclass(type);
- }
- return names;
- }
-
- // ***** type interface hierarchy
- public Iterable<String> getTypeInterfaceNames() {
- return new LiveCloneIterable<String>(this.typeInterfaceNames);
- }
-
- public boolean typeInterfaceNamesContains(String interfaceName) {
- return this.typeInterfaceNames.contains(interfaceName);
- }
-
- private void setTypeInterfaceNames(Collection<String> typeInterfaceNames) {
- this.synchronizeCollection(typeInterfaceNames, this.typeInterfaceNames, TYPE_INTERFACE_NAMES_COLLECTION);
- }
-
- private Collection<String> buildTypeInterfaceNames(IType type) {
- if (type == null) {
- return Collections.emptySet();
- }
-
- HashSet<String> names = new HashSet<String>();
- while (type != null) {
- this.addInterfaceNamesTo(type, names);
- type = this.findSuperclass(type);
- }
- return names;
- }
-
- private void addInterfaceNamesTo(IType type, HashSet<String> names) {
- for (String interfaceSignature : this.getSuperInterfaceTypeSignatures(type)) {
- String interfaceName = convertTypeSignatureToTypeName(interfaceSignature);
- names.add(interfaceName);
- IType interfaceType = this.findType(interfaceName);
- if (interfaceType != null) {
- this.addInterfaceNamesTo(interfaceType, names); // recurse
- }
- }
- }
-
- // ***** type type argument names
- public ListIterable<String> getTypeTypeArgumentNames() {
- return new LiveCloneListIterable<String>(this.typeTypeArgumentNames);
- }
-
- public int getTypeTypeArgumentNamesSize() {
- return this.typeTypeArgumentNames.size();
- }
-
- public String getTypeTypeArgumentName(int index) {
- return this.typeTypeArgumentNames.get(index);
- }
-
- private void setTypeTypeArgumentNames(List<String> typeTypeArgumentNames) {
- this.synchronizeList(typeTypeArgumentNames, this.typeTypeArgumentNames, TYPE_TYPE_ARGUMENT_NAMES_LIST);
- }
-
- private List<String> buildTypeTypeArgumentNames(String typeSignature, Iterable<ITypeParameter> typeParameters) {
- int arrayDimensionality = convertTypeSignatureToTypeArrayDimensionality(typeSignature);
- return (arrayDimensionality != 0) ? Collections.<String>emptyList() : convertTypeSignatureToTypeTypeArgumentNames(typeSignature, typeParameters);
- }
-
-
- // ********** convenience methods **********
-
- private String getTypeSignature() {
- try {
- return this.getAdapter().getTypeSignature();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return null;
- }
- }
-
- private IType findSuperclass(IType type) {
- return this.findTypeBySignature(this.getSuperclassSignature(type));
- }
-
- private String getSuperclassSignature(IType type) {
- try {
- return type.getSuperclassTypeSignature();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return null;
- }
- }
-
- private String[] getSuperInterfaceTypeSignatures(IType type) {
- try {
- return type.getSuperInterfaceTypeSignatures();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return StringTools.EMPTY_STRING_ARRAY;
- }
- }
-
- private IType findTypeBySignature(String typeSignature) {
- return (typeSignature == null) ? null : this.findType(convertTypeSignatureToTypeName_(typeSignature));
- }
-
- private IType getType() {
- return (this.typeName == null) ? null : this.findType(this.typeName);
- }
-
- private IType findType(String fullyQualifiedName) {
- try {
- return this.getJavaProject().findType(fullyQualifiedName);
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return null;
- }
- }
-
- private IJavaProject getJavaProject() {
- return this.getMember().getJavaProject();
- }
-
-
-
- // ********** adapters **********
-
- /**
- * Adapt an IField or IMethod.
- */
- interface Adapter
- extends BinaryMember.Adapter {
-
- /**
- * Return the field or getter method's "attribute" name
- * (e.g. field "foo" -> "foo"; method "getFoo" -> "foo").
- */
- String getAttributeName();
-
- /**
- * Return the attribute's type signature.
- */
- String getTypeSignature() throws JavaModelException;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryClassFile.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryClassFile.java
deleted file mode 100644
index 3c4d009ad6..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryClassFile.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceClassFile;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragment;
-
-/**
- * binary class file
- */
-final class BinaryClassFile
- extends BinaryNode
- implements JavaResourceClassFile
-{
- /** JDT class file */
- private final IClassFile classFile;
-
- /** class file's type */
- private final JavaResourceAbstractType type;
-
-
- // ********** construction/initialization **********
-
- /**
- * The JDT type gets passed in because the package fragment inspects it
- * beforehand to determine whether it exists and is relevant.
- */
- BinaryClassFile(JavaResourcePackageFragment parent, IClassFile classFile, IType jdtType) {
- super(parent);
- this.classFile = classFile;
- this.type = this.buildType(jdtType);
- }
-
- private JavaResourceAbstractType buildType(IType jdtType) {
- try {
- if (jdtType.isEnum()) {
- return new BinaryEnum(this, jdtType);
- }
- }
- catch (JavaModelException e) {
- JptCommonCorePlugin.log(e);
- }
- return new BinaryType(this, jdtType);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classFile.getElementName());
- }
-
-
- // ********** JavaResourceClassFile implementation **********
-
- public JavaResourceAbstractType getType() {
- return this.type;
- }
-
- // TODO
- @Override
- public void update() {
- super.update();
-// type(this.classFile.getType());
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnum.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnum.java
deleted file mode 100644
index c41524bbd3..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnum.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * binary enum
- */
-final class BinaryEnum
- extends BinaryAbstractType
- implements JavaResourceEnum
-{
- private final Vector<JavaResourceEnumConstant> enumConstants;
-
-
- // ********** construction/initialization **********
-
- BinaryEnum(JavaResourceNode parent, IType type) {
- super(parent, type);
- this.enumConstants = this.buildEnumConstants();
- }
-
- public Kind getKind() {
- return JavaResourceAnnotatedElement.Kind.ENUM;
- }
- // ********** overrides **********
-
- @Override
- public void update() {
- super.update();
- this.updateEnumConstants();
- }
-
- // TODO
- private void updateEnumConstants() {
- throw new UnsupportedOperationException();
- }
-
-
-
- // ********** JavaResourceEnum implementation **********
-
-
-
- // ********** enum constants **********
-
- public Iterable<JavaResourceEnumConstant> getEnumConstants() {
- return new LiveCloneIterable<JavaResourceEnumConstant>(this.enumConstants);
- }
-
- private void addEnumConstant(JavaResourceEnumConstant enumConstants) {
- this.addItemToCollection(enumConstants, this.enumConstants, ENUMS_COLLECTION);
- }
-
- private JavaResourceEnumConstant getEnumConstant(String enumConstantName, int occurrence) {
- for (JavaResourceEnumConstant enumConstant : this.getEnumConstants()) {
- if (enumConstant.isFor(enumConstantName, occurrence)) {
- return enumConstant;
- }
- }
- return null;
- }
-
- private void removeEnumConstants(Collection<JavaResourceEnumConstant> remove) {
- this.removeItemsFromCollection(remove, this.enumConstants, ENUMS_COLLECTION);
- }
-
- private Vector<JavaResourceEnumConstant> buildEnumConstants() {
- Iterable<IField> jdtEnumConstants = this.getEnumConstants(this.getMember());
- Vector<JavaResourceEnumConstant> result = new Vector<JavaResourceEnumConstant>(CollectionTools.size(jdtEnumConstants));
- for (IField jdtEnumConstant : jdtEnumConstants) {
- result.add(this.buildEnumConstant(jdtEnumConstant));
- }
- return result;
- }
-
- private Iterable<IField> getEnumConstants(IType type) {
- return new FilteringIterable<IField>(CollectionTools.iterable(this.getFields(type))) {
- @Override
- protected boolean accept(IField jdtField) {
- return isEnumConstant(jdtField);
- }
- };
- }
-
- private IField[] getFields(IType type) {
- try {
- return type.getFields();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EMPTY_FIELD_ARRAY;
- }
- }
- private static final IField[] EMPTY_FIELD_ARRAY = new IField[0];
-
- private boolean isEnumConstant(IField field) {
- try {
- return field.isEnumConstant();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- private JavaResourceEnumConstant buildEnumConstant(IField jdtEnumConstant) {
- return new BinaryEnumConstant(this, jdtEnumConstant);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnumConstant.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnumConstant.java
deleted file mode 100644
index eae0c24578..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryEnumConstant.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.ITypeParameter;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-
-/**
- * Java binary enum constant, IField that returns true to isEnumConstant
- */
-final class BinaryEnumConstant
- extends BinaryMember
- implements JavaResourceEnumConstant {
-
-
-
- BinaryEnumConstant(JavaResourceEnum parent, IField enumConstant){
- super(parent, new EnumConstantAdapter(enumConstant));
- }
-
- @Override
- IField getMember() {
- return (IField) super.getMember();
- }
-
- // ******** JavaResourceAnnotatedElement implementation ********
-
- public Kind getKind() {
- return Kind.ENUM_CONSTANT;
- }
-
-
- // ******** JavaResourceEnumConstant implementation ********
-
- public String getName() {
- return this.getMember().getElementName();
- }
-
-
- // ********** IField adapter **********
-
- static class EnumConstantAdapter
- implements Adapter {
-
- private final IField enumConstant;
-
- EnumConstantAdapter(IField enumConstant) {
- super();
- this.enumConstant = enumConstant;
- }
-
- public IField getElement() {
- return this.enumConstant;
- }
-
- public Iterable<ITypeParameter> getTypeParameters() {
- try {
- return new ArrayIterable<ITypeParameter>(this.enumConstant.getDeclaringType().getTypeParameters());
- }
- catch (JavaModelException jme) {
- JptCommonCorePlugin.log(jme);
- }
- return EmptyIterable.instance();
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.enumConstant.getAnnotations();
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryField.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryField.java
deleted file mode 100644
index ea20715065..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryField.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.ITypeParameter;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-
-/**
- * binary field
- */
-final class BinaryField
- extends BinaryAttribute
- implements JavaResourceField
-{
-
- BinaryField(JavaResourceType parent, IField field) {
- super(parent, new FieldAdapter(field));
- }
-
-
- // ******** JavaResourceAnnotatedElement implementation ********
-
- public Kind getKind() {
- return Kind.FIELD;
- }
-
- // ********** adapters **********
-
- /**
- * IField adapter
- */
- static class FieldAdapter
- implements BinaryAttribute.Adapter {
-
- final IField field;
-
- FieldAdapter(IField field) {
- super();
- this.field = field;
- }
-
- public IField getElement() {
- return this.field;
- }
-
- public Iterable<ITypeParameter> getTypeParameters() {
- try {
- return new ArrayIterable<ITypeParameter>(this.field.getDeclaringType().getTypeParameters());
- }
- catch (JavaModelException jme) {
- JptCommonCorePlugin.log(jme);
- }
- return EmptyIterable.instance();
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.field.getAnnotations();
- }
-
- public String getAttributeName() {
- return this.field.getElementName();
- }
-
- public String getTypeSignature() throws JavaModelException {
- return this.field.getTypeSignature();
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMember.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMember.java
deleted file mode 100644
index e0e219abcf..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMember.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.ITypeParameter;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-
-/**
- * binary persistent member
- */
-abstract class BinaryMember
- extends BinaryAnnotatedElement
- implements JavaResourceMember
-{
-
- private boolean final_; // 'final' is a reserved word
- private boolean transient_; // 'transient' is a reserved word
- private boolean public_; // 'public' is a reserved word
- private boolean static_; // 'static' is a reserved word
-
-
- // ********** construction/initialization **********
-
- public BinaryMember(JavaResourceNode parent, Adapter adapter) {
- super(parent, adapter);
- this.final_ = this.buildFinal();
- this.transient_ = this.buildTransient();
- this.public_ = this.buildPublic();
- this.static_ = this.buildStatic();
- }
-
-
- // ********** updating **********
-
- @Override
- public void update() {
- super.update();
- this.setFinal(this.buildFinal());
- this.setTransient(this.buildTransient());
- this.setPublic(this.buildPublic());
- this.setStatic(this.buildStatic());
- }
-
-
- // ********** simple state **********
-
- // ***** final
- public boolean isFinal() {
- return this.final_;
- }
-
- private void setFinal(boolean final_) {
- boolean old = this.final_;
- this.final_ = final_;
- this.firePropertyChanged(FINAL_PROPERTY, old, final_);
- }
-
- private boolean buildFinal() {
- try {
- return Flags.isFinal(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** transient
- public boolean isTransient() {
- return this.transient_;
- }
-
- private void setTransient(boolean transient_) {
- boolean old = this.transient_;
- this.transient_ = transient_;
- this.firePropertyChanged(TRANSIENT_PROPERTY, old, transient_);
- }
-
- private boolean buildTransient() {
- try {
- return Flags.isTransient(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** public
- public boolean isPublic() {
- return this.public_;
- }
-
- private void setPublic(boolean public_) {
- boolean old = this.public_;
- this.public_ = public_;
- this.firePropertyChanged(PUBLIC_PROPERTY, old, public_);
- }
-
- private boolean buildPublic() {
- try {
- return Flags.isPublic(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** static
- public boolean isStatic() {
- return this.static_;
- }
-
- private void setStatic(boolean static_) {
- boolean old = this.static_;
- this.static_ = static_;
- this.firePropertyChanged(STATIC_PROPERTY, old, static_);
- }
-
- private boolean buildStatic() {
- try {
- return Flags.isStatic(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
-
- // ********** miscellaneous **********
-
- IMember getMember() {
- return this.getAdapter().getElement();
- }
-
- private Adapter getAdapter() {
- return (Adapter) this.adapter;
- }
-
- /**
- * Strip off the type signature's parameters if present.
- * Convert to a readable string.
- */
- static String convertTypeSignatureToTypeName(String typeSignature) {
- return convertTypeSignatureToTypeName(typeSignature, EmptyIterable.<ITypeParameter>instance());
- }
-
- /**
- * Strip off the type signature's parameters if present.
- * Convert to a readable string.
- */
- static String convertTypeSignatureToTypeName(String typeSignature, Iterable<ITypeParameter> typeParameters) {
- return (typeSignature == null) ? null : convertTypeSignatureToTypeName_(typeSignature, typeParameters);
- }
-
- /**
- * no null check
- */
- static String convertTypeSignatureToTypeName_(String typeSignature) {
- return convertTypeSignatureToTypeName(typeSignature, EmptyIterable.<ITypeParameter>instance());
- }
-
- /**
- * no null check
- */
- static String convertTypeSignatureToTypeName_(String typeSignature, Iterable<ITypeParameter> typeParameters) {
- String erasureSignature = Signature.getTypeErasure(typeSignature);
- if (Signature.getTypeSignatureKind(erasureSignature) == Signature.TYPE_VARIABLE_SIGNATURE) {
- try {
- String typeParameterName = Signature.toString(erasureSignature);
- for (ITypeParameter typeParameter : typeParameters) {
- if (typeParameterName.equals(typeParameter.getElementName())) {
- String[] bounds = (typeParameter == null) ? new String[0] : typeParameter.getBoundsSignatures();
- if (bounds.length > 0) {
- return convertTypeSignatureToTypeName_(bounds[0], typeParameters);
- }
- }
- }
- }
- catch (JavaModelException jme) {
- JptCommonCorePlugin.log(jme);
- }
- }
- else if (Signature.getTypeSignatureKind(erasureSignature) == Signature.ARRAY_TYPE_SIGNATURE) {
- int dim = Signature.getArrayCount(erasureSignature);
- String arrayTypeName = convertTypeSignatureToTypeName(Signature.getElementType(erasureSignature), typeParameters);
- return Signature.toString(Signature.createArraySignature(Signature.createTypeSignature(arrayTypeName, true), dim));
- }
- else if (Signature.getTypeSignatureKind(erasureSignature) == Signature.WILDCARD_TYPE_SIGNATURE) {
- // if signature is ? (wildcard) or ? super X (bottom bounded), return top bound, which is Object
- if (String.valueOf(Signature.C_STAR).equals(erasureSignature) || erasureSignature.startsWith(String.valueOf(Signature.C_SUPER))) {
- return "java.lang.Object";
- }
- // else return top bound
- else {
- return Signature.toString(erasureSignature.substring(1));
- }
- }
- return Signature.toString(erasureSignature);
- }
-
- static boolean convertTypeSignatureToTypeIsArray(String typeSignature) {
- return (typeSignature == null) ? false : Signature.getTypeSignatureKind(typeSignature) == Signature.ARRAY_TYPE_SIGNATURE;
- }
-
- static int convertTypeSignatureToTypeArrayDimensionality(String typeSignature) {
- return (typeSignature == null) ? 0 : Signature.getArrayCount(typeSignature);
- }
-
- static String convertTypeSignatureToTypeArrayComponentTypeName(String typeSignature, Iterable<ITypeParameter> typeParameters) {
- return (typeSignature == null) ? null : convertTypeSignatureToTypeName(Signature.getElementType(typeSignature), typeParameters);
- }
-
- /**
- * these types can be arrays (e.g. "java.lang.String[]");
- * but they won't have any further nested generic type arguments
- * (e.g. "java.util.Collection<java.lang.String>")
- */
- static List<String> convertTypeSignatureToTypeTypeArgumentNames(String typeSignature, Iterable<ITypeParameter> typeParameters) {
- if (typeSignature == null) {
- return Collections.emptyList();
- }
-
- String[] typeArgumentSignatures = Signature.getTypeArguments(typeSignature);
- if (typeArgumentSignatures.length == 0) {
- return Collections.emptyList();
- }
-
- ArrayList<String> names = new ArrayList<String>(typeArgumentSignatures.length);
- for (String typeArgumentSignature : typeArgumentSignatures) {
- names.add(convertTypeSignatureToTypeName(typeArgumentSignature, typeParameters));
- }
- return names;
- }
-
-
- // ********** IMember adapter **********
-
- interface Adapter extends BinaryAnnotatedElement.Adapter {
- /**
- * Return the adapter's JDT member (IType, IField, IMethod).
- */
- IMember getElement();
-
- Iterable<ITypeParameter> getTypeParameters();
- }
-
-
- // ********** unsupported JavaResourceMember implementation **********
-
- public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- throw new UnsupportedOperationException();
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isFor(String memberName, int occurrence) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMethod.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMethod.java
deleted file mode 100644
index ef034a159c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryMethod.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.ILocalVariable;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.ITypeParameter;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.NameTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-
-/**
- * binary method
- */
-final class BinaryMethod
- extends BinaryAttribute
- implements JavaResourceMethod {
-
- private boolean constructor;
-
- private final Vector<String> parameterTypeNames = new Vector<String>();
-
-
- BinaryMethod(JavaResourceType parent, IMethod method) {
- super(parent, new MethodAdapter(method));
- }
-
- public Kind getKind() {
- return JavaResourceAnnotatedElement.Kind.METHOD;
- }
-
- // ***** overrides *****
-
- @Override
- public void update() {
- super.update();
- this.setConstructor(this.buildConstructor());
-
- this.setParameterTypeNames(this.buildParameterTypeNames());
- }
-
- @Override
- IMethod getMember() {
- return (IMethod) super.getMember();
- }
-
-
- // ***** method name *****
-
- public String getMethodName() {
- return getMember().getElementName();
- }
-
-
- // ***** parameter type names *****
-
- public ListIterable<String> getParameterTypeNames() {
- return new LiveCloneListIterable<String>(this.parameterTypeNames);
- }
-
- public String getParameterTypeName(int index) {
- return this.parameterTypeNames.get(index);
- }
-
- public int getParametersSize() {
- return this.parameterTypeNames.size();
- }
-
- private List<String> buildParameterTypeNames() {
- ArrayList<String> names = new ArrayList<String>();
- for (ILocalVariable parameter : this.getParameters(this.getMember())) {
- names.add(parameter.getElementName());//TODO is this right?
- }
- return names;
- }
-
- private ILocalVariable[] getParameters(IMethod jdtMethod) {
- try {
- return jdtMethod.getParameters();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return null;
- }
- }
-
- private void setParameterTypeNames(List<String> parameterTypeNames) {
- this.synchronizeList(parameterTypeNames, this.parameterTypeNames, PARAMETER_TYPE_NAMES_LIST);
- }
-
-
- // ***** constructor *****
-
- public boolean isConstructor() {
- return this.constructor;
- }
-
- private void setConstructor(boolean isConstructor) {
- boolean old = this.constructor;
- this.constructor = isConstructor;
- this.firePropertyChanged(CONSTRUCTOR_PROPERTY, old, isConstructor);
- }
-
- private boolean buildConstructor() {
- try {
- return this.getMember().isConstructor();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
-
- // ***** misc *****
-
- public boolean isFor(MethodSignature methodSignature, int occurrence) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** adapters **********
-
- /**
- * IMethod adapter
- */
- static class MethodAdapter
- implements BinaryAttribute.Adapter {
-
- final IMethod method;
- static final IMethod[] EMPTY_METHOD_ARRAY = new IMethod[0];
-
- MethodAdapter(IMethod method) {
- super();
- this.method = method;
- }
-
- public IMethod getElement() {
- return this.method;
- }
-
- public Iterable<ITypeParameter> getTypeParameters() {
- try {
- return new CompositeIterable<ITypeParameter>(
- new ArrayIterable<ITypeParameter>(this.method.getTypeParameters()),
- new ArrayIterable<ITypeParameter>(this.method.getDeclaringType().getTypeParameters()));
- }
- catch (JavaModelException jme) {
- JptCommonCorePlugin.log(jme);
- }
- return EmptyIterable.instance();
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.method.getAnnotations();
- }
-
- public String getAttributeName() {
- return NameTools.convertGetterSetterMethodNameToPropertyName(this.method.getElementName());
- }
-
- public String getTypeSignature() throws JavaModelException {
- return this.method.getReturnType();
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNamedAnnotation.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNamedAnnotation.java
deleted file mode 100644
index 3e3b3f8cc0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNamedAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-
-/**
- * Used for annotations that have no behavior, just a name
- */
-public final class BinaryNamedAnnotation
- extends BinaryAnnotation
-{
-
- private final String annotationName;
-
- public BinaryNamedAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation, String annotationName) {
- super(parent, jdtAnnotation);
- this.annotationName = annotationName;
- }
-
- public String getAnnotationName() {
- return this.annotationName;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNode.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNode.java
deleted file mode 100644
index 5bb0ad0410..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryNode.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Binary convenience methods
- */
-// TODO hopefully this class can go away with some sort of refactoring of the
-// source and binary hierarchies...
-public abstract class BinaryNode
- extends AbstractJavaResourceNode
-{
-
- // ********** construction **********
-
- protected BinaryNode(JavaResourceNode parent) {
- super(parent);
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- @Override
- public IFile getFile() {
- return null; // only BinaryPackageFragmentRoot has a file...
- }
-
- public void update() {
- // nothing by default
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void initialize(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragment.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragment.java
deleted file mode 100644
index 5550d24d9d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragment.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceClassFile;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-/**
- * binary package fragment
- */
-final class BinaryPackageFragment
- extends BinaryNode
- implements JavaResourcePackageFragment
-{
- /** JDT package fragment */
- private final IPackageFragment packageFragment;
-
- /**
- * class files in the package fragment;
- * we only hold class files/types that are actually annotated;
- * if the unannotated types are needed (e.g. for orm.xml or an
- * inheritance tree) they can be discovered on the classpath as needed
- */
- private final Vector<JavaResourceClassFile> classFiles = new Vector<JavaResourceClassFile>();
-
-
- // ********** construction/initialization **********
-
- BinaryPackageFragment(JavaResourcePackageFragmentRoot parent, IPackageFragment packageFragment) {
- super(parent);
- this.packageFragment = packageFragment;
- this.classFiles.addAll(this.buildClassFiles());
- }
-
- private Collection<JavaResourceClassFile> buildClassFiles() {
- IJavaElement[] children = this.getJDTChildren();
- ArrayList<JavaResourceClassFile> result = new ArrayList<JavaResourceClassFile>(children.length);
- for (IJavaElement child : children) {
- IClassFile jdtClassFile = (IClassFile) child;
- IType jdtType = jdtClassFile.getType();
- if (typeIsRelevant(jdtType)) {
- JavaResourceClassFile classFile = new BinaryClassFile(this, jdtClassFile, jdtType);
- if (classFile.getType().isAnnotated()) { // we only hold annotated types
- result.add(classFile);
- }
- }
- }
- return result;
- }
-
- //we will limit to classes, interfaces, and enums. Annotation types will be ignored.
- static boolean typeIsRelevant(IType type) {
- try {
- return (type != null)
- && type.exists()
- && (type.isClass() || type.isInterface()|| type.isEnum());
- }
- catch (JavaModelException e) {
- return false;
- }
- }
-
- // ********** JarResourceNode implementation **********
-
- @Override
- public void update() {
- super.update();
- this.updateClassFiles();
- }
-
- // TODO
- private void updateClassFiles() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** JavaResourcePackageFragment implementation **********
-
- public ListIterable<JavaResourceClassFile> getClassFiles() {
- return new LiveCloneListIterable<JavaResourceClassFile>(this.classFiles);
- }
-
- public int getClassFilesSize() {
- return this.classFiles.size();
- }
-
- public Iterable<JavaResourceAbstractType> getTypes() {
- return new TransformationIterable<JavaResourceClassFile, JavaResourceAbstractType>(this.getClassFiles()) {
- @Override
- protected JavaResourceAbstractType transform(JavaResourceClassFile classFile) {
- return classFile.getType(); // we only hold annotated types
- }
- };
- }
-
-
- // ********** misc **********
-
- private IJavaElement[] getJDTChildren() {
- try {
- return this.packageFragment.getChildren();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EMPTY_JAVA_ELEMENT_ARRAY;
- }
- }
- protected static final IJavaElement[] EMPTY_JAVA_ELEMENT_ARRAY = new IJavaElement[0];
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.packageFragment.getElementName());
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java
deleted file mode 100644
index 42865f3267..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-/**
- * binary package fragment root
- */
-public final class BinaryPackageFragmentRoot
- extends RootBinaryNode
- implements JavaResourcePackageFragmentRoot
-{
- /** JDT package fragment root */
- private final IPackageFragmentRoot packageFragmentRoot;
-
- /** package fragments in the JAR */
- private final Vector<JavaResourcePackageFragment> packageFragments = new Vector<JavaResourcePackageFragment>();
-
-
- // ********** construction/initialization **********
-
- public BinaryPackageFragmentRoot(IPackageFragmentRoot packageFragmentRoot, AnnotationProvider annotationProvider) {
- super(null, annotationProvider); // the package fragment root is the root of its sub-tree
- this.packageFragmentRoot = packageFragmentRoot;
- this.packageFragments.addAll(this.buildPackageFragments());
- }
-
- private Collection<JavaResourcePackageFragment> buildPackageFragments() {
- IJavaElement[] jdtChildren = this.getJDTChildren();
- ArrayList<JavaResourcePackageFragment> result = new ArrayList<JavaResourcePackageFragment>(jdtChildren.length);
- for (IJavaElement child : jdtChildren) {
- result.add(new BinaryPackageFragment(this, (IPackageFragment) child));
- }
- return result;
- }
-
-
- // ********** overrides **********
-
- @Override
- public IFile getFile() {
- return (IFile) this.packageFragmentRoot.getResource();
- }
-
- @Override
- public void update() {
- super.update();
- this.updatePackageFragments();
- }
-
- // TODO
- private void updatePackageFragments() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- /**
- * NB: we hold only annotated types
- */
- public Iterable<JavaResourceAbstractType> getTypes() {
- return new CompositeIterable<JavaResourceAbstractType>(this.persistedTypesLists());
- }
-
- private Iterable<Iterable<JavaResourceAbstractType>> persistedTypesLists() {
- return new TransformationIterable<JavaResourcePackageFragment, Iterable<JavaResourceAbstractType>>(this.getPackageFragments()) {
- @Override
- protected Iterable<JavaResourceAbstractType> transform(JavaResourcePackageFragment fragment) {
- return fragment.getTypes();
- }
- };
- }
-
-
- // ********** JavaResourcePackageFragmentRoot implementation **********
-
- public Iterable<JavaResourcePackageFragment> getPackageFragments() {
- return new LiveCloneIterable<JavaResourcePackageFragment>(this.packageFragments);
- }
-
- public int getPackageFragmentsSize() {
- return this.packageFragments.size();
- }
-
-
- // ********** misc **********
-
- private IJavaElement[] getJDTChildren() {
- return JDTTools.getChildren(this.packageFragmentRoot);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryType.java
deleted file mode 100644
index 2aca5d8f93..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryType.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.Collection;
-import java.util.Vector;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * binary type
- */
-final class BinaryType
- extends BinaryAbstractType
- implements JavaResourceType
-{
- private String superclassQualifiedName;
-
- private boolean abstract_; // 'abstract' is a reserved word
-
- private boolean hasNoArgConstructor;
-
- private boolean hasPrivateNoArgConstructor;
-
- private final Vector<JavaResourceField> fields;
-
- private final Vector<JavaResourceMethod> methods;
-
-
- // ********** construction/initialization **********
-
- BinaryType(JavaResourceNode parent, IType type) {
- super(parent, type);
- this.superclassQualifiedName = this.buildSuperclassQualifiedName();
- this.abstract_ = this.buildAbstract();
- this.hasNoArgConstructor = this.buildHasNoArgConstructor();
- this.hasPrivateNoArgConstructor = this.buildHasPrivateNoArgConstructor();
- this.fields = this.buildFields();
- this.methods = this.buildMethods();
- }
-
- public Kind getKind() {
- return JavaResourceAnnotatedElement.Kind.TYPE;
- }
-
-
- // ********** overrides **********
-
- @Override
- public void update() {
- super.update();
- this.setSuperclassQualifiedName(this.buildSuperclassQualifiedName());
- this.setAbstract(this.buildAbstract());
- this.setHasNoArgConstructor(this.buildHasNoArgConstructor());
- this.setHasPrivateNoArgConstructor(this.buildHasPrivateNoArgConstructor());
- this.updateFields();
- this.updateMethods();
- }
-
- // TODO
- private void updateFields() {
- throw new UnsupportedOperationException();
- }
-
- // TODO
- private void updateMethods() {
- throw new UnsupportedOperationException();
- }
-
-
-
- // ********** JavaResourceType implementation **********
-
- // ***** superclass qualified name
- public String getSuperclassQualifiedName() {
- return this.superclassQualifiedName;
- }
-
- private void setSuperclassQualifiedName(String superclassQualifiedName) {
- String old = this.superclassQualifiedName;
- this.superclassQualifiedName = superclassQualifiedName;
- this.firePropertyChanged(SUPERCLASS_QUALIFIED_NAME_PROPERTY, old, superclassQualifiedName);
- }
-
- private String buildSuperclassQualifiedName() {
- return convertTypeSignatureToTypeName(this.getSuperclassTypeSignature());
- }
-
- private String getSuperclassTypeSignature() {
- try {
- return this.getMember().getSuperclassTypeSignature();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return null;
- }
- }
-
-
- // ***** abstract
- public boolean isAbstract() {
- return this.abstract_;
- }
-
- private void setAbstract(boolean abstract_) {
- boolean old = this.abstract_;
- this.abstract_ = abstract_;
- this.firePropertyChanged(ABSTRACT_PROPERTY, old, abstract_);
- }
-
- private boolean buildAbstract() {
- try {
- return Flags.isAbstract(this.getMember().getFlags());
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** no-arg constructor
- public boolean hasNoArgConstructor() {
- return this.hasNoArgConstructor;
- }
-
- private void setHasNoArgConstructor(boolean hasNoArgConstructor) {
- boolean old = this.hasNoArgConstructor;
- this.hasNoArgConstructor = hasNoArgConstructor;
- this.firePropertyChanged(NO_ARG_CONSTRUCTOR_PROPERTY, old, hasNoArgConstructor);
- }
-
- private boolean buildHasNoArgConstructor() {
- return this.findNoArgConstructor() != null;
- }
-
- private IMethod findNoArgConstructor() {
- try {
- for (IMethod method : this.getMember().getMethods()) {
- if (method.isConstructor()) {
- return method;
- }
- }
- }
- catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- }
- return null;
- }
-
- // ***** private no-arg constructor
- public boolean hasPrivateNoArgConstructor() {
- return this.hasPrivateNoArgConstructor;
- }
-
- private void setHasPrivateNoArgConstructor(boolean hasPrivateNoArgConstructor) {
- boolean old = this.hasPrivateNoArgConstructor;
- this.hasPrivateNoArgConstructor = hasPrivateNoArgConstructor;
- this.firePropertyChanged(PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY, old, hasPrivateNoArgConstructor);
- }
-
- private boolean buildHasPrivateNoArgConstructor() {
- IMethod method = this.findNoArgConstructor();
- try {
- return method != null && Flags.isPrivate(method.getFlags());
- }
- catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
-
- // ********** misc **********
-
- public boolean hasAnyAnnotatedFields() {
- for (JavaResourceField field : this.getFields()) {
- if (field.isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-
- public boolean hasAnyAnnotatedMethods() {
- for (JavaResourceMethod method : this.getMethods()) {
- if (method.isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public IType getMember() {
- return super.getMember();
- }
-
-
- // ********** fields **********
-
- public Iterable<JavaResourceField> getFields() {
- return new LiveCloneIterable<JavaResourceField>(this.fields);
- }
-
- private void addField(JavaResourceField field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- private JavaResourceField getField(String fieldName, int occurrence) {
- for (JavaResourceField field : this.getFields()) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- private void removeFields(Collection<JavaResourceField> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
- private Vector<JavaResourceField> buildFields() {
- IField[] jdtFields = this.getFields(this.getMember());
- Vector<JavaResourceField> result = new Vector<JavaResourceField>(jdtFields.length);
- for (IField jdtField : jdtFields) {
- result.add(this.buildField(jdtField));
- }
- return result;
- }
-
- private IField[] getFields(IType type) {
- try {
- return type.getFields();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EMPTY_FIELD_ARRAY;
- }
- }
- private static final IField[] EMPTY_FIELD_ARRAY = new IField[0];
-
- private JavaResourceField buildField(IField jdtField) {
- return new BinaryField(this, jdtField);
- }
-
-
- // ********** methods **********
-
- public Iterable<JavaResourceMethod> getMethods() {
- return new LiveCloneIterable<JavaResourceMethod>(this.methods);
- }
-
- private JavaResourceMethod getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourceMethod method : this.getMethods()) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- private void addMethod(JavaResourceMethod method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- private void removeMethods(Collection<JavaResourceMethod> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
- private Vector<JavaResourceMethod> buildMethods() {
- IMethod[] jdtMethods = this.getMethods(this.getMember());
- Vector<JavaResourceMethod> result = new Vector<JavaResourceMethod>(jdtMethods.length);
- for (IMethod jdtMethod : jdtMethods) {
- result.add(this.buildMethod(jdtMethod));
- }
- return result;
- }
-
- private IMethod[] getMethods(IType type) {
- try {
- return type.getMethods();
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EMPTY_METHOD_ARRAY;
- }
- }
- private static final IMethod[] EMPTY_METHOD_ARRAY = new IMethod[0];
-
- private JavaResourceMethod buildMethod(IMethod jdtMethod) {
- return new BinaryMethod(this, jdtMethod);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryTypeCache.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryTypeCache.java
deleted file mode 100644
index fdc5684ba7..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/BinaryTypeCache.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceTypeCache;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-/**
- * cache used to hold binary "external" Java resource types
- * (typically derived from JARs on the project's build path)
- */
-public final class BinaryTypeCache
- extends RootBinaryNode
- implements JavaResourceTypeCache
-{
- /** populated on-demand */
- private final Vector<Entry> entries = new Vector<Entry>();
-
-
- // ********** construction **********
-
- public BinaryTypeCache(AnnotationProvider annotationProvider) {
- super(null, annotationProvider);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public Iterable<JavaResourceAbstractType> getTypes() {
- return new TransformationIterable<Entry, JavaResourceAbstractType>(this.getEntries()) {
- @Override
- protected JavaResourceAbstractType transform(Entry entry) {
- return entry.type;
- }
- };
- }
-
- private Iterable<Entry> getEntries() {
- return new LiveCloneIterable<Entry>(this.entries);
- }
-
-
- // ********** JavaResourcePersistentTypeCache implementation **********
-
- public int getTypesSize() {
- return this.entries.size();
- }
-
- public JavaResourceAbstractType addType(IType jdtType) {
- Entry entry = this.buildEntry(jdtType);
- this.entries.add(entry);
- this.fireItemAdded(TYPES_COLLECTION, entry.type);
- return entry.type;
- }
-
- private Entry buildEntry(IType jdtType) {
- return new Entry(this.buildType(jdtType), jdtType.getResource());
- }
-
- //ignore annotations
- private JavaResourceAbstractType buildType(IType jdtType) {
- try {
- if (jdtType.isClass() || jdtType.isInterface()) {
- return new BinaryType(this, jdtType);
- }
- if (jdtType.isEnum()) {
- return new BinaryEnum(this, jdtType);
- }
- }
- catch(JavaModelException e) {
- JptCommonCorePlugin.log(e);
- }
- return null;
- }
-
- public boolean removeTypes(IFile jarFile) {
- boolean modified = false;
- for (Entry entry : this.getEntries()) {
- IResource resource = entry.resource;
- if ((resource != null) && resource.equals(jarFile)) {
- this.removeEntry(entry);
- modified = true;
- }
- }
- return modified;
- }
-
- private void removeEntry(Entry entry) {
- this.entries.remove(entry);
- this.fireItemRemoved(TYPES_COLLECTION, entry.type);
- }
-
-
- // ********** overrides **********
-
- /**
- * Ignore changes to this collection. Adds can be ignored since they are triggered
- * by requests that will, themselves, trigger updates (typically during the
- * update of an object that calls a setter with the newly-created resource
- * type). Deletes will be accompanied by manual updates.
- */
- @Override
- protected void aspectChanged(String aspectName) {
- if ((aspectName != null) && ! aspectName.equals(TYPES_COLLECTION)) {
- super.aspectChanged(aspectName);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.entries);
- }
-
-
- // ********** cache entry **********
-
- /**
- * Associate a type with its resource.
- * This will be a JAR in the case of a type loaded from a JAR that is in
- * the Eclipse workspace. The resource will be null for a type loaded
- * from a JAR or class directory outside of the workspace.
- */
- static class Entry {
- final JavaResourceAbstractType type;
- final IResource resource;
-
- Entry(JavaResourceAbstractType type, IResource resource) {
- super();
- this.type = type;
- this.resource = resource;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.type);
- }
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryNode.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryNode.java
deleted file mode 100644
index 3afcf608da..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/binary/RootBinaryNode.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.binary;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-
-/**
- * JAR and external types
- */
-abstract class RootBinaryNode
- extends BinaryNode
- implements JavaResourceNode.Root
-{
- /** pluggable annotation provider */
- private final AnnotationProvider annotationProvider;
-
- /** listeners notified whenever the resource model changes */
- private final ListenerList<JptResourceModelListener> resourceModelListenerList = new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
-
-
- // ********** construction **********
-
- RootBinaryNode(JavaResourceNode parent, AnnotationProvider annotationProvider) {
- super(parent);
- this.annotationProvider = annotationProvider;
- }
-
-
- // ********** overrides **********
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public Root getRoot() {
- return this;
- }
-
- @Override
- public AnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAbstractType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAbstractType.java
deleted file mode 100644
index 533b3083c3..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAbstractType.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-import org.eclipse.jpt.common.utility.internal.SimpleIntReference;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Java source type
- */
-abstract class SourceAbstractType<A extends AbstractType>
- extends SourceMember<A>
- implements JavaResourceAbstractType
-{
- private String name;
-
- private String qualifiedName;
-
- private String packageName;
-
- private String declaringTypeName;
-
- private boolean memberType;
-
-
- // ********** construction/initialization **********
-
- protected SourceAbstractType(JavaResourceCompilationUnit javaResourceCompilationUnit, A type) {
- super(javaResourceCompilationUnit, type);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.name = this.buildName(binding);
- this.qualifiedName = this.buildQualifiedName(binding);
- this.packageName = this.buildPackageName(binding);
- this.declaringTypeName = this.buildDeclaringTypeName(binding);
- this.memberType = this.buildMemberType(binding);
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncName(this.buildName(binding));
- this.syncQualifiedName(this.buildQualifiedName(binding));
- this.syncPackageName(this.buildPackageName(binding));
- this.syncDeclaringTypeName(this.buildDeclaringTypeName(binding));
- this.syncMemberType(this.buildMemberType(binding));
- }
-
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ******** JavaResourceAbstractType implementation ********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getName();
- }
-
- // ***** qualified name
- public String getQualifiedName() {
- return this.qualifiedName;
- }
-
- private void syncQualifiedName(String astQualifiedName) {
- String old = this.qualifiedName;
- this.qualifiedName = astQualifiedName;
- this.firePropertyChanged(QUALIFIED_NAME_PROPERTY, old, astQualifiedName);
- }
-
- private String buildQualifiedName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getQualifiedName();
- }
-
- // ***** package name
- public String getPackageName() {
- return this.packageName;
- }
-
- private void syncPackageName(String astPackageName) {
- String old = this.packageName;
- this.packageName = astPackageName;
- this.firePropertyChanged(PACKAGE_NAME_PROPERTY, old, astPackageName);
- }
-
- private String buildPackageName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getPackage().getName();
- }
-
- // ***** package
- public boolean isIn(IPackageFragment packageFragment) {
- return StringTools.stringsAreEqual(packageFragment.getElementName(), this.packageName);
- }
-
- // ***** source folder
- public boolean isIn(IPackageFragmentRoot sourceFolder) {
- return getSourceFolder().equals(sourceFolder);
- }
-
- private IPackageFragmentRoot getSourceFolder() {
- return (IPackageFragmentRoot) this.getJavaResourceCompilationUnit().getCompilationUnit().getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
-
- // ***** declaring type name
- public String getDeclaringTypeName() {
- return this.declaringTypeName;
- }
-
- private void syncDeclaringTypeName(String astDeclaringTypeName) {
- String old = this.declaringTypeName;
- this.declaringTypeName = astDeclaringTypeName;
- this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, astDeclaringTypeName);
- }
-
- private String buildDeclaringTypeName(ITypeBinding binding) {
- if (binding == null) {
- return null;
- }
- ITypeBinding declaringClass = binding.getDeclaringClass();
- return (declaringClass == null) ? null : declaringClass.getTypeDeclaration().getQualifiedName();
- }
-
- // ***** member type
- public boolean isMemberType() {
- return this.memberType;
- }
-
- private void syncMemberType(boolean memberType) {
- boolean old = this.memberType;
- this.memberType = memberType;
- this.firePropertyChanged(MEMBER_TYPE_PROPERTY, old, memberType);
- }
-
- private boolean buildMemberType(ITypeBinding binding) {
- return (binding == null) ? false : binding.isMember();
- }
-
-
- // ********** CounterMap **********
-
- protected static class CounterMap {
- private final HashMap<Object, SimpleIntReference> counters;
-
- protected CounterMap(int initialCapacity) {
- super();
- this.counters = new HashMap<Object, SimpleIntReference>(initialCapacity);
- }
-
- /**
- * Return the incremented count for the specified object.
- */
- int increment(Object o) {
- SimpleIntReference counter = this.counters.get(o);
- if (counter == null) {
- counter = new SimpleIntReference();
- this.counters.put(o, counter);
- }
- counter.increment();
- return counter.getValue();
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java
deleted file mode 100644
index 3de22234cb..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-/**
- * Java source annotated element (annotations)
- */
-abstract class SourceAnnotatedElement<A extends AnnotatedElement>
- extends SourceNode
- implements JavaResourceAnnotatedElement
-{
- final A annotatedElement;
-
- /**
- * annotations; no duplicates (java compiler has an error for duplicates)
- */
- final Vector<Annotation> annotations = new Vector<Annotation>();
-
- /**
- * Annotation containers keyed on nestable annotation name.
- * This is used to store annotations that can be both standalone and nested
- * and are moved back and forth between the 2.
- */
- final Map<String, AnnotationContainer> annotationContainers = new HashMap<String, AnnotationContainer>();
-
- // ********** construction/initialization **********
-
- SourceAnnotatedElement(JavaResourceNode parent, A annotatedElement) {
- super(parent);
- this.annotatedElement = annotatedElement;
- }
-
- public void initialize(CompilationUnit astRoot) {
- ASTNode node = this.annotatedElement.getBodyDeclaration(astRoot);
- node.accept(this.buildInitialAnnotationVisitor(node));
- }
-
- private ASTVisitor buildInitialAnnotationVisitor(ASTNode node) {
- return new InitialAnnotationVisitor(node);
- }
-
- /**
- * called from {@link InitialAnnotationVisitor}
- */
- /* private */ void addInitialAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- String jdtAnnotationName = ASTTools.resolveAnnotation(node);
- if (jdtAnnotationName != null) {
- if(this.annotationIsValidContainer(jdtAnnotationName)) {
- String nestableAnnotationName = this.getNestableAnnotationName(jdtAnnotationName);
- AnnotationContainer container = new AnnotationContainer(nestableAnnotationName);
- container.initialize(node);
- this.annotationContainers.put(nestableAnnotationName, container);
- }
- else if (this.annotationIsValid(jdtAnnotationName)) {
- if (this.selectAnnotationNamed(this.annotations, jdtAnnotationName) == null) { // ignore duplicates
- Annotation annotation = this.buildAnnotation(jdtAnnotationName);
- annotation.initialize((CompilationUnit) node.getRoot());
- this.annotations.add(annotation);
- }
- }
- else if(this.annotationIsValidNestable(jdtAnnotationName)) {
- AnnotationContainer container = new AnnotationContainer(jdtAnnotationName);
- container.initializeNestableAnnotation(node);
- this.annotationContainers.put(jdtAnnotationName, container);
- }
- }
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncAnnotations(this.annotatedElement.getBodyDeclaration(astRoot));
- }
-
-
- // ********** annotations **********
-
- public Iterable<Annotation> getAnnotations() {
- return new LiveCloneIterable<Annotation>(this.annotations);
- }
-
- public int getAnnotationsSize() {
- return this.annotations.size();
- }
-
- protected Iterable<NestableAnnotation> getNestableAnnotations() {
- return new CompositeIterable<NestableAnnotation>(this.getNestableAnnotationLists());
- }
-
- private Iterable<Iterable<NestableAnnotation>> getNestableAnnotationLists() {
- return new TransformationIterable<AnnotationContainer, Iterable<NestableAnnotation>>(this.annotationContainers.values()) {
- @Override
- protected Iterable<NestableAnnotation> transform(AnnotationContainer container) {
- return container.getNestedAnnotations();
- }
- };
- }
-
- public Annotation getAnnotation(String annotationName) {
- if (this.annotationIsValidContainer(annotationName)) {
- AnnotationContainer container = this.annotationContainers.get(getAnnotationProvider().getNestableAnnotationName(annotationName));
- return container == null ? null : container.getContainerAnnotation();
- }
- return this.selectAnnotationNamed(this.getAnnotations(), annotationName);
- }
-
- public Annotation getNonNullAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- return (annotation != null) ? annotation : this.buildNullAnnotation(annotationName);
- }
-
- public ListIterable<NestableAnnotation> getAnnotations(String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container != null ? container.getNestedAnnotations() : EmptyListIterable.<NestableAnnotation> instance();
- }
-
- public int getAnnotationsSize(String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container == null ? 0 : container.getNestedAnnotationsSize();
- }
-
- public NestableAnnotation getAnnotation(int index, String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container == null ? null : container.nestedAnnotationAt(index);
- }
-
- public Annotation getContainerAnnotation(String containerAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(getAnnotationProvider().getNestableAnnotationName(containerAnnotationName));
- return container == null ? null : container.getContainerAnnotation();
- }
-
- private String getNestableAnnotationName(String containerAnnotationName) {
- return getAnnotationProvider().getNestableAnnotationName(containerAnnotationName);
- }
-
- private String getNestableElementName(String nestableAnnotationName) {
- return getAnnotationProvider().getNestableElementName(nestableAnnotationName);
- }
-
- public Annotation addAnnotation(String annotationName) {
- Annotation annotation = this.buildAnnotation(annotationName);
- this.annotations.add(annotation);
- annotation.newAnnotation();
- return annotation;
- }
-
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- if (container == null) {
- container = new AnnotationContainer(nestableAnnotationName);
- this.annotationContainers.put(nestableAnnotationName, container);
- }
- return container.addNestedAnnotation(index);
- }
-
- public void moveAnnotation(int targetIndex, int sourceIndex, String nestableAnnotationName) {
- this.annotationContainers.get(nestableAnnotationName).moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- if (annotation != null) {
- this.removeAnnotation(annotation);
- }
- }
-
- private void removeAnnotation(Annotation annotation) {
- this.annotations.remove(annotation);
- annotation.removeAnnotation();
- }
-
- public void removeAnnotation(int index, String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- container.removeNestedAnnotation(index);
- if (container.isEmpty()) {
- this.annotationContainers.remove(nestableAnnotationName);
- }
- }
-
- protected boolean annotationIsValid(String annotationName) {
- return CollectionTools.contains(this.getValidAnnotationNames(), annotationName);
- }
-
- protected boolean annotationIsValidContainer(String annotationName) {
- return CollectionTools.contains(this.getValidContainerAnnotationNames(), annotationName);
- }
-
- protected boolean annotationIsValidNestable(String annotationName) {
- return CollectionTools.contains(this.getValidNestableAnnotationNames(), annotationName);
- }
-
- Iterable<String> getValidAnnotationNames() {
- return this.getAnnotationProvider().getAnnotationNames();
- }
-
- Iterable<String> getValidContainerAnnotationNames() {
- return this.getAnnotationProvider().getContainerAnnotationNames();
- }
-
- Iterable<String> getValidNestableAnnotationNames() {
- return this.getAnnotationProvider().getNestableAnnotationNames();
- }
-
- Annotation buildAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildAnnotation(this, this.annotatedElement, annotationName);
- }
-
- Annotation buildNullAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullAnnotation(this, annotationName);
- }
-
- NestableAnnotation buildNestableAnnotation(String annotationName, int index) {
- return this.getAnnotationProvider().buildAnnotation(this, this.annotatedElement, annotationName, index);
- }
-
- private void syncAnnotations(ASTNode node) {
- HashSet<Annotation> annotationsToRemove = new HashSet<Annotation>(this.annotations);
-
- HashSet<AnnotationContainer> containersToRemove = new HashSet<AnnotationContainer>(this.annotationContainers.values());
- node.accept(this.buildSynchronizeAnnotationVisitor(node, annotationsToRemove, containersToRemove));
-
- for (Annotation annotation : annotationsToRemove) {
- this.removeItemFromCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
-
- for (AnnotationContainer annotationContainer : containersToRemove) {
- this.annotationContainers.remove(annotationContainer.getNestedAnnotationName());
- fireItemsRemoved(NESTABLE_ANNOTATIONS_COLLECTION, CollectionTools.collection(annotationContainer.getNestedAnnotations()));
- }
-
- Iterator<String> keys = this.annotationContainers.keySet().iterator();
-
- while (keys.hasNext()) {
- String annotationName = keys.next();
- if (this.annotationContainers.get(annotationName).getNestedAnnotationsSize() == 0) {
- keys.remove();
- }
- }
- }
-
- private ASTVisitor buildSynchronizeAnnotationVisitor(ASTNode node, Set<Annotation> annotationsToRemove, Set<AnnotationContainer> containersToRemove) {
- return new SynchronizeAnnotationVisitor(node, annotationsToRemove, containersToRemove);
- }
-
- /**
- * called from {@link SynchronizeAnnotationVisitor}
- */
- /* private */ void addOrSyncAnnotation(org.eclipse.jdt.core.dom.Annotation node, Set<Annotation> annotationsToRemove, Set<AnnotationContainer> containersToRemove) {
- String jdtAnnotationName = ASTTools.resolveAnnotation(node);
- if (jdtAnnotationName != null) {
- if (this.annotationIsValidContainer(jdtAnnotationName)) {
- this.addOrSyncContainerAnnotation_(node, jdtAnnotationName, containersToRemove);
- }
- else if (this.annotationIsValid(jdtAnnotationName)) {
- this.addOrSyncAnnotation_(node, jdtAnnotationName, annotationsToRemove);
- }
- else if(this.annotationIsValidNestable(jdtAnnotationName)) {
- this.addOrSyncNestableAnnotation_(node, jdtAnnotationName, containersToRemove);
- }
- }
- }
-
- /**
- * pre-condition: jdtAnnotationName is valid
- */
- private void addOrSyncAnnotation_(org.eclipse.jdt.core.dom.Annotation node, String jdtAnnotationName, Set<Annotation> annotationsToRemove) {
- Annotation annotation = this.selectAnnotationNamed(annotationsToRemove, jdtAnnotationName);
- if (annotation != null) {
- annotation.synchronizeWith((CompilationUnit) node.getRoot());
- annotationsToRemove.remove(annotation);
- } else {
- annotation = this.buildAnnotation(jdtAnnotationName);
- annotation.initialize((CompilationUnit) node.getRoot());
- this.addItemToCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
- }
-
- /**
- * pre-condition: jdtAnnotationName is valid
- */
- private void addOrSyncNestableAnnotation_(org.eclipse.jdt.core.dom.Annotation node, String nestableAnnotationName, Set<AnnotationContainer> containersToRemove) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- if (container != null) {
- container.synchronizeNestableAnnotation(node);
- containersToRemove.remove(container);
- }
- else {
- container = new AnnotationContainer(nestableAnnotationName);
- container.initializeNestableAnnotation(node);
- this.annotationContainers.put(nestableAnnotationName, container);
- this.fireItemAdded(NESTABLE_ANNOTATIONS_COLLECTION, container.nestedAnnotationAt(0));
- }
- }
-
- /**
- * pre-condition: node is valid container annotation
- */
- private void addOrSyncContainerAnnotation_(org.eclipse.jdt.core.dom.Annotation node, String containerAnnotationName, Set<AnnotationContainer> containersToRemove) {
- String nestableAnnotationName = this.getNestableAnnotationName(containerAnnotationName);
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- if (container == null) {
- container = new AnnotationContainer(nestableAnnotationName);
- container.initialize(node);
- this.annotationContainers.put(nestableAnnotationName, container);
- this.fireItemsAdded(NESTABLE_ANNOTATIONS_COLLECTION, CollectionTools.collection(container.getNestedAnnotations()));
- }
- else {
- container.synchronize(node);
- containersToRemove.remove(container);
- }
- }
-
-
- // ********** miscellaneous **********
-
- public boolean isAnnotated() {
- return ! this.annotations.isEmpty() || ! this.annotationContainers.isEmpty();
- }
-
- public boolean isAnnotatedWith(Iterable<String> annotationNames) {
- for (Annotation annotation : this.getAnnotations()) {
- if (CollectionTools.contains(annotationNames, annotation.getAnnotationName())) {
- return true;
- }
- }
- for (Annotation annotation : this.getNestableAnnotations()) {
- if (CollectionTools.contains(annotationNames, annotation.getAnnotationName())) {
- return true;
- }
- }
- return false;
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.buildTextRange(this.annotatedElement.getBodyDeclaration(astRoot));
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.annotatedElement.getNameTextRange(astRoot);
- }
-
- public TextRange getTextRange(String nestableAnnotationName, CompilationUnit astRoot) {
- Annotation containerAnnotation = getContainerAnnotation(getAnnotationProvider().getContainerAnnotationName(nestableAnnotationName));
- if (containerAnnotation != null) {
- return containerAnnotation.getTextRange(astRoot);
- }
- Annotation nestableAnnotation = getAnnotation(0, nestableAnnotationName);
- return nestableAnnotation == null ? null : nestableAnnotation.getTextRange(astRoot);
- }
-
-
- private Annotation selectAnnotationNamed(Iterable<Annotation> list, String annotationName) {
- for (Annotation annotation : list) {
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- private TextRange buildTextRange(ASTNode astNode) {
- return (astNode == null) ? null : ASTTools.buildTextRange(astNode);
- }
-
-
- // ********** AST visitors **********
-
- /**
- * annotation visitor
- */
- protected static abstract class AnnotationVisitor
- extends ASTVisitor
- {
- protected final ASTNode node;
-
-
- protected AnnotationVisitor(ASTNode node) {
- super();
- this.node = node;
- }
-
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return this.visit_(node);
- }
-
- @Override
- public boolean visit(NormalAnnotation node) {
- return this.visit_(node);
- }
-
- @Override
- public boolean visit(MarkerAnnotation node) {
- return this.visit_(node);
- }
-
- protected boolean visit_(org.eclipse.jdt.core.dom.Annotation node) {
- // ignore annotations for child members, only this member
- if (node.getParent() == this.node) {
- this.visitChildAnnotation(node);
- }
- return false;
- }
-
- protected abstract void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node);
- }
-
-
- /**
- * initial annotation visitor
- */
- protected class InitialAnnotationVisitor
- extends AnnotationVisitor
- {
- protected InitialAnnotationVisitor(ASTNode node) {
- super(node);
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- SourceAnnotatedElement.this.addInitialAnnotation(node);
- }
- }
-
-
- /**
- * synchronize annotation visitor
- */
- protected class SynchronizeAnnotationVisitor
- extends AnnotationVisitor
- {
- protected final Set<Annotation> annotationsToRemove;
- protected final Set<AnnotationContainer> containersToRemove;
-
- protected SynchronizeAnnotationVisitor(ASTNode node, Set<Annotation> annotationsToRemove, Set<AnnotationContainer> containersToRemove) {
- super(node);
- this.annotationsToRemove = annotationsToRemove;
- this.containersToRemove = containersToRemove;
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- SourceAnnotatedElement.this.addOrSyncAnnotation(node, this.annotationsToRemove, this.containersToRemove);
- }
- }
-
-
- class AnnotationContainer extends SourceNode.AnnotationContainer<NestableAnnotation>
- {
- private final String nestableAnnotationName;
-
- private Annotation containerAnnotation;
-
- protected AnnotationContainer(String nestableAnnotationName) {
- super();
- this.nestableAnnotationName = nestableAnnotationName;
- }
-
- @Override
- public void initialize(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- super.initialize(astContainerAnnotation);
- this.containerAnnotation = this.buildContainerAnnotation(ASTTools.resolveAnnotation(astContainerAnnotation));
- }
-
- protected Annotation buildContainerAnnotation(String name) {
- return getAnnotationProvider().buildAnnotation(SourceAnnotatedElement.this, SourceAnnotatedElement.this.annotatedElement, name);
- }
-
- protected Annotation getContainerAnnotation() {
- return this.containerAnnotation;
- }
-
- @Override
- public void synchronize(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- super.synchronize(astContainerAnnotation);
- }
-
- /**
- * Return the element name of the nested annotations
- */
- @Override
- protected String getElementName() {
- return SourceAnnotatedElement.this.getNestableElementName(this.nestableAnnotationName);
- }
-
- /**
- * Return the nested annotation name
- */
- @Override
- protected String getNestedAnnotationName() {
- return this.nestableAnnotationName;
- }
-
- /**
- * Return a new nested annotation at the given index
- */
- @Override
- protected NestableAnnotation buildNestedAnnotation(int index) {
- return SourceAnnotatedElement.this.buildNestableAnnotation(this.nestableAnnotationName, index);
- }
-
- public void initializeNestableAnnotation(org.eclipse.jdt.core.dom.Annotation standaloneNestableAnnotation) {
- NestableAnnotation nestedAnnotation = this.buildNestedAnnotation(0);
- this.nestedAnnotations.add(nestedAnnotation);
- nestedAnnotation.initialize((CompilationUnit) standaloneNestableAnnotation.getRoot());
- }
-
- public void synchronizeNestableAnnotation(org.eclipse.jdt.core.dom.Annotation standaloneNestableAnnotation) {
- if (this.getNestedAnnotationsSize() > 1) {
- //ignore the new standalone annotation as a container annotation already exists
- }
- else if (this.getNestedAnnotationsSize() == 1) {
- this.containerAnnotation = null;
- this.nestedAnnotationAt(0).synchronizeWith((CompilationUnit) standaloneNestableAnnotation.getRoot());
- }
- }
-
- @Override
- public NestableAnnotation addNestedAnnotation(int index) {
- if (getNestedAnnotationsSize() == 1 && getContainerAnnotation() == null) {
- this.containerAnnotation = buildContainerAnnotation(getAnnotationProvider().getContainerAnnotationName(getNestedAnnotationName()));
- }
- return super.addNestedAnnotation(index);
- }
-
- @Override
- public NestableAnnotation removeNestedAnnotation(int index) {
- if (getNestedAnnotationsSize() == 2) {
- this.containerAnnotation = null;
- }
- return super.removeNestedAnnotation(index);
- }
-
- @Override
- protected void fireItemAdded(int index, NestableAnnotation nestedAnnotation) {
- SourceAnnotatedElement.this.fireItemAdded(NESTABLE_ANNOTATIONS_COLLECTION, nestedAnnotation);
- }
-
- @Override
- protected void fireItemsRemoved(int index, List<NestableAnnotation> removedItems) {
- SourceAnnotatedElement.this.fireItemsRemoved(NESTABLE_ANNOTATIONS_COLLECTION, removedItems);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotation.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotation.java
deleted file mode 100644
index cc7f47e155..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotation.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationElementAdapter;
-
-/**
- * some common state and behavior for Java source annotations;
- * and lots of convenience methods
- */
-public abstract class SourceAnnotation
- extends SourceNode
- implements Annotation
-{
- protected final AnnotatedElement annotatedElement;
-
- // TODO - make 'final' if we start using combination annotation adapters(?)
- protected DeclarationAnnotationAdapter daa;
-
- // TODO - make 'final' if we start using combination annotation adapters(?)
- protected AnnotationAdapter annotationAdapter;
-
-
- /**
- * constructor for straight member annotation
- */
- protected SourceAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- this(parent, element, daa, new ElementAnnotationAdapter(element, daa));
- }
-
- /**
- * constructor for nested annotation (typically)
- */
- protected SourceAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent);
- this.annotatedElement = element;
- this.daa = daa;
- this.annotationAdapter = annotationAdapter;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return this.getAnnotationTextRange(astRoot);
- }
-
-
- // ********** Annotation implementation **********
-
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return this.annotationAdapter.getAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- this.annotationAdapter.newMarkerAnnotation();
- }
-
- public void removeAnnotation() {
- this.annotationAdapter.removeAnnotation();
- }
-
- public boolean isUnset() {
- return true;
- }
-
-
- // ********** convenience methods **********
-
- protected DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, elementName);
- }
-
- protected DeclarationAnnotationElementAdapter<Boolean> buildBooleanElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(this.daa, elementName);
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildIntegerElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forNumbers(this.daa, elementName);
- }
-
- protected AnnotationElementAdapter<String> buildStringElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildIntegerElementAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Integer>(this.annotatedElement, daea);
- }
-
- /**
- /**
- * Return the text range corresponding to the annotation.
- * If the annotation is missing, return <code>null</code>.
- */
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.getTextRange(this.getAstAnnotation(astRoot));
- }
-
- /**
- * Convenience method.
- * Return the text range corresponding to the specified element.
- * If the specified element is missing, return the annotation's text range instead.
- */
- protected TextRange getElementTextRange(DeclarationAnnotationElementAdapter<?> elementAdapter, CompilationUnit astRoot) {
- return this.getElementTextRange(this.getAnnotationElementTextRange(elementAdapter, astRoot), astRoot);
- }
-
- /**
- * Convenience method. If the specified element text range is null
- * return the member's text range instead.
- */
- protected TextRange getElementTextRange(TextRange elementTextRange, CompilationUnit astRoot) {
- return (elementTextRange != null) ? elementTextRange : this.getAnnotationTextRange(astRoot);
- }
-
- /**
- * Convenience method. Return whether the specified position exists and
- * touches the specified element.
- */
- protected boolean elementTouches(DeclarationAnnotationElementAdapter<?> elementAdapter, int pos, CompilationUnit astRoot) {
- return this.textRangeTouches(this.getAnnotationElementTextRange(elementAdapter, astRoot), pos);
- }
-
- /**
- * Convenience method. Return whether the specified text range is not
- * null (meaning the corresponding AST node exists) and the specified position touches it.
- */
- protected boolean textRangeTouches(TextRange textRange, int pos) {
- return (textRange != null) && textRange.touches(pos);
- }
-
- /**
- * Return the text range corresponding to the specified element.
- * If the element is missing, return null.
- */
- protected TextRange getAnnotationElementTextRange(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.getTextRange(this.getAnnotationElementExpression(adapter, astRoot));
- }
-
- /**
- * Return the specified AST DOM element.
- */
- protected Expression getAnnotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return adapter.getExpression(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- /**
- * Return the text range corresponding to the element's indexed subvalue
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- protected TextRange getAnnotationElementSubvalueTextRange(IndexedDeclarationAnnotationElementAdapter<?> adapter, int index, CompilationUnit astRoot) {
- // the AST is null for virtual Java attributes
- // TODO remove the AST null check once we start storing text ranges
- // in the resource model
- return (astRoot == null) ? null : this.getTextRange(this.getAnnotationElementSubvalueExpression(adapter, index, astRoot));
- }
-
- /**
- * Return the expression corresponding to the element's indexed subvalue.
- */
- protected Expression getAnnotationElementSubvalueExpression(IndexedDeclarationAnnotationElementAdapter<?> adapter, int index, CompilationUnit astRoot) {
- return adapter.getSubvalueExpression(index, this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- /**
- * Return the text range corresponding to the specified AST node.
- * If the AST node is null, return null.
- */
- protected TextRange getTextRange(ASTNode astNode) {
- return (astNode == null) ? null : ASTTools.buildTextRange(astNode);
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
- /**
- * A container for nested annotations. The owner of the AnnotationContainer
- * needs to call initialize(CompilationUnit) on it.
- * @param <T> the type of the resource nestable annotations
- */
- public abstract class AnnotationContainer<T extends NestableAnnotation> extends SourceNode.AnnotationContainer<T>
- {
- protected AnnotationContainer() {
- super();
- }
-
- /**
- * Return the annotations property name for firing property change notification
- */
- protected abstract String getAnnotationsPropertyName();
-
- @Override
- protected void fireItemAdded(int index, T addedItem) {
- SourceAnnotation.this.fireItemAdded(this.getAnnotationsPropertyName(), index, addedItem);
- }
-
- @Override
- protected void fireItemsRemoved(int index, java.util.List<T> removedItems) {
- SourceAnnotation.this.fireItemsRemoved(this.getAnnotationsPropertyName(), index, removedItems);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAttribute.java
deleted file mode 100644
index 54cba44e7e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAttribute.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-
-/**
- * Java source attribute (field or method)
- */
-abstract class SourceAttribute<A extends Attribute>
- extends SourceMember<A>
- implements JavaResourceAttribute
-{
- private int modifiers;
-
- private String typeName;
-
- private boolean typeIsInterface;
-
- private boolean typeIsEnum;
-
- private boolean typeIsArray;
-
- private int typeArrayDimensionality;
-
- private String typeArrayComponentTypeName;
-
- private final Vector<String> typeSuperclassNames = new Vector<String>();
-
- private final Vector<String> typeInterfaceNames = new Vector<String>();
-
- private final Vector<String> typeTypeArgumentNames = new Vector<String>();
-
-
- protected SourceAttribute(JavaResourceType parent, A attribute){
- super(parent, attribute);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot); //build once, minor performance tweak for major benefit
- this.modifiers = this.buildModifiers(astRoot);
- this.typeName = this.buildTypeName(typeBinding);
- this.typeIsInterface = this.buildTypeIsInterface(typeBinding);
- this.typeIsEnum = this.buildTypeIsEnum(typeBinding);
- this.typeIsArray = this.buildTypeIsArray(typeBinding);
- this.typeArrayDimensionality = buildTypeArrayDimensionality(typeBinding);
- this.typeArrayComponentTypeName = buildTypeArrayComponentTypeName(typeBinding);
- this.typeSuperclassNames.addAll(this.buildTypeSuperclassNames(typeBinding));
- this.typeInterfaceNames.addAll(this.buildTypeInterfaceNames(typeBinding));
- this.typeTypeArgumentNames.addAll(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
-
- // ******** overrides ********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
- this.syncTypeName(this.buildTypeName(typeBinding));
- syncTypeArrayComponentTypeName(buildTypeArrayComponentTypeName(typeBinding));
- this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
- this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
- this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
- this.syncModifiers(this.buildModifiers(astRoot));
- this.syncTypeName(this.buildTypeName(typeBinding));
- this.syncTypeIsInterface(this.buildTypeIsInterface(typeBinding));
- this.syncTypeIsEnum(this.buildTypeIsEnum(typeBinding));
- this.syncTypeIsArray(this.buildTypeIsArray(typeBinding));
- syncTypeArrayDimensionality(buildTypeArrayDimensionality(typeBinding));
- syncTypeArrayComponentTypeName(buildTypeArrayComponentTypeName(typeBinding));
- this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
- this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
- this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ******** JavaResourceAttribute implementation ********
-
- @Override
- public JavaResourceType getParent() {
- return (JavaResourceType) super.getParent();
- }
-
- public JavaResourceType getResourceType() {
- return this.getParent();
- }
-
- public String getName() {
- return this.annotatedElement.getAttributeName();
- }
-
- public boolean typeIsSubTypeOf(String tn) {
- if (this.typeName == null) {
- return false;
- }
- return this.typeName.equals(tn)
- || this.typeInterfaceNames.contains(tn)
- || this.typeSuperclassNames.contains(tn);
- }
-
- public boolean typeIsVariablePrimitive() {
- return (this.typeName != null) && ClassName.isVariablePrimitive(this.typeName);
- }
-
- private ITypeBinding getTypeBinding(CompilationUnit astRoot) {
- return this.annotatedElement.getTypeBinding(astRoot);
- }
-
-
- // ***** modifiers
- public int getModifiers() {
- return this.modifiers;
- }
-
- private void syncModifiers(int astModifiers) {
- int old = this.modifiers;
- this.modifiers = astModifiers;
- this.firePropertyChanged(MODIFIERS_PROPERTY, old, astModifiers);
- }
-
- /**
- * zero seems like a reasonable default...
- */
- private int buildModifiers(CompilationUnit astRoot) {
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- return (binding == null) ? 0 : binding.getModifiers();
- }
-
- // ***** type name
- public String getTypeName() {
- return this.typeName;
- }
-
- private void syncTypeName(String astTypeName) {
- String old = this.typeName;
- this.typeName = astTypeName;
- this.firePropertyChanged(TYPE_NAME_PROPERTY, old, astTypeName);
- }
-
- /**
- * this can be an array (e.g. "java.lang.String[]");
- * but no generic type arguments
- */
- private String buildTypeName(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return null;
- }
-
- typeBinding = typeBinding.getErasure();
- String tbName = typeBinding.getTypeDeclaration().getQualifiedName();
- return (tbName.length() == 0) ? null : tbName;
- }
-
- // ***** type is interface
- public boolean typeIsInterface() {
- return this.typeIsInterface;
- }
-
- private void syncTypeIsInterface(boolean astTypeIsInterface) {
- boolean old = this.typeIsInterface;
- this.typeIsInterface = astTypeIsInterface;
- this.firePropertyChanged(TYPE_IS_INTERFACE_PROPERTY, old, astTypeIsInterface);
- }
-
- private boolean buildTypeIsInterface(ITypeBinding typeBinding) {
- return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isInterface();
- }
-
- // ***** type is enum
- public boolean typeIsEnum() {
- return this.typeIsEnum;
- }
-
- private void syncTypeIsEnum(boolean astTypeIsEnum) {
- boolean old = this.typeIsEnum;
- this.typeIsEnum = astTypeIsEnum;
- this.firePropertyChanged(TYPE_IS_ENUM_PROPERTY, old, astTypeIsEnum);
- }
-
- private boolean buildTypeIsEnum(ITypeBinding typeBinding) {
- return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isEnum();
- }
-
- // ***** type is array
- public boolean typeIsArray() {
- return this.typeIsArray;
- }
-
- private void syncTypeIsArray(boolean astTypeIsArray) {
- boolean old = this.typeIsArray;
- this.typeIsArray = astTypeIsArray;
- this.firePropertyChanged(TYPE_IS_ARRAY_PROPERTY, old, astTypeIsArray);
- }
-
- private boolean buildTypeIsArray(ITypeBinding typeBinding) {
- return (typeBinding != null) && typeBinding.isArray();
- }
-
- // ***** type array dimensionality
- public int getTypeArrayDimensionality() {
- return this.typeArrayDimensionality;
- }
-
- private void syncTypeArrayDimensionality(int astTypeArrayDimensionality) {
- int old = this.typeArrayDimensionality;
- this.typeArrayDimensionality = astTypeArrayDimensionality;
- firePropertyChanged(TYPE_ARRAY_DIMENSIONALITY_PROPERTY, old, astTypeArrayDimensionality);
- }
-
- private int buildTypeArrayDimensionality(ITypeBinding typeBinding) {
- return (typeBinding == null) ? 0 : typeBinding.getDimensions();
- }
-
- // ***** type array component type name
- public String getTypeArrayComponentTypeName() {
- return this.typeArrayComponentTypeName;
- }
-
- private void syncTypeArrayComponentTypeName(String astTypeArrayComponentTypeName) {
- String old = this.typeArrayComponentTypeName;
- this.typeArrayComponentTypeName = astTypeArrayComponentTypeName;
- firePropertyChanged(TYPE_ARRAY_COMPONENT_TYPE_NAME_PROPERTY, old, astTypeArrayComponentTypeName);
- }
-
- private String buildTypeArrayComponentTypeName(ITypeBinding typeBinding) {
- if (typeBinding == null || ! typeBinding.isArray()) {
- return null;
- }
-
- // the component type of String[][] is actually String[], whereas we want String
- while (typeBinding.isArray()) {
- typeBinding = typeBinding.getComponentType();
-
- if (typeBinding == null) {
- return null;
- }
- }
-
- // a type variable is what is declared by a generic type;
- // e.g. "E" is a type variable declared by the generic type "Collection" in
- // public interface Collection<E>
- if (typeBinding.isTypeVariable()) {
- // e.g. "E extends Number" has an erasure of "Number"
- typeBinding = typeBinding.getErasure();
- }
- String tbName = typeBinding.getTypeDeclaration().getQualifiedName();
- return (tbName.length() == 0) ? null : tbName;
- }
-
- // ***** type superclass hierarchy
- public ListIterable<String> getTypeSuperclassNames() {
- return new LiveCloneListIterable<String>(this.typeSuperclassNames);
- }
-
- private void syncTypeSuperclassNames(List<String> astTypeSuperclassNames) {
- this.synchronizeList(astTypeSuperclassNames, this.typeSuperclassNames, TYPE_SUPERCLASS_NAMES_LIST);
- }
-
- private List<String> buildTypeSuperclassNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptyList();
- }
- ArrayList<String> names = new ArrayList<String>();
- typeBinding = typeBinding.getSuperclass();
- while (typeBinding != null) {
- names.add(typeBinding.getQualifiedName());
- typeBinding = typeBinding.getSuperclass();
- }
- return names;
- }
-
- // ***** type interface hierarchy
- public Iterable<String> getTypeInterfaceNames() {
- return new LiveCloneIterable<String>(this.typeInterfaceNames);
- }
-
-// private boolean typeInterfaceNamesContains(String interfaceName) {
-// return this.typeInterfaceNames.contains(interfaceName);
-// }
-//
- private void syncTypeInterfaceNames(Collection<String> astTypeInterfaceNames) {
- this.synchronizeCollection(astTypeInterfaceNames, this.typeInterfaceNames, TYPE_INTERFACE_NAMES_COLLECTION);
- }
-
- private Collection<String> buildTypeInterfaceNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptySet();
- }
- HashSet<String> names = new HashSet<String>();
- while (typeBinding != null) {
- this.addInterfaceNamesTo(typeBinding, names);
- typeBinding = typeBinding.getSuperclass();
- }
- return names;
- }
-
- private void addInterfaceNamesTo(ITypeBinding typeBinding, HashSet<String> names) {
- for (ITypeBinding interfaceBinding : typeBinding.getInterfaces()) {
- names.add(interfaceBinding.getTypeDeclaration().getQualifiedName());
- this.addInterfaceNamesTo(interfaceBinding, names); // recurse
- }
- }
-
- // ***** type type argument names
- public ListIterable<String> getTypeTypeArgumentNames() {
- return new LiveCloneListIterable<String>(this.typeTypeArgumentNames);
- }
-
- public int getTypeTypeArgumentNamesSize() {
- return this.typeTypeArgumentNames.size();
- }
-
- public String getTypeTypeArgumentName(int index) {
- return this.typeTypeArgumentNames.get(index);
- }
-
- private void syncTypeTypeArgumentNames(List<String> astTypeTypeArgumentNames) {
- this.synchronizeList(astTypeTypeArgumentNames, this.typeTypeArgumentNames, TYPE_TYPE_ARGUMENT_NAMES_LIST);
- }
-
- /**
- * these types can be arrays (e.g. "java.lang.String[]");
- * but they won't have any further nested generic type arguments
- * (e.g. "java.util.Collection<java.lang.String>")
- */
- private List<String> buildTypeTypeArgumentNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptyList();
- }
-
- ITypeBinding[] typeArguments = typeBinding.getTypeArguments();
- if (typeArguments.length == 0) {
- return Collections.emptyList();
- }
-
- ArrayList<String> names = new ArrayList<String>(typeArguments.length);
- for (ITypeBinding typeArgument : typeArguments) {
- if (typeArgument == null) {
- names.add(null);
- } else {
- // e.g. "? extends Number" has an erasure of "Number"
- ITypeBinding erasure = typeArgument.getErasure();
- names.add(erasure.getTypeDeclaration().getQualifiedName());
- }
- }
- return names;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java
deleted file mode 100644
index 57c43e85dd..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceCompilationUnit.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-
-/**
- * Java compilation unit (source file)
- */
-public abstract class SourceCompilationUnit
- extends SourceNode
- implements JavaResourceCompilationUnit
-{
- /** JDT compilation unit */
- final ICompilationUnit compilationUnit;
-
- /** pluggable annotation provider */
- private final AnnotationProvider annotationProvider;
-
- /** improved annotation formatting */
- private final AnnotationEditFormatter annotationEditFormatter;
-
- /** pluggable executor that allows the document to be modified on another thread */
- private final CommandExecutor modifySharedDocumentCommandExecutor;
-
- /** listeners notified whenever the resource model changes */
- private final ListenerList<JptResourceModelListener> resourceModelListenerList;
-
-
- // ********** construction **********
-
- protected SourceCompilationUnit(
- ICompilationUnit compilationUnit,
- AnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(null); // the JPA compilation unit is the root of its sub-tree
- this.compilationUnit = compilationUnit;
- this.annotationProvider = annotationProvider;
- this.annotationEditFormatter = annotationEditFormatter;
- this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor;
- this.resourceModelListenerList = new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // never called?
- }
-
- void openCompilationUnit() {
- try {
- this.compilationUnit.open(null);
- } catch (JavaModelException ex) {
- // do nothing - we just won't have a primary type in this case
- }
- }
-
- void closeCompilationUnit() {
- try {
- this.compilationUnit.close();
- } catch (JavaModelException ex) {
- // hmmm
- }
- }
-
-
- // ********** AbstractJavaResourceNode overrides **********
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public JavaResourceCompilationUnit getRoot() {
- return this;
- }
-
- @Override
- public IFile getFile() {
- return (IFile) this.compilationUnit.getResource();
- }
-
- @Override
- public AnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public ICompilationUnit getCompilationUnit() {
- return this.compilationUnit;
- }
-
- public CommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutor;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return this.annotationEditFormatter;
- }
-
- @Override
- public CompilationUnit buildASTRoot() {
- return ASTTools.buildASTRoot(this.compilationUnit);
- }
-
-
- // ********** JpaResourceModel implementation **********
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-
- // ********** Java changes **********
-
- public void synchronizeWithJavaSource() {
- this.synchronizeWith(this.buildASTRoot());
- }
-
-
- // ********** internal **********
-
- String getCompilationUnitName() {
- return this.removeJavaExtension(this.compilationUnit.getElementName());
- }
-
- private String removeJavaExtension(String fileName) {
- int index = fileName.lastIndexOf(".java"); //$NON-NLS-1$
- return (index == -1) ? fileName : fileName.substring(0, index);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getCompilationUnitName());
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnum.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnum.java
deleted file mode 100644
index edc6b44065..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnum.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.Enum;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.SimpleIntReference;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-
-/**
- * Java source type
- */
-final class SourceEnum
- extends SourceAbstractType<Enum>
- implements JavaResourceEnum
-{
-
- private final Vector<JavaResourceEnumConstant> enumConstants;
-
-
-
- // ********** construction/initialization **********
-
- /**
- * build top-level type
- */
- static JavaResourceEnum newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- EnumDeclaration enumDeclaration,
- CompilationUnit astRoot) {
- Enum _enum = new JDTEnum(
- enumDeclaration,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceEnum jre = new SourceEnum(javaResourceCompilationUnit, _enum);
- jre.initialize(astRoot);
- return jre;
- }
-
- /**
- * build nested type
- */
- protected static JavaResourceEnum newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- Type declaringType,
- EnumDeclaration enumDeclaration,
- int occurrence,
- CompilationUnit astRoot) {
- Enum _enum = new JDTEnum(
- declaringType,
- enumDeclaration,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceEnum jre = new SourceEnum(javaResourceCompilationUnit, _enum);
- jre.initialize(astRoot);
- return jre;
- }
-
- private SourceEnum(JavaResourceCompilationUnit javaResourceCompilationUnit, Enum _enum) {
- super(javaResourceCompilationUnit, _enum);
- this.enumConstants = new Vector<JavaResourceEnumConstant>();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.initializeEnumConstants(astRoot);
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncEnumConstants(astRoot);
- }
-
-
- // ********** SourceAnnotatedElement implementation **********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
-
- for (JavaResourceEnumConstant enumConstant : this.getEnumConstants()) {
- enumConstant.resolveTypes(astRoot);
- }
- }
-
-
- // ******** JavaResourceAnnotatedElement implementation ********
-
- public Kind getKind() {
- return Kind.ENUM;
- }
-
-
- // ********** enum constants **********
-
- public Iterable<JavaResourceEnumConstant> getEnumConstants() {
- return new LiveCloneIterable<JavaResourceEnumConstant>(this.enumConstants);
- }
-
- private void addEnumConstant(JavaResourceEnumConstant enumConstant) {
- this.addItemToCollection(enumConstant, this.enumConstants, ENUM_CONSTANTS_COLLECTION);
- }
-
- private JavaResourceEnumConstant getEnumConstant(String fieldName, int occurrence) {
- for (JavaResourceEnumConstant enumConstant : this.getEnumConstants()) {
- if (enumConstant.isFor(fieldName, occurrence)) {
- return enumConstant;
- }
- }
- return null;
- }
-
- private void removeEnumConstants(Collection<JavaResourceEnumConstant> remove) {
- this.removeItemsFromCollection(remove, this.enumConstants, ENUM_CONSTANTS_COLLECTION);
- }
-
- private void initializeEnumConstants(CompilationUnit astRoot) {
- EnumConstantDeclaration[] enumConstantDeclarations = this.annotatedElement.getEnumConstants(astRoot);
- CounterMap counters = new CounterMap(enumConstantDeclarations.length);
- for (EnumConstantDeclaration enumConstantDeclaration : enumConstantDeclarations) {
- String constantName = enumConstantDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(constantName);
- this.enumConstants.add(this.buildEnumConstant(constantName, occurrence, astRoot));
- }
- }
-
- private void syncEnumConstants(CompilationUnit astRoot) {
- EnumConstantDeclaration[] enumConstantDeclarations = this.annotatedElement.getEnumConstants(astRoot);
- CounterMap counters = new CounterMap(enumConstantDeclarations.length);
- HashSet<JavaResourceEnumConstant> enumConstantsToRemove = new HashSet<JavaResourceEnumConstant>(this.enumConstants);
- for (EnumConstantDeclaration enumConstantDeclaration : enumConstantDeclarations) {
- String constantName = enumConstantDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(constantName);
-
- JavaResourceEnumConstant enumConstant = this.getEnumConstant(constantName, occurrence);
- if (enumConstant == null) {
- this.addEnumConstant(this.buildEnumConstant(constantName, occurrence, astRoot));
- } else {
- enumConstantsToRemove.remove(enumConstant);
- enumConstant.synchronizeWith(astRoot);
- }
- }
- this.removeEnumConstants(enumConstantsToRemove);
- }
-
- private JavaResourceEnumConstant buildEnumConstant(String fieldName, int occurrence, CompilationUnit astRoot) {
- return SourceEnumConstant.newInstance(this, this.annotatedElement, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
-
- public Iterable<JavaResourceType> getTypes() {
- return EmptyIterable.instance();
- }
-
- public Iterable<JavaResourceType> getAllTypes() {
- return EmptyIterable.instance();
- }
-
- public Iterable<JavaResourceEnum> getEnums() {
- return EmptyIterable.instance();
- }
-
- public Iterable<JavaResourceEnum> getAllEnums() {
- return new SingleElementIterable<JavaResourceEnum>(this);
- }
-
- // ********** CounterMap **********
-
- private static class CounterMap {
- private final HashMap<Object, SimpleIntReference> counters;
-
- protected CounterMap(int initialCapacity) {
- super();
- this.counters = new HashMap<Object, SimpleIntReference>(initialCapacity);
- }
-
- /**
- * Return the incremented count for the specified object.
- */
- int increment(Object o) {
- SimpleIntReference counter = this.counters.get(o);
- if (counter == null) {
- counter = new SimpleIntReference();
- this.counters.put(o, counter);
- }
- counter.increment();
- return counter.getValue();
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnumConstant.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnumConstant.java
deleted file mode 100644
index 939a08f374..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceEnumConstant.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.jdt.Enum;
-import org.eclipse.jpt.common.core.utility.jdt.EnumConstant;
-
-/**
- * Java source enum constant
- */
-final class SourceEnumConstant
- extends SourceMember<EnumConstant>
- implements JavaResourceEnumConstant
-{
-
- /**
- * construct enum constant
- */
- static JavaResourceEnumConstant newInstance(
- JavaResourceEnum parent,
- Enum declaringEnum,
- String name,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
-
- EnumConstant enumConstant = new JDTEnumConstant(
- declaringEnum,
- name,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceEnumConstant jrec = new SourceEnumConstant(parent, enumConstant);
- jrec.initialize(astRoot);
- return jrec;
- }
-
-
- private SourceEnumConstant(JavaResourceEnum parent, EnumConstant enumConstant){
- super(parent, enumConstant);
- }
-
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- }
-
-
- // ******** JavaResourceAnnotatedElement implementation ********
-
- public Kind getKind() {
- return Kind.ENUM_CONSTANT;
- }
-
-
- // ******** overrides ********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ******** JavaResourceEnumConstant implementation ********
-
- public String getName() {
- return this.annotatedElement.getName();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceField.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceField.java
deleted file mode 100644
index 936231cc6a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceField.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.FieldAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-
-/**
- * Java source field
- */
-final class SourceField
- extends SourceAttribute<FieldAttribute>
- implements JavaResourceField
-{
-
- /**
- * construct field attribute
- */
- static JavaResourceField newInstance(
- JavaResourceType parent,
- Type declaringType,
- String name,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
-
- FieldAttribute field = new JDTFieldAttribute(
- declaringType,
- name,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceField jrpa = new SourceField(parent, field);
- jrpa.initialize(astRoot);
- return jrpa;
- }
-
-
- private SourceField(JavaResourceType parent, FieldAttribute field){
- super(parent, field);
- }
-
- // ******** JavaResourceAnnotatedElement implementation ********
-
- public Kind getKind() {
- return Kind.FIELD;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMember.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMember.java
deleted file mode 100644
index 588efe1a33..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMember.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-
-/**
- * Java source member (annotations, "persistable")
- */
-abstract class SourceMember<M extends Member>
- extends SourceAnnotatedElement<M>
- implements JavaResourceMember
-{
-
- boolean final_; // 'final' is a reserved word
-
- boolean transient_; // 'transient' is a reserved word
-
- boolean public_; // 'public' is a reserved word
-
- boolean static_; // 'static' is a reserved word
-
-
- // ********** construction/initialization **********
-
- SourceMember(JavaResourceNode parent, M member) {
- super(parent, member);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- this.final_ = this.buildFinal(binding);
- this.transient_ = this.buildTransient(binding);
- this.public_ = this.buildPublic(binding);
- this.static_ = this.buildStatic(binding);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncFinal(this.buildFinal(binding));
- this.syncTransient(this.buildTransient(binding));
- this.syncPublic(this.buildPublic(binding));
- this.syncStatic(this.buildStatic(binding));
- }
-
-
- // ********** annotations **********
-
- public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- ArrayList<String> annotationNames = new ArrayList<String>();
- CollectionTools.addAll(annotationNames, supportingAnnotationNames);
- if (primaryAnnotationName != null) {
- annotationNames.add(primaryAnnotationName);
- }
- for (Annotation annotation : this.getAnnotations()) {
- if ( ! CollectionTools.contains(annotationNames, annotation.getAnnotationName())) {
- this.annotations.remove(annotation);
- annotation.removeAnnotation();
- }
- }
- Iterator<AnnotationContainer> containers = this.annotationContainers.values().iterator();
- for (; containers.hasNext();) {
- AnnotationContainer container = containers.next();
- if (container.getContainerAnnotation() != null) {
- if ( ! CollectionTools.contains(annotationNames, container.getContainerAnnotation().getAnnotationName())) {
- containers.remove();
- container.getContainerAnnotation().removeAnnotation();
- }
- }
- else {
- //At this point the only thing remaining would be a standalone "nestable" annotation
- String nestedAnnotatioName = container.getNestedAnnotationName();
- if ( ! CollectionTools.contains(annotationNames, nestedAnnotatioName)) {
- containers.remove();
- container.getNestedAnnotations().iterator().next().removeAnnotation();
- }
- }
- }
-
- Annotation newPrimaryAnnotation = this.getAnnotation(primaryAnnotationName);
- if ((primaryAnnotationName != null) && (newPrimaryAnnotation == null)) {
- newPrimaryAnnotation = this.buildAnnotation(primaryAnnotationName);
- this.annotations.add(newPrimaryAnnotation);
- newPrimaryAnnotation.newAnnotation();
- }
- return newPrimaryAnnotation;
- }
-
-
- // ***** final
- public boolean isFinal() {
- return this.final_;
- }
-
- private void syncFinal(boolean astFinal) {
- boolean old = this.final_;
- this.final_ = astFinal;
- this.firePropertyChanged(FINAL_PROPERTY, old, astFinal);
- }
-
- private boolean buildFinal(IBinding binding) {
- return (binding == null) ? false : Modifier.isFinal(binding.getModifiers());
- }
-
- // ***** transient
- public boolean isTransient() {
- return this.transient_;
- }
-
- private void syncTransient(boolean astTransient) {
- boolean old = this.transient_;
- this.transient_ = astTransient;
- this.firePropertyChanged(TRANSIENT_PROPERTY, old, astTransient);
- }
-
- private boolean buildTransient(IBinding binding) {
- return (binding == null) ? false : Modifier.isTransient(binding.getModifiers());
- }
-
- // ***** public
- public boolean isPublic() {
- return this.public_;
- }
-
- private void syncPublic(boolean astPublic) {
- boolean old = this.public_;
- this.public_ = astPublic;
- this.firePropertyChanged(PUBLIC_PROPERTY, old, astPublic);
- }
-
- private boolean buildPublic(IBinding binding) {
- return (binding == null) ? false : Modifier.isPublic(binding.getModifiers());
- }
-
- // ***** static
- public boolean isStatic() {
- return this.static_;
- }
-
- private void syncStatic(boolean astStatic) {
- boolean old = this.static_;
- this.static_ = astStatic;
- this.firePropertyChanged(STATIC_PROPERTY, old, astStatic);
- }
-
- private boolean buildStatic(IBinding binding) {
- return (binding == null) ? false : Modifier.isStatic(binding.getModifiers());
- }
-
-
- // ********** miscellaneous **********
-
- public boolean isFor(String memberName, int occurrence) {
- return this.annotatedElement.matches(memberName, occurrence);
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMethod.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMethod.java
deleted file mode 100644
index 99cda60bc4..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceMethod.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTMethodAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-
-/**
- * Java source method
- */
-final class SourceMethod
- extends SourceAttribute<MethodAttribute>
- implements JavaResourceMethod {
-
- boolean constructor;
-
- private final Vector<String> parameterTypeNames = new Vector<String>();
-
-
- /**
- * construct method
- */
- static JavaResourceMethod newInstance(
- JavaResourceType parent,
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
-
- MethodAttribute method = JDTMethodAttribute.newInstance(
- declaringType,
- signature,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceMethod jrm = new SourceMethod(parent, method);
- jrm.initialize(astRoot);
- return jrm;
- }
-
-
- private SourceMethod(JavaResourceType parent, MethodAttribute method){
- super(parent, method);
- }
-
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- IMethodBinding binding = this.annotatedElement.getBinding(astRoot);
- this.constructor = this.buildConstructor(binding);
- this.parameterTypeNames.addAll(this.buildParameterTypeNames(binding));
- }
-
-
- // ******** JavaResourceAnnotatedElement implementation ********
-
- public Kind getKind() {
- return Kind.METHOD;
- }
-
-
- // ******** overrides ********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- IMethodBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncConstructor(this.buildConstructor(binding));
- this.syncParameterTypeNames(this.buildParameterTypeNames(binding));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getMethodName());
- }
-
-
- // ***** method name *****
-
- public String getMethodName() {
- return this.annotatedElement.getName();
- }
-
-
- // ***** parameter type names *****
-
- public ListIterable<String> getParameterTypeNames() {
- return new LiveCloneListIterable<String>(this.parameterTypeNames);
- }
-
- public String getParameterTypeName(int index) {
- return this.parameterTypeNames.get(index);
- }
-
- public int getParametersSize() {
- return this.parameterTypeNames.size();
- }
-
- private void syncParameterTypeNames(List<String> astParameterTypeNames) {
- this.synchronizeList(astParameterTypeNames, this.parameterTypeNames, PARAMETER_TYPE_NAMES_LIST);
- }
-
- private List<String> buildParameterTypeNames(IMethodBinding methodBinding) {
- if (methodBinding == null) {
- return Collections.emptyList();
- }
- ArrayList<String> names = new ArrayList<String>();
- for (ITypeBinding parameterType : methodBinding.getParameterTypes()) {
- if (parameterType.isTypeVariable()) {
- // e.g. "E extends Number" has an erasure of "Number"
- parameterType = parameterType.getErasure();
- }
- String ptName = parameterType.getTypeDeclaration().getQualifiedName();
- names.add(ptName);
- }
- return names;
- }
-
-
- // ***** constructor *****
-
- public boolean isConstructor() {
- return this.constructor;
- }
-
- private void syncConstructor(boolean astConstructor) {
- boolean old = this.constructor;
- this.constructor = astConstructor;
- this.firePropertyChanged(CONSTRUCTOR_PROPERTY, old, astConstructor);
- }
-
- private boolean buildConstructor(IMethodBinding methodBinding) {
- return methodBinding == null ? false : methodBinding.isConstructor();
- }
-
-
- // ***** misc *****
-
- public boolean isFor(MethodSignature signature, int occurrence) {
- return this.annotatedElement.matches(signature, occurrence);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNamedAnnotation.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNamedAnnotation.java
deleted file mode 100644
index 87225ba0fb..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNamedAnnotation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-
-/**
- * Used for annotations that have no behavior, just a name
- */
-public final class SourceNamedAnnotation
- extends SourceAnnotation
-{
- private final String annotationName;
-
- public SourceNamedAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, String annotationName) {
- super(parent, annotatedElement, new SimpleDeclarationAnnotationAdapter(annotationName));
- this.annotationName = annotationName;
- }
-
- public String getAnnotationName() {
- return this.annotationName;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //nothing
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNode.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNode.java
deleted file mode 100644
index 2b2ffbaa38..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceNode.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-
-
-/**
- * Source convenience methods
- */
-public abstract class SourceNode
- extends AbstractJavaResourceNode
-{
-
- public SourceNode(JavaResourceNode parent) {
- super(parent);
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- return (JavaResourceCompilationUnit) this.getRoot();
- }
-
- protected CompilationUnit buildASTRoot() {
- return this.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
- /**
- * A container for nested annotations. The owner of the AnnotationContainer
- * needs to call initialize(org.eclipse.jdt.core.dom.Annotation) on it.
- * @param <T> the type of the resource nestable annotations
- */
- abstract class AnnotationContainer<T extends NestableAnnotation>
- {
- protected final Vector<T> nestedAnnotations = new Vector<T>();
-
- protected AnnotationContainer() {
- super();
- }
-
- /**
- * Return the element name of the nested annotations
- */
- protected abstract String getElementName();
-
- /**
- * Return the nested annotation name
- */
- protected abstract String getNestedAnnotationName();
-
- /**
- * Return a new nested annotation at the given index
- */
- protected abstract T buildNestedAnnotation(int index);
-
- protected abstract void fireItemAdded(int index, T nestedAnnotation);
-
- protected abstract void fireItemsRemoved(int index, List<T> removedItems);
-
- public void initialize(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- // ignore the nested AST annotations themselves
- // (maybe someday we can use them during initialization...)
- int size = this.getNestedAstAnnotations(astContainerAnnotation).size();
- for (int i = 0; i < size; i++) {
- T nestedAnnotation = this.buildNestedAnnotation(i);
- this.nestedAnnotations.add(i, nestedAnnotation);
- nestedAnnotation.initialize((CompilationUnit) astContainerAnnotation.getRoot());
- }
- }
-
- /**
- * Synchronize the resource model annotations with those in the specified AST.
- * Trigger the appropriate change notification.
- */
- public void synchronize(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- ArrayList<org.eclipse.jdt.core.dom.Annotation> astAnnotations = this.getNestedAstAnnotations(astContainerAnnotation);
- Iterator<org.eclipse.jdt.core.dom.Annotation> astAnnotationStream = astAnnotations.iterator();
-
- for (T nestedAnnotation : this.getNestedAnnotations()) {
- if (astAnnotationStream.hasNext()) {
- // matching AST annotation is present - synchronize the nested annotation
- astAnnotationStream.next(); // maybe someday we can pass this to the update
- nestedAnnotation.synchronizeWith((CompilationUnit) astContainerAnnotation.getRoot());
- } else {
- // no more AST annotations - remove the remaining nested annotations and exit
- this.syncRemoveNestedAnnotations(astAnnotations.size());
- return;
- }
- }
-
- // add nested annotations for any remaining AST annotations
- while (astAnnotationStream.hasNext()) {
- this.syncAddNestedAnnotation(astAnnotationStream.next());
- }
- }
-
- public ListIterable<T> getNestedAnnotations() {
- return new LiveCloneListIterable<T>(this.nestedAnnotations);
- }
-
- public int getNestedAnnotationsSize() {
- return this.nestedAnnotations.size();
- }
-
- public T nestedAnnotationAt(int index) {
- return this.nestedAnnotations.get(index);
- }
-
- public T addNestedAnnotation(int index) {
- // add a new annotation to the end of the list...
- int sourceIndex = this.getNestedAnnotationsSize();
- T nestedAnnotation = this.buildNestedAnnotation(sourceIndex);
- this.nestedAnnotations.add(sourceIndex, nestedAnnotation);
- nestedAnnotation.newAnnotation();
- nestedAnnotation.initialize(nestedAnnotation.getJavaResourceCompilationUnit().buildASTRoot());
- // ...then move it to the specified index
- this.moveNestedAnnotation(index, sourceIndex);
- return nestedAnnotation;
- }
-
- public T moveNestedAnnotation(int targetIndex, int sourceIndex) {
- if (targetIndex != sourceIndex) {
- return this.moveNestedAnnotation_(targetIndex, sourceIndex);
- }
- return null;
- }
-
- public T removeNestedAnnotation(int index) {
- T nestedAnnotation = this.nestedAnnotations.remove(index);
- nestedAnnotation.removeAnnotation();
- this.syncAstAnnotationsAfterRemove(index);
- return nestedAnnotation;
- }
-
- private T moveNestedAnnotation_(int targetIndex, int sourceIndex) {
- T nestedAnnotation = CollectionTools.move(this.nestedAnnotations, targetIndex, sourceIndex).get(targetIndex);
- this.syncAstAnnotationsAfterMove(targetIndex, sourceIndex, nestedAnnotation);
- return nestedAnnotation;
- }
-
- /**
- * Return a list of the nested AST annotations.
- */
- private ArrayList<org.eclipse.jdt.core.dom.Annotation> getNestedAstAnnotations(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- ArrayList<org.eclipse.jdt.core.dom.Annotation> result = new ArrayList<org.eclipse.jdt.core.dom.Annotation>();
- if (astContainerAnnotation == null || astContainerAnnotation.isMarkerAnnotation()) {
- // no nested annotations
- }
- else if (astContainerAnnotation.isSingleMemberAnnotation()) {
- if (this.getElementName().equals("value")) { //$NON-NLS-1$
- Expression ex = ((SingleMemberAnnotation) astContainerAnnotation).getValue();
- this.addAstAnnotationsTo(ex, result);
- } else {
- // no nested annotations
- }
- }
- else if (astContainerAnnotation.isNormalAnnotation()) {
- MemberValuePair pair = this.getMemberValuePair((NormalAnnotation) astContainerAnnotation);
- if (pair == null) {
- // no nested annotations
- } else {
- this.addAstAnnotationsTo(pair.getValue(), result);
- }
- }
- return result;
- }
-
- /**
- * Add whatever annotations are represented by the specified expression to
- * the specified list. Do not add null to the list for any non-annotation expression.
- */
- private void addAstAnnotationsTo(Expression expression, ArrayList<org.eclipse.jdt.core.dom.Annotation> astAnnotations) {
- if (expression == null) {
- //do not add null to the list, not sure how we would get here...
- }
- else if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- this.addAstAnnotationsTo((ArrayInitializer) expression, astAnnotations);
- }
- else {
- org.eclipse.jdt.core.dom.Annotation astAnnotation = this.getAstAnnotation_(expression);
- if (astAnnotation != null) {
- astAnnotations.add(astAnnotation);
- }
- }
- }
-
- private void addAstAnnotationsTo(ArrayInitializer arrayInitializer, ArrayList<org.eclipse.jdt.core.dom.Annotation> astAnnotations) {
- List<Expression> expressions = this.expressions(arrayInitializer);
- for (Expression expression : expressions) {
- org.eclipse.jdt.core.dom.Annotation astAnnotation = getAstAnnotation(expression);
- if (astAnnotation != null) {
- astAnnotations.add(astAnnotation);
- }
- }
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<Expression> expressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
- /**
- * If the specified expression is an annotation with the specified name, return it;
- * otherwise return null.
- */
- private org.eclipse.jdt.core.dom.Annotation getAstAnnotation(Expression expression) {
- // not sure how the expression could be null...
- return (expression == null) ? null : getAstAnnotation_(expression);
- }
-
- /**
- * pre-condition: expression is not null
- */
- private org.eclipse.jdt.core.dom.Annotation getAstAnnotation_(Expression expression) {
- switch (expression.getNodeType()) {
- case ASTNode.NORMAL_ANNOTATION:
- case ASTNode.SINGLE_MEMBER_ANNOTATION:
- case ASTNode.MARKER_ANNOTATION:
- org.eclipse.jdt.core.dom.Annotation astAnnotation = (org.eclipse.jdt.core.dom.Annotation) expression;
- if (this.getQualifiedName(astAnnotation).equals(this.getNestedAnnotationName())) {
- return astAnnotation;
- }
- return null;
- default:
- return null;
- }
- }
-
- private String getQualifiedName(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- ITypeBinding typeBinding = astAnnotation.resolveTypeBinding();
- if (typeBinding != null) {
- String resolvedName = typeBinding.getQualifiedName();
- if (resolvedName != null) {
- return resolvedName;
- }
- }
- return astAnnotation.getTypeName().getFullyQualifiedName();
- }
-
- private MemberValuePair getMemberValuePair(NormalAnnotation annotation) {
- List<MemberValuePair> pairs = this.values(annotation);
- for (MemberValuePair pair : pairs) {
- if (pair.getName().getFullyQualifiedName().equals(this.getElementName())) {
- return pair;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
- /**
- * An annotation was moved within the specified annotation container from
- * the specified source index to the specified target index.
- * Synchronize the AST annotations with the resource model annotation container,
- * starting with the lower index to prevent overlap.
- */
- private void syncAstAnnotationsAfterMove(int targetIndex, int sourceIndex, T nestedAnnotation) {
- // move the Java annotation to the end of the list...
- nestedAnnotation.moveAnnotation(this.getNestedAnnotationsSize());
- // ...then shift the other AST annotations over one slot...
- if (sourceIndex < targetIndex) {
- for (int i = sourceIndex; i < targetIndex; i++) {
- this.nestedAnnotations.get(i).moveAnnotation(i);
- }
- } else {
- for (int i = sourceIndex; i > targetIndex; i-- ) {
- this.nestedAnnotations.get(i).moveAnnotation(i);
- }
- }
- // ...then move the AST annotation to the now empty slot at the target index
- nestedAnnotation.moveAnnotation(targetIndex);
- }
-
- /**
- * An annotation was removed from the specified annotation container at the
- * specified index.
- * Synchronize the AST annotations with the resource model annotation container,
- * starting at the specified index to prevent overlap.
- */
- private void syncAstAnnotationsAfterRemove(int index) {
- for (int i = index; i < this.getNestedAnnotationsSize(); i++) {
- // the indices are the same because the model annotations are
- // already in the proper locations - it's the AST annotations that
- // need to be moved to the matching location
- this.nestedAnnotations.get(i).moveAnnotation(i);
- }
- }
-
- protected void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.getNestedAnnotationsSize();
- T nestedAnnotation = this.buildNestedAnnotation(index);
- nestedAnnotation.initialize((CompilationUnit) astAnnotation.getRoot());
- this.nestedAnnotations.add(index, nestedAnnotation);
- this.fireItemAdded(index, nestedAnnotation);
- }
-
- protected void syncRemoveNestedAnnotations(int index) {
- List<T> subList = this.nestedAnnotations.subList(index, this.getNestedAnnotationsSize());
- List<T> removedItems = new ArrayList<T>(subList);
- subList.clear();
- this.fireItemsRemoved(index, removedItems);
- }
-
- public boolean isEmpty() {
- return this.nestedAnnotations.isEmpty();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- public void toString(StringBuilder sb) {
- sb.append(this.nestedAnnotations);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackage.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackage.java
deleted file mode 100644
index 7c3d504d1d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackage.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IPackageBinding;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTPackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedPackage;
-
-/**
- * @author Dmitry Geraskov
- * Source package-info.java
- *
- */
-public final class SourcePackage
- extends SourceAnnotatedElement<AnnotatedPackage>
- implements JavaResourcePackage
-{
-
- private String name;
-
- /**
- * construct package info
- */
- public static JavaResourcePackage newInstance(
- JavaResourceCompilationUnit parent,
- PackageDeclaration declaringPackage,
- CompilationUnit astRoot) {
- AnnotatedPackage pack = new JDTPackage(
- declaringPackage,
- parent.getCompilationUnit(),
- parent.getModifySharedDocumentCommandExecutor(),
- parent.getAnnotationEditFormatter());
- JavaResourcePackage jrpp = new SourcePackage(parent, pack);
- jrpp.initialize(astRoot);
- return jrpp;
- }
-
- private SourcePackage(
- JavaResourceCompilationUnit parent,
- AnnotatedPackage pack){
- super(parent, pack);
- }
-
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.name = this.buildName(astRoot);
- }
-
- // ******** JavaResourceAnnotatedElement implementation ********
-
- public Kind getKind() {
- return Kind.PACKAGE;
- }
-
-
- // ********** JavaResourcePackageInfo implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void syncName(String astName) {
- if (valuesAreDifferent(astName, this.name)){
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
- }
-
- private String buildName(CompilationUnit astRoot) {
- IPackageBinding binding = this.annotatedElement.getBinding(astRoot);
- return (binding == null) ? null : binding.getName();
- }
-
-
- // ********** Java changes **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncName(this.buildName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
deleted file mode 100644
index 3ea302a474..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-
-/**
- * @author Dmitry Geraskov
- * Source package-info.java
- *
- */
-public final class SourcePackageInfoCompilationUnit
- extends SourceCompilationUnit
- implements JavaResourcePackageInfoCompilationUnit {
-
- private JavaResourcePackage package_;
-
- public SourcePackageInfoCompilationUnit(
- ICompilationUnit compilationUnit,
- AnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the JPA compilation unit is the root of its sub-tree
- this.package_ = this.buildPackage();
- }
-
-
- private JavaResourcePackage buildPackage() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPackage(astRoot);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public Iterable<JavaResourceAbstractType> getTypes() {
- return EmptyIterable.instance();
- }
-
- public JavaResourceAbstractType getPrimaryType() {
- return null;
- }
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
- }
-
-
- // ********** Java changes **********
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncPackage(astRoot);
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public void resolveTypes() {
- //no-op
- }
-
- // ********** package-info **********
-
- public JavaResourcePackage getPackage() {
- return this.package_;
- }
-
- private JavaResourcePackage buildPackage(CompilationUnit astRoot) {
- return this.buildPackage(astRoot, this.getPackageDeclaration(astRoot));
- }
-
- private void syncPackage(CompilationUnit astRoot) {
- PackageDeclaration pd = this.getPackageDeclaration(astRoot);
- if (pd == null) {
- this.syncPackage_(null);
- } else {
- if (this.package_ == null) {
- this.syncPackage_(this.buildPackage(astRoot, pd));
- } else {
- this.package_.synchronizeWith(astRoot);
- }
- }
- }
-
- private PackageDeclaration getPackageDeclaration(CompilationUnit astRoot) {
- return astRoot.getPackage();
- }
-
- private void syncPackage_(JavaResourcePackage astPackage) {
- JavaResourcePackage old = this.package_;
- this.package_ = astPackage;
- this.firePropertyChanged(PACKAGE, old, astPackage);
- }
-
- private JavaResourcePackage buildPackage(CompilationUnit astRoot, PackageDeclaration packageDeclaration) {
- return SourcePackage.newInstance(this, packageDeclaration, astRoot);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceType.java
deleted file mode 100644
index ea2565fc24..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceType.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TreeIterable;
-
-/**
- * Java source type (type or interface)
- */
-final class SourceType
- extends SourceAbstractType<Type>
- implements JavaResourceType
-{
-
- private String superclassQualifiedName;
-
- private boolean abstract_; // 'abstract' is a reserved word
-
- private boolean hasNoArgConstructor;
-
- private boolean hasPrivateNoArgConstructor;
-
- private final Vector<JavaResourceType> types;
-
- private final Vector<JavaResourceEnum> enums;
-
- private final Vector<JavaResourceField> fields;
-
- private final Vector<JavaResourceMethod> methods;
-
-
- // ********** construction/initialization **********
-
- /**
- * build top-level type
- */
- static JavaResourceType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- TypeDeclaration typeDeclaration,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- typeDeclaration,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceType jrpt = new SourceType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- /**
- * build nested type
- */
- private static JavaResourceType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- Type declaringType,
- TypeDeclaration typeDeclaration,
- int occurrence,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- declaringType,
- typeDeclaration,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceType jrpt = new SourceType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- private SourceType(JavaResourceCompilationUnit javaResourceCompilationUnit, Type type) {
- super(javaResourceCompilationUnit, type);
- this.types = new Vector<JavaResourceType>();
- this.enums = new Vector<JavaResourceEnum>();
- this.fields = new Vector<JavaResourceField>();
- this.methods = new Vector<JavaResourceMethod>();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.superclassQualifiedName = this.buildSuperclassQualifiedName(binding);
- this.abstract_ = this.buildAbstract(binding);
- this.hasNoArgConstructor = this.buildHasNoArgConstructor(binding);
- this.hasPrivateNoArgConstructor = this.buildHasPrivateNoArgConstructor(binding);
- this.initializeTypes(astRoot);
- this.initializeEnums(astRoot);
- this.initializeFields(astRoot);
- this.initializeMethods(astRoot);
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(binding));
- this.syncAbstract(this.buildAbstract(binding));
- this.syncHasNoArgConstructor(this.buildHasNoArgConstructor(binding));
- this.syncHasPrivateNoArgConstructor(this.buildHasPrivateNoArgConstructor(binding));
- this.syncTypes(astRoot);
- this.syncEnums(astRoot);
- this.syncFields(astRoot);
- this.syncMethods(astRoot);
- }
-
-
- // ********** SourceAnnotatedElement implementation **********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
-
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(this.annotatedElement.getBinding(astRoot)));
-
- for (JavaResourceField field : this.getFields()) {
- field.resolveTypes(astRoot);
- }
-
- // a new type can trigger a method parameter type to be a resolved,
- // fully-qualified name, so we need to rebuild our list of methods:
- // "setFoo(Foo)" is not the same as "setFoo(com.bar.Foo)"
- // and, vice-versa, a removed type can "unresolve" a parameter type
- this.syncMethods(astRoot);
-
- for (JavaResourceMethod method : this.getMethods()) {
- method.resolveTypes(astRoot);
- }
- for (JavaResourceType type : this.getTypes()) {
- type.resolveTypes(astRoot);
- }
- for (JavaResourceEnum enum_ : this.getEnums()) {
- enum_.resolveTypes(astRoot);
- }
- }
-
-
- // ******** JavaResourceType implementation ********
-
- public Kind getKind() {
- return Kind.TYPE;
- }
-
- // ***** superclass qualified name
- public String getSuperclassQualifiedName() {
- return this.superclassQualifiedName;
- }
-
- private void syncSuperclassQualifiedName(String astSuperclassQualifiedName) {
- String old = this.superclassQualifiedName;
- this.superclassQualifiedName = astSuperclassQualifiedName;
- this.firePropertyChanged(SUPERCLASS_QUALIFIED_NAME_PROPERTY, old, astSuperclassQualifiedName);
- }
-
- private String buildSuperclassQualifiedName(ITypeBinding binding) {
- if (binding == null) {
- return null;
- }
- ITypeBinding superclass = binding.getSuperclass();
- return (superclass == null) ? null : superclass.getTypeDeclaration().getQualifiedName();
- }
-
- // ***** abstract
- public boolean isAbstract() {
- return this.abstract_;
- }
-
- private void syncAbstract(boolean astAbstract) {
- boolean old = this.abstract_;
- this.abstract_ = astAbstract;
- this.firePropertyChanged(ABSTRACT_PROPERTY, old, astAbstract);
- }
-
- private boolean buildAbstract(ITypeBinding binding) {
- return (binding == null) ? false : Modifier.isAbstract(binding.getModifiers());
- }
-
- // ***** no-arg constructor
- public boolean hasNoArgConstructor() {
- return this.hasNoArgConstructor;
- }
-
- private void syncHasNoArgConstructor(boolean hasNoArgConstructor) {
- boolean old = this.hasNoArgConstructor;
- this.hasNoArgConstructor = hasNoArgConstructor;
- this.firePropertyChanged(NO_ARG_CONSTRUCTOR_PROPERTY, old, hasNoArgConstructor);
- }
-
- private boolean buildHasNoArgConstructor(ITypeBinding binding) {
- return (binding == null) ? false : typeHasNoArgConstructor(binding);
- }
-
- protected static boolean typeHasNoArgConstructor(ITypeBinding binding) {
- return findNoArgConstructor(binding) != null;
- }
-
- protected static IMethodBinding findNoArgConstructor(ITypeBinding binding) {
- for (IMethodBinding method : binding.getDeclaredMethods()) {
- if (method.isConstructor()) {
- if (method.getParameterTypes().length == 0) {
- return method;
- }
- }
- }
- return null;
- }
-
- // ***** private no-arg constructor
- public boolean hasPrivateNoArgConstructor() {
- return this.hasPrivateNoArgConstructor;
- }
-
- private void syncHasPrivateNoArgConstructor(boolean astHasPrivateNoArgConstructor) {
- boolean old = this.hasPrivateNoArgConstructor;
- this.hasPrivateNoArgConstructor = astHasPrivateNoArgConstructor;
- this.firePropertyChanged(PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY, old, astHasPrivateNoArgConstructor);
- }
-
- private boolean buildHasPrivateNoArgConstructor(ITypeBinding binding) {
- return (binding == null) ? false : typeHasPrivateNoArgConstructor(binding);
- }
-
- protected static boolean typeHasPrivateNoArgConstructor(ITypeBinding binding) {
- IMethodBinding method = findNoArgConstructor(binding);
- return (method != null) && Modifier.isPrivate(method.getModifiers());
- }
-
- // ********** types **********
-
- public Iterable<JavaResourceType> getTypes() {
- return new LiveCloneIterable<JavaResourceType>(this.types); // read-only
- }
-
- public Iterable<JavaResourceType> getAllTypes() {
- return new TreeIterable<JavaResourceType>(this) {
- @Override
- protected Iterator<? extends JavaResourceType> children(JavaResourceType type) {
- return type.getTypes().iterator();
- }
- };
- }
-
- private JavaResourceType getType(String typeName, int occurrence) {
- for (JavaResourceType type : this.getTypes()) {
- if (type.isFor(typeName, occurrence)) {
- return type;
- }
- }
- return null;
- }
-
- private void addType(JavaResourceType type) {
- this.addItemToCollection(type, this.types, TYPES_COLLECTION);
- }
-
- private void removeTypes(Collection<JavaResourceType> remove) {
- this.removeItemsFromCollection(remove, this.types, TYPES_COLLECTION);
- }
-
- private void initializeTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
- CounterMap counters = new CounterMap(typeDeclarations.length);
- for (TypeDeclaration td : typeDeclarations) {
- String tdName = td.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
- this.types.add(this.buildType(td, occurrence, astRoot));
- }
- }
-
- private void syncTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
- CounterMap counters = new CounterMap(typeDeclarations.length);
- HashSet<JavaResourceType> typesToRemove = new HashSet<JavaResourceType>(this.types);
- for (TypeDeclaration typeDeclaration : typeDeclarations) {
- String tdName = typeDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
-
- JavaResourceType type = this.getType(tdName, occurrence);
- if (type == null) {
- this.addType(this.buildType(typeDeclaration, occurrence, astRoot));
- } else {
- typesToRemove.remove(type);
- type.synchronizeWith(astRoot);
- }
- }
- this.removeTypes(typesToRemove);
- }
-
- private JavaResourceType buildType(TypeDeclaration nestedTypeDeclaration, int occurrence, CompilationUnit astRoot) {
- return newInstance(this.getJavaResourceCompilationUnit(), this.annotatedElement, nestedTypeDeclaration, occurrence, astRoot);
- }
-
-
- // ********** enums **********
-
- public Iterable<JavaResourceEnum> getEnums() {
- return new LiveCloneIterable<JavaResourceEnum>(this.enums); // read-only
- }
-
- public Iterable<JavaResourceEnum> getAllEnums() {
- return this.getEnums();
- }
-
- private JavaResourceEnum getEnum(String enumName, int occurrence) {
- for (JavaResourceEnum enum_ : this.getEnums()) {
- if (enum_.isFor(enumName, occurrence)) {
- return enum_;
- }
- }
- return null;
- }
-
- private void addEnum(JavaResourceEnum enum_) {
- this.addItemToCollection(enum_, this.enums, ENUMS_COLLECTION);
- }
-
- private void removeEnums(Collection<JavaResourceEnum> remove) {
- this.removeItemsFromCollection(remove, this.enums, ENUMS_COLLECTION);
- }
-
- private void initializeEnums(CompilationUnit astRoot) {
- EnumDeclaration[] enumDeclarations = this.annotatedElement.getEnums(astRoot);
- CounterMap counters = new CounterMap(enumDeclarations.length);
- for (EnumDeclaration ed : enumDeclarations) {
- String tdName = ed.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
- this.enums.add(this.buildEnum(ed, occurrence, astRoot));
- }
- }
-
- private void syncEnums(CompilationUnit astRoot) {
- EnumDeclaration[] enumDeclarations = this.annotatedElement.getEnums(astRoot);
- CounterMap counters = new CounterMap(enumDeclarations.length);
- HashSet<JavaResourceEnum> enumsToRemove = new HashSet<JavaResourceEnum>(this.enums);
- for (EnumDeclaration enumDeclaration : enumDeclarations) {
- String tdName = enumDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
-
- JavaResourceEnum enum_ = this.getEnum(tdName, occurrence);
- if (enum_ == null) {
- this.addEnum(this.buildEnum(enumDeclaration, occurrence, astRoot));
- } else {
- enumsToRemove.remove(enum_);
- enum_.synchronizeWith(astRoot);
- }
- }
- this.removeEnums(enumsToRemove);
- }
-
- private JavaResourceEnum buildEnum(EnumDeclaration nestedEnumDeclaration, int occurrence, CompilationUnit astRoot) {
- return SourceEnum.newInstance(this.getJavaResourceCompilationUnit(), this.annotatedElement, nestedEnumDeclaration, occurrence, astRoot);
- }
-
-
- // ********** fields **********
-
- public Iterable<JavaResourceField> getFields() {
- return new LiveCloneIterable<JavaResourceField>(this.fields);
- }
-
- private void addField(JavaResourceField field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- private JavaResourceField getField(String fieldName, int occurrence) {
- for (JavaResourceField field : this.getFields()) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- private void removeFields(Collection<JavaResourceField> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
- private void initializeFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
- CounterMap counters = new CounterMap(fieldDeclarations.length);
- for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- String fieldName = fragment.getName().getFullyQualifiedName();
- int occurrence = counters.increment(fieldName);
- this.fields.add(this.buildField(fieldName, occurrence, astRoot));
- }
- }
- }
-
- private void syncFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
- CounterMap counters = new CounterMap(fieldDeclarations.length);
- HashSet<JavaResourceField> fieldsToRemove = new HashSet<JavaResourceField>(this.fields);
- for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- String fieldName = fragment.getName().getFullyQualifiedName();
- int occurrence = counters.increment(fieldName);
-
- JavaResourceField field = this.getField(fieldName, occurrence);
- if (field == null) {
- this.addField(this.buildField(fieldName, occurrence, astRoot));
- } else {
- fieldsToRemove.remove(field);
- field.synchronizeWith(astRoot);
- }
- }
- }
- this.removeFields(fieldsToRemove);
- }
-
- private JavaResourceField buildField(String fieldName, int occurrence, CompilationUnit astRoot) {
- return SourceField.newInstance(this, this.annotatedElement, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private static List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
- return fd.fragments();
- }
-
-
- // ********** methods **********
-
- public Iterable<JavaResourceMethod> getMethods() {
- return new LiveCloneIterable<JavaResourceMethod>(this.methods);
- }
-
- private JavaResourceMethod getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourceMethod method : this.getMethods()) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- private void addMethod(JavaResourceMethod method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- private void removeMethods(Collection<JavaResourceMethod> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
- private void initializeMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
- this.methods.add(this.buildMethod(signature, occurrence, astRoot));
- }
- }
-
- private void syncMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- HashSet<JavaResourceMethod> methodsToRemove = new HashSet<JavaResourceMethod>(this.methods);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
-
- JavaResourceMethod method = this.getMethod(signature, occurrence);
- if (method == null) {
- this.addMethod(this.buildMethod(signature, occurrence, astRoot));
- } else {
- methodsToRemove.remove(method);
- method.synchronizeWith(astRoot);
- }
- }
- this.removeMethods(methodsToRemove);
- }
-
- private JavaResourceMethod buildMethod(MethodSignature signature, int occurrence, CompilationUnit astRoot) {
- return SourceMethod.newInstance(this, this.annotatedElement, signature, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
-
- public boolean hasAnyAnnotatedFields() {
- for (JavaResourceField field : this.getFields()) {
- if (field.isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-
- public boolean hasAnyAnnotatedMethods() {
- for (JavaResourceMethod method : this.getMethods()) {
- if (method.isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java
deleted file mode 100644
index fc1f76eb08..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceTypeCompilationUnit.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.resource.java.source;
-
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-
-/**
- * Java compilation unit (source file)
- * non package-info.java file
- */
-public final class SourceTypeCompilationUnit
- extends SourceCompilationUnit
-{
-
- /**
- * The primary type of the AST compilation unit. We are not going to handle
- * multiple types defined in a single compilation unit. Entities must have
- * a public/protected no-arg constructor, and there is no way to access
- * the constructor in a package class (which is what all top-level,
- * non-primary classes must be).
- */
- private JavaResourceAbstractType primaryType;
-
-
- // ********** construction **********
-
- public SourceTypeCompilationUnit(
- ICompilationUnit compilationUnit,
- AnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the compilation unit is the root of its sub-tree
- this.primaryType = this.buildPrimaryType();
- }
-
- private JavaResourceAbstractType buildPrimaryType() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPrimaryType(astRoot);
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncPrimaryType(astRoot);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- /**
- * NB: return *all* the types since we build them all
- */
- public Iterable<JavaResourceAbstractType> getTypes() {
- return (this.primaryType == null) ?
- EmptyIterable.<JavaResourceAbstractType>instance() :
- new CompositeIterable<JavaResourceAbstractType>(this.primaryType.getAllTypes(), this.primaryType.getAllEnums());
- }
-
-
- // ********** JpaResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public void resolveTypes() {
- if (this.primaryType != null) {
- this.primaryType.resolveTypes(this.buildASTRoot());
- }
- }
-
-
- // ********** type **********
-
- public JavaResourceAbstractType getPrimaryType() {
- return this.primaryType;
- }
-
- private JavaResourceAbstractType buildPrimaryType(CompilationUnit astRoot) {
- AbstractTypeDeclaration td = this.getPrimaryTypeOrEnumDeclaration(astRoot);
- return (td == null) ? null : this.buildPrimaryType(astRoot, td);
- }
-
-
- private void syncPrimaryType(CompilationUnit astRoot) {
- AbstractTypeDeclaration td = this.getPrimaryTypeOrEnumDeclaration(astRoot);
- if (td == null) {
- this.syncPrimaryType_(null);
- } else {
- if (this.primaryType == null || (!typeMatchesASTNodeType(this.primaryType, td))) {
- this.syncPrimaryType_(this.buildPrimaryType(astRoot, td));
- } else {
- this.primaryType.synchronizeWith(astRoot);
- }
- }
- }
-
- /**
- * Must be non-null JavaResourceAbstractType and AbstractTypeDeclaration
- */
- protected static boolean typeMatchesASTNodeType(JavaResourceAbstractType type, AbstractTypeDeclaration astType) {
- return type.getKind().getAstNodeType() == astType.getNodeType();
- }
-
- private void syncPrimaryType_(JavaResourceAbstractType astType) {
- JavaResourceAbstractType old = this.primaryType;
- this.primaryType = astType;
- this.firePropertyChanged(TYPES_COLLECTION, old, astType);
- }
-
-
- // ********** internal **********
-
- private JavaResourceAbstractType buildPrimaryType(CompilationUnit astRoot, AbstractTypeDeclaration typeDeclaration) {
- if (typeDeclaration.getNodeType() == ASTNode.TYPE_DECLARATION) {
- return SourceType.newInstance(this, (TypeDeclaration) typeDeclaration, astRoot);
- }
- else if (typeDeclaration.getNodeType() == ASTNode.ENUM_DECLARATION) {
- return SourceEnum.newInstance(this, (EnumDeclaration) typeDeclaration, astRoot);
- }
- throw new IllegalArgumentException();
- }
-
- /**
- * i.e. the type with the same name as the compilation unit;
- * return the first class, interface or enum (ignore annotations) with
- * the same name as the compilation unit (file);
- * NB: this type could be in error if there is an annotation
- * with the same name preceding it in the compilation unit
- *
- * Return null if the parser did not resolve the type declaration's binding.
- * This can occur if the project JRE is removed (bug 225332).
- */
- private AbstractTypeDeclaration getPrimaryTypeOrEnumDeclaration(CompilationUnit astRoot) {
- String primaryTypeName = this.getPrimaryTypeName();
- for (AbstractTypeDeclaration atd : this.types(astRoot)) {
- if (this.nodeIsPrimaryTypeOrEnumDeclaration(atd, primaryTypeName)) {
- return (atd.resolveBinding() == null) ? null : atd;
- }
- }
- return null;
- }
-
- private boolean nodeIsPrimaryTypeOrEnumDeclaration(AbstractTypeDeclaration atd, String primaryTypeName) {
- return this.nodeIsTypeOrEnumDeclaration(atd) &&
- (atd.getName().getFullyQualifiedName().equals(primaryTypeName));
- }
-
- private boolean nodeIsTypeOrEnumDeclaration(AbstractTypeDeclaration atd) {
- return atd.getNodeType() == ASTNode.TYPE_DECLARATION ||
- atd.getNodeType() == ASTNode.ENUM_DECLARATION;
- }
-
- private String getPrimaryTypeName() {
- return this.getCompilationUnitName();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/CallbackJobSynchronizer.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/CallbackJobSynchronizer.java
deleted file mode 100644
index 38a4cda80f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/CallbackJobSynchronizer.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-
-/**
- * Extend the job synchronizer to notify listeners
- * when a synchronization "cycle" is complete; i.e. the synchronization has,
- * for the moment, handled every "synchronize" request and quiesced.
- * This notification is <em>not</em> guaranteed to occur with <em>every</em>
- * synchronization "cycle";
- * since other, unrelated, synchronizations can be triggered concurrently;
- * preventing the synchronization from quiescing.
- */
-public class CallbackJobSynchronizer
- extends JobSynchronizer
- implements CallbackSynchronizer
-{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
-
-
- // ********** construction **********
-
- /**
- * Construct a callback job synchronizer that uses the specified job command to
- * perform the synchronization. Assign the generated Eclipse job the
- * specified name.
- */
- public CallbackJobSynchronizer(String jobName, JobCommand command) {
- super(jobName, command);
- }
-
- /**
- * Construct a callback job synchronizer that uses the specified job command to
- * perform the synchronization. Assign the generated Eclipse job the
- * specified name and scheduling rule.
- */
- public CallbackJobSynchronizer(String jobName, JobCommand command, ISchedulingRule schedulingRule) {
- super(jobName, command, schedulingRule);
- }
-
- /**
- * Build a job that will let us know when the synchronization has
- * quiesced.
- */
- @Override
- SynchronizationJob buildJob(String jobName, JobCommand command, ISchedulingRule schedulingRule) {
- return new CallbackSynchronizationJob(jobName, command, schedulingRule);
- }
-
-
- // ********** CallbackSynchronizer implementation **********
-
- public void addListener(Listener listener) {
- this.listenerList.add(listener);
- }
-
- public void removeListener(Listener listener) {
- this.listenerList.remove(listener);
- }
-
- /**
- * Notify our listeners.
- */
- void synchronizationQuiesced() {
- for (Listener listener : this.listenerList.getListeners()) {
- listener.synchronizationQuiesced(this);
- }
- }
-
-
- // ********** synchronization job **********
-
- /**
- * Extend {@link JobSynchronizer.SynchronizationJob}
- * to notify the synchronizer when the synchronization has quiesced
- * (i.e. the command has finished executing and there are no further
- * requests for synchronization).
- * Because synchronization occurs during the job's execution,
- * no other thread will be able to
- * initiate another synchronization until the synchronizer's listeners have been
- * notified. Note also, the synchronizer's listeners can, themselves,
- * trigger another synchronization (by directly or indirectly calling
- * {@link org.eclipse.jpt.common.utility.synchronizers.Synchronizer#synchronize()});
- * but this synchronization will not occur until <em>after</em> all the
- * listeners have been notified.
- */
- class CallbackSynchronizationJob
- extends SynchronizationJob
- {
- /**
- * When this flag is set to true, the job has been scheduled to run.
- * We need this because {@link org.eclipse.core.runtime.jobs.Job Job}
- * has no public API for discovering whether a job is "scheduled".
- */
- // use 'volatile' because synchronization isn't really required
- private volatile boolean scheduled;
-
-
- CallbackSynchronizationJob(String jobName, JobCommand command, ISchedulingRule schedulingRule) {
- super(jobName, command, schedulingRule);
- this.scheduled = false;
- }
-
- /**
- * If we are allowing the job to be scheduled (i.e. {@link #start()}
- * was called), set the "scheduled" flag.
- */
- @Override
- void synchronize() {
- if (this.shouldSchedule) {
- this.scheduled = true;
- }
- super.synchronize();
- }
-
- /**
- * Clear the "scheduled" flag; perform the synchronization; and,
- * if the "scheduled" flag is still clear (i.e. there have been no
- * further calls to {@link #synchronize()}), notify our listeners.
- */
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- this.scheduled = false;
- IStatus status = super.run(monitor);
- // hmmm - we will notify listeners even when we our job is "stopped";
- // that seems ok... ~bjv
- if ( ! this.scheduled) {
- CallbackJobSynchronizer.this.synchronizationQuiesced();
- }
- return status;
- }
-
- @Override
- void stop() {
- this.scheduled = false;
- super.stop();
- }
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ICUStringCollator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ICUStringCollator.java
deleted file mode 100644
index 555fa43caf..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/ICUStringCollator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import java.util.Comparator;
-import java.util.Locale;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import com.ibm.icu.text.Collator;
-
-/**
- * This collator simply wraps an ICU4J collator and implements a
- * {@link String} {@link Comparator} (instead of an {@link Object}
- * {@link Comparator}, which is what {@link Collator} does, mimicking the
- * JDK(?)).
- *
- * @see Collator
- */
-public class ICUStringCollator
- implements Comparator<String>
-{
- private final Collator collator;
-
-
- /**
- * Wrap the default collator.
- * @see Collator#getInstance()
- */
- public ICUStringCollator() {
- this(Collator.getInstance());
- }
-
- /**
- * Wrap the collator for the specified locale.
- * @see Collator#getInstance(Locale)
- */
- public ICUStringCollator(Locale locale) {
- this(Collator.getInstance(locale));
- }
-
- /**
- * Wrap the specified collator.
- */
- public ICUStringCollator(Collator collator) {
- super();
- this.collator = collator;
- }
-
- public int compare(String string1, String string2) {
- return this.collator.compare(string1, string2);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.collator);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JDTTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JDTTools.java
deleted file mode 100644
index e42b16a310..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JDTTools.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IParent;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-
-/**
- * Convenience methods for dealing with JDT core
- */
-public final class JDTTools {
-
- /**
- * Wrap checked exception.
- */
- public static boolean packageFragmentRootIsSourceFolder(IPackageFragmentRoot pfr) {
- try {
- return packageFragmentRootIsSourceFolder_(pfr);
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- static boolean packageFragmentRootIsSourceFolder_(IPackageFragmentRoot pfr) throws JavaModelException {
- return pfr.exists() && (pfr.getKind() == IPackageFragmentRoot.K_SOURCE);
- }
-
- /**
- * Wrap checked exception and check for out of sync workspace.
- */
- public static IJavaElement[] getChildren(IParent parent) {
- try {
- return parent.getChildren();
- } catch (JavaModelException ex) {
- // ignore FNFE - which can happen when the workspace is out of sync with O/S file system
- if ( ! (ex.getCause() instanceof FileNotFoundException)) {
- JptCommonCorePlugin.log(ex);
- }
- return EMPTY_JAVA_ELEMENT_ARRAY;
- }
- }
-
- private static final IJavaElement[] EMPTY_JAVA_ELEMENT_ARRAY = new IJavaElement[0];
-
- /**
- * Climb the specified type's inheritance hierarchy looking for the specified interface.
- */
- public static boolean typeIsSubType(IJavaProject javaProject, String potentialSubType, String potentialSuperType) {
- try {
- return typeIsSubType(javaProject, javaProject.findType(potentialSubType), javaProject.findType(potentialSuperType));
- }
- catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- private static boolean typeIsSubType(IJavaProject javaProject, IType potentialSubType, String potentialSuperType) throws JavaModelException {
- return typeIsSubType(javaProject, potentialSubType, javaProject.findType(potentialSuperType));
- }
-
- private static boolean typeIsSubType(IJavaProject javaProject, IType potentialSubType, IType potentialSuperType) throws JavaModelException {
- if ((potentialSubType == null) || (potentialSuperType == null)) {
- return false;
- }
-
- // short cut if types are the same
- if (potentialSubType.equals(potentialSuperType)) {
- return true;
- }
-
- // short cut if potential supertype is java.lang.Object
- if (javaProject.findType(Object.class.getName()).equals(potentialSuperType)) {
- return true;
- }
-
- String potentialSuperTypeName = potentialSuperType.getFullyQualifiedName();
-
- for (String superTypeName : getResolvedSuperTypeNames(potentialSubType)) {
- if (superTypeName.equals(potentialSuperTypeName)) {
- return true;
- }
-
- // recurse into super type
- if (typeIsSubType(javaProject, javaProject.findType(superTypeName), potentialSuperType)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Return the names of the specified type's supertypes (class and interfaces).
- * This is necessary because, for whatever reason, { @link IType#getSuperInterfaceNames()}
- * {@link IType#getSuperclassName()} return unqualified names when the type is from Java source.
- */
- private static Iterable<String> getResolvedSuperTypeNames(IType type) throws JavaModelException {
- Iterable<String> nonResolvedSuperTypeNames = getNonResolvedSuperTypeNames(type);
- if (type.isBinary()) {
- // if type is binary, the types are already resolved
- return nonResolvedSuperTypeNames;
- }
- ArrayList<String> resolvedSuperTypeNames = new ArrayList<String>();
- for (String superTypeName : nonResolvedSuperTypeNames) {
- resolvedSuperTypeNames.add(resolveType(type, superTypeName));
- }
- return resolvedSuperTypeNames;
- }
-
- /**
- * Return the (potentially) non-resolved names of the specified type's supertypes (class and interfaces).
- * This is necessary because, for whatever reason, { @link IType#getSuperInterfaceNames()} and
- * {@link IType#getSuperclassName()} return unqualified names when the type is from Java source.
- */
- private static Iterable<String> getNonResolvedSuperTypeNames(IType type) throws JavaModelException {
- return new CompositeIterable<String>(
- new FilteringIterable<String>(
- new SingleElementIterable<String>(type.getSuperclassName()),
- NotNullFilter.<String>instance()),
- new ArrayIterable<String>(type.getSuperInterfaceNames()));
- }
-
- /**
- * Just grab the first candidate type.
- */
- private static String resolveType(IType type, String className) throws JavaModelException {
- String[][] resolvedClassNames = type.resolveType(className);
- if (resolvedClassNames == null) {
- return null;
- }
- String pkg = resolvedClassNames[0][0];
- String cls = resolvedClassNames[0][1];
- // check for default package
- return (pkg.length() == 0) ? cls : (pkg + '.' + cls);
- }
-
- public static IType findType(IJavaProject javaProject, String fullyQualifiedName) {
- try {
- return javaProject.findType(fullyQualifiedName);
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return null;
- }
- }
-
- public static Iterable<IPackageFragmentRoot> getJavaSourceFolders(IJavaProject javaProject) {
- return new FilteringIterable<IPackageFragmentRoot>(
- getPackageFragmentRoots(javaProject),
- SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER
- );
- }
-
- private static final Filter<IPackageFragmentRoot> SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER =
- new Filter<IPackageFragmentRoot>() {
- public boolean accept(IPackageFragmentRoot pfr) {
- return packageFragmentRootIsSourceFolder(pfr);
- }
- };
-
- private static Iterable<IPackageFragmentRoot> getPackageFragmentRoots(IJavaProject javaProject) {
- try {
- return getPackageFragmentRoots_(javaProject);
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return EmptyIterable.instance();
- }
- }
-
- private static Iterable<IPackageFragmentRoot> getPackageFragmentRoots_(IJavaProject javaProject) throws JavaModelException {
- return new ArrayIterable<IPackageFragmentRoot>(javaProject.getPackageFragmentRoots());
- }
-
- /**
- * Return whether the specified type is "basic".
- * @param fullyQualifiedName may include array brackets but not generic type arguments
- */
- public static boolean typeIsBasic(IJavaProject javaProject, String fullyQualifiedName) {
- try {
- return typeIsBasic(javaProject, javaProject.findType(fullyQualifiedName));
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- return false;
- }
- }
-
- private static boolean typeIsBasic(IJavaProject javaProject, IType type) throws JavaModelException {
- if (type == null) {
- return false;
- }
- String fullyQualifiedName = type.getFullyQualifiedName();
-
- if (fullyQualifiedName == null) {
- return false;
- }
-
- int arrayDepth = ReflectionTools.getArrayDepthForTypeDeclaration(fullyQualifiedName);
- if (arrayDepth > 1) {
- return false; // multi-dimensional arrays are not supported
- }
-
- if (arrayDepth == 1) {
- String elementTypeName = ReflectionTools.getElementTypeNameForTypeDeclaration(fullyQualifiedName, 1);
- return elementTypeIsValidForBasicArray(elementTypeName);
- }
-
- // arrayDepth == 0
- if (ClassName.isVariablePrimitive(fullyQualifiedName)) {
- return true; // any primitive but 'void'
- }
- if (ClassName.isVariablePrimitiveWrapper(fullyQualifiedName)) {
- return true; // any primitive wrapper but 'java.lang.Void'
- }
- if (typeIsOtherValidBasicType(fullyQualifiedName)) {
- return true;
- }
- if (typeIsSubType(javaProject, type, SERIALIZABLE_CLASS_NAME)) {
- return true;
- }
- if (type.isEnum()) {
- return true;
- }
- return false;
- }
-
- private static final String SERIALIZABLE_CLASS_NAME = java.io.Serializable.class.getName();
-
- /**
- * Return whether the specified type is a valid element type for
- * a one-dimensional array that can default to a basic mapping:<ul>
- * <li><code>byte</code>
- * <li><code>java.lang.Byte</code>
- * <li><code>char</code>
- * <li><code>java.lang.Character</code>
- * </ul>
- */
- public static boolean elementTypeIsValidForBasicArray(String elementTypeName) {
- return ArrayTools.contains(VALID_BASIC_ARRAY_ELEMENT_TYPE_NAMES, elementTypeName);
- }
-
- private static final String[] VALID_BASIC_ARRAY_ELEMENT_TYPE_NAMES = {
- byte.class.getName(),
- char.class.getName(),
- java.lang.Byte.class.getName(),
- java.lang.Character.class.getName()
- };
-
- /**
- * Return whether the specified type is among the various "other" types
- * that can default to a basic mapping.
- */
- public static boolean typeIsOtherValidBasicType(String typeName) {
- return ArrayTools.contains(OTHER_VALID_BASIC_TYPE_NAMES, typeName);
- }
-
- private static final String[] OTHER_VALID_BASIC_TYPE_NAMES = {
- java.lang.String.class.getName(),
- java.math.BigInteger.class.getName(),
- java.math.BigDecimal.class.getName(),
- java.util.Date.class.getName(),
- java.util.Calendar.class.getName(),
- java.sql.Date.class.getName(),
- java.sql.Time.class.getName(),
- java.sql.Timestamp.class.getName(),
- };
-
- public static boolean classHasPublicZeroArgConstructor(IJavaProject javaProject, String className) {
- if (javaProject != null && className != null) {
- boolean hasDefinedConstructor = false;
- IType type = findType(javaProject, className);
- if (type != null) {
- try {
- for (IMethod method : type.getMethods()) {
- if (method.isConstructor()) {
- if ((method.getNumberOfParameters() == 0) && (Flags.isPublic(method.getFlags()))) {
- return true;
- }
- hasDefinedConstructor = true;
- }
- }
- //When there's no defined constructor, the default constructor is in place.
- if (!hasDefinedConstructor) {
- return true;
- }
- } catch (JavaModelException ex) {
- JptCommonCorePlugin.log(ex);
- }
- }
- }
- return false;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobCommand.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobCommand.java
deleted file mode 100644
index 0a46bb470d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import java.io.Serializable;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-/**
- * Simple interface for implementing the GOF Command design pattern in an
- * Eclipse job.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JobCommand {
-
- /**
- * Execute the command. The semantics of the command
- * is determined by the contract between the client and server.
- * The command should check, as appropriate, whether the specified progress
- * monitor is {@link IProgressMonitor#isCanceled() "canceled"}; if it is,
- * the command should throw an
- * {@link org.eclipse.core.runtime.OperationCanceledException OperationCanceledException}.
- * @see IProgressMonitor#isCanceled()
- */
- IStatus execute(IProgressMonitor monitor);
-
- /**
- * Singleton implementation of the job command interface that will do
- * nothing when executed.
- */
- final class Null implements JobCommand, Serializable {
- public static final JobCommand INSTANCE = new Null();
- public static JobCommand instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public IStatus execute(IProgressMonitor arg0) {
- return Status.OK_STATUS;
- }
- @Override
- public String toString() {
- return "JobCommand.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- /**
- * Singleton implementation of the job command interface that will throw an
- * exception when executed.
- */
- final class Disabled implements JobCommand, Serializable {
- public static final JobCommand INSTANCE = new Disabled();
- public static JobCommand instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public IStatus execute(IProgressMonitor arg0) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "JobCommand.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobSynchronizer.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobSynchronizer.java
deleted file mode 100644
index 2ab0283e5a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/JobSynchronizer.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-
-/**
- * This synchronizer will perform synchronizations in an Eclipse job on a
- * separate thread, allowing calls to {@link Synchronizer#synchronize()}
- * to return immediately.
- * <p>
- * If necessary, the client-supplied job command should handle any
- * exceptions appropriately. Although, the default exception-handling provided
- * by the Eclipse Job Framework is probably adequate in most cases:<ul>
- * <li>An {@link org.eclipse.core.runtime.OperationCanceledException OperationCanceledException}
- * results in a {@link org.eclipse.core.runtime.Status#CANCEL_STATUS CANCEL_STATUS}.
- * <li>Any non-{@link ThreadDeath} {@link Throwable}
- * results in a {@link org.eclipse.core.runtime.IStatus#ERROR ERROR}
- * {@link org.eclipse.core.runtime.IStatus IStatus}
- * </ul>
- * @see org.eclipse.core.internal.jobs.Worker#run()
- */
-public class JobSynchronizer
- implements Synchronizer
-{
- /**
- * The synchronization is performed by this job. The same job is used
- * for every start/stop cycle (since a job can be re-started).
- */
- private final SynchronizationJob job;
-
-
- // ********** construction **********
-
- /**
- * Construct a job synchronizer that uses the specified job command to
- * perform the synchronization. Assign the generated Eclipse job the
- * specified name.
- */
- public JobSynchronizer(String jobName, JobCommand command) {
- this(jobName, command, null);
- }
-
- /**
- * Construct a job synchronizer that uses the specified job command to
- * perform the synchronization. Assign the generated Eclipse job the
- * specified name and scheduling rule.
- */
- public JobSynchronizer(String jobName, JobCommand command, ISchedulingRule schedulingRule) {
- super();
- this.job = this.buildJob(jobName, command, schedulingRule);
- }
-
- SynchronizationJob buildJob(String jobName, JobCommand command, ISchedulingRule schedulingRule) {
- return new SynchronizationJob(jobName, command, schedulingRule);
- }
-
-
- // ********** Synchronizer implementation **********
-
- /**
- * Allow the job to be scheduled, but postpone the first synchronization
- * until requested, via {@link #synchronize()}.
- */
- public void start() {
- this.job.start();
- }
-
- /**
- * "Schedule" the job.
- */
- public void synchronize() {
- this.job.synchronize();
- }
-
- /**
- * Wait for the current job execution to complete.
- */
- public void stop() {
- this.job.stop();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.job);
- }
-
-
- // ********** synchronization job **********
-
- /**
- * This is the job that gets scheduled by the job synchronizer.
- * When the job is run it executes the client-supplied job command.
- */
- static class SynchronizationJob extends Job {
- /**
- * The client-supplied job command that executes every time the job
- * runs.
- */
- private final JobCommand command;
-
- /**
- * When this flag is set to false, the job does not stop immediately;
- * but it will not be scheduled to run again.
- */
- // use 'volatile' because synchronization isn't really required
- volatile boolean shouldSchedule;
-
-
- SynchronizationJob(String jobName, JobCommand command, ISchedulingRule schedulingRule) {
- super(jobName);
- if (command == null) {
- throw new NullPointerException();
- }
- this.command = command;
- this.shouldSchedule = false;
- this.setRule(schedulingRule);
- }
-
- /**
- * Just set the "should schedule" flag so the job <em>can</em> be
- * scheduled; but don't actually schedule it.
- */
- void start() {
- if (this.shouldSchedule) {
- throw new IllegalStateException("The Synchronizer was not stopped."); //$NON-NLS-1$
- }
- this.shouldSchedule = true;
- }
-
- /**
- * Simply re-schedule the job, allowing the current execution
- * to run to completion (i.e. do not try to cancel it prematurely).
- * This should minimize the number of times the job is re-executed
- * (recursively and otherwise).
- */
- void synchronize() {
- this.schedule();
- }
-
- /**
- * Any uncaught exceptions thrown by the command will be reasonably
- * handled by the Job Framework.
- * @see org.eclipse.core.internal.jobs.Worker#run()
- */
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- return this.command.execute(monitor);
- }
-
- /**
- * Prevent the job from running again and wait for the current
- * execution, if there is any, to end before returning.
- */
- void stop() {
- if ( ! this.shouldSchedule) {
- throw new IllegalStateException("The Synchronizer was not started."); //$NON-NLS-1$
- }
- // this will prevent the job from being scheduled to run again
- this.shouldSchedule = false;
- // this will cancel the job if it has already been scheduled, but is currently WAITING
- this.cancel();
- try {
- // if the job is currently RUNNING, wait until it is done before returning
- this.join();
- } catch (InterruptedException ex) {
- // the thread that called #stop() was interrupted while waiting to
- // join the synchronization job - ignore;
- // 'shouldSchedule' is still set to 'false', so the job loop will still stop - we
- // just won't wait around for it...
- }
- }
-
- /**
- * This is part of the normal {@link Job} behavior. By default, it is
- * not used (i.e. it always returns <code>true</code>).
- * We implement it here.
- */
- @Override
- public boolean shouldSchedule() {
- return this.shouldSchedule;
- }
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
deleted file mode 100644
index 44183a9b68..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/PlatformTools.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import java.io.IOException;
-import java.io.InputStream;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-
-/**
- * A collection of utilities for dealing with the Eclipse platform API.
- */
-public class PlatformTools {
-
- /**
- * Return the {@link IContainer} with the workspace relative "full" path
- */
- public static IContainer getContainer(IPath fullContainerPath) {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- // changed to handle non-workspace projects
- String projectName = fullContainerPath.segment(0).toString();
- IPath projectRelativePath = fullContainerPath.removeFirstSegments(1);
- IProject project = root.getProject(projectName);
- if (projectRelativePath.isEmpty()) {
- return project;
- }
- return project.getFolder(projectRelativePath);
- }
-
- /**
- * Return the {@link IFile} with the workspace relative "full" path
- */
- public static IFile getFile(IPath fullFilePath) {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- // changed to handle non-workspace projects
- String projectName = fullFilePath.segment(0).toString();
- IPath projectRelativePath = fullFilePath.removeFirstSegments(1);
- IProject project = root.getProject(projectName);
- return project.getFile(projectRelativePath);
- }
-
- /**
- * Return the specified file's content type,
- * using the Eclipse platform's content type manager.
- */
- public static IContentType getContentType(IFile file) {
- String fileName = file.getName();
- InputStream fileContents = null;
- try {
- fileContents = file.getContents();
- } catch (CoreException ex) {
- // seems like we can ignore any exception that might occur here;
- // e.g. we get a FNFE if the workspace is out of synch with the O/S file system
- // JptCorePlugin.log(ex);
-
- // look for content type based on the file name only(?)
- return findContentTypeFor(fileName);
- }
-
- IContentType contentType = null;
- try {
- contentType = findContentTypeFor(fileContents, fileName);
- } catch (IOException ex) {
- JptCommonCorePlugin.log(ex);
- } finally {
- try {
- fileContents.close();
- } catch (IOException ex) {
- JptCommonCorePlugin.log(ex);
- }
- }
- return contentType;
- }
-
- private static IContentType findContentTypeFor(InputStream fileContents, String fileName) throws IOException {
- return getContentTypeManager().findContentTypeFor(fileContents, fileName);
- }
-
- private static IContentType findContentTypeFor(String fileName) {
- return getContentTypeManager().findContentTypeFor(fileName);
- }
-
- private static IContentTypeManager getContentTypeManager() {
- return Platform.getContentTypeManager();
- }
-
- private PlatformTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleSchedulingRule.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleSchedulingRule.java
deleted file mode 100644
index 04d8a24d15..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleSchedulingRule.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * A job scheduling rule that conflicts only with itself.
- */
-public final class SimpleSchedulingRule
- implements ISchedulingRule
-{
- public SimpleSchedulingRule() {
- super();
- }
-
- public boolean contains(ISchedulingRule rule) {
- return rule == this;
- }
-
- public boolean isConflicting(ISchedulingRule rule) {
- return rule == this;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleTextRange.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleTextRange.java
deleted file mode 100644
index 2164e3348e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/SimpleTextRange.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import org.eclipse.jpt.common.core.utility.AbstractTextRange;
-
-/**
- * Straightforward implementation of
- * {@link org.eclipse.jpt.common.core.utility.TextRange TextRange}.
- */
-public class SimpleTextRange
- extends AbstractTextRange
-{
- private final int offset;
- private final int length;
- private final int lineNumber;
-
-
- public SimpleTextRange(int offset, int length, int lineNumber) {
- super();
- this.offset = offset;
- this.length = length;
- this.lineNumber = lineNumber;
- }
-
- public int getOffset() {
- return this.offset;
- }
-
- public int getLength() {
- return this.length;
- }
-
- public int getLineNumber() {
- return this.lineNumber;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/XPointTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/XPointTools.java
deleted file mode 100644
index 5942fb531f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/XPointTools.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-
-/**
- * Utilities for extension point management, validation, etc.
- */
-public class XPointTools {
-
- public static String findRequiredAttribute(
- IConfigurationElement configElement, String attributeName)
- throws XPointException {
-
- String val = configElement.getAttribute(attributeName);
- if (val == null) {
- logMissingAttribute(configElement, attributeName);
- throw new XPointException();
- }
- return val;
- }
-
- public static <T> T instantiate(String pluginId, String extensionPoint, String className, Class<T> interfaze) {
- Class<T> clazz = loadClass(pluginId, extensionPoint, className, interfaze);
- return (clazz == null) ? null : instantiate(pluginId, extensionPoint, clazz);
- }
-
- /**
- * Instantiate the specified class.
- */
- public static <T> T instantiate(String pluginId, String extensionPoint, Class<T> clazz) {
- try {
- return clazz.newInstance();
- } catch (Exception ex) {
- logFailedInstantiation(ex, pluginId, extensionPoint, clazz.getName());
- return null;
- }
- }
-
- /**
- * Load the specified class and cast it to the specified interface.
- */
- private static <T> Class<T> loadClass(String pluginId, String extensionPoint, String className, Class<T> interfaze) {
- Bundle bundle = Platform.getBundle(pluginId);
-
- Class<?> clazz;
- try {
- clazz = bundle.loadClass(className);
- } catch (Exception ex) {
- logFailedClassLoad(ex, pluginId, extensionPoint, className);
- return null;
- }
-
- if (interfaze.isAssignableFrom(clazz)) {
- @SuppressWarnings("unchecked")
- Class<T> clazzT = (Class<T>) clazz;
- return clazzT;
- }
-
- logFailedInterfaceAssignment(pluginId, extensionPoint, className, interfaze.getName());
- return null;
- }
-
- public static void logDuplicateExtension(String extensionPoint, String nodeName, String value) {
- log(JptCommonCoreMessages.REGISTRY_DUPLICATE, extensionPoint, nodeName, value);
- }
-
- public static void logMissingAttribute(IConfigurationElement configElement, String attributeName) {
- log(JptCommonCoreMessages.REGISTRY_MISSING_ATTRIBUTE,
- attributeName,
- configElement.getName(),
- configElement.getDeclaringExtension().getExtensionPointUniqueIdentifier(),
- configElement.getContributor().getName());
- }
-
- public static void logInvalidValue(
- IConfigurationElement configElement, String nodeName, String invalidValue) {
-
- log(JptCommonCoreMessages.REGISTRY_INVALID_VALUE,
- invalidValue,
- nodeName,
- configElement.getDeclaringExtension().getExtensionPointUniqueIdentifier(),
- configElement.getContributor().getName());
- }
-
- private static void logFailedClassLoad(Exception ex, String pluginId, String extensionPoint, String className) {
- log(ex, JptCommonCoreMessages.REGISTRY_FAILED_CLASS_LOAD,
- className,
- extensionPoint,
- pluginId);
- }
-
- private static void logFailedInterfaceAssignment(
- String pluginId, String extensionPoint, String className, String interfaceName) {
-
- log(JptCommonCoreMessages.REGISTRY_FAILED_INTERFACE_ASSIGNMENT,
- className,
- extensionPoint,
- pluginId,
- interfaceName);
- }
-
- private static void logFailedInstantiation(Exception ex, String pluginId, String extensionPoint, String className) {
- log(ex, JptCommonCoreMessages.REGISTRY_FAILED_INSTANTIATION,
- className,
- extensionPoint,
- pluginId);
- }
-
- public static void log(String msg, String... bindings) {
- JptCommonCorePlugin.log(NLS.bind(msg, bindings));
- }
-
- public static void log(Throwable ex, String msg, String... bindings) {
- JptCommonCorePlugin.log(NLS.bind(msg, bindings), ex);
- }
-
- public static void log(Throwable ex) {
- JptCommonCorePlugin.log(ex);
- }
-
-
- public static final class XPointException extends Exception {
- private static final long serialVersionUID = 1L;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ASTTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ASTTools.java
deleted file mode 100644
index ccf435662e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ASTTools.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.HashSet;
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTParser;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.IAnnotationBinding;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.common.core.internal.utility.SimpleTextRange;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.SimpleJavaType;
-import org.eclipse.jpt.common.utility.internal.SimpleMethodSignature;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-/**
- * Convenience methods for dealing with JDT ASTs.
- */
-public class ASTTools {
-
- /**
- * Build an AST without method bodies for the specified compilation unit
- * with its bindings resolved (and the resultant performance hit).
- */
- public static CompilationUnit buildASTRoot(ICompilationUnit compilationUnit) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(compilationUnit);
- parser.setIgnoreMethodBodies(true); // we don't need method bodies
- parser.setResolveBindings(true);
- parser.setBindingsRecovery(true); // see bugs 196200, 222735
- return (CompilationUnit) parser.createAST(null);
- }
-
-
- // ********** JDT DOM **********
-
- public static String resolveEnum(Expression expression) {
- if (expression == null) {
- return null;
- }
- switch (expression.getNodeType()) {
- case ASTNode.QUALIFIED_NAME:
- case ASTNode.SIMPLE_NAME:
- return resolveEnum((Name) expression);
- default:
- return null;
- }
- }
-
- public static String resolveEnum(Name enumExpression) {
- IBinding binding = enumExpression.resolveBinding();
- if (binding == null) {
- return null; // TODO figure out why this is null sometimes
- }
- if (binding.getKind() != IBinding.VARIABLE) {
- return null;
- }
- IVariableBinding variableBinding = (IVariableBinding) binding;
- return variableBinding.getType().getQualifiedName() + '.' + variableBinding.getName();
- }
-
- /**
- * Return the fully-qualified name of the specified node's annotation
- * class.
- */
- public static String resolveAnnotation(Annotation node) {
- IAnnotationBinding annotationBinding = node.resolveAnnotationBinding();
- if (annotationBinding == null) {
- return null;
- }
- ITypeBinding annotationTypeBinding = annotationBinding.getAnnotationType();
- return (annotationTypeBinding == null) ? null : annotationTypeBinding.getQualifiedName();
- }
-
- /**
- * If the specified expression is a type literal, return the type's fully-
- * qualified name. Return null otherwise.
- */
- public static String resolveFullyQualifiedName(Expression expression) {
- ITypeBinding resolvedTypeBinding = resolveTypeBinding(expression);
- return (resolvedTypeBinding == null) ? null : resolvedTypeBinding.getQualifiedName();
- }
-
- /**
- * If the specified expression is an array initializer, return an an iterable
- * on the types' fully qualfified names.
- * The results may include nulls.
- */
- public static Iterable<String> resolveFullyQualifiedNames(Expression expression) {
- return new TransformationIterable<ITypeBinding, String>(resolveTypeBindings(expression)) {
- @Override
- protected String transform(ITypeBinding o) {
- return (o == null) ? null : o.getQualifiedName();
- }
- };
- }
-
- /**
- * If the specified expression is a type literal, return the corresponding
- * type binding.
- */
- public static ITypeBinding resolveTypeBinding(Expression expression) {
- if (expression != null && expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- return ((TypeLiteral) expression).getType().resolveBinding();
- }
- return null;
- }
-
- /**
- * If the specified expression is an array initializer, return an iterable of
- * the corresponding type bindings for each sub-expression.
- * The result may include <code>null</code> elements.
- */
- public static Iterable<ITypeBinding> resolveTypeBindings(Expression expression) {
- return (expression != null && expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) ?
- resolveTypeBindings((ArrayInitializer) expression) :
- EmptyIterable.<ITypeBinding>instance();
- }
-
- private static Iterable<ITypeBinding> resolveTypeBindings(ArrayInitializer arrayExpression) {
- @SuppressWarnings("unchecked")
- Iterable<Expression> expressions = arrayExpression.expressions();
- return new TransformationIterable<Expression, ITypeBinding>(expressions) {
- @Override
- protected ITypeBinding transform(Expression expression) {
- return resolveTypeBinding(expression);
- }
- };
- }
-
- public static MethodSignature buildMethodSignature(MethodDeclaration methodDeclaration) {
- return new SimpleMethodSignature(
- methodDeclaration.getName().getFullyQualifiedName(),
- buildParameterTypes(methodDeclaration)
- );
- }
-
- public static JavaType[] buildParameterTypes(MethodDeclaration methodDeclaration) {
- List<SingleVariableDeclaration> parameters = parameters(methodDeclaration);
- int len = parameters.size();
- JavaType[] parameterTypes = new JavaType[len];
- for (int i = 0; i < len; i++) {
- ITypeBinding type = parameters.get(i).getType().resolveBinding();
- parameterTypes[i] = new SimpleJavaType(type.getQualifiedName(), type.getDimensions());
- }
- return parameterTypes;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private static List<SingleVariableDeclaration> parameters(MethodDeclaration methodDeclaration) {
- return methodDeclaration.parameters();
- }
-
- /**
- * Return whether the specified expression is a type literal and the type binding
- * corresponding to the specified type name exists in the type
- * literal's inheritance hierarchy (superclasses and interfaces).
- * Return null otherwise.
- */
- public static boolean typeIsSubTypeOf(Expression expression, String searchTypeName) {
- return findTypeInHierarchy(expression, searchTypeName) != null;
- }
-
- /**
- * If the specified expression is a type literal, return the type binding
- * corresponding to the specified type name if it exists in the type
- * literal's inheritance hierarchy (superclasses and interfaces).
- * Return null otherwise.
- */
- public static ITypeBinding findTypeInHierarchy(Expression expression, String searchTypeName) {
- ITypeBinding typeBinding = resolveTypeBinding(expression);
- return (typeBinding == null) ? null : findTypeInHierarchy(typeBinding, searchTypeName);
- }
-
- /**
- * Return whether a type binding with the specified type name exists in
- * the specified type binding's inheritance hierarchy (superclasses
- * and interfaces).
- */
- public static boolean typeIsSubTypeOf(ITypeBinding typeBinding, String searchTypeName) {
- return findTypeInHierarchy(typeBinding, searchTypeName) != null;
- }
-
- /**
- * Return the type binding corresponding to the specified type name if it
- * exists in the specified type binding's inheritance hierarchy (superclasses
- * and interfaces). Return null otherwise.
- */
- public static ITypeBinding findTypeInHierarchy(ITypeBinding typeBinding, String searchTypeName) {
- return findTypeInHierarchy(typeBinding, searchTypeName, new HashSet<String>());
- }
-
- private static ITypeBinding findTypeInHierarchy(ITypeBinding typeBinding, String searchTypeName, HashSet<String> visited) {
- String typeName = typeBinding.getTypeDeclaration().getQualifiedName();
- if (visited.contains(typeName)) {
- return null;
- }
- if (typeName.equals(searchTypeName)) {
- return typeBinding;
- }
- visited.add(typeName);
-
- ITypeBinding interfaceBinding = findTypeInInterfaces(typeBinding, searchTypeName, visited);
- if (interfaceBinding != null) {
- return interfaceBinding;
- }
-
- return findTypeInSuperclasses(typeBinding, searchTypeName, visited);
- }
-
- private static ITypeBinding findTypeInInterfaces(ITypeBinding typeBinding, String searchTypeName, HashSet<String> visited) {
- ITypeBinding[] interfaceBindings = typeBinding.getInterfaces();
- for (ITypeBinding interfaceBinding : interfaceBindings) { // recurse up interfaces
- ITypeBinding result = findTypeInHierarchy(interfaceBinding, searchTypeName, visited);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- private static ITypeBinding findTypeInSuperclasses(ITypeBinding typeBinding, String searchTypeName, HashSet<String> visited) {
- ITypeBinding superBinding = typeBinding.getSuperclass();
- if (superBinding != null) { // recurse up superclasses
- ITypeBinding result = findTypeInHierarchy(superBinding, searchTypeName, visited);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
- /**
- * Return whether the specified expression is a type literal and the type binding
- * corresponding to the specified interface name exists in the type
- * literal's inheritance hierarchy (superclasses and interfaces).
- * Return null otherwise.
- */
- public static boolean typeImplementsInterface(Expression expression, String searchInterfaceName) {
- ITypeBinding typeBinding = resolveTypeBinding(expression);
- if (typeBinding == null) {
- return false;
- }
- return findInterfaceInHierarchy(typeBinding, searchInterfaceName) != null;
- }
-
- /**
- * Return whether a type binding with the specified interface name exists in
- * the specified type binding's inheritance hierarchy (superclasses
- * and interfaces).
- */
- public static boolean typeImplementsInterface(ITypeBinding typeBinding, String searchInterfaceName) {
- return findInterfaceInHierarchy(typeBinding, searchInterfaceName) != null;
- }
-
- private static ITypeBinding findInterfaceInHierarchy(ITypeBinding typeBinding, String searchInterfaceName) {
- HashSet<String> visited = new HashSet<String>();
- ITypeBinding interfaceBinding = findTypeInInterfaces(typeBinding, searchInterfaceName, visited);
- if (interfaceBinding != null) {
- return interfaceBinding;
- }
-
- return findTypeInSuperclasses(typeBinding, searchInterfaceName, visited);
-
- }
-
- /**
- * Build and return a text range for the specified AST node.
- */
- public static TextRange buildTextRange(ASTNode astNode) {
- return buildTextRange(astNode, null);
- }
-
- /**
- * Build and return a text range for the specified AST node if it differs
- * from the specified text range or the specified text range is
- * <code>null</code>. If the AST node already matches the
- * specified text range, simply return the text range unchanged.
- */
- public static TextRange buildTextRange(ASTNode astNode, TextRange textRange) {
- int offset = astNode.getStartPosition();
- int length = astNode.getLength();
- int lineNumber = ((CompilationUnit) astNode.getRoot()).getLineNumber(offset);
- return (textRange == null) ?
- new SimpleTextRange(offset, length, lineNumber) :
- textRange.buildTextRange(offset, length, lineNumber);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractAnnotationAdapter.java
deleted file mode 100644
index 7333322d48..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractAnnotationAdapter.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Adapt an annotated element and a declaration annotation adapter.
- */
-public abstract class AbstractAnnotationAdapter implements AnnotationAdapter {
- private final AnnotatedElement annotatedElement;
- private final DeclarationAnnotationAdapter daa;
-
-
- // ********** constructor **********
-
- public AbstractAnnotationAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super();
- this.annotatedElement = annotatedElement;
- this.daa = daa;
- }
-
-
- // ********** AnnotationAdapter implementation **********
-
- public Annotation getAnnotation(CompilationUnit astRoot) {
- return this.daa.getAnnotation(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- public void newMarkerAnnotation() {
- this.edit(this.buildNewMarkerAnnotationEditor());
- }
-
- public void newSingleMemberAnnotation() {
- this.edit(this.buildNewSingleMemberAnnotationEditor());
- }
-
- public void newNormalAnnotation() {
- this.edit(this.buildNewNormalAnnotationEditor());
- }
-
- public void removeAnnotation() {
- this.edit(this.buildRemoveAnnotationEditor());
- }
-
- public ASTNode getAstNode(CompilationUnit astRoot) {
- return this.daa.getAstNode(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.daa);
- }
-
-
- // ********** internal methods **********
-
- protected void edit(AnnotatedElement.Editor editor) {
- this.annotatedElement.edit(editor);
- }
-
-
- // ********** factory methods **********
-
- protected AnnotatedElement.Editor buildNewMarkerAnnotationEditor() {
- return new NewMarkerAnnotationEditor(this.daa);
- }
-
- protected AnnotatedElement.Editor buildNewSingleMemberAnnotationEditor() {
- return new NewSingleMemberAnnotationEditor(this.daa);
- }
-
- protected AnnotatedElement.Editor buildNewNormalAnnotationEditor() {
- return new NewNormalAnnotationEditor(this.daa);
- }
-
- protected AnnotatedElement.Editor buildRemoveAnnotationEditor() {
- return new RemoveAnnotationEditor(this.daa);
- }
-
-
- // ********** member classes **********
-
- protected static class NewMarkerAnnotationEditor implements AnnotatedElement.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- NewMarkerAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.newMarkerAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- protected static class NewSingleMemberAnnotationEditor implements AnnotatedElement.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- NewSingleMemberAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.newSingleMemberAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- protected static class NewNormalAnnotationEditor implements AnnotatedElement.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- NewNormalAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.newNormalAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- protected static class RemoveAnnotationEditor implements AnnotatedElement.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- RemoveAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.removeAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractDeclarationAnnotationAdapter.java
deleted file mode 100644
index 821c4ed618..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- *
- */
-public abstract class AbstractDeclarationAnnotationAdapter implements DeclarationAnnotationAdapter {
- private final String annotationName;
-
-
- // ********** constructors **********
-
- protected AbstractDeclarationAnnotationAdapter(String annotationName) {
- super();
- this.annotationName = annotationName;
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) {
- MarkerAnnotation annotation = this.newMarkerAnnotation(declaration.getAst());
- this.addAnnotationAndImport(declaration, annotation);
- return annotation;
- }
-
- public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) {
- SingleMemberAnnotation annotation = this.newSingleMemberAnnotation(declaration.getAst());
- this.addAnnotationAndImport(declaration, annotation);
- return annotation;
- }
-
- public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) {
- NormalAnnotation annotation = this.newNormalAnnotation(declaration.getAst());
- this.addAnnotationAndImport(declaration, annotation);
- return annotation;
- }
-
- /**
- * Add the appropriate import statement, then shorten the annotation's
- * name before adding it to the declaration.
- */
- protected void addAnnotationAndImport(ModifiedDeclaration declaration, Annotation annotation) {
- annotation.setTypeName(declaration.getAst().newName(this.getSourceCodeAnnotationName(declaration)));
- this.addAnnotation(declaration, annotation);
- }
-
- /**
- * Return the annotation's name as it can be used in source code;
- * i.e. if we can add it to the compilation unit's imports, return the short
- * name; if we can't (because of a collision), return the fully-qualified name.
- * NB: an import may be added as a side-effect :-(
- */
- protected String getSourceCodeAnnotationName(ModifiedDeclaration declaration) {
- return declaration.addImport(this.annotationName) ? this.getShortAnnotationName() : this.annotationName;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.annotationName);
- }
-
- /**
- * Add the specified annotation to the specified declaration,
- * replacing the original annotation if present.
- */
- protected abstract void addAnnotation(ModifiedDeclaration declaration, Annotation annotation);
-
-
- // ********** public methods **********
-
- /**
- * This is 'public' because we use it in CombinationIndexedDeclarationAnnotationAdapter
- * to get the annotation name from a NestedIndexedDeclarationAnnotationAdapter.
- */
- public String getAnnotationName() {
- return this.annotationName;
- }
-
-
- // ********** helper methods **********
-
- protected boolean nameMatches(ModifiedDeclaration declaration, Annotation annotation) {
- return this.nameMatches(declaration, annotation, this.annotationName);
- }
-
- protected boolean nameMatches(ModifiedDeclaration declaration, Annotation annotation, String name) {
- return declaration.annotationIsNamed(annotation, name);
- }
-
- protected MarkerAnnotation newMarkerAnnotation(AST ast) {
- return this.newMarkerAnnotation(ast, this.annotationName);
- }
-
- protected MarkerAnnotation newMarkerAnnotation(AST ast, String name) {
- MarkerAnnotation annotation = ast.newMarkerAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- protected SingleMemberAnnotation newSingleMemberAnnotation(AST ast) {
- return this.newSingleMemberAnnotation(ast, this.annotationName);
- }
-
- protected SingleMemberAnnotation newSingleMemberAnnotation(AST ast, String name) {
- SingleMemberAnnotation annotation = ast.newSingleMemberAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- protected NormalAnnotation newNormalAnnotation(AST ast) {
- return this.newNormalAnnotation(ast, this.annotationName);
- }
-
- protected NormalAnnotation newNormalAnnotation(AST ast, String name) {
- NormalAnnotation annotation = ast.newNormalAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- protected String getShortAnnotationName() {
- return convertToShortName(this.annotationName);
- }
-
- protected static String convertToShortName(String name) {
- return name.substring(name.lastIndexOf('.') + 1);
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractExpressionConverter.java
deleted file mode 100644
index 66b49ff157..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractExpressionConverter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Gather together the common implementation behavior.
- * T is the type of the object to be converted to and from an expression.
- *
- * We're still figuring out Java Generics here.... The methods in this abstract
- * class work fine with any subclass of Expression E; but a ClassCastException
- * will occur as soon as we call any method implemented by a subclass
- * (e.g. StringExpressionConverter) that expects a particular subclass of
- * Expression (e.g. StringLiteral).
- */
-public abstract class AbstractExpressionConverter<T>
- implements ExpressionConverter<T>
-{
-
- protected AbstractExpressionConverter() {
- super();
- }
-
-
- // ********** object -> expression **********
-
- public Expression convert(T object, AST ast) {
- return (object == null) ? this.convertNull(ast) : this.convertObject(object, ast);
- }
-
- /**
- * Return the expression for a null object. By default, a null object will
- * be converted into a null expression.
- */
- protected Expression convertNull(@SuppressWarnings("unused") AST ast) {
- return null;
- }
-
- /**
- * The specified object is not null.
- * @see #convert(Object, AST)
- */
- protected abstract Expression convertObject(T object, AST ast);
-
-
- // ********** expression -> object **********
-
- public T convert(Expression expression) {
- return (expression == null) ? this.convertNull() : this.convertExpression(expression);
- }
-
- /**
- * Return the object for a null expression. By default, a null expression will
- * be converted into a null object.
- */
- protected T convertNull() {
- return null;
- }
-
- /**
- * The specified expression is not null.
- * @see #convert(Expression)
- */
- protected abstract T convertExpression(Expression expression);
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractJDTType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractJDTType.java
deleted file mode 100644
index 48ac9b202a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractJDTType.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT abstract type.
- */
-public abstract class AbstractJDTType
- extends JDTMember
- implements AbstractType
-{
-
- /**
- * constructor for the compilation unit's primary type
- */
- protected AbstractJDTType(
- AbstractTypeDeclaration typeDeclaration,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(typeDeclaration, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for the compilation unit's primary type
- */
- protected AbstractJDTType(
- AbstractTypeDeclaration typeDeclaration,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- this(null, typeDeclaration, 1, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for nested types
- */
- protected AbstractJDTType(
- Type declaringType,
- AbstractTypeDeclaration typeDeclaration,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringType, typeDeclaration, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for nested types
- */
- protected AbstractJDTType(
- Type declaringType,
- AbstractTypeDeclaration typeDeclaration,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, typeDeclaration.getName().getFullyQualifiedName(), occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- protected AbstractJDTType(Type declaringType, String name, int occurrence, ICompilationUnit compilationUnit) {
- super(declaringType, name, occurrence, compilationUnit, CommandExecutor.Default.instance(), DefaultAnnotationEditFormatter.instance());
- }
-
- @Override
- protected Type getDeclaringType() {
- return (Type) super.getDeclaringType();
- }
-
- // ********** Member/Type implementation **********
-
- public ITypeBinding getBinding(CompilationUnit astRoot) {
- AbstractTypeDeclaration td = this.getBodyDeclaration(astRoot);
- return (td == null) ? null : td.resolveBinding();
- }
-
- /**
- * find the type's body declaration in the specified AST
- */
- @Override
- public AbstractTypeDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- Type declaringType = this.getDeclaringType();
- if (declaringType == null) {
- return this.getTopLevelTypeDeclaration(astRoot);
- }
- TypeDeclaration typeDeclaration = declaringType.getBodyDeclaration(astRoot);
- // the type declaration can be null when the source is completely hosed
- return (typeDeclaration == null) ? null : this.getNestedTypeDeclaration(typeDeclaration);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- AbstractTypeDeclaration bodyDeclaration = this.getBodyDeclaration(astRoot);
- // the declaration can be null if the resource is out of sync with the file system
- return (bodyDeclaration) == null ? null : ASTTools.buildTextRange(bodyDeclaration.getName());
- }
-
-
- // ********** internal **********
-
- /**
- * return the first top-level type in the specified AST with a matching name
- */
- protected AbstractTypeDeclaration getTopLevelTypeDeclaration(CompilationUnit astRoot) {
- return this.getTypeDeclaration(types(astRoot));
- }
-
- protected AbstractTypeDeclaration getTypeDeclaration(List<AbstractTypeDeclaration> typeDeclarations) {
- return this.getTypeDeclaration(typeDeclarations.toArray(new AbstractTypeDeclaration[typeDeclarations.size()]));
- }
-
- /**
- * Return the nested type declaration with matching name and occurrence within the declaring type
- */
- protected abstract AbstractTypeDeclaration getNestedTypeDeclaration(TypeDeclaration declaringTypeDeclaration);
-
- /**
- * return the type declaration corresponding to the type from the specified
- * set of type declarations (match name and occurrence).
- * Only return type or enum declarations
- */
- protected AbstractTypeDeclaration getTypeDeclaration(AbstractTypeDeclaration[] typeDeclarations) {
- String name = this.getName();
- int occurrence = this.getOccurrence();
- int count = 0;
- for (AbstractTypeDeclaration typeDeclaration : typeDeclarations) {
- if (typeDeclaration.getName().getFullyQualifiedName().equals(name)) {
- count++;
- if (count == occurrence) {
- return (typeDeclaration.getNodeType() == this.getASTNodeType()) ? typeDeclaration : null;
- }
- }
- }
- // return null if the type is no longer in the source code;
- // this can happen when the context model has not yet
- // been synchronized with the resource model but is still
- // asking for an ASTNode (e.g. during a selection event)
- return null;
- }
-
- protected abstract int getASTNodeType();
-
- /**
- * we only instantiate a single top-level, non-annotation
- * type per compilation unit (i.e. a class, enum, or interface)
- */
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected static List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-
- protected static EnumDeclaration[] getEnums(TypeDeclaration declaringTypeDeclaration) {
- List<BodyDeclaration> bd = bodyDeclarations(declaringTypeDeclaration);
- int typeCount = 0;
- for (Iterator<BodyDeclaration> it = bd.listIterator(); it.hasNext(); ) {
- if (it.next().getNodeType() == ASTNode.ENUM_DECLARATION) {
- typeCount++;
- }
- }
- EnumDeclaration[] memberEnums = new EnumDeclaration[typeCount];
- int next = 0;
- for (Iterator<BodyDeclaration> it = bd.listIterator(); it.hasNext(); ) {
- BodyDeclaration decl = it.next();
- if (decl.getNodeType() == ASTNode.ENUM_DECLARATION) {
- memberEnums[next++] = (EnumDeclaration) decl;
- }
- }
- return memberEnums;
- }
-
- @SuppressWarnings("unchecked")
- protected static List<BodyDeclaration> bodyDeclarations(TypeDeclaration typeDeclaration) {
- return typeDeclaration.bodyDeclarations();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 1e12f713b0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Pull together some of the behavior common to
- * {@link NestedDeclarationAnnotationAdapter}
- * and {@link NestedIndexedDeclarationAnnotationAdapter}
- */
-public abstract class AbstractNestedDeclarationAnnotationAdapter
- extends AbstractDeclarationAnnotationAdapter
-{
- private final DeclarationAnnotationAdapter outerAnnotationAdapter;
- private final String elementName;
-
- // reduce NLS checks
- protected static final String VALUE = "value"; //$NON-NLS-1$
-
-
- // ********** constructors **********
-
- /**
- * The default element name is <code>value</code>.
- */
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String annotationName) {
- this(outerAnnotationAdapter, VALUE, annotationName);
- }
-
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName) {
- super(annotationName);
- this.outerAnnotationAdapter = outerAnnotationAdapter;
- this.elementName = elementName;
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration);
- if (outer == null) {
- return null;
- }
- Expression value = this.elementValue(outer);
- if (value == null) {
- return null;
- }
- Annotation inner = this.getAnnotation(value);
- if (inner == null) {
- return null;
- }
- // return the annotation only if it has a matching name(?)
- return this.nameMatches(declaration, inner) ? inner : null;
- }
-
- public void removeAnnotation(ModifiedDeclaration declaration) {
- Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration);
- if (outer == null) {
- return;
- }
- Expression value = this.elementValue(outer);
- if (value == null) {
- return;
- }
- // hack to allow short-circuit when the value is an array initializer
- if (this.removeAnnotation(declaration, outer, value)) {
- return;
- }
- Annotation inner = this.annotationValue(value);
- if (inner == null) {
- return;
- }
- // remove the annotation only if it has a matching name(?)
- if (this.nameMatches(declaration, inner)) {
- this.removeElementAndNormalize(declaration, outer);
- }
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- // if the annotation is missing, return the outer annotation's node
- Annotation annotation = this.getAnnotation(declaration);
- return (annotation != null) ? annotation : this.outerAnnotationAdapter.getAstNode(declaration);
- }
-
- @Override
- protected void addAnnotation(ModifiedDeclaration declaration, Annotation inner) {
- Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration);
- if (outer == null) {
- this.buildNewOuterAnnotation(declaration, inner);
- } else if (outer.isMarkerAnnotation()) {
- this.modifyAnnotation(declaration, (MarkerAnnotation) outer, inner);
- } else if (outer.isSingleMemberAnnotation()) {
- this.modifyAnnotation(declaration, (SingleMemberAnnotation) outer, inner);
- } else if (outer.isNormalAnnotation()) {
- this.modifyAnnotation(declaration, (NormalAnnotation) outer, inner);
- } else {
- throw new IllegalStateException("unknown annotation type: " + outer); //$NON-NLS-1$
- }
- }
-
-
- // ********** abstract methods **********
-
- /**
- * Return an annotation extracted from the specified expression,
- * which is the value of the adapter's element.
- */
- protected abstract Annotation getAnnotation(Expression value);
-
- /**
- * Remove the annotation from the specified expression,
- * which is the value of the adapter's element.
- * Return whether the removal was successful.
- */
- protected abstract boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value);
-
- /**
- * Set the value of the specified outer annotation to the
- * specified inner annotation.
- */
- protected abstract void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner);
-
- /**
- * Set the value of the specified member value pair to the
- * specified inner annotation.
- */
- protected abstract void modifyMemberValuePair(MemberValuePair pair, Annotation inner);
-
-
- // ********** public methods **********
-
- public DeclarationAnnotationAdapter getOuterAnnotationAdapter() {
- return this.outerAnnotationAdapter;
- }
-
- public String getElementName() {
- return this.elementName;
- }
-
-
- // ********** internal methods **********
-
- /**
- * If the specified expression is an annotation, cast it to an annotation;
- * otherwise return null.
- */
- protected Annotation annotationValue(Expression expression) {
- switch (expression.getNodeType()) {
- case ASTNode.NORMAL_ANNOTATION:
- case ASTNode.SINGLE_MEMBER_ANNOTATION:
- case ASTNode.MARKER_ANNOTATION:
- return (Annotation) expression;
- default:
- return null;
- }
- }
-
- /**
- * Remove the <em>first</em> annotation element with the specified name
- * from the specified annotation, converting the annotation as appropriate.
- */
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, Annotation outer) {
- if (outer.isNormalAnnotation()) {
- this.removeElementAndNormalize(declaration, (NormalAnnotation) outer);
- } else if (outer.isSingleMemberAnnotation()) {
- this.removeElementAndNormalize(declaration, (SingleMemberAnnotation) outer);
- } else if (outer.isMarkerAnnotation()) {
- this.removeElementAndNormalize(declaration, (MarkerAnnotation) outer);
- } else {
- throw new IllegalArgumentException("unknown annotation type: " + outer); //$NON-NLS-1$
- }
- }
-
- /**
- * Remove the <em>first</em> annotation element with the adapter's element
- * name from the specified annotation. Convert the annotation to
- * a marker annotation or single member annotation if appropriate.
- * <pre>
- * &#64;Outer(name="Fred", foo=&#64;Inner) => &#64;Outer(name="Fred")
- * &#64;Outer(foo=&#64;Inner) => &#64;Outer
- * </pre>
- */
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, NormalAnnotation outer) {
- this.removeElement(outer);
- this.normalizeAnnotation(declaration, outer);
- }
-
- /**
- * Remove from the specified annotation the element with
- * the adapter's element name.
- */
- protected void removeElement(NormalAnnotation annotation) {
- for (Iterator<MemberValuePair> stream = this.values(annotation).iterator(); stream.hasNext(); ) {
- MemberValuePair pair = stream.next();
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- stream.remove();
- break;
- }
- }
- }
-
- /**
- * Convert the specified normal annotation to a marker annotation or
- * single member annotation if appropriate.
- */
- protected void normalizeAnnotation(ModifiedDeclaration declaration, NormalAnnotation outer) {
- List<MemberValuePair> values = this.values(outer);
- switch (values.size()) {
- case 0:
- // if the elements are all gone, convert the annotation to a marker annotation
- this.outerAnnotationAdapter.newMarkerAnnotation(declaration);
- break;
- case 1:
- MemberValuePair pair = values.get(0);
- if (pair.getName().getFullyQualifiedName().equals(VALUE)) {
- // if the last remaining element is 'value', convert the annotation to a single member annotation
- Expression vv = pair.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.outerAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv);
- }
- break;
- default:
- // do nothing
- break;
- }
- }
-
- /**
- * Convert the specified single member annotation to a marker annotation
- * if the adapter's element name is <code>value</code>.
- */
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, @SuppressWarnings("unused") SingleMemberAnnotation outer) {
- if (this.elementName.equals(VALUE)) {
- this.outerAnnotationAdapter.newMarkerAnnotation(declaration);
- }
- }
-
- protected void removeElementAndNormalize(@SuppressWarnings("unused") ModifiedDeclaration declaration, @SuppressWarnings("unused") MarkerAnnotation outer) {
- // NOP
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- * (An element name of "value" will return the value of a single
- * member annotation.)
- */
- protected Expression elementValue(Annotation annotation) {
- if (annotation.isNormalAnnotation()) {
- return this.elementValue((NormalAnnotation) annotation);
- }
- if (annotation.isSingleMemberAnnotation()) {
- return this.elementValue((SingleMemberAnnotation) annotation);
- }
- return null;
- }
-
- protected Expression elementValue(NormalAnnotation annotation) {
- MemberValuePair pair = this.memberValuePair(annotation);
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * If the adapter's element name is "value", return the value of the
- * annotation, otherwise return null.
- */
- protected Expression elementValue(SingleMemberAnnotation annotation) {
- return this.elementName.equals(VALUE) ? annotation.getValue() : null;
- }
-
- /**
- * Return the *first* member value pair for the adapter's element name.
- * Return null if the specified annotation has no such element.
- */
- protected MemberValuePair memberValuePair(NormalAnnotation annotation) {
- for (MemberValuePair pair : this.values(annotation)) {
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- /**
- * Build a new outer annotation and add the specified
- * inner annotation to it:
- * <pre>
- * &#64;Outer(&#64;Inner)
- * </pre>
- * or
- * <pre>
- * &#64;Outer(foo=&#64;Inner)
- * </pre>
- */
- protected void buildNewOuterAnnotation(ModifiedDeclaration declaration, Annotation inner) {
- if (this.elementName.equals(VALUE)) {
- this.outerAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(this.buildNewInnerExpression(inner));
- } else {
- List<MemberValuePair> values = this.values(this.outerAnnotationAdapter.newNormalAnnotation(declaration));
- values.add(this.newMemberValuePair(this.buildNewInnerExpression(inner)));
- }
- }
-
- /**
- * Build an expression to be added to a new outer annotation
- * for the specified inner annotation.
- */
- protected abstract Expression buildNewInnerExpression(Annotation inner);
-
- /**
- * Build a new member value pair with the specified name and value.
- */
- protected MemberValuePair newMemberValuePair(String name, Expression value) {
- AST ast = value.getAST();
- MemberValuePair pair = ast.newMemberValuePair();
- pair.setName(ast.newSimpleName(name));
- pair.setValue(value);
- return pair;
- }
-
- /**
- * Build a new member value pair with the adapter's element name
- * and the specified inner annotation.
- */
- protected MemberValuePair newMemberValuePair(Expression value) {
- return this.newMemberValuePair(this.elementName, value);
- }
-
- /**
- * Add the specified inner annotation to the marker annotation.
- */
- protected void modifyAnnotation(ModifiedDeclaration declaration, @SuppressWarnings("unused") MarkerAnnotation outer, Annotation inner) {
- this.buildNewOuterAnnotation(declaration, inner);
- }
-
- /**
- * Add the specified inner annotation to the single member annotation.
- */
- protected void modifyAnnotation(ModifiedDeclaration declaration, SingleMemberAnnotation outer, Annotation inner) {
- if (this.elementName.equals(VALUE)) {
- this.modifyAnnotationValue(outer, inner);
- } else {
- this.modifyAnnotationNonValue(declaration, outer, inner);
- }
- }
-
- /**
- * Add the specified inner annotation to the single member annotation,
- * converting it to a normal annotation:
- * <pre>
- * &#64;Outer("lorem ipsum") => &#64;Outer(value="lorem ipsum", foo=&#64;Inner)
- * </pre>
- */
- protected void modifyAnnotationNonValue(ModifiedDeclaration declaration, SingleMemberAnnotation outer, Annotation inner) {
- Expression vv = outer.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- NormalAnnotation newOuter = this.outerAnnotationAdapter.newNormalAnnotation(declaration);
- List<MemberValuePair> values = this.values(newOuter);
- values.add(this.newMemberValuePair(VALUE, vv));
- values.add(this.newMemberValuePair(this.buildNewInnerExpression(inner)));
- }
-
- /**
- * Add the specified inner annotation to the normal annotation:
- * <pre>
- * &#64;Outer(bar="lorem ipsum") => &#64;Outer(bar="lorem ipsum", foo=&#64;Inner)
- * </pre>
- * or
- * <pre>
- * &#64;Outer(foo=&#64;Inner("lorem ipsum")) => &#64;Outer(foo=&#64;Inner)
- * </pre>
- */
- protected void modifyAnnotation(@SuppressWarnings("unused") ModifiedDeclaration declaration, NormalAnnotation outer, Annotation inner) {
- MemberValuePair pair = this.memberValuePair(outer);
- if (pair == null) {
- List<MemberValuePair> values = this.values(outer);
- values.add(this.newMemberValuePair(inner));
- } else {
- this.modifyMemberValuePair(pair, inner);
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotatedElementAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotatedElementAnnotationElementAdapter.java
deleted file mode 100644
index 4419a56f0c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotatedElementAnnotationElementAdapter.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
- /**
- * Adapt an annotated element and a declaration annotation element adapter.
- */
-public class AnnotatedElementAnnotationElementAdapter<T>
- implements AnnotationElementAdapter<T>
-{
- private final AnnotatedElement annotatedElement;
- private final DeclarationAnnotationElementAdapter<T> daea;
-
-
- // ********** constructor **********
-
- public AnnotatedElementAnnotationElementAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationElementAdapter<T> daea) {
- super();
- this.annotatedElement = annotatedElement;
- this.daea = daea;
- }
-
-
- // ********** AnnotationElementAdapter implementation **********
-
- public T getValue() {
- return this.daea.getValue(this.annotatedElement.getModifiedDeclaration());
- }
-
- public T getValue(CompilationUnit astRoot) {
- return this.daea.getValue(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- public void setValue(T value) {
- this.edit(this.buildSetValueEditor(value));
- }
-
- public Expression getExpression(CompilationUnit astRoot) {
- return this.daea.getExpression(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- public ASTNode getAstNode(CompilationUnit astRoot) {
- return this.daea.getAstNode(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.daea);
- }
-
-
- // ********** internal methods **********
-
- protected void edit(AnnotatedElement.Editor editor) {
- this.annotatedElement.edit(editor);
- }
-
- protected AnnotatedElement.Editor buildSetValueEditor(T value) {
- return new SetValueEditor<T>(value, this.daea);
- }
-
-
- // ********** member classes **********
-
- protected static class SetValueEditor<T> implements AnnotatedElement.Editor {
- private final DeclarationAnnotationElementAdapter<T> daea;
- private final T value;
-
- SetValueEditor(T value, DeclarationAnnotationElementAdapter<T> daea) {
- super();
- this.value = value;
- this.daea = daea;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daea.setValue(this.value, declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java
deleted file mode 100644
index 9ecfd9e9e3..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedExpressionConverter;
-
-/**
- * Convert an array initializer or single expression to/from an array of
- * strings (e.g. {"text0", "text1"}).
- * E is the type of the expressions to be found either stand-alone or
- * as elements in the array initializer.
- */
-public class AnnotationStringArrayExpressionConverter
- extends AbstractExpressionConverter<String[]>
- implements IndexedExpressionConverter<String> {
-
- private final ExpressionConverter<String> elementConverter;
- private final StringArrayExpressionConverter arrayConverter;
-
-
- /**
- * The default behavior is to remove the array initializer if it is empty.
- */
- public AnnotationStringArrayExpressionConverter(ExpressionConverter<String> elementConverter) {
- this(elementConverter, true);
- }
-
- public AnnotationStringArrayExpressionConverter(ExpressionConverter<String> elementConverter, boolean removeArrayInitializerWhenEmpty) {
- super();
- this.elementConverter = elementConverter;
- this.arrayConverter = new StringArrayExpressionConverter(elementConverter, removeArrayInitializerWhenEmpty);
- }
-
- /**
- * if we only have a single string in the array return the single expression,
- * without braces, instead of an array initializer
- */
- @Override
- protected Expression convertObject(String[] strings, AST ast) {
- return (strings.length == 1) ?
- this.elementConverter.convert(strings[0], ast)
- :
- this.arrayConverter.convertObject(strings, ast);
- }
-
- @Override
- protected String[] convertNull() {
- return this.arrayConverter.convertNull();
- }
-
- /**
- * check for a single expression with no surrounding braces, implying a
- * single-entry array
- */
- @Override
- protected String[] convertExpression(Expression expression) {
- if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- return this.arrayConverter.convertArrayInitializer((ArrayInitializer) expression);
- }
- String result = this.elementConverter.convert(expression);
- return (result == null) ? new String[0] : new String[] { result };
- }
-
- public Expression getSubexpression(int index, Expression expression) {
- if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- return this.arrayConverter.getSubexpression(index, expression);
- }
- if (index > 0) {
- throw new ArrayIndexOutOfBoundsException();
- }
- return expression;
- }
-
-
- // ********** factory methods **********
-
- /**
- * Build an expression converter for an annotation element of type String[].
- * @Foo(bar={"text0", "text1"})
- * or
- * @Foo(bar="text0")
- */
- public static AnnotationStringArrayExpressionConverter forStrings() {
- return new AnnotationStringArrayExpressionConverter(StringExpressionConverter.instance());
- }
-
- /**
- * Build an expression converter for an annotation element of type <enum>[].
- * @Foo(bar={BAZ, BAT})
- * or
- * @Foo(bar=BAZ)
- */
- public static AnnotationStringArrayExpressionConverter forNames() {
- return new AnnotationStringArrayExpressionConverter(NameStringExpressionConverter.instance());
- }
-
-
- /**
- * Build an expression converter for an annotation element of type Class[].
- * @Foo(bar={Baz.class, Bat.class})
- * or
- * @Foo(bar=Baz.class)
- */
- public static AnnotationStringArrayExpressionConverter forTypes() {
- return new AnnotationStringArrayExpressionConverter(TypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/BooleanExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/BooleanExpressionConverter.java
deleted file mode 100644
index f33a719986..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/BooleanExpressionConverter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.BooleanLiteral;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a boolean literal to/from a Boolean
- * (e.g. Boolean.TRUE).
- */
-public final class BooleanExpressionConverter
- extends AbstractExpressionConverter<Boolean>
-{
- private static final ExpressionConverter<Boolean> INSTANCE = new BooleanExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<Boolean> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private BooleanExpressionConverter() {
- super();
- }
-
- @Override
- protected BooleanLiteral convertObject(Boolean booleanObject, AST ast) {
- return ast.newBooleanLiteral(booleanObject.booleanValue());
- }
-
- @Override
- protected Boolean convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof Boolean) ? ((Boolean) value) : null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CharacterStringExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CharacterStringExpressionConverter.java
deleted file mode 100644
index cfb470581b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CharacterStringExpressionConverter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.CharacterLiteral;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a character literal to/from a string representation of a character
- * (e.g. "A").
- */
-public final class CharacterStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new CharacterStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private CharacterStringExpressionConverter() {
- super();
- }
-
- @Override
- protected CharacterLiteral convertObject(String string, AST ast) {
- CharacterLiteral characterLiteral = ast.newCharacterLiteral();
- characterLiteral.setCharValue(string.charAt(0));
- return characterLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof Character) ? ((Character) value).toString() : null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index dde05b2a59..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Manipulate an annotation that either occurs stand-alone, e.g.
- * <pre>
- * &#64;Inner("zero")
- * private int id;
- * </pre>
- *
- * or is embedded in an element array within another annotation, e.g.
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one"), &#64;Inner("two")})
- * private int id;
- *
- * annotationName = "Inner"
- * containerAnnotationName = "Outer"
- * elementName = "foo"
- * index = 0-2
- * </pre>
- *
- * This is a useful pattern because a declaration cannot have more
- * than one annotation of the same type, and allowing the stand-alone
- * configuration reduces clutter.
- * <br>
- * NB: This configuration only makes sense for "top-level" annotations, as
- * opposed to "nested" annotations. This is because annotation elements
- * can only be declared with a type of a single annotation and annotations
- * cannot be part of an inheritance hierarchy.
- * For example, the following configurations cannot *both* be supported:
- * <pre>
- * &#64;Foo(bar=&#64;Outer(...))
- * private int id;
- *
- * &#64;Foo(bar=&#64;Inner(...)) // not allowed
- * private int id;
- * </pre>
- *
- * NB: Behavior is undefined when both the stand-alone and the nested
- * configurations annotate the same declaration, e.g.
- * <pre>
- * // undefined behavior
- * &#64;Inner("zero")
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one"), &#64;Inner("two")})
- * private int id;
- * </pre>
- */
-public class CombinationIndexedDeclarationAnnotationAdapter
- implements IndexedDeclarationAnnotationAdapter
-{
-
- /**
- * this adapter is used when the annotation is "stand-alone":
- * <pre>
- * &#64;Inner("zero")
- * </pre>
- * and is only used when the index is 0 or 1
- */
- private final DeclarationAnnotationAdapter standAloneAnnotationAdapter;
-
- /**
- * this adapter is used when the annotation is "nested":
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one")})
- * </pre>
- */
- private final NestedIndexedDeclarationAnnotationAdapter nestedAnnotationAdapter;
-
- /**
- * this adapter is for the "nested" annotation at the zero index;
- * and is only used when the index is 1
- */
- private final NestedIndexedDeclarationAnnotationAdapter zeroNestedAnnotationAdapter;
-
- // reduce NLS checks
- protected static final String VALUE = "value"; //$NON-NLS-1$
-
-
- // ********** constructors **********
-
- /**
- * default element name is "value"
- * <pre>
- * &#64;Inner("zero")
- * &#64;Outer({&#64;Inner("zero"), &#64;Inner("one")})
- * </pre>
- */
- public CombinationIndexedDeclarationAnnotationAdapter(String annotationName, String containerAnnotationName, int index) {
- this(annotationName, containerAnnotationName, VALUE, index);
- }
-
- public CombinationIndexedDeclarationAnnotationAdapter(String annotationName, String containerAnnotationName, String elementName, int index) {
- this(new SimpleDeclarationAnnotationAdapter(annotationName), new SimpleDeclarationAnnotationAdapter(containerAnnotationName), elementName, index, annotationName);
- }
-
- /**
- * default element name is "value"
- */
- public CombinationIndexedDeclarationAnnotationAdapter(
- DeclarationAnnotationAdapter standAloneAnnotationAdapter,
- DeclarationAnnotationAdapter containerAnnotationAdapter,
- int index,
- String nestedAnnotationName
- ) {
- this(standAloneAnnotationAdapter, containerAnnotationAdapter, VALUE, index, nestedAnnotationName);
- }
-
- public CombinationIndexedDeclarationAnnotationAdapter(
- DeclarationAnnotationAdapter standAloneAnnotationAdapter,
- DeclarationAnnotationAdapter containerAnnotationAdapter,
- String elementName,
- int index,
- String nestedAnnotationName
- ) {
- super();
- this.standAloneAnnotationAdapter = standAloneAnnotationAdapter;
- this.nestedAnnotationAdapter = new NestedIndexedDeclarationAnnotationAdapter(containerAnnotationAdapter, elementName, index, nestedAnnotationName);
- this.zeroNestedAnnotationAdapter = new NestedIndexedDeclarationAnnotationAdapter(containerAnnotationAdapter, elementName, 0, nestedAnnotationName);
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- if (this.getIndex() == 0) {
- // check for the stand-alone annotation
- Annotation standAloneAnnotation = this.getStandAloneAnnotation(declaration);
- if (standAloneAnnotation != null) {
- return standAloneAnnotation;
- }
- }
- return this.getNestedAnnotation(declaration);
- }
-
- /**
- * <pre>
- * [none] => &#64;Inner
- * or
- * &#64;Inner("lorem ipsum") => &#64;Inner
- * or
- * &#64;Inner(text="lorem ipsum") => &#64;Inner
- * or
- * &#64;Outer(foo={&#64;Inner, &#64;Inner}) => &#64;Outer(foo={&#64;Inner, &#64;Inner, &#64;Inner})
- * or
- * &#64;Outer(foo=&#64;Inner) => &#64;Outer(foo={&#64;Inner, &#64;Inner})
- * or
- * &#64;Inner => &#64;Outer(foo={&#64;Inner, &#64;Inner})
- * etc.
- * </pre>
- */
- public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) {
- return (MarkerAnnotation) this.newAnnotation(MARKER_ANNOTATION_FACTORY, declaration);
- }
-
- public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) {
- return (SingleMemberAnnotation) this.newAnnotation(SINGLE_MEMBER_ANNOTATION_FACTORY, declaration);
- }
-
- public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) {
- return (NormalAnnotation) this.newAnnotation(NORMAL_ANNOTATION_FACTORY, declaration);
- }
-
- public void removeAnnotation(ModifiedDeclaration declaration) {
- if (this.getIndex() == 0) {
- // check for the stand-alone annotation
- if (this.standAloneAnnotationIsPresent(declaration)) {
- this.removeStandAloneAnnotation(declaration);
- return;
- }
- }
- this.removeNestedAnnotation(declaration);
- if (this.nestedElementCanBeConvertedToStandAlone(declaration)) {
- this.convertLastElementAnnotationToStandAloneAnnotation(declaration);
- }
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- // if the annotation is missing, delegate to the nested annotation adapter
- Annotation annotation = this.getAnnotation(declaration);
- return (annotation != null) ? annotation : this.nestedAnnotationAdapter.getAstNode(declaration);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getAnnotationName());
- }
-
-
- // ********** IndexedDeclarationAnnotationAdapter implementation **********
-
- public int getIndex() {
- return this.nestedAnnotationAdapter.getIndex();
- }
-
- public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) {
- int oldIndex = this.getIndex();
- if (newIndex == oldIndex) {
- return;
- }
-
- Annotation standAloneAnnotation = this.getStandAloneAnnotation(declaration);
- if (standAloneAnnotation == null) {
- this.moveNestedAnnotation(newIndex, declaration);
- if (this.nestedElementCanBeConvertedToStandAlone(declaration)) {
- this.convertLastElementAnnotationToStandAloneAnnotation(declaration);
- }
- } else {
- if ((oldIndex == 0) && (newIndex == 1)) {
- // this is one of two situations where we transition from stand-alone to container
- this.moveStandAloneAnnotationToContainerAnnotation(standAloneAnnotation, declaration);
- this.moveNestedAnnotation(newIndex, declaration);
- } else if (newIndex == 0) {
- // we are moving a 'null' entry on top of the stand-alone, so remove it
- this.removeStandAloneAnnotation(declaration);
- } else {
- throw new IllegalStateException("old index = " + oldIndex + "; new index = " + newIndex); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
-
- // ********** internal methods **********
-
- /**
- * build the appropriate new annotation,
- * which may require moving the 0th annotation from "stand-alone" to "nested"
- */
- private Annotation newAnnotation(AnnotationFactory annotationFactory, ModifiedDeclaration declaration) {
- if (this.getIndex() == 0) {
- return this.newZeroAnnotation(annotationFactory, declaration);
- }
- if (this.zeroNestedAnnotationIsPresent(declaration)) {
- // manipulate the container annotation - ignore the stand-alone annotation(?)
- // @Outer(foo=@Inner("zero")) => @Outer(foo={@Inner("zero"), @Inner})
- // or
- // @Outer(foo={@Inner("zero"), @Inner("one")}) => @Outer(foo={@Inner("zero"), @Inner})
- return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration);
- }
-
- // this is one of two situations where we transition from stand-alone to container
- this.moveStandAloneAnnotationToContainerAnnotation(declaration);
- // once the stand-alone annotation is moved to index=0, build the new annotation at index=1
- return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration);
- }
-
- /**
- * the index is 0 - build the appropriate new annotation,
- * which may be either "stand-alone" or "nested"
- */
- private Annotation newZeroAnnotation(AnnotationFactory annotationFactory, ModifiedDeclaration declaration) {
- if (this.standAloneAnnotationIsPresent(declaration)) {
- // replace the stand-alone annotation - ignore the container annotation(?)
- // @Inner(text="lorem ipsum") => @Inner
- return annotationFactory.newAnnotation(this.standAloneAnnotationAdapter, declaration);
- }
- if (this.containerAnnotationIsPresent(declaration)) {
- // manipulate the container annotation
- // @Outer(foo=@Inner(text="lorem ipsum")) => @Outer(foo=@Inner)
- return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration);
- }
- // neither annotation is present - add a new stand-alone annotation
- return annotationFactory.newAnnotation(this.standAloneAnnotationAdapter, declaration);
- }
-
- /**
- * move the stand-alone annotation to the container annotation at index=0
- */
- private void moveStandAloneAnnotationToContainerAnnotation(ModifiedDeclaration declaration) {
- Annotation standAloneAnnotation = this.getStandAloneAnnotation(declaration);
- if (standAloneAnnotation == null) {
- throw new IllegalStateException("the stand-alone annotation is missing"); //$NON-NLS-1$
- }
- this.moveStandAloneAnnotationToContainerAnnotation(standAloneAnnotation, declaration);
- }
-
- /**
- * move the specified, non-null, stand-alone annotation to
- * the container annotation at index=0
- */
- private void moveStandAloneAnnotationToContainerAnnotation(Annotation standAloneAnnotation, ModifiedDeclaration declaration) {
- if (standAloneAnnotation.isMarkerAnnotation()) {
- this.zeroNestedAnnotationAdapter.newMarkerAnnotation(declaration);
- } else if (standAloneAnnotation.isSingleMemberAnnotation()) {
- Expression vv = ((SingleMemberAnnotation) standAloneAnnotation).getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.zeroNestedAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv);
- } else if (standAloneAnnotation.isNormalAnnotation()) {
- NormalAnnotation newNA = this.zeroNestedAnnotationAdapter.newNormalAnnotation(declaration);
- List<MemberValuePair> values = this.values(newNA);
- for (MemberValuePair pair : this.values((NormalAnnotation) standAloneAnnotation)) {
- values.add((MemberValuePair) ASTNode.copySubtree(pair.getAST(), pair));
- }
- } else {
- throw new IllegalStateException("unknown annotation type: " + standAloneAnnotation); //$NON-NLS-1$
- }
- this.removeStandAloneAnnotation(declaration);
- }
-
- /**
- * return whether the "nested" annotation container has been reduced to
- * a single element (and the array initializer is converted to just
- * the single remaining element) and can be further converted to the
- * "stand-alone" annotation:
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one")}) =>
- * &#64;Outer(foo=&#64;Inner("zero")) =>
- * &#64;Inner("zero")
- * </pre>
- */
- private boolean nestedElementCanBeConvertedToStandAlone(ModifiedDeclaration declaration) {
- Annotation containerAnnotation = this.getContainerAnnotation(declaration);
- if (containerAnnotation == null) {
- return false;
- }
- if (containerAnnotation.isMarkerAnnotation()) {
- return false;
- }
- if (containerAnnotation.isSingleMemberAnnotation()) {
- if (this.getElementName().equals(VALUE)) {
- return (((SingleMemberAnnotation) containerAnnotation).getValue().getNodeType() != ASTNode.ARRAY_INITIALIZER)
- && (this.zeroNestedAnnotationAdapter.getAnnotation(declaration) != null);
- }
- return false;
- }
- if (containerAnnotation.isNormalAnnotation()) {
- NormalAnnotation na = (NormalAnnotation) containerAnnotation;
- if (na.values().size() == 0) {
- return false; // there are no elements present
- }
- if (na.values().size() != 1) {
- return false; // there are other elements present - leave them all alone
- }
- MemberValuePair pair = (MemberValuePair) na.values().get(0);
- if (this.getElementName().equals(pair.getName().getFullyQualifiedName())) {
- return (pair.getValue().getNodeType() != ASTNode.ARRAY_INITIALIZER)
- && (this.zeroNestedAnnotationAdapter.getAnnotation(declaration) != null);
- }
- return false;
- }
- throw new IllegalStateException("unknown annotation type: " + containerAnnotation); //$NON-NLS-1$
- }
-
- /**
- * move the annotation in the container annotation at index=0
- * to the stand-alone annotation
- */
- private void convertLastElementAnnotationToStandAloneAnnotation(ModifiedDeclaration declaration) {
- Annotation last = this.zeroNestedAnnotationAdapter.getAnnotation(declaration);
- if (last == null) {
- throw new IllegalStateException("the last nested annotation is missing"); //$NON-NLS-1$
- } else if (last.isMarkerAnnotation()) {
- this.newStandAloneMarkerAnnotation(declaration);
- } else if (last.isSingleMemberAnnotation()) {
- Expression vv = ((SingleMemberAnnotation) last).getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.newStandAloneSingleMemberAnnotation(declaration).setValue(vv);
- } else if (last.isNormalAnnotation()) {
- NormalAnnotation newNA = this.newStandAloneNormalAnnotation(declaration);
- List<MemberValuePair> values = this.values(newNA);
- for (MemberValuePair pair : this.values((NormalAnnotation) last)) {
- values.add((MemberValuePair) ASTNode.copySubtree(pair.getAST(), pair));
- }
- } else {
- throw new IllegalStateException("unknown annotation type: " + last); //$NON-NLS-1$
- }
- this.removeContainerAnnotation(declaration);
- }
-
- private boolean standAloneAnnotationIsPresent(ModifiedDeclaration declaration) {
- return this.getStandAloneAnnotation(declaration) != null;
- }
-
- private Annotation getStandAloneAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.getAnnotation(declaration);
- }
-
- private MarkerAnnotation newStandAloneMarkerAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.newMarkerAnnotation(declaration);
- }
-
- private SingleMemberAnnotation newStandAloneSingleMemberAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.newSingleMemberAnnotation(declaration);
- }
-
- private NormalAnnotation newStandAloneNormalAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.newNormalAnnotation(declaration);
- }
-
- private void removeStandAloneAnnotation(ModifiedDeclaration declaration) {
- this.standAloneAnnotationAdapter.removeAnnotation(declaration);
- }
-
- private Annotation getNestedAnnotation(ModifiedDeclaration declaration) {
- return this.nestedAnnotationAdapter.getAnnotation(declaration);
- }
-
- private void moveNestedAnnotation(int newIndex, ModifiedDeclaration declaration) {
- this.nestedAnnotationAdapter.moveAnnotation(newIndex, declaration);
- }
-
- private void removeNestedAnnotation(ModifiedDeclaration declaration) {
- this.nestedAnnotationAdapter.removeAnnotation(declaration);
- }
-
- private boolean containerAnnotationIsPresent(ModifiedDeclaration declaration) {
- return this.getContainerAnnotation(declaration) != null;
- }
-
- private Annotation getContainerAnnotation(ModifiedDeclaration declaration) {
- return this.nestedAnnotationAdapter.getOuterAnnotationAdapter().getAnnotation(declaration);
- }
-
- private void removeContainerAnnotation(ModifiedDeclaration declaration) {
- this.nestedAnnotationAdapter.getOuterAnnotationAdapter().removeAnnotation(declaration);
- }
-
- private boolean zeroNestedAnnotationIsPresent(ModifiedDeclaration declaration) {
- return this.getZeroNestedAnnotation(declaration) != null;
- }
-
- private Annotation getZeroNestedAnnotation(ModifiedDeclaration declaration) {
- return this.zeroNestedAnnotationAdapter.getAnnotation(declaration);
- }
-
- private String getAnnotationName() {
- return this.nestedAnnotationAdapter.getAnnotationName();
- }
-
- private String getElementName() {
- return this.nestedAnnotationAdapter.getElementName();
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
-
- // ********** annotation factories **********
-
- /**
- * define interface that allows us to "re-use" the nasty code in
- * #newAnnotation(AnnotationFactory, ModifiedDeclaration)
- */
- private interface AnnotationFactory {
- Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration);
- }
-
- private static final AnnotationFactory MARKER_ANNOTATION_FACTORY = new AnnotationFactory() {
- public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) {
- return adapter.newMarkerAnnotation(declaration);
- }
- @Override
- public String toString() {
- return "MarkerAnnotationFactory"; //$NON-NLS-1$
- }
- };
-
- private static final AnnotationFactory SINGLE_MEMBER_ANNOTATION_FACTORY = new AnnotationFactory() {
- public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) {
- return adapter.newSingleMemberAnnotation(declaration);
- }
- @Override
- public String toString() {
- return "SingleMemberAnnotationFactory"; //$NON-NLS-1$
- }
- };
-
- private static final AnnotationFactory NORMAL_ANNOTATION_FACTORY = new AnnotationFactory() {
- public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) {
- return adapter.newNormalAnnotation(declaration);
- }
- @Override
- public String toString() {
- return "NormalAnnotationFactory"; //$NON-NLS-1$
- }
- };
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 1185f5233b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Wrap a declaration annotation element adapter that deals with AST
- * expressions, converting them to/from various other objects.
- *
- * @param <T> the type of the object be passed to and returned by the adapter
- */
-public class ConversionDeclarationAnnotationElementAdapter<T>
- implements DeclarationAnnotationElementAdapter<T>
-{
- /**
- * The wrapped adapter that returns and takes AST expressions.
- */
- private final DeclarationAnnotationElementAdapter<Expression> adapter;
-
- /**
- * The converter that converts AST expressions to other objects
- * (e.g. Strings).
- */
- private final ExpressionConverter<T> converter;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is <code>value</code>.
- */
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter), converter);
- }
-
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter, elementName), converter);
- }
-
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Expression> adapter, ExpressionConverter<T> converter) {
- super();
- this.adapter = adapter;
- this.converter = converter;
- }
-
-
- protected ExpressionConverter<T> getConverter() {
- return this.converter;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public T getValue(ModifiedDeclaration declaration) {
- Expression expression = this.adapter.getValue(declaration);
- return this.converter.convert(expression);
- }
-
- public void setValue(T value, ModifiedDeclaration declaration) {
- Expression expression;
- try {
- expression = this.converter.convert(value, declaration.getAst());
- } catch (IllegalArgumentException ex) {
- // if there is a problem converting the 'value' to an Expression we get this exception
- return; // don't set the value if it is "illegal"
- }
- this.adapter.setValue(expression, declaration);
- }
-
- public Expression getExpression(ModifiedDeclaration declaration) {
- return this.adapter.getExpression(declaration);
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- return this.adapter.getAstNode(declaration);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.adapter);
- }
-
-
- // ********** factory static methods **********
-
- /**
- * The default element name is <code>value</code>;
- * the default expression converter expects string constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forStrings(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, StringExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects string constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forStrings(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, StringExpressionConverter.instance());
- }
-
- /**
- * The default element name is <code>value</code>;
- * the default expression converter expects number constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Integer> forNumbers(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, NumberIntegerExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects number constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Integer> forNumbers(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, elementName, NumberIntegerExpressionConverter.instance());
- }
-
- /**
- * The default element name is <code>value</code>;
- * the default expression converter expects boolean constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Boolean> forBooleans(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, BooleanExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects boolean constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Boolean> forBooleans(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, BooleanExpressionConverter.instance());
- }
-
- /**
- * The default element name is <code>value</code>;
- * the default expression converter expects character constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forCharacters(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, CharacterStringExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects character constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forCharacters(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, CharacterStringExpressionConverter.instance());
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/DefaultAnnotationEditFormatter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/DefaultAnnotationEditFormatter.java
deleted file mode 100644
index 97264a9d93..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/DefaultAnnotationEditFormatter.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * This implementation will clean up some of the nasty Eclipse annotation
- * formatting (or lack thereof); e.g. arrays of annotations.
- */
-public final class DefaultAnnotationEditFormatter
- implements AnnotationEditFormatter
-{
- private static final DefaultAnnotationEditFormatter INSTANCE = new DefaultAnnotationEditFormatter();
-
- /**
- * Return the singleton.
- */
- public static DefaultAnnotationEditFormatter instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DefaultAnnotationEditFormatter() {
- super();
- }
-
- /**
- * TODO
- */
- public void format(IDocument doc, TextEdit editTree) throws MalformedTreeException, BadLocationException {
- TextEdit[] edits = editTree.getChildren();
- int len = edits.length;
- if (len == 0) {
- return;
- }
-
- MultiTextEdit extraEdits = new MultiTextEdit();
- for (int i = 0; i < len; i++) {
- TextEdit edit1 = edits[i];
- if ( ! (edit1 instanceof InsertEdit)) {
- continue; // if the edit is not an insert, skip to the next edit
- }
- InsertEdit insert1 = (InsertEdit) edit1;
- int j = i + 1;
- if (j < len) {
- TextEdit edit2 = edits[j];
- if (edit2 instanceof InsertEdit) {
- InsertEdit insert2 = (InsertEdit) edit2;
- String text1 = insert1.getText();
- String text2 = insert2.getText();
- int offset1 = insert1.getOffset();
- int offset2 = insert2.getOffset();
- if (this.stringIsAnnotation(text1) && text2.equals(" ")) { //$NON-NLS-1$
- // an annotation was inserted before something on the same line;
- // replace the trailing space with a newline and appropriate indent
- extraEdits.addChild(new ReplaceEdit(offset2, 1, this.buildCR(doc, offset2)));
- i++; // jump the index past 'edit2'
- continue; // go to the next edit
- }
- int comma1Length = this.commaLength(text1);
- if ((comma1Length != 0) && this.stringIsAnnotation(text2)) {
- // an annotation was inserted in an array initializer on the
- // same line as the previous array element;
- // replace the preceding space with a newline and appropriate indent
- extraEdits.addChild(new ReplaceEdit(offset1 + comma1Length, text1.length() - comma1Length, this.buildCR(doc, offset1)));
- i++; // jump the index past 'edit2'
- continue; // go to the next edit
- }
- }
- }
- this.formatArrayInitializer(doc, insert1, extraEdits);
- }
- extraEdits.apply(doc, TextEdit.NONE);
- }
-
- /**
- * If the insert edit is inserting an annotation containing an array of annotations as
- * its value then format them nicely.
- */
- private void formatArrayInitializer(IDocument doc, InsertEdit insertEdit, MultiTextEdit extraEdits) throws BadLocationException {
- String s = insertEdit.getText();
- if ( ! this.stringIsAnnotation(s)) {
- return;
- }
- int len = s.length();
- int pos = 1; // skip '@'
- while (pos < len) {
- char c = s.charAt(pos);
- pos++; // bump to just past first '('
- if (c == '(') {
- break;
- }
- }
- if (pos == len) {
- return; // reached end of string
- }
- while (pos < len) {
- char c = s.charAt(pos);
- pos++; // bump to just past first '{'
- if (c == '{') {
- break;
- }
- if (c != ' ') {
- return;
- }
- }
- if (pos == len) {
- return; // reached end of string
- }
- // now look for '@' not inside parentheses and put in
- // line delimeter and indent string before each
- int offset = insertEdit.getOffset();
- String indent = null;
- int parenDepth = 0;
- while (pos < len) {
- switch (s.charAt(pos)) {
- case '(' :
- parenDepth++;
- break;
- case ')' :
- parenDepth--;
- break;
- case '@' :
- if (parenDepth == 0) {
- if (indent == null) {
- indent = this.buildCR(doc, offset, "\t"); // TODO use tab preference? //$NON-NLS-1$
- }
- extraEdits.addChild(new InsertEdit(offset + pos, indent));
- }
- break;
- case '}' :
- if (parenDepth == 0) {
- extraEdits.addChild(new InsertEdit(offset + pos, this.buildCR(doc, offset)));
- }
- break;
- }
- pos++;
- }
- }
-
- /**
- * Build a string containing a line delimeter and indenting characters
- * matching the indent level of the line containing the character offset
- * (i.e. the new line's indent matches the current line).
- */
- private String buildCR(IDocument doc, int offset) throws BadLocationException {
- return this.buildCR(doc, offset, ""); //$NON-NLS-1$
- }
-
- private String buildCR(IDocument doc, int offset, String suffix) throws BadLocationException {
- int line = doc.getLineOfOffset(offset);
- StringBuilder sb = new StringBuilder();
- sb.append(doc.getLineDelimiter(line)); // use same CR as current line
-
- int o = doc.getLineOffset(line); // match the whitespace of the current line
- char c = doc.getChar(o++);
- while ((c == ' ') || (c == '\t')) {
- sb.append(c);
- c = doc.getChar(o++);
- }
- sb.append(suffix);
- return sb.toString();
- }
-
- /**
- * Return whether the specified string is an annotation.
- */
- private boolean stringIsAnnotation(String string) {
- return (string.length() > 1) && string.charAt(0) == '@';
- }
-
- /**
- * If the specified string is a single comma, possibly surrounded by
- * spaces, return the length of the substring containing the
- * initial spaces and the comma.
- */
- private int commaLength(String string) {
- boolean comma = false;
- int len = string.length();
- int result = 0;
- for (int i = 0; i < len; i++) {
- switch (string.charAt(i)) {
- case ' ' :
- if ( ! comma) {
- result++; // space preceding comma
- }
- break;
- case ',' :
- if (comma) {
- return 0; // second comma!
- }
- comma = true;
- result++;
- break;
- default:
- return 0; // non-comma, non-space char
- }
- }
- return result;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementAnnotationAdapter.java
deleted file mode 100644
index 17f14a4b22..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementAnnotationAdapter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * Adapt an annotated element and a declaration annotation adapter.
- */
-public class ElementAnnotationAdapter extends AbstractAnnotationAdapter {
-
-
- // ********** constructor **********
-
- public ElementAnnotationAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(annotatedElement, daa);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementIndexedAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementIndexedAnnotationAdapter.java
deleted file mode 100644
index f3e3467b8b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ElementIndexedAnnotationAdapter.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Adapt an annotated element and an indexed declaration annotation adapter.
- */
-public class ElementIndexedAnnotationAdapter
- extends AbstractAnnotationAdapter
- implements IndexedAnnotationAdapter
-{
- private final IndexedDeclarationAnnotationAdapter idaa;
-
-
- // ********** constructor **********
-
- public ElementIndexedAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- super(annotatedElement, idaa);
- this.idaa = idaa;
- }
-
-
- // ********** IndexedAnnotationAdapter implementation **********
-
- public int getIndex() {
- return this.idaa.getIndex();
- }
-
- public void moveAnnotation(int newIndex) {
- this.edit(this.buildMoveAnnotationEditor(newIndex));
- }
-
-
- // ********** factory methods **********
-
- protected AnnotatedElement.Editor buildMoveAnnotationEditor(int newIndex) {
- return new MoveAnnotationEditor(this.idaa, newIndex);
- }
-
-
- // ********** member classes **********
-
- protected static class MoveAnnotationEditor implements AnnotatedElement.Editor {
- private final IndexedDeclarationAnnotationAdapter idaa;
- private int index;
-
- MoveAnnotationEditor(IndexedDeclarationAnnotationAdapter idaa, int index) {
- super();
- this.idaa = idaa;
- this.index = index;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.idaa.moveAnnotation(this.index, declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 3b3a74be0d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Wrap a declaration annotation element adapter and simply
- * add an import for the enums when necessary.
- */
-public class EnumArrayDeclarationAnnotationElementAdapter
- implements DeclarationAnnotationElementAdapter<String[]>
-{
- /**
- * The wrapped adapter that returns and takes name strings (enums).
- */
- private final ConversionDeclarationAnnotationElementAdapter<String[]> adapter;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is <code>value</code>.
- * The default behavior is to remove the array initializer if it is empty.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, VALUE);
- }
-
- /**
- * The default behavior is to remove the array initializer if it is empty.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(annotationAdapter, elementName, true);
- }
-
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeArrayInitializerWhenEmpty) {
- this(new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, buildExpressionConverter(removeArrayInitializerWhenEmpty)));
- }
-
- private static ExpressionConverter<String[]> buildExpressionConverter(boolean removeArrayInitializerWhenEmpty) {
- return new AnnotationStringArrayExpressionConverter(NameStringExpressionConverter.instance(), removeArrayInitializerWhenEmpty);
- }
-
- protected EnumArrayDeclarationAnnotationElementAdapter(ConversionDeclarationAnnotationElementAdapter<String[]> adapter) {
- super();
- this.adapter = adapter;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public String[] getValue(ModifiedDeclaration declaration) {
- // ignore the adapter's getValue() - we want the expression
- return this.resolve(this.adapter.getExpression(declaration), declaration);
- }
-
- public void setValue(String[] value, ModifiedDeclaration declaration) {
- this.adapter.setValue(this.convertToSourceCodeNames(value, declaration), declaration);
- }
-
- public Expression getExpression(ModifiedDeclaration declaration) {
- return this.adapter.getExpression(declaration);
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- return this.adapter.getAstNode(declaration);
- }
-
-
- // ********** internal methods **********
-
- /**
- * resolve the enums, which can be
- * null
- * or
- * {FOO, BAR, BAZ}
- * or
- * FOO
- */
- protected String[] resolve(Expression expression, ModifiedDeclaration declaration) {
- if (expression == null) {
- return StringTools.EMPTY_STRING_ARRAY;
- } else if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- return this.resolveArray((ArrayInitializer) expression, declaration);
- } else {
- return this.resolveSingleElement(expression, declaration);
- }
- }
-
- protected String[] resolveArray(ArrayInitializer ai, @SuppressWarnings("unused") ModifiedDeclaration declaration) {
- List<Expression> expressions = this.expressions(ai);
- int len = expressions.size();
- String[] enums = new String[len];
- for (int i = len; i-- > 0; ) {
- enums[i] = this.resolveEnum(expressions.get(i));
- }
- return enums;
- }
-
- protected String[] resolveSingleElement(Expression enumExpression, @SuppressWarnings("unused") ModifiedDeclaration declaration) {
- return new String[] {this.resolveEnum(enumExpression)};
- }
-
- protected String resolveEnum(Expression expression) {
- return ASTTools.resolveEnum(expression);
- }
-
- // minimize scope of suppressd warnings
- @SuppressWarnings("unchecked")
- private List<Expression> expressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
- /**
- * convert the fully-qualified enums to names that can be inserted in source code
- * NB: imports may be added as a side-effect :-(
- */
- protected String[] convertToSourceCodeNames(String[] enums, ModifiedDeclaration declaration) {
- if (enums == null) {
- return null;
- }
- int len = enums.length;
- String[] sourceCodeNames = new String[len];
- for (int i = 0; i < len; i++) {
- sourceCodeNames[i] = this.convertToSourceCodeName(enums[i], declaration);
- }
- return sourceCodeNames;
- }
-
- protected String convertToSourceCodeName(String enum_, ModifiedDeclaration declaration) {
- return EnumDeclarationAnnotationElementAdapter.convertToSourceCodeName(enum_, declaration);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 21cbe29aaa..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Wrap a declaration annotation element adapter and simply
- * add an import for the enum when necessary.
- */
-public class EnumDeclarationAnnotationElementAdapter
- implements DeclarationAnnotationElementAdapter<String>
-{
- /**
- * The wrapped adapter that returns and takes name strings (enums).
- */
- private final ConversionDeclarationAnnotationElementAdapter<String> adapter;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is <code>value</code>.
- */
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, VALUE);
- }
-
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, NameStringExpressionConverter.instance()));
- }
-
- protected EnumDeclarationAnnotationElementAdapter(ConversionDeclarationAnnotationElementAdapter<String> adapter) {
- super();
- this.adapter = adapter;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public String getValue(ModifiedDeclaration declaration) {
- return this.resolve(this.adapter.getExpression(declaration));
- }
-
- public void setValue(String value, ModifiedDeclaration declaration) {
- this.adapter.setValue(convertToSourceCodeName(value, declaration), declaration);
- }
-
- public Expression getExpression(ModifiedDeclaration declaration) {
- return this.adapter.getExpression(declaration);
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- return this.adapter.getAstNode(declaration);
- }
-
-
- // ********** internal methods **********
-
- /**
- * resolve the enum
- */
- protected String resolve(Expression expression) {
- return ASTTools.resolveEnum(expression);
- }
-
- /**
- * convert the fully-qualified enum constant to a static import and the constant's short name, e.g.
- * static import javax.persistence.FetchType.EAGER;
- * return "EAGER"
- * if that doesn't work, convert to a normal import and the constant's partially-qualified name, e.g.
- * import javax.persistence.FetchType;
- * return "FetchType.EAGER"
- * if that doesn't work, simply return the constant's fully-qualified name, e.g.
- * return "javax.persistence.FetchType.EAGER"
- * NB: an import may be added as a side-effect :-(
- */
- protected static String convertToSourceCodeName(String enumConstantName, ModifiedDeclaration declaration) {
- return (enumConstantName == null) ? null : convertToSourceCodeName_(enumConstantName, declaration);
- }
-
- /**
- * pre-condition: enum constant name is non-null;
- * convert it to its short version if we can add a static import etc.
- */
- protected static String convertToSourceCodeName_(String enumConstantName, ModifiedDeclaration declaration) {
- if (declaration.addStaticImport(enumConstantName)) {
- return convertToShortName(enumConstantName);
- }
- if (declaration.addImport(convertToTypeName(enumConstantName))) {
- return convertToPartiallyQualifiedName(enumConstantName);
- }
- return enumConstantName;
- }
-
- protected static String convertToShortName(String name) {
- return name.substring(name.lastIndexOf('.') + 1);
- }
-
- protected static String convertToTypeName(String name) {
- return name.substring(0, name.lastIndexOf('.'));
- }
-
- protected static String convertToPartiallyQualifiedName(String name) {
- return name.substring(name.lastIndexOf('.', name.lastIndexOf('.') - 1) + 1);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index d3b0370942..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Most obvious implementation of the interface.
- * Assume the element's value is an Expression.
- */
-public class ExpressionDeclarationAnnotationElementAdapter<E extends Expression>
- implements DeclarationAnnotationElementAdapter<E>
-{
- /**
- * Adapter used to manipulate the element's annotation.
- */
- private final DeclarationAnnotationAdapter annotationAdapter;
-
- /**
- * The name of the relevant annotation element.
- */
- private final String elementName;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is <code>value</code>.
- */
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, VALUE);
- }
-
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this.annotationAdapter = annotationAdapter;
- this.elementName = elementName;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public E getValue(ModifiedDeclaration declaration) {
- // return the expression unmodified
- return this.getExpression(declaration);
- }
-
- public void setValue(E value, ModifiedDeclaration declaration) {
- this.setValue(value, this.annotationAdapter.getAnnotation(declaration), declaration);
- }
-
- public E getExpression(ModifiedDeclaration declaration) {
- return this.expression(this.annotationAdapter.getAnnotation(declaration));
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- Expression exp = this.getExpression(declaration);
- return (exp != null) ? exp : this.annotationAdapter.getAstNode(declaration);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.elementName);
- }
-
-
- // ********** expression **********
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- * (An element name of "value" will return the value of a single
- * member annotation.)
- */
- protected E expression(Annotation annotation) {
- if (annotation == null) {
- return this.expressionNoAnnotation();
- }
- if (annotation.isMarkerAnnotation()) {
- return this.expressionMarkerAnnotation((MarkerAnnotation) annotation);
- }
- if (annotation.isSingleMemberAnnotation()) {
- return this.expressionSingleMemberAnnotation((SingleMemberAnnotation) annotation);
- }
- if (annotation.isNormalAnnotation()) {
- return this.expressionNormalAnnotation((NormalAnnotation) annotation);
- }
- throw new IllegalArgumentException("unknown annotation type: " + annotation); //$NON-NLS-1$
- }
-
- protected E expressionNoAnnotation() {
- return null;
- }
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected E expressionMarkerAnnotation(@SuppressWarnings("unused") MarkerAnnotation annotation) {
- return null;
- }
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected E expressionSingleMemberAnnotation(SingleMemberAnnotation annotation) {
- return this.downcast(this.elementName.equals(VALUE) ? annotation.getValue() : null);
- }
-
- @SuppressWarnings("unchecked")
- private E downcast(Expression e) {
- return (E) e;
- }
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected E expressionNormalAnnotation(NormalAnnotation annotation) {
- MemberValuePair pair = this.memberValuePair(annotation);
- return this.downcast((pair == null) ? null : pair.getValue());
- }
-
-
- // ********** set value **********
-
- /**
- * set non-null, non-empty value
- */
- protected void setValue(Expression value, Annotation annotation, ModifiedDeclaration declaration) {
- if (value == null) {
- this.removeElement(annotation, declaration);
- }
- else if (annotation == null) {
- this.setValueNoAnnotation(value, declaration);
- }
- else if (annotation.isMarkerAnnotation()) {
- this.setValueMarkerAnnotation(value, (MarkerAnnotation) annotation, declaration);
- }
- else if (annotation.isSingleMemberAnnotation()) {
- this.setValueSingleMemberAnnotation(value, (SingleMemberAnnotation) annotation, declaration);
- }
- else if (annotation.isNormalAnnotation()) {
- this.setValueNormalAnnotation(value, (NormalAnnotation) annotation, declaration);
- }
- else {
- throw new IllegalArgumentException("unknown annotation type: " + annotation); //$NON-NLS-1$
- }
- }
-
- /**
- * add non-null, non-empty value
- */
- protected void setValueNoAnnotation(Expression value, ModifiedDeclaration declaration) {
- if (this.elementName.equals(VALUE)) {
- // @Foo("xxx")
- this.annotationAdapter.newSingleMemberAnnotation(declaration).setValue(value);
- } else {
- // @Foo(bar="xxx")
- this.addValue(value, this.annotationAdapter.newNormalAnnotation(declaration));
- }
- }
-
- protected void addValue(Expression value, NormalAnnotation annotation) {
- this.addValue(value, annotation, this.elementName);
- }
-
- protected void addValue(Expression value, NormalAnnotation annotation, String annotationElementName) {
- AST ast = annotation.getAST();
- MemberValuePair pair = ast.newMemberValuePair();
- pair.setName(ast.newSimpleName(annotationElementName));
- pair.setValue(value);
- List<MemberValuePair> values = this.values(annotation);
- values.add(pair);
- }
-
- protected void setValueMarkerAnnotation(Expression value, @SuppressWarnings("unused") MarkerAnnotation annotation, ModifiedDeclaration declaration) {
- // @Foo => @Foo("xxx")
- // or
- // @Foo => @Foo(bar="xxx")
- this.setValueNoAnnotation(value, declaration);
- }
-
- protected void setValueSingleMemberAnnotation(Expression value, SingleMemberAnnotation annotation, ModifiedDeclaration declaration) {
- if (this.elementName.equals(VALUE)) {
- // @Foo("yyy") => @Foo("xxx")
- annotation.setValue(value);
- } else {
- // @Foo("yyy") => @Foo(value="yyy", bar="xxx")
- Expression vv = annotation.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- NormalAnnotation normalAnnotation = this.annotationAdapter.newNormalAnnotation(declaration);
- this.addValue(vv, normalAnnotation, VALUE);
- this.addValue(value, normalAnnotation);
- }
- }
-
- protected void setValueNormalAnnotation(Expression value, NormalAnnotation annotation, @SuppressWarnings("unused") ModifiedDeclaration declaration) {
- MemberValuePair pair = this.memberValuePair(annotation);
- if (pair == null) {
- this.addValue(value, annotation);
- } else {
- pair.setValue(value);
- }
- }
-
-
- // ********** remove element **********
-
- protected void removeElement(Annotation annotation, ModifiedDeclaration declaration) {
- if (annotation == null) {
- this.removeElementNoAnnotation(declaration);
- }
- else if (annotation.isMarkerAnnotation()) {
- this.removeElementMarkerAnnotation((MarkerAnnotation) annotation, declaration);
- }
- else if (annotation.isSingleMemberAnnotation()) {
- this.removeElementSingleMemberAnnotation((SingleMemberAnnotation) annotation, declaration);
- }
- else if (annotation.isNormalAnnotation()) {
- this.removeElementNormalAnnotation((NormalAnnotation) annotation, declaration);
- }
- else {
- throw new IllegalArgumentException("unknown annotation type: " + annotation); //$NON-NLS-1$
- }
- }
-
- protected void removeElementNoAnnotation(@SuppressWarnings("unused") ModifiedDeclaration declaration) {
- // the element is already gone (?)
- }
-
- protected void removeElementMarkerAnnotation(@SuppressWarnings("unused") MarkerAnnotation annotation, @SuppressWarnings("unused") ModifiedDeclaration declaration) {
- // the element is already gone (?)
- }
-
- protected void removeElementSingleMemberAnnotation(@SuppressWarnings("unused") SingleMemberAnnotation annotation, ModifiedDeclaration declaration) {
- if (this.elementName.equals(VALUE)) {
- // @Foo("xxx") => @Foo
- this.annotationAdapter.newMarkerAnnotation(declaration);
- } else {
- // the [non-'value'] element is already gone (?)
- }
- }
-
- protected void removeElementNormalAnnotation(NormalAnnotation annotation, ModifiedDeclaration declaration) {
- List<MemberValuePair> values = this.values(annotation);
- if ((values.size() == 1) && values.get(0).getName().getFullyQualifiedName().equals(this.elementName)) {
- // @Foo(bar="xxx") => @Foo
- this.annotationAdapter.newMarkerAnnotation(declaration);
- } else {
- this.removeElement(annotation);
- if (values.size() == 1) {
- MemberValuePair pair = values.get(0);
- if (pair.getName().getFullyQualifiedName().equals(VALUE)) {
- // @Foo(bar="xxx", value="yyy") => @Foo("yyy")
- Expression vv = pair.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.annotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv);
- } else {
- // @Foo(bar="xxx", baz="yyy") => @Foo(baz="yyy")
- }
- } else {
- // @Foo(bar="xxx", baz="yyy", joo="xxx") => @Foo(baz="yyy", joo="xxx")
- }
- }
- }
-
- /**
- * Remove the *first* member value pair from the specified annotation element
- * with the adapter's element name.
- */
- protected void removeElement(NormalAnnotation annotation) {
- for (Iterator<MemberValuePair> stream = this.values(annotation).iterator(); stream.hasNext(); ) {
- MemberValuePair pair = stream.next();
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- stream.remove();
- }
- }
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return the *first* member value pair for the specified annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected MemberValuePair memberValuePair(NormalAnnotation annotation) {
- for (MemberValuePair pair : this.values(annotation)) {
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/GenericVisitor.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/GenericVisitor.java
deleted file mode 100644
index 92160afdf5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/GenericVisitor.java
+++ /dev/null
@@ -1,791 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.jdt.core.dom.ArrayAccess;
-import org.eclipse.jdt.core.dom.ArrayCreation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.ArrayType;
-import org.eclipse.jdt.core.dom.AssertStatement;
-import org.eclipse.jdt.core.dom.Assignment;
-import org.eclipse.jdt.core.dom.Block;
-import org.eclipse.jdt.core.dom.BlockComment;
-import org.eclipse.jdt.core.dom.BooleanLiteral;
-import org.eclipse.jdt.core.dom.BreakStatement;
-import org.eclipse.jdt.core.dom.CastExpression;
-import org.eclipse.jdt.core.dom.CatchClause;
-import org.eclipse.jdt.core.dom.CharacterLiteral;
-import org.eclipse.jdt.core.dom.ClassInstanceCreation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ConditionalExpression;
-import org.eclipse.jdt.core.dom.ConstructorInvocation;
-import org.eclipse.jdt.core.dom.ContinueStatement;
-import org.eclipse.jdt.core.dom.DoStatement;
-import org.eclipse.jdt.core.dom.EmptyStatement;
-import org.eclipse.jdt.core.dom.EnhancedForStatement;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.ExpressionStatement;
-import org.eclipse.jdt.core.dom.FieldAccess;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.ForStatement;
-import org.eclipse.jdt.core.dom.IfStatement;
-import org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.eclipse.jdt.core.dom.InfixExpression;
-import org.eclipse.jdt.core.dom.Initializer;
-import org.eclipse.jdt.core.dom.InstanceofExpression;
-import org.eclipse.jdt.core.dom.Javadoc;
-import org.eclipse.jdt.core.dom.LabeledStatement;
-import org.eclipse.jdt.core.dom.LineComment;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberRef;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.MethodInvocation;
-import org.eclipse.jdt.core.dom.MethodRef;
-import org.eclipse.jdt.core.dom.MethodRefParameter;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NullLiteral;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jdt.core.dom.ParameterizedType;
-import org.eclipse.jdt.core.dom.ParenthesizedExpression;
-import org.eclipse.jdt.core.dom.PostfixExpression;
-import org.eclipse.jdt.core.dom.PrefixExpression;
-import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jdt.core.dom.QualifiedType;
-import org.eclipse.jdt.core.dom.ReturnStatement;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SimpleType;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.jdt.core.dom.SuperFieldAccess;
-import org.eclipse.jdt.core.dom.SuperMethodInvocation;
-import org.eclipse.jdt.core.dom.SwitchCase;
-import org.eclipse.jdt.core.dom.SwitchStatement;
-import org.eclipse.jdt.core.dom.SynchronizedStatement;
-import org.eclipse.jdt.core.dom.TagElement;
-import org.eclipse.jdt.core.dom.TextElement;
-import org.eclipse.jdt.core.dom.ThisExpression;
-import org.eclipse.jdt.core.dom.ThrowStatement;
-import org.eclipse.jdt.core.dom.TryStatement;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jdt.core.dom.TypeParameter;
-import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.jdt.core.dom.WhileStatement;
-import org.eclipse.jdt.core.dom.WildcardType;
-
-/**
- * copied from org.eclipse.jdt.internal.corext.dom.GenericVisitor
- */
-public class GenericVisitor extends ASTVisitor {
-
- public GenericVisitor() {
- super();
- }
-
- public GenericVisitor(boolean visitJavadocTags) {
- super(visitJavadocTags);
- }
-
- // ********** hooks for subclasses **********
-
- protected boolean visit_(@SuppressWarnings("unused") ASTNode node) {
- return true;
- }
-
- protected void endVisit_(@SuppressWarnings("unused") ASTNode node) {
- // do nothing
- }
-
- // ********** overrides **********
-
- @Override
- public boolean visit(AnonymousClassDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ArrayAccess node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ArrayCreation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ArrayInitializer node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ArrayType node) {
- return visit_(node);
- }
- @Override
- public boolean visit(AssertStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(Assignment node) {
- return visit_(node);
- }
- @Override
- public boolean visit(Block node) {
- return visit_(node);
- }
- @Override
- public boolean visit(BooleanLiteral node) {
- return visit_(node);
- }
- @Override
- public boolean visit(BreakStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(CastExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(CatchClause node) {
- return visit_(node);
- }
- @Override
- public boolean visit(CharacterLiteral node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ClassInstanceCreation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(CompilationUnit node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ConditionalExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ConstructorInvocation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ContinueStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(DoStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(EmptyStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ExpressionStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(FieldAccess node) {
- return visit_(node);
- }
- @Override
- public boolean visit(FieldDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ForStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(IfStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ImportDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(InfixExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(InstanceofExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(Initializer node) {
- return visit_(node);
- }
- @Override
- public boolean visit(Javadoc node) {
- return (super.visit(node)) ? visit_(node) : false;
- }
- @Override
- public boolean visit(LabeledStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(MethodDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(MethodInvocation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(NullLiteral node) {
- return visit_(node);
- }
- @Override
- public boolean visit(NumberLiteral node) {
- return visit_(node);
- }
- @Override
- public boolean visit(PackageDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ParenthesizedExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(PostfixExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(PrefixExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(PrimitiveType node) {
- return visit_(node);
- }
- @Override
- public boolean visit(QualifiedName node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ReturnStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SimpleName node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SimpleType node) {
- return visit_(node);
- }
- @Override
- public boolean visit(StringLiteral node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SuperConstructorInvocation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SuperFieldAccess node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SuperMethodInvocation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SwitchCase node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SwitchStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SynchronizedStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ThisExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ThrowStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(TryStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(TypeDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(TypeDeclarationStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(TypeLiteral node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SingleVariableDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(VariableDeclarationExpression node) {
- return visit_(node);
- }
- @Override
- public boolean visit(VariableDeclarationStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(VariableDeclarationFragment node) {
- return visit_(node);
- }
- @Override
- public boolean visit(WhileStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(AnnotationTypeDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(BlockComment node) {
- return visit_(node);
- }
- @Override
- public boolean visit(EnhancedForStatement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(EnumConstantDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(EnumDeclaration node) {
- return visit_(node);
- }
- @Override
- public boolean visit(LineComment node) {
- return visit_(node);
- }
- @Override
- public boolean visit(MarkerAnnotation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(MemberRef node) {
- return visit_(node);
- }
- @Override
- public boolean visit(MemberValuePair node) {
- return visit_(node);
- }
- @Override
- public boolean visit(MethodRef node) {
- return visit_(node);
- }
- @Override
- public boolean visit(MethodRefParameter node) {
- return visit_(node);
- }
- @Override
- public boolean visit(Modifier node) {
- return visit_(node);
- }
- @Override
- public boolean visit(NormalAnnotation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(ParameterizedType node) {
- return visit_(node);
- }
- @Override
- public boolean visit(QualifiedType node) {
- return visit_(node);
- }
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return visit_(node);
- }
- @Override
- public boolean visit(TagElement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(TextElement node) {
- return visit_(node);
- }
- @Override
- public boolean visit(TypeParameter node) {
- return visit_(node);
- }
- @Override
- public boolean visit(WildcardType node) {
- return visit_(node);
- }
-
- @Override
- public void endVisit(AnonymousClassDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ArrayAccess node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ArrayCreation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ArrayInitializer node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ArrayType node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(AssertStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(Assignment node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(Block node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(BooleanLiteral node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(BreakStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(CastExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(CatchClause node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(CharacterLiteral node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ClassInstanceCreation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(CompilationUnit node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ConditionalExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ConstructorInvocation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ContinueStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(DoStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(EmptyStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ExpressionStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(FieldAccess node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(FieldDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ForStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(IfStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ImportDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(InfixExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(InstanceofExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(Initializer node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(Javadoc node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(LabeledStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(MethodDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(MethodInvocation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(NullLiteral node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(NumberLiteral node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(PackageDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ParenthesizedExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(PostfixExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(PrefixExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(PrimitiveType node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(QualifiedName node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ReturnStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SimpleName node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SimpleType node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(StringLiteral node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SuperConstructorInvocation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SuperFieldAccess node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SuperMethodInvocation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SwitchCase node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SwitchStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SynchronizedStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ThisExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ThrowStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(TryStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(TypeDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(TypeDeclarationStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(TypeLiteral node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SingleVariableDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(VariableDeclarationExpression node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(VariableDeclarationStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(VariableDeclarationFragment node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(WhileStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(AnnotationTypeDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(BlockComment node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(EnhancedForStatement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(EnumConstantDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(EnumDeclaration node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(LineComment node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(MarkerAnnotation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(MemberRef node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(MemberValuePair node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(MethodRef node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(MethodRefParameter node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(Modifier node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(NormalAnnotation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(ParameterizedType node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(QualifiedType node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(SingleMemberAnnotation node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(TagElement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(TextElement node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(TypeParameter node) {
- endVisit_(node);
- }
- @Override
- public void endVisit(WildcardType node) {
- endVisit_(node);
- }
-
-}
-
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/IndexedConversionDeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/IndexedConversionDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 7045a05bf6..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/IndexedConversionDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-
-public class IndexedConversionDeclarationAnnotationElementAdapter<T>
- extends ConversionDeclarationAnnotationElementAdapter<T[]>
- implements IndexedDeclarationAnnotationElementAdapter<T> {
-
- public IndexedConversionDeclarationAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, IndexedExpressionConverter<T> converter) {
- super(annotationAdapter, converter);
- }
-
- public IndexedConversionDeclarationAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName, IndexedExpressionConverter<T> converter) {
- super(annotationAdapter, elementName, converter);
- }
-
-
- @Override
- protected IndexedExpressionConverter<T> getConverter() {
- return (IndexedExpressionConverter<T>) super.getConverter();
- }
-
-
- public Expression getSubvalueExpression(int index, ModifiedDeclaration declaration) {
- return getConverter().getSubexpression(index, super.getExpression(declaration));
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTAnnotatedElement.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTAnnotatedElement.java
deleted file mode 100644
index c771c77ce5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTAnnotatedElement.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * Adapt and extend a JDT member with simplified annotation handling.
- */
-public abstract class JDTAnnotatedElement
- implements AnnotatedElement
-{
-
- /** the annotated element's name (duh) */
- private final String name;
-
- /**
- * the compilation unit (file) containing the annotated element;
- * used for building an AST when we modify the annotated element
- */
- private final ICompilationUnit compilationUnit;
-
- /**
- * this allows clients to provide a way to modify the compilation unit
- * (file) when it is open in an editor and should be modified on the UI
- * thread
- */
- private final CommandExecutor modifySharedDocumentCommandExecutor;
-
- /** this will format the annotated element's annotations a bit */
- private final AnnotationEditFormatter annotationEditFormatter;
-
-
- // ********** constructors **********
-
- protected JDTAnnotatedElement(
- String name,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(name, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- protected JDTAnnotatedElement(
- String name,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super();
- this.name = name;
- this.compilationUnit = compilationUnit;
- this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor;
- this.annotationEditFormatter = annotationEditFormatter;
- }
-
-
- // ********** AnnotatedElement implementation **********
-
- public String getName() {
- return this.name;
- }
-
- public abstract ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot);
-
- public ModifiedDeclaration getModifiedDeclaration() {
- return this.getModifiedDeclaration(this.buildASTRoot());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.name);
- }
-
-
- // ********** editing **********
-
- /**
- * Edit the member with the specified editor.
- * The editor will be invoked once the member's compilation unit
- * is in an editable state.
- */
- public void edit(Editor editor) {
- try {
- this.edit_(editor);
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- } catch (BadLocationException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * NB: Be careful changing this method.
- * Things to look out for:
- * - when editing via the JavaEditor there is no need to create a working copy
- * - when editing without an editor or via a simple text editor, a "working copy" must be created.
- * (at least as far as I can tell ~kfm)
- * - sharedDocument is only ever false in tests (headless mode). In the UI, even if the file
- * is not open in an editor, sharedDocument is still true (buffer is not null)
- * - if a working copy is created, then we must discard it
- */
- protected void edit_(Editor editor) throws JavaModelException, BadLocationException {
- boolean createWorkingCopy = ! this.compilationUnit.isWorkingCopy();
- if (createWorkingCopy) {
- this.compilationUnit.becomeWorkingCopy(null);
- }
-
- ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(this.compilationUnit.getResource().getFullPath(), LocationKind.NORMALIZE);
- boolean sharedDocument = (buffer != null); // documents are typically shared when they are already open in an editor
- IDocument doc = sharedDocument ?
- buffer.getDocument() :
- new Document(this.compilationUnit.getBuffer().getContents());
-
- try {
- CompilationUnit astRoot = this.buildASTRoot();
- astRoot.recordModifications();
-
- editor.edit(this.getModifiedDeclaration(astRoot));
-
- TextEdit edits = astRoot.rewrite(doc, this.compilationUnit.getJavaProject().getOptions(true));
- if (sharedDocument) {
- this.modifySharedDocumentCommandExecutor.execute(new ModifySharedDocumentCommand(edits, doc));
- } else {
- this.applyEdits(edits, doc);
- }
- }
- finally {
- if (createWorkingCopy) {
- //discardWorkingCopy must be called every time becomeWorkingCopy is called.
- this.compilationUnit.getBuffer().setContents(doc.get());
- this.compilationUnit.commitWorkingCopy(true, null); // true="force"
- this.compilationUnit.discardWorkingCopy();
- }
- }
- }
-
- /**
- * apply the specified edits to the specified document,
- * reformatting the document if necessary
- */
- protected void applyEdits(TextEdit edits, IDocument doc) throws MalformedTreeException, BadLocationException {
- edits.apply(doc, TextEdit.UPDATE_REGIONS);
- this.annotationEditFormatter.format(doc, edits);
- }
-
- protected CompilationUnit buildASTRoot() {
- return ASTTools.buildASTRoot(this.compilationUnit);
- }
-
-
- // ********** modify shared document command class **********
-
- /**
- * simple command that calls back to the member to apply the edits
- * in the same way as if the document were not shared
- */
- protected class ModifySharedDocumentCommand implements Command {
- private final TextEdit edits;
- private final IDocument doc;
-
- protected ModifySharedDocumentCommand(TextEdit edits, IDocument doc) {
- super();
- this.edits = edits;
- this.doc = doc;
- }
-
- public void execute() {
- try {
- JDTAnnotatedElement.this.applyEdits(this.edits, this.doc);
- } catch (MalformedTreeException ex) {
- throw new RuntimeException(ex);
- } catch (BadLocationException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnum.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnum.java
deleted file mode 100644
index 53d9bc2c1c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnum.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.Enum;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT enum.
- */
-public class JDTEnum
- extends AbstractJDTType
- implements Enum
-{
-
- /**
- * constructor for the compilation unit's primary type, an enum
- */
- public JDTEnum(
- EnumDeclaration enumDeclaration,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(enumDeclaration, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for the compilation unit's primary type, an enum
- */
- public JDTEnum(
- EnumDeclaration enumDeclaration,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(null, enumDeclaration, 1, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for nested enums
- */
- public JDTEnum(
- Type declaringType,
- EnumDeclaration enumDeclaration,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringType, enumDeclaration, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for nested enums
- */
- public JDTEnum(
- Type declaringType,
- EnumDeclaration enumDeclaration,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, enumDeclaration, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- public JDTEnum(Type declaringType, String name, int occurrence, ICompilationUnit compilationUnit) {
- super(declaringType, name, occurrence, compilationUnit);
- }
-
- @Override
- public EnumDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- return (EnumDeclaration) super.getBodyDeclaration(astRoot);
- }
-
- public boolean isPersistable(CompilationUnit astRoot) {
- return true;
- }
-
- public EnumConstantDeclaration[] getEnumConstants(CompilationUnit astRoot) {
- List<EnumConstantDeclaration> enumConstants = enumConstants(getBodyDeclaration(astRoot));
- return enumConstants.toArray(new EnumConstantDeclaration[enumConstants.size()]);
- }
-
- @SuppressWarnings("unchecked")
- private static List<EnumConstantDeclaration> enumConstants(EnumDeclaration ed) {
- return ed.enumConstants();
- }
-
-
- // ********** internal **********
-
- @Override
- protected EnumDeclaration getTopLevelTypeDeclaration(CompilationUnit astRoot) {
- return (EnumDeclaration) super.getTopLevelTypeDeclaration(astRoot);
- }
-
- @Override
- protected EnumDeclaration getTypeDeclaration(List<AbstractTypeDeclaration> typeDeclarations) {
- return (EnumDeclaration) super.getTypeDeclaration(typeDeclarations);
- }
-
- @Override
- protected EnumDeclaration getNestedTypeDeclaration(TypeDeclaration declaringTypeDeclaration) {
- return this.getTypeDeclaration(getEnums(declaringTypeDeclaration));
- }
-
- @Override
- protected EnumDeclaration getTypeDeclaration(AbstractTypeDeclaration[] typeDeclarations) {
- return (EnumDeclaration) super.getTypeDeclaration(typeDeclarations);
- }
-
- @Override
- protected int getASTNodeType() {
- return ASTNode.ENUM_DECLARATION;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnumConstant.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnumConstant.java
deleted file mode 100644
index 6c2714d6e7..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTEnumConstant.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.Enum;
-import org.eclipse.jpt.common.core.utility.jdt.EnumConstant;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT enum constant.
- */
-public class JDTEnumConstant
- extends JDTMember
- implements EnumConstant
-{
-
- // ********** constructors **********
-
- public JDTEnumConstant(
- Enum declaringEnum,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringEnum, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- public JDTEnumConstant(
- Enum declaringEnum,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringEnum, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- public JDTEnumConstant(Enum declaringEnum, String name, int occurrence, ICompilationUnit compilationUnit) {
- this(declaringEnum, name, occurrence, compilationUnit, CommandExecutor.Default.instance(), DefaultAnnotationEditFormatter.instance());
- }
-
- @Override
- protected Enum getDeclaringType() {
- return (Enum) super.getDeclaringType();
- }
-
- // ********** AnnotatedElement/EnumConstant implementation **********
-
- public IVariableBinding getBinding(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).resolveVariable();
- }
-
- @Override
- public EnumConstantDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- return this.getSelectedDeclaration(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- EnumConstantDeclaration declaration = this.getBodyDeclaration(astRoot);
- // the declaration can be null if the resource is out of sync with the file system
- return (declaration == null) ? null : ASTTools.buildTextRange(declaration.getName());
- }
-
- //As far as I can tell, enum constants are always "persistable",
- //there are no modifiers you can add to an enum constant
- public boolean isPersistable(CompilationUnit astRoot) {
- return true;
- }
-
-
- // ********** internal **********
-
- protected EnumConstantDeclaration getSelectedDeclaration(CompilationUnit astRoot) {
- String name = this.getName();
- int occurrence = this.getOccurrence();
- int count = 0;
- for (EnumConstantDeclaration enumConstantDeclaration : this.getDeclaringTypeEnumConstantDeclarations(astRoot)) {
- if (enumConstantDeclaration.getName().getFullyQualifiedName().equals(name)) {
- count++;
- if (count == occurrence) {
- return enumConstantDeclaration;
- }
- }
- }
- // return null if the field is no longer in the source code;
- // this can happen when the context model has not yet
- // been synchronized with the resource model but is still
- // asking for an ASTNode (e.g. during a selection event)
- return null;
- }
-
- protected EnumConstantDeclaration[] getDeclaringTypeEnumConstantDeclarations(CompilationUnit astRoot) {
- List<EnumConstantDeclaration> enumConstants = enumConstants(this.getDeclaringTypeDeclaration(astRoot));
- return enumConstants.toArray(new EnumConstantDeclaration[enumConstants.size()]);
- }
-
- @SuppressWarnings("unchecked")
- private static List<EnumConstantDeclaration> enumConstants(EnumDeclaration ed) {
- return ed.enumConstants();
- }
-
- protected EnumDeclaration getDeclaringTypeDeclaration(CompilationUnit astRoot) {
- return this.getDeclaringType().getBodyDeclaration(astRoot);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTFieldAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTFieldAttribute.java
deleted file mode 100644
index e343cb1596..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTFieldAttribute.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.FieldAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT field.
- * Attribute based on a Java field, e.g.
- * private int foo;
- */
-public class JDTFieldAttribute
- extends JDTMember
- implements FieldAttribute
-{
-
- // ********** constructors **********
-
- public JDTFieldAttribute(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- public JDTFieldAttribute(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- public JDTFieldAttribute(Type declaringType, String name, int occurrence, ICompilationUnit compilationUnit) {
- this(declaringType, name, occurrence, compilationUnit, CommandExecutor.Default.instance(), DefaultAnnotationEditFormatter.instance());
- }
-
-
- // ********** Member/Attribute/FieldAttribute implementation **********
-
- @Override
- protected Type getDeclaringType() {
- return (Type) super.getDeclaringType();
- }
-
- public IVariableBinding getBinding(CompilationUnit astRoot) {
- return this.getFragment(astRoot).resolveBinding();
- }
-
- @Override
- public FieldDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- return this.getSelectedDeclaration(astRoot, FIELD_DECLARATION_SELECTOR);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- VariableDeclarationFragment fragment = this.getFragment(astRoot);
- // the fragment can be null if the resource is out of sync with the file system
- return (fragment == null) ? null : ASTTools.buildTextRange(fragment.getName());
- }
-
- public String getAttributeName() {
- return this.getName();
- }
-
- public ITypeBinding getTypeBinding(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).getType().resolveBinding();
- }
-
- public boolean isField() {
- return true;
- }
-
- public boolean isPersistable(CompilationUnit astRoot) {
- IVariableBinding binding = this.getBinding(astRoot);
- return (binding == null) ? false : JPTTools.fieldIsPersistable(new JPTToolsAdapter(binding));
- }
-
-
- // ********** internal **********
-
- protected TypeDeclaration getDeclaringTypeDeclaration(CompilationUnit astRoot) {
- // assume the declaring type is not an enum or annotation
- // since they do not have field or method declarations
- return this.getDeclaringType().getBodyDeclaration(astRoot);
- }
-
- protected VariableDeclarationFragment getFragment(CompilationUnit astRoot) {
- return this.getSelectedDeclaration(astRoot, VARIABLE_DECLARATION_FRAGMENT_SELECTOR);
- }
-
- /**
- * return either a FieldDeclaration or a VariableDeclarationFragment,
- * depending on the specified selector;
- *
- * handle multiple fields declared in a single statement:
- * private int foo, bar;
- */
- protected <T extends ASTNode> T getSelectedDeclaration(CompilationUnit astRoot, Selector<T> selector) {
- String name = this.getName();
- int occurrence = this.getOccurrence();
- int count = 0;
- for (FieldDeclaration fieldDeclaration : this.getDeclaringTypeFieldDeclarations(astRoot)) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- if (fragment.getName().getFullyQualifiedName().equals(name)) {
- count++;
- if (count == occurrence) {
- return selector.select(fieldDeclaration, fragment);
- }
- }
- }
- }
- // return null if the field is no longer in the source code;
- // this can happen when the context model has not yet
- // been synchronized with the resource model but is still
- // asking for an ASTNode (e.g. during a selection event)
- return null;
- }
-
- protected FieldDeclaration[] getDeclaringTypeFieldDeclarations(CompilationUnit astRoot) {
- TypeDeclaration typeDeclaration = this.getDeclaringTypeDeclaration(astRoot);
- // the declaration can be null if the resource is out of sync with the file system
- return (typeDeclaration == null) ? EMPTY_FIELD_DECLARATION_ARRAY : typeDeclaration.getFields();
- }
- protected static final FieldDeclaration[] EMPTY_FIELD_DECLARATION_ARRAY = new FieldDeclaration[0];
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected static List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
- return fd.fragments();
- }
-
-
- // ********** Selector **********
-
- // I'm not quite sure this interface is worth the resulting obfuscation,
- // but, then, I kept changing both methods, so... ~bjv
- protected interface Selector<T extends ASTNode> {
- T select(FieldDeclaration fieldDeclaration, VariableDeclarationFragment variableDeclarationFragment);
- String getDescription();
- }
-
- protected static final Selector<FieldDeclaration> FIELD_DECLARATION_SELECTOR =
- new Selector<FieldDeclaration>() {
- public FieldDeclaration select(FieldDeclaration fieldDeclaration, VariableDeclarationFragment variableDeclarationFragment) {
- return fieldDeclaration;
- }
- public String getDescription() {
- return "field declaration"; //$NON-NLS-1$
- }
- @Override
- public String toString() {
- return "FIELD_DECLARATION_SELECTOR"; //$NON-NLS-1$
- }
- };
-
- protected static final Selector<VariableDeclarationFragment> VARIABLE_DECLARATION_FRAGMENT_SELECTOR =
- new Selector<VariableDeclarationFragment>() {
- public VariableDeclarationFragment select(FieldDeclaration fieldDeclaration, VariableDeclarationFragment variableDeclarationFragment) {
- return variableDeclarationFragment;
- }
- public String getDescription() {
- return "variable declaration fragment"; //$NON-NLS-1$
- }
- @Override
- public String toString() {
- return "VARIABLE_DECLARATION_FRAGMENT_SELECTOR"; //$NON-NLS-1$
- }
- };
-
-
- // ********** JPTTools adapter **********
-
- /**
- * JPTTools needs an adapter so it can work with either an IField
- * or an IVariableBinding etc.
- */
- protected static class JPTToolsAdapter implements JPTTools.FieldAdapter {
- private final IVariableBinding fieldBinding;
-
- protected JPTToolsAdapter(IVariableBinding fieldBinding) {
- super();
- if (fieldBinding == null) {
- throw new NullPointerException();
- }
- this.fieldBinding = fieldBinding;
- }
-
- public int getModifiers() {
- return this.fieldBinding.getModifiers();
- }
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMember.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMember.java
deleted file mode 100644
index 35638f0503..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMember.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT member with simplified annotation handling.
- */
-public abstract class JDTMember extends JDTAnnotatedElement
- implements Member
-{
-
- /** this will be null for the primary type */
- private final AbstractType declaringType;
-
- /**
- * members can occur more than once in non-compiling source;
- * count starts at 1; the primary type will have occurrence 1
- */
- private final int occurrence;
-
-
- // ********** constructors **********
-
- protected JDTMember(
- AbstractType declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- protected JDTMember(
- AbstractType declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(name, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- this.declaringType = declaringType;
- this.occurrence = occurrence;
- }
-
- //covariant override
- public abstract BodyDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
-
- // ********** Member implementation **********
-
- @Override
- public ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot) {
- return new JDTModifiedDeclaration(this.getBodyDeclaration(astRoot));
- }
-
- public boolean matches(String memberName, int occur) {
- return memberName.equals(this.getName()) && (occur == this.occurrence);
- }
-
-
- // ********** internal **********
-
- protected int getOccurrence() {
- return this.occurrence;
- }
-
- /**
- * this will return null for a top-level type
- */
- protected AbstractType getDeclaringType() {
- return this.declaringType;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMethodAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMethodAttribute.java
deleted file mode 100644
index 26133ed2cc..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTMethodAttribute.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.NameTools;
-import org.eclipse.jpt.common.utility.internal.SimpleMethodSignature;
-
-/**
- * Adapt and extend a JDT method.
- * Attribute based on a Java property, e.g.
- * private int getFoo() {
- * return foo;
- * }
- * private void setFoo(int foo) {
- * this.foo = foo;
- * }
- */
-public class JDTMethodAttribute
- extends JDTMember
- implements MethodAttribute
-{
- /** we need the parameter types to build the method signature */
- private final JavaType[] parameterTypes;
-
-
- // ********** constructors **********
-
- public static JDTMethodAttribute newInstance(
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- return newInstance(declaringType, signature, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- public static JDTMethodAttribute newInstance(
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- return new JDTMethodAttribute(declaringType, signature, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- private JDTMethodAttribute(
- Type declaringType,
- MethodSignature methodSignature,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, methodSignature.getName(), occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- this.parameterTypes = methodSignature.getParameterTypes();
- }
-
- /**
- * constructor for testing
- */
- public JDTMethodAttribute(Type declaringType, String name, String[] parameterTypeNames, int occurrence, ICompilationUnit compilationUnit) {
- this(declaringType, new SimpleMethodSignature(name, parameterTypeNames), occurrence, compilationUnit, CommandExecutor.Default.instance(), DefaultAnnotationEditFormatter.instance());
- }
-
-
- // ********** Member/Attribute/MethodAttribute implementation **********
-
- @Override
- protected Type getDeclaringType() {
- return (Type) super.getDeclaringType();
- }
-
- public boolean isField() {
- return false;
- }
-
- public IMethodBinding getBinding(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).resolveBinding();
- }
-
- @Override
- public MethodDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- int count = 0;
- for (MethodDeclaration methodDeclaration : this.getDeclaringTypeMethodDeclarations(astRoot)) {
- if (this.matches(methodDeclaration)) {
- count++;
- if (count == this.getOccurrence()) {
- return methodDeclaration;
- }
- }
- }
- // return null if the method is no longer in the source code;
- // this can happen when the context model has not yet
- // been synchronized with the resource model but is still
- // asking for an ASTNode (e.g. during a selection event)
- return null;
- }
-
- public boolean matches(MethodSignature signature, int occurrence) {
- return this.matches(signature) && (occurrence == this.getOccurrence());
- }
-
- protected boolean matches(MethodSignature signature) {
- return signature.getName().equals(this.getName())
- && Arrays.equals(this.parameterTypes, signature.getParameterTypes());
- }
-
- protected boolean matches(MethodDeclaration methodDeclaration) {
- return this.matches(ASTTools.buildMethodSignature(methodDeclaration));
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected static List<SingleVariableDeclaration> parameters(MethodDeclaration methodDeclaration) {
- return methodDeclaration.parameters();
- }
-
- @Override
- public boolean matches(String memberName, int occurrence) {
- throw new UnsupportedOperationException("Use #matches(MethodSignature, int)."); //$NON-NLS-1$
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- MethodDeclaration methodDeclaration = this.getBodyDeclaration(astRoot);
- // the declaration can be null if the resource is out of sync with the file system
- return (methodDeclaration == null) ? null : ASTTools.buildTextRange(methodDeclaration.getName());
- }
-
- /**
- * return "foo" for a method named "getFoo", "isFoo", "setFoo"
- */
- public String getAttributeName() {
- return NameTools.convertGetterSetterMethodNameToPropertyName(this.getName());
- }
-
- public ITypeBinding getTypeBinding(CompilationUnit astRoot) {
- IMethodBinding methodBinding = getBodyDeclaration(astRoot).resolveBinding();
- return (methodBinding == null) ? null : methodBinding.getReturnType();
- }
-
- public boolean isPersistable(CompilationUnit astRoot) {
- IMethodBinding binding = this.getBinding(astRoot);
- return (binding == null) ? false : JPTTools.methodIsPersistablePropertyGetter(new JPTToolsAdapter(binding));
- }
-
-
- // ********** internal **********
-
- protected TypeDeclaration getDeclaringTypeDeclaration(CompilationUnit astRoot) {
- // assume the declaring type is not an enum or annotation
- // since they do not have field or method declarations
- return this.getDeclaringType().getBodyDeclaration(astRoot);
- }
-
- protected MethodDeclaration[] getDeclaringTypeMethodDeclarations(CompilationUnit astRoot) {
- TypeDeclaration typeDeclaration = this.getDeclaringTypeDeclaration(astRoot);
- // the declaration can be null if the resource is out of sync with the file system
- return (typeDeclaration == null) ? EMPTY_METHOD_DECLARATION_ARRAY : typeDeclaration.getMethods();
- }
- protected static final MethodDeclaration[] EMPTY_METHOD_DECLARATION_ARRAY = new MethodDeclaration[0];
-
-
- // ********** JPTTools adapter **********
-
- /**
- * JPTTools needs an adapter so it can work with either an IMethod
- * or an IMethodBinding etc.
- */
- protected static class SimpleJPTToolsAdapter
- implements JPTTools.SimpleMethodAdapter
- {
- protected final IMethodBinding methodBinding;
-
- protected SimpleJPTToolsAdapter(IMethodBinding methodBinding) {
- super();
- if (methodBinding == null) {
- throw new NullPointerException();
- }
- this.methodBinding = methodBinding;
- }
-
- public int getModifiers() {
- return this.methodBinding.getModifiers();
- }
-
- public String getReturnTypeErasureName() {
- ITypeBinding returnType = this.methodBinding.getReturnType();
- return (returnType == null) ? null : returnType.getTypeDeclaration().getErasure().getQualifiedName();
- }
-
- public boolean isConstructor() {
- return this.methodBinding.isConstructor();
- }
-
- }
-
- protected static class JPTToolsAdapter
- extends SimpleJPTToolsAdapter
- implements JPTTools.MethodAdapter
- {
- protected JPTToolsAdapter(IMethodBinding methodBinding) {
- super(methodBinding);
- }
-
- public String getName() {
- return this.methodBinding.getName();
- }
-
- public int getParametersLength() {
- return this.methodBinding.getParameterTypes().length;
- }
-
- public JPTTools.SimpleMethodAdapter getSibling(String name) {
- ITypeBinding typeBinding = this.methodBinding.getDeclaringClass();
- if (typeBinding == null) {
- return null;
- }
- for (IMethodBinding sibling : typeBinding.getDeclaredMethods()) {
- if ((sibling.getParameterTypes().length == 0)
- && sibling.getName().equals(name)) {
- return new SimpleJPTToolsAdapter(sibling);
- }
- }
- return null;
- }
-
- public JPTTools.SimpleMethodAdapter getSibling(String name, String parameterTypeErasureName) {
- ITypeBinding typeBinding = this.methodBinding.getDeclaringClass();
- if (typeBinding == null) {
- return null;
- }
- for (IMethodBinding sibling : typeBinding.getDeclaredMethods()) {
- ITypeBinding[] siblingParmTypes = sibling.getParameterTypes();
- if ((siblingParmTypes.length == 1)
- && sibling.getName().equals(name)
- && siblingParmTypes[0].getTypeDeclaration().getErasure().getQualifiedName().equals(parameterTypeErasureName)) {
- return new SimpleJPTToolsAdapter(sibling);
- }
- }
- return null;
- }
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTModifiedDeclaration.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTModifiedDeclaration.java
deleted file mode 100644
index 6e67e46fbc..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTModifiedDeclaration.java
+++ /dev/null
@@ -1,584 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SubIteratorWrapper;
-
-/**
- * Wrap any of the AST nodes that have modifiers (specifically, annotations);
- * i.e. BodyDeclaration, SingleVariableDeclaration, VariableDeclarationExpression,
- * and VariableDeclarationStatement.
- */
-public class JDTModifiedDeclaration
- implements ModifiedDeclaration
-{
- private final Adapter adapter;
-
-
- // ********** constructors **********
-
- public JDTModifiedDeclaration(Adapter adapter) {
- super();
- this.adapter = adapter;
- }
-
- public JDTModifiedDeclaration(BodyDeclaration declaration) {
- this(new BodyDeclarationAdapter(declaration));
- }
-
- public JDTModifiedDeclaration(PackageDeclaration declaration) {
- this(new PackageDeclarationAdapter(declaration));
- }
-
- public JDTModifiedDeclaration(SingleVariableDeclaration declaration) {
- this(new SingleVariableDeclarationAdapter(declaration));
- }
-
- public JDTModifiedDeclaration(VariableDeclarationExpression declaration) {
- this(new VariableDeclarationExpressionAdapter(declaration));
- }
-
- public JDTModifiedDeclaration(VariableDeclarationStatement declaration) {
- this(new VariableDeclarationStatementAdapter(declaration));
- }
-
-
- // ********** annotations **********
-
- public Annotation getAnnotationNamed(String annotationName) {
- for (Iterator<Annotation> stream = this.annotations(); stream.hasNext(); ) {
- Annotation annotation = stream.next();
- if (this.annotationIsNamed(annotation, annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- public void removeAnnotationNamed(String annotationName) {
- for (Iterator<IExtendedModifier> stream = this.getModifiers().iterator(); stream.hasNext(); ) {
- IExtendedModifier modifier = stream.next();
- if (modifier.isAnnotation()) {
- if (this.annotationIsNamed((Annotation) modifier, annotationName)) {
- stream.remove();
- break;
- }
- }
- }
- }
-
- public void replaceAnnotationNamed(String oldAnnotationName, Annotation newAnnotation) {
- List<IExtendedModifier> modifiers = this.getModifiers();
- for (ListIterator<IExtendedModifier> stream = modifiers.listIterator(); stream.hasNext(); ) {
- IExtendedModifier modifier = stream.next();
- if (modifier.isAnnotation()) {
- if (this.annotationIsNamed((Annotation) modifier, oldAnnotationName)) {
- stream.set(newAnnotation);
- return;
- }
- }
- }
- this.addAnnotation(newAnnotation);
- }
-
- /**
- * Add the specified annotation to the declaration.
- * By convention annotations precede the "standard" (JLS2) modifiers;
- * though, technically, they can be interspersed.
- */
- protected void addAnnotation(Annotation annotation) {
- List<IExtendedModifier> modifiers = this.getModifiers();
- for (ListIterator<IExtendedModifier> stream = modifiers.listIterator(); stream.hasNext(); ) {
- if (stream.next().isModifier()) {
- stream.previous(); // put the annotation *before* the first "standard" (JLS2) modifier
- stream.add(annotation);
- return;
- }
- }
- modifiers.add(annotation); // just tack it on to the end
- }
-
- /**
- * Return the declaration's annotations.
- */
- protected Iterator<Annotation> annotations() {
- return new SubIteratorWrapper<IExtendedModifier, Annotation>(this.annotations_());
- }
-
- protected Iterator<IExtendedModifier> annotations_() {
- return new FilteringIterator<IExtendedModifier>(this.getModifiers().iterator()) {
- @Override
- protected boolean accept(IExtendedModifier next) {
- return next.isAnnotation();
- }
- };
- }
-
-
- // ********** add import **********
-
- public boolean addImport(String className) {
- if (className.indexOf('.') == -1) {
- return true; // the class is in the default package - no need for import
- }
- return this.addImport(className, false);
- }
-
- public boolean addStaticImport(String enumConstantName) {
- int index1 = enumConstantName.indexOf('.');
- if (index1 == -1) {
- throw new IllegalArgumentException(enumConstantName); // shouldn't happen?
- }
- int index2 = enumConstantName.indexOf('.', index1 + 1);
- if (index2 == -1) {
- return true; // the enum is in the default package - no need for import
- }
- return this.addImport(enumConstantName, true);
- }
-
- public boolean addImport(String importName, boolean staticImport) {
- Boolean include = this.importsInclude(importName, staticImport);
- if (include != null) {
- return include.booleanValue();
- }
-
- ImportDeclaration importDeclaration = this.getAst().newImportDeclaration();
- importDeclaration.setName(this.getAst().newName(importName));
- importDeclaration.setStatic(staticImport);
- this.getImports().add(importDeclaration);
- return true;
- }
-
- /**
- * Just a bit hacky:
- * Return Boolean.TRUE if the import is already present.
- * Return Boolean.FALSE if a colliding import is already present.
- * Return null if a new import may be added.
- * This hackery allows us to loop through the imports only once
- * (and compose our methods).
- * Pre-condition: 'importName' is not in the "default" package (i.e. it *is* qualified)
- */
- protected Boolean importsInclude(String importName, boolean staticImport) {
- int period = importName.lastIndexOf('.'); // should not be -1
- String importNameQualifier = importName.substring(0, period);
- String shortImportName = importName.substring(period + 1);
- return this.importsInclude(importName, importNameQualifier, shortImportName, staticImport);
- }
-
- /**
- * pre-calculate the qualifier and short name
- */
- protected Boolean importsInclude(String importName, String importNameQualifier, String shortImportName, boolean staticImport) {
- for (ImportDeclaration importDeclaration : this.getImports()) {
- if (importDeclaration.isStatic() == staticImport) {
- Boolean match = this.importMatches(importDeclaration, importName, importNameQualifier, shortImportName);
- if (match != null) {
- return match;
- }
- }
- }
- return null;
- }
-
- /**
- * we should be able to rely on the JDT model here, since we are looking
- * at objects that should not be changing underneath us...
- */
- protected Boolean importMatches(ImportDeclaration importDeclaration, String importName, String importNameQualifier, String shortImportName) {
- // examples:
- // 'importName' is "java.util.Date"
- // or
- // 'importName' is "java.lang.annotation.ElementType.TYPE"
- String idn = importDeclaration.getName().getFullyQualifiedName();
- if (importName.equals(idn)) {
- // import java.util.Date; => "Date" will resolve to "java.util.Date"
- // import static java.lang.annotation.ElementType.TYPE; => "TYPE" will resolve to "java.lang.annotation.ElementType.TYPE"
- return Boolean.TRUE;
- }
-
- String shortIDN = idn.substring(idn.lastIndexOf('.') + 1);
- if (shortImportName.equals(shortIDN)) {
- // import java.sql.Date; => ambiguous resolution of "Date"
- // import static org.foo.Bar.TYPE; => ambiguous resolution of "TYPE"
- return Boolean.FALSE;
- }
-
- if (importDeclaration.isOnDemand()) {
- if (importNameQualifier.equals(idn)) {
- // import java.util.*; => "Date" will resolve to "java.util.Date"
- // import static java.lang.annotation.ElementType.*; => "TYPE" will resolve to "java.lang.annotation.ElementType.TYPE"
- return Boolean.TRUE;
- }
- if (importDeclaration.isStatic()) {
- if (this.enumResolves(idn, shortImportName)) {
- // import static org.foo.Bar.*; => ambiguous resolution of "TYPE"
- return Boolean.FALSE;
- }
- } else {
- if (this.typeResolves(idn + '.' + shortImportName)) {
- // import java.sql.*; => ambiguous resolution of "Date"
- return Boolean.FALSE;
- }
- }
- }
- // no matches - OK to add explicit import
- return null;
- }
-
- protected boolean enumResolves(String enumTypeName, String enumConstantName) {
- try {
- return this.enumResolves_(enumTypeName, enumConstantName);
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- protected boolean enumResolves_(String enumTypeName, String enumConstantName) throws JavaModelException {
- IType jdtType = this.findType_(enumTypeName);
- if (jdtType == null) {
- return false;
- }
- if ( ! jdtType.isEnum()) {
- return false;
- }
- for (IField jdtField : jdtType.getFields()) {
- if (jdtField.isEnumConstant() && jdtField.getElementName().equals(enumConstantName)) {
- return true;
- }
- }
- return false;
- }
-
- protected boolean typeResolves(String name) {
- return this.findType(name) != null;
- }
-
- protected IType findType(String name) {
- try {
- return this.findType_(name);
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- protected IType findType_(String name) throws JavaModelException {
- return this.getCompilationUnit().getJavaElement().getJavaProject().findType(name);
- }
-
- protected List<ImportDeclaration> getImports() {
- return this.imports(this.getCompilationUnit());
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected List<ImportDeclaration> imports(CompilationUnit astRoot) {
- return astRoot.imports();
- }
-
-
- // ********** annotation name resolution **********
-
- public boolean annotationIsNamed(Annotation annotation, String name) {
- return this.getQualifiedName(annotation).equals(name);
- }
-
- /**
- * Simply return the annotation's unqualified name if we can't "resolve" it.
- */
- protected String getQualifiedName(Annotation annotation) {
- ITypeBinding typeBinding = annotation.resolveTypeBinding();
- if (typeBinding != null) {
- String resolvedName = typeBinding.getQualifiedName();
- if (resolvedName != null) {
- return resolvedName;
- }
- }
- // hack(?): check for a matching import because when moving a stand-alone
- // annotation to its container in CombinationIndexedDeclarationAnnotationAdapter
- // the container's import is added but then it won't "resolve" upon
- // subsequent lookups (because the parser hasn't had time to run?)... :-(
- return this.convertToFullClassName(annotation.getTypeName().getFullyQualifiedName());
- }
-
- /**
- * If necessary, use the declaration's imports to calculate a guess as to
- * the specified name's fully-qualified form.
- * Simply return the unqualified name if we can't "resolve" it.
- */
- protected String convertToFullClassName(String name) {
- // check for fully-qualified name
- return (name.lastIndexOf('.') != -1) ? name : this.resolveAgainstImports(name, false);
- }
-
- /**
- * If necessary, use the declaration's imports to calculate a guess as to
- * the specified name's fully-qualified form.
- * Simply return the unqualified name if we can't "resolve" it.
- */
- protected String convertToFullEnumConstantName(String name) {
- int index1 = name.indexOf('.');
- if (index1 == -1) {
- // short name, e.g. "TYPE"
- // true = look for static import of enum constant
- return this.resolveAgainstImports(name, true);
- }
-
- int index2 = name.indexOf('.', index1 + 1);
- if (index2 == -1) {
- // partially-qualified name, e.g. "ElementType.TYPE"
- // false = look regular import of enum class, not static import of enum constant
- return this.resolveAgainstImports(name, false);
- }
-
- // fully-qualified name, e.g. "java.lang.annotation.ElementType.TYPE"
- return name;
- }
-
- /**
- * Attempt to resolve the specified "short" name against the declaration's
- * imports. Return the name unchanged if we can't resolve it (perhaps it is
- * in the "default" package).
- */
- protected String resolveAgainstImports(String shortName, boolean static_) {
- for (ImportDeclaration importDeclaration : this.getImports()) {
- if (importDeclaration.isStatic() == static_) {
- String resolvedName = this.resolveAgainstImport(importDeclaration, shortName);
- if (resolvedName != null) {
- return resolvedName;
- }
- }
- }
- return shortName; // "default" package or unknown
- }
-
- /**
- * Attempt to resolve the specified "short" name against the specified
- * import. Return the resolved name if the import resolves it; otherwise
- * return null.
- */
- protected String resolveAgainstImport(ImportDeclaration importDeclaration, String shortName) {
- String idn = importDeclaration.getName().getFullyQualifiedName();
- if (importDeclaration.isOnDemand()) {
- String candidate = idn + '.' + shortName;
- if (importDeclaration.isStatic()) {
- if (this.enumResolves(idn, shortName)) {
- return candidate;
- }
- } else {
- if (this.typeResolves(candidate)) {
- return candidate;
- }
- }
- // no match
- return null;
- }
-
- // explicit import - see whether its end matches 'shortName'
- int period = idn.length() - shortName.length() - 1;
- if (period < 1) {
- // something must precede period
- return null;
- }
- if ((idn.charAt(period) == '.') && idn.endsWith(shortName)) {
- return idn; // probable exact match
- }
- return null;
- }
-
-
- // ********** miscellaneous methods **********
-
- public ASTNode getDeclaration() {
- return this.adapter.getDeclaration();
- }
-
- /**
- * Return the declaration's list of modifiers.
- * Element type: org.eclipse.jdt.core.dom.IExtendedModifier
- */
- protected List<IExtendedModifier> getModifiers() {
- return this.adapter.getModifiers();
- }
-
- public AST getAst() {
- return this.getDeclaration().getAST();
- }
-
- protected CompilationUnit getCompilationUnit() {
- return (CompilationUnit) this.getDeclaration().getRoot();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.adapter.toString());
- }
-
-
- // ********** declaration adapter interface and implementations **********
-
- /**
- * Define common protocol among the various "declarations".
- */
- public interface Adapter {
-
- /**
- * Return the adapted "declaration".
- */
- ASTNode getDeclaration();
-
- /**
- * Return the "declaration"'s list of modifiers.
- * Element type: org.eclipse.jdt.core.dom.IExtendedModifier
- */
- List<IExtendedModifier> getModifiers();
-
- }
-
- public static class BodyDeclarationAdapter implements Adapter {
- private final BodyDeclaration declaration;
- public BodyDeclarationAdapter(BodyDeclaration declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode getDeclaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> getModifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
- public static class PackageDeclarationAdapter implements Adapter {
- private final PackageDeclaration declaration;
- public PackageDeclarationAdapter(PackageDeclaration declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode getDeclaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> getModifiers() {
- return this.declaration.annotations();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
- /*public static class ASTNodeAdapter implements Adapter {
- private final ASTNode declaration;
- public ASTNodeAdapter(ASTNode declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode getDeclaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> getModifiers() {
- if (declaration instanceof BodyDeclaration) {
- return ((BodyDeclaration) declaration).modifiers();
- } else if (declaration instanceof PackageDeclaration) {
- return ((PackageDeclaration) declaration).annotations();
- }
- return Collections.emptyList();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }*/
-
- public static class SingleVariableDeclarationAdapter implements Adapter {
- private final SingleVariableDeclaration declaration;
- public SingleVariableDeclarationAdapter(SingleVariableDeclaration declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode getDeclaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> getModifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
- public static class VariableDeclarationExpressionAdapter implements Adapter {
- private final VariableDeclarationExpression declaration;
- public VariableDeclarationExpressionAdapter(VariableDeclarationExpression declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode getDeclaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> getModifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
- public static class VariableDeclarationStatementAdapter implements Adapter {
- private final VariableDeclarationStatement declaration;
- public VariableDeclarationStatementAdapter(VariableDeclarationStatement declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode getDeclaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> getModifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTPackage.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTPackage.java
deleted file mode 100644
index 2cef772df9..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTPackage.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Red Hat, Inc. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- * Oracle
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IPackageBinding;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedPackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-public class JDTPackage
- extends JDTAnnotatedElement
- implements AnnotatedPackage
-{
- protected JDTPackage(PackageDeclaration declaringPackage,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(declaringPackage.getName().getFullyQualifiedName(),
- compilationUnit,
- modifySharedDocumentCommandExecutor);
- }
-
- public JDTPackage(
- PackageDeclaration declaringPackage,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringPackage.getName().getFullyQualifiedName(),
- compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- @Override
- public ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot) {
- return new JDTModifiedDeclaration(this.getBodyDeclaration(astRoot));
- }
-
- public IPackageBinding getBinding(CompilationUnit astRoot) {
- PackageDeclaration pd = this.getBodyDeclaration(astRoot);
- return (pd == null) ? null : pd.resolveBinding();
- }
-
- public PackageDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- return astRoot.getPackage();
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return ASTTools.buildTextRange(this.getBodyDeclaration(astRoot).getName());
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTType.java
deleted file mode 100644
index 55bef8862a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JDTType.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT type.
- */
-public class JDTType
- extends AbstractJDTType
- implements Type
-{
-
- /**
- * constructor for the compilation unit's primary type
- */
- public JDTType(
- TypeDeclaration typeDeclaration, // exclude annotations and enums
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(typeDeclaration, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for the compilation unit's primary type
- */
- public JDTType(
- TypeDeclaration typeDeclaration, // exclude annotations and enums
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- this(null, typeDeclaration, 1, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for nested types
- */
- public JDTType(
- Type declaringType,
- TypeDeclaration typeDeclaration, // exclude annotations and enums
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringType, typeDeclaration, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- /**
- * constructor for nested types
- */
- public JDTType(
- Type declaringType,
- TypeDeclaration typeDeclaration, // exclude annotations and enums
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, typeDeclaration, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- public JDTType(Type declaringType, String name, int occurrence, ICompilationUnit compilationUnit) {
- super(declaringType, name, occurrence, compilationUnit);
- }
-
-
- // ********** Member/Type implementation **********
-
- /**
- * find the type's body declaration in the specified AST
- */
- @Override
- public TypeDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- return (TypeDeclaration) super.getBodyDeclaration(astRoot);
- }
-
- public boolean isPersistable(CompilationUnit astRoot) {
- ITypeBinding binding = this.getBinding(astRoot);
- return (binding == null) ? false : JPTTools.typeIsPersistable(new JPTToolsAdapter(binding));
- }
-
- public TypeDeclaration[] getTypes(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).getTypes();
- }
-
- public EnumDeclaration[] getEnums(CompilationUnit astRoot) {
- return getEnums(this.getBodyDeclaration(astRoot));
- }
-
- public FieldDeclaration[] getFields(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).getFields();
- }
-
- public MethodDeclaration[] getMethods(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).getMethods();
- }
-
-
- // ********** internal **********
-
- /**
- * return the first top-level type in the specified AST with a matching name
- */
- @Override
- protected TypeDeclaration getTopLevelTypeDeclaration(CompilationUnit astRoot) {
- return (TypeDeclaration) super.getTopLevelTypeDeclaration(astRoot);
- }
-
- @Override
- protected TypeDeclaration getTypeDeclaration(List<AbstractTypeDeclaration> typeDeclarations) {
- return (TypeDeclaration) super.getTypeDeclaration(typeDeclarations);
- }
-
- /**
- * return the nested type with a matching name and occurrence
- */
- @Override
- protected TypeDeclaration getNestedTypeDeclaration(TypeDeclaration declaringTypeDeclaration) {
- return this.getTypeDeclaration(declaringTypeDeclaration.getTypes());
- }
-
- /**
- * return the type declaration corresponding to the type from the specified
- * set of type declarations (match name and occurrence)
- */
- @Override
- protected TypeDeclaration getTypeDeclaration(AbstractTypeDeclaration[] typeDeclarations) {
- return (TypeDeclaration) super.getTypeDeclaration(typeDeclarations);
- }
-
- @Override
- protected int getASTNodeType() {
- return ASTNode.TYPE_DECLARATION;
- }
-
-
- // ********** JPT tools adapter **********
-
- protected static class JPTToolsAdapter implements JPTTools.TypeAdapter {
- private final ITypeBinding typeBinding;
- protected JPTToolsAdapter(ITypeBinding typeBinding) {
- super();
- if (typeBinding == null) {
- throw new NullPointerException();
- }
- this.typeBinding = typeBinding;
- }
-
- public int getModifiers() {
- return this.typeBinding.getModifiers();
- }
-
- public boolean isAnnotation() {
- return this.typeBinding.isAnnotation();
- }
-
- public boolean isAnonymous() {
- return this.typeBinding.isAnonymous();
- }
-
- public boolean isArray() {
- return this.typeBinding.isArray();
- }
-
- public boolean isEnum() {
- return this.typeBinding.isEnum();
- }
-
- public boolean isInterface() {
- return this.typeBinding.isInterface();
- }
-
- public boolean isLocal() {
- return this.typeBinding.isLocal();
- }
-
- public boolean isMember() {
- return this.typeBinding.isMember();
- }
-
- public boolean isPrimitive() {
- return this.typeBinding.isPrimitive();
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JPTTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JPTTools.java
deleted file mode 100644
index f1930c829c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/JPTTools.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.lang.reflect.Modifier;
-
-/**
- * Convenience methods for JPA-related queries concerning JDT objects.
- */
-//TODO this needs to move because it is only used for JPA
-public class JPTTools {
-
- // ********** type **********
-
- /**
- * Return whether the specified type can be "persisted", i.e. marked as
- * Entity, MappedSuperclass, Embeddable
- */
- public static boolean typeIsPersistable(TypeAdapter typeAdapter) {
- if (typeAdapter.isInterface()) {
- return false;
- }
- if (typeAdapter.isAnnotation()) {
- return false;
- }
- if (typeAdapter.isEnum()) {
- return false;
- }
- if (typeAdapter.isLocal()) {
- return false;
- }
- if (typeAdapter.isAnonymous()) {
- return false;
- }
- if (typeAdapter.isPrimitive()) {
- return false; // should never get here(?)
- }
- if (typeAdapter.isArray()) {
- return false; // should never get here(?)
- }
- return true;
- }
-
- /**
- * Queries needed to calculate whether a type is "persistable".
- * Adapted to ITypeBinding and IType.
- */
- public interface TypeAdapter {
- int getModifiers();
- boolean isAnnotation();
- boolean isAnonymous();
- boolean isArray();
- boolean isEnum();
- boolean isInterface();
- boolean isLocal();
- boolean isMember();
- boolean isPrimitive();
- }
-
-
- // ********** field **********
-
- /**
- * Return whether the specified field may be "persisted".
- * According to the spec, "All non-transient instance variables that are not
- * annotated with the Transient annotation are persistent."
- */
- public static boolean fieldIsPersistable(FieldAdapter fieldAdapter) {
- int modifiers = fieldAdapter.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return false;
- }
- if (Modifier.isTransient(modifiers)) {
- return false;
- }
- return true;
- }
-
- /**
- * Queries needed to calculate whether a field is "persistable".
- * Adapted to IVariableBinding and IField.
- */
- public interface FieldAdapter {
- /**
- * Return the field's modifiers. We use these to check whether the
- * field is static or transient.
- */
- int getModifiers();
- }
-
-
- // ********** method **********
-
- /**
- * Return whether the specified method is a "getter" method that
- * represents a property that may be "persisted".
- */
- public static boolean methodIsPersistablePropertyGetter(MethodAdapter methodAdapter) {
- if (methodHasInvalidModifiers(methodAdapter)) {
- return false;
- }
- if (methodAdapter.isConstructor()) {
- return false;
- }
-
- String returnTypeName = methodAdapter.getReturnTypeErasureName();
- if (returnTypeName == null) {
- return false; // DOM method bindings can have a null name
- }
- if (returnTypeName.equals("void")) { //$NON-NLS-1$
- return false;
- }
- if (methodHasParameters(methodAdapter)) {
- return false;
- }
-
- String name = methodAdapter.getName();
- int beginIndex = 0;
- boolean booleanGetter = false;
- if (name.startsWith("is")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- beginIndex = 2;
- } else {
- return false;
- }
- } else if (name.startsWith("get")) { //$NON-NLS-1$
- beginIndex = 3;
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- booleanGetter = true;
- }
- } else {
- return false;
- }
-
- String capitalizedAttributeName = name.substring(beginIndex);
- // if the type has both methods:
- // boolean isProperty()
- // boolean getProperty()
- // then #isProperty() takes precedence and we ignore #getProperty();
- // but only having #getProperty() is OK too
- // (see the JavaBeans spec 1.01)
- if (booleanGetter && methodHasValidSiblingIsMethod(methodAdapter, capitalizedAttributeName)) {
- return false; // since the type also defines #isProperty(), ignore #getProperty()
- }
- return methodHasValidSiblingSetMethod(methodAdapter, capitalizedAttributeName, returnTypeName);
- }
-
- /**
- * Return whether the method's modifiers prevent it
- * from being a getter or setter for a "persistent" property.
- */
- private static boolean methodHasInvalidModifiers(SimpleMethodAdapter methodAdapter) {
- int modifiers = methodAdapter.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return true;
- }
- return false;
- }
-
- private static boolean methodHasParameters(MethodAdapter methodAdapter) {
- return methodAdapter.getParametersLength() != 0;
- }
-
- /**
- * Return whether the method has a sibling "is" method for the specified
- * property and that method is valid for a "persistable" property.
- * Pre-condition: the method is a "boolean getter" (e.g. 'public boolean getProperty()');
- * this prevents us from returning true when the method itself is an
- * "is" method.
- */
- private static boolean methodHasValidSiblingIsMethod(MethodAdapter methodAdapter, String capitalizedAttributeName) {
- SimpleMethodAdapter isMethodAdapter = methodAdapter.getSibling("is" + capitalizedAttributeName); //$NON-NLS-1$
- return methodIsValidSibling(isMethodAdapter, "boolean"); //$NON-NLS-1$
- }
-
- /**
- * Return whether the method has a sibling "set" method
- * and that method is valid for a "persistable" property.
- */
- private static boolean methodHasValidSiblingSetMethod(MethodAdapter methodAdapter, String capitalizedAttributeName, String parameterTypeErasureName) {
- SimpleMethodAdapter setMethodAdapter = methodAdapter.getSibling("set" + capitalizedAttributeName, parameterTypeErasureName); //$NON-NLS-1$
- return methodIsValidSibling(setMethodAdapter, "void"); //$NON-NLS-1$
- }
-
- /**
- * Return whether the specified method is a valid sibling with the
- * specified return type.
- */
- private static boolean methodIsValidSibling(SimpleMethodAdapter methodAdapter, String returnTypeName) {
- if (methodAdapter == null) {
- return false;
- }
- if (methodHasInvalidModifiers(methodAdapter)) {
- return false;
- }
- if (methodAdapter.isConstructor()) {
- return false;
- }
- String rtName = methodAdapter.getReturnTypeErasureName();
- if (rtName == null) {
- return false; // DOM method bindings can have a null name
- }
- return rtName.equals(returnTypeName);
- }
-
- /**
- * Queries needed to calculate whether a method is "persistable".
- * Adapted to IMethodBinding and IMethod.
- */
- public interface SimpleMethodAdapter {
- /**
- * Return the method's modifiers.
- * We use these to check whether the method is static, final, etc.
- */
- int getModifiers();
-
- /**
- * Return the name of the method's return type erasure.
- * We use this to check for
- * - boolean getters
- * - void return types
- * - matching getters and setters
- */
- String getReturnTypeErasureName();
-
- /**
- * Return whether the method is a constructor.
- */
- boolean isConstructor();
- }
-
- /**
- * Queries needed to calculate whether a method is "persistable".
- * Adapted to IMethodBinding and IMethod.
- */
- public interface MethodAdapter extends SimpleMethodAdapter {
- /**
- * Return the method's name.
- * We use this to determine
- * - whether the method is a "getter"
- * - the property name implied by the getter's name
- */
- String getName();
-
- /**
- * Return the number of paramters declared by the method.
- * We use this to determine whether the method is a "getter".
- */
- int getParametersLength();
-
- /**
- * Return the method's "sibling" with the specified name and no parameters.
- * We use this to find an "is" boolean getter that would take precedence
- * over a "get" boolean getter.
- */
- SimpleMethodAdapter getSibling(String name);
-
- /**
- * Return the method's "sibling" with the specified name and single parameter.
- * We use this to find a matching "setter" for a possible "getter".
- */
- SimpleMethodAdapter getSibling(String name, String parameterTypeErasureName);
- }
-
-
- // ********** suppressed constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private JPTTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NameStringExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NameStringExpressionConverter.java
deleted file mode 100644
index 5c9bc46dde..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NameStringExpressionConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a name to/from a string representation of a name/identifier
- * (e.g. "com.xxx.Foo.VALUE1" or "value").
- */
-public final class NameStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new NameStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NameStringExpressionConverter() {
- super();
- }
-
- @Override
- protected Name convertObject(String string, AST ast) {
- return ast.newName(string);
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- switch (expression.getNodeType()) {
- case ASTNode.QUALIFIED_NAME:
- case ASTNode.SIMPLE_NAME:
- return ((Name) expression).getFullyQualifiedName();
- default:
- return null;
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 17eb956055..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Manipulate an annotation that is embedded as an element within
- * another annotation, e.g.
- * <pre>
- * &#64;Outer(foo=&#64;Inner)
- * private int id;
- * outerAnnotationAdapter = AnnotationAdapter<&#64;Outer>
- * elementName = "foo"
- * annotationName = "Inner"
- * </pre>
- */
-public class NestedDeclarationAnnotationAdapter
- extends AbstractNestedDeclarationAnnotationAdapter
-{
- // ********** constructors **********
-
- /**
- * The default element name is <code>value</code>.
- */
- public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String annotationName) {
- super(outerAnnotationAdapter, annotationName);
- }
-
- /**
- * default behavior is to remove the outer annotation when it is empty
- */
- public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName) {
- super(outerAnnotationAdapter, elementName, annotationName);
- }
-
-
- // ********** AbstractNestedDeclarationAnnotationAdapter implementation **********
-
- @Override
- protected Annotation getAnnotation(Expression value) {
- return this.annotationValue(value);
- }
-
- @Override
- protected Expression buildNewInnerExpression(Annotation inner) {
- return inner;
- }
-
- /**
- * the annotation is the expression itself, so the annotation cannot be
- * "removed" from itself - return 'false'
- */
- @Override
- protected boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value) {
- return false;
- }
-
- /**
- * <pre>
- * &#64;Outer("lorem ipsum") => &#64;Outer(&#64;Inner)
- * </pre>
- */
- @Override
- protected void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner) {
- // replace(?) the current element value
- outer.setValue(inner);
- }
-
- /**
- * Simply set the pair's value.
- */
- @Override
- protected void modifyMemberValuePair(MemberValuePair pair, Annotation inner) {
- pair.setValue(inner);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index acfd74372f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Manipulate an annotation that is embedded in an element array within
- * another annotation, e.g.
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one"), &#64;Inner("two")})
- * private int id;
- * outerAnnotationAdapter = AnnotationAdapter<&#64;Outer>
- * elementName = "foo"
- * index = 0-2
- * annotationName = "Inner"
- * </pre>
- */
-public class NestedIndexedDeclarationAnnotationAdapter
- extends AbstractNestedDeclarationAnnotationAdapter
- implements IndexedDeclarationAnnotationAdapter
-{
- private int index;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is <code>value</code>.
- */
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, int index, String annotationName) {
- super(annotationAdapter, annotationName);
- this.index = index;
- }
-
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, int index, String annotationName) {
- super(annotationAdapter, elementName, annotationName);
- this.index = index;
- }
-
-
- // ********** AbstractNestedDeclarationAnnotationAdapter implementation **********
-
- @Override
- protected Annotation getAnnotation(Expression value) {
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- return this.annotation((ArrayInitializer) value);
- }
- return (this.index == 0) ? this.annotationValue(value) : null;
- }
-
- @Override
- protected Expression buildNewInnerExpression(Annotation inner) {
- return (this.index == 0) ? inner : (Expression) this.buildNewInnerArrayInitializer(inner);
- }
-
- @Override
- protected boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value) {
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- this.removeAnnotation(declaration, outer, (ArrayInitializer) value);
- return true;
- }
- // if our index is greater than zero, but we don't have an array,
- // then the annotation must already be gone
- return (this.index != 0);
- }
-
- /**
- * <pre>
- * &#64;Outer({&#64;Inner(0), &#64;Inner(1)}) => &#64;Outer({&#64;Inner(0), &#64;Inner(1), &#64;Inner(2)})
- * or
- * &#64;Outer("lorem ipsum") => &#64;Outer(&#64;Inner(0))
- * or
- * &#64;Outer(&#64;Inner(0)) => &#64;Outer({&#64;Inner(0), &#64;Inner(1)})
- * </pre>
- */
- @Override
- protected void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner) {
- this.modifyExpression(outer, SINGLE_MEMBER_ANNOTATION_EXPRESSION_PROVIDER, inner);
- }
-
- /**
- * <pre>
- * &#64;Outer(text="lorem ipsum") => &#64;Outer(text="lorem ipsum", foo=&#64;Inner(0))
- * or
- * &#64;Outer(foo={&#64;Inner(0), &#64;Inner(1)}) => &#64;Outer(foo={&#64;Inner(0), &#64;Inner(1), &#64;Inner(2)})
- * or
- * &#64;Outer(foo="lorem ipsum") => &#64;Outer(foo=&#64;Inner(0))
- * or
- * &#64;Outer(foo=&#64;NotInner) => &#64;Outer(foo=&#64;Inner(0))
- * or
- * &#64;Outer(foo=&#64;Inner(0)) => &#64;Outer(foo={&#64;Inner(0), &#64;Inner(1)})
- * </pre>
- */
- @Override
- protected void modifyMemberValuePair(MemberValuePair pair, Annotation inner) {
- this.modifyExpression(pair, MEMBER_VALUE_PAIR_EXPRESSION_PROVIDER, inner);
- }
-
-
- // ********** IndexedDeclarationAnnotationAdapter implementation **********
-
- public int getIndex() {
- return this.index;
- }
-
- /**
- * Move the annotation to the specified index, leaving its original
- * position cleared out.
- */
- public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) {
- int oldIndex = this.index;
- if (newIndex == oldIndex) {
- return;
- }
-
- Annotation original = this.getAnnotation(declaration);
- if (original == null) {
- this.index = newIndex;
- this.removeAnnotation(declaration); // clear out the new location (?)
- } else {
- Annotation copy = (Annotation) ASTNode.copySubtree(original.getAST(), original);
- this.index = newIndex;
- this.addAnnotation(declaration, copy); // install the copy in the new location
- this.index = oldIndex;
- this.removeAnnotation(declaration); // go back and clear out the original location (AFTER the move)
- this.index = newIndex;
- }
- }
-
-
- // ********** internal methods **********
-
- /**
- * Return the adapter's annotation from the specified array initializer.
- */
- private Annotation annotation(ArrayInitializer value) {
- List<Expression> expressions = this.expressions(value);
- return (this.index >= expressions.size()) ? null : this.annotationValue(expressions.get(this.index));
- }
-
- /**
- * Build a new array initializer to hold the specified annotation,
- * padding it with 'null' literals as necessary
- */
- private ArrayInitializer buildNewInnerArrayInitializer(Annotation inner) {
- ArrayInitializer ai = inner.getAST().newArrayInitializer();
- this.addInnerToExpressions(inner, this.expressions(ai));
- return ai;
- }
-
- /**
- * Add the specified annotation to the specified array initializer,
- * padding it with 'null' literals as necessary
- */
- private void addInnerToExpressions(Annotation inner, List<Expression> expressions) {
- if (expressions.size() > this.index) {
- throw new IllegalStateException("expressions size is greater than index (size: " + expressions.size() + " index: " + this.index + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- while (expressions.size() < this.index) {
- expressions.add(inner.getAST().newNullLiteral());
- }
- expressions.add(inner);
- }
-
- /**
- * Remove the adapter's annotation from the specified array initializer.
- */
- private void removeAnnotation(ModifiedDeclaration declaration, Annotation outer, ArrayInitializer value) {
- List<Expression> expressions = this.expressions(value);
- if (this.index >= expressions.size()) {
- return; // avoid IndexOutOfBoundsException(?)
- }
- Annotation inner = this.annotationValue(expressions.get(this.index));
- if (inner == null) {
- return;
- }
- if ( ! this.nameMatches(declaration, inner)) {
- return;
- }
- if (this.index == (expressions.size() - 1)) {
- expressions.remove(this.index);
- } else {
- expressions.set(this.index, value.getAST().newNullLiteral());
- }
- this.trimExpressions(declaration, outer, expressions);
- }
-
- /**
- * Strip all the null literals off the end of the specified list of expressions
- * and normalize the specified outer annotation.
- */
- private void trimExpressions(ModifiedDeclaration declaration, Annotation outer, List<Expression> expressions) {
- // start at the end of the list
- for (int i = expressions.size(); i-- > 0; ) {
- if (expressions.get(i).getNodeType() == ASTNode.NULL_LITERAL) {
- expressions.remove(i);
- } else {
- break; // stop with the first non-null literal encountered
- }
- }
- switch (expressions.size()) {
- case 0:
- this.removeElementAndNormalize(declaration, outer);
- break;
- case 1:
- this.convertArrayToLastRemainingExpression(outer, expressions.get(0));
- break;
- default:
- break;
- }
- }
-
- /**
- * When there is only a single element in an array initializer, convert the
- * expression to be just the single element; e.g.
- * <pre>
- * &#64;Foo(xxx={"abc"}) => &#64;Foo(xxx="abc")
- * or
- * &#64;Foo({"abc"}) => &#64;Foo("abc")
- * </pre>
- */
- private void convertArrayToLastRemainingExpression(Annotation outer, Expression lastValue) {
- lastValue = (Expression) ASTNode.copySubtree(lastValue.getAST(), lastValue);
- if (outer.isNormalAnnotation()) {
- this.memberValuePair((NormalAnnotation) outer).setValue(lastValue);
- } else if (outer.isSingleMemberAnnotation()) {
- ((SingleMemberAnnotation) outer).setValue(lastValue);
- } else {
- throw new IllegalArgumentException("unexpected annotation type: " + outer); //$NON-NLS-1$
- }
- }
-
- /**
- * Manipulate the specified expression appropriately.
- * If it is an array initializer, add the specified annotation to it.
- * If it is not, replace the expression or convert it into an array
- * initializer.
- */
- private void modifyExpression(ASTNode node, ExpressionProvider expProvider, Annotation inner) {
- Expression value = expProvider.getExpression(node);
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- // ignore the other entries in the array initializer(?) - they may not be matching Annotations...
- List<Expression> expressions = this.expressions((ArrayInitializer) value);
- if (this.index >= expressions.size()) {
- this.addInnerToExpressions(inner, expressions);
- } else {
- expressions.set(this.index, inner);
- }
- } else {
- if (this.index == 0) {
- // replace whatever was there before
- expProvider.setExpression(node, inner);
- } else {
- // convert to an array
- ArrayInitializer ai = inner.getAST().newArrayInitializer();
- List<Expression> expressions = this.expressions(ai);
- expressions.add((Expression) ASTNode.copySubtree(value.getAST(), value));
- this.addInnerToExpressions(inner, expressions);
- expProvider.setExpression(node, ai);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- protected List<Expression> expressions(ArrayInitializer ai) {
- return ai.expressions();
- }
-
-
- // ********** expression providers **********
-
- /**
- * define interface that allows us to "re-use" the code in
- * #modifyExpression(ASTNode, ExpressionProvider, Annotation)
- */
- private interface ExpressionProvider {
- Expression getExpression(ASTNode node);
- void setExpression(ASTNode node, Expression expression);
- }
-
- private static final ExpressionProvider MEMBER_VALUE_PAIR_EXPRESSION_PROVIDER = new ExpressionProvider() {
- public Expression getExpression(ASTNode node) {
- return ((MemberValuePair) node).getValue();
- }
- public void setExpression(ASTNode node, Expression expression) {
- ((MemberValuePair) node).setValue(expression);
- }
- @Override
- public String toString() {
- return "MemberValuePairExpressionProvider"; //$NON-NLS-1$
- }
- };
-
- private static final ExpressionProvider SINGLE_MEMBER_ANNOTATION_EXPRESSION_PROVIDER = new ExpressionProvider() {
- public Expression getExpression(ASTNode node) {
- return ((SingleMemberAnnotation) node).getValue();
- }
- public void setExpression(ASTNode node, Expression expression) {
- ((SingleMemberAnnotation) node).setValue(expression);
- }
- @Override
- public String toString() {
- return "SingleMemberAnnotationExpressionProvider"; //$NON-NLS-1$
- }
- };
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullAnnotationEditFormatter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullAnnotationEditFormatter.java
deleted file mode 100644
index 284e9379b4..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullAnnotationEditFormatter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-public final class NullAnnotationEditFormatter
- implements AnnotationEditFormatter
-{
-
- private static final NullAnnotationEditFormatter INSTANCE = new NullAnnotationEditFormatter();
-
- /**
- * Return the singleton.
- */
- public static AnnotationEditFormatter instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullAnnotationEditFormatter() {
- super();
- }
-
- public void format(IDocument doc, TextEdit editTree) throws MalformedTreeException, BadLocationException {
- // no formatting
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationAdapter.java
deleted file mode 100644
index c9fe2d94e4..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Behaviorless implementation.
- */
-public final class NullDeclarationAnnotationAdapter
- implements IndexedDeclarationAnnotationAdapter
-{
-
- // singleton
- private static final NullDeclarationAnnotationAdapter INSTANCE = new NullDeclarationAnnotationAdapter();
-
- /**
- * Return the singleton.
- */
- public static IndexedDeclarationAnnotationAdapter instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullDeclarationAnnotationAdapter() {
- super();
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public void removeAnnotation(ModifiedDeclaration declaration) {
- // do nothing
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- return declaration.getDeclaration();
- }
-
-
- // ********** IndexedDeclarationAnnotationAdapter implementation **********
-
- public int getIndex() {
- return -1;
- }
-
- public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) {
- // do nothing
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index dd3e616a2d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Behaviorless implementation.
- */
-public class NullDeclarationAnnotationElementAdapter<T>
- implements DeclarationAnnotationElementAdapter<T>
-{
-
- // singleton
- @SuppressWarnings("rawtypes")
- private static final DeclarationAnnotationElementAdapter INSTANCE
- = new NullDeclarationAnnotationElementAdapter();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <S> DeclarationAnnotationElementAdapter<S> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullDeclarationAnnotationElementAdapter() {
- super();
- }
-
- public T getValue(ModifiedDeclaration declaration) {
- return null;
- }
-
- public void setValue(T value, ModifiedDeclaration declaration) {
- // do nothing
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- return declaration.getDeclaration();
- }
-
- public Expression getExpression(ModifiedDeclaration declaration) {
- return null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullExpressionConverter.java
deleted file mode 100644
index 8245a74a34..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NullExpressionConverter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * No conversion.
- */
-public final class NullExpressionConverter
- implements ExpressionConverter<Expression>
-{
-
- // singleton
- private static final ExpressionConverter<Expression> INSTANCE = new NullExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<Expression> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullExpressionConverter() {
- super();
- }
-
- public Expression convert(Expression expression, AST ast) {
- return expression;
- }
-
- public Expression convert(Expression expression) {
- return expression;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NumberIntegerExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NumberIntegerExpressionConverter.java
deleted file mode 100644
index 775d2d705a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/NumberIntegerExpressionConverter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a number literal to/from an Integer
- * (e.g. 5).
- */
-public final class NumberIntegerExpressionConverter
- extends AbstractExpressionConverter<Integer>
-{
- private static final ExpressionConverter<Integer> INSTANCE = new NumberIntegerExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<Integer> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NumberIntegerExpressionConverter() {
- super();
- }
-
- @Override
- protected NumberLiteral convertObject(Integer integer, AST ast) {
- return ast.newNumberLiteral(integer.toString());
- }
-
- @Override
- protected Integer convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof Integer) ? ((Integer) value) : null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/PrimitiveTypeStringExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/PrimitiveTypeStringExpressionConverter.java
deleted file mode 100644
index 7b17501e51..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/PrimitiveTypeStringExpressionConverter.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a type literal to/from a string representation of a primitive type
- * (e.g. "int").
- */
-public final class PrimitiveTypeStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new PrimitiveTypeStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PrimitiveTypeStringExpressionConverter() {
- super();
- }
-
- @Override
- protected TypeLiteral convertObject(String string, AST ast) {
- org.eclipse.jdt.core.dom.Type type = ast.newPrimitiveType(PrimitiveType.toCode(string));
- TypeLiteral typeLiteral = ast.newTypeLiteral();
- typeLiteral.setType(type);
- return typeLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- org.eclipse.jdt.core.dom.Type type = ((TypeLiteral) expression).getType();
- if (type.getNodeType() == ASTNode.PRIMITIVE_TYPE) {
- return ((PrimitiveType) type).getPrimitiveTypeCode().toString();
- }
- }
- return null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java
deleted file mode 100644
index c9ee5748c8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Wrap another annotation element adapter and short-circuit the
- * #setValue method if the value has not changed.
- */
-public class ShortCircuitAnnotationElementAdapter<T>
- implements AnnotationElementAdapter<T>
-{
- /** the wrapped adapter */
- private final AnnotationElementAdapter<T> adapter;
-
-
- // ********** constructor **********
-
- public ShortCircuitAnnotationElementAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationElementAdapter<T> daea) {
- this(new AnnotatedElementAnnotationElementAdapter<T>(annotatedElement, daea));
- }
-
- public ShortCircuitAnnotationElementAdapter(AnnotationElementAdapter<T> adapter) {
- super();
- this.adapter = adapter;
- }
-
-
- // ********** AnnotationElementAdapter implementation **********
-
- public T getValue() {
- return this.adapter.getValue();
- }
-
- public T getValue(CompilationUnit astRoot) {
- return this.adapter.getValue(astRoot);
- }
-
- public void setValue(T value) {
- this.setValue(this.adapter.getValue(), value);
- }
-
- public Expression getExpression(CompilationUnit astRoot) {
- return this.adapter.getExpression(astRoot);
- }
-
- public ASTNode getAstNode(CompilationUnit astRoot) {
- return this.adapter.getAstNode(astRoot);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.adapter);
- }
-
-
- // ********** internal methods **********
-
- /**
- * set the adapter's value to the specified new value if it
- * is different from the specified old value
- */
- protected void setValue(T oldValue, T newValue) {
- if (oldValue == null) {
- if (newValue == null) { // null => null
- // do nothing
- } else { // null => object
- this.adapter.setValue(newValue);
- }
- } else {
- if (newValue == null) { // object => null
- this.adapter.setValue(null);
- } else { // object => object
- if (this.valuesAreEqual(oldValue, newValue)) {
- // do nothing
- } else {
- this.adapter.setValue(newValue);
- }
- }
- }
- }
-
- /**
- * both values are non-null when this method is called
- */
- protected boolean valuesAreEqual(T oldValue, T newValue) {
- return newValue.equals(oldValue);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java
deleted file mode 100644
index 0676bc2840..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.Arrays;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * Wrap another annotation element adapter and short-circuit the
- * #setValue method if the value has not changed. Overrides #valuesAreEqual()
- * to check equality on arrays
- */
-public class ShortCircuitArrayAnnotationElementAdapter<T>
- extends ShortCircuitAnnotationElementAdapter<T[]>
-{
- // ********** constructor **********
-
- public ShortCircuitArrayAnnotationElementAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationElementAdapter<T[]> daea) {
- super(annotatedElement, daea);
- }
-
- public ShortCircuitArrayAnnotationElementAdapter(AnnotationElementAdapter<T[]> adapter) {
- super(adapter);
- }
-
-
- // ********** AnnotationElementAdapter implementation **********
-
- @Override
- protected boolean valuesAreEqual(T[] oldValue, T[] newValue) {
- return Arrays.equals(newValue, oldValue);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleDeclarationAnnotationAdapter.java
deleted file mode 100644
index 195dc197ec..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Manipulate an annotation with a specific name, e.g.
- * <pre>
- * &#64;Foo
- * private int id;
- * </pre>
- *
- * NB:
- * If the declaration contains more than one annotation with the same
- * name, the adapter will correspond to the first annotation with the specified
- * name. (Also note that the compiler will not allow a declaration to be
- * modified by multiple annotations with the same name, i.e. of the same type;
- * so if there *are* multiple annotations of the same type, there are bigger
- * problems to worry about than which annotation the adapter manipulates.)
- */
-public class SimpleDeclarationAnnotationAdapter extends AbstractDeclarationAnnotationAdapter {
-
-
- // ********** constructors **********
-
- public SimpleDeclarationAnnotationAdapter(String annotationName) {
- super(annotationName);
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(this.getAnnotationName());
- }
-
- public void removeAnnotation(ModifiedDeclaration declaration) {
- declaration.removeAnnotationNamed(this.getAnnotationName());
- }
-
- @Override
- protected void addAnnotation(ModifiedDeclaration declaration, Annotation annotation) {
- declaration.replaceAnnotationNamed(this.getAnnotationName(), annotation);
- }
-
- public ASTNode getAstNode(ModifiedDeclaration declaration) {
- // if the annotation is missing, return the declaration
- Annotation annotation = this.getAnnotation(declaration);
- return (annotation != null) ? annotation : declaration.getDeclaration();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleTypeStringExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleTypeStringExpressionConverter.java
deleted file mode 100644
index 156dc5fa73..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/SimpleTypeStringExpressionConverter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.SimpleType;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a type literal to/from a string representation of a simple type
- * (e.g. "java.lang.Object").
- */
-public final class SimpleTypeStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new SimpleTypeStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SimpleTypeStringExpressionConverter() {
- super();
- }
-
- @Override
- protected TypeLiteral convertObject(String string, AST ast) {
- Name name = ast.newName(string);
- org.eclipse.jdt.core.dom.Type type = ast.newSimpleType(name);
- TypeLiteral typeLiteral = ast.newTypeLiteral();
- typeLiteral.setType(type);
- return typeLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- org.eclipse.jdt.core.dom.Type type = ((TypeLiteral) expression).getType();
- if (type.getNodeType() == ASTNode.SIMPLE_TYPE) {
- return ((SimpleType) type).getName().getFullyQualifiedName();
- }
- }
- return null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringArrayExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringArrayExpressionConverter.java
deleted file mode 100644
index 91ee6cfa24..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringArrayExpressionConverter.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Convert an array initializer to/from an array of strings (e.g. {"text0", "text1"}).
- *
- * Do NOT use this class for converting array initializers in annotation elements.
- * Java5 has a bit of syntactic sugar that allows a single-element array
- * initializer to not have curly braces. This converter will return null if it encounters
- * anything other than an array initializer.
- *
- * Invalid entries in the array initializer will result in null elements in the
- * resulting string array. This allows clients to manipulate elements at
- * the appropriate index.
- */
-public class StringArrayExpressionConverter
- extends AbstractExpressionConverter<String[]>
- implements IndexedExpressionConverter<String> {
-
- private final ExpressionConverter<String> elementConverter;
- private final boolean removeArrayInitializerWhenEmpty;
-
-
- /**
- * The default behavior is to remove the array initializer if it is empty.
- */
- public StringArrayExpressionConverter(ExpressionConverter<String> elementConverter) {
- this(elementConverter, true);
- }
-
- public StringArrayExpressionConverter(ExpressionConverter<String> elementConverter, boolean removeArrayInitializerWhenEmpty) {
- super();
- this.elementConverter = elementConverter;
- this.removeArrayInitializerWhenEmpty = removeArrayInitializerWhenEmpty;
- }
-
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- @Override
- public ArrayInitializer convertObject(String[] strings, AST ast) {
- if ((strings.length == 0) && this.removeArrayInitializerWhenEmpty) {
- return null;
- }
- ArrayInitializer arrayInitializer = ast.newArrayInitializer();
- List<Expression> expressions = this.expressions(arrayInitializer);
- for (String string : strings) {
- expressions.add(this.elementConverter.convert(string, ast));
- }
- return arrayInitializer;
- }
-
- @SuppressWarnings("unchecked")
- private List<Expression> expressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- @Override
- public String[] convertNull() {
- return StringTools.EMPTY_STRING_ARRAY;
- }
-
- @Override
- protected String[] convertExpression(Expression expression) {
- return (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) ?
- this.convertArrayInitializer((ArrayInitializer) expression) :
- StringTools.EMPTY_STRING_ARRAY;
- }
-
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- public String[] convertArrayInitializer(ArrayInitializer arrayInitializer) {
- List<Expression> expressions = this.expressions(arrayInitializer);
- int len = expressions.size();
- String[] strings = new String[len];
- for (int i = len; i-- > 0; ) {
- strings[i] = this.elementConverter.convert(expressions.get(i));
- }
- return strings;
- }
-
- public Expression getSubexpression(int index, Expression expression) {
- if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- return expressions((ArrayInitializer) expression).get(index);
- }
- throw new ArrayIndexOutOfBoundsException();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringExpressionConverter.java
deleted file mode 100644
index f0e88b5331..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/StringExpressionConverter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a string literal to/from a string (e.g. "text").
- */
-public final class StringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new StringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private StringExpressionConverter() {
- super();
- }
-
- @Override
- protected StringLiteral convertObject(String string, AST ast) {
- StringLiteral stringLiteral = ast.newStringLiteral();
- stringLiteral.setLiteralValue(string);
- return stringLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof String) ? (String) value : null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/TypeStringExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/TypeStringExpressionConverter.java
deleted file mode 100644
index 3ed1b74189..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/TypeStringExpressionConverter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-
-/**
- * Convert a type literal to/from a string representation of a
- * simple type (e.g. "java.lang.Object") or primitive type (e.g. "int").
- */
-public final class TypeStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new TypeStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TypeStringExpressionConverter() {
- super();
- }
-
- @Override
- protected TypeLiteral convertObject(String string, AST ast) {
- if (PrimitiveType.toCode(string) != null) {
- return (TypeLiteral) PrimitiveTypeStringExpressionConverter.instance().convert(string, ast);
- }
- return (TypeLiteral) SimpleTypeStringExpressionConverter.instance().convert(string, ast);
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- String name = SimpleTypeStringExpressionConverter.instance().convert(expression);
- return name != null ? name : PrimitiveTypeStringExpressionConverter.instance().convert(expression);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/BooleanTranslator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/BooleanTranslator.java
deleted file mode 100644
index 7f2825c1a3..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/BooleanTranslator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class BooleanTranslator
- extends Translator
-{
- public BooleanTranslator(String domPathAndNames, EStructuralFeature structuralFeature) {
- super(domPathAndNames, structuralFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE);
- }
-
- public BooleanTranslator(String domPathAndNames, EStructuralFeature structuralFeature, int style) {
- super(domPathAndNames, structuralFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE | style);
- }
-
- @Override
- public Object convertStringToValue(String string, EObject owner) {
- return Boolean.valueOf(string);
- }
-
- @Override
- public String convertValueToString(Object value, EObject owner) {
- return ((Boolean) value).toString();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EmptyTagBooleanTranslator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EmptyTagBooleanTranslator.java
deleted file mode 100644
index 1d94705cca..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EmptyTagBooleanTranslator.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * This translator is to be used for empty xml tags that correspond
- * to a boolean attribute in the emf model.
- * cascade-persist is an example from the orm.xsd:
- *
- * <persistence-unit-defaults>
- * <cascade-persist/>
- * </persistence-unit-defaults> ==> cascadePersist == true
- *
- * vs.
- *
- * <persistence-unit-defaults>
- * </persistence-unit-defaults> ==> cascadePersist == false
- *
- */
-public class EmptyTagBooleanTranslator
- extends Translator
-{
- public EmptyTagBooleanTranslator(String domPathAndNames, EStructuralFeature structuralFeature) {
- this(domPathAndNames, structuralFeature, NO_STYLE);
- }
-
- public EmptyTagBooleanTranslator(String domPathAndNames, EStructuralFeature structuralFeature, int style) {
- super(domPathAndNames, structuralFeature, style | EMPTY_TAG | BOOLEAN_FEATURE);
- }
-
- @Override
- public Object getMOFValue(EObject mofObject) {
- // I am overriding this method. This is so the tag will be removed when
- // the value is false.
- // I'm not sure if this is a bug in the ecore or maybe in the translators,
- // but I really don't think that we should have to depend on the boolean
- // being "unset" to remove the tag.
- Boolean value = (Boolean) super.getMOFValue(mofObject);
- return (value == null) ? null : value.booleanValue() ? value : null;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EnumeratedValueTranslator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EnumeratedValueTranslator.java
deleted file mode 100644
index fc74b4a730..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/EnumeratedValueTranslator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public abstract class EnumeratedValueTranslator
- extends Translator
-{
- public EnumeratedValueTranslator(String domPathAndNames, EStructuralFeature structuralFeature) {
- super(domPathAndNames, structuralFeature);
- }
-
- public EnumeratedValueTranslator(String domPathAndNames, EStructuralFeature structuralFeature, int style) {
- super(domPathAndNames, structuralFeature, style);
- }
-
-
- protected abstract Iterable<?> getEnumeratedObjectValues();
-
- @Override
- public Object convertStringToValue(String string, EObject owner) {
- for (Object each : getEnumeratedObjectValues()) {
- if (each.toString().equals(string)) {
- return each;
- }
- }
- return null;
- }
-
- @Override
- public String convertValueToString(Object value, EObject owner) {
- return value.toString();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleRootTranslator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleRootTranslator.java
deleted file mode 100644
index 08c20d3b1d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleRootTranslator.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.translators;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.wst.common.internal.emf.resource.RootTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * Root translator that contains a list of child translators and no special
- * behavior.
- */
-public class SimpleRootTranslator
- extends RootTranslator
-{
- protected Translator[] children;
-
- public SimpleRootTranslator(String domPathAndNames, EClass eClass) {
- super(domPathAndNames, eClass);
- }
-
- public SimpleRootTranslator(String domPathAndNames, EClass eClass, Translator[] children) {
- super(domPathAndNames, eClass);
- this.children = children;
- }
-
- /**
- * Widen method access to 'public'.
- */
- @Override
- public Translator[] getChildren() {
- return this.children;
- }
-
- protected Translator[] getChildren_() {
- return (this.children == null) ? EMPTY_TRANSLATOR_ARRAY : this.children;
- }
- protected static final Translator[] EMPTY_TRANSLATOR_ARRAY = new Translator[0];
-
- /**
- * Set the translator's children.
- * Return the translator.
- */
- public void setChildren(Translator[] children) {
- this.children = children;
- }
-
- /**
- * Add the specified translator to the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleRootTranslator addChild(Translator translator) {
- this.children = ArrayTools.add(this.getChildren_(), translator);
- return this;
- }
-
- /**
- * Add the specified translators to the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleRootTranslator addChildren(Translator[] translators) {
- this.children = ArrayTools.addAll(this.getChildren_(), translators);
- return this;
- }
-
- /**
- * Remove the specified translator from the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleRootTranslator removeChild(Translator translator) {
- this.children = ArrayTools.remove(this.children, translator);
- return this;
- }
-
- /**
- * Remove the specified translators from the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleRootTranslator removeChildren(Translator[] translators) {
- this.children = ArrayTools.removeAll(this.children, (Object[]) translators);
- return this;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleTranslator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleTranslator.java
deleted file mode 100644
index 20db025e8a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/translators/SimpleTranslator.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.internal.utility.translators;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorPath;
-
-/**
- * Translator that contains a list of child translators and no special
- * behavior.
- */
-public class SimpleTranslator
- extends Translator
-{
- protected Translator[] children;
-
-
- // ********** constructors **********
-
- public SimpleTranslator(String domPathAndNames, EClass eClass) {
- super(domPathAndNames, eClass);
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature) {
- super(domPathAndNames, eStructuralFeature);
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature, Translator[] children) {
- super(domPathAndNames, eStructuralFeature);
- this.children = children;
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature, EClass eClass) {
- super(domPathAndNames, eStructuralFeature, eClass);
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature, EClass eClass, Translator[] children) {
- super(domPathAndNames, eStructuralFeature, eClass);
- this.children = children;
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature, TranslatorPath translatorPath) {
- super(domPathAndNames, eStructuralFeature, translatorPath);
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature, TranslatorPath[] translatorPaths) {
- super(domPathAndNames, eStructuralFeature, translatorPaths);
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature, int style) {
- super(domPathAndNames, eStructuralFeature, style);
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature aFeature, int style, EClass eClass, Translator[] children) {
- this(domPathAndNames, aFeature, style);
- setEMFClass(eClass);
- this.children = children;
- }
-
- public SimpleTranslator(String domPathAndNames, EStructuralFeature eStructuralFeature, int style, Translator[] children) {
- super(domPathAndNames, eStructuralFeature, style);
- this.children = children;
- }
-
-
- // ********** children **********
-
- /**
- * Widen method access to 'public'.
- */
- @Override
- public Translator[] getChildren() {
- return this.children;
- }
-
- protected Translator[] getChildren_() {
- return (this.children == null) ? EMPTY_TRANSLATOR_ARRAY : this.children;
- }
- protected static final Translator[] EMPTY_TRANSLATOR_ARRAY = new Translator[0];
-
- /**
- * Set the translator's children.
- * Return the translator.
- */
- public void setChildren(Translator[] children) {
- this.children = children;
- }
-
- /**
- * Add the specified translator to the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleTranslator addChild(Translator translator) {
- this.children = ArrayTools.add(this.getChildren_(), translator);
- return this;
- }
-
- /**
- * Add the specified translators to the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleTranslator addChildren(Translator[] translators) {
- this.children = ArrayTools.addAll(this.getChildren_(), translators);
- return this;
- }
-
- /**
- * Remove the specified translator from the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleTranslator removeChild(Translator translator) {
- this.children = ArrayTools.remove(this.children, translator);
- return this;
- }
-
- /**
- * Remove the specified translators from the translator's list of children.
- * Return the translator for method chaining.
- */
- public SimpleTranslator removeChildren(Translator[] translators) {
- this.children = ArrayTools.removeAll(this.children, (Object[]) translators);
- return this;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libprov/JptLibraryProviderInstallOperationConfig.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libprov/JptLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 3e524487f7..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libprov/JptLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.libprov;
-
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JptLibraryProviderInstallOperationConfig {
-
- IFacetedProjectBase getFacetedProject();
-
- ILibraryProvider getLibraryProvider();
-
- IProjectFacetVersion getProjectFacetVersion();
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libval/LibraryValidator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libval/LibraryValidator.java
deleted file mode 100644
index af15c438ce..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/libval/LibraryValidator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.libval;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-
-/**
- * Interface for extender-supplied library validators.
- * Each library validator must have a zero-arg constructor.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface LibraryValidator {
-
- IStatus validate(JptLibraryProviderInstallOperationConfig config);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/ResourceLocator.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/ResourceLocator.java
deleted file mode 100644
index 491608c147..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/ResourceLocator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.resource;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface ResourceLocator {
-
- /**
- * Return whether the given container is an acceptable (non-java) resource
- * location for the given project
- */
- boolean acceptResourceLocation(IProject project, IContainer container);
-
- /**
- * Return the default location in which to create new (non-java) resources
- */
- IContainer getDefaultResourceLocation(IProject project);
-
- /**
- * Return the workspace relative absolute resource path best represented by the given
- * runtime path for the given project
- */
- IPath getResourcePath(IProject project, IPath runtimePath);
-
- /**
- * Return the runtime path best represented by the given workspace relative absolute
- * resource path for the given project
- */
- IPath getRuntimePath(IProject project, IPath resourcePath);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/Annotation.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/Annotation.java
deleted file mode 100644
index a4cd5e0352..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/Annotation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Common Java resource annotation behavior
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface Annotation
- extends JavaResourceNode
-{
- /**
- * Return the annotation's fully qualified name, as opposed to the value of
- * the annotation's 'name' element. For example:
- * @com.foo.Bar(name="Thomas")
- * #getAnnotationName() will return "com.foo.Bar".
- * In typical subclasses, #getName() would return "Thomas".
- */
- String getAnnotationName();
-
- /**
- * Return the corresponding JDT DOM annotation from the specified
- * AST compilation unit.
- */
- org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot);
-
- /**
- * Create and add the corresponding Java annotation to the JDT DOM.
- */
- void newAnnotation();
-
- /**
- * Remove the corresponding Java annotation from the JDT DOM.
- */
- void removeAnnotation();
-
- /**
- * Return whether all the annotation's member values are <code>null</code>;
- * implying the annotation can be removed if it has no semantic value as a
- * marker annotation.
- */
- boolean isUnset();
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/AnnotationDefinition.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/AnnotationDefinition.java
deleted file mode 100644
index 9df453ed8a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/AnnotationDefinition.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-
-/**
- * Used to build Annotations discovered in the Java source code.
- * To provide new AnnotationDefinitions, create a new JaxbPlatform
- * by implementing JaxbPlatformDefinition.
- *
- * @see Annotation
- * @see org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface AnnotationDefinition
-{
- /**
- * Return the name of the annotation the definition will build in the
- * various #build...(...) methods.
- */
- String getAnnotationName();
-
- /**
- * Build and return an annotation for the specified annotated element.
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement);
-
- /**
- * Build and return an annotation for the specified JDT annotation
- * on the specified annotated element.
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation);
-
- /**
- * Build and return a "null" annotation for the specified annotated element.
- * Only certain annotations are required to have "null" implementations;
- * typically the annotations with reasonably complex default behavior.
- * The "null" annotation is used by the corresponding default context model.
- * The "null" annotation simplifies the context model code, allowing the
- * context model to simply set various bits of state (e.g. 'name') and the
- * "null" annotation will create a new "real" annotation and forward the
- * new state to it. This reduces the number of null checks in the context
- * model (hopefully).
- */
- Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAbstractType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAbstractType.java
deleted file mode 100644
index c228a6e8c6..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAbstractType.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-
-/**
- * Java source code or binary type. This corresponds to a {@link AbstractTypeDeclaration}
- * (which is why the name is somewhat wonky.)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceAbstractType
- extends JavaResourceMember {
-
- /**
- * Property change String for the unqualified (short) type name.
- * @see JavaResourceMember#getName()
- */
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified type name.
- */
- String getQualifiedName();
- String QUALIFIED_NAME_PROPERTY = "qualifiedName"; //$NON-NLS-1$
-
- /**
- * Return the package name.
- */
- String getPackageName();
- String PACKAGE_NAME_PROPERTY = "packageName"; //$NON-NLS-1$
-
- /**
- * Return the name of the type's "declaring type".
- * Return <code>null</code> if the type is a top-level type.
- */
- String getDeclaringTypeName();
- String DECLARING_TYPE_NAME_PROPERTY = "declaringTypeName"; //$NON-NLS-1$
-
- /**
- * Return whether the type is a member type.
- */
- boolean isMemberType();
- String MEMBER_TYPE_PROPERTY = "memberType"; //$NON-NLS-1$
-
- boolean isIn(IPackageFragment packageFragment);
-
- boolean isIn(IPackageFragmentRoot sourceFolder);
-
-
- /**
- * Return the immediately nested types (classes or interfaces, not enums or annotations) (children).
- */
- Iterable<JavaResourceType> getTypes();
- String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Return all the types; the type itself, its children, its grandchildren,
- * etc.
- */
- Iterable<JavaResourceType> getAllTypes();
-
- /**
- * Return the immediately nested enums (children).
- */
- Iterable<JavaResourceEnum> getEnums();
- String ENUMS_COLLECTION = "enums"; //$NON-NLS-1$
-
- /**
- * Return all the enums; the enum itself, its children, its grandchildren,
- * etc.
- */
- Iterable<JavaResourceEnum> getAllEnums();
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAnnotatedElement.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAnnotatedElement.java
deleted file mode 100644
index e7ec964a50..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAnnotatedElement.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Java source code or binary annotated element.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceAnnotatedElement
- extends JavaResourceNode
-{
- // ********** annotations **********
-
- /**
- * String associated with changes to the "annotations" collection
- */
- String ANNOTATIONS_COLLECTION = "annotations"; //$NON-NLS-1$
-
- /**
- * String associated with changes to the "nestableAnnotations" collection
- */
- String NESTABLE_ANNOTATIONS_COLLECTION = "nestableAnnotations"; //$NON-NLS-1$
-
- /**
- * Return the member's annotations in the order that they appear.
- * Do not return duplicate annotations as this error is handled by the Java
- * compiler.
- */
- Iterable<Annotation> getAnnotations();
-
- /**
- * Return the number of annotations.
- */
- int getAnnotationsSize();
-
- /**
- * Return the annotation with the specified name.
- * Return the first if there are duplicates in the source code.
- */
- Annotation getAnnotation(String annotationName);
-
- /**
- * Return the specified annotation.
- * Return the first if there are duplicates in the source code.
- * Do not return null, but a Null Object instead if no annotation
- * with the specified name exists in the source code.
- */
- Annotation getNonNullAnnotation(String annotationName);
-
- /**
- * Return the nestable annotations with the specified name in the order that
- * they appear.
- * If nestable and container annotations are both specified on the
- * member directly, the behavior is undefined
- */
- // TODO tie the singular and plural annotations together so we can generate
- // a validation error when both are specified
- ListIterable<NestableAnnotation> getAnnotations(String nestableAnnotationName);
-
- /**
- * Return the number of nestable annotations with the specified name.
- * If nestable and container annotations are both specified on the
- * member directly, the behavior is undefined
- */
- int getAnnotationsSize(String nestableAnnotationName);
-
- /**
- * Return the nestable annotation at the specified index with the specified name.
- * If nestable and container annotations are both specified on the
- * member directly, the behavior is undefined
- */
- NestableAnnotation getAnnotation(int index, String nestableAnnotationName);
-
- /**
- * Add an annotation with the specified name.
- * Return the newly-created annotation.
- */
- Annotation addAnnotation(String annotationName);
-
- /**
- * Add a new nestable annotation with the specified name.
- * Create a new container annotation if necessary and add the nestable
- * annotation to it.
- * If both the nestable annotation and the container annotation already
- * exist, then add to the container annotation, leaving the existing
- * nestable annotation alone.
- * If only the nestable annotation exists, then create the new container
- * annotation and move the existing nestable annotation to it along with
- * the new one. If neither annotation exists, then create a new nestable
- * annotation.
- */
- NestableAnnotation addAnnotation(int index, String nestableAnnotationName);
-
- /**
- * Move the nestable annotation at the specified source index to the specified target index.
- */
- void moveAnnotation(int targetIndex, int sourceIndex, String nestableAnnotationName);
-
- /**
- * Remove the specified annotation.
- */
- void removeAnnotation(String annotationName);
-
- /**
- * Remove the specified nestable annotation from the container annotation at the specified
- * index.
- * If there is no container, assume the index is zero and just remove the nestable annotation
- */
- void removeAnnotation(int index, String nestableAnnotationName);
-
-
- // ********** queries **********
-
- /**
- * Return whether the underlying JDT member is currently annotated with any recognized
- * annotations.
- */
- boolean isAnnotated();
-
- /**
- * Return whether the underlying JDT member is annotated with any of the given annotations.
- */
- boolean isAnnotatedWith(Iterable<String> annotationNames);
-
- /**
- * Return the element kind
- */
- Kind getKind();
-
- /**
- * Return the text range for the member's name.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the text range for the nestable annotation if it is currently
- * unnested. If it is nested, return the text range for the corresponding
- * container annotation.
- *
- * @see AnnotationProvider#getContainerAnnotationName(String)
- */
- TextRange getTextRange(String nestableAnnotationName, CompilationUnit astRoot);
-
- /**
- * The kind of java element.
- */
- public enum Kind {
-
- /**
- * Represents an annotatable package.
- * An {@link JavaResourceAnnotatedElement} of {@link Kind} PACKAGE may safely be cast as a
- * {@link JavaResourcePackage}
- */
- PACKAGE(ASTNode.PACKAGE_DECLARATION),
-
- /**
- * Represents a class or interface.
- * An {@link JavaResourceAnnotatedElement} of {@link Kind} TYPE may safely be cast as a
- * {@link JavaResourceType}
- */
- TYPE(ASTNode.TYPE_DECLARATION),
-
- /**
- * Represents an enum.
- * An {@link JavaResourceAnnotatedElement} of {@link Kind} ENUM may safely be cast as a
- * {@link JavaResourceEnum}
- */
- ENUM(ASTNode.ENUM_DECLARATION),
-
- /**
- * Represents a method.
- * An {@link JavaResourceAnnotatedElement} of {@link Kind} METHOD may safely be cast as a
- * {@link JavaResourceMethod}
- */
- METHOD(ASTNode.METHOD_DECLARATION),
-
- /**
- * Represents a type field.
- * An {@link JavaResourceAnnotatedElement} of {@link Kind} FIELD may safely be cast as a
- * {@link JavaResourceField}
- */
- FIELD(ASTNode.FIELD_DECLARATION),
-
- /**
- * Represents an enum constant.
- * An {@link JavaResourceAnnotatedElement} of {@link Kind} ENUM_CONSTANT may safely be cast as a
- * {@link JavaResourceEnumConstant}
- */
- ENUM_CONSTANT(ASTNode.ENUM_CONSTANT_DECLARATION);
-
-
- private int astNodeType;
-
- Kind(int astNodeType) {
- this.astNodeType = astNodeType;
- }
-
- public int getAstNodeType() {
- return this.astNodeType;
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAttribute.java
deleted file mode 100644
index d93fee2041..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceAttribute.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Java source code or binary attribute (field/method)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceAttribute
- extends JavaResourceMember
-{
- JavaResourceType getParent();
-
- JavaResourceType getResourceType();
-
- /**
- * Return whether the attribute's type implements or extends the specified
- * type.
- */
- boolean typeIsSubTypeOf(String typeName);
-
- /**
- * Return whether the attribute's type is a "variable" primitive type
- * (i.e. any primitive type except 'void').
- */
- boolean typeIsVariablePrimitive();
-
- /**
- * @see java.lang.reflect.Modifier
- */
- int getModifiers();
- String MODIFIERS_PROPERTY = "modifiers"; //$NON-NLS-1$
-
- /**
- * Return the resolved, qualified name of the attribute's type
- * (e.g. "java.util.Collection" or "byte[]").
- * If the type is an array, this name will include the appropriate number
- * of bracket pairs.
- * This name will not include the type's generic type arguments
- * (e.g. "java.util.Collection<java.lang.String>" will only return
- * "java.util.Collection").
- * @see #typeTypeArgumentNames()
- */
- String getTypeName();
- String TYPE_NAME_PROPERTY = "typeName"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute type is an interface.
- */
- boolean typeIsInterface();
- String TYPE_IS_INTERFACE_PROPERTY = "typeIsInterface"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute type is an enum.
- */
- boolean typeIsEnum();
- String TYPE_IS_ENUM_PROPERTY = "typeIsEnum"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute type is an array.
- */
- boolean typeIsArray();
- String TYPE_IS_ARRAY_PROPERTY = "typeIsArray"; //$NON-NLS-1$
-
- /**
- * Return the dimensionality of the array, 0 otherwise.
- * (String[][] -> 2, Collection<String> -> 0)
- */
- int getTypeArrayDimensionality();
- String TYPE_ARRAY_DIMENSIONALITY_PROPERTY = "typeArrayDimensionality"; //$NON-NLS-1$
-
- /**
- * Return the component type name of the array, null otherwise.
- * (String[][] -> "java.lang.String", Collection<String> -> null)
- */
- String getTypeArrayComponentTypeName();
- String TYPE_ARRAY_COMPONENT_TYPE_NAME_PROPERTY = "typeArrayComponentTypeName"; //$NON-NLS-1$
-
- /**
- * Return the names of the attribute type's superclasses.
- */
- ListIterable<String> getTypeSuperclassNames();
- String TYPE_SUPERCLASS_NAMES_LIST = "typeSuperclassNames"; //$NON-NLS-1$
-
- /**
- * Return the names of the attribute type's interfaces.
- */
- Iterable<String> getTypeInterfaceNames();
- String TYPE_INTERFACE_NAMES_COLLECTION = "typeInterfaceNames"; //$NON-NLS-1$
-
- /**
- * Return the names of the attribute type's type arguments.
- * The name for any argument that is an array will contain the appropriate
- * number of bracket pairs.
- * The names will not include any further generic type arguments.
- */
- ListIterable<String> getTypeTypeArgumentNames();
- String TYPE_TYPE_ARGUMENT_NAMES_LIST = "typeTypeArgumentNames"; //$NON-NLS-1$
-
- int getTypeTypeArgumentNamesSize();
-
- String getTypeTypeArgumentName(int index);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceClassFile.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceClassFile.java
deleted file mode 100644
index ebda076809..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceClassFile.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-
-
-/**
- * Java class file
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceClassFile
- extends JavaResourceNode
-{
- /**
- * Return the class file's type.
- */
- JavaResourceAbstractType getType();
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceCompilationUnit.java
deleted file mode 100644
index 147f717bb4..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceCompilationUnit.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Dali resource for JDT compilation unit.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceCompilationUnit
- extends JavaResourceNode.Root
-{
- /**
- * Return the corresponding JDT compilation unit.
- */
- ICompilationUnit getCompilationUnit();
-
- /**
- * Return the JPA project's annotation formatter. This is used to make any
- * manipulated annotations reasonably readable after being written to the
- * Java source file.
- */
- AnnotationEditFormatter getAnnotationEditFormatter();
-
- /**
- * This allows the resource model to modify the Java source code on the
- * UI thread when it is executing on another thread.
- */
- CommandExecutor getModifySharedDocumentCommandExecutor();
-
- /**
- * Resolve type information that could be dependent on other files being
- * added/removed.
- */
- void resolveTypes();
-
- /**
- * The primary type of the AST compilation unit, can be null.
- * This is named the same as the compilation unit.
- */
- JavaResourceAbstractType getPrimaryType();
-
- /**
- * Something in Java has changed (typically either the compilation unit's
- * source code or the Java classpath); synchronize the compilation unit's
- * state with the Java source code etc.
- */
- void synchronizeWithJavaSource();
-
- /**
- * Build an AST for the compilation unit with its bindings resolved.
- */
- CompilationUnit buildASTRoot();
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnum.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnum.java
deleted file mode 100644
index 774d95aa5c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnum.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-
-
-/**
- * Java source code or binary enum.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceEnum
- extends JavaResourceAbstractType
-{
-
-
- // ********** enum constants **********
-
- /**
- * Return the enum's enum constants.
- */
- Iterable<JavaResourceEnumConstant> getEnumConstants();
- String ENUM_CONSTANTS_COLLECTION = "enumConstants"; //$NON-NLS-1$
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnumConstant.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnumConstant.java
deleted file mode 100644
index c72c4c43bd..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceEnumConstant.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-/**
- * Java source code or binary enum constant
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceEnumConstant
- extends JavaResourceMember
-{
- /**
- * The Java resource enum constant's name does not change.
- */
- String getName();
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceField.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceField.java
deleted file mode 100644
index 1119f901c9..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceField.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-/**
- * Java source code or binary field
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceField
- extends JavaResourceAttribute
-{
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMember.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMember.java
deleted file mode 100644
index 88062b73e8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMember.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Java source code or binary persistent member.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 2.0
- */
-public interface JavaResourceMember
- extends JavaResourceAnnotatedElement
-{
- String getName();
-
- // ********** annotations **********
-
- /**
- * Sets the specified primary annotation as the first annotation, and removes all known
- * annotations (i.e. does not remove non-persistence annotations) which are not included
- * in the supporting annotations.
- */
- Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames);
-
-
-
- // ********** modifiers **********
-
- /**
- * Return whether the member is final.
- */
- boolean isFinal();
- String FINAL_PROPERTY = "final"; //$NON-NLS-1$
-
- boolean isTransient();
- String TRANSIENT_PROPERTY = "transient"; //$NON-NLS-1$
-
- boolean isPublic();
- String PUBLIC_PROPERTY = "public"; //$NON-NLS-1$
-
- boolean isStatic();
- String STATIC_PROPERTY = "static"; //$NON-NLS-1$
-
-
- // ********** queries **********
-
- /**
- * Return whether the Java resource member is for the specified
- * member.
- */
- boolean isFor(String memberName, int occurrence);
-
-
- // ********** behavior **********
-
- /**
- * Resolve type information that could be dependent on changes elsewhere
- * in the workspace.
- */
- void resolveTypes(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMethod.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMethod.java
deleted file mode 100644
index 8e5ff93244..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceMethod.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Java source code or binary method
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceMethod
- extends JavaResourceAttribute {
-
- // ***** method name *****
-
- /**
- * The Java resource method's name does not change.
- */
- String getMethodName();
-
-
- // ***** parameter type names *****
-
- String PARAMETER_TYPE_NAMES_LIST = "parameterTypeNames"; //$NON-NLS-1$
-
- ListIterable<String> getParameterTypeNames();
-
- String getParameterTypeName(int index);
-
- int getParametersSize();
-
-
- // ***** constructor *****
-
- String CONSTRUCTOR_PROPERTY = "constructor"; //$NON-NLS-1$
-
- boolean isConstructor();
-
-
- // ***** misc *****
-
- /**
- * Return whether the Java resource persistent attribute is for the specified
- * method.
- */
- boolean isFor(MethodSignature methodSignature, int occurrence);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceNode.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceNode.java
deleted file mode 100644
index 21e446ebfd..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceNode.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.model.Model;
-
-/**
- * Common interface for Java resource nodes (source code or binary).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourceNode
- extends Model
-{
- /**
- * Return the node's parent node.
- */
- JavaResourceNode getParent();
-
- /**
- * Return the Eclipse file that contains the Java resource node
- * (typically either a Java source code file or a JAR).
- */
- IFile getFile();
-
- /**
- * Return the root of the Java resource containment hierarchy
- * (typically either a compilation unit or a package fragment root).
- */
- Root getRoot();
-
- /**
- * Return the [source] node's root (the compilation unit).
- */
- // TODO get rid of this method...?
- JavaResourceCompilationUnit getJavaResourceCompilationUnit();
-
- /**
- * Return the [source] node's text range in the compilation unit's file.
- */
- TextRange getTextRange(CompilationUnit astRoot);
-
- /**
- * Initialize the [source] node from the specified AST.
- */
- void initialize(CompilationUnit astRoot);
-
- /**
- * Synchronize the [source] node with the specified AST.
- */
- void synchronizeWith(CompilationUnit astRoot);
-
-
- /**
- * Root of Java resource model containment hierarchy.
- */
- interface Root
- extends JavaResourceNode, JptResourceModel {
-
- /**
- * Return the root's Java resource "abstract" types.
- */
- Iterable<JavaResourceAbstractType> getTypes();
- String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Called (via a hook in change notification) whenever anything in the
- * Java resource model changes. Forwarded to listeners.
- */
- void resourceModelChanged();
-
- /**
- * Return the annotation provider that supplies the annotations found
- * in the Java resource model.
- */
- AnnotationProvider getAnnotationProvider();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackage.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackage.java
deleted file mode 100644
index 471b951473..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackage.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-/**
- * @author Dmitry Geraskov
- *
- * Java source code of package-info
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaResourcePackage
- extends JavaResourceAnnotatedElement {
-
- /**
- * The Java resource persistent package's name.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragment.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragment.java
deleted file mode 100644
index 87ceb27c66..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragment.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-
-
-
-/**
- * Java package fragment
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface JavaResourcePackageFragment
- extends JavaResourceNode
-{
- /**
- * Return the package fragment's class files that contain "annotated" types.
- * Annotated with the annotations we care about,
- * @see AnnotationProvider
- */
- Iterable<JavaResourceClassFile> getClassFiles();
- String CLASS_FILES_COLLECTION = "classFiles"; //$NON-NLS-1$
-
- /**
- * Return the size of the package fragment's class files.
- */
- int getClassFilesSize();
-
- /**
- * Return the package fragment's Java types.
- * This is a convenience method that returns the JavaResourceTypes of the classFiles.
- */
- Iterable<JavaResourceAbstractType> getTypes();
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragmentRoot.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragmentRoot.java
deleted file mode 100644
index 12082c6532..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageFragmentRoot.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-
-/**
- * Java package fragement root
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface JavaResourcePackageFragmentRoot
- extends JavaResourceNode.Root
-{
- /**
- * Return the package fragment root's package fragments.
- */
- Iterable<JavaResourcePackageFragment> getPackageFragments();
- String PACKAGE_FRAGMENTS_COLLECTION = "packageFragments"; //$NON-NLS-1$
-
- /**
- * Return the size of the package fragment root's package fragments.
- */
- int getPackageFragmentsSize();
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageInfoCompilationUnit.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageInfoCompilationUnit.java
deleted file mode 100644
index 9371615344..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourcePackageInfoCompilationUnit.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-/**
- * Dali resource for JDT compilation unit named package-info.java.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaResourcePackageInfoCompilationUnit
- extends JavaResourceCompilationUnit
-{
- JavaResourcePackage getPackage();
- String PACKAGE = "package"; //$NON-NLS-1$
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceType.java
deleted file mode 100644
index fbd1cf6f27..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceType.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-
-/**
- * Java source code or binary class or interface.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 2.0
- */
-public interface JavaResourceType
- extends JavaResourceAbstractType
-{
-
- /**
- * Return the fully qualified name of the type's superclass.
- */
- String getSuperclassQualifiedName();
- String SUPERCLASS_QUALIFIED_NAME_PROPERTY = "superclassQualifiedName"; //$NON-NLS-1$
-
- /**
- * Return whether the type is abstract.
- */
- boolean isAbstract();
- String ABSTRACT_PROPERTY = "abstract"; //$NON-NLS-1$
-
- /**
- * Return whether the type has a no-arg constructor (private, protected, or public)
- */
- boolean hasNoArgConstructor();
- String NO_ARG_CONSTRUCTOR_PROPERTY = "noArgConstructor"; //$NON-NLS-1$
-
- /**
- * Return whether the type has a private no-arg constructor
- */
- boolean hasPrivateNoArgConstructor();
- String PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY = "privateNoArgConstructor"; //$NON-NLS-1$
-
- /**
- * Return whether the type has any field that have relevant annotations
- * on them (which can be used to infer the type's access type).
- */
- boolean hasAnyAnnotatedFields();
-
- /**
- * Return whether the type has any field that have relevant annotations
- * on them (which can be used to infer the type's access type).
- */
- boolean hasAnyAnnotatedMethods();
-
- // ********** fields **********
-
- /**
- * Return the type's fields.
- */
- Iterable<JavaResourceField> getFields();
- String FIELDS_COLLECTION = "fields"; //$NON-NLS-1$
-
-
- // ********** methods **********
-
- /**
- * Return the type's methods. This returns *all* methods from the JDT Type
- */
- Iterable<JavaResourceMethod> getMethods();
- String METHODS_COLLECTION = "methods"; //$NON-NLS-1$
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceTypeCache.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceTypeCache.java
deleted file mode 100644
index 59d5e7e883..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/JavaResourceTypeCache.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IType;
-
-/**
- * Java persistent type cache - used to hold "external" types
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.2
- */
-public interface JavaResourceTypeCache
- extends JavaResourceNode.Root
-{
-
- /**
- * Return the size of the cache's types.
- */
- int getTypesSize();
-
- /**
- * Add a Java resource type for the specified JDT type to the
- * cache. Return the new type.
- */
- JavaResourceAbstractType addType(IType jdtType);
-
- /**
- * Remove all the types associated with the specified JAR file.
- * Return whether any types were removed.
- */
- boolean removeTypes(IFile jarFile);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotation.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotation.java
deleted file mode 100644
index b598cbfa85..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotation.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-/**
- * Interface for dealing with annotations that can be "nested" within other
- * annotations, typically within arrays.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 2.0
- */
-public interface NestableAnnotation
- extends Annotation
-{
- /**
- * Move the annotation to the specified index within its container annotation.
- * This should only be called when the annotation is actually nested.
- */
- void moveAnnotation(int index);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotationDefinition.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotationDefinition.java
deleted file mode 100644
index eb9784f1d0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/resource/java/NestableAnnotationDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-
-/**
- * Used to build NestableAnnotations discovered in the Java source code.
- * To provide new NestableAnnotationDefinitions, create a new JaxbPlatform
- * by implementing JaxbPlatformDefinition.
- *
- * @see NestableAnnotation
- * @see org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface NestableAnnotationDefinition
-{
- /**
- * Return the name of the annotation the definition will build in the
- * various #build...(...) methods.
- */
- String getNestableAnnotationName();
-
- String getContainerAnnotationName();
-
- String getElementName();
-
- /**
- * Build and return an annotation for the specified annotated element.
- */
- NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index);
-
- /**
- * Build and return an annotation for the specified JDT annotation
- * on the specified annotated element.
- */
- NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/AbstractTextRange.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/AbstractTextRange.java
deleted file mode 100644
index 266e65366a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/AbstractTextRange.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility;
-
-import org.eclipse.jpt.common.core.internal.utility.SimpleTextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Partial implementation of text range.
- *
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class AbstractTextRange
- implements TextRange
-{
- protected AbstractTextRange() {
- super();
- }
-
- public boolean includes(int index) {
- return (this.getOffset() <= index) && (index < this.getEnd());
- }
-
- public boolean touches(int index) {
- return (this.getOffset() <= index) && (index <= this.getEnd());
- }
-
- /**
- * The end offset is <em>exclusive</em>, i.e. the element at the end offset
- * is not included in the range.
- */
- protected int getEnd() {
- return this.getOffset() + this.getLength();
- }
-
- public TextRange buildTextRange(int offset, int length, int lineNumber) {
- return ((offset == this.getOffset()) &&
- (length == this.getLength()) &&
- (lineNumber == this.getLineNumber())) ?
- this :
- new SimpleTextRange(offset, length, lineNumber);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof TextRange)) {
- return false;
- }
- TextRange other = (TextRange) o;
- return (other.getOffset() == this.getOffset())
- && (other.getLength() == this.getLength())
- && (other.getLineNumber() == this.getLineNumber());
- }
-
- @Override
- public int hashCode() {
- return this.getOffset() ^ this.getLength() ^ this.getLineNumber();
- }
-
- @Override
- public String toString() {
- String start = String.valueOf(this.getOffset());
- String end = String.valueOf(this.getEnd());
- String line = String.valueOf(this.getLineNumber());
- return StringTools.buildToStringFor(this, start + ", " + end + " [" + line + ']'); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/BodySourceWriter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/BodySourceWriter.java
deleted file mode 100644
index 9aabeebdd5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/BodySourceWriter.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility;
-
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeSet;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.IndentingPrintWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * Extend {@link IndentingPrintWriter} with some methods that facilitate
- * building class source code.
- */
-@SuppressWarnings("nls")
-public class BodySourceWriter
- extends IndentingPrintWriter
-{
- protected final String packageName;
- protected final String className;
- // key = short class name; value = import package
- protected final HashMap<String, ImportPackage> imports = new HashMap<String, ImportPackage>();
-
- public BodySourceWriter(String packageName, String className) {
- super(new StringWriter(2000));
- this.packageName = packageName;
- this.className = className;
- }
-
- public String getSource() {
- return this.out.toString();
- }
-
- public int getLength() {
- return ((StringWriter) this.out).getBuffer().length();
- }
-
- protected void printVisibility(String visibilityModifier) {
- if (visibilityModifier.length() != 0) {
- this.print(visibilityModifier);
- this.print(' ');
- }
- }
-
- public void printAnnotation(String annotationName) {
- this.print('@');
- this.printTypeDeclaration(annotationName);
- }
-
- public void printTypeDeclaration(String typeDeclaration) {
- this.print(this.buildImportedTypeDeclaration(typeDeclaration));
- }
-
- protected void printField(String fieldName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(fieldName);
- this.print(';');
- this.println();
- this.println();
- }
-
- protected void printParameterizedField(String fieldName, String typeDeclaration, String parameterTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(typeDeclaration);
- this.print('<');
- this.printTypeDeclaration(parameterTypeDeclaration);
- this.print('>');
- this.print(' ');
- this.print(fieldName);
- this.print(';');
- this.println();
- this.println();
- }
-
- /**
- * Convert the specified string to a <em>String Literal</em> and print it,
- * adding the surrounding double-quotes and escaping characters
- * as necessary.
- */
- public void printStringLiteral(String string) {
- StringTools.convertToJavaStringLiteralOn(string, this);
- }
-
-
- // ********** imports **********
-
- // ***** writing
- /**
- * Return the specified class's "imported" name.
- * The class declaration must be of the form:
- * "int"
- * "int[]" (not "[I")
- * "java.lang.Object"
- * "java.lang.Object[]" (not "[Ljava.lang.Object;")
- * "java.util.Map.Entry" (not "java.util.Map$Entry")
- * "java.util.Map.Entry[][]" (not "[[Ljava.util.Map$Entry;")
- *
- * To really do this right, we would need to gather all the types from
- * the "unamed" (default) package that were referenced in the
- * compilation unit beforehand. *Any* collisions with one of these
- * types would have to be fully qualified (whether it was from
- * 'java.lang' or the same package as the current compilation unit).
- * In other words, if we have any types from the "unnamed" package,
- * results are unpredictable....
- */
- protected String buildImportedTypeDeclaration(String typeDeclaration) {
- if (this.typeDeclarationIsMemberClass(typeDeclaration)) {
- // no need for an import, just return the partially-qualified name
- return this.buildMemberClassTypeDeclaration(typeDeclaration);
- }
- int last = typeDeclaration.lastIndexOf('.');
- String currentPackageName = (last == -1) ? "" : typeDeclaration.substring(0, last);
- String shortTypeDeclaration = typeDeclaration.substring(last + 1);
- String shortElementTypeName = shortTypeDeclaration;
- while (shortElementTypeName.endsWith("[]")) {
- shortElementTypeName = shortElementTypeName.substring(0, shortElementTypeName.length() - 2);
- }
- ImportPackage prev = this.imports.get(shortElementTypeName);
- if (prev == null) {
- // this is the first class with this short element type name
- this.imports.put(shortElementTypeName, new ImportPackage(currentPackageName));
- return shortTypeDeclaration;
- }
- if (prev.packageName.equals(currentPackageName)) {
- // this element type has already been imported
- return shortTypeDeclaration;
- }
- if (currentPackageName.equals(this.packageName) &&
- prev.packageName.equals("java.lang")) {
- // we force the 'java.lang' class to be explicitly imported
- prev.collision = true;
- }
- // another class with the same short element type name has been
- // previously imported, so this one must be used fully-qualified
- return typeDeclaration;
- }
-
- /**
- * e.g. "foo.bar.Employee.PK" will return true
- */
- protected boolean typeDeclarationIsMemberClass(String typeDeclaration) {
- return (typeDeclaration.length() > this.className.length())
- && typeDeclaration.startsWith(this.className)
- && (typeDeclaration.charAt(this.className.length()) == '.');
- }
-
- /**
- * e.g. "foo.bar.Employee.PK" will return "Employee.PK"
- * this prevents collisions with other imported classes (e.g. "joo.jar.PK")
- */
- protected String buildMemberClassTypeDeclaration(String typeDeclaration) {
- int index = this.packageName.length();
- if (index != 0) {
- index++; // bump past the '.'
- }
- return typeDeclaration.substring(index);
- }
-
- // ***** reading
- public Iterable<String> getImports() {
- return this.getSortedRequiredImports();
- }
-
- /**
- * transform our map entries to class names
- */
- protected Iterable<String> getSortedRequiredImports() {
- return new TransformationIterable<Map.Entry<String, ImportPackage>, String>(this.getSortedRequiredImportEntries(), this.buildImportEntriesTransformer());
- }
-
- protected Transformer<Map.Entry<String, ImportPackage>, String> buildImportEntriesTransformer() {
- return IMPORT_ENTRIES_TRANSFORMER;
- }
-
- protected static final Transformer<Map.Entry<String, ImportPackage>, String> IMPORT_ENTRIES_TRANSFORMER = new ImportEntriesTransformer();
-
- protected static class ImportEntriesTransformer
- implements Transformer<Map.Entry<String, ImportPackage>, String>
- {
- public String transform(Entry<String, ImportPackage> importEntry) {
- String pkg = importEntry.getValue().packageName;
- String type = importEntry.getKey();
- StringBuilder sb = new StringBuilder(pkg.length() + 1 + type.length());
- sb.append(pkg);
- sb.append('.');
- sb.append(type);
- return sb.toString();
- }
- }
-
- /**
- * sort by package first, then class (*not* by fully-qualified class name)
- */
- protected Iterable<Map.Entry<String, ImportPackage>> getSortedRequiredImportEntries() {
- TreeSet<Map.Entry<String, ImportPackage>> sortedEntries = new TreeSet<Map.Entry<String, ImportPackage>>(this.buildImportEntriesComparator());
- CollectionTools.addAll(sortedEntries, this.getRequiredImportEntries());
- return sortedEntries;
- }
-
- protected Comparator<Map.Entry<String, ImportPackage>> buildImportEntriesComparator() {
- return IMPORT_ENTRIES_COMPARATOR;
- }
-
- protected static final Comparator<Map.Entry<String, ImportPackage>> IMPORT_ENTRIES_COMPARATOR = new ImportEntriesComparator();
-
- protected static class ImportEntriesComparator
- implements Comparator<Map.Entry<String, ImportPackage>>, Serializable
- {
- public int compare(Map.Entry<String, ImportPackage> e1, Map.Entry<String, ImportPackage> e2) {
- Collator collator = Collator.getInstance();
- int pkg = collator.compare(e1.getValue().packageName, e2.getValue().packageName);
- return (pkg == 0) ? collator.compare(e1.getKey(), e2.getKey()) : pkg;
- }
- }
-
- /**
- * strip off any non-required imports (e.g. "java.lang.Object')
- */
- protected Iterable<Map.Entry<String, ImportPackage>> getRequiredImportEntries() {
- return new FilteringIterable<Map.Entry<String, ImportPackage>>(this.imports.entrySet(), this.buildRequiredImportEntriesFilter());
- }
-
- protected Filter<Map.Entry<String, ImportPackage>> buildRequiredImportEntriesFilter() {
- return new RequiredImportEntriesFilter();
- }
-
- protected class RequiredImportEntriesFilter
- implements Filter<Map.Entry<String, ImportPackage>>
- {
- public boolean accept(Map.Entry<String, ImportPackage> importEntry) {
- return this.packageMustBeImported(importEntry.getValue());
- }
-
- protected boolean packageMustBeImported(ImportPackage importPackage) {
- String pkg = importPackage.packageName;
- if (pkg.equals("")) {
- // cannot import a type from the "unnamed" package
- return false;
- }
- if (pkg.equals("java.lang")) {
- // we must import from 'java.lang' if we also have a class in the same package
- return importPackage.collision;
- }
- if (pkg.equals(BodySourceWriter.this.packageName)) {
- // we never need to import a class from the same package
- return false;
- }
- return true;
- }
- }
-
- /**
- * We need a 'collision' flag for when we encounter a class from
- * 'java.lang' followed by a class from the current compilation unit's
- * package. We will need to include the explicit import of the
- * 'java.lang' class and all the references to the other class will
- * have to be fully-qualified.
- *
- * If the classes are encountered in the opposite order (i.e. the class
- * from the current compilation unit's package followed by the class
- * from 'java.lang'), we do *not* need to import the first class while
- * all the references to the 'java.lang' class will be fully-qualified.
- *
- * Unfortunately, we still have a problem: if we reference a class from
- * 'java.lang' and there is a conflicting class from the current
- * compilation unit's package (but that class is *not* revealed to us
- * here), the simple name will be resolved to the non-'java.lang' class.
- * Unless we simply force an import of *all* 'java.lang' classes.... :-(
- *
- * This shouldn't happen very often. :-)
- */
- protected static class ImportPackage {
- protected final String packageName;
- protected boolean collision = false;
-
- protected ImportPackage(String packageName) {
- super();
- this.packageName = packageName;
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/TextRange.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/TextRange.java
deleted file mode 100644
index f31dd77adf..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/TextRange.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * A text range defines the offset into, length of, and line of a piece
- * of text.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <p>
- * This interface is not intended to be implemented by clients.
- *
- * @version 2.0
- * @since 2.0
- */
-public interface TextRange {
-
- /**
- * Return the offset of the text.
- */
- int getOffset();
-
- /**
- * Return the length of the text.
- */
- int getLength();
-
- /**
- * Return whether the range includes the character at the specified index.
- */
- boolean includes(int index);
-
- /**
- * Return whether the range touches an insertion cursor at the
- * specified index.
- */
- boolean touches(int index);
-
- /**
- * Return the line number of the text.
- */
- int getLineNumber();
-
- /**
- * Build and return a new text range for the specified values if they differ
- * from the text range. If the specified values match the
- * text range, simply return the text range unchanged.
- */
- TextRange buildTextRange(int offset, int length, int lineNumber);
-
- /**
- * Return whether the offsets, lengths, and line numbers are the same.
- */
- boolean equals(Object obj);
-
- /**
- * Return a hash code that corresponds to the {@link Object#equals(Object)}
- * contract.
- */
- int hashCode();
-
-
- /**
- * Empty implementation of text range.
- */
- final class Empty extends AbstractTextRange {
- public static final TextRange INSTANCE = new Empty();
- public static TextRange instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Empty() {
- super();
- }
- public int getLineNumber() {
- return IMessage.LINENO_UNSET;
- }
- public int getOffset() {
- return IMessage.OFFSET_UNSET;
- }
- public int getLength() {
- return IMessage.OFFSET_UNSET;
- }
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AbstractType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AbstractType.java
deleted file mode 100644
index 8be7a07d97..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AbstractType.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-
-/**
- * AbstractType: just some covariant overrides.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface AbstractType extends Member {
-
- /**
- * Covariant override.
- */
- ITypeBinding getBinding(CompilationUnit astRoot);
-
- /**
- * Covariant override.
- */
- AbstractTypeDeclaration getBodyDeclaration(CompilationUnit astRoot);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedElement.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedElement.java
deleted file mode 100644
index 8ce99cf49c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedElement.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Dali manipulates annotations on elements (packages, types, fields, and methods).
- * This interface simplifies those manipulations.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface AnnotatedElement {
-
- String getName();
-
- /**
- * Return the annotated element's body declaration from the specified AST.
- * This can be null if the annotated element is no longer present in the AST
- * because the source has been changed in another thread.
- */
- ASTNode getBodyDeclaration(CompilationUnit astRoot);
-
- /**
- * Return the annotated element's binding from the specified AST.
- */
- IBinding getBinding(CompilationUnit astRoot);
-
- /**
- * Return the annotated element's "modified" declaration from the specified AST.
- */
- ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot);
-
- /**
- * Return the annotated element's "modified" declaration from a newly-generated AST.
- */
- ModifiedDeclaration getModifiedDeclaration();
-
- /**
- * Return the annotated element's name text range from the specified AST.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Edit the annotated element's declaration using the specified editor.
- */
- void edit(Editor editor);
-
-
- // ********** "editor" interface **********
-
- /**
- * This interface defines a callback that is invoked when the annotated element's
- * compilation unit/AST is in a state to be manipulated.
- */
- public interface Editor {
-
- /**
- * Edit the specified declaration. Any changes made to the declaration
- * will be captured and applied to the annotated element's compilation unit.
- */
- void edit(ModifiedDeclaration declaration);
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedPackage.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedPackage.java
deleted file mode 100644
index c0a3ccc098..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedPackage.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IPackageBinding;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-
-/**
- * @author Dmitry Geraskov
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface AnnotatedPackage extends AnnotatedElement {
-
- /**
- * Covariant override.
- */
- IPackageBinding getBinding(CompilationUnit astRoot);
-
- /**
- * Covariant override.
- */
- PackageDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationAdapter.java
deleted file mode 100644
index b0b04c4938..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationAdapter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Adapt a Java annotation with a simple-to-use interface.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface AnnotationAdapter {
-
- /**
- * Given the specified compilation unit, return the value of the
- * adapter's annotation.
- * @see #getAnnotation()
- */
- Annotation getAnnotation(CompilationUnit astRoot);
-
- /**
- * Build a new marker annotation, replacing the original annotation if present.
- */
- void newMarkerAnnotation();
-
- /**
- * Build a new single member annotation, replacing the original annotation if present.
- */
- void newSingleMemberAnnotation();
-
- /**
- * Build a new normal annotation, replacing the original annotation if present.
- */
- void newNormalAnnotation();
-
- /**
- * Remove the annotation.
- */
- void removeAnnotation();
-
- /**
- * Return the AST node corresponding to the annotation.
- * If the annotation is missing, return the annotation's parent node.
- * @see #getAstNode()
- */
- ASTNode getAstNode(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationEditFormatter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationEditFormatter.java
deleted file mode 100644
index 77b3ac0682..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationEditFormatter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface AnnotationEditFormatter {
-
- /**
- * Review the specified edits and format the specified document as needed.
- */
- void format(IDocument doc, TextEdit editTree) throws MalformedTreeException, BadLocationException;
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationElementAdapter.java
deleted file mode 100644
index 3fc6e95434..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationElementAdapter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Adapt a Java annotation element with a simple-to-use interface.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface AnnotationElementAdapter<T> {
-
- /**
- * Return the value of the adapter's annotation element.
- * Return null if the element is not present.
- * If the compilation unit is available, #value(CompilationUnit)
- * might be more performant.
- * @see #getValue(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- T getValue();
-
- /**
- * Given the specified compilation unit, return the value of the
- * adapter's annotation element.
- * Return null if the element is not present.
- * @see #getValue()
- */
- T getValue(CompilationUnit astRoot);
-
- /**
- * Set the value of the adapter's annotation element.
- * Setting the value of the element to null will cause
- * the element to be removed from its annotation.
- */
- void setValue(T value);
-
- /**
- * Given the specified compilation unit, return the expression value of the
- * adapter's annotation element.
- * Return null if the element is not present.
- * @see #getExpression()
- */
- Expression getExpression(CompilationUnit astRoot);
-
- /**
- * Return the AST node corresponding to the element.
- * If the element is missing, return the annotation's node.
- * @see #getAstNode()
- */
- ASTNode getAstNode(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Attribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Attribute.java
deleted file mode 100644
index cce19d5abc..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Attribute.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-
-/**
- * Attributes are either represented by fields ('foo') or properties/method
- * pairs ('getFoo()'/'setFoo()').
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Attribute extends Member {
-
- /**
- * Return the attribute's name, as opposed to the member's name
- * (e.g. "getFoo()" returns "foo").
- */
- String getAttributeName();
-
- /**
- * Return the type binding for the attribute's declared type,
- * as opposed to its declaring type.
- */
- ITypeBinding getTypeBinding(CompilationUnit astRoot);
-
- /**
- * Return whether the attribute is a field.
- */
- boolean isField();
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationAdapter.java
deleted file mode 100644
index 9f93a16ffd..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-
-/**
- * Provide clients with a pluggable way to manipulate an
- * annotation modifying a "declaration".
- *
- * TODO specify how multiple annotations with the same name are to be handled
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface DeclarationAnnotationAdapter {
-
- /**
- * Given the specified declaration, return the annotation.
- */
- Annotation getAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, modify it with
- * a new marker annotation, replacing the original annotation if present.
- * Return the new annotation.
- */
- MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, modify it with
- * a new single member annotation, replacing the original annotation if present.
- * Return the new annotation.
- */
- SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, modify it with
- * a new normal annotation, replacing the original annotation if present.
- * Return the new annotation.
- */
- NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Remove the annotation from the specified declaration.
- */
- void removeAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, return the AST node
- * corresponding to the annotation.
- * If the annotation is missing, return its parent node.
- */
- ASTNode getAstNode(ModifiedDeclaration declaration);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 1d5e4ff250..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Provide clients with a pluggable way to manipulate an
- * annotation element modifying a "declaration".
- * T is the type of the object to be passed to and returned by the adapter.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface DeclarationAnnotationElementAdapter<T> {
-
- /**
- * Reduce the number of NLS warnings.
- */
- String VALUE = "value"; //$NON-NLS-1$
-
- /**
- * Given the specified declaration, return the value of the
- * annotation element. Return null or an empty array
- * if the element is not present.
- */
- T getValue(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, set the value of the
- * annotation element. Setting the value of the element
- * to null will cause the element to be removed from its
- * annotation.
- */
- void setValue(T value, ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, return the element's value expression.
- * Return null if the element is not present.
- */
- Expression getExpression(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, return the AST node
- * corresponding to the element's value.
- * If the element is missing, return the annotation's node.
- */
- ASTNode getAstNode(ModifiedDeclaration declaration);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Enum.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Enum.java
deleted file mode 100644
index da690b148b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Enum.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-
-/**
- * Enum: some covariant overrides plus enumConstants
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Enum extends AbstractType {
-
- /**
- * Covariant override.
- */
- EnumDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
- /**
- * Return the enum's constants
- */
- EnumConstantDeclaration[] getEnumConstants(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/EnumConstant.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/EnumConstant.java
deleted file mode 100644
index 88693d415a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/EnumConstant.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-
-/**
- * Enum constants are part of Enums
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface EnumConstant extends Member {
-
- String getName();
-
- /**
- * Covariant override.
- */
- IVariableBinding getBinding(CompilationUnit astRoot);
-
- /**
- * Covariant override.
- */
- EnumConstantDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ExpressionConverter.java
deleted file mode 100644
index c5d7ed10e2..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ExpressionConverter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Define the protocol for converting an AST expression back and forth
- * from an arbitrary type (e.g. StringLiteral <=> String).
- * T is the type of the object to be converted to and from an expression.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface ExpressionConverter<T> {
-
- /**
- * Convert the specified object to an
- * expression that is owned by the specified AST.
- * The type of the object is determined by the
- * contract specified by the client.
- */
- Expression convert(T object, AST ast);
-
- /**
- * Convert the specified expression to an object of some
- * pre-determined type.
- */
- T convert(Expression expression);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/FieldAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/FieldAttribute.java
deleted file mode 100644
index 4e014ac72b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/FieldAttribute.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-
-/**
- * Field attribute: just some covariant overrides.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface FieldAttribute extends Attribute {
-
- /**
- * Covariant override.
- */
- IVariableBinding getBinding(CompilationUnit astRoot);
-
- /**
- * Covariant override.
- */
- FieldDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedAnnotationAdapter.java
deleted file mode 100644
index a55e9cbc77..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedAnnotationAdapter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-
-/**
- * Adapt an indexed Java annotation with a simple-to-use interface.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface IndexedAnnotationAdapter extends AnnotationAdapter {
-
- /**
- * Return the the index at which the annotation is situated.
- */
- int getIndex();
-
- /**
- * Move the annotation to the specified index, leaving its original
- * position cleared out.
- */
- void moveAnnotation(int newIndex);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 438f21e1e6..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-
-/**
- * Allow clients to manipulate an annotation within an array of annotations.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface IndexedDeclarationAnnotationAdapter extends DeclarationAnnotationAdapter {
-
- /**
- * Return the the index at which the annotation is situated.
- */
- int getIndex();
-
- /**
- * Move the annotation to the specified index, leaving its original
- * position cleared out.
- */
- void moveAnnotation(int newIndex, ModifiedDeclaration declaration);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index ae9f83ada8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Provide clients with a pluggable way to manipulate an <i>indexed</i> annotation
- * element modifying a "declaration".
- * T[] is the type of the object to be passed to and returned by the adapter.
- * T is the sub-value of the value object.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface IndexedDeclarationAnnotationElementAdapter<T>
- extends DeclarationAnnotationElementAdapter<T[]> {
-
- /**
- * Given the specified declaration, return the expression for the element's subvalue
- * at the given index.
- * @throws IndexOutOfBoundsException if the index is out of range
- */
- Expression getSubvalueExpression(int index, ModifiedDeclaration declaration);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedExpressionConverter.java
deleted file mode 100644
index a25ab674fb..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedExpressionConverter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * A type of {@link ExpressionConverter} that can further retrieve sub-expressions
- * based on indices.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface IndexedExpressionConverter<T>
- extends ExpressionConverter<T[]> {
-
- /**
- * Return the expression for the sub-value at the given index.
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- Expression getSubexpression(int index, Expression expression);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Member.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Member.java
deleted file mode 100644
index 8b9f398ea0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Member.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Dali manipulates annotations on members (types, fields, and methods).
- * This interface simplifies those manipulations.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Member extends AnnotatedElement {
-
- /**
- * Return whether the member is persistable.
- */
- boolean isPersistable(CompilationUnit astRoot);
-
- /**
- * Return whether the member matches the specified member
- * and occurrence.
- */
- boolean matches(String memberName, int occurrence);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/MethodAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/MethodAttribute.java
deleted file mode 100644
index 2eca93d773..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/MethodAttribute.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jpt.common.utility.MethodSignature;
-
-/**
- * Method attribute: just some covariant overrides.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface MethodAttribute extends Attribute {
-
- /**
- * Covariant override.
- */
- IMethodBinding getBinding(CompilationUnit astRoot);
-
- /**
- * Covariant override.
- */
- MethodDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
- /**
- * This method must be used instead of Member#matches(String, int).
- */
- boolean matches(MethodSignature signature, int occurrence);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ModifiedDeclaration.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ModifiedDeclaration.java
deleted file mode 100644
index 331e5391a0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ModifiedDeclaration.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-
-/**
- * Define a wrapper that provides a common protocol for all the various AST
- * declarations that have modifiers (i.e. there are a number of AST node
- * classes that implement the method #modifiers(), but they do not implement
- * a common interface):
- * BodyDeclaration
- * SingleVariableDeclaration
- * VariableDeclarationExpression
- * VariableDeclarationStatement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface ModifiedDeclaration {
-
- /**
- * Return the "declaration" AST node.
- */
- ASTNode getDeclaration();
-
- /**
- * Return the "declaration" AST.
- */
- AST getAst();
-
- /**
- * Return the *first* annotation with the specified name.
- * Return null if the declaration has no such annotation.
- */
- Annotation getAnnotationNamed(String annotationName);
-
- /**
- * Remove the *first* annotation with the specified name from the declaration.
- */
- void removeAnnotationNamed(String annotationName);
-
- /**
- * Replace the specified old annotation with the specified new annotation.
- * If there is no annotation with the specified name, simply add the new
- * annotation to the declaration's modifiers.
- */
- void replaceAnnotationNamed(String oldAnnotationName, Annotation newAnnotation);
-
- /**
- * Add the specified import to the declaration's compilation unit.
- * Return whether the appropriate import was added to or already present in
- * the declaration's compilation unit (i.e. the specified class can be
- * subsequently referenced using a "short" name).
- * Also return true if an import was unnecessary (i.e. the specified class
- * is part of the "default" package).
- * This does not support adding a "wildcard" import (e.g. "java.util.*").
- */
- boolean addImport(String className);
-
- /**
- * Add the specified static import to the declaration's compilation unit.
- * Return whether the appropriate import was added to or already present in
- * the declaration's compilation unit (i.e. the specified constant can be
- * subsequently referenced using a "short" name).
- * Also return true if an import was unnecessary (i.e. the specified enum
- * is part of the "default" package).
- * This does not support adding a "wildcard" import (e.g. "java.lang.annotation.ElementType.*").
- */
- boolean addStaticImport(String enumConstantName);
-
- /**
- * Add the specified import to the declaration's compilation unit.
- * Return whether the appropriate import was added to or already present in
- * the declaration's compilation unit (i.e. the specified name can be
- * subsequently referenced using a "short" name).
- * Also return true if an import was unnecessary (i.e. the specified class
- * or enum is part of the "default" package).
- * This does not support adding a "wildcard" import (e.g. "java.util.*").
- */
- boolean addImport(String importName, boolean static_);
-
- /**
- * Return whether the specified annotation has the specified
- * (fully-qualified) name within the declaration's context; i.e. attempt
- * to resolve the annotation's name (using imports etc.) and return
- * whether it matches the specified name.
- */
- boolean annotationIsNamed(Annotation annotation, String name);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Type.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Type.java
deleted file mode 100644
index 5a3a6a5a98..0000000000
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Type.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-
-/**
- * Type: nestedTypes, nestedEnums, fields, and methods.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * This interface is not intended to be implemented by clients.
- */
-public interface Type extends AbstractType {
-
- /**
- * Covariant override.
- */
- TypeDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
- /**
- * Return the type's nested types (does not include annotations or enums).
- */
- TypeDeclaration[] getTypes(CompilationUnit astRoot);
-
- /**
- * Return the type's nested enums.
- */
- EnumDeclaration[] getEnums(CompilationUnit astRoot);
-
- /**
- * Return the type's fields.
- */
- FieldDeclaration[] getFields(CompilationUnit astRoot);
-
- /**
- * Return the type's methods.
- */
- MethodDeclaration[] getMethods(CompilationUnit astRoot);
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/.cvsignore b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/.project b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/.project
deleted file mode 100644
index 9427ca0805..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.eclipselink.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/META-INF/MANIFEST.MF b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 0ded420bf7..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.common.eclipselink.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.html b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.ini b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.ini
deleted file mode 100644
index 6c107d466d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.mappings b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.properties b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.properties
deleted file mode 100644
index 129f69e36a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - EclipseLink Common\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/build.properties b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/build.properties
deleted file mode 100644
index 6c20e3b027..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/component.xml b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/component.xml
deleted file mode 100644
index a433d25681..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/component.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.common.eclipselink.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.common.eclipselink.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.eclipselink.core" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/icons/WTP_icon_x32_v2.png b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/plugin.properties b/common/plugins/org.eclipse.jpt.common.eclipselink.branding/plugin.properties
deleted file mode 100644
index 11a79f2639..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink Common
-providerName = Eclipse Web Tools Platform
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.classpath b/common/plugins/org.eclipse.jpt.common.eclipselink.core/.classpath
deleted file mode 100644
index ef7cc06313..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.cvsignore b/common/plugins/org.eclipse.jpt.common.eclipselink.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.project b/common/plugins/org.eclipse.jpt.common.eclipselink.core/.project
deleted file mode 100644
index 4179bd967e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.eclipselink.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.settings/org.eclipse.jdt.core.prefs b/common/plugins/org.eclipse.jpt.common.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 1322043060..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:06:31 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/META-INF/MANIFEST.MF b/common/plugins/org.eclipse.jpt.common.eclipselink.core/META-INF/MANIFEST.MF
deleted file mode 100644
index a0ad89c547..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.common.eclipselink.core;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.common.eclipselink.core.JptCommonEclipseLinkCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.600,2.0.0)"
-Export-Package: org.eclipse.jpt.common.eclipselink.core,
- org.eclipse.jpt.common.eclipselink.core.internal;
- x-friends:="org.eclipse.jpt.jpa.eclipselink.core,
- org.eclipse.jpt.jaxb.eclipselink.core",
- org.eclipse.jpt.common.eclipselink.core.internal.libval;
- x-friends:="org.eclipse.jpt.jpa.eclipselink.core,
- org.eclipse.jpt.jaxb.eclipselink.core"
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/about.html b/common/plugins/org.eclipse.jpt.common.eclipselink.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/build.properties b/common/plugins/org.eclipse.jpt.common.eclipselink.core/build.properties
deleted file mode 100644
index d5ecbb9699..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties,\
- schemas/
-src.includes = schemas/
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.properties b/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.properties
deleted file mode 100644
index c3865d8607..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Common EclipseLink Core
-providerName = Eclipse Web Tools Platform
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml b/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
deleted file mode 100644
index c4d3b8318c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2011 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <!--
- ******************************************
- * Library Provider Framework Integration *
- ******************************************
- -->
-
- <extension point="org.eclipse.jst.common.project.facet.core.downloadableLibraries">
-
- <import-definitions
- url="http://www.eclipse.org/webtools/dali/dev/eclipselink/eclipselink-downloadable-libs.xml">
- <enablement>
- <with variable="requestingProjectFacet">
- <or>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"
- forcePluginActivation="true"/>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </or>
- </with>
- </enablement>
- </import-definitions>
-
- </extension>
-
-
- <!--
- ******************************************
- * EclipseLink schemas *
- ******************************************
- -->
-
- <extension
- point="org.eclipse.wst.xml.core.catalogContributions">
-
- <catalogContribution id="default">
-
- <public
- publicId="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- uri="schemas/eclipselink_orm_2_3.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd"
- uri="schemas/eclipselink_orm_1_0.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_1.xsd"
- uri="schemas/eclipselink_orm_1_1.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_2.xsd"
- uri="schemas/eclipselink_orm_1_2.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_0.xsd"
- uri="schemas/eclipselink_orm_2_0.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_1.xsd"
- uri="schemas/eclipselink_orm_2_1.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_2.xsd"
- uri="schemas/eclipselink_orm_2_2.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_3.xsd"
- uri="schemas/eclipselink_orm_2_3.xsd"/>
-
- <public
- publicId="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- uri="schemas/eclipselink_oxm_2_3.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_0.xsd"
- uri="schemas/eclipselink_oxm_2_0.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_1.xsd"
- uri="schemas/eclipselink_oxm_2_1.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_2.xsd"
- uri="schemas/eclipselink_oxm_2_2.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_3.xsd"
- uri="schemas/eclipselink_oxm_2_3.xsd"/>
-
- <public
- publicId="http://www.eclipse.org/eclipselink/xsds/persistence"
- uri="schemas/eclipselink_persistence_map_2.3.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_1.0.xsd"
- uri="schemas/eclipselink_persistence_map_1.0.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_1.1.xsd"
- uri="schemas/eclipselink_persistence_map_1.1.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_1.2.xsd"
- uri="schemas/eclipselink_persistence_map_1.2.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_2.0.xsd"
- uri="schemas/eclipselink_persistence_map_2.0.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_persistence_map_2.3.xsd"
- uri="schemas/eclipselink_persistence_map_2.3.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_1.0.xsd"
- uri="schemas/eclipselink_sessions_1.0.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_1.1.xsd"
- uri="schemas/eclipselink_sessions_1.1.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_1.2.xsd"
- uri="schemas/eclipselink_sessions_1.2.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_2.0.xsd"
- uri="schemas/eclipselink_sessions_2.0.xsd"/>
-
- <uri
- name="http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_2.1.xsd"
- uri="schemas/eclipselink_sessions_2.1.xsd"/>
-
- </catalogContribution>
-
- </extension>
-
-</plugin>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/property_files/jpt_common_eclipselink_core.properties b/common/plugins/org.eclipse.jpt.common.eclipselink.core/property_files/jpt_common_eclipselink_core.properties
deleted file mode 100644
index 7b7ba929f4..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/property_files/jpt_common_eclipselink_core.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-################################################################################
-# Copyright (c) 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-EclipseLinkLibraryValidator_noEclipseLinkVersion=Selected libraries do not include required EclipseLink annotation classes.
-EclipseLinkLibraryValidator_multipleEclipseLinkVersions=There are multiple versions of EclipseLink in selected libraries.
-EclipseLinkLibraryValidator_improperEclipseLinkVersion=EclipseLink version does not meet platform requirements.
-
-ELJaxbUserLibraryValidator_noXjcClasses=Class generation may not be available if com.sun.tools.xjc and com.sun.xml.bind jars are not on project classpath.
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_0.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_0.xsd
deleted file mode 100644
index af1d1dadad..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_0.xsd
+++ /dev/null
@@ -1,3128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)eclipselink_orm_1_0.xsd 1.0 February 1 2008
- </xsd:documentation>
- </xsd:annotation>
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the new native EclipseLink XML metadata
- format used for JPA and native deployment xml files.
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <xsd:complexType name="emptyType"/>
-
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of an mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query or named-native-query
- of the same name in the same or different mapping files in a
- persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata"
- type="orm:persistence-unit-metadata"
- minOccurs="0"/>
- <xsd:element name="package" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType"
- fixed="1.0" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified then
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-default-mappings" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults"
- type="orm:persistence-unit-defaults"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables or secondary tables
- that apply to the persistence unit
- catalog - Used as the catalog for all tables or secondary tables
- that apply to the persistence unit
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its subelements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking"
- minOccurs="0"/>
- <xsd:element name="table" type="orm:table" minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:element name="discriminator-value" type="orm:discriminator-value"
- minOccurs="0"/>
- <xsd:element name="discriminator-column"
- type="orm:discriminator-column"
- minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking"
- minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="id" type="orm:id"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-collection" type="orm:basic-collection"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-map" type="orm:basic-map"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="variable-one-to-one" type="orm:variable-one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transformation" type="orm:transformation"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>
- A user defined mapping's property.
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Property {
- /**
- * Property name.
- */
- String name();
-
- /**
- * String representation of Property value,
- * converted to an instance of valueType.
- */
- String value();
-
- /**
- * Property value type.
- * The value converted to valueType by ConversionManager.
- * If specified must be a simple type that could be handled by
- * ConversionManager:
- * numerical, boolean, temporal.
- */
- Class valueType() default String.class;
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-result" type="orm:entity-result"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="access-methods">
- <xsd:annotation>
- <xsd:documentation>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="get-method" type="xsd:string" use="required"/>
- <xsd:attribute name="set-method" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="read-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * Unless the TransformationMapping is write-only, it should have a
- * ReadTransformer, it defines transformation of database column(s)
- * value(s)into attribute value.
- *
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReadTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.AttributeTransformer
- * interface. The class will be instantiated, its
- * buildAttributeValue will be used to create the value to be
- * assigned to the attribute.
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be assigned to the attribute (not assigns the value to
- * the attribute). Either transformerClass or method must be
- * specified, but not both.
- */
- String method() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="write-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- *
- * A single WriteTransformer may be specified directly on the method or
- * attribute. Multiple WriteTransformers should be wrapped into
- * WriteTransformers annotation. No WriteTransformers specified for
- * read-only mapping. Unless the TransformationMapping is write-only, it
- * should have a ReadTransformer, it defines transformation of database
- * column(s) value(s)into attribute value.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface WriteTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.FieldTransformer
- * interface. The class will be instantiated, its buildFieldValue
- * will be used to create the value to be written into the database
- * column. Note that for ddl generation and returning to be
- * supported the method buildFieldValue in the class should be
- * defined to return the relevant Java type, not just Object as
- * defined in the interface, for instance:
- * public Time buildFieldValue(Object instance, String fieldName, Session session).
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be written into the database column.
- * Note that for ddl generation and returning to be supported the
- * method should be defined to return a particular type, not just
- * Object, for instance:
- * public Time getStartTime().
- * The method may require a Transient annotation to avoid being
- * mapped as Basic by default.
- * Either transformerClass or method must be specified, but not both.
- */
- String method() default "";
-
- /**
- * Specify here the column into which the value should be written.
- * The only case when this could be skipped is if a single
- * WriteTransformer annotates an attribute - the attribute's name
- * will be used as a column name.
- */
- Column column() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="transformation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Transformation is an optional annotation for
- * org.eclipse.persistence.mappings.TransformationMapping.
- * TransformationMapping allows to map an attribute to one or more
- * database columns.
- *
- * Transformation annotation is an optional part of
- * TransformationMapping definition. Unless the TransformationMapping is
- * write-only, it should have a ReadTransformer, it defines
- * transformation of database column(s) value(s)into attribute value.
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Transformation {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) The optional element is a hint as to whether the value
- * of the field or property may be null. It is disregarded
- * for primitive types, which are considered non-optional.
- */
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="read-transformer" type="orm:read-transformer"/>
- <xsd:element name="write-transformer" type="orm:write-transformer" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType
- { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking"
- minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes"
- minOccurs="0"/>
- <xsd:element name="copy-policy" type="orm:copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking"
- minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking"
- minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Converter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must implement
- * the org.eclipse.persistence.mappings.converters.Converter interface.
- */
- Class converterClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface TypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence field
- * or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent field
- * or property.
- */
- Class objectType() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ObjectTypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence
- * field or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent
- * field or property.
- */
- Class objectType() default void.class;
-
- /**
- * (Required) Specify the conversion values to be used
- * with the object converter.
- */
- ConversionValue[] conversionValues();
-
- /**
- * (Optional) Specify a default object value. Used for
- * legacy data if the data value is missing.
- */
- String defaultObjectValue() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="conversion-value" type="orm:conversion-value" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="default-object-value" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="conversion-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface ConversionValue {
- /**
- * (Required) Specify the database value.
- */
- String dataValue();
-
- /**
- * (Required) Specify the object value.
- */
- String objectValue();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="data-value" type="xsd:string" use="required"/>
- <xsd:attribute name="object-value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface StructConverter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must
- * implement the EclipseLink interface
- * org.eclipse.persistence.mappings.converters.Converter
- */
- String converter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="converter" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CopyPolicy is used to set a
- * org.eclipse.persistence.descriptors.copying.CopyPolicy on an Entity.
- * It is required that a class that implements
- * org.eclipse.persistence.descriptors.copying.CopyPolicy be specified
- * as the argument.
- *
- * A CopyPolicy should be specified on an Entity or MappedSuperclass.
- *
- * For instance:
- * @Entity
- * @CopyPolicy("example.MyCopyPolicy")
- */
- public @interface CopyPolicy {
-
- /*
- * (Required)
- * This defines the class of the copy policy. It must specify a class
- * that implements org.eclipse.persistence.descriptors.copying.CopyPolicy
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * An InstantiationCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy
- * on an Entity. InstantiationCopyPolicy is the default CopyPolicy in
- * EclipseLink and therefore this configuration option is only used to
- * override other types of copy policies
- *
- * An InstantiationCopyPolicy should be specified on an Entity or
- * MappedSuperclass.
- *
- * Example:
- * @Entity
- * @InstantiationCopyPolicy
- */
- public @interface InstantiationCopyPolicy {
- }
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CloneCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.CloneCopyPolicy on an
- * Entity. A CloneCopyPolicy must specify at one or both of the "method"
- * or "workingCopyMethod". "workingCopyMethod" is used to clone objects
- * that will be returned to the user as they are registered in
- * EclipseLink's transactional mechanism, the UnitOfWork. "method" will
- * be used for the clone that is used for comparison in conjunction with
- * EclipseLink's DeferredChangeDetectionPolicy
- *
- * A CloneCopyPolicy should be specified on an Entity or
- * MappedSuperclass.
- *
- * Example:
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod", workingCopyMethod="myWorkingCopyCloneMethod")
- *
- * or:
- *
- @Entity
- * @CloneCopyPolicy(workingCopyMethodName="myWorkingCopyClone")
- */
- public @interface CloneCopyPolicy {
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified this defines
- * a method that will be used to create a clone that will be used
- * for comparison by
- * EclipseLink's DeferredChangeDetectionPolicy
- */
- String method();
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified
- * this defines a method that will be used to create a clone that
- * will be used to create the object returned when registering an
- * Object in an EclipseLink UnitOfWork
- */
- String workingCopyMethod();
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method" type="xsd:string"/>
- <xsd:attribute name="working-copy-method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface CollectionTable {
- /**
- * (Optional) The name of the collection table. If it is not
- * specified, it is defaulted to the concatenation of the following:
- * the name of the source entity; "_" ; the name of the relationship
- * property or field of the source entity.
- */
- String name() default "";
-
- /**
- * (Optional) The catalog of the table. It defaults to the persistence
- * unit default catalog.
- */
- String catalog() default "";
-
- /**
- * (Optional) The schema of the table. It defaults to the persistence
- * unit default schema.
- */
- String schema() default "";
-
- /**
- * (Optional) Used to specify a primary key column that is used as a
- * foreign key to join to another table. If the source entity uses a
- * composite primary key, a primary key join column must be specified
- * for each field of the composite primary key. In a single primary
- * key case, a primary key join column may optionally be specified.
- * Defaulting will apply otherwise as follows:
- * name, the same name as the primary key column of the primary table
- * of the source entity. referencedColumnName, the same name of
- * primary key column of the primary table of the source entity.
- */
- PrimaryKeyJoinColumn[] primaryKeyJoinColumns() default {};
-
- /**
- * (Optional) Unique constraints that are to be placed on the table.
- * These are only used if table generation is in effect.
- */
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicCollection {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the value column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:element name="collection-table" type="orm:collection-table" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-map">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicMap {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the data column that holds the direct map
- * key. If the name on te key column is "", the name will default to:
- * the name of the property or field; "_key".
- */
- Column keyColumn();
-
- /**
- * (Optional) Specify the key converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the direct map key.
- */
- Convert keyConverter() default @Convert;
-
- /**
- * (Optional) The name of the data column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
-
- /**
- * (Optional) Specify the value converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the value column mapping.
- */
- Convert valueConverter() default @Convert;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="key-converter" type="xsd:string"/>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="value-converter" type="xsd:string"/>
- <xsd:element name="collection-table" type="orm:collection-table" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum JoinFetchType {
- /**
- * An inner join is used to fetch the related object.
- * This does not allow for null/empty values.
- */
- INNER,
-
- /**
- * An inner join is used to fetch the related object.
- * This allows for null/empty values.
- */
- OUTER,
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="INNER"/>
- <xsd:enumeration value="OUTER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="optimistic-locking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An optimistic-locking element is used to specify the type of
- * optimistic locking EclipseLink should use when updating or deleting
- * entities. An optimistic-locking specification is supported on
- * an entity or mapped-superclass.
- *
- * It is used in conjunction with the optimistic-locking-type.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface OptimisticLocking {
- /**
- * (Optional) The type of optimistic locking policy to use.
- */
- OptimisticLockingType type() default VERSION_COLUMN;
-
- /**
- * (Optional) For an optimistic locking policy of type
- * SELECTED_COLUMNS, this annotation member becomes a (Required)
- * field.
- */
- Column[] selectedColumns() default {};
-
- /**
- * (Optional) Specify where the optimistic locking policy should
- * cascade lock. Currently only supported with VERSION_COLUMN locking.
- */
- boolean cascade() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="selected-column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:optimistic-locking-type"/>
- <xsd:attribute name="cascade" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="optimistic-locking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A simple type that is used within an optimistic-locking
- * specification to specify the type of optimistic-locking that
- * EclipseLink should use when updating or deleting entities.
- */
- public enum OptimisticLockingType {
- /**
- * Using this type of locking policy compares every field in the table
- * in the WHERE clause when doing an update or a delete. If any field
- * has been changed, an optimistic locking exception will be thrown.
- */
- ALL_COLUMNS,
-
- /**
- * Using this type of locking policy compares only the changed fields
- * in the WHERE clause when doing an update. If any field has been
- * changed, an optimistic locking exception will be thrown. A delete
- * will only compare the primary key.
- */
- CHANGED_COLUMNS,
-
- /**
- * Using this type of locking compares selected fields in the WHERE
- * clause when doing an update or a delete. If any field has been
- * changed, an optimistic locking exception will be thrown. Note that
- * the fields specified must be mapped and not be primary keys.
- */
- SELECTED_COLUMNS,
-
- /**
- * Using this type of locking policy compares a single version number
- * in the where clause when doing an update. The version field must be
- * mapped and not be the primary key.
- */
- VERSION_COLUMN
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL_COLUMNS"/>
- <xsd:enumeration value="CHANGED_COLUMNS"/>
- <xsd:enumeration value="SELECTED_COLUMNS"/>
- <xsd:enumeration value="VERSION_COLUMN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Cache annotation is used to set an
- * org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
- * which sets objects in EclipseLink's identity maps to be invalid
- * following given rules. By default in EclipseLink, objects do not
- * expire in the cache. Several different policies are available to
- * allow objects to expire.
- *
- * @see org.eclipse.persistence.annotations.CacheType
- *
- * A Cache anotation may be defined on an Entity or MappedSuperclass.
- * In the case of inheritance, a Cache annotation should only be defined
- * on the root of the inheritance hierarchy.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Cache {
- /**
- * (Optional) The type of cache to use.
- */
- CacheType type() default SOFT_WEAK;
-
- /**
- * (Optional) The size of cache to use.
- */
- int size() default 100;
-
- /**
- * (Optional) Cached instances in the shared cache or a client
- * isolated cache.
- */
- boolean shared() default true;
-
- /**
- * (Optional) Expire cached instance after a fix period of time (ms).
- * Queries executed against the cache after this will be forced back
- * to the database for a refreshed copy
- */
- int expiry() default -1; // minus one is no expiry.
-
- /**
- * (Optional) Expire cached instance a specific time of day. Queries
- * executed against the cache after this will be forced back to the
- * database for a refreshed copy
- */
- TimeOfDay expiryTimeOfDay() default @TimeOfDay(specified=false);
-
- /**
- * (Optional) Force all queries that go to the database to always
- * refresh the cache.
- */
- boolean alwaysRefresh() default false;
-
- /**
- * (Optional) For all queries that go to the database, refresh the
- * cache only if the data received from the database by a query is
- * newer than the data in the cache (as determined by the optimistic
- * locking field)
- */
- boolean refreshOnlyIfNewer() default false;
-
- /**
- * (Optional) Setting to true will force all queries to bypass the
- * cache for hits but still resolve against the cache for identity.
- * This forces all queries to hit the database.
- */
- boolean disableHits() default false;
-
- /**
- * (Optional) The cache coordination mode.
- */
- CacheCoordinationType coordinationType() default SEND_OBJECT_CHANGES;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="expiry" type="xsd:integer" minOccurs="0"/>
- <xsd:element name="expiry-time-of-day" type="orm:time-of-day" minOccurs="0"/>
- </xsd:choice>
- <xsd:attribute name="size" type="xsd:integer"/>
- <xsd:attribute name="shared" type="xsd:boolean"/>
- <xsd:attribute name="type" type="orm:cache-type"/>
- <xsd:attribute name="always-refresh" type="xsd:boolean"/>
- <xsd:attribute name="refresh-only-if-newer" type="xsd:boolean"/>
- <xsd:attribute name="disable-hits" type="xsd:boolean"/>
- <xsd:attribute name="coordination-type" type="orm:cache-coordination-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The CacheType enum is used with the Cache annotation for a
- * persistent class. It defines the type of IdentityMap/Cache used for
- * the class. By default the SOFT_WEAK cache type is used.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheType {
- /**
- * Provides full caching and guaranteed identity. Caches all objects
- * and does not remove them.
- * WARNING: This method may be memory intensive when many objects are
- * read.
- */
- FULL,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using weak references. This method allows full garbage
- * collection and provides full caching and guaranteed identity.
- */
- WEAK,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using soft references. This method allows full garbage
- * collection when memory is low and provides full caching and
- * guaranteed identity.
- */
- SOFT,
-
- /**
- * Similar to the WEAK identity map except that it maintains a
- * most-frequently-used sub-cache. The size of the sub-cache is
- * proportional to the size of the identity map as specified by
- * descriptor's setIdentityMapSize() method. The sub-cache
- * uses soft references to ensure that these objects are
- * garbage-collected only if the system is low on memory.
- */
- SOFT_WEAK,
-
- /**
- * Identical to the soft cache weak (SOFT_WEAK) identity map except
- * that it uses hard references in the sub-cache. Use this identity
- * map if soft references do not behave properly on your platform.
- */
- HARD_WEAK,
-
- /**
- * A cache identity map maintains a fixed number of objects
- * specified by the application. Objects are removed from the cache
- * on a least-recently-used basis. This method allows object
- * identity for the most commonly used objects.
- * WARNING: Furnishes caching and identity, but does not guarantee
- * identity.
- */
- CACHE,
-
- /**
- * WARNING: Does not preserve object identity and does not cache
- * objects.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="FULL"/>
- <xsd:enumeration value="WEAK"/>
- <xsd:enumeration value="SOFT"/>
- <xsd:enumeration value="SOFT_WEAK"/>
- <xsd:enumeration value="HARD_WEAK"/>
- <xsd:enumeration value="CACHE"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-coordination-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the Cache annotation.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheCoordinationType {
- /**
- * Sends a list of changed objects including data about the changes.
- * This data is merged into the receiving cache.
- */
- SEND_OBJECT_CHANGES,
-
- /**
- * Sends a list of the identities of the objects that have changed.
- * The receiving cache invalidates the objects (rather than changing
- * any of the data)
- */
- INVALIDATE_CHANGED_OBJECTS,
-
- /**
- * Same as SEND_OBJECT_CHANGES except it also includes any newly
- * created objects from the transaction.
- */
- SEND_NEW_OBJECTS_WITH_CHANGES,
-
- /**
- * Does no cache coordination.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SEND_OBJECT_CHANGES"/>
- <xsd:enumeration value="INVALIDATE_CHANGED_OBJECTS"/>
- <xsd:enumeration value="SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="time-of-day">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface TimeOfDay {
- /**
- * (Optional) Hour of the day.
- */
- int hour() default 0;
-
- /**
- * (Optional) Minute of the day.
- */
- int minute() default 0;
-
- /**
- * (Optional) Second of the day.
- */
- int second() default 0;
-
- /**
- * (Optional) Millisecond of the day.
- */
- int millisecond() default 0;
-
- /**
- * Internal use. Do not modify.
- */
- boolean specified() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="hour" type="xsd:integer"/>
- <xsd:attribute name="minute" type="xsd:integer"/>
- <xsd:attribute name="second" type="xsd:integer"/>
- <xsd:attribute name="millisecond" type="xsd:integer"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="change-tracking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The ChangeTracking annotation is used to specify the
- * org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy
- * which computes changes sets for EclipseLink's UnitOfWork commit
- * process. An ObjectChangePolicy is stored on an Entity's descriptor.
- *
- * A ChangeTracking annotation may be specified on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ChangeTracking {
- /**
- * (Optional) The type of change tracking to use.
- */
- ChangeTrackingType value() default AUTO;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:change-tracking-type" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="change-tracking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the ChangeTracking annotation.
- */
- public enum ChangeTrackingType {
- /**
- * An ATTRIBUTE change tracking type allows change tracking at the
- * attribute level of an object. Objects with changed attributes will
- * be processed in the commit process to include any changes in the
- * results of the commit. Unchanged objects will be ignored.
- */
- ATTRIBUTE,
-
- /**
- * An OBJECT change tracking policy allows an object to calculate for
- * itself whether it has changed. Changed objects will be processed in
- * the commit process to include any changes in the results of the
- * commit. Unchanged objects will be ignored.
- */
- OBJECT,
-
- /**
- * A DEFERRED change tracking policy defers all change detection to
- * the UnitOfWork's change detection process. Essentially, the
- * calculateChanges() method will run for all objects in a UnitOfWork.
- * This is the default ObjectChangePolicy
- */
- DEFERRED,
-
- /**
- * Will not set any change tracking policy.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ATTRIBUTE"/>
- <xsd:enumeration value="OBJECT"/>
- <xsd:enumeration value="DEFERRED"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="customizer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Customizer annotation is used to specify a class that implements
- * the org.eclipse.persistence.internal.sessions.factories.DescriptorCustomizer
- * interface and is to run against an enetity's class descriptor after all
- * metadata processing has been completed.
- *
- * The Customizer annotation may be defined on an Entity, MappedSuperclass
- * or Embeddable class. In the case of inheritance, a Customizer is not
- * inherited from its parent classes.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Customizer {
- /**
- * (Required) Defines the name of the descriptor customizer class that
- * should be applied for the related entity or embeddable class.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredProcedureQuery annotation allows the definition of
- * queries that call stored procedures as named queries.
-
- * A NamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Whether the query should return a result set.
- */
- boolean returnsResultSet() default true;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- <xsd:attribute name="returns-result-set" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="stored-procedure-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A StoredProcedureParameter annotation is used within a
- * NamedStoredProcedureQuery annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface StoredProcedureParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Optional) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Required) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) The type of Java class desired back from the procedure,
- * this is dependent on the type returned from the procedure.
- */
- Class type() default void.class;
-
- /**
- * (Optional) The JDBC type code, this dependent on the type returned
- * from the procedure.
- */
- int jdbcType() default -1;
-
- /**
- * (Optional) The JDBC type name, this may be required for ARRAY or
- * STRUCT types.
- */
- String jdbcTypeName() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="query-parameter" type="xsd:string" use="required"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="jdbc-type" type="xsd:integer"/>
- <xsd:attribute name="jdbc-type-name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="direction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the StoredProcedureParameter annotation.
- * It is used to specify the direction of the stored procedure
- * parameters of a named stored procedure query.
- */
- public enum Direction {
- /**
- * Input parameter
- */
- IN,
-
- /**
- * Output parameter
- */
- OUT,
-
- /**
- * Input and output parameter
- */
- IN_OUT,
-
- /**
- * Output cursor
- */
- OUT_CURSOR
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="IN_OUT"/>
- <xsd:enumeration value="OUT_CURSOR"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="variable-one-to-one">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Variable one to one mappings are used to represent a pointer
- * references between a java object and an implementer of an interface.
- * This mapping is usually represented by a single pointer (stored in an
- * instance variable) between the source and target objects. In the
- * relational database tables, these mappings are normally implemented
- * using a foreign key and a type code.
- *
- * A VariableOneToOne can be specified within an Entity,
- * MappedSuperclass and Embeddable class.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface VariableOneToOne {
- /**
- * (Optional) The interface class that is the target of the
- * association. If not specified it will be inferred from the type
- * of the object being referenced.
- */
- Class targetInterface() default void.class;
-
- /**
- * (Optional) The operations that must be cascaded to the target of
- * the association.
- */
- CascadeType[] cascade() default {};
-
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) Whether the association is optional. If set to false
- * then a non-null relationship must always exist.
- */
- boolean optional() default true;
-
- /**
- * (Optional) The discriminator column will hold the type
- * indicators. If the DiscriminatorColumn is not specified, the name
- * of the discriminator column defaults to "DTYPE" and the
- * discriminator type to STRING.
- */
- DiscriminatorColumn discriminatorColumn() default @DiscriminatorColumn;
-
- /**
- * (Optional) The list of discriminator types that can be used with
- * this VariableOneToOne. If none are specified then those entities
- * within the persistence unit that implement the target interface
- * will be added to the list of types. The discriminator type will
- * default as follows:
- * - If DiscriminatorColumn type is STRING: Entity.name()
- * - If DiscriminatorColumn type is CHAR: First letter of the
- * Entity class
- * - If DiscriminatorColumn type is INTEGER: The next integer after
- * the highest integer explicitly added.
- */
- DiscriminatorClass[] discriminatorClasses() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column"
- minOccurs="0"/>
- <xsd:element name="discriminator-class" type="orm:discriminator-class"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-interface" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-class">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A DiscriminatorClass is used within a VariableOneToOne annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface DiscriminatorClass {
- /**
- * (Required) The discriminator to be stored on the database.
- */
- String discriminator();
-
- /**
- * (Required) The class to the instantiated with the given
- * discriminator.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="discriminator" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="existence-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * The ExistenceChecking annotation is used to specify the type of
- * checking EclipseLink should use when updating entities.
- *
- * An existence-checking specification is supported on an Entity or
- * MappedSuperclass annotation.
- */
- public @interface ExistenceChecking {
- /**
- * (Optional) Set the existence check for determining
- * if an insert or update should occur for an object.
- */
- ExistenceType value() default CHECK_CACHE;
- }
-
- /**
- * Assume that if the objects primary key does not include null and
- * it is in the cache, then it must exist.
- */
- CHECK_CACHE,
-
- /**
- * Perform does exist check on the database.
- */
- CHECK_DATABASE,
-
- /**
- * Assume that if the objects primary key does not include null then
- * it must exist. This may be used if the application guarantees or
- * does not care about the existence check.
- */
- ASSUME_EXISTENCE,
-
- /**
- * Assume that the object does not exist. This may be used if the
- * application guarantees or does not care about the existence check.
- * This will always force an insert to be called.
- */
- ASSUME_NON_EXISTENCE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="CHECK_CACHE" />
- <xsd:enumeration value="CHECK_DATABASE" />
- <xsd:enumeration value="ASSUME_EXISTENCE" />
- <xsd:enumeration value="ASSUME_NON_EXISTENCE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_1.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_1.xsd
deleted file mode 100644
index 0d3ff1747c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_1.xsd
+++ /dev/null
@@ -1,3248 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.1">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)eclipselink_orm_1_1.xsd 1.1 February 4 2009
- </xsd:documentation>
- </xsd:annotation>
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the new native EclipseLink XML metadata
- format used for JPA and native deployment xml files.
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <xsd:complexType name="emptyType"/>
-
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of an mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query or named-native-query
- of the same name in the same or different mapping files in a
- persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata"
- type="orm:persistence-unit-metadata"
- minOccurs="0"/>
- <xsd:element name="package" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType"
- fixed="1.1" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified then
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-default-mappings" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults"
- type="orm:persistence-unit-defaults"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables or secondary tables
- that apply to the persistence unit
- catalog - Used as the catalog for all tables or secondary tables
- that apply to the persistence unit
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its subelements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking"
- minOccurs="0"/>
- <xsd:element name="table" type="orm:table" minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:element name="discriminator-value" type="orm:discriminator-value"
- minOccurs="0"/>
- <xsd:element name="discriminator-column"
- type="orm:discriminator-column"
- minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking"
- minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="id" type="orm:id"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-collection" type="orm:basic-collection"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-map" type="orm:basic-map"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="variable-one-to-one" type="orm:variable-one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transformation" type="orm:transformation"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>
- A user defined mapping's property.
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Property {
- /**
- * Property name.
- */
- String name();
-
- /**
- * String representation of Property value,
- * converted to an instance of valueType.
- */
- String value();
-
- /**
- * Property value type.
- * The value converted to valueType by ConversionManager.
- * If specified must be a simple type that could be handled by
- * ConversionManager:
- * numerical, boolean, temporal.
- */
- Class valueType() default String.class;
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-result" type="orm:entity-result"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="access-methods">
- <xsd:annotation>
- <xsd:documentation>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="get-method" type="xsd:string" use="required"/>
- <xsd:attribute name="set-method" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal" />
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="lob" type="orm:lob"/>
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="read-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * Unless the TransformationMapping is write-only, it should have a
- * ReadTransformer, it defines transformation of database column(s)
- * value(s)into attribute value.
- *
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReadTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.AttributeTransformer
- * interface. The class will be instantiated, its
- * buildAttributeValue will be used to create the value to be
- * assigned to the attribute.
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be assigned to the attribute (not assigns the value to
- * the attribute). Either transformerClass or method must be
- * specified, but not both.
- */
- String method() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="write-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- *
- * A single WriteTransformer may be specified directly on the method or
- * attribute. Multiple WriteTransformers should be wrapped into
- * WriteTransformers annotation. No WriteTransformers specified for
- * read-only mapping. Unless the TransformationMapping is write-only, it
- * should have a ReadTransformer, it defines transformation of database
- * column(s) value(s)into attribute value.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface WriteTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.FieldTransformer
- * interface. The class will be instantiated, its buildFieldValue
- * will be used to create the value to be written into the database
- * column. Note that for ddl generation and returning to be
- * supported the method buildFieldValue in the class should be
- * defined to return the relevant Java type, not just Object as
- * defined in the interface, for instance:
- * public Time buildFieldValue(Object instance, String fieldName, Session session).
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be written into the database column.
- * Note that for ddl generation and returning to be supported the
- * method should be defined to return a particular type, not just
- * Object, for instance:
- * public Time getStartTime().
- * The method may require a Transient annotation to avoid being
- * mapped as Basic by default.
- * Either transformerClass or method must be specified, but not both.
- */
- String method() default "";
-
- /**
- * Specify here the column into which the value should be written.
- * The only case when this could be skipped is if a single
- * WriteTransformer annotates an attribute - the attribute's name
- * will be used as a column name.
- */
- Column column() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="transformation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Transformation is an optional annotation for
- * org.eclipse.persistence.mappings.TransformationMapping.
- * TransformationMapping allows to map an attribute to one or more
- * database columns.
- *
- * Transformation annotation is an optional part of
- * TransformationMapping definition. Unless the TransformationMapping is
- * write-only, it should have a ReadTransformer, it defines
- * transformation of database column(s) value(s)into attribute value.
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Transformation {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) The optional element is a hint as to whether the value
- * of the field or property may be null. It is disregarded
- * for primitive types, which are considered non-optional.
- */
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="read-transformer" type="orm:read-transformer"/>
- <xsd:element name="write-transformer" type="orm:write-transformer" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType
- { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking"
- minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes"
- minOccurs="0"/>
- <xsd:element name="copy-policy" type="orm:copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking"
- minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking"
- minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy"
- minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Converter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must implement
- * the org.eclipse.persistence.mappings.converters.Converter interface.
- */
- Class converterClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface TypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence field
- * or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent field
- * or property.
- */
- Class objectType() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ObjectTypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence
- * field or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent
- * field or property.
- */
- Class objectType() default void.class;
-
- /**
- * (Required) Specify the conversion values to be used
- * with the object converter.
- */
- ConversionValue[] conversionValues();
-
- /**
- * (Optional) Specify a default object value. Used for
- * legacy data if the data value is missing.
- */
- String defaultObjectValue() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="conversion-value" type="orm:conversion-value" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="default-object-value" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="conversion-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface ConversionValue {
- /**
- * (Required) Specify the database value.
- */
- String dataValue();
-
- /**
- * (Required) Specify the object value.
- */
- String objectValue();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="data-value" type="xsd:string" use="required"/>
- <xsd:attribute name="object-value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface StructConverter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must
- * implement the EclipseLink interface
- * org.eclipse.persistence.mappings.converters.Converter
- */
- String converter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="converter" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CopyPolicy is used to set a
- * org.eclipse.persistence.descriptors.copying.CopyPolicy on an Entity.
- * It is required that a class that implements
- * org.eclipse.persistence.descriptors.copying.CopyPolicy be specified
- * as the argument.
- *
- * A CopyPolicy should be specified on an Entity, MappedSuperclass or
- * Embeddable.
- *
- * For instance:
- * @Entity
- * @CopyPolicy("example.MyCopyPolicy")
- */
- public @interface CopyPolicy {
-
- /*
- * (Required)
- * This defines the class of the copy policy. It must specify a class
- * that implements org.eclipse.persistence.descriptors.copying.CopyPolicy
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * An InstantiationCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy
- * on an Entity. InstantiationCopyPolicy is the default CopyPolicy in
- * EclipseLink and therefore this configuration option is only used to
- * override other types of copy policies
- *
- * An InstantiationCopyPolicy should be specified on an Entity,
- * MappedSuperclass or Embeddable.
- *
- * Example:
- * @Entity
- * @InstantiationCopyPolicy
- */
- public @interface InstantiationCopyPolicy {
- }
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CloneCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.CloneCopyPolicy on an
- * Entity. A CloneCopyPolicy must specify at one or both of the "method"
- * or "workingCopyMethod". "workingCopyMethod" is used to clone objects
- * that will be returned to the user as they are registered in
- * EclipseLink's transactional mechanism, the UnitOfWork. "method" will
- * be used for the clone that is used for comparison in conjunction with
- * EclipseLink's DeferredChangeDetectionPolicy
- *
- * A CloneCopyPolicy should be specified on an Entity, MappedSuperclass
- * or Embeddable.
- *
- * Example:
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod", workingCopyMethod="myWorkingCopyCloneMethod")
- *
- * or:
- *
- @Entity
- * @CloneCopyPolicy(workingCopyMethodName="myWorkingCopyClone")
- */
- public @interface CloneCopyPolicy {
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified this defines
- * a method that will be used to create a clone that will be used
- * for comparison by
- * EclipseLink's DeferredChangeDetectionPolicy
- */
- String method();
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified
- * this defines a method that will be used to create a clone that
- * will be used to create the object returned when registering an
- * Object in an EclipseLink UnitOfWork
- */
- String workingCopyMethod();
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method" type="xsd:string"/>
- <xsd:attribute name="working-copy-method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface CollectionTable {
- /**
- * (Optional) The name of the collection table. If it is not
- * specified, it is defaulted to the concatenation of the following:
- * the name of the source entity; "_" ; the name of the relationship
- * property or field of the source entity.
- */
- String name() default "";
-
- /**
- * (Optional) The catalog of the table. It defaults to the persistence
- * unit default catalog.
- */
- String catalog() default "";
-
- /**
- * (Optional) The schema of the table. It defaults to the persistence
- * unit default schema.
- */
- String schema() default "";
-
- /**
- * (Optional) Used to specify a primary key column that is used as a
- * foreign key to join to another table. If the source entity uses a
- * composite primary key, a primary key join column must be specified
- * for each field of the composite primary key. In a single primary
- * key case, a primary key join column may optionally be specified.
- * Defaulting will apply otherwise as follows:
- * name, the same name as the primary key column of the primary table
- * of the source entity. referencedColumnName, the same name of
- * primary key column of the primary table of the source entity.
- */
- PrimaryKeyJoinColumn[] primaryKeyJoinColumns() default {};
-
- /**
- * (Optional) Unique constraints that are to be placed on the table.
- * These are only used if table generation is in effect.
- */
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicCollection {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the value column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-map">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicMap {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the data column that holds the direct map
- * key. If the name on te key column is "", the name will default to:
- * the name of the property or field; "_KEY".
- */
- Column keyColumn() default @Column;
-
- /**
- * (Optional) Specify the key converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the direct map key.
- */
- Convert keyConverter() default @Convert;
-
- /**
- * (Optional) The name of the data column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
-
- /**
- * (Optional) Specify the value converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the value column mapping.
- */
- Convert valueConverter() default @Convert;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="key-converter" type="xsd:string" minOccurs="0"/>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="value-converter" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum JoinFetchType {
- /**
- * An inner join is used to fetch the related object.
- * This does not allow for null/empty values.
- */
- INNER,
-
- /**
- * An inner join is used to fetch the related object.
- * This allows for null/empty values.
- */
- OUTER,
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="INNER"/>
- <xsd:enumeration value="OUTER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="optimistic-locking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An optimistic-locking element is used to specify the type of
- * optimistic locking EclipseLink should use when updating or deleting
- * entities. An optimistic-locking specification is supported on
- * an entity or mapped-superclass.
- *
- * It is used in conjunction with the optimistic-locking-type.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface OptimisticLocking {
- /**
- * (Optional) The type of optimistic locking policy to use.
- */
- OptimisticLockingType type() default VERSION_COLUMN;
-
- /**
- * (Optional) For an optimistic locking policy of type
- * SELECTED_COLUMNS, this annotation member becomes a (Required)
- * field.
- */
- Column[] selectedColumns() default {};
-
- /**
- * (Optional) Specify where the optimistic locking policy should
- * cascade lock. Currently only supported with VERSION_COLUMN locking.
- */
- boolean cascade() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="selected-column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:optimistic-locking-type"/>
- <xsd:attribute name="cascade" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="optimistic-locking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A simple type that is used within an optimistic-locking
- * specification to specify the type of optimistic-locking that
- * EclipseLink should use when updating or deleting entities.
- */
- public enum OptimisticLockingType {
- /**
- * Using this type of locking policy compares every field in the table
- * in the WHERE clause when doing an update or a delete. If any field
- * has been changed, an optimistic locking exception will be thrown.
- */
- ALL_COLUMNS,
-
- /**
- * Using this type of locking policy compares only the changed fields
- * in the WHERE clause when doing an update. If any field has been
- * changed, an optimistic locking exception will be thrown. A delete
- * will only compare the primary key.
- */
- CHANGED_COLUMNS,
-
- /**
- * Using this type of locking compares selected fields in the WHERE
- * clause when doing an update or a delete. If any field has been
- * changed, an optimistic locking exception will be thrown. Note that
- * the fields specified must be mapped and not be primary keys.
- */
- SELECTED_COLUMNS,
-
- /**
- * Using this type of locking policy compares a single version number
- * in the where clause when doing an update. The version field must be
- * mapped and not be the primary key.
- */
- VERSION_COLUMN
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL_COLUMNS"/>
- <xsd:enumeration value="CHANGED_COLUMNS"/>
- <xsd:enumeration value="SELECTED_COLUMNS"/>
- <xsd:enumeration value="VERSION_COLUMN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The PrimaryKey annotation allows advanced configuration of the Id.
- * A validation policy can be given that allows specifying if zero is a valid id value.
- * The set of primary key columns can also be specified precisely.
- *
- * @author James Sutherland
- * @since EclipseLink 1.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PrimaryKey {
- /**
- * (Optional) Configures what id validation is done.
- * By default 0 is not a valid id value, this can be used to allow 0 id values.
- */
- IdValidation validation() default IdValidation.ZERO;
-
- /**
- * (Optional) Used to specify the primary key columns directly.
- * This can be used instead of @Id if the primary key includes a non basic field,
- * such as a foreign key, or a inheritance discriminator, embedded, or transformation mapped field.
- */
- Column[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="validation" type="orm:id-validation"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="id-validation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The IdValidation enum determines the type value that are valid for an Id.
- * By default null is not allowed, and 0 is not allow for singleton ids of long or int type.
- * The default value is ZERO for singleton ids, and NULL for composite ids.
- * This can be set using the @PrimaryKey annotation, or ClassDescriptor API.
- *
- * @see PrimaryKey
- * @see org.eclipse.persistence.descriptors.ClassDescriptor#setIdValidation(IdValidation)
- * @author James Sutherland
- * @since EclipseLink 1.0
- */
- public enum IdValidation {
- /**
- * Only null is not allowed as an id value, 0 is allowed.
- */
- NULL,
-
- /**
- * null and 0 are not allowed, (only int and long).
- */
- ZERO,
-
- /**
- * No id validation is done.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="NULL"/>
- <xsd:enumeration value="ZERO"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Cache annotation is used to set an
- * org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
- * which sets objects in EclipseLink's identity maps to be invalid
- * following given rules. By default in EclipseLink, objects do not
- * expire in the cache. Several different policies are available to
- * allow objects to expire.
- *
- * @see org.eclipse.persistence.annotations.CacheType
- *
- * A Cache anotation may be defined on an Entity or MappedSuperclass.
- * In the case of inheritance, a Cache annotation should only be defined
- * on the root of the inheritance hierarchy.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Cache {
- /**
- * (Optional) The type of cache to use.
- */
- CacheType type() default SOFT_WEAK;
-
- /**
- * (Optional) The size of cache to use.
- */
- int size() default 100;
-
- /**
- * (Optional) Cached instances in the shared cache or a client
- * isolated cache.
- */
- boolean shared() default true;
-
- /**
- * (Optional) Expire cached instance after a fix period of time (ms).
- * Queries executed against the cache after this will be forced back
- * to the database for a refreshed copy
- */
- int expiry() default -1; // minus one is no expiry.
-
- /**
- * (Optional) Expire cached instance a specific time of day. Queries
- * executed against the cache after this will be forced back to the
- * database for a refreshed copy
- */
- TimeOfDay expiryTimeOfDay() default @TimeOfDay(specified=false);
-
- /**
- * (Optional) Force all queries that go to the database to always
- * refresh the cache.
- */
- boolean alwaysRefresh() default false;
-
- /**
- * (Optional) For all queries that go to the database, refresh the
- * cache only if the data received from the database by a query is
- * newer than the data in the cache (as determined by the optimistic
- * locking field)
- */
- boolean refreshOnlyIfNewer() default false;
-
- /**
- * (Optional) Setting to true will force all queries to bypass the
- * cache for hits but still resolve against the cache for identity.
- * This forces all queries to hit the database.
- */
- boolean disableHits() default false;
-
- /**
- * (Optional) The cache coordination mode.
- */
- CacheCoordinationType coordinationType() default SEND_OBJECT_CHANGES;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="expiry" type="xsd:integer" minOccurs="0"/>
- <xsd:element name="expiry-time-of-day" type="orm:time-of-day" minOccurs="0"/>
- </xsd:choice>
- <xsd:attribute name="size" type="xsd:integer"/>
- <xsd:attribute name="shared" type="xsd:boolean"/>
- <xsd:attribute name="type" type="orm:cache-type"/>
- <xsd:attribute name="always-refresh" type="xsd:boolean"/>
- <xsd:attribute name="refresh-only-if-newer" type="xsd:boolean"/>
- <xsd:attribute name="disable-hits" type="xsd:boolean"/>
- <xsd:attribute name="coordination-type" type="orm:cache-coordination-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The CacheType enum is used with the Cache annotation for a
- * persistent class. It defines the type of IdentityMap/Cache used for
- * the class. By default the SOFT_WEAK cache type is used.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheType {
- /**
- * Provides full caching and guaranteed identity. Caches all objects
- * and does not remove them.
- * WARNING: This method may be memory intensive when many objects are
- * read.
- */
- FULL,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using weak references. This method allows full garbage
- * collection and provides full caching and guaranteed identity.
- */
- WEAK,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using soft references. This method allows full garbage
- * collection when memory is low and provides full caching and
- * guaranteed identity.
- */
- SOFT,
-
- /**
- * Similar to the WEAK identity map except that it maintains a
- * most-frequently-used sub-cache. The size of the sub-cache is
- * proportional to the size of the identity map as specified by
- * descriptor's setIdentityMapSize() method. The sub-cache
- * uses soft references to ensure that these objects are
- * garbage-collected only if the system is low on memory.
- */
- SOFT_WEAK,
-
- /**
- * Identical to the soft cache weak (SOFT_WEAK) identity map except
- * that it uses hard references in the sub-cache. Use this identity
- * map if soft references do not behave properly on your platform.
- */
- HARD_WEAK,
-
- /**
- * A cache identity map maintains a fixed number of objects
- * specified by the application. Objects are removed from the cache
- * on a least-recently-used basis. This method allows object
- * identity for the most commonly used objects.
- * WARNING: Furnishes caching and identity, but does not guarantee
- * identity.
- */
- CACHE,
-
- /**
- * WARNING: Does not preserve object identity and does not cache
- * objects.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="FULL"/>
- <xsd:enumeration value="WEAK"/>
- <xsd:enumeration value="SOFT"/>
- <xsd:enumeration value="SOFT_WEAK"/>
- <xsd:enumeration value="HARD_WEAK"/>
- <xsd:enumeration value="CACHE"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-coordination-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the Cache annotation.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheCoordinationType {
- /**
- * Sends a list of changed objects including data about the changes.
- * This data is merged into the receiving cache.
- */
- SEND_OBJECT_CHANGES,
-
- /**
- * Sends a list of the identities of the objects that have changed.
- * The receiving cache invalidates the objects (rather than changing
- * any of the data)
- */
- INVALIDATE_CHANGED_OBJECTS,
-
- /**
- * Same as SEND_OBJECT_CHANGES except it also includes any newly
- * created objects from the transaction.
- */
- SEND_NEW_OBJECTS_WITH_CHANGES,
-
- /**
- * Does no cache coordination.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SEND_OBJECT_CHANGES"/>
- <xsd:enumeration value="INVALIDATE_CHANGED_OBJECTS"/>
- <xsd:enumeration value="SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="time-of-day">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface TimeOfDay {
- /**
- * (Optional) Hour of the day.
- */
- int hour() default 0;
-
- /**
- * (Optional) Minute of the day.
- */
- int minute() default 0;
-
- /**
- * (Optional) Second of the day.
- */
- int second() default 0;
-
- /**
- * (Optional) Millisecond of the day.
- */
- int millisecond() default 0;
-
- /**
- * Internal use. Do not modify.
- */
- boolean specified() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="hour" type="xsd:integer"/>
- <xsd:attribute name="minute" type="xsd:integer"/>
- <xsd:attribute name="second" type="xsd:integer"/>
- <xsd:attribute name="millisecond" type="xsd:integer"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="change-tracking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The ChangeTracking annotation is used to specify the
- * org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy
- * which computes changes sets for EclipseLink's UnitOfWork commit
- * process. An ObjectChangePolicy is stored on an Entity's descriptor.
- *
- * A ChangeTracking annotation may be specified on an Entity,
- * MappedSuperclass or Embeddable.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ChangeTracking {
- /**
- * (Optional) The type of change tracking to use.
- */
- ChangeTrackingType value() default AUTO;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:change-tracking-type" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="change-tracking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the ChangeTracking annotation.
- */
- public enum ChangeTrackingType {
- /**
- * An ATTRIBUTE change tracking type allows change tracking at the
- * attribute level of an object. Objects with changed attributes will
- * be processed in the commit process to include any changes in the
- * results of the commit. Unchanged objects will be ignored.
- */
- ATTRIBUTE,
-
- /**
- * An OBJECT change tracking policy allows an object to calculate for
- * itself whether it has changed. Changed objects will be processed in
- * the commit process to include any changes in the results of the
- * commit. Unchanged objects will be ignored.
- */
- OBJECT,
-
- /**
- * A DEFERRED change tracking policy defers all change detection to
- * the UnitOfWork's change detection process. Essentially, the
- * calculateChanges() method will run for all objects in a UnitOfWork.
- * This is the default ObjectChangePolicy
- */
- DEFERRED,
-
- /**
- * Will not set any change tracking policy.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ATTRIBUTE"/>
- <xsd:enumeration value="OBJECT"/>
- <xsd:enumeration value="DEFERRED"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="customizer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Customizer annotation is used to specify a class that implements
- * the org.eclipse.persistence.config.DescriptorCustomizer
- * interface and is to run against an enetity's class descriptor after all
- * metadata processing has been completed.
- *
- * The Customizer annotation may be defined on an Entity, MappedSuperclass
- * or Embeddable class. In the case of inheritance, a Customizer is not
- * inherited from its parent classes.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Customizer {
- /**
- * (Required) Defines the name of the descriptor customizer class that
- * should be applied for the related entity or embeddable class.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredProcedureQuery annotation allows the definition of
- * queries that call stored procedures as named queries.
-
- * A NamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Whether the query should return a result set.
- */
- boolean returnsResultSet() default true;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0"
- maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- <xsd:attribute name="returns-result-set" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="stored-procedure-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A StoredProcedureParameter annotation is used within a
- * NamedStoredProcedureQuery annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface StoredProcedureParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Optional) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Required) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) The type of Java class desired back from the procedure,
- * this is dependent on the type returned from the procedure.
- */
- Class type() default void.class;
-
- /**
- * (Optional) The JDBC type code, this dependent on the type returned
- * from the procedure.
- */
- int jdbcType() default -1;
-
- /**
- * (Optional) The JDBC type name, this may be required for ARRAY or
- * STRUCT types.
- */
- String jdbcTypeName() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="query-parameter" type="xsd:string" use="required"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="jdbc-type" type="xsd:integer"/>
- <xsd:attribute name="jdbc-type-name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="direction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the StoredProcedureParameter annotation.
- * It is used to specify the direction of the stored procedure
- * parameters of a named stored procedure query.
- */
- public enum Direction {
- /**
- * Input parameter
- */
- IN,
-
- /**
- * Output parameter
- */
- OUT,
-
- /**
- * Input and output parameter
- */
- IN_OUT,
-
- /**
- * Output cursor
- */
- OUT_CURSOR
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="IN_OUT"/>
- <xsd:enumeration value="OUT_CURSOR"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="variable-one-to-one">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Variable one to one mappings are used to represent a pointer
- * references between a java object and an implementer of an interface.
- * This mapping is usually represented by a single pointer (stored in an
- * instance variable) between the source and target objects. In the
- * relational database tables, these mappings are normally implemented
- * using a foreign key and a type code.
- *
- * A VariableOneToOne can be specified within an Entity,
- * MappedSuperclass and Embeddable class.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface VariableOneToOne {
- /**
- * (Optional) The interface class that is the target of the
- * association. If not specified it will be inferred from the type
- * of the object being referenced.
- */
- Class targetInterface() default void.class;
-
- /**
- * (Optional) The operations that must be cascaded to the target of
- * the association.
- */
- CascadeType[] cascade() default {};
-
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) Whether the association is optional. If set to false
- * then a non-null relationship must always exist.
- */
- boolean optional() default true;
-
- /**
- * (Optional) The discriminator column will hold the type
- * indicators. If the DiscriminatorColumn is not specified, the name
- * of the discriminator column defaults to "DTYPE" and the
- * discriminator type to STRING.
- */
- DiscriminatorColumn discriminatorColumn() default @DiscriminatorColumn;
-
- /**
- * (Optional) The list of discriminator types that can be used with
- * this VariableOneToOne. If none are specified then those entities
- * within the persistence unit that implement the target interface
- * will be added to the list of types. The discriminator type will
- * default as follows:
- * - If DiscriminatorColumn type is STRING: Entity.name()
- * - If DiscriminatorColumn type is CHAR: First letter of the
- * Entity class
- * - If DiscriminatorColumn type is INTEGER: The next integer after
- * the highest integer explicitly added.
- */
- DiscriminatorClass[] discriminatorClasses() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="discriminator-class" type="orm:discriminator-class" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-interface" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-class">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A DiscriminatorClass is used within a VariableOneToOne annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface DiscriminatorClass {
- /**
- * (Required) The discriminator to be stored on the database.
- */
- String discriminator();
-
- /**
- * (Required) The class to the instantiated with the given
- * discriminator.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="discriminator" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="existence-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * The ExistenceChecking annotation is used to specify the type of
- * checking EclipseLink should use when updating entities.
- *
- * An existence-checking specification is supported on an Entity or
- * MappedSuperclass annotation.
- */
- public @interface ExistenceChecking {
- /**
- * (Optional) Set the existence check for determining
- * if an insert or update should occur for an object.
- */
- ExistenceType value() default CHECK_CACHE;
- }
-
- /**
- * Assume that if the objects primary key does not include null and
- * it is in the cache, then it must exist.
- */
- CHECK_CACHE,
-
- /**
- * Perform does exist check on the database.
- */
- CHECK_DATABASE,
-
- /**
- * Assume that if the objects primary key does not include null then
- * it must exist. This may be used if the application guarantees or
- * does not care about the existence check.
- */
- ASSUME_EXISTENCE,
-
- /**
- * Assume that the object does not exist. This may be used if the
- * application guarantees or does not care about the existence check.
- * This will always force an insert to be called.
- */
- ASSUME_NON_EXISTENCE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="CHECK_CACHE" />
- <xsd:enumeration value="CHECK_DATABASE" />
- <xsd:enumeration value="ASSUME_EXISTENCE" />
- <xsd:enumeration value="ASSUME_NON_EXISTENCE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-</xsd:schema>
-
-
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_2.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_2.xsd
deleted file mode 100644
index f7c2b26770..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_1_2.xsd
+++ /dev/null
@@ -1,3519 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2009 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.2">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)eclipselink_orm_1_2.xsd 1.0 February 1 2008
- </xsd:documentation>
- </xsd:annotation>
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the native Eclipselink XML mapping file
- The file may be named "META-INF/eclipselink-orm.xml" in the persistence
- archive or it may be named some other name which would be
- used to locate the file as resource on the classpath.
- Object/relational mapping files must indicate the object/relational
- mapping file schema by using the persistence namespace:
-
- http://www.eclipse.org/eclipselink/xsds/persistence/orm
-
- and indicate the version of the schema by using the version element as shown below:
-
- <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm
- eclipselink_orm_1_2.xsd
- version="1.2">
- ...
- </entity-mappings>
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="emptyType"/>
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="access-methods">
- <xsd:annotation>
- <xsd:documentation>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="get-method" type="xsd:string" use="required"/>
- <xsd:attribute name="set-method" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Cache annotation is used to set an
- * org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
- * which sets objects in EclipseLink's identity maps to be invalid
- * following given rules. By default in EclipseLink, objects do not
- * expire in the cache. Several different policies are available to
- * allow objects to expire.
- *
- * @see org.eclipse.persistence.annotations.CacheType
- *
- * A Cache anotation may be defined on an Entity or MappedSuperclass.
- * In the case of inheritance, a Cache annotation should only be defined
- * on the root of the inheritance hierarchy.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Cache {
- /**
- * (Optional) The type of cache to use.
- */
- CacheType type() default SOFT_WEAK;
-
- /**
- * (Optional) The size of cache to use.
- */
- int size() default 100;
-
- /**
- * (Optional) Cached instances in the shared cache or a client
- * isolated cache.
- */
- boolean shared() default true;
-
- /**
- * (Optional) Expire cached instance after a fix period of time (ms).
- * Queries executed against the cache after this will be forced back
- * to the database for a refreshed copy
- */
- int expiry() default -1; // minus one is no expiry.
-
- /**
- * (Optional) Expire cached instance a specific time of day. Queries
- * executed against the cache after this will be forced back to the
- * database for a refreshed copy
- */
- TimeOfDay expiryTimeOfDay() default @TimeOfDay(specified=false);
-
- /**
- * (Optional) Force all queries that go to the database to always
- * refresh the cache.
- */
- boolean alwaysRefresh() default false;
-
- /**
- * (Optional) For all queries that go to the database, refresh the
- * cache only if the data received from the database by a query is
- * newer than the data in the cache (as determined by the optimistic
- * locking field)
- */
- boolean refreshOnlyIfNewer() default false;
-
- /**
- * (Optional) Setting to true will force all queries to bypass the
- * cache for hits but still resolve against the cache for identity.
- * This forces all queries to hit the database.
- */
- boolean disableHits() default false;
-
- /**
- * (Optional) The cache coordination mode.
- */
- CacheCoordinationType coordinationType() default SEND_OBJECT_CHANGES;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="expiry" type="xsd:integer" minOccurs="0"/>
- <xsd:element name="expiry-time-of-day" type="orm:time-of-day" minOccurs="0"/>
- </xsd:choice>
- <xsd:attribute name="size" type="xsd:integer"/>
- <xsd:attribute name="shared" type="xsd:boolean"/>
- <xsd:attribute name="type" type="orm:cache-type"/>
- <xsd:attribute name="always-refresh" type="xsd:boolean"/>
- <xsd:attribute name="refresh-only-if-newer" type="xsd:boolean"/>
- <xsd:attribute name="disable-hits" type="xsd:boolean"/>
- <xsd:attribute name="coordination-type" type="orm:cache-coordination-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The CacheType enum is used with the Cache annotation for a
- * persistent class. It defines the type of IdentityMap/Cache used for
- * the class. By default the SOFT_WEAK cache type is used.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheType {
- /**
- * Provides full caching and guaranteed identity. Caches all objects
- * and does not remove them.
- * WARNING: This method may be memory intensive when many objects are
- * read.
- */
- FULL,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using weak references. This method allows full garbage
- * collection and provides full caching and guaranteed identity.
- */
- WEAK,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using soft references. This method allows full garbage
- * collection when memory is low and provides full caching and
- * guaranteed identity.
- */
- SOFT,
-
- /**
- * Similar to the WEAK identity map except that it maintains a
- * most-frequently-used sub-cache. The size of the sub-cache is
- * proportional to the size of the identity map as specified by
- * descriptor's setIdentityMapSize() method. The sub-cache
- * uses soft references to ensure that these objects are
- * garbage-collected only if the system is low on memory.
- */
- SOFT_WEAK,
-
- /**
- * Identical to the soft cache weak (SOFT_WEAK) identity map except
- * that it uses hard references in the sub-cache. Use this identity
- * map if soft references do not behave properly on your platform.
- */
- HARD_WEAK,
-
- /**
- * A cache identity map maintains a fixed number of objects
- * specified by the application. Objects are removed from the cache
- * on a least-recently-used basis. This method allows object
- * identity for the most commonly used objects.
- * WARNING: Furnishes caching and identity, but does not guarantee
- * identity.
- */
- CACHE,
-
- /**
- * WARNING: Does not preserve object identity and does not cache
- * objects.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="FULL"/>
- <xsd:enumeration value="WEAK"/>
- <xsd:enumeration value="SOFT"/>
- <xsd:enumeration value="SOFT_WEAK"/>
- <xsd:enumeration value="HARD_WEAK"/>
- <xsd:enumeration value="CACHE"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-coordination-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the Cache annotation.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheCoordinationType {
- /**
- * Sends a list of changed objects including data about the changes.
- * This data is merged into the receiving cache.
- */
- SEND_OBJECT_CHANGES,
-
- /**
- * Sends a list of the identities of the objects that have changed.
- * The receiving cache invalidates the objects (rather than changing
- * any of the data)
- */
- INVALIDATE_CHANGED_OBJECTS,
-
- /**
- * Same as SEND_OBJECT_CHANGES except it also includes any newly
- * created objects from the transaction.
- */
- SEND_NEW_OBJECTS_WITH_CHANGES,
-
- /**
- * Does no cache coordination.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SEND_OBJECT_CHANGES"/>
- <xsd:enumeration value="INVALIDATE_CHANGED_OBJECTS"/>
- <xsd:enumeration value="SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="change-tracking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The ChangeTracking annotation is used to specify the
- * org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy
- * which computes changes sets for EclipseLink's UnitOfWork commit
- * process. An ObjectChangePolicy is stored on an Entity's descriptor.
- *
- * A ChangeTracking annotation may be specified on an Entity,
- * MappedSuperclass or Embeddable.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ChangeTracking {
- /**
- * (Optional) The type of change tracking to use.
- */
- ChangeTrackingType value() default AUTO;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:change-tracking-type" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="change-tracking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the ChangeTracking annotation.
- */
- public enum ChangeTrackingType {
- /**
- * An ATTRIBUTE change tracking type allows change tracking at the
- * attribute level of an object. Objects with changed attributes will
- * be processed in the commit process to include any changes in the
- * results of the commit. Unchanged objects will be ignored.
- */
- ATTRIBUTE,
-
- /**
- * An OBJECT change tracking policy allows an object to calculate for
- * itself whether it has changed. Changed objects will be processed in
- * the commit process to include any changes in the results of the
- * commit. Unchanged objects will be ignored.
- */
- OBJECT,
-
- /**
- * A DEFERRED change tracking policy defers all change detection to
- * the UnitOfWork's change detection process. Essentially, the
- * calculateChanges() method will run for all objects in a UnitOfWork.
- * This is the default ObjectChangePolicy
- */
- DEFERRED,
-
- /**
- * Will not set any change tracking policy.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ATTRIBUTE"/>
- <xsd:enumeration value="OBJECT"/>
- <xsd:enumeration value="DEFERRED"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="customizer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Customizer annotation is used to specify a class that implements
- * the org.eclipse.persistence.config.DescriptorCustomizer
- * interface and is to run against an enetity's class descriptor after all
- * metadata processing has been completed.
- *
- * The Customizer annotation may be defined on an Entity, MappedSuperclass
- * or Embeddable class. In the case of inheritance, a Customizer is not
- * inherited from its parent classes.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Customizer {
- /**
- * (Required) Defines the name of the descriptor customizer class that
- * should be applied for the related entity or embeddable class.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="direction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the StoredProcedureParameter annotation.
- * It is used to specify the direction of the stored procedure
- * parameters of a named stored procedure query.
- */
- public enum Direction {
- /**
- * Input parameter
- */
- IN,
-
- /**
- * Output parameter
- */
- OUT,
-
- /**
- * Input and output parameter
- */
- IN_OUT,
-
- /**
- * Output cursor
- */
- OUT_CURSOR
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="IN_OUT"/>
- <xsd:enumeration value="OUT_CURSOR"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of an mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query, named-native-query, or
- result-set-mapping of the same name in the same or different mapping
- files in a persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata" type="orm:persistence-unit-metadata" minOccurs="0"/>
- <xsd:element name="package" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string" minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping" type="orm:sql-result-set-mapping" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType" fixed="1.2" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="existence-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * The ExistenceChecking annotation is used to specify the type of
- * checking EclipseLink should use when updating entities.
- *
- * An existence-checking specification is supported on an Entity or
- * MappedSuperclass annotation.
- */
- public @interface ExistenceChecking {
-
- /**
- * (Optional) Set the existence check for determining
- * if an insert or update should occur for an object.
- */
- ExistenceType value() default CHECK_CACHE;
- }
-
- /**
- * Assume that if the objects primary key does not include null and
- * it is in the cache, then it must exist.
- */
- CHECK_CACHE,
-
- /**
- * Perform does exist check on the database.
- */
- CHECK_DATABASE,
-
- /**
- * Assume that if the objects primary key does not include null then
- * it must exist. This may be used if the application guarantees or
- * does not care about the existence check.
- */
- ASSUME_EXISTENCE,
-
- /**
- * Assume that the object does not exist. This may be used if the
- * application guarantees or does not care about the existence check.
- * This will always force an insert to be called.
- */
- ASSUME_NON_EXISTENCE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="CHECK_CACHE"/>
- <xsd:enumeration value="CHECK_DATABASE"/>
- <xsd:enumeration value="ASSUME_EXISTENCE"/>
- <xsd:enumeration value="ASSUME_NON_EXISTENCE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified,
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="exclude-default-mappings" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults" type="orm:persistence-unit-defaults" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables, secondary tables,
- collection tables, sequence generators, and table generators
- that apply to the persistence unit
- catalog - Used as the catalog for all tables, secondary tables,
- collection tables, sequence generators, and table generators
- that apply to the persistence unit
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in all entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string" minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string" minOccurs="0"/>
- <xsd:element name="delimited-identifiers" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its sub-elements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="table" type="orm:table" minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:element name="discriminator-value" type="orm:discriminator-value" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping" type="orm:sql-result-set-mapping" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist" minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns() default{};
- JoinTable joinTable() default @JoinTable;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="id" type="orm:id" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-collection" type="orm:basic-collection" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-map" type="orm:basic-map" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="variable-one-to-one" type="orm:variable-one-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection" type="orm:element-collection" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transformation" type="orm:transformation" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="lob" type="orm:lob"/>
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicCollection {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the value column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-map">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicMap {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the data column that holds the direct map
- * key. If the name on te key column is "", the name will default to:
- * the name of the property or field; "_KEY".
- */
- Column keyColumn() default @Column;
-
- /**
- * (Optional) Specify the key converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the direct map key.
- */
- Convert keyConverter() default @Convert;
-
- /**
- * (Optional) The name of the data column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
-
- /**
- * (Optional) Specify the value converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the value column mapping.
- */
- Convert valueConverter() default @Convert;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="key-converter" type="xsd:string" minOccurs="0"/>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="value-converter" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CloneCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.CloneCopyPolicy on an
- * Entity. A CloneCopyPolicy must specify at one or both of the "method"
- * or "workingCopyMethod". "workingCopyMethod" is used to clone objects
- * that will be returned to the user as they are registered in
- * EclipseLink's transactional mechanism, the UnitOfWork. "method" will
- * be used for the clone that is used for comparison in conjunction with
- * EclipseLink's DeferredChangeDetectionPolicy
- *
- * A CloneCopyPolicy should be specified on an Entity, MappedSuperclass
- * or Embeddable.
- *
- * Example:
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod", workingCopyMethod="myWorkingCopyCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(workingCopyMethodName="myWorkingCopyClone")
- */
- public @interface CloneCopyPolicy {
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified this defines
- * a method that will be used to create a clone that will be used
- * for comparison by
- * EclipseLink's DeferredChangeDetectionPolicy
- */
- String method();
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified
- * this defines a method that will be used to create a clone that
- * will be used to create the object returned when registering an
- * Object in an EclipseLink UnitOfWork
- */
- String workingCopyMethod();
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method" type="xsd:string"/>
- <xsd:attribute name="working-copy-method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface CollectionTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="eclipselink-collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface CollectionTable {
- /**
- * (Optional) The name of the collection table. If it is not
- * specified, it is defaulted to the concatenation of the following:
- * the name of the source entity; "_" ; the name of the relationship
- * property or field of the source entity.
- */
- String name() default "";
-
- /**
- * (Optional) The catalog of the table. It defaults to the persistence
- * unit default catalog.
- */
- String catalog() default "";
-
- /**
- * (Optional) The schema of the table. It defaults to the persistence
- * unit default schema.
- */
- String schema() default "";
-
- /**
- * (Optional) Used to specify a primary key column that is used as a
- * foreign key to join to another table. If the source entity uses a
- * composite primary key, a primary key join column must be specified
- * for each field of the composite primary key. In a single primary
- * key case, a primary key join column may optionally be specified.
- * Defaulting will apply otherwise as follows:
- * name, the same name as the primary key column of the primary table
- * of the source entity. referencedColumnName, the same name of
- * primary key column of the primary table of the source entity.
- */
- PrimaryKeyJoinColumn[] primaryKeyJoinColumns() default {};
-
- /**
- * (Optional) Unique constraints that are to be placed on the table.
- * These are only used if table generation is in effect.
- */
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="conversion-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface ConversionValue {
- /**
- * (Required) Specify the database value.
- */
- String dataValue();
-
- /**
- * (Required) Specify the object value.
- */
- String objectValue();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="data-value" type="xsd:string" use="required"/>
- <xsd:attribute name="object-value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Converter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must implement
- * the org.eclipse.persistence.mappings.converters.Converter interface.
- */
- Class converterClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CopyPolicy is used to set a
- * org.eclipse.persistence.descriptors.copying.CopyPolicy on an Entity.
- * It is required that a class that implements
- * org.eclipse.persistence.descriptors.copying.CopyPolicy be specified
- * as the argument.
- *
- * A CopyPolicy should be specified on an Entity, MappedSuperclass or
- * Embeddable.
- *
- * For instance:
- * @Entity
- * @CopyPolicy("example.MyCopyPolicy")
- */
- public @interface CopyPolicy {
-
- /*
- * (Required)
- * This defines the class of the copy policy. It must specify a class
- * that implements org.eclipse.persistence.descriptors.copying.CopyPolicy
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-class">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A DiscriminatorClass is used within a VariableOneToOne annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface DiscriminatorClass {
- /**
- * (Required) The discriminator to be stored on the database.
- */
- String discriminator();
-
- /**
- * (Required) The class to the instantiated with the given
- * discriminator.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="discriminator" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="element-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ElementCollection {
- Class targetClass() default void.class;
- FetchType fetch() default LAZY;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column" minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="map-key-enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column" minOccurs="0"/>
- <xsd:element name="map-key-join-column" type="orm:map-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-class" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist" minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="id-validation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The IdValidation enum determines the type value that are valid for an Id.
- * By default null is not allowed, and 0 is not allow for singleton ids of long or int type.
- * The default value is ZERO for singleton ids, and NULL for composite ids.
- * This can be set using the @PrimaryKey annotation, or ClassDescriptor API.
- *
- * @see PrimaryKey
- * @see org.eclipse.persistence.descriptors.ClassDescriptor#setIdValidation(IdValidation)
- * @author James Sutherland
- * @since EclipseLink 1.0
- */
- public enum IdValidation {
- /**
- * Only null is not allowed as an id value, 0 is allowed.
- */
- NULL,
-
- /**
- * null and 0 are not allowed, (only int and long).
- */
- ZERO,
-
- /**
- * No id validation is done.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="NULL"/>
- <xsd:enumeration value="ZERO"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType { SINGLE_TABLE, JOINED, TABLE_PER_CLASS };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * An InstantiationCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy
- * on an Entity. InstantiationCopyPolicy is the default CopyPolicy in
- * EclipseLink and therefore this configuration option is only used to
- * override other types of copy policies
- *
- * An InstantiationCopyPolicy should be specified on an Entity,
- * MappedSuperclass or Embeddable.
- *
- * Example:
- * @Entity
- * @InstantiationCopyPolicy
- */
- public @interface InstantiationCopyPolicy {
- }
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum JoinFetchType {
- /**
- * An inner join is used to fetch the related object.
- * This does not allow for null/empty values.
- */
- INNER,
-
- /**
- * An inner join is used to fetch the related object.
- * This allows for null/empty values.
- */
- OUTER,
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="INNER"/>
- <xsd:enumeration value="OUTER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="lock-mode-type">
- <xsd:annotation>
- <xsd:documentation>
- public enum LockModeType { READ, WRITE, OPTIMISTIC,
- OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE,
- PESSIMISTIC_FORCE_INCREMENT, NONE};
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="WRITE"/>
- <xsd:enumeration value="OPTIMISTIC"/>
- <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="PESSIMISTIC_READ"/>
- <xsd:enumeration value="PESSIMISTIC_WRITE"/>
- <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column" minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="map-key-enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column" minOccurs="0"/>
- <xsd:element name="map-key-join-column" type="orm:map-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyColumn {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist" minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredProcedureQuery annotation allows the definition of
- * queries that call stored procedures as named queries.
- * A NamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Whether the query should return a result set.
- */
- boolean returnsResultSet() default true;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- <xsd:attribute name="returns-result-set" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ObjectTypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence
- * field or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent
- * field or property.
- */
- Class objectType() default void.class;
-
- /**
- * (Required) Specify the conversion values to be used
- * with the object converter.
- */
- ConversionValue[] conversionValues();
-
- /**
- * (Optional) Specify a default object value. Used for
- * legacy data if the data value is missing.
- */
- String defaultObjectValue() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="conversion-value" type="orm:conversion-value" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="default-object-value" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column" minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="map-key-enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column" minOccurs="0"/>
- <xsd:element name="map-key-join-column" type="orm:map-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- boolean orphanRemoval() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="mapped-by-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="optimistic-locking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An optimistic-locking element is used to specify the type of
- * optimistic locking EclipseLink should use when updating or deleting
- * entities. An optimistic-locking specification is supported on
- * an entity or mapped-superclass.
- *
- * It is used in conjunction with the optimistic-locking-type.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface OptimisticLocking {
- /**
- * (Optional) The type of optimistic locking policy to use.
- */
- OptimisticLockingType type() default VERSION_COLUMN;
-
- /**
- * (Optional) For an optimistic locking policy of type
- * SELECTED_COLUMNS, this annotation member becomes a (Required)
- * field.
- */
- Column[] selectedColumns() default {};
-
- /**
- * (Optional) Specify where the optimistic locking policy should
- * cascade lock. Currently only supported with VERSION_COLUMN locking.
- */
- boolean cascade() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="selected-column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:optimistic-locking-type"/>
- <xsd:attribute name="cascade" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="optimistic-locking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A simple type that is used within an optimistic-locking
- * specification to specify the type of optimistic-locking that
- * EclipseLink should use when updating or deleting entities.
- */
- public enum OptimisticLockingType {
- /**
- * Using this type of locking policy compares every field in the table
- * in the WHERE clause when doing an update or a delete. If any field
- * has been changed, an optimistic locking exception will be thrown.
- */
- ALL_COLUMNS,
-
- /**
- * Using this type of locking policy compares only the changed fields
- * in the WHERE clause when doing an update. If any field has been
- * changed, an optimistic locking exception will be thrown. A delete
- * will only compare the primary key.
- */
- CHANGED_COLUMNS,
-
- /**
- * Using this type of locking compares selected fields in the WHERE
- * clause when doing an update or a delete. If any field has been
- * changed, an optimistic locking exception will be thrown. Note that
- * the fields specified must be mapped and not be primary keys.
- */
- SELECTED_COLUMNS,
-
- /**
- * Using this type of locking policy compares a single version number
- * in the where clause when doing an update. The version field must be
- * mapped and not be the primary key.
- */
- VERSION_COLUMN
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL_COLUMNS"/>
- <xsd:enumeration value="CHANGED_COLUMNS"/>
- <xsd:enumeration value="SELECTED_COLUMNS"/>
- <xsd:enumeration value="VERSION_COLUMN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="order-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderColumn {
- String name() default "";
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="validation-mode" type="orm:order-column-validation-mode"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-column-validation-mode">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum OrderColumnValidationMode {
- NONE,
- CORRECTION,
- EXCEPTION
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="NONE"/>
- <xsd:enumeration value="CORRECTION"/>
- <xsd:enumeration value="EXCEPTION"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The PrimaryKey annotation allows advanced configuration of the Id.
- * A validation policy can be given that allows specifying if zero is a valid id value.
- * The set of primary key columns can also be specified precisely.
- *
- * @author James Sutherland
- * @since EclipseLink 1.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PrimaryKey {
- /**
- * (Optional) Configures what id validation is done.
- * By default 0 is not a valid id value, this can be used to allow 0 id values.
- */
- IdValidation validation() default IdValidation.ZERO;
-
- /**
- * (Optional) Used to specify the primary key columns directly.
- * This can be used instead of @Id if the primary key includes a non basic field,
- * such as a foreign key, or a inheritance discriminator, embedded, or transformation mapped field.
- */
- Column[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="validation" type="orm:id-validation"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>
-
- A user defined mapping's property.
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Property {
- /**
- * Property name.
- */
- String name();
-
- /**
- * String representation of Property value,
- * converted to an instance of valueType.
- */
- String value();
-
- /**
- * Property value type.
- * The value converted to valueType by ConversionManager.
- * If specified must be a simple type that could be handled by
- * ConversionManager:
- * numerical, boolean, temporal.
- */
- Class valueType() default String.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="read-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * Unless the TransformationMapping is write-only, it should have a
- * ReadTransformer, it defines transformation of database column(s)
- * value(s)into attribute value.
- *
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReadTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.AttributeTransformer
- * interface. The class will be instantiated, its
- * buildAttributeValue will be used to create the value to be
- * assigned to the attribute.
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be assigned to the attribute (not assigns the value to
- * the attribute). Either transformerClass or method must be
- * specified, but not both.
- */
- String method() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- String catalog() default "";
- String schema() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="entity-result" type="orm:entity-result" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="stored-procedure-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A StoredProcedureParameter annotation is used within a
- * NamedStoredProcedureQuery annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface StoredProcedureParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Optional) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Required) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) The type of Java class desired back from the procedure,
- * this is dependent on the type returned from the procedure.
- */
- Class type() default void.class;
-
- /**
- * (Optional) The JDBC type code, this dependent on the type returned
- * from the procedure.
- */
- int jdbcType() default -1;
-
- /**
- * (Optional) The JDBC type name, this may be required for ARRAY or
- * STRUCT types.
- */
- String jdbcTypeName() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="query-parameter" type="xsd:string" use="required"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="jdbc-type" type="xsd:integer"/>
- <xsd:attribute name="jdbc-type-name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface StructConverter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must
- * implement the EclipseLink interface
- * org.eclipse.persistence.mappings.converters.Converter
- */
- String converter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="converter" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="time-of-day">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface TimeOfDay {
- /**
- * (Optional) Hour of the day.
- */
- int hour() default 0;
-
- /**
- * (Optional) Minute of the day.
- */
- int minute() default 0;
-
- /**
- * (Optional) Second of the day.
- */
- int second() default 0;
-
- /**
- * (Optional) Millisecond of the day.
- */
- int millisecond() default 0;
-
- /**
- * Internal use. Do not modify.
- */
- boolean specified() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="hour" type="xsd:integer"/>
- <xsd:attribute name="minute" type="xsd:integer"/>
- <xsd:attribute name="second" type="xsd:integer"/>
- <xsd:attribute name="millisecond" type="xsd:integer"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transformation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Transformation is an optional annotation for
- * org.eclipse.persistence.mappings.TransformationMapping.
- * TransformationMapping allows to map an attribute to one or more
- * database columns.
- *
- * Transformation annotation is an optional part of
- * TransformationMapping definition. Unless the TransformationMapping is
- * write-only, it should have a ReadTransformer, it defines
- * transformation of database column(s) value(s)into attribute value.
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Transformation {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) The optional element is a hint as to whether the value
- * of the field or property may be null. It is disregarded
- * for primitive types, which are considered non-optional.
- */
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="read-transformer" type="orm:read-transformer"/>
- <xsd:element name="write-transformer" type="orm:write-transformer" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface TypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence field
- * or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent field
- * or property.
- */
- Class objectType() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String name() default "";
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" minOccurs="0"/>
- <xsd:element name="column-name" type="xsd:string" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="variable-one-to-one">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Variable one to one mappings are used to represent a pointer
- * references between a java object and an implementer of an interface.
- * This mapping is usually represented by a single pointer (stored in an
- * instance variable) between the source and target objects. In the
- * relational database tables, these mappings are normally implemented
- * using a foreign key and a type code.
- *
- * A VariableOneToOne can be specified within an Entity,
- * MappedSuperclass and Embeddable class.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface VariableOneToOne {
- /**
- * (Optional) The interface class that is the target of the
- * association. If not specified it will be inferred from the type
- * of the object being referenced.
- */
- Class targetInterface() default void.class;
-
- /**
- * (Optional) The operations that must be cascaded to the target of
- * the association.
- */
- CascadeType[] cascade() default {};
-
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) Whether the association is optional. If set to false
- * then a non-null relationship must always exist.
- */
- boolean optional() default true;
-
- /**
- * (Optional) The discriminator column will hold the type
- * indicators. If the DiscriminatorColumn is not specified, the name
- * of the discriminator column defaults to "DTYPE" and the
- * discriminator type to STRING.
- */
- DiscriminatorColumn discriminatorColumn() default @DiscriminatorColumn;
-
- /**
- * (Optional) The list of discriminator types that can be used with
- * this VariableOneToOne. If none are specified then those entities
- * within the persistence unit that implement the target interface
- * will be added to the list of types. The discriminator type will
- * default as follows:
- * - If DiscriminatorColumn type is STRING: Entity.name()
- * - If DiscriminatorColumn type is CHAR: First letter of the
- * Entity class
- * - If DiscriminatorColumn type is INTEGER: The next integer after
- * the highest integer explicitly added.
- */
- DiscriminatorClass[] discriminatorClasses() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="discriminator-class" type="orm:discriminator-class" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-interface" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="write-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- *
- * A single WriteTransformer may be specified directly on the method or
- * attribute. Multiple WriteTransformers should be wrapped into
- * WriteTransformers annotation. No WriteTransformers specified for
- * read-only mapping. Unless the TransformationMapping is write-only, it
- * should have a ReadTransformer, it defines transformation of database
- * column(s) value(s)into attribute value.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface WriteTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.FieldTransformer
- * interface. The class will be instantiated, its buildFieldValue
- * will be used to create the value to be written into the database
- * column. Note that for ddl generation and returning to be
- * supported the method buildFieldValue in the class should be
- * defined to return the relevant Java type, not just Object as
- * defined in the interface, for instance:
- * public Time buildFieldValue(Object instance, String fieldName, Session session).
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be written into the database column.
- * Note that for ddl generation and returning to be supported the
- * method should be defined to return a particular type, not just
- * Object, for instance:
- * public Time getStartTime().
- * The method may require a Transient annotation to avoid being
- * mapped as Basic by default.
- * Either transformerClass or method must be specified, but not both.
- */
- String method() default "";
-
- /**
- * Specify here the column into which the value should be written.
- * The only case when this could be skipped is if a single
- * WriteTransformer annotates an attribute - the attribute's name
- * will be used as a column name.
- */
- Column column() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
-</xsd:schema> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_0.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_0.xsd
deleted file mode 100644
index 2aa23acf3e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_0.xsd
+++ /dev/null
@@ -1,3625 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
- tware - update version number to 2.0
-*****************************************************************************/
--->
-
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)eclipselink_orm_2_0.xsd 2.0 October 5 2008
- </xsd:documentation>
- </xsd:annotation>
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the native Eclipselink XML mapping file
- The file may be named "META-INF/eclipselink-orm.xml" in the persistence
- archive or it may be named some other name which would be
- used to locate the file as resource on the classpath.
- Object/relational mapping files must indicate the object/relational
- mapping file schema by using the persistence namespace:
-
- http://www.eclipse.org/eclipselink/xsds/persistence/orm
-
- and indicate the version of the schema by using the version element as shown below:
-
- <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm
- eclipselink_orm_2_0.xsd
- version="2.0">
- ...
- </entity-mappings>
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="emptyType"/>
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="access-methods">
- <xsd:annotation>
- <xsd:documentation>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="get-method" type="xsd:string" use="required"/>
- <xsd:attribute name="set-method" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Cache annotation is used to set an
- * org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
- * which sets objects in EclipseLink's identity maps to be invalid
- * following given rules. By default in EclipseLink, objects do not
- * expire in the cache. Several different policies are available to
- * allow objects to expire.
- *
- * @see org.eclipse.persistence.annotations.CacheType
- *
- * A Cache anotation may be defined on an Entity or MappedSuperclass.
- * In the case of inheritance, a Cache annotation should only be defined
- * on the root of the inheritance hierarchy.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Cache {
- /**
- * (Optional) The type of cache to use.
- */
- CacheType type() default SOFT_WEAK;
-
- /**
- * (Optional) The size of cache to use.
- */
- int size() default 100;
-
- /**
- * (Optional) Cached instances in the shared cache or a client
- * isolated cache.
- */
- boolean shared() default true;
-
- /**
- * (Optional) Expire cached instance after a fix period of time (ms).
- * Queries executed against the cache after this will be forced back
- * to the database for a refreshed copy
- */
- int expiry() default -1; // minus one is no expiry.
-
- /**
- * (Optional) Expire cached instance a specific time of day. Queries
- * executed against the cache after this will be forced back to the
- * database for a refreshed copy
- */
- TimeOfDay expiryTimeOfDay() default @TimeOfDay(specified=false);
-
- /**
- * (Optional) Force all queries that go to the database to always
- * refresh the cache.
- */
- boolean alwaysRefresh() default false;
-
- /**
- * (Optional) For all queries that go to the database, refresh the
- * cache only if the data received from the database by a query is
- * newer than the data in the cache (as determined by the optimistic
- * locking field)
- */
- boolean refreshOnlyIfNewer() default false;
-
- /**
- * (Optional) Setting to true will force all queries to bypass the
- * cache for hits but still resolve against the cache for identity.
- * This forces all queries to hit the database.
- */
- boolean disableHits() default false;
-
- /**
- * (Optional) The cache coordination mode.
- */
- CacheCoordinationType coordinationType() default SEND_OBJECT_CHANGES;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="expiry" type="xsd:integer" minOccurs="0"/>
- <xsd:element name="expiry-time-of-day" type="orm:time-of-day" minOccurs="0"/>
- </xsd:choice>
- <xsd:attribute name="size" type="xsd:integer"/>
- <xsd:attribute name="shared" type="xsd:boolean"/>
- <xsd:attribute name="type" type="orm:cache-type"/>
- <xsd:attribute name="always-refresh" type="xsd:boolean"/>
- <xsd:attribute name="refresh-only-if-newer" type="xsd:boolean"/>
- <xsd:attribute name="disable-hits" type="xsd:boolean"/>
- <xsd:attribute name="coordination-type" type="orm:cache-coordination-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache-interceptor">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface CacheInterceptor {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
- <!-- **************************************************** -->
-
-
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The CacheType enum is used with the Cache annotation for a
- * persistent class. It defines the type of IdentityMap/Cache used for
- * the class. By default the SOFT_WEAK cache type is used.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheType {
- /**
- * Provides full caching and guaranteed identity. Caches all objects
- * and does not remove them.
- * WARNING: This method may be memory intensive when many objects are
- * read.
- */
- FULL,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using weak references. This method allows full garbage
- * collection and provides full caching and guaranteed identity.
- */
- WEAK,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using soft references. This method allows full garbage
- * collection when memory is low and provides full caching and
- * guaranteed identity.
- */
- SOFT,
-
- /**
- * Similar to the WEAK identity map except that it maintains a
- * most-frequently-used sub-cache. The size of the sub-cache is
- * proportional to the size of the identity map as specified by
- * descriptor's setIdentityMapSize() method. The sub-cache
- * uses soft references to ensure that these objects are
- * garbage-collected only if the system is low on memory.
- */
- SOFT_WEAK,
-
- /**
- * Identical to the soft cache weak (SOFT_WEAK) identity map except
- * that it uses hard references in the sub-cache. Use this identity
- * map if soft references do not behave properly on your platform.
- */
- HARD_WEAK,
-
- /**
- * A cache identity map maintains a fixed number of objects
- * specified by the application. Objects are removed from the cache
- * on a least-recently-used basis. This method allows object
- * identity for the most commonly used objects.
- * WARNING: Furnishes caching and identity, but does not guarantee
- * identity.
- */
- CACHE,
-
- /**
- * WARNING: Does not preserve object identity and does not cache
- * objects.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="FULL"/>
- <xsd:enumeration value="WEAK"/>
- <xsd:enumeration value="SOFT"/>
- <xsd:enumeration value="SOFT_WEAK"/>
- <xsd:enumeration value="HARD_WEAK"/>
- <xsd:enumeration value="CACHE"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-coordination-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the Cache annotation.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheCoordinationType {
- /**
- * Sends a list of changed objects including data about the changes.
- * This data is merged into the receiving cache.
- */
- SEND_OBJECT_CHANGES,
-
- /**
- * Sends a list of the identities of the objects that have changed.
- * The receiving cache invalidates the objects (rather than changing
- * any of the data)
- */
- INVALIDATE_CHANGED_OBJECTS,
-
- /**
- * Same as SEND_OBJECT_CHANGES except it also includes any newly
- * created objects from the transaction.
- */
- SEND_NEW_OBJECTS_WITH_CHANGES,
-
- /**
- * Does no cache coordination.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SEND_OBJECT_CHANGES"/>
- <xsd:enumeration value="INVALIDATE_CHANGED_OBJECTS"/>
- <xsd:enumeration value="SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="change-tracking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The ChangeTracking annotation is used to specify the
- * org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy
- * which computes changes sets for EclipseLink's UnitOfWork commit
- * process. An ObjectChangePolicy is stored on an Entity's descriptor.
- *
- * A ChangeTracking annotation may be specified on an Entity,
- * MappedSuperclass or Embeddable.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ChangeTracking {
- /**
- * (Optional) The type of change tracking to use.
- */
- ChangeTrackingType value() default AUTO;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:change-tracking-type" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="change-tracking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the ChangeTracking annotation.
- */
- public enum ChangeTrackingType {
- /**
- * An ATTRIBUTE change tracking type allows change tracking at the
- * attribute level of an object. Objects with changed attributes will
- * be processed in the commit process to include any changes in the
- * results of the commit. Unchanged objects will be ignored.
- */
- ATTRIBUTE,
-
- /**
- * An OBJECT change tracking policy allows an object to calculate for
- * itself whether it has changed. Changed objects will be processed in
- * the commit process to include any changes in the results of the
- * commit. Unchanged objects will be ignored.
- */
- OBJECT,
-
- /**
- * A DEFERRED change tracking policy defers all change detection to
- * the UnitOfWork's change detection process. Essentially, the
- * calculateChanges() method will run for all objects in a UnitOfWork.
- * This is the default ObjectChangePolicy
- */
- DEFERRED,
-
- /**
- * Will not set any change tracking policy.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ATTRIBUTE"/>
- <xsd:enumeration value="OBJECT"/>
- <xsd:enumeration value="DEFERRED"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="customizer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Customizer annotation is used to specify a class that implements
- * the org.eclipse.persistence.config.DescriptorCustomizer
- * interface and is to run against an enetity's class descriptor after all
- * metadata processing has been completed.
- *
- * The Customizer annotation may be defined on an Entity, MappedSuperclass
- * or Embeddable class. In the case of inheritance, a Customizer is not
- * inherited from its parent classes.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Customizer {
- /**
- * (Required) Defines the name of the descriptor customizer class that
- * should be applied for the related entity or embeddable class.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="direction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the StoredProcedureParameter annotation.
- * It is used to specify the direction of the stored procedure
- * parameters of a named stored procedure query.
- */
- public enum Direction {
- /**
- * Input parameter
- */
- IN,
-
- /**
- * Output parameter
- */
- OUT,
-
- /**
- * Input and output parameter
- */
- IN_OUT,
-
- /**
- * Output cursor
- */
- OUT_CURSOR
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="IN_OUT"/>
- <xsd:enumeration value="OUT_CURSOR"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of an mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query, named-native-query, or
- result-set-mapping of the same name in the same or different mapping
- files in a persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata" type="orm:persistence-unit-metadata" minOccurs="0"/>
- <xsd:element name="package" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string" minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping" type="orm:sql-result-set-mapping" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType" fixed="2.0" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="existence-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * The ExistenceChecking annotation is used to specify the type of
- * checking EclipseLink should use when updating entities.
- *
- * An existence-checking specification is supported on an Entity or
- * MappedSuperclass annotation.
- */
- public @interface ExistenceChecking {
-
- /**
- * (Optional) Set the existence check for determining
- * if an insert or update should occur for an object.
- */
- ExistenceType value() default CHECK_CACHE;
- }
-
- /**
- * Assume that if the objects primary key does not include null and
- * it is in the cache, then it must exist.
- */
- CHECK_CACHE,
-
- /**
- * Perform does exist check on the database.
- */
- CHECK_DATABASE,
-
- /**
- * Assume that if the objects primary key does not include null then
- * it must exist. This may be used if the application guarantees or
- * does not care about the existence check.
- */
- ASSUME_EXISTENCE,
-
- /**
- * Assume that the object does not exist. This may be used if the
- * application guarantees or does not care about the existence check.
- * This will always force an insert to be called.
- */
- ASSUME_NON_EXISTENCE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="CHECK_CACHE"/>
- <xsd:enumeration value="CHECK_DATABASE"/>
- <xsd:enumeration value="ASSUME_EXISTENCE"/>
- <xsd:enumeration value="ASSUME_NON_EXISTENCE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified,
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="exclude-default-mappings" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults" type="orm:persistence-unit-defaults" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables, secondary tables,
- collection tables, sequence generators, and table generators
- that apply to the persistence unit
- catalog - Used as the catalog for all tables, secondary tables,
- collection tables, sequence generators, and table generators
- that apply to the persistence unit
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in all entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string" minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string" minOccurs="0"/>
- <xsd:element name="delimited-identifiers" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its sub-elements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="table" type="orm:table" minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:element name="discriminator-value" type="orm:discriminator-value" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping" type="orm:sql-result-set-mapping" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="query-redirectors" type="orm:query-redirectors" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist" minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns() default{};
- JoinTable joinTable() default @JoinTable;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="id" type="orm:id" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-collection" type="orm:basic-collection" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-map" type="orm:basic-map" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="variable-one-to-one" type="orm:variable-one-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection" type="orm:element-collection" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transformation" type="orm:transformation" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="lob" type="orm:lob"/>
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicCollection {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the value column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-map">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicMap {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the data column that holds the direct map
- * key. If the name on te key column is "", the name will default to:
- * the name of the property or field; "_KEY".
- */
- Column keyColumn() default @Column;
-
- /**
- * (Optional) Specify the key converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the direct map key.
- */
- Convert keyConverter() default @Convert;
-
- /**
- * (Optional) The name of the data column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
-
- /**
- * (Optional) Specify the value converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the value column mapping.
- */
- Convert valueConverter() default @Convert;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="key-converter" type="xsd:string" minOccurs="0"/>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="value-converter" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CloneCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.CloneCopyPolicy on an
- * Entity. A CloneCopyPolicy must specify at one or both of the "method"
- * or "workingCopyMethod". "workingCopyMethod" is used to clone objects
- * that will be returned to the user as they are registered in
- * EclipseLink's transactional mechanism, the UnitOfWork. "method" will
- * be used for the clone that is used for comparison in conjunction with
- * EclipseLink's DeferredChangeDetectionPolicy
- *
- * A CloneCopyPolicy should be specified on an Entity, MappedSuperclass
- * or Embeddable.
- *
- * Example:
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod", workingCopyMethod="myWorkingCopyCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(workingCopyMethodName="myWorkingCopyClone")
- */
- public @interface CloneCopyPolicy {
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified this defines
- * a method that will be used to create a clone that will be used
- * for comparison by
- * EclipseLink's DeferredChangeDetectionPolicy
- */
- String method();
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified
- * this defines a method that will be used to create a clone that
- * will be used to create the object returned when registering an
- * Object in an EclipseLink UnitOfWork
- */
- String workingCopyMethod();
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method" type="xsd:string"/>
- <xsd:attribute name="working-copy-method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface CollectionTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="eclipselink-collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface CollectionTable {
- /**
- * (Optional) The name of the collection table. If it is not
- * specified, it is defaulted to the concatenation of the following:
- * the name of the source entity; "_" ; the name of the relationship
- * property or field of the source entity.
- */
- String name() default "";
-
- /**
- * (Optional) The catalog of the table. It defaults to the persistence
- * unit default catalog.
- */
- String catalog() default "";
-
- /**
- * (Optional) The schema of the table. It defaults to the persistence
- * unit default schema.
- */
- String schema() default "";
-
- /**
- * (Optional) Used to specify a primary key column that is used as a
- * foreign key to join to another table. If the source entity uses a
- * composite primary key, a primary key join column must be specified
- * for each field of the composite primary key. In a single primary
- * key case, a primary key join column may optionally be specified.
- * Defaulting will apply otherwise as follows:
- * name, the same name as the primary key column of the primary table
- * of the source entity. referencedColumnName, the same name of
- * primary key column of the primary table of the source entity.
- */
- PrimaryKeyJoinColumn[] primaryKeyJoinColumns() default {};
-
- /**
- * (Optional) Unique constraints that are to be placed on the table.
- * These are only used if table generation is in effect.
- */
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="conversion-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface ConversionValue {
- /**
- * (Required) Specify the database value.
- */
- String dataValue();
-
- /**
- * (Required) Specify the object value.
- */
- String objectValue();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="data-value" type="xsd:string" use="required"/>
- <xsd:attribute name="object-value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Converter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must implement
- * the org.eclipse.persistence.mappings.converters.Converter interface.
- */
- Class converterClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CopyPolicy is used to set a
- * org.eclipse.persistence.descriptors.copying.CopyPolicy on an Entity.
- * It is required that a class that implements
- * org.eclipse.persistence.descriptors.copying.CopyPolicy be specified
- * as the argument.
- *
- * A CopyPolicy should be specified on an Entity, MappedSuperclass or
- * Embeddable.
- *
- * For instance:
- * @Entity
- * @CopyPolicy("example.MyCopyPolicy")
- */
- public @interface CopyPolicy {
-
- /*
- * (Required)
- * This defines the class of the copy policy. It must specify a class
- * that implements org.eclipse.persistence.descriptors.copying.CopyPolicy
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-class">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A DiscriminatorClass is used within a VariableOneToOne annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface DiscriminatorClass {
- /**
- * (Required) The discriminator to be stored on the database.
- */
- String discriminator();
-
- /**
- * (Required) The class to the instantiated with the given
- * discriminator.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="discriminator" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="element-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ElementCollection {
- Class targetClass() default void.class;
- FetchType fetch() default LAZY;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column" minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="map-key-enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column" minOccurs="0"/>
- <xsd:element name="map-key-join-column" type="orm:map-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-class" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist" minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="id-validation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The IdValidation enum determines the type value that are valid for an Id.
- * By default null is not allowed, and 0 is not allow for singleton ids of long or int type.
- * The default value is ZERO for singleton ids, and NULL for composite ids.
- * This can be set using the @PrimaryKey annotation, or ClassDescriptor API.
- *
- * @see PrimaryKey
- * @see org.eclipse.persistence.descriptors.ClassDescriptor#setIdValidation(IdValidation)
- * @author James Sutherland
- * @since EclipseLink 1.0
- */
- public enum IdValidation {
- /**
- * Only null is not allowed as an id value, 0 is allowed.
- */
- NULL,
-
- /**
- * null and 0 are not allowed, (only int and long).
- */
- ZERO,
-
- /**
- * No id validation is done.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="NULL"/>
- <xsd:enumeration value="ZERO"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType { SINGLE_TABLE, JOINED, TABLE_PER_CLASS };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * An InstantiationCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy
- * on an Entity. InstantiationCopyPolicy is the default CopyPolicy in
- * EclipseLink and therefore this configuration option is only used to
- * override other types of copy policies
- *
- * An InstantiationCopyPolicy should be specified on an Entity,
- * MappedSuperclass or Embeddable.
- *
- * Example:
- * @Entity
- * @InstantiationCopyPolicy
- */
- public @interface InstantiationCopyPolicy {
- }
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum JoinFetchType {
- /**
- * An inner join is used to fetch the related object.
- * This does not allow for null/empty values.
- */
- INNER,
-
- /**
- * An inner join is used to fetch the related object.
- * This allows for null/empty values.
- */
- OUTER,
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="INNER"/>
- <xsd:enumeration value="OUTER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="lock-mode-type">
- <xsd:annotation>
- <xsd:documentation>
- public enum LockModeType { READ, WRITE, OPTIMISTIC,
- OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE,
- PESSIMISTIC_FORCE_INCREMENT, NONE};
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="WRITE"/>
- <xsd:enumeration value="OPTIMISTIC"/>
- <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="PESSIMISTIC_READ"/>
- <xsd:enumeration value="PESSIMISTIC_WRITE"/>
- <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column" minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="map-key-enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column" minOccurs="0"/>
- <xsd:element name="map-key-join-column" type="orm:map-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyColumn {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist" minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredProcedureQuery annotation allows the definition of
- * queries that call stored procedures as named queries.
- * A NamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Whether the query should return a result set.
- */
- boolean returnsResultSet() default true;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- <xsd:attribute name="returns-result-set" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ObjectTypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence
- * field or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent
- * field or property.
- */
- Class objectType() default void.class;
-
- /**
- * (Required) Specify the conversion values to be used
- * with the object converter.
- */
- ConversionValue[] conversionValues();
-
- /**
- * (Optional) Specify a default object value. Used for
- * legacy data if the data value is missing.
- */
- String defaultObjectValue() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="conversion-value" type="orm:conversion-value" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="default-object-value" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by" minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column" minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal" type="orm:temporal" minOccurs="0"/>
- <xsd:element name="map-key-enumerated" type="orm:enumerated" minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column" minOccurs="0"/>
- <xsd:element name="map-key-join-column" type="orm:map-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- boolean orphanRemoval() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="optimistic-locking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An optimistic-locking element is used to specify the type of
- * optimistic locking EclipseLink should use when updating or deleting
- * entities. An optimistic-locking specification is supported on
- * an entity or mapped-superclass.
- *
- * It is used in conjunction with the optimistic-locking-type.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface OptimisticLocking {
- /**
- * (Optional) The type of optimistic locking policy to use.
- */
- OptimisticLockingType type() default VERSION_COLUMN;
-
- /**
- * (Optional) For an optimistic locking policy of type
- * SELECTED_COLUMNS, this annotation member becomes a (Required)
- * field.
- */
- Column[] selectedColumns() default {};
-
- /**
- * (Optional) Specify where the optimistic locking policy should
- * cascade lock. Currently only supported with VERSION_COLUMN locking.
- */
- boolean cascade() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="selected-column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:optimistic-locking-type"/>
- <xsd:attribute name="cascade" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="optimistic-locking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A simple type that is used within an optimistic-locking
- * specification to specify the type of optimistic-locking that
- * EclipseLink should use when updating or deleting entities.
- */
- public enum OptimisticLockingType {
- /**
- * Using this type of locking policy compares every field in the table
- * in the WHERE clause when doing an update or a delete. If any field
- * has been changed, an optimistic locking exception will be thrown.
- */
- ALL_COLUMNS,
-
- /**
- * Using this type of locking policy compares only the changed fields
- * in the WHERE clause when doing an update. If any field has been
- * changed, an optimistic locking exception will be thrown. A delete
- * will only compare the primary key.
- */
- CHANGED_COLUMNS,
-
- /**
- * Using this type of locking compares selected fields in the WHERE
- * clause when doing an update or a delete. If any field has been
- * changed, an optimistic locking exception will be thrown. Note that
- * the fields specified must be mapped and not be primary keys.
- */
- SELECTED_COLUMNS,
-
- /**
- * Using this type of locking policy compares a single version number
- * in the where clause when doing an update. The version field must be
- * mapped and not be the primary key.
- */
- VERSION_COLUMN
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL_COLUMNS"/>
- <xsd:enumeration value="CHANGED_COLUMNS"/>
- <xsd:enumeration value="SELECTED_COLUMNS"/>
- <xsd:enumeration value="VERSION_COLUMN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="order-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderColumn {
- String name() default "";
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="correction-type" type="orm:order-column-correction-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-column-correction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum OrderCorrectionType {
- READ,
- READ_WRITE,
- EXCEPTION
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="READ_WRITE"/>
- <xsd:enumeration value="EXCEPTION"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The PrimaryKey annotation allows advanced configuration of the Id.
- * A validation policy can be given that allows specifying if zero is a valid id value.
- * The set of primary key columns can also be specified precisely.
- *
- * @author James Sutherland
- * @since EclipseLink 1.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PrimaryKey {
- /**
- * (Optional) Configures what id validation is done.
- * By default 0 is not a valid id value, this can be used to allow 0 id values.
- */
- IdValidation validation() default IdValidation.ZERO;
-
- /**
- * (Optional) Used to specify the primary key columns directly.
- * This can be used instead of @Id if the primary key includes a non basic field,
- * such as a foreign key, or a inheritance discriminator, embedded, or transformation mapped field.
- */
- Column[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="validation" type="orm:id-validation"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>
-
- A user defined mapping's property.
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Property {
- /**
- * Property name.
- */
- String name();
-
- /**
- * String representation of Property value,
- * converted to an instance of valueType.
- */
- String value();
-
- /**
- * Property value type.
- * The value converted to valueType by ConversionManager.
- * If specified must be a simple type that could be handled by
- * ConversionManager:
- * numerical, boolean, temporal.
- */
- Class valueType() default String.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-redirectors">
- <xsd:annotation>
- <xsd:documentation>
-
-@Target({TYPE}) @Retention(RUNTIME)
-public @interface QueryRedirectors {
-
- /**
- * This AllQueries Query Redirector will be applied to any executing object query
- * that does not have a more precise redirector (like the
- * ReadObjectQuery Redirector) or a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- *
- */
- Class allQueries() default void.class;
-
- /**
- * A Default ReadAll Query Redirector will be applied to any executing
- * ReadAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getResultList() API this is the redirector that will be invoked
- */
- Class readAll() default void.class;
-
- /**
- * A Default ReadObject Query Redirector will be applied to any executing
- * ReadObjectQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getSingleResult() API or EntityManager.find() this is the redirector that will be invoked
- */
- Class readObject() default void.class;
-
- /**
- * A Default ReportQuery Redirector will be applied to any executing
- * ReportQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query that contains agregate functions or selects multiple entities this is the redirector that will be invoked
- */
- Class report() default void.class;
-
- /**
- * A Default Update Query Redirector will be applied to any executing
- * UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.
- * In EclipseLink an UpdateObjectQuery is executed whenever flushing changes to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class update() default void.class;
-
- /**
- * A Default Insert Query Redirector will be applied to any executing
- * InsertObjectQuery that does not have a redirector set directly on the query.
- * In EclipseLink an InsertObjectQuery is executed when persisting an object to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class insert() default void.class;
-
- /**
- * A Default Delete Object Query Redirector will be applied to any executing
- * DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class delete() default void.class;
-
-}
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="all-queries" type="xsd:string"/>
- <xsd:attribute name="read-all" type="xsd:string"/>
- <xsd:attribute name="read-object" type="xsd:string"/>
- <xsd:attribute name="report" type="xsd:string"/>
- <xsd:attribute name="update" type="xsd:string"/>
- <xsd:attribute name="insert" type="xsd:string"/>
- <xsd:attribute name="delete" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="read-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * Unless the TransformationMapping is write-only, it should have a
- * ReadTransformer, it defines transformation of database column(s)
- * value(s)into attribute value.
- *
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReadTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.AttributeTransformer
- * interface. The class will be instantiated, its
- * buildAttributeValue will be used to create the value to be
- * assigned to the attribute.
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be assigned to the attribute (not assigns the value to
- * the attribute). Either transformerClass or method must be
- * specified, but not both.
- */
- String method() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- String catalog() default "";
- String schema() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="entity-result" type="orm:entity-result" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="stored-procedure-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A StoredProcedureParameter annotation is used within a
- * NamedStoredProcedureQuery annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface StoredProcedureParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Optional) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Required) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) The type of Java class desired back from the procedure,
- * this is dependent on the type returned from the procedure.
- */
- Class type() default void.class;
-
- /**
- * (Optional) The JDBC type code, this dependent on the type returned
- * from the procedure.
- */
- int jdbcType() default -1;
-
- /**
- * (Optional) The JDBC type name, this may be required for ARRAY or
- * STRUCT types.
- */
- String jdbcTypeName() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="query-parameter" type="xsd:string" use="required"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="jdbc-type" type="xsd:integer"/>
- <xsd:attribute name="jdbc-type-name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface StructConverter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must
- * implement the EclipseLink interface
- * org.eclipse.persistence.mappings.converters.Converter
- */
- String converter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="converter" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="time-of-day">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface TimeOfDay {
- /**
- * (Optional) Hour of the day.
- */
- int hour() default 0;
-
- /**
- * (Optional) Minute of the day.
- */
- int minute() default 0;
-
- /**
- * (Optional) Second of the day.
- */
- int second() default 0;
-
- /**
- * (Optional) Millisecond of the day.
- */
- int millisecond() default 0;
-
- /**
- * Internal use. Do not modify.
- */
- boolean specified() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="hour" type="xsd:integer"/>
- <xsd:attribute name="minute" type="xsd:integer"/>
- <xsd:attribute name="second" type="xsd:integer"/>
- <xsd:attribute name="millisecond" type="xsd:integer"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transformation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Transformation is an optional annotation for
- * org.eclipse.persistence.mappings.TransformationMapping.
- * TransformationMapping allows to map an attribute to one or more
- * database columns.
- *
- * Transformation annotation is an optional part of
- * TransformationMapping definition. Unless the TransformationMapping is
- * write-only, it should have a ReadTransformer, it defines
- * transformation of database column(s) value(s)into attribute value.
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Transformation {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) The optional element is a hint as to whether the value
- * of the field or property may be null. It is disregarded
- * for primitive types, which are considered non-optional.
- */
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="read-transformer" type="orm:read-transformer"/>
- <xsd:element name="write-transformer" type="orm:write-transformer" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface TypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence field
- * or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent field
- * or property.
- */
- Class objectType() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String name() default "";
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="variable-one-to-one">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Variable one to one mappings are used to represent a pointer
- * references between a java object and an implementer of an interface.
- * This mapping is usually represented by a single pointer (stored in an
- * instance variable) between the source and target objects. In the
- * relational database tables, these mappings are normally implemented
- * using a foreign key and a type code.
- *
- * A VariableOneToOne can be specified within an Entity,
- * MappedSuperclass and Embeddable class.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface VariableOneToOne {
- /**
- * (Optional) The interface class that is the target of the
- * association. If not specified it will be inferred from the type
- * of the object being referenced.
- */
- Class targetInterface() default void.class;
-
- /**
- * (Optional) The operations that must be cascaded to the target of
- * the association.
- */
- CascadeType[] cascade() default {};
-
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) Whether the association is optional. If set to false
- * then a non-null relationship must always exist.
- */
- boolean optional() default true;
-
- /**
- * (Optional) The discriminator column will hold the type
- * indicators. If the DiscriminatorColumn is not specified, the name
- * of the discriminator column defaults to "DTYPE" and the
- * discriminator type to STRING.
- */
- DiscriminatorColumn discriminatorColumn() default @DiscriminatorColumn;
-
- /**
- * (Optional) The list of discriminator types that can be used with
- * this VariableOneToOne. If none are specified then those entities
- * within the persistence unit that implement the target interface
- * will be added to the list of types. The discriminator type will
- * default as follows:
- * - If DiscriminatorColumn type is STRING: Entity.name()
- * - If DiscriminatorColumn type is CHAR: First letter of the
- * Entity class
- * - If DiscriminatorColumn type is INTEGER: The next integer after
- * the highest integer explicitly added.
- */
- DiscriminatorClass[] discriminatorClasses() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="discriminator-class" type="orm:discriminator-class" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-interface" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0" maxOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="write-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- *
- * A single WriteTransformer may be specified directly on the method or
- * attribute. Multiple WriteTransformers should be wrapped into
- * WriteTransformers annotation. No WriteTransformers specified for
- * read-only mapping. Unless the TransformationMapping is write-only, it
- * should have a ReadTransformer, it defines transformation of database
- * column(s) value(s)into attribute value.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface WriteTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.FieldTransformer
- * interface. The class will be instantiated, its buildFieldValue
- * will be used to create the value to be written into the database
- * column. Note that for ddl generation and returning to be
- * supported the method buildFieldValue in the class should be
- * defined to return the relevant Java type, not just Object as
- * defined in the interface, for instance:
- * public Time buildFieldValue(Object instance, String fieldName, Session session).
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be written into the database column.
- * Note that for ddl generation and returning to be supported the
- * method should be defined to return a particular type, not just
- * Object, for instance:
- * public Time getStartTime().
- * The method may require a Transient annotation to avoid being
- * mapped as Basic by default.
- * Either transformerClass or method must be specified, but not both.
- */
- String method() default "";
-
- /**
- * Specify here the column into which the value should be written.
- * The only case when this could be skipped is if a single
- * WriteTransformer annotates an attribute - the attribute's name
- * will be used as a column name.
- */
- Column column() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
-</xsd:schema>
-
-
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_1.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_1.xsd
deleted file mode 100644
index 5e3ce57249..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_1.xsd
+++ /dev/null
@@ -1,4108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ************************************************************************************************************************** -->
-<!-- Copyright (c) 1998, 2010 Oracle. All rights reserved. -->
-<!-- This program and the accompanying materials are made available under the -->
-<!-- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 -->
-<!-- which accompanies this distribution. -->
-<!-- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html -->
-<!-- and the Eclipse Distribution License is available at -->
-<!-- http://www.eclipse.org/org/documents/edl-v10.php. -->
-<!-- -->
-<!-- Contributors: -->
-<!-- Oracle - initial API and implementation from Oracle TopLink -->
-<!-- tware - update version number to 2.0 -->
-<!-- 12/2/2009-2.1 Guy Pelletier -->
-<!-- - 296289: Add current annotation metadata support on mapped superclasses to EclipseLink-ORM.XML Schema -->
-<!-- - 296612: Add current annotation only metadata support of return insert/update to the EclipseLink-ORM.XML Schema -->
-<!-- - formatted to match orm_2_0.xsd so that users can easily compare the two schemas -->
-<!-- 5/4/2010-2.1 Guy Pelletier -->
-<!-- - 227219: Expand EclipseLink-ORM.XML schema functionality for 2.1 release (update version to 2.1) -->
-<!-- ************************************************************************************************************************** -->
-
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.1">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)eclipselink_orm_2_1.xsd 2.1 April 05 2010
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the native Eclipselink XML mapping file
- The file may be named "META-INF/eclipselink-orm.xml" in the persistence
- archive or it may be named some other name which would be
- used to locate the file as resource on the classpath.
- Object/relational mapping files must indicate the object/relational
- mapping file schema by using the persistence namespace:
-
- http://www.eclipse.org/eclipselink/xsds/persistence/orm
-
- and indicate the version of the schema by using the version element as shown below:
-
- <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm
- eclipselink_orm_2_1.xsd
- version="2.1">
- ...
- </entity-mappings>
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="emptyType"/>
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="access-methods">
- <xsd:annotation>
- <xsd:documentation>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="get-method" type="xsd:string" use="required"/>
- <xsd:attribute name="set-method" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Cache annotation is used to set an
- * org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
- * which sets objects in EclipseLink's identity maps to be invalid
- * following given rules. By default in EclipseLink, objects do not
- * expire in the cache. Several different policies are available to
- * allow objects to expire.
- *
- * @see org.eclipse.persistence.annotations.CacheType
- *
- * A Cache anotation may be defined on an Entity or MappedSuperclass.
- * In the case of inheritance, a Cache annotation should only be defined
- * on the root of the inheritance hierarchy.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Cache {
- /**
- * (Optional) The type of cache to use.
- */
- CacheType type() default SOFT_WEAK;
-
- /**
- * (Optional) The size of cache to use.
- */
- int size() default 100;
-
- /**
- * (Optional) Cached instances in the shared cache or a client
- * isolated cache.
- */
- boolean shared() default true;
-
- /**
- * (Optional) Expire cached instance after a fix period of time (ms).
- * Queries executed against the cache after this will be forced back
- * to the database for a refreshed copy
- */
- int expiry() default -1; // minus one is no expiry.
-
- /**
- * (Optional) Expire cached instance a specific time of day. Queries
- * executed against the cache after this will be forced back to the
- * database for a refreshed copy
- */
- TimeOfDay expiryTimeOfDay() default @TimeOfDay(specified=false);
-
- /**
- * (Optional) Force all queries that go to the database to always
- * refresh the cache.
- */
- boolean alwaysRefresh() default false;
-
- /**
- * (Optional) For all queries that go to the database, refresh the
- * cache only if the data received from the database by a query is
- * newer than the data in the cache (as determined by the optimistic
- * locking field)
- */
- boolean refreshOnlyIfNewer() default false;
-
- /**
- * (Optional) Setting to true will force all queries to bypass the
- * cache for hits but still resolve against the cache for identity.
- * This forces all queries to hit the database.
- */
- boolean disableHits() default false;
-
- /**
- * (Optional) The cache coordination mode.
- */
- CacheCoordinationType coordinationType() default SEND_OBJECT_CHANGES;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="expiry" type="xsd:integer" minOccurs="0"/>
- <xsd:element name="expiry-time-of-day" type="orm:time-of-day" minOccurs="0"/>
- </xsd:choice>
- <xsd:attribute name="size" type="xsd:integer"/>
- <xsd:attribute name="shared" type="xsd:boolean"/>
- <xsd:attribute name="type" type="orm:cache-type"/>
- <xsd:attribute name="always-refresh" type="xsd:boolean"/>
- <xsd:attribute name="refresh-only-if-newer" type="xsd:boolean"/>
- <xsd:attribute name="disable-hits" type="xsd:boolean"/>
- <xsd:attribute name="coordination-type" type="orm:cache-coordination-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache-interceptor">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface CacheInterceptor {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
-
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The CacheType enum is used with the Cache annotation for a
- * persistent class. It defines the type of IdentityMap/Cache used for
- * the class. By default the SOFT_WEAK cache type is used.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheType {
- /**
- * Provides full caching and guaranteed identity. Caches all objects
- * and does not remove them.
- * WARNING: This method may be memory intensive when many objects are
- * read.
- */
- FULL,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using weak references. This method allows full garbage
- * collection and provides full caching and guaranteed identity.
- */
- WEAK,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using soft references. This method allows full garbage
- * collection when memory is low and provides full caching and
- * guaranteed identity.
- */
- SOFT,
-
- /**
- * Similar to the WEAK identity map except that it maintains a
- * most-frequently-used sub-cache. The size of the sub-cache is
- * proportional to the size of the identity map as specified by
- * descriptor's setIdentityMapSize() method. The sub-cache
- * uses soft references to ensure that these objects are
- * garbage-collected only if the system is low on memory.
- */
- SOFT_WEAK,
-
- /**
- * Identical to the soft cache weak (SOFT_WEAK) identity map except
- * that it uses hard references in the sub-cache. Use this identity
- * map if soft references do not behave properly on your platform.
- */
- HARD_WEAK,
-
- /**
- * A cache identity map maintains a fixed number of objects
- * specified by the application. Objects are removed from the cache
- * on a least-recently-used basis. This method allows object
- * identity for the most commonly used objects.
- * WARNING: Furnishes caching and identity, but does not guarantee
- * identity.
- */
- CACHE,
-
- /**
- * WARNING: Does not preserve object identity and does not cache
- * objects.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="FULL"/>
- <xsd:enumeration value="WEAK"/>
- <xsd:enumeration value="SOFT"/>
- <xsd:enumeration value="SOFT_WEAK"/>
- <xsd:enumeration value="HARD_WEAK"/>
- <xsd:enumeration value="CACHE"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-coordination-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the Cache annotation.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheCoordinationType {
- /**
- * Sends a list of changed objects including data about the changes.
- * This data is merged into the receiving cache.
- */
- SEND_OBJECT_CHANGES,
-
- /**
- * Sends a list of the identities of the objects that have changed.
- * The receiving cache invalidates the objects (rather than changing
- * any of the data)
- */
- INVALIDATE_CHANGED_OBJECTS,
-
- /**
- * Same as SEND_OBJECT_CHANGES except it also includes any newly
- * created objects from the transaction.
- */
- SEND_NEW_OBJECTS_WITH_CHANGES,
-
- /**
- * Does no cache coordination.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SEND_OBJECT_CHANGES"/>
- <xsd:enumeration value="INVALIDATE_CHANGED_OBJECTS"/>
- <xsd:enumeration value="SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="change-tracking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The ChangeTracking annotation is used to specify the
- * org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy
- * which computes changes sets for EclipseLink's UnitOfWork commit
- * process. An ObjectChangePolicy is stored on an Entity's descriptor.
- *
- * A ChangeTracking annotation may be specified on an Entity,
- * MappedSuperclass or Embeddable.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ChangeTracking {
- /**
- * (Optional) The type of change tracking to use.
- */
- ChangeTrackingType value() default AUTO;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:change-tracking-type" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="change-tracking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the ChangeTracking annotation.
- */
- public enum ChangeTrackingType {
- /**
- * An ATTRIBUTE change tracking type allows change tracking at the
- * attribute level of an object. Objects with changed attributes will
- * be processed in the commit process to include any changes in the
- * results of the commit. Unchanged objects will be ignored.
- */
- ATTRIBUTE,
-
- /**
- * An OBJECT change tracking policy allows an object to calculate for
- * itself whether it has changed. Changed objects will be processed in
- * the commit process to include any changes in the results of the
- * commit. Unchanged objects will be ignored.
- */
- OBJECT,
-
- /**
- * A DEFERRED change tracking policy defers all change detection to
- * the UnitOfWork's change detection process. Essentially, the
- * calculateChanges() method will run for all objects in a UnitOfWork.
- * This is the default ObjectChangePolicy
- */
- DEFERRED,
-
- /**
- * Will not set any change tracking policy.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ATTRIBUTE"/>
- <xsd:enumeration value="OBJECT"/>
- <xsd:enumeration value="DEFERRED"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="customizer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Customizer annotation is used to specify a class that implements
- * the org.eclipse.persistence.config.DescriptorCustomizer
- * interface and is to run against an enetity's class descriptor after all
- * metadata processing has been completed.
- *
- * The Customizer annotation may be defined on an Entity, MappedSuperclass
- * or Embeddable class. In the case of inheritance, a Customizer is not
- * inherited from its parent classes.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Customizer {
- /**
- * (Required) Defines the name of the descriptor customizer class that
- * should be applied for the related entity or embeddable class.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="direction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the StoredProcedureParameter annotation.
- * It is used to specify the direction of the stored procedure
- * parameters of a named stored procedure query.
- */
- public enum Direction {
- /**
- * Input parameter
- */
- IN,
-
- /**
- * Output parameter
- */
- OUT,
-
- /**
- * Input and output parameter
- */
- IN_OUT,
-
- /**
- * Output cursor
- */
- OUT_CURSOR
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="IN_OUT"/>
- <xsd:enumeration value="OUT_CURSOR"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of a mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query, named-native-query, or
- result-set-mapping of the same name in the same or different mapping
- files in a persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata"
- type="orm:persistence-unit-metadata"
- minOccurs="0"/>
- <xsd:element name="package" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType"
- fixed="2.1" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="existence-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * The ExistenceChecking annotation is used to specify the type of
- * checking EclipseLink should use when updating entities.
- *
- * An existence-checking specification is supported on an Entity or
- * MappedSuperclass annotation.
- */
- public @interface ExistenceChecking {
-
- /**
- * (Optional) Set the existence check for determining
- * if an insert or update should occur for an object.
- */
- ExistenceType value() default CHECK_CACHE;
- }
-
- /**
- * Assume that if the objects primary key does not include null and
- * it is in the cache, then it must exist.
- */
- CHECK_CACHE,
-
- /**
- * Perform does exist check on the database.
- */
- CHECK_DATABASE,
-
- /**
- * Assume that if the objects primary key does not include null then
- * it must exist. This may be used if the application guarantees or
- * does not care about the existence check.
- */
- ASSUME_EXISTENCE,
-
- /**
- * Assume that the object does not exist. This may be used if the
- * application guarantees or does not care about the existence check.
- * This will always force an insert to be called.
- */
- ASSUME_NON_EXISTENCE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="CHECK_CACHE"/>
- <xsd:enumeration value="CHECK_DATABASE"/>
- <xsd:enumeration value="ASSUME_EXISTENCE"/>
- <xsd:enumeration value="ASSUME_NON_EXISTENCE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified,
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-default-mappings" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults"
- type="orm:persistence-unit-defaults"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- catalog - Used as the catalog for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- delimited-identifiers - Used to treat database identifiers as
- delimited identifiers.
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in all entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="delimited-identifiers" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its subelements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="table" type="orm:table"
- minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="discriminator-value" type="orm:discriminator-value" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- </xsd:sequence>
- <xsd:element name="class-extractor" type="orm:class-extractor" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="fetch-group" type="orm:fetch-group" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="query-redirectors" type="orm:query-redirectors" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- <xsd:enumeration value="VIRTUAL"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns() default{};
- JoinTable joinTable() default @JoinTable;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="id" type="orm:id"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-collection" type="orm:basic-collection" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-map" type="orm:basic-map" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="variable-one-to-one" type="orm:variable-one-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection" type="orm:element-collection"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transformation" type="orm:transformation" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="lob" type="orm:lob"/>
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="return-insert" type="orm:return-insert" minOccurs="0"/>
- <xsd:element name="return-update" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="basic-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicCollection {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the value column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-map">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicMap {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the data column that holds the direct map
- * key. If the name on te key column is "", the name will default to:
- * the name of the property or field; "_KEY".
- */
- Column keyColumn() default @Column;
-
- /**
- * (Optional) Specify the key converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the direct map key.
- */
- Convert keyConverter() default @Convert;
-
- /**
- * (Optional) The name of the data column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
-
- /**
- * (Optional) Specify the value converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the value column mapping.
- */
- Convert valueConverter() default @Convert;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="key-converter" type="xsd:string" minOccurs="0"/>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="value-converter" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-detach" type="orm:emptyType"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="class-extractor">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A ClassExtractor allows for a user defined class indicator in place of
- * providing a discriminator column. The class has the following restrictions:
-
- * - It must extend the org.eclipse.persistence.descriptors.ClassExtractor
- * class and implement the extractClassFromRow(Record, Session) method.
- * - That method must take a database row (a Record/Map) as an argument and
- * must return the class to use for that row.
- *
- * This method will be used to decide which class to instantiate when reading
- * from the database. It is the application's responsibility to populate any
- * typing information in the database required to determine the class from the
- * row.
- *
- * The ClassExtractor must only be set on the root of an entity class or
- * sub-hierarchy in which a different inheritance strategy is applied. The
- * ClassExtractor can only be used with the SINGLE_TABLE and JOINED inheritance
- * strategies.
- *
- * If a ClassExtractor is used then a DiscriminatorColumn cannot be used. A
- * ClassExtractor also cannot be used on either the root or its subclasses.
- *
- * In addition, for more complex configurations using a ClassExtractor and a
- * SINGLE_TABLE strategy, the descriptor's withAllSubclasses and onlyInstances
- * expressions should be set through the ClassExtractor's initialize method.
- *
- * @see org.eclipse.persistence.descriptors.InheritancePolicy.setWithAllSubclassesExpression(Expression)
- * @see org.eclipse.persistence.descriptors.InheritancePolicy.setOnlyInstancesExpression(Expression)
- *
- * @author Guy Pelletier
- * @since EclipseLink 2.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ClassExtractor {
- /**
- * (Required) Defines the name of the class extractor that should be
- * applied to this entity's descriptor.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CloneCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.CloneCopyPolicy on an
- * Entity. A CloneCopyPolicy must specify at one or both of the "method"
- * or "workingCopyMethod". "workingCopyMethod" is used to clone objects
- * that will be returned to the user as they are registered in
- * EclipseLink's transactional mechanism, the UnitOfWork. "method" will
- * be used for the clone that is used for comparison in conjunction with
- * EclipseLink's DeferredChangeDetectionPolicy
- *
- * A CloneCopyPolicy should be specified on an Entity, MappedSuperclass
- * or Embeddable.
- *
- * Example:
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod", workingCopyMethod="myWorkingCopyCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(workingCopyMethodName="myWorkingCopyClone")
- */
- public @interface CloneCopyPolicy {
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified this defines
- * a method that will be used to create a clone that will be used
- * for comparison by
- * EclipseLink's DeferredChangeDetectionPolicy
- */
- String method();
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified
- * this defines a method that will be used to create a clone that
- * will be used to create the object returned when registering an
- * Object in an EclipseLink UnitOfWork
- */
- String workingCopyMethod();
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method" type="xsd:string"/>
- <xsd:attribute name="working-copy-method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface CollectionTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="eclipselink-collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface CollectionTable {
- /**
- * (Optional) The name of the collection table. If it is not
- * specified, it is defaulted to the concatenation of the following:
- * the name of the source entity; "_" ; the name of the relationship
- * property or field of the source entity.
- */
- String name() default "";
-
- /**
- * (Optional) The catalog of the table. It defaults to the persistence
- * unit default catalog.
- */
- String catalog() default "";
-
- /**
- * (Optional) The schema of the table. It defaults to the persistence
- * unit default schema.
- */
- String schema() default "";
-
- /**
- * (Optional) Used to specify a primary key column that is used as a
- * foreign key to join to another table. If the source entity uses a
- * composite primary key, a primary key join column must be specified
- * for each field of the composite primary key. In a single primary
- * key case, a primary key join column may optionally be specified.
- * Defaulting will apply otherwise as follows:
- * name, the same name as the primary key column of the primary table
- * of the source entity. referencedColumnName, the same name of
- * primary key column of the primary table of the source entity.
- */
- PrimaryKeyJoinColumn[] primaryKeyJoinColumns() default {};
-
- /**
- * (Optional) Unique constraints that are to be placed on the table.
- * These are only used if table generation is in effect.
- */
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="conversion-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface ConversionValue {
- /**
- * (Required) Specify the database value.
- */
- String dataValue();
-
- /**
- * (Required) Specify the object value.
- */
- String objectValue();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="data-value" type="xsd:string" use="required"/>
- <xsd:attribute name="object-value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Converter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must implement
- * the org.eclipse.persistence.mappings.converters.Converter interface.
- */
- Class converterClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CopyPolicy is used to set a
- * org.eclipse.persistence.descriptors.copying.CopyPolicy on an Entity.
- * It is required that a class that implements
- * org.eclipse.persistence.descriptors.copying.CopyPolicy be specified
- * as the argument.
- *
- * A CopyPolicy should be specified on an Entity, MappedSuperclass or
- * Embeddable.
- *
- * For instance:
- * @Entity
- * @CopyPolicy("example.MyCopyPolicy")
- */
- public @interface CopyPolicy {
-
- /*
- * (Required)
- * This defines the class of the copy policy. It must specify a class
- * that implements org.eclipse.persistence.descriptors.copying.CopyPolicy
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-class">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A DiscriminatorClass is used within a VariableOneToOne annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface DiscriminatorClass {
- /**
- * (Required) The discriminator to be stored on the database.
- */
- String discriminator();
-
- /**
- * (Required) The class to the instantiated with the given
- * discriminator.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="discriminator" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-<xsd:complexType name="element-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ElementCollection {
- Class targetClass() default void.class;
- FetchType fetch() default LAZY;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column"
- type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="lob"
- type="orm:lob"
- minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:sequence>
- <xsd:element name="attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table"
- minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-class" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="fetch-attribute">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface FetchAttribute {
- /**
- * (Required) The fetch attribute name.
- */
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface FetchGroup {
- /**
- * (Required) The fetch group name.
- */
- String name();
-
- /**
- * (Optional) Indicates whether all relationship attributes
- * specified in the fetch group should be loaded.
- */
- boolean load() default true;
-
- /**
- * (Required) The list of attributes to fetch.
- */
- FetchAttribute[] attributes();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute" type="orm:fetch-attribute" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="load" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"
- minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value"
- minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="id-validation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The IdValidation enum determines the type value that are valid for an Id.
- * By default null is not allowed, and 0 is not allow for singleton ids of long or int type.
- * The default value is ZERO for singleton ids, and NULL for composite ids.
- * This can be set using the @PrimaryKey annotation, or ClassDescriptor API.
- *
- * @see PrimaryKey
- * @see org.eclipse.persistence.descriptors.ClassDescriptor#setIdValidation(IdValidation)
- * @author James Sutherland
- * @since EclipseLink 1.0
- */
- public enum IdValidation {
- /**
- * Only null is not allowed as an id value, 0 is allowed.
- */
- NULL,
-
- /**
- * null and 0 are not allowed, (only int and long).
- */
- ZERO,
-
- /**
- * No id validation is done.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="NULL"/>
- <xsd:enumeration value="ZERO"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="cache-key-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Configures what type of Id value is used to store the object in the cache.
- * This can either be the basic Id value for simple singleton Ids,
- * or an optimized CacheKey type.
- *
- * @see PrimaryKey#cacheKeyType()
- * @see ClassDescriptor#setCacheKeyType(CacheKeyType)
- * @author James Sutherland
- * @since EclipseLink 2.1
- */
- public enum CacheKeyType {
- /**
- * This can only be used for simple singleton Ids, such as long/int/String.
- * This is the default for simple singleton Ids.
- */
- ID_VALUE,
-
- /**
- * Optimized cache key type that allows composite and complex values.
- * This is the default for composite or complex Ids.
- */
- CACHE_KEY,
-
- /**
- * The cache key type is automatically configured depending on what is optimal for the class.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ID_VALUE"/>
- <xsd:enumeration value="CACHE_KEY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType
- { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * An InstantiationCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy
- * on an Entity. InstantiationCopyPolicy is the default CopyPolicy in
- * EclipseLink and therefore this configuration option is only used to
- * override other types of copy policies
- *
- * An InstantiationCopyPolicy should be specified on an Entity,
- * MappedSuperclass or Embeddable.
- *
- * Example:
- * @Entity
- * @InstantiationCopyPolicy
- */
- public @interface InstantiationCopyPolicy {
- }
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum JoinFetchType {
- /**
- * An inner join is used to fetch the related object.
- * This does not allow for null/empty values.
- */
- INNER,
-
- /**
- * An inner join is used to fetch the related object.
- * This allows for null/empty values.
- */
- OUTER,
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="INNER"/>
- <xsd:enumeration value="OUTER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="batch-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
- public enum BatchFetchType {
- /**
- * This is the default form of batch reading.
- * The original query's selection criteria is joined with the batch query.
- */
- JOIN,
-
- /**
- * This uses an SQL EXISTS and a sub-select in the batch query instead of a join.
- * This has the advantage of not requiring an SQL DISTINCT which can have issues
- * with LOBs, or may be more efficient for some types of queries or on some databases.
- */
- EXISTS,
-
- /**
- * This uses an SQL IN clause in the batch query passing in the source object Ids.
- * This has the advantage of only selecting the objects not already contained in the cache,
- * and can work better with cursors, or if joins cannot be used.
- * This may only work for singleton Ids on some databases.
- */
- IN
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="JOIN"/>
- <xsd:enumeration value="EXISTS"/>
- <xsd:enumeration value="IN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="lock-mode-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum LockModeType { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="WRITE"/>
- <xsd:enumeration value="OPTIMISTIC"/>
- <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="PESSIMISTIC_READ"/>
- <xsd:enumeration value="PESSIMISTIC_WRITE"/>
- <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="NONE"/>
-
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-<xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyColumn {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0"/>
- <xsd:element name="fetch-group" type="orm:fetch-group" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="query-redirectors" type="orm:query-redirectors" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- LockModeType lockMode() default NONE;
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredProcedureQuery annotation allows the definition of
- * queries that call stored procedures as named queries.
- * A NamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Whether the query should return a result set.
- */
- boolean returnsResultSet() default true;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- <xsd:attribute name="returns-result-set" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ObjectTypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence
- * field or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent
- * field or property.
- */
- Class objectType() default void.class;
-
- /**
- * (Required) Specify the conversion values to be used
- * with the object converter.
- */
- ConversionValue[] conversionValues();
-
- /**
- * (Optional) Specify a default object value. Used for
- * legacy data if the data value is missing.
- */
- String defaultObjectValue() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="conversion-value" type="orm:conversion-value" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="default-object-value" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
-<xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- boolean orphanRemoval() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="optimistic-locking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An optimistic-locking element is used to specify the type of
- * optimistic locking EclipseLink should use when updating or deleting
- * entities. An optimistic-locking specification is supported on
- * an entity or mapped-superclass.
- *
- * It is used in conjunction with the optimistic-locking-type.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface OptimisticLocking {
- /**
- * (Optional) The type of optimistic locking policy to use.
- */
- OptimisticLockingType type() default VERSION_COLUMN;
-
- /**
- * (Optional) For an optimistic locking policy of type
- * SELECTED_COLUMNS, this annotation member becomes a (Required)
- * field.
- */
- Column[] selectedColumns() default {};
-
- /**
- * (Optional) Specify where the optimistic locking policy should
- * cascade lock. Currently only supported with VERSION_COLUMN locking.
- */
- boolean cascade() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="selected-column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:optimistic-locking-type"/>
- <xsd:attribute name="cascade" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="optimistic-locking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A simple type that is used within an optimistic-locking
- * specification to specify the type of optimistic-locking that
- * EclipseLink should use when updating or deleting entities.
- */
- public enum OptimisticLockingType {
- /**
- * Using this type of locking policy compares every field in the table
- * in the WHERE clause when doing an update or a delete. If any field
- * has been changed, an optimistic locking exception will be thrown.
- */
- ALL_COLUMNS,
-
- /**
- * Using this type of locking policy compares only the changed fields
- * in the WHERE clause when doing an update. If any field has been
- * changed, an optimistic locking exception will be thrown. A delete
- * will only compare the primary key.
- */
- CHANGED_COLUMNS,
-
- /**
- * Using this type of locking compares selected fields in the WHERE
- * clause when doing an update or a delete. If any field has been
- * changed, an optimistic locking exception will be thrown. Note that
- * the fields specified must be mapped and not be primary keys.
- */
- SELECTED_COLUMNS,
-
- /**
- * Using this type of locking policy compares a single version number
- * in the where clause when doing an update. The version field must be
- * mapped and not be the primary key.
- */
- VERSION_COLUMN
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL_COLUMNS"/>
- <xsd:enumeration value="CHANGED_COLUMNS"/>
- <xsd:enumeration value="SELECTED_COLUMNS"/>
- <xsd:enumeration value="VERSION_COLUMN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="order-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderColumn {
- String name() default "";
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="correction-type" type="orm:order-column-correction-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-column-correction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum OrderCorrectionType {
- READ,
- READ_WRITE,
- EXCEPTION
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="READ_WRITE"/>
- <xsd:enumeration value="EXCEPTION"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="primary-key">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The PrimaryKey annotation allows advanced configuration of the Id.
- * A validation policy can be given that allows specifying if zero is a valid id value.
- * The set of primary key columns can also be specified precisely.
- *
- * @author James Sutherland
- * @since EclipseLink 1.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PrimaryKey {
- /**
- * (Optional) Configures what id validation is done.
- * By default 0 is not a valid id value, this can be used to allow 0 id values.
- */
- IdValidation validation() default IdValidation.ZERO;
-
- /**
- * (Optional) Configures what cache key type is used to store the object in the cache.
- * By default the type is determined by what type is optimal for the class.
- */
- CacheKeyType cacheKeyType() default CacheKeyType.AUTO;
-
- /**
- * (Optional) Used to specify the primary key columns directly.
- * This can be used instead of @Id if the primary key includes a non basic field,
- * such as a foreign key, or a inheritance discriminator, embedded, or transformation mapped field.
- */
- Column[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="validation" type="orm:id-validation"/>
- <xsd:attribute name="cache-key-type" type="orm:cache-key-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>
-
- A user defined mapping's property.
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Property {
- /**
- * Property name.
- */
- String name();
-
- /**
- * String representation of Property value,
- * converted to an instance of valueType.
- */
- String value();
-
- /**
- * Property value type.
- * The value converted to valueType by ConversionManager.
- * If specified must be a simple type that could be handled by
- * ConversionManager:
- * numerical, boolean, temporal.
- */
- Class valueType() default String.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="query-redirectors">
- <xsd:annotation>
- <xsd:documentation>
-
-@Target({TYPE}) @Retention(RUNTIME)
-public @interface QueryRedirectors {
-
- /**
- * This AllQueries Query Redirector will be applied to any executing object query
- * that does not have a more precise redirector (like the
- * ReadObjectQuery Redirector) or a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- *
- */
- Class allQueries() default void.class;
-
- /**
- * A Default ReadAll Query Redirector will be applied to any executing
- * ReadAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getResultList() API this is the redirector that will be invoked
- */
- Class readAll() default void.class;
-
- /**
- * A Default ReadObject Query Redirector will be applied to any executing
- * ReadObjectQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getSingleResult() API or EntityManager.find() this is the redirector that will be invoked
- */
- Class readObject() default void.class;
-
- /**
- * A Default ReportQuery Redirector will be applied to any executing
- * ReportQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query that contains agregate functions or selects multiple entities this is the redirector that will be invoked
- */
- Class report() default void.class;
-
- /**
- * A Default Update Query Redirector will be applied to any executing
- * UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.
- * In EclipseLink an UpdateObjectQuery is executed whenever flushing changes to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class update() default void.class;
-
- /**
- * A Default Insert Query Redirector will be applied to any executing
- * InsertObjectQuery that does not have a redirector set directly on the query.
- * In EclipseLink an InsertObjectQuery is executed when persisting an object to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class insert() default void.class;
-
- /**
- * A Default Delete Object Query Redirector will be applied to any executing
- * DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class delete() default void.class;
-
-}
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="all-queries" type="xsd:string"/>
- <xsd:attribute name="read-all" type="xsd:string"/>
- <xsd:attribute name="read-object" type="xsd:string"/>
- <xsd:attribute name="report" type="xsd:string"/>
- <xsd:attribute name="update" type="xsd:string"/>
- <xsd:attribute name="insert" type="xsd:string"/>
- <xsd:attribute name="delete" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="read-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * Unless the TransformationMapping is write-only, it should have a
- * ReadTransformer, it defines transformation of database column(s)
- * value(s)into attribute value.
- *
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReadTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.AttributeTransformer
- * interface. The class will be instantiated, its
- * buildAttributeValue will be used to create the value to be
- * assigned to the attribute.
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be assigned to the attribute (not assigns the value to
- * the attribute). Either transformerClass or method must be
- * specified, but not both.
- */
- String method() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="return-insert">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReturnInsert {
- /**
- * A ReturnInsert annotation allows for INSERT operations to return
- * values back into the object being written. This allows for table
- * default values, trigger or stored procedures computed values to
- * be set back into the object.
- */
- boolean returnOnly() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="return-only" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- String catalog() default "";
- String schema() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="entity-result" type="orm:entity-result"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="stored-procedure-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A StoredProcedureParameter annotation is used within a
- * NamedStoredProcedureQuery annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface StoredProcedureParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Optional) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Required) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) The type of Java class desired back from the procedure,
- * this is dependent on the type returned from the procedure.
- */
- Class type() default void.class;
-
- /**
- * (Optional) The JDBC type code, this dependent on the type returned
- * from the procedure.
- */
- int jdbcType() default -1;
-
- /**
- * (Optional) The JDBC type name, this may be required for ARRAY or
- * STRUCT types.
- */
- String jdbcTypeName() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="query-parameter" type="xsd:string" use="required"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="jdbc-type" type="xsd:integer"/>
- <xsd:attribute name="jdbc-type-name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface StructConverter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must
- * implement the EclipseLink interface
- * org.eclipse.persistence.mappings.converters.Converter
- */
- String converter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="converter" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="time-of-day">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface TimeOfDay {
- /**
- * (Optional) Hour of the day.
- */
- int hour() default 0;
-
- /**
- * (Optional) Minute of the day.
- */
- int minute() default 0;
-
- /**
- * (Optional) Second of the day.
- */
- int second() default 0;
-
- /**
- * (Optional) Millisecond of the day.
- */
- int millisecond() default 0;
-
- /**
- * Internal use. Do not modify.
- */
- boolean specified() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="hour" type="xsd:integer"/>
- <xsd:attribute name="minute" type="xsd:integer"/>
- <xsd:attribute name="second" type="xsd:integer"/>
- <xsd:attribute name="millisecond" type="xsd:integer"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transformation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Transformation is an optional annotation for
- * org.eclipse.persistence.mappings.TransformationMapping.
- * TransformationMapping allows to map an attribute to one or more
- * database columns.
- *
- * Transformation annotation is an optional part of
- * TransformationMapping definition. Unless the TransformationMapping is
- * write-only, it should have a ReadTransformer, it defines
- * transformation of database column(s) value(s)into attribute value.
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Transformation {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) The optional element is a hint as to whether the value
- * of the field or property may be null. It is disregarded
- * for primitive types, which are considered non-optional.
- */
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="read-transformer" type="orm:read-transformer"/>
- <xsd:element name="write-transformer" type="orm:write-transformer" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access" type="orm:access-type" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface TypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence field
- * or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent field
- * or property.
- */
- Class objectType() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String name() default "";
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="variable-one-to-one">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Variable one to one mappings are used to represent a pointer
- * references between a java object and an implementer of an interface.
- * This mapping is usually represented by a single pointer (stored in an
- * instance variable) between the source and target objects. In the
- * relational database tables, these mappings are normally implemented
- * using a foreign key and a type code.
- *
- * A VariableOneToOne can be specified within an Entity,
- * MappedSuperclass and Embeddable class.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface VariableOneToOne {
- /**
- * (Optional) The interface class that is the target of the
- * association. If not specified it will be inferred from the type
- * of the object being referenced.
- */
- Class targetInterface() default void.class;
-
- /**
- * (Optional) The operations that must be cascaded to the target of
- * the association.
- */
- CascadeType[] cascade() default {};
-
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) Whether the association is optional. If set to false
- * then a non-null relationship must always exist.
- */
- boolean optional() default true;
-
- /**
- * (Optional) The discriminator column will hold the type
- * indicators. If the DiscriminatorColumn is not specified, the name
- * of the discriminator column defaults to "DTYPE" and the
- * discriminator type to STRING.
- */
- DiscriminatorColumn discriminatorColumn() default @DiscriminatorColumn;
-
- /**
- * (Optional) The list of discriminator types that can be used with
- * this VariableOneToOne. If none are specified then those entities
- * within the persistence unit that implement the target interface
- * will be added to the list of types. The discriminator type will
- * default as follows:
- * - If DiscriminatorColumn type is STRING: Entity.name()
- * - If DiscriminatorColumn type is CHAR: First letter of the
- * Entity class
- * - If DiscriminatorColumn type is INTEGER: The next integer after
- * the highest integer explicitly added.
- */
- DiscriminatorClass[] discriminatorClasses() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="discriminator-class" type="orm:discriminator-class" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-interface" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="write-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- *
- * A single WriteTransformer may be specified directly on the method or
- * attribute. Multiple WriteTransformers should be wrapped into
- * WriteTransformers annotation. No WriteTransformers specified for
- * read-only mapping. Unless the TransformationMapping is write-only, it
- * should have a ReadTransformer, it defines transformation of database
- * column(s) value(s)into attribute value.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface WriteTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.FieldTransformer
- * interface. The class will be instantiated, its buildFieldValue
- * will be used to create the value to be written into the database
- * column. Note that for ddl generation and returning to be
- * supported the method buildFieldValue in the class should be
- * defined to return the relevant Java type, not just Object as
- * defined in the interface, for instance:
- * public Time buildFieldValue(Object instance, String fieldName, Session session).
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be written into the database column.
- * Note that for ddl generation and returning to be supported the
- * method should be defined to return a particular type, not just
- * Object, for instance:
- * public Time getStartTime().
- * The method may require a Transient annotation to avoid being
- * mapped as Basic by default.
- * Either transformerClass or method must be specified, but not both.
- */
- String method() default "";
-
- /**
- * Specify here the column into which the value should be written.
- * The only case when this could be skipped is if a single
- * WriteTransformer annotates an attribute - the attribute's name
- * will be used as a column name.
- */
- Column column() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="batch-fetch">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A BatchFetch annotation can be used on any relationship mapping,
- * (OneToOne, ManyToOne, OneToMany, ManyToMany, ElementCollection, BasicCollection, BasicMap).
- * It allows the related objects to be batch read in a single query.
- * Batch fetching can also be set at the query level, and it is
- * normally recommended to do so as all queries may not require batching.
- *
- * @author James Sutherland
- * @since EclipseLink 2.1
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BatchFetch {
- /**
- * (Optional) The type of batch-fetch to use.
- * Either JOIN, EXISTS or IN.
- * JOIN is the default.
- */
- BatchFetchType value() default BatchFetchType.JOIN;
-
- /**
- * Define the default batch fetch size.
- * This is only used for IN type batch reading and defines
- * the number of keys used in each IN clause.
- * The default size is 256, or the query's pageSize for cursor queries.
- */
- int size() default -1;
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:batch-fetch-type"/>
- <xsd:attribute name="size" type="xsd:integer"/>
- </xsd:complexType>
-
-</xsd:schema>
-
-
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_2.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_2.xsd
deleted file mode 100644
index 223029e12a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_2.xsd
+++ /dev/null
@@ -1,4778 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ******************************************************************************************************************************* -->
-<!-- Copyright (c) 1998, 2010 Oracle. All rights reserved. -->
-<!-- This program and the accompanying materials are made available under the -->
-<!-- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 -->
-<!-- which accompanies this distribution. -->
-<!-- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html -->
-<!-- and the Eclipse Distribution License is available at -->
-<!-- http://www.eclipse.org/org/documents/edl-v10.php. -->
-<!-- -->
-<!-- Contributors: -->
-<!-- Oracle - initial API and implementation from Oracle TopLink -->
-<!-- tware - update version number to 2.0 -->
-<!-- 12/2/2009-2.1 Guy Pelletier -->
-<!-- - 296289: Add current annotation metadata support on mapped superclasses to EclipseLink-ORM.XML Schema -->
-<!-- - 296612: Add current annotation only metadata support of return insert/update to the EclipseLink-ORM.XML Schema -->
-<!-- - formatted to match orm_2_0.xsd so that users can easily compare the two schemas -->
-<!-- 5/4/2010-2.1 Guy Pelletier -->
-<!-- - 227219: Expand EclipseLink-ORM.XML schema functionality for 2.1 release (update version to 2.1) -->
-<!-- 6/14/2010-2.2 Guy Pelletier -->
-<!-- - 247078: eclipselink-orm.xml schema should allow lob and enumerated on version and id mappings (update version to 2.2) -->
-<!-- 10/15/2010-2.2 Guy Pelletier -->
-<!-- - 322008: Improve usability of additional criteria applied to queries at the session/EM -->
-<!-- ******************************************************************************************************************************* -->
-
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.2">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)eclipselink_orm_2_2.xsd 2.2 June 14 2010
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the native Eclipselink XML mapping file
- The file may be named "META-INF/eclipselink-orm.xml" in the persistence
- archive or it may be named some other name which would be
- used to locate the file as resource on the classpath.
- Object/relational mapping files must indicate the object/relational
- mapping file schema by using the persistence namespace:
-
- http://www.eclipse.org/eclipselink/xsds/persistence/orm
-
- and indicate the version of the schema by using the version element as shown below:
-
- <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm
- eclipselink_orm_2_2.xsd
- version="2.2">
- ...
- </entity-mappings>
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="emptyType"/>
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="access-methods">
- <xsd:annotation>
- <xsd:documentation>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="get-method" type="xsd:string" use="required"/>
- <xsd:attribute name="set-method" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="additional-criteria">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An additional criteria can be specified at the Entity or MappedSuperclass
- * level. When specified at the mapped superclass level, it applies to all
- * inheriting entities unless those entities define their own additional
- * criteria, at which point the additional criteria from the mapped superclass
- * is ignored.
- *
- * The additional criteria supports any valid JPQL string and must use 'this'
- * as an alias to form your additional criteria. E.G.,
- *
- * @Entity
- * @AdditionalCriteria("this.nut.size = :NUT_SIZE and this.nut.color = :NUT_COLOR")
- * public class Bolt {...}
- *
- * Additional criteria parameters are also accepted and are set through
- * properties on the entity manager factory, or on an entity manager. When set
- * on the entity manager, the properties must be set before any query execution
- * and should not be changed for the life span of that entity manager.
- *
- * Properties set on the entity manager will override those similarly named
- * properties set on the entity manager factory.
- *
- * Additional criteria is not supported with any native queries.
- *
- * @author Guy Pelletier
- * @since EclipseLink 2.2
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface AdditionalCriteria {
- /**
- * (Required) The JPQL fragment to use as the additional criteria.
- */
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="criteria" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Cache annotation is used to set an
- * org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
- * which sets objects in EclipseLink's identity maps to be invalid
- * following given rules. By default in EclipseLink, objects do not
- * expire in the cache. Several different policies are available to
- * allow objects to expire.
- *
- * @see org.eclipse.persistence.annotations.CacheType
- *
- * A Cache anotation may be defined on an Entity or MappedSuperclass.
- * In the case of inheritance, a Cache annotation should only be defined
- * on the root of the inheritance hierarchy.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Cache {
- /**
- * (Optional) The type of cache to use.
- */
- CacheType type() default SOFT_WEAK;
-
- /**
- * (Optional) The size of cache to use.
- */
- int size() default 100;
-
- /**
- * (Optional) Cached instances in the shared cache,
- * or only a per EntityManager isolated cache.
- * The default is shared.
- * @deprecated As of Eclipselink 2.2. See the attribute 'isolation'
- */
- @Deprecated
- boolean shared() default true;
-
- /**
- * (Optional) Controls the level of caching this Entity will use.
- * The default is CacheIsolationType.SHARED which has EclipseLink
- * Caching all Entities in the Shared Cache.
- * @see org.eclipse.persistence.config.CacheIsolationType
- */
- CacheIsolationType isolation() default SHARED;
-
- /**
- * (Optional) Expire cached instance after a fix period of time (ms).
- * Queries executed against the cache after this will be forced back
- * to the database for a refreshed copy
- */
- int expiry() default -1; // minus one is no expiry.
-
- /**
- * (Optional) Expire cached instance a specific time of day. Queries
- * executed against the cache after this will be forced back to the
- * database for a refreshed copy
- */
- TimeOfDay expiryTimeOfDay() default @TimeOfDay(specified=false);
-
- /**
- * (Optional) Force all queries that go to the database to always
- * refresh the cache.
- */
- boolean alwaysRefresh() default false;
-
- /**
- * (Optional) For all queries that go to the database, refresh the
- * cache only if the data received from the database by a query is
- * newer than the data in the cache (as determined by the optimistic
- * locking field)
- */
- boolean refreshOnlyIfNewer() default false;
-
- /**
- * (Optional) Setting to true will force all queries to bypass the
- * cache for hits but still resolve against the cache for identity.
- * This forces all queries to hit the database.
- */
- boolean disableHits() default false;
-
- /**
- * (Optional) The cache coordination mode.
- */
- CacheCoordinationType coordinationType() default SEND_OBJECT_CHANGES;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="expiry" type="xsd:integer" minOccurs="0"/>
- <xsd:element name="expiry-time-of-day" type="orm:time-of-day" minOccurs="0"/>
- </xsd:choice>
- <xsd:attribute name="size" type="xsd:integer"/>
- <xsd:attribute name="shared" type="xsd:boolean"/>
- <xsd:attribute name="isolation" type="orm:cache-isolation-type"/>
- <xsd:attribute name="type" type="orm:cache-type"/>
- <xsd:attribute name="always-refresh" type="xsd:boolean"/>
- <xsd:attribute name="refresh-only-if-newer" type="xsd:boolean"/>
- <xsd:attribute name="disable-hits" type="xsd:boolean"/>
- <xsd:attribute name="coordination-type" type="orm:cache-coordination-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache-interceptor">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface CacheInterceptor {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
-
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The CacheType enum is used with the Cache annotation for a
- * persistent class. It defines the type of IdentityMap/Cache used for
- * the class. By default the SOFT_WEAK cache type is used.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheType {
- /**
- * Provides full caching and guaranteed identity. Caches all objects
- * and does not remove them.
- * WARNING: This method may be memory intensive when many objects are
- * read.
- */
- FULL,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using weak references. This method allows full garbage
- * collection and provides full caching and guaranteed identity.
- */
- WEAK,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using soft references. This method allows full garbage
- * collection when memory is low and provides full caching and
- * guaranteed identity.
- */
- SOFT,
-
- /**
- * Similar to the WEAK identity map except that it maintains a
- * most-frequently-used sub-cache. The size of the sub-cache is
- * proportional to the size of the identity map as specified by
- * descriptor's setIdentityMapSize() method. The sub-cache
- * uses soft references to ensure that these objects are
- * garbage-collected only if the system is low on memory.
- */
- SOFT_WEAK,
-
- /**
- * Identical to the soft cache weak (SOFT_WEAK) identity map except
- * that it uses hard references in the sub-cache. Use this identity
- * map if soft references do not behave properly on your platform.
- */
- HARD_WEAK,
-
- /**
- * A cache identity map maintains a fixed number of objects
- * specified by the application. Objects are removed from the cache
- * on a least-recently-used basis. This method allows object
- * identity for the most commonly used objects.
- * WARNING: Furnishes caching and identity, but does not guarantee
- * identity.
- */
- CACHE,
-
- /**
- * WARNING: Does not preserve object identity and does not cache
- * objects.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="FULL"/>
- <xsd:enumeration value="WEAK"/>
- <xsd:enumeration value="SOFT"/>
- <xsd:enumeration value="SOFT_WEAK"/>
- <xsd:enumeration value="HARD_WEAK"/>
- <xsd:enumeration value="CACHE"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
- <xsd:simpleType name="cache-isolation-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Options for how Entity instances should be shared within an EclipseLink Persistence Unit / ServerSession
- * @see ClassDescriptor#setCacheIsolationType(CacheIsolationType)
- * @author Gordon Yorke
- * @since EclipseLink 2.2
- */
- public enum CacheIsolationType {
-
- /**
- * Entity instances will be cached within the EntityManagerFactory/ServerSession level.
- * Any user queries for shared cache instances (ie Read-Only query hint) will return an Entity
- * instance that may be shared by multiple clients.
- *
- * This setting is the default isolation level.
- */
- SHARED,
-
- /**
- * Entity state information will be cached in the shared cache but Entity
- * instances will not be shared. Any user queries for shared cache instances
- * (ie Read-Only query hint) will return a new Entity instance with the cached state.
- * This will ensure the instance is <i>protected</i> from any concurrent
- * state change.
- */
- PROTECTED,
-
- /**
- * The Entity and its data is not stored in the shared cache but is
- * <i>isolated</i> to the Persistence Context/UnitOfWork or
- * IsolatedClientSession. This setting effectively disables second level
- * caching for this entity and should be used when users do not want caching for
- * a particular Entity.
- */
- ISOLATED;
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SHARED"/>
- <xsd:enumeration value="PROTECTED"/>
- <xsd:enumeration value="ISOLATED"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-coordination-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the Cache annotation.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheCoordinationType {
- /**
- * Sends a list of changed objects including data about the changes.
- * This data is merged into the receiving cache.
- */
- SEND_OBJECT_CHANGES,
-
- /**
- * Sends a list of the identities of the objects that have changed.
- * The receiving cache invalidates the objects (rather than changing
- * any of the data)
- */
- INVALIDATE_CHANGED_OBJECTS,
-
- /**
- * Same as SEND_OBJECT_CHANGES except it also includes any newly
- * created objects from the transaction.
- */
- SEND_NEW_OBJECTS_WITH_CHANGES,
-
- /**
- * Does no cache coordination.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SEND_OBJECT_CHANGES"/>
- <xsd:enumeration value="INVALIDATE_CHANGED_OBJECTS"/>
- <xsd:enumeration value="SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="change-tracking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The ChangeTracking annotation is used to specify the
- * org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy
- * which computes changes sets for EclipseLink's UnitOfWork commit
- * process. An ObjectChangePolicy is stored on an Entity's descriptor.
- *
- * A ChangeTracking annotation may be specified on an Entity,
- * MappedSuperclass or Embeddable.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ChangeTracking {
- /**
- * (Optional) The type of change tracking to use.
- */
- ChangeTrackingType value() default AUTO;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:change-tracking-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="change-tracking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the ChangeTracking annotation.
- */
- public enum ChangeTrackingType {
- /**
- * An ATTRIBUTE change tracking type allows change tracking at the
- * attribute level of an object. Objects with changed attributes will
- * be processed in the commit process to include any changes in the
- * results of the commit. Unchanged objects will be ignored.
- */
- ATTRIBUTE,
-
- /**
- * An OBJECT change tracking policy allows an object to calculate for
- * itself whether it has changed. Changed objects will be processed in
- * the commit process to include any changes in the results of the
- * commit. Unchanged objects will be ignored.
- */
- OBJECT,
-
- /**
- * A DEFERRED change tracking policy defers all change detection to
- * the UnitOfWork's change detection process. Essentially, the
- * calculateChanges() method will run for all objects in a UnitOfWork.
- * This is the default ObjectChangePolicy
- */
- DEFERRED,
-
- /**
- * Will not set any change tracking policy.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ATTRIBUTE"/>
- <xsd:enumeration value="OBJECT"/>
- <xsd:enumeration value="DEFERRED"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="customizer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Customizer annotation is used to specify a class that implements
- * the org.eclipse.persistence.config.DescriptorCustomizer
- * interface and is to run against an enetity's class descriptor after all
- * metadata processing has been completed.
- *
- * The Customizer annotation may be defined on an Entity, MappedSuperclass
- * or Embeddable class. In the case of inheritance, a Customizer is not
- * inherited from its parent classes.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Customizer {
- /**
- * (Required) Defines the name of the descriptor customizer class that
- * should be applied for the related entity or embeddable class.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="direction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the StoredProcedureParameter annotation.
- * It is used to specify the direction of the stored procedure
- * parameters of a named stored procedure query.
- */
- public enum Direction {
- /**
- * Input parameter
- */
- IN,
-
- /**
- * Output parameter
- */
- OUT,
-
- /**
- * Input and output parameter
- */
- IN_OUT,
-
- /**
- * Output cursor
- */
- OUT_CURSOR
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="IN_OUT"/>
- <xsd:enumeration value="OUT_CURSOR"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of a mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query, named-native-query, or
- result-set-mapping of the same name in the same or different mapping
- files in a persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata"
- type="orm:persistence-unit-metadata"
- minOccurs="0"/>
- <xsd:element name="package" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="partitioning" type="orm:partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="replication-partitioning" type="orm:replication-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="round-robin-partitioning" type="orm:round-robin-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="pinned-partitioning" type="orm:pinned-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="range-partitioning" type="orm:range-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="value-partitioning" type="orm:value-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="hash-partitioning" type="orm:hash-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="union-partitioning" type="orm:union-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:versionType"
- fixed="2.2" use="required"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="existence-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * The ExistenceChecking annotation is used to specify the type of
- * checking EclipseLink should use when updating entities.
- *
- * An existence-checking specification is supported on an Entity or
- * MappedSuperclass annotation.
- */
- public @interface ExistenceChecking {
-
- /**
- * (Optional) Set the existence check for determining
- * if an insert or update should occur for an object.
- */
- ExistenceType value() default CHECK_CACHE;
- }
-
- /**
- * Assume that if the objects primary key does not include null and
- * it is in the cache, then it must exist.
- */
- CHECK_CACHE,
-
- /**
- * Perform does exist check on the database.
- */
- CHECK_DATABASE,
-
- /**
- * Assume that if the objects primary key does not include null then
- * it must exist. This may be used if the application guarantees or
- * does not care about the existence check.
- */
- ASSUME_EXISTENCE,
-
- /**
- * Assume that the object does not exist. This may be used if the
- * application guarantees or does not care about the existence check.
- * This will always force an insert to be called.
- */
- ASSUME_NON_EXISTENCE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="CHECK_CACHE"/>
- <xsd:enumeration value="CHECK_DATABASE"/>
- <xsd:enumeration value="ASSUME_EXISTENCE"/>
- <xsd:enumeration value="ASSUME_NON_EXISTENCE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified,
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-default-mappings" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults"
- type="orm:persistence-unit-defaults"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- catalog - Used as the catalog for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- delimited-identifiers - Used to treat database identifiers as
- delimited identifiers.
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in all entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="delimited-identifiers" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its subelements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="additional-criteria" type="orm:additional-criteria" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="table" type="orm:table" minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="discriminator-value" type="orm:discriminator-value" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- </xsd:sequence>
- <xsd:element name="class-extractor" type="orm:class-extractor" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="fetch-group" type="orm:fetch-group" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="query-redirectors" type="orm:query-redirectors" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:group name="partitioning-group">
- <xsd:sequence>
- <xsd:element name="partitioning" type="orm:partitioning" minOccurs="0"/>
- <xsd:element name="replication-partitioning" type="orm:replication-partitioning" minOccurs="0"/>
- <xsd:element name="round-robin-partitioning" type="orm:round-robin-partitioning" minOccurs="0"/>
- <xsd:element name="pinned-partitioning" type="orm:pinned-partitioning" minOccurs="0"/>
- <xsd:element name="range-partitioning" type="orm:range-partitioning" minOccurs="0"/>
- <xsd:element name="value-partitioning" type="orm:value-partitioning" minOccurs="0"/>
- <xsd:element name="hash-partitioning" type="orm:hash-partitioning" minOccurs="0"/>
- <xsd:element name="union-partitioning" type="orm:union-partitioning" minOccurs="0"/>
- <xsd:element name="partitioned" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:group>
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- <xsd:enumeration value="VIRTUAL"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns() default{};
- JoinTable joinTable() default @JoinTable;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="id" type="orm:id"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-collection" type="orm:basic-collection" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-map" type="orm:basic-map" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="variable-one-to-one" type="orm:variable-one-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection" type="orm:element-collection"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transformation" type="orm:transformation" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="lob" type="orm:lob"/>
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="return-insert" type="orm:return-insert" minOccurs="0"/>
- <xsd:element name="return-update" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="basic-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicCollection {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the value column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-map">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicMap {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the data column that holds the direct map
- * key. If the name on te key column is "", the name will default to:
- * the name of the property or field; "_KEY".
- */
- Column keyColumn() default @Column;
-
- /**
- * (Optional) Specify the key converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the direct map key.
- */
- Convert keyConverter() default @Convert;
-
- /**
- * (Optional) The name of the data column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
-
- /**
- * (Optional) Specify the value converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the value column mapping.
- */
- Convert valueConverter() default @Convert;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="key-converter" type="xsd:string" minOccurs="0"/>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="value-converter" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-detach" type="orm:emptyType"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="class-extractor">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A ClassExtractor allows for a user defined class indicator in place of
- * providing a discriminator column. The class has the following restrictions:
-
- * - It must extend the org.eclipse.persistence.descriptors.ClassExtractor
- * class and implement the extractClassFromRow(Record, Session) method.
- * - That method must take a database row (a Record/Map) as an argument and
- * must return the class to use for that row.
- *
- * This method will be used to decide which class to instantiate when reading
- * from the database. It is the application's responsibility to populate any
- * typing information in the database required to determine the class from the
- * row.
- *
- * The ClassExtractor must only be set on the root of an entity class or
- * sub-hierarchy in which a different inheritance strategy is applied. The
- * ClassExtractor can only be used with the SINGLE_TABLE and JOINED inheritance
- * strategies.
- *
- * If a ClassExtractor is used then a DiscriminatorColumn cannot be used. A
- * ClassExtractor also cannot be used on either the root or its subclasses.
- *
- * In addition, for more complex configurations using a ClassExtractor and a
- * SINGLE_TABLE strategy, the descriptor's withAllSubclasses and onlyInstances
- * expressions should be set through the ClassExtractor's initialize method.
- *
- * @see org.eclipse.persistence.descriptors.InheritancePolicy.setWithAllSubclassesExpression(Expression)
- * @see org.eclipse.persistence.descriptors.InheritancePolicy.setOnlyInstancesExpression(Expression)
- *
- * @author Guy Pelletier
- * @since EclipseLink 2.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ClassExtractor {
- /**
- * (Required) Defines the name of the class extractor that should be
- * applied to this entity's descriptor.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CloneCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.CloneCopyPolicy on an
- * Entity. A CloneCopyPolicy must specify at one or both of the "method"
- * or "workingCopyMethod". "workingCopyMethod" is used to clone objects
- * that will be returned to the user as they are registered in
- * EclipseLink's transactional mechanism, the UnitOfWork. "method" will
- * be used for the clone that is used for comparison in conjunction with
- * EclipseLink's DeferredChangeDetectionPolicy
- *
- * A CloneCopyPolicy should be specified on an Entity, MappedSuperclass
- * or Embeddable.
- *
- * Example:
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod", workingCopyMethod="myWorkingCopyCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(workingCopyMethodName="myWorkingCopyClone")
- */
- public @interface CloneCopyPolicy {
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified this defines
- * a method that will be used to create a clone that will be used
- * for comparison by
- * EclipseLink's DeferredChangeDetectionPolicy
- */
- String method();
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified
- * this defines a method that will be used to create a clone that
- * will be used to create the object returned when registering an
- * Object in an EclipseLink UnitOfWork
- */
- String workingCopyMethod();
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method" type="xsd:string"/>
- <xsd:attribute name="working-copy-method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface CollectionTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="eclipselink-collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface CollectionTable {
- /**
- * (Optional) The name of the collection table. If it is not
- * specified, it is defaulted to the concatenation of the following:
- * the name of the source entity; "_" ; the name of the relationship
- * property or field of the source entity.
- */
- String name() default "";
-
- /**
- * (Optional) The catalog of the table. It defaults to the persistence
- * unit default catalog.
- */
- String catalog() default "";
-
- /**
- * (Optional) The schema of the table. It defaults to the persistence
- * unit default schema.
- */
- String schema() default "";
-
- /**
- * (Optional) Used to specify a primary key column that is used as a
- * foreign key to join to another table. If the source entity uses a
- * composite primary key, a primary key join column must be specified
- * for each field of the composite primary key. In a single primary
- * key case, a primary key join column may optionally be specified.
- * Defaulting will apply otherwise as follows:
- * name, the same name as the primary key column of the primary table
- * of the source entity. referencedColumnName, the same name of
- * primary key column of the primary table of the source entity.
- */
- PrimaryKeyJoinColumn[] primaryKeyJoinColumns() default {};
-
- /**
- * (Optional) Unique constraints that are to be placed on the table.
- * These are only used if table generation is in effect.
- */
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="conversion-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface ConversionValue {
- /**
- * (Required) Specify the database value.
- */
- String dataValue();
-
- /**
- * (Required) Specify the object value.
- */
- String objectValue();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="data-value" type="xsd:string" use="required"/>
- <xsd:attribute name="object-value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Converter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must implement
- * the org.eclipse.persistence.mappings.converters.Converter interface.
- */
- Class converterClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A Partitioning is used to partition the data for a class across multiple difference databases
- * or across a database cluster such as Oracle RAC.
- * Partitioning can provide improved scalability by allowing multiple database machines to service requests.
- * This annotation configures a custom PartitioningPolicy.
- *
- * If multiple partitions are used to process a single transaction, JTA should be used for proper XA transaction support.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- * Partition policies are globally named to allow reuse,
- * the partitioning policy must also be set using the @Partitioned annotation to be used.
- *
- * @see Partitioned
- * @see org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Partitioning {
- String name();
-
- /**
- * (Required) Full package.class name of a subclass of PartitioningPolicy.
- */
- Class partitioningClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="hash-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * HashPartitioning partitions access to a database cluster by the hash of a field value from the object,
- * such as the object's location, or tenant.
- * The hash indexes into the list of connection pools.
- * All write or read request for object's with that hash value are sent to the server.
- * If a query does not include the field as a parameter, then it can either be sent
- * to all server's and unioned, or left to the sesion's default behavior.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.HashPartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface HashPartitioning {
- String name();
-
- /**
- * The database column or query parameter to partition queries by.
- * This is the table column name, not the class attribute name.
- * The column value must be included in the query and should normally be part of the object's Id.
- * This can also be the name of a query parameter.
- * If a query does not contain the field the query will not be partitioned.
- */
- Column partitionColumn();
-
- /**
- * List of connection pool names to partition across.
- */
- String[] connectionPools();
-
- /**
- * Defines if queries that do not contain the partition field should be sent
- * to every database and have the result unioned.
- */
- boolean unionUnpartitionableQueries() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="partition-column" type="orm:column"/>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="union-unpartitionable-queries" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="range-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * RangePartitioningPolicy partitions access to a database cluster by a field value from the object,
- * such as the object's id, location, or tenant.
- * Each server is assigned a range of values.
- * All write or read request for object's with that value are sent to the server.
- * If a query does not include the field as a parameter, then it can either be sent
- * to all server's and unioned, or left to the sesion's default behavior.
- *
- * If multiple partitions are used to process a single transaction, JTA should be used for proper XA transaction support.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- * Partition policies are globally named to allow reuse,
- * the partitioning policy must also be set using the @Partitioned annotation to be used.
- *
- * @see Partitioned
- * @see org.eclipse.persistence.descriptors.partitioning.RangePartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface RangePartitioning {
- String name();
-
- /**
- * The database column or query parameter to partition queries by.
- * This is the table column name, not the class attribute name.
- * The column value must be included in the query and should normally be part of the object's Id.
- * This can also be the name of a query parameter.
- * If a query does not contain the field the query will not be partitioned.
- */
- Column partitionColumn();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- RangePartition[] partitions();
-
- /**
- * Defines if queries that do not contain the partition field should be sent
- * to every database and have the result unioned.
- */
- boolean unionUnpartitionableQueries() default false;
-
- /** The type of the start and end values. */
- Class partitionValueType() default String.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="partition-column" type="orm:column"/>
- <xsd:element name="partition" type="orm:range-partition" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="union-unpartitionable-queries" type="xsd:boolean"/>
- <xsd:attribute name="partition-value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="range-partition">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Represent a specific range partition.
- * Values = startValue and = endValue will be routed to the connection pool.
- *
- * @see RangePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.RangePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.RangePartition
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface RangePartition {
- /** The String representation of the range start value. */
- String startValue() default "";
- /** The String representation of the range start value. */
- String endValue() default "";
- /** The connection pool to route queries to for this range. */
- String connectionPool();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="start-value" type="xsd:string"/>
- <xsd:attribute name="end-value" type="xsd:string"/>
- <xsd:attribute name="connection-pool" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="value-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * ValuePartitioning partitions access to a database cluster by a field value from the object,
- * such as the object's location, or tenant.
- * Each value is assigned a specific server.
- * All write or read request for object's with that value are sent to the server.
- * If a query does not include the field as a parameter, then it can either be sent
- * to all server's and unioned, or left to the sesion's default behavior.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.ValuePartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ValuePartitioning {
- String name();
-
- /**
- * The database column or query parameter to partition queries by.
- * This is the table column name, not the class attribute name.
- * The column value must be included in the query and should normally be part of the object's Id.
- * This can also be the name of a query parameter.
- * If a query does not contain the field the query will not be partitioned.
- */
- Column partitionColumn();
-
- /** Store the value partitions. Each partition maps a value to a connectionPool. */
- ValuePartition[] partitions();
-
- /** The type of the start and end values. */
- Class partitionValueType() default String.class;
-
- /** The default connection pool is used for any unmapped values. */
- String defaultConnectionPool();
-
- /**
- * Defines if queries that do not contain the partition field should be sent
- * to every database and have the result unioned.
- */
- boolean unionUnpartitionableQueries() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="partition-column" type="orm:column"/>
- <xsd:element name="partition" type="orm:value-partition" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="union-unpartitionable-queries" type="xsd:boolean"/>
- <xsd:attribute name="default-connection-pool" type="xsd:string"/>
- <xsd:attribute name="partition-value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="value-partition">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Represent a specific value partition.
- * The value will be routed to the connection pool.
- *
- * @see ValuePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.ValuePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.ValuePartition
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ValuePartition {
- /** The String representation of the range start value. */
- String value() default "";
-
- /** The connection pool to route queries to for this value. */
- String connectionPool();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="connection-pool" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="round-robin-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * RoundRobinPartitioning sends requests in a round robin fashion to the set of connection pools.
- * It is for load-balancing read queries across a cluster of database machines.
- * It requires that the full database be replicated on each machine, so does not support partitioning.
- * The data should either be read-only, or writes should be replicated on the database.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.RoundRobinPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface RoundRobinPartitioning {
- String name();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- String[] connectionPools();
-
- /**
- * This allows for a set of database to be written to and kept in synch,
- * and have reads load-balanced across the databases.
- */
- boolean replicateWrites() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="replicate-writes" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="replication-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * ReplicationPartitioning sends requests to a set of connection pools.
- * It is for replicating data across a cluster of database machines.
- * Only modification queries are replicated.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.ReplicationPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReplicationPartitioning {
- String name();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- String[] connectionPools();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="union-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * UnionPartitioning sends queries to all connection pools and unions the results.
- * This is for queries or relationships that span partitions when partitioning is used,
- * such as on a ManyToMany cross partition relationship.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.UnionPartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface UnionPartitioning {
- String name();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- String[] connectionPools();
-
- /**
- * Defines if write queries should be replicated.
- * Writes are normally not replicated when unioning,
- * but can be for ManyToMany relationships, when the join table needs to be replicated.
- */
- boolean replicateWrites() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="replicate-writes" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pinned-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * PinnedPartitioning pins requests to a single connection pool.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.PinnedPartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface PinnedPartitioning {
- String name();
-
- /**
- * The connection pool name to pin queries to.
- */
- String connectionPool();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="connection-pool" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CopyPolicy is used to set a
- * org.eclipse.persistence.descriptors.copying.CopyPolicy on an Entity.
- * It is required that a class that implements
- * org.eclipse.persistence.descriptors.copying.CopyPolicy be specified
- * as the argument.
- *
- * A CopyPolicy should be specified on an Entity, MappedSuperclass or
- * Embeddable.
- *
- * For instance:
- * @Entity
- * @CopyPolicy("example.MyCopyPolicy")
- */
- public @interface CopyPolicy {
-
- /*
- * (Required)
- * This defines the class of the copy policy. It must specify a class
- * that implements org.eclipse.persistence.descriptors.copying.CopyPolicy
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-class">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A DiscriminatorClass is used within a VariableOneToOne annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface DiscriminatorClass {
- /**
- * (Required) The discriminator to be stored on the database.
- */
- String discriminator();
-
- /**
- * (Required) The class to the instantiated with the given
- * discriminator.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="discriminator" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-<xsd:complexType name="element-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ElementCollection {
- Class targetClass() default void.class;
- FetchType fetch() default LAZY;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column"
- type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="lob"
- type="orm:lob"
- minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:sequence>
- <xsd:element name="attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
-
-
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-class" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="fetch-attribute">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface FetchAttribute {
- /**
- * (Required) The fetch attribute name.
- */
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface FetchGroup {
- /**
- * (Required) The fetch group name.
- */
- String name();
-
- /**
- * (Optional) Indicates whether all relationship attributes
- * specified in the fetch group should be loaded.
- */
- boolean load() default true;
-
- /**
- * (Required) The list of attributes to fetch.
- */
- FetchAttribute[] attributes();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute" type="orm:fetch-attribute" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="load" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"
- minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value"
- minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="id-validation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The IdValidation enum determines the type value that are valid for an Id.
- * By default null is not allowed, and 0 is not allow for singleton ids of long or int type.
- * The default value is ZERO for singleton ids, and NULL for composite ids.
- * This can be set using the @PrimaryKey annotation, or ClassDescriptor API.
- *
- * @see PrimaryKey
- * @see org.eclipse.persistence.descriptors.ClassDescriptor#setIdValidation(IdValidation)
- * @author James Sutherland
- * @since EclipseLink 1.0
- */
- public enum IdValidation {
- /**
- * Only null is not allowed as an id value, 0 is allowed.
- */
- NULL,
-
- /**
- * null and 0 are not allowed, (only int and long).
- */
- ZERO,
-
- /**
- * No id validation is done.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="NULL"/>
- <xsd:enumeration value="ZERO"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="cache-key-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Configures what type of Id value is used to store the object in the cache.
- * This can either be the basic Id value for simple singleton Ids,
- * or an optimized CacheKey type.
- *
- * @see PrimaryKey#cacheKeyType()
- * @see ClassDescriptor#setCacheKeyType(CacheKeyType)
- * @author James Sutherland
- * @since EclipseLink 2.1
- */
- public enum CacheKeyType {
- /**
- * This can only be used for simple singleton Ids, such as long/int/String.
- * This is the default for simple singleton Ids.
- */
- ID_VALUE,
-
- /**
- * Optimized cache key type that allows composite and complex values.
- * This is the default for composite or complex Ids.
- */
- CACHE_KEY,
-
- /**
- * The cache key type is automatically configured depending on what is optimal for the class.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ID_VALUE"/>
- <xsd:enumeration value="CACHE_KEY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType
- { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * An InstantiationCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy
- * on an Entity. InstantiationCopyPolicy is the default CopyPolicy in
- * EclipseLink and therefore this configuration option is only used to
- * override other types of copy policies
- *
- * An InstantiationCopyPolicy should be specified on an Entity,
- * MappedSuperclass or Embeddable.
- *
- * Example:
- * @Entity
- * @InstantiationCopyPolicy
- */
- public @interface InstantiationCopyPolicy {
- }
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum JoinFetchType {
- /**
- * An inner join is used to fetch the related object.
- * This does not allow for null/empty values.
- */
- INNER,
-
- /**
- * An inner join is used to fetch the related object.
- * This allows for null/empty values.
- */
- OUTER,
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="INNER"/>
- <xsd:enumeration value="OUTER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="batch-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
- public enum BatchFetchType {
- /**
- * This is the default form of batch reading.
- * The original query's selection criteria is joined with the batch query.
- */
- JOIN,
-
- /**
- * This uses an SQL EXISTS and a sub-select in the batch query instead of a join.
- * This has the advantage of not requiring an SQL DISTINCT which can have issues
- * with LOBs, or may be more efficient for some types of queries or on some databases.
- */
- EXISTS,
-
- /**
- * This uses an SQL IN clause in the batch query passing in the source object Ids.
- * This has the advantage of only selecting the objects not already contained in the cache,
- * and can work better with cursors, or if joins cannot be used.
- * This may only work for singleton Ids on some databases.
- */
- IN
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="JOIN"/>
- <xsd:enumeration value="EXISTS"/>
- <xsd:enumeration value="IN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="lock-mode-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum LockModeType { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="WRITE"/>
- <xsd:enumeration value="OPTIMISTIC"/>
- <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="PESSIMISTIC_READ"/>
- <xsd:enumeration value="PESSIMISTIC_WRITE"/>
- <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="NONE"/>
-
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-<xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyColumn {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="map-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="additional-criteria" type="orm:additional-criteria" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0"/>
- <xsd:element name="fetch-group" type="orm:fetch-group" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="query-redirectors" type="orm:query-redirectors" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- LockModeType lockMode() default NONE;
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredProcedureQuery annotation allows the definition of
- * queries that call stored procedures as named queries.
- * A NamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Whether the query should return a result set.
- */
- boolean returnsResultSet() default true;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- <xsd:attribute name="returns-result-set" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ObjectTypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence
- * field or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent
- * field or property.
- */
- Class objectType() default void.class;
-
- /**
- * (Required) Specify the conversion values to be used
- * with the object converter.
- */
- ConversionValue[] conversionValues();
-
- /**
- * (Optional) Specify a default object value. Used for
- * legacy data if the data value is missing.
- */
- String defaultObjectValue() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="conversion-value" type="orm:conversion-value" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="default-object-value" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
-<xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- boolean orphanRemoval() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
-</xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="optimistic-locking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An optimistic-locking element is used to specify the type of
- * optimistic locking EclipseLink should use when updating or deleting
- * entities. An optimistic-locking specification is supported on
- * an entity or mapped-superclass.
- *
- * It is used in conjunction with the optimistic-locking-type.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface OptimisticLocking {
- /**
- * (Optional) The type of optimistic locking policy to use.
- */
- OptimisticLockingType type() default VERSION_COLUMN;
-
- /**
- * (Optional) For an optimistic locking policy of type
- * SELECTED_COLUMNS, this annotation member becomes a (Required)
- * field.
- */
- Column[] selectedColumns() default {};
-
- /**
- * (Optional) Specify where the optimistic locking policy should
- * cascade lock. Currently only supported with VERSION_COLUMN locking.
- */
- boolean cascade() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="selected-column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:optimistic-locking-type"/>
- <xsd:attribute name="cascade" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="optimistic-locking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A simple type that is used within an optimistic-locking
- * specification to specify the type of optimistic-locking that
- * EclipseLink should use when updating or deleting entities.
- */
- public enum OptimisticLockingType {
- /**
- * Using this type of locking policy compares every field in the table
- * in the WHERE clause when doing an update or a delete. If any field
- * has been changed, an optimistic locking exception will be thrown.
- */
- ALL_COLUMNS,
-
- /**
- * Using this type of locking policy compares only the changed fields
- * in the WHERE clause when doing an update. If any field has been
- * changed, an optimistic locking exception will be thrown. A delete
- * will only compare the primary key.
- */
- CHANGED_COLUMNS,
-
- /**
- * Using this type of locking compares selected fields in the WHERE
- * clause when doing an update or a delete. If any field has been
- * changed, an optimistic locking exception will be thrown. Note that
- * the fields specified must be mapped and not be primary keys.
- */
- SELECTED_COLUMNS,
-
- /**
- * Using this type of locking policy compares a single version number
- * in the where clause when doing an update. The version field must be
- * mapped and not be the primary key.
- */
- VERSION_COLUMN
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL_COLUMNS"/>
- <xsd:enumeration value="CHANGED_COLUMNS"/>
- <xsd:enumeration value="SELECTED_COLUMNS"/>
- <xsd:enumeration value="VERSION_COLUMN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="order-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderColumn {
- String name() default "";
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="correction-type" type="orm:order-column-correction-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-column-correction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum OrderCorrectionType {
- READ,
- READ_WRITE,
- EXCEPTION
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="READ_WRITE"/>
- <xsd:enumeration value="EXCEPTION"/>
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="primary-key">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The PrimaryKey annotation allows advanced configuration of the Id.
- * A validation policy can be given that allows specifying if zero is a valid id value.
- * The set of primary key columns can also be specified precisely.
- *
- * @author James Sutherland
- * @since EclipseLink 1.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PrimaryKey {
- /**
- * (Optional) Configures what id validation is done.
- * By default 0 is not a valid id value, this can be used to allow 0 id values.
- */
- IdValidation validation() default IdValidation.ZERO;
-
- /**
- * (Optional) Configures what cache key type is used to store the object in the cache.
- * By default the type is determined by what type is optimal for the class.
- */
- CacheKeyType cacheKeyType() default CacheKeyType.AUTO;
-
- /**
- * (Optional) Used to specify the primary key columns directly.
- * This can be used instead of @Id if the primary key includes a non basic field,
- * such as a foreign key, or a inheritance discriminator, embedded, or transformation mapped field.
- */
- Column[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="validation" type="orm:id-validation"/>
- <xsd:attribute name="cache-key-type" type="orm:cache-key-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>
-
- A user defined mapping's property.
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Property {
- /**
- * Property name.
- */
- String name();
-
- /**
- * String representation of Property value,
- * converted to an instance of valueType.
- */
- String value();
-
- /**
- * Property value type.
- * The value converted to valueType by ConversionManager.
- * If specified must be a simple type that could be handled by
- * ConversionManager:
- * numerical, boolean, temporal.
- */
- Class valueType() default String.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="query-redirectors">
- <xsd:annotation>
- <xsd:documentation>
-
-@Target({TYPE}) @Retention(RUNTIME)
-public @interface QueryRedirectors {
-
- /**
- * This AllQueries Query Redirector will be applied to any executing object query
- * that does not have a more precise redirector (like the
- * ReadObjectQuery Redirector) or a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- *
- */
- Class allQueries() default void.class;
-
- /**
- * A Default ReadAll Query Redirector will be applied to any executing
- * ReadAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getResultList() API this is the redirector that will be invoked
- */
- Class readAll() default void.class;
-
- /**
- * A Default ReadObject Query Redirector will be applied to any executing
- * ReadObjectQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getSingleResult() API or EntityManager.find() this is the redirector that will be invoked
- */
- Class readObject() default void.class;
-
- /**
- * A Default ReportQuery Redirector will be applied to any executing
- * ReportQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query that contains agregate functions or selects multiple entities this is the redirector that will be invoked
- */
- Class report() default void.class;
-
- /**
- * A Default Update Query Redirector will be applied to any executing
- * UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.
- * In EclipseLink an UpdateObjectQuery is executed whenever flushing changes to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class update() default void.class;
-
- /**
- * A Default Insert Query Redirector will be applied to any executing
- * InsertObjectQuery that does not have a redirector set directly on the query.
- * In EclipseLink an InsertObjectQuery is executed when persisting an object to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class insert() default void.class;
-
- /**
- * A Default Delete Object Query Redirector will be applied to any executing
- * DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class delete() default void.class;
-
-}
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="all-queries" type="xsd:string"/>
- <xsd:attribute name="read-all" type="xsd:string"/>
- <xsd:attribute name="read-object" type="xsd:string"/>
- <xsd:attribute name="report" type="xsd:string"/>
- <xsd:attribute name="update" type="xsd:string"/>
- <xsd:attribute name="insert" type="xsd:string"/>
- <xsd:attribute name="delete" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="read-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * Unless the TransformationMapping is write-only, it should have a
- * ReadTransformer, it defines transformation of database column(s)
- * value(s)into attribute value.
- *
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReadTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.AttributeTransformer
- * interface. The class will be instantiated, its
- * buildAttributeValue will be used to create the value to be
- * assigned to the attribute.
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be assigned to the attribute (not assigns the value to
- * the attribute). Either transformerClass or method must be
- * specified, but not both.
- */
- String method() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="return-insert">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReturnInsert {
- /**
- * A ReturnInsert annotation allows for INSERT operations to return
- * values back into the object being written. This allows for table
- * default values, trigger or stored procedures computed values to
- * be set back into the object.
- */
- boolean returnOnly() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="return-only" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- String catalog() default "";
- String schema() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="entity-result" type="orm:entity-result"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="stored-procedure-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A StoredProcedureParameter annotation is used within a
- * NamedStoredProcedureQuery annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface StoredProcedureParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Optional) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Required) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) The type of Java class desired back from the procedure,
- * this is dependent on the type returned from the procedure.
- */
- Class type() default void.class;
-
- /**
- * (Optional) The JDBC type code, this dependent on the type returned
- * from the procedure.
- */
- int jdbcType() default -1;
-
- /**
- * (Optional) The JDBC type name, this may be required for ARRAY or
- * STRUCT types.
- */
- String jdbcTypeName() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="query-parameter" type="xsd:string" use="required"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="jdbc-type" type="xsd:integer"/>
- <xsd:attribute name="jdbc-type-name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface StructConverter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must
- * implement the EclipseLink interface
- * org.eclipse.persistence.mappings.converters.Converter
- */
- String converter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="converter" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="index">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Allow a database INDEX to be define when generating DDL.
- * The @Index can be defined on a Entity class, or on an attribute.
- * The column is defaulted when defined on a attribute.
- *
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Index {
- /** The name of the INDEX, defaults to INDEX_(table-name) */
- String name() default "";
-
- /** The schema of the INDEX */
- String schema() default "";
-
- /** The catalog of the INDEX */
- String catalog() default "";
-
- /** The table to define the index on, defaults to entities primary table. */
- String table() default "";
-
- boolean unique() default false;
-
- /**
- * Specify the set of columns to define the index on.
- * Not required when annotated on a field/method.
- */
- String[] columnNames() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="time-of-day">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface TimeOfDay {
- /**
- * (Optional) Hour of the day.
- */
- int hour() default 0;
-
- /**
- * (Optional) Minute of the day.
- */
- int minute() default 0;
-
- /**
- * (Optional) Second of the day.
- */
- int second() default 0;
-
- /**
- * (Optional) Millisecond of the day.
- */
- int millisecond() default 0;
-
- /**
- * Internal use. Do not modify.
- */
- boolean specified() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="hour" type="xsd:integer"/>
- <xsd:attribute name="minute" type="xsd:integer"/>
- <xsd:attribute name="second" type="xsd:integer"/>
- <xsd:attribute name="millisecond" type="xsd:integer"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="transformation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Transformation is an optional annotation for
- * org.eclipse.persistence.mappings.TransformationMapping.
- * TransformationMapping allows to map an attribute to one or more
- * database columns.
- *
- * Transformation annotation is an optional part of
- * TransformationMapping definition. Unless the TransformationMapping is
- * write-only, it should have a ReadTransformer, it defines
- * transformation of database column(s) value(s)into attribute value.
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Transformation {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) The optional element is a hint as to whether the value
- * of the field or property may be null. It is disregarded
- * for primitive types, which are considered non-optional.
- */
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="read-transformer" type="orm:read-transformer"/>
- <xsd:element name="write-transformer" type="orm:write-transformer" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface TypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence field
- * or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent field
- * or property.
- */
- Class objectType() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String name() default "";
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
-<!-- **************************************************** -->
-
- <xsd:complexType name="variable-one-to-one">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Variable one to one mappings are used to represent a pointer
- * references between a java object and an implementer of an interface.
- * This mapping is usually represented by a single pointer (stored in an
- * instance variable) between the source and target objects. In the
- * relational database tables, these mappings are normally implemented
- * using a foreign key and a type code.
- *
- * A VariableOneToOne can be specified within an Entity,
- * MappedSuperclass and Embeddable class.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface VariableOneToOne {
- /**
- * (Optional) The interface class that is the target of the
- * association. If not specified it will be inferred from the type
- * of the object being referenced.
- */
- Class targetInterface() default void.class;
-
- /**
- * (Optional) The operations that must be cascaded to the target of
- * the association.
- */
- CascadeType[] cascade() default {};
-
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) Whether the association is optional. If set to false
- * then a non-null relationship must always exist.
- */
- boolean optional() default true;
-
- /**
- * (Optional) The discriminator column will hold the type
- * indicators. If the DiscriminatorColumn is not specified, the name
- * of the discriminator column defaults to "DTYPE" and the
- * discriminator type to STRING.
- */
- DiscriminatorColumn discriminatorColumn() default @DiscriminatorColumn;
-
- /**
- * (Optional) The list of discriminator types that can be used with
- * this VariableOneToOne. If none are specified then those entities
- * within the persistence unit that implement the target interface
- * will be added to the list of types. The discriminator type will
- * default as follows:
- * - If DiscriminatorColumn type is STRING: Entity.name()
- * - If DiscriminatorColumn type is CHAR: First letter of the
- * Entity class
- * - If DiscriminatorColumn type is INTEGER: The next integer after
- * the highest integer explicitly added.
- */
- DiscriminatorClass[] discriminatorClasses() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="discriminator-class" type="orm:discriminator-class" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-interface" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="write-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- *
- * A single WriteTransformer may be specified directly on the method or
- * attribute. Multiple WriteTransformers should be wrapped into
- * WriteTransformers annotation. No WriteTransformers specified for
- * read-only mapping. Unless the TransformationMapping is write-only, it
- * should have a ReadTransformer, it defines transformation of database
- * column(s) value(s)into attribute value.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface WriteTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.FieldTransformer
- * interface. The class will be instantiated, its buildFieldValue
- * will be used to create the value to be written into the database
- * column. Note that for ddl generation and returning to be
- * supported the method buildFieldValue in the class should be
- * defined to return the relevant Java type, not just Object as
- * defined in the interface, for instance:
- * public Time buildFieldValue(Object instance, String fieldName, Session session).
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be written into the database column.
- * Note that for ddl generation and returning to be supported the
- * method should be defined to return a particular type, not just
- * Object, for instance:
- * public Time getStartTime().
- * The method may require a Transient annotation to avoid being
- * mapped as Basic by default.
- * Either transformerClass or method must be specified, but not both.
- */
- String method() default "";
-
- /**
- * Specify here the column into which the value should be written.
- * The only case when this could be skipped is if a single
- * WriteTransformer annotates an attribute - the attribute's name
- * will be used as a column name.
- */
- Column column() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <xsd:complexType name="batch-fetch">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A BatchFetch annotation can be used on any relationship mapping,
- * (OneToOne, ManyToOne, OneToMany, ManyToMany, ElementCollection, BasicCollection, BasicMap).
- * It allows the related objects to be batch read in a single query.
- * Batch fetching can also be set at the query level, and it is
- * normally recommended to do so as all queries may not require batching.
- *
- * @author James Sutherland
- * @since EclipseLink 2.1
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BatchFetch {
- /**
- * (Optional) The type of batch-fetch to use.
- * Either JOIN, EXISTS or IN.
- * JOIN is the default.
- */
- BatchFetchType value() default BatchFetchType.JOIN;
-
- /**
- * Define the default batch fetch size.
- * This is only used for IN type batch reading and defines
- * the number of keys used in each IN clause.
- * The default size is 256, or the query's pageSize for cursor queries.
- */
- int size() default -1;
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:batch-fetch-type"/>
- <xsd:attribute name="size" type="xsd:integer"/>
- </xsd:complexType>
-
-</xsd:schema>
-
-
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_3.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_3.xsd
deleted file mode 100644
index fb0521a52f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_orm_2_3.xsd
+++ /dev/null
@@ -1,5479 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ******************************************************************************************************************************* -->
-<!-- Copyright (c) 1998, 2010 Oracle. All rights reserved. -->
-<!-- This program and the accompanying materials are made available under the -->
-<!-- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 -->
-<!-- which accompanies this distribution. -->
-<!-- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html -->
-<!-- and the Eclipse Distribution License is available at -->
-<!-- http://www.eclipse.org/org/documents/edl-v10.php. -->
-<!-- -->
-<!-- Contributors: -->
-<!-- Oracle - initial API and implementation from Oracle TopLink -->
-<!-- tware - update version number to 2.0 -->
-<!-- 12/2/2009-2.1 Guy Pelletier -->
-<!-- - 296289: Add current annotation metadata support on mapped superclasses to EclipseLink-ORM.XML Schema -->
-<!-- - 296612: Add current annotation only metadata support of return insert/update to the EclipseLink-ORM.XML Schema -->
-<!-- - formatted to match orm_2_0.xsd so that users can easily compare the two schemas -->
-<!-- 5/4/2010-2.1 Guy Pelletier -->
-<!-- - 227219: Expand EclipseLink-ORM.XML schema functionality for 2.1 release (update version to 2.1) -->
-<!-- 6/14/2010-2.2 Guy Pelletier -->
-<!-- - 247078: eclipselink-orm.xml schema should allow lob and enumerated on version and id mappings (update version to 2.2) -->
-<!-- 10/15/2010-2.2 Guy Pelletier -->
-<!-- - 322008: Improve usability of additional criteria applied to queries at the session/EM -->
-<!-- 03/23/2011-2.3 Guy Pelletier -->
-<!-- - 337323: Multi-tenant with shared schema support (part 1) -->
-<!-- ******************************************************************************************************************************* -->
-
-<!-- Java Persistence API object-relational mapping file schema -->
-<xsd:schema targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.3">
-
- <xsd:annotation>
- <xsd:documentation>
- @(#)eclipselink_orm_2_3.xsd 2.3 March 23 2011
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-
- This is the XML Schema for the native Eclipselink XML mapping file
- The file may be named "META-INF/eclipselink-orm.xml" in the persistence
- archive or it may be named some other name which would be
- used to locate the file as resource on the classpath.
- Object/relational mapping files must indicate the object/relational
- mapping file schema by using the persistence namespace:
-
- http://www.eclipse.org/eclipselink/xsds/persistence/orm
-
- and indicate the version of the schema by using the version element as shown below:
-
- <entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm
- eclipselink_orm_2_3.xsd
- version="2.3">
- ...
- </entity-mappings>
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="emptyType"/>
-
- <xsd:simpleType name="versionType">
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="supported-versions-type">
- <xsd:restriction base="orm:versionType">
- <xsd:enumeration value="2.0"/>
- <xsd:enumeration value="2.1"/>
- <xsd:enumeration value="2.2"/>
- <xsd:enumeration value="2.3"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="access-methods">
- <xsd:annotation>
- <xsd:documentation>
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="get-method" type="xsd:string" use="required"/>
- <xsd:attribute name="set-method" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="additional-criteria">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An additional criteria can be specified at the Entity or MappedSuperclass
- * level. When specified at the mapped superclass level, it applies to all
- * inheriting entities unless those entities define their own additional
- * criteria, at which point the additional criteria from the mapped superclass
- * is ignored.
- *
- * The additional criteria supports any valid JPQL string and must use 'this'
- * as an alias to form your additional criteria. E.G.,
- *
- * @Entity
- * @AdditionalCriteria("this.nut.size = :NUT_SIZE and this.nut.color = :NUT_COLOR")
- * public class Bolt {...}
- *
- * Additional criteria parameters are also accepted and are set through
- * properties on the entity manager factory, or on an entity manager. When set
- * on the entity manager, the properties must be set before any query execution
- * and should not be changed for the life span of that entity manager.
- *
- * Properties set on the entity manager will override those similarly named
- * properties set on the entity manager factory.
- *
- * Additional criteria is not supported with any native queries.
- *
- * @author Guy Pelletier
- * @since EclipseLink 2.2
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface AdditionalCriteria {
- /**
- * (Required) The JPQL fragment to use as the additional criteria.
- */
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="criteria" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Cache annotation is used to set an
- * org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy
- * which sets objects in EclipseLink's identity maps to be invalid
- * following given rules. By default in EclipseLink, objects do not
- * expire in the cache. Several different policies are available to
- * allow objects to expire.
- *
- * @see org.eclipse.persistence.annotations.CacheType
- *
- * A Cache anotation may be defined on an Entity or MappedSuperclass.
- * In the case of inheritance, a Cache annotation should only be defined
- * on the root of the inheritance hierarchy.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Cache {
- /**
- * (Optional) The type of cache to use.
- */
- CacheType type() default SOFT_WEAK;
-
- /**
- * (Optional) The size of cache to use.
- */
- int size() default 100;
-
- /**
- * (Optional) Cached instances in the shared cache,
- * or only a per EntityManager isolated cache.
- * The default is shared.
- * @deprecated As of Eclipselink 2.2. See the attribute 'isolation'
- */
- @Deprecated
- boolean shared() default true;
-
- /**
- * (Optional) Controls the level of caching this Entity will use.
- * The default is CacheIsolationType.SHARED which has EclipseLink
- * Caching all Entities in the Shared Cache.
- * @see org.eclipse.persistence.config.CacheIsolationType
- */
- CacheIsolationType isolation() default SHARED;
-
- /**
- * (Optional) Expire cached instance after a fix period of time (ms).
- * Queries executed against the cache after this will be forced back
- * to the database for a refreshed copy
- */
- int expiry() default -1; // minus one is no expiry.
-
- /**
- * (Optional) Expire cached instance a specific time of day. Queries
- * executed against the cache after this will be forced back to the
- * database for a refreshed copy
- */
- TimeOfDay expiryTimeOfDay() default @TimeOfDay(specified=false);
-
- /**
- * (Optional) Force all queries that go to the database to always
- * refresh the cache.
- */
- boolean alwaysRefresh() default false;
-
- /**
- * (Optional) For all queries that go to the database, refresh the
- * cache only if the data received from the database by a query is
- * newer than the data in the cache (as determined by the optimistic
- * locking field)
- */
- boolean refreshOnlyIfNewer() default false;
-
- /**
- * (Optional) Setting to true will force all queries to bypass the
- * cache for hits but still resolve against the cache for identity.
- * This forces all queries to hit the database.
- */
- boolean disableHits() default false;
-
- /**
- * (Optional) The cache coordination mode.
- */
- CacheCoordinationType coordinationType() default SEND_OBJECT_CHANGES;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="expiry" type="xsd:integer" minOccurs="0"/>
- <xsd:element name="expiry-time-of-day" type="orm:time-of-day" minOccurs="0"/>
- </xsd:choice>
- <xsd:attribute name="size" type="xsd:integer"/>
- <xsd:attribute name="shared" type="xsd:boolean"/>
- <xsd:attribute name="isolation" type="orm:cache-isolation-type"/>
- <xsd:attribute name="type" type="orm:cache-type"/>
- <xsd:attribute name="always-refresh" type="xsd:boolean"/>
- <xsd:attribute name="refresh-only-if-newer" type="xsd:boolean"/>
- <xsd:attribute name="disable-hits" type="xsd:boolean"/>
- <xsd:attribute name="coordination-type" type="orm:cache-coordination-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cache-interceptor">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface CacheInterceptor {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The CacheType enum is used with the Cache annotation for a
- * persistent class. It defines the type of IdentityMap/Cache used for
- * the class. By default the SOFT_WEAK cache type is used.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheType {
- /**
- * Provides full caching and guaranteed identity. Caches all objects
- * and does not remove them.
- * WARNING: This method may be memory intensive when many objects are
- * read.
- */
- FULL,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using weak references. This method allows full garbage
- * collection and provides full caching and guaranteed identity.
- */
- WEAK,
-
- /**
- * Similar to the FULL identity map except that the map holds the
- * objects using soft references. This method allows full garbage
- * collection when memory is low and provides full caching and
- * guaranteed identity.
- */
- SOFT,
-
- /**
- * Similar to the WEAK identity map except that it maintains a
- * most-frequently-used sub-cache. The size of the sub-cache is
- * proportional to the size of the identity map as specified by
- * descriptor's setIdentityMapSize() method. The sub-cache
- * uses soft references to ensure that these objects are
- * garbage-collected only if the system is low on memory.
- */
- SOFT_WEAK,
-
- /**
- * Identical to the soft cache weak (SOFT_WEAK) identity map except
- * that it uses hard references in the sub-cache. Use this identity
- * map if soft references do not behave properly on your platform.
- */
- HARD_WEAK,
-
- /**
- * A cache identity map maintains a fixed number of objects
- * specified by the application. Objects are removed from the cache
- * on a least-recently-used basis. This method allows object
- * identity for the most commonly used objects.
- * WARNING: Furnishes caching and identity, but does not guarantee
- * identity.
- */
- CACHE,
-
- /**
- * WARNING: Does not preserve object identity and does not cache
- * objects.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="FULL"/>
- <xsd:enumeration value="WEAK"/>
- <xsd:enumeration value="SOFT"/>
- <xsd:enumeration value="SOFT_WEAK"/>
- <xsd:enumeration value="HARD_WEAK"/>
- <xsd:enumeration value="CACHE"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-isolation-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Options for how Entity instances should be shared within an EclipseLink Persistence Unit / ServerSession
- * @see ClassDescriptor#setCacheIsolationType(CacheIsolationType)
- * @author Gordon Yorke
- * @since EclipseLink 2.2
- */
- public enum CacheIsolationType {
-
- /**
- * Entity instances will be cached within the EntityManagerFactory/ServerSession level.
- * Any user queries for shared cache instances (ie Read-Only query hint) will return an Entity
- * instance that may be shared by multiple clients.
- *
- * This setting is the default isolation level.
- */
- SHARED,
-
- /**
- * Entity state information will be cached in the shared cache but Entity
- * instances will not be shared. Any user queries for shared cache instances
- * (ie Read-Only query hint) will return a new Entity instance with the cached state.
- * This will ensure the instance is <i>protected</i> from any concurrent
- * state change.
- */
- PROTECTED,
-
- /**
- * The Entity and its data is not stored in the shared cache but is
- * <i>isolated</i> to the Persistence Context/UnitOfWork or
- * IsolatedClientSession. This setting effectively disables second level
- * caching for this entity and should be used when users do not want caching for
- * a particular Entity.
- */
- ISOLATED;
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SHARED"/>
- <xsd:enumeration value="PROTECTED"/>
- <xsd:enumeration value="ISOLATED"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-coordination-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the Cache annotation.
- *
- * @see org.eclipse.persistence.annotations.Cache
- */
- public enum CacheCoordinationType {
- /**
- * Sends a list of changed objects including data about the changes.
- * This data is merged into the receiving cache.
- */
- SEND_OBJECT_CHANGES,
-
- /**
- * Sends a list of the identities of the objects that have changed.
- * The receiving cache invalidates the objects (rather than changing
- * any of the data)
- */
- INVALIDATE_CHANGED_OBJECTS,
-
- /**
- * Same as SEND_OBJECT_CHANGES except it also includes any newly
- * created objects from the transaction.
- */
- SEND_NEW_OBJECTS_WITH_CHANGES,
-
- /**
- * Does no cache coordination.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SEND_OBJECT_CHANGES"/>
- <xsd:enumeration value="INVALIDATE_CHANGED_OBJECTS"/>
- <xsd:enumeration value="SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="change-tracking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The ChangeTracking annotation is used to specify the
- * org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy
- * which computes changes sets for EclipseLink's UnitOfWork commit
- * process. An ObjectChangePolicy is stored on an Entity's descriptor.
- *
- * A ChangeTracking annotation may be specified on an Entity,
- * MappedSuperclass or Embeddable.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ChangeTracking {
- /**
- * (Optional) The type of change tracking to use.
- */
- ChangeTrackingType value() default AUTO;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:change-tracking-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="change-tracking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the ChangeTracking annotation.
- */
- public enum ChangeTrackingType {
- /**
- * An ATTRIBUTE change tracking type allows change tracking at the
- * attribute level of an object. Objects with changed attributes will
- * be processed in the commit process to include any changes in the
- * results of the commit. Unchanged objects will be ignored.
- */
- ATTRIBUTE,
-
- /**
- * An OBJECT change tracking policy allows an object to calculate for
- * itself whether it has changed. Changed objects will be processed in
- * the commit process to include any changes in the results of the
- * commit. Unchanged objects will be ignored.
- */
- OBJECT,
-
- /**
- * A DEFERRED change tracking policy defers all change detection to
- * the UnitOfWork's change detection process. Essentially, the
- * calculateChanges() method will run for all objects in a UnitOfWork.
- * This is the default ObjectChangePolicy
- */
- DEFERRED,
-
- /**
- * Will not set any change tracking policy.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ATTRIBUTE"/>
- <xsd:enumeration value="OBJECT"/>
- <xsd:enumeration value="DEFERRED"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="customizer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The Customizer annotation is used to specify a class that implements
- * the org.eclipse.persistence.config.DescriptorCustomizer
- * interface and is to run against an enetity's class descriptor after all
- * metadata processing has been completed.
- *
- * The Customizer annotation may be defined on an Entity, MappedSuperclass
- * or Embeddable class. In the case of inheritance, a Customizer is not
- * inherited from its parent classes.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Customizer {
- /**
- * (Required) Defines the name of the descriptor customizer class that
- * should be applied for the related entity or embeddable class.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="direction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An enum that is used within the StoredProcedureParameter annotation.
- * It is used to specify the direction of the stored procedure
- * parameters of a named stored procedure query.
- */
- public enum Direction {
- /**
- * Input parameter
- */
- IN,
-
- /**
- * Output parameter
- */
- OUT,
-
- /**
- * Input and output parameter
- */
- IN_OUT,
-
- /**
- * Output cursor
- */
- OUT_CURSOR
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="IN"/>
- <xsd:enumeration value="OUT"/>
- <xsd:enumeration value="IN_OUT"/>
- <xsd:enumeration value="OUT_CURSOR"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:element name="entity-mappings">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>
-
- The entity-mappings element is the root element of a mapping
- file. It contains the following four types of elements:
-
- 1. The persistence-unit-metadata element contains metadata
- for the entire persistence unit. It is undefined if this element
- occurs in multiple mapping files within the same persistence unit.
-
- 2. The package, schema, catalog and access elements apply to all of
- the entity, mapped-superclass and embeddable elements defined in
- the same file in which they occur.
-
- 3. The sequence-generator, table-generator, named-query,
- named-native-query and sql-result-set-mapping elements are global
- to the persistence unit. It is undefined to have more than one
- sequence-generator or table-generator of the same name in the same
- or different mapping files in a persistence unit. It is also
- undefined to have more than one named-query, named-native-query, or
- result-set-mapping of the same name in the same or different mapping
- files in a persistence unit.
-
- 4. The entity, mapped-superclass and embeddable elements each define
- the mapping information for a managed persistent class. The mapping
- information contained in these elements may be complete or it may
- be partial.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="persistence-unit-metadata"
- type="orm:persistence-unit-metadata"
- minOccurs="0"/>
- <xsd:element name="package" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0"/>
- <xsd:element name="tenant-discriminator-column" type="orm:tenant-discriminator-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="partitioning" type="orm:partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="replication-partitioning" type="orm:replication-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="round-robin-partitioning" type="orm:round-robin-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="pinned-partitioning" type="orm:pinned-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="range-partitioning" type="orm:range-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="value-partitioning" type="orm:value-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="hash-partitioning" type="orm:hash-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="union-partitioning" type="orm:union-partitioning" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-function-query" type="orm:named-stored-function-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-plsql-stored-procedure-query" type="orm:named-plsql-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-plsql-stored-function-query" type="orm:named-plsql-stored-function-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="plsql-record" type="orm:plsql-record" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="plsql-table" type="orm:plsql-table" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity" type="orm:entity"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embeddable" type="orm:embeddable"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="version" type="orm:supported-versions-type"
- default="2.3" use="optional"/>
- </xsd:complexType>
- </xsd:element>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="existence-type">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * The ExistenceChecking annotation is used to specify the type of
- * checking EclipseLink should use when updating entities.
- *
- * An existence-checking specification is supported on an Entity or
- * MappedSuperclass annotation.
- */
- public @interface ExistenceChecking {
-
- /**
- * (Optional) Set the existence check for determining
- * if an insert or update should occur for an object.
- */
- ExistenceType value() default CHECK_CACHE;
- }
-
- /**
- * Assume that if the objects primary key does not include null and
- * it is in the cache, then it must exist.
- */
- CHECK_CACHE,
-
- /**
- * Perform does exist check on the database.
- */
- CHECK_DATABASE,
-
- /**
- * Assume that if the objects primary key does not include null then
- * it must exist. This may be used if the application guarantees or
- * does not care about the existence check.
- */
- ASSUME_EXISTENCE,
-
- /**
- * Assume that the object does not exist. This may be used if the
- * application guarantees or does not care about the existence check.
- * This will always force an insert to be called.
- */
- ASSUME_NON_EXISTENCE
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="CHECK_CACHE"/>
- <xsd:enumeration value="CHECK_DATABASE"/>
- <xsd:enumeration value="ASSUME_EXISTENCE"/>
- <xsd:enumeration value="ASSUME_NON_EXISTENCE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-metadata">
- <xsd:annotation>
- <xsd:documentation>
-
- Metadata that applies to the persistence unit and not just to
- the mapping file in which it is contained.
-
- If the xml-mapping-metadata-complete element is specified,
- the complete set of mapping metadata for the persistence unit
- is contained in the XML mapping files for the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-default-mappings" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="persistence-unit-defaults"
- type="orm:persistence-unit-defaults"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="persistence-unit-defaults">
- <xsd:annotation>
- <xsd:documentation>
-
- These defaults are applied to the persistence unit as a whole
- unless they are overridden by local annotation or XML
- element settings.
-
- schema - Used as the schema for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- catalog - Used as the catalog for all tables, secondary tables, join
- tables, collection tables, sequence generators, and table
- generators that apply to the persistence unit
- delimited-identifiers - Used to treat database identifiers as
- delimited identifiers.
- access - Used as the access type for all managed classes in
- the persistence unit
- cascade-persist - Adds cascade-persist to the set of cascade options
- in all entity relationships of the persistence unit
- entity-listeners - List of default entity listeners to be invoked
- on each entity in the persistence unit.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="schema" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="catalog" type="xsd:string"
- minOccurs="0"/>
- <xsd:element name="delimited-identifiers" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="access" type="orm:access-type"
- minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="tenant-discriminator-column" type="orm:tenant-discriminator-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for an entity. Is allowed to be
- sparsely populated and used in conjunction with the annotations.
- Alternatively, the metadata-complete attribute can be used to
- indicate that no annotations on the entity class (and its fields
- or properties) are to be processed. If this is the case then
- the defaulting rules for the entity and its subelements will
- be recursively applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface Entity {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="multitenant" type="orm:multitenant" minOccurs="0"/>
- <xsd:element name="additional-criteria" type="orm:additional-criteria" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="table" type="orm:table" minOccurs="0"/>
- <xsd:element name="secondary-table" type="orm:secondary-table" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct" type="orm:struct" minOccurs="0"/>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="discriminator-value" type="orm:discriminator-value" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- </xsd:sequence>
- <xsd:element name="class-extractor" type="orm:class-extractor" minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="fetch-group" type="orm:fetch-group" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-function-query" type="orm:named-stored-function-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-plsql-stored-procedure-query" type="orm:named-plsql-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-plsql-stored-function-query" type="orm:named-plsql-stored-function-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="plsql-record" type="orm:plsql-record" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="plsql-table" type="orm:plsql-table" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="query-redirectors" type="orm:query-redirectors" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:group name="partitioning-group">
- <xsd:sequence>
- <xsd:element name="partitioning" type="orm:partitioning" minOccurs="0"/>
- <xsd:element name="replication-partitioning" type="orm:replication-partitioning" minOccurs="0"/>
- <xsd:element name="round-robin-partitioning" type="orm:round-robin-partitioning" minOccurs="0"/>
- <xsd:element name="pinned-partitioning" type="orm:pinned-partitioning" minOccurs="0"/>
- <xsd:element name="range-partitioning" type="orm:range-partitioning" minOccurs="0"/>
- <xsd:element name="value-partitioning" type="orm:value-partitioning" minOccurs="0"/>
- <xsd:element name="hash-partitioning" type="orm:hash-partitioning" minOccurs="0"/>
- <xsd:element name="union-partitioning" type="orm:union-partitioning" minOccurs="0"/>
- <xsd:element name="partitioned" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:group>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="access-type">
- <xsd:annotation>
- <xsd:documentation>
-
- This element determines how the persistence provider accesses the
- state of an entity or embedded object.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="PROPERTY"/>
- <xsd:enumeration value="FIELD"/>
- <xsd:enumeration value="VIRTUAL"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="association-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AssociationOverride {
- String name();
- JoinColumn[] joinColumns() default{};
- JoinTable joinTable() default @JoinTable;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attribute-override">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface AttributeOverride {
- String name();
- Column column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="attributes">
- <xsd:annotation>
- <xsd:documentation>
-
- This element contains the entity field or property mappings.
- It may be sparsely populated to include only a subset of the
- fields or properties. If metadata-complete for the entity is true
- then the remainder of the attributes will be defaulted according
- to the default rules.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="id" type="orm:id"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded-id" type="orm:embedded-id"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="basic" type="orm:basic"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-collection" type="orm:basic-collection" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic-map" type="orm:basic-map" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version" type="orm:version"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one" type="orm:many-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many" type="orm:one-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one" type="orm:one-to-one"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="variable-one-to-one" type="orm:variable-one-to-one" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many" type="orm:many-to-many"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection" type="orm:element-collection"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded" type="orm:embedded"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transformation" type="orm:transformation" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="transient" type="orm:transient" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="structure" type="orm:structure" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="array" type="orm:array" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Basic {
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="lob" type="orm:lob"/>
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator" minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="return-insert" type="orm:return-insert" minOccurs="0"/>
- <xsd:element name="return-update" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicCollection {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the value column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="basic-map">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BasicMap {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime that
- * the value must be eagerly fetched. The LAZY strategy is a hint to
- * the persistence provider runtime. If not specified, defaults to
- * LAZY.
- */
- FetchType fetch() default LAZY;
-
- /**
- * (Optional) The name of the data column that holds the direct map
- * key. If the name on te key column is "", the name will default to:
- * the name of the property or field; "_KEY".
- */
- Column keyColumn() default @Column;
-
- /**
- * (Optional) Specify the key converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the direct map key.
- */
- Convert keyConverter() default @Convert;
-
- /**
- * (Optional) The name of the data column that holds the direct
- * collection data. Defaults to the property or field name.
- */
- Column valueColumn() default @Column;
-
- /**
- * (Optional) Specify the value converter. Default is equivalent to
- * specifying @Convert("none"), meaning no converter will be added to
- * the value column mapping.
- */
- Convert valueConverter() default @Convert;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="key-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="key-converter" type="xsd:string" minOccurs="0"/>
- <xsd:element name="value-column" type="orm:column" minOccurs="0"/>
- <xsd:element name="value-converter" type="xsd:string" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:eclipselink-collection-table" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="cascade-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade-all" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-persist" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-merge" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-remove" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-refresh" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="cascade-detach" type="orm:emptyType"
- minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="class-extractor">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A ClassExtractor allows for a user defined class indicator in place of
- * providing a discriminator column. The class has the following restrictions:
-
- * - It must extend the org.eclipse.persistence.descriptors.ClassExtractor
- * class and implement the extractClassFromRow(Record, Session) method.
- * - That method must take a database row (a Record/Map) as an argument and
- * must return the class to use for that row.
- *
- * This method will be used to decide which class to instantiate when reading
- * from the database. It is the application's responsibility to populate any
- * typing information in the database required to determine the class from the
- * row.
- *
- * The ClassExtractor must only be set on the root of an entity class or
- * sub-hierarchy in which a different inheritance strategy is applied. The
- * ClassExtractor can only be used with the SINGLE_TABLE and JOINED inheritance
- * strategies.
- *
- * If a ClassExtractor is used then a DiscriminatorColumn cannot be used. A
- * ClassExtractor also cannot be used on either the root or its subclasses.
- *
- * In addition, for more complex configurations using a ClassExtractor and a
- * SINGLE_TABLE strategy, the descriptor's withAllSubclasses and onlyInstances
- * expressions should be set through the ClassExtractor's initialize method.
- *
- * @see org.eclipse.persistence.descriptors.InheritancePolicy.setWithAllSubclassesExpression(Expression)
- * @see org.eclipse.persistence.descriptors.InheritancePolicy.setOnlyInstancesExpression(Expression)
- *
- * @author Guy Pelletier
- * @since EclipseLink 2.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface ClassExtractor {
- /**
- * (Required) Defines the name of the class extractor that should be
- * applied to this entity's descriptor.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CloneCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.CloneCopyPolicy on an
- * Entity. A CloneCopyPolicy must specify at one or both of the "method"
- * or "workingCopyMethod". "workingCopyMethod" is used to clone objects
- * that will be returned to the user as they are registered in
- * EclipseLink's transactional mechanism, the UnitOfWork. "method" will
- * be used for the clone that is used for comparison in conjunction with
- * EclipseLink's DeferredChangeDetectionPolicy
- *
- * A CloneCopyPolicy should be specified on an Entity, MappedSuperclass
- * or Embeddable.
- *
- * Example:
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(method="myCloneMethod", workingCopyMethod="myWorkingCopyCloneMethod")
- *
- * or:
- *
- * @Entity
- * @CloneCopyPolicy(workingCopyMethodName="myWorkingCopyClone")
- */
- public @interface CloneCopyPolicy {
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified this defines
- * a method that will be used to create a clone that will be used
- * for comparison by
- * EclipseLink's DeferredChangeDetectionPolicy
- */
- String method();
-
- /**
- * (Optional)
- * Either method or workingCopyMethod must be specified
- * this defines a method that will be used to create a clone that
- * will be used to create the object returned when registering an
- * Object in an EclipseLink UnitOfWork
- */
- String workingCopyMethod();
-
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="method" type="xsd:string"/>
- <xsd:attribute name="working-copy-method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface CollectionTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="eclipselink-collection-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface CollectionTable {
- /**
- * (Optional) The name of the collection table. If it is not
- * specified, it is defaulted to the concatenation of the following:
- * the name of the source entity; "_" ; the name of the relationship
- * property or field of the source entity.
- */
- String name() default "";
-
- /**
- * (Optional) The catalog of the table. It defaults to the persistence
- * unit default catalog.
- */
- String catalog() default "";
-
- /**
- * (Optional) The schema of the table. It defaults to the persistence
- * unit default schema.
- */
- String schema() default "";
-
- /**
- * (Optional) Used to specify a primary key column that is used as a
- * foreign key to join to another table. If the source entity uses a
- * composite primary key, a primary key join column must be specified
- * for each field of the composite primary key. In a single primary
- * key case, a primary key join column may optionally be specified.
- * Defaulting will apply otherwise as follows:
- * name, the same name as the primary key column of the primary table
- * of the source entity. referencedColumnName, the same name of
- * primary key column of the primary table of the source entity.
- */
- PrimaryKeyJoinColumn[] primaryKeyJoinColumns() default {};
-
- /**
- * (Optional) Unique constraints that are to be placed on the table.
- * These are only used if table generation is in effect.
- */
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column" type="orm:primary-key-join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Column {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="conversion-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface ConversionValue {
- /**
- * (Required) Specify the database value.
- */
- String dataValue();
-
- /**
- * (Required) Specify the object value.
- */
- String objectValue();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="data-value" type="xsd:string" use="required"/>
- <xsd:attribute name="object-value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Converter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must implement
- * the org.eclipse.persistence.mappings.converters.Converter interface.
- */
- Class converterClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A Partitioning is used to partition the data for a class across multiple difference databases
- * or across a database cluster such as Oracle RAC.
- * Partitioning can provide improved scalability by allowing multiple database machines to service requests.
- * This annotation configures a custom PartitioningPolicy.
- *
- * If multiple partitions are used to process a single transaction, JTA should be used for proper XA transaction support.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- * Partition policies are globally named to allow reuse,
- * the partitioning policy must also be set using the @Partitioned annotation to be used.
- *
- * @see Partitioned
- * @see org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Partitioning {
- String name();
-
- /**
- * (Required) Full package.class name of a subclass of PartitioningPolicy.
- */
- Class partitioningClass();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="hash-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * HashPartitioning partitions access to a database cluster by the hash of a field value from the object,
- * such as the object's location, or tenant.
- * The hash indexes into the list of connection pools.
- * All write or read request for object's with that hash value are sent to the server.
- * If a query does not include the field as a parameter, then it can either be sent
- * to all server's and unioned, or left to the sesion's default behavior.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.HashPartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface HashPartitioning {
- String name();
-
- /**
- * The database column or query parameter to partition queries by.
- * This is the table column name, not the class attribute name.
- * The column value must be included in the query and should normally be part of the object's Id.
- * This can also be the name of a query parameter.
- * If a query does not contain the field the query will not be partitioned.
- */
- Column partitionColumn();
-
- /**
- * List of connection pool names to partition across.
- */
- String[] connectionPools();
-
- /**
- * Defines if queries that do not contain the partition field should be sent
- * to every database and have the result unioned.
- */
- boolean unionUnpartitionableQueries() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="partition-column" type="orm:column"/>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="union-unpartitionable-queries" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="range-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * RangePartitioningPolicy partitions access to a database cluster by a field value from the object,
- * such as the object's id, location, or tenant.
- * Each server is assigned a range of values.
- * All write or read request for object's with that value are sent to the server.
- * If a query does not include the field as a parameter, then it can either be sent
- * to all server's and unioned, or left to the sesion's default behavior.
- *
- * If multiple partitions are used to process a single transaction, JTA should be used for proper XA transaction support.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- * Partition policies are globally named to allow reuse,
- * the partitioning policy must also be set using the @Partitioned annotation to be used.
- *
- * @see Partitioned
- * @see org.eclipse.persistence.descriptors.partitioning.RangePartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface RangePartitioning {
- String name();
-
- /**
- * The database column or query parameter to partition queries by.
- * This is the table column name, not the class attribute name.
- * The column value must be included in the query and should normally be part of the object's Id.
- * This can also be the name of a query parameter.
- * If a query does not contain the field the query will not be partitioned.
- */
- Column partitionColumn();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- RangePartition[] partitions();
-
- /**
- * Defines if queries that do not contain the partition field should be sent
- * to every database and have the result unioned.
- */
- boolean unionUnpartitionableQueries() default false;
-
- /** The type of the start and end values. */
- Class partitionValueType() default String.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="partition-column" type="orm:column"/>
- <xsd:element name="partition" type="orm:range-partition" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="union-unpartitionable-queries" type="xsd:boolean"/>
- <xsd:attribute name="partition-value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="range-partition">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Represent a specific range partition.
- * Values = startValue and = endValue will be routed to the connection pool.
- *
- * @see RangePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.RangePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.RangePartition
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface RangePartition {
- /** The String representation of the range start value. */
- String startValue() default "";
- /** The String representation of the range start value. */
- String endValue() default "";
- /** The connection pool to route queries to for this range. */
- String connectionPool();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="start-value" type="xsd:string"/>
- <xsd:attribute name="end-value" type="xsd:string"/>
- <xsd:attribute name="connection-pool" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="value-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * ValuePartitioning partitions access to a database cluster by a field value from the object,
- * such as the object's location, or tenant.
- * Each value is assigned a specific server.
- * All write or read request for object's with that value are sent to the server.
- * If a query does not include the field as a parameter, then it can either be sent
- * to all server's and unioned, or left to the sesion's default behavior.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.ValuePartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ValuePartitioning {
- String name();
-
- /**
- * The database column or query parameter to partition queries by.
- * This is the table column name, not the class attribute name.
- * The column value must be included in the query and should normally be part of the object's Id.
- * This can also be the name of a query parameter.
- * If a query does not contain the field the query will not be partitioned.
- */
- Column partitionColumn();
-
- /** Store the value partitions. Each partition maps a value to a connectionPool. */
- ValuePartition[] partitions();
-
- /** The type of the start and end values. */
- Class partitionValueType() default String.class;
-
- /** The default connection pool is used for any unmapped values. */
- String defaultConnectionPool();
-
- /**
- * Defines if queries that do not contain the partition field should be sent
- * to every database and have the result unioned.
- */
- boolean unionUnpartitionableQueries() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="partition-column" type="orm:column"/>
- <xsd:element name="partition" type="orm:value-partition" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="union-unpartitionable-queries" type="xsd:boolean"/>
- <xsd:attribute name="default-connection-pool" type="xsd:string"/>
- <xsd:attribute name="partition-value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="value-partition">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Represent a specific value partition.
- * The value will be routed to the connection pool.
- *
- * @see ValuePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.ValuePartitioningPolicy
- * @see org.eclipse.persistence.descriptors.partitioning.ValuePartition
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ValuePartition {
- /** The String representation of the range start value. */
- String value() default "";
-
- /** The connection pool to route queries to for this value. */
- String connectionPool();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="connection-pool" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="round-robin-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * RoundRobinPartitioning sends requests in a round robin fashion to the set of connection pools.
- * It is for load-balancing read queries across a cluster of database machines.
- * It requires that the full database be replicated on each machine, so does not support partitioning.
- * The data should either be read-only, or writes should be replicated on the database.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.RoundRobinPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface RoundRobinPartitioning {
- String name();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- String[] connectionPools();
-
- /**
- * This allows for a set of database to be written to and kept in synch,
- * and have reads load-balanced across the databases.
- */
- boolean replicateWrites() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="replicate-writes" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="replication-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * ReplicationPartitioning sends requests to a set of connection pools.
- * It is for replicating data across a cluster of database machines.
- * Only modification queries are replicated.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.ReplicationPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReplicationPartitioning {
- String name();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- String[] connectionPools();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="union-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * UnionPartitioning sends queries to all connection pools and unions the results.
- * This is for queries or relationships that span partitions when partitioning is used,
- * such as on a ManyToMany cross partition relationship.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.UnionPartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface UnionPartitioning {
- String name();
-
- /**
- * (Required) List of connection pool names to load balance across.
- */
- String[] connectionPools();
-
- /**
- * Defines if write queries should be replicated.
- * Writes are normally not replicated when unioning,
- * but can be for ManyToMany relationships, when the join table needs to be replicated.
- */
- boolean replicateWrites() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="connection-pool" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="replicate-writes" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pinned-partitioning">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * PinnedPartitioning pins requests to a single connection pool.
- *
- * Partitioning can be enabled on an Entity, relationship, query, or session/persistence unit.
- *
- * @see org.eclipse.persistence.descriptors.partitioning.PinnedPartitioningPolicy
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface PinnedPartitioning {
- String name();
-
- /**
- * The connection pool name to pin queries to.
- */
- String connectionPool();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="connection-pool" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="column-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface ColumnResult {
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A CopyPolicy is used to set a
- * org.eclipse.persistence.descriptors.copying.CopyPolicy on an Entity.
- * It is required that a class that implements
- * org.eclipse.persistence.descriptors.copying.CopyPolicy be specified
- * as the argument.
- *
- * A CopyPolicy should be specified on an Entity, MappedSuperclass or
- * Embeddable.
- *
- * For instance:
- * @Entity
- * @CopyPolicy("example.MyCopyPolicy")
- */
- public @interface CopyPolicy {
-
- /*
- * (Required)
- * This defines the class of the copy policy. It must specify a class
- * that implements org.eclipse.persistence.descriptors.copying.CopyPolicy
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorColumn {
- String name() default "DTYPE";
- DiscriminatorType discriminatorType() default STRING;
- String columnDefinition() default "";
- int length() default 31;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="discriminator-class">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A DiscriminatorClass is used within a VariableOneToOne annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface DiscriminatorClass {
- /**
- * (Required) The discriminator to be stored on the database.
- */
- String discriminator();
-
- /**
- * (Required) The class to the instantiated with the given
- * discriminator.
- */
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="discriminator" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum DiscriminatorType { STRING, CHAR, INTEGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="STRING"/>
- <xsd:enumeration value="CHAR"/>
- <xsd:enumeration value="INTEGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="discriminator-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface DiscriminatorValue {
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="element-collection">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ElementCollection {
- Class targetClass() default void.class;
- FetchType fetch() default LAZY;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column"
- type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="lob"
- type="orm:lob"
- minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:sequence>
- <xsd:element name="attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="collection-table" type="orm:collection-table"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-class" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- <xsd:attribute name="composite-member" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="array">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Array types are extended object-relational data-types supported by some databases.
- * Array types are user define types in the database such as VARRAY types on Oracle.
- * Arrays can contains basic types (VARCHAR) or other Struct types, and can be stored in
- * a column or in a Struct type.
- * This annotation can be defined on a collection attribute that is
- * persisted to an Array type. The collection can be of basic types, or embeddable
- * class mapped using a Struct.
- *
- * @see org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor
- * @see org.eclipse.persistence.mappings.structures.ArrayMapping
- * @see org.eclipse.persistence.mappings.structures.ObjectArrayMapping
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Array {
- /**
- * (Optional) The basic or embeddable class that is the element
- * type of the collection. This element is optional only if the
- * collection field or property is defined using Java generics,
- * and must be specified otherwise. It defaults to the
- * paramterized type of the collection when defined using
- * generics.
- */
- Class targetClass() default void.class;
-
- /**
- * (Required) The database name of the database array structure type.
- */
- String databaseType();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="lob"
- type="orm:lob"
- minOccurs="0"/>
- <xsd:element name="convert" type="xsd:string" minOccurs="0"/>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="2">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="database-type" type="xsd:string" use="required"/>
- <xsd:attribute name="target-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embeddable">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for embeddable objects. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- in the class. If this is the case then the defaulting rules will
- be recursively applied.
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Embeddable {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="struct" type="orm:struct" minOccurs="0"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="plsql-record" type="orm:plsql-record" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="plsql-table" type="orm:plsql-table" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Embedded {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="embedded-id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface EmbeddedId {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listener">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines an entity listener to be invoked at lifecycle events
- for the entities that list this listener.
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-listeners">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface EntityListeners {
- Class[] value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="entity-listener" type="orm:entity-listener"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="entity-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface EntityResult {
- Class entityClass();
- FieldResult[] fields() default {};
- String discriminatorColumn() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field-result" type="orm:field-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
- <xsd:attribute name="discriminator-column" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enum-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum EnumType {
- ORDINAL,
- STRING
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ORDINAL"/>
- <xsd:enumeration value="STRING"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="enumerated">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Enumerated {
- EnumType value() default ORDINAL;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:enum-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="fetch-attribute">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface FetchAttribute {
- /**
- * (Required) The fetch attribute name.
- */
- String name();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface FetchGroup {
- /**
- * (Required) The fetch group name.
- */
- String name();
-
- /**
- * (Optional) Indicates whether all relationship attributes
- * specified in the fetch group should be loaded.
- */
- boolean load() default true;
-
- /**
- * (Required) The list of attributes to fetch.
- */
- FetchAttribute[] attributes();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="attribute" type="orm:fetch-attribute" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="load" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum FetchType { LAZY, EAGER };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="LAZY"/>
- <xsd:enumeration value="EAGER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="field-result">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface FieldResult {
- String name();
- String column();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="column" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="generated-value">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface GeneratedValue {
- GenerationType strategy() default AUTO;
- String generator() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:generation-type"/>
- <xsd:attribute name="generator" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="generation-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="TABLE"/>
- <xsd:enumeration value="SEQUENCE"/>
- <xsd:enumeration value="IDENTITY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Id {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"
- minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0"/>
- <xsd:element name="generated-value" type="orm:generated-value"
- minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="enumerated" type="orm:enumerated"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="id-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface IdClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="id-validation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The IdValidation enum determines the type value that are valid for an Id.
- * By default null is not allowed, and 0 is not allow for singleton ids of long or int type.
- * The default value is ZERO for singleton ids, and NULL for composite ids.
- * This can be set using the @PrimaryKey annotation, or ClassDescriptor API.
- *
- * @see PrimaryKey
- * @see org.eclipse.persistence.descriptors.ClassDescriptor#setIdValidation(IdValidation)
- * @author James Sutherland
- * @since EclipseLink 1.0
- */
- public enum IdValidation {
- /**
- * Only null is not allowed as an id value, 0 is allowed.
- */
- NULL,
-
- /**
- * null and 0 are not allowed, (only int and long).
- */
- ZERO,
-
- /**
- * No id validation is done.
- */
- NONE
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="NULL"/>
- <xsd:enumeration value="ZERO"/>
- <xsd:enumeration value="NONE"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="cache-key-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Configures what type of Id value is used to store the object in the cache.
- * This can either be the basic Id value for simple singleton Ids,
- * or an optimized CacheKey type.
- *
- * @see PrimaryKey#cacheKeyType()
- * @see ClassDescriptor#setCacheKeyType(CacheKeyType)
- * @author James Sutherland
- * @since EclipseLink 2.1
- */
- public enum CacheKeyType {
- /**
- * This can only be used for simple singleton Ids, such as long/int/String.
- * This is the default for simple singleton Ids.
- */
- ID_VALUE,
-
- /**
- * Optimized cache key type that allows composite and complex values.
- * This is the default for composite or complex Ids.
- */
- CACHE_KEY,
-
- /**
- * The cache key type is automatically configured depending on what is optimal for the class.
- */
- AUTO
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ID_VALUE"/>
- <xsd:enumeration value="CACHE_KEY"/>
- <xsd:enumeration value="AUTO"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="inheritance">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Inheritance {
- InheritanceType strategy() default SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="strategy" type="orm:inheritance-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="inheritance-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum InheritanceType
- { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="JOINED"/>
- <xsd:enumeration value="TABLE_PER_CLASS"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * An InstantiationCopyPolicy is used to set an
- * org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy
- * on an Entity. InstantiationCopyPolicy is the default CopyPolicy in
- * EclipseLink and therefore this configuration option is only used to
- * override other types of copy policies
- *
- * An InstantiationCopyPolicy should be specified on an Entity,
- * MappedSuperclass or Embeddable.
- *
- * Example:
- * @Entity
- * @InstantiationCopyPolicy
- */
- public @interface InstantiationCopyPolicy {
- }
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum JoinFetchType {
- /**
- * An inner join is used to fetch the related object.
- * This does not allow for null/empty values.
- */
- INNER,
-
- /**
- * An inner join is used to fetch the related object.
- * This allows for null/empty values.
- */
- OUTER,
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="INNER"/>
- <xsd:enumeration value="OUTER"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="batch-fetch-type">
- <xsd:annotation>
- <xsd:documentation>
- public enum BatchFetchType {
- /**
- * This is the default form of batch reading.
- * The original query's selection criteria is joined with the batch query.
- */
- JOIN,
-
- /**
- * This uses an SQL EXISTS and a sub-select in the batch query instead of a join.
- * This has the advantage of not requiring an SQL DISTINCT which can have issues
- * with LOBs, or may be more efficient for some types of queries or on some databases.
- */
- EXISTS,
-
- /**
- * This uses an SQL IN clause in the batch query passing in the source object Ids.
- * This has the advantage of only selecting the objects not already contained in the cache,
- * and can work better with cursors, or if joins cannot be used.
- * This may only work for singleton Ids on some databases.
- */
- IN
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="JOIN"/>
- <xsd:enumeration value="EXISTS"/>
- <xsd:enumeration value="IN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="join-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface JoinTable {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- JoinColumn[] joinColumns() default {};
- JoinColumn[] inverseJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="inverse-join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="lob">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Lob {}
-
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="lock-mode-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum LockModeType { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE};
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="WRITE"/>
- <xsd:enumeration value="OPTIMISTIC"/>
- <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="PESSIMISTIC_READ"/>
- <xsd:enumeration value="PESSIMISTIC_WRITE"/>
- <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
- <xsd:enumeration value="NONE"/>
-
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="many-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface ManyToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKey {
- String name() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-class">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyClass {
- Class value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyColumn {
- String name() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- int length() default 255;
- int precision() default 0; // decimal precision
- int scale() default 0; // decimal scale
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="precision" type="xsd:int"/>
- <xsd:attribute name="scale" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="map-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface MapKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- boolean unique() default false;
- boolean nullable() default false;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- String table() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="mapped-superclass">
- <xsd:annotation>
- <xsd:documentation>
-
- Defines the settings and mappings for a mapped superclass. Is
- allowed to be sparsely populated and used in conjunction with
- the annotations. Alternatively, the metadata-complete attribute
- can be used to indicate that no annotations are to be processed
- If this is the case then the defaulting rules will be recursively
- applied.
-
- @Target(TYPE) @Retention(RUNTIME)
- public @interface MappedSuperclass{}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="multitenant" type="orm:multitenant" minOccurs="0"/>
- <xsd:element name="additional-criteria" type="orm:additional-criteria" minOccurs="0"/>
- <xsd:element name="customizer" type="orm:customizer" minOccurs="0"/>
- <xsd:element name="change-tracking" type="orm:change-tracking" minOccurs="0"/>
- <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
- <xsd:element name="primary-key" type="orm:primary-key" minOccurs="0"/>
- <xsd:element name="optimistic-locking" type="orm:optimistic-locking" minOccurs="0"/>
- <xsd:element name="cache" type="orm:cache" minOccurs="0"/>
- <xsd:element name="cache-interceptor" type="orm:cache-interceptor" minOccurs="0"/>
- <xsd:element name="fetch-group" type="orm:fetch-group" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="converter" type="orm:converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="type-converter" type="orm:type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="struct-converter" type="orm:struct-converter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="copy-policy" type="orm:copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="instantiation-copy-policy" type="orm:instantiation-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="clone-copy-policy" type="orm:clone-copy-policy" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="sequence-generator" type="orm:sequence-generator"
- minOccurs="0"/>
- <xsd:element name="table-generator" type="orm:table-generator"
- minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- <xsd:element name="named-query" type="orm:named-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-native-query" type="orm:named-native-query"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-procedure-query" type="orm:named-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-stored-function-query" type="orm:named-stored-function-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-plsql-stored-procedure-query" type="orm:named-plsql-stored-procedure-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="named-plsql-stored-function-query" type="orm:named-plsql-stored-function-query" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="plsql-record" type="orm:plsql-record" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="plsql-table" type="orm:plsql-table" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="sql-result-set-mapping"
- type="orm:sql-result-set-mapping"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="query-redirectors" type="orm:query-redirectors" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="exclude-default-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
- minOccurs="0"/>
- <xsd:element name="entity-listeners" type="orm:entity-listeners"
- minOccurs="0"/>
- <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
- <xsd:element name="post-persist" type="orm:post-persist"
- minOccurs="0"/>
- <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
- <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
- <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
- <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
- <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attribute-override" type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="association-override"
- type="orm:association-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:string" use="required"/>
- <xsd:attribute name="parent-class" type="xsd:string"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="cacheable" type="xsd:boolean"/>
- <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
- <xsd:attribute name="read-only" type="xsd:boolean"/>
- <xsd:attribute name="existence-checking" type="orm:existence-type"/>
- <xsd:attribute name="exclude-default-mappings" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="multitenant">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface Multitenant {
- /**
- * (Optional) Specify the multi-tenant strategy to use.
- */
- MultitenantType value() default MultitenantType.SINGLE_TABLE;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="tenant-discriminator-column" type="orm:tenant-discriminator-column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:multitenant-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="multitenant-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum MultitenantType {
- /**
- * Specifies that table(s) the entity maps to includes rows for multiple
- * tenants. The tenant discriminator column(s) are used with application
- * context values to limit what a persistence context can access.
- */
- SINGLE_TABLE,
-
- /**
- * Specifies that different tables are used for each tenant. The table scan
- * be uniquely identified by name, schema/tablespace.
- */
- TABLE_PER_TENANT,
-
- /**
- * Specifies that the DB will handle the tenant filtering on all SELECT,
- * UPDATE and DELETE queries. Using this type assumes that the platform
- * used with your persistence unit does indeed support VPD.
- */
- VPD
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="SINGLE_TABLE"/>
- <xsd:enumeration value="TABLE_PER_TENANT"/>
- <xsd:enumeration value="VPD"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-native-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedNativeQuery {
- String name();
- String query();
- QueryHint[] hints() default {};
- Class resultClass() default void.class;
- String resultSetMapping() default ""; //named SqlResultSetMapping
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-query">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface NamedQuery {
- String name();
- String query();
- LockModeType lockMode() default NONE;
- QueryHint[] hints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="query" type="xsd:string"/>
- <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
- <xsd:element name="hint" type="orm:query-hint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredProcedureQuery annotation allows the definition of
- * queries that call stored procedures as named queries.
- * A NamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Whether the query should return a result set.
- */
- boolean returnsResultSet() default true;
-
- /**
- * (Optional) Defines if the stored procedure returns multiple result sets.
- * This is only relevant on databases that support multiple result sets from stored procedures.
- */
- boolean multipleResultSets() default false;
-
- /**
- * (Optional) Defines if the stored procedure should be called by index or by name.
- * By index requires that the StoredProcedureParameter are defined in the same order as the procedure on the database.
- * By name requires the database platform support naming procedure parameters.
- */
- boolean callByIndex() default false;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- <xsd:attribute name="returns-result-set" type="xsd:boolean"/>
- <xsd:attribute name="multiple-result-sets" type="xsd:boolean"/>
- <xsd:attribute name="call-by-index" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-stored-function-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedStoredFunctionQuery annotation allows the definition of
- * queries that call stored function as named queries.
- * A NamedStoredFunctionQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedStoredFunctionQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String functionName();
-
- /**
- * (Optional) Defines if the stored procedure should be called by index or by name.
- * By index requires that the StoredProcedureParameter are defined in the same order as the procedure on the database.
- * By name requires the database platform support naming procedure parameters.
- */
- boolean callByIndex() default false;
-
- /**
- * (Optional) Defines arguments to the stored procedure.
- */
- StoredProcedureParameter[] parameters() default {};
-
- /**
- * (Required) Defines return of the stored function.
- */
- StoredProcedureParameter[] returnParameter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:stored-procedure-parameter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="return-parameter" type="orm:stored-procedure-parameter" minOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="function-name" type="xsd:string" use="required"/>
- <xsd:attribute name="call-by-index" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-plsql-stored-function-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A NamedPLSQLStoredFunctionQuery annotation allows the definition of queries that
- * call PLSQL stored functions as named queries.
- * The PLSQL support adds support for complex PLSQL types such as RECORD and TABLE types,
- * that are not accessible from JDBC.
- *
- * A NamedPLSQLStoredFunctionQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- *
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedPLSQLStoredFunctionQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String functionName();
-
- /**
- * (Optional) Defines the parameters to the stored procedure.
- */
- PLSQLParameter[] parameters() default {};
-
- /**
- * (Required) Defines the return value of the stored function.
- */
- PLSQLParameter returnParameter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:plsql-parameter" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="return-parameter" type="orm:plsql-parameter" minOccurs="1"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="function-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="named-plsql-stored-procedure-query">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A PLSQLNamedStoredProcedureQuery annotation allows the definition of queries that
- * call PLSQL stored procedures as named queries.
- * The PLSQL support adds support for complex PLSQL types such as RECORD and TABLE types,
- * that are not accessible from JDBC.
- *
- * A PLSQLNamedStoredProcedureQuery annotation may be defined on an Entity or
- * MappedSuperclass.
- *
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface NamedPLSQLStoredProcedureQuery {
- /**
- * (Required) Unique name that references this stored procedure query.
- */
- String name();
-
- /**
- * (Optional) Query hints.
- */
- QueryHint[] hints() default {};
-
- /**
- * (Optional) Refers to the class of the result.
- */
- Class resultClass() default void.class;
-
- /**
- * (Optional) The name of the SQLResultMapping.
- */
- String resultSetMapping() default "";
-
- /**
- * (Required) The name of the stored procedure.
- */
- String procedureName();
-
- /**
- * (Optional) Defines the parameters to the stored procedure.
- */
- PLSQLParameter[] parameters() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="hint" type="orm:query-hint" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="parameter" type="orm:plsql-parameter" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="result-class" type="xsd:string"/>
- <xsd:attribute name="result-set-mapping" type="xsd:string"/>
- <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="plsql-record">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A PLSQLRecord annotation is used to define a database PLSQL RECORD type.
- * This type can be used within PLSQL procedure calls.
- *
- * @see NamedPLSQLStoredProcedureQuery
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PLSQLRecord {
-
- /**
- * (Required) The name of the record type in the database.
- */
- String name();
-
- /**
- * (Required) The name of the database OBJECT TYPE that mirrors the record's structure.
- * The record will be converted to/from this type so it can be passed through JDBC.
- */
- String compatibleType();
-
- /**
- * (Optional) The Java class to map the object-type to.
- * This class must be mapped using a @Struct annotation.
- */
- Class javaType() default void.class;
-
- /**
- * (Required) Defines the fields in the record type.
- */
- PLSQLParameter[] fields();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field" type="orm:plsql-parameter" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="compatible-type" type="xsd:string"/>
- <xsd:attribute name="java-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="plsql-table">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A PLSQLRecord annotation is used to define a database PLSQL RECORD type.
- * This type can be used within PLSQL procedure calls.
- *
- * @see NamedPLSQLStoredProcedureQuery
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PLSQLRecord {
-
- /**
- * (Required) The name of the record type in the database.
- */
- String name();
-
- /**
- * (Required) The name of the database OBJECT TYPE that mirrors the record's structure.
- * The record will be converted to/from this type so it can be passed through JDBC.
- */
- String compatibleType();
-
- /**
- * (Optional) The Java class to map the object-type to.
- * This class must be mapped using a @Struct annotation.
- */
- Class javaType() default void.class;
-
- /**
- * (Required) Defines the fields in the record type.
- */
- PLSQLParameter[] fields();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="compatible-type" type="xsd:string"/>
- <xsd:attribute name="java-type" type="xsd:string"/>
- <xsd:attribute name="nested-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ObjectTypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence
- * field or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent
- * field or property.
- */
- Class objectType() default void.class;
-
- /**
- * (Required) Specify the conversion values to be used
- * with the object converter.
- */
- ConversionValue[] conversionValues();
-
- /**
- * (Optional) Specify a default object value. Used for
- * legacy data if the data value is missing.
- */
- String defaultObjectValue() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="conversion-value" type="orm:conversion-value" minOccurs="1" maxOccurs="unbounded"/>
- <xsd:element name="default-object-value" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-many">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToMany {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default LAZY;
- String mappedBy() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="order-by" type="orm:order-by"
- minOccurs="0"/>
- <xsd:element name="order-column" type="orm:order-column"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key" type="orm:map-key"
- minOccurs="0"/>
- <xsd:sequence>
- <xsd:element name="map-key-class" type="orm:map-key-class"
- minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-temporal"
- type="orm:temporal"
- minOccurs="0"/>
- <xsd:element name="map-key-enumerated"
- type="orm:enumerated"
- minOccurs="0"/>
- <xsd:element name="map-key-convert" type="xsd:string" minOccurs="0"/>
- <xsd:choice>
- <xsd:element name="map-key-attribute-override"
- type="orm:attribute-override"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="map-key-association-override" type="orm:association-override" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="map-key-column" type="orm:map-key-column"
- minOccurs="0"/>
- <xsd:element name="map-key-join-column"
- type="orm:map-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:sequence>
- </xsd:choice>
- <xsd:choice minOccurs="0" maxOccurs="1">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:choice>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="one-to-one">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OneToOne {
- Class targetEntity() default void.class;
- CascadeType[] cascade() default {};
- FetchType fetch() default EAGER;
- boolean optional() default true;
- String mappedBy() default "";
- boolean orphanRemoval() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-table" type="orm:join-table"
- minOccurs="0"/>
- </xsd:choice>
- <xsd:element name="cascade" type="orm:cascade-type"
- minOccurs="0"/>
- <xsd:element name="cascade-on-delete" type="xsd:boolean" minOccurs="0"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="join-fetch" type="orm:join-fetch-type" minOccurs="0"/>
- <xsd:element name="batch-fetch" type="orm:batch-fetch" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-entity" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mapped-by" type="xsd:string"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- <xsd:attribute name="maps-id" type="xsd:string"/>
- <xsd:attribute name="id" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="optimistic-locking">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * An optimistic-locking element is used to specify the type of
- * optimistic locking EclipseLink should use when updating or deleting
- * entities. An optimistic-locking specification is supported on
- * an entity or mapped-superclass.
- *
- * It is used in conjunction with the optimistic-locking-type.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface OptimisticLocking {
- /**
- * (Optional) The type of optimistic locking policy to use.
- */
- OptimisticLockingType type() default VERSION_COLUMN;
-
- /**
- * (Optional) For an optimistic locking policy of type
- * SELECTED_COLUMNS, this annotation member becomes a (Required)
- * field.
- */
- Column[] selectedColumns() default {};
-
- /**
- * (Optional) Specify where the optimistic locking policy should
- * cascade lock. Currently only supported with VERSION_COLUMN locking.
- */
- boolean cascade() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="selected-column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="type" type="orm:optimistic-locking-type"/>
- <xsd:attribute name="cascade" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="optimistic-locking-type">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A simple type that is used within an optimistic-locking
- * specification to specify the type of optimistic-locking that
- * EclipseLink should use when updating or deleting entities.
- */
- public enum OptimisticLockingType {
- /**
- * Using this type of locking policy compares every field in the table
- * in the WHERE clause when doing an update or a delete. If any field
- * has been changed, an optimistic locking exception will be thrown.
- */
- ALL_COLUMNS,
-
- /**
- * Using this type of locking policy compares only the changed fields
- * in the WHERE clause when doing an update. If any field has been
- * changed, an optimistic locking exception will be thrown. A delete
- * will only compare the primary key.
- */
- CHANGED_COLUMNS,
-
- /**
- * Using this type of locking compares selected fields in the WHERE
- * clause when doing an update or a delete. If any field has been
- * changed, an optimistic locking exception will be thrown. Note that
- * the fields specified must be mapped and not be primary keys.
- */
- SELECTED_COLUMNS,
-
- /**
- * Using this type of locking policy compares a single version number
- * in the where clause when doing an update. The version field must be
- * mapped and not be the primary key.
- */
- VERSION_COLUMN
- }
-
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="ALL_COLUMNS"/>
- <xsd:enumeration value="CHANGED_COLUMNS"/>
- <xsd:enumeration value="SELECTED_COLUMNS"/>
- <xsd:enumeration value="VERSION_COLUMN"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-by">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderBy {
- String value() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="order-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface OrderColumn {
- String name() default "";
- boolean nullable() default true;
- boolean insertable() default true;
- boolean updatable() default true;
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="nullable" type="xsd:boolean"/>
- <xsd:attribute name="insertable" type="xsd:boolean"/>
- <xsd:attribute name="updatable" type="xsd:boolean"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="correction-type" type="orm:order-column-correction-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="order-column-correction-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum OrderCorrectionType {
- READ,
- READ_WRITE,
- EXCEPTION
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="READ"/>
- <xsd:enumeration value="READ_WRITE"/>
- <xsd:enumeration value="EXCEPTION"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-load">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostLoad {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostPersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="post-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PostUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-persist">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PrePersist {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-remove">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreRemove {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="pre-update">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD}) @Retention(RUNTIME)
- public @interface PreUpdate {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="method-name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * The PrimaryKey annotation allows advanced configuration of the Id.
- * A validation policy can be given that allows specifying if zero is a valid id value.
- * The set of primary key columns can also be specified precisely.
- *
- * @author James Sutherland
- * @since EclipseLink 1.1
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- public @interface PrimaryKey {
- /**
- * (Optional) Configures what id validation is done.
- * By default 0 is not a valid id value, this can be used to allow 0 id values.
- */
- IdValidation validation() default IdValidation.ZERO;
-
- /**
- * (Optional) Configures what cache key type is used to store the object in the cache.
- * By default the type is determined by what type is optimal for the class.
- */
- CacheKeyType cacheKeyType() default CacheKeyType.AUTO;
-
- /**
- * (Optional) Used to specify the primary key columns directly.
- * This can be used instead of @Id if the primary key includes a non basic field,
- * such as a foreign key, or a inheritance discriminator, embedded, or transformation mapped field.
- */
- Column[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="validation" type="orm:id-validation"/>
- <xsd:attribute name="cache-key-type" type="orm:cache-key-type"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="primary-key-join-column">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface PrimaryKeyJoinColumn {
- String name() default "";
- String referencedColumnName() default "";
- String columnDefinition() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="referenced-column-name" type="xsd:string"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>
-
- A user defined mapping's property.
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Property {
- /**
- * Property name.
- */
- String name();
-
- /**
- * String representation of Property value,
- * converted to an instance of valueType.
- */
- String value();
-
- /**
- * Property value type.
- * The value converted to valueType by ConversionManager.
- * If specified must be a simple type that could be handled by
- * ConversionManager:
- * numerical, boolean, temporal.
- */
- Class valueType() default String.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- <xsd:attribute name="value-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-hint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface QueryHint {
- String name();
- String value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="value" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="query-redirectors">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface QueryRedirectors {
-
- /**
- * This AllQueries Query Redirector will be applied to any executing object query
- * that does not have a more precise redirector (like the
- * ReadObjectQuery Redirector) or a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- *
- */
- Class allQueries() default void.class;
-
- /**
- * A Default ReadAll Query Redirector will be applied to any executing
- * ReadAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getResultList() API this is the redirector that will be invoked
- */
- Class readAll() default void.class;
-
- /**
- * A Default ReadObject Query Redirector will be applied to any executing
- * ReadObjectQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query through the getSingleResult() API or EntityManager.find() this is the redirector that will be invoked
- */
- Class readObject() default void.class;
-
- /**
- * A Default ReportQuery Redirector will be applied to any executing
- * ReportQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- * For users executing a JPA Query that contains agregate functions or selects multiple entities this is the redirector that will be invoked
- */
- Class report() default void.class;
-
- /**
- * A Default Update Query Redirector will be applied to any executing
- * UpdateObjectQuery or UpdateAllQuery that does not have a redirector set directly on the query.
- * In EclipseLink an UpdateObjectQuery is executed whenever flushing changes to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class update() default void.class;
-
- /**
- * A Default Insert Query Redirector will be applied to any executing
- * InsertObjectQuery that does not have a redirector set directly on the query.
- * In EclipseLink an InsertObjectQuery is executed when persisting an object to the datasource.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class insert() default void.class;
-
- /**
- * A Default Delete Object Query Redirector will be applied to any executing
- * DeleteObjectQuery or DeleteAllQuery that does not have a redirector set directly on the query.
- * Query redirectors allow the user to intercept query execution preventing
- * it or alternately performing some side effect like auditing.
- */
- Class delete() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="all-queries" type="xsd:string"/>
- <xsd:attribute name="read-all" type="xsd:string"/>
- <xsd:attribute name="read-object" type="xsd:string"/>
- <xsd:attribute name="report" type="xsd:string"/>
- <xsd:attribute name="update" type="xsd:string"/>
- <xsd:attribute name="insert" type="xsd:string"/>
- <xsd:attribute name="delete" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="read-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * Unless the TransformationMapping is write-only, it should have a
- * ReadTransformer, it defines transformation of database column(s)
- * value(s)into attribute value.
- *
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReadTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.AttributeTransformer
- * interface. The class will be instantiated, its
- * buildAttributeValue will be used to create the value to be
- * assigned to the attribute.
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be assigned to the attribute (not assigns the value to
- * the attribute). Either transformerClass or method must be
- * specified, but not both.
- */
- String method() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="return-insert">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface ReturnInsert {
- /**
- * A ReturnInsert annotation allows for INSERT operations to return
- * values back into the object being written. This allows for table
- * default values, trigger or stored procedures computed values to
- * be set back into the object.
- */
- boolean returnOnly() default false;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="return-only" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="secondary-table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SecondaryTable {
- String name();
- String catalog() default "";
- String schema() default "";
- PrimaryKeyJoinColumn[] pkJoinColumns() default {};
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="primary-key-join-column"
- type="orm:primary-key-join-column"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sequence-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface SequenceGenerator {
- String name();
- String sequenceName() default "";
- String catalog() default "";
- String schema() default "";
- int initialValue() default 1;
- int allocationSize() default 50;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="sequence-name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="sql-result-set-mapping">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface SqlResultSetMapping {
- String name();
- EntityResult[] entities() default {};
- ColumnResult[] columns() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="entity-result" type="orm:entity-result"
- minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="column-result" type="orm:column-result"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="stored-procedure-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A StoredProcedureParameter annotation is used within a
- * NamedStoredProcedureQuery annotation.
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface StoredProcedureParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Optional) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Required) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) Define if the parameter is required, or optional and defaulted by the procedure.
- */
- boolean optional() default false;
-
- /**
- * (Optional) The type of Java class desired back from the procedure,
- * this is dependent on the type returned from the procedure.
- */
- Class type() default void.class;
-
- /**
- * (Optional) The JDBC type code, this dependent on the type returned
- * from the procedure.
- */
- int jdbcType() default -1;
-
- /**
- * (Optional) The JDBC type name, this may be required for ARRAY or
- * STRUCT types.
- */
- String jdbcTypeName() default "";
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="query-parameter" type="xsd:string" use="required"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="type" type="xsd:string"/>
- <xsd:attribute name="jdbc-type" type="xsd:integer"/>
- <xsd:attribute name="jdbc-type-name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="plsql-parameter">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * A PLSQLParameter annotation is used within a
- * NamedPLSQLStoredProcedureQuery or PLSQLRecord annotation.
- *
- * @see NamedPLSQLStoredProcedureQuery
- * @see PLSQLRecord
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({})
- @Retention(RUNTIME)
- public @interface PLSQLParameter {
- /**
- * (Optional) The direction of the stored procedure parameter.
- */
- Direction direction() default IN;
-
- /**
- * (Required) Stored procedure parameter name.
- */
- String name() default "";
-
- /**
- * (Optional) The query parameter name.
- */
- String queryParameter();
-
- /**
- * (Optional) Define if the parameter is required, or optional and defaulted by the procedure.
- */
- boolean optional() default false;
-
- /**
- * (Optional) The database data-type for the paramter.
- * This either one of the type constants defined in OraclePLSQLTypes, or JDBCTypes,
- * or a custom record or table type name.
- * @see PLSQLRecord
- * @see OraclePLSQLTypes
- * @see JDBCTypes
- */
- String databaseType() default "VARCHAR";
-
- /**
- * (Optional) The max length of the field value.
- */
- int length() default 255;
-
- /**
- * (Optional) If a numeric, the max scale value.
- */
- int scale() default 0;
-
- /**
- * (Optional) If a numeric, the max precision value.
- */
- int precision() default 0;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="direction" type="orm:direction-type"/>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="query-parameter" type="xsd:string"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="database-type" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:integer"/>
- <xsd:attribute name="scale" type="xsd:integer"/>
- <xsd:attribute name="precision" type="xsd:integer"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface StructConverter {
- /**
- * (Required) Name this converter. The name should be unique across
- * the whole persistence unit.
- */
- String name();
-
- /**
- * (Required) The converter class to be used. This class must
- * implement the EclipseLink interface
- * org.eclipse.persistence.mappings.converters.Converter
- */
- String converter();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="converter" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="struct">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Struct types are extended object-relational data-types supported by some databases.
- * Struct types are user define types in the database such as OBJECT types on Oracle.
- * Structs can normally contains Arrays (VARRAY) or other Struct types, and can be stored in
- * a column or a table.
- * This annotation define a class to map to a database Struct type.
- * The class should normally be an Embeddable, but could also be an Entity if stored in a object table.
- *
- * @see org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor
- * @see org.eclipse.persistence.mappings.structures.StructureMapping
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Struct {
- /**
- * (Required) The database name of the database structure type.
- */
- String name();
-
- /**
- * (Optional) Defines the order of the fields contained in the database structure type.
- */
- String[] fields() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="structure">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Struct types are extended object-relational data-types supported by some databases.
- * Struct types are user define types in the database such as OBJECT types on Oracle.
- * Structs can normally contains Arrays (VARRAY) or other Struct types, and can be stored in
- * a column or a table.
- * This annotation can be defined on a field/method to define an StructureMapping to an embedded Struct type.
- * The target Embeddable must be mapped using the Struct annotation.
- *
- * @see Struct
- * @see org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor
- * @see org.eclipse.persistence.mappings.structures.StructureMapping
- * @author James Sutherland
- * @since EclipseLink 2.3
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Structure {
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE}) @Retention(RUNTIME)
- public @interface Table {
- String name() default "";
- String catalog() default "";
- String schema() default "";
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string" />
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="index">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Allow a database INDEX to be define when generating DDL.
- * The @Index can be defined on a Entity class, or on an attribute.
- * The column is defaulted when defined on a attribute.
- *
- * @author James Sutherland
- * @since EclipseLink 2.2
- */
- @Target({METHOD, FIELD, TYPE})
- @Retention(RUNTIME)
- public @interface Index {
- /** The name of the INDEX, defaults to INDEX_(table-name) */
- String name() default "";
-
- /** The schema of the INDEX */
- String schema() default "";
-
- /** The catalog of the INDEX */
- String catalog() default "";
-
- /** The table to define the index on, defaults to entities primary table. */
- String table() default "";
-
- boolean unique() default false;
-
- /**
- * Specify the set of columns to define the index on.
- * Not required when annotated on a field/method.
- */
- String[] columnNames() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="unique" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="table-generator">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
- public @interface TableGenerator {
- String name();
- String table() default "";
- String catalog() default "";
- String schema() default "";
- String pkColumnName() default "";
- String valueColumnName() default "";
- String pkColumnValue() default "";
- int initialValue() default 0;
- int allocationSize() default 50;
- UniqueConstraint[] uniqueConstraints() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="description" type="xsd:string" minOccurs="0"/>
- <xsd:element name="unique-constraint" type="orm:unique-constraint"
- minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="catalog" type="xsd:string"/>
- <xsd:attribute name="schema" type="xsd:string"/>
- <xsd:attribute name="creation-suffix" type="xsd:string"/>
- <xsd:attribute name="pk-column-name" type="xsd:string"/>
- <xsd:attribute name="value-column-name" type="xsd:string"/>
- <xsd:attribute name="pk-column-value" type="xsd:string"/>
- <xsd:attribute name="initial-value" type="xsd:int"/>
- <xsd:attribute name="allocation-size" type="xsd:int"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Temporal {
- TemporalType value();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="orm:temporal-type"/>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:simpleType name="temporal-type">
- <xsd:annotation>
- <xsd:documentation>
-
- public enum TemporalType {
- DATE, // java.sql.Date
- TIME, // java.sql.Time
- TIMESTAMP // java.sql.Timestamp
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:enumeration value="DATE"/>
- <xsd:enumeration value="TIME"/>
- <xsd:enumeration value="TIMESTAMP"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="tenant-discriminator-column">
- <xsd:annotation>
- <xsd:documentation>
- @Target({})
- @Retention(RUNTIME)
- public @interface TenantDiscriminatorColumn {
- /**
- * (Optional) The name of column to be used for the tenant discriminator.
- */
- String name() default "TENANT_ID";
-
- /**
- * (Optional) The name of the context property to apply to the
- * tenant discriminator column.
- */
- String contextProperty() default "eclipselink.tenant-id";
-
- /**
- * (Optional) The type of object/column to use as a class discriminator.
- * Defaults to {@link DiscriminatorType#STRING DiscriminatorType.STRING}.
- */
- DiscriminatorType discriminatorType() default DiscriminatorType.STRING;
-
- /**
- * (Optional) The SQL fragment that is used when generating the DDL
- * for the discriminator column.
- * Defaults to the provider-generated SQL to create a column
- * of the specified discriminator type.
- */
- String columnDefinition() default "";
-
- /**
- * (Optional) The column length for String-based discriminator types.
- * Ignored for other discriminator types.
- */
- int length() default 31;
-
- /**
- * (Optional) The name of the table that contains the column.
- * If absent the column is assumed to be in the primary table.
- */
- String table() default "";
-
- /**
- * Specifies that the tenant discriminator column is part of the primary
- * key of the tables.
- */
- boolean primaryKey() default false;
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string"/>
- <xsd:attribute name="context-property" type="xsd:string"/>
- <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
- <xsd:attribute name="column-definition" type="xsd:string"/>
- <xsd:attribute name="length" type="xsd:int"/>
- <xsd:attribute name="table" type="xsd:string"/>
- <xsd:attribute name="primary-key" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="time-of-day">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({})
- @Retention(RUNTIME)
- public @interface TimeOfDay {
- /**
- * (Optional) Hour of the day.
- */
- int hour() default 0;
-
- /**
- * (Optional) Minute of the day.
- */
- int minute() default 0;
-
- /**
- * (Optional) Second of the day.
- */
- int second() default 0;
-
- /**
- * (Optional) Millisecond of the day.
- */
- int millisecond() default 0;
-
- /**
- * Internal use. Do not modify.
- */
- boolean specified() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="hour" type="xsd:integer"/>
- <xsd:attribute name="minute" type="xsd:integer"/>
- <xsd:attribute name="second" type="xsd:integer"/>
- <xsd:attribute name="millisecond" type="xsd:integer"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transformation">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Transformation is an optional annotation for
- * org.eclipse.persistence.mappings.TransformationMapping.
- * TransformationMapping allows to map an attribute to one or more
- * database columns.
- *
- * Transformation annotation is an optional part of
- * TransformationMapping definition. Unless the TransformationMapping is
- * write-only, it should have a ReadTransformer, it defines
- * transformation of database column(s) value(s)into attribute value.
- * Also unless it's a read-only mapping, either WriteTransformer
- * annotation or WriteTransformers annotation should be specified. Each
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface Transformation {
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) The optional element is a hint as to whether the value
- * of the field or property may be null. It is disregarded
- * for primitive types, which are considered non-optional.
- */
- boolean optional() default true;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="read-transformer" type="orm:read-transformer"/>
- <xsd:element name="write-transformer" type="orm:write-transformer" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="transient">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Transient {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="type-converter">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({TYPE, METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface TypeConverter {
- /**
- * (Required) Name this converter. The name should be unique
- * across the whole persistence unit.
- */
- String name();
-
- /**
- * (Optional) Specify the type stored on the database. The
- * default is inferred from the type of the persistence field
- * or property.
- */
- Class dataType() default void.class;
-
- /**
- * (Optional) Specify the type stored on the entity. The
- * default is inferred from the type of the persistent field
- * or property.
- */
- Class objectType() default void.class;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="data-type" type="xsd:string"/>
- <xsd:attribute name="object-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="unique-constraint">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({}) @Retention(RUNTIME)
- public @interface UniqueConstraint {
- String name() default "";
- String[] columnNames();
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column-name" type="xsd:string"
- maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="variable-one-to-one">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * Variable one to one mappings are used to represent a pointer
- * references between a java object and an implementer of an interface.
- * This mapping is usually represented by a single pointer (stored in an
- * instance variable) between the source and target objects. In the
- * relational database tables, these mappings are normally implemented
- * using a foreign key and a type code.
- *
- * A VariableOneToOne can be specified within an Entity,
- * MappedSuperclass and Embeddable class.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface VariableOneToOne {
- /**
- * (Optional) The interface class that is the target of the
- * association. If not specified it will be inferred from the type
- * of the object being referenced.
- */
- Class targetInterface() default void.class;
-
- /**
- * (Optional) The operations that must be cascaded to the target of
- * the association.
- */
- CascadeType[] cascade() default {};
-
- /**
- * (Optional) Defines whether the value of the field or property
- * should be lazily loaded or must be eagerly fetched. The EAGER
- * strategy is a requirement on the persistence provider runtime
- * that the value must be eagerly fetched. The LAZY strategy is a
- * hint to the persistence provider runtime. If not specified,
- * defaults to EAGER.
- */
- FetchType fetch() default EAGER;
-
- /**
- * (Optional) Whether the association is optional. If set to false
- * then a non-null relationship must always exist.
- */
- boolean optional() default true;
-
- /**
- * (Optional) The discriminator column will hold the type
- * indicators. If the DiscriminatorColumn is not specified, the name
- * of the discriminator column defaults to "DTYPE" and the
- * discriminator type to STRING.
- */
- DiscriminatorColumn discriminatorColumn() default @DiscriminatorColumn;
-
- /**
- * (Optional) The list of discriminator types that can be used with
- * this VariableOneToOne. If none are specified then those entities
- * within the persistence unit that implement the target interface
- * will be added to the list of types. The discriminator type will
- * default as follows:
- * - If DiscriminatorColumn type is STRING: Entity.name()
- * - If DiscriminatorColumn type is CHAR: First letter of the
- * Entity class
- * - If DiscriminatorColumn type is INTEGER: The next integer after
- * the highest integer explicitly added.
- */
- DiscriminatorClass[] discriminatorClasses() default {};
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="cascade" type="orm:cascade-type" minOccurs="0"/>
- <xsd:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
- <xsd:element name="discriminator-class" type="orm:discriminator-class" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="join-column" type="orm:join-column" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="private-owned" type="orm:emptyType" minOccurs="0"/>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- <xsd:element name="noncacheable" type="orm:emptyType" minOccurs="0"/>
- <xsd:group ref="orm:partitioning-group"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="target-interface" type="xsd:string"/>
- <xsd:attribute name="fetch" type="orm:fetch-type"/>
- <xsd:attribute name="optional" type="xsd:boolean"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="version">
- <xsd:annotation>
- <xsd:documentation>
-
- @Target({METHOD, FIELD}) @Retention(RUNTIME)
- public @interface Version {}
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column" minOccurs="0"/>
- <xsd:element name="index" type="orm:index" minOccurs="0"/>
- <xsd:choice minOccurs="0">
- <xsd:element name="temporal" type="orm:temporal"/>
- <xsd:element name="convert" type="xsd:string"/>
- </xsd:choice>
- <xsd:choice minOccurs="0">
- <xsd:element name="converter" type="orm:converter"/>
- <xsd:element name="type-converter" type="orm:type-converter"/>
- <xsd:element name="object-type-converter" type="orm:object-type-converter"/>
- <xsd:element name="struct-converter" type="orm:struct-converter"/>
- </xsd:choice>
- <xsd:element name="property" type="orm:property" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="access-methods" type="orm:access-methods" minOccurs="0"/>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"/>
- <xsd:attribute name="access" type="orm:access-type"/>
- <xsd:attribute name="mutable" type="xsd:boolean"/>
- <xsd:attribute name="attribute-type" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="write-transformer">
- <xsd:annotation>
- <xsd:documentation>
-
- /**
- * Annotation for org.eclipse.persistence.mappings.TransformationMapping.
- * WriteTransformer defines transformation of the attribute value to a
- * single database column value (column is specified in the
- * WriteTransformer).
- *
- * A single WriteTransformer may be specified directly on the method or
- * attribute. Multiple WriteTransformers should be wrapped into
- * WriteTransformers annotation. No WriteTransformers specified for
- * read-only mapping. Unless the TransformationMapping is write-only, it
- * should have a ReadTransformer, it defines transformation of database
- * column(s) value(s)into attribute value.
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface WriteTransformer {
- /**
- * User-defined class that must implement the
- * org.eclipse.persistence.mappings.transformers.FieldTransformer
- * interface. The class will be instantiated, its buildFieldValue
- * will be used to create the value to be written into the database
- * column. Note that for ddl generation and returning to be
- * supported the method buildFieldValue in the class should be
- * defined to return the relevant Java type, not just Object as
- * defined in the interface, for instance:
- * public Time buildFieldValue(Object instance, String fieldName, Session session).
- * Either transformerClass or method must be specified, but not both.
- */
- Class transformerClass() default void.class;
-
- /**
- * The mapped class must have a method with this name which returns
- * a value to be written into the database column.
- * Note that for ddl generation and returning to be supported the
- * method should be defined to return a particular type, not just
- * Object, for instance:
- * public Time getStartTime().
- * The method may require a Transient annotation to avoid being
- * mapped as Basic by default.
- * Either transformerClass or method must be specified, but not both.
- */
- String method() default "";
-
- /**
- * Specify here the column into which the value should be written.
- * The only case when this could be skipped is if a single
- * WriteTransformer annotates an attribute - the attribute's name
- * will be used as a column name.
- */
- Column column() default @Column;
- }
-
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="column" type="orm:column"/>
- </xsd:sequence>
- <xsd:attribute name="transformer-class" type="xsd:string"/>
- <xsd:attribute name="method" type="xsd:string"/>
- </xsd:complexType>
-
- <!-- **************************************************** -->
-
- <xsd:complexType name="batch-fetch">
- <xsd:annotation>
- <xsd:documentation>
- /**
- * A BatchFetch annotation can be used on any relationship mapping,
- * (OneToOne, ManyToOne, OneToMany, ManyToMany, ElementCollection, BasicCollection, BasicMap).
- * It allows the related objects to be batch read in a single query.
- * Batch fetching can also be set at the query level, and it is
- * normally recommended to do so as all queries may not require batching.
- *
- * @author James Sutherland
- * @since EclipseLink 2.1
- */
- @Target({METHOD, FIELD})
- @Retention(RUNTIME)
- public @interface BatchFetch {
- /**
- * (Optional) The type of batch-fetch to use.
- * Either JOIN, EXISTS or IN.
- * JOIN is the default.
- */
- BatchFetchType value() default BatchFetchType.JOIN;
-
- /**
- * Define the default batch fetch size.
- * This is only used for IN type batch reading and defines
- * the number of keys used in each IN clause.
- * The default size is 256, or the query's pageSize for cursor queries.
- */
- int size() default -1;
- }
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="type" type="orm:batch-fetch-type"/>
- <xsd:attribute name="size" type="xsd:integer"/>
- </xsd:complexType>
-
-</xsd:schema>
-
-
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_0.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_0.xsd
deleted file mode 100644
index bb10ce4894..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_0.xsd
+++ /dev/null
@@ -1,260 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- dmccann - November 24/2009 - 2.0 - Initial implementation
-*****************************************************************************/
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0">
-
- <xs:element name="xml-bindings">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-schema" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapters" minOccurs="0"/>
- <xs:element name="java-types" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-type" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-type">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-type" minOccurs="0"/>
- <xs:element ref="xml-root-element" minOccurs="0"/>
- <xs:element ref="xml-see-also" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element name="java-attributes" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-attribute" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="name" type="xs:string" />
- <xs:attribute name="xml-transient" type="xs:boolean" default="false" />
- <xs:attribute name="xml-customizer" type="xs:string" />
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-attribute" type="java-attribute" />
- <xs:complexType name="java-attribute" abstract="true">
- <xs:attribute name="java-attribute" type="xs:string" />
- </xs:complexType>
-
- <!-- Enums -->
- <xs:simpleType name="xml-access-order">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ALPHABETICAL" />
- <xs:enumeration value="UNDEFINED" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-access-type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="FIELD" />
- <xs:enumeration value="NONE" />
- <xs:enumeration value="PROPERTY" />
- <xs:enumeration value="PUBLIC_MEMBER" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-ns-form">
- <xs:restriction base="xs:string">
- <xs:enumeration value="UNQUALIFIED" />
- <xs:enumeration value="QUALIFIED" />
- <xs:enumeration value="UNSET" />
- </xs:restriction>
- </xs:simpleType>
-
- <!-- @Target(value=PACKAGE) -->
- <xs:element name="xml-schema">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="xml-ns" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="namespace-uri" type="xs:string" />
- <xs:attribute name="prefix" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="attribute-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="element-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="location" type="xs:string" />
- <xs:attribute name="namespace" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-java-type-adapters">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-java-type-adapter" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,PACKAGE}) -->
-
- <!-- @Target(value={PACKAGE,FIELD,METHOD,TYPE,PARAMETER}) -->
- <xs:element name="xml-java-type-adapter" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:attribute name="value" type="xs:string" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,TYPE}) -->
- <xs:element name="xml-transient" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute" />
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value=TYPE) -->
- <xs:element name="xml-type">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="prop-order">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-root-element">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-see-also">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:element>
-
- <!-- @Target(value={FIELD}) -->
-
- <!-- @Target(value={FIELD,METHOD}) -->
- <xs:element name="xml-any-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute" />
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-any-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="lax" type="xs:boolean" default="false" />
- <xs:attribute name="dom-handler" type="xs:string" default="javax.xml.bind.annotation.W3CDomHandler" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-map" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="default-value" type="xs:string" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlElement.DEFAULT" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-wrapper">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-value" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute" />
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-map">
- <xs:complexType>
- <xs:all>
- <xs:element name="key" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="value" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:all>
- </xs:complexType>
- </xs:element>
-</xs:schema> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_1.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_1.xsd
deleted file mode 100644
index d4ea8426bb..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_1.xsd
+++ /dev/null
@@ -1,462 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- dmccann - December 08/2009 - 2.1 - Initial implementation
-*****************************************************************************/
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.1">
-
- <xs:element name="xml-bindings">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-schema" minOccurs="0"/>
- <xs:element ref="xml-schema-type" minOccurs="0"/>
- <xs:element ref="xml-schema-types" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapters" minOccurs="0"/>
- <xs:element name="xml-registries" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-registry" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-enums" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-enum" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="java-types" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-type" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-registry">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="xml-element-decl" maxOccurs="unbounded" >
- <xs:complexType>
- <xs:attribute name="java-method" type="xs:string" />
- <xs:attribute name="name" type="xs:string" />
- <xs:attribute name="defaultValue" type="xs:string" default="\u0000" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="scope" type="xs:string" default="javax.xml.bind.annotation.XmlElementDecl.GLOBAL" />
- <xs:attribute name="substitutionHeadName" type="xs:string" default="" />
- <xs:attribute name="substitutionHeadNamespace" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="name" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-type">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-type" minOccurs="0"/>
- <xs:element ref="xml-root-element" minOccurs="0"/>
- <xs:element ref="xml-see-also" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element name="java-attributes" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-attribute" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="name" type="xs:string" />
- <xs:attribute name="xml-transient" type="xs:boolean" default="false" />
- <xs:attribute name="xml-customizer" type="xs:string" />
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-attribute" type="java-attribute" />
- <xs:complexType name="java-attribute" abstract="true">
- <xs:attribute name="java-attribute" type="xs:string" />
- </xs:complexType>
- <xs:element name="xml-access-methods" type="xml-access-methods" />
- <xs:complexType name="xml-access-methods">
- <xs:attribute name="get-method" type="xs:string" use="required"/>
- <xs:attribute name="set-method" type="xs:string" use="required"/>
- </xs:complexType>
-
- <!-- Enums -->
- <xs:simpleType name="xml-access-order">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ALPHABETICAL" />
- <xs:enumeration value="UNDEFINED" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-access-type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="FIELD" />
- <xs:enumeration value="NONE" />
- <xs:enumeration value="PROPERTY" />
- <xs:enumeration value="PUBLIC_MEMBER" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-ns-form">
- <xs:restriction base="xs:string">
- <xs:enumeration value="UNQUALIFIED" />
- <xs:enumeration value="QUALIFIED" />
- <xs:enumeration value="UNSET" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-marshal-null-representation">
- <xs:restriction base="xs:string">
- <xs:enumeration value="XSI_NIL" />
- <xs:enumeration value="ABSENT_NODE" />
- <xs:enumeration value="EMPTY_NODE" />
- </xs:restriction>
- </xs:simpleType>
-
- <!-- @Target(value=PACKAGE) -->
- <xs:element name="xml-schema">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="xml-ns" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="namespace-uri" type="xs:string" />
- <xs:attribute name="prefix" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="attribute-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="element-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="location" type="xs:string" />
- <xs:attribute name="namespace" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-schema-types">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-schema-type" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-java-type-adapters">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-java-type-adapter" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,PACKAGE}) -->
- <xs:element name="xml-schema-type">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="namespace" type="xs:string" default="http://www.w3.org/2001/XMLSchema" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlSchemaType.DEFAULT" />
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={PACKAGE,FIELD,METHOD,TYPE,PARAMETER}) -->
- <xs:element name="xml-java-type-adapter" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:attribute name="value" type="xs:string" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,TYPE}) -->
- <xs:element name="xml-transient" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute" />
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value=TYPE) -->
- <xs:element name="xml-enum">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-enum-value" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="java-enum" type="xs:string" use="required" />
- <xs:attribute name="value" type="xs:string" default="java.lang.String" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-type">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="factory-class" type="xs:string" default="javax.xml.bind.annotation.XmlType.DEFAULT" />
- <xs:attribute name="factory-method" type="xs:string" />
- <xs:attribute name="prop-order">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-root-element">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-see-also">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:element>
-
- <!-- @Target(value={FIELD}) -->
- <xs:element name="xml-enum-value">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="java-enum-value" type="xs:string" use="required" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD}) -->
- <xs:element name="xml-any-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- </xs:all>
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-schema-type" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-any-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="lax" type="xs:boolean" default="false" />
- <xs:attribute name="dom-handler" type="xs:string" default="javax.xml.bind.annotation.W3CDomHandler" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-map" minOccurs="0"/>
- <xs:element ref="xml-schema-type" minOccurs="0" />
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="default-value" type="xs:string" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlElement.DEFAULT" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="cdata" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-elements" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-element" maxOccurs="unbounded" minOccurs="0"/>
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-ref" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlElementRef.DEFAULT" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-refs" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element ref="xml-element-ref" minOccurs="0" maxOccurs="unbounded" />
- <xs:element ref="xml-element-wrapper" minOccurs="0" />
- </xs:sequence>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-inverse-reference" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- </xs:all>
- <xs:attribute name="mapped-by" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-wrapper">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-value" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- </xs:sequence>
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="cdata" type="xs:boolean" default="false" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-map">
- <xs:complexType>
- <xs:all>
- <xs:element name="key" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="value" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-abstract-null-policy" type="xml-abstract-null-policy" />
- <xs:complexType name="xml-abstract-null-policy" abstract="true">
- <xs:attribute name="xsi-nil-represents-null" type="xs:boolean" default="false" />
- <xs:attribute name="empty-node-represents-null" type="xs:boolean" default="false" />
- <xs:attribute name="null-representation-for-xml" type="xml-marshal-null-representation" />
- </xs:complexType>
- <xs:element name="xml-null-policy" substitutionGroup="xml-abstract-null-policy">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xml-abstract-null-policy">
- <xs:attribute name="is-set-performed-for-absent-node" type="xs:boolean" default="true" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-is-set-null-policy" substitutionGroup="xml-abstract-null-policy">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xml-abstract-null-policy">
- <xs:sequence>
- <xs:element name="is-set-parameter" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="value" type="xs:string"/>
- <xs:attribute name="type" type="xs:string"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="is-set-method-name" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-</xs:schema> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_2.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_2.xsd
deleted file mode 100644
index 61e37c7daf..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_2.xsd
+++ /dev/null
@@ -1,562 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- dmccann - October 12/2010 - 2.2 - Initial implementation
-*****************************************************************************/
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.2">
-
- <xs:element name="xml-bindings">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-schema" minOccurs="0"/>
- <xs:element ref="xml-schema-type" minOccurs="0"/>
- <xs:element ref="xml-schema-types" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapters" minOccurs="0"/>
- <xs:element name="xml-registries" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-registry" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-enums" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-enum" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="java-types" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-type" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- <xs:attribute name="xml-mapping-metadata-complete" type="xs:boolean" default="false" />
- <xs:attribute name="package-name" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-registry">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="xml-element-decl" maxOccurs="unbounded" >
- <xs:complexType>
- <xs:attribute name="java-method" type="xs:string" />
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="defaultValue" type="xs:string" default="\u0000" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="scope" type="xs:string" default="javax.xml.bind.annotation.XmlElementDecl.GLOBAL" />
- <xs:attribute name="substitutionHeadName" type="xs:string" default="" />
- <xs:attribute name="substitutionHeadNamespace" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="name" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-type">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-type" minOccurs="0"/>
- <xs:element ref="xml-root-element" minOccurs="0"/>
- <xs:element ref="xml-see-also" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-class-extractor" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element name="java-attributes" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-attribute" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="name" type="xs:string" />
- <xs:attribute name="super-type" type="xs:string" default="##default" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-customizer" type="xs:string" />
- <xs:attribute name="xml-discriminator-node" type="xs:string" />
- <xs:attribute name="xml-discriminator-value" type="xs:string" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-transient" type="xs:boolean" default="false" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-attribute" type="java-attribute" />
- <xs:complexType name="java-attribute" abstract="true">
- <xs:attribute name="java-attribute" type="xs:string" />
- </xs:complexType>
- <xs:element name="xml-access-methods" type="xml-access-methods" />
- <xs:complexType name="xml-access-methods">
- <xs:attribute name="get-method" type="xs:string" use="required"/>
- <xs:attribute name="set-method" type="xs:string" use="required"/>
- </xs:complexType>
- <xs:element name="xml-class-extractor" type="xml-class-extractor" />
- <xs:complexType name="xml-class-extractor">
- <xs:attribute name="class" type="xs:string" use="required"/>
- </xs:complexType>
- <xs:element name="xml-properties" type="xml-properties" />
- <xs:complexType name="xml-properties">
- <xs:sequence>
- <xs:element name="xml-property" minOccurs="0" maxOccurs="unbounded" >
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="value" type="xs:string" use="required" />
- <xs:attribute name="value-type" type="xs:string" default="java.lang.String" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <!-- Enums -->
- <xs:simpleType name="xml-access-order">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ALPHABETICAL" />
- <xs:enumeration value="UNDEFINED" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-access-type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="FIELD" />
- <xs:enumeration value="NONE" />
- <xs:enumeration value="PROPERTY" />
- <xs:enumeration value="PUBLIC_MEMBER" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-ns-form">
- <xs:restriction base="xs:string">
- <xs:enumeration value="UNQUALIFIED" />
- <xs:enumeration value="QUALIFIED" />
- <xs:enumeration value="UNSET" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-marshal-null-representation">
- <xs:restriction base="xs:string">
- <xs:enumeration value="XSI_NIL" />
- <xs:enumeration value="ABSENT_NODE" />
- <xs:enumeration value="EMPTY_NODE" />
- </xs:restriction>
- </xs:simpleType>
-
- <!-- @Target(value=PACKAGE) -->
- <xs:element name="xml-schema">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="xml-ns" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="namespace-uri" type="xs:string" />
- <xs:attribute name="prefix" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="attribute-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="element-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="location" type="xs:string" />
- <xs:attribute name="namespace" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-schema-types">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-schema-type" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-java-type-adapters">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-java-type-adapter" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,PACKAGE}) -->
- <xs:element name="xml-schema-type">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="namespace" type="xs:string" default="http://www.w3.org/2001/XMLSchema" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlSchemaType.DEFAULT" />
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={PACKAGE,FIELD,METHOD,TYPE,PARAMETER}) -->
- <xs:element name="xml-java-type-adapter" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:attribute name="value" type="xs:string" use="required" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,TYPE}) -->
- <xs:element name="xml-transient" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute" />
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value=TYPE) -->
- <xs:element name="xml-enum">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-enum-value" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="java-enum" type="xs:string" use="required" />
- <xs:attribute name="value" type="xs:string" default="java.lang.String" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-type">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="factory-class" type="xs:string" default="javax.xml.bind.annotation.XmlType.DEFAULT" />
- <xs:attribute name="factory-method" type="xs:string" />
- <xs:attribute name="prop-order">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-root-element">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-see-also">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:element>
-
- <!-- @Target(value={FIELD}) -->
- <xs:element name="xml-enum-value">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="java-enum-value" type="xs:string" use="required" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD}) -->
- <xs:element name="xml-any-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- </xs:all>
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-schema-type" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-key" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-any-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-element-refs" minOccurs="0" />
- </xs:all>
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="lax" type="xs:boolean" default="false" />
- <xs:attribute name="dom-handler" type="xs:string" default="javax.xml.bind.annotation.W3CDomHandler" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-map" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-schema-type" minOccurs="0" />
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="default-value" type="xs:string" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlElement.DEFAULT" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-key" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="cdata" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-elements" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-element" minOccurs="0" maxOccurs="unbounded" />
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-join-nodes" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-ref" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element name="xml-access-methods" type="xml-access-methods" minOccurs="0"/>
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlElementRef.DEFAULT" />
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-refs" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element name="xml-access-methods" type="xml-access-methods" minOccurs="0"/>
- <xs:element ref="xml-element-ref" minOccurs="0" maxOccurs="unbounded" />
- <xs:element ref="xml-element-wrapper" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- </xs:sequence>
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-inverse-reference" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- </xs:all>
- <xs:attribute name="mapped-by" type="xs:string" use="required" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-wrapper">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-value" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="cdata" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-map">
- <xs:complexType>
- <xs:all>
- <xs:element name="key" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="value" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-abstract-null-policy" type="xml-abstract-null-policy" />
- <xs:complexType name="xml-abstract-null-policy" abstract="true">
- <xs:attribute name="xsi-nil-represents-null" type="xs:boolean" default="false" />
- <xs:attribute name="empty-node-represents-null" type="xs:boolean" default="false" />
- <xs:attribute name="null-representation-for-xml" type="xml-marshal-null-representation" default="ABSENT_NODE" />
- </xs:complexType>
- <xs:element name="xml-null-policy" substitutionGroup="xml-abstract-null-policy">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xml-abstract-null-policy">
- <xs:attribute name="is-set-performed-for-absent-node" type="xs:boolean" default="true" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-is-set-null-policy" substitutionGroup="xml-abstract-null-policy">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xml-abstract-null-policy">
- <xs:sequence>
- <xs:element name="is-set-parameter" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="value" type="xs:string" use="required" />
- <xs:attribute name="type" type="xs:string" use="required" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="is-set-method-name" type="xs:string" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-transformation" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element name="xml-access-methods" type="xml-access-methods" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0"/>
- <xs:element name="xml-read-transformer">
- <xs:complexType>
- <xs:attribute name="method" type="xs:string" />
- <xs:attribute name="transformer-class" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-write-transformer" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="method" type="xs:string" />
- <xs:attribute name="xml-path" type="xs:string" use="required" />
- <xs:attribute name="transformer-class" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="optional" type="xs:boolean" default="true"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-join-nodes" substitutionGroup="java-attribute" >
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element name="xml-join-node" minOccurs="1" maxOccurs="unbounded" >
- <xs:complexType>
- <xs:attribute name="xml-path" type="xs:string" use="required" />
- <xs:attribute name="referenced-xml-path" type="xs:string" use="required" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-</xs:schema> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_3.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_3.xsd
deleted file mode 100644
index 74a4d55db5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_oxm_2_3.xsd
+++ /dev/null
@@ -1,589 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- dmccann - December 22/2010 - 2.3 - Initial implementation
-*****************************************************************************/
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.3">
-
- <xs:element name="xml-bindings">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-schema" minOccurs="0"/>
- <xs:element ref="xml-schema-type" minOccurs="0"/>
- <xs:element ref="xml-schema-types" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapters" minOccurs="0"/>
- <xs:element name="xml-registries" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-registry" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-enums" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-enum" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="java-types" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-type" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- <xs:attribute name="xml-mapping-metadata-complete" type="xs:boolean" default="false" />
- <xs:attribute name="package-name" type="xs:string" default="##default" />
- <xs:attribute name="xml-name-transformer" type="xs:string" />
- <xs:attribute name="version" type="supported-versions" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-registry">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="xml-element-decl" maxOccurs="unbounded" >
- <xs:complexType>
- <xs:attribute name="java-method" type="xs:string" />
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="defaultValue" type="xs:string" default="\u0000" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="scope" type="xs:string" default="javax.xml.bind.annotation.XmlElementDecl.GLOBAL" />
- <xs:attribute name="substitutionHeadName" type="xs:string" default="" />
- <xs:attribute name="substitutionHeadNamespace" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="name" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-type">
- <xs:complexType>
- <xs:all>
- <xs:element ref="xml-type" minOccurs="0"/>
- <xs:element ref="xml-root-element" minOccurs="0"/>
- <xs:element ref="xml-virtual-access-methods" minOccurs="0"/>
- <xs:element ref="xml-see-also" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-class-extractor" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element name="java-attributes" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="java-attribute" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="name" type="xs:string" />
- <xs:attribute name="super-type" type="xs:string" default="##default" />
- <xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
- <xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
- <xs:attribute name="xml-customizer" type="xs:string" />
- <xs:attribute name="xml-discriminator-node" type="xs:string" />
- <xs:attribute name="xml-discriminator-value" type="xs:string" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-transient" type="xs:boolean" default="false" />
- <xs:attribute name="xml-name-transformer" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="java-attribute" type="java-attribute" />
- <xs:complexType name="java-attribute" abstract="true">
- <xs:attribute name="java-attribute" type="xs:string" />
- </xs:complexType>
- <xs:element name="xml-access-methods" type="xml-access-methods" />
- <xs:complexType name="xml-access-methods">
- <xs:attribute name="get-method" type="xs:string" />
- <xs:attribute name="set-method" type="xs:string" />
- </xs:complexType>
- <xs:element name="xml-class-extractor" type="xml-class-extractor" />
- <xs:complexType name="xml-class-extractor">
- <xs:attribute name="class" type="xs:string" use="required"/>
- </xs:complexType>
- <xs:element name="xml-properties" type="xml-properties" />
- <xs:complexType name="xml-properties">
- <xs:sequence>
- <xs:element name="xml-property" minOccurs="0" maxOccurs="unbounded" >
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="value" type="xs:string" use="required" />
- <xs:attribute name="value-type" type="xs:string" default="java.lang.String" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <!-- Enums -->
- <xs:simpleType name="xml-access-order">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ALPHABETICAL" />
- <xs:enumeration value="UNDEFINED" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-access-type">
- <xs:restriction base="xs:string">
- <xs:enumeration value="FIELD" />
- <xs:enumeration value="NONE" />
- <xs:enumeration value="PROPERTY" />
- <xs:enumeration value="PUBLIC_MEMBER" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-ns-form">
- <xs:restriction base="xs:string">
- <xs:enumeration value="UNQUALIFIED" />
- <xs:enumeration value="QUALIFIED" />
- <xs:enumeration value="UNSET" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="xml-marshal-null-representation">
- <xs:restriction base="xs:string">
- <xs:enumeration value="XSI_NIL" />
- <xs:enumeration value="ABSENT_NODE" />
- <xs:enumeration value="EMPTY_NODE" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="supported-versions">
- <xs:restriction base="xs:string">
- <xs:enumeration value="2.0"/>
- <xs:enumeration value="2.1"/>
- <xs:enumeration value="2.2"/>
- <xs:enumeration value="2.3"/>
- </xs:restriction>
- </xs:simpleType>
-
- <!-- @Target(value=PACKAGE) -->
- <xs:element name="xml-schema">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="xml-ns" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="namespace-uri" type="xs:string" />
- <xs:attribute name="prefix" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="attribute-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="element-form-default" type="xml-ns-form" default="UNSET" />
- <xs:attribute name="location" type="xs:string" />
- <xs:attribute name="namespace" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-schema-types">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-schema-type" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-java-type-adapters">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-java-type-adapter" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,PACKAGE}) -->
- <xs:element name="xml-schema-type">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="namespace" type="xs:string" default="http://www.w3.org/2001/XMLSchema" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlSchemaType.DEFAULT" />
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={PACKAGE,FIELD,METHOD,TYPE,PARAMETER}) -->
- <xs:element name="xml-java-type-adapter" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:attribute name="value" type="xs:string" use="required" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD,TYPE}) -->
- <xs:element name="xml-transient" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute" />
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value=TYPE) -->
- <xs:element name="xml-enum">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="xml-enum-value" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="java-enum" type="xs:string" use="required" />
- <xs:attribute name="value" type="xs:string" default="java.lang.String" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-type">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="factory-class" type="xs:string" default="javax.xml.bind.annotation.XmlType.DEFAULT" />
- <xs:attribute name="factory-method" type="xs:string" />
- <xs:attribute name="prop-order">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-root-element">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-see-also">
- <xs:simpleType>
- <xs:list itemType="xs:string" />
- </xs:simpleType>
- </xs:element>
- <xs:element name="xml-virtual-access-methods">
- <xs:complexType>
- <xs:attribute name="get-method" type="xs:string" default="get" />
- <xs:attribute name="set-method" type="xs:string" default="set" />
- <xs:attribute name="schema" type="xml-virtual-access-methods-schema" default="NODES" />
- </xs:complexType>
- </xs:element>
- <xs:simpleType name="xml-virtual-access-methods-schema">
- <xs:restriction base="xs:string">
- <xs:enumeration value="NODES" />
- <xs:enumeration value="ANY" />
- </xs:restriction>
- </xs:simpleType>
-
- <!-- @Target(value={FIELD}) -->
- <xs:element name="xml-enum-value">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="java-enum-value" type="xs:string" use="required" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
- <!-- @Target(value={FIELD,METHOD}) -->
- <xs:element name="xml-any-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- </xs:all>
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-attribute" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-schema-type" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-key" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-any-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-element-refs" minOccurs="0" />
- </xs:all>
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="lax" type="xs:boolean" default="false" />
- <xs:attribute name="dom-handler" type="xs:string" default="javax.xml.bind.annotation.W3CDomHandler" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- <xs:element ref="xml-map" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-schema-type" minOccurs="0" />
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="default-value" type="xs:string" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlElement.DEFAULT" />
- <xs:attribute name="xml-id" type="xs:boolean" default="false" />
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-key" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="xml-inline-binary-data" type="xs:boolean" default="false" />
- <xs:attribute name="xml-attachment-ref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-mime-type" type="xs:string" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="cdata" type="xs:boolean" default="false" />
- <xs:attribute name="xml-path" type="xs:string" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-elements" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-element" minOccurs="0" maxOccurs="unbounded" />
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-join-nodes" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="xml-idref" type="xs:boolean" default="false" />
- <xs:attribute name="xml-list" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-ref" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element name="xml-access-methods" type="xml-access-methods" minOccurs="0"/>
- <xs:element ref="xml-element-wrapper" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0" />
- </xs:all>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.XmlElementRef.DEFAULT" />
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-refs" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element name="xml-access-methods" type="xml-access-methods" minOccurs="0"/>
- <xs:element ref="xml-element-ref" minOccurs="0" maxOccurs="unbounded" />
- <xs:element ref="xml-element-wrapper" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0" />
- </xs:sequence>
- <xs:attribute name="xml-mixed" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-inverse-reference" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- </xs:all>
- <xs:attribute name="mapped-by" type="xs:string" use="required" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-element-wrapper">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string" default="##default" />
- <xs:attribute name="namespace" type="xs:string" default="##default" />
- <xs:attribute name="nillable" type="xs:boolean" default="false" />
- <xs:attribute name="required" type="xs:boolean" default="false" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-value" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
- <xs:element ref="xml-access-methods" minOccurs="0" />
- <xs:element ref="xml-properties" minOccurs="0" />
- <xs:element ref="xml-java-type-adapter" minOccurs="0"/>
- </xs:all>
- <xs:attribute name="cdata" type="xs:boolean" default="false" />
- <xs:attribute name="read-only" type="xs:boolean" default="false" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- <xs:attribute name="write-only" type="xs:boolean" default="false" />
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-map">
- <xs:complexType>
- <xs:all>
- <xs:element name="key" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="value" minOccurs="0">
- <xs:complexType>
- <xs:attribute name="type" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-abstract-null-policy" type="xml-abstract-null-policy" />
- <xs:complexType name="xml-abstract-null-policy" abstract="true">
- <xs:attribute name="xsi-nil-represents-null" type="xs:boolean" default="false" />
- <xs:attribute name="empty-node-represents-null" type="xs:boolean" default="false" />
- <xs:attribute name="null-representation-for-xml" type="xml-marshal-null-representation" default="ABSENT_NODE" />
- </xs:complexType>
- <xs:element name="xml-null-policy" substitutionGroup="xml-abstract-null-policy">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xml-abstract-null-policy">
- <xs:attribute name="is-set-performed-for-absent-node" type="xs:boolean" default="true" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-is-set-null-policy" substitutionGroup="xml-abstract-null-policy">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="xml-abstract-null-policy">
- <xs:sequence>
- <xs:element name="is-set-parameter" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="value" type="xs:string" use="required" />
- <xs:attribute name="type" type="xs:string" use="required" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="is-set-method-name" type="xs:string" use="required" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-transformation" substitutionGroup="java-attribute">
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element name="xml-access-methods" type="xml-access-methods" minOccurs="0"/>
- <xs:element ref="xml-properties" minOccurs="0"/>
- <xs:element name="xml-read-transformer">
- <xs:complexType>
- <xs:attribute name="method" type="xs:string" />
- <xs:attribute name="transformer-class" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-write-transformer" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="method" type="xs:string" />
- <xs:attribute name="xml-path" type="xs:string" use="required" />
- <xs:attribute name="transformer-class" type="xs:string" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="optional" type="xs:boolean" default="true"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="xml-join-nodes" substitutionGroup="java-attribute" >
- <xs:complexType>
- <xs:complexContent>
- <xs:extension base="java-attribute">
- <xs:sequence>
- <xs:element name="xml-join-node" minOccurs="1" maxOccurs="unbounded" >
- <xs:complexType>
- <xs:attribute name="xml-path" type="xs:string" use="required" />
- <xs:attribute name="referenced-xml-path" type="xs:string" use="required" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="container-type" type="xs:string" default="##default" />
- <xs:attribute name="type" type="xs:string" default="##default" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-</xs:schema> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.0.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.0.xsd
deleted file mode 100644
index 02c6c61c6c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.0.xsd
+++ /dev/null
@@ -1,4109 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-<!-- Eclipse Persistence Service Project :: Map Schema file for ORM/OXM/EIS -->
-<xsd:schema
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0"
- >
- <xsd:element name="object-persistence" type="object-persistence" />
- <xsd:complexType name="object-persistence">
- <xsd:annotation>
- <xsd:documentation>An object-persistence mapping module, a set of class-mapping-descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>A name for the model being mapped.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-mapping-descriptors">
- <xsd:annotation>
- <xsd:documentation>The list of class mapping descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-mapping-descriptor" type="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="login" type="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="default-temporal-mutable" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines the default for how Date and Calendar types are used with change tracking.</xsd:documentation>
- <xsd:documentation>By default they are assumed not to be changed directly (only replaced).</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute default="Eclipse Persistence Services - 1.0 (Build YYMMDD)" name="version" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="platform-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the platform class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="user-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource user-name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="password" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource password, this is stored in encrypted form.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-connection-pooling" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the connections are managed by the datasource driver, and a new connection should be acquire per call.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-transaction-controller" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the transaction are managed by a transaction manager, and should not be managed by TopLink.</xsd:documentation>
- <xsd:documentation>This can also be used if the datasource does not support transactions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing">
- <xsd:annotation>
- <xsd:documentation>Sequencing information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-sequence" type="sequence">
- <xsd:annotation>
- <xsd:documentation>Default sequence. The name is optional. If no name provided an empty string will be used as a name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequences">
- <xsd:annotation>
- <xsd:documentation>Non default sequences. Make sure each sequence has unique name.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="sequence" type="sequence" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>The JDBC driver and database connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="driver-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the JDBC driver class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full JDBC driver connection URL.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if parameter binding should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cache-all-statements" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if statement caching should be used. This should be used with parameter binding, this cannot be used with external connection pooling.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="byte-array-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if byte array data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="string-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="256" name="string-binding-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Configure the threshold string size for usage of string binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="streams-for-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if large byte array and string data-types should be bound as streams.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="force-field-names-to-upper-case" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure to force all field names to upper-case.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="optimize-data-conversion" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure data optimization.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="trim-strings" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string trailing blanks should be trimmed. This is normally required for CHAR data-types.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="jdbc-batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If using batch writing, configure if the JDBC drivers batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>The JCA driver and EIS connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="connection-spec-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the TopLink platform specific connection spec class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-factory-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The JNDI url for the managed JCA adapter's connection factory.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>The connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="equal-namespace-resolvers" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- <xsd:documentation>This is an abstract definition to allow flexibility in the types of classes and datastores persisted, i.e. interfaces, abstract classes, aggregates, non-relational persistence.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the implementation class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.implementation.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="alias" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally an alias name can be given for the class. The alias is a string that can be used to refer to the class in place of its implementation name, such as in querying.</xsd:documentation>
- <xsd:documentation>Example: <alias xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">Employee</alias></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="primary-key">
- <xsd:annotation>
- <xsd:documentation>The list of fields/columns that make up the primary key or unique identifier of the class.</xsd:documentation>
- <xsd:documentation>This is used for caching, relationships, and for database operations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary key field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the class is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="inheritance" type="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="events" type="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="querying" type="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries for the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-mappings">
- <xsd:annotation>
- <xsd:documentation>The list of mappings that define how the class' attributes are persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="attribute-mapping" type="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="descriptor-type" type="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the descriptor type, such as aggregate or independent.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="interfaces" type="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the interfaces that this class implements..</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="locking" type="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the locking behavior for the class. Such as an optimistic locking policy based on version, timestamp or change set of columns.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing" type="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="remote-caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached on remote clients.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="returning-policy" type="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="amendment" type="amendment">
- <xsd:annotation>
- <xsd:documentation>Allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="instantiation" type="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="copying" type="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-keys">
- <xsd:annotation>
- <xsd:documentation>A list of query keys or aliases for database information. These can be used in queries instead of the database column names.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query-key" type="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="cmp-policy" type="cmp-policy">
- <xsd:annotation>
- <xsd:documentation>Place holder of CMP information specific.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-groups" type="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups at the descriptor level</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="change-policy" type="change-policy">
- <xsd:annotation>
- <xsd:documentation>Contains the Change Policy for this descriptor</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute fixed="10" name="schema-major-version" type="xsd:integer" />
- <xsd:attribute fixed="0" name="schema-minor-version" type="xsd:integer" />
- </xsd:complexType>
- <xsd:simpleType name="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the class descriptor type.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="independent" />
- <xsd:enumeration value="aggregate" />
- <xsd:enumeration value="aggregate-collection" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="interface" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Specify the interfaces that a class descriptor implements, or the implemention class for an interface descriptor.</xsd:documentation>
- <xsd:documentation>Optionally a set of public interfaces for the class can be specified. This allows the interface to be used to refer to the implementation class.</xsd:documentation>
- <xsd:documentation>If two classes implement the same interface, an interface descriptor should be defined for the interface.</xsd:documentation>
- <xsd:documentation>This can also be used to define inheritance between interface descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="interface" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified interface class name.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.api.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="implementor-descriptor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the implementation class for which this interface is the public interface.</xsd:documentation>
- <xsd:documentation>This can be used if the interface has only a single implementor.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.impl.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Creates a copying through creating a new instance to copy into.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized through a clone method.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the clone method on the object, i.e. 'clone'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method on the factory to instantiate the object instance.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified factory class name.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method to instantiate the factory class.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="amendment">
- <xsd:annotation>
- <xsd:documentation>Specifies a class and static method to be called to allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="amendment-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation> The fully qualified name of the amendment class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="amendment-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the static amendment method on the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a relational database table(s).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="tables">
- <xsd:annotation>
- <xsd:documentation>The list of the tables the class is persisted to. Typically a class is persisted to a single table, but multiple tables can be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="table" type="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-keys-for-multiple-table" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>Allow the foreign key field references to be define for multiple table descriptors.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="multiple-table-join-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For complex multiple table join conditions an expression may be provided instead of the table foreign key information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="version-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on a numeric version field/column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="version-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="store-version-in-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the version value should be stored in the cache, or if it will be stored in the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="timestamp-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on timestamp version column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="version-locking-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="server-time" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the timestamp should be obtained locally or from the database server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="all-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of all fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="changed-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of only the changed fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="selected-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of a specified set of fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="fields">
- <xsd:annotation>
- <xsd:documentation>Specify the set of fields to compare on update and delete.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a database generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="sequence-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the name of the sequence generator. This could be the name of a sequence object, or a row value in a sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequence-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the field/column that the generated sequence id is assigned to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid caching types.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="full" />
- <xsd:enumeration value="cache" />
- <xsd:enumeration value="weak-reference" />
- <xsd:enumeration value="soft-reference" />
- <xsd:enumeration value="soft-cache-weak-reference" />
- <xsd:enumeration value="hard-cache-weak-reference" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached and how object identity should be maintained.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="soft-cache-weak-reference" name="cache-type" type="cache-type">
- <xsd:annotation>
- <xsd:documentation>Specify the type of caching, such as LRU, weak reference or none.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="cache-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specify the initial or maximum size of the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always refresh cached objects on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="only-refresh-cache-if-newer-version" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to refresh if the cached object is an older version.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="disable-cache-hits" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Disable obtaining cache hits on primary key queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-conform" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always conform queries within a transaction.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="isolated" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects of this type should be isolated from the shared cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="isolate-new-data-after-transaction" name="unitofwork-isolation-level" type="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work should be isolated to the session cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="change-set" name="cache-sync-type" type="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to be used with this descripor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="cache-invalidation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Abstract superclass for cache invalidation policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="update-read-time-on-update" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="no-expiry-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects in the cache do not expire.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="time-to-live-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects live a specific number of milliseconds after they are read.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="time-to-live" type="xsd:long" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="daily-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation Policy where objects expire at a specific time every day</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="expiry-time" type="xsd:dateTime" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are to be persisted to the data-store.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="handle-writes" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="use-database-time" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="history-tables">
- <xsd:annotation>
- <xsd:documentation>Defines the names of the mirroring historical tables.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="history-table" type="history-table" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="start-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the start fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="start-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="end-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the end fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="end-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="history-table">
- <xsd:annotation>
- <xsd:documentation>Each entry is a source (descriptor) to history table name association.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="source" type="xsd:string" />
- <xsd:element minOccurs="1" name="history" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="1" name="returning-field-infos">
- <xsd:annotation>
- <xsd:documentation>Lists the fields to be returned together with the flags defining returning options</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="returning-field-info" type="returning-field-info" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-field-info">
- <xsd:annotation>
- <xsd:documentation>Field to be returned together with type and the flags defining returning options. At least one of insert, update should be true.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field to be returned.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert-mode-return-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If insert==true, indicates whether the field should not be inserted (true). If insert==false - ignored.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="update" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="parent-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the parent/superclass of the class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="read-subclasses-on-queries" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define if subclasses of the class should be returned on queries, or only the exact class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-view" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify the name of a view that joins all of the subclass' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-class-name-as-indicator" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the fully qualified class name should be used as the class type indicator.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extraction-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a method on the class that takes the class' row as argument a computed that class type to be used to instantiate from the row.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name of the type field/column that the class type is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extractor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a class that implements a class extractor interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="only-instances-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out all sibling and subclass instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out sibling instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="qname-inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Extends inheritance policy. Allows for prefixed names to be resolved at runtime to find the approriate class</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="inheritance-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-indicator-mapping">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the class the type maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="class-indicator" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The field value used to define the class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="event-listeners">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="event-listener" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of an event listener class that implements the descriptor event listener interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-build-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after building the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-clone-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after cloning the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-merge-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after merging the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-refresh-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after refreshing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries and query properties for the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="queries">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="query">
- <xsd:annotation>
- <xsd:documentation>A query definition for the class' instances.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to apply to all queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="check-cache" name="existence" type="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the behavoir used to determine if an insert or update should occur for an object to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom insert query. This overide the default insert behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="update-query" type="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom update query. This overide the default update behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom delete query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="does-exist-query" type="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Custom does exist query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-object-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom read object query. This overide the default read behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-all-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Custom read all query. This overide the default read all behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence policies for determining if an insert or update should occur for an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query-key alias name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:simpleType name="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to use with a descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="invalidation" />
- <xsd:enumeration value="no-changes" />
- <xsd:enumeration value="change-set-with-new-objects" />
- <xsd:enumeration value="change-set" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work isolated from the session cache.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="use-session-cache-after-transaction" />
- <xsd:enumeration value="isolate-new-data-after-transaction" />
- <xsd:enumeration value="isolate-cache-after-transaction" />
- <xsd:enumeration value="isolate-cache-always" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="direct-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column being aliased.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-query-key" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key join condition between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The join criteria between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-1 join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-m join from another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the field/column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="null-value" type="xsd:anySimpleType" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a value that null data values should be converted to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="converter" type="value-converter" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-classification" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute. This is the implementation class attribute name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the attribute is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="get-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the get method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="set-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the set method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a simple attribute is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-direct-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-transformation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a field transformation for a transformation mapping</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="method-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="method" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformer-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="transformer-class" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a transformation mapping that uses Java code to transform between the data and object values.</xsd:documentation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute transformation defined in the domain class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-transformer" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The class name of the attribute transformer. Used in place of attribute-transformation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="mutable" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy" />
- <xsd:element minOccurs="0" name="field-transformations">
- <xsd:annotation>
- <xsd:documentation>The field transformations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-transformation" type="field-transformation" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a relationship where the target object is strictly privately owned by the source object and stores within the source objects row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="allow-null" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if a row of all nulls should be interpreted as null.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-translations">
- <xsd:annotation>
- <xsd:documentation>Allow for the mapping to use different field names than the descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-translation">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source descriptor's table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the aggregate descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a relationship between two classes is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="private-owned" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the target objects are privately owned dependent objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-persist" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-merge" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the refresh operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-remove" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the remove operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the source class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="one-to-one-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="target-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-grouping-element" type="field" />
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of simple types relationship from the source instance to a set of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the reference table that stores the source primary key and the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="direct-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that stores the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the reference table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="session-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name session that defines the reference table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a map relationship from the source instance to a set of key values pairs of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-collection-mapping">
- <xsd:sequence>
- <xsd:element name="direct-key-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that sores the map key data value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="key-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the key data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances where the target instances are strictly privately owned by the source object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="many-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a m-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="relation-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the relation table that stores the source/target primary keys.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="source-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the target class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="variable-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance that may be of several types related through an interface.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="type-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the column to store the class type of the related object into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="foreign-key-to-query-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target column/query key references relating a foreign key in one table to the query keys defining a primary or unique key value in the other interface descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="query-key-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target interface descriptor query key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-query-key" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query key name of the target interface descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a container/collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection implementation class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="sorted-collection-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a sorted collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="comparator-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the comparitor, used to compare objects in sorting the collection.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="list-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a list collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a direct map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="scrollable-cursor-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a scrollable cursor container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="cursored-stream-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a cursored stream container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indirection-policy" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a deferred read indirection mechanism.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="value-holder-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of value holders to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="proxy-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of proxies to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transparent-collection-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of transparent collections to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection interface to use, i.e. List, Set, Map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of a user defined container to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element name="container-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the container implementer to use.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="typesafe-enumeration-converter">
- <xsd:annotation>
- <xsd:documentation>Typesafe Enumeration conversion</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-conversion-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies the data type and an object type of the attribute to convert between.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attribute type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="data-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="serialized-object-converter">
- <xsd:annotation>
- <xsd:documentation>Uses object serialization to convert between the object and data type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="data-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of values from database values used in the field and object values used in the attribute.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>An optional default value can be specified. This value is used if a database type is not found in the type mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies the mapping of values. Both the object and database values must be unique.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-only-type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of additional values that map non-unique data values to a unique attribute value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Define an object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="object-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the object's attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="data-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the database field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query/interaction against a database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="maintain-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should bypass the cache completely.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should use paramater binding for arguments, or print the arguments in-line.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-statement" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries statement should be cached, this must be used with parameter binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to cancel the query in if the request takes too long to complete.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="prepare" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should prepare and cache its generated SQL, or regenerate the SQL on each execution.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="call" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For static calls the SQL or Stored Procedure call definition can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid join fetch options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="inner-join" />
- <xsd:enumeration value="outer-join" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid cascade policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="private" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="value-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a single value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a collection of values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="data-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading raw data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="cache-query-results" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should cache the query results to avoid future executions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="max-rows" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies the maximum number of rows to fetch, results will be trunctate on the database to this size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="first-result" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies where to start the cursor in a result set returned from the database. Results prior to this number will not be built into objects</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifiess the number of rows to fetch from the database on each result set next operation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-result-cache-policy" type="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Specify how the query results should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a query's results should be cached.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="maximum-cached-results" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>This defines the number of query result sets that will be cached. The LRU query results will be discarded when the max size is reached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for manipulating data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-modify-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for modifying an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for updating an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for inserting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for determining if an object exists.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="existence-check" type="existence-check">
- <xsd:annotation>
- <xsd:documentation>The existence check option.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="existence-check">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence check options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting a criteria of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for objects (as apposed to data).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full qualified name of the class of objects being queried.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any cached objects from the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="remote-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any remotely cached objects from the server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="cascade-policy" type="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries settings (such as refresh, maintain-cache) should apply to the object's relationship queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="primary-key" name="cache-usage" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how the query should interact with the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="lock-mode" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should lock the resulting rows on the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="distinct-state" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should filter distinct results.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="in-memory-querying">
- <xsd:annotation>
- <xsd:documentation>The in memory querying policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element default="ignore-exceptions-return-conformed" name="policy" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how indirection or unconformable expressions should be treating with in-memory querying and conforming.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="use-default-fetch-group" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the default fetch group should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group" type="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify a pre-defined named fetch group to allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-exclusive-connection" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the exclusive connection (VPD) should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="joined-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies the attributes being joined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for joining</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects resulting from the query are read-only, and will not be registered in the unit of work.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a set of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="batch-read-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies all attributes for batch reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for batch reading</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="order-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets the order expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for ordering</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a single object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="report-query">
- <xsd:annotation>
- <xsd:documentation>Query for information about a set of objects instead of the objects themselves.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-all-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="return-choice" type="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="retrieve-primary-keys" type="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="report-items">
- <xsd:annotation>
- <xsd:documentation>Items to be selected, these could be attributes or aggregate functions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="item" type="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="group-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets GROUP BY expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for grouping</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="return-single-result" />
- <xsd:enumeration value="return-single-value" />
- <xsd:enumeration value="return-single-attribute" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="full-primary-key" />
- <xsd:enumeration value="first-primary-key" />
- <xsd:enumeration value="no-primary-key" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested in ReportQuery.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Name given for item, can be used to retieve value from result.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Expression (partial) that describes the attribute wanted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="expression" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query filter expression tree.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relation-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a relation expression that compares to expressions through operators such as equal, lessThan, etc..</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logic-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of two sub-expressions joined through an operator such as AND, OR.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="function-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of a function applied to a list of sub-expressions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of function arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="expression">
- <xsd:annotation>
- <xsd:documentation>Defines an argument expression.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="function" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="constant-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression value. If the value is null the value tag can is absent.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-key-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression query-key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="any-of" type="xsd:boolean" />
- <xsd:attribute name="outer-join" type="xsd:boolean" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression field.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="parameter-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression parameter.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="parameter" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="base-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression builder/base.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="operator">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid operators.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:complexType name="sql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an SQL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="sql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full SQL query string. Arguments can be specified through #arg-name tokens in the string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="ejbql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an EJB-QL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="ejbql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The EJB-QL query string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cursor-output-procedure" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define the call to use a cursor output parameter to define the result set.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure. The order of the arguments must match the procedure arguments if not named.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-function-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored function invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="stored-procedure-call">
- <xsd:sequence>
- <xsd:element minOccurs="1" name="stored-function-result" type="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>The return value of the stored-function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="procedure-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The stored procedure name of the argument. For indexed argument the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the argument class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype" type="xsd:int">
- <xsd:annotation>
- <xsd:documentation>The JDBC int type of the argument, as defined in java.jdbc.Types</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the type if procedure-argument-sqltype is STRUCT or ARRAY</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-inoutput-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument">
- <xsd:sequence>
- <xsd:element name="output-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition whose arguments contain at least one Oracle PL/SQL type that has no JDBC representation (e.g. BOOLEAN, PLS_INTEGER, PL/SQL record).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-procedure-argument-type" abstract="true">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element minOccurs="0" name="index" type="xsd:string" />
- <xsd:element minOccurs="0" name="direction" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="jdbc-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:choice>
- <xsd:element minOccurs="0" name="length" type="xsd:string" />
- <xsd:sequence>
- <xsd:element name="precision" type="xsd:string" />
- <xsd:element name="scale" type="xsd:string" />
- </xsd:sequence>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-record">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="record-name" type="xsd:string" />
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="fields">
- <xsd:annotation>
- <xsd:documentation>The list of fields.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an EIS record data structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element name="datatype" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the record structure name the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="mapped-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing MappedRecord.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing XML records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-record-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name to use for the input record, if required by the adapter.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-root-element-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indexed-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing Indexed records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="interaction-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an interaction argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The interaction name of the argument. For indexed arguments the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argumen. This is the name of the argument as define in the query, or the descriptor field name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="object-relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a Structure type in an object-relational database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relational-class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the object structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-order">
- <xsd:annotation>
- <xsd:documentation>The ordered list of the field defined in the structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="nested-table-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m/m-m relationship that makes use of the object-relational nested-table type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the source table that stores the nested-table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the nested-table type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of primitive/simple type values using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of object-types using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="structure-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a structure of object-types using the object-relational structure type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a reference to another object-type using the object-relational reference type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source type that stores the reference.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-relational-field">
- <xsd:annotation>
- <xsd:documentation>Defines an ObjectRelationalDatabaseField</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="nested-type-field" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-xml-type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct mapping to an Oracle XDB XML Type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="read-whole-document" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a user defined converter class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-collection-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-M relationship from the source XML element to the target XML element based on a key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-object-reference-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="containerpolicy" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="uses-single-node" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-object-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source XML element to the target XML element based on one or more keys.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="aggregate-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-to-target-key-field-association" type="foreign-key" />
- <xsd:element minOccurs="0" name="source-to-target-key-fields">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an XML element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="default-root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the element the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="default-root-element-field" type="node">
- <xsd:annotation>
- <xsd:documentation>The XMLField representing the default root element of the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="should-preserve-document" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if nodes should be cached to preserve unmapped data</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="schema" type="schema-reference">
- <xsd:annotation>
- <xsd:documentation>The location of the XML Schema.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single object to an xs:any declaration</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single Node to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection of Nodes to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="container-policy" type="container-policy" />
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-field-to-class-association">
- <xsd:sequence>
- <xsd:element name="xml-field" type="node" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="xml-conversion-pair">
- <xsd:sequence>
- <xsd:element name="qname" type="xsd:string" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="node">
- <xsd:annotation>
- <xsd:documentation>Defines an XPath expression to an element or attribute in an XML document.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="position" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>The position of the node in the parent type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" name="leaf-element-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Indicates the elements type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="union-node">
- <xsd:annotation>
- <xsd:documentation>Use to represent nodes which are mapped to unions</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="namespace-resolver">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="namespaces">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="namespace" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="default-namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="namespace">
- <xsd:sequence>
- <xsd:element name="prefix" type="xsd:string" />
- <xsd:element name="namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-reference">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="resource" type="xsd:string" />
- <xsd:element name="schema-context" type="xsd:string" />
- <xsd:element name="node-type" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-class-path-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-file-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-url-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="java-character">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="java-timestamp">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:simpleType name="java-util-date">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:complexType name="cmp-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="pessimistic-locking" type="pessimistic-locking">
- <xsd:annotation>
- <xsd:documentation>Defines the cmp bean-level pessimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="defer-until-commit" type="defer-until-commit">
- <xsd:annotation>
- <xsd:documentation>Defines modification deferral level for non-deferred writes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="non-deferred-create-time" type="non-deferred-create-time">
- <xsd:annotation>
- <xsd:documentation>Defines point at which insert will be issued to Database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="pessimistic-locking">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="wait" name="locking-mode" type="locking-mode" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="defer-until-commit">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all-modifications" />
- <xsd:enumeration value="update-modifications" />
- <xsd:enumeration value="none" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="non-deferred-create-time">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="after-ejbcreate" />
- <xsd:enumeration value="after-ejbpostcreate" />
- <xsd:enumeration value="undefined" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="locking-mode">
- <xsd:annotation>
- <xsd:documentation>Holds the pessimistic locking mode.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="wait" />
- <xsd:enumeration value="no-wait" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Sequence name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="50" name="preallocation-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Sequence preallocation size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>References default sequence object, overriding its name and (optionally) preallocation size.</xsd:documentation>
- <xsd:documentation>To use preallocation size of default sequence object, set preallocation size to 0</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>Database sequence mechanism used.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>Unary table sequence - sequence name is a table name, table has a single field and a single row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-fetch-group" type="fetch-group" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group" type="fetch-group" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Contains the fetch group attributes info.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string" />
- <xsd:element name="fetch-group-attributes">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>Contains a fetch group's attribute list.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group-attribute" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="change-policy">
- <xsd:annotation>
- <xsd:documentation>Describes the change tracking policy for this descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="deferred-detection-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses backup clone to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses "mark dirty" to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses a ChangeTracker firing PropertyChangeEvent's to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-null-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the Null Policy in use for this relationship currently a choice of [NullPolicy and IsSetNullPolicy].</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="xsi-nil-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="empty-node-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-representation-for-xml" type="marshal-null-representation" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="is-set-performed-for-absent-node" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="is-set-null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-set-method-name" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter-type" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="marshal-null-representation">
- <xsd:annotation>
- <xsd:documentation>Write null, no tag(default) or an empty tag.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="XSI_NIL" />
- <xsd:enumeration value="ABSENT_NODE" />
- <xsd:enumeration value="EMPTY_NODE" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="field">
- <xsd:annotation>
- <xsd:documentation>Defines a generic field concept, such as a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the field.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>Defines a column in a relational database table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:attribute name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the column's table. This table must be listed in the class' tables. If not specified the first table of the class will be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target field/column references relating a foreign key in one table to the primary or unique key in another table.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target table primary key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary or unique key field/column name in the target table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query">
- <xsd:annotation>
- <xsd:documentation>Defines a query specification for querying instances of the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The selection criteria of the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of query arguments. The order of the argument must match the order of the argument value passed to the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="query-argument">
- <xsd:annotation>
- <xsd:documentation>The query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query. This name can be used to reference and execute the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="criteria">
- <xsd:annotation>
- <xsd:documentation>Defines the filtering clause of a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="query-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a query argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class type name of the argument may be provided.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Optional constant value for the argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:anyType" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the table. The name can be fully qualified with the schema, tablespace or link.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="value-converter">
- <xsd:annotation>
- <xsd:documentation>
- Specifies how the data value should be converted to the
- object value.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-</xsd:schema> \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.1.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.1.xsd
deleted file mode 100644
index 3746ead644..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.1.xsd
+++ /dev/null
@@ -1,4183 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-<!-- Eclipse Persistence Service Project :: Map Schema file for ORM/OXM/EIS -->
-<xsd:schema
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.1"
- >
- <xsd:element name="object-persistence" type="object-persistence" />
- <xsd:complexType name="object-persistence">
- <xsd:annotation>
- <xsd:documentation>An object-persistence mapping module, a set of class-mapping-descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>A name for the model being mapped.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-mapping-descriptors">
- <xsd:annotation>
- <xsd:documentation>The list of class mapping descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-mapping-descriptor" type="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="login" type="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="default-temporal-mutable" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines the default for how Date and Calendar types are used with change tracking.</xsd:documentation>
- <xsd:documentation>By default they are assumed not to be changed directly (only replaced).</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute default="Eclipse Persistence Services - 1.1 (Build YYMMDD)" name="version" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="platform-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the platform class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="user-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource user-name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="password" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource password, this is stored in encrypted form.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-connection-pooling" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the connections are managed by the datasource driver, and a new connection should be acquire per call.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-transaction-controller" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the transaction are managed by a transaction manager, and should not be managed by TopLink.</xsd:documentation>
- <xsd:documentation>This can also be used if the datasource does not support transactions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing">
- <xsd:annotation>
- <xsd:documentation>Sequencing information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-sequence" type="sequence">
- <xsd:annotation>
- <xsd:documentation>Default sequence. The name is optional. If no name provided an empty string will be used as a name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequences">
- <xsd:annotation>
- <xsd:documentation>Non default sequences. Make sure each sequence has unique name.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="sequence" type="sequence" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>The JDBC driver and database connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="driver-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the JDBC driver class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full JDBC driver connection URL.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if parameter binding should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cache-all-statements" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if statement caching should be used. This should be used with parameter binding, this cannot be used with external connection pooling.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="byte-array-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if byte array data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="string-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="256" name="string-binding-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Configure the threshold string size for usage of string binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="streams-for-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if large byte array and string data-types should be bound as streams.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="force-field-names-to-upper-case" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure to force all field names to upper-case.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="optimize-data-conversion" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure data optimization.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="trim-strings" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string trailing blanks should be trimmed. This is normally required for CHAR data-types.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="jdbc-batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If using batch writing, configure if the JDBC drivers batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>The JCA driver and EIS connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="connection-spec-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the TopLink platform specific connection spec class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-factory-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The JNDI url for the managed JCA adapter's connection factory.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>The connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true"
- name="equal-namespace-resolvers" type="xsd:boolean" />
- <xsd:element name="document-preservation-policy"
- type="document-preservation-policy" maxOccurs="1"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- <xsd:documentation>This is an abstract definition to allow flexibility in the types of classes and datastores persisted, i.e. interfaces, abstract classes, aggregates, non-relational persistence.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the implementation class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.implementation.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="alias" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally an alias name can be given for the class. The alias is a string that can be used to refer to the class in place of its implementation name, such as in querying.</xsd:documentation>
- <xsd:documentation>Example: <alias xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">Employee</alias></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="primary-key">
- <xsd:annotation>
- <xsd:documentation>The list of fields/columns that make up the primary key or unique identifier of the class.</xsd:documentation>
- <xsd:documentation>This is used for caching, relationships, and for database operations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary key field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the class is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="inheritance" type="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="events" type="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="querying" type="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries for the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-mappings">
- <xsd:annotation>
- <xsd:documentation>The list of mappings that define how the class' attributes are persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="attribute-mapping" type="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="descriptor-type" type="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the descriptor type, such as aggregate or independent.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="interfaces" type="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the interfaces that this class implements..</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="locking" type="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the locking behavior for the class. Such as an optimistic locking policy based on version, timestamp or change set of columns.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing" type="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="remote-caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached on remote clients.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="returning-policy" type="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="amendment" type="amendment">
- <xsd:annotation>
- <xsd:documentation>Allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="instantiation" type="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="copying" type="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-keys">
- <xsd:annotation>
- <xsd:documentation>A list of query keys or aliases for database information. These can be used in queries instead of the database column names.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query-key" type="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="cmp-policy" type="cmp-policy">
- <xsd:annotation>
- <xsd:documentation>Place holder of CMP information specific.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-groups" type="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups at the descriptor level</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="change-policy" type="change-policy">
- <xsd:annotation>
- <xsd:documentation>Contains the Change Policy for this descriptor</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute fixed="10" name="schema-major-version" type="xsd:integer" />
- <xsd:attribute fixed="0" name="schema-minor-version" type="xsd:integer" />
- </xsd:complexType>
- <xsd:simpleType name="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the class descriptor type.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="independent" />
- <xsd:enumeration value="aggregate" />
- <xsd:enumeration value="aggregate-collection" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="interface" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Specify the interfaces that a class descriptor implements, or the implemention class for an interface descriptor.</xsd:documentation>
- <xsd:documentation>Optionally a set of public interfaces for the class can be specified. This allows the interface to be used to refer to the implementation class.</xsd:documentation>
- <xsd:documentation>If two classes implement the same interface, an interface descriptor should be defined for the interface.</xsd:documentation>
- <xsd:documentation>This can also be used to define inheritance between interface descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="interface" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified interface class name.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.api.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="implementor-descriptor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the implementation class for which this interface is the public interface.</xsd:documentation>
- <xsd:documentation>This can be used if the interface has only a single implementor.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.impl.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Creates a copying through creating a new instance to copy into.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized through a clone method.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the clone method on the object, i.e. 'clone'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method on the factory to instantiate the object instance.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified factory class name.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method to instantiate the factory class.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="amendment">
- <xsd:annotation>
- <xsd:documentation>Specifies a class and static method to be called to allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="amendment-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation> The fully qualified name of the amendment class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="amendment-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the static amendment method on the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a relational database table(s).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="tables">
- <xsd:annotation>
- <xsd:documentation>The list of the tables the class is persisted to. Typically a class is persisted to a single table, but multiple tables can be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="table" type="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-keys-for-multiple-table" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>Allow the foreign key field references to be define for multiple table descriptors.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="multiple-table-join-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For complex multiple table join conditions an expression may be provided instead of the table foreign key information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="version-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on a numeric version field/column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="version-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="store-version-in-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the version value should be stored in the cache, or if it will be stored in the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="timestamp-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on timestamp version column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="version-locking-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="server-time" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the timestamp should be obtained locally or from the database server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="all-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of all fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="changed-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of only the changed fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="selected-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of a specified set of fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="fields">
- <xsd:annotation>
- <xsd:documentation>Specify the set of fields to compare on update and delete.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a database generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="sequence-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the name of the sequence generator. This could be the name of a sequence object, or a row value in a sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequence-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the field/column that the generated sequence id is assigned to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid caching types.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="full" />
- <xsd:enumeration value="cache" />
- <xsd:enumeration value="weak-reference" />
- <xsd:enumeration value="soft-reference" />
- <xsd:enumeration value="soft-cache-weak-reference" />
- <xsd:enumeration value="hard-cache-weak-reference" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached and how object identity should be maintained.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="soft-cache-weak-reference" name="cache-type" type="cache-type">
- <xsd:annotation>
- <xsd:documentation>Specify the type of caching, such as LRU, weak reference or none.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="cache-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specify the initial or maximum size of the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always refresh cached objects on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="only-refresh-cache-if-newer-version" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to refresh if the cached object is an older version.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="disable-cache-hits" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Disable obtaining cache hits on primary key queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-conform" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always conform queries within a transaction.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="isolated" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects of this type should be isolated from the shared cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="isolate-new-data-after-transaction" name="unitofwork-isolation-level" type="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work should be isolated to the session cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="change-set" name="cache-sync-type" type="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to be used with this descripor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="cache-invalidation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Abstract superclass for cache invalidation policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="update-read-time-on-update" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="no-expiry-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects in the cache do not expire.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="time-to-live-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects live a specific number of milliseconds after they are read.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="time-to-live" type="xsd:long" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="daily-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation Policy where objects expire at a specific time every day</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="expiry-time" type="xsd:dateTime" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are to be persisted to the data-store.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="handle-writes" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="use-database-time" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="history-tables">
- <xsd:annotation>
- <xsd:documentation>Defines the names of the mirroring historical tables.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="history-table" type="history-table" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="start-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the start fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="start-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="end-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the end fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="end-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="history-table">
- <xsd:annotation>
- <xsd:documentation>Each entry is a source (descriptor) to history table name association.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="source" type="xsd:string" />
- <xsd:element minOccurs="1" name="history" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="1" name="returning-field-infos">
- <xsd:annotation>
- <xsd:documentation>Lists the fields to be returned together with the flags defining returning options</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="returning-field-info" type="returning-field-info" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-field-info">
- <xsd:annotation>
- <xsd:documentation>Field to be returned together with type and the flags defining returning options. At least one of insert, update should be true.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field to be returned.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert-mode-return-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If insert==true, indicates whether the field should not be inserted (true). If insert==false - ignored.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="update" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="parent-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the parent/superclass of the class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="read-subclasses-on-queries" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define if subclasses of the class should be returned on queries, or only the exact class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-view" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify the name of a view that joins all of the subclass' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-class-name-as-indicator" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the fully qualified class name should be used as the class type indicator.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extraction-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a method on the class that takes the class' row as argument a computed that class type to be used to instantiate from the row.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name of the type field/column that the class type is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extractor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a class that implements a class extractor interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="only-instances-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out all sibling and subclass instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out sibling instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="qname-inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Extends inheritance policy. Allows for prefixed names to be resolved at runtime to find the approriate class</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="inheritance-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-indicator-mapping">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the class the type maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="class-indicator" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The field value used to define the class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="event-listeners">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="event-listener" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of an event listener class that implements the descriptor event listener interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-build-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after building the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-clone-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after cloning the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-merge-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after merging the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-refresh-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after refreshing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries and query properties for the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="queries">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="query">
- <xsd:annotation>
- <xsd:documentation>A query definition for the class' instances.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to apply to all queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="check-cache" name="existence" type="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the behavoir used to determine if an insert or update should occur for an object to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom insert query. This overide the default insert behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="update-query" type="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom update query. This overide the default update behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom delete query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="does-exist-query" type="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Custom does exist query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-object-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom read object query. This overide the default read behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-all-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Custom read all query. This overide the default read all behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence policies for determining if an insert or update should occur for an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query-key alias name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:simpleType name="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to use with a descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="invalidation" />
- <xsd:enumeration value="no-changes" />
- <xsd:enumeration value="change-set-with-new-objects" />
- <xsd:enumeration value="change-set" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work isolated from the session cache.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="use-session-cache-after-transaction" />
- <xsd:enumeration value="isolate-new-data-after-transaction" />
- <xsd:enumeration value="isolate-cache-after-transaction" />
- <xsd:enumeration value="isolate-cache-always" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="direct-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column being aliased.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-query-key" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key join condition between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The join criteria between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-1 join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-m join from another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the field/column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="null-value" type="xsd:anySimpleType" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a value that null data values should be converted to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="converter" type="value-converter" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-classification" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute. This is the implementation class attribute name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the attribute is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="get-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the get method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="set-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the set method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a simple attribute is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-direct-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-transformation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a field transformation for a transformation mapping</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="method-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="method" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformer-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="transformer-class" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a transformation mapping that uses Java code to transform between the data and object values.</xsd:documentation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute transformation defined in the domain class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-transformer" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The class name of the attribute transformer. Used in place of attribute-transformation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="mutable" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy" />
- <xsd:element minOccurs="0" name="field-transformations">
- <xsd:annotation>
- <xsd:documentation>The field transformations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-transformation" type="field-transformation" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a relationship where the target object is strictly privately owned by the source object and stores within the source objects row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="allow-null" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if a row of all nulls should be interpreted as null.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-translations">
- <xsd:annotation>
- <xsd:documentation>Allow for the mapping to use different field names than the descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-translation">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source descriptor's table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the aggregate descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a relationship between two classes is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="private-owned" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the target objects are privately owned dependent objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-persist" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-merge" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the refresh operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-remove" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the remove operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the source class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="one-to-one-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="target-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-grouping-element" type="field" />
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of simple types relationship from the source instance to a set of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the reference table that stores the source primary key and the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="direct-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that stores the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the reference table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="session-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name session that defines the reference table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a map relationship from the source instance to a set of key values pairs of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-collection-mapping">
- <xsd:sequence>
- <xsd:element name="direct-key-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that sores the map key data value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="key-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the key data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances where the target instances are strictly privately owned by the source object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="many-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a m-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="relation-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the relation table that stores the source/target primary keys.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="source-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the target class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="variable-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance that may be of several types related through an interface.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="type-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the column to store the class type of the related object into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="foreign-key-to-query-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target column/query key references relating a foreign key in one table to the query keys defining a primary or unique key value in the other interface descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="query-key-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target interface descriptor query key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-query-key" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query key name of the target interface descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a container/collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection implementation class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="sorted-collection-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a sorted collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="comparator-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the comparitor, used to compare objects in sorting the collection.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="list-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a list collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a direct map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="scrollable-cursor-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a scrollable cursor container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="cursored-stream-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a cursored stream container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indirection-policy" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a deferred read indirection mechanism.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="value-holder-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of value holders to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="proxy-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of proxies to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transparent-collection-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of transparent collections to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection interface to use, i.e. List, Set, Map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of a user defined container to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element name="container-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the container implementer to use.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="typesafe-enumeration-converter">
- <xsd:annotation>
- <xsd:documentation>Typesafe Enumeration conversion</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-conversion-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies the data type and an object type of the attribute to convert between.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attribute type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="data-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="serialized-object-converter">
- <xsd:annotation>
- <xsd:documentation>Uses object serialization to convert between the object and data type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="data-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of values from database values used in the field and object values used in the attribute.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>An optional default value can be specified. This value is used if a database type is not found in the type mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies the mapping of values. Both the object and database values must be unique.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-only-type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of additional values that map non-unique data values to a unique attribute value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Define an object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="object-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the object's attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="data-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the database field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query/interaction against a database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="maintain-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should bypass the cache completely.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should use paramater binding for arguments, or print the arguments in-line.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-statement" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries statement should be cached, this must be used with parameter binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to cancel the query in if the request takes too long to complete.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="prepare" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should prepare and cache its generated SQL, or regenerate the SQL on each execution.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="call" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For static calls the SQL or Stored Procedure call definition can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid join fetch options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="inner-join" />
- <xsd:enumeration value="outer-join" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid cascade policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="private" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="value-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a single value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a collection of values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="data-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading raw data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="cache-query-results" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should cache the query results to avoid future executions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="max-rows" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies the maximum number of rows to fetch, results will be trunctate on the database to this size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="first-result" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies where to start the cursor in a result set returned from the database. Results prior to this number will not be built into objects</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifiess the number of rows to fetch from the database on each result set next operation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-result-cache-policy" type="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Specify how the query results should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a query's results should be cached.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="maximum-cached-results" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>This defines the number of query result sets that will be cached. The LRU query results will be discarded when the max size is reached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for manipulating data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-modify-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for modifying an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for updating an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for inserting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for determining if an object exists.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="existence-check" type="existence-check">
- <xsd:annotation>
- <xsd:documentation>The existence check option.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="existence-check">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence check options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting a criteria of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for objects (as apposed to data).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full qualified name of the class of objects being queried.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any cached objects from the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="remote-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any remotely cached objects from the server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="cascade-policy" type="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries settings (such as refresh, maintain-cache) should apply to the object's relationship queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="primary-key" name="cache-usage" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how the query should interact with the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="lock-mode" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should lock the resulting rows on the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="distinct-state" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should filter distinct results.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="in-memory-querying">
- <xsd:annotation>
- <xsd:documentation>The in memory querying policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element default="ignore-exceptions-return-conformed" name="policy" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how indirection or unconformable expressions should be treating with in-memory querying and conforming.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="use-default-fetch-group" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the default fetch group should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group" type="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify a pre-defined named fetch group to allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-exclusive-connection" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the exclusive connection (VPD) should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="joined-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies the attributes being joined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for joining</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects resulting from the query are read-only, and will not be registered in the unit of work.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a set of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="batch-read-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies all attributes for batch reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for batch reading</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="order-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets the order expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for ordering</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a single object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="report-query">
- <xsd:annotation>
- <xsd:documentation>Query for information about a set of objects instead of the objects themselves.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-all-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="return-choice" type="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="retrieve-primary-keys" type="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="report-items">
- <xsd:annotation>
- <xsd:documentation>Items to be selected, these could be attributes or aggregate functions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="item" type="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="group-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets GROUP BY expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for grouping</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="return-single-result" />
- <xsd:enumeration value="return-single-value" />
- <xsd:enumeration value="return-single-attribute" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="full-primary-key" />
- <xsd:enumeration value="first-primary-key" />
- <xsd:enumeration value="no-primary-key" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested in ReportQuery.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Name given for item, can be used to retieve value from result.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Expression (partial) that describes the attribute wanted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="expression" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query filter expression tree.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relation-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a relation expression that compares to expressions through operators such as equal, lessThan, etc..</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logic-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of two sub-expressions joined through an operator such as AND, OR.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="function-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of a function applied to a list of sub-expressions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of function arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="expression">
- <xsd:annotation>
- <xsd:documentation>Defines an argument expression.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="function" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="constant-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression value. If the value is null the value tag can is absent.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-key-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression query-key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="any-of" type="xsd:boolean" />
- <xsd:attribute name="outer-join" type="xsd:boolean" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression field.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="parameter-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression parameter.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="parameter" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="base-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression builder/base.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="operator">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid operators.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:complexType name="sql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an SQL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="sql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full SQL query string. Arguments can be specified through #arg-name tokens in the string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="ejbql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an EJB-QL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="ejbql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The EJB-QL query string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cursor-output-procedure" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define the call to use a cursor output parameter to define the result set.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure. The order of the arguments must match the procedure arguments if not named.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-function-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored function invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="stored-procedure-call">
- <xsd:sequence>
- <xsd:element minOccurs="1" name="stored-function-result" type="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>The return value of the stored-function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="procedure-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The stored procedure name of the argument. For indexed argument the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the argument class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype" type="xsd:int">
- <xsd:annotation>
- <xsd:documentation>The JDBC int type of the argument, as defined in java.jdbc.Types</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the type if procedure-argument-sqltype is STRUCT or ARRAY</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-inoutput-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument">
- <xsd:sequence>
- <xsd:element name="output-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition whose arguments contain at least one Oracle PL/SQL type that has no JDBC representation (e.g. BOOLEAN, PLS_INTEGER, PL/SQL record).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-procedure-argument-type" abstract="true">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element minOccurs="0" name="index" type="xsd:string" />
- <xsd:element minOccurs="0" name="direction" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="jdbc-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:choice>
- <xsd:element minOccurs="0" name="length" type="xsd:string" />
- <xsd:sequence>
- <xsd:element name="precision" type="xsd:string" />
- <xsd:element name="scale" type="xsd:string" />
- </xsd:sequence>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-record">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="fields">
- <xsd:annotation>
- <xsd:documentation>The list of fields.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-collection">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="nested-type" type="plsql-procedure-argument-type" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an EIS record data structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element name="datatype" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the record structure name the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="mapped-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing MappedRecord.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing XML records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-record-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name to use for the input record, if required by the adapter.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-root-element-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indexed-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing Indexed records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="interaction-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an interaction argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The interaction name of the argument. For indexed arguments the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argumen. This is the name of the argument as define in the query, or the descriptor field name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="object-relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a Structure type in an object-relational database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relational-class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the object structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-order">
- <xsd:annotation>
- <xsd:documentation>The ordered list of the field defined in the structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="nested-table-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m/m-m relationship that makes use of the object-relational nested-table type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the source table that stores the nested-table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the nested-table type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of primitive/simple type values using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of object-types using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="structure-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a structure of object-types using the object-relational structure type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a reference to another object-type using the object-relational reference type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source type that stores the reference.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-relational-field">
- <xsd:annotation>
- <xsd:documentation>Defines an ObjectRelationalDatabaseField</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="nested-type-field" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-xml-type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct mapping to an Oracle XDB XML Type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="read-whole-document" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a user defined converter class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-collection-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-M relationship from the source XML element to the target XML element based on a key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-object-reference-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="containerpolicy" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="uses-single-node" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-object-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source XML element to the target XML element based on one or more keys.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="aggregate-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-to-target-key-field-association" type="foreign-key" />
- <xsd:element minOccurs="0" name="source-to-target-key-fields">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an XML element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="default-root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the element the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="default-root-element-field" type="node">
- <xsd:annotation>
- <xsd:documentation>The XMLField representing the default root element of the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="should-preserve-document" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if nodes should be cached to preserve unmapped data</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="schema" type="schema-reference">
- <xsd:annotation>
- <xsd:documentation>The location of the XML Schema.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single object to an xs:any declaration</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single Node to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection of Nodes to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="container-policy" type="container-policy" />
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-field-to-class-association">
- <xsd:sequence>
- <xsd:element name="xml-field" type="node" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="xml-conversion-pair">
- <xsd:sequence>
- <xsd:element name="qname" type="xsd:string" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="node">
- <xsd:annotation>
- <xsd:documentation>Defines an XPath expression to an element or attribute in an XML document.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="position" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>The position of the node in the parent type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" name="leaf-element-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Indicates the elements type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="union-node">
- <xsd:annotation>
- <xsd:documentation>Use to represent nodes which are mapped to unions</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="namespace-resolver">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="namespaces">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="namespace" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="default-namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="namespace">
- <xsd:sequence>
- <xsd:element name="prefix" type="xsd:string" />
- <xsd:element name="namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-reference">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="resource" type="xsd:string" />
- <xsd:element name="schema-context" type="xsd:string" />
- <xsd:element name="node-type" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-class-path-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-file-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-url-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="java-character">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="java-timestamp">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:simpleType name="java-util-date">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:complexType name="cmp-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="pessimistic-locking" type="pessimistic-locking">
- <xsd:annotation>
- <xsd:documentation>Defines the cmp bean-level pessimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="defer-until-commit" type="defer-until-commit">
- <xsd:annotation>
- <xsd:documentation>Defines modification deferral level for non-deferred writes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="non-deferred-create-time" type="non-deferred-create-time">
- <xsd:annotation>
- <xsd:documentation>Defines point at which insert will be issued to Database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="pessimistic-locking">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="wait" name="locking-mode" type="locking-mode" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="defer-until-commit">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all-modifications" />
- <xsd:enumeration value="update-modifications" />
- <xsd:enumeration value="none" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="non-deferred-create-time">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="after-ejbcreate" />
- <xsd:enumeration value="after-ejbpostcreate" />
- <xsd:enumeration value="undefined" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="locking-mode">
- <xsd:annotation>
- <xsd:documentation>Holds the pessimistic locking mode.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="wait" />
- <xsd:enumeration value="no-wait" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Sequence name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="50" name="preallocation-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Sequence preallocation size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>References default sequence object, overriding its name and (optionally) preallocation size.</xsd:documentation>
- <xsd:documentation>To use preallocation size of default sequence object, set preallocation size to 0</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>Database sequence mechanism used.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>Unary table sequence - sequence name is a table name, table has a single field and a single row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-fetch-group" type="fetch-group" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group" type="fetch-group" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Contains the fetch group attributes info.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string" />
- <xsd:element name="fetch-group-attributes">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>Contains a fetch group's attribute list.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group-attribute" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="change-policy">
- <xsd:annotation>
- <xsd:documentation>Describes the change tracking policy for this descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="deferred-detection-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses backup clone to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses "mark dirty" to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses a ChangeTracker firing PropertyChangeEvent's to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-null-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the Null Policy in use for this relationship currently a choice of [NullPolicy and IsSetNullPolicy].</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="xsi-nil-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="empty-node-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-representation-for-xml" type="marshal-null-representation" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="is-set-performed-for-absent-node" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="is-set-null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-set-method-name" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter-type" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="marshal-null-representation">
- <xsd:annotation>
- <xsd:documentation>Write null, no tag(default) or an empty tag.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="XSI_NIL" />
- <xsd:enumeration value="ABSENT_NODE" />
- <xsd:enumeration value="EMPTY_NODE" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="field">
- <xsd:annotation>
- <xsd:documentation>Defines a generic field concept, such as a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the field.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>Defines a column in a relational database table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:attribute name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the column's table. This table must be listed in the class' tables. If not specified the first table of the class will be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target field/column references relating a foreign key in one table to the primary or unique key in another table.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target table primary key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary or unique key field/column name in the target table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query">
- <xsd:annotation>
- <xsd:documentation>Defines a query specification for querying instances of the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The selection criteria of the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of query arguments. The order of the argument must match the order of the argument value passed to the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="query-argument">
- <xsd:annotation>
- <xsd:documentation>The query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query. This name can be used to reference and execute the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="criteria">
- <xsd:annotation>
- <xsd:documentation>Defines the filtering clause of a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="query-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a query argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class type name of the argument may be provided.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Optional constant value for the argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:anyType" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the table. The name can be fully qualified with the schema, tablespace or link.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="value-converter">
- <xsd:annotation>
- <xsd:documentation>
- Specifies how the data value should be converted to the
- object value.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy"></xsd:complexType>
-
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.2.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.2.xsd
deleted file mode 100644
index 22a56967a2..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_1.2.xsd
+++ /dev/null
@@ -1,4253 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-<!-- Eclipse Persistence Service Project :: Map Schema file for ORM/OXM/EIS -->
-<xsd:schema
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.2"
- >
- <xsd:element name="object-persistence" type="object-persistence" />
- <xsd:complexType name="object-persistence">
- <xsd:annotation>
- <xsd:documentation>An object-persistence mapping module, a set of class-mapping-descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>A name for the model being mapped.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-mapping-descriptors">
- <xsd:annotation>
- <xsd:documentation>The list of class mapping descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-mapping-descriptor" type="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="login" type="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="default-temporal-mutable" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines the default for how Date and Calendar types are used with change tracking.</xsd:documentation>
- <xsd:documentation>By default they are assumed not to be changed directly (only replaced).</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="queries">
- <xsd:annotation>
- <xsd:documentation>A list of queries to be stored on the session.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="database-query">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute default="Eclipse Persistence Services - 1.1 (Build YYMMDD)" name="version" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="platform-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the platform class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="user-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource user-name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="password" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource password, this is stored in encrypted form.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-connection-pooling" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the connections are managed by the datasource driver, and a new connection should be acquire per call.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-transaction-controller" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the transaction are managed by a transaction manager, and should not be managed by TopLink.</xsd:documentation>
- <xsd:documentation>This can also be used if the datasource does not support transactions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing">
- <xsd:annotation>
- <xsd:documentation>Sequencing information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-sequence" type="sequence">
- <xsd:annotation>
- <xsd:documentation>Default sequence. The name is optional. If no name provided an empty string will be used as a name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequences">
- <xsd:annotation>
- <xsd:documentation>Non default sequences. Make sure each sequence has unique name.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="sequence" type="sequence" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>The JDBC driver and database connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="driver-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the JDBC driver class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full JDBC driver connection URL.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if parameter binding should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cache-all-statements" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if statement caching should be used. This should be used with parameter binding, this cannot be used with external connection pooling.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="byte-array-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if byte array data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="string-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="256" name="string-binding-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Configure the threshold string size for usage of string binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="streams-for-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if large byte array and string data-types should be bound as streams.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="force-field-names-to-upper-case" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure to force all field names to upper-case.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="optimize-data-conversion" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure data optimization.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="trim-strings" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string trailing blanks should be trimmed. This is normally required for CHAR data-types.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="jdbc-batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If using batch writing, configure if the JDBC drivers batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>The JCA driver and EIS connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="connection-spec-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the TopLink platform specific connection spec class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-factory-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The JNDI url for the managed JCA adapter's connection factory.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>The connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true"
- name="equal-namespace-resolvers" type="xsd:boolean" />
- <xsd:element name="document-preservation-policy"
- type="document-preservation-policy" maxOccurs="1"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- <xsd:documentation>This is an abstract definition to allow flexibility in the types of classes and datastores persisted, i.e. interfaces, abstract classes, aggregates, non-relational persistence.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the implementation class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.implementation.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="alias" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally an alias name can be given for the class. The alias is a string that can be used to refer to the class in place of its implementation name, such as in querying.</xsd:documentation>
- <xsd:documentation>Example: <alias xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">Employee</alias></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="primary-key">
- <xsd:annotation>
- <xsd:documentation>The list of fields/columns that make up the primary key or unique identifier of the class.</xsd:documentation>
- <xsd:documentation>This is used for caching, relationships, and for database operations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary key field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the class is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="inheritance" type="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="events" type="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="querying" type="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries for the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-mappings">
- <xsd:annotation>
- <xsd:documentation>The list of mappings that define how the class' attributes are persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="attribute-mapping" type="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="descriptor-type" type="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the descriptor type, such as aggregate or independent.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="interfaces" type="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the interfaces that this class implements..</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="locking" type="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the locking behavior for the class. Such as an optimistic locking policy based on version, timestamp or change set of columns.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing" type="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="remote-caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached on remote clients.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="returning-policy" type="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="amendment" type="amendment">
- <xsd:annotation>
- <xsd:documentation>Allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="instantiation" type="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="copying" type="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-keys">
- <xsd:annotation>
- <xsd:documentation>A list of query keys or aliases for database information. These can be used in queries instead of the database column names.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query-key" type="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="cmp-policy" type="cmp-policy">
- <xsd:annotation>
- <xsd:documentation>Place holder of CMP information specific.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-groups" type="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups at the descriptor level</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="change-policy" type="change-policy">
- <xsd:annotation>
- <xsd:documentation>Contains the Change Policy for this descriptor</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute fixed="10" name="schema-major-version" type="xsd:integer" />
- <xsd:attribute fixed="0" name="schema-minor-version" type="xsd:integer" />
- </xsd:complexType>
- <xsd:simpleType name="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the class descriptor type.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="independent" />
- <xsd:enumeration value="aggregate" />
- <xsd:enumeration value="aggregate-collection" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="interface" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Specify the interfaces that a class descriptor implements, or the implemention class for an interface descriptor.</xsd:documentation>
- <xsd:documentation>Optionally a set of public interfaces for the class can be specified. This allows the interface to be used to refer to the implementation class.</xsd:documentation>
- <xsd:documentation>If two classes implement the same interface, an interface descriptor should be defined for the interface.</xsd:documentation>
- <xsd:documentation>This can also be used to define inheritance between interface descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="interface" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified interface class name.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.api.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="implementor-descriptor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the implementation class for which this interface is the public interface.</xsd:documentation>
- <xsd:documentation>This can be used if the interface has only a single implementor.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.impl.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Creates a copying through creating a new instance to copy into.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized through a clone method.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the clone method on the object, i.e. 'clone'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method on the factory to instantiate the object instance.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified factory class name.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method to instantiate the factory class.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="amendment">
- <xsd:annotation>
- <xsd:documentation>Specifies a class and static method to be called to allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="amendment-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation> The fully qualified name of the amendment class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="amendment-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the static amendment method on the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a relational database table(s).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="tables">
- <xsd:annotation>
- <xsd:documentation>The list of the tables the class is persisted to. Typically a class is persisted to a single table, but multiple tables can be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="table" type="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-keys-for-multiple-table" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>Allow the foreign key field references to be define for multiple table descriptors.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="multiple-table-join-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For complex multiple table join conditions an expression may be provided instead of the table foreign key information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="version-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on a numeric version field/column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="version-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="store-version-in-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the version value should be stored in the cache, or if it will be stored in the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="timestamp-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on timestamp version column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="version-locking-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="server-time" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the timestamp should be obtained locally or from the database server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="all-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of all fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="changed-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of only the changed fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="selected-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of a specified set of fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="fields">
- <xsd:annotation>
- <xsd:documentation>Specify the set of fields to compare on update and delete.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a database generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="sequence-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the name of the sequence generator. This could be the name of a sequence object, or a row value in a sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequence-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the field/column that the generated sequence id is assigned to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid caching types.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="full" />
- <xsd:enumeration value="cache" />
- <xsd:enumeration value="weak-reference" />
- <xsd:enumeration value="soft-reference" />
- <xsd:enumeration value="soft-cache-weak-reference" />
- <xsd:enumeration value="hard-cache-weak-reference" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached and how object identity should be maintained.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="soft-cache-weak-reference" name="cache-type" type="cache-type">
- <xsd:annotation>
- <xsd:documentation>Specify the type of caching, such as LRU, weak reference or none.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="cache-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specify the initial or maximum size of the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always refresh cached objects on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="only-refresh-cache-if-newer-version" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to refresh if the cached object is an older version.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="disable-cache-hits" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Disable obtaining cache hits on primary key queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-conform" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always conform queries within a transaction.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="isolated" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects of this type should be isolated from the shared cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="isolate-new-data-after-transaction" name="unitofwork-isolation-level" type="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work should be isolated to the session cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="change-set" name="cache-sync-type" type="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to be used with this descripor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="cache-invalidation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Abstract superclass for cache invalidation policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="update-read-time-on-update" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="no-expiry-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects in the cache do not expire.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="time-to-live-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects live a specific number of milliseconds after they are read.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="time-to-live" type="xsd:long" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="daily-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation Policy where objects expire at a specific time every day</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="expiry-time" type="xsd:dateTime" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are to be persisted to the data-store.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="handle-writes" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="use-database-time" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="history-tables">
- <xsd:annotation>
- <xsd:documentation>Defines the names of the mirroring historical tables.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="history-table" type="history-table" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="start-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the start fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="start-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="end-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the end fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="end-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="history-table">
- <xsd:annotation>
- <xsd:documentation>Each entry is a source (descriptor) to history table name association.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="source" type="xsd:string" />
- <xsd:element minOccurs="1" name="history" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="1" name="returning-field-infos">
- <xsd:annotation>
- <xsd:documentation>Lists the fields to be returned together with the flags defining returning options</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="returning-field-info" type="returning-field-info" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-field-info">
- <xsd:annotation>
- <xsd:documentation>Field to be returned together with type and the flags defining returning options. At least one of insert, update should be true.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field to be returned.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert-mode-return-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If insert==true, indicates whether the field should not be inserted (true). If insert==false - ignored.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="update" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="parent-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the parent/superclass of the class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="read-subclasses-on-queries" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define if subclasses of the class should be returned on queries, or only the exact class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-view" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify the name of a view that joins all of the subclass' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-class-name-as-indicator" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the fully qualified class name should be used as the class type indicator.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extraction-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a method on the class that takes the class' row as argument a computed that class type to be used to instantiate from the row.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name of the type field/column that the class type is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extractor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a class that implements a class extractor interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="only-instances-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out all sibling and subclass instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out sibling instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="qname-inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Extends inheritance policy. Allows for prefixed names to be resolved at runtime to find the approriate class</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="inheritance-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-indicator-mapping">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the class the type maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="class-indicator" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The field value used to define the class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="event-listeners">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="event-listener" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of an event listener class that implements the descriptor event listener interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-build-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after building the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-clone-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after cloning the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-merge-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after merging the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-refresh-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after refreshing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries and query properties for the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="queries">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="query">
- <xsd:annotation>
- <xsd:documentation>A query definition for the class' instances.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to apply to all queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="check-cache" name="existence" type="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the behavoir used to determine if an insert or update should occur for an object to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom insert query. This overide the default insert behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="update-query" type="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom update query. This overide the default update behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom delete query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="does-exist-query" type="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Custom does exist query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-object-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom read object query. This overide the default read behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-all-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Custom read all query. This overide the default read all behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence policies for determining if an insert or update should occur for an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query-key alias name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:simpleType name="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to use with a descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="invalidation" />
- <xsd:enumeration value="no-changes" />
- <xsd:enumeration value="change-set-with-new-objects" />
- <xsd:enumeration value="change-set" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work isolated from the session cache.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="use-session-cache-after-transaction" />
- <xsd:enumeration value="isolate-new-data-after-transaction" />
- <xsd:enumeration value="isolate-cache-after-transaction" />
- <xsd:enumeration value="isolate-cache-always" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="direct-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column being aliased.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-query-key" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key join condition between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The join criteria between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-1 join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-m join from another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the field/column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="null-value" type="xsd:anySimpleType" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a value that null data values should be converted to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="converter" type="value-converter" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-classification" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute. This is the implementation class attribute name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the attribute is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="get-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the get method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="set-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the set method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a simple attribute is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-direct-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-transformation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a field transformation for a transformation mapping</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="method-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="method" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformer-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="transformer-class" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a transformation mapping that uses Java code to transform between the data and object values.</xsd:documentation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute transformation defined in the domain class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-transformer" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The class name of the attribute transformer. Used in place of attribute-transformation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="mutable" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy" />
- <xsd:element minOccurs="0" name="field-transformations">
- <xsd:annotation>
- <xsd:documentation>The field transformations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-transformation" type="field-transformation" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a relationship where the target object is strictly privately owned by the source object and stores within the source objects row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="allow-null" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if a row of all nulls should be interpreted as null.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-translations">
- <xsd:annotation>
- <xsd:documentation>Allow for the mapping to use different field names than the descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-translation">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source descriptor's table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the aggregate descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a relationship between two classes is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="private-owned" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the target objects are privately owned dependent objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-persist" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-merge" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the refresh operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-remove" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the remove operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the source class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="one-to-one-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="target-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-grouping-element" type="field" />
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of simple types relationship from the source instance to a set of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the reference table that stores the source primary key and the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="direct-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that stores the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the reference table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="session-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name session that defines the reference table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a map relationship from the source instance to a set of key values pairs of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-collection-mapping">
- <xsd:sequence>
- <xsd:element name="direct-key-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that sores the map key data value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="key-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the key data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances where the target instances are strictly privately owned by the source object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="many-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a m-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="relation-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the relation table that stores the source/target primary keys.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="source-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the target class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="variable-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance that may be of several types related through an interface.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="type-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the column to store the class type of the related object into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="foreign-key-to-query-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target column/query key references relating a foreign key in one table to the query keys defining a primary or unique key value in the other interface descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="query-key-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target interface descriptor query key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-query-key" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query key name of the target interface descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a container/collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection implementation class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="sorted-collection-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a sorted collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="comparator-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the comparitor, used to compare objects in sorting the collection.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="list-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a list collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a direct map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="scrollable-cursor-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a scrollable cursor container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="cursored-stream-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a cursored stream container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indirection-policy" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a deferred read indirection mechanism.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="value-holder-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of value holders to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="proxy-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of proxies to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transparent-collection-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of transparent collections to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection interface to use, i.e. List, Set, Map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of a user defined container to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element name="container-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the container implementer to use.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-list-converter">
- <xsd:annotation>
- <xsd:documentation>List converter</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the list's element type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="typesafe-enumeration-converter">
- <xsd:annotation>
- <xsd:documentation>Typesafe Enumeration conversion</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-conversion-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies the data type and an object type of the attribute to convert between.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attribute type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="data-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="serialized-object-converter">
- <xsd:annotation>
- <xsd:documentation>Uses object serialization to convert between the object and data type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="data-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of values from database values used in the field and object values used in the attribute.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>An optional default value can be specified. This value is used if a database type is not found in the type mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies the mapping of values. Both the object and database values must be unique.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-only-type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of additional values that map non-unique data values to a unique attribute value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Define an object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="object-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the object's attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="data-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the database field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query/interaction against a database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="maintain-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should bypass the cache completely.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should use paramater binding for arguments, or print the arguments in-line.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-statement" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries statement should be cached, this must be used with parameter binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to cancel the query in if the request takes too long to complete.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="prepare" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should prepare and cache its generated SQL, or regenerate the SQL on each execution.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="call" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For static calls the SQL or Stored Procedure call definition can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid join fetch options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="inner-join" />
- <xsd:enumeration value="outer-join" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid cascade policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="private" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="value-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a single value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a collection of values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="data-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading raw data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="cache-query-results" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should cache the query results to avoid future executions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="max-rows" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies the maximum number of rows to fetch, results will be trunctate on the database to this size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="first-result" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies where to start the cursor in a result set returned from the database. Results prior to this number will not be built into objects</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifiess the number of rows to fetch from the database on each result set next operation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-result-cache-policy" type="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Specify how the query results should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a query's results should be cached.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="maximum-cached-results" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>This defines the number of query result sets that will be cached. The LRU query results will be discarded when the max size is reached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for manipulating data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-modify-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for modifying an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for updating an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for inserting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for determining if an object exists.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="existence-check" type="existence-check">
- <xsd:annotation>
- <xsd:documentation>The existence check option.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="existence-check">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence check options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting a criteria of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for objects (as apposed to data).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full qualified name of the class of objects being queried.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any cached objects from the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="remote-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any remotely cached objects from the server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="cascade-policy" type="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries settings (such as refresh, maintain-cache) should apply to the object's relationship queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="primary-key" name="cache-usage" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how the query should interact with the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="lock-mode" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should lock the resulting rows on the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="distinct-state" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should filter distinct results.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="in-memory-querying">
- <xsd:annotation>
- <xsd:documentation>The in memory querying policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element default="ignore-exceptions-return-conformed" name="policy" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how indirection or unconformable expressions should be treating with in-memory querying and conforming.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="use-default-fetch-group" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the default fetch group should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group" type="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify a pre-defined named fetch group to allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-exclusive-connection" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the exclusive connection (VPD) should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="joined-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies the attributes being joined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for joining</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects resulting from the query are read-only, and will not be registered in the unit of work.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a set of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="batch-read-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies all attributes for batch reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for batch reading</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="order-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets the order expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for ordering</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a single object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="report-query">
- <xsd:annotation>
- <xsd:documentation>Query for information about a set of objects instead of the objects themselves.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-all-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="return-choice" type="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="retrieve-primary-keys" type="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="report-items">
- <xsd:annotation>
- <xsd:documentation>Items to be selected, these could be attributes or aggregate functions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="item" type="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="group-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets GROUP BY expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for grouping</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="return-single-result" />
- <xsd:enumeration value="return-single-value" />
- <xsd:enumeration value="return-single-attribute" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="full-primary-key" />
- <xsd:enumeration value="first-primary-key" />
- <xsd:enumeration value="no-primary-key" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested in ReportQuery.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Name given for item, can be used to retieve value from result.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Expression (partial) that describes the attribute wanted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="expression" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query filter expression tree.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relation-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a relation expression that compares to expressions through operators such as equal, lessThan, etc..</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logic-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of two sub-expressions joined through an operator such as AND, OR.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="function-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of a function applied to a list of sub-expressions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of function arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="expression">
- <xsd:annotation>
- <xsd:documentation>Defines an argument expression.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="function" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="constant-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression value. If the value is null the value tag can is absent.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-key-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression query-key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="any-of" type="xsd:boolean" />
- <xsd:attribute name="outer-join" type="xsd:boolean" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression field.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="parameter-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression parameter.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="parameter" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="base-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression builder/base.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="operator">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid operators.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:complexType name="sql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an SQL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="sql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full SQL query string. Arguments can be specified through #arg-name tokens in the string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="ejbql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an EJB-QL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="ejbql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The EJB-QL query string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cursor-output-procedure" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define the call to use a cursor output parameter to define the result set.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure. The order of the arguments must match the procedure arguments if not named.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-function-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored function invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="stored-procedure-call">
- <xsd:sequence>
- <xsd:element minOccurs="1" name="stored-function-result" type="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>The return value of the stored-function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="procedure-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The stored procedure name of the argument. For indexed argument the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the argument class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype" type="xsd:int">
- <xsd:annotation>
- <xsd:documentation>The JDBC int type of the argument, as defined in java.jdbc.Types</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the type if procedure-argument-sqltype is STRUCT or ARRAY</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-inoutput-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument">
- <xsd:sequence>
- <xsd:element name="output-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition whose arguments contain at least one Oracle PL/SQL type that has no JDBC representation (e.g. BOOLEAN, PLS_INTEGER, PL/SQL record).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-procedure-argument-type" abstract="true">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element minOccurs="0" name="index" type="xsd:string" />
- <xsd:element minOccurs="0" name="direction" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="jdbc-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:choice>
- <xsd:element minOccurs="0" name="length" type="xsd:string" />
- <xsd:sequence>
- <xsd:element name="precision" type="xsd:string" />
- <xsd:element name="scale" type="xsd:string" />
- </xsd:sequence>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-record">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="fields">
- <xsd:annotation>
- <xsd:documentation>The list of fields.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-collection">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="nested-type" type="plsql-procedure-argument-type" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an EIS record data structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element name="datatype" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the record structure name the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="mapped-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing MappedRecord.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing XML records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-record-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name to use for the input record, if required by the adapter.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-root-element-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indexed-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing Indexed records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="interaction-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an interaction argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The interaction name of the argument. For indexed arguments the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argumen. This is the name of the argument as define in the query, or the descriptor field name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="object-relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a Structure type in an object-relational database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relational-class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the object structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-order">
- <xsd:annotation>
- <xsd:documentation>The ordered list of the field defined in the structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="nested-table-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m/m-m relationship that makes use of the object-relational nested-table type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the source table that stores the nested-table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the nested-table type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of primitive/simple type values using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of object-types using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="structure-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a structure of object-types using the object-relational structure type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a reference to another object-type using the object-relational reference type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source type that stores the reference.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-relational-field">
- <xsd:annotation>
- <xsd:documentation>Defines an ObjectRelationalDatabaseField</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="nested-type-field" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-xml-type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct mapping to an Oracle XDB XML Type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="read-whole-document" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a user defined converter class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-collection-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-M relationship from the source XML element to the target XML element based on a key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-object-reference-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="containerpolicy" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="uses-single-node" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-object-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source XML element to the target XML element based on one or more keys.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="aggregate-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-to-target-key-field-association" type="foreign-key" />
- <xsd:element minOccurs="0" name="source-to-target-key-fields">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- <xsd:element name="keep-as-element-policy" type="xsd:string" minOccurs="0"/>
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an XML element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="default-root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the element the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="default-root-element-field" type="node">
- <xsd:annotation>
- <xsd:documentation>The XMLField representing the default root element of the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="should-preserve-document" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if nodes should be cached to preserve unmapped data</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="schema" type="schema-reference">
- <xsd:annotation>
- <xsd:documentation>The location of the XML Schema.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="result-always-xml-root" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" name="include-namespace-declaration" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="include-schema-instance" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single object to an xs:any declaration</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single Node to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection of Nodes to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="container-policy" type="container-policy" />
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-field-to-class-association">
- <xsd:sequence>
- <xsd:element name="xml-field" type="node" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="xml-conversion-pair">
- <xsd:sequence>
- <xsd:element name="qname" type="xsd:string" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="node">
- <xsd:annotation>
- <xsd:documentation>Defines an XPath expression to an element or attribute in an XML document.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="position" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>The position of the node in the parent type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" name="leaf-element-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Indicates the elements type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="is-required" type="xsd:boolean"/>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="union-node">
- <xsd:annotation>
- <xsd:documentation>Use to represent nodes which are mapped to unions</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="namespace-resolver">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="namespaces">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="namespace" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="default-namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="namespace">
- <xsd:sequence>
- <xsd:element name="prefix" type="xsd:string" />
- <xsd:element name="namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-reference">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="resource" type="xsd:string" />
- <xsd:element name="schema-context" type="xsd:string" />
- <xsd:element name="node-type" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-class-path-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-file-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-url-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="java-character">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="java-timestamp">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:simpleType name="java-util-date">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:complexType name="cmp-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="pessimistic-locking" type="pessimistic-locking">
- <xsd:annotation>
- <xsd:documentation>Defines the cmp bean-level pessimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="defer-until-commit" type="defer-until-commit">
- <xsd:annotation>
- <xsd:documentation>Defines modification deferral level for non-deferred writes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="non-deferred-create-time" type="non-deferred-create-time">
- <xsd:annotation>
- <xsd:documentation>Defines point at which insert will be issued to Database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="pessimistic-locking">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="wait" name="locking-mode" type="locking-mode" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="defer-until-commit">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all-modifications" />
- <xsd:enumeration value="update-modifications" />
- <xsd:enumeration value="none" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="non-deferred-create-time">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="after-ejbcreate" />
- <xsd:enumeration value="after-ejbpostcreate" />
- <xsd:enumeration value="undefined" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="locking-mode">
- <xsd:annotation>
- <xsd:documentation>Holds the pessimistic locking mode.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="wait" />
- <xsd:enumeration value="no-wait" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Sequence name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="50" name="preallocation-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Sequence preallocation size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>References default sequence object, overriding its name and (optionally) preallocation size.</xsd:documentation>
- <xsd:documentation>To use preallocation size of default sequence object, set preallocation size to 0</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>Database sequence mechanism used.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>Unary table sequence - sequence name is a table name, table has a single field and a single row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-fetch-group" type="fetch-group" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group" type="fetch-group" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Contains the fetch group attributes info.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string" />
- <xsd:element name="fetch-group-attributes">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>Contains a fetch group's attribute list.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group-attribute" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="change-policy">
- <xsd:annotation>
- <xsd:documentation>Describes the change tracking policy for this descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="deferred-detection-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses backup clone to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses "mark dirty" to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses a ChangeTracker firing PropertyChangeEvent's to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-null-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the Null Policy in use for this relationship currently a choice of [NullPolicy and IsSetNullPolicy].</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="xsi-nil-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="empty-node-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-representation-for-xml" type="marshal-null-representation" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="is-set-performed-for-absent-node" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="is-set-null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-set-method-name" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter-type" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="marshal-null-representation">
- <xsd:annotation>
- <xsd:documentation>Write null, no tag(default) or an empty tag.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="XSI_NIL" />
- <xsd:enumeration value="ABSENT_NODE" />
- <xsd:enumeration value="EMPTY_NODE" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="field">
- <xsd:annotation>
- <xsd:documentation>Defines a generic field concept, such as a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the field.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>Defines a column in a relational database table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:attribute name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the column's table. This table must be listed in the class' tables. If not specified the first table of the class will be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="sql-typecode" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>(optional field) The JDBC typecode of this column</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="column-definition" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>(optional field) Name of the JDBC typecode for this column</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target field/column references relating a foreign key in one table to the primary or unique key in another table.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target table primary key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary or unique key field/column name in the target table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query">
- <xsd:annotation>
- <xsd:documentation>Defines a query specification for querying instances of the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The selection criteria of the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of query arguments. The order of the argument must match the order of the argument value passed to the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="query-argument">
- <xsd:annotation>
- <xsd:documentation>The query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query. This name can be used to reference and execute the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="criteria">
- <xsd:annotation>
- <xsd:documentation>Defines the filtering clause of a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="query-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a query argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class type name of the argument may be provided.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Optional constant value for the argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:anyType" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the table. The name can be fully qualified with the schema, tablespace or link.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="value-converter">
- <xsd:annotation>
- <xsd:documentation>
- Specifies how the data value should be converted to the
- object value.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy"></xsd:complexType>
-
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.0.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.0.xsd
deleted file mode 100644
index a93b9ea08e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.0.xsd
+++ /dev/null
@@ -1,4253 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-<!-- Eclipse Persistence Service Project :: Map Schema file for ORM/OXM/EIS -->
-<xsd:schema
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.0"
- >
- <xsd:element name="object-persistence" type="object-persistence" />
- <xsd:complexType name="object-persistence">
- <xsd:annotation>
- <xsd:documentation>An object-persistence mapping module, a set of class-mapping-descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>A name for the model being mapped.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-mapping-descriptors">
- <xsd:annotation>
- <xsd:documentation>The list of class mapping descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-mapping-descriptor" type="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="login" type="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="default-temporal-mutable" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines the default for how Date and Calendar types are used with change tracking.</xsd:documentation>
- <xsd:documentation>By default they are assumed not to be changed directly (only replaced).</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="queries">
- <xsd:annotation>
- <xsd:documentation>A list of queries to be stored on the session.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="database-query">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute default="Eclipse Persistence Services - 2.0 (Build YYMMDD)" name="version" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="platform-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the platform class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="user-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource user-name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="password" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource password, this is stored in encrypted form.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-connection-pooling" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the connections are managed by the datasource driver, and a new connection should be acquire per call.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-transaction-controller" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the transaction are managed by a transaction manager, and should not be managed by TopLink.</xsd:documentation>
- <xsd:documentation>This can also be used if the datasource does not support transactions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing">
- <xsd:annotation>
- <xsd:documentation>Sequencing information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-sequence" type="sequence">
- <xsd:annotation>
- <xsd:documentation>Default sequence. The name is optional. If no name provided an empty string will be used as a name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequences">
- <xsd:annotation>
- <xsd:documentation>Non default sequences. Make sure each sequence has unique name.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="sequence" type="sequence" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>The JDBC driver and database connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="driver-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the JDBC driver class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full JDBC driver connection URL.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if parameter binding should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cache-all-statements" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if statement caching should be used. This should be used with parameter binding, this cannot be used with external connection pooling.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="byte-array-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if byte array data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="string-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="256" name="string-binding-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Configure the threshold string size for usage of string binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="streams-for-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if large byte array and string data-types should be bound as streams.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="force-field-names-to-upper-case" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure to force all field names to upper-case.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="optimize-data-conversion" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure data optimization.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="trim-strings" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string trailing blanks should be trimmed. This is normally required for CHAR data-types.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="jdbc-batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If using batch writing, configure if the JDBC drivers batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>The JCA driver and EIS connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="connection-spec-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the TopLink platform specific connection spec class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-factory-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The JNDI url for the managed JCA adapter's connection factory.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>The connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true"
- name="equal-namespace-resolvers" type="xsd:boolean" />
- <xsd:element name="document-preservation-policy"
- type="document-preservation-policy" maxOccurs="1"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- <xsd:documentation>This is an abstract definition to allow flexibility in the types of classes and datastores persisted, i.e. interfaces, abstract classes, aggregates, non-relational persistence.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the implementation class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.implementation.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="alias" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally an alias name can be given for the class. The alias is a string that can be used to refer to the class in place of its implementation name, such as in querying.</xsd:documentation>
- <xsd:documentation>Example: <alias xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">Employee</alias></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="primary-key">
- <xsd:annotation>
- <xsd:documentation>The list of fields/columns that make up the primary key or unique identifier of the class.</xsd:documentation>
- <xsd:documentation>This is used for caching, relationships, and for database operations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary key field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the class is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="inheritance" type="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="events" type="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="querying" type="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries for the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-mappings">
- <xsd:annotation>
- <xsd:documentation>The list of mappings that define how the class' attributes are persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="attribute-mapping" type="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="descriptor-type" type="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the descriptor type, such as aggregate or independent.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="interfaces" type="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the interfaces that this class implements..</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="locking" type="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the locking behavior for the class. Such as an optimistic locking policy based on version, timestamp or change set of columns.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing" type="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="remote-caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached on remote clients.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="returning-policy" type="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="amendment" type="amendment">
- <xsd:annotation>
- <xsd:documentation>Allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="instantiation" type="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="copying" type="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-keys">
- <xsd:annotation>
- <xsd:documentation>A list of query keys or aliases for database information. These can be used in queries instead of the database column names.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query-key" type="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="cmp-policy" type="cmp-policy">
- <xsd:annotation>
- <xsd:documentation>Place holder of CMP information specific.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-groups" type="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups at the descriptor level</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="change-policy" type="change-policy">
- <xsd:annotation>
- <xsd:documentation>Contains the Change Policy for this descriptor</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute fixed="10" name="schema-major-version" type="xsd:integer" />
- <xsd:attribute fixed="0" name="schema-minor-version" type="xsd:integer" />
- </xsd:complexType>
- <xsd:simpleType name="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the class descriptor type.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="independent" />
- <xsd:enumeration value="aggregate" />
- <xsd:enumeration value="aggregate-collection" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="interface" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Specify the interfaces that a class descriptor implements, or the implemention class for an interface descriptor.</xsd:documentation>
- <xsd:documentation>Optionally a set of public interfaces for the class can be specified. This allows the interface to be used to refer to the implementation class.</xsd:documentation>
- <xsd:documentation>If two classes implement the same interface, an interface descriptor should be defined for the interface.</xsd:documentation>
- <xsd:documentation>This can also be used to define inheritance between interface descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="interface" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified interface class name.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.api.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="implementor-descriptor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the implementation class for which this interface is the public interface.</xsd:documentation>
- <xsd:documentation>This can be used if the interface has only a single implementor.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.impl.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Creates a copying through creating a new instance to copy into.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized through a clone method.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the clone method on the object, i.e. 'clone'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method on the factory to instantiate the object instance.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified factory class name.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method to instantiate the factory class.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="amendment">
- <xsd:annotation>
- <xsd:documentation>Specifies a class and static method to be called to allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="amendment-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation> The fully qualified name of the amendment class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="amendment-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the static amendment method on the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a relational database table(s).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="tables">
- <xsd:annotation>
- <xsd:documentation>The list of the tables the class is persisted to. Typically a class is persisted to a single table, but multiple tables can be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="table" type="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-keys-for-multiple-table" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>Allow the foreign key field references to be define for multiple table descriptors.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="multiple-table-join-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For complex multiple table join conditions an expression may be provided instead of the table foreign key information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="version-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on a numeric version field/column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="version-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="store-version-in-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the version value should be stored in the cache, or if it will be stored in the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="timestamp-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on timestamp version column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="version-locking-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="server-time" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the timestamp should be obtained locally or from the database server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="all-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of all fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="changed-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of only the changed fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="selected-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of a specified set of fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="fields">
- <xsd:annotation>
- <xsd:documentation>Specify the set of fields to compare on update and delete.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a database generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="sequence-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the name of the sequence generator. This could be the name of a sequence object, or a row value in a sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequence-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the field/column that the generated sequence id is assigned to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid caching types.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="full" />
- <xsd:enumeration value="cache" />
- <xsd:enumeration value="weak-reference" />
- <xsd:enumeration value="soft-reference" />
- <xsd:enumeration value="soft-cache-weak-reference" />
- <xsd:enumeration value="hard-cache-weak-reference" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached and how object identity should be maintained.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="soft-cache-weak-reference" name="cache-type" type="cache-type">
- <xsd:annotation>
- <xsd:documentation>Specify the type of caching, such as LRU, weak reference or none.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="cache-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specify the initial or maximum size of the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always refresh cached objects on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="only-refresh-cache-if-newer-version" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to refresh if the cached object is an older version.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="disable-cache-hits" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Disable obtaining cache hits on primary key queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-conform" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always conform queries within a transaction.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="isolated" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects of this type should be isolated from the shared cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="isolate-new-data-after-transaction" name="unitofwork-isolation-level" type="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work should be isolated to the session cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="change-set" name="cache-sync-type" type="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to be used with this descripor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="cache-invalidation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Abstract superclass for cache invalidation policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="update-read-time-on-update" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="no-expiry-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects in the cache do not expire.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="time-to-live-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects live a specific number of milliseconds after they are read.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="time-to-live" type="xsd:long" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="daily-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation Policy where objects expire at a specific time every day</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="expiry-time" type="xsd:dateTime" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are to be persisted to the data-store.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="handle-writes" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="use-database-time" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="history-tables">
- <xsd:annotation>
- <xsd:documentation>Defines the names of the mirroring historical tables.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="history-table" type="history-table" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="start-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the start fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="start-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="end-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the end fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="end-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="history-table">
- <xsd:annotation>
- <xsd:documentation>Each entry is a source (descriptor) to history table name association.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="source" type="xsd:string" />
- <xsd:element minOccurs="1" name="history" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="1" name="returning-field-infos">
- <xsd:annotation>
- <xsd:documentation>Lists the fields to be returned together with the flags defining returning options</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="returning-field-info" type="returning-field-info" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-field-info">
- <xsd:annotation>
- <xsd:documentation>Field to be returned together with type and the flags defining returning options. At least one of insert, update should be true.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field to be returned.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert-mode-return-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If insert==true, indicates whether the field should not be inserted (true). If insert==false - ignored.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="update" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="parent-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the parent/superclass of the class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="read-subclasses-on-queries" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define if subclasses of the class should be returned on queries, or only the exact class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-view" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify the name of a view that joins all of the subclass' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-class-name-as-indicator" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the fully qualified class name should be used as the class type indicator.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extraction-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a method on the class that takes the class' row as argument a computed that class type to be used to instantiate from the row.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name of the type field/column that the class type is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extractor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a class that implements a class extractor interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="only-instances-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out all sibling and subclass instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out sibling instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="qname-inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Extends inheritance policy. Allows for prefixed names to be resolved at runtime to find the approriate class</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="inheritance-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-indicator-mapping">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the class the type maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="class-indicator" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The field value used to define the class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="event-listeners">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="event-listener" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of an event listener class that implements the descriptor event listener interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-build-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after building the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-clone-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after cloning the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-merge-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after merging the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-refresh-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after refreshing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries and query properties for the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="queries">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="query">
- <xsd:annotation>
- <xsd:documentation>A query definition for the class' instances.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to apply to all queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="check-cache" name="existence" type="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the behavoir used to determine if an insert or update should occur for an object to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom insert query. This overide the default insert behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="update-query" type="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom update query. This overide the default update behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom delete query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="does-exist-query" type="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Custom does exist query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-object-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom read object query. This overide the default read behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-all-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Custom read all query. This overide the default read all behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence policies for determining if an insert or update should occur for an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query-key alias name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:simpleType name="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to use with a descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="invalidation" />
- <xsd:enumeration value="no-changes" />
- <xsd:enumeration value="change-set-with-new-objects" />
- <xsd:enumeration value="change-set" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work isolated from the session cache.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="use-session-cache-after-transaction" />
- <xsd:enumeration value="isolate-new-data-after-transaction" />
- <xsd:enumeration value="isolate-cache-after-transaction" />
- <xsd:enumeration value="isolate-cache-always" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="direct-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column being aliased.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-query-key" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key join condition between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The join criteria between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-1 join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-m join from another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the field/column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="null-value" type="xsd:anySimpleType" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a value that null data values should be converted to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="converter" type="value-converter" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-classification" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute. This is the implementation class attribute name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the attribute is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="get-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the get method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="set-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the set method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a simple attribute is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-direct-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-transformation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a field transformation for a transformation mapping</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="method-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="method" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformer-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="transformer-class" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a transformation mapping that uses Java code to transform between the data and object values.</xsd:documentation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute transformation defined in the domain class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-transformer" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The class name of the attribute transformer. Used in place of attribute-transformation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="mutable" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy" />
- <xsd:element minOccurs="0" name="field-transformations">
- <xsd:annotation>
- <xsd:documentation>The field transformations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-transformation" type="field-transformation" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a relationship where the target object is strictly privately owned by the source object and stores within the source objects row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="allow-null" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if a row of all nulls should be interpreted as null.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-translations">
- <xsd:annotation>
- <xsd:documentation>Allow for the mapping to use different field names than the descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-translation">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source descriptor's table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the aggregate descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a relationship between two classes is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="private-owned" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the target objects are privately owned dependent objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-persist" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-merge" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the refresh operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-remove" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the remove operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the source class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="one-to-one-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="target-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-grouping-element" type="field" />
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of simple types relationship from the source instance to a set of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the reference table that stores the source primary key and the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="direct-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that stores the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the reference table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="session-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name session that defines the reference table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a map relationship from the source instance to a set of key values pairs of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-collection-mapping">
- <xsd:sequence>
- <xsd:element name="direct-key-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that sores the map key data value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="key-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the key data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances where the target instances are strictly privately owned by the source object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="many-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a m-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="relation-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the relation table that stores the source/target primary keys.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="source-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the target class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="variable-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance that may be of several types related through an interface.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="type-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the column to store the class type of the related object into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="foreign-key-to-query-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target column/query key references relating a foreign key in one table to the query keys defining a primary or unique key value in the other interface descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="query-key-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target interface descriptor query key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-query-key" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query key name of the target interface descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a container/collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection implementation class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="sorted-collection-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a sorted collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="comparator-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the comparitor, used to compare objects in sorting the collection.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="list-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a list collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a direct map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="scrollable-cursor-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a scrollable cursor container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="cursored-stream-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a cursored stream container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indirection-policy" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a deferred read indirection mechanism.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="value-holder-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of value holders to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="proxy-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of proxies to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transparent-collection-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of transparent collections to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection interface to use, i.e. List, Set, Map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of a user defined container to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element name="container-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the container implementer to use.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-list-converter">
- <xsd:annotation>
- <xsd:documentation>List converter</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the list's element type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="typesafe-enumeration-converter">
- <xsd:annotation>
- <xsd:documentation>Typesafe Enumeration conversion</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-conversion-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies the data type and an object type of the attribute to convert between.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attribute type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="data-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="serialized-object-converter">
- <xsd:annotation>
- <xsd:documentation>Uses object serialization to convert between the object and data type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="data-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of values from database values used in the field and object values used in the attribute.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>An optional default value can be specified. This value is used if a database type is not found in the type mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies the mapping of values. Both the object and database values must be unique.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-only-type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of additional values that map non-unique data values to a unique attribute value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Define an object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="object-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the object's attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="data-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the database field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query/interaction against a database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="maintain-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should bypass the cache completely.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should use paramater binding for arguments, or print the arguments in-line.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-statement" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries statement should be cached, this must be used with parameter binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to cancel the query in if the request takes too long to complete.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="prepare" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should prepare and cache its generated SQL, or regenerate the SQL on each execution.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="call" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For static calls the SQL or Stored Procedure call definition can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid join fetch options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="inner-join" />
- <xsd:enumeration value="outer-join" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid cascade policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="private" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="value-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a single value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a collection of values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="data-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading raw data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="cache-query-results" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should cache the query results to avoid future executions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="max-rows" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies the maximum number of rows to fetch, results will be trunctate on the database to this size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="first-result" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies where to start the cursor in a result set returned from the database. Results prior to this number will not be built into objects</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifiess the number of rows to fetch from the database on each result set next operation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-result-cache-policy" type="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Specify how the query results should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a query's results should be cached.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="maximum-cached-results" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>This defines the number of query result sets that will be cached. The LRU query results will be discarded when the max size is reached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for manipulating data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-modify-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for modifying an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for updating an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for inserting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for determining if an object exists.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="existence-check" type="existence-check">
- <xsd:annotation>
- <xsd:documentation>The existence check option.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="existence-check">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence check options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting a criteria of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for objects (as apposed to data).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full qualified name of the class of objects being queried.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any cached objects from the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="remote-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any remotely cached objects from the server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="cascade-policy" type="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries settings (such as refresh, maintain-cache) should apply to the object's relationship queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="primary-key" name="cache-usage" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how the query should interact with the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="lock-mode" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should lock the resulting rows on the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="distinct-state" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should filter distinct results.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="in-memory-querying">
- <xsd:annotation>
- <xsd:documentation>The in memory querying policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element default="ignore-exceptions-return-conformed" name="policy" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how indirection or unconformable expressions should be treating with in-memory querying and conforming.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="use-default-fetch-group" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the default fetch group should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group" type="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify a pre-defined named fetch group to allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-exclusive-connection" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the exclusive connection (VPD) should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="joined-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies the attributes being joined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for joining</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects resulting from the query are read-only, and will not be registered in the unit of work.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a set of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="batch-read-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies all attributes for batch reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for batch reading</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="order-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets the order expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for ordering</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a single object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="report-query">
- <xsd:annotation>
- <xsd:documentation>Query for information about a set of objects instead of the objects themselves.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-all-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="return-choice" type="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="retrieve-primary-keys" type="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="report-items">
- <xsd:annotation>
- <xsd:documentation>Items to be selected, these could be attributes or aggregate functions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="item" type="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="group-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets GROUP BY expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for grouping</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="return-single-result" />
- <xsd:enumeration value="return-single-value" />
- <xsd:enumeration value="return-single-attribute" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="full-primary-key" />
- <xsd:enumeration value="first-primary-key" />
- <xsd:enumeration value="no-primary-key" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested in ReportQuery.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Name given for item, can be used to retieve value from result.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Expression (partial) that describes the attribute wanted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="expression" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query filter expression tree.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relation-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a relation expression that compares to expressions through operators such as equal, lessThan, etc..</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logic-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of two sub-expressions joined through an operator such as AND, OR.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="function-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of a function applied to a list of sub-expressions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of function arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="expression">
- <xsd:annotation>
- <xsd:documentation>Defines an argument expression.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="function" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="constant-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression value. If the value is null the value tag can is absent.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-key-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression query-key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="any-of" type="xsd:boolean" />
- <xsd:attribute name="outer-join" type="xsd:boolean" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression field.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="parameter-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression parameter.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="parameter" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="base-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression builder/base.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="operator">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid operators.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:complexType name="sql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an SQL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="sql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full SQL query string. Arguments can be specified through #arg-name tokens in the string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="ejbql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an EJB-QL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="ejbql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The EJB-QL query string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cursor-output-procedure" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define the call to use a cursor output parameter to define the result set.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure. The order of the arguments must match the procedure arguments if not named.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-function-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored function invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="stored-procedure-call">
- <xsd:sequence>
- <xsd:element minOccurs="1" name="stored-function-result" type="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>The return value of the stored-function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="procedure-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The stored procedure name of the argument. For indexed argument the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the argument class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype" type="xsd:int">
- <xsd:annotation>
- <xsd:documentation>The JDBC int type of the argument, as defined in java.jdbc.Types</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the type if procedure-argument-sqltype is STRUCT or ARRAY</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-inoutput-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument">
- <xsd:sequence>
- <xsd:element name="output-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition whose arguments contain at least one Oracle PL/SQL type that has no JDBC representation (e.g. BOOLEAN, PLS_INTEGER, PL/SQL record).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-procedure-argument-type" abstract="true">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element minOccurs="0" name="index" type="xsd:string" />
- <xsd:element minOccurs="0" name="direction" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="jdbc-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:choice>
- <xsd:element minOccurs="0" name="length" type="xsd:string" />
- <xsd:sequence>
- <xsd:element name="precision" type="xsd:string" />
- <xsd:element name="scale" type="xsd:string" />
- </xsd:sequence>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-record">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="fields">
- <xsd:annotation>
- <xsd:documentation>The list of fields.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-collection">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="nested-type" type="plsql-procedure-argument-type" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an EIS record data structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element name="datatype" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the record structure name the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="mapped-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing MappedRecord.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing XML records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-record-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name to use for the input record, if required by the adapter.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-root-element-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indexed-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing Indexed records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="interaction-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an interaction argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The interaction name of the argument. For indexed arguments the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argumen. This is the name of the argument as define in the query, or the descriptor field name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="object-relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a Structure type in an object-relational database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relational-class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the object structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-order">
- <xsd:annotation>
- <xsd:documentation>The ordered list of the field defined in the structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="nested-table-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m/m-m relationship that makes use of the object-relational nested-table type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the source table that stores the nested-table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the nested-table type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of primitive/simple type values using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of object-types using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="structure-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a structure of object-types using the object-relational structure type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a reference to another object-type using the object-relational reference type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source type that stores the reference.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-relational-field">
- <xsd:annotation>
- <xsd:documentation>Defines an ObjectRelationalDatabaseField</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="nested-type-field" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-xml-type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct mapping to an Oracle XDB XML Type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="read-whole-document" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a user defined converter class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-collection-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-M relationship from the source XML element to the target XML element based on a key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-object-reference-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="containerpolicy" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="uses-single-node" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-object-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source XML element to the target XML element based on one or more keys.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="aggregate-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-to-target-key-field-association" type="foreign-key" />
- <xsd:element minOccurs="0" name="source-to-target-key-fields">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- <xsd:element name="keep-as-element-policy" type="xsd:string" minOccurs="0"/>
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an XML element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="default-root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the element the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="default-root-element-field" type="node">
- <xsd:annotation>
- <xsd:documentation>The XMLField representing the default root element of the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="should-preserve-document" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if nodes should be cached to preserve unmapped data</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="schema" type="schema-reference">
- <xsd:annotation>
- <xsd:documentation>The location of the XML Schema.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="result-always-xml-root" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" name="include-namespace-declaration" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="include-schema-instance" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single object to an xs:any declaration</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single Node to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection of Nodes to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="container-policy" type="container-policy" />
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-field-to-class-association">
- <xsd:sequence>
- <xsd:element name="xml-field" type="node" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="xml-conversion-pair">
- <xsd:sequence>
- <xsd:element name="qname" type="xsd:string" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="node">
- <xsd:annotation>
- <xsd:documentation>Defines an XPath expression to an element or attribute in an XML document.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="position" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>The position of the node in the parent type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" name="leaf-element-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Indicates the elements type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="is-required" type="xsd:boolean"/>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="union-node">
- <xsd:annotation>
- <xsd:documentation>Use to represent nodes which are mapped to unions</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="namespace-resolver">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="namespaces">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="namespace" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="default-namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="namespace">
- <xsd:sequence>
- <xsd:element name="prefix" type="xsd:string" />
- <xsd:element name="namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-reference">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="resource" type="xsd:string" />
- <xsd:element name="schema-context" type="xsd:string" />
- <xsd:element name="node-type" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-class-path-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-file-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-url-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="java-character">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="java-timestamp">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:simpleType name="java-util-date">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:complexType name="cmp-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="pessimistic-locking" type="pessimistic-locking">
- <xsd:annotation>
- <xsd:documentation>Defines the cmp bean-level pessimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="defer-until-commit" type="defer-until-commit">
- <xsd:annotation>
- <xsd:documentation>Defines modification deferral level for non-deferred writes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="non-deferred-create-time" type="non-deferred-create-time">
- <xsd:annotation>
- <xsd:documentation>Defines point at which insert will be issued to Database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="pessimistic-locking">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="wait" name="locking-mode" type="locking-mode" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="defer-until-commit">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all-modifications" />
- <xsd:enumeration value="update-modifications" />
- <xsd:enumeration value="none" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="non-deferred-create-time">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="after-ejbcreate" />
- <xsd:enumeration value="after-ejbpostcreate" />
- <xsd:enumeration value="undefined" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="locking-mode">
- <xsd:annotation>
- <xsd:documentation>Holds the pessimistic locking mode.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="wait" />
- <xsd:enumeration value="no-wait" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Sequence name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="50" name="preallocation-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Sequence preallocation size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>References default sequence object, overriding its name and (optionally) preallocation size.</xsd:documentation>
- <xsd:documentation>To use preallocation size of default sequence object, set preallocation size to 0</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>Database sequence mechanism used.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>Unary table sequence - sequence name is a table name, table has a single field and a single row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-fetch-group" type="fetch-group" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group" type="fetch-group" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Contains the fetch group attributes info.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string" />
- <xsd:element name="fetch-group-attributes">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>Contains a fetch group's attribute list.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group-attribute" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="change-policy">
- <xsd:annotation>
- <xsd:documentation>Describes the change tracking policy for this descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="deferred-detection-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses backup clone to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses "mark dirty" to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses a ChangeTracker firing PropertyChangeEvent's to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-null-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the Null Policy in use for this relationship currently a choice of [NullPolicy and IsSetNullPolicy].</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="xsi-nil-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="empty-node-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-representation-for-xml" type="marshal-null-representation" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="is-set-performed-for-absent-node" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="is-set-null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-set-method-name" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter-type" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="marshal-null-representation">
- <xsd:annotation>
- <xsd:documentation>Write null, no tag(default) or an empty tag.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="XSI_NIL" />
- <xsd:enumeration value="ABSENT_NODE" />
- <xsd:enumeration value="EMPTY_NODE" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="field">
- <xsd:annotation>
- <xsd:documentation>Defines a generic field concept, such as a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the field.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>Defines a column in a relational database table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:attribute name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the column's table. This table must be listed in the class' tables. If not specified the first table of the class will be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="sql-typecode" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>(optional field) The JDBC typecode of this column</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="column-definition" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>(optional field) Name of the JDBC typecode for this column</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target field/column references relating a foreign key in one table to the primary or unique key in another table.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target table primary key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary or unique key field/column name in the target table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query">
- <xsd:annotation>
- <xsd:documentation>Defines a query specification for querying instances of the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The selection criteria of the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of query arguments. The order of the argument must match the order of the argument value passed to the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="query-argument">
- <xsd:annotation>
- <xsd:documentation>The query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query. This name can be used to reference and execute the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="criteria">
- <xsd:annotation>
- <xsd:documentation>Defines the filtering clause of a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="query-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a query argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class type name of the argument may be provided.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Optional constant value for the argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:anyType" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the table. The name can be fully qualified with the schema, tablespace or link.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="value-converter">
- <xsd:annotation>
- <xsd:documentation>
- Specifies how the data value should be converted to the
- object value.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy"></xsd:complexType>
-
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.3.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.3.xsd
deleted file mode 100644
index 12a97f0bd7..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_persistence_map_2.3.xsd
+++ /dev/null
@@ -1,4307 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-<!-- Eclipse Persistence Service Project :: Map Schema file for ORM/OXM/EIS -->
-<xsd:schema
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.eclipse.org/eclipselink/xsds/persistence"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="2.3"
- >
- <xsd:element name="object-persistence" type="object-persistence" />
- <xsd:complexType name="object-persistence">
- <xsd:annotation>
- <xsd:documentation>An object-persistence mapping module, a set of class-mapping-descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>A name for the model being mapped.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-mapping-descriptors">
- <xsd:annotation>
- <xsd:documentation>The list of class mapping descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-mapping-descriptor" type="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="login" type="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="default-temporal-mutable" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines the default for how Date and Calendar types are used with change tracking.</xsd:documentation>
- <xsd:documentation>By default they are assumed not to be changed directly (only replaced).</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="queries">
- <xsd:annotation>
- <xsd:documentation>A list of queries to be stored on the session.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="database-query">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute default="Eclipse Persistence Services - 2.0 (Build YYMMDD)" name="version" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="datasource-login">
- <xsd:annotation>
- <xsd:documentation>The datasource connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="platform-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the platform class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="user-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource user-name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="password" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The datasource password, this is stored in encrypted form.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-connection-pooling" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the connections are managed by the datasource driver, and a new connection should be acquire per call.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="external-transaction-controller" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the transaction are managed by a transaction manager, and should not be managed by TopLink.</xsd:documentation>
- <xsd:documentation>This can also be used if the datasource does not support transactions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing">
- <xsd:annotation>
- <xsd:documentation>Sequencing information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-sequence" type="sequence">
- <xsd:annotation>
- <xsd:documentation>Default sequence. The name is optional. If no name provided an empty string will be used as a name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequences">
- <xsd:annotation>
- <xsd:documentation>Non default sequences. Make sure each sequence has unique name.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="sequence" type="sequence" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>The JDBC driver and database connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="driver-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the JDBC driver class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full JDBC driver connection URL.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if parameter binding should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cache-all-statements" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if statement caching should be used. This should be used with parameter binding, this cannot be used with external connection pooling.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="byte-array-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if byte array data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="string-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string data-types should use binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="256" name="string-binding-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Configure the threshold string size for usage of string binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="streams-for-binding" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if large byte array and string data-types should be bound as streams.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="force-field-names-to-upper-case" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure to force all field names to upper-case.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="optimize-data-conversion" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure data optimization.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="trim-strings" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if string trailing blanks should be trimmed. This is normally required for CHAR data-types.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Configure if batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="jdbc-batch-writing" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If using batch writing, configure if the JDBC drivers batch writing should be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>The JCA driver and EIS connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="connection-spec-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the TopLink platform specific connection spec class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="connection-factory-url" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The JNDI url for the managed JCA adapter's connection factory.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>The connection and configuration information.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="datasource-login">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true"
- name="equal-namespace-resolvers" type="xsd:boolean" />
- <xsd:element name="document-preservation-policy"
- type="document-preservation-policy" maxOccurs="1"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Information of how a class is persisted to its data-store.</xsd:documentation>
- <xsd:documentation>This is an abstract definition to allow flexibility in the types of classes and datastores persisted, i.e. interfaces, abstract classes, aggregates, non-relational persistence.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the implementation class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.implementation.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="alias" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally an alias name can be given for the class. The alias is a string that can be used to refer to the class in place of its implementation name, such as in querying.</xsd:documentation>
- <xsd:documentation>Example: <alias xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">Employee</alias></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="primary-key">
- <xsd:annotation>
- <xsd:documentation>The list of fields/columns that make up the primary key or unique identifier of the class.</xsd:documentation>
- <xsd:documentation>This is used for caching, relationships, and for database operations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary key field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the class is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="inheritance" type="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="events" type="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="querying" type="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries for the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-mappings">
- <xsd:annotation>
- <xsd:documentation>The list of mappings that define how the class' attributes are persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="attribute-mapping" type="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="descriptor-type" type="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the descriptor type, such as aggregate or independent.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="interfaces" type="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the interfaces that this class implements..</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="locking" type="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the locking behavior for the class. Such as an optimistic locking policy based on version, timestamp or change set of columns.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="sequencing" type="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="remote-caching" type="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached on remote clients.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="returning-policy" type="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="amendment" type="amendment">
- <xsd:annotation>
- <xsd:documentation>Allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="instantiation" type="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="copying" type="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-keys">
- <xsd:annotation>
- <xsd:documentation>A list of query keys or aliases for database information. These can be used in queries instead of the database column names.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query-key" type="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="cmp-policy" type="cmp-policy">
- <xsd:annotation>
- <xsd:documentation>Place holder of CMP information specific.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-groups" type="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups at the descriptor level</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="change-policy" type="change-policy">
- <xsd:annotation>
- <xsd:documentation>Contains the Change Policy for this descriptor</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute fixed="10" name="schema-major-version" type="xsd:integer" />
- <xsd:attribute fixed="0" name="schema-minor-version" type="xsd:integer" />
- </xsd:complexType>
- <xsd:simpleType name="class-descriptor-type">
- <xsd:annotation>
- <xsd:documentation>Defines the class descriptor type.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="independent" />
- <xsd:enumeration value="aggregate" />
- <xsd:enumeration value="aggregate-collection" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="composite" />
- <xsd:enumeration value="interface" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="interface-policy">
- <xsd:annotation>
- <xsd:documentation>Specify the interfaces that a class descriptor implements, or the implemention class for an interface descriptor.</xsd:documentation>
- <xsd:documentation>Optionally a set of public interfaces for the class can be specified. This allows the interface to be used to refer to the implementation class.</xsd:documentation>
- <xsd:documentation>If two classes implement the same interface, an interface descriptor should be defined for the interface.</xsd:documentation>
- <xsd:documentation>This can also be used to define inheritance between interface descriptors.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="interface" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified interface class name.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.api.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="implementor-descriptor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the implementation class for which this interface is the public interface.</xsd:documentation>
- <xsd:documentation>This can be used if the interface has only a single implementor.</xsd:documentation>
- <xsd:documentation>Example: <class xmlns="http://www.eclipse.org/eclipselink/xsds/persistence">example.employee.impl.Employee</class></xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="instantiation-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Creates a copying through creating a new instance to copy into.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="clone-copy-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object cloning/copying behavoir to be customized through a clone method.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="copy-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the clone method on the object, i.e. 'clone'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="instantiation-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the object instantiation behavoir to be customized.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method on the factory to instantiate the object instance.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified factory class name.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="factory-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the method to instantiate the factory class.'</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="amendment">
- <xsd:annotation>
- <xsd:documentation>Specifies a class and static method to be called to allow for the descriptor to be amended or customized through a class API after loading.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="amendment-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation> The fully qualified name of the amendment class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="amendment-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the static amendment method on the class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a relational database table(s).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="tables">
- <xsd:annotation>
- <xsd:documentation>The list of the tables the class is persisted to. Typically a class is persisted to a single table, but multiple tables can be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="table" type="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-keys-for-multiple-table" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>Allow the foreign key field references to be define for multiple table descriptors.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="multiple-table-join-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For complex multiple table join conditions an expression may be provided instead of the table foreign key information.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="version-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on a numeric version field/column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="version-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="store-version-in-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the version value should be stored in the cache, or if it will be stored in the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="timestamp-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on timestamp version column that tracks changes and the version to an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="version-locking-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="server-time" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the timestamp should be obtained locally or from the database server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="all-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of all fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="changed-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of only the changed fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="selected-fields-locking-policy">
- <xsd:annotation>
- <xsd:documentation>Defines an optimistic locking policy based on comparing the original read values of a specified set of fields of the object with the current state of the values in the database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="locking-policy">
- <xsd:sequence>
- <xsd:element name="fields">
- <xsd:annotation>
- <xsd:documentation>Specify the set of fields to compare on update and delete.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sequencing-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a database generated unique id should be assigned to the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="sequence-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the name of the sequence generator. This could be the name of a sequence object, or a row value in a sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequence-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the field/column that the generated sequence id is assigned to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="cache-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid caching types.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="full" />
- <xsd:enumeration value="cache" />
- <xsd:enumeration value="weak-reference" />
- <xsd:enumeration value="soft-reference" />
- <xsd:enumeration value="soft-cache-weak-reference" />
- <xsd:enumeration value="hard-cache-weak-reference" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="caching-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class' instances should be cached and how object identity should be maintained.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="soft-cache-weak-reference" name="cache-type" type="cache-type">
- <xsd:annotation>
- <xsd:documentation>Specify the type of caching, such as LRU, weak reference or none.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="cache-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specify the initial or maximum size of the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always refresh cached objects on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="only-refresh-cache-if-newer-version" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to refresh if the cached object is an older version.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="disable-cache-hits" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Disable obtaining cache hits on primary key queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="always-conform" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to always conform queries within a transaction.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="isolated" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects of this type should be isolated from the shared cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="isolate-new-data-after-transaction" name="unitofwork-isolation-level" type="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work should be isolated to the session cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="change-set" name="cache-sync-type" type="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to be used with this descripor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="cache-invalidation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Abstract superclass for cache invalidation policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="update-read-time-on-update" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="no-expiry-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects in the cache do not expire.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="time-to-live-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation policy where objects live a specific number of milliseconds after they are read.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="time-to-live" type="xsd:long" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="daily-cache-invalidation-policy">
- <xsd:annotation>
- <xsd:documentation>Cache invalidation Policy where objects expire at a specific time every day</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="cache-invalidation">
- <xsd:sequence>
- <xsd:element name="expiry-time" type="xsd:dateTime" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of objects are to be persisted to the data-store.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="handle-writes" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="use-database-time" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="history-tables">
- <xsd:annotation>
- <xsd:documentation>Defines the names of the mirroring historical tables.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="history-table" type="history-table" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="start-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the start fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="start-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="end-fields">
- <xsd:annotation>
- <xsd:documentation>Defines the end fields for each historical table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="end-field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="history-table">
- <xsd:annotation>
- <xsd:documentation>Each entry is a source (descriptor) to history table name association.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="source" type="xsd:string" />
- <xsd:element minOccurs="1" name="history" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-policy">
- <xsd:annotation>
- <xsd:documentation>Defines retuning policy. By default there will be no returning policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="1" name="returning-field-infos">
- <xsd:annotation>
- <xsd:documentation>Lists the fields to be returned together with the flags defining returning options</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="returning-field-info" type="returning-field-info" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="returning-field-info">
- <xsd:annotation>
- <xsd:documentation>Field to be returned together with type and the flags defining returning options. At least one of insert, update should be true.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field to be returned.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="insert-mode-return-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If insert==true, indicates whether the field should not be inserted (true). If insert==false - ignored.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="update" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates whether the field should be retuned after Insert.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how the class is related in inheritance and how this inheritance is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="parent-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the parent/superclass of the class being persisted. The class name must be full qualified with its package.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="read-subclasses-on-queries" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define if subclasses of the class should be returned on queries, or only the exact class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-view" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify the name of a view that joins all of the subclass' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-class-name-as-indicator" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the fully qualified class name should be used as the class type indicator.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extraction-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a method on the class that takes the class' row as argument a computed that class type to be used to instantiate from the row.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name of the type field/column that the class type is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-extractor" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of a class that implements a class extractor interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="only-instances-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out all sibling and subclass instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="all-subclasses-criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The criteria that filters out sibling instances on queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="qname-inheritance-policy">
- <xsd:annotation>
- <xsd:documentation>Extends inheritance policy. Allows for prefixed names to be resolved at runtime to find the approriate class</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="inheritance-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="class-indicator-mapping">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the class the type maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="class-indicator" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The field value used to define the class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="event-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the persistent events for this class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="event-listeners">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="event-listener" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of an event listener class that implements the descriptor event listener interface.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-build-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after building the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-write-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after writing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="pre-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-delete-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after deleting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-insert-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before inserting the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="about-to-update-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed before updating the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-clone-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after cloning the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-merge-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after merging the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="post-refresh-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Method executed after refreshing the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query-policy">
- <xsd:annotation>
- <xsd:documentation>The list of defined queries and query properties for the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="queries">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="query" type="query">
- <xsd:annotation>
- <xsd:documentation>A query definition for the class' instances.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to apply to all queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="check-cache" name="existence" type="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Allow the behavoir used to determine if an insert or update should occur for an object to be customized.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom insert query. This overide the default insert behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="update-query" type="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom update query. This overide the default update behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom delete query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="does-exist-query" type="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Custom does exist query. This overide the default delete behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-object-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Custom read object query. This overide the default read behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="read-all-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Custom read all query. This overide the default read all behavoir for usage with stored procedures or custom calls.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="existence-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence policies for determining if an insert or update should occur for an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for querying database information.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query-key alias name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:simpleType name="cache-sync-type">
- <xsd:annotation>
- <xsd:documentation>The type of cache synchronization to use with a descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="invalidation" />
- <xsd:enumeration value="no-changes" />
- <xsd:enumeration value="change-set-with-new-objects" />
- <xsd:enumeration value="change-set" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="unitofwork-isolation-level">
- <xsd:annotation>
- <xsd:documentation>Specify how the unit of work isolated from the session cache.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="use-session-cache-after-transaction" />
- <xsd:enumeration value="isolate-new-data-after-transaction" />
- <xsd:enumeration value="isolate-cache-after-transaction" />
- <xsd:enumeration value="isolate-cache-always" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="direct-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column being aliased.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-query-key" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query-key">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the target referenced class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:choice>
- <xsd:element name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key join condition between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The join criteria between the source and target class' tables.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-1 join to another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-query-key">
- <xsd:annotation>
- <xsd:documentation>Defines an alias for a 1-m join from another class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="relationship-query-key" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The name and optionally the table of the field/column that the attribute is stored into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="null-value" type="xsd:anySimpleType" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a value that null data values should be converted to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="converter" type="value-converter" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-classification" type="xsd:string" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a attribute is persisted. The attribute mapping definition is extendable to allow for different types of mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute. This is the implementation class attribute name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the attribute is read-only.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="get-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the get method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="set-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the set method for the attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="properties">
- <xsd:annotation>
- <xsd:documentation>Allow for user defined properties to be defined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="property" type="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a simple attribute is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="abstract-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-direct-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping from an attirbute to a simple field datatype, i.e. String, Number, Date.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-direct-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-transformation" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a field transformation for a transformation mapping</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="method-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="method" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformer-based-field-transformation">
- <xsd:complexContent mixed="false">
- <xsd:extension base="field-transformation">
- <xsd:sequence>
- <xsd:element name="transformer-class" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a transformation mapping that uses Java code to transform between the data and object values.</xsd:documentation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="attribute-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the attribute transformation defined in the domain class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-transformer" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The class name of the attribute transformer. Used in place of attribute-transformation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="mutable" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy" />
- <xsd:element minOccurs="0" name="field-transformations">
- <xsd:annotation>
- <xsd:documentation>The field transformations.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-transformation" type="field-transformation" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-transformation-mapping">
- <xsd:annotation>
- <xsd:documentation>This can be used if a single attribute maps to multiple fields, or field only mappings or attribute only mappings.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-transformation-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a relationship where the target object is strictly privately owned by the source object and stores within the source objects row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="allow-null" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if a row of all nulls should be interpreted as null.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-translations">
- <xsd:annotation>
- <xsd:documentation>Allow for the mapping to use different field names than the descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field-translation">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source descriptor's table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the aggregate descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relationship-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines how a relationship between two classes is persisted.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class name of the target class of the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="private-owned" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the target objects are privately owned dependent objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-persist" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-merge" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the create operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the refresh operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="cascade-remove" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the remove operation should be cascaded to the referenced object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the source class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="one-to-one-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-one-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="target-foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-grouping-element" type="field" />
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of simple types relationship from the source instance to a set of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the reference table that stores the source primary key and the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="direct-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that stores the data values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="reference-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the reference table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the reference table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="session-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name session that defines the reference table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a map relationship from the source instance to a set of key values pairs of simple data values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-collection-mapping">
- <xsd:sequence>
- <xsd:element name="direct-key-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the reference table that sores the map key data value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="key-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the key data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="aggregate-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m relationship from the source instance to the target instances where the target instances are strictly privately owned by the source object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="target-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key in the target class' table that defines the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the related objects can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="many-to-many-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a m-m relationship from the source instance to the target instances.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="relation-table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the relation table that stores the source/target primary keys.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="source-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-relation-foreign-key" type="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The foreign key from the relational table to the target class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="insert-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to insert a row into the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete a row from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="delete-all-query" type="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>A query to delete all of the rows from the relation table can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="history-policy" type="history-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how past versions of this attribute are persisted to the data-store. By default there will be no history policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="join-fetch" type="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Specify to always join the related objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="variable-one-to-one-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source instance to the target instance that may be of several types related through an interface.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="bidirectional-target-attribute" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>For bi-directional relationships the target inverse relationship can be defined.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="batch-reading" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify to optimize reads for the class by batching the reads to this relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="indirection" type="indirection-policy">
- <xsd:annotation>
- <xsd:documentation>The indirection policy to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="selection-query" type="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Specify the query to use to select the target objects.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="type-field" type="field">
- <xsd:annotation>
- <xsd:documentation>Specify the column to store the class type of the related object into.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="foreign-key-fields">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The set of foreign key fields populated by this relationship in the source class' table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="foreign-key-to-query-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target column/query key references relating a foreign key in one table to the query keys defining a primary or unique key value in the other interface descriptor.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="query-key-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target interface descriptor query key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-query-key" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query key name of the target interface descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="class-indicator-mappings" type="class-indicator-mappings">
- <xsd:annotation>
- <xsd:documentation>The set of class indicator values and the subclasses they map to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a container/collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection implementation class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="sorted-collection-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a sorted collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="comparator-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the comparitor, used to compare objects in sorting the collection.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="list-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a list collection type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-map-container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a direct map container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="scrollable-cursor-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a scrollable cursor container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="cursored-stream-policy">
- <xsd:annotation>
- <xsd:documentation>Defines a cursored stream container type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="container-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indirection-policy" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a deferred read indirection mechanism.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="value-holder-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of value holders to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="proxy-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of proxies to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="transparent-collection-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of transparent collections to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="collection-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the collection interface to use, i.e. List, Set, Map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="map-key-method" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the method to call on the target objects to get the key value for the map.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="container-indirection-policy">
- <xsd:annotation>
- <xsd:documentation>Defines usage of a user defined container to implement indirection.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="indirection-policy">
- <xsd:sequence>
- <xsd:element name="container-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the container implementer to use.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-list-converter">
- <xsd:annotation>
- <xsd:documentation>List converter</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the list's element type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="typesafe-enumeration-converter">
- <xsd:annotation>
- <xsd:documentation>Typesafe Enumeration conversion</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-conversion-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies the data type and an object type of the attribute to convert between.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="object-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attribute type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="data-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="serialized-object-converter">
- <xsd:annotation>
- <xsd:documentation>Uses object serialization to convert between the object and data type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="data-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specifies the fully qualified class name of the attributes storage data type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-type-converter">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of values from database values used in the field and object values used in the attribute.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="value-converter">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>An optional default value can be specified. This value is used if a database type is not found in the type mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies the mapping of values. Both the object and database values must be unique.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="attribute-only-type-mappings">
- <xsd:annotation>
- <xsd:documentation>Specifies a mapping of additional values that map non-unique data values to a unique attribute value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="type-mapping" type="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines the object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="type-mapping">
- <xsd:annotation>
- <xsd:documentation>Define an object and data value mapping.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="object-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the object's attribute.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="data-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Specifies the value to use in the database field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query/interaction against a database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="maintain-cache" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should bypass the cache completely.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="bind-all-parameters" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should use paramater binding for arguments, or print the arguments in-line.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cache-statement" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries statement should be cached, this must be used with parameter binding.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="timeout" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies a timeout to cancel the query in if the request takes too long to complete.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="prepare" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should prepare and cache its generated SQL, or regenerate the SQL on each execution.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="call" type="criteria">
- <xsd:annotation>
- <xsd:documentation>For static calls the SQL or Stored Procedure call definition can be specified.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="join-fetch-type">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid join fetch options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="inner-join" />
- <xsd:enumeration value="outer-join" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid cascade policies.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="private" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="value-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a single value.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading a collection of values.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="data-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="data-read-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading raw data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="cache-query-results" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specifies if the query should cache the query results to avoid future executions.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="max-rows" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies the maximum number of rows to fetch, results will be trunctate on the database to this size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="first-result" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifies where to start the cursor in a result set returned from the database. Results prior to this number will not be built into objects</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Specifiess the number of rows to fetch from the database on each result set next operation.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="query-result-cache-policy" type="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Specify how the query results should be cached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-result-cache-policy">
- <xsd:annotation>
- <xsd:documentation>Defines how a query's results should be cached.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="invalidation-policy" type="cache-invalidation">
- <xsd:annotation>
- <xsd:documentation>Defines the cache invalidation policy. By default there will be no cache invalidation policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="100" name="maximum-cached-results" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>This defines the number of query result sets that will be cached. The LRU query results will be discarded when the max size is reached.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="data-modify-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for manipulating data.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-modify-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for modifying an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="update-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for updating an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="insert-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for inserting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="delete-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting an object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-modify-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="does-exist-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for determining if an object exists.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="existence-check" type="existence-check">
- <xsd:annotation>
- <xsd:documentation>The existence check option.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="existence-check">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid existence check options.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="check-cache" />
- <xsd:enumeration value="check-database" />
- <xsd:enumeration value="assume-existence" />
- <xsd:enumeration value="assume-non-existence" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="delete-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for deleting a criteria of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="database-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-read-query" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query for objects (as apposed to data).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full qualified name of the class of objects being queried.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any cached objects from the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="remote-refresh" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should refresh any remotely cached objects from the server.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="cascade-policy" type="cascade-policy">
- <xsd:annotation>
- <xsd:documentation>Specifies if the queries settings (such as refresh, maintain-cache) should apply to the object's relationship queries.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="primary-key" name="cache-usage" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how the query should interact with the cache.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="lock-mode" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should lock the resulting rows on the database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="none" name="distinct-state" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify if the query should filter distinct results.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="in-memory-querying">
- <xsd:annotation>
- <xsd:documentation>The in memory querying policy.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element default="ignore-exceptions-return-conformed" name="policy" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify how indirection or unconformable expressions should be treating with in-memory querying and conforming.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="true" name="use-default-fetch-group" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the default fetch group should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group" type="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="fetch-group-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify a pre-defined named fetch group to allow the query to partially fetch the object.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="use-exclusive-connection" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if the exclusive connection (VPD) should be used for the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="joined-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies the attributes being joined.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for joining</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="read-only" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Specify if objects resulting from the query are read-only, and will not be registered in the unit of work.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="outer-join-subclasses" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>For inheritance queries specify if all subclasses should be outer joined, instead of a query per subclass.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-all-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a set of objects.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="batch-read-attribute-expressions">
- <xsd:annotation>
- <xsd:documentation>Specifies all attributes for batch reading.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for batch reading</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="order-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets the order expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for ordering</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="read-object-query">
- <xsd:annotation>
- <xsd:documentation>Defines a query for a single object.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="object-level-read-query" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="report-query">
- <xsd:annotation>
- <xsd:documentation>Query for information about a set of objects instead of the objects themselves.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="read-all-query">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="return-choice" type="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="retrieve-primary-keys" type="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="report-items">
- <xsd:annotation>
- <xsd:documentation>Items to be selected, these could be attributes or aggregate functions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="item" type="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="group-by-expressions">
- <xsd:annotation>
- <xsd:documentation>Sets GROUP BY expressions for the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Represents an expression for grouping</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="return-choice">
- <xsd:annotation>
- <xsd:documentation>Simplifies the result by only returning the first result, first value, or all attribute values.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="return-single-result" />
- <xsd:enumeration value="return-single-value" />
- <xsd:enumeration value="return-single-attribute" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="retrieve-primary-keys">
- <xsd:annotation>
- <xsd:documentation>Indicates wether the primary key values should also be retrieved for the reference class.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="full-primary-key" />
- <xsd:enumeration value="first-primary-key" />
- <xsd:enumeration value="no-primary-key" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="report-item">
- <xsd:annotation>
- <xsd:documentation>Represents an item requested in ReportQuery.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Name given for item, can be used to retieve value from result.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="attribute-expression" type="expression">
- <xsd:annotation>
- <xsd:documentation>Expression (partial) that describes the attribute wanted.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="expression" abstract="true">
- <xsd:annotation>
- <xsd:documentation>Defines a query filter expression tree.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="relation-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a relation expression that compares to expressions through operators such as equal, lessThan, etc..</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logic-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of two sub-expressions joined through an operator such as AND, OR.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="left" type="expression" />
- <xsd:element name="right" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="operator" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="function-expression">
- <xsd:annotation>
- <xsd:documentation>Defines a expression composed of a function applied to a list of sub-expressions.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of function arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="expression">
- <xsd:annotation>
- <xsd:documentation>Defines an argument expression.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="function" type="operator" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="constant-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression value. If the value is null the value tag can is absent.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="query-key-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression query-key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="any-of" type="xsd:boolean" />
- <xsd:attribute name="outer-join" type="xsd:boolean" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="field-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression field.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element name="base" type="expression" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="parameter-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression parameter.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression">
- <xsd:sequence>
- <xsd:element name="parameter" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="base-expression">
- <xsd:annotation>
- <xsd:documentation>Defines an expression builder/base.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="expression" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="operator">
- <xsd:annotation>
- <xsd:documentation>Defines the set of valid operators.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:complexType name="sql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an SQL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="sql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The full SQL query string. Arguments can be specified through #arg-name tokens in the string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="ejbql-call">
- <xsd:annotation>
- <xsd:documentation>Defines an EJB-QL query language string.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="ejbql" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The EJB-QL query string.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cursor-output-procedure" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define the call to use a cursor output parameter to define the result set.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure. The order of the arguments must match the procedure arguments if not named.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="optional-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of optional arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="field">
- <xsd:annotation>
- <xsd:documentation>Defines an optional argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="stored-function-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored function invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="stored-procedure-call">
- <xsd:sequence>
- <xsd:element minOccurs="1" name="stored-function-result" type="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>The return value of the stored-function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="procedure-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The stored procedure name of the argument. For indexed argument the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified name of the argument class type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype" type="xsd:int">
- <xsd:annotation>
- <xsd:documentation>The JDBC int type of the argument, as defined in java.jdbc.Types</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="procedure-argument-sqltype-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the type if procedure-argument-sqltype is STRUCT or ARRAY</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="procedure-output-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="procedure-inoutput-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure call output argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="procedure-argument">
- <xsd:sequence>
- <xsd:element name="output-argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argument. This is the name of the argument as define in the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-stored-procedure-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored procedure invocation definition whose arguments contain at least one Oracle PL/SQL type that has no JDBC representation (e.g. BOOLEAN, PLS_INTEGER, PL/SQL record).</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="procedure-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the stored procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="cursor-output-procedure" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Define the call to use a cursor output parameter to define the result set.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input and output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="optional-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of optional arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="field">
- <xsd:annotation>
- <xsd:documentation>Defines an optional argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-stored-function-call">
- <xsd:annotation>
- <xsd:documentation>Defines a stored function invocation definition.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-stored-procedure-call">
- <xsd:sequence>
- <xsd:element minOccurs="1" name="stored-function-result" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>The return value of the stored-function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-procedure-argument-type" abstract="true">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element minOccurs="0" name="index" type="xsd:string" />
- <xsd:element minOccurs="0" name="direction" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="jdbc-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:choice>
- <xsd:element minOccurs="0" name="length" type="xsd:string" />
- <xsd:sequence>
- <xsd:element name="precision" type="xsd:string" />
- <xsd:element name="scale" type="xsd:string" />
- </xsd:sequence>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-type">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:attribute name="type-name" type="xsd:string" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-record">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="fields">
- <xsd:annotation>
- <xsd:documentation>The list of fields.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="plsql-procedure-argument-type">
- <xsd:annotation>
- <xsd:documentation>Defines an argument to the procedure.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="plsql-collection">
- <xsd:complexContent mixed="false">
- <xsd:extension base="plsql-procedure-argument-type">
- <xsd:sequence>
- <xsd:element name="type-name" type="xsd:string" />
- <xsd:element minOccurs="0" name="compatible-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="java-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="nested-type" type="plsql-procedure-argument-type" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an EIS record data structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element name="datatype" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the record structure name the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="mapped-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing MappedRecord.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing XML records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-record-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name to use for the input record, if required by the adapter.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-root-element-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the input result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-result-path" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optional root key if the output result is not at the record root.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="indexed-interaction">
- <xsd:annotation>
- <xsd:documentation>Defines an EIS interaction utilizing Indexed records.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="criteria">
- <xsd:sequence>
- <xsd:element name="function-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the function.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="input-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of input arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" name="output-arguments">
- <xsd:annotation>
- <xsd:documentation>The list of output arguments.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="interaction-argument" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="interaction-argument">
- <xsd:annotation>
- <xsd:documentation>Defines an interaction argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="argument-value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>The procedure argument value maybe be specified if not using a query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The interaction name of the argument. For indexed arguments the name is not required.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="argument-name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The query name of the argumen. This is the name of the argument as define in the query, or the descriptor field name.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="object-relational-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to a Structure type in an object-relational database.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relational-class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the object structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="field-order">
- <xsd:annotation>
- <xsd:documentation>The ordered list of the field defined in the structure.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="nested-table-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-m/m-m relationship that makes use of the object-relational nested-table type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field/column in the source table that stores the nested-table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the nested-table type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of primitive/simple type values using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-array-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a collection of object-types using the object-relational array type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="structure" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Specify the object-relational type name of the structure type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="structure-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a structure of object-types using the object-relational structure type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a reference to another object-type using the object-relational reference type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="relationship-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field">
- <xsd:annotation>
- <xsd:documentation>The field in the source type that stores the reference.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-relational-field">
- <xsd:annotation>
- <xsd:documentation>Defines an ObjectRelationalDatabaseField</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="nested-type-field" type="field" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="direct-xml-type-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct mapping to an Oracle XDB XML Type.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="read-whole-document" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="value-converter" type="value-converter">
- <xsd:annotation>
- <xsd:documentation>Optionally specify how the data value should be converted to the object value.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value-converter-class" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Optionally specify a user defined converter class.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-collection-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-M relationship from the source XML element to the target XML element based on a key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-object-reference-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="containerpolicy" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="uses-single-node" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-object-reference-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a 1-1 relationship from the source XML element to the target XML element based on one or more keys.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="aggregate-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="source-to-target-key-field-association" type="foreign-key" />
- <xsd:element minOccurs="0" name="source-to-target-key-fields">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="field" type="field" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-cdata" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-direct-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a direct collection mapping for an XML list of elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-direct-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the collection type to use for the relationship.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping">
- <xsd:sequence>
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- <xsd:element name="keep-as-element-policy" type="xsd:string" minOccurs="0"/>
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite collection mapping for an XML list of nested elements.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reference-class" type="xsd:string" />
- <xsd:element name="field" type="field" />
- <xsd:element name="container-attribute" minOccurs="0"/>
- <xsd:element name="container-get-method" minOccurs="0"/>
- <xsd:element name="container-set-method" minOccurs="0"/>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="null-policy" type="abstract-null-policy" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eis-composite-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a composite object mapping for an XML nested element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-object-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-class-mapping-descriptor">
- <xsd:annotation>
- <xsd:documentation>Defines a class mapping to an XML element.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="class-mapping-descriptor">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="default-root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the element the descriptor maps to.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="default-root-element-field" type="node">
- <xsd:annotation>
- <xsd:documentation>The XMLField representing the default root element of the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="should-preserve-document" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if nodes should be cached to preserve unmapped data</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="namespace-resolver" type="namespace-resolver">
- <xsd:annotation>
- <xsd:documentation>The namespace resolver for the descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="schema" type="schema-reference">
- <xsd:annotation>
- <xsd:documentation>The location of the XML Schema.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="false" name="result-always-xml-root" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-attribute-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to an xs:any declaration or xs:anyType element</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" name="container" type="container-policy" />
- <xsd:element minOccurs="0" name="include-namespace-declaration" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="include-schema-instance" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-any-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single object to an xs:any declaration</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="field" type="field" />
- <xsd:element minOccurs="0" default="false" name="use-xml-root" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="keep-as-element-policy" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a single Node to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-fragment-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection of Nodes to a fragment of an XML document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-composite-collection-mapping" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-direct-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-binary-data-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a binary object to base64 binary</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="xml-composite-direct-collection-mapping">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-swa-ref" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="mime-type" type="xsd:string" />
- <xsd:element minOccurs="0" name="should-inline-data" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-collection-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element name="container-policy" type="container-policy" />
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- <xsd:element minOccurs="0" name="reuse-container" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-object-mapping">
- <xsd:annotation>
- <xsd:documentation>Defines a mapping of a collection to a choice structure in an xml document</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="attribute-mapping">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-to-class-association" type="xml-choice-field-to-class-association" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-choice-field-to-class-association">
- <xsd:sequence>
- <xsd:element name="xml-field" type="node" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="xml-conversion-pair">
- <xsd:sequence>
- <xsd:element name="qname" type="xsd:string" />
- <xsd:element name="class-name" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="node">
- <xsd:annotation>
- <xsd:documentation>Defines an XPath expression to an element or attribute in an XML document.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="position" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>The position of the node in the parent type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" name="leaf-element-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Indicates the elements type.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="is-required" type="xsd:boolean"/>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="union-node">
- <xsd:annotation>
- <xsd:documentation>Use to represent nodes which are mapped to unions</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="typed-text-field" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>If this is a typed text field.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="single-node" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Indicates if each item in the collection is in the same node instead of having one node per item in the collection</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="schema-type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The schema type of the element.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="xml-to-java-conversion-pair" type="xml-conversion-pair" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="java-to-xml-conversion-pair" type="xml-conversion-pair" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="namespace-resolver">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="namespaces">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="namespace" type="namespace" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element minOccurs="0" maxOccurs="1" name="default-namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="namespace">
- <xsd:sequence>
- <xsd:element name="prefix" type="xsd:string" />
- <xsd:element name="namespace-uri" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-reference">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="resource" type="xsd:string" />
- <xsd:element name="schema-context" type="xsd:string" />
- <xsd:element name="node-type" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="schema-class-path-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-file-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="schema-url-reference">
- <xsd:complexContent mixed="false">
- <xsd:extension base="schema-reference" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="java-character">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="java-timestamp">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:simpleType name="java-util-date">
- <xsd:restriction base="xsd:dateTime" />
- </xsd:simpleType>
- <xsd:complexType name="cmp-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="pessimistic-locking" type="pessimistic-locking">
- <xsd:annotation>
- <xsd:documentation>Defines the cmp bean-level pessimistic locking policy.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="defer-until-commit" type="defer-until-commit">
- <xsd:annotation>
- <xsd:documentation>Defines modification deferral level for non-deferred writes.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="non-deferred-create-time" type="non-deferred-create-time">
- <xsd:annotation>
- <xsd:documentation>Defines point at which insert will be issued to Database.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="pessimistic-locking">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="wait" name="locking-mode" type="locking-mode" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:simpleType name="defer-until-commit">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all-modifications" />
- <xsd:enumeration value="update-modifications" />
- <xsd:enumeration value="none" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="non-deferred-create-time">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="after-ejbcreate" />
- <xsd:enumeration value="after-ejbpostcreate" />
- <xsd:enumeration value="undefined" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="locking-mode">
- <xsd:annotation>
- <xsd:documentation>Holds the pessimistic locking mode.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="wait" />
- <xsd:enumeration value="no-wait" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="" name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Sequence name.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="50" name="preallocation-size" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>Sequence preallocation size.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>References default sequence object, overriding its name and (optionally) preallocation size.</xsd:documentation>
- <xsd:documentation>To use preallocation size of default sequence object, set preallocation size to 0</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>Database sequence mechanism used.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>Unary table sequence - sequence name is a table name, table has a single field and a single row</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="counter-field" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="SEQUENCE" name="root-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_NAME" name="name-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence name field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" default="SEQ_COUNT" name="counter-element" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>Define the name of the sequence counter field in the sequence table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="fetch-groups">
- <xsd:annotation>
- <xsd:documentation>Contains all pre-defined fetch groups.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="default-fetch-group" type="fetch-group" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group" type="fetch-group" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="fetch-group">
- <xsd:annotation>
- <xsd:documentation>Contains the fetch group attributes info.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="name" type="xsd:string" />
- <xsd:element name="fetch-group-attributes">
- <xsd:complexType>
- <xsd:annotation>
- <xsd:documentation>Contains a fetch group's attribute list.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="fetch-group-attribute" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="change-policy">
- <xsd:annotation>
- <xsd:documentation>Describes the change tracking policy for this descriptor.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="deferred-detection-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses backup clone to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="object-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses "mark dirty" to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="attribute-level-change-policy">
- <xsd:annotation>
- <xsd:documentation>Uses a ChangeTracker firing PropertyChangeEvent's to detect changes.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="change-policy" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="abstract-null-policy">
- <xsd:annotation>
- <xsd:documentation>Defines the Null Policy in use for this relationship currently a choice of [NullPolicy and IsSetNullPolicy].</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" default="false" name="xsi-nil-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" default="false" name="empty-node-represents-null" type="xsd:boolean" />
- <xsd:element minOccurs="0" name="null-representation-for-xml" type="marshal-null-representation" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" default="true" name="is-set-performed-for-absent-node" type="xsd:boolean" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="is-set-null-policy">
- <xsd:complexContent mixed="false">
- <xsd:extension base="abstract-null-policy">
- <xsd:sequence>
- <xsd:element minOccurs="0" name="is-set-method-name" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter-type" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="is-set-parameter" type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="marshal-null-representation">
- <xsd:annotation>
- <xsd:documentation>Write null, no tag(default) or an empty tag.</xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="XSI_NIL" />
- <xsd:enumeration value="ABSENT_NODE" />
- <xsd:enumeration value="EMPTY_NODE" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="field">
- <xsd:annotation>
- <xsd:documentation>Defines a generic field concept, such as a database column.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the field.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="column">
- <xsd:annotation>
- <xsd:documentation>Defines a column in a relational database table.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent mixed="false">
- <xsd:extension base="field">
- <xsd:attribute name="table" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the column's table. This table must be listed in the class' tables. If not specified the first table of the class will be used.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="sql-typecode" type="xsd:integer">
- <xsd:annotation>
- <xsd:documentation>(optional field) The JDBC typecode of this column</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="column-definition" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>(optional field) Name of the JDBC typecode for this column</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="foreign-key">
- <xsd:annotation>
- <xsd:documentation>The list of source/target field/column references relating a foreign key in one table to the primary or unique key in another table.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" name="field-reference">
- <xsd:annotation>
- <xsd:documentation>The reference of a source table foreign key and a target table primary key.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="source-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The foreign key field/column name in the source table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="target-field" type="field">
- <xsd:annotation>
- <xsd:documentation>The primary or unique key field/column name in the target table.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="query">
- <xsd:annotation>
- <xsd:documentation>Defines a query specification for querying instances of the class.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="criteria" type="criteria">
- <xsd:annotation>
- <xsd:documentation>The selection criteria of the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="arguments">
- <xsd:annotation>
- <xsd:documentation>The list of query arguments. The order of the argument must match the order of the argument value passed to the query.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="unbounded" name="argument" type="query-argument">
- <xsd:annotation>
- <xsd:documentation>The query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query. This name can be used to reference and execute the query.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="criteria">
- <xsd:annotation>
- <xsd:documentation>Defines the filtering clause of a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="query-argument">
- <xsd:annotation>
- <xsd:documentation>Defines a query argument.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element minOccurs="0" name="type" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The fully qualified class type name of the argument may be provided.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="value" type="xsd:anySimpleType">
- <xsd:annotation>
- <xsd:documentation>Optional constant value for the argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element minOccurs="0" name="nullable" type="xsd:boolean">
- <xsd:annotation>
- <xsd:documentation>Defines if the argument is nullable.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the query argument.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="property">
- <xsd:annotation>
- <xsd:documentation>A user defined property.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:anyType" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- <xsd:complexType name="table">
- <xsd:annotation>
- <xsd:documentation>The list of tables that the class is persisted to. This is typically a single table but can be multiple, or empty for inheritance or aggregated classes.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>The name of the table. The name can be fully qualified with the schema, tablespace or link.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- <xsd:complexType name="value-converter">
- <xsd:annotation>
- <xsd:documentation>
- Specifies how the data value should be converted to the
- object value.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy"></xsd:complexType>
-
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.0.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.0.xsd
deleted file mode 100644
index 9831af0a26..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.0.xsd
+++ /dev/null
@@ -1,1477 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
- The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-<!--
-
-XML Schema definition for the Eclipse Persistence Services Project Session Configuration file. Instances
-of this file are typically located as: 'META-INF/sessions.xml'
-
- -->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" version="1.0">
- <xsd:element name="sessions">
- <xsd:annotation>
- <xsd:documentation>
- This is the root element and exists only for XML
- structure
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="session" minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="session">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes a particular session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- Generic element used to describe a string that
- represents the name of an item
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="server-platform" type="server-platform"
- minOccurs="0" />
- <xsd:choice minOccurs="0">
- <xsd:element name="remote-command">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- session element that define the Remote
- Command Module that can also be used for
- cache synchronization
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="channel"
- type="xsd:string" default="EclipseLinkCommandChannel"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element."
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="commands"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It determine what
- command features, the RCM
- supports
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="cache-sync"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an
- optional element of
- command element. It
- turns on cache
- synchronization to
- allow sending and
- receiving cache sync
- commands
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="transport"
- type="transport-manager" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It defines the
- transport mechanism of the RCM.
- The default transport mechanism
- is RMI
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="event-listener-classes" minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="event-listener-classes" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="profiler" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element represents if the profiler will be
- used by the session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="dms" />
- <xsd:enumeration value="eclipselink" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="exception-handler-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the class that the session will use to
- handle exceptions generated from within the
- session
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging" type="log" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element used to specify the logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="session-customizer-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the session customizer
- class to run on a loaded session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="server-platform">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes which server
- platform to use, JTA settings and runtime services
- settings
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="enable-runtime-services"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not the JMX MBean for
- providing runtime services is deployed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-jta" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not this session will
- integrate with the JTA (i.e. whether the session
- will be populated with a transaction controller
- class. The choice of server-class will
- automatically be chosen based on the transaction
- controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="custom-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform">
- <xsd:sequence>
- <xsd:element name="server-class" type="xsd:string"
- default="org.eclipse.persistence.platform.server.CustomServerPlatform"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the subclass of
- org.eclipse.persistence.platform.server.PlatformBase
- to specify which server platform to use
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="external-transaction-controller-class" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-903-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-904-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1012-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1013-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1111-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform"/>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-70-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-81-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-9-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-10-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-40-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-50-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-51-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-60-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jboss-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="session-broker">
- <xsd:annotation>
- <xsd:documentation>
- Provides a single view to a session that
- transparently accesses multple databases.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="session-name" type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the
- session name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="project">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="xml">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:simpleType name="class">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:complexType name="database-session">
- <xsd:annotation>
- <xsd:documentation>
- The session is the primary interface into EclipseLink, the
- application should do all of its reading and writing of
- objects through the session. The session also manages
- transactions and units of work. The database session is
- intended for usage in two-tier client-server
- applications. Although it could be used in a server
- situation, it is limitted to only having a single
- database connection and only allows a single open
- database transaction.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="primary-project" type="project"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This project (class or xml) will be
- loaded as the primary project for the
- session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="additional-project"
- type="project" minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- Additional projects will have their
- descriptors appended to the primary
- project.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-session">
- <xsd:annotation>
- <xsd:documentation>
- Is an extension of a DatabaseSession
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="database-session">
- <xsd:sequence>
- <xsd:element name="connection-pools"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Connection pools are only for usage with
- internal connection pooling and should
- not be used if using external connection
- pooling
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="read-connection-pool"
- type="read-connection-pool" minOccurs="0" />
- <xsd:element
- name="write-connection-pool" type="connection-pool"
- minOccurs="0" />
- <xsd:element
- name="sequence-connection-pool" type="connection-pool"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set this tag to use the
- sequence connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-pool"
- type="connection-pool" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-policy"
- type="connection-policy" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-policy">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how default client sessions are acquired
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exclusive-connection" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if an exclusive connection should be
- used for reads, required for VPD, or user based
- read security.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lazy" type="xsd:boolean" default="true"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if a connection should be acquired and
- held upfront in the client session, or only
- acquired when needed and then released.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="login">
- <xsd:annotation>
- <xsd:documentation>
- Defines common fields for database-login and eis-login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="platform-class" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the platform
- class name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="password" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="table-qualifier" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set the default qualifier for all tables. This
- can be the creator of the table or database name
- the table exists on. This is required by some
- databases such as Oracle and DB2.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-connection-pooling"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the connection should use an
- external connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-transaction-controller"
- type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the session will be using an
- external transaction controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequencing" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequencing information.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="default-sequence"
- type="sequence" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Default sequence. The name is
- optional. If no name provided an
- empty string will be used as a name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequences" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Non default sequences. Make sure
- each sequence has unique name.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="sequence"
- type="sequence" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of a login.
- It is used to define extra properties on the
- login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>
- Holds the configuration information necessary to connect
- to a JDBC driver.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:choice minOccurs="0">
- <xsd:sequence>
- <xsd:element name="driver-class"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- The driver class is the Java
- class for the JDBC driver to be
- used (e.g.
- sun.jdbc.odbc.JdbcOdbcDriver.class)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-url"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL that will be
- used to connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:element name="datasource">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL of a datasource that
- may be used by the session to
- connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lookup"
- type="lookup-enum" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="bind-all-parameters"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to bind all arguments to any
- SQL statement.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cache-all-statements"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether prepared statements should
- be cached.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="byte-array-binding"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- parameter binding for large binary data.
- By default EclipseLink will print this data
- as hex through the JDBC binary excape
- clause. Both binding and printing have
- various limits on all databases (e.g. 5k
- - 32k).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="string-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if strings should be bound.
- Used to help bean introspection.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="streams-for-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use streams
- to store large binary data. This can
- improve the max size for reading/writing
- on some JDBC drivers.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="force-field-names-to-upper-case"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This setting can be used if the
- application expects upper case but the
- database does not return consistent case
- (e.g. different databases).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="optimize-data-conversion"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether driver level data conversion
- optimization is enabled. This can be
- disabled as some drivers perform data
- conversion themselves incorrectly.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="trim-strings" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- By default CHAR field values have
- trailing blanks trimmed, this can be
- configured.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="batch-writing" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use batch
- writing. This facility allows multiple
- write operations to be submitted to a
- database for processing at once.
- Submitting multiple updates together,
- instead of individually, can greatly
- improve performance in some situations.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jdbc-batch-writing"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Setting this tag with true indicates to
- EclipseLink that the JDBC driver supports
- batch writing. EclipseLink's internal batch
- writing is disabled. Setting this tag
- with false indicates to EclipseLink that the
- JDBC driver does not support batch
- writing. This will revert to the default
- behaviour which is to delegate to
- EclipseLink's internal batch writing.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-batch-writing-size"
- type="xsd:integer" default="32000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Allow for the max batch writing size to
- be set. This allows for the batch size
- to be limited as most database have
- strict limits. The size is in
- characters, the default is 32000 but the
- real value depends on the database
- configuration.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="native-sql" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- database specific sql grammar not JDBC
- specific. This is because unfortunately
- some bridges to not support the full
- JDBC standard. By default EclipseLink uses
- the JDBC sql grammar.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="struct-converters"
- minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="struct-converters" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-health-validated-on-error" type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>If true will cause EclipseLink to ping database to determine if an SQLException was cause by a communication failure</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="query-retry-attempt-count" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the number of attempts EclipseLink will make if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="delay-between-reconnect-attempts" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the time in miliseconds that EclipseLink will wait between attempts to reconnect if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ping-sql" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Override the platform specific SQL that EclipseLink will issue to a connection to determine if the connection is still live.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="lookup-enum">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="composite-name" />
- <xsd:enumeration value="compound-name" />
- <xsd:enumeration value="string" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines connection information and datasource
- properties. There are three ways to connect through EIS,
- - Provide a JNDI name to the ConnectionFactory and use
- the default getConnection - Provide a JNDI name to the
- ConnectionFactory, and a driver specific ConnectionSpec
- to pass to the getConnection - Connect in a non-managed
- way directly to the driver specific ConnectionFactory An
- EISConnectionSpec must be provided to define how to
- connect to the EIS adapter. The EIS platform can be used
- to provide datasource/driver specific behavoir such as
- InteractionSpec and Record conversion.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="connection-spec-class"
- type="xsd:string" minOccurs="0" />
- <xsd:element name="connection-factory-url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines login and platform type to be used
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how connections should be pooled in a
- server session.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element name="max-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The max number of connections that will be
- created in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="min-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The min number of connections that will aways be
- in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="read-connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- The read connection pool is used for read access through
- the server session. Any of the connection pools can be
- used for the read pool however this is the default. This
- pool allows for concurrent reads against the same JDBC
- connection and requires that the JDBC connection support
- concurrent read access.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="connection-pool">
- <xsd:sequence>
- <xsd:element name="exclusive" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This tag is used to specify if the
- connections from the read connection
- pool are exclusive or not
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the common logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="java-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Java log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eclipselink-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the EclipseLink log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="log-level" default="info"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the log level for logging
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="off" />
- <xsd:enumeration value="severe" />
- <xsd:enumeration value="warning" />
- <xsd:enumeration value="info" />
- <xsd:enumeration value="config" />
- <xsd:enumeration value="fine" />
- <xsd:enumeration value="finer" />
- <xsd:enumeration value="finest" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="file-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Name of the file to write the logging to
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Server log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logging-options">
- <xsd:sequence>
- <xsd:element name="log-exception-stacktrace"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log exception stacktrace. Without
- this element, the stacktrace is logged for FINER
- or less (FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-thread" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log thread. Without this element,
- the thread is logged for FINE or less (FINER or
- FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-session" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log session. Without this
- element, the session is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-connection" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log connection. Without this
- element, the connection is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-date" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log date. Without this element,
- the date is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="transport-manager">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the transport mechanism of the RCM.
- The default transport mechanism is RMI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="on-connection-error"
- default="DiscardConnection" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element and has value of "DiscardConnection" or
- "KeepConnection". It determines whether
- connection to a RCM service should be dropped if
- there is a communication error with that RCM
- service. The default value for this element is
- "DiscardConnection".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="KeepConnection" />
- <xsd:enumeration value="DiscardConnection" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="rmi-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It defines the RMI transport mechanism. The
- default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="send-mode" default="Asynchronous"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element and has value of
- "Asynchronous" or "Synchronous". It
- determines whether the RCM propagates
- command and does not wait for command to
- finish its execution in asynchronous
- mode or wait for command to finish its
- execution in synchronous mode. The
- default value of this element is
- "Asynchronous".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="Asynchronous" />
- <xsd:enumeration value="Synchronous" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="discovery" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element. It determines whether the
- Discovery settings should be changed.
- Note that a default Discovery with its
- default settings is created when the rmi
- element is specified.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="multicast-group-address" type="xsd:string"
- default="226.10.12.64" minOccurs="0" />
- <xsd:element name="multicast-port"
- type="xsd:integer" default="3121" minOccurs="0" />
- <xsd:element name="announcement-delay"
- type="xsd:integer" default="1000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the multicast group
- address should be changed.
- The default value of this
- element is "1000"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="packet-time-to-live"
- type="xsd:integer" default="2" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the time-to-live of
- the packets that are sent
- from the Discovery's
- mulsticast socket should be
- changed. The default value
- of this element is "2"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:choice minOccurs="0">
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- <xsd:element
- name="rmi-registry-naming-service">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element
- of rmi elemenent. It determines
- whether RMI registry should be used
- for naming service
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="rmi-iiop-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the RMI-IIOP transport mechanism of
- the RCM. The default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="rmi-transport" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jms-topic-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the JMS topic transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="topic-host-url" type="xsd:string"
- minOccurs="0" />
- <xsd:element name="topic-connection-factory-name"
- type="xsd:string" default="jms/EclipseLinkTopicConnectionFactory"
- minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- default="jms/EclipseLinkTopic" minOccurs="0" />
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-jgroups-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the OC4J JGroups transport
- mechanism of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="use-single-threaded-notification"
- type="xsd:boolean" default="false" minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sun-corba-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the Sun CORBA transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="user-defined-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It determines whether a user implemented
- transport mechanism that should be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="transport-class"
- type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jndi-naming-service">
- <xsd:sequence>
- <xsd:element name="url" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- URL for naming service should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- default="admin" minOccurs="0" />
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0" />
- <xsd:element name="password" type="xsd:string"
- default="password" minOccurs="0" />
- <!-- TODO: Need to have a non Oracle-AS default or route through server platform by default -->
- <xsd:element name="initial-context-factory-name"
- type="xsd:string"
- default="com.evermind.server.rmi.RMIInitialContextFactory"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- initial context factory class for naming service
- should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether
- naming service requires extra property that is
- not defined by EclipseLink but it is required by the
- user application
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:group name="event-listener-classes">
- <xsd:sequence>
- <xsd:element name="event-listener-class" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:group name="struct-converters">
- <xsd:sequence>
- <xsd:element name="struct-converter" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="preallocation-size" type="xsd:integer"
- default="50" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence preallocation size.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>
- References default sequence object, overriding its name
- and (optionally) preallocation size.
- </xsd:documentation>
- <xsd:documentation>
- To use preallocation size of default sequence object,
- set preallocation size to 0
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Database sequence mechanism used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="table" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-field" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Unary table sequence - sequence name is a table name,
- table has a single field and a single row
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="root-element" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-element" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-element"
- type="xsd:string" default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.1.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.1.xsd
deleted file mode 100644
index d872a1640e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.1.xsd
+++ /dev/null
@@ -1,1585 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*******************************************************************************
- Copyright (c) 1998, 2007 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
-*****************************************************************************/
--->
-<!--
-
-XML Schema definition for the Eclipse Persistence Services Project Session Configuration file. Instances
-of this file are typically located as: 'META-INF/sessions.xml'
-
- -->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" version="1.1">
- <xsd:element name="sessions">
- <xsd:annotation>
- <xsd:documentation>
- This is the root element and exists only for XML
- structure
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="session" minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="session">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes a particular session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- Generic element used to describe a string that
- represents the name of an item
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="server-platform" type="server-platform"
- minOccurs="0" />
- <xsd:choice minOccurs="0">
- <xsd:element name="remote-command">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- session element that define the Remote
- Command Module that can also be used for
- cache synchronization
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="channel"
- type="xsd:string" default="EclipseLinkCommandChannel"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element."
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="commands"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It determine what
- command features, the RCM
- supports
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="cache-sync"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an
- optional element of
- command element. It
- turns on cache
- synchronization to
- allow sending and
- receiving cache sync
- commands
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="transport"
- type="transport-manager" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It defines the
- transport mechanism of the RCM.
- The default transport mechanism
- is RMI
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="event-listener-classes" minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="event-listener-classes" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="profiler" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element represents if the profiler will be
- used by the session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="dms" />
- <xsd:enumeration value="eclipselink" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="exception-handler-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the class that the session will use to
- handle exceptions generated from within the
- session
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging" type="log" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element used to specify the logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="session-customizer-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the session customizer
- class to run on a loaded session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="server-platform">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes which server
- platform to use, JTA settings and runtime services
- settings
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="enable-runtime-services"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not the JMX MBean for
- providing runtime services is deployed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-jta" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not this session will
- integrate with the JTA (i.e. whether the session
- will be populated with a transaction controller
- class. The choice of server-class will
- automatically be chosen based on the transaction
- controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="custom-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform">
- <xsd:sequence>
- <xsd:element name="server-class" type="xsd:string"
- default="org.eclipse.persistence.platform.server.CustomServerPlatform"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the subclass of
- org.eclipse.persistence.platform.server.PlatformBase
- to specify which server platform to use
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="external-transaction-controller-class" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-903-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-904-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1012-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1013-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1111-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform"/>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-70-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-81-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-9-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-10-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-40-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-50-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-51-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-60-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jboss-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="session-broker">
- <xsd:annotation>
- <xsd:documentation>
- Provides a single view to a session that
- transparently accesses multple databases.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="session-name" type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the
- session name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="project">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="xml">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:simpleType name="class">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:complexType name="database-session">
- <xsd:annotation>
- <xsd:documentation>
- The session is the primary interface into EclipseLink, the
- application should do all of its reading and writing of
- objects through the session. The session also manages
- transactions and units of work. The database session is
- intended for usage in two-tier client-server
- applications. Although it could be used in a server
- situation, it is limitted to only having a single
- database connection and only allows a single open
- database transaction.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="primary-project" type="project"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This project (class or xml) will be
- loaded as the primary project for the
- session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="additional-project"
- type="project" minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- Additional projects will have their
- descriptors appended to the primary
- project.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-session">
- <xsd:annotation>
- <xsd:documentation>
- Is an extension of a DatabaseSession
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="database-session">
- <xsd:sequence>
- <xsd:element name="connection-pools"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Connection pools are only for usage with
- internal connection pooling and should
- not be used if using external connection
- pooling
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="read-connection-pool"
- type="read-connection-pool" minOccurs="0" />
- <xsd:element
- name="write-connection-pool" type="connection-pool"
- minOccurs="0" />
- <xsd:element
- name="sequence-connection-pool" type="connection-pool"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set this tag to use the
- sequence connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-pool"
- type="connection-pool" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-policy"
- type="connection-policy" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-policy">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how default client sessions are acquired
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exclusive-connection" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if an exclusive connection should be
- used for reads, required for VPD, or user based
- read security.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lazy" type="xsd:boolean" default="true"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if a connection should be acquired and
- held upfront in the client session, or only
- acquired when needed and then released.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="login">
- <xsd:annotation>
- <xsd:documentation>
- Defines common fields for database-login and eis-login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="platform-class" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the platform
- class name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="password" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="table-qualifier" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set the default qualifier for all tables. This
- can be the creator of the table or database name
- the table exists on. This is required by some
- databases such as Oracle and DB2.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-connection-pooling"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the connection should use an
- external connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-transaction-controller"
- type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the session will be using an
- external transaction controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequencing" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequencing information.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="default-sequence"
- type="sequence" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Default sequence. The name is
- optional. If no name provided an
- empty string will be used as a name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequences" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Non default sequences. Make sure
- each sequence has unique name.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="sequence"
- type="sequence" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of a login.
- It is used to define extra properties on the
- login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>
- Holds the configuration information necessary to connect
- to a JDBC driver.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:choice minOccurs="0">
- <xsd:sequence>
- <xsd:element name="driver-class"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- The driver class is the Java
- class for the JDBC driver to be
- used (e.g.
- sun.jdbc.odbc.JdbcOdbcDriver.class)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-url"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL that will be
- used to connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:element name="datasource">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL of a datasource that
- may be used by the session to
- connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lookup"
- type="lookup-enum" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="bind-all-parameters"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to bind all arguments to any
- SQL statement.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cache-all-statements"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether prepared statements should
- be cached.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="byte-array-binding"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- parameter binding for large binary data.
- By default EclipseLink will print this data
- as hex through the JDBC binary excape
- clause. Both binding and printing have
- various limits on all databases (e.g. 5k
- - 32k).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="string-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if strings should be bound.
- Used to help bean introspection.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="streams-for-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use streams
- to store large binary data. This can
- improve the max size for reading/writing
- on some JDBC drivers.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="force-field-names-to-upper-case"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This setting can be used if the
- application expects upper case but the
- database does not return consistent case
- (e.g. different databases).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="optimize-data-conversion"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether driver level data conversion
- optimization is enabled. This can be
- disabled as some drivers perform data
- conversion themselves incorrectly.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="trim-strings" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- By default CHAR field values have
- trailing blanks trimmed, this can be
- configured.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="batch-writing" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use batch
- writing. This facility allows multiple
- write operations to be submitted to a
- database for processing at once.
- Submitting multiple updates together,
- instead of individually, can greatly
- improve performance in some situations.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jdbc-batch-writing"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Setting this tag with true indicates to
- EclipseLink that the JDBC driver supports
- batch writing. EclipseLink's internal batch
- writing is disabled. Setting this tag
- with false indicates to EclipseLink that the
- JDBC driver does not support batch
- writing. This will revert to the default
- behaviour which is to delegate to
- EclipseLink's internal batch writing.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-batch-writing-size"
- type="xsd:integer" default="32000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Allow for the max batch writing size to
- be set. This allows for the batch size
- to be limited as most database have
- strict limits. The size is in
- characters, the default is 32000 but the
- real value depends on the database
- configuration.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="native-sql" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- database specific sql grammar not JDBC
- specific. This is because unfortunately
- some bridges to not support the full
- JDBC standard. By default EclipseLink uses
- the JDBC sql grammar.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="struct-converters"
- minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="struct-converters" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-health-validated-on-error" type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>If true will cause EclipseLink to ping database to determine if an SQLException was cause by a communication failure</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="query-retry-attempt-count" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the number of attempts EclipseLink will make if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="delay-between-reconnect-attempts" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the time in miliseconds that EclipseLink will wait between attempts to reconnect if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ping-sql" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Override the platform specific SQL that EclipseLink will issue to a connection to determine if the connection is still live.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="lookup-enum">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="composite-name" />
- <xsd:enumeration value="compound-name" />
- <xsd:enumeration value="string" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines connection information and datasource
- properties. There are three ways to connect through EIS,
- - Provide a JNDI name to the ConnectionFactory and use
- the default getConnection - Provide a JNDI name to the
- ConnectionFactory, and a driver specific ConnectionSpec
- to pass to the getConnection - Connect in a non-managed
- way directly to the driver specific ConnectionFactory An
- EISConnectionSpec must be provided to define how to
- connect to the EIS adapter. The EIS platform can be used
- to provide datasource/driver specific behavoir such as
- InteractionSpec and Record conversion.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="connection-spec-class"
- type="xsd:string" minOccurs="0" />
- <xsd:element name="connection-factory-url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines login and platform type to be used
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="equal-namespace-resolvers"
- type="xsd:boolean" maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="document-preservation-policy"
- maxOccurs="1" minOccurs="0"
- type="document-preservation-policy">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how connections should be pooled in a
- server session.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element name="max-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The max number of connections that will be
- created in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="min-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The min number of connections that will aways be
- in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="read-connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- The read connection pool is used for read access through
- the server session. Any of the connection pools can be
- used for the read pool however this is the default. This
- pool allows for concurrent reads against the same JDBC
- connection and requires that the JDBC connection support
- concurrent read access.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="connection-pool">
- <xsd:sequence>
- <xsd:element name="exclusive" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This tag is used to specify if the
- connections from the read connection
- pool are exclusive or not
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the common logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="java-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Java log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eclipselink-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the EclipseLink log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="log-level" default="info"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the log level for logging
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="off" />
- <xsd:enumeration value="severe" />
- <xsd:enumeration value="warning" />
- <xsd:enumeration value="info" />
- <xsd:enumeration value="config" />
- <xsd:enumeration value="fine" />
- <xsd:enumeration value="finer" />
- <xsd:enumeration value="finest" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="file-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Name of the file to write the logging to
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Server log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logging-options">
- <xsd:sequence>
- <xsd:element name="log-exception-stacktrace"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log exception stacktrace. Without
- this element, the stacktrace is logged for FINER
- or less (FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-thread" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log thread. Without this element,
- the thread is logged for FINE or less (FINER or
- FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-session" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log session. Without this
- element, the session is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-connection" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log connection. Without this
- element, the connection is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-date" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log date. Without this element,
- the date is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="transport-manager">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the transport mechanism of the RCM.
- The default transport mechanism is RMI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="on-connection-error"
- default="DiscardConnection" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element and has value of "DiscardConnection" or
- "KeepConnection". It determines whether
- connection to a RCM service should be dropped if
- there is a communication error with that RCM
- service. The default value for this element is
- "DiscardConnection".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="KeepConnection" />
- <xsd:enumeration value="DiscardConnection" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="rmi-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It defines the RMI transport mechanism. The
- default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="send-mode" default="Asynchronous"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element and has value of
- "Asynchronous" or "Synchronous". It
- determines whether the RCM propagates
- command and does not wait for command to
- finish its execution in asynchronous
- mode or wait for command to finish its
- execution in synchronous mode. The
- default value of this element is
- "Asynchronous".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="Asynchronous" />
- <xsd:enumeration value="Synchronous" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="discovery" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element. It determines whether the
- Discovery settings should be changed.
- Note that a default Discovery with its
- default settings is created when the rmi
- element is specified.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="multicast-group-address" type="xsd:string"
- default="226.10.12.64" minOccurs="0" />
- <xsd:element name="multicast-port"
- type="xsd:integer" default="3121" minOccurs="0" />
- <xsd:element name="announcement-delay"
- type="xsd:integer" default="1000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the multicast group
- address should be changed.
- The default value of this
- element is "1000"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="packet-time-to-live"
- type="xsd:integer" default="2" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the time-to-live of
- the packets that are sent
- from the Discovery's
- mulsticast socket should be
- changed. The default value
- of this element is "2"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:choice minOccurs="0">
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- <xsd:element
- name="rmi-registry-naming-service">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element
- of rmi elemenent. It determines
- whether RMI registry should be used
- for naming service
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="rmi-iiop-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the RMI-IIOP transport mechanism of
- the RCM. The default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="rmi-transport" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jms-topic-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the JMS topic transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="topic-host-url" type="xsd:string"
- minOccurs="0" />
- <xsd:element name="topic-connection-factory-name"
- type="xsd:string" default="jms/EclipseLinkTopicConnectionFactory"
- minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- default="jms/EclipseLinkTopic" minOccurs="0" />
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-jgroups-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the OC4J JGroups transport
- mechanism of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="use-single-threaded-notification"
- type="xsd:boolean" default="false" minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sun-corba-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the Sun CORBA transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="user-defined-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It determines whether a user implemented
- transport mechanism that should be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="transport-class"
- type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jndi-naming-service">
- <xsd:sequence>
- <xsd:element name="url" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- URL for naming service should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- default="admin" minOccurs="0" />
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0" />
- <xsd:element name="password" type="xsd:string"
- default="password" minOccurs="0" />
- <!-- TODO: Need to have a non WebLogic (previously OC4J) default or route through server platform by default -->
- <xsd:element name="initial-context-factory-name"
- type="xsd:string"
- default="weblogic.jndi.WLInitialContextFactory"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- initial context factory class for naming service
- should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether
- naming service requires extra property that is
- not defined by EclipseLink but it is required by the
- user application
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:group name="event-listener-classes">
- <xsd:sequence>
- <xsd:element name="event-listener-class" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:group name="struct-converters">
- <xsd:sequence>
- <xsd:element name="struct-converter" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="preallocation-size" type="xsd:integer"
- default="50" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence preallocation size.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>
- References default sequence object, overriding its name
- and (optionally) preallocation size.
- </xsd:documentation>
- <xsd:documentation>
- To use preallocation size of default sequence object,
- set preallocation size to 0
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Database sequence mechanism used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="table" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-field" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Unary table sequence - sequence name is a table name,
- table has a single field and a single row
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="root-element" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-element" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-element"
- type="xsd:string" default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which document preservation
- strategy will be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which node ordering strategy will
- be used.
- </xsd:documentation>
- </xsd:annotation></xsd:complexType>
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservation Policy that
- accesses the session cache to store Objects and their
- associated nodes.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- A DocumentPreservationPolicy to indicate that no
- document preservation work should be done.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservationPolicy that
- maintains bidirectional relationships between Java
- Objects and the XMLNodes they originated from.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that simply
- appends the new child element to the parent.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that ignores any
- new elements when updating a cached document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that adds new
- elements to an XML Document based on the last updated
- sibling in their context.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.2.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.2.xsd
deleted file mode 100644
index b58242768c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_1.2.xsd
+++ /dev/null
@@ -1,1586 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
- tware - update version number to 1.2
-*****************************************************************************/
--->
-<!--
-
-XML Schema definition for the Eclipse Persistence Services Project Session Configuration file. Instances
-of this file are typically located as: 'META-INF/sessions.xml'
-
- -->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" version="1.2">
- <xsd:element name="sessions">
- <xsd:annotation>
- <xsd:documentation>
- This is the root element and exists only for XML
- structure
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="session" minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="session">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes a particular session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- Generic element used to describe a string that
- represents the name of an item
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="server-platform" type="server-platform"
- minOccurs="0" />
- <xsd:choice minOccurs="0">
- <xsd:element name="remote-command">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- session element that define the Remote
- Command Module that can also be used for
- cache synchronization
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="channel"
- type="xsd:string" default="EclipseLinkCommandChannel"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element."
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="commands"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It determine what
- command features, the RCM
- supports
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="cache-sync"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an
- optional element of
- command element. It
- turns on cache
- synchronization to
- allow sending and
- receiving cache sync
- commands
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="transport"
- type="transport-manager" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It defines the
- transport mechanism of the RCM.
- The default transport mechanism
- is RMI
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="event-listener-classes" minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="event-listener-classes" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="profiler" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element represents if the profiler will be
- used by the session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="dms" />
- <xsd:enumeration value="eclipselink" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="exception-handler-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the class that the session will use to
- handle exceptions generated from within the
- session
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging" type="log" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element used to specify the logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="session-customizer-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the session customizer
- class to run on a loaded session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="server-platform">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes which server
- platform to use, JTA settings and runtime services
- settings
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="enable-runtime-services"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not the JMX MBean for
- providing runtime services is deployed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-jta" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not this session will
- integrate with the JTA (i.e. whether the session
- will be populated with a transaction controller
- class. The choice of server-class will
- automatically be chosen based on the transaction
- controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="custom-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform">
- <xsd:sequence>
- <xsd:element name="server-class" type="xsd:string"
- default="org.eclipse.persistence.platform.server.CustomServerPlatform"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the subclass of
- org.eclipse.persistence.platform.server.PlatformBase
- to specify which server platform to use
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="external-transaction-controller-class" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-903-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-904-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1012-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1013-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1111-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform"/>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-70-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-81-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-9-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-10-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-40-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-50-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-51-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-60-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jboss-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="session-broker">
- <xsd:annotation>
- <xsd:documentation>
- Provides a single view to a session that
- transparently accesses multple databases.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="session-name" type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the
- session name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="project">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="xml">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:simpleType name="class">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:complexType name="database-session">
- <xsd:annotation>
- <xsd:documentation>
- The session is the primary interface into EclipseLink, the
- application should do all of its reading and writing of
- objects through the session. The session also manages
- transactions and units of work. The database session is
- intended for usage in two-tier client-server
- applications. Although it could be used in a server
- situation, it is limitted to only having a single
- database connection and only allows a single open
- database transaction.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="primary-project" type="project"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This project (class or xml) will be
- loaded as the primary project for the
- session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="additional-project"
- type="project" minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- Additional projects will have their
- descriptors appended to the primary
- project.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-session">
- <xsd:annotation>
- <xsd:documentation>
- Is an extension of a DatabaseSession
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="database-session">
- <xsd:sequence>
- <xsd:element name="connection-pools"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Connection pools are only for usage with
- internal connection pooling and should
- not be used if using external connection
- pooling
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="read-connection-pool"
- type="read-connection-pool" minOccurs="0" />
- <xsd:element
- name="write-connection-pool" type="connection-pool"
- minOccurs="0" />
- <xsd:element
- name="sequence-connection-pool" type="connection-pool"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set this tag to use the
- sequence connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-pool"
- type="connection-pool" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-policy"
- type="connection-policy" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-policy">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how default client sessions are acquired
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exclusive-connection" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if an exclusive connection should be
- used for reads, required for VPD, or user based
- read security.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lazy" type="xsd:boolean" default="true"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if a connection should be acquired and
- held upfront in the client session, or only
- acquired when needed and then released.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="login">
- <xsd:annotation>
- <xsd:documentation>
- Defines common fields for database-login and eis-login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="platform-class" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the platform
- class name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="password" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="table-qualifier" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set the default qualifier for all tables. This
- can be the creator of the table or database name
- the table exists on. This is required by some
- databases such as Oracle and DB2.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-connection-pooling"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the connection should use an
- external connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-transaction-controller"
- type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the session will be using an
- external transaction controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequencing" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequencing information.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="default-sequence"
- type="sequence" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Default sequence. The name is
- optional. If no name provided an
- empty string will be used as a name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequences" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Non default sequences. Make sure
- each sequence has unique name.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="sequence"
- type="sequence" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of a login.
- It is used to define extra properties on the
- login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>
- Holds the configuration information necessary to connect
- to a JDBC driver.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:choice minOccurs="0">
- <xsd:sequence>
- <xsd:element name="driver-class"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- The driver class is the Java
- class for the JDBC driver to be
- used (e.g.
- sun.jdbc.odbc.JdbcOdbcDriver.class)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-url"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL that will be
- used to connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:element name="datasource">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL of a datasource that
- may be used by the session to
- connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lookup"
- type="lookup-enum" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="bind-all-parameters"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to bind all arguments to any
- SQL statement.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cache-all-statements"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether prepared statements should
- be cached.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="byte-array-binding"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- parameter binding for large binary data.
- By default EclipseLink will print this data
- as hex through the JDBC binary excape
- clause. Both binding and printing have
- various limits on all databases (e.g. 5k
- - 32k).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="string-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if strings should be bound.
- Used to help bean introspection.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="streams-for-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use streams
- to store large binary data. This can
- improve the max size for reading/writing
- on some JDBC drivers.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="force-field-names-to-upper-case"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This setting can be used if the
- application expects upper case but the
- database does not return consistent case
- (e.g. different databases).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="optimize-data-conversion"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether driver level data conversion
- optimization is enabled. This can be
- disabled as some drivers perform data
- conversion themselves incorrectly.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="trim-strings" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- By default CHAR field values have
- trailing blanks trimmed, this can be
- configured.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="batch-writing" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use batch
- writing. This facility allows multiple
- write operations to be submitted to a
- database for processing at once.
- Submitting multiple updates together,
- instead of individually, can greatly
- improve performance in some situations.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jdbc-batch-writing"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Setting this tag with true indicates to
- EclipseLink that the JDBC driver supports
- batch writing. EclipseLink's internal batch
- writing is disabled. Setting this tag
- with false indicates to EclipseLink that the
- JDBC driver does not support batch
- writing. This will revert to the default
- behaviour which is to delegate to
- EclipseLink's internal batch writing.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-batch-writing-size"
- type="xsd:integer" default="32000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Allow for the max batch writing size to
- be set. This allows for the batch size
- to be limited as most database have
- strict limits. The size is in
- characters, the default is 32000 but the
- real value depends on the database
- configuration.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="native-sql" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- database specific sql grammar not JDBC
- specific. This is because unfortunately
- some bridges to not support the full
- JDBC standard. By default EclipseLink uses
- the JDBC sql grammar.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="struct-converters"
- minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="struct-converters" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-health-validated-on-error" type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>If true will cause EclipseLink to ping database to determine if an SQLException was cause by a communication failure</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="query-retry-attempt-count" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the number of attempts EclipseLink will make if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="delay-between-reconnect-attempts" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the time in miliseconds that EclipseLink will wait between attempts to reconnect if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ping-sql" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Override the platform specific SQL that EclipseLink will issue to a connection to determine if the connection is still live.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="lookup-enum">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="composite-name" />
- <xsd:enumeration value="compound-name" />
- <xsd:enumeration value="string" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines connection information and datasource
- properties. There are three ways to connect through EIS,
- - Provide a JNDI name to the ConnectionFactory and use
- the default getConnection - Provide a JNDI name to the
- ConnectionFactory, and a driver specific ConnectionSpec
- to pass to the getConnection - Connect in a non-managed
- way directly to the driver specific ConnectionFactory An
- EISConnectionSpec must be provided to define how to
- connect to the EIS adapter. The EIS platform can be used
- to provide datasource/driver specific behavoir such as
- InteractionSpec and Record conversion.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="connection-spec-class"
- type="xsd:string" minOccurs="0" />
- <xsd:element name="connection-factory-url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines login and platform type to be used
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="equal-namespace-resolvers"
- type="xsd:boolean" maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="document-preservation-policy"
- maxOccurs="1" minOccurs="0"
- type="document-preservation-policy">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how connections should be pooled in a
- server session.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element name="max-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The max number of connections that will be
- created in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="min-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The min number of connections that will aways be
- in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="read-connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- The read connection pool is used for read access through
- the server session. Any of the connection pools can be
- used for the read pool however this is the default. This
- pool allows for concurrent reads against the same JDBC
- connection and requires that the JDBC connection support
- concurrent read access.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="connection-pool">
- <xsd:sequence>
- <xsd:element name="exclusive" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This tag is used to specify if the
- connections from the read connection
- pool are exclusive or not
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the common logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="java-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Java log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eclipselink-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the EclipseLink log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="log-level" default="info"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the log level for logging
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="off" />
- <xsd:enumeration value="severe" />
- <xsd:enumeration value="warning" />
- <xsd:enumeration value="info" />
- <xsd:enumeration value="config" />
- <xsd:enumeration value="fine" />
- <xsd:enumeration value="finer" />
- <xsd:enumeration value="finest" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="file-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Name of the file to write the logging to
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Server log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logging-options">
- <xsd:sequence>
- <xsd:element name="log-exception-stacktrace"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log exception stacktrace. Without
- this element, the stacktrace is logged for FINER
- or less (FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-thread" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log thread. Without this element,
- the thread is logged for FINE or less (FINER or
- FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-session" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log session. Without this
- element, the session is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-connection" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log connection. Without this
- element, the connection is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-date" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log date. Without this element,
- the date is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="transport-manager">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the transport mechanism of the RCM.
- The default transport mechanism is RMI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="on-connection-error"
- default="DiscardConnection" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element and has value of "DiscardConnection" or
- "KeepConnection". It determines whether
- connection to a RCM service should be dropped if
- there is a communication error with that RCM
- service. The default value for this element is
- "DiscardConnection".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="KeepConnection" />
- <xsd:enumeration value="DiscardConnection" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="rmi-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It defines the RMI transport mechanism. The
- default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="send-mode" default="Asynchronous"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element and has value of
- "Asynchronous" or "Synchronous". It
- determines whether the RCM propagates
- command and does not wait for command to
- finish its execution in asynchronous
- mode or wait for command to finish its
- execution in synchronous mode. The
- default value of this element is
- "Asynchronous".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="Asynchronous" />
- <xsd:enumeration value="Synchronous" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="discovery" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element. It determines whether the
- Discovery settings should be changed.
- Note that a default Discovery with its
- default settings is created when the rmi
- element is specified.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="multicast-group-address" type="xsd:string"
- default="226.10.12.64" minOccurs="0" />
- <xsd:element name="multicast-port"
- type="xsd:integer" default="3121" minOccurs="0" />
- <xsd:element name="announcement-delay"
- type="xsd:integer" default="1000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the multicast group
- address should be changed.
- The default value of this
- element is "1000"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="packet-time-to-live"
- type="xsd:integer" default="2" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the time-to-live of
- the packets that are sent
- from the Discovery's
- mulsticast socket should be
- changed. The default value
- of this element is "2"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:choice minOccurs="0">
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- <xsd:element
- name="rmi-registry-naming-service">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element
- of rmi elemenent. It determines
- whether RMI registry should be used
- for naming service
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="rmi-iiop-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the RMI-IIOP transport mechanism of
- the RCM. The default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="rmi-transport" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jms-topic-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the JMS topic transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="topic-host-url" type="xsd:string"
- minOccurs="0" />
- <xsd:element name="topic-connection-factory-name"
- type="xsd:string" default="jms/EclipseLinkTopicConnectionFactory"
- minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- default="jms/EclipseLinkTopic" minOccurs="0" />
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-jgroups-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the OC4J JGroups transport
- mechanism of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="use-single-threaded-notification"
- type="xsd:boolean" default="false" minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sun-corba-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the Sun CORBA transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="user-defined-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It determines whether a user implemented
- transport mechanism that should be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="transport-class"
- type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jndi-naming-service">
- <xsd:sequence>
- <xsd:element name="url" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- URL for naming service should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- default="admin" minOccurs="0" />
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0" />
- <xsd:element name="password" type="xsd:string"
- default="password" minOccurs="0" />
- <!-- TODO: Need to have a non WebLogic (previously OC4J) default or route through server platform by default -->
- <xsd:element name="initial-context-factory-name"
- type="xsd:string"
- default="weblogic.jndi.WLInitialContextFactory"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- initial context factory class for naming service
- should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether
- naming service requires extra property that is
- not defined by EclipseLink but it is required by the
- user application
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:group name="event-listener-classes">
- <xsd:sequence>
- <xsd:element name="event-listener-class" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:group name="struct-converters">
- <xsd:sequence>
- <xsd:element name="struct-converter" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="preallocation-size" type="xsd:integer"
- default="50" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence preallocation size.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>
- References default sequence object, overriding its name
- and (optionally) preallocation size.
- </xsd:documentation>
- <xsd:documentation>
- To use preallocation size of default sequence object,
- set preallocation size to 0
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Database sequence mechanism used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="table" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-field" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Unary table sequence - sequence name is a table name,
- table has a single field and a single row
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="root-element" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-element" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-element"
- type="xsd:string" default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which document preservation
- strategy will be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which node ordering strategy will
- be used.
- </xsd:documentation>
- </xsd:annotation></xsd:complexType>
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservation Policy that
- accesses the session cache to store Objects and their
- associated nodes.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- A DocumentPreservationPolicy to indicate that no
- document preservation work should be done.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservationPolicy that
- maintains bidirectional relationships between Java
- Objects and the XMLNodes they originated from.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that simply
- appends the new child element to the parent.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that ignores any
- new elements when updating a cached document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that adds new
- elements to an XML Document based on the last updated
- sibling in their context.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.0.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.0.xsd
deleted file mode 100644
index c84821e948..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.0.xsd
+++ /dev/null
@@ -1,1591 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
- tware - update version number to 2.0
-*****************************************************************************/
--->
-<!--
-
-XML Schema definition for the Eclipse Persistence Services Project Session Configuration file. Instances
-of this file are typically located as: 'META-INF/sessions.xml'
-
- -->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" version="2.0">
- <xsd:element name="sessions">
- <xsd:annotation>
- <xsd:documentation>
- This is the root element and exists only for XML
- structure
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="session" minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="session">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes a particular session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- Generic element used to describe a string that
- represents the name of an item
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="server-platform" type="server-platform"
- minOccurs="0" />
- <xsd:choice minOccurs="0">
- <xsd:element name="remote-command">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- session element that define the Remote
- Command Module that can also be used for
- cache synchronization
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="channel"
- type="xsd:string" default="EclipseLinkCommandChannel"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element."
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="commands"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It determine what
- command features, the RCM
- supports
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="cache-sync"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an
- optional element of
- command element. It
- turns on cache
- synchronization to
- allow sending and
- receiving cache sync
- commands
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="transport"
- type="transport-manager" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It defines the
- transport mechanism of the RCM.
- The default transport mechanism
- is RMI
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="event-listener-classes" minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="event-listener-classes" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="profiler" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element represents if the profiler will be
- used by the session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="dms" />
- <xsd:enumeration value="eclipselink" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="exception-handler-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the class that the session will use to
- handle exceptions generated from within the
- session
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging" type="log" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element used to specify the logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="session-customizer-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the session customizer
- class to run on a loaded session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="server-platform">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes which server
- platform to use, JTA settings and runtime services
- settings
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="enable-runtime-services"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not the JMX MBean for
- providing runtime services is deployed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-jta" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not this session will
- integrate with the JTA (i.e. whether the session
- will be populated with a transaction controller
- class. The choice of server-class will
- automatically be chosen based on the transaction
- controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="custom-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform">
- <xsd:sequence>
- <xsd:element name="server-class" type="xsd:string"
- default="org.eclipse.persistence.platform.server.CustomServerPlatform"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the subclass of
- org.eclipse.persistence.platform.server.PlatformBase
- to specify which server platform to use
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="external-transaction-controller-class" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-903-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-904-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1012-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1013-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1111-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform"/>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-70-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-81-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-9-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-10-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-40-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-50-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-51-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-60-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-7-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jboss-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="session-broker">
- <xsd:annotation>
- <xsd:documentation>
- Provides a single view to a session that
- transparently accesses multple databases.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="session-name" type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the
- session name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="project">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="xml">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:simpleType name="class">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:complexType name="database-session">
- <xsd:annotation>
- <xsd:documentation>
- The session is the primary interface into EclipseLink, the
- application should do all of its reading and writing of
- objects through the session. The session also manages
- transactions and units of work. The database session is
- intended for usage in two-tier client-server
- applications. Although it could be used in a server
- situation, it is limitted to only having a single
- database connection and only allows a single open
- database transaction.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="primary-project" type="project"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This project (class or xml) will be
- loaded as the primary project for the
- session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="additional-project"
- type="project" minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- Additional projects will have their
- descriptors appended to the primary
- project.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-session">
- <xsd:annotation>
- <xsd:documentation>
- Is an extension of a DatabaseSession
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="database-session">
- <xsd:sequence>
- <xsd:element name="connection-pools"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Connection pools are only for usage with
- internal connection pooling and should
- not be used if using external connection
- pooling
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="read-connection-pool"
- type="read-connection-pool" minOccurs="0" />
- <xsd:element
- name="write-connection-pool" type="connection-pool"
- minOccurs="0" />
- <xsd:element
- name="sequence-connection-pool" type="connection-pool"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set this tag to use the
- sequence connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-pool"
- type="connection-pool" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-policy"
- type="connection-policy" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-policy">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how default client sessions are acquired
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exclusive-connection" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if an exclusive connection should be
- used for reads, required for VPD, or user based
- read security.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lazy" type="xsd:boolean" default="true"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if a connection should be acquired and
- held upfront in the client session, or only
- acquired when needed and then released.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="login">
- <xsd:annotation>
- <xsd:documentation>
- Defines common fields for database-login and eis-login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="platform-class" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the platform
- class name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="password" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="table-qualifier" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set the default qualifier for all tables. This
- can be the creator of the table or database name
- the table exists on. This is required by some
- databases such as Oracle and DB2.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-connection-pooling"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the connection should use an
- external connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-transaction-controller"
- type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the session will be using an
- external transaction controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequencing" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequencing information.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="default-sequence"
- type="sequence" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Default sequence. The name is
- optional. If no name provided an
- empty string will be used as a name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequences" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Non default sequences. Make sure
- each sequence has unique name.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="sequence"
- type="sequence" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of a login.
- It is used to define extra properties on the
- login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>
- Holds the configuration information necessary to connect
- to a JDBC driver.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:choice minOccurs="0">
- <xsd:sequence>
- <xsd:element name="driver-class"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- The driver class is the Java
- class for the JDBC driver to be
- used (e.g.
- sun.jdbc.odbc.JdbcOdbcDriver.class)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-url"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL that will be
- used to connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:element name="datasource">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL of a datasource that
- may be used by the session to
- connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lookup"
- type="lookup-enum" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="bind-all-parameters"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to bind all arguments to any
- SQL statement.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cache-all-statements"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether prepared statements should
- be cached.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="byte-array-binding"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- parameter binding for large binary data.
- By default EclipseLink will print this data
- as hex through the JDBC binary excape
- clause. Both binding and printing have
- various limits on all databases (e.g. 5k
- - 32k).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="string-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if strings should be bound.
- Used to help bean introspection.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="streams-for-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use streams
- to store large binary data. This can
- improve the max size for reading/writing
- on some JDBC drivers.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="force-field-names-to-upper-case"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This setting can be used if the
- application expects upper case but the
- database does not return consistent case
- (e.g. different databases).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="optimize-data-conversion"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether driver level data conversion
- optimization is enabled. This can be
- disabled as some drivers perform data
- conversion themselves incorrectly.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="trim-strings" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- By default CHAR field values have
- trailing blanks trimmed, this can be
- configured.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="batch-writing" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use batch
- writing. This facility allows multiple
- write operations to be submitted to a
- database for processing at once.
- Submitting multiple updates together,
- instead of individually, can greatly
- improve performance in some situations.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jdbc-batch-writing"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Setting this tag with true indicates to
- EclipseLink that the JDBC driver supports
- batch writing. EclipseLink's internal batch
- writing is disabled. Setting this tag
- with false indicates to EclipseLink that the
- JDBC driver does not support batch
- writing. This will revert to the default
- behaviour which is to delegate to
- EclipseLink's internal batch writing.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-batch-writing-size"
- type="xsd:integer" default="32000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Allow for the max batch writing size to
- be set. This allows for the batch size
- to be limited as most database have
- strict limits. The size is in
- characters, the default is 32000 but the
- real value depends on the database
- configuration.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="native-sql" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- database specific sql grammar not JDBC
- specific. This is because unfortunately
- some bridges to not support the full
- JDBC standard. By default EclipseLink uses
- the JDBC sql grammar.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="struct-converters"
- minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="struct-converters" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-health-validated-on-error" type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>If true will cause EclipseLink to ping database to determine if an SQLException was cause by a communication failure</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="query-retry-attempt-count" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the number of attempts EclipseLink will make if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="delay-between-reconnect-attempts" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the time in miliseconds that EclipseLink will wait between attempts to reconnect if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ping-sql" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Override the platform specific SQL that EclipseLink will issue to a connection to determine if the connection is still live.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="lookup-enum">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="composite-name" />
- <xsd:enumeration value="compound-name" />
- <xsd:enumeration value="string" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines connection information and datasource
- properties. There are three ways to connect through EIS,
- - Provide a JNDI name to the ConnectionFactory and use
- the default getConnection - Provide a JNDI name to the
- ConnectionFactory, and a driver specific ConnectionSpec
- to pass to the getConnection - Connect in a non-managed
- way directly to the driver specific ConnectionFactory An
- EISConnectionSpec must be provided to define how to
- connect to the EIS adapter. The EIS platform can be used
- to provide datasource/driver specific behavoir such as
- InteractionSpec and Record conversion.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="connection-spec-class"
- type="xsd:string" minOccurs="0" />
- <xsd:element name="connection-factory-url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines login and platform type to be used
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="equal-namespace-resolvers"
- type="xsd:boolean" maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="document-preservation-policy"
- maxOccurs="1" minOccurs="0"
- type="document-preservation-policy">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how connections should be pooled in a
- server session.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element name="max-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The max number of connections that will be
- created in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="min-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The min number of connections that will aways be
- in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="read-connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- The read connection pool is used for read access through
- the server session. Any of the connection pools can be
- used for the read pool however this is the default. This
- pool allows for concurrent reads against the same JDBC
- connection and requires that the JDBC connection support
- concurrent read access.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="connection-pool">
- <xsd:sequence>
- <xsd:element name="exclusive" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This tag is used to specify if the
- connections from the read connection
- pool are exclusive or not
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the common logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="java-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Java log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eclipselink-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the EclipseLink log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="log-level" default="info"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the log level for logging
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="off" />
- <xsd:enumeration value="severe" />
- <xsd:enumeration value="warning" />
- <xsd:enumeration value="info" />
- <xsd:enumeration value="config" />
- <xsd:enumeration value="fine" />
- <xsd:enumeration value="finer" />
- <xsd:enumeration value="finest" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="file-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Name of the file to write the logging to
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Server log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logging-options">
- <xsd:sequence>
- <xsd:element name="log-exception-stacktrace"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log exception stacktrace. Without
- this element, the stacktrace is logged for FINER
- or less (FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-thread" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log thread. Without this element,
- the thread is logged for FINE or less (FINER or
- FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-session" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log session. Without this
- element, the session is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-connection" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log connection. Without this
- element, the connection is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-date" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log date. Without this element,
- the date is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="transport-manager">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the transport mechanism of the RCM.
- The default transport mechanism is RMI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="on-connection-error"
- default="DiscardConnection" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element and has value of "DiscardConnection" or
- "KeepConnection". It determines whether
- connection to a RCM service should be dropped if
- there is a communication error with that RCM
- service. The default value for this element is
- "DiscardConnection".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="KeepConnection" />
- <xsd:enumeration value="DiscardConnection" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="rmi-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It defines the RMI transport mechanism. The
- default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="send-mode" default="Asynchronous"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element and has value of
- "Asynchronous" or "Synchronous". It
- determines whether the RCM propagates
- command and does not wait for command to
- finish its execution in asynchronous
- mode or wait for command to finish its
- execution in synchronous mode. The
- default value of this element is
- "Asynchronous".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="Asynchronous" />
- <xsd:enumeration value="Synchronous" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="discovery" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element. It determines whether the
- Discovery settings should be changed.
- Note that a default Discovery with its
- default settings is created when the rmi
- element is specified.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="multicast-group-address" type="xsd:string"
- default="226.10.12.64" minOccurs="0" />
- <xsd:element name="multicast-port"
- type="xsd:integer" default="3121" minOccurs="0" />
- <xsd:element name="announcement-delay"
- type="xsd:integer" default="1000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the multicast group
- address should be changed.
- The default value of this
- element is "1000"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="packet-time-to-live"
- type="xsd:integer" default="2" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the time-to-live of
- the packets that are sent
- from the Discovery's
- mulsticast socket should be
- changed. The default value
- of this element is "2"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:choice minOccurs="0">
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- <xsd:element
- name="rmi-registry-naming-service">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element
- of rmi elemenent. It determines
- whether RMI registry should be used
- for naming service
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="rmi-iiop-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the RMI-IIOP transport mechanism of
- the RCM. The default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="rmi-transport" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jms-topic-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the JMS topic transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="topic-host-url" type="xsd:string"
- minOccurs="0" />
- <xsd:element name="topic-connection-factory-name"
- type="xsd:string" default="jms/EclipseLinkTopicConnectionFactory"
- minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- default="jms/EclipseLinkTopic" minOccurs="0" />
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-jgroups-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the OC4J JGroups transport
- mechanism of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="use-single-threaded-notification"
- type="xsd:boolean" default="false" minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sun-corba-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the Sun CORBA transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="user-defined-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It determines whether a user implemented
- transport mechanism that should be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="transport-class"
- type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jndi-naming-service">
- <xsd:sequence>
- <xsd:element name="url" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- URL for naming service should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- default="admin" minOccurs="0" />
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0" />
- <xsd:element name="password" type="xsd:string"
- default="password" minOccurs="0" />
- <!-- TODO: Need to have a non WebLogic (previously OC4J) default or route through server platform by default -->
- <xsd:element name="initial-context-factory-name"
- type="xsd:string"
- default="weblogic.jndi.WLInitialContextFactory"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- initial context factory class for naming service
- should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether
- naming service requires extra property that is
- not defined by EclipseLink but it is required by the
- user application
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:group name="event-listener-classes">
- <xsd:sequence>
- <xsd:element name="event-listener-class" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:group name="struct-converters">
- <xsd:sequence>
- <xsd:element name="struct-converter" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="preallocation-size" type="xsd:integer"
- default="50" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence preallocation size.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>
- References default sequence object, overriding its name
- and (optionally) preallocation size.
- </xsd:documentation>
- <xsd:documentation>
- To use preallocation size of default sequence object,
- set preallocation size to 0
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Database sequence mechanism used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="table" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-field" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Unary table sequence - sequence name is a table name,
- table has a single field and a single row
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="root-element" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-element" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-element"
- type="xsd:string" default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which document preservation
- strategy will be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which node ordering strategy will
- be used.
- </xsd:documentation>
- </xsd:annotation></xsd:complexType>
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservation Policy that
- accesses the session cache to store Objects and their
- associated nodes.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- A DocumentPreservationPolicy to indicate that no
- document preservation work should be done.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservationPolicy that
- maintains bidirectional relationships between Java
- Objects and the XMLNodes they originated from.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that simply
- appends the new child element to the parent.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that ignores any
- new elements when updating a cached document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that adds new
- elements to an XML Document based on the last updated
- sibling in their context.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.1.xsd b/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.1.xsd
deleted file mode 100644
index 61697113d8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/schemas/eclipselink_sessions_2.1.xsd
+++ /dev/null
@@ -1,1598 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation from Oracle TopLink
- tware - update version number to 2.0
- pkrogh- update version number to 2.1
- agoerler - add Net weaver support
-*****************************************************************************/
--->
-<!--
-
-XML Schema definition for the Eclipse Persistence Services Project Session Configuration file. Instances
-of this file are typically located as: 'META-INF/sessions.xml'
-
- -->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" version="2.1">
- <xsd:element name="sessions">
- <xsd:annotation>
- <xsd:documentation>
- This is the root element and exists only for XML
- structure
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="session" type="session" minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:complexType name="session">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes a particular session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- Generic element used to describe a string that
- represents the name of an item
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="server-platform" type="server-platform"
- minOccurs="0" />
- <xsd:choice minOccurs="0">
- <xsd:element name="remote-command">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- session element that define the Remote
- Command Module that can also be used for
- cache synchronization
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="channel"
- type="xsd:string" default="EclipseLinkCommandChannel"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element."
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="commands"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It determine what
- command features, the RCM
- supports
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="cache-sync"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an
- optional element of
- command element. It
- turns on cache
- synchronization to
- allow sending and
- receiving cache sync
- commands
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="transport"
- type="transport-manager" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of remote-command
- element. It defines the
- transport mechanism of the RCM.
- The default transport mechanism
- is RMI
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="event-listener-classes" minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="event-listener-classes" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="profiler" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element represents if the profiler will be
- used by the session
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="dms" />
- <xsd:enumeration value="eclipselink" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="exception-handler-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the class that the session will use to
- handle exceptions generated from within the
- session
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging" type="log" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element used to specify the logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="session-customizer-class"
- type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the session customizer
- class to run on a loaded session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="server-platform">
- <xsd:annotation>
- <xsd:documentation>
- This is the node element that describes which server
- platform to use, JTA settings and runtime services
- settings
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="enable-runtime-services"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not the JMX MBean for
- providing runtime services is deployed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="enable-jta" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element. This
- specifies whether or not this session will
- integrate with the JTA (i.e. whether the session
- will be populated with a transaction controller
- class. The choice of server-class will
- automatically be chosen based on the transaction
- controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="custom-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform">
- <xsd:sequence>
- <xsd:element name="server-class" type="xsd:string"
- default="org.eclipse.persistence.platform.server.CustomServerPlatform"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the subclass of
- org.eclipse.persistence.platform.server.PlatformBase
- to specify which server platform to use
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element
- name="external-transaction-controller-class" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-903-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-904-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1012-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1013-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-1111-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform"/>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-70-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-81-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-9-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="weblogic-10-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-40-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-50-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-51-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-60-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-61-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="websphere-7-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jboss-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="netweaver-71-platform">
- <xsd:complexContent>
- <xsd:extension base="server-platform" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="session-broker">
- <xsd:annotation>
- <xsd:documentation>
- Provides a single view to a session that
- transparently accesses multple databases.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="session-name" type="xsd:string"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the
- session name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="project">
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- <xsd:simpleType name="xml">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:simpleType name="class">
- <xsd:restriction base="project" />
- </xsd:simpleType>
- <xsd:complexType name="database-session">
- <xsd:annotation>
- <xsd:documentation>
- The session is the primary interface into EclipseLink, the
- application should do all of its reading and writing of
- objects through the session. The session also manages
- transactions and units of work. The database session is
- intended for usage in two-tier client-server
- applications. Although it could be used in a server
- situation, it is limitted to only having a single
- database connection and only allows a single open
- database transaction.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="session">
- <xsd:sequence>
- <xsd:element name="primary-project" type="project"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This project (class or xml) will be
- loaded as the primary project for the
- session.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="additional-project"
- type="project" minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- Additional projects will have their
- descriptors appended to the primary
- project.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-session">
- <xsd:annotation>
- <xsd:documentation>
- Is an extension of a DatabaseSession
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="database-session">
- <xsd:sequence>
- <xsd:element name="connection-pools"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Connection pools are only for usage with
- internal connection pooling and should
- not be used if using external connection
- pooling
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="read-connection-pool"
- type="read-connection-pool" minOccurs="0" />
- <xsd:element
- name="write-connection-pool" type="connection-pool"
- minOccurs="0" />
- <xsd:element
- name="sequence-connection-pool" type="connection-pool"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set this tag to use the
- sequence connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-pool"
- type="connection-pool" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-policy"
- type="connection-policy" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-policy">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how default client sessions are acquired
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="exclusive-connection" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if an exclusive connection should be
- used for reads, required for VPD, or user based
- read security.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="lazy" type="xsd:boolean" default="true"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Specifies if a connection should be acquired and
- held upfront in the client session, or only
- acquired when needed and then released.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="login">
- <xsd:annotation>
- <xsd:documentation>
- Defines common fields for database-login and eis-login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="platform-class" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This is the element that represents the platform
- class name
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="password" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is used in the login as well as the
- Cache Synchronization feature
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="table-qualifier" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set the default qualifier for all tables. This
- can be the creator of the table or database name
- the table exists on. This is required by some
- databases such as Oracle and DB2.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-connection-pooling"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the connection should use an
- external connection pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="external-transaction-controller"
- type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if the session will be using an
- external transaction controller
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequencing" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequencing information.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="default-sequence"
- type="sequence" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Default sequence. The name is
- optional. If no name provided an
- empty string will be used as a name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="sequences" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Non default sequences. Make sure
- each sequence has unique name.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="sequence"
- type="sequence" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of a login.
- It is used to define extra properties on the
- login
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="database-login">
- <xsd:annotation>
- <xsd:documentation>
- Holds the configuration information necessary to connect
- to a JDBC driver.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:choice minOccurs="0">
- <xsd:sequence>
- <xsd:element name="driver-class"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- The driver class is the Java
- class for the JDBC driver to be
- used (e.g.
- sun.jdbc.odbc.JdbcOdbcDriver.class)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="connection-url"
- type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL that will be
- used to connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:element name="datasource">
- <xsd:annotation>
- <xsd:documentation>
- This is the URL of a datasource that
- may be used by the session to
- connect to the database.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lookup"
- type="lookup-enum" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element name="bind-all-parameters"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to bind all arguments to any
- SQL statement.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="cache-all-statements"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether prepared statements should
- be cached.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="byte-array-binding"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- parameter binding for large binary data.
- By default EclipseLink will print this data
- as hex through the JDBC binary excape
- clause. Both binding and printing have
- various limits on all databases (e.g. 5k
- - 32k).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="string-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set to true if strings should be bound.
- Used to help bean introspection.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="streams-for-binding"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use streams
- to store large binary data. This can
- improve the max size for reading/writing
- on some JDBC drivers.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="force-field-names-to-upper-case"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This setting can be used if the
- application expects upper case but the
- database does not return consistent case
- (e.g. different databases).
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="optimize-data-conversion"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether driver level data conversion
- optimization is enabled. This can be
- disabled as some drivers perform data
- conversion themselves incorrectly.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="trim-strings" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- By default CHAR field values have
- trailing blanks trimmed, this can be
- configured.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="batch-writing" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use batch
- writing. This facility allows multiple
- write operations to be submitted to a
- database for processing at once.
- Submitting multiple updates together,
- instead of individually, can greatly
- improve performance in some situations.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="jdbc-batch-writing"
- type="xsd:boolean" default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Setting this tag with true indicates to
- EclipseLink that the JDBC driver supports
- batch writing. EclipseLink's internal batch
- writing is disabled. Setting this tag
- with false indicates to EclipseLink that the
- JDBC driver does not support batch
- writing. This will revert to the default
- behaviour which is to delegate to
- EclipseLink's internal batch writing.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="max-batch-writing-size"
- type="xsd:integer" default="32000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Allow for the max batch writing size to
- be set. This allows for the batch size
- to be limited as most database have
- strict limits. The size is in
- characters, the default is 32000 but the
- real value depends on the database
- configuration.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="native-sql" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- EclipseLink can be configured to use
- database specific sql grammar not JDBC
- specific. This is because unfortunately
- some bridges to not support the full
- JDBC standard. By default EclipseLink uses
- the JDBC sql grammar.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="struct-converters"
- minOccurs="0">
- <xsd:complexType>
- <xsd:group ref="struct-converters" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="connection-health-validated-on-error" type="xsd:boolean" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>If true will cause EclipseLink to ping database to determine if an SQLException was cause by a communication failure</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="query-retry-attempt-count" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the number of attempts EclipseLink will make if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="delay-between-reconnect-attempts" type="xsd:integer" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Configure the time in miliseconds that EclipseLink will wait between attempts to reconnect if EclipseLink is attempting to retry a query.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="ping-sql" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>Override the platform specific SQL that EclipseLink will issue to a connection to determine if the connection is still live.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:simpleType name="lookup-enum">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="composite-name" />
- <xsd:enumeration value="compound-name" />
- <xsd:enumeration value="string" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="eis-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines connection information and datasource
- properties. There are three ways to connect through EIS,
- - Provide a JNDI name to the ConnectionFactory and use
- the default getConnection - Provide a JNDI name to the
- ConnectionFactory, and a driver specific ConnectionSpec
- to pass to the getConnection - Connect in a non-managed
- way directly to the driver specific ConnectionFactory An
- EISConnectionSpec must be provided to define how to
- connect to the EIS adapter. The EIS platform can be used
- to provide datasource/driver specific behavoir such as
- InteractionSpec and Record conversion.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="connection-spec-class"
- type="xsd:string" minOccurs="0" />
- <xsd:element name="connection-factory-url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-login">
- <xsd:annotation>
- <xsd:documentation>
- Defines login and platform type to be used
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="login">
- <xsd:sequence>
- <xsd:element name="equal-namespace-resolvers"
- type="xsd:boolean" maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="document-preservation-policy"
- maxOccurs="1" minOccurs="0"
- type="document-preservation-policy">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- Used to specify how connections should be pooled in a
- server session.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" />
- <xsd:element name="max-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The max number of connections that will be
- created in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="min-connections" type="xsd:integer"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- The min number of connections that will aways be
- in the pool
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="login" type="login" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="read-connection-pool">
- <xsd:annotation>
- <xsd:documentation>
- The read connection pool is used for read access through
- the server session. Any of the connection pools can be
- used for the read pool however this is the default. This
- pool allows for concurrent reads against the same JDBC
- connection and requires that the JDBC connection support
- concurrent read access.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="connection-pool">
- <xsd:sequence>
- <xsd:element name="exclusive" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This tag is used to specify if the
- connections from the read connection
- pool are exclusive or not
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the common logging options
- </xsd:documentation>
- </xsd:annotation>
- </xsd:complexType>
- <xsd:complexType name="java-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Java log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="eclipselink-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the EclipseLink log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log">
- <xsd:sequence>
- <xsd:element name="log-level" default="info"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies the log level for logging
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="off" />
- <xsd:enumeration value="severe" />
- <xsd:enumeration value="warning" />
- <xsd:enumeration value="info" />
- <xsd:enumeration value="config" />
- <xsd:enumeration value="fine" />
- <xsd:enumeration value="finer" />
- <xsd:enumeration value="finest" />
- <xsd:enumeration value="all" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="file-name" type="xsd:string"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Name of the file to write the logging to
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="logging-options"
- type="logging-options" minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="server-log">
- <xsd:annotation>
- <xsd:documentation>
- Defines the options of the Server log
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="log" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="logging-options">
- <xsd:sequence>
- <xsd:element name="log-exception-stacktrace"
- type="xsd:boolean" default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log exception stacktrace. Without
- this element, the stacktrace is logged for FINER
- or less (FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-thread" type="xsd:boolean"
- default="false" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log thread. Without this element,
- the thread is logged for FINE or less (FINER or
- FINEST)
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-session" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log session. Without this
- element, the session is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-connection" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log connection. Without this
- element, the connection is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="print-date" type="xsd:boolean"
- default="true" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Set whether to log date. Without this element,
- the date is always printed
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="transport-manager">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the transport mechanism of the RCM.
- The default transport mechanism is RMI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="on-connection-error"
- default="DiscardConnection" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element and has value of "DiscardConnection" or
- "KeepConnection". It determines whether
- connection to a RCM service should be dropped if
- there is a communication error with that RCM
- service. The default value for this element is
- "DiscardConnection".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="KeepConnection" />
- <xsd:enumeration value="DiscardConnection" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="rmi-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It defines the RMI transport mechanism. The
- default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="send-mode" default="Asynchronous"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element and has value of
- "Asynchronous" or "Synchronous". It
- determines whether the RCM propagates
- command and does not wait for command to
- finish its execution in asynchronous
- mode or wait for command to finish its
- execution in synchronous mode. The
- default value of this element is
- "Asynchronous".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="Asynchronous" />
- <xsd:enumeration value="Synchronous" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="discovery" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- rmi element. It determines whether the
- Discovery settings should be changed.
- Note that a default Discovery with its
- default settings is created when the rmi
- element is specified.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="multicast-group-address" type="xsd:string"
- default="226.10.12.64" minOccurs="0" />
- <xsd:element name="multicast-port"
- type="xsd:integer" default="3121" minOccurs="0" />
- <xsd:element name="announcement-delay"
- type="xsd:integer" default="1000" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the multicast group
- address should be changed.
- The default value of this
- element is "1000"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="packet-time-to-live"
- type="xsd:integer" default="2" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional
- element of discovery
- elemenent. It determines
- whether the time-to-live of
- the packets that are sent
- from the Discovery's
- mulsticast socket should be
- changed. The default value
- of this element is "2"
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:choice minOccurs="0">
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- <xsd:element
- name="rmi-registry-naming-service">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element
- of rmi elemenent. It determines
- whether RMI registry should be used
- for naming service
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="url"
- type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="rmi-iiop-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the RMI-IIOP transport mechanism of
- the RCM. The default naming service is JNDI
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="rmi-transport" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jms-topic-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the JMS topic transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="topic-host-url" type="xsd:string"
- minOccurs="0" />
- <xsd:element name="topic-connection-factory-name"
- type="xsd:string" default="jms/EclipseLinkTopicConnectionFactory"
- minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- default="jms/EclipseLinkTopic" minOccurs="0" />
- <xsd:element name="jndi-naming-service"
- type="jndi-naming-service" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="oc4j-jgroups-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the OC4J JGroups transport
- mechanism of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="use-single-threaded-notification"
- type="xsd:boolean" default="false" minOccurs="0" />
- <xsd:element name="topic-name" type="xsd:string"
- minOccurs="0" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="sun-corba-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element defines the Sun CORBA transport mechanism
- of the RCM
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="user-defined-transport">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of transport
- element. It determines whether a user implemented
- transport mechanism that should be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="transport-manager">
- <xsd:sequence>
- <xsd:element name="transport-class"
- type="xsd:string" />
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="jndi-naming-service">
- <xsd:sequence>
- <xsd:element name="url" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- URL for naming service should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="user-name" type="xsd:string"
- default="admin" minOccurs="0" />
- <xsd:element name="encryption-class" type="xsd:string"
- default="org.eclipse.persistence.internal.security.JCEEncryptor"
- minOccurs="0" />
- <xsd:element name="password" type="xsd:string"
- default="password" minOccurs="0" />
- <!-- TODO: Need to have a non WebLogic (previously OC4J) default or route through server platform by default -->
- <xsd:element name="initial-context-factory-name"
- type="xsd:string"
- default="weblogic.jndi.WLInitialContextFactory"
- minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether the
- initial context factory class for naming service
- should be changed.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="property" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- This element is an optional element of
- jndi-naming-service. It determines whether
- naming service requires extra property that is
- not defined by EclipseLink but it is required by the
- user application
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string"
- use="required" />
- <xsd:attribute name="value" type="xsd:string"
- use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:group name="event-listener-classes">
- <xsd:sequence>
- <xsd:element name="event-listener-class" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:group name="struct-converters">
- <xsd:sequence>
- <xsd:element name="struct-converter" type="xsd:string"
- minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:group>
- <xsd:complexType name="sequence">
- <xsd:annotation>
- <xsd:documentation>Sequence object.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence name.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="preallocation-size" type="xsd:integer"
- default="50" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Sequence preallocation size.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="default-sequence">
- <xsd:annotation>
- <xsd:documentation>
- References default sequence object, overriding its name
- and (optionally) preallocation size.
- </xsd:documentation>
- <xsd:documentation>
- To use preallocation size of default sequence object,
- set preallocation size to 0
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="native-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Database sequence mechanism used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="table-sequence">
- <xsd:annotation>
- <xsd:documentation>Table sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="table" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-field" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="unary-table-sequence">
- <xsd:annotation>
- <xsd:documentation>
- Unary table sequence - sequence name is a table name,
- table has a single field and a single row
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="counter-field" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xmlfile-sequence">
- <xsd:annotation>
- <xsd:documentation>Xmlfile sequence.</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence" />
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="xml-sequence">
- <xsd:annotation>
- <xsd:documentation>Xml sequence</xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="sequence">
- <xsd:sequence>
- <xsd:element name="root-element" type="xsd:string"
- default="SEQUENCE" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="name-element" type="xsd:string"
- default="SEQ_NAME" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence name
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="counter-element"
- type="xsd:string" default="SEQ_COUNT" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>
- Define the name of the sequence counter
- field in the sequence table.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
-
- <xsd:complexType name="document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which document preservation
- strategy will be used.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="node-ordering-policy"
- type="node-ordering-policy" maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="node-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- This element specifies which node ordering strategy will
- be used.
- </xsd:documentation>
- </xsd:annotation></xsd:complexType>
-
- <xsd:complexType
- name="descriptor-level-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservation Policy that
- accesses the session cache to store Objects and their
- associated nodes.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="no-document-preservation-policy">
- <xsd:annotation>
- <xsd:documentation>
- A DocumentPreservationPolicy to indicate that no
- document preservation work should be done.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="xml-binder-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of DocumentPreservationPolicy that
- maintains bidirectional relationships between Java
- Objects and the XMLNodes they originated from.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="document-preservation-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="append-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that simply
- appends the new child element to the parent.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ignore-new-elements-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that ignores any
- new elements when updating a cached document.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="relative-position-ordering-policy">
- <xsd:annotation>
- <xsd:documentation>
- An implementation of NodeOrderingPolicy that adds new
- elements to an XML Document based on the last updated
- sibling in their context.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="node-ordering-policy"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-</xsd:schema>
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/JptCommonEclipseLinkCorePlugin.java b/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/JptCommonEclipseLinkCorePlugin.java
deleted file mode 100644
index 60cb45646a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/JptCommonEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.eclipselink.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-
-public class JptCommonEclipseLinkCorePlugin
- extends Plugin {
-
- // ********** public constants **********
-
- /**
- * The plug-in identifier of the jpt common core support
- * (value <code>"org.eclipse.jpt.common.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.common.eclipselink.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
-
- // ********** singleton **********
-
- private static JptCommonEclipseLinkCorePlugin INSTANCE;
-
- /**
- * Return the singleton jpt common eclipselink core plug-in.
- */
- public static JptCommonEclipseLinkCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **********
-
- public JptCommonEclipseLinkCorePlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // nothing yet...
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- // nothing yet...
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/JptCommonEclipseLinkCoreMessages.java b/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/JptCommonEclipseLinkCoreMessages.java
deleted file mode 100644
index 64af708d3b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/JptCommonEclipseLinkCoreMessages.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.eclipselink.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JptCommonEclipseLinkCoreMessages {
-
- public static String EclipseLinkLibraryValidator_noEclipseLinkVersion;
- public static String EclipseLinkLibraryValidator_multipleEclipseLinkVersions;
- public static String EclipseLinkLibraryValidator_improperEclipseLinkVersion;
-
- // TODO - move to jpt.jaxb.eclipselink.core when there are messages there
- public static String ELJaxbUserLibraryValidator_noXjcClasses;
-
-
- private static final String BUNDLE_NAME = "jpt_common_eclipselink_core"; //$NON-NLS-1$
-
- private static final Class<?> BUNDLE_CLASS = JptCommonEclipseLinkCoreMessages.class;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptCommonEclipseLinkCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/libval/EclipseLinkLibValUtil.java b/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/libval/EclipseLinkLibValUtil.java
deleted file mode 100644
index 1ad52aba44..0000000000
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/src/org/eclipse/jpt/common/eclipselink/core/internal/libval/EclipseLinkLibValUtil.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.eclipselink.core.internal.libval;
-
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ToolFactory;
-import org.eclipse.jdt.core.util.IClassFileReader;
-import org.eclipse.jdt.core.util.IFieldInfo;
-import org.eclipse.jpt.common.eclipselink.core.JptCommonEclipseLinkCorePlugin;
-import org.eclipse.jpt.common.eclipselink.core.internal.JptCommonEclipseLinkCoreMessages;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.osgi.framework.Version;
-
-
-public class EclipseLinkLibValUtil {
-
- private final static String VERSION_CLASS_PATH = "org/eclipse/persistence/Version.class"; //$NON-NLS-1$
-
- private final static String VERSION_FIELD_NAME = "version"; //$NON-NLS-1$
-
-
- public static IStatus validate(Iterable<IClasspathEntry> libraryEntries, Set<VersionRange> versionRanges) {
- Version version = null;
- for (IClasspathEntry entry : libraryEntries) {
- String versionString = null;
- if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- IClassFileReader classReader =
- ToolFactory.createDefaultClassFileReader(
- entry.getPath().toFile().getAbsolutePath(), VERSION_CLASS_PATH, IClassFileReader.FIELD_INFOS);
- if (classReader != null) {
- for (IFieldInfo field : classReader.getFieldInfos()) {
- if (StringTools.stringsAreEqual(field.getName(), VERSION_FIELD_NAME.toCharArray())) {
- try {
- versionString = field.getConstantValueAttribute().getConstantValue().getStringValue();
- }
- catch (Exception e) {
- // potentially a bit could go wrong with that last line, but if any
- // assumptions aren't met, there's no value
- }
- break;
- }
- }
- }
- if (versionString != null) {
- if (version != null) {
- return new Status(
- IStatus.ERROR, JptCommonEclipseLinkCorePlugin.PLUGIN_ID,
- JptCommonEclipseLinkCoreMessages.EclipseLinkLibraryValidator_multipleEclipseLinkVersions);
- }
- else {
- version = new Version(versionString);
- }
- }
- }
- }
-
- if (version == null) {
- return new Status(
- IStatus.ERROR, JptCommonEclipseLinkCorePlugin.PLUGIN_ID,
- JptCommonEclipseLinkCoreMessages.EclipseLinkLibraryValidator_noEclipseLinkVersion);
- }
-
- for (VersionRange versionRange : versionRanges) {
- if (! versionRange.isIncluded(version)) {
- return new Status(
- IStatus.ERROR, JptCommonEclipseLinkCorePlugin.PLUGIN_ID,
- JptCommonEclipseLinkCoreMessages.EclipseLinkLibraryValidator_improperEclipseLinkVersion);
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/.classpath b/common/plugins/org.eclipse.jpt.common.ui/.classpath
deleted file mode 100644
index 934fb38085..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/plugins/org.eclipse.jpt.common.ui/.cvsignore b/common/plugins/org.eclipse.jpt.common.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/common/plugins/org.eclipse.jpt.common.ui/.project b/common/plugins/org.eclipse.jpt.common.ui/.project
deleted file mode 100644
index 7fde966914..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/common/plugins/org.eclipse.jpt.common.ui/.settings/org.eclipse.jdt.core.prefs b/common/plugins/org.eclipse.jpt.common.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4ab78dabaf..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Mon Mar 21 17:39:13 EDT 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/common/plugins/org.eclipse.jpt.common.ui/META-INF/MANIFEST.MF b/common/plugins/org.eclipse.jpt.common.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index f36200ae88..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,73 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.common.ui;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.common.ui.JptCommonUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.draw2d;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.0.0)",
- org.eclipse.jst.common.project.facet.ui;bundle-version="[1.3.100,2.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.3.0,2.0.0)"
-Dali-Comment: *NO* EclipseLink friends!
-Export-Package: org.eclipse.jpt.common.ui,
- org.eclipse.jpt.common.ui.internal;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.dialogs;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.jface;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.listeners;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.properties;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.swt;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.util;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.utility;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.utility.swt;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.widgets;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.internal.wizards;
- x-friends:="org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jpa.db.ui,
- org.eclipse.jpt.jpa.ui",
- org.eclipse.jpt.common.ui.jface
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/common/plugins/org.eclipse.jpt.common.ui/about.html b/common/plugins/org.eclipse.jpt.common.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/common/plugins/org.eclipse.jpt.common.ui/build.properties b/common/plugins/org.eclipse.jpt.common.ui/build.properties
deleted file mode 100644
index 7fc780eaa0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/common/plugins/org.eclipse.jpt.common.ui/plugin.properties b/common/plugins/org.eclipse.jpt.common.ui/plugin.properties
deleted file mode 100644
index 4caf90e773..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - Common UI
-providerName=Eclipse Web Tools Platform
diff --git a/common/plugins/org.eclipse.jpt.common.ui/property_files/jpt_common_ui.properties b/common/plugins/org.eclipse.jpt.common.ui/property_files/jpt_common_ui.properties
deleted file mode 100644
index dd48cc6488..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/property_files/jpt_common_ui.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-Boolean_True=True
-Boolean_False=False
-
-NoneSelected=<None>
-DefaultEmpty=Default
-DefaultWithOneParam=Default ({0})
-
-AddRemovePane_AddButtonText=Add...
-AddRemovePane_RemoveButtonText=Remove
-ChooserPane_browseButton=Browse...
-ClassChooserPane_dialogMessage=&Enter type name prefix or pattern (*, ?, or camel case):
-ClassChooserPane_dialogTitle=Class Selection
-PackageChooserPane_dialogTitle=Package Selection
-PackageChooserPane_dialogMessage=&Enter package name prefix or pattern (* = any string, ? = any character):
-EnumComboViewer_default=Default ()
-EnumComboViewer_defaultWithDefault=Default ({0})
-NewNameStateObject_nameMustBeSpecified=A name must be specified.
-NewNameStateObject_nameAlreadyExists=A query with this name already exists.
-
-OptionalMessageDialog_doNotShowWarning=Do not show this &message again
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiPlugin.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiPlugin.java
deleted file mode 100644
index c249775143..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiPlugin.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class JptCommonUiPlugin
- extends AbstractUIPlugin
-{
-
- // ********** constants **********
-
- /**
- * The plug-in identifier of JPT Common UI support (value {@value}).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.common.ui"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- // ********** singleton **********
-
- private static JptCommonUiPlugin INSTANCE;
-
- /**
- * Returns the singleton JPT UI plug-in.
- */
- public static JptCommonUiPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** logging **********
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** construction **********
-
- public JptCommonUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java
deleted file mode 100644
index 4a7154aeee..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui;
-
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DateTime;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * A widget factory is responsible for creating an SWT widget based on the right
- * style. Some style shows the widgets differently, for instance, the flat style
- * shows the widgets with less borders.
- * <p>
- * Provisional API: This interface is part of an interim API that is still under
- * development and expected to change significantly before reaching stability.
- * It is available at this early stage to solicit feedback from pioneering
- * adopters on the understanding that any code that uses this API will almost
- * certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.0
- * @since 2.0
- */
-public interface WidgetFactory {
-
- /**
- * Creates a new regular button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createButton(Composite parent, String text);
-
- /**
- * Creates a new non-editable custom <code>Combo</code>.
- *
- * @deprecated
- * @param parent The parent container
- * @return A new <code>CCombo</code>
- */
- @Deprecated
- CCombo createCCombo(Composite parent);
-
- /**
- * Creates a new check box button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createCheckBox(Composite parent, String text);
-
- /**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param parent The parent container
- * @return A new <code>Combo</code>
- */
- Combo createCombo(Composite parent);
-
- /**
- * Creates a new container.
- *
- * @param parent The parent container
- * @return A new <code>Composite</code>
- */
- Composite createComposite(Composite parent);
-
- /**
- * Creates a new DateTime.
- *
- * @param container The parent container
- * @param style The style is to tell the type of widget
- * (<code>SWT.DATE</code> or <code>SWT.TIME</code> or <code>SWT.CALENDAR</code>)
- * @return A new <code>DateTime</code>
- */
- DateTime createDateTime(Composite parent, int style);
-
- /**
- * Creates a new editable custom <code>CCombo</code>.
- *
- * @deprecated
- * @param parent The parent container
- * @return A new <code>CCombo</code>
- */
- @Deprecated
- CCombo createEditableCCombo(Composite parent);
-
- /**
- * Creates a new editable <code>Combo</code>.
- *
- * @param parent The parent container
- * @return A new <code>Combo</code>
- */
- Combo createEditableCombo(Composite parent);
-
- /**
- * Creates a new titled pane (group box).
- *
- * @param parent The parent container
- * @param title The group pane's title
- * @return A new <code>Group</code>
- */
- Group createGroup(Composite parent, String title);
-
- /**
- * Creates a new label that is shown as a hyperlink.
- *
- * @param parent The parent container
- * @param text The label's text
- * @return A new <code>Hyperlink</code>
- */
- Hyperlink createHyperlink(Composite parent, String text);
-
- /**
- * Creates a new label.
- *
- * @param container The parent container
- * @param labelText The label's text
- * @return A new <code>Label</code>
- */
- Label createLabel(Composite container, String labelText);
-
- /**
- * Creates a new list.
- *
- * @param container The parent container
- * @param style The style is usually to tell what type of selection
- * (<code>SWT.MULTI</code> or <code>SWT.SINGLE</code>)
- * @return A new <code>Label</code>
- */
- List createList(Composite container, int style);
-
- /**
- * Creates a new label that can be wrapped on multiple lines.
- *
- * @param container The parent container
- * @param labelText The label's text
- * @return A new <code>FormText</code>
- */
- FormText createMultiLineLabel(Composite container, String labelText);
-
- /**
- * Creates a new editable text area.
- *
- * @param parent The parent container
- * @param parent The number of lines the text area should display
- * @return A new <code>Text</code>
- */
- Text createMultiLineText(Composite parent);
-
- /**
- * Creates a new editable text field that handles password.
- *
- * @param container The parent container
- * @return A new <code>Text</code>
- */
- Text createPasswordText(Composite container);
-
- /**
- * Creates a new push button (toggle between selected and unselected).
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createPushButton(Composite parent, String text);
-
- /**
- * Creates a new radio button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createRadioButton(Composite parent, String text);
-
- /**
- * Creates a new section, which is a collapsable pane with a title bar.
- *
- * @param parent The parent container
- * @param style The style of the title bar, which can be
- * <code>ExpandableComposite.TWISTIE</code> and
- * <code>ExpandableComposite.TITLE_BAR</code>
- * @return A new <code>Section</code>
- */
- Section createSection(Composite parent, int style);
-
- /**
- * Creates a new spinner.
- *
- * @param parent The parent container
- * @return A new <code>Spinner</code>
- */
- Spinner createSpinner(Composite parent);
-
- /**
- * Creates a new table.
- *
- * @param container The parent container
- * @param style The style to apply to the table
- * @return A new <code>Table</code>
- */
- Table createTable(Composite parent, int style);
-
- /**
- * Creates a new editable text field.
- *
- * @param container The parent container
- * @return A new <code>Text</code>
- */
- Text createText(Composite parent);
-
- /**
- * Creates a new tri-state check box.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code> that has 3 selection states
- */
- Button createTriStateCheckBox(Composite parent, String text);
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptCommonUiMessages.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptCommonUiMessages.java
deleted file mode 100644
index 75e14336c4..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptCommonUiMessages.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali UI.
- *
- * @version 3.0
- * @since 1.0
- */
-public class JptCommonUiMessages {
-
-
- public static String Boolean_True;
- public static String Boolean_False;
-
- public static String DefaultEmpty;
- public static String DefaultWithOneParam;
- public static String NoneSelected;
-
- public static String AddRemovePane_AddButtonText;
- public static String AddRemovePane_RemoveButtonText;
-
- public static String ChooserPane_browseButton;
- public static String ClassChooserPane_dialogMessage;
- public static String ClassChooserPane_dialogTitle;
- public static String PackageChooserPane_dialogMessage;
- public static String PackageChooserPane_dialogTitle;
- public static String EnumComboViewer_default;
- public static String EnumComboViewer_defaultWithDefault;
- public static String NewNameStateObject_nameAlreadyExists;
- public static String NewNameStateObject_nameMustBeSpecified;
-
- public static String OptionalMessageDialog_doNotShowWarning;
-
- private static final String BUNDLE_NAME = "jpt_common_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptCommonUiMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptCommonUiMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java
deleted file mode 100644
index 7826015d18..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.ui.JptCommonUiPlugin;
-
-/**
- * This tracing class manages to convert the string value into boolean values or
- * integer values that are associated with the tracing debug flags. Those flags
- * are specified in the .options file. The supported keys are defined here as
- * constants for quick reference.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class Tracing
-{
- /**
- * A constant used to retrieve the value associated with "/debug".
- */
- public static final String DEBUG = "/debug";
-
- /**
- * A constant used to retrieve the value associated with "/debug/ui/db".
- */
- public static final String UI_DB = "/debug/ui/db";
-
- /**
- * A constant used to retrieve the value associated with "/debug/ui/detailsView".
- */
- public static final String UI_DETAILS_VIEW = "/debug/ui/detailsView";
-
- /**
- * A constant used to retrieve the value associated with "/debug/ui/layout".
- */
- public static final String UI_LAYOUT = "/debug/ui/layout";
-
- /**
- * A constant used to retrieve the value associated with "/unit-tests".
- */
- public static final String UNIT_TESTS = "/unit-tests";
-
- /**
- * Can't instantiate this <code>Tracing</code> class.
- */
- private Tracing()
- {
- super();
- throw new UnsupportedOperationException("Tracing cannot be instantiated");
- }
-
- /**
- * Retrieves the debug value associated with the given flag. The default
- * value is <code>false</code>.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @return <code>true</code> if the given flag is active; <code>false</code>
- * otherwise
- */
- public static boolean booleanDebugOption(String flag)
- {
- return booleanDebugOption(flag, false);
- }
-
- /**
- * Retrieves the debug value associated with the given flag.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @param defaultValue The default value if the value associated with the
- * given flag could not be found
- * @return <code>true</code> if the given flag is active; <code>false</code>
- * otherwise
- */
- public static boolean booleanDebugOption(String flag, boolean defaultValue)
- {
- String string = Platform.getDebugOption(JptCommonUiPlugin.PLUGIN_ID + flag);
- return (string == null) ? defaultValue : Boolean.parseBoolean(string.trim());
- }
-
- /**
- * Retrieves the debug value associated with the given flag. The default value
- * is 0.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static int intDebugOption(String flag)
- {
- return intDebugOption(flag, 0);
- }
-
- /**
- * Retrieves the debug value associated with the given flag.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @param defaultValue The default value if the value associated with the
- * given flag could not be found
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static int intDebugOption(String flag, int defaultValue)
- {
- String string = Platform.getDebugOption(JptCommonUiPlugin.PLUGIN_ID + flag);
- return (string == null) ? defaultValue : Integer.parseInt(string);
- }
-
- /**
- * Logs the given messages, appends it with this plug-in id.
- *
- * @param message The message to be logged
- */
- public static void log(String message)
- {
- System.out.print("[" + JptCommonUiPlugin.PLUGIN_ID + "] ");
- System.out.println(message);
- }
-
- /**
- * Retrieves the debug value associated with the given flag. The default value
- * is an empty string.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static String stringDebugOption(String flag)
- {
- return stringDebugOption(flag, "");
- }
-
- /**
- * Retrieves the debug value associated with the given flag.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @param defaultValue The default value if the value associated with the
- * given flag could not be found
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static String stringDebugOption(String flag, String defaultValue)
- {
- String string = Platform.getDebugOption(JptCommonUiPlugin.PLUGIN_ID + flag);
- return (string != null) ? string : defaultValue;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/dialogs/OptionalMessageDialog.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/dialogs/OptionalMessageDialog.java
deleted file mode 100644
index bf281fc4de..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/dialogs/OptionalMessageDialog.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.eclipse.jpt.common.ui.internal.dialogs;
-
-import org.eclipse.jdt.internal.ui.JavaPlugin;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A <code>OptionalMessageDialog</code> is a dialog that has a check box allowing the
- * option to no longer show the dialog in the future.
- */
-public abstract class OptionalMessageDialog extends MessageDialog {
-
- private static final String CHECKBOX_TEXT = JptCommonUiMessages.OptionalMessageDialog_doNotShowWarning;
-
- // Dialog store id constants
- private static final String STORE_ID = "OptionalMessageDialog.hide."; //$NON-NLS-1$
-
- public static final int NOT_SHOWN = IDialogConstants.CLIENT_ID + 1;
-
- private final String id;
-
- private final String checkBoxText;
-
- /**
- * Creates a dialog with the given parent.
- *
- * @param parentShell
- * object that returns the current parent shell
- */
- public OptionalMessageDialog(String id, Shell parentShell, String dialogTitle, String dialogMessage, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
- this(id, parentShell, dialogTitle, dialogMessage, dialogType, buttonLabels, defaultButtonIndex, CHECKBOX_TEXT);
- }
-
- /**
- * Creates a dialog with the given parent and a checkbox with the labeled with the text in <code>checkBoxText</code>
- *
- * @param parentShell
- * object that returns the current parent shell
- */
- public OptionalMessageDialog(String id, Shell parentShell, String dialogTitle, String dialogMessage, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkBoxText) {
- super(parentShell, dialogTitle, null, dialogMessage, dialogType, buttonLabels, defaultButtonIndex);
- this.id = id;
- this.checkBoxText = checkBoxText;
- }
-
- @Override
- protected Control createCustomArea(Composite parent) {
- final Button checkbox = new Button(parent, SWT.CHECK);
- checkbox.setText(this.checkBoxText);
- checkbox.setSelection(false);
- checkbox.setLayoutData(new GridData(GridData.FILL_BOTH));
- checkbox.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- setDialogEnabled(id, !((Button)e.widget).getSelection());
- }
- });
- return checkbox;
- }
-
- /**
- * Returns this dialog settings
- *
- * @return the settings to be used
- */
- private static IDialogSettings getDialogSettings() {
- IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings();
- settings= settings.getSection(STORE_ID);
- if (settings == null)
- settings= JavaPlugin.getDefault().getDialogSettings().addNewSection(STORE_ID);
- return settings;
- }
-
- /**
- * Answers whether the optional dialog is enabled and should be shown.
- */
- public static boolean isDialogEnabled(String key) {
- IDialogSettings settings= getDialogSettings();
- return !settings.getBoolean(key);
- }
-
- /**
- * Sets whether the optional dialog is enabled and should be shown.
- */
- public static void setDialogEnabled(String key, boolean isEnabled) {
- IDialogSettings settings= getDialogSettings();
- settings.put(key, !isEnabled);
- }
-
- /**
- * Clears all remembered information about hidden dialogs
- */
- public static void clearAllRememberedStates() {
- IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings();
- settings.addNewSection(STORE_ID);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemLabelProvider.java
deleted file mode 100644
index c351dddcd8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemLabelProvider.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Implementation of {@link ItemLabelProvider} that provides updating
- * label information for a Model object.
- *
- * The typical subclass will override the following methods:
- * #buildImageModel()
- * return a {@link PropertyValueModel} that represents the image for the
- * represented model object
- * #buildTextModel()
- * return a {@link PropertyValueModel} that represents the text for the
- * represented model object.
- * #buildDescriptionModel()
- * return a {@link PropertyValueModel} that represents the description for
- * the represented model object
- *
- * Other methods may be overridden, but take care to preserve the logic provided
- * by this class.
- */
-public abstract class AbstractItemLabelProvider implements ItemLabelProvider
-{
- private DelegatingContentAndLabelProvider labelProvider;
-
- private Model model;
-
- private PropertyValueModel<Image> imageModel;
-
- private PropertyValueModel<String> textModel;
-
- private PropertyValueModel<String> descriptionModel;
-
- private PropertyChangeListener labelChangeListener;
-
-
- protected AbstractItemLabelProvider(
- Model model, DelegatingContentAndLabelProvider labelProvider) {
- this.model = model;
- this.labelProvider = labelProvider;
- this.labelChangeListener = buildLabelChangeListener();
- }
-
-
- /**
- * Construct a listener to update the viewer (through the label provider)
- * if the text or image changes
- */
- protected PropertyChangeListener buildLabelChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- getLabelProvider().updateLabel(getModel());
- }
- };
- }
-
- /**
- * Return the image value model
- * (lazy and just-in-time initialized)
- */
- protected synchronized PropertyValueModel<Image> getImageModel() {
- if (this.imageModel == null) {
- this.imageModel = buildImageModel();
- engageImageModel();
- }
- return this.imageModel;
- }
-
- /**
- * Construct an image model
- */
- protected abstract PropertyValueModel<Image> buildImageModel();
-
- /**
- * Should only be overridden with a call to super.engageImageModel() before
- * subclass logic
- */
- protected void engageImageModel() {
- this.imageModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.labelChangeListener);
- }
-
- /**
- * Should only be overridden with a call to super.disengageImageModel() after
- * subclass logic
- */
- protected void disengageImageModel() {
- this.imageModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.labelChangeListener);
- }
-
- /**
- * Return the text value model
- * (lazy and just-in-time initialized)
- */
- protected synchronized PropertyValueModel<String> getTextModel() {
- if (this.textModel == null) {
- this.textModel = buildTextModel();
- engageTextModel();
- }
- return this.textModel;
- }
-
- /**
- * Construct a text value model
- */
- protected abstract PropertyValueModel<String> buildTextModel();
-
- /**
- * Should only be overridden with a call to super.engageTextModel() before
- * subclass logic
- */
- protected void engageTextModel() {
- this.textModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.labelChangeListener);
- }
-
- /**
- * Should only be overridden with a call to super.disengageTextModel() after
- * subclass logic
- */
- protected void disengageTextModel() {
- this.textModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.labelChangeListener);
- }
-
- /**
- * Return the description value model
- * (lazy and just-in-time initialized)
- */
- protected synchronized PropertyValueModel<String> getDescriptionModel() {
- if (this.descriptionModel == null) {
- this.descriptionModel = buildDescriptionModel();
- engageDescriptionModel();
- }
- return this.descriptionModel;
- }
-
- /**
- * Construct a description value model
- */
- protected abstract PropertyValueModel<String> buildDescriptionModel();
-
- /**
- * Should only be overridden with a call to super.engageDescriptionModel() before
- * subclass logic
- */
- protected void engageDescriptionModel() {
- this.descriptionModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.labelChangeListener);
- }
-
- /**
- * Should only be overridden with a call to super.disengageDescriptionModel() after
- * subclass logic
- */
- protected void disengageDescriptionModel() {
- this.descriptionModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.labelChangeListener);
- }
-
- /**
- * Return the model object represented by this item
- */
- public Model getModel() {
- return this.model;
- }
-
- /**
- * Return the label provider that delegates to this item
- */
- public DelegatingContentAndLabelProvider getLabelProvider() {
- return this.labelProvider;
- }
-
- public Image getImage() {
- return getImageModel().getValue();
- }
-
- public String getText() {
- return getTextModel().getValue();
- }
-
- public String getDescription() {
- return getDescriptionModel().getValue();
- }
-
- public void dispose() {
- disposeTextModel();
- disposeImageModel();
- disposeDescriptionModel();
- }
-
- protected synchronized void disposeTextModel() {
- if (this.textModel != null) {
- disengageTextModel();
- this.textModel = null;
- }
- }
-
- protected synchronized void disposeImageModel() {
- if (this.imageModel != null) {
- disengageImageModel();
- this.imageModel = null;
- }
- }
-
- protected synchronized void disposeDescriptionModel() {
- if (this.descriptionModel != null) {
- disengageDescriptionModel();
- this.descriptionModel = null;
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractTreeItemContentProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractTreeItemContentProvider.java
deleted file mode 100644
index c5631b8d6a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractTreeItemContentProvider.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.NullCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-
-/**
- * Implementation of {@link TreeItemContentProvider} that provides updating
- * children information for a Model object.
- *
- * The typical subclass will override the following methods:
- * #getParent()
- * the default behavior for this method is to return null. there is no
- * property value model for this as this should not be changing for a given
- * node. all such changes will be provided by the parent side of the relationship.
- * #buildChildrenModel()
- * return a {@link ListValueModel} that represents the children for the represented
- * model object. #buildChildrenModel(CollectionValueModel) and
- * #buildChildrenModel(PropertyValueModel) are provided if the children are more
- * easily represented as a collection or as a property (single child)
- * the default behavior is to return a {@link NullListValueModel}
- *
- * Other methods may be overridden, but take care to preserve the logic provided
- * by this class.
- */
-public abstract class AbstractTreeItemContentProvider<E>
- implements TreeItemContentProvider
-{
- private DelegatingTreeContentAndLabelProvider treeContentProvider;
-
- private Model model;
-
- private CollectionValueModel<E> childrenModel;
-
- private CollectionChangeListener childrenListener;
-
-
- protected AbstractTreeItemContentProvider(
- Model model, DelegatingTreeContentAndLabelProvider treeContentProvider) {
- this.model = model;
- this.treeContentProvider = treeContentProvider;
- this.childrenListener = buildChildrenListener();
- }
-
- /**
- * Construct a listener to refresh the tree (through the tree content provider)
- * if the children change
- */
- protected CollectionChangeListener buildChildrenListener() {
- return new CollectionChangeListener() {
-
- public void itemsAdded(CollectionAddEvent event) {
- getTreeContentProvider().updateContent(getModel());
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- getTreeContentProvider().updateContent(getModel());
- for (Object item : event.getItems()) {
- getTreeContentProvider().dispose(item);
- }
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- getTreeContentProvider().updateContent(getModel());
- // in the case of a list changed event, we don't have
- // access to the removed objects, so we can't dispose them.
- // keep a watch on this to see if this becomes a problem.
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- getTreeContentProvider().updateContent(getModel());
- // in the case of a list cleared event, we don't have
- // access to the removed objects, so we can't dispose them.
- // keep a watch on this to see if this becomes a problem.
- }
- };
- }
-
- /**
- * Return the children model
- * (lazy and just-in-time initialized)
- */
- protected synchronized Iterator<E> childrenModel() {
- if (this.childrenModel == null) {
- this.childrenModel = buildChildrenModel();
- engageChildren();
- }
- return this.childrenModel.iterator();
- }
-
- /**
- * Construct a children model
- */
- protected CollectionValueModel<E> buildChildrenModel() {
- return new NullCollectionValueModel<E>();
- }
-
- /**
- * Utility method that can be used if the children model is better represented
- * as a collection.
- * This wraps the children collection model and uses it internally as a list
- * model.
- */
- protected CollectionValueModel<E> buildChildrenModel(ListValueModel<E> lvm) {
- return new ListCollectionValueModelAdapter<E>(lvm);
- }
-
- /**
- * Utility method that can be used if the children model is better represented
- * as a single value property.
- * This wraps the children (child) property model and uses it internally as a list
- * model.
- */
- protected ListValueModel<E> buildChildrenModel(PropertyValueModel<E> lvm) {
- return new PropertyListValueModelAdapter<E>(lvm);
- }
-
- /**
- * Return the model object represented by this node
- */
- public Model getModel() {
- return this.model;
- }
-
- /**
- * Return the tree content provider that delegates to this node
- */
- public DelegatingTreeContentAndLabelProvider getTreeContentProvider() {
- return this.treeContentProvider;
- }
-
- public Object getParent() {
- return null;
- }
-
- public Object[] getElements() {
- return getChildren();
- }
-
- public Object[] getChildren() {
- return ArrayTools.array(this.childrenModel());
- }
-
- /**
- * Override with potentially more efficient logic
- */
- public boolean hasChildren() {
- return this.childrenModel().hasNext();
- }
-
- /**
- * Should only be overridden with a call to super.dispose()
- */
- public void dispose() {
- for (Object child : getChildren()) {
- getTreeContentProvider().dispose(child);
- }
- disposeChildrenModel();
- }
-
- /**
- * Should only be overridden with a call to super.engageChildren() before
- * subclass logic
- */
- protected void engageChildren() {
- this.childrenModel.addCollectionChangeListener(CollectionValueModel.VALUES, this.childrenListener);
- }
-
- protected synchronized void disposeChildrenModel() {
- if (this.childrenModel != null) {
- this.disengageChildrenModel();
- this.childrenModel = null;
- }
- }
- /**
- * Should only be overridden with a call to super.disengageChildren() after
- * subclass logic
- */
- protected void disengageChildrenModel() {
- this.childrenModel.removeCollectionChangeListener(CollectionValueModel.VALUES, this.childrenListener);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ArchiveFileViewerFilter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ArchiveFileViewerFilter.java
deleted file mode 100644
index bbff5516fc..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ArchiveFileViewerFilter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.common.ui.JptCommonUiPlugin;
-
-/**
- * This filter will deny showing any file that are not JAR files or folders
- * that don't contain any JAR files in its sub-hierarchy.
- */
-public class ArchiveFileViewerFilter
- extends ViewerFilter
-{
- private static final String[] archiveExtensions= { "jar", "zip" }; //$NON-NLS-1$ //$NON-NLS-2$
-
-
- public ArchiveFileViewerFilter() {
- super();
- }
-
-
- @Override
- public boolean select(
- Viewer viewer, Object parentElement, Object element) {
- if (element instanceof IFile) {
- return isArchivePath(((IFile)element).getFullPath());
- }
- else if (element instanceof IFolder) {
- IFolder folder = (IFolder) element;
- try {
- for (IResource each : folder.members()) {
- if (select(viewer, folder, each)) {
- return true;
- }
- }
- }
- catch (CoreException ce) {
- // just skip this one, then
- JptCommonUiPlugin.log(ce);
- }
- }
- return false;
- }
-
- public static boolean isArchivePath(IPath path) {
- String ext= path.getFileExtension();
- if (ext != null && ext.length() != 0) {
- for (int i= 0; i < archiveExtensions.length; i++) {
- if (ext.equalsIgnoreCase(archiveExtensions[i])) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/DelegatingTreeContentAndLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/DelegatingTreeContentAndLabelProvider.java
deleted file mode 100644
index d5df216b6e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/DelegatingTreeContentAndLabelProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-
-/**
- * Extension of {@link DelegatingContentAndLabelProvider} that provides an extension
- * to provide tree content
- */
-public class DelegatingTreeContentAndLabelProvider
- extends DelegatingContentAndLabelProvider
- implements ITreeContentProvider
-{
- public DelegatingTreeContentAndLabelProvider(
- TreeItemContentProviderFactory treeItemContentProviderFactory) {
- super(treeItemContentProviderFactory);
- }
-
- public DelegatingTreeContentAndLabelProvider(
- TreeItemContentProviderFactory treeItemContentProviderFactory,
- ItemLabelProviderFactory itemLabelProviderFactory) {
- super(treeItemContentProviderFactory, itemLabelProviderFactory);
- }
-
-
- @Override
- protected TreeItemContentProvider itemContentProvider(Object item) {
- return (TreeItemContentProvider) super.itemContentProvider(item);
- }
-
- public Object[] getChildren(Object parentElement) {
- TreeItemContentProvider provider = itemContentProvider(parentElement);
- return (provider == null) ? new Object[0] : provider.getChildren();
- }
-
- public Object getParent(Object element) {
- TreeItemContentProvider provider = itemContentProvider(element);
- return (provider == null) ? null : provider.getParent();
- }
-
- public boolean hasChildren(Object element) {
- TreeItemContentProvider provider = itemContentProvider(element);
- return (provider == null) ? false : provider.hasChildren();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java
deleted file mode 100644
index e2079e0227..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-/**
- * Image descriptor for an image.
- */
-public class ImageImageDescriptor extends ImageDescriptor
-{
-
- private Image fImage;
-
- /**
- * Constructor for ImagImageDescriptor.
- */
- public ImageImageDescriptor(Image image) {
- super();
- this.fImage = image;
- }
-
- @Override
- public boolean equals(Object obj) {
- return (obj != null) && getClass().equals(obj.getClass()) && this.fImage.equals(((ImageImageDescriptor) obj).fImage);
- }
-
- @Override
- public ImageData getImageData() {
- return this.fImage.getImageData();
- }
-
- @Override
- public int hashCode() {
- return this.fImage.hashCode();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullLabelProvider.java
deleted file mode 100644
index 1380b3dac6..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullLabelProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Null implementation of the ILabelProvider interface.
- * Implemented as a singleton.
- */
-public final class NullLabelProvider
- implements ILabelProvider
-{
- public static final NullLabelProvider INSTANCE = new NullLabelProvider();
-
- public static ILabelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure a single instance.
- */
- private NullLabelProvider() {
- super();
- }
-
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return null;
- }
-
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullTreeContentProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullTreeContentProvider.java
deleted file mode 100644
index f050ffa226..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NullTreeContentProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Null implementation of the ILabelProvider interface.
- * Implemented as a singleton.
- */
-public final class NullTreeContentProvider
- implements ITreeContentProvider
-{
- private static final Object[] EMPTY_ARRAY = new Object[0];
- public static final NullTreeContentProvider INSTANCE = new NullTreeContentProvider();
-
- public static ITreeContentProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure a single instance.
- */
- private NullTreeContentProvider() {
- super();
- }
-
- public Object[] getChildren(Object parentElement) {
- return EMPTY_ARRAY;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- return EMPTY_ARRAY;
- }
-
- public void dispose() {
- // do nothing
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java
deleted file mode 100644
index ca953012ae..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.jface.viewers.AbstractListViewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-
-/**
- * This adapter can be used to keep an AbstractListViewer
- * (e.g. a ListViewer or ComboViewer) in synch with a ListValueModel
- * (or a CollectionValueModel).
- */
-public class StructuredContentProviderAdapter
- implements IStructuredContentProvider
-{
- /** The underlying model list. */
- protected ListValueModel listHolder;
-
- /** The list viewer we keep in synch with the model list. */
- protected final AbstractListViewer listViewer;
-
- /** A listener that allows us to forward changes made to the underlying model list. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** static **********
-
- /**
- * Adapt the specified list viewer to the specified list holder so they
- * stay in synch.
- */
- public static StructuredContentProviderAdapter adapt(AbstractListViewer listViewer, ListValueModel listHolder) {
- // we need only construct the adapter and it will hook up to the list viewer etc.
- return new StructuredContentProviderAdapter(listViewer, listHolder);
- }
-
- /**
- * Adapt the specified list viewer to the specified list holder so they
- * stay in synch.
- */
- public static StructuredContentProviderAdapter adapt(AbstractListViewer listViewer, CollectionValueModel collectionHolder) {
- // we need only construct the adapter and it will hook up to the list viewer etc.
- return new StructuredContentProviderAdapter(listViewer, collectionHolder);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor.
- */
- protected StructuredContentProviderAdapter(AbstractListViewer listViewer, ListValueModel listHolder) {
- super();
- this.listChangeListener = this.buildListChangeListener();
- this.listViewer = listViewer;
- this.listViewer.setContentProvider(this);
- // the list viewer will call back to #inputChanged(Viewer, Object, Object)
- this.listViewer.setInput(listHolder);
- }
-
- /**
- * Constructor.
- */
- protected StructuredContentProviderAdapter(AbstractListViewer listViewer, CollectionValueModel collectionHolder) {
- this(listViewer, new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- StructuredContentProviderAdapter.this.itemsAdded(e);
- }
- public void itemsRemoved(ListRemoveEvent e) {
- StructuredContentProviderAdapter.this.itemsRemoved(e);
- }
- public void itemsReplaced(ListReplaceEvent e) {
- StructuredContentProviderAdapter.this.itemsReplaced(e);
- }
- public void itemsMoved(ListMoveEvent e) {
- StructuredContentProviderAdapter.this.itemsMoved(e);
- }
- public void listCleared(ListClearEvent e) {
- StructuredContentProviderAdapter.this.listCleared();
- }
- public void listChanged(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.listChanged();
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
-
- // ********** IStructuredContentProvider implementation **********
-
- public Object[] getElements(Object inputElement) {
- if (inputElement != this.listHolder) {
- throw new IllegalArgumentException("invalid input element: " + inputElement);
- }
- return this.listHolder.toArray();
- }
-
- /**
- * This is called by the list viewer, so don't update the list viewer here.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (viewer != this.listViewer) {
- throw new IllegalArgumentException("invalid viewer: " + viewer);
- }
- if (oldInput != this.listHolder) {
- throw new IllegalArgumentException("invalid old input: " + oldInput);
- }
- this.modelChanged((ListValueModel) oldInput, (ListValueModel) newInput);
- }
-
- public void dispose() {
- // do nothing - listeners should've already been removed in #inputChanged(Viewer, Object, Object)
- }
-
-
- // ********** internal methods **********
-
- protected void modelChanged(ListValueModel oldModel, ListValueModel newModel) {
- if (oldModel != null) {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- this.listHolder = newModel;
- if (newModel != null) {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Return the underlying list model.
- */
- public ListValueModel model() {
- return this.listHolder;
- }
-
- /**
- * Set the underlying list model.
- */
- public void setModel(ListValueModel listHolder) {
- // the list viewer will call back to #inputChanged(Viewer, Object, Object)
- this.listViewer.setInput(listHolder);
- }
-
- /**
- * Set the underlying collection model.
- */
- public void setModel(CollectionValueModel collectionHolder) {
- this.setModel(new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsAdded(ListAddEvent e) {
- int i = e.getIndex();
- for (Object item : e.getItems()) {
- this.listViewer.insert(item, i++);
- }
- }
-
- /**
- * Items were removed from the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsRemoved(ListRemoveEvent e) {
- this.listViewer.remove(ArrayTools.array(e.getItems(), e.getItemsSize()));
- }
-
- /**
- * Items were replaced in the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsReplaced(ListReplaceEvent e) {
- this.listViewer.remove(ArrayTools.array(e.getOldItems(), e.getItemsSize()));
- int i = e.getIndex();
- for (Object item : e.getNewItems()) {
- this.listViewer.insert(item, i++);
- }
- }
-
- /**
- * Items were moved in the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsMoved(ListMoveEvent e) {
- int len = e.getLength();
- Object[] items = new Object[len];
- int offset = e.getSourceIndex();
- for (int i = 0; i < len; i++) {
- items[i] = this.listHolder.get(offset + i);
- }
- this.listViewer.remove(items);
-
- offset = e.getTargetIndex();
- for (int i = 0; i < len; i++) {
- this.listViewer.insert(items[i], offset + i);
- }
- }
-
- /**
- * The underlying model list was cleared.
- * Synchronize the list viewer.
- */
- protected void listCleared() {
- this.listViewer.refresh();
- }
-
- /**
- * The underlying model list has changed "dramatically".
- * Synchronize the list viewer.
- */
- protected void listChanged() {
- this.listViewer.refresh();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listHolder);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java
deleted file mode 100644
index 8918708bbf..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.listeners;
-
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another collection change listener and forward events to it on the SWT
- * UI thread, asynchronously if necessary.
- */
-public class SWTCollectionChangeListenerWrapper
- implements CollectionChangeListener
-{
- private final CollectionChangeListener listener;
-
- public SWTCollectionChangeListenerWrapper(CollectionChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void itemsAdded(CollectionAddEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnUIThread(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnUIThread(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.collectionCleared_(event);
- } else {
- this.executeOnUIThread(this.buildCollectionClearedRunnable(event));
- }
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.collectionChanged_(event);
- } else {
- this.executeOnUIThread(this.buildCollectionChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final CollectionAddEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final CollectionRemoveEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildCollectionClearedRunnable(final CollectionClearEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.collectionCleared_(event);
- }
- @Override
- public String toString() {
- return "collection cleared runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildCollectionChangedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.collectionChanged_(event);
- }
- @Override
- public String toString() {
- return "collection changed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * {@link Display#asyncExec(Runnable)} seems to work OK;
- * but using {@link Display#syncExec(Runnable)} can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void itemsAdded_(CollectionAddEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(CollectionRemoveEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void collectionCleared_(CollectionClearEvent event) {
- this.listener.collectionCleared(event);
- }
-
- void collectionChanged_(CollectionChangeEvent event) {
- this.listener.collectionChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTListChangeListenerWrapper.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTListChangeListenerWrapper.java
deleted file mode 100644
index 321080dfc5..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTListChangeListenerWrapper.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.listeners;
-
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another list change listener and forward events to it on the SWT
- * UI thread, asynchronously if necessary.
- */
-public class SWTListChangeListenerWrapper
- implements ListChangeListener
-{
- private final ListChangeListener listener;
-
- public SWTListChangeListenerWrapper(ListChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void itemsAdded(ListAddEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnUIThread(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnUIThread(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void itemsMoved(ListMoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsMoved_(event);
- } else {
- this.executeOnUIThread(this.buildItemsMovedRunnable(event));
- }
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsReplaced_(event);
- } else {
- this.executeOnUIThread(this.buildItemsReplacedRunnable(event));
- }
- }
-
- public void listCleared(ListClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.listCleared_(event);
- } else {
- this.executeOnUIThread(this.buildListClearedRunnable(event));
- }
- }
-
- public void listChanged(ListChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.listChanged_(event);
- } else {
- this.executeOnUIThread(this.buildListChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final ListAddEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final ListRemoveEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsMovedRunnable(final ListMoveEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsMoved_(event);
- }
- @Override
- public String toString() {
- return "items moved runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsReplacedRunnable(final ListReplaceEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsReplaced_(event);
- }
- @Override
- public String toString() {
- return "items replaced runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildListClearedRunnable(final ListClearEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.listCleared_(event);
- }
- @Override
- public String toString() {
- return "list cleared runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildListChangedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.listChanged_(event);
- }
- @Override
- public String toString() {
- return "list changed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * {@link Display#asyncExec(Runnable)} seems to work OK;
- * but using {@link Display#syncExec(Runnable)} can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void itemsAdded_(ListAddEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(ListRemoveEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void itemsMoved_(ListMoveEvent event) {
- this.listener.itemsMoved(event);
- }
-
- void itemsReplaced_(ListReplaceEvent event) {
- this.listener.itemsReplaced(event);
- }
-
- void listCleared_(ListClearEvent event) {
- this.listener.listCleared(event);
- }
-
- void listChanged_(ListChangeEvent event) {
- this.listener.listChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java
deleted file mode 100644
index f95fbe6005..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.listeners;
-
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another property change listener and forward events to it on the SWT
- * UI thread, asynchronously if necessary. If the event arrived on the UI
- * thread that is probably because it was initiated by a UI widget; as a
- * result, we want to loop back synchronously so the events can be
- * short-circuited. (Typically, the adapter(s) between a <em>property</em> and
- * its corresponding UI widget are read-write; as opposed to the adapter(s)
- * between a <em>collection</em> (or <em>list</em>) and its UI widget, which
- * is read-only.)
- */
-public class SWTPropertyChangeListenerWrapper
- implements PropertyChangeListener
-{
- private final PropertyChangeListener listener;
-
- public SWTPropertyChangeListenerWrapper(PropertyChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.propertyChanged_(event);
- } else {
- this.executeOnUIThread(this.buildPropertyChangedRunnable(event));
- }
- }
-
- private Runnable buildPropertyChangedRunnable(final PropertyChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTPropertyChangeListenerWrapper.this.propertyChanged_(event);
- }
- @Override
- public String toString() {
- return "property changed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * {@link Display#asyncExec(Runnable)} seems to work OK;
- * but using {@link Display#syncExec(Runnable)} can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void propertyChanged_(PropertyChangeEvent event) {
- this.listener.propertyChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTStateChangeListenerWrapper.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTStateChangeListenerWrapper.java
deleted file mode 100644
index 16bf1194db..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTStateChangeListenerWrapper.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.listeners;
-
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another state change listener and forward events to it on the SWT
- * UI thread, asynchronously if necessary. If the event arrived on the UI
- * thread that is probably because it was initiated by a UI widget; as a
- * result, we want to loop back synchronously so the events can be
- * short-circuited.
- */
-public class SWTStateChangeListenerWrapper
- implements StateChangeListener
-{
- private final StateChangeListener listener;
-
- public SWTStateChangeListenerWrapper(StateChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void stateChanged(StateChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.stateChanged_(event);
- } else {
- this.executeOnUIThread(this.buildStateChangedRunnable(event));
- }
- }
-
- private Runnable buildStateChangedRunnable(final StateChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTStateChangeListenerWrapper.this.stateChanged_(event);
- }
- @Override
- public String toString() {
- return "state changed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * {@link Display#asyncExec(Runnable)} seems to work OK;
- * but using {@link Display#syncExec(Runnable)} can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void stateChanged_(StateChangeEvent event) {
- this.listener.stateChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTTreeChangeListenerWrapper.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTTreeChangeListenerWrapper.java
deleted file mode 100644
index 84255e6fd9..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/listeners/SWTTreeChangeListenerWrapper.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.listeners;
-
-import org.eclipse.jpt.common.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.TreeChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another tree change listener and forward events to it on the SWT
- * UI thread, asynchronously if necessary.
- */
-public class SWTTreeChangeListenerWrapper
- implements TreeChangeListener
-{
- private final TreeChangeListener listener;
-
- public SWTTreeChangeListenerWrapper(TreeChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void nodeAdded(TreeAddEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.nodeAdded_(event);
- } else {
- this.executeOnUIThread(this.buildNodeAddedRunnable(event));
- }
- }
-
- public void nodeRemoved(TreeRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.nodeRemoved_(event);
- } else {
- this.executeOnUIThread(this.buildNodeRemovedRunnable(event));
- }
- }
-
- public void treeCleared(TreeClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.treeCleared_(event);
- } else {
- this.executeOnUIThread(this.buildTreeClearedRunnable(event));
- }
- }
-
- public void treeChanged(TreeChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.treeChanged_(event);
- } else {
- this.executeOnUIThread(this.buildTreeChangedRunnable(event));
- }
- }
-
- private Runnable buildNodeAddedRunnable(final TreeAddEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.nodeAdded_(event);
- }
- @Override
- public String toString() {
- return "node added runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildNodeRemovedRunnable(final TreeRemoveEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.nodeRemoved_(event);
- }
- @Override
- public String toString() {
- return "node removed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildTreeClearedRunnable(final TreeClearEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.treeCleared_(event);
- }
- @Override
- public String toString() {
- return "tree cleared runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildTreeChangedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.treeChanged_(event);
- }
- @Override
- public String toString() {
- return "tree changed runnable"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * {@link Display#asyncExec(Runnable)} seems to work OK;
- * but using {@link Display#syncExec(Runnable)} can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void nodeAdded_(TreeAddEvent event) {
- this.listener.nodeAdded(event);
- }
-
- void nodeRemoved_(TreeRemoveEvent event) {
- this.listener.nodeRemoved(event);
- }
-
- void treeCleared_(TreeClearEvent event) {
- this.listener.treeCleared(event);
- }
-
- void treeChanged_(TreeChangeEvent event) {
- this.listener.treeChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/properties/JptProjectPropertiesPage.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/properties/JptProjectPropertiesPage.java
deleted file mode 100644
index 05e5bd5767..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/properties/JptProjectPropertiesPage.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.properties;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.SimpleChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.ui.libprov.LibraryFacetPropertyPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage;
-
-
-public abstract class JptProjectPropertiesPage
- extends LibraryFacetPropertyPage {
-
- protected final WritablePropertyValueModel<IProject> projectModel;
- protected final BufferedWritablePropertyValueModel.Trigger trigger;
-
- protected final ChangeListener validationListener;
-
-
- public JptProjectPropertiesPage() {
- super();
-
- this.projectModel = new SimplePropertyValueModel<IProject>();
- this.trigger = new BufferedWritablePropertyValueModel.Trigger();
-
- buildModels();
-
- this.validationListener = this.buildValidationListener();
- }
-
-
- /**
- * Build any additional models needed by this page. The project model has been created at this
- * point.
- */
- protected abstract void buildModels();
-
-
- // ********** convenience methods **********
-
- protected static boolean flagIsSet(PropertyValueModel<Boolean> flagModel) {
- Boolean flag = flagModel.getValue();
- return (flag != null) && flag.booleanValue();
- }
-
-
- // ********** LibraryFacetPropertyPage implementation **********
-
-
-
- protected IPropertyChangeListener buildLibraryProviderListener() {
- return new IPropertyChangeListener() {
- public void propertyChanged(String property, Object oldValue, Object newValue ) {
- if (LibraryInstallDelegate.PROP_AVAILABLE_PROVIDERS.equals(property)) {
- adjustLibraryProviders();
- }
- }
- };
- }
-
- protected abstract void adjustLibraryProviders();
-
-
- // ********** page **********
-
- @Override
- protected Control createPageContents(Composite parent) {
- if (this.projectModel.getValue() != null) {
- disengageListeners();
- }
-
- this.projectModel.setValue(getProject());
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- createWidgets(composite);
-
- Dialog.applyDialogFont(composite);
-
- adjustLibraryProviders();
-
- engageListeners();
- updateValidation();
-
- return composite;
- }
-
- /**
- * Build specific widgets. Layout and validation will be taken care of.
- */
- protected abstract void createWidgets(Composite parent);
-
- protected void engageListeners() {
- engageValidationListener();
- }
-
- protected void disengageListeners() {
- disengageValidationListener();
- }
-
- protected Link buildFacetsPageLink(Composite parent, String text) {
- Link facetsPageLink = buildLink(parent, text);
- facetsPageLink.addSelectionListener(buildFacetsPageLinkListener()); // the link will be GCed
- return facetsPageLink;
- }
-
- private SelectionListener buildFacetsPageLinkListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- openProjectFacetsPage();
- }
- @Override
- public String toString() {
- return "facets page link listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected void openProjectFacetsPage() {
- ((IWorkbenchPreferenceContainer)getContainer()).openPage(FacetsPropertyPage.ID, null);
- }
-
- /**
- * Don't allow {@link org.eclipse.jface.preference.PreferencePage#computeSize()}
- * to cache the page's size, since the size of the "Library" panel can
- * change depending on the user's selection from the drop-down list.
- */
- @Override
- public Point computeSize() {
- return this.doComputeSize();
- }
-
-
- // ********** widgets **********
-
- protected Button buildCheckBox(Composite parent, int horizontalSpan, String text) {
- return buildButton(parent, horizontalSpan, text, SWT.CHECK);
- }
-
- protected Button buildRadioButton(Composite parent, int horizontalSpan, String text) {
- return buildButton(parent, horizontalSpan, text, SWT.RADIO);
- }
-
- protected Button buildButton(Composite parent, int horizontalSpan, String text, int style) {
- Button button = new Button(parent, SWT.NONE | style);
- button.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = horizontalSpan;
- button.setLayoutData(gd);
- return button;
- }
-
- protected Combo buildDropDown(Composite parent) {
- return buildDropDown(parent, 1);
- }
-
- protected Combo buildDropDown(Composite parent, int horizontalSpan) {
- Combo combo = new Combo(parent, SWT.READ_ONLY);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = horizontalSpan;
- combo.setLayoutData(gd);
- return combo;
- }
-
- protected Label buildLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = 1;
- label.setLayoutData(gd);
- return label;
- }
-
- protected Link buildLink(Composite parent, String text) {
- Link link = new Link(parent, SWT.NONE);
- GridData data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- link.setLayoutData(data);
- link.setText(text);
- return link;
- }
-
-
- // ********** OK/Revert/Apply behavior **********
-
- @Override
- public boolean performOk() {
- super.performOk();
-
- try {
- // true=fork; false=uncancellable
- this.buildOkProgressMonitorDialog().run(true, false, this.buildOkRunnableWithProgress());
- }
- catch (InterruptedException ex) {
- return false;
- }
- catch (InvocationTargetException ex) {
- throw new RuntimeException(ex.getTargetException());
- }
-
- return true;
- }
-
- private IRunnableContext buildOkProgressMonitorDialog() {
- return new ProgressMonitorDialog(this.getShell());
- }
-
- private IRunnableWithProgress buildOkRunnableWithProgress() {
- return new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- try {
- // the build we execute in #performOk_() locks the workspace root,
- // so we need to use the workspace root as our scheduling rule here
- ws.run(
- buildOkWorkspaceRunnable(),
- ws.getRoot(),
- IWorkspace.AVOID_UPDATE,
- monitor);
- }
- catch (CoreException ex) {
- throw new InvocationTargetException(ex);
- }
- }
- };
- }
-
- /* private */ IWorkspaceRunnable buildOkWorkspaceRunnable() {
- return new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- performOk_(monitor);
- }
- };
- }
-
- // ********** OK/Revert/Apply behavior **********
-
- void performOk_(IProgressMonitor monitor) throws CoreException {
- if (isBuffering()) {
- boolean rebuild = projectRebuildRequired();
- this.trigger.accept();
- if (rebuild) {
- rebuildProject();
- }
- this.getProject().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- }
- }
-
- protected abstract boolean projectRebuildRequired();
-
- protected abstract void rebuildProject();
-
- /**
- * Return whether any of the models are buffering a change.
- */
- private boolean isBuffering() {
- for (BufferedWritablePropertyValueModel<?> model : buildBufferedModels()) {
- if (model.isBuffering()) {
- return true;
- }
- }
- return false;
- }
-
- protected abstract BufferedWritablePropertyValueModel<?>[] buildBufferedModels();
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- this.trigger.reset();
- }
-
-
- // ********** dispose **********
-
- @Override
- public void dispose() {
- disengageListeners();
- super.dispose();
- }
-
-
- // ********** validation **********
-
- private ChangeListener buildValidationListener() {
- return new SimpleChangeListener() {
- @Override
- protected void modelChanged() {
- validate();
- }
- @Override
- public String toString() {
- return "validation listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected void validate() {
- if ( ! getControl().isDisposed()) {
- updateValidation();
- }
- }
-
- private void engageValidationListener() {
- for (Model model : buildValidationModels()) {
- model.addChangeListener(this.validationListener);
- }
- }
-
- protected abstract Model[] buildValidationModels();
-
- private void disengageValidationListener() {
- for (Model model : buildReverseValidationModels()) {
- model.removeChangeListener(this.validationListener);
- }
- }
-
- protected Model[] buildReverseValidationModels() {
- return ArrayTools.reverse(buildValidationModels());
- }
-
- protected static final Integer ERROR_STATUS = Integer.valueOf(IStatus.ERROR);
- protected static final Integer WARNING_STATUS = Integer.valueOf(IStatus.WARNING);
- protected static final Integer INFO_STATUS = Integer.valueOf(IStatus.INFO);
- protected static final Integer OK_STATUS = Integer.valueOf(IStatus.OK);
-
- protected IStatus buildInfoStatus(String message) {
- return this.buildStatus(IStatus.INFO, message);
- }
-
- protected IStatus buildWarningStatus(String message) {
- return this.buildStatus(IStatus.WARNING, message);
- }
-
- protected IStatus buildErrorStatus(String message) {
- return this.buildStatus(IStatus.ERROR, message);
- }
-
- protected IStatus buildStatus(int severity, String message) {
- return new Status(severity, JptCommonCorePlugin.PLUGIN_ID, message);
- }
-
- @Override
- protected IStatus performValidation() {
- HashMap<Integer, ArrayList<IStatus>> statuses = new HashMap<Integer, ArrayList<IStatus>>();
- statuses.put(ERROR_STATUS, new ArrayList<IStatus>());
- statuses.put(WARNING_STATUS, new ArrayList<IStatus>());
- statuses.put(INFO_STATUS, new ArrayList<IStatus>());
- statuses.put(OK_STATUS, CollectionTools.list(Status.OK_STATUS));
-
- performValidation(statuses);
-
- if ( ! statuses.get(ERROR_STATUS).isEmpty()) {
- return statuses.get(ERROR_STATUS).get(0);
- }
- else if ( ! statuses.get(WARNING_STATUS).isEmpty()) {
- return statuses.get(WARNING_STATUS).get(0);
- }
- else if ( ! statuses.get(INFO_STATUS).isEmpty()) {
- return statuses.get(INFO_STATUS).get(0);
- }
- else {
- return statuses.get(OK_STATUS).get(0);
- }
- }
-
- protected void performValidation(Map<Integer, ArrayList<IStatus>> statuses) {
- /* library provider */
- IStatus lpStatus = super.performValidation();
- statuses.get(Integer.valueOf(lpStatus.getSeverity())).add(lpStatus);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java
deleted file mode 100644
index de3aca1167..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/AbstractComboModelAdapter.java
+++ /dev/null
@@ -1,704 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import java.util.EventListener;
-import java.util.EventObject;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-
-/**
- * This adapter provides a more object-oriented interface to the items and
- * selected item in a combo.
- * <p>
- * <b>listHolder</b> contains the items in the combo.<br>
- * <b>selectedItemHolder</b> contains the items in 'listHolder' that are
- * selected in the combo.
- *
- * @param <E> The type of the items in <b>listHolder</b>
- * @see ComboModelAdapter
- * @see CComboModelAdapter
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class AbstractComboModelAdapter<E> {
-
- // ********** model **********
- /**
- * A value model on the underlying model list.
- */
- protected final ListValueModel<E> listHolder;
-
- /**
- * A listener that allows us to synchronize the combo's contents with
- * the model list.
- */
- protected final ListChangeListener listChangeListener;
-
- /**
- * A value model on the underlying model selection.
- */
- protected final WritablePropertyValueModel<E> selectedItemHolder;
-
- /**
- * A listener that allows us to synchronize the combo's selection with the
- * model selection.
- */
- protected final PropertyChangeListener selectedItemChangeListener;
-
- /**
- * A converter that converts items in the model list
- * to strings that can be put in the combo.
- */
- protected StringConverter<E> stringConverter;
-
- // ********** UI **********
- /**
- * The combo we keep synchronized with the model list.
- */
- protected final ComboHolder comboHolder;
-
- /**
- * A listener that allows us to synchronize our selection list holder
- * with the combo's text.
- */
- protected ModifyListener comboModifyListener;
-
- /**
- * A listener that allows us to synchronize our selection list holder
- * with the combo's selection.
- */
- protected SelectionListener comboSelectionListener;
-
- /**
- * Clients that are interested in selection change events.
- */
- @SuppressWarnings("unchecked")
- protected final ListenerList<SelectionChangeListener> selectionChangeListenerList;
-
- /**
- * Clients that are interested in double click events.
- */
- @SuppressWarnings("unchecked")
- protected final ListenerList<DoubleClickListener> doubleClickListenerList;
-
- /**
- * A listener that allows us to stop listening to stuff when the combo
- * is disposed.
- */
- protected final DisposeListener comboDisposeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder, selections holder, combo, and
- * string converter are required.
- */
- protected AbstractComboModelAdapter(
- ListValueModel<E> listHolder,
- WritablePropertyValueModel<E> selectedItemHolder,
- ComboHolder comboHolder,
- StringConverter<E> stringConverter)
- {
- super();
-
- Assert.isNotNull(listHolder, "The holder of the items");
- Assert.isNotNull(selectedItemHolder, "The holder of the selected item cannot be null");
- Assert.isNotNull(comboHolder, "The holder of the combo widget cannot be null");
- Assert.isNotNull(stringConverter, "The string converter cannot be null");
-
- this.listHolder = listHolder;
- this.selectedItemHolder = selectedItemHolder;
- this.comboHolder = comboHolder;
- this.stringConverter = stringConverter;
-
- this.listChangeListener = this.buildListChangeListener();
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
-
- this.selectedItemChangeListener = this.buildSelectedItemChangeListener();
- this.selectedItemHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.selectedItemChangeListener);
-
- if (this.comboHolder.isEditable()) {
- this.comboModifyListener = this.buildComboModifyListener();
- this.comboHolder.addModifyListener(this.comboModifyListener);
- }
- else {
- this.comboSelectionListener = this.buildComboSelectionListener();
- this.comboHolder.addSelectionListener(this.comboSelectionListener);
- }
-
- this.selectionChangeListenerList = this.buildSelectionChangeListenerList();
- this.doubleClickListenerList = this.buildDoubleClickListenerList();
-
- this.comboDisposeListener = this.buildComboDisposeListener();
- this.comboHolder.addDisposeListener(this.comboDisposeListener);
-
- this.synchronizeCombo();
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- AbstractComboModelAdapter.this.listItemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- AbstractComboModelAdapter.this.listItemsRemoved(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- AbstractComboModelAdapter.this.listItemsMoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- AbstractComboModelAdapter.this.listItemsReplaced(event);
- }
- public void listCleared(ListClearEvent event) {
- AbstractComboModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- AbstractComboModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
- protected PropertyChangeListener buildSelectedItemChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSelectedItemChangeListener_());
- }
-
- protected PropertyChangeListener buildSelectedItemChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- AbstractComboModelAdapter.this.selectedItemChanged(e);
- }
- };
- }
-
- protected ModifyListener buildComboModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- AbstractComboModelAdapter.this.comboSelectionChanged(event);
- }
-
- @Override
- public String toString() {
- return "combo modify listener";
- }
- };
- }
-
- protected SelectionListener buildComboSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- AbstractComboModelAdapter.this.comboSelectionChanged(event);
- }
-
- @Override
- public String toString() {
- return "combo modify listener";
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- protected ListenerList<DoubleClickListener> buildDoubleClickListenerList() {
- return new ListenerList<DoubleClickListener>(DoubleClickListener.class);
- }
-
- @SuppressWarnings("unchecked")
- protected ListenerList<SelectionChangeListener> buildSelectionChangeListenerList() {
- return new ListenerList<SelectionChangeListener>(SelectionChangeListener.class);
- }
-
- protected DisposeListener buildComboDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- AbstractComboModelAdapter.this.comboDisposed(event);
- }
-
- @Override
- public String toString() {
- return "combo dispose listener";
- }
- };
- }
-
- protected void synchronizeCombo() {
- this.synchronizeComboItems();
- this.synchronizeComboSelection();
- }
-
-
- // ********** string converter **********
-
- public void setStringConverter(StringConverter<E> stringConverter) {
- Assert.isNotNull(stringConverter, "The StringConverter cannot be null");
- this.stringConverter = stringConverter;
- this.synchronizeCombo();
- }
-
-
- // ********** list **********
-
- /**
- * Use the string converter to convert the specified item to a
- * string that can be added to the combo.
- */
- protected String convert(E item) {
- return this.stringConverter.convertToString(item);
- }
-
- /**
- * Brute force synchronization of combo with the model list.
- */
- protected void synchronizeComboItems() {
- if (this.comboHolder.isDisposed()) {
- return;
- }
- int len = this.listHolder.size();
- String[] items = new String[len];
- for (int index = 0; index < len; index++) {
- items[index] = this.convert(this.listHolder.get(index));
- }
- try {
- this.comboHolder.setPopulating(true);
- this.comboHolder.setItems(items);
- }
- finally {
- this.comboHolder.setPopulating(false);
- }
- }
-
- /**
- * The model has changed - synchronize the combo.
- */
- protected void listItemsAdded(ListAddEvent event) {
- if (this.comboHolder.isDisposed()) {
- return;
- }
-
- int count = this.comboHolder.getItemCount();
- int index = event.getIndex();
-
- for (E item : this.getItems(event)) {
- this.comboHolder.add(this.convert(item), index++);
- }
-
- // When the combo is populated, it's possible the selection was already
- // set but no items was found, resync the selected item
- synchronizeComboSelection();
- }
-
- /**
- * The model has changed - synchronize the combo.
- */
- protected void listItemsRemoved(ListRemoveEvent event) {
- if (this.comboHolder.isDisposed()) {
- return;
- }
- this.comboHolder.setPopulating(true);
- try {
- this.comboHolder.remove(event.getIndex(), event.getIndex() + event.getItemsSize() - 1);
- }
- finally {
- this.comboHolder.setPopulating(false);
- }
- }
-
- /**
- * The model has changed - synchronize the combo.
- */
- protected void listItemsMoved(ListMoveEvent event) {
- if (this.comboHolder.isDisposed()) {
- return;
- }
- int target = event.getTargetIndex();
- int source = event.getSourceIndex();
- int len = event.getLength();
- int loStart = Math.min(target, source);
- int hiStart = Math.max(target, source);
- // make a copy of the affected items...
- String[] subArray = ArrayTools.subArray(this.comboHolder.getItems(), loStart, hiStart + len - loStart);
- // ...move them around...
- subArray = ArrayTools.move(subArray, target - loStart, source - loStart, len);
- // ...and then put them back
- for (int index = 0; index < subArray.length; index++) {
- this.comboHolder.setItem(loStart + index, subArray[index]);
- }
- }
-
- /**
- * The model has changed - synchronize the combo.
- */
- protected void listItemsReplaced(ListReplaceEvent event) {
- if (this.comboHolder.isDisposed()) {
- return;
- }
- int index = event.getIndex();
- int selectionIndex = this.comboHolder.getSelectionIndex();
- //fixing bug 269100 by setting the populating flag to true
- this.comboHolder.setPopulating(true);
- try {
- for (E item : this.getNewItems(event)) {
- this.comboHolder.setItem(index++, this.convert(item));
- }
- if (selectionIndex == 0) {
- this.comboHolder.setText(this.comboHolder.getItems()[0]);
- }
- }
- finally {
- this.comboHolder.setPopulating(false);
- }
- }
-
- /**
- * The model has changed - synchronize the combo.
- */
- protected void listCleared(ListClearEvent event) {
- if (this.comboHolder.isDisposed()) {
- return;
- }
- this.comboHolder.setPopulating(true);
- try {
- this.comboHolder.removeAll();
- }
- finally {
- this.comboHolder.setPopulating(false);
- }
- }
-
- /**
- * The model has changed - synchronize the combo.
- */
- protected void listChanged(ListChangeEvent event) {
- this.synchronizeCombo();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(ListAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getNewItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getNewItems();
- }
-
-
- // ********** selected items **********
-
- protected int indexOf(E item) {
- int length = this.listHolder.size();
- for (int index = 0; index < length; index++) {
- if (valuesAreEqual(this.listHolder.get(index), item)) {
- return index;
- }
- }
- return -1;
- }
-
- protected void synchronizeComboSelection() {
- if (this.comboHolder.isDisposed() || this.comboHolder.isPopulating()) {
- return;
- }
-
- E selectedValue = this.selectedItemHolder.getValue();
- if (this.comboHolder.getText().equals(selectedValue)) {
- //if the selection is still the same, don't reset it
- return;
- }
- this.comboHolder.setPopulating(true);
- try {
- this.comboHolder.deselectAll();
- String selectedItem = this.convert(selectedValue);
- if (selectedItem == null) {
- selectedItem = "";
- }
- this.comboHolder.setText(selectedItem);
- this.notifyListeners(selectedValue);
- }
- finally {
- this.comboHolder.setPopulating(false);
- }
- }
-
- protected void selectedItemChanged(PropertyChangeEvent event) {
- this.synchronizeComboSelection();
- }
-
- /**
- * Return whether the values are equal, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- */
- protected final boolean valuesAreEqual(Object value1, Object value2) {
- if ((value1 == null) && (value2 == null)) {
- return true; // both are null
- }
- if ((value1 == null) || (value2 == null)) {
- return false; // one is null but the other is not
- }
- return value1.equals(value2);
- }
-
- // ********** combo events **********
-
- protected void comboSelectionChanged(SelectionEvent event) {
- this.selectionChanged();
- }
-
- protected void comboSelectionChanged(ModifyEvent event) {
- this.selectionChanged();
- }
-
- protected void selectionChanged() {
- if (!this.comboHolder.isPopulating()) {
- E selectedItem = this.selectedItem();
- this.comboHolder.setPopulating(true);
- try {
- this.selectedItemHolder.setValue(selectedItem);
- this.notifyListeners(selectedItem);
- }
- finally {
- this.comboHolder.setPopulating(false);
- }
- }
- }
-
- private void notifyListeners(E selectedItem) {
- if (this.selectionChangeListenerList.size() > 0) {
- SelectionChangeEvent<E> scEvent = new SelectionChangeEvent<E>(this, selectedItem);
- for (SelectionChangeListener<E> selectionChangeListener : this.selectionChangeListenerList.getListeners()) {
- selectionChangeListener.selectionChanged(scEvent);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- protected E selectedItem() {
- if (this.comboHolder.isDisposed()) {
- return null;
- }
-
- if (this.comboHolder.isEditable()) {
- String text = this.comboHolder.getText();
-
- if (text.length() == 0) {
- return null;
- }
-
- for (int index = this.listHolder.size(); --index >= 0; ) {
- E item = this.listHolder.get(index);
- String value = this.convert(item);
- if (valuesAreEqual(text, value)) {
- return item;
- }
- }
-
- // TODO: Find a way to prevent this type cast (it'll work if E is
- // String but it won't work if E is something else), maybe use a
- // BidiStringConverter instead of StringConverter
- try {
- return (E) text;
- }
- catch (ClassCastException e) {
- return null;
- }
- }
-
- int index = this.comboHolder.getSelectionIndex();
-
- if (index == -1) {
- return null;
- }
-
- return this.listHolder.get(index);
- }
-
- protected void comboDoubleClicked(SelectionEvent event) {
- if (this.comboHolder.isDisposed()) {
- return;
- }
- if (this.doubleClickListenerList.size() > 0) {
- // there should be only a single item selected during a double-click(?)
- E selection = this.listHolder.get(this.comboHolder.getSelectionIndex());
- DoubleClickEvent<E> dcEvent = new DoubleClickEvent<E>(this, selection);
- for (DoubleClickListener<E> doubleClickListener : this.doubleClickListenerList.getListeners()) {
- doubleClickListener.doubleClick(dcEvent);
- }
- }
- }
-
-
- // ********** dispose **********
-
- protected void comboDisposed(DisposeEvent event) {
- // the combo is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.comboHolder.removeDisposeListener(this.comboDisposeListener);
- if (this.comboHolder.isEditable()) {
- this.comboHolder.removeModifyListener(this.comboModifyListener);
- }
- else {
- this.comboHolder.removeSelectionListener(this.comboSelectionListener);
- }
- this.selectedItemHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.selectedItemChangeListener);
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listHolder);
- }
-
-
- // ********** double click support **********
-
- public void addDoubleClickListener(DoubleClickListener<E> listener) {
- this.doubleClickListenerList.add(listener);
- }
-
- public void removeDoubleClickListener(DoubleClickListener<E> listener) {
- this.doubleClickListenerList.remove(listener);
- }
-
- public interface DoubleClickListener<E> extends EventListener {
- void doubleClick(DoubleClickEvent<E> event);
- }
-
- public static class DoubleClickEvent<E> extends EventObject {
- private final E selection;
- private static final long serialVersionUID = 1L;
-
- protected DoubleClickEvent(AbstractComboModelAdapter<E> source, E selection) {
- super(source);
- if (selection == null) {
- throw new NullPointerException();
- }
- this.selection = selection;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public AbstractComboModelAdapter<E> getSource() {
- return (AbstractComboModelAdapter<E>) super.getSource();
- }
-
- public E selection() {
- return this.selection;
- }
- }
-
-
- // ********** selection support **********
-
- public void addSelectionChangeListener(SelectionChangeListener<E> listener) {
- this.selectionChangeListenerList.add(listener);
- }
-
- public void removeSelectionChangeListener(SelectionChangeListener<E> listener) {
- this.selectionChangeListenerList.remove(listener);
- }
-
- public interface SelectionChangeListener<E> extends EventListener {
- void selectionChanged(SelectionChangeEvent<E> event);
- }
-
- public static class SelectionChangeEvent<E> extends EventObject {
- private final E selectedItem;
- private static final long serialVersionUID = 1L;
-
- protected SelectionChangeEvent(AbstractComboModelAdapter<E> source, E selectedItem) {
- super(source);
- this.selectedItem = selectedItem;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public AbstractComboModelAdapter<E> getSource() {
- return (AbstractComboModelAdapter<E>) super.getSource();
- }
-
- public E selectedItem() {
- return this.selectedItem;
- }
- }
-
- // ********** Internal member **********
-
- /**
- * This holder is required for supporting <code>Combo</code> and
- * <code>CCombo</code> transparently.
- */
- protected static interface ComboHolder {
- void add(String item, int index);
- void addDisposeListener(DisposeListener disposeListener);
- void addModifyListener(ModifyListener modifyListener);
- void addSelectionListener(SelectionListener selectionListener);
- void deselectAll();
- int getItemCount();
- String[] getItems();
- int getSelectionIndex();
- String getText();
- boolean isDisposed();
- boolean isEditable();
- boolean isPopulating();
- void removeDisposeListener(DisposeListener disposeListener);
- void removeModifyListener(ModifyListener modifyListener);
- void removeSelectionListener(SelectionListener selectionListener);
- void setItem(int index, String item);
- void setItems(String[] items);
- void setPopulating(boolean populating);
- void setText(String item);
- void remove(int start, int end);
- void removeAll();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ColumnAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ColumnAdapter.java
deleted file mode 100644
index 775bf91e4c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ColumnAdapter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This adapter is used by the table model adapter to convert a model object
- * into the models used for each of the cells for the object's corresponding row
- * in the table.
- *
- * @version 2.0
- * @since 2.0
- */
-public interface ColumnAdapter<V> {
-
- /**
- * Return the cell models for the specified subject
- * that corresponds to a single row in the table.
- */
- WritablePropertyValueModel<?>[] cellModels(V subject);
-
- /**
- * Returns the number of columns in the table. Typically this is static.
- *
- * @return The number of columns
- */
- int columnCount();
-
- /**
- * Returns the name of the column at the specified index.
- *
- * @param columnIndex The index of the column to retrieve its display text
- * @return The display text of the column
- */
- String columnName(int columnIndex);
-
- /**
- * Returns whether the specified column is editable. Typically this is the
- * same for every row.
- *
- * @param columnIndex The index of the column for which we determine if
- * the content can be modified
- * @return <code>true</code> to allow editing of the cell at the given
- * column index; <code>false</code> to keep it not editable
- */
-// boolean columnIsEditable(int columnIndex);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ComboModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ComboModelAdapter.java
deleted file mode 100644
index 39794a9cc7..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/ComboModelAdapter.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Combo;
-
-/**
- * This adapter provides a more object-oriented interface to the items and
- * selected item in a <code>Combo</code>.
- * <p>
- * <b>listHolder</b> contains the items in the <code>Combo</code>.<br>
- * <b>selectedItemHolder</b> contains the items in 'listHolder' that are
- * selected in the <code>Combo</code>.
- *
- * @param <E> The type of the items in <b>listHolder</b>
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class ComboModelAdapter<E> extends AbstractComboModelAdapter<E> {
-
- // ********** static methods **********
-
- /**
- * Adapt the specified model list and selection to the specified combo.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the combo, which calls #toString() on the
- * items in the model list.
- */
- public static <T> ComboModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- WritablePropertyValueModel<T> selectedItemHolder,
- Combo combo)
- {
- return adapt(
- listHolder,
- selectedItemHolder,
- combo,
- StringConverter.Default.<T>instance()
- );
- }
-
- /**
- * Adapt the specified model list and selection to the specified combo.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the combo.
- */
- public static <T> ComboModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- WritablePropertyValueModel<T> selectedItemHolder,
- Combo combo,
- StringConverter<T> stringConverter)
- {
- return new ComboModelAdapter<T>(
- listHolder,
- selectedItemHolder,
- combo,
- stringConverter
- );
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder, selections holder, combo, and
- * string converter are required.
- */
- protected ComboModelAdapter(
- ListValueModel<E> listHolder,
- WritablePropertyValueModel<E> selectedItemHolder,
- Combo combo,
- StringConverter<E> stringConverter)
- {
- super(listHolder,
- selectedItemHolder,
- new SWTComboHolder(combo),
- stringConverter);
- }
-
-
- // ********** Internal member **********
-
- private static class SWTComboHolder implements ComboHolder {
- private final Combo combo;
- private final boolean editable;
- private String selectedItem;
-
- SWTComboHolder(Combo combo) {
- super();
- this.combo = combo;
- this.editable = (combo.getStyle() & SWT.READ_ONLY) == 0;
- }
-
- public void add(String item, int index) {
- this.combo.add(item, index);
-
- // It is possible the selected item was set before the combo is being
- // populated, update the selected item if it's matches the item being
- // added
- if ((this.selectedItem != null) && this.selectedItem.equals(item)) {
- this.setText(this.selectedItem);
- this.selectedItem = null;
- }
- }
-
- public void addDisposeListener(DisposeListener disposeListener) {
- this.combo.addDisposeListener(disposeListener);
- }
-
- public void addModifyListener(ModifyListener modifyListener) {
- this.combo.addModifyListener(modifyListener);
- }
-
- public void addSelectionListener(SelectionListener selectionListener) {
- this.combo.addSelectionListener(selectionListener);
- }
-
- public void deselectAll() {
- this.combo.deselectAll();
- }
-
- public int getItemCount() {
- return this.combo.getItemCount();
- }
-
- public String[] getItems() {
- return this.combo.getItems();
- }
-
- public int getSelectionIndex() {
- return this.combo.getSelectionIndex();
- }
-
- public String getText() {
- return this.combo.getText();
- }
-
- public boolean isDisposed() {
- return this.combo.isDisposed();
- }
-
- public boolean isEditable() {
- return this.editable;
- }
-
- public boolean isPopulating() {
- return this.combo.getData("populating") == Boolean.TRUE;
- }
-
- public void remove(int start, int end) {
- this.combo.remove(start, end);
- }
-
- public void removeAll() {
- this.combo.removeAll();
- }
-
- public void removeDisposeListener(DisposeListener disposeListener) {
- this.combo.removeDisposeListener(disposeListener);
- }
-
- public void removeModifyListener(ModifyListener modifyListener) {
- this.combo.removeModifyListener(modifyListener);
- }
-
- public void removeSelectionListener(SelectionListener selectionListener) {
- this.combo.removeSelectionListener(selectionListener);
- }
-
- public void setItem(int index, String item) {
- this.combo.setItem(index, item);
- }
-
- public void setItems(String[] items) {
- this.combo.setItems(items);
- }
-
- public void setPopulating(boolean populating) {
- this.combo.setData("populating", Boolean.valueOf(populating));
- }
-
- public void setText(String item) {
-
- // Keep track of the selected item since it's possible the selected
- // item is before the combo is populated
- if (this.combo.getItemCount() == 0) {
- this.selectedItem = item;
- }
- else {
- this.selectedItem = null;
- }
- this.combo.setText(item);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/DateTimeModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/DateTimeModelAdapter.java
deleted file mode 100644
index 7347f3e70b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/DateTimeModelAdapter.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.DateTime;
-
-/**
- * This adapter can be used to keep a DateTime widget in synch with
- * model integers hours, minutes, and seconds. Has default hours,
- * minutes and seconds of 0 which corresponds to 12:00:00 AM. This model
- * adapter can only be used for a DateTime widget with the style SWT.TIME
- */
-@SuppressWarnings("nls")
-public class DateTimeModelAdapter {
-
- /**
- * A value model on the underlying model hours integer.
- */
- protected final WritablePropertyValueModel<Integer> hoursHolder;
-
- /**
- * A value model on the underlying model minutes integer.
- */
- protected final WritablePropertyValueModel<Integer> minutesHolder;
-
- /**
- * A value model on the underlying model seconds integer.
- */
- protected final WritablePropertyValueModel<Integer> secondsHolder;
-
- /**
- * A listener that allows us to synchronize the dateTime's selection state with
- * the model hours integer.
- */
- protected final PropertyChangeListener hoursPropertyChangeListener;
-
- /**
- * A listener that allows us to synchronize the dateTime's selection state with
- * the model minutes integer.
- */
- protected final PropertyChangeListener minutesPropertyChangeListener;
-
- /**
- * A listener that allows us to synchronize the dateTime's selection state with
- * the model seconds integer.
- */
- protected final PropertyChangeListener secondsPropertyChangeListener;
-
- /**
- * The dateTime we keep synchronized with the model integers.
- */
- protected final DateTime dateTime;
-
- /**
- * A listener that allows us to synchronize our selection number holder
- * with the spinner's value.
- */
- protected final SelectionListener dateTimeSelectionListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the dateTime
- * is disposed.
- */
- protected final DisposeListener dateTimeDisposeListener;
-
- /**
- * This lock is used to prevent the listeners to be notified when the value
- * changes from the spinner or from the holder.
- */
- private boolean locked;
-
- // ********** static methods **********
-
- /**
- * Adapt the specified model integer holders to the specified dateTime.
- */
- public static DateTimeModelAdapter adapt(
- WritablePropertyValueModel<Integer> hoursHolder,
- WritablePropertyValueModel<Integer> minutesHolder,
- WritablePropertyValueModel<Integer> secondsHolder,
- DateTime dateTime)
- {
- return new DateTimeModelAdapter(hoursHolder, minutesHolder, secondsHolder, dateTime);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the hoursHolder, minutesHolder, secondsHolder, and dateTime are required
- */
- protected DateTimeModelAdapter(WritablePropertyValueModel<Integer> hoursHolder,
- WritablePropertyValueModel<Integer> minutesHolder,
- WritablePropertyValueModel<Integer> secondsHolder,
- DateTime dateTime) {
- super();
- if ((hoursHolder == null)
- || (minutesHolder == null)
- || (secondsHolder == null)
- || (dateTime == null)) {
- throw new NullPointerException();
- }
- this.hoursHolder = hoursHolder;
- this.minutesHolder = minutesHolder;
- this.secondsHolder = secondsHolder;
- this.dateTime = dateTime;
-
- this.hoursPropertyChangeListener = this.buildHoursPropertyChangeListener();
- this.hoursHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.hoursPropertyChangeListener);
-
- this.minutesPropertyChangeListener = this.buildMinutesPropertyChangeListener();
- this.minutesHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.minutesPropertyChangeListener);
-
- this.secondsPropertyChangeListener = this.buildSecondsPropertyChangeListener();
- this.secondsHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.secondsPropertyChangeListener);
-
- this.dateTimeSelectionListener = this.buildDateTimeSelectionListener();
- this.dateTime.addSelectionListener(this.dateTimeSelectionListener);
-
- this.dateTimeDisposeListener = this.buildDateTimeDisposeListener();
- this.dateTime.addDisposeListener(this.dateTimeDisposeListener);
-
- this.updateDateTimeHours(hoursHolder.getValue());
- this.updateDateTimeMinutes(minutesHolder.getValue());
- this.updateDateTimeSeconds(secondsHolder.getValue());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildHoursPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildHoursPropertyChangeListener_());
- }
-
- protected PropertyChangeListener buildHoursPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DateTimeModelAdapter.this.hoursChanged(event);
- }
- @Override
- public String toString() {
- return "dateTime hours listener";
- }
- };
- }
-
- protected PropertyChangeListener buildMinutesPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildMinutesPropertyChangeListener_());
- }
-
- protected PropertyChangeListener buildMinutesPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DateTimeModelAdapter.this.minutesChanged(event);
- }
- @Override
- public String toString() {
- return "dateTime minutes listener";
- }
- };
- }
-
- protected PropertyChangeListener buildSecondsPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSecondsPropertyChangeListener_());
- }
-
- protected PropertyChangeListener buildSecondsPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DateTimeModelAdapter.this.secondsChanged(event);
- }
- @Override
- public String toString() {
- return "dateTime seconds listener";
- }
- };
- }
-
- protected SelectionListener buildDateTimeSelectionListener() {
- return new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- DateTimeModelAdapter.this.dateTimeSelected(e);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- @Override
- public String toString() {
- return "dateTime selection listener";
- }
- };
- }
-
- protected DisposeListener buildDateTimeDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- DateTimeModelAdapter.this.dateTimeDisposed(event);
- }
- @Override
- public String toString() {
- return "dateTime dispose listener";
- }
- };
- }
-
-
- // ********** model events **********
-
- protected void hoursChanged(PropertyChangeEvent event) {
- if (!this.locked) {
- this.updateDateTimeHours((Integer) event.getNewValue());
- }
- }
-
- protected void minutesChanged(PropertyChangeEvent event) {
- if (!this.locked) {
- this.updateDateTimeMinutes((Integer) event.getNewValue());
- }
- }
-
- protected void secondsChanged(PropertyChangeEvent event) {
- if (!this.locked) {
- this.updateDateTimeSeconds((Integer) event.getNewValue());
- }
- }
-
- // ********** dateTime events **********
-
- protected void dateTimeSelected(SelectionEvent event) {
- if (!this.locked) {
- this.locked = true;
- try {
- //too bad they didn't split the event up
- hoursSelected();
- minutesSelected();
- secondsSelected();
- }
- finally {
- this.locked = false;
- }
- }
- }
-
- protected void hoursSelected() {
- Integer hours = null;
- if (this.dateTime.getHours() != 0) {
- hours = Integer.valueOf(this.dateTime.getHours());
- }
- this.hoursHolder.setValue(hours);
- }
-
- protected void minutesSelected() {
- Integer minutes = null;
- if (this.dateTime.getMinutes() != 0) {
- minutes = Integer.valueOf(this.dateTime.getMinutes());
- }
- this.minutesHolder.setValue(minutes);
- }
-
- protected void secondsSelected() {
- Integer seconds = null;
- if (this.dateTime.getSeconds() != 0) {
- seconds = Integer.valueOf(this.dateTime.getSeconds());
- }
- this.secondsHolder.setValue(seconds);
- }
-
- protected void dateTimeDisposed(DisposeEvent event) {
- // the dateTime is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.dateTime.removeDisposeListener(this.dateTimeDisposeListener);
- this.dateTime.removeSelectionListener(this.dateTimeSelectionListener);
- this.hoursHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.hoursPropertyChangeListener);
- this.minutesHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.minutesPropertyChangeListener);
- this.secondsHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.secondsPropertyChangeListener);
- }
-
- // ********** update **********
-
- protected void updateDateTimeHours(Integer hours) {
- if (this.dateTime.isDisposed()) {
- return;
- }
- if (hours == null) {
- hours = Integer.valueOf(0);//TODO defaultHours
- }
- this.locked = true;
- try {
- this.dateTime.setHours(hours.intValue());
- }
- finally {
- this.locked = false;
- }
- }
-
- protected void updateDateTimeMinutes(Integer minutes) {
- if (this.dateTime.isDisposed()) {
- return;
- }
- if (minutes == null) {
- minutes = Integer.valueOf(0);//TODO defaultMinutes
- }
- this.locked = true;
- try {
- this.dateTime.setMinutes(minutes.intValue());
- }
- finally {
- this.locked = false;
- }
- }
-
- protected void updateDateTimeSeconds(Integer seconds) {
- if (this.dateTime.isDisposed()) {
- return;
- }
- if (seconds == null) {
- seconds = Integer.valueOf(0);//TODO defaultSeconds
- }
- this.locked = true;
- try {
- this.dateTime.setSeconds(seconds.intValue());
- }
- finally {
- this.locked = false;
- }
- }
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.hoursHolder);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/SpinnerModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/SpinnerModelAdapter.java
deleted file mode 100644
index dabb63eb3a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/SpinnerModelAdapter.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Spinner;
-
-/**
- *
- */
-@SuppressWarnings("nls")
-public class SpinnerModelAdapter {
-
- /**
- * A value model on the underlying model list.
- */
- protected final WritablePropertyValueModel<Integer> numberHolder;
-
- /**
- * A listener that allows us to synchronize the spinner's contents with
- * the model list.
- */
- protected final PropertyChangeListener propertyChangeListener;
-
- /**
- * The spinner we keep synchronized with the model string.
- */
- protected final Spinner spinner;
-
- /**
- * A listener that allows us to synchronize our selection number holder
- * with the spinner's value.
- */
- protected final ModifyListener spinnerModifyListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the spinner
- * is disposed.
- */
- protected final DisposeListener spinnerDisposeListener;
-
- /**
- * The value shown when the number holder's value is <code>null</code>.
- */
- protected final int defaultValue;
-
- /**
- * This lock is used to prevent the listeners to be notified when the value
- * changes from the spinner or from the holder.
- */
- private boolean locked;
-
- // ********** static methods **********
-
- /**
- * Adapt the specified model list and selections to the specified spinner.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the spinner.
- */
- public static SpinnerModelAdapter adapt(
- WritablePropertyValueModel<Integer> numberHolder,
- Spinner spinner,
- int defaultValue)
- {
- return new SpinnerModelAdapter(numberHolder, spinner, defaultValue);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder, selections holder, list box, and
- * string converter are required.
- */
- protected SpinnerModelAdapter(WritablePropertyValueModel<Integer> numberHolder,
- Spinner spinner,
- int defaultValue) {
- super();
- if ((numberHolder == null) || (spinner == null)) {
- throw new NullPointerException();
- }
- this.numberHolder = numberHolder;
- this.spinner = spinner;
- this.defaultValue = defaultValue;
-
- this.propertyChangeListener = this.buildPropertyChangeListener();
- this.numberHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
-
- this.spinnerModifyListener = this.buildSpinnerModifyListener();
- this.spinner.addModifyListener(this.spinnerModifyListener);
-
- this.spinnerDisposeListener = this.buildSpinnerDisposeListener();
- this.spinner.addDisposeListener(this.spinnerDisposeListener);
-
- this.updateSpinner(numberHolder.getValue());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildPropertyChangeListener_());
- }
-
- protected PropertyChangeListener buildPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- SpinnerModelAdapter.this.valueChanged(event);
- }
- @Override
- public String toString() {
- return "spinner listener";
- }
- };
- }
-
- protected ModifyListener buildSpinnerModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- SpinnerModelAdapter.this.spinnerModified(e);
- }
- @Override
- public String toString() {
- return "spinner selection listener";
- }
- };
- }
-
- protected DisposeListener buildSpinnerDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- SpinnerModelAdapter.this.spinnerDisposed(event);
- }
- @Override
- public String toString() {
- return "spinner dispose listener";
- }
- };
- }
-
-
- // ********** model events **********
-
- protected void valueChanged(PropertyChangeEvent event) {
- if (!this.locked) {
- this.updateSpinner((Integer) event.getNewValue());
- }
- }
-
-
- // ********** spinner events **********
-
- protected void spinnerModified(ModifyEvent event) {
- if (!this.locked) {
- this.locked = true;
- try {
- this.numberHolder.setValue(this.spinner.getSelection());
- }
- finally {
- this.locked = false;
- }
- }
- }
-
- protected void spinnerDisposed(DisposeEvent event) {
- // the spinner is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.spinner.removeDisposeListener(this.spinnerDisposeListener);
- this.spinner.removeModifyListener(this.spinnerModifyListener);
- this.numberHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- }
-
- // ********** update **********
-
- protected void updateSpinner(Integer value) {
- if (this.spinner.isDisposed()) {
- return;
- }
- // the model can be null, but the spinner cannot
- if (value == null) {
- value = defaultValue;
- }
- this.locked = true;
- try {
- this.spinner.setSelection(value);
- }
- finally {
- this.locked = false;
- }
- }
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.numberHolder);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java
deleted file mode 100644
index cc1a67ec4c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * This adapter can be used to keep a table item in synch with the properties of
- * a model.
- */
-@SuppressWarnings("nls")
-public class TableItemModelAdapter {
-
- /** The table item we synchronize with the model. */
- protected final TableItem tableItem;
-
- /**
- * A listener that allows us to stop listening to stuff when the button
- * is disposed.
- */
- protected final DisposeListener tableItemDisposeListener;
-
- /**
- * Client-supplied adapter that provides with the various column settings and
- * converts the objects in the LVM into an array of cell models.
- */
- private ColumnAdapter<Object> columnAdapter;
-
- /**
- * The value models used to listen to each property that are display by the
- * table item.
- */
- private WritablePropertyValueModel<?>[] valueHolders;
-
- /**
- * The list of <code>PropertyChangeListener</code>s used to be notified when
- * the properties of the model being display into a row change.
- */
- private PropertyChangeListener[] propertyChangeListeners;
-
- /**
- * The label used to format the objects into a string representation.
- */
- private ITableLabelProvider labelProvider;
-
- // ********** static methods **********
-
- /**
- * Adapt the specified boolean to the specified button.
- * If the boolean is null, the button's value will be "unselected".
- */
- public static TableItemModelAdapter adapt(TableItem tableItem, ColumnAdapter<?> columnAdapter, ITableLabelProvider labelProvider) {
- return new TableItemModelAdapter(tableItem, columnAdapter, labelProvider);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder and button are required.
- */
- @SuppressWarnings("unchecked")
- protected TableItemModelAdapter(TableItem tableItem, ColumnAdapter<?> columnAdapter, ITableLabelProvider labelProvider) {
- super();
- if (tableItem == null || columnAdapter == null || labelProvider == null) {
- throw new NullPointerException();
- }
- this.tableItem = tableItem;
- this.labelProvider = labelProvider;
- this.columnAdapter = (ColumnAdapter<Object>) columnAdapter;
-
- this.tableItemDisposeListener = this.buildTableItemDisposeListener();
- this.tableItem.addDisposeListener(this.tableItemDisposeListener);
-
- this.valueHolders = this.columnAdapter.cellModels(tableItem.getData());
- this.propertyChangeListeners = this.buildPropertyChangeListeners();
-
- for (int index = this.columnAdapter.columnCount(); --index >= 0; ) {
- tableItemChanged(index, tableItem.getData(), false);
- valueHolders[index].addPropertyChangeListener(PropertyValueModel.VALUE, propertyChangeListeners[index]);
- }
- }
-
-
- // ********** initialization **********
-
- private PropertyChangeListener[] buildPropertyChangeListeners() {
- PropertyChangeListener[] listeners = new PropertyChangeListener[columnAdapter.columnCount()];
- for (int index = listeners.length; --index >= 0; ) {
- listeners[index] = buildPropertyChangeListener(index);
- }
- return listeners;
- }
-
-
- protected PropertyChangeListener buildPropertyChangeListener(int index) {
- return new SWTPropertyChangeListenerWrapper(
- this.buildPropertyChangeListener_(index)
- );
- }
-
- protected PropertyChangeListener buildPropertyChangeListener_(int index) {
- return new TableItemPropertyChangeListener(index);
- }
-
- protected DisposeListener buildTableItemDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- TableItemModelAdapter.this.tableItemDisposed(event);
- }
- @Override
- public String toString() {
- return "TableItem dispose listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- protected void tableItemChanged(int index, Object subject, boolean revalidate) {
-
- if (!this.tableItem.isDisposed()) {
- this.updateTableItemText(index, subject);
- this.updateTableItemImage(index, subject);
-
- if (revalidate) {
- this.layoutTable();
- }
- }
- }
-
- private void updateTableItemText(int index, Object subject) {
- String text = this.labelProvider.getColumnText(subject, index);
- if (text == null) {
- text = "";
- }
- this.tableItem.setText(index, text);
- }
-
- private void updateTableItemImage(int index, Object subject) {
- Image image = this.labelProvider.getColumnImage(subject, index);
- this.tableItem.setImage(index, image);
- }
-
- private void layoutTable() {
- // Refresh the table in order to show the scrollbar if required
- Composite container = this.tableItem.getParent().getParent();
- container.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- container.layout();
- }
-
- // ********** dispose **********
-
- protected void tableItemDisposed(DisposeEvent event) {
- // the button is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.tableItem.removeDisposeListener(this.tableItemDisposeListener);
-
- for (int index = valueHolders.length; --index >= 0; ) {
- valueHolders[index].removePropertyChangeListener(PropertyValueModel.VALUE, propertyChangeListeners[index]);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- private class TableItemPropertyChangeListener implements PropertyChangeListener {
-
- private final int index;
-
- TableItemPropertyChangeListener(int index) {
- super();
- this.index = index;
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (!tableItem.isDisposed()) {
- Table table = tableItem.getParent();
- tableItemChanged(index, tableItem.getData(), table.getColumnCount() == 0);
- }
- }
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java
deleted file mode 100644
index 8d3b4e3af9..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableModelAdapter.java
+++ /dev/null
@@ -1,746 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EventListener;
-import java.util.EventObject;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTCollectionChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * This adapter provides a more object-oriented interface to the items and
- * selected items in a table.
- * {@link #listHolder} contains the data of a single column in the table.
- * {@link #selectedItemsHolder} contains the data of a single column in
- * {@link #listHolder} that are selected in the table.
- */
-// TODO bjv
-@SuppressWarnings("nls")
-public class TableModelAdapter<E> {
-
- // ********** model **********
- /**
- * A value model on the underlying model list.
- */
- protected final ListValueModel<E> listHolder;
-
- /**
- * A listener that allows us to synchronize the table's contents with
- * the model list.
- */
- protected final ListChangeListener listChangeListener;
-
- /**
- * A value model on the underlying model selections.
- */
- protected final CollectionValueModel<E> selectedItemsHolder;
-
- /**
- * A listener that allows us to synchronize the table's selection with
- * the model selections.
- */
- protected final CollectionChangeListener selectedItemsChangeListener;
-
- /**
- * The table we keep synchronized with the model list.
- */
- protected final Table table;
-
- /**
- * A listener that allows us to synchronize our selection list holder
- * with the table's selection.
- */
- protected final SelectionListener tableSelectionListener;
-
- /**
- * Clients that are interested in selection change events.
- */
- protected final ListenerList<SelectionChangeListener<E>> selectionChangeListenerList;
-
- /**
- * Clients that are interested in double click events.
- */
- protected final ListenerList<DoubleClickListener<E>> doubleClickListenerList;
-
- /**
- * A listener that allows us to stop listening to stuff when the table
- * is disposed.
- */
- protected final DisposeListener tableDisposeListener;
-
- /**
- * This label provider is responsible to convert a property at a column index
- * to a string value.
- */
- protected final ITableLabelProvider labelProvider;
-
- /**
- * The column adapter is responsible to return the count of columns and to
- * create the value holders for all the properties.
- */
- private ColumnAdapter<E> columnAdapter;
-
- /**
- * Keeps track of the <code>TableItemModelAdapter</code>s that were created
- * for each item of the list holder.
- */
- private List<TableItemModelAdapter> tableItemModelAdapters;
-
-
- // ********** static methods **********
-
- /**
- * Adapt the specified list model and selection to the specified table.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the table.
- */
- public static <T> TableModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- PropertyValueModel<T> selectedItemHolder,
- Table table,
- ColumnAdapter<T> columnAdapter,
- ITableLabelProvider labelProvider) {
-
- return new TableModelAdapter<T>(
- listHolder,
- new PropertyCollectionValueModelAdapter<T>(selectedItemHolder),
- table,
- columnAdapter,
- labelProvider);
- }
-
- /**
- * Adapt the specified list model and selection to the specified table.
- * The specified selection model will be kept in sync with the table.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the table.
- */
- public static <T> TableModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- WritableCollectionValueModel<T> selectionModel,
- Table table,
- ColumnAdapter<T> columnAdapter,
- ITableLabelProvider labelProvider) {
-
- TableModelAdapter adapter =
- new TableModelAdapter<T>(
- listHolder,
- selectionModel,
- table,
- columnAdapter,
- labelProvider);
- adapter.addSelectionChangeListener(buildSyncListener(selectionModel));
- return adapter;
- }
-
- private static <T> SelectionChangeListener buildSyncListener(
- final WritableCollectionValueModel<T> selectionModel) {
-
- return new SelectionChangeListener() {
- public void selectionChanged(SelectionChangeEvent event) {
- selectionModel.setValues(CollectionTools.iterable(event.selection()));
- }
- };
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder, selections holder, table, and
- * string converter are required.
- */
- protected TableModelAdapter(
- ListValueModel<E> listHolder,
- CollectionValueModel<E> selectedItemsHolder,
- Table table,
- ColumnAdapter<E> columnAdapter,
- ITableLabelProvider labelProvider)
- {
- super();
- if ((listHolder == null) || (selectedItemsHolder == null) || (table == null) || (labelProvider == null)) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.selectedItemsHolder = selectedItemsHolder;
- this.table = table;
- this.columnAdapter = columnAdapter;
- this.labelProvider = labelProvider;
- this.tableItemModelAdapters = new ArrayList<TableItemModelAdapter>(columnAdapter.columnCount());
-
- this.listChangeListener = this.buildListChangeListener();
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
-
- this.selectedItemsChangeListener = this.buildSelectedItemsChangeListener();
- this.selectedItemsHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.selectedItemsChangeListener);
-
- this.tableSelectionListener = this.buildTableSelectionListener();
- this.table.addSelectionListener(this.tableSelectionListener);
-
- this.selectionChangeListenerList = this.buildSelectionChangeListenerList();
- this.doubleClickListenerList = this.buildDoubleClickListenerList();
-
- this.tableDisposeListener = this.buildTableDisposeListener();
- this.table.addDisposeListener(this.tableDisposeListener);
-
- this.synchronizeTable();
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- TableModelAdapter.this.listItemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- TableModelAdapter.this.listItemsRemoved(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- TableModelAdapter.this.listItemsMoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- TableModelAdapter.this.listItemsReplaced(event);
- }
- public void listCleared(ListClearEvent event) {
- TableModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- TableModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "TableModelAdapter list listener";
- }
- };
- }
-
- protected CollectionChangeListener buildSelectedItemsChangeListener() {
- return new SWTCollectionChangeListenerWrapper(this.buildSelectedItemsChangeListener_());
- }
-
- protected CollectionChangeListener buildSelectedItemsChangeListener_() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- TableModelAdapter.this.selectedItemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- TableModelAdapter.this.selectedItemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- TableModelAdapter.this.selectedItemsCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- TableModelAdapter.this.selectedItemsChanged(event);
- }
- @Override
- public String toString() {
- return "TableModelAdapter selected items listener";
- }
- };
- }
-
- protected SelectionListener buildTableSelectionListener() {
- return new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- TableModelAdapter.this.tableSelectionChanged(event);
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- TableModelAdapter.this.tableDoubleClicked(event);
- }
- @Override
- public String toString() {
- return "TableModelAdapter table selection listener";
- }
- };
- }
-
- @SuppressWarnings({"rawtypes", "unchecked"})
- protected ListenerList<DoubleClickListener<E>> buildDoubleClickListenerList() {
- return new ListenerList(DoubleClickListener.class);
- }
-
- @SuppressWarnings({"rawtypes", "unchecked"})
- protected ListenerList<SelectionChangeListener<E>> buildSelectionChangeListenerList() {
- return new ListenerList(SelectionChangeListener.class);
- }
-
- protected DisposeListener buildTableDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- TableModelAdapter.this.tableDisposed(event);
- }
- @Override
- public String toString() {
- return "TableModelAdapter table dispose listener";
- }
- };
- }
-
- protected void synchronizeTable() {
- this.synchronizeTableColumns();
- this.synchronizeTableItems();
- this.synchronizeTableSelection();
- }
-
-
- // ********** list **********
-
- /**
- * Creates the table colums.
- */
- protected void synchronizeTableColumns() {
- if (this.table.isDisposed()) {
- return;
- }
-
- int columnCount = this.columnAdapter.columnCount();
-
- for (int index = 0; index < columnCount; index++) {
- TableColumn tableColumn = new TableColumn(this.table, SWT.NULL, index);
- tableColumn.setMoveable(false);
- tableColumn.setResizable(true);
- tableColumn.setWidth(100);
-
- String columnName = this.columnAdapter.columnName(index);
-
- if (columnName == null) {
- columnName = "";
- }
-
- tableColumn.setText(columnName);
- }
- }
-
- /**
- * Brute force synchronization of table with the model list.
- */
- protected void synchronizeTableItems() {
- if (this.table.isDisposed()) {
- return;
- }
-
- for (int index = this.table.getItemCount(); --index >= 0; ) {
- this.table.remove(index);
- this.tableItemModelAdapters.remove(index);
- }
-
- int itemCount = this.listHolder.size();
-
- for (int index = 0; index < itemCount; index++) {
-
- TableItem tableItem = new TableItem(this.table, SWT.NULL, index);
- tableItem.setData(this.listHolder.get(index));
-
- TableItemModelAdapter adapter = this.buildItemModel(tableItem);
- this.tableItemModelAdapters.add(adapter);
- }
- }
-
- /**
- * The model has changed - synchronize the table.
- */
- protected void listItemsAdded(ListAddEvent event) {
-
- if (this.table.isDisposed()) {
- return;
- }
-
- int index = event.getIndex();
-
- for (E item : this.getItems(event)) {
-
- TableItem tableItem = new TableItem(this.table, SWT.NULL, index);
- tableItem.setData(item);
-
- TableItemModelAdapter adapter = this.buildItemModel(tableItem);
- this.tableItemModelAdapters.add(index++, adapter);
- }
- }
-
- /**
- * The model has changed - synchronize the table.
- */
- protected void listItemsRemoved(ListRemoveEvent event) {
-
- if (this.table.isDisposed()) {
- return;
- }
-
- this.table.remove(event.getIndex(), event.getIndex() + event.getItemsSize() - 1);
-
- for (int index = event.getIndex() + event.getItemsSize(); --index >= event.getIndex(); ) {
- this.tableItemModelAdapters.remove(index);
- }
- }
-
- /**
- * The model has changed - synchronize the table.
- */
- protected void listItemsMoved(ListMoveEvent event) {
-
- if (this.table.isDisposed()) {
- return;
- }
-
- int length = event.getLength();
- int sourceIndex = event.getSourceIndex();
- int targetIndex = event.getTargetIndex();
- int lowStartIndex = Math.min(targetIndex, sourceIndex);
- int hiStartIndex = Math.max(targetIndex, sourceIndex);
-
- Object[] items = new Object[hiStartIndex - lowStartIndex + length];
- int itemsIndex = items.length;
-
- // Remove the TableItems wrapping the moved items
- for (int index = hiStartIndex + length; --index >= lowStartIndex; ) {
-
- TableItemModelAdapter tableItemModel = this.tableItemModelAdapters.get(index);
- items[--itemsIndex] = tableItemModel.tableItem.getData();
-
- // Remove the TableItem, which will also dispose TableItemModelAdapter
- this.table.remove(index);
- }
-
- // Move the items so they can retrieved in the right order when
- // re-creating the TableItems
- ArrayTools.move(
- items,
- targetIndex - lowStartIndex,
- sourceIndex - lowStartIndex,
- length
- );
-
- itemsIndex = 0;
-
- // Add TableItems for the moved items
- for (int index = lowStartIndex; index <= hiStartIndex + length - 1; index++) {
-
- // Create the new TableItem
- TableItem tableItem = new TableItem(this.table, SWT.NULL, index);
- tableItem.setData(items[itemsIndex++]);
-
- // Adapt it with a model adapter
- TableItemModelAdapter adapter = this.buildItemModel(tableItem);
- this.tableItemModelAdapters.set(index, adapter);
- }
- }
-
-
- private TableItemModelAdapter buildItemModel(TableItem tableItem) {
- return TableItemModelAdapter.adapt(
- tableItem,
- this.columnAdapter,
- this.labelProvider
- );
- }
-
- /**
- * The model has changed - synchronize the table.
- */
- protected void listItemsReplaced(ListReplaceEvent event) {
- if (this.table.isDisposed()) {
- return;
- }
-
- int rowIndex = event.getIndex();
-
- for (E item : this.getNewItems(event)) {
- TableItem tableItem = this.table.getItem(rowIndex);
- tableItem.setData(item);
-
- TableItemModelAdapter adapter = this.tableItemModelAdapters.get(rowIndex);
-
- int columnCount = this.columnAdapter.columnCount();
- boolean revalidate = (columnCount == 1);
-
- for (int columnIndex = columnCount; --columnIndex >= 0; ) {
- adapter.tableItemChanged(columnIndex, tableItem.getData(), revalidate);
- }
-
- rowIndex++;
- }
- }
-
- /**
- * The model has changed - synchronize the table.
- */
- protected void listCleared(@SuppressWarnings("unused") ListClearEvent event) {
- if (this.table.isDisposed()) {
- return;
- }
- this.table.removeAll();
- }
-
- /**
- * The model has changed - synchronize the table.
- */
- protected void listChanged(@SuppressWarnings("unused") ListChangeEvent event) {
- this.synchronizeTableItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(ListAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getNewItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getNewItems();
- }
-
-
- // ********** selected items **********
-
- protected int indexOf(E item) {
- int len = this.listHolder.size();
- for (int i = 0; i < len; i++) {
- if (this.listHolder.get(i) == item) {
- return i;
- }
- }
- return -1;
- }
-
- protected void synchronizeTableSelection() {
- if (this.table.isDisposed()) {
- return;
- }
- int[] indices = new int[this.selectedItemsHolder.size()];
- int i = 0;
- for (E selectedItemHolder : this.selectedItemsHolder) {
- indices[i++] = this.indexOf(selectedItemHolder);
- }
- this.table.deselectAll();
- this.table.select(indices);
- }
-
- protected void selectedItemsAdded(CollectionAddEvent event) {
- if (this.table.isDisposed()) {
- return;
- }
- this.table.select(this.getIndices(event.getItemsSize(), this.getItems(event)));
- }
-
- protected void selectedItemsRemoved(CollectionRemoveEvent event) {
- if (this.table.isDisposed()) {
- return;
- }
- this.table.deselect(this.getIndices(event.getItemsSize(), this.getItems(event)));
- }
-
- protected int[] getIndices(int itemsSize, Iterable<E> items) {
- int[] indices = new int[itemsSize];
- int i = 0;
- for (E item : items) {
- indices[i++] = this.indexOf(item);
- }
- return indices;
- }
-
- protected void selectedItemsCleared(@SuppressWarnings("unused") CollectionClearEvent event) {
- if (this.table.isDisposed()) {
- return;
- }
- this.table.deselectAll();
- }
-
- protected void selectedItemsChanged(@SuppressWarnings("unused") CollectionChangeEvent event) {
- this.synchronizeTableSelection();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(CollectionAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(CollectionRemoveEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
-
- // ********** list box events **********
-
- protected void tableSelectionChanged(@SuppressWarnings("unused") SelectionEvent event) {
- if (this.selectionChangeListenerList.size() > 0) {
- SelectionChangeEvent<E> scEvent = new SelectionChangeEvent<E>(this, this.selectedItems());
- for (SelectionChangeListener<E> selectionChangeListener : this.selectionChangeListenerList.getListeners()) {
- selectionChangeListener.selectionChanged(scEvent);
- }
- }
- }
-
- protected Collection<E> selectedItems() {
- if (this.table.isDisposed()) {
- return Collections.emptySet();
- }
- ArrayList<E> selectedItems = new ArrayList<E>(this.table.getSelectionCount());
- for (int selectionIndex : this.table.getSelectionIndices()) {
- selectedItems.add(this.listHolder.get(selectionIndex));
- }
- return selectedItems;
- }
-
- protected void tableDoubleClicked(@SuppressWarnings("unused") SelectionEvent event) {
- if (this.table.isDisposed()) {
- return;
- }
- if (this.doubleClickListenerList.size() > 0) {
- // there should be only a single item selected during a double-click(?)
- E selection = this.listHolder.get(this.table.getSelectionIndex());
- DoubleClickEvent<E> dcEvent = new DoubleClickEvent<E>(this, selection);
- for (DoubleClickListener<E> doubleClickListener : this.doubleClickListenerList.getListeners()) {
- doubleClickListener.doubleClick(dcEvent);
- }
- }
- }
-
-
- // ********** dispose **********
-
- protected void tableDisposed(@SuppressWarnings("unused") DisposeEvent event) {
- // the table is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.table.removeDisposeListener(this.tableDisposeListener);
- this.table.removeSelectionListener(this.tableSelectionListener);
- this.selectedItemsHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.selectedItemsChangeListener);
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listHolder);
- }
-
-
- // ********** double click support **********
-
- public void addDoubleClickListener(DoubleClickListener<E> listener) {
- this.doubleClickListenerList.add(listener);
- }
-
- public void removeDoubleClickListener(DoubleClickListener<E> listener) {
- this.doubleClickListenerList.remove(listener);
- }
-
- public interface DoubleClickListener<E> extends EventListener {
- void doubleClick(DoubleClickEvent<E> event);
- }
-
- public static class DoubleClickEvent<E> extends EventObject {
- private final E selection;
- private static final long serialVersionUID = 1L;
-
- protected DoubleClickEvent(TableModelAdapter<E> source, E selection) {
- super(source);
- if (selection == null) {
- throw new NullPointerException();
- }
- this.selection = selection;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public TableModelAdapter<E> getSource() {
- return (TableModelAdapter<E>) super.getSource();
- }
-
- public E selection() {
- return this.selection;
- }
-
- }
-
-
- // ********** selection support **********
-
- public void addSelectionChangeListener(SelectionChangeListener<E> listener) {
- this.selectionChangeListenerList.add(listener);
- }
-
- public void removeSelectionChangeListener(SelectionChangeListener<E> listener) {
- this.selectionChangeListenerList.remove(listener);
- }
-
- public interface SelectionChangeListener<E> extends EventListener {
- void selectionChanged(SelectionChangeEvent<E> event);
- }
-
- public static class SelectionChangeEvent<E> extends EventObject {
- private final Collection<E> selection;
- private static final long serialVersionUID = 1L;
-
- protected SelectionChangeEvent(TableModelAdapter<E> source, Collection<E> selection) {
- super(source);
- if (selection == null) {
- throw new NullPointerException();
- }
- this.selection = selection;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public TableModelAdapter<E> getSource() {
- return (TableModelAdapter<E>) super.getSource();
- }
-
- public Iterator<E> selection() {
- return this.selection.iterator();
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TriStateCheckBoxModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TriStateCheckBoxModelAdapter.java
deleted file mode 100644
index 2c16b5b31c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TriStateCheckBoxModelAdapter.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.swt;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-
-/**
- * This adapter can be used to keep a tri-state check box in synch with
- * a model Boolean where the value can be <code>null</code>.
- */
-@SuppressWarnings("nls")
-public class TriStateCheckBoxModelAdapter {
-
- /** A value model on the underlying model boolean. */
- protected final WritablePropertyValueModel<Boolean> booleanHolder;
-
- /**
- * A listener that allows us to synchronize the button's selection state with
- * the model boolean.
- */
- protected final PropertyChangeListener booleanChangeListener;
-
- /** The check box/toggle button we synchronize with the model boolean. */
- protected final TriStateCheckBox button;
-
- /**
- * A listener that allows us to synchronize the model boolean with
- * the button's selection state.
- */
- protected final SelectionListener buttonSelectionListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the button
- * is disposed.
- */
- protected final DisposeListener buttonDisposeListener;
-
-
- // ********** static methods **********
-
- /**
- * Adapt the specified boolean to the specified button.
- * If the boolean is null, the button's value will be "partially checked"
- * (i.e. the button will be checked but grayed out).
- */
- public static TriStateCheckBoxModelAdapter adapt(WritablePropertyValueModel<Boolean> booleanHolder, TriStateCheckBox button) {
- return new TriStateCheckBoxModelAdapter(booleanHolder, button);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder and button are required.
- */
- protected TriStateCheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, TriStateCheckBox button) {
- super();
-
- Assert.isNotNull(booleanHolder, "The boolean holder cannot be null");
- Assert.isNotNull(button, "The check box cannot be null");
-
- this.booleanHolder = booleanHolder;
- this.button = button;
-
- this.booleanChangeListener = this.buildBooleanChangeListener();
- this.booleanHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
-
- this.buttonDisposeListener = this.buildButtonDisposeListener();
- this.button.addDisposeListener(this.buttonDisposeListener);
-
- this.buttonSelectionListener = this.buildButtonSelectionListener();
- this.button.addSelectionListener(this.buttonSelectionListener);
-
- this.setButtonSelection(this.booleanHolder.getValue());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildBooleanChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildBooleanChangeListener_());
- }
-
- protected PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- TriStateCheckBoxModelAdapter.this.booleanChanged(event);
- }
- @Override
- public String toString() {
- return "tri-state boolean listener";
- }
- };
- }
-
- protected SelectionListener buildButtonSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- TriStateCheckBoxModelAdapter.this.buttonSelected(event);
- }
- @Override
- public String toString() {
- return "tri-state button selection listener";
- }
- };
- }
-
- protected DisposeListener buildButtonDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- TriStateCheckBoxModelAdapter.this.buttonDisposed(event);
- }
- @Override
- public String toString() {
- return "tri-state button dispose listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * The model has changed - synchronize the button.
- * If the new model value is null, use the adapter's default value
- * (which is typically false).
- */
- protected void booleanChanged(PropertyChangeEvent event) {
- this.setButtonSelection((Boolean) event.getNewValue());
- }
-
- protected void setButtonSelection(Boolean selection) {
- if (this.button.isDisposed()) {
- return;
- }
- this.button.setSelection(selection);
- }
-
- /**
- * The button has been "selected" - synchronize the model.
- */
- protected void buttonSelected(SelectionEvent event) {
- if (this.button.isDisposed()) {
- return;
- }
- this.booleanHolder.setValue(button.getSelection());
- }
-
-
- // ********** dispose **********
-
- protected void buttonDisposed(DisposeEvent event) {
- // the button is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.button.removeSelectionListener(this.buttonSelectionListener);
- this.button.removeDisposeListener(this.buttonDisposeListener);
- this.booleanHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.booleanHolder);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlAligner.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlAligner.java
deleted file mode 100644
index ebbd1eed4c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlAligner.java
+++ /dev/null
@@ -1,913 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * This class is responsible to set a preferred width on the registered widgets
- * (either <code>Control</code> or <code>ControlAligner</code>) based on the
- * widest widget.
- * <p>
- * Important: The layout data has to be a <code>GridData</code>. If none is set,
- * then a new <code>GridData</code> is automatically created.
- * <p>
- * Here an example of the result if this aligner is used to align controls
- * within either one or two group boxes, the controls added are the labels in
- * this case. It is also possible to align controls on the right side of the
- * main component, a spacer can be used for extra space.
- * <p>
- * Here's an example:
- * <pre>
- * - Group Box 1 --------------------------------------------------------------
- * | -------------------------------------- ------------- |
- * | Name: | I | | Browse... | |
- * | -------------------------------------- ------------- |
- * | --------- |
- * | Preallocation Size: | |I| |
- * | --------- |
- * | -------------------------------------- |
- * | Descriptor: | |v| |
- * | -------------------------------------- |
- * ----------------------------------------------------------------------------
- *
- * - Group Box 2 --------------------------------------------------------------
- * | -------------------------------------- |
- * | Mapping Type: | |V| |
- * | -------------------------------------- |
- * | -------------------------------------- |
- * | Check in Script: | I | |
- * | -------------------------------------- |
- * ----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class ControlAligner
-{
- /**
- * Flag used to prevent a validation so it can be done after an operation
- * completed.
- */
- private boolean autoValidate;
-
- /**
- * The utility class used to support bound properties.
- */
- private Collection<Listener> changeSupport;
-
- /**
- * The listener added to each of the controls that listens only to a text
- * change.
- */
- private Listener listener;
-
- /**
- * Prevents infinite recursion when recalculating the preferred width.
- * This happens in an hierarchy of <code>ControlAligner</code>s. The lock
- * has to be placed here and not in the {@link ControlAlignerWrapper}.
- */
- private boolean locked;
-
- /**
- * The length of the widest control. If the length was not calculated, then
- * this value is 0.
- */
- private int maximumWidth;
-
- /**
- * The collection of {@link Wrapper}s encapsulating either <code>Control</code>s
- * or {@link ControlAligner}s.
- */
- private Collection<Wrapper> wrappers;
-
- /**
- * A null-<code>Point</code> object used to clear the preferred size.
- */
- private static final Point DEFAULT_SIZE = new Point(SWT.DEFAULT, SWT.DEFAULT);
-
- /**
- * The types of events to listen in order to properly adjust the size of all
- * the widgets.
- */
- private static final int[] EVENT_TYPES = {
- SWT.Dispose,
- SWT.Hide,
- SWT.Resize,
- SWT.Show
- };
-
- /**
- * Creates a new <code>ControlAligner</code>.
- */
- public ControlAligner() {
- super();
- initialize();
- }
-
- /**
- * Creates a new <code>ControlAligner</code>.
- *
- * @param controls The collection of <code>Control</code>s
- */
- public ControlAligner(Collection<? extends Control> controls) {
- this();
- addAllControls(controls);
- }
-
- /**
- * Adds the given control. Its width will be used along with the width of all
- * the other registered controls in order to get the greater witdh and use
- * it as the width for all the controls.
- *
- * @param control The <code>Control</code> to be added
- */
- public void add(Control control) {
-
- Assert.isNotNull(control, "Can't add null to this ControlAligner");
-
- Wrapper wrapper = buildWrapper(control);
- wrapper.addListener(listener);
- wrappers.add(wrapper);
-
- revalidate(false);
- }
-
- /**
- * Adds the given control. Its width will be used along with the width of all
- * the other registered controls in order to get the greater witdh and use
- * it as the width for all the controls.
- *
- * @param controlAligner The <code>ControlAligner</code> to be added
- * @exception IllegalArgumentException Can't add the <code>ControlAligner</code>
- * to itself
- */
- public void add(ControlAligner controlAligner) {
-
- Assert.isNotNull(controlAligner, "Can't add null to this ControlAligner");
- Assert.isLegal(controlAligner != this, "Can't add the ControlAligner to itself");
-
- Wrapper wrapper = buildWrapper(controlAligner);
- wrapper.addListener(listener);
- wrappers.add(wrapper);
-
- if (!controlAligner.wrappers.isEmpty()) {
- revalidate(false);
- }
- }
-
- /**
- * Adds the items contained in the given collection into this
- * <code>ControlAligner</code>. The preferred width of each item will be
- * used along with the width of all the other items in order to get the
- * widest control and use its width as the width for all the controls.
- *
- * @param aligners The collection of <code>ControlAligner</code>s
- */
- public void addAllControlAligners(Collection<ControlAligner> aligners) {
-
- // Deactivate the auto validation while adding all the Controls and/or
- // ControlAligners in order to improve performance
- boolean oldAutoValidate = autoValidate;
- autoValidate = false;
-
- for (ControlAligner aligner : aligners) {
- add(aligner);
- }
-
- autoValidate = oldAutoValidate;
- revalidate(false);
- }
-
- /**
- * Adds the items contained in the given collection into this
- * <code>ControlAligner</code>. The preferred width of each item will be
- * used along with the width of all the other items in order to get the
- * widest control and use its width as the width for all the controls.
- *
- * @param controls The collection of <code>Control</code>s
- */
- public void addAllControls(Collection<? extends Control> controls) {
-
- // Deactivate the auto validation while adding all the Controls and/or
- // ControlAligners in order to improve performance
- boolean oldAutoValidate = autoValidate;
- autoValidate = false;
-
- for (Control control : controls) {
- add(control);
- }
-
- autoValidate = oldAutoValidate;
- revalidate(false);
- }
-
- /**
- * Adds the given <code>ControListener</code>.
- *
- * @param listener The <code>Listener</code> to be added
- */
- private void addListener(Listener listener) {
-
- if (changeSupport == null) {
- changeSupport = new ArrayList<Listener>();
- }
-
- changeSupport.add(listener);
- }
-
- /**
- * Creates a new <code>Wrapper</code> that encapsulates the given source.
- *
- * @param control The control to be wrapped
- * @return A new {@link Wrapper}
- */
- private Wrapper buildWrapper(Control control) {
- return new ControlWrapper(control);
- }
-
- /**
- * Creates a new <code>Wrapper</code> that encapsulates the given source.
- *
- * @param ControlAligner The <code>ControlAligner</code> to be wrapped
- * @return A new {@link ControlAlignerWrapper}
- */
- private Wrapper buildWrapper(ControlAligner ControlAligner) {
- return new ControlAlignerWrapper(ControlAligner);
- }
-
- /**
- * Calculates the width taken by the widgets and returns the maximum width.
- *
- * @param recalculateSize <code>true</code> to recalculate the preferred size
- * of all the wrappers contained within them rather than using the cached
- * size; <code>false</code> to use the cached size
- */
- private int calculateWidth(boolean recalculateSize) {
-
- int width = 0;
-
- for (Wrapper wrapper : wrappers) {
- Point size = wrapper.cachedSize();
-
- // The size has not been calculated yet
- if (recalculateSize || (size.x == 0)) {
- size = wrapper.calculateSize();
- }
-
- // Only keep the greatest width
- width = Math.max(size.x, width);
- }
-
- return width;
- }
-
- /**
- * Reports a bound property change.
- *
- * @param oldValue the old value of the property (as an int)
- * @param newValue the new value of the property (as an int)
- */
- private void controlResized(int oldValue, int newValue) {
-
- if ((changeSupport != null) && (oldValue != newValue)) {
- Event event = new Event();
- event.widget = SWTUtil.getShell();
- event.data = this;
-
- for (Listener listener : changeSupport) {
- listener.handleEvent(event);
- }
- }
- }
-
- /**
- * Disposes this <code>ControlAligner</code>, this can improve the speed of
- * disposing a pane. When a pane is disposed, this aligner doesn't need to
- * revalidate its size upon dispose of its widgets.
- */
- public void dispose() {
-
- for (Iterator<Wrapper> iter = wrappers.iterator(); iter.hasNext(); ) {
- Wrapper wrapper = iter.next();
- wrapper.removeListener(listener);
- iter.remove();
- }
-
- this.wrappers.clear();
- }
-
- /**
- * Returns the length of the widest control. If the length was not
- * calculated, then this value is 0.
- *
- * @return The width of the widest control or 0 if the length has not been
- * calculated yet
- */
- public int getMaximumWidth() {
- return maximumWidth;
- }
-
- /**
- * Initializes this <code>ControlAligner</code>.
- */
- private void initialize() {
-
- this.autoValidate = true;
- this.maximumWidth = 0;
- this.listener = new ListenerHandler();
- this.wrappers = new ArrayList<Wrapper>();
- }
-
- /**
- * Invalidates the size of the given object.
- *
- * @param source The source object to be invalidated
- */
- private void invalidate(Object source) {
-
- Wrapper wrapper = retrieveWrapper(source);
-
- if (!wrapper.locked()) {
- Point size = wrapper.cachedSize();
- size.x = size.y = 0;
- wrapper.setSize(DEFAULT_SIZE);
- }
- }
-
- /**
- * Updates the maximum length based on the widest control. This methods
- * does not update the width of the controls.
- *
- * @param recalculateSize <code>true</code> to recalculate the preferred size
- * of all the wrappers contained within them rather than using the cached
- * size; <code>false</code> to use the cached size
- */
- private void recalculateWidth(boolean recalculateSize) {
-
- int width = calculateWidth(recalculateSize);
-
- try {
- locked = true;
- setMaximumWidth(width);
- }
- finally {
- locked = false;
- }
- }
-
- /**
- * Removes the given control. Its preferred width will not be used when
- * calculating the preferred width.
- *
- * @param control The control to be removed
- * @exception AssertionFailedException If the given <code>Control</code> is
- * <code>null</code>
- */
- public void remove(Control control) {
-
- Assert.isNotNull(control, "The Control to remove cannot be null");
-
- Wrapper wrapper = retrieveWrapper(control);
- wrapper.removeListener(listener);
- wrappers.remove(wrapper);
-
- revalidate(true);
- }
-
- /**
- * Removes the given <code>ControlAligner</code>. Its preferred width
- * will not be used when calculating the preferred witdh.
- *
- * @param controlAligner The <code>ControlAligner</code> to be removed
- * @exception AssertionFailedException If the given <code>ControlAligner</code>
- * is <code>null</code>
- */
- public void remove(ControlAligner controlAligner) {
-
- Assert.isNotNull(controlAligner, "The ControlAligner to remove cannot be null");
-
- Wrapper wrapper = retrieveWrapper(controlAligner);
- wrapper.removeListener(listener);
- wrappers.remove(wrapper);
-
- revalidate(true);
- }
-
- /**
- * Removes the given <code>Listener</code>.
- *
- * @param listener The <code>Listener</code> to be removed
- */
- private void removeListener(Listener listener) {
-
- changeSupport.remove(listener);
-
- if (changeSupport.isEmpty()) {
- changeSupport = null;
- }
- }
-
- /**
- * Retrieves the <code>Wrapper</code> that is encapsulating the given object.
- *
- * @param source Either a <code>Control</code> or a <code>ControlAligner</code>
- * @return Its <code>Wrapper</code>
- */
- private Wrapper retrieveWrapper(Object source) {
-
- for (Wrapper wrapper : wrappers) {
- if (wrapper.source() == source) {
- return wrapper;
- }
- }
-
- throw new IllegalArgumentException("Can't retrieve the Wrapper for " + source);
- }
-
- /**
- * If the count of control is greater than one and {@link #isAutoValidate()}
- * returns <code>true</code>, then the size of all the registered
- * <code>Control</code>s will be udpated.
- *
- * @param recalculateSize <code>true</code> to recalculate the preferred size
- * of all the wrappers contained within them rather than using the cached
- * size; <code>false</code> to use the cached size
- */
- private void revalidate(boolean recalculateSize) {
-
- if (autoValidate) {
- recalculateWidth(recalculateSize);
- updateWrapperSize(recalculateSize);
- }
- }
-
- /**
- * Bases on the information contained in the given <code>Event</code>,
- * resize the controls.
- *
- * @param event The <code>Event</code> sent by the UI thread when the state
- * of a widget changed
- */
- private void revalidate(Event event) {
-
- // We don't need to revalidate during a revalidation process
- if (locked) {
- return;
- }
-
- Object source;
-
- if (event.widget != SWTUtil.getShell()) {
- source = event.widget;
- Control control = (Control) source;
-
- // When a dialog is opened, we need to actually force a layout of
- // the controls, this is required because the control is actually
- // not visible when the preferred width is caculated
- if (control == control.getShell()) {
- if (event.type == SWT.Dispose) {
- return;
- }
-
- source = null;
- }
- }
- else {
- source = event.data;
- }
-
- // Either remove the ControlWrapper if the widget was disposed or
- // invalidate the widget in order to recalculate the preferred size
- if (source != null) {
- if (event.type == SWT.Dispose) {
- Wrapper wrapper = retrieveWrapper(source);
- wrappers.remove(wrapper);
- }
- else {
- invalidate(source);
- }
- }
-
- // Now revalidate all the Controls and ControlAligners
- revalidate(true);
- }
-
- /**
- * Sets the length of the widest control. If the length was not calulcated,
- * then this value is 0.
- *
- * @param maximumWidth The width of the widest control
- */
- private void setMaximumWidth(int maximumWidth) {
-
- int oldMaximumWidth = this.maximumWidth;
- this.maximumWidth = maximumWidth;
- controlResized(oldMaximumWidth, maximumWidth);
- }
-
- /**
- * Returns a string representation of this <code>ControlAligner</code>.
- *
- * @return Information about this object
- */
- @Override
- public String toString() {
-
- StringBuffer sb = new StringBuffer();
- sb.append("maximumWidth=");
- sb.append(maximumWidth);
- sb.append(", wrappers=");
- sb.append(wrappers);
- return StringTools.buildToStringFor(this, sb);
- }
-
- /**
- * Updates the size of every <code>Wrapper</code> based on the maximum width.
- *
- * @param forceRevalidate <code>true</code> to revalidate the wrapper's size
- * even though its current size might be the same as the maximum width;
- * <code>false</code> to only revalidate the wrappers with a different width
- */
- private void updateWrapperSize(boolean forceRevalidate) {
-
- for (Wrapper wrapper : wrappers) {
- Point cachedSize = wrapper.cachedSize();
-
- // No need to change the size of the wrapper since it's always using
- // the maximum width
- if (forceRevalidate || (cachedSize.x != maximumWidth)) {
- Point size = new Point(maximumWidth, cachedSize.y);
- wrapper.setSize(size);
- }
- }
- }
-
- /**
- * This <code>Wrapper</code> encapsulates a {@link ControlAligner}.
- */
- private class ControlAlignerWrapper implements Wrapper {
- /**
- * The cached size, which is {@link ControlAligner#maximumWidth}.
- */
- private final Point cachedSize;
-
- /**
- * The <code>ControlAligner</code> encapsulated by this
- * <code>Wrapper</code>.
- */
- private final ControlAligner controlAligner;
-
- /**
- * Creates a new <code>ControlAlignerWrapper</code> that encapsulates
- * the given <code>ControlAligner</code>.
- *
- * @param controlAligner The <code>ControlAligner</code> to be
- * encapsulated by this <code>Wrapper</code>
- */
- private ControlAlignerWrapper(ControlAligner controlAligner) {
- super();
- this.controlAligner = controlAligner;
- this.cachedSize = new Point(controlAligner.maximumWidth, 0);
- }
-
- /*
- * (non-Javadoc)
- */
- public void addListener(Listener listener) {
- controlAligner.addListener(listener);
- }
-
- /*
- * (non-Javadoc)
- */
- public Point cachedSize() {
- cachedSize.x = controlAligner.maximumWidth;
- return cachedSize;
- }
-
- /*
- * (non-Javadoc)
- */
- public Point calculateSize() {
-
- Point size = new Point(controlAligner.calculateWidth(false), 0);
-
- if (size.x != SWT.DEFAULT) {
- cachedSize.x = size.x;
- }
- else {
- cachedSize.x = 0;
- }
-
- if (size.y != SWT.DEFAULT) {
- cachedSize.y = size.y;
- }
- else {
- cachedSize.y = 0;
- }
-
- return size;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean locked() {
- return controlAligner.locked;
- }
-
- /*
- * (non-Javadoc)
- */
- public void removeListener(Listener listener) {
- controlAligner.removeListener(listener);
- }
-
- /*
- * (non-Javadoc)
- */
- public void setSize(Point size) {
-
- if (size == DEFAULT_SIZE) {
- controlAligner.maximumWidth = 0;
- }
- else if (controlAligner.maximumWidth != size.x) {
- controlAligner.maximumWidth = size.x;
- controlAligner.updateWrapperSize(true);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public Object source() {
- return controlAligner;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String toString() {
-
- StringBuffer sb = new StringBuffer();
- sb.append("Cached size=");
- sb.append(cachedSize);
- sb.append(", ControlAligner=");
- sb.append(controlAligner);
- return StringTools.buildToStringFor(this, sb);
- }
- }
-
- /**
- * This <code>Wrapper</code> encapsulates a {@link Control}.
- */
- private class ControlWrapper implements Wrapper {
- /**
- * The cached size, which is control's size.
- */
- private Point cachedSize;
-
- /**
- * The control to be encapsulated by this <code>Wrapper</code>.
- */
- private final Control control;
-
- /**
- * Creates a new <code>controlWrapper</code> that encapsulates the given
- * control.
- *
- * @param control The control to be encapsulated by this <code>Wrapper</code>
- */
- private ControlWrapper(Control control) {
- super();
-
- this.control = control;
- this.cachedSize = new Point(0, 0);
- }
-
- /*
- * (non-Javadoc)
- */
- public void addListener(Listener listener) {
-
- for (int eventType : EVENT_TYPES) {
- control.addListener(eventType, listener);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public Point cachedSize() {
- return cachedSize;
- }
-
- /*
- * (non-Javadoc)
- */
- public Point calculateSize() {
-
- cachedSize = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
-
- // Update right away the control's GridData
- GridData gridData = (GridData) control.getLayoutData();
-
- if (gridData == null) {
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- control.setLayoutData(gridData);
- }
-
- gridData.widthHint = cachedSize.x;
- gridData.heightHint = cachedSize.y;
-
- // Make sure the size is not -1
- if (cachedSize.x == SWT.DEFAULT) {
- cachedSize.x = 0;
- }
-
- if (cachedSize.y == SWT.DEFAULT) {
- cachedSize.y = 0;
- }
-
- return cachedSize;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean locked() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- */
- public void removeListener(Listener listener) {
-
- for (int eventType : EVENT_TYPES) {
- control.removeListener(eventType, listener);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public void setSize(Point size) {
-
- if (control.isDisposed()) {
- return;
- }
-
- // Update the GridData with the new size
- GridData gridData = (GridData) control.getLayoutData();
-
- if (gridData == null) {
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- control.setLayoutData(gridData);
- }
-
- gridData.widthHint = size.x;
- gridData.heightHint = size.y;
-
- // Force the control to be resized, and tell its parent to layout
- // its widgets
- if (size.x > 0) {
-// locked = true;
-// try {
-//// control.getParent().layout(new Control[] { control });
-// control.getParent().layout(true);
-// }
-// finally {
-// locked = false;
-// }
- Rectangle bounds = control.getBounds();
-
- // Only update the control's width if it's
- // different from the current size
- if (bounds.width != size.x) {
- locked = true;
-
- try {
-// control.setBounds(bounds.x, bounds.y, size.x, size.y);
- control.getParent().layout(true);
- }
- finally
- {
- locked = false;
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public Control source() {
- return control;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String toString() {
-
- StringBuffer sb = new StringBuffer();
- sb.append("Cached size=");
- sb.append(cachedSize);
- sb.append(", Control=");
- sb.append(control);
- return StringTools.buildToStringFor(this, sb);
- }
- }
-
- /**
- * The listener added to each of the control that is notified in order to
- * revalidate the preferred size.
- */
- private class ListenerHandler implements Listener {
- public void handleEvent(Event event) {
- ControlAligner.this.revalidate(event);
- }
- }
-
- /**
- * This <code>Wrapper</code> helps to encapsulate heterogeneous objects and
- * apply the same behavior on them.
- */
- private interface Wrapper {
- /**
- * Adds the given <code>Listener</code> to wrapped object in order to
- * receive notification when its property changed.
- *
- * @param listener The <code>Listener</code> to be added
- */
- void addListener(Listener listener);
-
- /**
- * Returns the cached size of the encapsulated source.
- *
- * @return A non-<code>null</code> <code>Point</code> where the x is the
- * width and the y is the height of the widget
- */
- Point cachedSize();
-
- /**
- * Calculates the preferred size the wrapped object would take by itself.
- *
- * @return The calculated size
- */
- Point calculateSize();
-
- /**
- * Prevents infinite recursion when recalculating the preferred width.
- * This happens in an hierarchy of <code>ControlAligner</code>s.
- *
- * @return <code>true</code> to prevent this <code>Wrapper</code> from
- * being invalidated; otherwise <code>false</code>
- */
- boolean locked();
-
- /**
- * Removes the given <code>Listener</code>.
- *
- * @param listener The <code>Listener</code> to be removed
- */
- void removeListener(Listener listener);
-
- /**
- * Sets the size on the encapsulated source.
- *
- * @param size The new size
- */
- void setSize(Point size);
-
- /**
- * Returns the encapsulated object.
- *
- * @return The object that is been wrapped
- */
- Object source();
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlSwitcher.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlSwitcher.java
deleted file mode 100644
index 45d6471162..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/ControlSwitcher.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * This controller is responsible to switch the active page based on a value. A
- * <code>Transformer</code> is used to transformed that value into a
- * <code>Control</code>.
- *
- * @version 2.3
- * @since 2.0
- */
-public final class ControlSwitcher
-{
- /**
- * The widget that is used to show the active <code>Control</code>.
- */
- private PageBook pageBook;
-
- /**
- * The <code>Transformer</code> used to transform the value into a
- * <code>Control</code>.
- */
- private Transformer<?, Control> controlTransformer;
-
- private Label emptyLabel;
-
- /**
- * Creates a new <code>ControlSwitcher</code>.
- *
- * @param switchHolder The holder of the value that will be used to retrieve
- * the right <code>Control</code> when passed to the given transformer
- * @param controlTransformer The <code>Transformer</code> used to transform the value into a
- * <code>Control</code>
- * @param pageBook The <code>PageBook</code> used for switching the <code>Control</code>
- */
- public <T> ControlSwitcher(PropertyValueModel<? extends T> switchHolder,
- Transformer<T, Control> controlTransformer,
- PageBook pageBook)
- {
- super();
- initialize(switchHolder, controlTransformer, pageBook);
- }
-
- public <T> ControlSwitcher(PropertyValueModel<? extends T> switchHolder,
- Control control,
- PageBook pageBook)
- {
- this(switchHolder, buildNullControlTransformer(control), pageBook);
- }
-
- private static <T> Transformer<T, Control> buildNullControlTransformer(final Control control) {
- return new Transformer<T, Control>() {
- public Control transform(T model) {
- if (model == null) {
- return null;
- }
- return control;
- }
- };
- }
-
- private void initialize(PropertyValueModel<?> switchHolder,
- Transformer<?, Control> controlTransformer,
- PageBook pageBook)
- {
- this.pageBook = pageBook;
- this.controlTransformer = controlTransformer;
-
- this.emptyLabel = this.buildEmptyLabel();
-
- switchHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildPropertyChangeListener()
- );
-
- switchPages(switchHolder.getValue());
- }
-
- //Build an empty label to display in the page book when the controlTransformer returns null.
- //SWT.SHADOW_NONE makes the line separator not visible
- //This is the best we can come up with for an empty page
- private Label buildEmptyLabel() {
- return new Label(this.pageBook, SWT.SEPARATOR | SWT.SHADOW_NONE | SWT.HORIZONTAL);
- }
-
- private PropertyChangeListener buildPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildPropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- switchPages(e.getNewValue());
- }
- };
- }
-
- /**
- * Switches the active page by transforming the given value into its
- * corresponding control.
- *
- * @param value The state passed to the transformer in order to retrieve the
- * new control
- */
- private void switchPages(Object value) {
- if (this.pageBook.isDisposed()) {
- return;
- }
-
- // Retrieve the Control for the new value
- Control page = transform(value);
-
- if (page == null) {
- //Note: We can't pass in null due to a bug in PageBook
- page = this.emptyLabel;
- }
- this.pageBook.showPage(page);
-
- // Revalidate the parents in order to update the layout
- SWTUtil.reflow(this.pageBook);
- }
-
- @SuppressWarnings("unchecked")
- private Control transform(Object value) {
- return ((Transformer<Object, Control>) this.controlTransformer).transform(value);
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledButton.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledButton.java
deleted file mode 100644
index a1d6d2979a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledButton.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-
-/**
- * A default implementation of <code>LabeledControl</code> that updates a
- * <code>Button</code> when required.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class LabeledButton implements LabeledControl
-{
- /**
- * The button to be updated with a different icon and text.
- */
- private final Button button;
-
- /**
- * Creates a new <code>LabeledButton</code>.
- *
- * @param button The button that will have its text and icon updated when
- * required
- * @exception AssertionFailedException If the given <code>Button</code> is
- * <code>null</code>
- */
- public LabeledButton(Button button) {
- super();
-
- Assert.isNotNull(button, "The button cannot be null");
- this.button = button;
- }
-
- /*
- * (non-Javadoc)
- */
- public void setImage(Image image) {
- if (!this.button.isDisposed()) {
- this.button.setImage(image);
- this.button.getParent().layout(true);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public void setText(String text) {
- if (!this.button.isDisposed()) {
- this.button.setText(text);
- this.button.getParent().layout(true);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControl.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControl.java
deleted file mode 100644
index 2cef0dc8b2..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This <code>LabeledControl</code> is used to encapsulate a widget and update
- * its properties (icon and text).
- *
- * @see LabeledButton
- * @see LabeledLabel
- *
- * @version 2.0
- * @since 2.0
- */
-public interface LabeledControl {
- /**
- * Passes the image so the wrapped component can receive it.
- *
- * @param image The new <code>Image</code>
- */
- void setImage(Image image);
-
- /**
- * Passes the text so the wrapped component can receive it.
- *
- * @param text The new text
- */
- void setText(String text);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControlUpdater.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControlUpdater.java
deleted file mode 100644
index 8be981398a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledControlUpdater.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This updater is responsible to update the <code>LabeledControl</code> when
- * the text and the icon need to change.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class LabeledControlUpdater {
-
- /**
- * The wrapper around a control that has text and icon.
- */
- private LabeledControl labeledControl;
-
- /**
- * Creates a new <code>LabeledControlUpdater</code>.
- *
- * @param labeledControl The wrapper around the control that needs to
- * have its text updated
- * @param textHolder The holder this class will listen for changes
- */
- public LabeledControlUpdater(LabeledControl labeledControl,
- PropertyValueModel<String> textHolder)
- {
- this(labeledControl, textHolder, null);
- }
-
- /**
- * Creates a new <code>LabeledControlUpdater</code>.
- *
- * @param labeledControl The wrapper around the control that needs to
- * have its image and text updated
- * @param imageHolder The holder this class will listen for changes or
- * <code>null</code> if the text never changes
- * @param textHolder The holder this class will listen for changes or
- * <code>null</code> if the image never changes
- */
- public LabeledControlUpdater(LabeledControl labeledControl,
- PropertyValueModel<String> textHolder,
- PropertyValueModel<Image> imageHolder)
- {
- super();
- initialize(labeledControl, textHolder, imageHolder);
- }
-
- private PropertyChangeListener buildIconListener() {
- return new SWTPropertyChangeListenerWrapper(buildIconListener_());
- }
-
- private PropertyChangeListener buildIconListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- LabeledControlUpdater.this.setImage((Image) e.getNewValue());
- }
-
- @Override
- public String toString() {
- return "LabeledControlUpdater.imageListener";
- }
- };
- }
-
- private PropertyChangeListener buildTextListener() {
- return new SWTPropertyChangeListenerWrapper(buildTextListener_());
- }
-
- private PropertyChangeListener buildTextListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- LabeledControlUpdater.this.setText((String) e.getNewValue());
- }
-
- @Override
- public String toString() {
- return "LabeledControlUpdater.textListener";
- }
- };
- }
-
- private void initialize(LabeledControl labeledControl,
- PropertyValueModel<String> textHolder,
- PropertyValueModel<Image> imageHolder)
- {
- Assert.isNotNull(labeledControl, "The LabeledControl cannot be null");
-
- this.labeledControl = labeledControl;
-
- if (textHolder != null) {
- textHolder.addPropertyChangeListener(PropertyValueModel.VALUE, buildTextListener());
- setText(textHolder.getValue());
- }
-
- if (imageHolder != null) {
- imageHolder.addPropertyChangeListener(PropertyValueModel.VALUE, buildIconListener());
- setImage(imageHolder.getValue());
- }
- }
-
- private void setImage(Image icon) {
- labeledControl.setImage(icon);
- }
-
- private void setText(String text) {
-
- if (text == null) {
- text = "";
- }
-
- labeledControl.setText(text);
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledLabel.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledLabel.java
deleted file mode 100644
index c74ef06559..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/LabeledLabel.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * A default implementation of <code>LabeledControl</code> that updates an
- * <code>Label</code> when required.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class LabeledLabel implements LabeledControl
-{
- /**
- * The label to be updated with a different icon and text.
- */
- private final Label label;
-
- /**
- * Creates a new <code>LabeledButton</code>.
- *
- * @param label The label that will have its text and icon updated when
- * required
- * @exception AssertionFailedException If the given <code>Label</code> is
- * <code>null</code>
- */
- public LabeledLabel(Label label) {
- super();
-
- Assert.isNotNull(label, "The label cannot be null");
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- */
- public void setImage(Image image) {
- if (!this.label.isDisposed()) {
- this.label.setImage(image);
- this.label.getParent().layout(true);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public void setText(String text) {
- if (!this.label.isDisposed()) {
- this.label.setText(text);
- this.label.getParent().layout(true);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneEnabler.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneEnabler.java
deleted file mode 100644
index 6615c72127..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneEnabler.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-
-/**
- * This <code>PaneEnabler</code> keeps the "enabled" state of a collection of
- * controls in synch with the provided boolean holder.
- *
- * @version 2.0
- * @since 2.0
- */
-public class PaneEnabler extends StateController
-{
- /**
- * Creates a new <code>PaneEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "enabled" state is kept in sync with the
- * boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?> pane) {
-
- this(booleanHolder, pane, false);
- }
-
- /**
- * Creates a new <code>PaneEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?>... panes) {
-
- this(booleanHolder, CollectionTools.collection(panes), false);
- }
-
- /**
- * Creates a new <code>PaneEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "enabled" state is kept in sync with the
- * boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?> pane,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.singletonIterator(pane), false);
- }
-
- /**
- * Creates a new <code>PaneEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?>[] panes,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.iterator(panes), defaultValue);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code> with a default value
- * of* <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Pane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Pane<?>> panes,
- boolean defaultValue) {
-
- this(booleanHolder, panes.iterator(), defaultValue);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "enabled" state
- * is kept in sync with the boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Pane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "enabled" state
- * is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Pane<?>> panes,
- boolean defaultValue) {
-
- super(booleanHolder, wrap(panes), defaultValue);
- }
-
- private static Collection<ControlHolder> wrap(Iterator<? extends Pane<?>> panes) {
- return CollectionTools.collection(new TransformationIterator<Pane<?>, ControlHolder>(panes) {
- @Override
- protected ControlHolder transform(Pane<?> pane) {
- return new PaneHolder(pane);
- }
- });
- }
-
- /**
- * This holder holds onto an <code>Pane</code> and update its enabled
- * state.
- */
- private static class PaneHolder implements ControlHolder {
- private final Pane<?> pane;
-
- PaneHolder(Pane<?> pane) {
- super();
- this.pane = pane;
- }
-
- public void updateState(boolean state) {
- if (!this.pane.getControl().isDisposed()) {
- this.pane.enableWidgets(state);
- }
- }
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneVisibilityEnabler.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneVisibilityEnabler.java
deleted file mode 100644
index c081839b5f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/PaneVisibilityEnabler.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-
-/**
- * This <code>PaneVisibilityEnabler</code> keeps the "visible" state of a
- * collection of controls in synch with the provided boolean holder.
- *
- * @version 2.0
- * @since 2.0
- */
-public class PaneVisibilityEnabler extends StateController
-{
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "visible" state is kept in sync with the
- * boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?> pane) {
-
- this(booleanHolder, pane, false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?>... panes) {
-
- this(booleanHolder, CollectionTools.collection(panes), false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "visible" state is kept in sync with the
- * boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?> pane,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.singletonIterator(pane), false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Pane<?>[] panes,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.iterator(panes), defaultValue);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Pane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Pane<?>> panes,
- boolean defaultValue) {
-
- this(booleanHolder, panes.iterator(), defaultValue);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "visible" state
- * is kept in sync with the boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Pane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "visible" state
- * is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Pane<?>> panes,
- boolean defaultValue) {
-
- super(booleanHolder, wrap(panes), defaultValue);
- }
-
- private static Collection<ControlHolder> wrap(Iterator<? extends Pane<?>> panes) {
- return CollectionTools.collection(new TransformationIterator<Pane<?>, ControlHolder>(panes) {
- @Override
- protected ControlHolder transform(Pane<?> pane) {
- return new PaneHolder(pane);
- }
- });
- }
-
- /**
- * This holder holds onto an <code>Pane</code> and update its visible
- * state.
- */
- private static class PaneHolder implements ControlHolder {
- private final Pane<?> pane;
-
- PaneHolder(Pane<?> pane) {
- super();
- this.pane = pane;
- }
-
- public void updateState(boolean state) {
- this.pane.setVisible(state);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java
deleted file mode 100644
index efc6584919..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import java.util.Locale;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.common.ui.internal.widgets.NullPostExecution;
-import org.eclipse.jpt.common.ui.internal.widgets.PostExecution;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * A suite of utility methods related to the user interface.
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class SWTUtil {
-
- /**
- * Causes the <code>run()</code> method of the given runnable to be invoked
- * by the user-interface thread at the next reasonable opportunity. The caller
- * of this method continues to run in parallel, and is not notified when the
- * runnable has completed.
- *
- * @param runnable Code to run on the user-interface thread
- * @exception org.eclipse.swt.SWTException
- * <ul>
- * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
- * </ul>
- * @see #syncExec
- */
- public static void asyncExec(Runnable runnable) {
- getStandardDisplay().asyncExec(runnable);
- }
-
- /**
- * Tweaks the given <code>Combo</code> to remove the default value when the
- * widget receives the focus and to show the default when the widget loses
- * the focus.
- *
- * @param combo The widget having a default value that is always at the
- * beginning of the list
- */
- public static void attachDefaultValueHandler(Combo combo) {
- ComboHandler handler = new ComboHandler();
- combo.addFocusListener(handler);
- combo.addModifyListener(handler);
- }
-
- /**
- * Retrieves the localized string from the given NLS class by creating the
- * key. That key is the concatenation of the composite's short class name
- * with the toString() of the given value separated by an underscore.
- *
- * @param nlsClass The NLS class used to retrieve the localized text
- * @param compositeClass The class used for creating the key, its short class
- * name is the beginning of the key
- * @param value The value used to append its toString() to the generated key
- * @return The localized text associated with the value
- */
- public static String buildDisplayString(Class<?> nlsClass,
- Class<?> compositeClass,
- Object value) {
-
- StringBuilder sb = new StringBuilder();
- sb.append(compositeClass.getSimpleName());
- sb.append("_");
- sb.append(value.toString().toLowerCase(Locale.ENGLISH));//bug 234953
- //TODO in a future release we should not be converting the key using toLowerCase()
-
- return (String) ReflectionTools.getStaticFieldValue(nlsClass, sb.toString());
- }
-
- /**
- * Retrieves the localized string from the given NLS class by creating the
- * key. That key is the concatenation of the composite's short class name
- * with the toString() of the given value separated by an underscore.
- *
- * @param nlsClass The NLS class used to retrieve the localized text
- * @param composite The object used to retrieve the short class name that is
- * the beginning of the key
- * @param value The value used to append its toString() to the generated key
- * @return The localized text associated with the value
- */
- public static final String buildDisplayString(Class<?> nlsClass,
- Object composite,
- Object value) {
-
- return buildDisplayString(nlsClass, composite.getClass(), value);
- }
-
- /**
- * Creates the <code>Runnable</code> that will invoke the given
- * <code>PostExecution</code> in order to its execution to be done in the
- * UI thread.
- *
- * @param dialog The dialog that was just diposed
- * @param postExecution The post execution once the dialog is disposed
- * @return The <code>Runnable</code> that will invoke
- * {@link PostExecution#execute(Dialog)}
- */
- @SuppressWarnings("unchecked")
- private static <D1 extends Dialog, D2 extends D1>
- Runnable buildPostExecutionRunnable(
- final D1 dialog,
- final PostExecution<D2> postExecution) {
-
- return new Runnable() {
- public void run() {
- setUserInterfaceActive(false);
- try {
- postExecution.execute((D2) dialog);
- }
- finally {
- setUserInterfaceActive(true);
- }
- }
- };
- }
-
- /**
- * Convenience method for getting the current shell. If the current thread is
- * not the UI thread, then an invalid thread access exception will be thrown.
- *
- * @return The shell, never <code>null</code>
- */
- public static Shell getShell() {
-
- // Retrieve the active shell, which can be the shell from any window
- Shell shell = getStandardDisplay().getActiveShell();
-
- // No shell could be found, revert back to the active workbench window
- if (shell == null) {
- shell = getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
- // Make sure it's never null
- if (shell == null) {
- shell = new Shell(getStandardDisplay().getActiveShell());
- }
-
- return shell;
- }
-
- /**
- * Returns the standard display to be used. The method first checks, if the
- * thread calling this method has an associated display. If so, this display
- * is returned. Otherwise the method returns the default display.
- *
- * @return The current display if not <code>null</code> otherwise the default
- * display is returned
- */
- public static Display getStandardDisplay()
- {
- Display display = Display.getCurrent();
-
- if (display == null) {
- display = Display.getDefault();
- }
-
- return display;
- }
-
- public static int getTableHeightHint(Table table, int rows) {
- if (table.getFont().equals(JFaceResources.getDefaultFont()))
- table.setFont(JFaceResources.getDialogFont());
- int result= table.getItemHeight() * rows + table.getHeaderHeight();
- if (table.getLinesVisible())
- result+= table.getGridLineWidth() * (rows - 1);
- return result;
- }
-
- /**
- * Returns the Platform UI workbench.
- *
- * @return The workbench for this plug-in
- */
- public static IWorkbench getWorkbench() {
- return PlatformUI.getWorkbench();
- }
-
- /**
- * Relays out the parents of the <code>Control</code>. This was taken from
- * the widget <code>Section</code>.
- *
- * @param pane The pane to revalidate as well as its parents
- */
- public static void reflow(Composite pane) {
-
- for (Composite composite = pane; composite != null; ) {
- composite.setRedraw(false);
- composite = composite.getParent();
-
- if (composite instanceof ScrolledForm || composite instanceof Shell) {
- break;
- }
- }
-
- for (Composite composite = pane; composite != null; ) {
- composite.layout(true);
- composite = composite.getParent();
-
- if (composite instanceof ScrolledForm) {
- ((ScrolledForm) composite).reflow(true);
- break;
- }
- }
-
- for (Composite composite = pane; composite != null; ) {
- composite.setRedraw(true);
- composite = composite.getParent();
-
- if (composite instanceof ScrolledForm || composite instanceof Shell) {
- break;
- }
- }
- }
-
- /**
- * Sets whether the entire shell and its widgets should be enabled or
- * everything should be unaccessible.
- *
- * @param active <code>true</code> to make all the UI active otherwise
- * <code>false</code> to deactivate it
- */
- public static void setUserInterfaceActive(boolean active) {
- Shell[] shells = getStandardDisplay().getShells();
-
- for (Shell shell : shells) {
- shell.setEnabled(active);
- }
- }
-
- /**
- * Asynchronously launches the specified dialog in the UI thread.
- *
- * @param dialog The dialog to show on screen
- * @param postExecution This interface let the caller to invoke a piece of
- * code once the dialog is disposed
- */
- public static <D1 extends Dialog, D2 extends D1>
- void show(final D1 dialog, final PostExecution<D2> postExecution) {
-
- try {
- Assert.isNotNull(dialog, "The dialog cannot be null");
- Assert.isNotNull(postExecution, "The PostExecution cannot be null");
- }
- catch (AssertionFailedException e) {
- // Make sure the UI is interactive
- setUserInterfaceActive(true);
- throw e;
- }
-
- new Thread() {
- @Override
- public void run() {
- asyncExec(
- new Runnable() {
- public void run() {
- showImp(dialog, postExecution);
- }
- }
- );
- }
- }.start();
- }
-
- /**
- * Asynchronously launches the specified dialog in the UI thread.
- *
- * @param dialog The dialog to show on screen
- */
- public static void show(Dialog dialog) {
- show(dialog, NullPostExecution.<Dialog>instance());
- }
-
- /**
- * Asynchronously launches the specified dialog in the UI thread.
- *
- * @param dialog The dialog to show on screen
- * @param postExecution This interface let the caller to invoke a piece of
- * code once the dialog is disposed
- */
- private static <D1 extends Dialog, D2 extends D1>
- void showImp(D1 dialog, PostExecution<D2> postExecution) {
-
- setUserInterfaceActive(true);
- dialog.open();
-
- if (postExecution != NullPostExecution.<D2>instance()) {
- asyncExec(buildPostExecutionRunnable(dialog, postExecution));
- }
- }
-
- /**
- * Causes the <code>run()</code> method of the given runnable to be invoked
- * by the user-interface thread at the next reasonable opportunity. The
- * thread which calls this method is suspended until the runnable completes.
- *
- * @param runnable code to run on the user-interface thread.
- * @see #asyncExec
- */
- public static void syncExec(Runnable runnable) {
- getStandardDisplay().syncExec(runnable);
- }
-
- /**
- * Determines if the current thread is the UI event thread.
- *
- * @return <code>true</code> if it's the UI event thread, <code>false</code>
- * otherwise
- */
- public static boolean uiThread() {
- return getStandardDisplay().getThread() == Thread.currentThread();
- }
-
- /**
- * Determines if the current thread is the UI event thread by using the
- * thread from which the given viewer's display was instantiated.
- *
- * @param viewer The viewer used to determine if the current thread
- * is the UI event thread
- * @return <code>true</code> if the current thread is the UI event thread;
- * <code>false</code> otherwise
- */
- public static boolean uiThread(Viewer viewer) {
- return uiThread(viewer.getControl());
- }
-
- /**
- * Determines if the current thread is the UI event thread by using the
- * thread from which the given widget's display was instantiated.
- *
- * @param widget The widget used to determine if the current thread
- * is the UI event thread
- * @return <code>true</code> if the current thread is the UI event thread;
- * <code>false</code> otherwise
- */
- public static boolean uiThread(Widget widget) {
- return widget.getDisplay().getThread() == Thread.currentThread();
- }
-
-
- /**
- * This handler is responsible for removing the default value when the combo
- * has the focus or when the selected item is the default value and to select
- * it when the combo loses the focus.
- */
- private static class ComboHandler implements ModifyListener,
- FocusListener {
-
- public void focusGained(FocusEvent e) {
- Combo combo = (Combo) e.widget;
-
- if (combo.getSelectionIndex() == 0) {
- // The text selection has to be changed outside of the context of this
- // listener otherwise the combo won't update because it's currently
- // notifying its listeners
- asyncExec(new SelectText(combo));
- }
- }
-
- public void focusLost(FocusEvent e) {
- //do nothing
- }
-
- public void modifyText(ModifyEvent e) {
-
- Combo combo = (Combo) e.widget;
-
- if (combo.isFocusControl() &&
- combo.getSelectionIndex() == 0) {
-
- // The text has to be changed outside of the context of this
- // listener otherwise the combo won't update because it's currently
- // notifying its listeners
- asyncExec(new ModifyText(combo));
- }
- }
-
- private class ModifyText implements Runnable {
- private final Combo combo;
-
- public ModifyText(Combo combo) {
- super();
- this.combo = combo;
- }
-
- public void run() {
- if (this.combo.isDisposed()) {
- return;
- }
- String text = this.combo.getText();
-
- if (text.length() == 0) {
- text = this.combo.getItem(0);
- this.combo.setText(text);
- }
-
- this.combo.setSelection(new Point(0, text.length()));
- }
- }
-
- private class SelectText implements Runnable {
- private final Combo combo;
-
- public SelectText(Combo combo) {
- super();
- this.combo = combo;
- }
-
- public void run() {
- if (this.combo.isDisposed()) {
- return;
- }
- String text = this.combo.getText();
- this.combo.setSelection(new Point(0, text.length()));
- }
- }
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/StateController.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/StateController.java
deleted file mode 100644
index 5c313e6603..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/StateController.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>StateController</code> keeps the state of a collection of widgets in
- * synch with the provided boolean holder.
- *
- * @see ControlEnabler
- * @see ControlVisibilityEnabler
- * @see PaneEnabler
- * @see PaneVisibilityEnabler
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-abstract class StateController
-{
- /**
- * A listener that allows us to synchronize the controlHolders with changes
- * made to the underlying boolean model.
- */
- private PropertyChangeListener booleanChangeListener;
-
- /**
- * A value model on the underlying boolean model
- */
- private PropertyValueModel<Boolean> booleanHolder;
-
- /**
- * The collection of <code>ControlHolder</code>s whose state is kept in sync
- * with the boolean holder's value.
- */
- private Collection<ControlHolder> controlHolders;
-
- /**
- * The default setting for the state; for when the underlying model is
- * <code>null</code>. The default [default value] is <code>false<code>.
- */
- private boolean defaultValue;
-
- /**
- * Creates a new <code>StateController</code>.
- */
- StateController() {
- super();
- initialize();
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>ControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Collection<ControlHolder> controlHolders) {
-
- this(booleanHolder, controlHolders, false);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>ControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Collection<ControlHolder> controlHolders,
- boolean defaultValue) {
-
- this();
- initialize(booleanHolder, controlHolders, defaultValue);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolder The <code>ControlHolder</code> whose state is kept
- * in sync with the boolean holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- ControlHolder controlHolder) {
-
- this(booleanHolder, controlHolder, false);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>ControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- ControlHolder... controlHolders) {
-
- this(booleanHolder, CollectionTools.collection(controlHolders), false);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolder The <code>ControlHolder</code> whose state is kept
- * in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- ControlHolder controlHolder,
- boolean defaultValue) {
-
- this(booleanHolder, new ControlHolder[] { controlHolder }, false);
- }
-
- /**
- * Creates a new <code>StateController</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>ControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- ControlHolder[] controlHolders,
- boolean defaultValue) {
-
- this();
- this.initialize(booleanHolder, CollectionTools.collection(controlHolders), defaultValue);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders An iterator on the collection of
- * <code>ControlHolder</code>s whose state is kept in sync with the boolean
- * holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Iterator<ControlHolder> controlHolders) {
-
- this(booleanHolder, CollectionTools.collection(controlHolders), false);
- }
-
- /**
- * Creates a new <code>StateController</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders An iterator on the collection of
- * <code>ControlHolder</code>s whose state is kept in sync with the boolean
- * holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Iterator<ControlHolder> controlHolders,
- boolean defaultValue) {
-
- this();
- initialize(booleanHolder, CollectionTools.collection(controlHolders), defaultValue);
- }
-
- /**
- * Returns the boolean primitive of the given <code>Boolean</code> value but
- * also checks for <code>null</code>, if that is the case, then
- * {@link #defaultValue} is returned.
- *
- * @param value The <code>Boolean</code> value to be returned as a primitive
- * @return The primitive of the given value or {@link #defaultValue}when the
- * value is <code>null</code>
- */
- protected boolean booleanValue(Boolean value) {
- return (value == null) ? this.defaultValue : value.booleanValue();
- }
-
- /**
- * Creates a listener for the boolean holder.
- *
- * @return A new <code>PropertyChangeListener</code>
- */
- private PropertyChangeListener buildBooleanChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildBooleanChangeListener_()
- )
- {
- @Override
- public String toString() {
- return "StateController.SWTPropertyChangeListenerWrapper";
- }
- };
- }
-
- /**
- * Creates a listener for the boolean holder.
- *
- * @return A new <code>PropertyChangeListener</code>
- */
- private PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- updateState();
- }
-
- @Override
- public String toString() {
- return "StateController.PropertyChangeListener";
- }
- };
- }
-
- /**
- * Returns an <code>Iterator</code> over the collection of
- * <code>ControlHolder</code>s.
- *
- * @return The iteration of <code>ControlHolder</code>s
- */
- protected final Iterator<ControlHolder> controlHolders() {
- return new CloneIterator<ControlHolder>(this.controlHolders);
- }
-
- /**
- * Initializes this <code>StateController</code> by building the appropriate
- * listeners.
- */
- protected void initialize() {
- this.booleanChangeListener = this.buildBooleanChangeListener();
- }
-
- /**
- * Initializes this <code>StateController</code> with the given state.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders A <code>ControlHolder</code>s whose enablement state
- * is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- protected void initialize(PropertyValueModel<Boolean> booleanHolder,
- Collection<ControlHolder> controlHolders,
- boolean defaultValue) {
-
- Assert.isNotNull(booleanHolder, "The holder of the boolean value cannot be null");
- Assert.isNotNull(controlHolders, "The collection of ControlHolders cannot be null");
-
- this.controlHolders = new ArrayList<ControlHolder>(controlHolders);
- this.defaultValue = defaultValue;
- this.booleanHolder = booleanHolder;
-
- this.booleanHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- this.booleanChangeListener
- );
-
- this.updateState();
- }
-
- /**
- * Updates the state of the control holders.
- */
- protected void updateState() {
- this.updateState(booleanValue(this.booleanHolder.getValue()));
- }
-
- /**
- * Updates the state of the <code>Control</code>s.
- *
- * @param state The new state the widgets need to have
- */
- protected void updateState(boolean state) {
- for (ControlHolder controlHolder : this.controlHolders) {
- controlHolder.updateState(state);
- }
- }
-
- /**
- * The holder of the actual widget.
- */
- static interface ControlHolder {
-
- /**
- * Updates the state of the wrapped control.
- *
- * @param state The new state the control should have
- */
- void updateState(boolean state);
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/TableLayoutComposite.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/TableLayoutComposite.java
deleted file mode 100644
index 9a8790c941..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/TableLayoutComposite.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-// copied from org.eclipse.jdt.internal.ui.util.TableLayoutComposite
-package org.eclipse.jpt.common.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-import org.eclipse.core.runtime.Assert;
-
-import org.eclipse.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-
-/**
- * A special composite to layout columns inside a table. The composite is needed since we have
- * to layout the columns "before" the actual table gets layouted. Hence we can't use a normal
- * layout manager.
- * <p>
- * XXX: Should switch to use {@link org.eclipse.jface.layout.TableColumnLayout}.
- * </p>
- */
-public class TableLayoutComposite extends Composite {
-
- /**
- * The number of extra pixels taken as horizontal trim by the table column.
- * To ensure there are N pixels available for the content of the column,
- * assign N+COLUMN_TRIM for the column width.
- * <p>
- * XXX: Should either switch to use {@link org.eclipse.jface.layout.TableColumnLayout} or get API from JFace or SWT, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=218483
- * </p>
- *
- * @since 3.1
- */
- private static int COLUMN_TRIM;
- static {
- String platform= SWT.getPlatform();
- if ("win32".equals(platform)) //$NON-NLS-1$
- COLUMN_TRIM= 4;
- else if ("carbon".equals(platform)) //$NON-NLS-1$
- COLUMN_TRIM= 24;
- else
- COLUMN_TRIM= 3;
- }
-
- private List columns= new ArrayList();
-
- /**
- * Creates a new <code>TableLayoutComposite</code>.
- *
- * @param parent the parent composite
- * @param style the SWT style
- */
- public TableLayoutComposite(Composite parent, int style) {
- super(parent, style);
- addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Rectangle area= getClientArea();
- Table table= (Table)getChildren()[0];
- Point preferredSize= computeTableSize(table);
- int width= area.width - 2 * table.getBorderWidth();
- if (preferredSize.y > area.height) {
- // Subtract the scrollbar width from the total column width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
- layoutTable(table, width, area, table.getSize().x < area.width);
- }
- });
- }
-
- /**
- * Adds a new column of data to this table layout.
- *
- * @param data the column layout data
- */
- public void addColumnData(ColumnLayoutData data) {
- columns.add(data);
- }
-
- //---- Helpers -------------------------------------------------------------------------------------
-
- private Point computeTableSize(Table table) {
- Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- int width= 0;
- int size= columns.size();
- for (int i= 0; i < size; ++i) {
- ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i);
- if (layoutData instanceof ColumnPixelData) {
- ColumnPixelData col= (ColumnPixelData) layoutData;
- width += col.width;
- if (col.addTrim) {
- width += COLUMN_TRIM;
- }
- } else if (layoutData instanceof ColumnWeightData) {
- ColumnWeightData col= (ColumnWeightData) layoutData;
- width += col.minimumWidth;
- } else {
- Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
- }
- }
- if (width > result.x)
- result.x= width;
- return result;
- }
-
- private void layoutTable(Table table, int width, Rectangle area, boolean increase) {
- // XXX: Layout is being called with an invalid value the first time
- // it is being called on Linux. This method resets the
- // Layout to null so we make sure we run it only when
- // the value is OK.
- if (width <= 1)
- return;
-
- TableColumn[] tableColumns= table.getColumns();
- int size= Math.min(columns.size(), tableColumns.length);
- int[] widths= new int[size];
- int fixedWidth= 0;
- int numberOfWeightColumns= 0;
- int totalWeight= 0;
-
- // First calc space occupied by fixed columns
- for (int i= 0; i < size; i++) {
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
- if (col instanceof ColumnPixelData) {
- ColumnPixelData cpd= (ColumnPixelData) col;
- int pixels= cpd.width;
- if (cpd.addTrim) {
- pixels += COLUMN_TRIM;
- }
- widths[i]= pixels;
- fixedWidth += pixels;
- } else if (col instanceof ColumnWeightData) {
- ColumnWeightData cw= (ColumnWeightData) col;
- numberOfWeightColumns++;
- // first time, use the weight specified by the column data, otherwise use the actual width as the weight
- // int weight = firstTime ? cw.weight : tableColumns[i].getWidth();
- int weight= cw.weight;
- totalWeight += weight;
- } else {
- Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
- }
- }
-
- // Do we have columns that have a weight
- if (numberOfWeightColumns > 0) {
- // Now distribute the rest to the columns with weight.
- int rest= width - fixedWidth;
- int totalDistributed= 0;
- for (int i= 0; i < size; ++i) {
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
- if (col instanceof ColumnWeightData) {
- ColumnWeightData cw= (ColumnWeightData) col;
- // calculate weight as above
- // int weight = firstTime ? cw.weight : tableColumns[i].getWidth();
- int weight= cw.weight;
- int pixels= totalWeight == 0 ? 0 : weight * rest / totalWeight;
- if (pixels < cw.minimumWidth)
- pixels= cw.minimumWidth;
- totalDistributed += pixels;
- widths[i]= pixels;
- }
- }
-
- // Distribute any remaining pixels to columns with weight.
- int diff= rest - totalDistributed;
- for (int i= 0; diff > 0; ++i) {
- if (i == size)
- i= 0;
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
- if (col instanceof ColumnWeightData) {
- ++widths[i];
- --diff;
- }
- }
- }
-
- if (increase) {
- table.setSize(area.width, area.height);
- }
- for (int i= 0; i < size; i++) {
- tableColumns[i].setWidth(widths[i]);
- }
- if (!increase) {
- table.setSize(area.width, area.height);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/AsynchronousUiCommandExecutor.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/AsynchronousUiCommandExecutor.java
deleted file mode 100644
index 9a8b3aa0d8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/AsynchronousUiCommandExecutor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.CommandRunnable;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * This implementation of CommandExecutor can be used by a non-UI
- * thread to asynchronously modify a JPA project with any objects associated
- * with documents that are currently displayed in the UI.
- */
-public final class AsynchronousUiCommandExecutor
- implements CommandExecutor
-{
- public static final CommandExecutor INSTANCE = new AsynchronousUiCommandExecutor();
-
- public static CommandExecutor instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private AsynchronousUiCommandExecutor() {
- super();
- }
-
- public void execute(Command command) {
- this.getDisplay().asyncExec(this.buildRunnable(command));
- }
-
- private Runnable buildRunnable(Command command) {
- return new CommandRunnable(command);
- }
-
- private Display getDisplay() {
- Display display = Display.getCurrent();
- return (display != null) ? display : Display.getDefault();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/SynchronousUiCommandExecutor.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/SynchronousUiCommandExecutor.java
deleted file mode 100644
index 895dd212f3..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/SynchronousUiCommandExecutor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.CommandRunnable;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * This implementation of CommandExecutor can be used by a non-UI
- * thread to synchronously modify a JPA project with any objects associated
- * with documents that are currently displayed in the UI.
- */
-public final class SynchronousUiCommandExecutor
- implements CommandExecutor
-{
- public static final CommandExecutor INSTANCE = new SynchronousUiCommandExecutor();
-
- public static CommandExecutor instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private SynchronousUiCommandExecutor() {
- super();
- }
-
- public void execute(Command command) {
- this.getDisplay().syncExec(this.buildRunnable(command));
- }
-
- private Runnable buildRunnable(Command command) {
- return new CommandRunnable(command);
- }
-
- private Display getDisplay() {
- Display display = Display.getCurrent();
- return (display != null) ? display : Display.getDefault();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/AbstractListWidgetAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/AbstractListWidgetAdapter.java
deleted file mode 100644
index 50df45253c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/AbstractListWidgetAdapter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * All the "list widgets" are subclasses of {@link Widget}; so we can provide
- * a smidgen of common behavior here.
- */
-abstract class AbstractListWidgetAdapter<W extends Widget>
- implements ListWidgetModelBinding.ListWidget
-{
- final W widget;
-
- AbstractListWidgetAdapter(W widget) {
- super();
- this.widget = widget;
- }
-
- public boolean isDisposed() {
- return this.widget.isDisposed();
- }
-
- public void addDisposeListener(DisposeListener listener) {
- this.widget.addDisposeListener(listener);
- }
-
- public void removeDisposeListener(DisposeListener listener) {
- this.widget.removeDisposeListener(listener);
- }
-
-}
-
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanButtonModelBinding.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanButtonModelBinding.java
deleted file mode 100644
index 5967029a51..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanButtonModelBinding.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-
-/**
- * This binding can be used to keep a check-box, toggle button, or radio button
- * "selection" synchronized with a model boolean.
- *
- * @see WritablePropertyValueModel
- * @see Button
- */
-@SuppressWarnings("nls")
-final class BooleanButtonModelBinding {
-
- // ***** model
- /** A value model on the underlying model boolean. */
- private final WritablePropertyValueModel<Boolean> booleanModel;
-
- /**
- * A listener that allows us to synchronize the button's selection state with
- * the model boolean.
- */
- private final PropertyChangeListener booleanChangeListener;
-
- /**
- * The default setting for the check-box/toggle button/radio button;
- * for when the underlying model is <code>null</code>.
- * The default [default value] is <code>false</code> (i.e. the check-box
- * is unchecked/toggle button popped out/radio button unchecked).
- */
- private final boolean defaultValue;
-
- // ***** UI
- /** The check-box/toggle button/radio button we synchronize with the model boolean. */
- private final Button button;
-
- /**
- * A listener that allows us to synchronize the model boolean with
- * the button's selection state.
- */
- private final SelectionListener buttonSelectionListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the button
- * is disposed. (Critical for preventing memory leaks.)
- */
- private final DisposeListener buttonDisposeListener;
-
-
- // ********** constructor **********
-
- /**
- * Constructor - the boolean model and button are required.
- */
- BooleanButtonModelBinding(WritablePropertyValueModel<Boolean> booleanModel, Button button, boolean defaultValue) {
- super();
- if ((booleanModel == null) || (button == null)) {
- throw new NullPointerException();
- }
- this.booleanModel = booleanModel;
- this.button = button;
- this.defaultValue = defaultValue;
-
- this.booleanChangeListener = this.buildBooleanChangeListener();
- this.booleanModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
-
- this.buttonSelectionListener = this.buildButtonSelectionListener();
- this.button.addSelectionListener(this.buttonSelectionListener);
-
- this.buttonDisposeListener = this.buildButtonDisposeListener();
- this.button.addDisposeListener(this.buttonDisposeListener);
-
- this.setButtonSelection(this.booleanModel.getValue());
- }
-
-
- // ********** initialization **********
-
- private PropertyChangeListener buildBooleanChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildBooleanChangeListener_());
- }
-
- private PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- BooleanButtonModelBinding.this.booleanChanged(event);
- }
- @Override
- public String toString() {
- return "boolean listener";
- }
- };
- }
-
- private SelectionListener buildButtonSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- BooleanButtonModelBinding.this.buttonSelected();
- }
- @Override
- public String toString() {
- return "button selection listener";
- }
- };
- }
-
- private DisposeListener buildButtonDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- BooleanButtonModelBinding.this.buttonDisposed();
- }
- @Override
- public String toString() {
- return "button dispose listener";
- }
- };
- }
-
-
- // ********** boolean model events **********
-
- /**
- * The model has changed - synchronize the button.
- * If the new model value is null, use the binding's default value
- * (which is typically false).
- */
- /* CU private */ void booleanChanged(PropertyChangeEvent event) {
- this.setButtonSelection((Boolean) event.getNewValue());
- }
-
- private void setButtonSelection(Boolean b) {
- if ( ! this.button.isDisposed()) {
- this.button.setSelection(this.booleanValue(b));
- }
- }
-
- private boolean booleanValue(Boolean b) {
- return (b != null) ? b.booleanValue() : this.defaultValue;
- }
-
-
- // ********** button events **********
-
- /**
- * The button has been "selected" - synchronize the model.
- */
- /* CU private */ void buttonSelected() {
- if ( ! this.button.isDisposed()) {
- this.booleanModel.setValue(Boolean.valueOf(this.button.getSelection()));
- }
- }
-
- /* CU private */ void buttonDisposed() {
- // the button is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.button.removeSelectionListener(this.buttonSelectionListener);
- this.button.removeDisposeListener(this.buttonDisposeListener);
- this.booleanModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.booleanModel);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanStateController.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanStateController.java
deleted file mode 100644
index 5ea988de7c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/BooleanStateController.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This controller enables a boolean model to control either the
- * <em>enabled</em> or <em>visible</em> properties of SWT controls; i.e. the
- * controls' properties are kept in synch with the boolean model,
- * but <em>not</em> vice-versa.
- * <p>
- * Subclasses must manage the listeners; i.e. the engaging and disengaging of
- * the boolean model and the control(s).
- *
- * @see PropertyValueModel
- * @see Control#setEnabled(boolean)
- * @see Control#setVisible(boolean)
- */
-abstract class BooleanStateController {
-
- /**
- * The controlling boolean model.
- */
- private final PropertyValueModel<Boolean> booleanModel;
-
- /**
- * A listener that allows us to synchronize the control states with
- * changes in the value of the boolean model.
- */
- private final PropertyChangeListener booleanChangeListener;
-
- /**
- * A listener that allows us to stop listening to stuff when all the
- * controls are disposed. (Critical for preventing memory leaks.)
- */
- private final DisposeListener controlDisposeListener;
-
- /**
- * The default setting for the state; for when the underlying boolean model is
- * <code>null</code>. The default [default value] is <code>false<code>.
- */
- private final boolean defaultValue;
-
- /**
- * The adapter determines whether the 'enabled' or 'visible' property is
- * controlled.
- */
- private final Adapter adapter;
-
-
- // ********** constructor **********
-
- /**
- * Constructor - the boolean model and the adapter are required.
- */
- BooleanStateController(PropertyValueModel<Boolean> booleanModel, boolean defaultValue, Adapter adapter) {
- super();
- if ((booleanModel == null) || (adapter == null)) {
- throw new NullPointerException();
- }
- this.booleanModel = booleanModel;
- this.defaultValue = defaultValue;
- this.adapter = adapter;
-
- this.booleanChangeListener = this.buildBooleanChangeListener();
- this.controlDisposeListener = this.buildControlDisposeListener();
- }
-
-
- // ********** initialization **********
-
- private PropertyChangeListener buildBooleanChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildBooleanChangeListener_());
- }
-
- private PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- BooleanStateController.this.booleanChanged(event);
- }
- @Override
- public String toString() {
- return "boolean listener"; //$NON-NLS-1$
- }
- };
- }
-
- private DisposeListener buildControlDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- // the control is not yet "disposed" when we receive this event
- // so we can still remove our listener
- BooleanStateController.this.controlDisposed((Control) event.widget);
- }
- @Override
- public String toString() {
- return "control dispose listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** boolean model **********
-
- void engageBooleanModel() {
- this.booleanModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
- void disengageBooleanModel() {
- this.booleanModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
- /**
- * The boolean model has changed - synchronize the controls.
- * If the new boolean model value is <code>null</code>, use the controller's
- * default value (which is typically false).
- */
- /* CU private */ void booleanChanged(PropertyChangeEvent event) {
- this.setControlState((Boolean) event.getNewValue());
- }
-
-
- boolean getBooleanValue() {
- return this.booleanValue(this.booleanModel.getValue());
- }
-
- private boolean booleanValue(Boolean b) {
- return (b != null) ? b.booleanValue() : this.defaultValue;
- }
-
-
- // ********** control **********
-
- void engageControl(Control control) {
- control.addDisposeListener(this.controlDisposeListener);
- }
-
- void disengageControl(Control control) {
- control.removeDisposeListener(this.controlDisposeListener);
- }
-
- private void setControlState(Boolean b) {
- this.setControlState(this.booleanValue(b));
- }
-
- abstract void setControlState(boolean b);
-
- void setControlState(Control control, boolean b) {
- if ( ! control.isDisposed()) {
- this.adapter.setState(control, b);
- }
- }
-
- void controlDisposed(Control control) {
- this.disengageControl(control);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.booleanModel);
- }
-
-
- // ********** adapter interface **********
-
- interface Adapter {
- void setState(Control control, boolean b);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/DropDownListBoxSelectionBinding.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/DropDownListBoxSelectionBinding.java
deleted file mode 100644
index ccfb8bdaed..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/DropDownListBoxSelectionBinding.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-
-/**
- * This binding can be used to keep a drop-down list box's selection
- * synchronized with a model. The selection can be modified by either the
- * drop-down list box or the model, so changes must be coordinated.
- * <p>
- * <strong>NB:</strong> A selected item value of <code>null</code> can be used
- * to clear the drop-down list box's selection. If <code>null</code> is a
- * valid item in the model list, an invalid selected item can be used to clear
- * the selection.
- *
- * @see ListValueModel
- * @see WritablePropertyValueModel
- * @see DropDownListBox
- * @see SWTTools
- */
-@SuppressWarnings("nls")
-final class DropDownListBoxSelectionBinding<E>
- implements ListWidgetModelBinding.SelectionBinding
-{
- // ***** model
- /**
- * The underlying list model.
- */
- private final ListValueModel<E> listModel;
-
- /**
- * A writable value model on the underlying model selection.
- */
- private final WritablePropertyValueModel<E> selectedItemModel;
-
- /**
- * A listener that allows us to synchronize the drop-down list box's
- * selection with the model selection.
- */
- private final PropertyChangeListener selectedItemChangeListener;
-
- // ***** UI
- /**
- * The drop-down list box whose selection we keep synchronized
- * with the model selection.
- */
- private final DropDownListBox dropdownListBox;
-
- /**
- * A listener that allows us to synchronize our selected item holder
- * with the drop-down list box's selection.
- */
- private final SelectionListener dropdownListBoxSelectionListener;
-
-
- // ********** constructor **********
-
- /**
- * Constructor - all parameters are required.
- */
- DropDownListBoxSelectionBinding(
- ListValueModel<E> listModel,
- WritablePropertyValueModel<E> selectedItemModel,
- DropDownListBox dropdownListBox
- ) {
- super();
- if ((listModel == null) || (selectedItemModel == null) || (dropdownListBox == null)) {
- throw new NullPointerException();
- }
- this.listModel = listModel;
- this.selectedItemModel = selectedItemModel;
- this.dropdownListBox = dropdownListBox;
-
- this.selectedItemChangeListener = this.buildSelectedItemChangeListener();
- this.selectedItemModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.selectedItemChangeListener);
-
- this.dropdownListBoxSelectionListener = this.buildDropDownListBoxSelectionListener();
- this.dropdownListBox.addSelectionListener(this.dropdownListBoxSelectionListener);
- }
-
-
- // ********** initialization **********
-
- private PropertyChangeListener buildSelectedItemChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSelectedItemChangeListener_());
- }
-
- private PropertyChangeListener buildSelectedItemChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DropDownListBoxSelectionBinding.this.selectedItemChanged(event);
- }
- @Override
- public String toString() {
- return "selected item listener";
- }
- };
- }
-
- private SelectionListener buildDropDownListBoxSelectionListener() {
- return new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- DropDownListBoxSelectionBinding.this.dropDownListBoxSelectionChanged(event);
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- DropDownListBoxSelectionBinding.this.dropDownListBoxDoubleClicked(event);
- }
- @Override
- public String toString() {
- return "drop-down list box selection listener";
- }
- };
- }
-
-
- // ********** ListWidgetModelBinding.SelectionBinding implementation **********
-
- /**
- * Modifying the drop-down lisb box's selected item programmatically does
- * not trigger a SelectionEvent.
- * <p>
- * Pre-condition: The drop-down list box is not disposed.
- */
- public void synchronizeListWidgetSelection() {
- int oldIndex = this.dropdownListBox.getSelectionIndex();
- E value = this.selectedItemModel.getValue();
- int newIndex = this.indexOf(value);
- if ((oldIndex != -1) && (newIndex != -1) && (newIndex != oldIndex)) {
- this.dropdownListBox.deselect(oldIndex);
- }
- if (newIndex == -1) {
- this.dropdownListBox.deselectAll();
- } else {
- if (newIndex != oldIndex) {
- this.dropdownListBox.select(newIndex);
- }
- }
- }
-
- public void dispose() {
- this.dropdownListBox.removeSelectionListener(this.dropdownListBoxSelectionListener);
- this.selectedItemModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.selectedItemChangeListener);
- }
-
-
- // ********** selected item **********
-
- void selectedItemChanged(PropertyChangeEvent event) {
- if ( ! this.dropdownListBox.isDisposed()) {
- this.selectedItemChanged_(event);
- }
- }
-
- /**
- * Modifying the drop-down list box's selected item programmatically does
- * not trigger a SelectionEvent.
- */
- private void selectedItemChanged_(@SuppressWarnings("unused") PropertyChangeEvent event) {
- this.synchronizeListWidgetSelection();
- }
-
- private int indexOf(E item) {
- int len = this.listModel.size();
- for (int i = 0; i < len; i++) {
- if (Tools.valuesAreEqual(this.listModel.get(i), item)) {
- return i;
- }
- }
- // if 'null' is not in the list, use it to clear the selection
- if (item == null) {
- return -1;
- }
- // We can get here via one of the following:
- // 1. The selected item model is invalid and not in sync with the list
- // model. This is not good and we don't make this (programming
- // error) obvious (e.g. via an exception). :-(
- // 2. If both the selected item model and the list model are dependent
- // on the same underlying model, the selected item model may receive
- // its event first, resulting in a missing item. This will resolve
- // itself once the list model receives its event and synchronizes
- // with the same underlying model. This situation is acceptable.
- return -1;
-
-// This is what we used to do:
-// throw new IllegalStateException("selected item not found: " + item);
- }
-
-
- // ********** combo-box events **********
-
- void dropDownListBoxSelectionChanged(SelectionEvent event) {
- if ( ! this.dropdownListBox.isDisposed()) {
- this.dropDownListBoxSelectionChanged_(event);
- }
- }
-
- void dropDownListBoxDoubleClicked(SelectionEvent event) {
- if ( ! this.dropdownListBox.isDisposed()) {
- this.dropDownListBoxSelectionChanged_(event);
- }
- }
-
- private void dropDownListBoxSelectionChanged_(@SuppressWarnings("unused") SelectionEvent event) {
- this.selectedItemModel.setValue(this.getDropDownListBoxSelectedItem());
- }
-
- private E getDropDownListBoxSelectedItem() {
- int selectionIndex = this.dropdownListBox.getSelectionIndex();
- return (selectionIndex == -1) ? null : this.listModel.get(selectionIndex);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selectedItemModel);
- }
-
-
- // ********** adapter interface **********
-
- /**
- * Adapter used by the drop-down list box selection binding to query and manipulate
- * the drop-down list box.
- */
- interface DropDownListBox {
-
- /**
- * Return whether the combo-box is "disposed".
- */
- boolean isDisposed();
-
- /**
- * Add the specified selection listener to the combo-box.
- */
- void addSelectionListener(SelectionListener listener);
-
- /**
- * Remove the specified selection listener from the combo-box.
- */
- void removeSelectionListener(SelectionListener listener);
-
- /**
- * Return the index of the combo-box's selection.
- */
- int getSelectionIndex();
-
- /**
- * Select the item at the specified index in the combo-box.
- */
- void select(int index);
-
- /**
- * Deselect the item at the specified index in the combo-box.
- */
- void deselect(int index);
-
- /**
- * Clear the combo-box's selection.
- */
- void deselectAll();
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListBoxSelectionBinding.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListBoxSelectionBinding.java
deleted file mode 100644
index 1c5c28bcab..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListBoxSelectionBinding.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTCollectionChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.List;
-
-/**
- * This binding can be used to keep a list box's selection
- * synchronized with a model. The selection can be modified by either the list
- * box or the model, so changes must be coordinated.
- *
- * @see ListValueModel
- * @see WritableCollectionValueModel
- * @see List
- * @see SWTTools
- */
-@SuppressWarnings("nls")
-final class ListBoxSelectionBinding<E>
- implements ListWidgetModelBinding.SelectionBinding
-{
- // ***** model
- /**
- * The underlying list model.
- */
- private final ListValueModel<E> listModel;
-
- /**
- * A writable value model on the underlying model selections.
- */
- private final WritableCollectionValueModel<E> selectedItemsModel;
-
- /**
- * A listener that allows us to synchronize the list box's selection with
- * the model selections.
- */
- private final CollectionChangeListener selectedItemsChangeListener;
-
- // ***** UI
- /**
- * The list box whose selection we keep synchronized with the model selections.
- */
- private final List listBox;
-
- /**
- * A listener that allows us to synchronize our selected items holder
- * with the list box's selection.
- */
- private final SelectionListener listBoxSelectionListener;
-
-
- // ********** constructor **********
-
- /**
- * Constructor - all parameters are required.
- */
- ListBoxSelectionBinding(
- ListValueModel<E> listModel,
- WritableCollectionValueModel<E> selectedItemsModel,
- List listBox
- ) {
- super();
- if ((listModel == null) || (selectedItemsModel == null) || (listBox == null)) {
- throw new NullPointerException();
- }
- this.listModel = listModel;
- this.selectedItemsModel = selectedItemsModel;
- this.listBox = listBox;
-
- this.selectedItemsChangeListener = this.buildSelectedItemsChangeListener();
- this.selectedItemsModel.addCollectionChangeListener(CollectionValueModel.VALUES, this.selectedItemsChangeListener);
-
- this.listBoxSelectionListener = this.buildListBoxSelectionListener();
- this.listBox.addSelectionListener(this.listBoxSelectionListener);
- }
-
-
- // ********** initialization **********
-
- private CollectionChangeListener buildSelectedItemsChangeListener() {
- return new SWTCollectionChangeListenerWrapper(this.buildSelectedItemsChangeListener_());
- }
-
- private CollectionChangeListener buildSelectedItemsChangeListener_() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- ListBoxSelectionBinding.this.selectedItemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- ListBoxSelectionBinding.this.selectedItemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- ListBoxSelectionBinding.this.selectedItemsCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- ListBoxSelectionBinding.this.selectedItemsChanged(event);
- }
- @Override
- public String toString() {
- return "selected items listener";
- }
- };
- }
-
- private SelectionListener buildListBoxSelectionListener() {
- return new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- ListBoxSelectionBinding.this.listBoxSelectionChanged(event);
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- ListBoxSelectionBinding.this.listBoxDoubleClicked(event);
- }
- @Override
- public String toString() {
- return "list box selection listener";
- }
- };
- }
-
-
- // ********** ListWidgetModelBinding.SelectionBinding implementation **********
-
- /**
- * Modifying the list box's selected items programmatically does not
- * trigger a SelectionEvent.
- *
- * Pre-condition: The list-box is not disposed.
- */
- public void synchronizeListWidgetSelection() {
- int selectedItemsSize = this.selectedItemsModel.size();
- int[] select = new int[selectedItemsSize];
- int i = 0;
- for (E item : this.selectedItemsModel) {
- select[i++] = this.indexOf(item);
- }
-
- int listSize = this.listModel.size();
- int[] deselect = new int[listSize - selectedItemsSize];
- i = 0;
- for (int j = 0; j < listSize; j++) {
- if ( ! ArrayTools.contains(select, j)) {
- deselect[i++] = j;
- }
- }
-
- int[] old = ArrayTools.sort(this.listBox.getSelectionIndices());
- select = ArrayTools.sort(select);
- if ( ! Arrays.equals(select, old)) {
- this.listBox.deselect(deselect);
- this.listBox.select(select);
- }
- }
-
- public void dispose() {
- this.listBox.removeSelectionListener(this.listBoxSelectionListener);
- this.selectedItemsModel.removeCollectionChangeListener(CollectionValueModel.VALUES, this.selectedItemsChangeListener);
- }
-
-
- // ********** selected items **********
-
- void selectedItemsAdded(CollectionAddEvent event) {
- if ( ! this.listBox.isDisposed()) {
- this.selectedItemsAdded_(event);
- }
- }
-
- /**
- * Modifying the list box's selected items programmatically does not
- * trigger a SelectionEvent.
- */
- private void selectedItemsAdded_(CollectionAddEvent event) {
- int[] indices = new int[event.getItemsSize()];
- int i = 0;
- for (E item : this.getItems(event)) {
- indices[i++] = this.indexOf(item);
- }
- this.listBox.select(indices);
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Iterable<E> getItems(CollectionAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- void selectedItemsRemoved(CollectionRemoveEvent event) {
- if ( ! this.listBox.isDisposed()) {
- this.selectedItemsRemoved_(event);
- }
- }
-
- /**
- * Modifying the list box's selected items programmatically does not
- * trigger a SelectionEvent.
- */
- private void selectedItemsRemoved_(CollectionRemoveEvent event) {
- int[] indices = new int[event.getItemsSize()];
- int i = 0;
- for (E item : this.getItems(event)) {
- indices[i++] = this.indexOf(item);
- }
- this.listBox.deselect(indices);
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Iterable<E> getItems(CollectionRemoveEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- void selectedItemsCleared(CollectionClearEvent event) {
- if ( ! this.listBox.isDisposed()) {
- this.selectedItemsCleared_(event);
- }
- }
-
- /**
- * Modifying the list box's selected items programmatically does not
- * trigger a SelectionEvent.
- */
- private void selectedItemsCleared_(@SuppressWarnings("unused") CollectionClearEvent event) {
- this.listBox.deselectAll();
- }
-
- void selectedItemsChanged(CollectionChangeEvent event) {
- if ( ! this.listBox.isDisposed()) {
- this.selectedItemsChanged_(event);
- }
- }
-
- private void selectedItemsChanged_(@SuppressWarnings("unused") CollectionChangeEvent event) {
- this.synchronizeListWidgetSelection();
- }
-
- private int indexOf(E item) {
- int len = this.listModel.size();
- for (int i = 0; i < len; i++) {
- if (Tools.valuesAreEqual(this.listModel.get(i), item)) {
- return i;
- }
- }
- // see comment in DropDownListBoxSelectionBinding.indexOf(E)
- return -1;
- }
-
-
- // ********** list box events **********
-
- void listBoxSelectionChanged(SelectionEvent event) {
- if ( ! this.listBox.isDisposed()) {
- this.listBoxSelectionChanged_(event);
- }
- }
-
- void listBoxDoubleClicked(SelectionEvent event) {
- if ( ! this.listBox.isDisposed()) {
- this.listBoxSelectionChanged_(event);
- }
- }
-
- private void listBoxSelectionChanged_(@SuppressWarnings("unused") SelectionEvent event) {
- this.selectedItemsModel.setValues(this.getListBoxSelectedItems());
- }
-
- private Iterable<E> getListBoxSelectedItems() {
- ArrayList<E> selectedItems = new ArrayList<E>(this.listBox.getSelectionCount());
- for (int selectionIndex : this.listBox.getSelectionIndices()) {
- selectedItems.add(this.listModel.get(selectionIndex));
- }
- return selectedItems;
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selectedItemsModel);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListWidgetModelBinding.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListWidgetModelBinding.java
deleted file mode 100644
index 18b9e7c2d8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/ListWidgetModelBinding.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import java.util.ArrayList;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-
-/**
- * This binding can be used to keep a list widget's contents
- * synchronized with a model. The list widget never alters
- * its contents directly; all changes are driven by the model.
- *
- * @see ListValueModel
- * @see StringConverter
- * @see ListWidget
- * @see SelectionBinding
- * @see SWTTools
- */
-@SuppressWarnings("nls")
-final class ListWidgetModelBinding<E> {
-
- // ***** model
- /**
- * The underlying list model.
- */
- private final ListValueModel<E> listModel;
-
- /**
- * A listener that allows us to synchronize the list widget's contents with
- * the model list.
- */
- private final ListChangeListener listChangeListener;
-
- /**
- * A converter that converts items in the model list
- * to strings that can be put in the list widget.
- */
- private final StringConverter<E> stringConverter;
-
- // ***** UI
- /**
- * An adapter on the list widget we keep synchronized with the model list.
- */
- private final ListWidget listWidget;
-
- /**
- * A listener that allows us to stop listening to stuff when the list widget
- * is disposed. (Critical for preventing memory leaks.)
- */
- private final DisposeListener listWidgetDisposeListener;
-
- // ***** selection
- /**
- * Widget-specific selection binding.
- */
- private final SelectionBinding selectionBinding;
-
-
- // ********** constructor **********
-
- /**
- * Constructor - all parameters are required.
- */
- ListWidgetModelBinding(
- ListValueModel<E> listModel,
- ListWidget listWidget,
- StringConverter<E> stringConverter,
- SelectionBinding selectionBinding
- ) {
- super();
- if ((listModel == null) || (listWidget == null) || (stringConverter == null) || (selectionBinding == null)) {
- throw new NullPointerException();
- }
- this.listModel = listModel;
- this.listWidget = listWidget;
- this.stringConverter = stringConverter;
- this.selectionBinding = selectionBinding;
-
- this.listChangeListener = this.buildListChangeListener();
- this.listModel.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
-
- this.listWidgetDisposeListener = this.buildListWidgetDisposeListener();
- this.listWidget.addDisposeListener(this.listWidgetDisposeListener);
-
- this.synchronizeListWidget();
- }
-
-
- // ********** initialization **********
-
- private ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- private ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ListWidgetModelBinding.this.listItemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ListWidgetModelBinding.this.listItemsRemoved(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ListWidgetModelBinding.this.listItemsMoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ListWidgetModelBinding.this.listItemsReplaced(event);
- }
- public void listCleared(ListClearEvent event) {
- ListWidgetModelBinding.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListWidgetModelBinding.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
- private DisposeListener buildListWidgetDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- ListWidgetModelBinding.this.listWidgetDisposed(event);
- }
- @Override
- public String toString() {
- return "list widget dispose listener";
- }
- };
- }
-
-
- // ********** list **********
-
- /**
- * Brute force synchronization of list widget with the model list.
- */
- private void synchronizeListWidget() {
- if ( ! this.listWidget.isDisposed()) {
- this.synchronizeListWidget_();
- }
- }
-
- private void synchronizeListWidget_() {
- ArrayList<String> items = new ArrayList<String>(this.listModel.size());
- for (E item : this.listModel) {
- items.add(this.convert(item));
- }
- this.listWidget.setItems(items.toArray(new String[items.size()]));
-
- // now that the list has changed, we need to synch the selection
- this.selectionBinding.synchronizeListWidgetSelection();
- }
-
- /**
- * The model has changed - synchronize the list widget.
- */
- void listItemsAdded(ListAddEvent event) {
- if ( ! this.listWidget.isDisposed()) {
- this.listItemsAdded_(event);
- }
- }
-
- private void listItemsAdded_(ListAddEvent event) {
- int i = event.getIndex();
- for (E item : this.getItems(event)) {
- this.listWidget.add(this.convert(item), i++);
- }
-
- // now that the list has changed, we need to synch the selection
- this.selectionBinding.synchronizeListWidgetSelection();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Iterable<E> getItems(ListAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- /**
- * The model has changed - synchronize the list widget.
- */
- void listItemsRemoved(ListRemoveEvent event) {
- if ( ! this.listWidget.isDisposed()) {
- this.listItemsRemoved_(event);
- }
- }
-
- private void listItemsRemoved_(ListRemoveEvent event) {
- this.listWidget.remove(event.getIndex(), event.getIndex() + event.getItemsSize() - 1);
-
- // now that the list has changed, we need to synch the selection
- this.selectionBinding.synchronizeListWidgetSelection();
- }
-
- /**
- * The model has changed - synchronize the list widget.
- */
- void listItemsMoved(ListMoveEvent event) {
- if ( ! this.listWidget.isDisposed()) {
- this.listItemsMoved_(event);
- }
- }
-
- private void listItemsMoved_(ListMoveEvent event) {
- int target = event.getTargetIndex();
- int source = event.getSourceIndex();
- int len = event.getLength();
- int loStart = Math.min(target, source);
- int hiStart = Math.max(target, source);
- // make a copy of the affected items...
- String[] subArray = ArrayTools.subArray(this.listWidget.getItems(), loStart, hiStart + len);
- // ...move them around...
- subArray = ArrayTools.move(subArray, target - loStart, source - loStart, len);
- // ...and then put them back
- int i = loStart;
- for (String item : subArray) {
- this.listWidget.setItem(i++, item);
- }
-
- // now that the list has changed, we need to synch the selection
- this.selectionBinding.synchronizeListWidgetSelection();
- }
-
- /**
- * The model has changed - synchronize the list widget.
- */
- void listItemsReplaced(ListReplaceEvent event) {
- if ( ! this.listWidget.isDisposed()) {
- this.listItemsReplaced_(event);
- }
- }
-
- private void listItemsReplaced_(ListReplaceEvent event) {
- int i = event.getIndex();
- for (E item : this.getNewItems(event)) {
- this.listWidget.setItem(i++, this.convert(item));
- }
-
- // now that the list has changed, we need to synch the selection
- this.selectionBinding.synchronizeListWidgetSelection();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Iterable<E> getNewItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getNewItems();
- }
-
- /**
- * The model has changed - synchronize the list widget.
- */
- void listCleared(ListClearEvent event) {
- if ( ! this.listWidget.isDisposed()) {
- this.listCleared_(event);
- }
- }
-
- private void listCleared_(@SuppressWarnings("unused") ListClearEvent event) {
- this.listWidget.removeAll();
- }
-
- /**
- * The model has changed - synchronize the list widget.
- */
- void listChanged(ListChangeEvent event) {
- if ( ! this.listWidget.isDisposed()) {
- this.listChanged_(event);
- }
- }
-
- private void listChanged_(@SuppressWarnings("unused") ListChangeEvent event) {
- this.synchronizeListWidget_();
- }
-
- /**
- * Use the string converter to convert the specified item to a
- * string that can be added to the list widget.
- */
- private String convert(E item) {
- return this.stringConverter.convertToString(item);
- }
-
-
- // ********** list widget events **********
-
- void listWidgetDisposed(@SuppressWarnings("unused") DisposeEvent event) {
- // the list widget is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.listWidget.removeDisposeListener(this.listWidgetDisposeListener);
- this.listModel.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- this.selectionBinding.dispose();
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listModel);
- }
-
-
- // ********** adapter interfaces **********
-
- /**
- * Adapter used by the list widget model binding to query and manipulate
- * the widget.
- */
- interface ListWidget {
-
- /**
- * Return whether the list widget is "disposed".
- */
- boolean isDisposed();
-
- /**
- * Add the specified dispose listener to the list widget.
- */
- void addDisposeListener(DisposeListener listener);
-
- /**
- * Remove the specified dispose listener from the list widget.
- */
- void removeDisposeListener(DisposeListener listener);
-
- /**
- * Return the list widget's items.
- */
- String[] getItems();
-
- /**
- * Set the list widget's item at the specified index to the specified item.
- */
- void setItem(int index, String item);
-
- /**
- * Set the list widget's items.
- */
- void setItems(String[] items);
-
- /**
- * Add the specified item to the list widget's items at the specified index.
- */
- void add(String item, int index);
-
- /**
- * Remove the specified range of items from the list widget's items.
- */
- void remove(int start, int end);
-
- /**
- * Remove all the items from the list widget.
- */
- void removeAll();
-
- }
-
-
- /**
- * Widget-specific selection binding that is controlled by the list widget
- * model binding.
- */
- interface SelectionBinding {
-
- /**
- * Synchronize the selection binding's widget with the selection model.
- * <p>
- * Pre-condition: The widget is not disposed.
- */
- void synchronizeListWidgetSelection();
-
- /**
- * The widget has been disposed; dispose the selection binding.
- */
- void dispose();
-
-
- /**
- * Useful for list boxes that ignore the selection.
- */
- final class Null implements SelectionBinding {
- public static final SelectionBinding INSTANCE = new Null();
- public static SelectionBinding instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void synchronizeListWidgetSelection() {
- // do nothing
- }
- public void dispose() {
- // do nothing
- }
- @Override
- public String toString() {
- return "SelectionBinding.Null"; //$NON-NLS-1$
- }
- }
-
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/MultiControlBooleanStateController.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/MultiControlBooleanStateController.java
deleted file mode 100644
index aa52a80af1..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/MultiControlBooleanStateController.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import java.util.HashSet;
-
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This controller enables a boolean model to control either the
- * <em>enabled</em> or <em>visible</em> properties of a set of SWT controls;
- * i.e. the controls' properties are kept in synch with the boolean model,
- * but <em>not</em> vice-versa.
- *
- * @see PropertyValueModel
- * @see CollectionValueModel
- * @see Control#setEnabled(boolean)
- * @see Control#setVisible(boolean)
- */
-final class MultiControlBooleanStateController
- extends BooleanStateController
-{
- /**
- * The set of controls whose state is kept in sync with the boolean model.
- */
- private final CollectionValueModel<? extends Control> controlsModel;
-
- /**
- * A listener that allows clients to add/remove controls.
- */
- private final CollectionChangeListener controlsListener;
-
- /**
- * Cache of controls.
- */
- private final HashSet<Control> controls = new HashSet<Control>();
-
-
- // ********** constructor **********
-
- /**
- * Constructor - the boolean model, the controls model, and the adapter are required.
- */
- MultiControlBooleanStateController(
- PropertyValueModel<Boolean> booleanModel,
- CollectionValueModel<? extends Control> controlsModel,
- boolean defaultValue,
- Adapter adapter
- ) {
- super(booleanModel, defaultValue, adapter);
- if (controlsModel == null) {
- throw new NullPointerException();
- }
- this.controlsModel = controlsModel;
- this.controlsListener = this.buildControlsListener();
- this.addControls(controlsModel);
- }
-
-
- // ********** initialization **********
-
- private CollectionChangeListener buildControlsListener() {
- return new CollectionChangeListener() {
- @SuppressWarnings("unchecked")
- public void itemsAdded(CollectionAddEvent event) {
- MultiControlBooleanStateController.this.addControls((Iterable<? extends Control>) event.getItems());
- }
- @SuppressWarnings("unchecked")
- public void itemsRemoved(CollectionRemoveEvent event) {
- MultiControlBooleanStateController.this.removeControls((Iterable<? extends Control>) event.getItems());
- }
- public void collectionCleared(CollectionClearEvent event) {
- MultiControlBooleanStateController.this.clearControls();
- }
- @SuppressWarnings("unchecked")
- public void collectionChanged(CollectionChangeEvent event) {
- MultiControlBooleanStateController.this.clearControls();
- MultiControlBooleanStateController.this.addControls((Iterable<? extends Control>) event.getCollection());
- }
- @Override
- public String toString() {
- return "controls listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** controls **********
-
- @Override
- void setControlState(boolean b) {
- for (Control control : this.controls) {
- this.setControlState(control, b);
- }
- }
-
- /* CU private */ void addControls(Iterable<? extends Control> controls_) {
- boolean b = this.getBooleanValue();
- for (Control control : controls_) {
- this.addControl(control, b);
- }
- }
-
- private void addControl(Control control, boolean b) {
- if (this.controls.isEmpty()) {
- this.engageBooleanModel();
- this.controlsModel.addCollectionChangeListener(CollectionValueModel.VALUES, this.controlsListener);
- }
- if (this.controls.add(control)) {
- this.engageControl(control);
- this.setControlState(control, b);
- } else {
- throw new IllegalArgumentException("duplicate control: " + control); //$NON-NLS-1$
- }
- }
-
- /* CU private */ void clearControls() {
- this.removeControls(new SnapshotCloneIterable<Control>(this.controls));
- }
-
- /* CU private */ void removeControls(Iterable<? extends Control> controls_) {
- for (Control control : controls_) {
- this.disengageControl(control);
- this.removeControl(control);
- }
- }
-
- private void removeControl(Control control) {
- this.controls.remove(control);
- if (this.controls.isEmpty()) {
- this.controlsModel.removeCollectionChangeListener(CollectionValueModel.VALUES, this.controlsListener);
- this.disengageBooleanModel();
- }
- }
-
- @Override
- void controlDisposed(Control control) {
- super.controlDisposed(control);
- this.removeControl(control);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTComboAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTComboAdapter.java
deleted file mode 100644
index 672524d2d2..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTComboAdapter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Combo;
-
-/**
- * Adapt an SWT {@link Combo} to the list widget expected by
- * {@link ListWidgetModelBinding} and the
- * drop-down list box expected by {@link DropDownListBoxSelectionBinding}.
- */
-final class SWTComboAdapter
- extends AbstractListWidgetAdapter<Combo>
- implements DropDownListBoxSelectionBinding.DropDownListBox
-{
- SWTComboAdapter(Combo combo) {
- super(combo);
- }
-
- // ********** ListWidgetModelBinding.ListWidget implementation **********
- public String[] getItems() {
- return this.widget.getItems();
- }
- public void setItem(int index, String item) {
- this.widget.setItem(index, item);
- }
- public void setItems(String[] items) {
- this.widget.setItems(items);
- }
- public void add(String item, int index) {
- this.widget.add(item, index);
- }
- public void remove(int start, int end) {
- this.widget.remove(start, end);
- }
- public void removeAll() {
- this.widget.removeAll();
- }
-
- // ********** ComboBoxSelectionBinding.ComboBox implementation **********
- public void addSelectionListener(SelectionListener listener) {
- this.widget.addSelectionListener(listener);
- }
- public void removeSelectionListener(SelectionListener listener) {
- this.widget.removeSelectionListener(listener);
- }
- public int getSelectionIndex() {
- return this.widget.getSelectionIndex();
- }
- public void select(int index) {
- this.widget.select(index);
- }
- public void deselect(int index) {
- this.widget.deselect(index);
- }
- public void deselectAll() {
- this.widget.deselectAll();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTListAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTListAdapter.java
deleted file mode 100644
index 767be1bb86..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTListAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.List;
-
-/**
- * Adapt an SWT {@link List} to the list widget expected by
- * {@link ListWidgetModelBinding}.
- */
-final class SWTListAdapter
- extends AbstractListWidgetAdapter<List>
-{
- SWTListAdapter(List list) {
- super(list);
- }
- public void addSelectionListener(SelectionListener listener) {
- this.widget.addSelectionListener(listener);
- }
- public void removeSelectionListener(SelectionListener listener) {
- this.widget.removeSelectionListener(listener);
- }
- public String[] getItems() {
- return this.widget.getItems();
- }
- public void setItem(int index, String item) {
- this.widget.setItem(index, item);
- }
- public void setItems(String[] items) {
- this.widget.setItems(items);
- }
- public void add(String item, int index) {
- this.widget.add(item, index);
- }
- public void remove(int start, int end) {
- this.widget.remove(start, end);
- }
- public void removeAll() {
- this.widget.removeAll();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTTools.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTTools.java
deleted file mode 100644
index f5b9358a74..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SWTTools.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.WritablePropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * Various SWT tools.
- */
-@SuppressWarnings("nls")
-public final class SWTTools {
-
- // ********** check-box/radio button/toggle button **********
-
- /**
- * Bind the specified button (check-box, radio button, or toggle button)
- * to the specified boolean model.
- * If the boolean model is <code>null<code>, the button's 'selection' state will
- * be <code>false<code>.
- */
- public static void bind(WritablePropertyValueModel<Boolean> booleanModel, Button button) {
- bind(booleanModel, button, false);
- }
-
- /**
- * Bind the specified button (check-box, radio button, or toggle button)
- * to the specified boolean model.
- * If the boolean model is <code>null<code>, the button's 'selection' state will
- * be the specified default value.
- */
- public static void bind(WritablePropertyValueModel<Boolean> booleanModel, Button button, boolean defaultValue) {
- // the new binding will add itself as a listener to the boolean model and the button
- new BooleanButtonModelBinding(booleanModel, button, defaultValue);
- }
-
-
- // ********** text field **********
-
- /**
- * Bind the specified text model to the specified text field.
- */
- public static <E> void bind(WritablePropertyValueModel<String> textModel, Text textField) {
- // the new binding will add itself as a listener to the text model and the text field
- new TextFieldModelBinding(textModel, textField);
- }
-
-
- // ********** list box **********
-
- /**
- * Bind the specified model list to the specified list box.
- * The list box selection is ignored.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the list box, which calls {@link Object#toString()}
- * on the items in the model list.
- */
- public static <E> void bind(ListValueModel<E> listModel, List listBox) {
- bind(listModel, listBox, StringConverter.Default.<E>instance());
- }
-
- /**
- * Bind the specified model list to the specified list box.
- * The list box selection is ignored.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- public static <E> void bind(ListValueModel<E> listModel, List listBox, StringConverter<E> stringConverter) {
- bind(listModel, new SWTListAdapter(listBox), stringConverter);
- }
-
- /**
- * Bind the specified model list and selection to the specified list box.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the list box, which calls {@link Object#toString()}
- * on the items in the model list.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritablePropertyValueModel<E> selectedItemModel, List listBox) {
- bind(listModel, selectedItemModel, listBox, StringConverter.Default.<E>instance());
- }
-
- /**
- * Adapt the specified model list and selection to the specified list box.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritablePropertyValueModel<E> selectedItemModel, List listBox, StringConverter<E> stringConverter) {
- checkForSingleSelectionStyle(listBox);
- bind(listModel, new WritablePropertyCollectionValueModelAdapter<E>(selectedItemModel), listBox, stringConverter);
- }
-
- /**
- * Bind the specified model list and selections to the specified list box.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the list box, which calls {@link Object#toString()}
- * on the items in the model list.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritableCollectionValueModel<E> selectedItemsModel, List listBox) {
- bind(listModel, selectedItemsModel, listBox, StringConverter.Default.<E>instance());
- }
-
- /**
- * Bind the specified model list and selections to the specified list box.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritableCollectionValueModel<E> selectedItemsModel, List listBox, StringConverter<E> stringConverter) {
- bind(
- listModel,
- new SWTListAdapter(listBox),
- stringConverter,
- new ListBoxSelectionBinding<E>(listModel, selectedItemsModel, listBox)
- );
- }
-
- private static void checkForSingleSelectionStyle(List listBox) {
- if ( ! BitTools.flagIsSet(listBox.getStyle(), SWT.SINGLE)) {
- throw new IllegalStateException("list box must be single-selection: " + listBox);
- }
- }
-
-
- // ********** drop-down list box **********
-
- /**
- * Bind the specified model list and selection to the specified drop-down list box.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the drop-down list box, which calls {@link Object#toString()}
- * on the items in the model list.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritablePropertyValueModel<E> selectedItemModel, Combo dropDownListBox) {
- bind(listModel, selectedItemModel, dropDownListBox, StringConverter.Default.<E>instance());
- }
-
- /**
- * Adapt the specified model list and selection to the specified drop-down list box.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the drop-down list box.
- */
- public static <E> void bind(ListValueModel<E> listModel, WritablePropertyValueModel<E> selectedItemModel, Combo dropDownListBox, StringConverter<E> stringConverter) {
- checkForReadOnlyStyle(dropDownListBox);
- SWTComboAdapter comboAdapter = new SWTComboAdapter(dropDownListBox);
- bind(
- listModel,
- comboAdapter,
- stringConverter,
- new DropDownListBoxSelectionBinding<E>(listModel, selectedItemModel, comboAdapter)
- );
- }
-
- private static void checkForReadOnlyStyle(Widget comboBox) {
- if ( ! BitTools.flagIsSet(comboBox.getStyle(), SWT.READ_ONLY)) {
- throw new IllegalStateException("combo-box must be read-only: " + comboBox);
- }
- }
-
-
- // ********** list "widget" **********
-
- /**
- * Bind the specified model list to the specified list widget.
- * The list widget's selection is ignored.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- private static <E> void bind(ListValueModel<E> listModel, ListWidgetModelBinding.ListWidget listWidget, StringConverter<E> stringConverter) {
- bind(listModel, listWidget, stringConverter, ListWidgetModelBinding.SelectionBinding.Null.instance());
- }
-
- /**
- * Bind the specified model list to the specified list widget.
- * Use the specified selection binding to control the list widget's selection.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- private static <E> void bind(ListValueModel<E> listModel, ListWidgetModelBinding.ListWidget listWidget, StringConverter<E> stringConverter, ListWidgetModelBinding.SelectionBinding selectionBinding) {
- // the new binding will add itself as a listener to the value models and the list box
- new ListWidgetModelBinding<E>(listModel, listWidget, stringConverter, selectionBinding);
- }
-
-
- // ********** 'enabled' state **********
-
- /**
- * Control the <em>enabled</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>enabled</em> states will be <code>false<code>.
- */
- public static void controlEnabledState(PropertyValueModel<Boolean> booleanModel, Control... controls) {
- controlEnabledState(booleanModel, controls, false);
- }
-
- /**
- * Control the <em>enabled</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>enabled</em> states will be the specified default value.
- */
- public static void controlEnabledState(PropertyValueModel<Boolean> booleanModel, Control[] controls, boolean defaultValue) {
- switch (controls.length) {
- case 0:
- throw new IllegalArgumentException("empty controls array: " + Arrays.toString(controls));
- case 1:
- controlEnabledState(booleanModel, controls[0], defaultValue);
- break;
- default:
- controlEnabledState(booleanModel, new StaticCollectionValueModel<Control>(controls), defaultValue);
- break;
- }
- }
-
- /**
- * Control the <em>enabled</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>enabled</em> states will be <code>false<code>.
- */
- public static void controlEnabledState(PropertyValueModel<Boolean> booleanModel, Iterable<? extends Control> controls) {
- controlEnabledState(booleanModel, controls, false);
- }
-
- /**
- * Control the <em>enabled</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>enabled</em> states will be the specified default value.
- */
- public static void controlEnabledState(PropertyValueModel<Boolean> booleanModel, Iterable<? extends Control> controls, boolean defaultValue) {
- controlEnabledState(booleanModel, new StaticCollectionValueModel<Control>(controls), defaultValue);
- }
-
- /**
- * Control the <em>enabled</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>enabled</em> states will be <code>false<code>.
- */
- public static void controlEnabledState(PropertyValueModel<Boolean> booleanModel, CollectionValueModel<? extends Control> controlsModel) {
- controlEnabledState(booleanModel, controlsModel, false);
- }
-
- /**
- * Control the <em>enabled</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>enabled</em> states will be the specified default value.
- */
- public static void controlEnabledState(PropertyValueModel<Boolean> booleanModel, CollectionValueModel<? extends Control> controlsModel, boolean defaultValue) {
- control(booleanModel, controlsModel, defaultValue, ENABLED_ADAPTER);
- }
-
- /**
- * Control the <em>enabled</em> state of the specified control with the
- * specified boolean. If the boolean is <code>null<code>, the control's
- * <em>enabled</em> state will be the specified default value.
- */
- public static void controlEnabledState(PropertyValueModel<Boolean> booleanModel, Control control, boolean defaultValue) {
- control(booleanModel, control, defaultValue, ENABLED_ADAPTER);
- }
-
- private static final BooleanStateController.Adapter ENABLED_ADAPTER =
- new BooleanStateController.Adapter() {
- public void setState(Control control, boolean b) {
- control.setEnabled(b);
- }
- };
-
-
- // ********** 'visible' state **********
-
- /**
- * Control the <em>visible</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>visible</em> states will be <code>false<code>.
- */
- public static void controlVisibleState(PropertyValueModel<Boolean> booleanModel, Control... controls) {
- controlVisibleState(booleanModel, controls, false);
- }
-
- /**
- * Control the <em>visible</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>visible</em> states will be the specified default value.
- */
- public static void controlVisibleState(PropertyValueModel<Boolean> booleanModel, Control[] controls, boolean defaultValue) {
- switch (controls.length) {
- case 0:
- throw new IllegalArgumentException("empty controls array: " + Arrays.toString(controls));
- case 1:
- controlVisibleState(booleanModel, controls[0], defaultValue);
- break;
- default:
- controlVisibleState(booleanModel, new StaticCollectionValueModel<Control>(controls), defaultValue);
- break;
- }
- }
-
- /**
- * Control the <em>visible</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>visible</em> states will be <code>false<code>.
- */
- public static void controlVisibleState(PropertyValueModel<Boolean> booleanModel, Iterable<? extends Control> controls) {
- controlVisibleState(booleanModel, controls, false);
- }
-
- /**
- * Control the <em>visible</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>visible</em> states will be the specified default value.
- */
- public static void controlVisibleState(PropertyValueModel<Boolean> booleanModel, Iterable<? extends Control> controls, boolean defaultValue) {
- controlVisibleState(booleanModel, new StaticCollectionValueModel<Control>(controls), defaultValue);
- }
-
- /**
- * Control the <em>visible</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>visible</em> states will be <code>false<code>.
- */
- public static void controlVisibleState(PropertyValueModel<Boolean> booleanModel, CollectionValueModel<? extends Control> controlsModel) {
- controlVisibleState(booleanModel, controlsModel, false);
- }
-
- /**
- * Control the <em>visible</em> state of the specified controls with the
- * specified boolean. If the boolean is <code>null<code>, the controls'
- * <em>visible</em> states will be the specified default value.
- */
- public static void controlVisibleState(PropertyValueModel<Boolean> booleanModel, CollectionValueModel<? extends Control> controlsModel, boolean defaultValue) {
- control(booleanModel, controlsModel, defaultValue, VISIBLE_ADAPTER);
- }
-
- /**
- * Control the <em>visible</em> state of the specified control with the
- * specified boolean. If the boolean is <code>null<code>, the control's
- * <em>visible</em> state will be the specified default value.
- */
- public static void controlVisibleState(PropertyValueModel<Boolean> booleanModel, Control control, boolean defaultValue) {
- control(booleanModel, control, defaultValue, VISIBLE_ADAPTER);
- }
-
- private static final BooleanStateController.Adapter VISIBLE_ADAPTER =
- new BooleanStateController.Adapter() {
- public void setState(Control control, boolean b) {
- control.setVisible(b);
- }
- };
-
-
- // ********** boolean state controller **********
-
- private static void control(PropertyValueModel<Boolean> booleanModel, CollectionValueModel<? extends Control> controlsModel, boolean defaultValue, BooleanStateController.Adapter adapter) {
- // the new controller will add itself as a listener to the value model and the controls
- new MultiControlBooleanStateController(booleanModel, controlsModel, defaultValue, adapter);
- }
-
- private static void control(PropertyValueModel<Boolean> booleanModel, Control control, boolean defaultValue, BooleanStateController.Adapter adapter) {
- // the new controller will add itself as a listener to the value model and the controls
- new SimpleBooleanStateController(booleanModel, control, defaultValue, adapter);
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private SWTTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SimpleBooleanStateController.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SimpleBooleanStateController.java
deleted file mode 100644
index 0b38bb3c1d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/SimpleBooleanStateController.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This controller enables a boolean model to control either the
- * <em>enabled</em> or <em>visible</em> properties of an SWT control; i.e. the
- * control's property is kept in synch with the boolean model,
- * but <em>not</em> vice-versa.
- * <p>
- * Once the control is disposed, this controller is kaput.
- *
- * @see PropertyValueModel
- * @see Control#setEnabled(boolean)
- * @see Control#setVisible(boolean)
- */
-final class SimpleBooleanStateController
- extends BooleanStateController
-{
- private final Control control;
-
-
- // ********** constructor **********
-
- /**
- * Constructor - the boolean model, the control, and the adapter are required.
- */
- SimpleBooleanStateController(
- PropertyValueModel<Boolean> booleanModel,
- Control control,
- boolean defaultValue,
- Adapter adapter
- ) {
- super(booleanModel, defaultValue, adapter);
- if (control == null) {
- throw new NullPointerException();
- }
- this.control = control;
- this.engageBooleanModel();
- this.engageControl(control);
- this.setControlState(control, this.getBooleanValue());
- }
-
-
- // ********** controls **********
-
- @Override
- void setControlState(boolean b) {
- this.setControlState(this.control, b);
- }
-
- @Override
- void controlDisposed(Control c) {
- super.controlDisposed(c);
- this.disengageBooleanModel();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/TextFieldModelBinding.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/TextFieldModelBinding.java
deleted file mode 100644
index 12c0ce1b3e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/utility/swt/TextFieldModelBinding.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.utility.swt;
-
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * This binding can be used to keep a text field
- * synchronized with a model text/string.
- *
- * @see WritablePropertyValueModel
- * @see Text
- */
-@SuppressWarnings("nls")
-class TextFieldModelBinding {
-
- /**
- * The text model we keep synchronized with the text field.
- */
- private final WritablePropertyValueModel<String> textModel;
-
- /**
- * A listener that allows us to synchronize the text field's contents with
- * the text model.
- */
- private final PropertyChangeListener textModelChangeListener;
-
- /**
- * The text field we keep synchronized with the text model.
- */
- private final Text textField;
-
- /**
- * A listener that allows us to synchronize our text model
- * with the text field's contents.
- */
- private final ModifyListener textFieldModifyListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the text field
- * is disposed.
- */
- private final DisposeListener textFieldDisposeListener;
-
- /**
- * Hmm...
- */
- private boolean settingTextFieldText = false;
-
-
- // ********** constructor **********
-
- /**
- * Constructor - the text model and text field are required.
- */
- TextFieldModelBinding(WritablePropertyValueModel<String> textModel, Text textField) {
- super();
- if ((textModel == null) || (textField == null)) {
- throw new NullPointerException();
- }
- this.textModel = textModel;
- this.textField = textField;
-
- this.textModelChangeListener = this.buildTextModelChangeListener();
- this.textModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.textModelChangeListener);
-
- this.textFieldModifyListener = this.buildTextFieldModifyListener();
- this.textField.addModifyListener(this.textFieldModifyListener);
-
- this.textFieldDisposeListener = this.buildTextFieldDisposeListener();
- this.textField.addDisposeListener(this.textFieldDisposeListener);
-
- this.setTextFieldText(textModel.getValue());
- }
-
-
- // ********** initialization **********
-
- private PropertyChangeListener buildTextModelChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildTextModelChangeListener_());
- }
-
- private PropertyChangeListener buildTextModelChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- TextFieldModelBinding.this.textModelChanged(event);
- }
- @Override
- public String toString() {
- return "text listener";
- }
- };
- }
-
- private ModifyListener buildTextFieldModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- TextFieldModelBinding.this.textFieldModified();
- }
- @Override
- public String toString() {
- return "text field modify listener";
- }
- };
- }
-
- private DisposeListener buildTextFieldDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- TextFieldModelBinding.this.textFieldDisposed();
- }
- @Override
- public String toString() {
- return "text field dispose listener";
- }
- };
- }
-
-
- // ********** text model events **********
-
- /* CU private */ void textModelChanged(PropertyChangeEvent event) {
- if ( ! this.textField.isDisposed()) { // ???
- this.setTextFieldText((String) event.getNewValue());
- }
- }
-
- private void setTextFieldText(String text) {
- // the text model can be null, but the text field cannot
- this.setTextFieldText_((text == null) ? "" : text);
- }
-
- private void setTextFieldText_(String text) {
- if ( ! text.equals(this.textField.getText())) { // ???
- this.setTextFieldText__(text);
- }
- }
-
- private void setTextFieldText__(String text) {
- this.settingTextFieldText = true;
- try {
- this.textField.setText(text);
- } finally {
- this.settingTextFieldText = false;
- }
- }
-
-
- // ********** text field events **********
-
- /* CU private */ void textFieldModified() {
- if ( ! this.settingTextFieldText) {
- this.setTextModelText(this.textField.getText());
- }
- }
-
- private void setTextModelText(String text) {
- if ( ! text.equals(this.textModel.getValue())) { // ???
- this.textModel.setValue(text);
- }
- }
-
- /* CU private */ void textFieldDisposed() {
- // the text field is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.textField.removeDisposeListener(this.textFieldDisposeListener);
- this.textField.removeModifyListener(this.textFieldModifyListener);
- this.textModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.textModelChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.textModel);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java
deleted file mode 100644
index 3aefe2adfe..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-/**
- * This implementation of the <code>AddRemovePane</code> uses a <code>Table</code>
- * as its main widget, a <code>List</code> can't be used because it doesn't
- * support showing images. However, the table is displayed like a list.
- * <p>
- * Here the layot of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------- ----------- |
- * | | Item 1 | | Add... | |
- * | | ... | ----------- |
- * | | Item n | ----------- |
- * | | | | Edit... | |
- * | | | ----------- |
- * | | | ----------- |
- * | | | | Remove | |
- * | | | ----------- |
- * | ------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class AddRemoveListPane<T extends Model> extends AddRemovePane<T>
-{
-
- /**
- * The main widget of this add/remove pane.
- */
- private Table table;
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the table holder's items
- */
- public AddRemoveListPane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider) {
-
- super(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider);
- }
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the table holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- public AddRemoveListPane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- super(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
- }
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the table holder's items
- * @param helpId The topic help ID to be registered with this pane
- * @param parentManagePane <code>true</code> to have the parent pane manage
- * the enabled state of this pane
- */
- public AddRemoveListPane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId,
- boolean parentManagePane) {
-
- super(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId,
- parentManagePane);
- }
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the table holder's items
- */
- public AddRemoveListPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider) {
-
- super(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider);
- }
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the table holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- public AddRemoveListPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- super(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
- }
-
- private ColumnAdapter<Object> buildColumnAdapter() {
- return new ColumnAdapter<Object>() {
- public WritablePropertyValueModel<?>[] cellModels(Object subject) {
- WritablePropertyValueModel<?>[] valueHolders = new WritablePropertyValueModel<?>[1];
- valueHolders[0] = new SimplePropertyValueModel<Object>(subject);
- return valueHolders;
- }
-
- public int columnCount() {
- return 1;
- }
-
- public String columnName(int columnIndex) {
- return "";
- }
- };
- }
-
- @Override
- protected void itemsAdded(ListAddEvent e) {
- super.itemsAdded(e);
- revalidateLayout();
- }
-
- @Override
- protected void itemsMoved(ListMoveEvent e) {
- super.itemsMoved(e);
- revalidateLayout();
- }
-
- @Override
- protected void itemsRemoved(ListRemoveEvent e) {
- super.itemsRemoved(e);
- revalidateLayout();
- }
-
- @Override
- protected void itemsReplaced(ListReplaceEvent e) {
- super.itemsReplaced(e);
- revalidateLayout();
- }
-
- @Override
- protected void listChanged(ListChangeEvent e) {
- super.listChanged(e);
- revalidateLayout();
- }
-
- @Override
- protected void listCleared(ListClearEvent e) {
- super.listCleared(e);
- revalidateLayout();
- }
-
- /**
- * Revalidates the table layout after the list of items has changed. The
- * layout has to be done in a new UI thread because our listener might be
- * notified before the table has been updated (table column added or removed).
- */
- private void revalidateLayout() {
- SWTUtil.asyncExec(new Runnable() { public void run() {
- if (!table.isDisposed()) {
- table.getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- table.getParent().layout();
- }
- }});
- }
-
- private PropertyChangeListener buildSelectedItemPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildSelectedItemPropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildSelectedItemPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (table.isDisposed()) {
- return;
- }
- getSelectionModel().setSelectedValue(e.getNewValue());
- updateButtons();
- }
- };
- }
-
- private SelectionChangeListener<Object> buildSelectionListener() {
- return new SelectionChangeListener<Object>() {
- public void selectionChanged(SelectionChangeEvent<Object> e) {
- AddRemoveListPane.this.selectionChanged();
- }
- };
- }
-
- private Composite addTableContainer(Composite container) {
-
- container = addPane(container, buildTableContainerLayout());
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
- return container;
- }
-
- private Layout buildTableContainerLayout() {
- return new Layout() {
- @Override
- protected Point computeSize(Composite composite,
- int widthHint,
- int heightHint,
- boolean flushCache) {
-
- Table table = (Table) composite.getChildren()[0];
- TableColumn tableColumn = table.getColumn(0);
- int columnWidth = tableColumn.getWidth();
- packColumn(table);
-
- // Calculate the table size and adjust it with the hints
- Point size = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- if (widthHint != SWT.DEFAULT) {
- size.x = widthHint;
- }
-
- if (heightHint != SWT.DEFAULT) {
- size.y = heightHint;
- }
-
- // Revert the column's width to its current value
- table.setRedraw(false);
- table.setLayoutDeferred(true);
- tableColumn.setWidth(columnWidth);
- table.setLayoutDeferred(false);
- table.setRedraw(true);
-
- return size;
- }
-
- private boolean isVerticalScrollbarBarVisible(Table table,
- Rectangle clientArea) {
-
- // Get the height of all the rows
- int height = table.getItemCount() * table.getItemHeight();
-
- // Remove the border from the height
- height += (table.getBorderWidth() * 2);
-
- return (clientArea.height < height);
- }
-
- @Override
- protected void layout(Composite composite, boolean flushCache) {
-
- Rectangle bounds = composite.getClientArea();
-
- if (bounds.width > 0) {
-
- Table table = (Table) composite.getChildren()[0];
- table.setBounds(0, 0, bounds.width, bounds.height);
-
- updateTableColumnWidth(
- table,
- bounds.width,
- isVerticalScrollbarBarVisible(table, bounds)
- );
- }
- }
-
- private void packColumn(Table table) {
-
- TableColumn tableColumn = table.getColumn(0);
-
- table.setRedraw(false);
- table.setLayoutDeferred(true);
- tableColumn.pack();
- table.setLayoutDeferred(false);
- table.setRedraw(true);
-
- // Cache the column width so it can be used in
- // updateTableColumnWidth() when determine which width to use
- table.setData(
- "column.width",
- Integer.valueOf(tableColumn.getWidth())
- );
- }
-
- private void updateTableColumnWidth(Table table,
- int width,
- boolean verticalScrollbarBarVisible) {
-
- // Remove the border from the width
- width -= (table.getBorderWidth() * 2);
-
- // Remove the scrollbar from the width if it is shown
- if (verticalScrollbarBarVisible) {
- width -= table.getVerticalBar().getSize().x;
- }
-
- TableColumn tableColumn = table.getColumn(0);
-
- // Retrieve the cached column width, which is required for
- // determining which width to use (the column width or the
- // calculated width)
- Integer columnWitdh = (Integer) table.getData("column.width");
-
- // Use the calculated width if the column is smaller, otherwise
- // use the column width and a horizontal scroll bar will show up
- width = Math.max(width, columnWitdh);
-
- // Adjust the column width
- tableColumn.setWidth(width);
- }
- };
- }
-
- private ITableLabelProvider buildTableLabelProvider(IBaseLabelProvider labelProvider) {
- return new TableLabelProvider((ILabelProvider) labelProvider);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getMainControl() {
- return table;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- @SuppressWarnings("unchecked")
- protected void initializeMainComposite(Composite container,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId) {
-
- table = addUnmanagedTable(
- addTableContainer(container),
- SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI,
- helpId
- );
-
-
- TableModelAdapter model = TableModelAdapter.adapt(
- (ListValueModel<Object>) listHolder,
- getSelectedItemHolder(),
- table,
- buildColumnAdapter(),
- buildTableLabelProvider(labelProvider)
- );
-
- model.addSelectionChangeListener(buildSelectionListener());
-
- selectedItemHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildSelectedItemPropertyChangeListener()
- );
-
- initializeTable(table);
- }
-
- /**
- * Initializes the given table, which acts like a list in our case.
- *
- * @param table The main widget of this pane
- */
- protected void initializeTable(Table table) {
-
- table.setData("column.width", new Integer(0));
- table.setHeaderVisible(false);
- table.setLinesVisible(false);
- }
-
- /**
- * The selection has changed, update (1) the selected item holder, (2) the
- * selection model and (3) the buttons.
- */
- private void selectionChanged() {
- WritablePropertyValueModel<Object> selectedItemHolder = getSelectedItemHolder();
- ObjectListSelectionModel selectionModel = getSelectionModel();
- int selectionCount = this.table.getSelectionCount();
-
- if (selectionCount == 0) {
- selectedItemHolder.setValue(null);
- selectionModel.clearSelection();
- }
- else if (selectionCount != 1) {
- selectedItemHolder.setValue(null);
- selectionModel.clearSelection();
-
- for (int index : this.table.getSelectionIndices()) {
- selectionModel.addSelectionInterval(index, index);
- }
- }
- else {
- int selectedIndex = this.table.getSelectionIndex();
- Object selectedItem = getListHolder().get(selectedIndex);
-
- selectedItemHolder.setValue(selectedItem);
- selectionModel.setSelectedValue(selectedItem);
- }
-
- updateButtons();
- }
-
- /**
- * This label provider simply delegates the rendering to the provided
- * <code>ILabelProvider</code>.
- */
- private class TableLabelProvider extends LabelProvider
- implements ITableLabelProvider {
-
- private ILabelProvider labelProvider;
-
- TableLabelProvider(ILabelProvider labelProvider) {
- super();
- this.labelProvider = labelProvider;
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return labelProvider.getImage(element);
- }
-
- public String getColumnText(Object element, int columnIndex) {
- return labelProvider.getText(element);
- }
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java
deleted file mode 100644
index 79d6175759..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java
+++ /dev/null
@@ -1,923 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Arrays;
-
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The abstract definition of a pane that has buttons for adding, removing and
- * possibly editing the items.
- *
- * @see AddRemoveListPane
- *
- * @version 1.0
- * @since 2.0
- */
-public abstract class AddRemovePane<T extends Model> extends Pane<T>
-{
- private Adapter adapter;
- private Button addButton;
- private Composite container;
- private boolean enabled;
- private IBaseLabelProvider labelProvider;
- private ListValueModel<?> listHolder;
- private Button optionalButton;
- private Button removeButton;
- private WritablePropertyValueModel<Object> selectedItemHolder;
- private ObjectListSelectionModel selectionModel;
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- protected AddRemovePane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider) {
-
- this(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- null);
- }
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- protected AddRemovePane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId) {
-
- this(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId,
- true);
- }
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- * @param parentManagePane <code>true</code> to have the parent pane manage
- * the enabled state of this pane
- */
- protected AddRemovePane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId,
- boolean parentManagePane) {
-
- super(parentPane, parent, true, parentManagePane);
-
- initialize(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider
- );
-
- initializeLayout(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId
- );
- }
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- protected AddRemovePane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider) {
-
- this(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- null);
- }
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- protected AddRemovePane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId) {
-
- super(parentPane, subjectHolder, parent);
-
- initialize(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider
- );
-
- initializeLayout(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId
- );
- }
-
- /**
- * Gives the possibility to add buttons after the Add button and before the
- * optional button.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered with the buttons
- *
- * @category Layout
- */
- protected void addCustomButtonAfterAddButton(Composite container,
- String helpId) {
- }
-
- /**
- * Gives the possibility to add buttons after the optional button and before
- * the Remove button.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered with the buttons
- *
- * @category Layout
- */
- protected void addCustomButtonAfterOptionalButton(Composite container,
- String helpId) {
- }
-
- /**
- * @category Add
- */
- protected void addItem() {
- adapter.addNewItem(selectionModel);
- }
-
- /**
- * @category Initialize
- */
- protected Adapter buildAdapter() {
- return adapter;
- }
-
- /**
- * @category Add
- */
- protected Button addAddButton(Composite parent) {
- return addUnmanagedButton(
- parent,
- adapter.addButtonText(),
- buildAddItemAction()
- );
- }
-
- /**
- * @category Add
- */
- private Runnable buildAddItemAction() {
- return new Runnable() {
- public void run() {
- AddRemovePane.this.addItem();
- }
- };
- }
-
- private ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(buildListChangeListener_());
- }
-
- private ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
-
- public void itemsAdded(ListAddEvent e) {
- AddRemovePane.this.itemsAdded(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- AddRemovePane.this.itemsMoved(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- AddRemovePane.this.itemsRemoved(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- AddRemovePane.this.itemsReplaced(e);
- }
-
- public void listChanged(ListChangeEvent e) {
- AddRemovePane.this.listChanged(e);
- }
-
- public void listCleared(ListClearEvent e) {
- AddRemovePane.this.listCleared(e);
- }
- };
- }
-
- protected void itemsAdded(ListAddEvent e) {
-
- }
-
- protected void itemsMoved(ListMoveEvent e) {
-
- }
-
- protected void itemsRemoved(ListRemoveEvent e) {
- Object selectedItem = this.selectedItemHolder.getValue();
-
- if (selectedItem == null) {
- updateButtons();
- return;
- }
-
- if (CollectionTools.contains(e.getItems(), selectedItem)) {
- this.selectedItemHolder.setValue(null);
- updateButtons();
- }
- }
-
- protected void itemsReplaced(ListReplaceEvent e) {
-
- }
-
- protected void listChanged(ListChangeEvent e) {
-
- }
-
- protected void listCleared(ListClearEvent e) {
- this.selectedItemHolder.setValue(null);
- updateButtons();
- }
-
-
- /**
- * @category Option
- */
- private Runnable buildOptionalAction() {
- return new Runnable() {
- public void run() {
- AddRemovePane.this.editItem();
- }
- };
- }
-
- /**
- * @category Option
- */
- protected Button addOptionalButton(Composite container) {
- return addUnmanagedButton(
- container,
- adapter.optionalButtonText(),
- buildOptionalAction()
- );
- }
-
- /**
- * @category Add
- */
- protected Button addRemoveButton(Composite parent) {
- return addUnmanagedButton(
- parent,
- adapter.removeButtonText(),
- buildRemoveItemsAction()
- );
- }
-
- /**
- * @category Remove
- */
- private Runnable buildRemoveItemsAction() {
- return new Runnable() {
- public void run() {
- AddRemovePane.this.removeItems();
- }
- };
- }
-
- protected ObjectListSelectionModel buildRowSelectionModel(ListValueModel<?> listModel) {
- return new ObjectListSelectionModel(new ListModelAdapter(listModel));
- }
-
- /**
- * @category Option
- */
- protected void editItem() {
- this.adapter.optionOnSelection(getSelectionModel());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
-
- super.enableWidgets(enabled);
- this.enabled = enabled;
-
- if (!this.getMainControl().isDisposed()) {
- this.getMainControl().setEnabled(enabled);
- }
-
- this.updateButtons();
- }
-
- protected final Composite getContainer() {
- return container;
- }
-
- protected IBaseLabelProvider getLabelProvider() {
- return labelProvider;
- }
-
- protected final ListValueModel<?> getListHolder() {
- return listHolder;
- }
-
- /**
- * Returns
- *
- * @return
- */
- public abstract Composite getMainControl();
-
- protected final WritablePropertyValueModel<Object> getSelectedItemHolder() {
- return selectedItemHolder;
- }
-
- public final ObjectListSelectionModel getSelectionModel() {
- return selectionModel;
- }
-
- /**
- * Initializes this add/remove pane.
- *
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- *
- * @category Initialization
- */
- @SuppressWarnings("unchecked")
- protected void initialize(Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider)
- {
- this.listHolder = listHolder;
- this.labelProvider = labelProvider;
- this.adapter = (adapter == null) ? buildAdapter() : adapter;
- this.selectedItemHolder = (WritablePropertyValueModel<Object>) selectedItemHolder;
- this.selectionModel = new ObjectListSelectionModel(new ListModelAdapter(listHolder));
-
- this.listHolder.addListChangeListener(
- ListValueModel.LIST_VALUES,
- buildListChangeListener()
- );
- }
-
- /**
- * Initializes the pane containing the buttons (Add, optional (if required)
- * and Remove).
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered with the buttons
- *
- * @category Layout
- */
- protected void initializeButtonPane(Composite container, String helpId) {
-
- container = addSubPane(container);
-
- GridData gridData = new GridData();
- gridData.grabExcessVerticalSpace = true;
- gridData.verticalAlignment = SWT.TOP;
- container.setLayoutData(gridData);
-
- // Add button
- this.addButton = addAddButton(container);
- addAlignRight(this.addButton);
-
- // Custom button
- addCustomButtonAfterAddButton(container, helpId);
-
- // Optional button
- if (this.adapter.hasOptionalButton()) {
- this.optionalButton = addOptionalButton(container);
- addAlignRight(this.optionalButton);
- }
-
- // Custom button
- addCustomButtonAfterOptionalButton(container, helpId);
-
- // Remove button
- removeButton = addRemoveButton(container);
- addAlignRight(removeButton);
-
- // Update the help topic ID
- if (helpId != null) {
- getHelpSystem().setHelp(addButton, helpId);
- getHelpSystem().setHelp(removeButton, helpId);
-
- if (optionalButton != null) {
- getHelpSystem().setHelp(optionalButton, helpId);
- }
- }
- }
-
- /**
- * Initializes this add/remove pane by creating the widgets. The subclass is
- * required to build the main widget.
- *
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- *
- * @category Layout
- */
- protected void initializeLayout(Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId) {
-
- initializeMainComposite(
- container,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
-
- initializeButtonPane(container, helpId);
- enableWidgets(getSubject() != null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeLayout(Composite container) {
- this.container = addSubPane(container, 2, 0, 0, 0, 0);
- }
-
- /**
- * Initializes the main widget of this add/remove pane.
- *
- * @param container The parent container
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane or
- * <code>null</code> if it was not specified
- *
- * @category Layout
- */
- protected abstract void initializeMainComposite(Composite container,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId);
-
- /**
- * @category Remove
- */
- protected void removeItems() {
-
- // Keep track of the selected indices so we can select an item
- // before the lowest index
- int[] indices = selectionModel.selectedIndices();
- Arrays.sort(indices);
-
- // Notify the adapter to remove the selected items
- adapter.removeSelectedItems(selectionModel);
-
- // Select a new item
- if (getListHolder().size() > 0) {
- int index = Math.min(indices[0], getListHolder().size() - 1);
- Object item = getListHolder().get(index);
- selectedItemHolder.setValue(item);
- }
- // The list is empty, clear the value
- else {
- selectedItemHolder.setValue(null);
- }
- }
-
- /**
- * Selects the given value, which can be <code>null</code>.
- *
- * @param value The new selected value
- */
- public void setSelectedItem(Object value) {
- selectedItemHolder.setValue(value);
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateAddButton(Button addButton) {
- addButton.setEnabled(enabled);
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateButtons() {
- if (!container.isDisposed()) {
- updateAddButton(addButton);
- updateRemoveButton(removeButton);
- updateOptionalButton(optionalButton);
- }
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateOptionalButton(Button optionalButton) {
- if (optionalButton != null) {
- optionalButton.setEnabled(
- enabled &&
- adapter.enableOptionOnSelectionChange(selectionModel)
- );
- }
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateRemoveButton(Button removeButton) {
- removeButton.setEnabled(
- enabled &&
- adapter.enableRemoveOnSelectionChange(selectionModel)
- );
- }
-
- /**
- * An abstract implementation of <code>Adapter</code>.
- */
- public static abstract class AbstractAdapter implements Adapter {
-
- /**
- * The text of the add button.
- */
- private String addButtonText;
-
- /**
- * Determines whether the optional button should be shown or not.
- */
- private boolean hasOptionalButton;
-
- /**
- * The text of the optional button, if used.
- */
- private String optionalButtonText;
-
- /**
- * The text of the remove button.
- */
- private String removeButtonText;
-
- /**
- * Creates a new <code>AbstractAdapter</code> with default text for the
- * add and remove buttons.
- */
- public AbstractAdapter() {
- this(JptCommonUiMessages.AddRemovePane_AddButtonText,
- JptCommonUiMessages.AddRemovePane_RemoveButtonText);
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code> with default text for the
- * add and remove buttons.
- *
- * @param hasOptionalButton <code>true</code> to show an optional button
- * and to use the behavior related to the optional button;
- * <code>false</code> to not use it
- */
- public AbstractAdapter(boolean hasOptionalButton) {
- this();
- this.setHasOptionalButton(hasOptionalButton);
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code> with default text for the
- * add and remove buttons.
- *
- * @param optionalButtonText The text of the optional button, which means
- * the optional button will be shown
- */
- public AbstractAdapter(String optionalButtonText) {
- this(true);
- this.setOptionalButtonText(optionalButtonText);
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code>.
- *
- * @param addButtonText The add button's text
- * @param removeButtonText The remove button's text
- */
- public AbstractAdapter(String addButtonText,
- String removeButtonText) {
-
- super();
- this.addButtonText = addButtonText;
- this.removeButtonText = removeButtonText;
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code>.
- *
- * @param addButtonText The add button's text
- * @param removeButtonText The remove button's text
- * @param optionalButtonText The text of the optional button, which means
- * the optional button will be shown
- */
- public AbstractAdapter(String addButtonText,
- String removeButtonText,
- String optionalButtonText) {
-
- this(optionalButtonText);
- this.setAddButtonText(addButtonText);
- this.setRemoveButtonText(removeButtonText);
- }
-
- /*
- * (non-Javadoc)
- */
- public String addButtonText() {
- return addButtonText;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean enableOptionOnSelectionChange(ObjectListSelectionModel listSelectionModel) {
- return listSelectionModel.selectedValuesSize() == 1;
- }
-
- public boolean enableRemoveOnSelectionChange(ObjectListSelectionModel listSelectionModel) {
- return listSelectionModel.selectedValue() != null;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean hasOptionalButton() {
- return hasOptionalButton;
- }
-
- /*
- * (non-Javadoc)
- */
- public String optionalButtonText() {
- return optionalButtonText;
- }
-
- /*
- * (non-Javadoc)
- */
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- }
-
- /*
- * (non-Javadoc)
- */
- public String removeButtonText() {
- return removeButtonText;
- }
-
- /**
- * Changes the text of the add button. This method has to be called before
- * the <code>AddRemoveListPane</code> is initialized.
- *
- * @param addButtonText The add button's text
- */
- public void setAddButtonText(String addButtonText) {
- this.addButtonText = addButtonText;
- }
-
- /**
- * Changes the state of the optional button, meaning if it should be shown
- * between the add and remove buttons or not.
- *
- * @param hasOptionalButton <code>true</code> to show an optional button
- * and to use the behavior related to the optional button;
- * <code>false</code> to not use it
- */
- public void setHasOptionalButton(boolean hasOptionalButton) {
- this.hasOptionalButton = hasOptionalButton;
- }
-
- /**
- * Changes the text of the optional button. This method has to be called
- * before the <code>AddRemoveListPane</code> is initialized. This does not
- * make the optional button visible.
- *
- * @param optionalButtonText The optional button's text
- */
- public void setOptionalButtonText(String optionalButtonText) {
- this.optionalButtonText = optionalButtonText;
- }
-
- /**
- * Changes the text of the remove button. This method has to be called
- * before the <code>AddRemoveListPane</code> is initialized.
- *
- * @param removeButtonText The remove button's text
- */
- public void setRemoveButtonText(String removeButtonText) {
- this.removeButtonText = removeButtonText;
- }
- }
-
- /**
- * This adapter is used to perform the actual action when adding a new item
- * or removing the selected items. It is possible to add an optional button.
- */
- public static interface Adapter {
-
- /**
- * The add button's text.
- *
- * @return The text shown on the add button
- */
- String addButtonText();
-
- /**
- * Invoked when the user selects the Add button.
- */
- void addNewItem(ObjectListSelectionModel listSelectionModel);
-
- /**
- * Invoked when selection changes. Implementation dictates whether button
- * should be enabled.
- */
- boolean enableOptionOnSelectionChange(ObjectListSelectionModel listSelectionModel);
-
- /**
- * Invoked when selection changes. Implementation dictates whether remove button
- * should be enabled.
- */
- boolean enableRemoveOnSelectionChange(ObjectListSelectionModel listSelectionModel);
-
- /**
- * Determines whether an optional button should be added between the add
- * and remove buttons.
- *
- * @return <code>true</code> to show an optional button and to use the
- * behavior related to the optional button; <code>false</code> to not use
- * it
- */
- boolean hasOptionalButton();
-
- /**
- * Resource string key for the optional button.
- */
- String optionalButtonText();
-
- /**
- * Invoked when the user selects the optional button
- */
- void optionOnSelection(ObjectListSelectionModel listSelectionModel);
-
- /**
- * The remove button's text.
- *
- * @return The text shown on the remove button
- */
- String removeButtonText();
-
- /**
- * Invoked when the user selects the Remove button.
- */
- void removeSelectedItems(ObjectListSelectionModel listSelectionModel);
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveTablePane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveTablePane.java
deleted file mode 100644
index 05a7eda6be..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveTablePane.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-
-/**
- * This implementation of the <code>AddRemovePane</code> uses a <code>Table</code>
- * as its main widget.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------- ----------- |
- * | | Column 1 | Column 2 | ... | Column i | ... | Colunm n | | Add... | |
- * | |-----------------------------------------------------------| ----------- |
- * | | | | | | | | ----------- |
- * | |-----------------------------------------------------------| | Edit... | |
- * | | | | | | | | ----------- |
- * | |-----------------------------------------------------------| ----------- |
- * | | | | | | | | | Remove | |
- * | |-----------------------------------------------------------| ----------- |
- * | ------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class AddRemoveTablePane<T extends Model> extends AddRemovePane<T>
-{
- /**
- * Flag used to prevent circular
- */
- private boolean locked;
-
- /**
- * The main widget of this add/remove pane.
- */
- private Table table;
-
- /**
- * Creates a new <code>AddRemoveTablePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- public AddRemoveTablePane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ITableLabelProvider labelProvider) {
-
- super(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider);
-
- }
-
- /**
- * Creates a new <code>AddRemoveTablePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- public AddRemoveTablePane(Pane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ITableLabelProvider labelProvider,
- String helpId) {
-
- super(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
- }
-
- /**
- * Creates a new <code>AddRemoveTablePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- public AddRemoveTablePane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ITableLabelProvider labelProvider) {
-
- super(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider);
- }
-
- /**
- * Creates a new <code>AddRemoveTablePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- public AddRemoveTablePane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ITableLabelProvider labelProvider,
- String helpId) {
-
- super(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
- }
-
- protected abstract ColumnAdapter<?> buildColumnAdapter();
-
- private WritablePropertyValueModel<Object> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<Object>();
- }
-
- private PropertyChangeListener buildSelectedItemPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildSelectedItemPropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildSelectedItemPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (table.isDisposed()) {
- return;
- }
-
- if (!locked) {
- locked = true;
-
- try {
- Object value = e.getNewValue();
- getSelectionModel().setSelectedValue(e.getNewValue());
- int index = -1;
-
- if (value != null) {
- index = CollectionTools.indexOf(getListHolder().iterator(), value);
- }
-
- table.select(index);
- updateButtons();
- }
- finally {
- locked = false;
- }
- }
- }
- };
- }
-
- private SelectionChangeListener<Object> buildSelectionListener() {
- return new SelectionChangeListener<Object>() {
- public void selectionChanged(SelectionChangeEvent<Object> e) {
- AddRemoveTablePane.this.selectionChanged();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getMainControl() {
- return table;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- @SuppressWarnings("unchecked")
- protected void initializeMainComposite(Composite container,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId)
- {
- table = addUnmanagedTable(container, helpId);
- table.setHeaderVisible(true);
-
- TableModelAdapter<Object> tableModel = TableModelAdapter.adapt(
- (ListValueModel<Object>) listHolder,
- buildSelectedItemHolder(),
- table,
- (ColumnAdapter<Object>) buildColumnAdapter(),
- (ITableLabelProvider) labelProvider
- );
-
- tableModel.addSelectionChangeListener(buildSelectionListener());
-
- selectedItemHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildSelectedItemPropertyChangeListener()
- );
- }
-
- /**
- * The selection has changed, update (1) the selected item holder, (2) the
- * selection model and (3) the buttons.
- */
- private void selectionChanged() {
-
- if (locked) {
- return;
- }
-
- locked = true;
-
- try {
- WritablePropertyValueModel<Object> selectedItemHolder = getSelectedItemHolder();
- ObjectListSelectionModel selectionModel = getSelectionModel();
- int selectionCount = table.getSelectionCount();
-
- if (selectionCount == 0) {
- selectedItemHolder.setValue(null);
- selectionModel.clearSelection();
- }
- else if (selectionCount != 1) {
- selectedItemHolder.setValue(null);
- selectionModel.clearSelection();
-
- for (int index : table.getSelectionIndices()) {
- selectionModel.addSelectionInterval(index, index);
- }
- }
- else {
- int selectedIndex = table.getSelectionIndex();
- Object selectedItem = getListHolder().get(selectedIndex);
-
- selectedItemHolder.setValue(selectedItem);
- selectionModel.setSelectedValue(selectedItem);
- }
-
- updateButtons();
- }
- finally {
- locked = false;
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java
deleted file mode 100644
index a652562257..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A chooser is simply a pane with three widgets, the label on the left, a main
- * widget, usually a text field, and a right widget which is usually a browse
- * button.
- *
- * @see ClassChooserPane
- * @see PackageChooserPane
- *
- * @version 3.0
- * @since 2.0
- */
-public abstract class ChooserPane<T extends Model> extends Pane<T>
-{
- /**
- * The control shown after the label (left control).
- */
- private Control mainControl;
-
- /**
- * The control shown after the main control.
- */
- private Control rightControl;
-
- /**
- * Creates a new <code>ChooserPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public ChooserPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>ChooserPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public ChooserPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.mainControl = addMainControl(container);
- this.rightControl = addRightControl(container);
-
- addLabeledComposite(
- container,
- addLeftControl(container),
- this.mainControl,
- this.rightControl,
- getHelpId()
- );
- }
-
- /**
- * Creates the left control. By default a label is created and its text is
- * retrieved by {@link #getLabelText()}.
- *
- * @param container The parent container
- * @return The newly created left control
- */
- protected Control addLeftControl(Composite container) {
- return addLabel(container, getLabelText());
- }
-
- /**
- * The text of the label. This method is called by
- * {@link #buildLeftControl(Composite)}.
- *
- * @return The localized text of the left control (which is a label by
- * default)
- */
- protected abstract String getLabelText();
-
- /**
- * Creates the main control of this pane.
- *
- * @param container The parent container
- * @return The newly created main control
- */
- protected abstract Control addMainControl(Composite container);
-
- /**
- * Creates the right control. By default a browse button is created and its
- * action is performed by {@link #buildBrowseAction()} and its text is
- * retrieved by {@link #getBrowseButtonText()}.
- *
- * @param container The parent container
- * @return The newly created right control
- */
- protected Control addRightControl(Composite container) {
- return addButton(
- container,
- getBrowseButtonText(),
- buildBrowseAction()
- );
- }
-
- /**
- * Returns the text of the browse button. This method is called by
- * {@link #buildRightControl(Composite)}.
- *
- * @return "Browse..."
- */
- protected String getBrowseButtonText() {
- return JptCommonUiMessages.ChooserPane_browseButton;
- }
-
- /**
- * Creates the action responsible to perform the action when the Browse is
- * clicked.
- *
- * @return A new <code>Runnable</code> performing the actual action of the
- * button
- */
- protected abstract Runnable buildBrowseAction();
-
- /**
- * Returns the help topic ID for the controls of this pane.
- *
- * @return <code>null</code> is returned otherwise the subclass can return an ID
- */
- protected String getHelpId() {
- return null;
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
-
- super.enableWidgets(enabled);
-
- if (!this.mainControl.isDisposed()) {
- this.mainControl.setEnabled(enabled);
- }
-
- if (!this.rightControl.isDisposed()) {
- this.rightControl.setEnabled(enabled);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserComboPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserComboPane.java
deleted file mode 100644
index f50eb3b64f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserComboPane.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This chooser allows the user to choose a type when browsing and it adds code
- * completion support to the text field, which is the main component.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- ------------- |
- * | Label: | I X | | Browse... | |
- * | ---------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class ClassChooserComboPane<T extends Model> extends ClassChooserPane<T>
-{
-
- /**
- * Creates a new <code>ClassChooserPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public ClassChooserComboPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>ClassChooserPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public ClassChooserComboPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected Control addMainControl(Composite container) {
- Composite subPane = addSubPane(container);
- Combo combo = this.addClassCombo(subPane);
-
- ControlContentAssistHelper.createComboContentAssistant(
- combo,
- javaTypeCompletionProcessor
- );
-
- return subPane;
- }
-
- protected Combo addClassCombo(Composite container) {
- return this.addEditableCombo(
- container,
- this.buildClassListHolder(),
- this.buildTextHolder(),
- this.buildClassConverter()
- );
- }
-
- protected abstract ListValueModel<String> buildClassListHolder();
-
- protected StringConverter<String> buildClassConverter() {
- return StringConverter.Default.instance();
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java
deleted file mode 100644
index e2eb246e3e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
-import org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.ui.JptCommonUiPlugin;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-
-/**
- * This chooser allows the user to choose a type when browsing and it adds code
- * completion support to the text field, which is the main component.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- ------------- |
- * | Label: | I | | Browse... | |
- * | ---------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.3
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class ClassChooserPane<T extends Model> extends ChooserPane<T>
-{
- /**
- * The code completion manager.
- */
- protected JavaTypeCompletionProcessor javaTypeCompletionProcessor;
-
- private PropertyChangeListener subjectChangeListener;
-
- /**
- * Creates a new <code>ClassChooserPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public ClassChooserPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>ClassChooserPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public ClassChooserPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
-
- // TODO bug 156185 - when this is fixed there should be api for this
- this.javaTypeCompletionProcessor = new JavaTypeCompletionProcessor(false, false);
-
- this.subjectChangeListener = this.buildSubjectChangeListener();
- this.getSubjectHolder().addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
-
- this.classChooserSubjectChanged(getSubject());
- }
-
- private PropertyChangeListener buildSubjectChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSubjectChangeListener_());
- }
-
- private PropertyChangeListener buildSubjectChangeListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent e) {
- ClassChooserPane.this.classChooserSubjectChanged((T) e.getNewValue());
- }
- };
- }
-
- protected void classChooserSubjectChanged(T newSubject) {
- IPackageFragment packageFragment = null;
- if (newSubject != null) {
- IPackageFragmentRoot root = getPackageFragmentRoot();
- if (root != null) {
- packageFragment = root.getPackageFragment("");
- }
- }
- this.javaTypeCompletionProcessor.setPackageFragment(packageFragment);
- }
-
- @Override
- protected Control addLeftControl(Composite container) {
- if( ! this.allowTypeCreation()) {
- return super.addLeftControl(container);
- }
- Hyperlink labelLink = this.addHyperlink(container,
- this.getLabelText(),
- this.buildHyperLinkAction()
- );
- return labelLink;
- }
-
- private Runnable buildHyperLinkAction() {
- return new Runnable() {
- public void run() {
- ClassChooserPane.this.hyperLinkSelected();
- }
- };
- }
-
- protected void hyperLinkSelected() {
- IType type = getType();
- if (type != null) {
- openInEditor(type);
- }
- else if (allowTypeCreation()){
- createType();
- }
- }
-
- protected IType getType() {
- if (getClassName() == null) {
- return null;
- }
- IType type = null;
- try {
- type = getJavaProject().findType(getClassName().replace('$', '.'));
- }
- catch (JavaModelException e) {
- JptCommonUiPlugin.log(e);
- }
- return type;
- }
-
- protected void createType() {
- StructuredSelection selection = new StructuredSelection(getJavaProject().getProject());
-
- NewClassWizardPage newClassWizardPage = new NewClassWizardPage();
- newClassWizardPage.init(selection);
- newClassWizardPage.setSuperClass(getSuperclassName(), true);
- newClassWizardPage.setSuperInterfaces(getSuperInterfaceNames(), true);
- if (!StringTools.stringIsEmpty(getClassName())) {
- newClassWizardPage.setTypeName(ClassName.getSimpleName(getClassName()), true);
- String packageName = ClassName.getPackageName(getClassName());
- newClassWizardPage.setPackageFragment(getFirstJavaSourceFolder().getPackageFragment(packageName), true);
- }
- NewClassCreationWizard wizard = new NewClassCreationWizard(newClassWizardPage, false);
- wizard.init(PlatformUI.getWorkbench(), selection);
-
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.create();
- int dResult = dialog.open();
- if (dResult == Window.OK) {
- String className = (newClassWizardPage.getCreatedType()).getFullyQualifiedName(getEnclosingTypeSeparator());
- setClassName(className);
- }
- }
-
- protected abstract void setClassName(String className);
-
- /**
- * Override this to change the enclosing type separator
- */
- protected char getEnclosingTypeSeparator() {
- return '$';
- }
-
- /**
- * Override this to set a superclass in the New Class wizard. If no class is chosen,
- * clicking the hyperlink label will open the new class wizard.
- */
- protected String getSuperclassName() {
- return "";
- }
-
- /**
- * Override this to set a super interface in the New Class wizard. If no class is chosen,
- * clicking the hyperlink label will open the new class wizard.
- * @see getSuperInterfaceName
- */
- protected List<String> getSuperInterfaceNames() {
- return getSuperInterfaceName() != null ? Collections.singletonList(getSuperInterfaceName()) : Collections.<String>emptyList();
- }
-
- /**
- * Override this to set a super interface in the New Class wizard. If no class is chosen,
- * clicking the hyperlink label will open the new class wizard.
- */
- protected String getSuperInterfaceName() {
- return null;
- }
-
- /**
- * Override this if it does not make sense to allow the user to create a new type.
- * This will determine whether clicking the hyperlink opens the New Class wizard
- * @return
- */
- protected boolean allowTypeCreation() {
- return true;
- }
-
- protected void openInEditor(IType type) {
- IJavaElement javaElement = type.getParent();
- try {
- JavaUI.openInEditor(javaElement, true, true);
- }
- catch (JavaModelException e) {
- JptCommonUiPlugin.log(e);
- }
- catch (PartInitException e) {
- JptCommonUiPlugin.log(e);
- }
- }
-
- protected abstract IJavaProject getJavaProject();
-
- @Override
- protected final Runnable buildBrowseAction() {
- return new Runnable() {
- public void run() {
- promptType();
- }
- };
- }
-
- @Override
- protected Control addMainControl(Composite container) {
- Composite subPane = addSubPane(container);
- Text text = addText(subPane, buildTextHolder());
-
- ControlContentAssistHelper.createTextContentAssistant(
- text,
- javaTypeCompletionProcessor
- );
-
- return subPane;
- }
-
- /**
- * Creates the value holder of the subject's property.
- *
- * @return The holder of the class name
- */
- protected abstract WritablePropertyValueModel<String> buildTextHolder();
-
- /**
- * Prompts the user the Open Type dialog.
- *
- * @return Either the selected type or <code>null</code> if the user
- * cancelled the dialog
- */
- protected IType chooseType() {
- IJavaElement[] elements = new IJavaElement[] { getJavaProject() };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- PlatformUI.getWorkbench().getProgressService(),
- scope,
- getTypeDialogStyle(),
- false,
- StringTools.stringIsEmpty(getClassName()) ? "" : ClassName.getSimpleName(getClassName())
- );
- }
- catch (JavaModelException e) {
- JptCommonUiPlugin.log(e);
- return null;
- }
-
- typeSelectionDialog.setTitle(JptCommonUiMessages.ClassChooserPane_dialogTitle);
- typeSelectionDialog.setMessage(JptCommonUiMessages.ClassChooserPane_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- protected int getTypeDialogStyle() {
- return IJavaElementSearchConstants.CONSIDER_CLASSES;
- }
-
- /**
- * Returns the class name from its subject.
- *
- * @return The class name or <code>null</code> if none is defined
- */
- protected abstract String getClassName();
-
- protected IPackageFragmentRoot getFirstJavaSourceFolder() {
- Iterator<IPackageFragmentRoot> i = JDTTools.getJavaSourceFolders(getJavaProject()).iterator();
- return i.hasNext() ? i.next() : null;
- }
-
- /**
- * The browse button was clicked, its action invokes this action which should
- * prompt the user to select a class and set it.
- */
- protected void promptType() {
- IType type = this.chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName(getEnclosingTypeSeparator());
- setClassName(className);
- }
- }
-
- protected IPackageFragmentRoot getPackageFragmentRoot() {
- try {
- return this.getJavaProject().getPackageFragmentRoots()[0];
- } catch (JavaModelException ex) {
- JptCommonUiPlugin.log(ex);
- return null;
- }
- }
-
- @Override
- public void dispose() {
- this.getSubjectHolder().removePropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- super.dispose();
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ComboPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ComboPane.java
deleted file mode 100644
index 4046ed13ba..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ComboPane.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Pane with combo box support for automatic updating of:
- * - selected value
- * - default value
- * - value choices
- */
-public abstract class ComboPane<T extends Model>
- extends Pane<T>
-{
- /**
- * The main (only) widget of this pane.
- */
- protected Combo comboBox;
-
-
- // **************** constructors ******************************************
-
- protected ComboPane(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- protected ComboPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- protected ComboPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- PropertyValueModel<Boolean> enabledModel) {
-
- super(parentPane, subjectHolder, parent, enabledModel);
- }
-
-
- // **************** initialization ****************************************
-
- @Override
- protected void initializeLayout(Composite container) {
- this.comboBox = this.addEditableCombo(container);
- this.comboBox.addModifyListener(this.buildModifyListener());
- SWTUtil.attachDefaultValueHandler(this.comboBox);
- }
-
- protected ModifyListener buildModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- ComboPane.this.comboBoxModified();
- }
- };
- }
-
-
- // **************** typical overrides *************************************
-
- /**
- * Return the possible values to be added to the combo during
- * population.
- */
- protected abstract Iterable<String> getValues();
-
- /**
- * Return whether the combo is to add a default value to the choices
- */
- protected boolean usesDefaultValue() {
- // default response is 'true'
- return true;
- }
-
- /**
- * Return the default value, or <code>null</code> if no default is
- * specified. This method is only called when the subject is non-null.
- */
- protected abstract String getDefaultValue();
-
- /**
- * Return the current value from the subject.
- * This method is only called when the subject is non-null.
- */
- protected abstract String getValue();
-
- /**
- * Set the specified value as the new value on the subject.
- */
- protected abstract void setValue(String value);
-
-
- // **************** overrides *********************************************
-
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
- this.updateSelectedItem();
- }
-
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.populateComboBox();
- }
-
-
- // **************** populating ********************************************
-
- /**
- * Populate the combo-box list by clearing it, then adding first the default
- * value, if available, and then the possible choices.
- */
- protected void populateComboBox() {
- this.comboBox.removeAll();
-
- if (usesDefaultValue()) {
- this.comboBox.add(this.buildDefaultValueEntry());
- }
-
- for (String value : this.getValues()) {
- this.comboBox.add(value);
- }
-
- this.updateSelectedItem_();
- }
-
- protected String buildDefaultValueEntry() {
- if (getSubject() == null) {
- return JptCommonUiMessages.NoneSelected;
- }
- String defaultValue = this.getDefaultValue();
- return (defaultValue == null) ? this.buildNullDefaultValueEntry() : this.buildNonNullDefaultValueEntry(defaultValue);
- }
-
- protected String buildNullDefaultValueEntry() {
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- protected String buildNonNullDefaultValueEntry(String defaultValue) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue);
- }
-
- protected void updateSelectedItem() {
- // make sure the default value is up to date (??? ~bjv)
- if (usesDefaultValue()) {
- String defaultValueEntry = this.buildDefaultValueEntry();
- if ( ! this.comboBox.getItem(0).equals(defaultValueEntry)) {
- this.comboBox.remove(0);
- this.comboBox.add(defaultValueEntry, 0);
- }
- }
-
- this.updateSelectedItem_();
- }
-
- /**
- * Updates the selected item by selecting the current value, if not
- * <code>null</code>, or select the default value if one is available,
- * otherwise remove the selection.
- */
- protected void updateSelectedItem_() {
- String value = (this.getSubject() == null) ? null : this.getValue();
- if (value == null) {
- if (usesDefaultValue()) {
- // select the default value
- this.comboBox.select(0);
- }
- else {
- this.comboBox.setText("");
- }
- } else {
- // select the new value
- if ( ! value.equals(this.comboBox.getText())) {
- // This prevents the cursor from being set back to the beginning of the line (bug 234418).
- // The reason we are hitting this method at all is because the
- // context model is updating from the resource model in a way
- // that causes change notifications to be fired (the annotation
- // is added to the resource model, change notification occurs
- // on the update thread, and then the name is set, these 2
- // threads can get in the wrong order).
- // The #valueChanged() method sets the populating flag to true,
- // but in this case it is already set back to false when we
- // receive notification back from the model because it has
- // moved to the update thread and then jumps back on the UI thread.
- this.comboBox.setText(value);
- }
- }
- }
-
- protected void repopulateComboBox() {
- if ( ! this.comboBox.isDisposed()) {
- this.repopulate();
- }
- }
-
-
- // **************** combo-box listener callback ***************************
-
- protected void comboBoxModified() {
- if ( ! this.isPopulating()) {
- this.valueChanged(this.comboBox.getText());
- }
- }
-
- /**
- * The combo-box selection has changed, update the model if necessary.
- * If the value has changed and the subject is null, we can build a subject
- * before setting the value.
- */
- protected void valueChanged(String newValue) {
- T subject = this.getSubject();
- String oldValue;
- if (subject == null) {
- if (this.nullSubjectIsNotAllowed()) {
- return; // no subject to set the value on
- }
- oldValue = null;
- } else {
- oldValue = this.getValue();
- }
-
- // convert empty string or default to null
- if (StringTools.stringIsEmpty(newValue) || this.valueIsDefault(newValue)) {
- newValue = null;
- }
-
- // set the new value if it is different from the old value
- if (Tools.valuesAreDifferent(oldValue, newValue)) {
- this.setPopulating(true);
-
- try {
- this.setValue(newValue);
- } finally {
- this.setPopulating(false);
- }
- }
- }
-
- /**
- * Return whether we can set the value when the subject is null
- * (i.e. #setValue(String) will construct the subject if necessary).
- */
- protected boolean nullSubjectIsAllowed() {
- return false;
- }
-
- protected final boolean nullSubjectIsNotAllowed() {
- return ! this.nullSubjectIsAllowed();
- }
-
- /**
- * pre-condition: value is not null
- */
- protected boolean valueIsDefault(String value) {
- if (! usesDefaultValue()) {
- return false;
- }
- return (this.comboBox.getItemCount() > 0)
- && value.equals(this.comboBox.getItem(0));
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java
deleted file mode 100644
index 97f4dc388c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DateTime;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-/**
- * This <code>WidgetFactory</code> simply creates plain SWT widgets.
- *
- * @version 2.0
- * @since 2.0
- */
-public class DefaultWidgetFactory implements WidgetFactory {
-
- /**
- * The singleton instance of this <code>IWidgetFactory</code>
- */
- private static final WidgetFactory INSTANCE = new DefaultWidgetFactory();
-
- /**
- * Creates a new <code>DefaultWidgetFactory</code>.
- */
- private DefaultWidgetFactory() {
- super();
- }
-
- /**
- * Returns the singleton instance of this <code>IWidgetFactory</code>.
- *
- * @return The singleton instance of this <code>IWidgetFactory</code>
- */
- public static WidgetFactory instance() {
- return INSTANCE;
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.NULL);
- }
-
- /**
- * Creates a new button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param style The style to apply to the button, which determines its type:
- * toggle, push, check box, radio
- * @return The newly created <code>Button</code>
- */
- private Button createButton(Composite parent, String text, int style) {
- Button button = new Button(parent, style);
- button.setText(text);
- return button;
- }
-
- /**
- * {@inheritDoc}
- */
- @Deprecated
- public CCombo createCCombo(Composite parent) {
- return new CCombo(parent, SWT.BORDER | SWT.READ_ONLY);
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createCheckBox(Composite parent, String text) {
- return this.createButton(parent, text, SWT.CHECK);
- }
-
- /**
- * {@inheritDoc}
- */
- public Combo createCombo(Composite parent) {
- return new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- }
-
- /**
- * {@inheritDoc}
- */
- public Composite createComposite(Composite parent) {
- return new Composite(parent, SWT.NULL);
- }
-
- /**
- * {@inheritDoc}
- */
- public DateTime createDateTime(Composite parent, int style) {
- return new DateTime(parent, style);
- }
-
- /**
- * {@inheritDoc}
- */
- @Deprecated
- public CCombo createEditableCCombo(Composite parent) {
- return new CCombo(parent, SWT.BORDER);
- }
-
- /**
- * {@inheritDoc}
- */
- public Combo createEditableCombo(Composite parent) {
- return new Combo(parent, SWT.BORDER);
- }
-
- /**
- * {@inheritDoc}
- */
- public Group createGroup(Composite parent, String title) {
- Group group = new Group(parent, SWT.NULL);
- group.setText(title);
- return group;
- }
-
- /**
- * {@inheritDoc}
- */
- public Hyperlink createHyperlink(Composite parent, String text) {
- Hyperlink hyperlink = new Hyperlink(parent, SWT.NULL);
- hyperlink.setText(text);
- return hyperlink;
- }
-
- /**
- * {@inheritDoc}
- */
- public Label createLabel(Composite parent, String labelText) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(labelText);
- return label;
- }
-
- /**
- * {@inheritDoc}
- */
- public List createList(Composite parent, int style) {
- return new List(parent, SWT.BORDER | style);
- }
-
- /**
- * {@inheritDoc}
- */
- public FormText createMultiLineLabel(Composite parent, String labelText) {
-
- Composite container = new Composite(parent, SWT.NONE);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- container.setLayoutData(gridData);
-
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 1;
- layout.bottomMargin = 0;
- layout.leftMargin = 0;
- layout.rightMargin = 0;
- layout.topMargin = 0;
- container.setLayout(layout);
-
- FormToolkit widgetFactory = new FormToolkit(parent.getDisplay());
- FormText text = widgetFactory.createFormText(container, true);
- text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- text.setText(labelText, false, false);
-
- return text;
- }
-
- /**
- * {@inheritDoc}
- */
- public Text createMultiLineText(Composite parent) {
- return new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
- }
-
- /**
- * {@inheritDoc}
- */
- public Text createPasswordText(Composite parent) {
- return new Text(parent, SWT.BORDER | SWT.PASSWORD);
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createPushButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.PUSH);
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createRadioButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.RADIO);
- }
-
- /**
- * {@inheritDoc}
- */
- public Section createSection(Composite parent, int style) {
- return new Section(parent, style);
- }
-
- /**
- * {@inheritDoc}
- */
- public Spinner createSpinner(Composite parent) {
- return new Spinner(parent, SWT.NULL);
- }
-
- /**
- * {@inheritDoc}
- */
- public Table createTable(Composite parent, int style) {
- return new Table(parent, SWT.BORDER | style);
- }
-
- /**
- * {@inheritDoc}
- */
- public Text createText(Composite parent) {
- return new Text(parent, SWT.BORDER);
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createTriStateCheckBox(Composite parent, String text) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, text, this);
- return checkBox.getCheckBox();
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java
deleted file mode 100644
index 1c6509ed1b..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-/**
- * The abstract implementation of a dialog using a "state object" (model object)
- * for behavior.
- * <p>
- * The main pane of this dialog should be extending <code>DialogPane</code>
- * for creating the right type of widgets and it has the "state object" (subject)
- * behavior built-in.
- *
- * @see Node
- * @see DialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class Dialog<T extends Node> extends TitleAreaDialog
-{
- /**
- * The main content pane of this dialog.
- */
- private DialogPane<?> pane;
-
- /**
- * The holder of the "state object" used by this dialog.
- */
- private WritablePropertyValueModel<T> subjectHolder;
-
- /**
- * Caches the title text until the dialog is created and the dialog's shell
- * needs to be configured.
- */
- private String title;
-
- /**
- * Creates a new <code>Dialog</code>.
- *
- * @param parent The parent shell
- */
- protected Dialog(Shell parent) {
- this(parent, "");
- }
-
- /**
- * Creates a new <code>Dialog</code>.
- *
- * @param parent The parent shell
- * @param title The dialog's title
- */
- protected Dialog(Shell parent, String title) {
- super(parent);
- this.title = title;
- initialize();
- }
-
- /**
- * Initializes the main pane of this dialog. This method is invoked only
- * when the dialog is requested to show on screen and not during
- * initialization.
- *
- * @param container The container to which the widgets should be added to,
- * the layout is already set
- */
- protected abstract DialogPane<?> buildLayout(Composite container);
-
- /**
- * Creates the state object (model object) that will be used to keep track
- * of the information entered in this dialog. The state object will be stored
- * in the subject holder and can be retrieved using {@link #subject()}.
- *
- * @return A new state object
- */
- protected T buildStateObject() {
- return null;
- }
-
- /**
- * Creates the <code>Validator</code> that will be notified when changes are
- * made to the state object.
- *
- * @return The validator that will be set on the state object
- */
- Node.Validator buildValidator() {
- return Node.NULL_VALIDATOR;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean close() {
-
- // Dispose the pane in order to remove any listeners that could
- // have been installed outside the scrope of the state object
- if (pane != null) {
- pane.dispose();
- pane = null;
- }
-
- return super.close();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(getTitle());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void create() {
- super.create();
- installSubject();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Control createContents(Composite parent) {
- if (hasTitleArea()) {
- return super.createContents(parent);
- }
-
- return createDefaultContent(parent);
- }
-
- /**
- * Creates the default main container of this dialog when the title area is
- * not required. The top part is the dialog area populated by the subclass
- * and the lower part is the button pane having the OK and Cancel buttons.
- *
- * @param parent The parent container
- * @return The
- */
- private Composite createDefaultContent(Composite parent) {
-
- Composite composite = new Composite(parent, SWT.NULL);
-
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.verticalSpacing = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- applyDialogFont(composite);
- initializeDialogUnits(composite);
- dialogArea = createDialogArea(composite);
- buttonBar = createButtonBar(composite);
-
- return composite;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Composite createDialogArea(Composite parent) {
-
- // If the title area needs to be shown, then leave the superclass to
- // create the necessary widgets
- if (hasTitleArea()) {
- parent = (Composite) super.createDialogArea(parent);
- }
-
- // Create the main area's container
- Composite container = new Composite(parent, SWT.NULL);
- container.setLayout(new GridLayout(1, false));
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- container.setLayoutData(gridData);
-
- // Initialize the content pane
- pane = buildLayout(container);
-
- // Initialize the UI part, which requires the widgets being created
- initializeUI();
-
- return parent;
- }
-
- /**
- * Determines whether the description area (where a title, description and
- * image) should be visible or hidden. <code>ValidatingDialog</code>
- * automatically show the description area in order to show problems.
- *
- * @return <code>false</code> by default, which means the methods used to
- * update the title, description and image shouldn't be called; <code>true</code>
- * to make the description pane visible
- */
- protected boolean hasTitleArea() {
- return false;
- }
-
- /**
- * Returns the helps system.
- *
- * @return The platform's help system
- *
- * @category Helper
- */
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
- /**
- * Initializes this dialog.
- */
- protected void initialize() {
- this.subjectHolder = new SimplePropertyValueModel<T>();
- }
-
- /**
- * Initializes the UI part of this dialog, this is called after the widgets
- * have been created.
- */
- protected void initializeUI() {
- }
-
- /**
- * Creates the state object, if one is needed and install a <code>Validator</code>
- * in order to receive notification of changes done to that state object. The
- * subject can be retrieved from the subject holder.
- */
- private void installSubject() {
-
- T subject = buildStateObject();
-
- if (subject != null) {
- subject.setValidator(buildValidator());
- }
-
- subjectHolder.setValue(subject);
- }
-
- /**
- * Asynchronously launches this dialog in the UI thread.
- */
- public final void openDialog() {
- SWTUtil.setUserInterfaceActive(false);
- SWTUtil.show(this);
- }
-
- /**
- * Asynchronously launches this dialog in the UI thread and invoke the given
- * <code>PostExecution</code> to perform any post-task.
- *
- * @param postExecution This interface let the caller to invoke a piece of
- * code once the dialog is disposed
- */
- public final void openDialog(PostExecution<? extends Dialog<T>> execution) {
- SWTUtil.setUserInterfaceActive(false);
- SWTUtil.show(this, execution);
- }
-
- /**
- * Gives access to the dialog's main pane.
- *
- * @return The pane showing the custom widgets
- */
- protected DialogPane<?> getPane() {
- return pane;
- }
-
- /**
- * Returns the subject of this dialog.
- *
- * @return The subject of this dialog or <code>null</code> if no subject was
- * used
- */
- public T getSubject() {
- return subjectHolder.getValue();
- }
-
- /**
- * Returns the holder of the subject.
- *
- * @return The subject holder used to be passed to the dialog pane, which is
- * an instance of <code>DialogPane</code>
- */
- protected final PropertyValueModel<T> getSubjectHolder() {
- return subjectHolder;
- }
-
- /**
- * Retrieves the dialog's title. The title passed to the constructor will be
- * returned by default but if it wasn't specified, this method can be used
- * to return it.
- *
- * @return Either the title passed to the constructor or a different title
- */
- protected String getTitle() {
- return title;
- }
-
- /**
- * Determines whether the dialog was cancelled or not.
- *
- * @return <code>true</code> if the dialog was cancelled; <code>false</code>
- * if it was confirmed
- */
- public final boolean wasCancelled() {
- return getReturnCode() == CANCEL;
- }
-
- /**
- * Determines whether the dialog was confirmed or not.
- *
- * @return <code>true</code> if the dialog was confirmed; <code>false</code>
- * if it was cancelled
- */
- public final boolean wasConfirmed() {
- return getReturnCode() == OK;
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java
deleted file mode 100644
index 823cd0c183..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The abstract pane to use when the pane is shown in an <code>Dialog</code>.
- *
- * @see Dialog
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class DialogPane<T extends Node> extends Pane<T> {
-
- /**
- * Creates a new <code>DialogPane</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected DialogPane(DialogPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>DialogPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent controller;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected DialogPane(DialogPane<? extends T> parentPane,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, parent, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>DialogPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected DialogPane(DialogPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>DialogPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent controller;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected DialogPane(DialogPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>DialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected DialogPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent, DefaultWidgetFactory.instance());
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java
deleted file mode 100644
index f3069c5311..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Arrays;
-import java.util.Comparator;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import com.ibm.icu.text.Collator;
-
-/**
- * This pane simply shows a combo where its data is populating through
- * {@link #choices()} and a default value can also be added.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | I |v| |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-abstract class EnumComboViewer<T extends Model, V> extends Pane<T>
-{
- /**
- * The main widget of this pane.
- */
- private ComboViewer comboViewer;
-
- /**
- * A constant used to represent the <code>null</code> value.
- */
- public static final String NULL_VALUE = "null";
-
- /**
- * Creates a new <code>EnumComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- EnumComboViewer(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>EnumComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- EnumComboViewer(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>EnumComboViewer</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- EnumComboViewer(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /**
- * Creates the list of choices and add an extra element that represents the
- * default value.
- *
- * @return The combo's choices including the default value
- */
- private Object[] buildChoices() {
- V[] choices = getChoices();
- if (sortChoices()) {
- Arrays.sort(choices, buildComparator());
- }
-
- Object[] extendedChoices = new Object[choices.length + 1];
- System.arraycopy(choices, 0, extendedChoices, 1, choices.length);
- extendedChoices[0] = NULL_VALUE;
-
- return extendedChoices;
- }
-
- /**
- * Return true to sort the choices in alphabetical order
- * @return
- */
- protected boolean sortChoices() {
- return true;
- }
-
- /**
- * Creates the <code>ComboViewer</code> with the right combo widgets.
- *
- * @param container The container of the combo
- * @return A new <code>ComboViewer</code> containing the right combo widget
- */
- protected ComboViewer addComboViewer(Composite container) {
- return addComboViewer(container, buildLabelProvider());
- }
-
- private Comparator<Object> buildComparator() {
- return new Comparator<Object>() {
- final LabelProvider labelProvider = buildLabelProvider();
-
- public int compare(Object value1, Object value2) {
- String displayString1 = labelProvider.getText(value1);
- String displayString2 = labelProvider.getText(value2);
- return Collator.getInstance().compare(displayString1, displayString2);
- }
- };
- }
-
- /**
- * Retrieves the localized string from the given NLS class by creating the
- * key. That key is the concatenation of the composite's short class name
- * with the toString() of the given value separated by an underscore.
- *
- * @param nlsClass The NLS class used to retrieve the localized text
- * @param compositeClass The class used for creating the key, its short class
- * name is the beginning of the key
- * @param value The value used to append its toString() to the generated key
- * @return The localized text associated with the value
- */
- protected final String buildDisplayString(Class<?> nlsClass,
- Class<?> compositeClass,
- Object value) {
-
- return SWTUtil.buildDisplayString(nlsClass, compositeClass, value);
- }
-
- /**
- * Retrieves the localized string from the given NLS class by creating the
- * key. That key is the concatenation of the composite's short class name
- * with the toString() of the given value separated by an underscore.
- *
- * @param nlsClass The NLS class used to retrieve the localized text
- * @param composite The object used to retrieve the short class name that is
- * the beginning of the key
- * @param value The value used to append its toString() to the generated key
- * @return The localized text associated with the value
- */
- protected final String buildDisplayString(Class<?> nlsClass,
- Object composite,
- Object value) {
-
- return SWTUtil.buildDisplayString(nlsClass, composite, value);
- }
-
- /**
- * Creates the display string for the given element. If the element is the
- * virtual <code>null</code> value then its display string will be "Default"
- * appended by the actual default value, if it exists.
- *
- * @param value The value to convert into a human readable string
- * @return The string representation of the given element
- */
- @SuppressWarnings("unchecked")
- private String buildDisplayString(Object value) {
- if (value == NULL_VALUE) {
- V defaultValue = (getSubject() != null) ? getDefaultValue() : null;
-
- if (defaultValue != null) {
- String displayString = displayString(defaultValue);
- return NLS.bind(JptCommonUiMessages.EnumComboViewer_defaultWithDefault, displayString);
- }
- return nullDisplayString();
- }
-
- return displayString((V) value);
- }
-
- final LabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildDisplayString(element);
- }
- };
- }
-
- private ISelection buildSelection() {
- Object value = (getSubject() != null) ? getValue() : null;
-
- if (value == null) {
- value = NULL_VALUE;
- }
-
- return new StructuredSelection(value);
- }
-
- private ISelectionChangedListener buildSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- if (!isPopulating()) {
- StructuredSelection selection = (StructuredSelection) e.getSelection();
- valueChanged(selection.getFirstElement());
- }
- }
- };
- }
-
- /**
- * Returns the possible choices to show in the viewer.
- *
- * @return The items to show in the combos
- */
- protected abstract V[] getChoices();
-
- /**
- * Returns the default value, this method is not called if the subject is
- * <code>null</code>.
- *
- * @return The value that is declared as being the default when it is not
- * defined or <code>null</code> if there is no default value
- */
- protected abstract V getDefaultValue();
-
- /**
- * Returns the displayable string for the given value.
- *
- * @param value The value to translate into a human readable string
- * @return The localized text representing the given value
- */
- protected abstract String displayString(V value);
-
- /**
- * Returns the displayable string for a null value.
- */
- protected String nullDisplayString() {
- return null; //I would rather display nothing than "Default()"
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.populateCombo();
- }
-
- /**
- * Returns
- *
- * @return
- */
- final ComboViewer getComboViewer() {
- return comboViewer;
- }
-
- /**
- * Retrieves the subject's value. The subject is never <code>null</code>.
- *
- * @return The subject' value, which can be <code>null</code>
- */
- protected abstract V getValue();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected final void initializeLayout(Composite container) {
-
- this.comboViewer = this.addComboViewer(container);
- this.comboViewer.addSelectionChangedListener(buildSelectionChangedListener());
- }
-
- /**
- * Populates the combo by re-adding all the items.
- */
- private void populateCombo() {
-
- removeAll();
- comboViewer.add(buildChoices());
- updateSelection();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
- this.populateCombo();
- }
-
- /**
- * Removes all the items from the combo.
- */
- abstract void removeAll();
-
- /**
- * Requests the given new value be set on the subject.
- *
- * @param value The new value to be set
- */
- protected abstract void setValue(V value);
-
- /**
- * Updates the cursor, which is required to show the entire selected item
- * within the combo's area.
- */
- abstract void updateCursor();
-
- /**
- * Updates the combo's selected item.
- */
- private void updateSelection() {
- comboViewer.setSelection(buildSelection());
- updateCursor();
- }
-
- /**
- * The selection changes, notify the subclass to set the value.
- *
- * @param value The new selected item
- */
- @SuppressWarnings("unchecked")
- private void valueChanged(Object value) {
-
- // Convert the default "null" value to a real null
- if (value == NULL_VALUE) {
- value = null;
- }
-
- setPopulating(true);
-
- try {
- setValue((V) value);
- }
- finally {
- setPopulating(false);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumDialogComboViewer.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumDialogComboViewer.java
deleted file mode 100644
index 85d6b19518..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumDialogComboViewer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This <code>EnumComboViewer</code> should be used within a dialog pane.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class EnumDialogComboViewer<T extends Model, V>
- extends EnumComboViewer<T, V>
-{
- /**
- * Creates a new <code>EnumDialogComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumDialogComboViewer(DialogPane<? extends T> parentPane,
- Composite parent
- ) {
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>EnumDialogComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumDialogComboViewer(DialogPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent
- ) {
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
-
- Combo combo = getCombo();
- if ( ! combo.isDisposed()) {
- combo.setEnabled(enabled);
- }
- }
-
- protected final Combo getCombo() {
- return getComboViewer().getCombo();
- }
-
- @Override
- void removeAll() {
- getCombo().removeAll();
- }
-
- @Override
- void updateCursor() {
- getCombo().setSelection(new Point(0, 0));
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumFormComboViewer.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumFormComboViewer.java
deleted file mode 100644
index b6ee89f7ec..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumFormComboViewer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This <code>EnumComboViewer</code> should be used within a form pane.
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class EnumFormComboViewer<T extends Model, V>
- extends EnumComboViewer<T, V>
-{
- /**
- * Creates a new <code>EnumFormComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumFormComboViewer(Pane<? extends T> parentPane,
- Composite parent
- ) {
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>EnumFormComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumFormComboViewer(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent
- ) {
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
-
- Combo combo = getCombo();
- if ( ! combo.isDisposed()) {
- combo.setEnabled(enabled);
- }
- }
-
- protected final Combo getCombo() {
- return this.getComboViewer().getCombo();
- }
-
- @Override
- void removeAll() {
- getCombo().removeAll();
- }
-
- @Override
- void updateCursor() {
- getCombo().setSelection(new Point(0, 0));
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserComboPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserComboPane.java
deleted file mode 100644
index 4b47bad407..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserComboPane.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This chooser allows the user to choose a file when browsing.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- ------------- |
- * | Label: | I |v| | | Browse... | |
- * | ---------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 3.0
- * @since 3.0
- */
-public abstract class FileChooserComboPane<T extends Model> extends FileChooserPane<T>
-{
- /**
- * Creates a new <code>FileChooserComboPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public FileChooserComboPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>FileChooserComboPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public FileChooserComboPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected Control addMainControl(Composite container) {
-
- return addEditableCombo(
- container,
- this.buildListHolder(),
- this.getTextHolder(),
- this.buildStringConverter()
- );
- }
-
- /**
- * Creates the list holder of the combo box.
- */
- protected ListValueModel<String> buildListHolder() {
- return new SimpleListValueModel<String>(
- this.buildDefaultList()
- );
- }
-
- /**
- * Creates the default list of the combo box.
- */
- protected List<String> buildDefaultList() {
- return Arrays.asList(this.getDefaultString());
- }
-
- /**
- * Returns the default value of the combo box.
- */
- protected abstract String getDefaultString();
-
- /**
- * The converter responsible to transform each combo box item
- * into a string representation
- */
- protected StringConverter<String> buildStringConverter() {
- return StringConverter.Default.<String>instance();
- }
-
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserPane.java
deleted file mode 100644
index bcaec6dca9..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FileChooserPane.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.common.ui.JptCommonUiPlugin;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-
-/**
- * This chooser allows the user to choose a file when browsing.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- ------------- |
- * | Label: | I | | Browse... | |
- * | ---------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class FileChooserPane<T extends Model> extends ChooserPane<T>
-{
- private WritablePropertyValueModel<String> textHolder;
-
- /**
- * Creates a new <code>FileChooserPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public FileChooserPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>FileChooserPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public FileChooserPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected final Runnable buildBrowseAction() {
- return new Runnable() {
- public void run() {
- promptFile();
- }
- };
- }
-
- /**
- * Creates the <code>ViewerFilter</code> that will filter the content of the
- * dialog and only displays what is valid.
- *
- * @return A new <code>ViewerFilter</code>
- */
- protected ViewerFilter buildFilter() {
- return new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer,
- Object parentElement,
- Object element) {
-
- return true;
- }
- };
- }
-
- @Override
- protected Control addMainControl(Composite container) {
- return this.addText(container, this.textHolder);
- }
-
- /**
- * Creates the value holder of the subject's property.
- *
- * @return The holder of the class name
- */
- protected abstract WritablePropertyValueModel<String> buildTextHolder();
-
- /**
- * Creates the validator that will show a status message based on what is
- * selected in the selection dialog.
- *
- * @return A new <code>ISelectionStatusValidator</code>
- */
- protected ISelectionStatusValidator buildValidator() {
- return new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
-
- if (selection.length != 1) {
- return new Status(IStatus.ERROR, JptCommonUiPlugin.PLUGIN_ID, "");
- }
-
- return new Status(IStatus.OK, JptCommonUiPlugin.PLUGIN_ID, "");
- }
- };
- }
-
- /**
- * Returns the selection dialog's title.
- *
- * @return A non-<code>null</code> string
- */
- protected abstract String getDialogTitle();
-
- /**
- * Retrieves the project path that will be used by the selection dialog.
- *
- * @return The project path used to display its content in a selection dialog
- */
- protected abstract String getProjectPath();
-
- protected WritablePropertyValueModel<String> getTextHolder() {
- return this.textHolder;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.textHolder = this.buildTextHolder();
- }
-
- /**
- * The browse button was clicked, its action invokes this action which should
- * prompt the user to select a file and set it.
- */
- protected void promptFile() {
- String projectPath= this.getProjectPath();
-
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(this.getDialogTitle());
- dialog.setFilterPath(projectPath);
- String filePath = dialog.open();
- if (filePath != null) {
- FileChooserPane.this.textHolder.setValue(filePath);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserComboPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserComboPane.java
deleted file mode 100644
index d7cce8ab4d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserComboPane.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * This chooser allows the user to choose a folder when browsing.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- ------------- |
- * | Label: | I |v| | | Browse... | |
- * | ---------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 3.0
- * @since 3.0
- */
-public abstract class FolderChooserComboPane<T extends Model> extends FolderChooserPane<T>
-{
- /**
- * Creates a new <code>FolderChooserComboPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public FolderChooserComboPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>FolderChooserComboPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public FolderChooserComboPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected Control addMainControl(Composite container) {
-
- return addEditableCombo(
- container,
- this.buildListHolder(),
- this.getTextHolder(),
- this.buildStringConverter()
- );
- }
-
- /**
- * Creates the list holder of the combo box.
- */
- protected ListValueModel<String> buildListHolder() {
- return new SimpleListValueModel<String>(
- this.buildDefaultList()
- );
- }
-
- /**
- * Creates the default list of the combo box.
- */
- protected List<String> buildDefaultList() {
- return Arrays.asList(this.getDefaultString());
- }
-
- /**
- * Returns the default value of the combo box.
- */
- protected abstract String getDefaultString();
-
- /**
- * The converter responsible to transform each combo box item
- * into a string representation
- */
- protected StringConverter<String> buildStringConverter() {
- return StringConverter.Default.<String>instance();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserPane.java
deleted file mode 100644
index 0aa4142d4a..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FolderChooserPane.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 20010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-
-/**
- * This chooser allows the user to choose a folder when browsing.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- ------------- |
- * | Label: | I | | Browse... | |
- * | ---------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 3.0
- * @since 2.0
- */
-public abstract class FolderChooserPane<T extends Model> extends ChooserPane<T>
-{
- private WritablePropertyValueModel<String> textHolder;
-
- /**
- * Creates a new <code>FolderChooserPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public FolderChooserPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>FolderChooserPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public FolderChooserPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected final Runnable buildBrowseAction() {
- return new Runnable() {
- public void run() {
- promptFolder();
- }
- };
- }
-
- @Override
- protected Control addMainControl(Composite container) {
- return this.addText(container, this.textHolder);
- }
-
- /**
- * Creates the value holder of the subject's property.
- *
- * @return The holder of the class name
- */
- protected abstract WritablePropertyValueModel<String> buildTextHolder();
-
- /**
- * Returns the message to be shown in the selection dialog.
- *
- * @return A non-<code>null</code> string shown above the text field of the
- * selection dialog
- */
- protected abstract String getDialogMessage();
-
- /**
- * Returns the selection dialog's title.
- *
- * @return A non-<code>null</code> string
- */
- protected abstract String getDialogTitle();
-
- /**
- * Returns the path that the dialog will use to filter the directories it
- * shows to the argument, which may be null. If the string is null, then the
- * operating system's default filter path will be used.
- * <p>
- * Note that the path string is platform dependent. For convenience, either
- * '/' or '\' can be used as a path separator.
- * </p>
- *
- * @return The filter path
- */
- protected String filterPath() {
- return null;
- }
-
- protected WritablePropertyValueModel<String> getTextHolder() {
- return this.textHolder;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.textHolder = this.buildTextHolder();
- }
-
- /**
- * The browse button was clicked, its action invokes this action which should
- * prompt the user to select a folder and set it.
- */
- protected void promptFolder() {
-
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(this.getDialogMessage());
- dialog.setText(this.getDialogTitle());
- dialog.setFilterPath(this.filterPath());
- String directory = dialog.open();
-
- if (directory != null) {
- this.textHolder.setValue(directory);
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java
deleted file mode 100644
index ea1302f7df..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DateTime;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-/**
- * This <code>WidgetFactory</code> is responsible to create the widgets
- * using the <code>FormToolkit</code> in order use the form style (flat-style)
- * look and feel.
- *
- * @see FormToolkit
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class FormWidgetFactory implements WidgetFactory {
-
- /**
- * The actual factory responsible for creating the new widgets.
- */
- private final FormToolkit widgetFactory;
-
- /**
- * Creates a new <code>FormWidgetFactory</code>.
- *
- * @param widgetFactory The actual factory responsible for creating the new
- * widgets
- */
- public FormWidgetFactory(FormToolkit widgetFactory) {
- super();
-
- Assert.isNotNull(widgetFactory, "The widget factory cannot be null");
- this.widgetFactory = widgetFactory;
- }
-
- /**
- * Wraps the given <code>Composite</code> into a new <code>Composite</code>
- * in order to have the widgets' border painted. Except for <code>CCombo</code>,
- * the top and bottom margins have to be 2 pixel and the left and right
- * margins have to be 1 pixel.
- *
- * @param container The parent of the sub-pane
- * @return A new <code>Composite</code> that has the necessary space to paint
- * the border
- */
- protected Composite createBorderContainer(Composite container) {
- return createBorderContainer(container, 2, 1);
- }
-
- protected Composite createBorderContainer(Composite container, int marginHeight, int marginWidth) {
-
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = marginHeight;
- layout.marginWidth = marginWidth;
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
-
- container = widgetFactory.createComposite(container);
- container.setLayoutData(gridData);
- container.setLayout(layout);
-
- return container;
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createButton(Composite parent, String text) {
- return createButton(parent, text, SWT.NULL);
- }
-
- /**
- * Creates a new button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param style The style to apply to the button, which determines its type:
- * toggle, push, check box, radio
- * @return The newly created <code>Button</code>
- */
- protected Button createButton(Composite parent, String text, int style) {
- return widgetFactory.createButton(parent, text, SWT.FLAT | style);
- }
-
- /**
- * {@inheritDoc}
- */
- @Deprecated
- public CCombo createCCombo(Composite parent) {
- return createCCombo(parent, SWT.READ_ONLY);
- }
-
- /**
- * Creates a new combo.
- *
- * @param parent The parent container
- * @param style The style to apply to the combo, usually read-only, flat
- * @return The newly created <code>CCombo</code>
- */
- protected CCombo createCCombo(Composite parent, int style) {
- parent = createBorderContainer(parent, 1, 1);
-
- CCombo combo = new CCombo(parent, style);
- widgetFactory.adapt(combo, true, false);
-
- // Bugzilla 145837 - workaround for no borders on Windows XP
- if (widgetFactory.getBorderStyle() == SWT.BORDER) {
- combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- }
-
- return combo;
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createCheckBox(Composite parent, String text) {
- return createButton(parent, text, SWT.CHECK);
- }
-
- /**
- * {@inheritDoc}
- */
- public Combo createCombo(Composite parent) {
- return new Combo(parent, SWT.READ_ONLY | SWT.FLAT);
- }
-
- /**
- * {@inheritDoc}
- */
- public Composite createComposite(Composite parent) {
- return this.widgetFactory.createComposite(parent);
- }
- /**
- * {@inheritDoc}
- */
- public DateTime createDateTime(Composite parent, int style) {
- parent = createBorderContainer(parent);
-
- DateTime dateTime = new DateTime(parent, style | SWT.FLAT);
- dateTime.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- this.widgetFactory.adapt(dateTime, true, false);
-
- return dateTime;
- }
-
- /**
- * {@inheritDoc}
- */
- @Deprecated
- public CCombo createEditableCCombo(Composite parent) {
- return createCCombo(parent, SWT.NULL);
- }
-
- /**
- * {@inheritDoc}
- */
- public Combo createEditableCombo(Composite parent) {
- Combo combo = new Combo(parent, SWT.FLAT);
- return combo;
- }
-
- /**
- * {@inheritDoc}
- */
- public Group createGroup(Composite parent, String title) {
- Group group = new Group(parent, SWT.NULL);
- group.setText(title);
- return group;
- }
-
- /**
- * {@inheritDoc}
- */
- public Hyperlink createHyperlink(Composite parent, String text) {
- return widgetFactory.createHyperlink(parent, text, SWT.FLAT);
- }
-
- /**
- * {@inheritDoc}
- */
- public Label createLabel(Composite container, String labelText) {
- return widgetFactory.createLabel(container, labelText, SWT.WRAP);
- }
-
- /**
- * {@inheritDoc}
- */
- public List createList(Composite container, int style) {
- List list = new List(container, SWT.FLAT | style);
- list.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- return list;
- }
-
- /**
- * {@inheritDoc}
- */
- public FormText createMultiLineLabel(Composite parent, String labelText) {
-
- Composite container = widgetFactory.createComposite(parent, SWT.NONE);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- container.setLayoutData(gridData);
-
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 1;
- layout.bottomMargin = 0;
- layout.leftMargin = 0;
- layout.rightMargin = 0;
- layout.topMargin = 0;
- container.setLayout(layout);
-
- FormText text = widgetFactory.createFormText(container, true);
- text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- text.setText(labelText, false, false);
-
- return text;
- }
-
- /**
- * {@inheritDoc}
- */
- public Text createMultiLineText(Composite parent) {
- return createText(parent, SWT.MULTI | SWT.V_SCROLL);
- }
-
- /**
- * {@inheritDoc}
- */
- public Text createPasswordText(Composite parent) {
- return createText(parent, SWT.PASSWORD);
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createPushButton(Composite parent, String text) {
- return createButton(parent, text, SWT.PUSH);
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createRadioButton(Composite parent, String text) {
- return createButton(parent, text, SWT.RADIO);
- }
-
- /**
- * {@inheritDoc}
- */
- public Section createSection(Composite parent, int style) {
- return widgetFactory.createSection(parent, SWT.FLAT | style);
- }
-
- /**
- * {@inheritDoc}
- */
- public Spinner createSpinner(Composite parent) {
- parent = createBorderContainer(parent);
-
- Spinner spinner = new Spinner(parent, SWT.FLAT);
- spinner.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- widgetFactory.adapt(spinner, true, false);
-
- return spinner;
- }
-
- /**
- * {@inheritDoc}
- */
- public Table createTable(Composite parent, int style) {
- Table table = this.widgetFactory.createTable(parent, SWT.BORDER | style);
- table.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- return table;
- }
-
- /**
- * {@inheritDoc}
- */
- public Text createText(Composite parent) {
- return createText(parent, SWT.NONE);
- }
-
- protected Text createText(Composite parent, int style) {
- return widgetFactory.createText(parent, null, SWT.BORDER | SWT.FLAT | style);
- }
-
- /**
- * {@inheritDoc}
- */
- public Button createTriStateCheckBox(Composite parent, String text) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, text, this);
- return checkBox.getCheckBox();
- }
-
- /**
- * Returns the actual factory responsible for creating the new widgets.
- *
- * @return The factory creating the widgets with the form style (flat-style)
- */
- public FormToolkit getWidgetFactory() {
- return widgetFactory;
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java
deleted file mode 100644
index 6703d6a3a0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/IntegerCombo.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This is a replacement for a Spinner. It is a combo that only accepts integers.
- * It also includes a Default option in the combo.
- */
-public abstract class IntegerCombo<T extends Model>
- extends Pane<T>
-{
-
- /**
- * The main (only) widget of this pane.
- */
- private Combo comboBox;
-
-
- private PropertyValueModel<String> defaultValueHolder;
-
- // ********** constructors **********
-
- protected IntegerCombo(
- Pane<? extends T> parentPane,
- Composite parent
- ) {
- super(parentPane, parent);
- }
-
- protected IntegerCombo(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent
- ) {
- super(parentPane, subjectHolder, parent);
- }
-
- public Combo getCombo() {
- return this.comboBox;
- }
-
- // ********** initialization **********
-
- @Override
- protected void initializeLayout(Composite container) {
- this.defaultValueHolder = buildDefaultStringHolder();
- this.comboBox = this.addIntegerCombo(container);
-
- int margin = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
- gridData.horizontalIndent = margin;
- gridData.grabExcessHorizontalSpace = false;
- this.comboBox.setLayoutData(gridData);
-
- this.comboBox.addVerifyListener(this.buildVerifyListener());
- SWTUtil.attachDefaultValueHandler(this.comboBox);
- }
-
- protected Combo addIntegerCombo(Composite container) {
- return this.addLabeledEditableCombo(
- container,
- getLabelText(),
- buildDefaultListHolder(),
- buildSelectedItemStringHolder(),
- getHelpId()
- );
-
- }
-
- protected VerifyListener buildVerifyListener() {
- return new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- IntegerCombo.this.verifyComboBox(e);
- }
- };
- }
-
- protected ListValueModel<String> buildDefaultListHolder() {
- return new PropertyListValueModelAdapter<String>(this.defaultValueHolder);
- }
-
- private PropertyValueModel<String> buildDefaultStringHolder() {
- return new TransformationPropertyValueModel<Integer, String>(buildDefaultHolder()) {
- @Override
- protected String transform(Integer value) {
- if (value == null) {
- return JptCommonUiMessages.NoneSelected;
- }
- return super.transform(value);
- }
- @Override
- protected String transform_(Integer value) {
- return getDefaultValueString(value);
- }
- };
- }
-
- private String getDefaultValueString(Integer defaultValue) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
-
- private String getDefaultValueString() {
- return this.defaultValueHolder.getValue();
- }
-
- protected WritablePropertyValueModel<String> buildSelectedItemStringHolder() {
- return new TransformationWritablePropertyValueModel<Integer, String>(buildSelectedItemHolder()) {
- @Override
- protected String transform(Integer value) {
- return value == null ?
- getDefaultValueString()
- :
- value.toString();
- }
-
- @Override
- protected Integer reverseTransform_(String value) {
- int intLength;
- try {
- intLength = Integer.parseInt(value);
- }
- catch (NumberFormatException e) {
- //if the default is selected from the combo, set length to null
- return null;
- }
- return Integer.valueOf(intLength);
- }
- };
- }
-
- // ********** abstract methods **********
-
- protected abstract String getLabelText();
-
- protected abstract String getHelpId();
-
- protected abstract PropertyValueModel<Integer> buildDefaultHolder();
-
- protected abstract WritablePropertyValueModel<Integer> buildSelectedItemHolder();
-
- // ********** combo-box verify listener callback **********
-
- protected void verifyComboBox(VerifyEvent e) {
- if (e.character == '\b') {
- //ignore backspace
- return;
- }
- if (e.text.equals("") //DefaultValueHandler sets the text to "" //$NON-NLS-1$
- || e.text.equals(this.defaultValueHolder.getValue())) {
- return;
- }
- try {
- Integer.parseInt(e.text);
- }
- catch (NumberFormatException exception) {
- e.doit = false;
- }
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java
deleted file mode 100644
index 3dd63559cb..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * The dialog used to requests a name from the user.
- *
- * @version 2.0
- * @since 2.0
- */
-public class NewNameDialog extends ValidatingDialog<NewNameStateObject>
-{
- private String description;
- private Image descriptionImage;
- private String descriptionTitle;
- private String labelText;
- private String name;
- private Collection<String> names;
-
- /**
- * Creates a new <code>NewNameDialog</code>.
- *
- * @param parentShell
- * @param dialogTitle
- * @param descriptionTitle
- * @param descriptionImage
- * @param description
- * @param labelText
- * @param name
- * @param names
- */
- NewNameDialog(Shell parentShell,
- String dialogTitle,
- String descriptionTitle,
- Image descriptionImage,
- String description,
- String labelText,
- String name,
- Collection<String> names)
- {
- super(parentShell, dialogTitle);
-
- this.name = name;
- this.names = names;
- this.labelText = labelText;
- this.description = description;
- this.descriptionImage = descriptionImage;
- this.descriptionTitle = descriptionTitle;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected DialogPane<NewNameStateObject> buildLayout(Composite container) {
- return new NewNameDialogPane(container);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected NewNameStateObject buildStateObject() {
- return new NewNameStateObject(name, names);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void create() {
- super.create();
-
- NewNameDialogPane pane = (NewNameDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getDescription() {
- return description;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Image getDescriptionImage() {
- return descriptionImage;
- }
-
- /* (non-Javadoc)
- */
- @Override
- protected String getDescriptionTitle() {
- return descriptionTitle;
- }
-
- /**
- * Returns the text field's input, which is the new name the user entered.
- *
- * @return The name the user entered
- */
- public String getName() {
- return getSubject().getName();
- }
-
- private class NewNameDialogPane extends DialogPane<NewNameStateObject> {
-
- private Text text;
-
- NewNameDialogPane(Composite parent) {
- super(NewNameDialog.this.getSubjectHolder(), parent);
- }
-
- private WritablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapter<NewNameStateObject, String>(getSubjectHolder(), NewNameStateObject.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setName(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- text = addLabeledText(
- container,
- labelText,
- buildNameHolder()
- );
- }
-
- void selectAll() {
- text.selectAll();
- }
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java
deleted file mode 100644
index 4142c07709..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This builder is responsible to create a fully initialized
- * <code>NewNameDialog</code> once all the properties have been set.
- *
- * @see NewNameDialog
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class NewNameDialogBuilder {
-
- /**
- * The message to show in the description area.
- */
- private String description;
-
- /**
- * The image of the description area.
- */
- private Image descriptionImage;
-
- /**
- * The title to show in the description area.
- */
- private String descriptionTitle;
-
- /**
- * The title of the new name dialog.
- */
- private String dialogTitle;
-
- /**
- * The text field's label.
- */
- private String labelText;
-
- /**
- * The initial input or <code>null</code> if no initial value can be
- * specified.
- */
- private String name;
-
- /**
- * The collection of names that can't be used or an empty collection if none
- * are available.
- */
- private Collection<String> names;
-
- /**
- * The parent shell of the new name dialog.
- */
- private Shell parentShell;
-
- /**
- * Creates a new <code>NewNameDialogBuilder</code>.
- *
- * @param parentShell The parent shell of the new name dialog
- */
- public NewNameDialogBuilder(Shell parentShell) {
- super();
- initialize(parentShell);
- }
-
- /**
- * Creates the dialog that will be used to request a new name from the user.
- *
- * @return The initialized dialog
- */
- public NewNameDialog buildDialog() {
- return new NewNameDialog(
- parentShell,
- dialogTitle,
- descriptionTitle,
- descriptionImage,
- description,
- labelText,
- name,
- names
- );
- }
-
- /**
- * Initializes this builder.
- *
- * @param parentShell The parent shell of the new name dialog
- */
- protected void initialize(Shell parentShell) {
-
- Assert.isNotNull(parentShell, "The parent shell cannot be null");
-
- this.parentShell = parentShell;
- this.names = Collections.emptyList();
- }
-
- /**
- * Sets the description to be shown in the description area under the title.
- *
- * @param description The message to show in the description area
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the image to be shown to the right side of the description area.
- *
- * @param descriptionImage The image of the description area
- */
- public void setDescriptionImage(Image descriptionImage) {
- this.descriptionImage = descriptionImage;
- }
-
- /**
- * Sets the title to be shown in the description area.
- *
- * @param descriptionTitle The title to show in the description area
- */
- public void setDescriptionTitle(String descriptionTitle) {
- this.descriptionTitle = descriptionTitle;
- }
-
- /**
- * Sets the dialog's title.
- *
- * @param dialogTitle The title of the new name dialog
- */
- public void setDialogTitle(String dialogTitle) {
- this.dialogTitle = dialogTitle;
- }
-
- /**
- * Sets the existing names that will be used to validate the text field's
- * input and prevent the user from using it.
- *
- * @param names The collection of names that can't be used
- */
- public void setExistingNames(Iterator<String> names) {
- this.names = CollectionTools.collection(names);
- }
-
- /**
- * Sets the text to label the text field.
- *
- * @param labelText The text field's label
- */
- public void setLabelText(String labelText) {
- this.labelText = labelText;
- }
-
- /**
- * Sets the initial name if one exists. It is valid to leave this
- * <code>null</code> when the user has to enter something.
- *
- * @param name The initial input
- */
- public void setName(String name) {
- this.name = name;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java
deleted file mode 100644
index f86bae2e11..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.internal.node.Problem;
-
-/**
- * This is the state object used by the <code>NewNameDialog</code>, which stores
- * the current name and validates it when it is modified.
- *
- * @see NewNameDialog
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-final class NewNameStateObject extends AbstractNode
-{
- /**
- * The initial input or <code>null</code> if no initial value can be
- * specified.
- */
- private String name;
-
- /**
- * The collection of names that can't be used or an empty collection if none
- * are available.
- */
- private Collection<String> names;
-
- /**
- * The <code>Validator</code> used to validate this state object.
- */
- private Validator validator;
-
- /**
- * Notifies a change in the name property.
- */
- static final String NAME_PROPERTY = "name";
-
- /**
- * Creates a new <code>NewNameStateObject</code>.
- *
- * @param name The initial input or <code>null</code> if no initial value can
- * be specified
- * @param names The collection of names that can't be used or an empty
- * collection if none are available
- */
- NewNameStateObject(String name, Collection<String> names) {
- super(null);
-
- this.name = name;
- this.names = names;
- }
-
- /**
- * Validates the name property.
- *
- * @param currentProblems The list to which <code>Problem</code>s can be
- * added
- */
- private void addNameProblems(List<Problem> currentProblems) {
-
- if (StringTools.stringIsEmpty(name)) {
- currentProblems.add(buildProblem(JptCommonUiMessages.NewNameStateObject_nameMustBeSpecified, IMessageProvider.ERROR));
- }
- else if (names.contains(name.trim())) {
- currentProblems.add(buildProblem(JptCommonUiMessages.NewNameStateObject_nameAlreadyExists, IMessageProvider.ERROR));
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addProblemsTo(List<Problem> currentProblems)
- {
- super.addProblemsTo(currentProblems);
- addNameProblems(currentProblems);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void checkParent(Node parentNode) {
- }
-
- /*
- * (non-Javadoc)
- */
- public String displayString() {
- return null;
- }
-
- /**
- * Returns the current name stored in this state object.
- *
- * @return The current name or <code>null</code>
- */
- String getName() {
- return name;
- }
-
- /**
- * Sets the current name stored in this state object or <code>null</code> to
- * clear it.
- *
- * @param name The new name or <code>null</code>
- */
- public void setName(String name) {
- String oldName = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, oldName, name);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Validator getValidator() {
- return validator;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NullPostExecution.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NullPostExecution.java
deleted file mode 100644
index 21e7420523..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NullPostExecution.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.Dialog;
-
-/**
- * A <code>null</code> instance of <code>PostExecution</code>.
- *
- * @version 2.0
- * @since 1.0
- */
-public final class NullPostExecution implements PostExecution<Dialog> {
-
- /**
- * The singleton instance of this <code>NullPostExecution</code>.
- */
- private static PostExecution<Dialog> INSTANCE;
-
- /**
- * Creates a new <code>NullPostExecution</code>.
- */
- private NullPostExecution() {
- super();
- }
-
- /**
- * Returns the singleton instance of this <code>NullPostExecution</code>.
- *
- * @param <T> The dialog where this <code>PostExecution</code> will be used
- * @return The singleton instance with the proper type
- */
- @SuppressWarnings("unchecked")
- public static synchronized <T extends Dialog> PostExecution<T> instance() {
-
- if (INSTANCE == null) {
- INSTANCE = new NullPostExecution();
- }
-
- return (PostExecution<T>) INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- */
- public void execute(Dialog dialog) {
- // Nothing to do
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PackageChooserPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PackageChooserPane.java
deleted file mode 100644
index c88726ca65..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PackageChooserPane.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaPackageCompletionProcessor;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.JptCommonUiPlugin;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-/**
- * This chooser allows the user to choose a package when browsing and it adds
- * code completion support to the text field, which is the main component.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | !---------------------------------------------------- ------------- |
- * | Label: | I | | Browse... | |
- * | ---------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class PackageChooserPane<T extends Model> extends ChooserPane<T>
-{
- /**
- * The code completion manager.
- */
- private JavaPackageCompletionProcessor javaPackageCompletionProcessor;
-
- private PropertyChangeListener subjectChangeListener;
-
- /**
- * Creates a new <code>PackageChooserPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public PackageChooserPane(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>PackageChooserPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public PackageChooserPane(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
-
- // TODO bug 156185 - when this is fixed there should be api for this
- this.javaPackageCompletionProcessor = new JavaPackageCompletionProcessor(
- new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_ROOT)
- );
- this.subjectChangeListener = this.buildSubjectChangeListener();
- this.getSubjectHolder().addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- this.packageChooserSubjectChanged(getSubject());
- }
-
- private PropertyChangeListener buildSubjectChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSubjectChangeListener_());
- }
-
- private PropertyChangeListener buildSubjectChangeListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent e) {
- PackageChooserPane.this.packageChooserSubjectChanged((T) e.getNewValue());
- }
- };
- }
-
- protected void packageChooserSubjectChanged(T newSubject) {
- IPackageFragmentRoot root = null;
- if (newSubject != null) {
- root = getPackageFragmentRoot();
- }
- this.javaPackageCompletionProcessor.setPackageFragmentRoot(root);
- }
-
- @Override
- protected final Runnable buildBrowseAction() {
- return new Runnable() {
- public void run() {
- promptPackage();
- }
- };
- }
-
- @Override
- protected Control addMainControl(Composite container) {
- Composite subPane = addSubPane(container);
-
- Text text = addText(subPane, buildTextHolder());
-
- Image image = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage();
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalIndent = image.getBounds().width;
- text.setLayoutData(data);
-
- ControlContentAssistHelper.createTextContentAssistant(
- text,
- javaPackageCompletionProcessor
- );
-
- return subPane;
- }
-
- /**
- * Creates the value holder of the subject's property.
- *
- * @return The holder of the package name
- */
- protected abstract WritablePropertyValueModel<String> buildTextHolder();
-
- /**
- * Prompts the user the Open Package dialog.
- *
- * @return Either the selected package or <code>null</code> if the user
- * cancelled the dialog
- */
- protected IPackageFragment choosePackage() {
-
- SelectionDialog selectionDialog;
-
- try {
- selectionDialog = JavaUI.createPackageDialog(
- getShell(),
- getPackageFragmentRoot()
- );
- }
- catch (JavaModelException e) {
- JptCommonUiPlugin.log(e);
- return null;
- }
-
- selectionDialog.setTitle(JptCommonUiMessages.PackageChooserPane_dialogTitle);
- selectionDialog.setMessage(JptCommonUiMessages.PackageChooserPane_dialogMessage);
-
- IPackageFragment pack = getPackageFragment();
-
- if (pack != null) {
- selectionDialog.setInitialSelections(new Object[] { pack });
- }
-
- if (selectionDialog.open() == Window.OK) {
- return (IPackageFragment) selectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- protected abstract IJavaProject getJavaProject();
-
- /**
- * Returns the package name from its subject.
- *
- * @return The package name or <code>null</code> if none is defined
- */
- protected abstract String getPackageName();
-
- /**
- * The browse button was clicked, its action invokes this action which should
- * prompt the user to select a package and set it.
- */
- protected void promptPackage() {
- IPackageFragment packageFragment = choosePackage();
-
- if (packageFragment != null) {
- String packageName = packageFragment.getElementName();
- this.setPackageName(packageName);
- }
- }
-
- protected abstract void setPackageName(String packageName);
-
- private IPackageFragment getPackageFragment() {
- String packageName = getPackageName();
-
- if (packageName == null) {
- return null;
- }
-
- return getPackageFragmentRoot().getPackageFragment(packageName);
- }
-
- protected IPackageFragmentRoot getPackageFragmentRoot() {
- try {
- return this.getJavaProject().getPackageFragmentRoots()[0];
- } catch (JavaModelException ex) {
- JptCommonUiPlugin.log(ex);
- return null;
- }
- }
-
- @Override
- public void dispose() {
- this.getSubjectHolder().removePropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- super.dispose();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
deleted file mode 100644
index d3f7ffef59..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
+++ /dev/null
@@ -1,3746 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.Tracing;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.swt.ComboModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.DateTimeModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.SpinnerModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TriStateCheckBoxModelAdapter;
-import org.eclipse.jpt.common.ui.internal.util.ControlAligner;
-import org.eclipse.jpt.common.ui.internal.util.LabeledButton;
-import org.eclipse.jpt.common.ui.internal.util.LabeledControlUpdater;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.NonNullBooleanTransformer;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeBooleanPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DateTime;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * The abstract definition of a pane which holds onto a <code>PropertyValueModel</code>
- * that contains the subject of this pane.
- * <p>
- * It also contains convenience methods for building buttons, labels, check
- * boxes, and radio buttons, etc.
- * <p>
- * It is possible to easily listen to any property changes coming from the
- * subject, {@link #addPropertyNames(Collection)} is specify which properties
- * are of interest and {@link #propertyChanged(String)} is used to notify the
- * pane when the property has changed.
- *
- * @see FormPane
- * @see DialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class Pane<T extends Model>
-{
- /**
- * The listener registered with the subject in order to be notified when a
- * property has changed, the property names are determined by
- * {@link #propertyNames()}.
- */
- private PropertyChangeListener aspectChangeListener;
-
- /**
- * The container of this composite.
- */
- private final Composite container;
-
- /**
- * The aligner responsible to align the left controls.
- */
- private ControlAligner leftControlAligner;
-
- /**
- * Flag used to stop the circular population of widgets.
- */
- private boolean populating;
-
- /**
- * The aligner responsible to align the left controls.
- */
- private ControlAligner rightControlAligner;
-
- /**
- * This listener is registered with the subject holder in order to
- * automatically repopulate this pane with the new subject.
- */
- private PropertyChangeListener subjectChangeListener;
-
- /**
- * The subject of this pane.
- */
- private PropertyValueModel<T> subjectHolder;
-
- /**
- * The collection of registered sub-panes will be automatically notified
- * when listeners need to be engaged or disengaged or when to populate its
- * widgets.
- */
- private Collection<Pane<?>> subPanes;
-
- /**
- * The factory used to create various common widgets.
- */
- private WidgetFactory widgetFactory;
-
- /**
- * The collection of <code>Control</code>s that are displayed in this pane,
- * which will have their enablement state updated when
- * {@link #enableWidgets(boolean)} is called.
- */
- private ArrayList<Control> managedWidgets;
-
- /**
- * The collection of <code>Pane</code>s that are displayed in this pane,
- * which will have their enablement state updated when
- * {@link #enableWidgets(boolean)} is called.
- */
- private ArrayList<Pane<?>> managedSubPanes;
-
- /**
- * This enabled model is used to store the pane's base enablement state.
- * If API is called to set the pane enabled, this model gets updated. If the pane is thereby
- * fully enabled (controller enabled model is also in agreement) the pane's widgets are set
- * enabled.
- * @see #getCombinedEnabledModel()
- */
- private final WritablePropertyValueModel<Boolean> baseEnabledModel
- = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
-
- /**
- * This enabled model is used to define the pane's enablement as controlled by other widgets,
- * tests, etc. (for example a radio button)
- * If this model is changed, and the pane is thereby fully enabled (base enabled model is also
- * in agreement) the pane's widgets are set enabled.
- * @see #getCombinedEnabledModel()
- */
- private PropertyValueModel<Boolean> controllerEnabledModel;
-
- /**
- * The "and" combination of {@link #baseEnabledModel} and {@link #controllerEnabledModel}
- */
- private PropertyValueModel<Boolean> combinedEnabledModel;
-
- private PropertyChangeListener combinedEnabledModelListener;
-
- /**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected Pane(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- this(parentPane, parent, true);
- }
-
- /**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected Pane(
- Pane<? extends T> parentPane,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- this(
- parentPane,
- parentPane.getSubjectHolder(),
- parent,
- automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected Pane(
- Pane<? extends T> parentPane,
- Composite parent,
- boolean automaticallyAlignWidgets,
- boolean parentManagePane) {
-
- this(
- parentPane,
- parentPane.getSubjectHolder(),
- parent,
- automaticallyAlignWidgets,
- parentManagePane);
- }
-
- /**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- this(parentPane, subjectHolder, parent, true);
- }
-
- protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- PropertyValueModel<Boolean> enabledModel) {
-
- this(parentPane, subjectHolder, parent, true, enabledModel);
- }
-
- /**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- this(parentPane, subjectHolder, parent, automaticallyAlignWidgets, true);
- }
-
- protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets,
- PropertyValueModel<Boolean> enabledModel) {
-
- this(parentPane, subjectHolder, parent, automaticallyAlignWidgets, true, enabledModel);
- }
-
- /**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- * @param parentManagePane <code>true</code> to have the parent pane manage
- * the enabled state of this pane
- *
- * @category Constructor
- */
- protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets,
- boolean parentManagePane) {
-
- this(subjectHolder, parent, parentPane.getWidgetFactory());
- this.initialize(parentPane, automaticallyAlignWidgets, parentManagePane);
- }
-
- protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets,
- boolean parentManagePane,
- PropertyValueModel<Boolean> enabledModel) {
-
- this(subjectHolder, parent, parentPane.getWidgetFactory());
- this.initialize(parentPane, automaticallyAlignWidgets, parentManagePane);
- this.initializeEnabledModel(enabledModel);
- }
-
- /**
- * Creates a new <code>Pane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- *
- * @category Constructor
- */
- protected Pane(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super();
- this.initialize(subjectHolder, widgetFactory);
- this.container = this.addContainer(parent);
- this.initializeLayout(this.container);
- this.engageSubjectHolder();
- this.engageListeners(getSubject());
- this.populate();
- }
-
-
- // ********** initialization **********
-
- @SuppressWarnings("unchecked")
- private void initialize(
- PropertyValueModel<? extends T> subjectHolder,
- WidgetFactory widgetFactory) {
-
- Assert.isNotNull(subjectHolder, "The subject holder cannot be null");
-
- this.subjectHolder = (PropertyValueModel<T>) subjectHolder;
- this.widgetFactory = widgetFactory;
- this.subPanes = new ArrayList<Pane<?>>();
- this.managedWidgets = new ArrayList<Control>();
- this.managedSubPanes = new ArrayList<Pane<?>>();
- this.leftControlAligner = new ControlAligner();
- this.rightControlAligner = new ControlAligner();
- this.subjectChangeListener = this.buildSubjectChangeListener();
- this.aspectChangeListener = this.buildAspectChangeListener();
-
- this.initialize();
- }
-
- protected void initialize() {
- // do nothing by default
- }
-
- /**
- * Registers this pane with the parent pane.
- *
- * @param parentPane The parent pane
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- * @param parentManagePane <code>true</code> to have the parent pane manage
- * the enabled state of this pane
- *
- * @category Initialization
- */
- private void initialize(
- Pane<?> parentPane,
- boolean automaticallyAlignWidgets,
- boolean parentManagePane) {
-
- // Register this pane with the parent pane, it will call the methods
- // automatically (engageListeners(), disengageListeners(), populate(),
- // dispose(), etc)
- parentPane.registerSubPane(this);
-
- if (parentManagePane) {
- parentPane.manageSubPane(this);
- }
-
- // Align the left and right controls with the controls from the parent
- // pane
- if (automaticallyAlignWidgets) {
- parentPane.addAlignLeft(this);
- parentPane.addAlignRight(this);
- }
- }
-
- private void initializeEnabledModel(PropertyValueModel<Boolean> enabledModel) {
- this.controllerEnabledModel = enabledModel;
- this.combinedEnabledModel =
- CompositeBooleanPropertyValueModel.and(this.baseEnabledModel, this.controllerEnabledModel);
- this.combinedEnabledModelListener = buildCombinedEnabledModelListener();
- this.combinedEnabledModel.addPropertyChangeListener(
- PropertyValueModel.VALUE, this.combinedEnabledModelListener);
- enableWidgets_(getCombinedEnablement());
- }
-
- private PropertyChangeListener buildCombinedEnabledModelListener() {
- return new SWTPropertyChangeListenerWrapper(buildControllerEnabledModelListener_());
- }
-
- private PropertyChangeListener buildControllerEnabledModelListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent e) {
- Pane.this.controllerEnablementChanged();
- }
- };
- }
-
- /**
- * Initializes the layout of this pane.
- *
- * @param container The parent container
- *
- * @category Layout
- */
- protected abstract void initializeLayout(Composite container);
-
- private void manageWidget(Control control) {
- if (this.managedWidgets.contains(control)) {
- throw new IllegalStateException();
- }
- this.managedWidgets.add(control);
- }
-
- private void manageSubPane(Pane<?> subPane) {
- if (this.managedSubPanes.contains(subPane)) {
- throw new IllegalStateException();
- }
- this.managedSubPanes.add(subPane);
- }
-
- /**
- * Adds the given pane's widgets (those that were registered with its
- * left <code>ControlAligner</code>) to this pane's left
- * <code>ControlAligner</code> so that their width can be adjusted to have
- * the width of the widest widget.
- *
- * @param pane The pane containing the widgets to add
- *
- * @category Layout
- */
- protected final void addAlignLeft(Pane<?> container) {
- this.leftControlAligner.add(container.leftControlAligner);
- }
-
- /**
- * Adds the given control to the collection of widgets that have their width
- * adjust with the width of the widest widget. The left alignment is usually
- * used for labels.
- *
- * @param pane The pane to add
- *
- * @category Layout
- */
- protected final void addAlignLeft(Control control) {
- this.leftControlAligner.add(control);
- }
-
- /**
- * Adds the given pane's widgets (those that were registered with its
- * right <code>ControlAligner</code>) to this pane's right
- * <code>ControlAligner</code> so that their width can be adjusted to have
- * the width of the widest widget.
- *
- * @param pane The pane containing the widgets to add
- *
- * @category Layout
- */
- protected final void addAlignRight(Pane<?> container) {
- this.rightControlAligner.add(container.rightControlAligner);
- }
-
- /**
- * Adds the given control to the collection of widgets that have their width
- * adjust with the width of the widest widget. The left alignment is usually
- * used for buttons.
- *
- * @param pane The pane to add
- *
- * @category Layout
- */
- protected final void addAlignRight(Control control) {
- this.rightControlAligner.add(control);
- }
-
- /**
- * Adds the given pane's controls (those that were registered for
- * alignment) from this pane.
- *
- * @param pane The pane containing the widgets to add for
- * alignment
- *
- * @category Layout
- */
- protected final void addPaneForAlignment(Pane<?> container) {
- addAlignLeft(container);
- addAlignRight(container);
- }
-
- /**
- * Adds any property names to the given collection in order to be notified
- * when the actual property changes in the subject.
- *
- * @param propertyNames The collection of property names to register with the
- * subject
- */
- protected void addPropertyNames(Collection<String> propertyNames) {
- }
-
- private PropertyChangeListener buildAspectChangeListener() {
- return new SWTPropertyChangeListenerWrapper(buildAspectChangeListener_());
- }
-
- private PropertyChangeListener buildAspectChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- //subject() could have changed or is null because of the possibility of
- //"jumping" on the UI thread here and a selection change occuring
- if (e.getSource() == getSubject()) {
- updatePane(e.getPropertyName());
- }
- }
- };
- }
-
- /**
- * Creates a new button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button addButton(Composite container,
- String text,
- final Runnable buttonAction) {
-
- return this.addButton(container, text, null, buttonAction);
- }
-
- /**
- * Creates a new unmanaged <code>Button</code> widget. Unmanaged means
- * that this Pane will not handle the enabling/disabling of this widget.
- * The owning object will handle it with its own PaneEnabler or ControlEnabler.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button addUnmanagedButton(Composite container,
- String text,
- final Runnable buttonAction) {
-
- return this.addUnmanagedButton(container, text, null, buttonAction);
- }
-
- /**
- * Creates a new button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param helpId The topic help ID to be registered for the new check box
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button addButton(Composite container,
- String text,
- String helpId,
- final Runnable buttonAction) {
-
- Button button = addUnmanagedButton(container, text, helpId, buttonAction);
- this.manageWidget(button);
-
- return button;
- }
-
- /**
- * Creates a new unmanaged <code>Button</code> widget. Unmanaged means
- * that this Pane will not handle the enabling/disabling of this widget.
- * The owning object will handle it with its own PaneEnabler or ControlEnabler.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param helpId The topic help ID to be registered for the new check box
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- private Button addUnmanagedButton(Composite container,
- String text,
- String helpId,
- final Runnable buttonAction) {
-
- Button button = this.widgetFactory.createButton(container, text);
- button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- SWTUtil.asyncExec(buttonAction);
- }
- });
-
- if (helpId != null) {
- getHelpSystem().setHelp(button, helpId);
- }
-
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = false;
- gridData.horizontalAlignment = GridData.FILL;
- button.setLayoutData(gridData);
-
- return button;
- }
-
- /**
- * This layout will leave space for decorations on widgets.
- * Whether decorated or not, all of the widgets need the same indent
- * so that they align properly.
- */
- protected GridData getFieldGridData() {
- int margin = FieldDecorationRegistry.getDefault()
- .getMaximumDecorationWidth();
- GridData data = new GridData();
- data.horizontalAlignment = SWT.FILL;
- data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + margin;
- data.horizontalIndent = margin;
- data.grabExcessHorizontalSpace = true;
- return data;
- }
-
- /**
- * Creates a new check box using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @param helpId The topic help ID to be registered for the new check box
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button addCheckBox(
- Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId) {
-
- return this.addToggleButton(
- parent,
- buttonText,
- booleanHolder,
- helpId,
- SWT.CHECK);
- }
-
- protected final Button addCheckBox(
- Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId,
- PropertyValueModel<Boolean> enabledModel) {
-
- Button button = this.addUnmanagedToggleButton(parent, buttonText, booleanHolder, helpId, SWT.CHECK);
- this.controlEnabledState(enabledModel, button);
- return button;
- }
-
- /**
- * Creates a new <code>Section</code> that can be collapsed. A sub-pane is
- * automatically added as its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addCollapsibleSection(
- Composite container,
- String sectionText) {
-
- return this.addCollapsibleSection(
- container,
- sectionText,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE));
- }
-
- /**
- * Creates a new <code>Section</code> that can be collapsed. A sub-pane is
- * automatically added as its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param description The section's description or <code>null</code> if none
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addCollapsibleSection(Composite container,
- String sectionText,
- String description) {
-
- return this.addCollapsibleSection(
- container,
- sectionText,
- description,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param type The type of section to create
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- private Composite addCollapsibleSection(Composite container,
- String sectionText,
- int type,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- return addCollapsibleSection(container, sectionText, null, type, expandedStateHolder);
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param description The section's description or <code>null</code> if none
- * was provided
- * @param type The type of section to create
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- private Composite addCollapsibleSection(Composite container,
- String sectionText,
- String description,
- int type,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- Composite subPane = this.addSection(
- container,
- sectionText,
- description,
- ExpandableComposite.TWISTIE | type
- );
-
- Section section = (Section) subPane.getParent();
-
- expandedStateHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildExpandedStateChangeListener(section)
- );
-
- section.setExpanded(
- expandedStateHolder.getValue() != null ? expandedStateHolder.getValue() : true
- );
-
- return subPane;
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addCollapsibleSection(Composite container,
- String sectionText,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- return this.addCollapsibleSection(
- container,
- sectionText,
- ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE,
- expandedStateHolder
- );
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param description The section's description or <code>null</code> if none
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addCollapsibleSection(Composite container,
- String sectionText,
- String description,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- return this.addCollapsibleSection(
- container,
- sectionText,
- description,
- ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE,
- expandedStateHolder
- );
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client which can be typed cast directly as a <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addCollapsibleSubSection(Composite container,
- String sectionText,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- return this.addCollapsibleSection(
- container,
- sectionText,
- SWT.NULL,
- expandedStateHolder
- );
- }
-
- /**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final Combo addCombo(Composite container) {
- Combo combo = this.addUnmanagedCombo(container);
- this.manageWidget(combo);
- return combo;
- }
-
- /**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- private Combo addUnmanagedCombo(Composite container) {
- Combo combo = this.widgetFactory.createCombo(container);
- combo.setLayoutData(getFieldGridData());
- return combo;
- }
-
- /**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param container The parent container
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final <V> Combo addCombo(Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter) {
-
- Combo combo = this.addCombo(container);
-
- ComboModelAdapter.adapt(
- listHolder,
- selectedItemHolder,
- combo,
- stringConverter
- );
-
- return combo;
- }
-
- /**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param container The parent container
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- private <V> Combo addUnmanagedCombo(Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter) {
-
- Combo combo = this.addUnmanagedCombo(container);
-
- ComboModelAdapter.adapt(
- listHolder,
- selectedItemHolder,
- combo,
- stringConverter
- );
-
- return combo;
- }
-
- protected final <V> Combo addCombo(
- Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- PropertyValueModel<Boolean> enabledModel) {
-
- Combo combo = this.addUnmanagedCombo(container, listHolder, selectedItemHolder, stringConverter);
- this.controlEnabledState(enabledModel, combo);
- return combo;
- }
-
- /**
- * Creates a new <code>ComboViewer</code> using a <code>Combo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer addComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- Combo combo = this.addCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- /**
- * Creates the main container of this pane. The layout and layout data are
- * automatically set.
- *
- * @param parent The parent container
- * @return The newly created <code>Composite</code> that will holds all the
- * widgets created by this pane through {@link #initializeLayout(Composite)}
- *
- * @category Layout
- */
- protected Composite addContainer(Composite parent) {
- return this.addSubPane(parent);
- }
-
- protected final <V> Combo addEditableCombo(
- Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- PropertyValueModel<Boolean> enabledModel) {
-
- Combo combo = this.addUnmanagedEditableCombo(container, listHolder, selectedItemHolder, stringConverter);
- this.controlEnabledState(enabledModel, combo);
- return combo;
- }
-
- protected final Combo addEditableCombo(
- Composite container) {
-
- Combo combo = this.widgetFactory.createEditableCombo(container);
- combo.setLayoutData(getFieldGridData());
- this.manageWidget(combo);
- return combo;
- }
-
- /**
- * Creates a new editable <code>Combo</code>.
- *
- * @param container The parent container
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final <V> Combo addEditableCombo(Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter) {
-
- Combo combo = this.addEditableCombo(container);
-
- ComboModelAdapter.adapt(
- listHolder,
- selectedItemHolder,
- combo,
- stringConverter
- );
-
- return combo;
- }
-
- /**
- * Creates a new editable <code>ComboViewer</code> using a <code>Combo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer addEditableComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- Combo combo = this.addEditableCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- private PropertyChangeListener buildExpandedStateChangeListener(final Section section) {
- return new SWTPropertyChangeListenerWrapper(buildExpandedStateChangeListener_(section));
- }
-
- private PropertyChangeListener buildExpandedStateChangeListener_(final Section section) {
- return new PropertyChangeListener() {
- public void propertyChanged(final PropertyChangeEvent e) {
- Boolean value = (Boolean) e.getNewValue();
- if (value == null) {
- value = Boolean.TRUE;
- }
- section.setExpanded(value);
- }
- };
- }
-
- /**
- * Creates a new <code>Hyperlink</code> that will invoked the given
- * <code>Runnable</code> when selected. The given action is always invoked
- * from the UI thread.
- *
- * @param parent The parent container
- * @param text The hyperlink's text
- * @param hyperLinkAction The action to be invoked when the link was selected
- * return The newly created <code>Hyperlink</code>
- *
- * @category Layout
- */
- protected final Hyperlink addHyperlink(Composite parent,
- String text,
- final Runnable hyperLinkAction) {
-
- Hyperlink link = this.widgetFactory.createHyperlink(parent, text);
- this.manageWidget(link);
-
- link.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseUp(MouseEvent e) {
-
- Hyperlink hyperLink = (Hyperlink) e.widget;
-
- if (hyperLink.isEnabled()) {
- SWTUtil.asyncExec(hyperLinkAction);
- }
- }
- });
-
- return link;
- }
-
- /**
- * Creates a new label using the given information.
- *
- * @param parent The parent container
- * @param labelText The label's text
- *
- * @category Layout
- */
- protected final Label addLabel(Composite container,
- String labelText) {
-
- Label label = addUnmanagedLabel(container, labelText);
- manageWidget(label);
- return label;
- }
-
- protected final Label addLabel(
- Composite container,
- String labelText,
- PropertyValueModel<Boolean> enabledModel
- ) {
- Label label = this.addUnmanagedLabel(container, labelText);
- this.controlEnabledState(enabledModel, label);
- return label;
- }
-
- /**
- * Creates a new unmanaged <code>Label</code> widget. Unmanaged means
- * that this Pane will not handle the enabling/disabling of this widget.
- * The owning object will handle it with its own PaneEnabler or ControlEnabler.
- *
- * @param parent The parent container
- * @param labelText The label's text
- *
- * @category Layout
- */
- private Label addUnmanagedLabel(Composite container,
- String labelText) {
-
- return this.widgetFactory.createLabel(container, labelText);
- }
-
- /**
- * Creates a new container that will have a non-editable combo labeled with
- * the given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final <V> Combo addLabeledCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- Control rightControl,
- String helpId) {
-
- Combo combo = this.addCombo(
- container,
- listHolder,
- selectedItemHolder,
- stringConverter
- );
-
- this.addLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have a non-editable combo labeled with
- * the given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final <V> Combo addLabeledCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- String helpId) {
-
- return this.addLabeledCombo(
- container,
- labelText,
- listHolder,
- selectedItemHolder,
- stringConverter,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite addLabeledComposite(Composite container,
- Control leftControl,
- Control centerControl,
- Control rightControl,
- String helpId) {
-
- // Container for the label and main composite
- container = this.addSubPane(container, 3, 0, 0, 0, 0);
-
- // Left control
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.BEGINNING;
- gridData.grabExcessHorizontalSpace = false;
- leftControl.setLayoutData(gridData);
-
- // Re-parent the left control to the new sub pane
- leftControl.setParent(container);
- this.addAlignLeft(leftControl);
-
-
- // Re-parent the center control to the new sub pane
- centerControl.setParent(container);
-
- // Register the help id for the center control
- if (helpId != null) {
- getHelpSystem().setHelp(centerControl, helpId);
- }
-
- // Right control
- if (rightControl == null) {
- Composite spacer = this.addPane(container);
- spacer.setLayout(this.buildSpacerLayout());
- rightControl = spacer;
- }
- else {
- rightControl.setParent(container);
-
- // Register the help id for the right control
- if (helpId != null) {
- getHelpSystem().setHelp(rightControl, helpId);
- }
- }
-
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
- gridData.grabExcessHorizontalSpace = false;
-
- rightControl.setLayoutData(gridData);
- this.addAlignRight(rightControl);
-
- return container;
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param label The label used to describe the center control
- * @param centerControl The main widget
- * @param helpId The topic help ID to be registered for the given center
- * control
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite addLabeledComposite(Composite container,
- Control label,
- Control centerControl,
- String helpId) {
-
- return this.addLabeledComposite(
- container,
- label,
- centerControl,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerPane The main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite addLabeledComposite(Composite container,
- String labelText,
- Pane<?> centerPane,
- String helpId) {
-
- return this.addLabeledComposite(
- container,
- labelText,
- centerPane.getControl(),
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerControl The main widget
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite addLabeledComposite(Composite container,
- String labelText,
- Control centerControl) {
-
-
- return this.addLabeledComposite(
- container,
- labelText,
- centerControl,
- null,
- null
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite addLabeledComposite(Composite container,
- String labelText,
- Control centerControl,
- Control rightControl,
- String helpId) {
-
- return this.addLabeledComposite(
- container,
- this.addLabel(container, labelText),
- centerControl,
- rightControl,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerControl The main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite addLabeledComposite(Composite container,
- String labelText,
- Control centerControl,
- String helpId) {
-
- Label label = this.addLabel(container, labelText);
-
- return this.addLabeledComposite(
- container,
- label,
- centerControl,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final Combo addLabeledEditableCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- Control rightControl,
- String helpId) {
-
- Combo combo = this.addEditableCombo(container);
- combo.addModifyListener(comboListener);
-
- this.addLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param comboListener The listener that will be notified when the selection
- * changes
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final Combo addLabeledEditableCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- String helpId) {
-
- return this.addLabeledEditableCombo(
- container,
- labelText,
- comboListener,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final Combo addLabeledEditableComboViewer(Composite container,
- String labelText,
- ModifyListener comboListener,
- ILabelProvider labelProvider,
- Control rightControl,
- String helpId) {
-
- ComboViewer comboViewer = this.addEditableComboViewer(
- container,
- labelProvider
- );
-
- Combo combo = comboViewer.getCombo();
- combo.addModifyListener(comboListener);
-
- this.addLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param comboListener The listener that will be notified when the selection
- * changes
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final Combo addLabeledEditableComboViewer(Composite container,
- String labelText,
- ModifyListener comboListener,
- ILabelProvider labelProvider,
- String helpId) {
-
- return this.addLabeledEditableComboViewer(
- container,
- labelText,
- comboListener,
- labelProvider,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final <V> Combo addLabeledEditableCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- String helpId) {
-
- return this.addLabeledEditableCombo(
- container,
- labelText,
- listHolder,
- selectedItemHolder,
- StringConverter.Default.<V>instance(),
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final <V> Combo addLabeledEditableCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- Control rightControl,
- String helpId) {
-
- Combo combo = this.addEditableCombo(
- container,
- listHolder,
- selectedItemHolder,
- stringConverter
- );
-
- this.addLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @param helpId The topic help ID to be registered for the given center
- * composite
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final <V> Combo addLabeledEditableCombo(Composite container,
- String labelText,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter,
- String helpId) {
-
- return this.addLabeledEditableCombo(
- container,
- labelText,
- listHolder,
- selectedItemHolder,
- stringConverter,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param labelText The text area's label
- * @param textHolder The holder of the text field's input
- * @param lineCount The number of lines the text area should display
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledMultiLineText(Composite container,
- String labelText,
- WritablePropertyValueModel<String> textHolder,
- int lineCount,
- String helpId) {
-
- Text text = this.addMultiLineText(container, textHolder, lineCount);
-
- container = this.addLabeledComposite(
- container,
- labelText,
- text,
- helpId
- );
-
- int textHeight = text.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
-
- // Specify the number of lines the text area should display
- GridData gridData = (GridData) text.getLayoutData();
- gridData.heightHint = text.getLineHeight() * lineCount;
-
- // Move the label to the top of its cell
- Control label = container.getChildren()[0];
- int labelHeight = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
-
- gridData = (GridData) label.getLayoutData();
- gridData.verticalAlignment = SWT.TOP;
- gridData.verticalIndent += (Math.abs(textHeight - labelHeight) / 2);
-
- return text;
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledPasswordText(Composite container,
- String labelText,
- WritablePropertyValueModel<String> textHolder) {
-
- return this.addLabeledPasswordText(
- container,
- labelText,
- textHolder,
- null
- );
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param labelText The text field's label
- * @param rightComponent The component to be placed to the right of the text
- * field
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledPasswordText(Composite container,
- String labelText,
- WritablePropertyValueModel<String> textHolder,
- Control rightControl,
- String helpId) {
-
- Text text = this.addPasswordText(container, textHolder);
-
- this.addLabeledComposite(
- container,
- labelText,
- text,
- rightControl,
- helpId
- );
-
- return text;
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledPasswordText(Composite container,
- String labelText,
- WritablePropertyValueModel<String> textHolder,
- String helpId) {
-
- return this.addLabeledPasswordText(
- container,
- labelText,
- textHolder,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new spinner.
- *
- * @param parent The parent container
- * @param labelText The label's text
- * @param numberHolder The holder of the integer value
- * @param defaultValue The value shown when the holder has <code>null</code>
- * @param minimumValue The minimum value that the spinner will allow
- * @param maximumValue The maximum value that the spinner will allow
- * @param rightControl The widget to be placed to the right of spinner
- * @param helpId The topic help ID to be registered for the spinner
- * @return The newly created <code>Spinner</code>
- *
- * @category Layout
- */
- protected final Spinner addLabeledSpinner(Composite parent,
- String labelText,
- WritablePropertyValueModel<Integer> numberHolder,
- int defaultValue,
- int minimumValue,
- int maximumValue,
- Control rightControl,
- String helpId) {
-
- Spinner spinner = this.addSpinner(
- parent,
- numberHolder,
- defaultValue,
- minimumValue,
- maximumValue,
- helpId
- );
- Label label = addLabel(parent, labelText);
- addLabeledComposite(
- parent,
- label,
- (spinner.getParent() != parent) ? spinner.getParent() : spinner,
- rightControl,
- helpId
- );
-
- GridData gridData = (GridData) spinner.getLayoutData();
- gridData.horizontalAlignment = GridData.BEGINNING;
-
- return spinner;
- }
-
- /**
- * Creates a new managed spinner. Managed means that this Pane will
- * handle enabling/disabling of this widget if a PaneEnabler is used.
- *
- * @param parent The parent container
- * @param numberHolder The holder of the integer value
- * @param defaultValue The value shown when the holder has <code>null</code>
- * @param minimumValue The minimum value that the spinner will allow
- * @param maximumValue The maximum value that the spinner will allow
- * @param helpId The topic help ID to be registered for the new button
- * @return The newly created <code>Spinner</code>
- *
- * @category Layout
- */
- protected final Spinner addSpinner(Composite parent,
- WritablePropertyValueModel<Integer> numberHolder,
- int defaultValue,
- int minimumValue,
- int maximumValue,
- String helpId) {
-
- Spinner spinner = addUnmanagedSpinner(parent, numberHolder, defaultValue, minimumValue, maximumValue, helpId);
- this.manageWidget(spinner);
- return spinner;
- }
-
- /**
- * Creates a new unmanaged spinner. Unmanaged means that this Pane will
- * not handle the enabling/disabling of this widget. The owning object will handle
- * it with its own PaneEnabler or ControlEnabler.
- *
- * @param parent The parent container
- * @param numberHolder The holder of the integer value
- * @param defaultValue The value shown when the holder has <code>null</code>
- * @param minimumValue The minimum value that the spinner will allow
- * @param maximumValue The maximum value that the spinner will allow
- * @param helpId The topic help ID to be registered for the new button
- * @return The newly created <code>Spinner</code>
- *
- * @category Layout
- */
- private Spinner addUnmanagedSpinner(Composite parent,
- WritablePropertyValueModel<Integer> numberHolder,
- int defaultValue,
- int minimumValue,
- int maximumValue,
- String helpId) {
-
- Spinner spinner = this.widgetFactory.createSpinner(parent);
- spinner.setMinimum(minimumValue);
- spinner.setMaximum(maximumValue);
- GridData gridData = getFieldGridData();
- gridData.grabExcessHorizontalSpace = false;
- spinner.setLayoutData(gridData);
-
- SpinnerModelAdapter.adapt(numberHolder, spinner, defaultValue);
-
- if (helpId != null) {
- getHelpSystem().setHelp(spinner, helpId);
- }
-
- return spinner;
- }
-
- /**
- * Creates a new managed DateTime of type SWT.TIME. Managed means that this Pane will
- * handle enabling/disabling of this widget if a PaneEnabler is used.
- *
- * @param parent The parent container
- * @param hoursHolder The holder of the hours integer value
- * @param minutesHolder The holder of the minutes integer value
- * @param secondsHolder The holder of the seconds integer value
- * @param helpId The topic help ID to be registered for the new dateTime
- * @return The newly created <code>DateTime</code>
- *
- * @category Layout
- */
- protected final DateTime addDateTime(Composite parent,
- WritablePropertyValueModel<Integer> hoursHolder,
- WritablePropertyValueModel<Integer> minutesHolder,
- WritablePropertyValueModel<Integer> secondsHolder,
- String helpId) {
-
- DateTime dateTime = this.addUnmanagedDateTime(parent, hoursHolder, minutesHolder, secondsHolder, helpId);
- this.manageWidget(dateTime);
-
- return dateTime;
- }
-
- protected final DateTime addDateTime(
- Composite parent,
- WritablePropertyValueModel<Integer> hoursHolder,
- WritablePropertyValueModel<Integer> minutesHolder,
- WritablePropertyValueModel<Integer> secondsHolder,
- String helpId,
- PropertyValueModel<Boolean> enabledModel
- ) {
- DateTime dateTime = this.addUnmanagedDateTime(parent, hoursHolder, minutesHolder, secondsHolder, helpId);
- this.controlEnabledState(enabledModel, dateTime);
- return dateTime;
- }
-
- /**
- * Creates a new unmanaged DateTime of type SWT.TIME. Unmanaged means that this Pane will
- * not handle the enabling/disabling of this widget. The owning object will handle
- * it with its own PaneEnabler or ControlEnabler.
- *
- * @param parent The parent container
- * @param hoursHolder The holder of the hours integer value
- * @param minutesHolder The holder of the minutes integer value
- * @param secondsHolder The holder of the seconds integer value
- * @param helpId The topic help ID to be registered for the new dateTime
- * @return The newly created <code>DateTime</code>
- *
- * @category Layout
- */
- private DateTime addUnmanagedDateTime(Composite parent,
- WritablePropertyValueModel<Integer> hoursHolder,
- WritablePropertyValueModel<Integer> minutesHolder,
- WritablePropertyValueModel<Integer> secondsHolder,
- String helpId) {
-
- DateTime dateTime = this.widgetFactory.createDateTime(parent, SWT.TIME);
-
- DateTimeModelAdapter.adapt(hoursHolder, minutesHolder, secondsHolder, dateTime);
-
- if (helpId != null) {
- getHelpSystem().setHelp(dateTime, helpId);
- }
-
- return dateTime;
- }
- /**
- * Creates a new editable <code>Combo</code>.
- *
- * @param container The parent container
- * @param listHolder The <code>ListValueHolder</code>
- * @param selectedItemHolder The holder of the selected item
- * @param stringConverter The converter responsible to transform each item
- * into a string representation
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- private <V> Combo addUnmanagedEditableCombo(Composite container,
- ListValueModel<V> listHolder,
- WritablePropertyValueModel<V> selectedItemHolder,
- StringConverter<V> stringConverter) {
-
- Combo combo = addUnmanagedEditableCombo(container);
-
- ComboModelAdapter.adapt(
- listHolder,
- selectedItemHolder,
- combo,
- stringConverter
- );
-
- return combo;
- }
-
-
- /**
- * Creates a new editable <code>Combo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- private Combo addUnmanagedEditableCombo(Composite container) {
-
- Combo combo = this.widgetFactory.createEditableCombo(container);
- combo.setLayoutData(getFieldGridData());
- return combo;
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledText(Composite container,
- String labelText,
- WritablePropertyValueModel<String> textHolder) {
-
- return this.addLabeledText(container, labelText, textHolder, null);
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param labelText The text field's label
- * @param rightComponent The component to be placed to the right of the text
- * field
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledText(Composite container,
- String labelText,
- WritablePropertyValueModel<String> textHolder,
- Control rightComponent,
- String helpId) {
-
- Text text = this.addText(container, textHolder);
-
- this.addLabeledComposite(
- container,
- labelText,
- text,
- rightComponent,
- helpId
- );
-
- return text;
- }
- /**
- *
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param labelText The text field's label
- * @param rightComponent The component to be placed to the right of the text
- * field
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledText(Composite container,
- Label label,
- WritablePropertyValueModel<String> textHolder,
- Control rightComponent,
- String helpId) {
-
- Text text = this.addText(container, textHolder);
-
- this.addLabeledComposite(
- container,
- label,
- text,
- rightComponent,
- helpId
- );
-
- return text;
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledText(Composite container,
- String labelText,
- WritablePropertyValueModel<String> textHolder,
- String helpId) {
-
- return this.addLabeledText(
- container,
- labelText,
- textHolder,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text addLabeledText(Composite container,
- Label label,
- WritablePropertyValueModel<String> textHolder,
- String helpId) {
-
- return this.addLabeledText(
- container,
- label,
- textHolder,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new list and notify the given selection holder when the
- * selection changes. If the selection count is different than one than the
- * holder will receive <code>null</code>.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>List</code>
- *
- * @category Layout
- */
- protected final List addList(Composite container, String helpId) {
-
- return this.addList(
- container,
- new SimplePropertyValueModel<String>(),
- helpId
- );
- }
-
- /**
- * Creates a new list and notify the given selection holder when the
- * selection changes. If the selection count is different than one than the
- * holder will receive <code>null</code>.
- *
- * @param container The parent container
- * @param selectionHolder The holder of the unique selected item
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>List</code>
- *
- * @category Layout
- */
- protected final List addList(Composite container,
- WritablePropertyValueModel<String> selectionHolder,
- String helpId) {
-
- List list = this.addUnmanagedList(container, selectionHolder, helpId);
- this.manageWidget(list);
-
- return list;
- }
-
- /**
- * Creates a new unmanaged list and notify the given selection holder when the
- * selection changes. If the selection count is different than one than the
- * holder will receive <code>null</code>.
- * Unmanaged means that this Pane will not handle the enabling/disabling of this widget.
- * The owning object will handle it with its own PaneEnabler or ControlEnabler.
- *
- * @param container The parent container
- * @param selectionHolder The holder of the unique selected item
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>List</code>
- *
- * @category Layout
- */
- private List addUnmanagedList(Composite container,
- WritablePropertyValueModel<String> selectionHolder,
- String helpId) {
-
- List list = this.widgetFactory.createList(
- container,
- SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI
- );
-
- list.addSelectionListener(buildSelectionListener(selectionHolder));
- list.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- if (helpId != null) {
- getHelpSystem().setHelp(list, helpId);
- }
-
- return list;
- }
-
- /**
- * Creates a new lable expanding on multiple lines.
- *
- * @param parent The parent container
- * @param labelText The label's text
- *
- * @category Layout
- */
- protected final FormText addMultiLineLabel(Composite container,
- String labelText) {
-
- FormText label = this.widgetFactory.createMultiLineLabel(container, labelText);
- manageWidget(label);
- return label;
- }
-
- /**
- * Creates a new <code>Text</code> widget that has multiple lines.
- *
- * @param container The parent container
- * @return The newly created <code>Text</code> widget
- *
- */
- protected final Text addMultiLineText(Composite container) {
-
- Text text = this.widgetFactory.createMultiLineText(container);
- text.setLayoutData(getFieldGridData());
- this.manageWidget(text);
-
- return text;
- }
-
- /**
- * Creates a new <code>Text</code> widget that has multiple lines.
- *
- * @param container The parent container
- * @param lineCount The number of lines the text area should display
- * @param helpId The topic help ID to be registered for the new text
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addMultiLineText(Composite container,
- int lineCount,
- String helpId) {
-
- Text text = this.addMultiLineText(container);
- adjustMultiLineTextLayout(container, lineCount, text, text.getLineHeight());
-
- if (helpId != null) {
- getHelpSystem().setHelp(text, helpId);
- }
-
- return text;
- }
-
- /**
- * Creates a new <code>Text</code> widget that has multiple lines.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @param lineCount The number of lines the text area should display
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addMultiLineText(Composite container,
- WritablePropertyValueModel<String> textHolder,
- int lineCount) {
-
- return this.addMultiLineText(container, textHolder, lineCount, null);
- }
-
- /**
- * Creates a new <code>Text</code> widget that has multiple lines.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the new text
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addMultiLineText(Composite container,
- WritablePropertyValueModel<String> textHolder,
- int lineCount,
- String helpId) {
-
- Text text = this.addMultiLineText(container, lineCount, helpId);
- SWTTools.bind(textHolder, text);
- return text;
- }
-
- /**
- * Adjusts the layout of the given container so that the text control has the correct amount of
- * lines by default.
- */
- protected final void adjustMultiLineTextLayout(Composite container,
- int lineCount,
- Control text,
- int lineHeight) {
-
- int textHeight = text.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
-
- // Specify the number of lines the text area should display
- GridData gridData = (GridData) text.getLayoutData();
- if (gridData == null) {
- gridData = this.getFieldGridData();
- text.setLayoutData(gridData);
- }
- gridData.heightHint = lineHeight * lineCount;
-
- // Move the label to the top of its cell
- Control label = container.getChildren()[0];
- int labelHeight = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
-
- gridData = (GridData) label.getLayoutData();
- gridData.verticalAlignment = SWT.TOP;
- gridData.verticalIndent += (Math.abs(textHeight - labelHeight) / 2);
- }
- /**
- * Creates a new <code>PageBook</code> and set the proper layout and layout
- * data.
- *
- * @param container The parent container
- * @return The newly created <code>PageBook</code>
- *
- * @category Layout
- */
- protected final PageBook addPageBook(Composite container) {
-
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- return pageBook;
- }
-
- /**
- * Creates a new container without specifying any layout manager.
- *
- * @param container The parent of the new container
- * @return The newly created <code>Composite</code>
- *
- * @category Layout
- */
- protected final Composite addPane(Composite parent) {
- return this.widgetFactory.createComposite(parent);
- }
-
- /**
- * Creates a new container using the given layout manager.
- *
- * @param parent The parent of the new container
- * @param layout The layout manager of the new container
- * @return The newly created container
- *
- * @category Layout
- */
- protected final Composite addPane(Composite container, Layout layout) {
-
- container = this.addPane(container);
- container.setLayout(layout);
- container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- return container;
- }
-
- /**
- * Creates a new <code>Text</code> widget.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addPasswordText(Composite container,
- WritablePropertyValueModel<String> textHolder) {
-
- Text text = this.addPasswordText(container);
- SWTTools.bind(textHolder, text);
-
- return text;
- }
-
- /**
- * Creates a new <code>Text</code> widget.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addPasswordText(Composite container) {
-
- Text text = this.widgetFactory.createPasswordText(container);
- text.setLayoutData(getFieldGridData());
-
- this.manageWidget(text);
- return text;
- }
-
- /**
- * Creates a new push button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button addPushButton(Composite parent,
- String buttonText,
- final Runnable buttonAction) {
-
- return this.addPushButton(parent, buttonText, null, buttonAction);
- }
-
- /**
- * Creates a new push button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param buttonAction The action to be invoked when the button is pressed
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button addPushButton(Composite parent,
- String buttonText,
- String helpId,
- final Runnable buttonAction) {
-
- Button button = this.widgetFactory.createPushButton(parent, buttonText);
- manageWidget(button);
- button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- SWTUtil.asyncExec(buttonAction);
- }
- });
-
- button.setLayoutData(new GridData());
-
- if (helpId != null) {
- getHelpSystem().setHelp(button, helpId);
- }
-
- return button;
- }
-
- /**
- * Creates a new check box using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button addRadioButton(Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId) {
-
- return this.addToggleButton(
- parent,
- buttonText,
- booleanHolder,
- helpId,
- SWT.RADIO
- );
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addSection(Composite container,
- String sectionText) {
-
- return this.addSection(
- container,
- sectionText,
- ExpandableComposite.TITLE_BAR
- );
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param type The type of section to create
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- private Composite addSection(Composite container,
- String sectionText,
- int type) {
-
- return this.addSection(container, sectionText, null, type);
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param description The section's description
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addSection(Composite container,
- String sectionText,
- String description) {
-
- return this.addSection(
- container,
- sectionText,
- description,
- ExpandableComposite.TITLE_BAR
- );
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param description The section's description or <code>null</code> if none
- * was provider
- * @param type The type of section to create
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- private Composite addSection(Composite container,
- String sectionText,
- String description,
- int type) {
-
- Section section = this.widgetFactory.createSection(container, type | ((description != null) ? Section.DESCRIPTION : SWT.NULL));
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- section.setText(sectionText);
- section.marginWidth = 0;
- section.marginHeight = 0;
-
- if (description != null) {
- section.setDescription(description);
- }
-
- Composite subPane = this.addSubPane(section);
- section.setClient(subPane);
-
- return subPane;
- }
-
- private SelectionListener buildSelectionListener(final WritablePropertyValueModel<String> selectionHolder) {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- List list = (List) e.widget;
- String[] selectedItems = list.getSelection();
- if ((selectedItems == null) || (selectedItems.length != 1)) {
- selectionHolder.setValue(null);
- }
- else {
- selectionHolder.setValue(selectedItems[0]);
- }
- }
- };
- }
-
- /**
- * Creates the layout responsible to compute the size of the spacer created
- * for the right control when none was given. The spacer helps to align all
- * the right controls.
- *
- * @category Layout
- */
- private Layout buildSpacerLayout() {
- return new Layout() {
- @Override
- protected Point computeSize(Composite composite,
- int widthHint,
- int heightHint,
- boolean flushCache) {
-
- return new Point(widthHint, heightHint);
- }
-
- @Override
- protected void layout(Composite composite, boolean flushCache) {
- GridData data = (GridData) composite.getLayoutData();
- composite.setBounds(0, 0, data.widthHint, data.heightHint);
- }
- };
- }
-
- private PropertyChangeListener buildSubjectChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSubjectChangeListener_());
- }
-
- private PropertyChangeListener buildSubjectChangeListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent e) {
- Pane.this.subjectChanged((T) e.getOldValue(), (T) e.getNewValue());
- }
- };
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane.
- *
- * @param container The parent container
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite addSubPane(Composite container) {
- return this.addSubPane(container, 0);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite addSubPane(Composite container, int topMargin) {
- return this.addSubPane(container, topMargin, 0);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @param leftMargin The extra spacing to add to the left of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite addSubPane(Composite container,
- int topMargin,
- int leftMargin) {
-
- return this.addSubPane(container, topMargin, leftMargin, 0, 0);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane, the new widget
- * will have its layout and layout data already initialized, the layout will
- * be a <code>GridLayout</code> with 1 column.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @param leftMargin The extra spacing to add to the left of the pane
- * @param bottomMargin The extra spacing to add at the bottom of the pane
- * @param rightMargin The extra spacing to add to the right of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite addSubPane(Composite container,
- int topMargin,
- int leftMargin,
- int bottomMargin,
- int rightMargin) {
-
- return this.addSubPane(
- container,
- 1,
- topMargin,
- leftMargin,
- bottomMargin,
- rightMargin);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane, the new widget
- * will have its layout and layout data already initialized, the layout will
- * be a <code>GridLayout</code> with 1 column.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @param leftMargin The extra spacing to add to the left of the pane
- * @param bottomMargin The extra spacing to add at the bottom of the pane
- * @param rightMargin The extra spacing to add to the right of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite addSubPane(Composite container,
- int columnCount,
- int topMargin,
- int leftMargin,
- int bottomMargin,
- int rightMargin) {
-
- GridLayout layout = new GridLayout(columnCount, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = topMargin;
- layout.marginLeft = leftMargin;
- layout.marginBottom = bottomMargin;
- layout.marginRight = rightMargin;
-
- container = this.addPane(container, layout);
-
- return container;
- }
-
- /**
- * Creates a new <code>Section</code>. A sub-pane is automatically added as
- * its client which can be typed cast directly as a <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite addSubSection(Composite container,
- String sectionText) {
-
- return this.addCollapsibleSubSection(
- container,
- sectionText,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
- }
-
- /**
- * Creates a new table.
- *
- * @param container The parent container
- * @param style The style to apply to the table
- * @param helpId The topic help ID to be registered for the new table or
- * <code>null</code> if no help ID is required
- * @return The newly created <code>Table</code>
- *
- * @category Layout
- */
- protected final Table addTable(Composite container,
- int style,
- String helpId) {
-
- Table table = addUnmanagedTable(container, style, helpId);
- this.manageWidget(table);
-
- return table;
- }
- /**
- * Creates a new unmanaged table. Unmanaged means that this Pane will
- * not handle the enabling/disabling of this widget. The owning object will handle
- * it with its own PaneEnabler or ControlEnabler.
- *
- * @param container The parent container
- * @param style The style to apply to the table
- * @param helpId The topic help ID to be registered for the new table or
- * <code>null</code> if no help ID is required
- * @return The newly created <code>Table</code>
- *
- * @category Layout
- */
- protected final Table addUnmanagedTable(Composite container,
- int style,
- String helpId) {
-
- Table table = this.widgetFactory.createTable(container, style);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.heightHint = table.getItemHeight() * 4;
- table.setLayoutData(gridData);
-
- if (helpId != null) {
- getHelpSystem().setHelp(table, helpId);
- }
-
- return table;
- }
-
- /**
- * Creates a new table.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new table or
- * <code>null</code> if no help ID is required
- * @return The newly created <code>Table</code>
- *
- * @category Layout
- */
- protected final Table addTable(Composite container, String helpId) {
-
- return this.addTable(
- container,
- SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI,
- helpId
- );
- }
-
- /**
- * Creates a new unmanaged table. Unmanaged means that this Pane will
- * not handle the enabling/disabling of this widget. The owning object will handle
- * it with its own PaneEnabler or ControlEnabler.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new table or
- * <code>null</code> if no help ID is required
- * @return The newly created <code>Table</code>
- *
- * @category Layout
- */
- protected final Table addUnmanagedTable(Composite container, String helpId) {
-
- return this.addUnmanagedTable(
- container,
- SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI,
- helpId
- );
- }
-
- /**
- * Creates a new managed <code>Text</code> widget.
- *
- * @param container The parent container
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addText(Composite container) {
- Text text = this.addUnmanagedText(container);
- this.manageWidget(text);
- return text;
- }
-
- /**
- * Creates a new unmanaged <code>Text</code> widget. Unmanaged means
- * that this Pane will not handle the enabling/disabling of this widget.
- * The owning object will handle it with its own PaneEnabler or ControlEnabler.
- *
- * @param container The parent container
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- private Text addUnmanagedText(Composite container) {
- Text text = this.widgetFactory.createText(container);
- text.setLayoutData(getFieldGridData());
- return text;
- }
-
- /**
- * Creates a new <code>Text</code> widget.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new text
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addText(Composite container, String helpId) {
-
- Text text = this.addText(container);
-
- if (helpId != null) {
- getHelpSystem().setHelp(text, helpId);
- }
-
- return text;
- }
-
- /**
- * Creates a new unmanaged <code>Text</code> widget. Unmanaged means
- * that this Pane will not handle the enabling/disabling of this widget.
- * The owning object will handle it with its own PaneEnabler or ControlEnabler.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new text
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- private Text addUnmanagedText(Composite container, String helpId) {
-
- Text text = this.addUnmanagedText(container);
-
- if (helpId != null) {
- getHelpSystem().setHelp(text, helpId);
- }
-
- return text;
- }
-
- /**
- * Creates a new <code>Text</code> widget.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addText(Composite container,
- WritablePropertyValueModel<String> textHolder) {
-
- return this.addText(container, textHolder, null);
- }
-
- /**
- * Creates a new <code>Text</code> widget.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the new text
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text addText(Composite container,
- WritablePropertyValueModel<String> textHolder,
- String helpId) {
-
- Text text = this.addText(container, helpId);
- SWTTools.bind(textHolder, text);
-
- return text;
- }
-
- protected final Text addText(
- Composite container,
- WritablePropertyValueModel<String> textHolder,
- String helpId,
- PropertyValueModel<Boolean> enabledModel
- ) {
- Text text = this.addUnmanagedText(container, textHolder, helpId);
- this.controlEnabledState(enabledModel, text);
- return text;
- }
-
- /**
- * Creates a new unmanaged <code>Text</code> widget. Unmanaged means
- * that this Pane will not handle the enabling/disabling of this widget.
- * The owning object will handle it with its own PaneEnabler or ControlEnabler.
- *
- * @param container The parent container
- * @param textHolder The holder of the text field's input
- * @param helpId The topic help ID to be registered for the new text
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- private Text addUnmanagedText(Composite container,
- WritablePropertyValueModel<String> textHolder,
- String helpId) {
-
- Text text = this.addUnmanagedText(container, helpId);
- SWTTools.bind(textHolder, text);
-
- return text;
- }
-
- /**
- * Creates a new container with a titled border.
- *
- * @param title The text of the titled border
- * @param container The parent container
- * @return The newly created <code>Composite</code> with a titled border
- *
- * @category Layout
- */
- protected final Group addTitledGroup(Composite container, String title) {
- return this.addTitledGroup(container, title, null);
- }
-
- /**
- * Creates a new container with a titled border.
- *
- * @param title The text of the titled border
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new group
- * @return The newly created <code>Composite</code> with a titled border
- *
- * @category Layout
- */
- protected final Group addTitledGroup(Composite container,
- String title,
- String helpId) {
-
- return addTitledGroup(container, title, 1, helpId);
- }
-
- /**
- * Creates a new container with a titled border.
- *
- * @param title The text of the titled border
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new group
- * @return The newly created <code>Composite</code> with a titled border
- *
- * @category Layout
- */
- protected final Group addTitledGroup(Composite container,
- String title,
- int columnCount,
- String helpId) {
-
- Group group = this.widgetFactory.createGroup(container, title);
- //manageWidget(group); TODO unsure if I want to manage groups,
- //also should probably rename this addUnmanagedTitledPane
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- GridLayout layout = new GridLayout(columnCount, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 5;
- layout.marginLeft = 5;
- layout.marginBottom = 5;
- layout.marginRight = 5;
- group.setLayout(layout);
-
- if (helpId != null) {
- getHelpSystem().setHelp(group, helpId);
- }
-
- return group;
- }
-
- /**
- * Creates a new unmanaged new toggle button (radio button or check box).
- * Unmanaged means that this Pane will not handle the enabling/disabling
- * of this widget. The owning object will handle it with its own PaneEnabler
- * or ControlEnabler.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @param helpId The topic help ID to be registered for the new button
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- private Button addUnmanagedToggleButton(
- Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId,
- int toggleButtonType) {
-
- Button button;
-
- if (toggleButtonType == SWT.PUSH) {
- button = this.widgetFactory.createPushButton(parent, buttonText);
- }
- else if (toggleButtonType == SWT.RADIO) {
- button = this.widgetFactory.createRadioButton(parent, buttonText);
- }
- else if (toggleButtonType == SWT.CHECK) {
- button = this.widgetFactory.createCheckBox(parent, buttonText);
- }
- else {
- button = this.widgetFactory.createButton(parent, buttonText);
- }
-
- button.setLayoutData(new GridData());
- SWTTools.bind(booleanHolder, button);
-
- if (helpId != null) {
- getHelpSystem().setHelp(button, helpId);
- }
-
- return button;
- }
-
- /**
- * Creates a new toggle button (radio button or check box) using the given
- * information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @param helpId The topic help ID to be registered for the new button
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- private Button addToggleButton(
- Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId,
- int toggleButtonType) {
-
- Button button = addUnmanagedToggleButton(
- parent,
- buttonText,
- booleanHolder,
- helpId,
- toggleButtonType);
- this.manageWidget(button);
- return button;
- }
-
- /**
- * Creates a new check box that can have 3 selection states (selected,
- * unselected and partially selected.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param booleanHolder The holder of the boolean value where <code>null</code>
- * means partially selected
- * @param helpId The topic help ID to be registered for the new check box
- * @return The newly created <code>TriStateCheckBox</code>
- *
- * @category Layout
- */
- protected final TriStateCheckBox addTriStateCheckBox(Composite parent,
- String text,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId) {
-
- TriStateCheckBox checkBox = new TriStateCheckBox(
- parent,
- text,
- this.getWidgetFactory()
- );
-
- this.manageWidget(checkBox.getCheckBox());
-
- TriStateCheckBoxModelAdapter.adapt(
- booleanHolder,
- checkBox
- );
-
- if (helpId != null) {
- getHelpSystem().setHelp(checkBox.getCheckBox(), helpId);
- }
-
- return checkBox;
- }
-
- /**
- * Creates a new check box that can have 3 selection states (selected,
- * unselected and partially selected.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param booleanHolder The holder of the boolean value where <code>null</code>
- * means partially selected
- * @param stringHolder The holder of the string to put in parenthesis after
- * the check box's text when it is partially selected
- * @param helpId The topic help ID to be registered for the new check box
- * @return The newly created <code>TriStateCheckBox</code>
- *
- * @category Layout
- */
- protected final TriStateCheckBox addTriStateCheckBoxWithDefault(Composite parent,
- String text,
- WritablePropertyValueModel<Boolean> booleanHolder,
- PropertyValueModel<String> stringHolder,
- String helpId) {
-
- TriStateCheckBox checkBox = this.addTriStateCheckBox(
- parent,
- text,
- booleanHolder,
- helpId
- );
-
- new LabeledControlUpdater(
- new LabeledButton(checkBox.getCheckBox()),
- stringHolder
- );
-
- return checkBox;
- }
-
- /**
- * Requests this pane to populate its widgets with the subject's values.
- *
- * @category Populate
- */
- protected void doPopulate() {
- this.log(Tracing.UI_LAYOUT, " ->doPopulate()");
- }
-
- private void controlEnabledState(PropertyValueModel<Boolean> booleanModel, Control... controls) {
- this.controlEnabledState_(this.wrapEnabledModel(booleanModel), controls);
- }
-
- /**
- * Assume the "enabled" models can return null (which is typical with aspect
- * adapters etc.).
- */
- private PropertyValueModel<Boolean> wrapEnabledModel(PropertyValueModel<Boolean> booleanModel) {
- return new TransformationPropertyValueModel<Boolean, Boolean>(booleanModel, NonNullBooleanTransformer.FALSE);
- }
-
- private void controlEnabledState_(PropertyValueModel<Boolean> booleanModel, Control... controls) {
- SWTTools.controlEnabledState(this.andEnabledModel(booleanModel), controls);
- }
-
- private PropertyValueModel<Boolean> getCombinedEnabledModel() {
- return (this.combinedEnabledModel != null) ? this.combinedEnabledModel : this.baseEnabledModel;
- }
-
- private boolean getCombinedEnablement() {
- Boolean enabled = getCombinedEnabledModel().getValue();
- return (enabled == null) ? true : enabled.booleanValue();
- }
-
- private PropertyValueModel<Boolean> andEnabledModel(PropertyValueModel<Boolean> booleanModel) {
- return CompositeBooleanPropertyValueModel.and(getCombinedEnabledModel(), booleanModel);
- }
-
- protected void controllerEnablementChanged() {
- enableWidgets_(getCombinedEnablement());
- }
-
- /**
- * Changes the enablement state of the widgets of this pane.
- *
- * @param enabled <code>true</code> to enable the widgets or <code>false</code>
- * to disable them
- *
- * @category Layout
- */
- public void enableWidgets(boolean enabled) {
- this.baseEnabledModel.setValue(Boolean.valueOf(enabled));
- enableWidgets_(getCombinedEnablement());
- }
-
- private void enableWidgets_(boolean enabled) {
- if (! this.container.isDisposed()) {
- for (Control control : this.managedWidgets) {
- control.setEnabled(enabled);
- }
-
- for (Pane<?> subPane : this.managedSubPanes) {
- subPane.enableWidgets(enabled);
- }
- }
- }
-
- private void engageSubjectHolder() {
- this.subjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- }
-
- /**
- * engage the specified subject
- */
- protected void engageListeners(T subject) {
- if (subject != null) {
- this.engageListeners_(subject);
- }
- }
-
- /**
- * specified subject is not null
- */
- protected void engageListeners_(T subject) {
- this.log(Tracing.UI_LAYOUT, " ->engageListeners_(" + subject + ')');
-
- for (String propertyName : this.getPropertyNames()) {
- subject.addPropertyChangeListener(propertyName, this.aspectChangeListener);
- }
- }
-
- /**
- * disengage the specified subject
- */
- protected void disengageListeners(T subject) {
- if (subject != null) {
- this.disengageListeners_(subject);
- }
- }
-
- /**
- * specified subject is not null
- */
- protected void disengageListeners_(T subject) {
- this.log(Tracing.UI_LAYOUT, " ->disengageListeners_(" + subject + ')');
-
- for (String propertyName : this.getPropertyNames()) {
- subject.removePropertyChangeListener(propertyName, this.aspectChangeListener);
- }
- }
-
- private void disengageSubjectHolder() {
- this.subjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- }
-
- /**
- * Returns the main <code>Control</code> of this pane.
- *
- * @return The main container
- *
- * @category Layout
- */
- public Composite getControl() {
- return this.container;
- }
-
- /**
- * Returns the subject holder used by this pane.
- *
- * @return The holder of the subject
- *
- * @category Populate
- */
- protected final PropertyValueModel<T> getSubjectHolder() {
- return this.subjectHolder;
- }
-
- /**
- * Returns the factory responsible for creating the widgets.
- *
- * @return The factory used by this pane to create the widgets
- *
- * @category Layout
- */
- protected final WidgetFactory getWidgetFactory() {
- return this.widgetFactory;
- }
-
- /**
- * Returns the margin taken by a group box, which is the number of pixel the
- * group box border and its margin takes before displaying its widgets plus
- * 5 pixels since the widgets inside of the group box and the border should
- * have that extra 5 pixels.
- *
- * @return The width taken by the group box border with its margin
- *
- * @category Layout
- */
- protected final int getGroupBoxMargin() {
- Group group = this.widgetFactory.createGroup(SWTUtil.getShell(), "");
- Rectangle clientArea = group.getClientArea();
- group.dispose();
- return clientArea.x + 5;
- }
-
- /**
- * Returns the helps system.
- *
- * @return The platform's help system
- *
- * @category Helper
- */
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
-
- /**
- * Determines whether
- *
- * @return
- *
- * @category Populate
- */
- protected final boolean isPopulating() {
- return this.populating;
- }
-
- /**
- * Logs the given message if the <code>Tracing.DEBUG_LAYOUT</code> is enabled.
- *
- * @param flag
- * @param message The logging message
- */
- protected void log(String flag, String message) {
- if (flag.equals(Tracing.UI_LAYOUT) && Tracing.booleanDebugOption(Tracing.UI_LAYOUT)) {
- this.log(message);
- }
- }
-
- protected void log(String message) {
- Class<?> thisClass = this.getClass();
- String className = thisClass.getSimpleName();
-
- if (thisClass.isAnonymousClass()) {
- className = className.substring(0, className.indexOf('$'));
- className += "->" + thisClass.getSuperclass().getSimpleName();
- }
-
- Tracing.log(className + ": " + message);
- }
-
- /**
- * Notifies this pane to populate itself using the subject's information.
- *
- * @category Populate
- */
- private void populate() {
- if (!this.container.isDisposed()) {
- this.log(Tracing.UI_LAYOUT, "populate()");
- this.repopulate();
- }
- }
-
- /**
- * Notifies the subject's property associated with the given property name
- * has changed.
- *
- * @param propertyName The property name associated with the property change
- *
- * @category Populate
- */
- protected void propertyChanged(String propertyName) {
- }
-
- /**
- * Returns the list of names to listen for properties changing from the
- * subject.
- *
- * @return A non-<code>null</code> list of property names
- *
- * @category Populate
- */
- protected Collection<String> getPropertyNames() {
- ArrayList<String> propertyNames = new ArrayList<String>();
- addPropertyNames(propertyNames);
- return propertyNames;
- }
-
- /**
- * Removes the given pane's widgets (those that were registered with
- * its left <code>ControlAligner</code>) from this pane's left
- * <code>ControlAligner</code> so that their width will no longer be adjusted
- * with the width of the widest widget.
- *
- * @param pane The pane containing the widgets to remove
- *
- * @category Layout
- */
- protected final void removeAlignLeft(Pane<?> pane) {
- this.leftControlAligner.remove(pane.leftControlAligner);
- }
-
- /**
- * Removes the given control from the collection of widgets that are aligned
- * to have the same width when they are shown to the left side of the 3
- * widget colums.
- *
- * @param pane The pane to remove, its width will no longer be
- * ajusted to be the width of the longest widget
- *
- * @category Layout
- */
- protected final void removeAlignLeft(Control control) {
- this.leftControlAligner.remove(control);
- }
-
- /**
- * Removes the given pane's widgets (those that were registered with
- * its right <code>ControlAligner</code>) from this pane's right
- * <code>ControlAligner</code> so that their width will no longer be adjusted
- * with the width of the widest widget.
- *
- * @param pane The pane containing the widgets to remove
- *
- * @category Layout
- */
- protected final void removeAlignRight(Pane<?> pane) {
- this.rightControlAligner.remove(pane.rightControlAligner);
- }
-
- /**
- * Removes the given control from the collection of widgets that are aligned
- * to have the same width when they are shown to the right side of the 3
- * widget colums.
- *
- * @param pane The pane to remove, its width will no longer be
- * ajusted to be the width of the longest widget
- *
- * @category Layout
- */
- protected final void removeAlignRight(Control control) {
- this.rightControlAligner.remove(control);
- }
-
- /**
- * Removes the given pane's controls (those that were registered for
- * alignment) from this pane.
- *
- * @param pane The pane containing the widgets that no longer
- * requires their width adjusted with the width of the longest widget
- *
- * @category Layout
- */
- protected final void removePaneForAlignment(Pane<?> pane) {
- removeAlignLeft(pane);
- removeAlignRight(pane);
- }
-
- /**
- * This method is called (perhaps internally) when this needs to repopulate
- * but the object of interest has not changed.
- *
- * @category Populate
- */
- protected final void repopulate() {
-
- this.log(Tracing.UI_LAYOUT, " ->repopulate()");
-
- // Populate this pane
- try {
- setPopulating(true);
- doPopulate();
- }
- finally {
- setPopulating(false);
- }
-
- // Ask the sub-panes to repopulate themselves
- for (Pane<?> subPane : this.subPanes) {
- subPane.repopulate();
- }
- }
-
- /**
- * Sets the internal flag that is used to determine whether the pane is being
- * populated or not. During population, it is required to not update the
- * widgets when the model is updated nor to update the model when the widgets
- * are being synchronized with the model's values.
- *
- * @param populating
- *
- * @category Populate
- */
- protected final void setPopulating(boolean populating) {
- this.populating = populating;
- }
-
- /**
- * Either show or hides this pane.
- *
- * @param visible The new visibility state
- */
- public void setVisible(boolean visible) {
- if (!this.container.isDisposed()) {
- this.container.setVisible(visible);
- }
- }
-
- /**
- * Returns the nearest <code>Shell</code> displaying the main widget of this
- * pane.
- *
- * @return The nearest window displaying this pane
- */
- public final Shell getShell() {
- return this.container.getShell();
- }
-
- /**
- * Returns the subject of this pane.
- *
- * @return The subject if this pane was not disposed; <code>null</code>
- * if it was
- *
- * @category Populate
- */
- public T getSubject() {
- return this.subjectHolder.getValue();
- }
-
- /**
- * The subject has changed, disconnects any listeners from the old subject
- * and connects those listeners onto the new subject.
- *
- * @param oldsubject The old subject or <code>null</code> if none was set
- * @param newSubject The new subject or <code>null</code> if none needs to be
- * set
- *
- * @category Populate
- */
- protected final void subjectChanged(T oldSubject, T newSubject) {
- if (!this.container.isDisposed()) {
-
- this.log(Tracing.UI_LAYOUT, "subjectChanged()");
- this.disengageListeners(oldSubject);
-
- this.repopulate();
-
- this.engageListeners(newSubject);
- }
- }
-
-
- /**
- * Registers another <code>Pane</code> with this one so it can
- * be automatically notified about certain events such as engaging or
- * disengaging the listeners, etc.
- *
- * @param subPane The sub-pane to register
- *
- * @category Controller
- */
- protected final void registerSubPane(Pane<?> subPane) {
- this.subPanes.add(subPane);
- }
-
- /**
- * Unregisters the given <code>Pane</code> from this one so it
- * can no longer be automatically notified about certain events such as
- * engaging or disengaging the listeners, etc.
- *
- * @param subPane The sub-pane to unregister
- *
- * @category Controller
- */
- protected final void unregisterSubPane(Pane<?> subPane) {
- this.subPanes.remove(subPane);
- }
-
- private void updatePane(String propertyName) {
- if (!isPopulating() && !this.container.isDisposed()) {
- this.populating = true;
-
- try {
- propertyChanged(propertyName);
- }
- finally {
- this.populating = false;
- }
- }
- }
-
- public void dispose() {
- this.log(Tracing.UI_LAYOUT, "dispose()");
-
- // Dispose this pane
- this.disengageListeners(getSubject());
- this.disengageSubjectHolder();
-
- if (this.combinedEnabledModel != null && this.combinedEnabledModelListener != null) {
- this.combinedEnabledModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.combinedEnabledModelListener);
- }
-
- this.leftControlAligner.dispose();
- this.rightControlAligner.dispose();
-
- // Ask the sub-panes to dispose themselves
- for (Pane<?> subPane : this.subPanes) {
- subPane.dispose();
- }
- }
-
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PostExecution.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PostExecution.java
deleted file mode 100644
index bae4b60382..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PostExecution.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.Dialog;
-
-/**
- * This <code>PostExecution</code> is used to post execute a portion of code
- * once a dialog, that was launched into a different UI thread, has been
- * disposed.
- *
- * @version 2.0
- * @since 1.0
- */
-public interface PostExecution<T extends Dialog> {
-
- /**
- * Notifies this post exection the dialog that was launched into a different
- * UI thread has been disposed.
- *
- * @param dialog The dialog that was launched into a different thread
- */
- public void execute(T dialog);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PropertySheetWidgetFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PropertySheetWidgetFactory.java
deleted file mode 100644
index c841976fc0..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/PropertySheetWidgetFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This <code>WidgetFactory</code> is responsible to create the widgets using
- * <code>TabbedPropertySheetWidgetFactory</code> in order use the form style
- * (flat-style) look and feel.
- *
- * @see TabbedPropertySheetWidgetFactory
- *
- * @version 2.0
- * @since 2.0
- */
-public class PropertySheetWidgetFactory extends FormWidgetFactory {
-
- /**
- * Creates a new <code>PropertySheetWidgetFactory</code>.
- *
- * @param widgetFactory The actual factory responsible for creating the new
- * widgets
- */
- public PropertySheetWidgetFactory(TabbedPropertySheetWidgetFactory widgetFactory) {
- super(widgetFactory);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Composite createComposite(Composite parent) {
- return getWidgetFactory().createComposite(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Group createGroup(Composite parent, String title) {
- return getWidgetFactory().createGroup(parent, title);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return (TabbedPropertySheetWidgetFactory) super.getWidgetFactory();
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/TriStateCheckBox.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/TriStateCheckBox.java
deleted file mode 100644
index ecb0d2098c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/TriStateCheckBox.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This <code>TriStateCheckBox</code> can display one of three states:
- * unchecked, checked, or partially checked. It can be modified via a mouse
- * selection, via a keyboard selection, or programmatically. The selection state is
- * represented by a <code>Boolean</code> value where a <code>null</code>
- * value means partially checked.
- * <p>
- * The order of state changes is: unchecked -> partially checked -> checked.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class TriStateCheckBox
-{
- /**
- * A check box button.
- */
- private final Button button;
-
- /**
- * The current selection state.
- */
- private TriState state;
-
- /**
- * Creates a new <code>TriStateCheckBox</code> with no text.
- *
- * @param parent The parent composite
- * @param widgetFactory The factory used to create the check box
- */
- public TriStateCheckBox(Composite parent, WidgetFactory widgetFactory) {
- this(parent, null, widgetFactory);
- }
-
- /**
- * Creates a new <code>TriStateCheckBox</code>.
- *
- * @param parent The parent composite
- * @param text The check box's text
- * @param widgetFactory The factory used to create the check box
- */
- public TriStateCheckBox(Composite parent,
- String text,
- WidgetFactory widgetFactory) {
- super();
- this.state = TriState.UNCHECKED;
- this.button = widgetFactory.createCheckBox(parent, text);
- this.button.addSelectionListener(this.buildSelectionListener());
- }
-
- /**
- * Convenience method: Adds a dispose listener to the check box.
- * The source of any events sent to the listener will be the check box widget.
- */
- public void addDisposeListener(DisposeListener disposeListener) {
- this.button.addDisposeListener(disposeListener);
- }
-
- /**
- * Convenience method: Adds a selection listener to the check box.
- * The source of any events sent to the listener will be the check box widget.
- */
- public void addSelectionListener(SelectionListener selectionListener) {
- this.button.addSelectionListener(selectionListener);
- }
-
- private SelectionListener buildSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- TriStateCheckBox.this.checkBoxClicked();
- }
- };
- }
-
- /**
- * The check box was clicked, change the tri-state to the next value and
- * update the check box's state.
- */
- void checkBoxClicked() {
- this.state = this.nextState();
- this.updateCheckBox();
- }
-
- /**
- * Disposes the check box widget.
- */
- public void dispose() {
- this.button.dispose();
- }
-
- /**
- * Returns the <code>Button</code> used to show a tri-state check box.
- *
- * @return The <code>Button</code> used to show a tri-state check box
- */
- public Button getCheckBox() {
- return this.button;
- }
-
- /**
- * Returns the check box's image.
- *
- * @return The check box's image.
- */
- public Image getImage() {
- return this.button.getImage();
- }
-
- /**
- * Returns the check box's selection state.
- *
- * @return Either <code>true</code> or <code>false</code> for checked or
- * unchecked; or <code>null</code> for partially selected
- */
- public Boolean getSelection() {
- return (this.state == TriState.PARTIALLY_CHECKED) ? null : Boolean.valueOf(this.state == TriState.CHECKED);
- }
-
- /**
- * Returns the check box's text.
- *
- * @return The text of the check box
- */
- public String getText() {
- return this.button.getText();
- }
-
- /**
- * Returns whether the check box is disposed.
- *
- * @return <code>true</code> if the check box is disposed; <code>false</code>
- * otherwise
- */
- public boolean isDisposed() {
- return this.button.isDisposed();
- }
-
- /**
- * Returns whether the check box is enabled.
- *
- * @return <code>true</code> if the check box is enabled; <code>false</code>
- * otherwise
- */
- public boolean isEnabled() {
- return this.button.isEnabled();
- }
-
- /**
- * Returns the next state:
- * UNCHECKED -> PARTIALLY_CHECKED
- * PARTIALLY_CHECKED -> CHECKED
- * CHECKED -> UNCHECKED
- */
- private TriState nextState() {
- switch (this.state) {
- case UNCHECKED:
- return TriState.PARTIALLY_CHECKED;
- case PARTIALLY_CHECKED:
- return TriState.CHECKED;
- case CHECKED:
- return TriState.UNCHECKED;
- default:
- throw new IllegalStateException("unknown state: " + this.state);
- }
- }
-
- /**
- * Convenience method: Removes a dispose listener from the check box.
- */
- public void removeDisposeListener(DisposeListener disposeListener) {
- this.button.removeDisposeListener(disposeListener);
- }
-
- /**
- * Convenience method: Removes a selection listener from the check box.
- */
- public void removeSelectionListener(SelectionListener selectionListener) {
- this.button.removeSelectionListener(selectionListener);
- }
-
- /**
- * Changes the check box's enablement state.
- *
- * @param enabled <code>true</code> to enable the check box or <code>false</code>
- * to disable it
- */
- public void setEnabled(boolean enabled) {
- this.button.setEnabled(enabled);
- }
-
- /**
- * Sets the check box's image.
- *
- * @param image The new image of the check box
- */
- public void setImage(Image image) {
- this.button.setImage(image);
- }
-
- /**
- * Changes the check box's selection state.
- *
- * @param selection Either <code>true</code> or <code>false</code> for
- * checked and unchecked; or <code>null</code> for partially selected
- */
- public void setSelection(Boolean selection) {
- TriState old = this.state;
- this.state = this.stateForBoolean(selection);
- if (old != this.state) {
- this.updateCheckBox();
- }
- }
-
- /**
- * Sets the check box's text.
- *
- * @param text The new text of the check box
- */
- public void setText(String text) {
- this.button.setText(text);
- }
-
- /**
- * Returns the tri-state corresponding to the boolean.
- *
- * @param selection The boolean to be converted to a tri-state
- */
- private TriState stateForBoolean(Boolean selection) {
- return (selection == null) ? TriState.PARTIALLY_CHECKED :
- selection.booleanValue() ? TriState.CHECKED : TriState.UNCHECKED;
- }
-
- /**
- * Updates the selection state of the of the check box based on the tri-state
- * value.
- */
- void updateCheckBox() {
- switch (this.state) {
- case UNCHECKED:
- this.button.setSelection(false);
- this.button.setGrayed(false);
- break;
- case PARTIALLY_CHECKED:
- this.button.setSelection(true);
- this.button.setGrayed(true);
- break;
- case CHECKED:
- this.button.setSelection(true);
- this.button.setGrayed(false);
- break;
- default:
- throw new IllegalStateException("unknown state: " + this.state);
- }
- }
-
- /**
- * An enum containing the possible selections.
- */
- enum TriState {
- CHECKED,
- PARTIALLY_CHECKED,
- UNCHECKED
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java
deleted file mode 100644
index b4b6cdf73e..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.widgets;
-
-import java.util.ListIterator;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.internal.node.Problem;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is similar to it superclass, <code>Dialog</code>, with
- * the added value of an error message label below the main panel. A subclass
- * can set this error message as needed so that it can inform the user something
- * incorrect has been entered.
- * <p>
- * If there is an error message, it will be shown. If there is a warning
- * message, it will only be shown if there is no error message. Warning messages
- * have a different icon than error messages.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class ValidatingDialog<T extends Node> extends Dialog<T> {
-
- /**
- * Creates a new <code>ValidatingDialog</code>.
- *
- * @param parent The parent shell
- */
- public ValidatingDialog(Shell parent) {
- super(parent);
- }
-
- /**
- * Creates a new <code>ValidatingDialog</code>.
- *
- * @param parent The parent shell
- * @param title The dialog's title
- */
- public ValidatingDialog(Shell parent, String title) {
- super(parent, title);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- final Node.Validator buildValidator() {
- return new Node.Validator() {
- public void pause() {
- }
-
- public void resume() {
- }
-
- public void validate() {
- ValidatingDialog.this.validate();
- }
- };
- }
-
- /**
- * Clears the messages from the description pane
- */
- protected final void clearMessage(){
- setMessage(getDescription());
- }
-
- /**
- * Clears the error message from the description pane.
- */
- protected final void clearErrorMessage() {
- setErrorMessage(null);
- }
-
- /**
- * Returns the description shown in the description pane.
- *
- * @return The description under the description's title
- */
- protected String getDescription() {
- return null;
- }
-
- /**
- * Returns the image shown in the description pane.
- *
- * @return The image of the description pane or <code>null</code> if none is
- * required
- */
- protected Image getDescriptionImage() {
- return null;
- }
-
- /**
- * Returns the title of the description pane.
- *
- * @return The title shown in the description pane
- */
- protected String getDescriptionTitle() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Point getInitialSize() {
- Point result = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point paneSize = getPane().getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = convertHorizontalDLUsToPixels(400);
- result.x = Math.max(width, paneSize.x);
- return result;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected final boolean hasTitleArea() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeUI() {
-
- super.initializeUI();
-
- // Update the description title
- String descriptionTitle = getDescriptionTitle();
-
- if (descriptionTitle != null) {
- setTitle(descriptionTitle);
- }
-
- // Update the description title
- String description = getDescription();
-
- if (description != null) {
- setMessage(description);
- }
-
- // Update the description image
- Image image = getDescriptionImage();
-
- if (image != null) {
- setTitleImage(image);
- }
- }
-
- /**
- * Updates the description pane by showing the given error message and format
- * the text with the given list of arguments if any exists.
- *
- * @param errorMessage The error message to show in the description pane
- * @param arguments The list of arguments used to format the error message
- */
- protected final void setErrorMessage(String errorMessage, Object... arguments) {
- setErrorMessage(NLS.bind(errorMessage, arguments));
- }
-
- /**
- * Updates the description pane by showing the given warning message and format
- * the text with the given list of arguments if any exists.
- *
- * @param warningMessage The warning message to show in the description pane
- * @param arguments The list of arguments used to format the error message
- */
-
- protected final void setWarningMessage(String warningMessage, Object... arguments) {
- setMessage(NLS.bind(warningMessage, arguments), IMessageProvider.WARNING);
- }
-
- /**
- * Updates the error message, either shows the first error problem or hides
- * the error pane. If the progress bar is shown, then the error message will
- * not be shown.
- */
- private void updateMessage() {
- if (getSubject().branchProblemsSize() == 0) {
- clearMessage();
- } else {
- for (ListIterator<Problem> problems = getSubject().branchProblems(); problems.hasNext();){
- Problem problem = problems.next();
- if (problem.messageType() == IMessageProvider.ERROR){
- this.setErrorMessage(problem.messageKey(), problem.messageArguments());
- }
- else if (problem.messageType() == IMessageProvider.WARNING){
- this.setWarningMessage(problem.messageKey(), problem.messageArguments());
- }
- }
- }
- if (!this.containsErrorMessage()){
- clearErrorMessage();
- }
- }
-
- public final boolean containsErrorMessage(){
- boolean error = false;
- for (ListIterator<Problem> problems = getSubject().branchProblems(); problems.hasNext();){
- Problem problem = problems.next();
- if (problem.messageType() ==IMessageProvider.ERROR){
- error = true;
- }
- }
- return error;
- }
- /**
- * Validates the state object and based on its status, update the description
- * pane to show the first error if any exists and update the enablement of
- * the OK button.
- */
- private void validate() {
- getSubject().validateBranch();
- updateMessage();
- getButton(OK).setEnabled(!containsErrorMessage());
- }
-} \ No newline at end of file
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/wizards/JavaProjectWizardPage.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/wizards/JavaProjectWizardPage.java
deleted file mode 100644
index 510957a1b2..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/wizards/JavaProjectWizardPage.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.wizards;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * JavaProjectWizardPage
- */
-public class JavaProjectWizardPage extends WizardPage {
-
- private IJavaProject javaProject;
- private String destinationLabel;
- private Table projectTable;
- private TableViewer projectTableViewer;
-
- private static String SELECT_PROJECT_PAGE_NAME = "SelectJavaProject"; //$NON-NLS-1$
- private static int PROJECT_NAME_COLUMN_INDEX = 0;
-
- // ********** constructor **********
-
- public JavaProjectWizardPage(IJavaProject javaProject) {
- super(SELECT_PROJECT_PAGE_NAME);
-
- this.javaProject = javaProject;
- }
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- composite.setLayout(layout);
-
- this.buildLabel(composite, this.destinationLabel);
-
- this.projectTable = this.buildProjectTable(composite, this.buildProjectTableSelectionListener());
-
- this.projectTableViewer = this.buildProjectTableViewer(
- this.projectTable,
- this.buildProjectTableLabelProvider(),
- this.buildProjectTableContentProvider());
- this.fillProjectList();
- this.setControl(composite);
- this.setTableSelection(this.javaProject);
- this.validate();
- }
-
- // ********** listeners **********
-
- private SelectionListener buildProjectTableSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedProjectChanged();
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- @Override
- public String toString() {
- return "PromptProjectWizardPage project table selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- // ********** listener callbacks **********
-
- protected void selectedProjectChanged() {
- if(this.projectTable.getSelectionIndex() != -1) {
- TableItem item = this.projectTable.getItem(this.projectTable.getSelectionIndex());
- String projectName = item.getText(0);
- if( ! StringTools.stringIsEmpty(projectName)) {
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- this.setJavaProject(JavaCore.create(project));
- this.validate();
- }
- }
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- return this.javaProject;
- }
-
- public void setDestinationLabel(String destinationLabel) {
- this.destinationLabel = destinationLabel;
- }
-
- // ********** protected methods **********
-
- protected void setTableSelection(IJavaProject javaProject) {
- if(javaProject != null) {
- String projectName = javaProject.getProject().getName();
- for(TableItem item: this.projectTable.getItems()) {
- if(item.getText(0).equals(projectName)) {
- this.projectTable.setSelection(item);
- }
- }
- }
- }
-
- protected void fillProjectList() {
- this.projectTableViewer.setInput(this.getSortedJavaProjectsNames());
- }
-
- // ********** internal methods **********
-
- private void validate() {
- this.setPageComplete(this.projectTable.getSelectionIndex() != -1);
- }
-
- private void setJavaProject(IJavaProject project) {
- this.javaProject = project;
- }
-
- private String[] getSortedJavaProjectsNames() {
- return ArrayTools.sort(this.getJavaProjectsNames());
- }
-
- private String[] getJavaProjectsNames() {
- return ArrayTools.array(
- new TransformationIterable<IProject, String>(this.getJavaProjects()) {
- @Override
- protected String transform(IProject project) {
- return project.getName();
- }
- },
- new String[0]);
- }
-
- protected Iterable<IProject> getJavaProjects() {
- return new FilteringIterable<IProject>(CollectionTools.collection(this.getProjects())) {
- @Override
- protected boolean accept(IProject next) {
- try {
- return next.hasNature(JavaCore.NATURE_ID);
- }
- catch (CoreException e) {
- return false;
- }
- }
- };
- }
-
- protected Iterator<IProject> getProjects() {
- return new ArrayIterator<IProject>(ResourcesPlugin.getWorkspace().getRoot().getProjects());
- }
-
- // ********** inner classes **********
-
- private final class ProjectTableLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- if(columnIndex == PROJECT_NAME_COLUMN_INDEX)
- return PlatformUI.getWorkbench().getSharedImages().getImage(org.eclipse.ui.ide.IDE.SharedImages.IMG_OBJ_PROJECT);
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- assert element instanceof String;
- String projectName = (String)element;
- if(columnIndex == PROJECT_NAME_COLUMN_INDEX)
- return projectName;
- return null;
- }
- }
-
- private final class ProjectTableContentProvider implements IStructuredContentProvider {
-
- public Object[] getElements(Object inputElement) {
- return ((String[])inputElement);
- }
-
- public void dispose() {}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
-
- // ********** UI components **********
-
- private ITableLabelProvider buildProjectTableLabelProvider() {
- return new ProjectTableLabelProvider();
- }
-
- private IStructuredContentProvider buildProjectTableContentProvider() {
- return new ProjectTableContentProvider();
- }
-
- private Label buildLabel(Composite parent, String text) {
- Label label = new Label( parent, SWT.NONE );
- label.setText(text);
- return label;
- }
-
- private Table buildProjectTable(Composite parent, SelectionListener listener) {
- TableViewer tableViewer = new TableViewer(parent,
- SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.VIRTUAL);
-
- Table table = tableViewer.getTable();
- table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- table.addSelectionListener(listener);
- return table;
- }
-
- private TableViewer buildProjectTableViewer(Table parent, ITableLabelProvider labelProvider, IStructuredContentProvider contentProvider) {
-
- TableViewer tableViewer = new TableViewer(parent);
- tableViewer.setLabelProvider(labelProvider);
- tableViewer.setContentProvider(contentProvider);
- return tableViewer;
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/DelegatingContentAndLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/DelegatingContentAndLabelProvider.java
deleted file mode 100644
index 66f3be391d..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/DelegatingContentAndLabelProvider.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.jface;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.navigator.IDescriptionProvider;
-
-/**
- * Implementation of {@link IStructuredContentProvider} and {@link ILabelProvider} that
- * maintains a collection (Map, actually) of {@link ItemContentProvider}
- * delegates that perform the function of providing content and label information
- * for each represented item
- *
- * NB: This class, if used as a label provider *MUST* be used as a content provider
- * for the same viewer. It may be used as a content provider with a different
- * label provider, however.
- *
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public abstract class DelegatingContentAndLabelProvider
- extends BaseLabelProvider
- implements IStructuredContentProvider, ILabelProvider, IDescriptionProvider
-{
- private final ItemContentProviderFactory itemContentProviderFactory;
-
- private final ItemLabelProviderFactory itemLabelProviderFactory;
-
- private final Map<Object, ItemContentProvider> itemContentProviders;
-
- private final Map<Object, ItemLabelProvider> itemLabelProviders;
-
- StructuredViewer viewer;
-
-
- protected DelegatingContentAndLabelProvider(
- ItemContentProviderFactory itemContentProviderFactory) {
- this(itemContentProviderFactory, null);
- }
-
- protected DelegatingContentAndLabelProvider(
- ItemContentProviderFactory itemContentProviderFactory,
- ItemLabelProviderFactory itemLabelProviderFactory) {
- super();
- this.itemContentProviderFactory = itemContentProviderFactory;
- this.itemLabelProviderFactory = itemLabelProviderFactory;
- this.itemContentProviders = new HashMap<Object, ItemContentProvider>();
- this.itemLabelProviders = new HashMap<Object, ItemLabelProvider>();
- }
-
-
- protected ItemContentProvider itemContentProvider(Object item) {
- ItemContentProvider itemContentProvider = this.itemContentProviders.get(item);
- if (itemContentProvider != null) {
- return itemContentProvider;
- }
- itemContentProvider = this.itemContentProviderFactory.buildItemContentProvider(item, this);
- if (itemContentProvider == null) {
- return null;
- }
- this.itemContentProviders.put(item, itemContentProvider);
- return itemContentProvider;
- }
-
- protected ItemLabelProvider itemLabelProvider(Object item) {
- if (this.viewer == null) {
- throw new IllegalStateException(
- "This provider must be used as a content" + //$NON-NLS-1$
- "provider *as well as* a label provider."); //$NON-NLS-1$
- }
- ItemLabelProvider itemLabelProvider = this.itemLabelProviders.get(item);
- if (itemLabelProvider != null) {
- return itemLabelProvider;
- }
- itemLabelProvider = this.itemLabelProviderFactory.buildItemLabelProvider(item, this);
- if (itemLabelProvider == null) {
- return null;
- }
- this.itemLabelProviders.put(item, itemLabelProvider);
- return itemLabelProvider;
- }
-
-
- public Object[] getElements(Object inputElement) {
- return itemContentProvider(inputElement).getElements();
- }
-
- public Image getImage(Object element) {
- ItemLabelProvider provider = itemLabelProvider(element);
- return (provider == null) ? null :provider.getImage();
- }
-
- public String getText(Object element) {
- ItemLabelProvider provider = itemLabelProvider(element);
- return (provider == null) ? null : provider.getText();
- }
-
- public String getDescription(Object element) {
- ItemLabelProvider provider = itemLabelProvider(element);
- return (provider == null) ? null : provider.getDescription();
- }
-
- /**
- * Disposes all items
- */
- @Override
- public void dispose() {
- disposeProviders();
- super.dispose();
- }
-
- protected void disposeProviders() {
- // coded this way to allow some item providers to dispose of their child
- // elements without disrupting the entire process
- while (! this.itemContentProviders.isEmpty()) {
- dispose(this.itemContentProviders.keySet().iterator().next());
- }
- // this catches any items that weren't disposed from the content providers,
- // though there most likely won't be any items represented here that
- // haven't already been disposed
- while (! this.itemLabelProviders.isEmpty()) {
- dispose(this.itemLabelProviders.keySet().iterator().next());
- }
- }
-
- /**
- * Disposes item
- */
- public void dispose(Object item) {
- if (this.itemContentProviders.containsKey(item)) {
- this.itemContentProviders.get(item).dispose();
- this.itemContentProviders.remove(item);
- }
- if (this.itemLabelProviders.containsKey(item)) {
- this.itemLabelProviders.get(item).dispose();
- this.itemLabelProviders.remove(item);
- }
- }
-
- public void inputChanged(Viewer structuredViewer, Object oldInput, Object newInput) {
- if (oldInput != newInput) {
- disposeProviders();
- }
- this.viewer = (StructuredViewer) structuredViewer;
- }
-
- /**
- * Update the content for the given item
- */
- public void updateContent(final Object item) {
- Runnable runnable = new Runnable() {
- public void run() {
- if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
- viewer.refresh(item);
- }
- }
- };
- if (!viewerIsDisposed()) {
- this.viewer.getControl().getDisplay().asyncExec(runnable);
- }
- }
-
- // open up visibility a bit for inner classes
- @Override
- protected void fireLabelProviderChanged(LabelProviderChangedEvent event) {
- super.fireLabelProviderChanged(event);
- }
-
- /**
- * Update the label for the given item
- */
- public void updateLabel(final Object item) {
- Runnable runnable = new Runnable() {
- public void run() {
- if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
- fireLabelProviderChanged(new LabelProviderChangedEvent(DelegatingContentAndLabelProvider.this, item));
- }
- }
- };
- if (!viewerIsDisposed()) {
- this.viewer.getControl().getDisplay().asyncExec(runnable);
- }
- }
-
- protected boolean viewerIsDisposed() {
- return this.viewer.getControl().isDisposed();
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProvider.java
deleted file mode 100644
index 2f21206f8c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProvider.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.jface;
-
-/**
- * Marker interface used in conjunction with DelegatingContentProvider to return
- * content information for a particular item.
- * @see DelegatingContentProvider
- * @see ItemContentProviderFactory
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ItemContentProvider
-{
- /**
- * Return the elements of the represented item.
- * Note that when this is called, the represented item is an input element.
- */
- Object[] getElements();
-
- /**
- * Dispose of this content provider, cleaning up all references, listeners, etc.
- */
- void dispose();
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProviderFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProviderFactory.java
deleted file mode 100644
index a9c951d816..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemContentProviderFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.jface;
-
-/**
- * Factory interface used to describe how to build {@link ItemContentProvider}s
- * for a {@link DelegatingContentAndLabelProvider}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ItemContentProviderFactory
-{
- ItemContentProvider buildItemContentProvider(Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java
deleted file mode 100644
index 592a8a6bbe..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.jface;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Interface used in conjunction with DelegatingLabelProvider to return
- * label information for a particular item.
- * @see DelegatingLabelProvider
- * @see ItemLabelProviderFactory
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ItemLabelProvider
-{
- /**
- * Return the image for the item
- */
- Image getImage();
-
- /**
- * Return the text for the item
- */
- public String getText();
-
- /**
- * Return the description for the item
- */
- public String getDescription();
-
- /**
- * Dispose of this label provider, cleaning up all references, listeners, etc.
- */
- void dispose();
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProviderFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProviderFactory.java
deleted file mode 100644
index db61b3905f..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProviderFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.jface;
-
-/**
- * Factory interface used to describe how to build IItemLabelProviders
- * for a DelegatingContentAndLabelProvider
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ItemLabelProviderFactory
-{
- ItemLabelProvider buildItemLabelProvider(Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider);
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProvider.java
deleted file mode 100644
index 2e978f00b8..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.jface;
-
-/**
- * Interface used in conjunction with DelegatingTreeContentProvider to return
- * tree information for a particular item.
- * @see DelegatingTreeContentProvider
- * @see TreeItemContentProviderFactory
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TreeItemContentProvider extends ItemContentProvider
-{
- /**
- * Return the parent of the represented item
- */
- Object getParent();
-
- /**
- * Return whether the represented item has children
- */
- boolean hasChildren();
-
- /**
- * Return the children of the represented item
- */
- Object[] getChildren();
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProviderFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProviderFactory.java
deleted file mode 100644
index 393a737525..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/TreeItemContentProviderFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.jface;
-
-/**
- * Extension of {@link ItemContentProviderFactory} that extends functionality
- * for tree content
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TreeItemContentProviderFactory extends ItemContentProviderFactory
-{
- public TreeItemContentProvider buildItemContentProvider(Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider);
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/.classpath b/common/tests/org.eclipse.jpt.common.core.tests/.classpath
deleted file mode 100644
index 1e530394ab..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/.cvsignore b/common/tests/org.eclipse.jpt.common.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/.project b/common/tests/org.eclipse.jpt.common.core.tests/.project
deleted file mode 100644
index 0839d137f9..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/.settings/org.eclipse.jdt.core.prefs b/common/tests/org.eclipse.jpt.common.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 294090b50a..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:06:24 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/META-INF/MANIFEST.MF b/common/tests/org.eclipse.jpt.common.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 8e6e217fa2..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.common.core.tests;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility.tests;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.common.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.common.core.tests.internal.projects;x-internal:=true,
- org.eclipse.jpt.common.core.tests.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.common.core.tests.internal.utility.jdt;x-internal:=true
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/about.html b/common/tests/org.eclipse.jpt.common.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/build.properties b/common/tests/org.eclipse.jpt.common.core.tests/build.properties
deleted file mode 100644
index 9cd29bcb38..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/plugin.properties b/common/tests/org.eclipse.jpt.common.core.tests/plugin.properties
deleted file mode 100644
index b22b820267..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - Common Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/JptCommonCoreTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/JptCommonCoreTests.java
deleted file mode 100644
index b53253a105..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/JptCommonCoreTests.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.common.core.tests.internal.resource.java.JptCommonCoreResourceJavaTests;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.JptCommonCoreUtilityJdtTests;
-
-public class JptCommonCoreTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCommonCoreTests.class.getPackage().getName());
- suite.addTest(JptCommonCoreResourceJavaTests.suite());
- suite.addTest(JptCommonCoreUtilityJdtTests.suite());
- return suite;
- }
-
- private JptCommonCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestFacetedProject.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestFacetedProject.java
deleted file mode 100644
index a2ba74b0b3..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestFacetedProject.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * This builds and holds a "faceted" project.
- * Support for installing facets.
- */
-public class TestFacetedProject extends TestPlatformProject {
- private final IFacetedProject facetedProject;
-
-
- // ********** builders *****************************
-
- public static TestFacetedProject buildFacetedProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return new TestFacetedProject(baseProjectName, autoBuild);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestFacetedProject(String projectName) throws CoreException {
- this(projectName, true);
- }
-
- public TestFacetedProject(String projectName, boolean autoBuild) throws CoreException {
- super(projectName, autoBuild);
- this.facetedProject = this.createFacetedProject();
- }
-
- private IFacetedProject createFacetedProject() throws CoreException {
- return ProjectFacetsManager.create(this.getProject(), true, null); // true = "convert if necessary"
- }
-
-
- // ********** public methods **********
-
- public IFacetedProject getFacetedProject() {
- return this.facetedProject;
- }
-
- public void installFacet(String facetName, String versionName) throws CoreException {
- this.installFacet(facetName, versionName, null);
- }
-
- public void uninstallFacet(String facetName, String versionName) throws CoreException {
- this.uninstallFacet(facetName, versionName, null);
- }
-
- /**
- * if 'config' is null (and 'facetName' is "jpt.jpa"), the JPA project will be built with the defaults
- * defined in JpaFacetInstallDataModelProvider#getDefaultProperty(String)
- * In JPA the config object will be an IDataModel
- * In JAXB the config object will be a JaxbFacetInstallConfig
- */
- public void installFacet(String facetName, String versionName, Object config) throws CoreException {
- this.facetedProject.installProjectFacet(this.facetVersion(facetName, versionName), config, null);
- }
-
- /**
- * In JPA the config object will be an IDataModel
- * In JAXB the config object will be a JaxbFacetUninstallConfig
- */
- public void uninstallFacet(String facetName, String versionName, Object config) throws CoreException {
- this.facetedProject.uninstallProjectFacet(this.facetVersion(facetName, versionName), config, null);
- }
-
- private IProjectFacetVersion facetVersion(String facetName, String versionName) {
- return ProjectFacetsManager.getProjectFacet(facetName).getVersion(versionName);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestJavaProject.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestJavaProject.java
deleted file mode 100644
index 7ea7e3813a..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestJavaProject.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-
-/**
- * This builds and holds a "Java" project.
- * Support for adding packages and types.
- *
- * "Java" projects aren't required to be "faceted" projects, but for JPA
- * testing they are.
- */
-@SuppressWarnings("nls")
-public class TestJavaProject extends TestFacetedProject {
- private final IJavaProject javaProject;
- private final IPackageFragmentRoot sourceFolder;
-
-
- // ********** builders *****************************
-
- public static TestJavaProject buildJavaProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return new TestJavaProject(baseProjectName, autoBuild);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestJavaProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJavaProject(String projectName, boolean autoBuild) throws CoreException {
- super(projectName, autoBuild);
- this.installFacet("jst.java", "5.0");
- this.javaProject = JavaCore.create(this.getProject());
- this.sourceFolder = this.javaProject.getPackageFragmentRoot(this.getProject().getFolder("src"));
- }
-
- public void addJar(String jarPath) throws JavaModelException {
- this.addClasspathEntry(JavaCore.newLibraryEntry(new Path(jarPath), null, null));
- }
-
- private void addClasspathEntry(IClasspathEntry entry) throws JavaModelException {
- this.javaProject.setRawClasspath(ArrayTools.add(this.javaProject.getRawClasspath(), entry), null);
- }
-
-
- // ********** public methods **********
-
- public IJavaProject getJavaProject() {
- return this.javaProject;
- }
-
- public IPackageFragment createPackage(String packageName) throws CoreException {
- return this.sourceFolder.createPackageFragment(packageName, false, null); // false = "no force"
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public ICompilationUnit createCompilationUnit(String packageName, String compilationUnitName, String source) throws CoreException {
- return this.createCompilationUnit(this.createPackage(packageName), compilationUnitName, new SimpleSourceWriter(source));
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public ICompilationUnit createCompilationUnit(String packageName, String compilationUnitName, SourceWriter sourceWriter) throws CoreException {
- return this.createCompilationUnit(this.createPackage(packageName), compilationUnitName, sourceWriter);
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public ICompilationUnit createCompilationUnit(IPackageFragment packageFragment, String compilationUnitName, SourceWriter sourceWriter) throws CoreException {
- StringBuilder sb = new StringBuilder(2000);
- sourceWriter.appendSourceTo(sb);
- String source = sb.toString();
- return packageFragment.createCompilationUnit(compilationUnitName, source, false, null); // false = "no force"
- }
-
-
- // ********** member classes **********
-
- public interface SourceWriter {
- void appendSourceTo(StringBuilder sb);
- }
-
- public class SimpleSourceWriter implements SourceWriter {
- private final String source;
- public SimpleSourceWriter(String source) {
- super();
- this.source = source;
- }
- public void appendSourceTo(StringBuilder sb) {
- sb.append(this.source);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestPlatformProject.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestPlatformProject.java
deleted file mode 100644
index 1c9c2dfa16..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/projects/TestPlatformProject.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.projects;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * This builds and holds a "general" Eclipse project.
- * Support for adding natures, folders, and files.
- */
-public class TestPlatformProject {
- private final IProject project;
-
- /** carriage return */
- public static final String CR = StringTools.CR;
-
-
- // ********** builders **********
-
- public static TestPlatformProject buildPlatformProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return new TestPlatformProject(baseProjectName, autoBuild);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestPlatformProject(String projectName, boolean autoBuild) throws CoreException {
- super();
- this.setAutoBuild(autoBuild); // workspace-wide setting
- this.project = this.buildPlatformProject(projectName);
- }
-
- private void setAutoBuild(boolean autoBuild) throws CoreException {
- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
- description.setAutoBuilding(autoBuild);
- ResourcesPlugin.getWorkspace().setDescription(description);
- }
-
- private IProject buildPlatformProject(String projectName) throws CoreException {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- p.create(null);
- p.open(null);
- return p;
- }
-
-
- // ********** public methods **********
-
- public IProject getProject() {
- return this.project;
- }
-
- public void addProjectNature(String natureID) throws CoreException {
- IProjectDescription description = this.project.getDescription();
- description.setNatureIds(ArrayTools.add(description.getNatureIds(), natureID));
- this.project.setDescription(description, null);
- }
-
- public void removeProjectNature(String natureID) throws CoreException {
- IProjectDescription description = this.project.getDescription();
- description.setNatureIds(ArrayTools.removeAllOccurrences(description.getNatureIds(), natureID));
- this.project.setDescription(description, null);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JavaResourceModelTestCase.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JavaResourceModelTestCase.java
deleted file mode 100644
index 4c3bd461f3..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.resource.java;
-
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.GenericAnnotationProvider;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NullAnnotationEditFormatter;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-@SuppressWarnings("nls")
-public abstract class JavaResourceModelTestCase
- extends AnnotationTestCase {
-
- private JavaElementChangeListener javaElementChangeListener;
- protected JavaResourceCompilationUnit javaResourceCompilationUnit;
-
-
- public JavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaElementChangeListener = new JavaElementChangeListener();
- JavaCore.addElementChangedListener(this.javaElementChangeListener);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- this.javaElementChangeListener = null;
- }
-
- private class JavaElementChangeListener
- implements IElementChangedListener {
-
- JavaElementChangeListener() {
- super();
- }
-
- public void elementChanged(ElementChangedEvent event) {
- JavaResourceModelTestCase.this.javaElementChanged(event);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void javaElementChanged(ElementChangedEvent event) {
- if (this.javaResourceCompilationUnit == null) {
- return;
- }
- this.syncWithJavaDelta(event.getDelta());
- }
-
- /**
- * NB: this is copied from GenericJpaProject, so it might need to be
- * kept in synch with that code if it changes... yech...
- */
- protected void syncWithJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- case IJavaElement.JAVA_PROJECT :
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- case IJavaElement.PACKAGE_FRAGMENT :
- this.syncWithJavaDeltaChildren(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- this.javaCompilationUnitChanged(delta);
- break;
- default :
- break; // ignore the elements inside a compilation unit
- }
- }
-
- protected void syncWithJavaDeltaChildren(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.syncWithJavaDelta(child); // recurse
- }
- }
-
- protected void javaCompilationUnitChanged(IJavaElementDelta delta) {
- if (this.deltaIsRelevant(delta)) {
- this.javaResourceCompilationUnit.synchronizeWithJavaSource();
- }
- }
-
- protected boolean deltaIsRelevant(IJavaElementDelta delta) {
- if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
- return false;
- }
- return delta.getKind() == IJavaElementDelta.CHANGED;
- }
-
- protected ICompilationUnit createAnnotationAndMembers(String packageName, String annotationName, String annotationBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- protected ICompilationUnit createEnumAndMembers(String packageName, String enumName, String enumBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- protected JavaResourcePackage buildJavaResourcePackage(ICompilationUnit cu) {
- JavaResourcePackageInfoCompilationUnit pkgCu =
- new SourcePackageInfoCompilationUnit(
- cu,
- this.buildAnnotationProvider(),
- NullAnnotationEditFormatter.instance(),
- CommandExecutor.Default.instance());
- this.javaResourceCompilationUnit = pkgCu;
- return pkgCu.getPackage();
- }
-
- protected JavaResourceType buildJavaResourceType(ICompilationUnit cu) {
- return (JavaResourceType) this.buildJavaResourceType_(cu);
- }
-
- protected JavaResourceEnum buildJavaResourceEnum(ICompilationUnit cu) {
- return (JavaResourceEnum) this.buildJavaResourceType_(cu);
- }
-
- private JavaResourceAbstractType buildJavaResourceType_(ICompilationUnit cu) {
- this.javaResourceCompilationUnit = this.buildJavaResourceCompilationUnit(cu);
- this.javaResourceCompilationUnit.resolveTypes();
- return this.hackJavaResourceType();
- }
-
- protected JavaResourceField getField(JavaResourceType type, int index) {
- return CollectionTools.get(type.getFields(), index);
- }
-
- protected JavaResourceMethod getMethod(JavaResourceType type, int index) {
- return CollectionTools.get(type.getMethods(), index);
- }
-
- protected JavaResourceEnumConstant getEnumConstant(JavaResourceEnum resourceEnum, int index) {
- return CollectionTools.get(resourceEnum.getEnumConstants(), index);
- }
-
- protected JavaResourceAbstractType hackJavaResourceType() {
- return (JavaResourceAbstractType) ReflectionTools.getFieldValue(this.javaResourceCompilationUnit, "primaryType");
- }
-
- protected JavaResourceCompilationUnit buildJavaResourceCompilationUnit(ICompilationUnit cu) {
- if (this.javaResourceCompilationUnit != null) {
- throw new IllegalStateException();
- }
- return new SourceTypeCompilationUnit(
- cu,
- this.buildAnnotationProvider(),
- NullAnnotationEditFormatter.instance(),
- CommandExecutor.Default.instance());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new GenericAnnotationProvider(this.annotationDefinitions(), this.nestableAnnotationDefinitions());
- }
-
- protected abstract AnnotationDefinition[] annotationDefinitions();
-
- protected abstract NestableAnnotationDefinition[] nestableAnnotationDefinitions();
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JptCommonCoreResourceJavaTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JptCommonCoreResourceJavaTests.java
deleted file mode 100644
index 34f6a682ab..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/JptCommonCoreResourceJavaTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-public class JptCommonCoreResourceJavaTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCommonCoreResourceJavaTests.class.getPackage().getName());
- suite.addTestSuite(SourceAttributeTests.class);
- return suite;
- }
-
- private JptCommonCoreResourceJavaTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/SourceAttributeTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/SourceAttributeTests.java
deleted file mode 100644
index d5cfc8908c..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/resource/java/SourceAttributeTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.eclipse.jpt.common.core.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-
-
-public class SourceAttributeTests
- extends JavaResourceModelTestCase {
-
- private static String TEST_CLASS_NAME = "TestClass";
-
-
- public SourceAttributeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return new AnnotationDefinition[0];
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return new NestableAnnotationDefinition[0];
- }
-
-
- private ICompilationUnit createTestClassWithVariousAttributes() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append(CR);
- sb.append("public class ").append(TEST_CLASS_NAME).append("<T extends Number> ").append("{").append(CR);
- sb.append(" public String string;").append(CR);
- sb.append(" public List<String> stringList;").append(CR);
- sb.append(" public String[] stringArray;").append(CR);
- sb.append(" public String[][] stringDoubleArray;").append(CR);
- sb.append(" public T generic;").append(CR);
- sb.append(" public List<T> genericList;").append(CR);
- sb.append(" public T[] genericArray;").append(CR);
- sb.append(" public List<?> wildcardList;").append(CR);
- sb.append("}").append(CR);
- }
- };
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, TEST_CLASS_NAME + ".java", sourceWriter);
- }
-
-
- public void testAttributeTypes() throws Exception {
- ICompilationUnit testClassCU = createTestClassWithVariousAttributes();
- JavaResourceType testClass = buildJavaResourceType(testClassCU);
-
- // String string
- JavaResourceField att = getField(testClass, 0);
- assertEquals("string", att.getName());
- assertEquals("java.lang.String", att.getTypeName());
- assertEquals(false, att.typeIsArray());
- assertEquals(null, att.getTypeArrayComponentTypeName());
- assertEquals(0, att.getTypeArrayDimensionality());
- assertEquals(0, att.getTypeTypeArgumentNamesSize());
-
- // List<String> stringList
- att = getField(testClass, 1);
- assertEquals("stringList", att.getName());
- assertEquals("java.util.List", att.getTypeName());
- assertEquals(false, att.typeIsArray());
- assertEquals(null, att.getTypeArrayComponentTypeName());
- assertEquals(0, att.getTypeArrayDimensionality());
- assertEquals(1, att.getTypeTypeArgumentNamesSize());
- assertEquals("java.lang.String", att.getTypeTypeArgumentName(0));
-
- // String[] stringArray
- att = getField(testClass, 2);
- assertEquals("stringArray", att.getName());
- assertEquals("java.lang.String[]", att.getTypeName());
- assertEquals(true, att.typeIsArray());
- assertEquals("java.lang.String", att.getTypeArrayComponentTypeName());
- assertEquals(1, att.getTypeArrayDimensionality());
- assertEquals(0, att.getTypeTypeArgumentNamesSize());
-
- // String[] stringDoubleArray
- att = getField(testClass, 3);
- assertEquals("stringDoubleArray", att.getName());
- assertEquals("java.lang.String[][]", att.getTypeName());
- assertEquals(true, att.typeIsArray());
- assertEquals("java.lang.String", att.getTypeArrayComponentTypeName());
- assertEquals(2, att.getTypeArrayDimensionality());
- assertEquals(0, att.getTypeTypeArgumentNamesSize());
-
- // T generic
- att = getField(testClass, 4);
- assertEquals("generic", att.getName());
- assertEquals("java.lang.Number", att.getTypeName());
- assertEquals(false, att.typeIsArray());
- assertEquals(null, att.getTypeArrayComponentTypeName());
- assertEquals(0, att.getTypeArrayDimensionality());
- assertEquals(0, att.getTypeTypeArgumentNamesSize());
-
- // List<T> genericList
- att = getField(testClass, 5);
- assertEquals("genericList", att.getName());
- assertEquals("java.util.List", att.getTypeName());
- assertEquals(false, att.typeIsArray());
- assertEquals(null, att.getTypeArrayComponentTypeName());
- assertEquals(0, att.getTypeArrayDimensionality());
- assertEquals(1, att.getTypeTypeArgumentNamesSize());
- assertEquals("java.lang.Number", att.getTypeTypeArgumentName(0));
-
- // T[] genericArray
- att = getField(testClass, 6);
- assertEquals("genericArray", att.getName());
- assertEquals("java.lang.Number[]", att.getTypeName());
- assertEquals(true, att.typeIsArray());
- assertEquals("java.lang.Number", att.getTypeArrayComponentTypeName());
- assertEquals(1, att.getTypeArrayDimensionality());
- assertEquals(0, att.getTypeTypeArgumentNamesSize());
-
- // List<?> wildcardList
- att = getField(testClass, 7);
- assertEquals("wildcardList", att.getName());
- assertEquals("java.util.List", att.getTypeName());
- assertEquals(false, att.typeIsArray());
- assertEquals(null, att.getTypeArrayComponentTypeName());
- assertEquals(0, att.getTypeArrayDimensionality());
- assertEquals(1, att.getTypeTypeArgumentNamesSize());
- assertEquals("java.lang.Object", att.getTypeTypeArgumentName(0));
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/ASTToolsTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/ASTToolsTests.java
deleted file mode 100644
index e8d26126ed..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/ASTToolsTests.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class ASTToolsTests
- extends AnnotationTestCase {
-
- public ASTToolsTests(String name) {
- super(name);
- }
-
-
- private void createClassAndMembers(String className, String classBody) throws Exception {
- this.javaProject.createCompilationUnit("clazz", className + ".java", "public class " + className + " { " + classBody + " }");
- }
-
- private void createEnumAndMembers(String enumName, String enumBody) throws Exception {
- this.javaProject.createCompilationUnit("enums", enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- private ICompilationUnit createTestType(final Iterator<String> imports, final String idFieldAnnotation)
- throws Exception {
- return createTestType(
- new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return imports;
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(idFieldAnnotation);
- }
- });
- }
-
- public void testResolveEnum1() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("@annot.TestAnnotation(foo=enums.TestEnum.BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = ASTTools.resolveEnum((Name) daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum2() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.BAZ", "@annot.TestAnnotation(foo=BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = ASTTools.resolveEnum((Name) daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum3() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.*", "@annot.TestAnnotation(foo=BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = ASTTools.resolveEnum((Name)daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum4() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- ICompilationUnit cu = this.createTestType("enums.TestEnum", "@annot.TestAnnotation(foo=TestEnum.BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- JDTFieldAttribute field = this.idField(cu);
-
- String actual = ASTTools.resolveEnum((Name) daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveFullyQualifiedNames() throws Exception {
- final String otherClassName = "OtherClass";
- final String otherClassName2 = "OtherClass2";
- final String fqOtherClassName = "clazz.OtherClass";
- final String fqOtherClassName2 = "clazz.OtherClass2";
- final String annotationName = "TestAnnotation";
- final String fqAnnotationName = "annot.TestAnnotation";
-
- createClassAndMembers(otherClassName, "");
- createClassAndMembers(otherClassName2, "");
- createAnnotationAndMembers(annotationName, "Class[] foo();");
-
- ICompilationUnit cu = createTestType(
- new ArrayIterator<String>(new String[] {fqOtherClassName, fqOtherClassName2, fqAnnotationName}),
- "@TestAnnotation(foo={" + otherClassName + ".class, " + otherClassName2 + ".class})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter(fqAnnotationName);
- DeclarationAnnotationElementAdapter<String[]> daea =
- new ConversionDeclarationAnnotationElementAdapter<String[]>(
- daa, "foo", AnnotationStringArrayExpressionConverter.forTypes());
- JDTFieldAttribute field = idField(cu);
-
- Iterable<String> actual = ASTTools.resolveFullyQualifiedNames(daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
-
- assertEquals(
- CollectionTools.list(new String[] {fqOtherClassName, fqOtherClassName2}),
- CollectionTools.list(actual));
- }
-
- public void testResolveFullyQualifiedNames2() throws Exception {
- final String otherClassName = "OtherClass";
- final String otherClassName2 = "OtherClass2";
- final String fqOtherClassName = "clazz.OtherClass";
- final String fqOtherClassName2 = "clazz.OtherClass2";
- final String annotationName = "TestAnnotation";
- final String fqAnnotationName = "annot.TestAnnotation";
-
- createClassAndMembers(otherClassName, "");
- createClassAndMembers(otherClassName2, "");
- createAnnotationAndMembers(annotationName, "Class[] foo();");
-
- ICompilationUnit cu = createTestType(
- new ArrayIterator<String>(new String[] {fqOtherClassName, fqOtherClassName2, fqAnnotationName}),
- "@TestAnnotation(foo={1, " + otherClassName + ".class})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter(fqAnnotationName);
- DeclarationAnnotationElementAdapter<String[]> daea =
- new ConversionDeclarationAnnotationElementAdapter<String[]>(
- daa, "foo", AnnotationStringArrayExpressionConverter.forTypes());
- JDTFieldAttribute field = idField(cu);
-
- Iterable<String> actual = ASTTools.resolveFullyQualifiedNames(daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
-
- assertEquals(
- CollectionTools.list(new String[] {null, fqOtherClassName}),
- CollectionTools.list(actual));
- }
-
- public void testResolveFullyQualifiedNames3() throws Exception {
- final String otherClassName = "OtherClass";
- final String otherClassName2 = "OtherClass2";
- final String fqOtherClassName = "clazz.OtherClass";
- final String fqOtherClassName2 = "clazz.OtherClass2";
- final String annotationName = "TestAnnotation";
- final String fqAnnotationName = "annot.TestAnnotation";
-
- createClassAndMembers(otherClassName, "");
- createClassAndMembers(otherClassName2, "");
- createAnnotationAndMembers(annotationName, "Class[] foo();");
-
- ICompilationUnit cu = createTestType(
- new ArrayIterator<String>(new String[] {fqOtherClassName, fqOtherClassName2, fqAnnotationName}),
- "@TestAnnotation(foo={@TestAnnotation(), " + otherClassName + ".class}");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter(fqAnnotationName);
- DeclarationAnnotationElementAdapter<String[]> daea =
- new ConversionDeclarationAnnotationElementAdapter<String[]>(
- daa, "foo", AnnotationStringArrayExpressionConverter.forTypes());
- JDTFieldAttribute field = idField(cu);
-
- Iterable<String> actual = ASTTools.resolveFullyQualifiedNames(daea.getExpression(field.getModifiedDeclaration(this.buildASTRoot(cu))));
-
- assertEquals(
- CollectionTools.list(new String[] {null, fqOtherClassName}),
- CollectionTools.list(actual));
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java
deleted file mode 100644
index abf84a8173..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java
+++ /dev/null
@@ -1,1065 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.BooleanLiteral;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SimpleType;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTMethodAttribute;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-/**
- * Provide an easy(?) way to build an annotated source file.
- * The type must be created by calling one of the {@link #createTestType()}
- * methods before calling any of the various helper methods (i.e. the type is
- * <em>not</em> created during {@link #setUp()}).
- */
-@SuppressWarnings("nls")
-public abstract class AnnotationTestCase
- extends TestCase
-{
- protected TestJavaProject javaProject;
-
- public static final String CR = System.getProperty("line.separator");
- public static final String SEP = File.separator;
- public static final String PROJECT_NAME = "AnnotationTestProject";
- public static final String PACKAGE_NAME = "test";
- public static final String PACKAGE_NAME_ = PACKAGE_NAME + '.';
- public static final String PACKAGE_INFO_FILE_NAME = "package-info.java";
- public static final IPath PACKAGE_INFO_FILE_PATH = new Path("src" + SEP + PACKAGE_NAME + SEP + PACKAGE_INFO_FILE_NAME);
- public static final String TYPE_NAME = "AnnotationTestType";
- public static final String FULLY_QUALIFIED_TYPE_NAME = PACKAGE_NAME_ + TYPE_NAME;
- public static final String FILE_NAME = TYPE_NAME + ".java";
- public static final IPath FILE_PATH = new Path("src" + SEP + PACKAGE_NAME + SEP + FILE_NAME);
-
- public static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-
- // ********** TestCase behavior **********
-
- protected AnnotationTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject = this.buildJavaProject(false); // false = no auto-build
- }
-
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return this.buildJavaProject(PROJECT_NAME, autoBuild);
- }
-
- protected TestJavaProject buildJavaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJavaProject(projectName, autoBuild);
- }
-
- @Override
- protected void tearDown() throws Exception {
-// this.dumpSource();
- this.deleteProject();
- TestTools.clear(this);
- super.tearDown();
- }
-
- protected void deleteProject() throws Exception {
- int i = 1;
- boolean deleted = false;
- while ( ! deleted) {
- try {
- this.javaProject.getProject().delete(true, true, null);
- deleted = true;
- } catch (CoreException ex) {
- if (i == 4) {
- throw new RuntimeException(this.getName() + " - unable to delete project", ex);
- }
- Thread.sleep(1000);
- i++;
- }
- }
- }
-
- protected void dumpSource(ICompilationUnit cu) throws Exception {
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(this.getSource(cu));
- System.out.println();
- }
-
-
- // ********** package creation *********
-
- /**
- * create an un-annotated package-info
- */
- protected ICompilationUnit createTestPackageInfo() throws CoreException {
- return this.createTestPackageInfo(new DefaultAnnotationWriter());
- }
-
- /**
- * create an un-annotated package-info in a package the given name
- */
- protected ICompilationUnit createTestPackageInfo(String packageName) throws CoreException {
- return this.createTestPackageInfo(packageName, new DefaultAnnotationWriter());
- }
-
- /**
- * shortcut for simply adding an annotation to the package declaration
- */
- protected ICompilationUnit createTestPackageInfo(
- final String packageAnnotation, final String ... imports)
- throws CoreException {
-
- return createTestPackageInfo(
- new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(imports);
- }
-
- @Override
- public void appendPackageAnnotationTo(StringBuilder sb) {
- sb.append(packageAnnotation);
- }
- });
- }
-
- protected ICompilationUnit createTestPackageInfo(AnnotationWriter annotationWriter) throws CoreException {
- return this.createTestPackageInfo(PACKAGE_NAME, annotationWriter);
- }
-
- protected ICompilationUnit createTestPackageInfo(String packageName, AnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(
- packageName, PACKAGE_INFO_FILE_NAME, this.createSourceWriter(annotationWriter, packageName, null));
- }
-
-
- // ********** type creation **********
-
- /**
- * create an un-annotated type
- */
- protected ICompilationUnit createTestType() throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter());
- }
-
- /**
- * shortcut for simply adding an annotation to the 'id' field
- */
- protected ICompilationUnit createTestType(final String annotationImport, final String idFieldAnnotation) throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return (annotationImport == null) ?
- EmptyIterator.<String>instance() :
- new SingleElementIterator<String>(annotationImport);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(idFieldAnnotation);
- }
- });
- }
-
- /**
- * shortcut for simply adding a fully-qualified annotation to the 'id' field
- */
- protected ICompilationUnit createTestType(final String idFieldAnnotation) throws CoreException {
- return this.createTestType(null, idFieldAnnotation);
- }
-
- protected ICompilationUnit createTestType(AnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, this.createSourceWriter(annotationWriter));
- }
-
- protected ICompilationUnit createTestType(String typeName, AnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, typeName + ".java", createSourceWriter(annotationWriter, typeName));
- }
-
- protected ICompilationUnit createTestType(String packageName, String fileName, String typeName, AnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(packageName, fileName, this.createSourceWriter(annotationWriter, typeName));
- }
-
- protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter) {
- return new AnnotatedSourceWriter(annotationWriter);
- }
-
- protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter, String typeName) {
- return new AnnotatedSourceWriter(annotationWriter, typeName);
- }
-
- protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter, String packageName, String typeName) {
- return new AnnotatedSourceWriter(annotationWriter, packageName, typeName);
- }
-
- protected ICompilationUnit createTestEnum(EnumAnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, this.createEnumSourceWriter(annotationWriter));
- }
-
- protected ICompilationUnit createTestEnum(String packageName, String fileName, String enumName, EnumAnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createCompilationUnit(packageName, fileName, this.createEnumSourceWriter(annotationWriter, enumName));
- }
-
- protected SourceWriter createEnumSourceWriter(EnumAnnotationWriter annotationWriter) {
- return new EnumAnnotatedSourceWriter(annotationWriter);
- }
-
- protected SourceWriter createEnumSourceWriter(EnumAnnotationWriter annotationWriter, String enumName) {
- return new EnumAnnotatedSourceWriter(annotationWriter, enumName);
- }
-
- protected SourceWriter createEnumSourceWriter(EnumAnnotationWriter annotationWriter, String packageName, String enumName) {
- return new EnumAnnotatedSourceWriter(annotationWriter, packageName, enumName);
- }
-
- protected ICompilationUnit createAnnotatedEnumAndMembers(String enumName, String enumBody) throws Exception {
- StringBuilder sb = new StringBuilder();
- sb.append("package ").append(PACKAGE_NAME).append(";").append(CR);
- sb.append(CR);
- sb.append("import javax.xml.bind.annotation.XmlEnum;");
- sb.append(CR);
- sb.append(CR);
- sb.append("@XmlEnum");
- sb.append(CR);
- sb.append("public enum ").append(enumName).append(" { ").append(enumBody).append(" }");
-
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, enumName + ".java", sb.toString());
- }
-
- /**
- * writes source for package-info java files
- */
- protected void appendSourceTo(
- StringBuilder sb, AnnotationWriter annotationWriter, String packageName) {
-
- annotationWriter.appendPackageAnnotationTo(sb);
- sb.append(CR);
- sb.append("package ").append(packageName).append(";").append(CR);
- sb.append(CR);
- for (Iterator<String> stream = annotationWriter.imports(); stream.hasNext(); ) {
- sb.append("import ").append(stream.next()).append(";").append(CR);
- }
- }
-
- /**
- * writes source for typical java files
- */
- protected void appendSourceTo(
- StringBuilder sb, AnnotationWriter annotationWriter,
- String packageName, String typeName) {
-
- sb.append("package ").append(packageName).append(";").append(CR);
- sb.append(CR);
- for (Iterator<String> stream = annotationWriter.imports(); stream.hasNext(); ) {
- sb.append("import ");
- sb.append(stream.next());
- sb.append(";");
- sb.append(CR);
- }
- sb.append(CR);
- annotationWriter.appendTypeAnnotationTo(sb);
- sb.append(CR);
- sb.append("public class ").append(typeName).append(" ");
- annotationWriter.appendExtendsImplementsTo(sb);
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendIdFieldAnnotationTo(sb);
- sb.append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendNameFieldAnnotationTo(sb);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendGetIdMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public int getId() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendSetIdMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public void setId(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendGetNameMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public String getName() {").append(CR);
- sb.append(" return this.name;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendSetNameMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public void setTestField(String testField) {").append(CR);
- sb.append(" this.testField = testField;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- annotationWriter.appendMemberTypeTo(sb);
- sb.append(CR);
- sb.append("}").append(CR);
- annotationWriter.appendTopLevelTypesTo(sb);
- sb.append(CR);
- }
-
-
- /**
- * writes source for typical java enum files
- */
- protected void appendEnumSourceTo(
- StringBuilder sb, EnumAnnotationWriter annotationWriter,
- String packageName, String enumName) {
-
- sb.append("package ").append(packageName).append(";").append(CR);
- sb.append(CR);
- for (Iterator<String> stream = annotationWriter.imports(); stream.hasNext(); ) {
- sb.append("import ");
- sb.append(stream.next());
- sb.append(";");
- sb.append(CR);
- }
- sb.append(CR);
- annotationWriter.appendEnumAnnotationTo(sb);
- sb.append(CR);
- sb.append("public enum ").append(enumName).append(" {").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendSundayEnumConstantAnnotationTo(sb);
- sb.append(CR);
- sb.append(" SUNDAY, ").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendMondayEnumConstantAnnotationTo(sb);
- sb.append(CR);
- sb.append(" MONDAY").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- sb.append(CR);
- }
-
-
- // ********** queries **********
-
- protected TestJavaProject getJavaProject() {
- return this.javaProject;
- }
-
- protected JDTType testType(ICompilationUnit cu) {
- return this.buildType(TYPE_NAME, cu);
- }
-
- protected JDTType buildType(String name, ICompilationUnit cu) {
- return this.buildType(name, 1, cu);
- }
-
- protected JDTType buildType(String name, int occurrence, ICompilationUnit cu) {
- return this.buildType(null, name, occurrence, cu);
- }
-
- protected JDTType buildType(Type declaringType, String name, int occurrence, ICompilationUnit cu) {
- return new JDTType(declaringType, name, occurrence, cu);
- }
-
- protected JDTFieldAttribute idField(ICompilationUnit cu) {
- return this.buildField("id", cu);
- }
-
- protected JDTFieldAttribute nameField(ICompilationUnit cu) {
- return this.buildField("name", cu);
- }
-
- protected JDTFieldAttribute buildField(String name, ICompilationUnit cu) {
- return this.buildField(name, 1, cu);
- }
-
- protected JDTFieldAttribute buildField(String name, int occurrence, ICompilationUnit cu) {
- return this.buildField(this.testType(cu), name, occurrence, cu);
- }
-
- protected JDTFieldAttribute buildField(Type declaringType, String name, int occurrence, ICompilationUnit cu) {
- return new JDTFieldAttribute(declaringType, name, occurrence, cu);
- }
-
- protected JDTMethodAttribute idGetMethod(ICompilationUnit cu) {
- return this.buildMethod("getId", cu);
- }
-
- protected JDTMethodAttribute idSetMethod(ICompilationUnit cu) {
- return this.buildMethod("setId", new String[] {"int"}, cu);
- }
-
- protected JDTMethodAttribute nameGetMethod(ICompilationUnit cu) {
- return this.buildMethod("getName", cu);
- }
-
- protected JDTMethodAttribute buildMethod(String name, ICompilationUnit cu) {
- return this.buildMethod(name, EMPTY_STRING_ARRAY, cu);
- }
-
- protected JDTMethodAttribute buildMethod(String name, String[] parameterTypeNames, ICompilationUnit cu) {
- return this.buildMethod(name, parameterTypeNames, 1, cu);
- }
-
- protected JDTMethodAttribute buildMethod(String name, String[] parameterTypeNames, int occurrence, ICompilationUnit cu) {
- return new JDTMethodAttribute(this.testType(cu), name, parameterTypeNames, occurrence, cu);
- }
-
- protected JDTMethodAttribute buildMethod(Type declaringType, String name, String[] parameterTypeNames, int occurrence, ICompilationUnit cu) {
- return new JDTMethodAttribute(declaringType, name, parameterTypeNames, occurrence, cu);
- }
-
- protected String getSource(ICompilationUnit cu) throws JavaModelException {
- return cu.getBuffer().getContents();
- }
-
- protected CompilationUnit buildASTRoot(ICompilationUnit cu) {
- return ASTTools.buildASTRoot(cu);
- }
-
-
- // ********** test validation **********
-
- protected void assertSourceContains(String s, ICompilationUnit cu) throws JavaModelException {
- String source = this.getSource(cu);
- boolean found = source.indexOf(s) > -1;
- if ( ! found) {
- String msg = "source does not contain the expected string: " + s + " (see System console)";
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(msg);
- System.out.println(source);
- System.out.println();
- fail(msg);
- }
- }
-
- protected void assertSourceDoesNotContain(String s, ICompilationUnit cu) throws JavaModelException {
- String source = this.getSource(cu);
- int pos = source.indexOf(s);
- if (pos != -1) {
- String msg = "unexpected string in source (position: " + pos + "): " + s + " (see System console)";
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(msg);
- System.out.println(source);
- System.out.println();
- fail(msg);
- }
- }
-
-
- // ********** manipulate annotations **********
-
- /**
- * Return the *first* member value pair for the specified annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected MemberValuePair memberValuePair(NormalAnnotation annotation, String elementName) {
- for (MemberValuePair pair : this.values(annotation)) {
- if (pair.getName().getFullyQualifiedName().equals(elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected List<EnumConstantDeclaration> enumConstants(EnumDeclaration ed) {
- return ed.enumConstants();
- }
-
- /**
- * check for null member value pair
- */
- protected Expression value_(MemberValuePair pair) {
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected Expression annotationElementValue(NormalAnnotation annotation, String elementName) {
- return this.value_(this.memberValuePair(annotation, elementName));
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected Expression annotationElementValue(SingleMemberAnnotation annotation, String elementName) {
- return elementName.equals("value") ? annotation.getValue() : null;
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- * (An element name of "value" will return the value of a single
- * member annotation.)
- */
- protected Expression annotationElementValue(Annotation annotation, String elementName) {
- if (annotation.isNormalAnnotation()) {
- return this.annotationElementValue((NormalAnnotation) annotation, elementName);
- }
- if (annotation.isSingleMemberAnnotation()) {
- return this.annotationElementValue((SingleMemberAnnotation) annotation, elementName);
- }
- return null;
- }
-
- protected ArrayInitializer newArrayInitializer(AST ast, Expression... expressions) {
- ArrayInitializer arrayInitializer = ast.newArrayInitializer();
- for (Expression expression : expressions) {
- arrayInitializer.expressions().add(expression);
- }
- return arrayInitializer;
- }
-
- /**
- * Build a number literal and set its initial value to the specified literal.
- */
- protected NumberLiteral newNumberLiteral(AST ast, int value) {
- return ast.newNumberLiteral(Integer.toString(value));
- }
-
- /**
- * Build a number literal and set its initial value to the specified literal.
- */
- protected BooleanLiteral newBooleanLiteral(AST ast, boolean value) {
- return ast.newBooleanLiteral(value);
- }
-
- /**
- * Build a string literal and set its initial value.
- */
- protected StringLiteral newStringLiteral(AST ast, String value) {
- StringLiteral stringLiteral = ast.newStringLiteral();
- stringLiteral.setLiteralValue(value);
- return stringLiteral;
- }
-
- protected TypeLiteral newTypeLiteral(AST ast, String typeName) {
- TypeLiteral typeLiteral = ast.newTypeLiteral();
- typeLiteral.setType(this.newSimpleType(ast, typeName));
- return typeLiteral;
- }
-
- protected SimpleType newSimpleType(AST ast, String typeName) {
- return this.newSimpleType(ast, ast.newName(typeName));
- }
-
- protected SimpleType newSimpleType(AST ast, Name typeName) {
- return ast.newSimpleType(typeName);
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, SimpleName name, Expression value) {
- MemberValuePair pair = ast.newMemberValuePair();
- pair.setName(name);
- pair.setValue(value);
- return pair;
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, Expression value) {
- return this.newMemberValuePair(ast, ast.newSimpleName(name), value);
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, String value) {
- return this.newMemberValuePair(ast, name, this.newStringLiteral(ast, value));
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, int value) {
- return this.newMemberValuePair(ast, name, this.newNumberLiteral(ast, value));
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, boolean value) {
- return this.newMemberValuePair(ast, name, this.newBooleanLiteral(ast, value));
- }
-
- protected EnumConstantDeclaration newEnumConstantDeclaration(AST ast, String enumConstantName) {
- EnumConstantDeclaration enumConstantDeclaration = ast.newEnumConstantDeclaration();
- enumConstantDeclaration.setName(ast.newSimpleName(enumConstantName));
- return enumConstantDeclaration;
- }
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, MemberValuePair pair) {
- this.values(annotation).add(pair);
- return annotation;
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, int value) {
- return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value));
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, String value) {
- return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value));
- }
-
- /**
- * Add the specified member value pair to the marker annotation
- * by first replacing it with a normal annotation.
- * Return the resulting normal annotation.
- */
- protected NormalAnnotation addMemberValuePair(MarkerAnnotation annotation, String name, String value) {
- NormalAnnotation normalAnnotation = this.replaceMarkerAnnotation(annotation);
- this.addMemberValuePair(normalAnnotation, this.newMemberValuePair(annotation.getAST(), name, value));
- return normalAnnotation;
- }
-
- protected NormalAnnotation addMemberValuePair(MarkerAnnotation annotation, String name, boolean value) {
- NormalAnnotation normalAnnotation = this.replaceMarkerAnnotation(annotation);
- this.addMemberValuePair(normalAnnotation, this.newMemberValuePair(annotation.getAST(), name, value));
- return normalAnnotation;
- }
-
- /**
- * Add the specified member value pair to the marker annotation
- * by first replacing it with a normal annotation.
- * Return the resulting normal annotation.
- */
- protected NormalAnnotation addMemberValuePair(MarkerAnnotation annotation, MemberValuePair pair) {
- NormalAnnotation normalAnnotation = this.replaceMarkerAnnotation(annotation);
- return this.addMemberValuePair(normalAnnotation, pair);
- }
-
- protected void setEnumMemberValuePair(ModifiedDeclaration declaration, String annotationName, String enumValue) {
- NormalAnnotation annotation = (NormalAnnotation) declaration.getAnnotationNamed(annotationName);
- if (annotation == null) {
- annotation = addNormalAnnotation(declaration.getDeclaration(), annotationName);
- }
- this.setEnumMemberValuePair(annotation, "value", enumValue);
- }
-
- protected void setEnumMemberValuePair(NormalAnnotation annotation, String elementName, String enumValue) {
- MemberValuePair memberValuePair = this.memberValuePair(annotation, elementName);
- if (memberValuePair == null) {
- this.addEnumMemberValuePair(annotation, elementName, enumValue);
- }
- else {
- memberValuePair.setValue(annotation.getAST().newName(enumValue));
- }
- }
-
- protected void addEnumMemberValuePair(MarkerAnnotation markerAnnotation, String elementName, String value) {
- this.addEnumMemberValuePair(this.replaceMarkerAnnotation(markerAnnotation), elementName, value);
- }
-
- protected void addEnumMemberValuePair(NormalAnnotation annotation, String elementName, String value) {
- this.addMemberValuePair(annotation, elementName, annotation.getAST().newName(value));
- }
-
- protected void addMemberValuePair(NormalAnnotation annotation, String elementName, Expression value) {
- MemberValuePair memberValuePair = this.newMemberValuePair(annotation.getAST(), elementName, value);
- this.addMemberValuePair(annotation, memberValuePair);
- }
-
- protected void addMemberValuePair(MarkerAnnotation annotation, String elementName, Expression value) {
- MemberValuePair memberValuePair = this.newMemberValuePair(annotation.getAST(), elementName, value);
- this.addMemberValuePair(annotation, memberValuePair);
- }
-
- protected void addEnumConstant(EnumDeclaration enumDeclaration, String enumConstantName) {
- EnumConstantDeclaration enumConstantDeclaration = this.newEnumConstantDeclaration(enumDeclaration.getAST(), enumConstantName);
- this.enumConstants(enumDeclaration).add(enumConstantDeclaration);
- }
-
- protected void removeEnumConstant(EnumDeclaration enumDeclaration, String enumConstantName) {
- List<EnumConstantDeclaration> enumConstantsList = this.enumConstants(enumDeclaration);
- for (EnumConstantDeclaration constant : enumConstantsList) {
- if (constant.getName().getFullyQualifiedName().equals(enumConstantName)) {
- enumConstantsList.remove(constant);
- break;
- }
- }
- }
-
- protected void changeEnumConstantName(EnumDeclaration enumDeclaration, String oldEnumConstantName, String newEnumConstantName) {
- List<EnumConstantDeclaration> enumConstantsList = this.enumConstants(enumDeclaration);
- for (EnumConstantDeclaration constant : enumConstantsList) {
- if (constant.getName().getFullyQualifiedName().equals(oldEnumConstantName)) {
- this.changeEnumConstantName(constant, newEnumConstantName);
- break;
- }
- }
- }
-
- protected void changeEnumConstantName(EnumConstantDeclaration enumConstantDeclaration, String newEnumConstantName) {
- enumConstantDeclaration.setName(enumConstantDeclaration.getAST().newSimpleName(newEnumConstantName));
- }
-
- /**
- * Add the array element to an annotation that is either a normal annotation or a marker annotation.
- * If it is a marker annotation first make it a normal annotation.
- */
- protected void addArrayElement(ModifiedDeclaration declaration, String annotationName, int index, String elementName, Expression arrayElement) {
- Annotation annotation = declaration.getAnnotationNamed(annotationName);
- NormalAnnotation normalAnnotation;
- if (annotation == null) {
- normalAnnotation = this.addNormalAnnotation(declaration.getDeclaration(), annotationName);
- }
- else if (annotation.getNodeType() == ASTNode.MARKER_ANNOTATION) {
- normalAnnotation = this.replaceMarkerAnnotation((MarkerAnnotation) annotation);
- }
- else {
- normalAnnotation = (NormalAnnotation) annotation;
- }
- this.addArrayElement(normalAnnotation, index, elementName, arrayElement);
- }
-
- /**
- * Add the array element to the given normal annotation's element named elementName.
- * Add a new member value pair if one does not exist.
- * If the member value pair exists but the value is not yet an array, make it an array.
- */
- protected void addArrayElement(NormalAnnotation annotation, int index, String elementName, Expression arrayElement) {
- MemberValuePair pair = this.memberValuePair(annotation, elementName);
- if (pair == null) {
- pair = this.newMemberValuePair(annotation.getAST(), elementName, arrayElement);
- this.addMemberValuePair(annotation, pair);
- }
- else {
- Expression value = pair.getValue();
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- this.expressions((ArrayInitializer) value).add(index, arrayElement);
- }
- else {
- ArrayInitializer arrayInitializer = annotation.getAST().newArrayInitializer();
- pair.setValue(arrayInitializer);
- this.expressions(arrayInitializer).add(value);
- this.expressions(arrayInitializer).add(index, arrayElement);
- }
- }
- }
-
- /**
- * This assumes an element with name elementName exists with an array as its value.
- * Move the array element at sourceIndex to the targetIndex
- */
- protected void moveArrayElement(NormalAnnotation annotation, String elementName, int targetIndex, int sourceIndex) {
- MemberValuePair pair = this.memberValuePair(annotation, elementName);
- ArrayInitializer array = (ArrayInitializer) pair.getValue();
- CollectionTools.move(this.expressions(array), targetIndex, sourceIndex);
- }
-
- /**
- * This assumes an element with name elementName exists with potentially an array as its value.
- * If the value is not an array, then the member value pair is removed.
- * If the array element is removed and there is only 1 array element left, the array itself is removed
- * and the remaining element is set as the value of the member value pair
- */
- protected void removeArrayElement(NormalAnnotation annotation, String elementName, int index) {
- MemberValuePair pair = this.memberValuePair(annotation, elementName);
- if (pair.getValue().getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- ArrayInitializer array = (ArrayInitializer) pair.getValue();
- this.expressions(array).remove(index);
- if (this.expressions(array).size() == 1) {
- pair.setValue(this.expressions(array).remove(0));
- }
- }
- else {
- this.values(annotation).remove(pair);
- }
- }
-
- /**
- * Replace the given marker annotation with a normal annotation.
- * Return the resulting normal annotation.
- */
- protected NormalAnnotation replaceMarkerAnnotation(MarkerAnnotation annotation) {
- List<IExtendedModifier> annotations = this.annotations(annotation.getParent());
- int index = annotations.indexOf(annotation);
- NormalAnnotation normalAnnotation = newNormalAnnotation(annotation.getAST(), annotation.getTypeName().getFullyQualifiedName());
- annotations.set(index, normalAnnotation);
- return normalAnnotation;
- }
-
- /**
- * Build a normal annotation and set its name.
- */
- protected NormalAnnotation newNormalAnnotation(AST ast, String name) {
- NormalAnnotation annotation = ast.newNormalAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- /**
- * Add the normal annotation to the given AST node.
- * This should be a PackageDeclaration or a BodyDeclaration.
- * Return the resulting normal annotation.
- */
- protected NormalAnnotation addNormalAnnotation(ASTNode astNode, String name) {
- NormalAnnotation annotation = this.newNormalAnnotation(astNode.getAST(), name);
- this.addAnnotation(astNode, annotation);
- return annotation;
- }
-
- /**
- * Add the annotation to the given AST node.
- * This should be a PackageDeclaration or a BodyDeclaration.
- */
- protected void addAnnotation(ASTNode astNode, Annotation annotation) {
- this.annotations(astNode).add(annotation);
- }
-
- /**
- * Build a marker annotation and set its name.
- */
- protected MarkerAnnotation newMarkerAnnotation(AST ast, String name) {
- MarkerAnnotation annotation = ast.newMarkerAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- /**
- * Add the normal annotation to the given AST node.
- * This should be a PackageDeclaration or a BodyDeclaration.
- * Return the resulting normal annotation.
- */
- protected MarkerAnnotation addMarkerAnnotation(ASTNode astNode, String name) {
- MarkerAnnotation annotation = this.newMarkerAnnotation(astNode.getAST(), name);
- this.addAnnotation(astNode, annotation);
- return annotation;
- }
-
- /**
- * Remove the annotation with the specified name
- */
- protected void removeAnnotation(ModifiedDeclaration declaration, String name) {
- this.removeAnnotation(declaration.getDeclaration(), declaration.getAnnotationNamed(name));
- }
-
- /**
- * Remove the specified annotation from the AST node.
- * This should be a PackageDeclaration or a BodyDeclaration.
- */
- protected void removeAnnotation(ASTNode astNode, Annotation annotation) {
- this.annotations(astNode).remove(annotation);
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected List<IExtendedModifier> annotations(ASTNode astNode) {
- if (astNode instanceof BodyDeclaration) {
- return ((BodyDeclaration) astNode).modifiers();
- }
- else if (astNode instanceof PackageDeclaration) {
- return ((PackageDeclaration) astNode).annotations();
- }
- return Collections.emptyList();
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected List<Expression> expressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
-
- // ********** member classes **********
-
- public interface AnnotationWriter {
- Iterator<String> imports();
- void appendPackageAnnotationTo(StringBuilder sb);
- void appendTypeAnnotationTo(StringBuilder sb);
- void appendExtendsImplementsTo(StringBuilder sb);
- void appendIdFieldAnnotationTo(StringBuilder sb);
- void appendNameFieldAnnotationTo(StringBuilder sb);
- void appendGetIdMethodAnnotationTo(StringBuilder sb);
- void appendSetIdMethodAnnotationTo(StringBuilder sb);
- void appendGetNameMethodAnnotationTo(StringBuilder sb);
- void appendSetNameMethodAnnotationTo(StringBuilder sb);
- void appendMemberTypeTo(StringBuilder sb);
- void appendTopLevelTypesTo(StringBuilder sb);
- }
-
- public static class DefaultAnnotationWriter implements AnnotationWriter {
- public Iterator<String> imports() {return EmptyIterator.instance();}
- public void appendPackageAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendTypeAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendExtendsImplementsTo(StringBuilder sb) {/* do nothing */}
- public void appendIdFieldAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendNameFieldAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendSetIdMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendSetNameMethodAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendMemberTypeTo(StringBuilder sb) {/* do nothing */}
- public void appendTopLevelTypesTo(StringBuilder sb) {/* do nothing */}
- }
-
- public static class AnnotationWriterWrapper implements AnnotationWriter {
- private final AnnotationWriter aw;
- public AnnotationWriterWrapper(AnnotationWriter aw) {
- super();
- this.aw = aw;
- }
- public Iterator<String> imports() {return this.aw.imports();}
- public void appendPackageAnnotationTo(StringBuilder sb) {this.aw.appendPackageAnnotationTo(sb);}
- public void appendTypeAnnotationTo(StringBuilder sb) {this.aw.appendTypeAnnotationTo(sb);}
- public void appendExtendsImplementsTo(StringBuilder sb) {this.aw.appendExtendsImplementsTo(sb);}
- public void appendIdFieldAnnotationTo(StringBuilder sb) {this.aw.appendIdFieldAnnotationTo(sb);}
- public void appendNameFieldAnnotationTo(StringBuilder sb) {this.aw.appendNameFieldAnnotationTo(sb);}
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {this.aw.appendGetIdMethodAnnotationTo(sb);}
- public void appendSetIdMethodAnnotationTo(StringBuilder sb) {this.aw.appendSetIdMethodAnnotationTo(sb);}
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {this.aw.appendGetNameMethodAnnotationTo(sb);}
- public void appendSetNameMethodAnnotationTo(StringBuilder sb) {this.aw.appendSetNameMethodAnnotationTo(sb);}
- public void appendMemberTypeTo(StringBuilder sb) {this.aw.appendMemberTypeTo(sb);}
- public void appendTopLevelTypesTo(StringBuilder sb) {this.aw.appendTopLevelTypesTo(sb);}
- }
-
- public class AnnotatedSourceWriter
- implements SourceWriter {
-
- private AnnotationWriter annotationWriter;
- private String packageName;
- private String typeName;
-
- public AnnotatedSourceWriter(AnnotationWriter annotationWriter) {
- this(annotationWriter, TYPE_NAME);
- }
-
- public AnnotatedSourceWriter(AnnotationWriter annotationWriter, String typeName) {
- this(annotationWriter, PACKAGE_NAME, typeName);
- }
-
- public AnnotatedSourceWriter(AnnotationWriter annotationWriter, String packageName, String typeName) {
- super();
- this.annotationWriter = annotationWriter;
- this.packageName = packageName;
- this.typeName = typeName;
- }
-
- public void appendSourceTo(StringBuilder sb) {
- if (this.typeName != null) {
- AnnotationTestCase.this.appendSourceTo(sb, this.annotationWriter, this.packageName, this.typeName);
- }
- else {
- AnnotationTestCase.this.appendSourceTo(sb, this.annotationWriter, this.packageName);
- }
- }
- }
-
- public interface EnumAnnotationWriter {
- Iterator<String> imports();
- void appendPackageAnnotationTo(StringBuilder sb);
- void appendEnumAnnotationTo(StringBuilder sb);
- void appendSundayEnumConstantAnnotationTo(StringBuilder sb);
- void appendMondayEnumConstantAnnotationTo(StringBuilder sb);
- }
-
- public static class DefaultEnumAnnotationWriter implements EnumAnnotationWriter {
- public Iterator<String> imports() {return EmptyIterator.instance();}
- public void appendPackageAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendEnumAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendSundayEnumConstantAnnotationTo(StringBuilder sb) {/* do nothing */}
- public void appendMondayEnumConstantAnnotationTo(StringBuilder sb) {/* do nothing */}
- }
-
- public class EnumAnnotatedSourceWriter
- implements SourceWriter {
-
- private EnumAnnotationWriter annotationWriter;
- private String packageName;
- private String enumName;
-
- public EnumAnnotatedSourceWriter(EnumAnnotationWriter annotationWriter) {
- this(annotationWriter, TYPE_NAME);
- }
-
- public EnumAnnotatedSourceWriter(EnumAnnotationWriter annotationWriter, String enumName) {
- this(annotationWriter, PACKAGE_NAME, enumName);
- }
-
- public EnumAnnotatedSourceWriter(EnumAnnotationWriter annotationWriter, String packageName, String enumName) {
- super();
- this.annotationWriter = annotationWriter;
- this.packageName = packageName;
- this.enumName = enumName;
- }
-
- public void appendSourceTo(StringBuilder sb) {
- AnnotationTestCase.this.appendEnumSourceTo(sb, this.annotationWriter, this.packageName, this.enumName);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index b4f92fa9a7..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,744 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.osgi.framework.Version;
-
-@SuppressWarnings("nls")
-public class CombinationIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public CombinationIndexedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- }
-
- public void testAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- String value = ((StringLiteral) this.values((NormalAnnotation) annotation).get(0).getValue()).getLiteralValue();
- assertEquals("ADDRESS_ID2", value);
- }
-
- public void testAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- String value = ((StringLiteral) this.values(((NormalAnnotation) annotation)).get(0).getValue()).getLiteralValue();
- assertEquals("ADDRESS_ID2", value);
- }
-
- public void testAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumn", cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("ADDRESS_ID", cu);
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns", cu);
- this.assertSourceDoesNotContain("ADDRESS_ID2", cu);
- this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")", cu);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns", cu);
- this.assertSourceDoesNotContain("ADDRESS_ID2", cu);
- this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")", cu);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "String comment(); JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(comment=\"test\",columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceContains("@annot.JoinColumns(comment=\"test\",columns=@annot.JoinColumn(name=\"ADDRESS_ID1\"))", cu);
- }
-
- public void testRemoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(null)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.removeAnnotation();
- this.assertSourceContains("@annot.JoinColumns(null)", cu);
- }
-
- public void testRemoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testRemoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({null, @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- this.assertSourceContains("@annot.JoinColumn", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("ADDRESS_ID", cu);
- }
-
- public void testRemoveAnnotation14() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), null})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation15() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation16() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 3);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation17() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({null, null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- this.assertSourceContains("@annot.JoinColumn", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("ADDRESS_ID2", cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("JoinColumn", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("JoinColumn", cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn");
- this.assertSourceDoesNotContain("JoinColumns", cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns = { @JoinColumn, @JoinColumn })", cu);
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn," + CR + " @JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(77)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("JoinColumn", cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- this.assertSourceDoesNotContain("77", cu);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns=@JoinColumn)", cu);
- this.assertSourceDoesNotContain("77", cu);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(77)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns = { @JoinColumn(77), @JoinColumn })", cu);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(77),@annot.JoinColumn(88)})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})", cu);
- }
-
- public void testNewMarkerAnnotation9() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns = { @JoinColumn(text = \"blah\", num = 42), @JoinColumn })", cu);
- }
-
- public void testNewMarkerAnnotation23() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"b\",num=4)");
- String expected1 = "@JoinColumns(columns = { @JoinColumn(text = \"b\", num = 4), null,";
- String expected2 = "@JoinColumn })";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewMarkerAnnotation24() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
-
- //Use old formatting if jdt core version is 3.5 or below - see bug 285604
- Version version = Platform.getBundle("org.eclipse.jdt.core").getVersion();
- int majorVersion = version.getMajor();
- int minorVersion = version.getMinor();
- //This condition should be removed and test updated after Dali 3.0 branches
- String expected1;
- if (majorVersion == 3 && minorVersion <= 5) {
- expected1 = "@JoinColumns( {";
- }
- else expected1 = "@JoinColumns({";
-
- String expected2 = "@JoinColumn(text = \"blah\", num = 42), null,";
- String expected3 = "@JoinColumn " + CR + " })";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- this.assertSourceDoesNotContain(expected3, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- this.assertSourceContains(expected3, cu);
- }
-
- public void testNewMarkerAnnotation25() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected1 = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split
- String expected2 = "@JoinColumn})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 4);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewMarkerAnnotation26() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected1 = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split
- String expected2 = "@JoinColumn})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 4);
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testMoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")");
- String expected = "@JoinColumns(columns = { null, @JoinColumn(name = \"ADDRESS_ID0\") })";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID1\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testMoveAnnotation2a() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID1\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 1);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("JoinColumns", cu);
- }
-
- public void testMoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID4\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID0\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})";
- this.assertSourceDoesNotContain(expected, cu);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- ICompilationUnit cu = this.createTestType(expected); // the source should be unchanged
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("@annot.JoinColumns", cu);
- }
-
- public void testMoveAnnotation10a() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("@annot.JoinColumns", cu);
- }
-
- public void testMoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")");
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceDoesNotContain("JoinColumn", cu);
- }
-
- public void testMoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID2\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- this.assertSourceDoesNotContain("@annot.JoinColumns", cu);
- }
-
- public void testMoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), cidaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java
deleted file mode 100644
index 1237cc9bf1..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/DefaultAnnotationEditFormatterTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-
-@SuppressWarnings("nls")
-public class DefaultAnnotationEditFormatterTests extends AnnotationTestCase {
-
-
- // ********** TestCase behavior **********
-
- public DefaultAnnotationEditFormatterTests(String name) {
- super(name);
- }
-
-
- // ********** tests **********
-
- public void testCommaLength() throws Exception {
- assertEquals(1, this.commaLength(","));
- assertEquals(1, this.commaLength(", "));
- assertEquals(1, this.commaLength(", "));
-
- assertEquals(2, this.commaLength(" ,"));
- assertEquals(2, this.commaLength(" , "));
- assertEquals(2, this.commaLength(" , "));
-
- assertEquals(3, this.commaLength(" ,"));
- assertEquals(3, this.commaLength(" , "));
- assertEquals(3, this.commaLength(" , "));
-
- assertEquals(0, this.commaLength(" ,,,"));
- assertEquals(0, this.commaLength(" ,,, "));
- assertEquals(0, this.commaLength(" , ,"));
-
- assertEquals(0, this.commaLength(" ,x"));
- assertEquals(0, this.commaLength(" ,x "));
- assertEquals(0, this.commaLength(" , x"));
-
- assertEquals(0, this.commaLength("x ,"));
- assertEquals(0, this.commaLength("x , "));
- assertEquals(0, this.commaLength("x , "));
- }
-
- private int commaLength(String s) {
- Integer len = (Integer) ReflectionTools.executeMethod(DefaultAnnotationEditFormatter.instance(), "commaLength", String.class, s);
- return len.intValue();
- }
-
- public void testStringIsAnnotation() throws Exception {
- assertTrue(this.stringIsAnnotation("@F"));
- assertTrue(this.stringIsAnnotation("@Foo"));
- assertTrue(this.stringIsAnnotation("@org.bar.Foo"));
-
- assertFalse(this.stringIsAnnotation(""));
- assertFalse(this.stringIsAnnotation("@"));
- assertFalse(this.stringIsAnnotation("Foo"));
- assertFalse(this.stringIsAnnotation("Foo@"));
- }
-
- private boolean stringIsAnnotation(String s) {
- Boolean b = (Boolean) ReflectionTools.executeMethod(DefaultAnnotationEditFormatter.instance(), "stringIsAnnotation", String.class, s);
- return b.booleanValue();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java
deleted file mode 100644
index 0fddcce6f7..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import java.util.AbstractCollection;
-import java.util.AbstractList;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.Vector;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-
-
-public class JDTToolsTests
- extends AnnotationTestCase {
-
- public JDTToolsTests(String name) {
- super(name);
- }
-
-
- public void testTypeIsSubtype() throws Exception {
- IJavaProject jProj = getJavaProject().getJavaProject();
-
- // same type
- assertTrue(JDTTools.typeIsSubType(jProj, ArrayList.class.getName(), ArrayList.class.getName()));
- assertTrue(JDTTools.typeIsSubType(jProj, List.class.getName(), List.class.getName()));
-
- // concrete type is subtype of interface
- assertTrue(JDTTools.typeIsSubType(jProj, ArrayList.class.getName(), List.class.getName()));
- assertTrue(JDTTools.typeIsSubType(jProj, TreeSet.class.getName(), Iterable.class.getName()));
-
- // concrete type is not subtype of interface
- assertFalse(JDTTools.typeIsSubType(jProj, ArrayList.class.getName(), Map.class.getName()));
- assertFalse(JDTTools.typeIsSubType(jProj, TreeSet.class.getName(), Map.class.getName()));
-
- // interface is subtype of interface
- assertTrue(JDTTools.typeIsSubType(jProj, List.class.getName(), Collection.class.getName()));
- assertTrue(JDTTools.typeIsSubType(jProj, SortedSet.class.getName(), Iterable.class.getName()));
-
- // interface is not subtype of interface
- assertFalse(JDTTools.typeIsSubType(jProj, List.class.getName(), Map.class.getName()));
- assertFalse(JDTTools.typeIsSubType(jProj, SortedSet.class.getName(), Map.class.getName()));
-
- // concrete type is subtype of concrete type
- assertTrue(JDTTools.typeIsSubType(jProj, ArrayList.class.getName(), AbstractList.class.getName()));
- assertTrue(JDTTools.typeIsSubType(jProj, LinkedList.class.getName(), AbstractCollection.class.getName()));
-
- // concrete type is not subtype of concrete type
- assertFalse(JDTTools.typeIsSubType(jProj, ArrayList.class.getName(), Vector.class.getName()));
- assertFalse(JDTTools.typeIsSubType(jProj, LinkedList.class.getName(), Vector.class.getName()));
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java
deleted file mode 100644
index 0f485953b4..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptCommonCoreUtilityJdtTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCommonCoreUtilityJdtTests.class.getPackage().getName());
- suite.addTestSuite(CombinationIndexedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(DefaultAnnotationEditFormatterTests.class);
- suite.addTestSuite(ASTToolsTests.class);
- suite.addTestSuite(JDTToolsTests.class);
- suite.addTestSuite(MemberAnnotationElementAdapterTests.class);
- suite.addTestSuite(NestedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(NestedIndexedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(SimpleDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(TypeTests.class);
- return suite;
- }
-
- private JptCommonCoreUtilityJdtTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java
deleted file mode 100644
index b4f2fa7afa..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MemberAnnotationElementAdapterTests.java
+++ /dev/null
@@ -1,1298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import java.util.Arrays;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CharacterStringExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumArrayDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.IndexedConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.PrimitiveTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.TypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedExpressionConverter;
-
-@SuppressWarnings("nls")
-public class MemberAnnotationElementAdapterTests extends AnnotationTestCase {
-
- public MemberAnnotationElementAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- private void createEnum(String enumName, String enumBody) throws Exception {
- this.createEnum("enums", enumName, enumBody);
- }
-
- private void createEnum(String packageName, String enumName, String enumBody) throws Exception {
- this.javaProject.createCompilationUnit(packageName, enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- public void testValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"xxx\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("xxx", aea.getValue());
- }
-
- public void testValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=48)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, "bar", NumberIntegerExpressionConverter.instance());
- AnnotationElementAdapter<Integer> aea = new AnnotatedElementAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(48), aea.getValue());
- }
-
- public void testValue3() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar='c')");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", CharacterStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("c", aea.getValue());
- }
-
- public void testValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa, "bar", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValue5() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValue6() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa, BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueNull1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueNull2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueNull3() throws Exception {
- this.createAnnotationAndMembers("Baz", "String fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa3, "fred");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueStringConcatenation() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"xxx\" + \"yyy\" + \"zzz\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("xxxyyyzzz", aea.getValue());
- }
-
- public void testValueStringConstant() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- // just a bit hacky:
- ICompilationUnit cu = this.createTestType("private static final String FOO_BAR = \"xxx\"; @annot.Foo(bar=FOO_BAR + \"yyy\" + \"zzz\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("xxxyyyzzz", aea.getValue());
- }
-
- public void testValueNumberArithmetic() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=47 - 7 + 2 * 1 / 1)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = ConversionDeclarationAnnotationElementAdapter.forNumbers(daa, "bar");
- AnnotationElementAdapter<Integer> aea = new AnnotatedElementAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(42), aea.getValue());
- }
-
- public void testValueNumberShift() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=2 << 2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = ConversionDeclarationAnnotationElementAdapter.forNumbers(daa, "bar");
- AnnotationElementAdapter<Integer> aea = new AnnotatedElementAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(8), aea.getValue());
- }
-
- public void testValueNumberConstant() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- // just a bit hacky:
- ICompilationUnit cu = this.createTestType("private static final int FOO_BAR = 77; @annot.Foo(bar=FOO_BAR)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Integer> daea = ConversionDeclarationAnnotationElementAdapter.forNumbers(daa, "bar");
- AnnotationElementAdapter<Integer> aea = new AnnotatedElementAnnotationElementAdapter<Integer>(this.idField(cu), daea);
- assertEquals(Integer.valueOf(77), aea.getValue());
- }
-
- public void testValueCharacterConstant() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- // just a bit hacky:
- ICompilationUnit cu = this.createTestType("private static final char FOO_BAR = 'Q'; @annot.Foo(bar=FOO_BAR)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forCharacters(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("Q", aea.getValue());
- }
-
- public void testValueCharacterCast() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=(char) 0x41)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forCharacters(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("A", aea.getValue());
- }
-
- public void testValueBooleanOperator1() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=7 > 2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.TRUE, aea.getValue());
- }
-
- public void testValueBooleanOperator2() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=7 == 2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueBooleanOperator3() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=(7 != 2) && false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueBooleanOperator4() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=(7 != 2) ? false : true)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- }
-
- public void testValueInvalidValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=77)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=bazzzz)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue3() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=bazzzz)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<Boolean> daea = ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, "bar");
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"bazzzz\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forCharacters(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue5() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"java.lang.Object\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue6() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=enums.TestEnum.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue7() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String value = "\"false\"";
- String element = "fred=" + value;
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(" + element + ")))";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueInvalidValue8() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={true, false})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {null, null}, aea.getValue()));
- }
-
- public void testValueInvalidValue9() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=77)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testASTNode1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String value = "\"xxx\"";
- String element = "bar=" + value;
- String annotation = "@annot.Foo(" + element + ")";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- TextRange textRange = ASTTools.buildTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(this.getSource(cu).indexOf(value), textRange.getOffset());
- assertEquals(value.length(), textRange.getLength());
- assertEquals(7, textRange.getLineNumber());
- }
-
- public void testASTNode2() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String value = "false";
- String element = "fred=" + value;
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(" + element + ")))";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
- assertEquals(Boolean.FALSE, aea.getValue());
- TextRange textRange = ASTTools.buildTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(value.length(), textRange.getLength());
- }
-
- public void testASTNode3() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String element = "\"xxx\"";
- String annotation = "@annot.Foo(" + element + ")";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa);
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- TextRange textRange = ASTTools.buildTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(this.getSource(cu).indexOf(element), textRange.getOffset());
- assertEquals(element.length(), textRange.getLength());
- }
-
- public void testASTNode4() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo";
- ICompilationUnit cu = this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa);
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- TextRange textRange = ASTTools.buildTextRange(aea.getAstNode(this.buildASTRoot(cu)));
- assertEquals(this.getSource(cu).indexOf(annotation), textRange.getOffset());
- assertEquals(annotation.length(), textRange.getLength());
- }
-
- public void testSetValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain("bar", cu);
- }
-
- public void testSetValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@Foo", cu);
- }
-
- public void testSetValue3() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceDoesNotContain("fred", cu);
- }
-
- public void testSetValue3a() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceDoesNotContain("fred", cu);
- this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy=@Baz))", cu);
- }
-
- public void testSetValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(bar = \"xxx\")", cu);
- }
-
- public void testSetValue5() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(Boolean.TRUE);
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=true)))", cu);
- }
-
- public void testSetValue6() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<Boolean> daea = new ConversionDeclarationAnnotationElementAdapter<Boolean>(daa3, "fred", BooleanExpressionConverter.instance());
- AnnotationElementAdapter<Boolean> aea = new AnnotatedElementAnnotationElementAdapter<Boolean>(this.idField(cu), daea);
-
- aea.setValue(Boolean.TRUE);
- this.assertSourceContains("@Foo(@Bar(jimmy = @Baz(fred = true)))", cu);
- }
-
- public void testSetValue7() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("yyy");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(bar=\"yyy\")", cu);
- }
-
- public void testSetValue8() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(bar = \"xxx\")", cu);
- }
-
- public void testSetValue9() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value(); String bar();");
- String annotation = "@annot.Foo(\"zzz\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@Foo(value = \"zzz\", bar = \"xxx\")", cu);
- }
-
- public void testSetValue10() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar(); String baz();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "baz");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("yyy");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(bar=\"xxx\", baz = \"yyy\")", cu);
- }
-
- public void testSetValue11() throws Exception {
- this.createAnnotationAndMembers("Baz", "int fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=2), @annot.Baz(fred=3)}))";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "jimmy", 2, "annot.Baz");
- DeclarationAnnotationElementAdapter<Integer> daea = new ConversionDeclarationAnnotationElementAdapter<Integer>(daa3, "fred", NumberIntegerExpressionConverter.instance());
- AnnotationElementAdapter<Integer> aea = new AnnotatedElementAnnotationElementAdapter<Integer>(this.idField(cu), daea);
-
- assertEquals(Integer.valueOf(2), aea.getValue());
- aea.setValue(Integer.valueOf(48));
- this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=48), @annot.Baz(fred=3)}))", cu);
- }
-
- public void testSetValue12() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(\"xxx\")", cu);
- }
-
- public void testSetValue13() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo(\"zzz\")";
- ICompilationUnit cu = this.createTestType(annotation);
- this.assertSourceContains(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
-
- aea.setValue("xxx");
- this.assertSourceDoesNotContain(annotation, cu);
- this.assertSourceContains("@annot.Foo(\"xxx\")", cu);
- }
-
- public void testSimpleTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.lang.Object", aea.getValue());
- }
-
- public void testSimpleTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("java.lang.Object");
- this.assertSourceContains("@Foo(bar = java.lang.Object.class)", cu);
- }
-
- public void testSimpleTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testSimpleTypeLiteral4() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.util.Map.Entry.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.util.Map.Entry", aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("int", aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("int");
- this.assertSourceContains("@Foo(bar = int.class)", cu);
- }
-
- public void testPrimitiveTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral4() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=void.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("void", aea.getValue());
- }
-
- public void testTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.lang.Object", aea.getValue());
- }
-
- public void testTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("java.lang.Object");
- this.assertSourceContains("@Foo(bar = java.lang.Object.class)", cu);
- }
-
- public void testTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=java.util.Map.Entry.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("java.util.Map.Entry", aea.getValue());
- }
-
- public void testTypeLiteral14() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("int", aea.getValue());
- }
-
- public void testTypeLiteral5() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("int");
- this.assertSourceContains("@Foo(bar = int.class)", cu);
- }
-
- public void testTypeLiteral6() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=void.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", TypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("void", aea.getValue());
- }
-
- public void testValueEnum1() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=enums.TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testValueEnum2() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.XXX", "@annot.Foo(bar=XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testValueEnum3() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertNull(aea.getValue());
- }
-
- public void testValueEnum4() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- ICompilationUnit cu = this.createTestType("enums.TestEnum", "@annot.Foo(bar=TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testSetValueEnum1() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- String expected = "@annot.Foo(bar=XXX)";
- ICompilationUnit cu = this.createTestType("static enums.TestEnum.XXX", expected);
- this.assertSourceContains(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue(null);
- this.assertSourceDoesNotContain("bar", cu);
- }
-
- public void testSetValueEnum2() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- String expected = "@Foo(bar = XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea);
- aea.setValue("enums.TestEnum.XXX");
- this.assertSourceContains("import static enums.TestEnum.XXX;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumImportCollision1() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum bar1(); enums2.TestEnum bar2();");
- String expected = "@Foo(bar1 = XXX, bar2 = TestEnum.XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums1.TestEnum.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums2.TestEnum.XXX");
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumImportCollision2() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum bar1(); enums2.TestEnum bar2();");
- String expected = "@annot.Foo(bar1=XXX, bar2 = TestEnum.XXX)";
- ICompilationUnit cu = this.createTestType("static enums1.TestEnum.*", "@annot.Foo(bar1=XXX)");
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums2.TestEnum.XXX");
-
- this.assertSourceContains("import static enums1.TestEnum.*;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumImportCollision3() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1 bar1(); enums.TestEnum2 bar2();");
- String expected = "@Foo(bar1 = XXX, bar2 = TestEnum2.XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums.TestEnum1.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums.TestEnum2.XXX");
-
- this.assertSourceContains("import static enums.TestEnum1.XXX;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumImportCollision4() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1 bar1(); enums.TestEnum2 bar2();");
- String expected = "@annot.Foo(bar1=XXX, bar2 = TestEnum2.XXX)";
- ICompilationUnit cu = this.createTestType("static enums.TestEnum1.*", "@annot.Foo(bar1=XXX)");
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums.TestEnum2.XXX");
-
- this.assertSourceContains("import static enums.TestEnum1.*;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- /**
- * not sure this is exactly what we want...
- * it would be nice if we just skip the static import; but it's a matter of taste...
- */
- public void testSetValueEnumImportCollision5() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1 bar1(); enums.TestEnum2 bar2();");
- String expected = "@Foo(bar1 = XXX, bar2 = TestEnum2.XXX)";
- ICompilationUnit cu = this.createTestType("enums.*", "");
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums.TestEnum1.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums.TestEnum2.XXX");
-
- this.assertSourceContains("import enums.*;", cu);
- this.assertSourceContains("import static enums.TestEnum1.XXX;", cu);
- this.assertSourceDoesNotContain("import enums.TestEnum2;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumImportCollision6() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums3", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum bar1(); enums2.TestEnum bar2(); enums3.TestEnum bar3();");
- String expected = "@Foo(bar1 = XXX, bar2 = TestEnum.XXX, bar3 = enums3.TestEnum.XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String> daea1 = new EnumDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String> aea1 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea1);
- aea1.setValue("enums1.TestEnum.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea2 = new EnumDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String> aea2 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea2);
- aea2.setValue("enums2.TestEnum.XXX");
-
- DeclarationAnnotationElementAdapter<String> daea3 = new EnumDeclarationAnnotationElementAdapter(daa, "bar3");
- AnnotationElementAdapter<String> aea3 = new AnnotatedElementAnnotationElementAdapter<String>(this.idField(cu), daea3);
- aea3.setValue("enums3.TestEnum.XXX");
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceDoesNotContain("import static enums3", cu);
- this.assertSourceDoesNotContain("import enums3", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testValueStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={\"string0\", \"string1\"})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"string0", "string1"}, aea.getValue()));
- }
-
- public void testValueStringArrayConcatenation() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={\"stri\" + \"ng0\", \"s\" + \"tring1\"})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"string0", "string1"}, aea.getValue()));
- }
-
- public void testValueStringArrayEmpty() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testValueStringArraySingleElement() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"string0\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[]>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"string0"}, aea.getValue()));
- }
-
- public void testValueNullStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new IndexedConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testSetValueStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String expected = "@Foo(bar = { \"string0\", \"string1\" })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new IndexedConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"string0", "string1"});
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueStringArrayEmptyRemove() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String expected = "@Foo";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new IndexedConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceDoesNotContain(expected, cu);
- }
-
- public void testSetValueStringArrayEmpty() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String expected = "@Foo(bar = {})";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- IndexedExpressionConverter<String> expressionConverter = new AnnotationStringArrayExpressionConverter(StringExpressionConverter.instance(), false);
- DeclarationAnnotationElementAdapter<String[]> daea = new IndexedConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", expressionConverter);
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueStringArraySingleElement() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String annotation = "@Foo(bar = \"string0\")";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(annotation, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new IndexedConversionDeclarationAnnotationElementAdapter<String>(daa, "bar", AnnotationStringArrayExpressionConverter.forStrings());
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"string0"});
- this.assertSourceContains(annotation, cu);
- }
-
- public void testValueEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={enums.TestEnum.XXX, enums.TestEnum.YYY})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"}, aea.getValue()));
- }
-
- public void testValueEnumArrayInvalidEntry() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={enums.TestEnum.XXX, 88})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX", null}, aea.getValue()));
- }
-
- public void testValueEnumArrayEmpty() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar={})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testValueEnumArraySingleElement() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=enums.TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX"}, aea.getValue()));
- }
-
- public void testValueEnumArraySingleElementInvalid() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(bar=\"\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[] {null}, aea.getValue()));
- }
-
- public void testValueNullEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- assertTrue(Arrays.equals(new String[0], aea.getValue()));
- }
-
- public void testSetValueEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String expected = "@Foo(bar = { XXX, YYY })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"});
- this.assertSourceContains("import static enums.TestEnum.XXX;", cu);
- this.assertSourceContains("import static enums.TestEnum.YYY;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumArrayEmptyRemove() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String expected = "@Foo";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceDoesNotContain(expected, cu);
- }
-
- public void testSetValueEnumArrayEmpty() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String expected = "@Foo(bar = {})";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar", false);
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[0]);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumArraySingleElement() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String expected = "@Foo(bar = XXX)";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea);
- aea.setValue(new String[] {"enums.TestEnum.XXX"});
- this.assertSourceContains("import static enums.TestEnum.XXX;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumArrayImportCollision1() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum[] bar1(); enums2.TestEnum[] bar2();");
- String expected = "@Foo(bar1 = { XXX, YYY }, bar2 = { TestEnum.XXX, TestEnum.YYY })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- aea1.setValue(new String[] {"enums1.TestEnum.XXX", "enums1.TestEnum.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums2.TestEnum.XXX", "enums2.TestEnum.YYY"});
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceContains("import static enums1.TestEnum.YYY;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.YYY;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumArrayImportCollision2() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum[] bar1(); enums2.TestEnum[] bar2();");
- String expected = "@annot.Foo(bar1={XXX,YYY}, bar2 = { TestEnum.XXX, TestEnum.YYY })";
- ICompilationUnit cu = this.createTestType("static enums1.TestEnum.*", "@annot.Foo(bar1={XXX,YYY})");
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums2.TestEnum.XXX", "enums2.TestEnum.YYY"});
-
- this.assertSourceContains("import static enums1.TestEnum.*;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums2.TestEnum.YYY;", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumArrayImportCollision3() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1[] bar1(); enums.TestEnum2[] bar2();");
- String expected = "@Foo(bar1 = { XXX, YYY }, bar2 = { TestEnum2.XXX, TestEnum2.YYY })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- aea1.setValue(new String[] {"enums.TestEnum1.XXX", "enums.TestEnum1.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums.TestEnum2.XXX", "enums.TestEnum2.YYY"});
-
- this.assertSourceContains("import static enums.TestEnum1.XXX;", cu);
- this.assertSourceContains("import static enums.TestEnum1.YYY;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.YYY;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumArrayImportCollision4() throws Exception {
- this.createEnum("TestEnum1", "XXX, YYY, ZZZ");
- this.createEnum("TestEnum2", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum1[] bar1(); enums.TestEnum2[] bar2();");
- String expected = "@annot.Foo(bar1={XXX,YYY}, bar2 = { TestEnum2.XXX, TestEnum2.YYY })";
- ICompilationUnit cu = this.createTestType("static enums.TestEnum1.*", "@annot.Foo(bar1={XXX,YYY})");
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- assertNotNull(aea1.getValue());
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums.TestEnum2.XXX", "enums.TestEnum2.YYY"});
-
- this.assertSourceContains("import static enums.TestEnum1.*;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.XXX;", cu);
- this.assertSourceDoesNotContain("import static enums.TestEnum2.YYY;", cu);
- this.assertSourceContains("import enums.TestEnum2;", cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testSetValueEnumArrayImportCollision6() throws Exception {
- this.createEnum("enums1", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums2", "TestEnum", "XXX, YYY, ZZZ");
- this.createEnum("enums3", "TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums1.TestEnum[] bar1(); enums2.TestEnum[] bar2(); enums3.TestEnum[] bar3();");
- String expected = "@Foo(bar1 = { XXX, YYY }, bar2 = { TestEnum.XXX, TestEnum.YYY }, bar3 = { enums3.TestEnum.XXX, enums3.TestEnum.YYY })";
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- DeclarationAnnotationElementAdapter<String[]> daea1 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar1");
- AnnotationElementAdapter<String[]> aea1 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea1);
- aea1.setValue(new String[] {"enums1.TestEnum.XXX", "enums1.TestEnum.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea2 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar2");
- AnnotationElementAdapter<String[]> aea2 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea2);
- aea2.setValue(new String[] {"enums2.TestEnum.XXX", "enums2.TestEnum.YYY"});
-
- DeclarationAnnotationElementAdapter<String[]> daea3 = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar3");
- AnnotationElementAdapter<String[]> aea3 = new AnnotatedElementAnnotationElementAdapter<String[]>(this.idField(cu), daea3);
- aea3.setValue(new String[] {"enums3.TestEnum.XXX", "enums3.TestEnum.YYY"});
-
- this.assertSourceContains("import static enums1.TestEnum.XXX;", cu);
- this.assertSourceContains("import static enums1.TestEnum.YYY;", cu);
- this.assertSourceDoesNotContain("import static enums2", cu);
- this.assertSourceContains("import enums2.TestEnum;", cu);
- this.assertSourceDoesNotContain("import static enums3", cu);
- this.assertSourceDoesNotContain("import enums3", cu);
- this.assertSourceContains(expected, cu);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MiscTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MiscTests.java
deleted file mode 100644
index 77ef53aa9b..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/MiscTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.Signature;
-
-@SuppressWarnings("nls")
-public class MiscTests extends AnnotationTestCase {
-
- public MiscTests(String name) {
- super(name);
- }
-
- /*
- * Signature.toString(...) returns a dot-qualified name for member types
- */
- public void testSignature() throws Exception {
- IType hashTableType = this.getJavaProject().getJavaProject().findType("java.util.Hashtable");
- IField tableField = hashTableType.getField("table");
- String tableFieldTypeSignature = tableField.getTypeSignature();
- String tableFieldTypeName = Signature.toString(tableFieldTypeSignature);
- assertEquals(tableFieldTypeName, "java.util.Hashtable.Entry[]");
- }
-
- /*
- * IType.getFullyQualifiedName() returns a dollar-qualified name for member types
- * (but the lookup on IJavaProject takes a dot-qualified name!)
- */
- public void testITypeName() throws Exception {
- IType hashTableEntryType = this.getJavaProject().getJavaProject().findType("java.util.Hashtable.Entry");
- assertEquals(hashTableEntryType.getFullyQualifiedName(), "java.util.Hashtable$Entry");
- }
-
- public void testITypeParameterizedName() throws Exception {
- IType mapType = this.getJavaProject().getJavaProject().findType("java.util.Map");
- assertEquals(mapType.getFullyQualifiedParameterizedName(), "java.util.Map<K extends java.lang.Object, V extends java.lang.Object>");
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index f92e2d832f..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,763 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-@SuppressWarnings("nls")
-public class NestedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public NestedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar)");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar(yana=@annot.Baz))");
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "nestedAnnotation", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "yana", "annot.Baz");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa3);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotationNull1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=\"annot.Bar\")");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Bar2", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar2)");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceDoesNotContain("nestedAnnotation", cu);
- }
-
- public void testRemoveAnnotation1a() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("Foo", cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=\"annot.Bar\")";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Bar2", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar2)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();");
- String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar");
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceDoesNotContain("Baz", cu);
- }
-
- public void testRemoveAnnotation5a() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();");
- String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar");
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("@annot.Foo(nestedAnnotation1=@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotation = @Bar)", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value = \"something\", nestedAnnotation = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewSingleMemberAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotation = @Bar(\"test string literal\"))", cu);
- }
-
- void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(\"test string literal\"))", cu);
- }
-
- void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value = \"something\", nestedAnnotation = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewNormalAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotation = @Bar(yyy = \"test string literal\"))", cu);
- }
-
- void editNewNormalAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(yyy = \"test string literal\"))", cu);
- }
-
- void editNewNormalAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value = \"something\", nestedAnnotation = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index ae4f0f9788..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,2229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-@SuppressWarnings("nls")
-public class NestedIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public NestedIndexedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotation(String annotationName) throws Exception {
- this.createAnnotationAndMembers(annotationName, "");
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})");
- // 0
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa.getAnnotation(astRoot);
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
-
- // 1
- daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 1, "annot.Bar");
- aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- annotation = aa.getAnnotation(astRoot);
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isSingleMemberAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana=@annot.Baz))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa3);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotation3() throws Exception {
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa3);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa.getAnnotation(astRoot);
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
-
- // name mismatch
- daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz");
- aa = new ElementAnnotationAdapter(this.idField(cu), daa3);
- annotation = aa.getAnnotation(astRoot);
- assertNull(annotation);
- }
-
- public void testAnnotationNull1() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull2() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull3() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=\"annot.Bar\")");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull4() throws Exception {
- this.createAnnotation("NotBar");
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull6() throws Exception {
- this.createAnnotation("Xyz");
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa3);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("Foo", cu);
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={\"annot.Bar1\", \"annot.Bar2\", \"annot.Bar3\"})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.NotBar(0), @annot.NotBar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- assertNull(aa.getAnnotation(this.buildASTRoot(cu)));
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceDoesNotContain("nestedAnnotations", cu);
- }
-
- public void testRemoveAnnotation5a() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.Bar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation(this.buildASTRoot(cu)).isMarkerAnnotation());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- }
-
- public void testRemoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=\"annot.Bar\")";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.NotBar)";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na, cu);
- }
-
- public void testRemoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation(astRoot).isNormalAnnotation());
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})", cu);
- }
-
- public void testRemoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation(astRoot).isSingleMemberAnnotation());
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains("@annot.Foo({@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})", cu);
- }
-
- public void testRemoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo({null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 0, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain("Bar", cu);
- }
-
- public void testRemoveAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), null})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation15() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo({@annot.Bar(0), null, null, @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 3, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "value").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})";
- String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 1, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain("nestedAnnotations", cu);
- }
-
- public void testRemoveAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), null})";
- String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(this.buildASTRoot(cu)), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation20() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, null, @annot.Bar(3)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testRemoveAnnotation21() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})";
- ICompilationUnit cu = this.createTestType(na);
- this.assertSourceDoesNotContain(expected, cu);
- this.assertSourceContains(na, cu);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 3, "annot.Bar");
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- Annotation annotation = aa2.getAnnotation(astRoot);
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(astRoot), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na, cu);
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations = @Bar)", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("Foo", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(@Bar)", cu);
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value = \"something\", nestedAnnotations = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- assertNull(aa.getAnnotation(this.buildASTRoot(cu)));
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations = { null, null, null, null, null, @Bar })", cu);
- }
-
- public void testNewMarkerAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected1 = "@Foo(value = \"something\", nestedAnnotations = { null, null, null, null,";
- String expected2 = "null, @Bar })";
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewMarkerAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar, \"two\"})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("Bar})", cu); // split line
- }
-
- public void testNewMarkerAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar})", cu);
- }
-
- public void testNewMarkerAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("Bar})", cu); // split line
- }
-
- public void testNewMarkerAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar})", cu);
- }
-
- public void testNewMarkerAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation23() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))");
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(88),null,@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation24() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(88))");
- String expected = "@annot.Foo({@annot.Bar(88),null,@Bar})";
- this.assertSourceDoesNotContain(expected, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected, cu);
- }
-
- public void testNewMarkerAnnotation25() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77)})");
- String expected1 = "@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split
- String expected2 = "@Bar})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 4, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewMarkerAnnotation26() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(88), @annot.Bar(77)})");
- String expected1 = "@annot.Foo({@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split
- String expected2 = "@Bar})";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 4, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewSingleMemberAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotations = @Bar(88))", cu);
- }
-
- void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(88))", cu);
- }
-
- void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations = @Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value = \"something\", nestedAnnotations = @Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations = { null, null, null, null, null, @Bar(MISSING) })", cu); // ???
- }
-
- public void testNewSingleMemberAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected1 = "@Foo(value = \"something\", nestedAnnotations = { null, null, null, null,";
- String expected2 = "null, @Bar(MISSING) })"; // ???
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewSingleMemberAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar(88), \"two\"})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation11(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation11(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Bar(MISSING)})", cu); // split line
- }
-
- public void testNewSingleMemberAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation13(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation13(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar(MISSING)})", cu);
- }
-
- public void testNewSingleMemberAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation15(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation15(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar(88)})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation16(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation16(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar(88)})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation17(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation17(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Bar(MISSING)})", cu); // ???
- }
-
- public void testNewSingleMemberAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation19(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation19(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation20(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation20(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar(MISSING)})", cu);
- }
-
- public void testNewSingleMemberAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(77))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation22(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewSingleMemberAnnotation22(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewNormalAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotations = @Bar(xxx = 88))", cu);
- }
-
- void editNewNormalAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(xxx = 88))", cu);
- }
-
- void editNewNormalAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value = \"something\", nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value(); String xxx();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations = { null, null, null, null, null, @Bar() })", cu);
- }
-
- public void testNewNormalAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(\"something\")");
- String expected1 = "@Foo(value = \"something\", nestedAnnotations = { null, null, null, null,";
- String expected2 = "null, @Bar() })";
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- }
-
- public void testNewNormalAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({ \"one\", \"two\" })");
- String expected = "@annot.Foo({ @Bar(xxx = 88), \"two\" })";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation11(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation11(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Bar()})", cu); // split line
- }
-
- public void testNewNormalAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation13(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation13(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar()})", cu);
- }
-
- public void testNewNormalAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation15(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation15(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar(xxx=88)})";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation16(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation16(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations = { \"something\" })");
- String expected = "@annot.Foo(nestedAnnotations = { @Bar(xxx = 88) })";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation17(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation17(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Bar()})", cu); // split line
- }
-
- public void testNewNormalAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations = \"something\")");
- String expected = "@annot.Foo(nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation19(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation19(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations = @annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation20(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation20(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar", cu);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar()})", cu);
- }
-
- public void testNewNormalAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(nestedAnnotations = @annot.Bar(77))");
- String expected = "@annot.Foo(nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected, cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation22(declaration);
- }
- });
- this.assertSourceContains(expected, cu);
- }
-
- void editNewNormalAnnotation22(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testMoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(00))");
- String expected = "@annot.Foo({null,@annot.Bar(00)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({null, @annot.Bar(11)})");
- String expected = "@annot.Foo(@annot.Bar(11))";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33), @annot.Bar(44)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), @annot.Bar(00)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})";
- this.assertSourceDoesNotContain(expected, cu);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})";
- ICompilationUnit cu = this.createTestType(expected); // the source should be unchanged
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11)})");
- String expected = "@annot.Foo(@annot.Bar(00))";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo(@annot.Bar(00))");
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceDoesNotContain("Bar", cu);
- }
-
- public void testMoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), null, @annot.Bar(22)})");
- String expected = "@annot.Foo(@annot.Bar(22))";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
- public void testMoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- ICompilationUnit cu = this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(33)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11)})";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new ElementIndexedAnnotationAdapter(this.idField(cu), idaa);
- Annotation annotation = iaa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected, cu);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index 8c86b93406..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/SimpleDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-
-@SuppressWarnings("nls")
-public class SimpleDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public SimpleDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotation(String annotationName) throws Exception {
- this.createAnnotation("annot", annotationName);
- }
-
- private void createAnnotation(String packageName, String annotationName) throws Exception {
- this.javaProject.createCompilationUnit(packageName, annotationName + ".java", "public @interface " + annotationName + " {}");
- }
-
- public void testAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo(1) @annot.Foo(2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isSingleMemberAnnotation());
- Expression value = ((SingleMemberAnnotation) annotation).getValue();
- assertEquals(ASTNode.NUMBER_LITERAL, value.getNodeType());
- assertEquals("1", ((NumberLiteral) value).getToken());
- }
-
- public void testAnnotation3() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("annot.Foo", "@Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testAnnotationNull1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- }
-
- public void testAnnotationNull2() throws Exception {
- this.createAnnotation("Foo");
- this.createAnnotation("Fop");
- ICompilationUnit cu = this.createTestType("@annot.Fop");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- this.assertSourceContains("@annot.Fop", cu);
- }
-
- public void testAnnotationNull3() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- // un-qualified name
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
- this.assertSourceContains("@annot.Foo", cu);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo");
- this.assertSourceContains("@annot.Foo", cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("@annot.Foo", cu);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo(1) @annot.Foo(2)");
- this.assertSourceContains("@annot.Foo(1) @annot.Foo(2)", cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("@annot.Foo(1)", cu);
- this.assertSourceContains("@annot.Foo(2)", cu);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("import annot.Foo;", cu);
- this.assertSourceDoesNotContain("@Foo", cu);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("@annot.Foo(88)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new ElementAnnotationAdapter(this.idField(cu), daa);
- Annotation annotation = aa.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- this.assertSourceDoesNotContain("@annot.Foo(88)", cu);
- }
-
- public void testNewSingleMemberAnnotation() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SimpleDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation(declaration);
- }
- });
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo(\"test string literal\")", cu);
- }
-
- void editNewSingleMemberAnnotation(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewNormalAnnotation() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- this.idField(cu).edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SimpleDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation(declaration);
- }
- });
- this.assertSourceContains("import annot.Foo;", cu);
- this.assertSourceContains("@Foo(bar = \"test string literal\")", cu);
- }
-
- void editNewNormalAnnotation(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- MemberValuePair mvp = this.newMemberValuePair(annotation.getAST(), "bar", "test string literal");
- this.values(annotation).add(mvp);
- }
-
- public void testImportCollision1() throws Exception {
- this.createAnnotation("annot1", "Foo");
- this.createAnnotation("annot2", "Foo");
- ICompilationUnit cu = this.createTestType();
- this.assertSourceDoesNotContain("@Foo", cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot1.Foo");
- DeclarationAnnotationAdapter daa2 = new SimpleDeclarationAnnotationAdapter("annot2.Foo");
-
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- Annotation annotation1 = aa1.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation1);
-
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation2 = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation2);
-
- aa1.newMarkerAnnotation();
- this.assertSourceContains("import annot1.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
-
- aa2.newMarkerAnnotation();
- this.assertSourceDoesNotContain("import annot2.Foo;", cu);
- this.assertSourceContains("@annot2.Foo", cu);
- }
-
- public void testImportCollision2() throws Exception {
- this.createAnnotation("annot1", "Foo");
- this.createAnnotation("annot2", "Foo");
- ICompilationUnit cu = this.createTestType("annot1.*", "@Foo");
- this.assertSourceContains("import annot1.*;", cu);
- this.assertSourceContains("@Foo", cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot1.Foo");
- DeclarationAnnotationAdapter daa2 = new SimpleDeclarationAnnotationAdapter("annot2.Foo");
-
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- Annotation annotation1 = aa1.getAnnotation(this.buildASTRoot(cu));
- assertNotNull(annotation1);
-
- AnnotationAdapter aa2 = new ElementAnnotationAdapter(this.idField(cu), daa2);
- Annotation annotation2 = aa2.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation2);
-
- aa2.newMarkerAnnotation();
- this.assertSourceDoesNotContain("import annot2.Foo;", cu);
- this.assertSourceContains("@annot2.Foo", cu);
- }
-
- public void testImportWildCard() throws Exception {
- this.createAnnotation("Foo");
- ICompilationUnit cu = this.createTestType("annot.*", "");
- this.assertSourceContains("import annot.*;", cu);
- this.assertSourceDoesNotContain("@Foo", cu);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
-
- AnnotationAdapter aa1 = new ElementAnnotationAdapter(this.idField(cu), daa1);
- Annotation annotation1 = aa1.getAnnotation(this.buildASTRoot(cu));
- assertNull(annotation1);
-
- aa1.newMarkerAnnotation();
- this.assertSourceDoesNotContain("import annot.Foo;", cu);
- this.assertSourceContains("@Foo", cu);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeTests.java
deleted file mode 100644
index ebd80a401f..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-
-@SuppressWarnings("nls")
-public class TypeTests extends AnnotationTestCase {
-
- public TypeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected ICompilationUnit createCompilationUnit(String source) throws CoreException {
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, source);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void test1() throws Exception {
- ICompilationUnit jdtCompilationUnit = this.createCompilationUnit(this.buildTest1Source());
- assertNotNull(jdtCompilationUnit);
- }
-
- private String buildTest1Source() {
- StringBuilder sb = new StringBuilder();
- sb.append("public class ").append(TYPE_NAME).append(" {").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(" public int getId() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append("}").append(CR);
- return sb.toString();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/test.xml b/common/tests/org.eclipse.jpt.common.core.tests/test.xml
deleted file mode 100644
index 0034685b7a..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/test.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0"?> <!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.common.core.tests"/> <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1">
- <property file="${testRoot}/testServer.properties"/>
- <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/>
- <delete dir="${jpt-folder}" quiet="true"/>
-
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jpt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.common.core.tests.internal.JptCommonCoreTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant> </target>
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1,cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/.classpath b/common/tests/org.eclipse.jpt.common.ui.tests/.classpath
deleted file mode 100644
index 62dd151822..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/.cvsignore b/common/tests/org.eclipse.jpt.common.ui.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/.project b/common/tests/org.eclipse.jpt.common.ui.tests/.project
deleted file mode 100644
index 0e0633e91a..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.ui.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/.settings/org.eclipse.jdt.core.prefs b/common/tests/org.eclipse.jpt.common.ui.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 1da1cd1a72..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:06:44 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/META-INF/MANIFEST.MF b/common/tests/org.eclipse.jpt.common.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 8aa4fa0986..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.common.ui.tests
-Bundle-Version: 1.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle:
- org.junit;bundle-version="4.3.1",
- org.eclipse.core.runtime;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.jface;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.5.100,4.0.0)",
- org.eclipse.ui.workbench;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.5.0,4.0.0)"
-Export-Package: org.eclipse.jpt.common.ui.tests;x-internal:=true,
- org.eclipse.jpt.common.ui.tests.internal.jface;x-internal:=true,
- org.eclipse.jpt.common.ui.tests.internal.swt;x-internal:=true,
- org.eclipse.jpt.common.ui.tests.internal.util;x-internal:=true,
- org.eclipse.jpt.common.ui.tests.internal.utility.swt;x-internal:=true
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/build.properties b/common/tests/org.eclipse.jpt.common.ui.tests/build.properties
deleted file mode 100644
index 4dce676b59..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/plugin.properties b/common/tests/org.eclipse.jpt.common.ui.tests/plugin.properties
deleted file mode 100644
index 7b81997383..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - Common UI Tests
-providerName=Eclipse Web Tools Platform
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java
deleted file mode 100644
index bb3b72fe07..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.common.ui.tests.internal.swt.JptUiSWTTests;
-import org.eclipse.jpt.common.ui.tests.internal.util.JptUiUtilTests;
-
-/**
- * Runs all JPT UI Tests
- */
-public class JptCommonUiTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCommonUiTests.class.getPackage().getName());
- suite.addTest(JptUiSWTTests.suite());
- suite.addTest(JptUiUtilTests.suite());
- return suite;
- }
-
- private JptCommonUiTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
deleted file mode 100644
index 223b8e64cd..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
+++ /dev/null
@@ -1,602 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.jface;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.NullCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class DelegatingLabelProviderUiTest extends ApplicationWindow
-{
- private TreeViewer tree;
-
- private WritablePropertyValueModel<Vehicle> selectedVehicle;
-
-
- public static void main(String[] args) {
- Window window = new DelegatingLabelProviderUiTest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
-
- private DelegatingLabelProviderUiTest(String[] args) {
- super(null);
- this.selectedVehicle = new SimplePropertyValueModel<Vehicle>();
- }
-
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(400, 400);
- parent.setLayout(new GridLayout());
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
- mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
- return mainPanel;
- }
-
- private void buildTreePanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout());
-
- Label label = new Label(panel, SWT.NONE);
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- label.setText("My Vehicles");
-
- tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- DelegatingContentAndLabelProvider contentAndLabelProvider =
- new DelegatingTreeContentAndLabelProvider(
- new VehicleContentProviderFactory(),
- new VehicleLabelProviderFactory());
- tree.setContentProvider(contentAndLabelProvider);
- tree.setLabelProvider(contentAndLabelProvider);
- tree.setInput(new Root());
- tree.addSelectionChangedListener(buildTreeSelectionChangedListener());
- }
-
- private ISelectionChangedListener buildTreeSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle.setValue((Vehicle) ((IStructuredSelection) event.getSelection()).getFirstElement());
- }
- };
- }
-
- private void buildControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout());
- buildUpperControlPanel(panel);
- buildLowerControlPanel(panel);
- }
-
- private void buildUpperControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout(2, true));
- buildVehicleCombo(panel);
- buildColorCombo(panel);
- }
-
- private void buildVehicleCombo(Composite parent) {
- final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
- combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- combo.setContentProvider(new ArrayContentProvider());
- combo.setLabelProvider(new VehicleTypeLabelProvider());
- combo.setInput(
- new VehicleType[] {
- VehicleType.BICYCLE, VehicleType.CAR,
- VehicleType.TRUCK, VehicleType.BOAT
- });
- combo.getCombo().setEnabled(false);
- combo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setVehicleType((VehicleType) ((StructuredSelection) event.getSelection()).getFirstElement());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.vehicleType()));
- }
- });
- }
-
- private void buildColorCombo(Composite parent) {
- final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
- combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- combo.setContentProvider(new ArrayContentProvider());
- combo.setLabelProvider(new ColorLabelProvider());
- combo.setInput(new Color[] {Color.RED, Color.BLUE, Color.YELLOW, Color.GREEN});
- combo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setColor((Color) ((StructuredSelection) event.getSelection()).getFirstElement());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.color()));
- }
- });
- }
-
- private void buildLowerControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout(3, false));
- buildEffectsLabel(panel);
- buildGreyedCheckBox(panel);
- buildTranslucentCheckBox(panel);
- buildActionPanel(panel);
- }
-
- private void buildEffectsLabel(Composite parent) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText("Color effects: ");
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
- }
-
- private void buildGreyedCheckBox(Composite parent) {
- final Button button = new Button(parent, SWT.CHECK);
- button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- button.setText("greyed");
- button.setEnabled(false);
- button.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setGreyed(button.getSelection());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isGreyed());
- }
- });
- }
-
- private void buildTranslucentCheckBox(Composite parent) {
- final Button button = new Button(parent, SWT.CHECK);
- button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
- button.setText("translucent");
- button.setEnabled(false);
- button.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setTranslucent(button.getSelection());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isTranslucent());
- }
- });
- }
-
- private void buildActionPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.END, GridData.FILL, false, false));
- panel.setLayout(new GridLayout());
- buildRefreshTreeACI().fill(panel);
- }
-
- private ActionContributionItem buildRefreshTreeACI() {
- Action action = new Action("Refresh tree", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- refreshTree();
- }
- };
- action.setToolTipText("Refresh the tree's labels");
- return new ActionContributionItem(action);
- }
-
- void refreshTree() {
- tree.refresh();
- }
-
- private Vehicle selectedVehicle() {
- return selectedVehicle.getValue();
- }
-
-
- private static class VehicleTypeLabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((VehicleType) element).description();
- }
- }
-
-
- private static class ColorLabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((Color) element).description();
- }
- }
-
-
- private static class VehicleContentProviderFactory
- implements TreeItemContentProviderFactory
- {
- public TreeItemContentProvider buildItemContentProvider(Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- if (item instanceof Root) {
- return new RootContentProvider(
- (Root) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- return new VehicleContentProvider(
- (Vehicle) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- }
-
-
- private static class RootContentProvider extends AbstractTreeItemContentProvider<Vehicle>
- {
- public RootContentProvider(Root item, DelegatingTreeContentAndLabelProvider contentAndLabelProvider) {
- super(item, contentAndLabelProvider);
- }
-
- @Override
- public Root getModel() {
- return (Root) super.getModel();
- }
-
- @Override
- public Object getParent() {
- return null;
- }
-
- @Override
- protected CollectionValueModel<Vehicle> buildChildrenModel() {
- return new StaticCollectionValueModel<Vehicle>(this.getModel().vehicles());
- }
- }
-
- @SuppressWarnings("unchecked")
- private static class VehicleContentProvider extends AbstractTreeItemContentProvider
- {
- public VehicleContentProvider(Vehicle item, DelegatingTreeContentAndLabelProvider contentAndLabelProvider) {
- super(item, contentAndLabelProvider);
- }
-
- @Override
- public Vehicle getModel() {
- return (Vehicle) super.getModel();
- }
-
- @Override
- public Object getParent() {
- return getModel().parent();
- }
-
- @Override
- protected CollectionValueModel buildChildrenModel() {
- return new NullCollectionValueModel();
- }
- }
-
-
- private static class VehicleLabelProviderFactory
- implements ItemLabelProviderFactory
- {
- public ItemLabelProvider buildItemLabelProvider(Object element, DelegatingContentAndLabelProvider labelProvider) {
- return new VehicleLabelProvider((Vehicle) element, labelProvider);
- }
- }
-
-
- private static class VehicleLabelProvider extends AbstractItemLabelProvider
- {
- public VehicleLabelProvider(Vehicle vehicle, DelegatingContentAndLabelProvider labelProvider) {
- super(vehicle, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<Vehicle, Image>(
- new StaticPropertyValueModel<Vehicle>((Vehicle) getModel()),
- Vehicle.COLOR_PROPERTY, Vehicle.GREYED_PROPERTY, Vehicle.TRANSLUCENT_PROPERTY) {
- @Override
- protected Image buildValue_() {
- return subject.image();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<Vehicle, String>(
- new StaticPropertyValueModel<Vehicle>((Vehicle) getModel()),
- Vehicle.VEHICLE_TYPE_PROPERTY, Vehicle.COLOR_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.color().description() + ' ' + subject.vehicleType().description();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return buildTextModel();
- }
- }
-
-
- private static abstract class TreeNode extends AbstractModel
- {
- private TreeNode parent;
-
-
- public TreeNode(TreeNode parent) {
- this.parent = parent;
- }
-
-
- public TreeNode parent() {
- return parent;
- }
- }
-
-
- private static class Root extends TreeNode
- {
- protected final Vehicle[] vehicles;
-
-
- public Root() {
- super(null);
- vehicles = new Vehicle[] {
- new Vehicle(this, VehicleType.BICYCLE, Color.BLUE),
- new Vehicle(this, VehicleType.CAR, Color.YELLOW),
- new Vehicle(this, VehicleType.TRUCK, Color.RED),
- new Vehicle(this, VehicleType.BOAT, Color.GREEN)};
- }
-
- public Vehicle[] vehicles() {
- return vehicles;
- }
- }
-
-
- private static class Vehicle extends TreeNode
- {
- private VehicleType vehicleType;
- public final static String VEHICLE_TYPE_PROPERTY = "vehicleType";
-
- private Color color;
- public final static String COLOR_PROPERTY = "color";
-
- private boolean greyed = false;
- public final static String GREYED_PROPERTY = "greyed";
-
- private boolean translucent = false;
- public final static String TRANSLUCENT_PROPERTY = "translucent";
-
- private Image image;
-
-
- public Vehicle(TreeNode parent, VehicleType vehicleType, Color color) {
- super(parent);
- this.vehicleType = vehicleType;
- this.color = color;
- }
-
- public VehicleType vehicleType() {
- return vehicleType;
- }
-
- public void setVehicleType(VehicleType newVehicleType) {
- VehicleType oldVehicleType = vehicleType;
- vehicleType = newVehicleType;
- firePropertyChanged(VEHICLE_TYPE_PROPERTY, oldVehicleType, newVehicleType);
- }
-
- public Color color() {
- return color;
- }
-
- public void setColor(Color newColor) {
- Color oldColor = color;
- color = newColor;
- firePropertyChanged(COLOR_PROPERTY, oldColor, newColor);
- }
-
- public boolean isGreyed() {
- return greyed;
- }
-
- public void setGreyed(boolean newGreyed) {
- boolean oldGreyed = greyed;
- greyed = newGreyed;
- firePropertyChanged(GREYED_PROPERTY, oldGreyed, newGreyed);
- }
-
- public boolean isTranslucent() {
- return translucent;
- }
-
- public void setTranslucent(boolean newTranslucent) {
- boolean oldTranslucent = translucent;
- translucent = newTranslucent;
- firePropertyChanged(TRANSLUCENT_PROPERTY, oldTranslucent, newTranslucent);
- }
-
- public Image image() {
- if (image != null) {
- image.dispose();
- }
-
- return ImageFactory.image(color(), greyed, translucent);
- }
- }
-
-
- private static enum VehicleType
- {
- BICYCLE("bicycle"),
- CAR("car"),
- TRUCK("truck"),
- BOAT("boat");
-
- private final String description;
-
- private VehicleType(String description) {
- this.description = description;
- }
-
- public String description() {
- return description;
- }
-
- @Override
- public String toString() {
- return description();
- }
- }
-
-
- private static enum Color
- {
- RED("red", new RGB(255, 0, 0)),
- BLUE("blue", new RGB(0, 0, 255)),
- YELLOW("yellow", new RGB(255, 255, 0)),
- GREEN("green", new RGB(0, 255, 0));
-
- private final String description;
-
- private final RGB rgb;
-
- private Color(String description, RGB rgb) {
- this.description = description;
- this.rgb = rgb;
- }
-
- public String description() {
- return description;
- }
-
- public RGB rgb() {
- return rgb;
- }
-
- @Override
- public String toString() {
- return description();
- }
- }
-
-
- private static class ImageFactory
- {
- private static RGB rgb(Color color, boolean greyed, boolean translucent) {
- RGB rgb = (greyed) ? new RGB(127, 127, 127) : color.rgb();
- if (translucent) {
- rgb = new RGB(translucify(rgb.red), translucify(rgb.green), translucify(rgb.blue));
- }
- return rgb;
- }
-
- private static int translucify(int color) {
- return 255 - (int) ((255 - color) * 0.3);
- }
-
- public static Image image(Color color, boolean greyed, boolean translucent) {
- PaletteData pd = new PaletteData(new RGB[] {rgb(color, greyed, translucent)});
- ImageData id = new ImageData(20, 20, 1, pd);
- for (int x = 0; x < 20; x ++) {
- for (int y = 0; y < 20; y ++) {
- id.setPixel(x, y, 0);
- }
- }
- return new Image(Display.getCurrent(), id);
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
deleted file mode 100644
index 00af4be8e7..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.jface;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-@SuppressWarnings("nls")
-public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
-{
- private final Root root;
-
- private WritablePropertyValueModel<TreeNode> selectedNode;
-
- private TreeViewer controlTree;
-
- private TreeViewer viewTree;
-
- private Text nodeNameText;
-
-
- public static void main(String[] args) {
- Window window = new DelegatingTreeContentProviderUiTest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private DelegatingTreeContentProviderUiTest(String[] args) {
- super(null);
- this.root = new Root();
- this.root.addChild("Parent_1");
- this.selectedNode = new SimplePropertyValueModel<TreeNode>(this.root);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(800, 400);
- parent.setLayout(new GridLayout());
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
- mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
- return mainPanel;
- }
-
- private void buildTreePanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout(2, true));
- buildControlTreePanel(panel);
- buildViewTreePanel(panel);
- }
-
- private void buildControlTreePanel(Composite parent) {
- controlTree = buildTreePanel(
- parent, "Control tree",
- new DelegatingTreeContentAndLabelProvider(new ControlTreeItemContentProviderFactory()),
- new LabelProvider());
- controlTree.addSelectionChangedListener(buildTreeSelectionChangedListener());
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- controlTree.setSelection(new StructuredSelection(event.getNewValue()));
- }
- }
- );
- }
-
- private void buildViewTreePanel(Composite parent) {
- viewTree = buildTreePanel(
- parent, "View tree",
- new DelegatingTreeContentAndLabelProvider(new ViewTreeItemContentProviderFactory()),
- new LabelProvider());
- }
-
- private TreeViewer buildTreePanel(Composite parent, String labelText, ITreeContentProvider contentProvider, ILabelProvider labelProvider) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout());
-
- Label label = new Label(panel, SWT.LEFT);
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- label.setText(labelText);
-
- final TreeViewer tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- tree.setContentProvider(contentProvider);
- tree.setLabelProvider(labelProvider);
- tree.setInput(root);
-
- return tree;
- }
-
- private ISelectionChangedListener buildTreeSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- TreeNode selection = (TreeNode) ((IStructuredSelection) event.getSelection()).getFirstElement();
- selectedNode.setValue((selection == null) ? root : selection);
- }
- };
- }
-
- private void buildControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- panel.setLayout(new GridLayout(6, false));
- buildNodeNameText(panel);
- buildAddChildACI().fill(panel);
- buildAddNestedChildACI().fill(panel);
- buildRemoveACI().fill(panel);
- buildClearModelACI().fill(panel);
- buildRestoreModelACI().fill(panel);
- }
-
- private void buildNodeNameText(Composite parent) {
- nodeNameText = new Text(parent, SWT.SINGLE | SWT.BORDER);
- nodeNameText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- }
-
- private ActionContributionItem buildAddChildACI() {
- final Action action = new Action("Add child", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- addChild();
- }
- };
- action.setToolTipText("Add a child with the given name");
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(((TreeNode) event.getNewValue()).canHaveChildren());
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildAddNestedChildACI() {
- final Action action = new Action("Add nested child", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- addNestedChild();
- }
- };
- action.setToolTipText("Add a nested child with the given name");
- action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(((TreeNode) event.getNewValue()).canHaveNestedChildren());
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRemoveACI() {
- final Action action = new Action("Remove", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- remove();
- }
- };
- action.setToolTipText("Remove the selected node");
- action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(event.getNewValue() != root);
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("Clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- clearModel();
- }
- };
- action.setToolTipText("Clear the model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("Restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- restoreModel();
- }
- };
- action.setToolTipText("Restore the model");
- return new ActionContributionItem(action);
- }
-
- void addChild() {
- String nodeName = nodeNameText.getText();
- if (nodeName.length() != 0) {
- selectedNode.getValue().addChild(nodeName);
- }
- }
-
- void addNestedChild() {
- String nodeName = nodeNameText.getText();
- if (nodeName.length() != 0) {
- selectedNode.getValue().addNestedChild(nodeName);
- }
- }
-
- void remove() {
- TreeNode node = selectedNode.getValue();
- node.parent().removeChild(node);
- }
-
- void clearModel() {
- controlTree.setInput(null);
- viewTree.setInput(null);
- }
-
- void restoreModel() {
- controlTree.setInput(root);
- viewTree.setInput(root);
- }
-
-
- static abstract class AbstractTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory
- {
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- return new GenericTreeItemContentProvider(
- (TreeNode) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- }
-
-
- static class ControlTreeItemContentProviderFactory extends AbstractTreeItemContentProviderFactory
- {
-
- }
-
-
- static class ViewTreeItemContentProviderFactory
- extends AbstractTreeItemContentProviderFactory
- {
- @Override
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- if (item instanceof Parent) {
- return new ViewTreeParentItemContentProvider(
- (Parent) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- return super.buildItemContentProvider(item, contentAndLabelProvider);
- }
- }
-
-
- static class GenericTreeItemContentProvider extends AbstractTreeItemContentProvider<TreeNode>
- {
- public GenericTreeItemContentProvider(
- TreeNode treeNode, DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider) {
- super(treeNode, treeContentAndLabelProvider);
- }
-
- protected TreeNode treeNode() {
- return (TreeNode) getModel();
- }
-
- @Override
- public TreeNode getParent() {
- return treeNode().parent();
- }
-
- @Override
- protected CollectionValueModel<TreeNode> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<TreeNode>(
- new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, treeNode()) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return treeNode().children();
- }
- });
- }
- }
-
- static class ViewTreeParentItemContentProvider extends GenericTreeItemContentProvider
- {
- public ViewTreeParentItemContentProvider(
- TreeNode treeNode, DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider) {
- super(treeNode, treeContentAndLabelProvider);
- }
-
- @Override
- public TreeNode getParent() {
- TreeNode parent = super.getParent();
- if (parent instanceof Nest) {
- parent = parent.parent();
- }
- return parent;
- }
-
- @Override
- protected CollectionValueModel<TreeNode> buildChildrenModel() {
- return new CompositeCollectionValueModel<TreeNode, TreeNode>(super.buildChildrenModel()) {
- @Override
- protected CollectionValueModel<TreeNode> transform(TreeNode value) {
- if (value instanceof Nest) {
- final Nest nest = (Nest) value;
- return new ListCollectionValueModelAdapter<TreeNode>(
- new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, nest) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return nest.children();
- }
- }
- );
- }
- return new StaticCollectionValueModel<TreeNode>(CollectionTools.collection(value));
- }
- };
- }
- }
-
-
- static class LabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((TreeNode) element).getName();
- }
- }
-
-
- static abstract class TreeNode extends AbstractModel
- {
- private TreeNode parent;
-
- protected final List<TreeNode> children;
- public final static String CHILDREN_LIST = "children";
-
- protected String name;
- public final static String NAME_PROPERTY = "name";
-
-
- public TreeNode(TreeNode parent, String name) {
- this.parent = parent;
- this.children = new ArrayList<TreeNode>();
- this.name = name;
- }
-
- public TreeNode parent() {
- return parent;
- }
-
- public ListIterator<TreeNode> children() {
- return new ReadOnlyListIterator<TreeNode>(children);
- }
-
- protected void addChild(TreeNode child) {
- addItemToList(child, children, CHILDREN_LIST);
- }
-
- public void removeChild(TreeNode child) {
- removeItemFromList(child, children, CHILDREN_LIST);
- }
-
- public void removeChild(int index) {
- removeItemFromList(index, children, CHILDREN_LIST);
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public boolean canHaveChildren() {
- return false;
- }
-
- public void addChild(String name) {
- throw new UnsupportedOperationException();
- }
-
- public boolean canHaveNestedChildren() {
- return false;
- }
-
- public void addNestedChild(String name) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getName());
- }
- }
-
-
- static class Root extends TreeNode
- {
- public Root() {
- super(null, null);
- }
-
- @Override
- public boolean canHaveChildren() {
- return true;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Parent(this, name));
- }
- }
-
-
- static class Parent extends TreeNode
- {
- public Parent(TreeNode parent, String name) {
- super(parent, name);
- }
-
- @Override
- public boolean canHaveChildren() {
- return true;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Child(this, name));
- }
-
- @Override
- public boolean canHaveNestedChildren() {
- return true;
- }
-
- @Override
- public void addNestedChild(String name) {
- TreeNode nest = new Nest(this);
- addChild(nest);
- nest.addChild(name);
- }
-
- public Iterator<Child> nestlessChildren() {
- return new FilteringIterator<Child>(
- new TransformationIterator<TreeNode, Child>(children()) {
- @Override
- protected Child transform(TreeNode next) {
- if (next instanceof Nest) {
- return ((Nest) next).child();
- }
- return (Child) next;
- }
- },
- NotNullFilter.<Child>instance()
- );
- }
- }
-
-
- static class Nest extends TreeNode
- {
- public Nest(TreeNode parent) {
- super(parent, "nest");
- }
-
- @Override
- public boolean canHaveChildren() {
- return children.size() == 0;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Child(this, name));
- }
-
- /* can only have one child */
- public Child child() {
- return (children.isEmpty()) ? null : (Child) children.get(0);
- }
- }
-
-
- static class Child extends TreeNode
- {
- public Child(TreeNode parent, String name) {
- super(parent, name);
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/AbstractComboModelAdapterTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/AbstractComboModelAdapterTest.java
deleted file mode 100644
index d987d9e3eb..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/AbstractComboModelAdapterTest.java
+++ /dev/null
@@ -1,777 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.swt;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.AbstractComboModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.common.ui.internal.swt.AbstractComboModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public abstract class AbstractComboModelAdapterTest {
-
- private Model model;
- private WritablePropertyValueModel<SimpleDisplayable> selectedItemHolder;
- private Shell shell;
- private WritablePropertyValueModel<Model> subjectHolder;
-
- protected abstract AbstractComboModelAdapter<SimpleDisplayable> buildEditableComboModelAdapter();
-
- protected final ListValueModel<SimpleDisplayable> buildEmptyListHolder() {
- return new SimpleListValueModel<SimpleDisplayable>();
- }
-
- private List<SimpleDisplayable> buildList() {
- List<SimpleDisplayable> list = new ArrayList<SimpleDisplayable>();
- populateCollection(list);
- return list;
- }
-
- protected final ListValueModel<SimpleDisplayable> buildListHolder() {
- return new ListAspectAdapter<Model, SimpleDisplayable>(subjectHolder, Model.ITEMS_LIST) {
- @Override
- protected ListIterator<SimpleDisplayable> listIterator_() {
- return subject.items();
- }
-
- @Override
- protected int size_() {
- return subject.itemsSize();
- }
- };
- }
-
- protected abstract AbstractComboModelAdapter<SimpleDisplayable> buildReadOnlyComboModelAdapter();
-
- private SimpleDisplayable buildSelectedItem() {
- return new SimpleDisplayable("baz");
- }
-
- private WritablePropertyValueModel<SimpleDisplayable> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Model, SimpleDisplayable>(subjectHolder, Model.ITEM_PROPERTY) {
- @Override
- protected SimpleDisplayable buildValue_() {
- return subject.getItem();
- }
-
- @Override
- protected void setValue_(SimpleDisplayable value) {
- subject.setItem(value);
- }
- };
- }
-
- protected final StringConverter<SimpleDisplayable> buildStringConverter() {
- return new StringConverter<SimpleDisplayable>() {
- public String convertToString(SimpleDisplayable value) {
- return (value == null) ? "" : value.displayString();
- }
- };
- }
-
- private WritablePropertyValueModel<Model> buildSubjectHolder() {
- return new SimplePropertyValueModel<Model>();
- }
-
- public abstract String comboSelectedItem();
-
- protected abstract boolean emptyComboCanHaveSelectedValue();
-
- protected abstract String itemAt(int index);
-
- protected abstract int itemCounts();
-
- private void populateCollection(Collection<SimpleDisplayable> c) {
- c.add(new SimpleDisplayable("foo"));
- c.add(new SimpleDisplayable("bar"));
- c.add(new SimpleDisplayable("baz"));
- c.add(new SimpleDisplayable("joo"));
- c.add(new SimpleDisplayable("jar"));
- c.add(new SimpleDisplayable("jaz"));
- }
-
- protected final WritablePropertyValueModel<SimpleDisplayable> selectedItemHolder() {
- return selectedItemHolder;
- }
-
- @Before
- public void setUp() throws Exception {
-
- shell = new Shell(Display.getCurrent());
- model = new Model();
- subjectHolder = buildSubjectHolder();
- selectedItemHolder = buildSelectedItemHolder();
- }
-
- protected final Shell shell() {
- return shell;
- }
-
- protected final WritablePropertyValueModel<Model> subjectHolder() {
- return subjectHolder;
- }
-
- @After
- public void tearDown() throws Exception {
-
- if (!shell.isDisposed()) {
- shell.dispose();
- }
-
- shell = null;
- subjectHolder = null;
- selectedItemHolder = null;
- }
-
- private void testItems() {
-
- assertEquals(
- "The count of items is not in sync with the model",
- model.itemsSize(),
- itemCounts()
- );
-
- for (int index = 0; index < model.itemsSize(); index++) {
- assertEquals(
- "The item at index " + index + " is not the same between the model and the combo",
- model.itemAt(index).displayString(),
- itemAt(index)
- );
- }
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedAfter_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
- testRemoveItems_AddedAfter();
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedAfter_RemoveItems_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
- testRemoveItems_AddedAfter();
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedBefore_RemoveItems_Editable() throws Exception {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- buildEditableComboModelAdapter();
- testSelectedItem(null);
- testItems();
-
- ArrayList<SimpleDisplayable> items = new ArrayList<SimpleDisplayable>();
- items.add(model.itemAt(0));
- items.add(model.itemAt(3));
- model.removeItems(items.iterator());
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_AddedBefore_RemoveItems_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- buildReadOnlyComboModelAdapter();
- testSelectedItem(null);
- testItems();
-
- ArrayList<SimpleDisplayable> items = new ArrayList<SimpleDisplayable>();
- items.add(model.itemAt(0));
- items.add(model.itemAt(3));
- model.removeItems(items.iterator());
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterAfter_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterAfter_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterBefore_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
-
- model.addItems(buildList());
- subjectHolder.setValue(model);
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsAfterBefore_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
-
- model.addItems(buildList());
- subjectHolder.setValue(model);
-
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsBefore_Editable() throws Exception {
-
- model.addItems(buildList());
- buildEditableComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_ItemsBefore_ReadOnly() throws Exception {
-
- model.addItems(buildList());
- buildReadOnlyComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_NoItems_Editable() throws Exception {
-
- buildEditableComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_NullSelectedItem_NoItems_ReadOnly() throws Exception {
-
- buildReadOnlyComboModelAdapter();
-
- subjectHolder.setValue(model);
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectAfter_SelectedItemChanged_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- SimpleDisplayable selectedItem = model.itemAt(0);
-
- AbstractComboModelAdapter<SimpleDisplayable> adapter = buildEditableComboModelAdapter();
- SelectionListener selectionListener = new SelectionListener();
- adapter.addSelectionChangeListener(selectionListener);
-
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
- testSelectedItem(null);
-
- testSelectedItemChanged(selectedItem, selectionListener);
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_Editable() throws Exception {
-
- SimpleDisplayable selectedItem = buildSelectedItem();
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_Items_Editable() throws Exception {
-
- SimpleDisplayable selectedItem = buildSelectedItem();
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_Items_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemAfter_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_Editable() throws Exception {
-
- model.addItems(buildList());
- SimpleDisplayable selectedItem = model.itemAt(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_Items_Editable() throws Exception {
-
- model.addItems(buildList());
- SimpleDisplayable selectedItem = model.itemAt(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildEditableComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_Items_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NonNullSelectedItemBefore_ReadOnly() throws Exception {
-
- List<SimpleDisplayable> list = buildList();
- SimpleDisplayable selectedItem = list.get(0);
- subjectHolder.setValue(model);
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
-
- model.clearItemCalledFlag();
- buildReadOnlyComboModelAdapter();
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
-
- testSelectedItem(selectedItem);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_Items_Editable() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_Items_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_NoItems_Editable() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_NullSelectedItem_NoItems_ReadOnly() throws Exception {
-
- subjectHolder.setValue(model);
-
- buildEditableComboModelAdapter();
-
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item is supposed to remain null", model.getItem());
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNonNullSubjectBefore_SelectedItemChanged_Editable() throws Exception {
-
- model.addItems(buildList());
-
- SimpleDisplayable selectedItem = model.itemAt(3);
- subjectHolder.setValue(model);
-
- AbstractComboModelAdapter<SimpleDisplayable> adapter = buildEditableComboModelAdapter();
- SelectionListener selectionListener = new SelectionListener();
- adapter.addSelectionChangeListener(selectionListener);
-
- assertFalse("The selected item wasn't supposed to be modified", model.isSetItemCalled());
- testSelectedItem(null);
-
- testSelectedItemChanged(selectedItem, selectionListener);
- }
-
- private void testNullSubject() throws Exception {
-
- assertNull("The selected item should be null", selectedItemHolder.getValue());
-
- selectedItemHolder.setValue(buildSelectedItem());
- assertFalse("The item wasn't supposed to be modified", model.isSetItemCalled());
-
- // Null because the subject holder doesn't have the subject set
- testSelectedItem(null);
- testItems();
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_Items_Editable() throws Exception {
- buildEditableComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_Items_ReadOnly() throws Exception {
- buildReadOnlyComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_NoItems_Editable() throws Exception {
- buildEditableComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- @Test
- public void testNullSubject_NullSelectedItem_NoItems_ReadOnly() throws Exception {
- buildReadOnlyComboModelAdapter();
- testNullSubject();
- testItems();
- testSelectedItem(null);
- }
-
- private void testRemoveItems_AddedAfter() {
-
- subjectHolder.setValue(model);
- model.addItems(buildList());
-
- testSelectedItem(null);
- testItems();
- testSelectedItem(null);
-
- ArrayList<SimpleDisplayable> items = new ArrayList<SimpleDisplayable>();
- items.add(model.itemAt(0));
- items.add(model.itemAt(3));
- model.removeItems(items.iterator());
-
- testItems();
- testSelectedItem(null);
- }
-
- private void testSelectedItem(SimpleDisplayable selectedItem) {
-
- if (selectedItem == null) {
-
- assertNull(
- "The selected item is supposed to be null",
- model.getItem()
- );
-
- assertEquals(
- "The combo's selected item should be null",
- "",
- comboSelectedItem()
- );
- }
- else if (!emptyComboCanHaveSelectedValue()) {
-
- assertEquals(
- "The selected item wasn't set correctly",
- selectedItem,
- model.getItem()
- );
-
- assertEquals(
- "The combo's selected item should be null",
- "",
- comboSelectedItem()
- );
- }
- else {
-
- assertEquals(
- "The selected item wasn't set correctly",
- selectedItem,
- model.getItem()
- );
-
- assertEquals(
- "The selected item wasn't set correctly",
- selectedItem.displayString(),
- comboSelectedItem()
- );
- }
- }
-
- private void testSelectedItemChanged(SimpleDisplayable selectedItem,
- SelectionListener selectionListener) {
-
- // Test 1
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
-
- // Test 2
- selectedItem = model.itemAt(1);
- model.clearItemCalledFlag();
- selectionListener.clearInfo();
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
-
- // Test 3
- selectedItem = null;
- model.clearItemCalledFlag();
- selectionListener.clearInfo();
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertNull("The selected item wasn't set properly", model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
-
- // Test 3
- selectedItem = model.itemAt(2);
- model.clearItemCalledFlag();
- selectionListener.clearInfo();
-
- model.setItem(selectedItem);
- assertTrue("The selected item was supposed to be modified", model.isSetItemCalled());
- assertSame("The selected item wasn't set properly", selectedItem, model.getItem());
- assertTrue("The SelectionListener was supposed to be notified", selectionListener.isListenerNotified());
- assertSame("The SelectionListener was supposed to be notified", selectedItem, selectionListener.getItem());
- testSelectedItem(selectedItem);
- }
-
- private static class Model extends AbstractModel {
-
- private SimpleDisplayable item;
- private List<SimpleDisplayable> items = new ArrayList<SimpleDisplayable>();
- private boolean setItemCalled;
-
- static final String ITEM_PROPERTY = "item";
- static final String ITEMS_LIST = "items";
-
- void addItems(Iterator<SimpleDisplayable> items) {
- addItemsToList(items, this.items, ITEMS_LIST);
- }
-
- void addItems(List<SimpleDisplayable> items) {
- addItemsToList(items, this.items, ITEMS_LIST);
- }
-
- void clearItemCalledFlag() {
- setItemCalled = false;
- }
-
- SimpleDisplayable getItem() {
- return item;
- }
-
- boolean isSetItemCalled() {
- return setItemCalled;
- }
-
- SimpleDisplayable itemAt(int index) {
- return this.items.get(index);
- }
-
- ListIterator<SimpleDisplayable> items() {
- return items.listIterator();
- }
-
- int itemsSize() {
- return items.size();
- }
-
- void removeItems(Iterator<SimpleDisplayable> items) {
- removeItemsFromList(items, this.items, ITEMS_LIST);
- }
-
- void setItem(SimpleDisplayable item) {
- setItemCalled = true;
-
- SimpleDisplayable oldItem = this.item;
- this.item = item;
- firePropertyChanged(ITEM_PROPERTY, oldItem, item);
- }
- }
-
- private class SelectionListener implements SelectionChangeListener<SimpleDisplayable> {
-
- private SimpleDisplayable item;
- private boolean listenerNotified;
-
- void clearInfo() {
- this.listenerNotified = false;
- this.item = null;
- }
-
- SimpleDisplayable getItem() {
- return item;
- }
-
- public boolean isListenerNotified() {
- return listenerNotified;
- }
-
- public void selectionChanged(SelectionChangeEvent<SimpleDisplayable> e) {
- listenerNotified = true;
- item = e.selectedItem();
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/ComboModelAdapterTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/ComboModelAdapterTest.java
deleted file mode 100644
index f2379318d9..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/ComboModelAdapterTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.swt;
-
-import org.eclipse.jpt.common.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.ComboModelAdapter;
-import org.eclipse.jpt.common.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Combo;
-import org.junit.After;
-
-public class ComboModelAdapterTest extends AbstractComboModelAdapterTest {
-
- private Combo combo;
- private boolean editable;
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildEditableComboModelAdapter() {
-
- combo = new Combo(shell(), SWT.NULL);
- editable = true;
-
- return ComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- protected AbstractComboModelAdapter<SimpleDisplayable> buildReadOnlyComboModelAdapter() {
-
- combo = new Combo(shell(), SWT.READ_ONLY);
- editable = false;
-
- return ComboModelAdapter.adapt(
- buildListHolder(),
- selectedItemHolder(),
- combo,
- buildStringConverter()
- );
- }
-
- @Override
- public String comboSelectedItem() {
- return combo.getText();
- }
-
- @Override
- protected boolean emptyComboCanHaveSelectedValue() {
- return editable;
- }
-
- @Override
- protected String itemAt(int index) {
- return this.combo.getItem(index);
- }
-
- @Override
- protected int itemCounts() {
- return combo.getItemCount();
- }
-
- @After
- @Override
- public void tearDown() throws Exception {
- super.tearDown();
- combo = null;
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/JptUiSWTTests.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/JptUiSWTTests.java
deleted file mode 100644
index fb7f5d3d61..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/JptUiSWTTests.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.swt;
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@SuiteClasses
-({
- ComboModelAdapterTest.class,
- SpinnerModelAdapterTest.class,
- TableModelAdapterTest.class
-})
-@RunWith(Suite.class)
-public final class JptUiSWTTests {
-
- private JptUiSWTTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(new JUnit4TestAdapter(JptUiSWTTests.class));
- return suite;
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/SpinnerModelAdapterTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/SpinnerModelAdapterTest.java
deleted file mode 100644
index f8792a4e5f..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/SpinnerModelAdapterTest.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.swt;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import org.eclipse.jpt.common.ui.internal.swt.SpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Spinner;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public class SpinnerModelAdapterTest {
-
- private Model model;
- private Shell shell;
- private WritablePropertyValueModel<Model> subjectHolder;
-
- private WritablePropertyValueModel<Model> buildSubjectHolder() {
- return new SimplePropertyValueModel<Model>();
- }
-
- private WritablePropertyValueModel<Integer> buildValueHolder() {
- return new PropertyAspectAdapter<Model, Integer>(subjectHolder, Model.VALUE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return subject.getValue();
- }
-
- @Override
- protected void setValue_(Integer value) {
- subject.setValue(value);
- }
- };
- }
-
- @Before
- public void setUp() throws Exception {
-
- shell = new Shell(Display.getCurrent());
- model = new Model();
- subjectHolder = buildSubjectHolder();
- }
-
- @After
- public void tearDown() throws Exception {
-
- if (!shell.isDisposed()) {
- shell.dispose();
- }
-
- shell = null;
- subjectHolder = null;
- }
-
- @Test
- public void testDisposed() {
-
- int value = 2;
- model.setValue(value);
- model.clearSetValueCalledFlag();
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The number holder's value should be the model's value",
- model.getValue(),
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
-
- // Change the value in the model
- spinner.dispose();
-
- value = 4;
- model.setValue(value);
-
- assertEquals(
- "The model's value was somehow changed",
- Integer.valueOf(value),
- model.getValue()
- );
- }
-
- @Test
- public void testInitialization_1() {
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = new SimplePropertyValueModel<Integer>();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
-
- assertNull(
- "The number holder's value should be null",
- numberHolder.getValue()
- );
- }
-
- @Test
- public void testInitialization_2() {
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
-
- assertNull(
- "The number holder's value should be null",
- numberHolder.getValue()
- );
- }
-
- @Test
- public void testInitialization_3() {
-
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
-
- assertNull(
- "The number holder's value should be null",
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
- }
-
- @Test
- public void testInitialization_4() {
-
- int value = 2;
- model.setValue(value);
- model.clearSetValueCalledFlag();
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be the value coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The number holder's value should be " + value,
- Integer.valueOf(value),
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
- }
-
- @Test
- public void testValueChanged() {
-
- int value = 2;
- model.setValue(value);
- model.clearSetValueCalledFlag();
- subjectHolder.setValue(model);
-
- Spinner spinner = new Spinner(shell, SWT.NULL);
- WritablePropertyValueModel<Integer> numberHolder = buildValueHolder();
- int defaultValue = 1;
-
- SpinnerModelAdapter.adapt(
- numberHolder,
- spinner,
- defaultValue
- );
-
- assertEquals(
- "The spinner's value should be coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The number holder's value should be the model's value",
- model.getValue(),
- numberHolder.getValue()
- );
-
- assertFalse(
- "The model should not have received the value during initialization",
- model.isSetValueCalled()
- );
-
- // Change the value in the model
- value = 4;
- model.setValue(value);
-
- assertEquals(
- "The spinner's value should be coming from the model",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The model's value was somehow changed",
- Integer.valueOf(value),
- model.getValue()
- );
-
- // Change the value from the spinner
- value = 6;
- spinner.setSelection(value);
-
- assertEquals(
- "The spinner's value should be the new value set",
- value,
- spinner.getSelection()
- );
-
- assertEquals(
- "The model's value was supposed to be updated",
- Integer.valueOf(value),
- model.getValue()
- );
-
- // Disconnect from model
- subjectHolder.setValue(null);
-
- assertEquals(
- "The spinner's value should be the default value",
- defaultValue,
- spinner.getSelection()
- );
- }
-
- private static class Model extends AbstractModel {
-
- private boolean setValueCalled;
- private Integer value;
-
- static final String VALUE_PROPERTY = "value";
-
- void clearSetValueCalledFlag() {
- setValueCalled = false;
- }
-
- Integer getValue() {
- return value;
- }
-
- boolean isSetValueCalled() {
- return setValueCalled;
- }
-
- void setValue(Integer value) {
- setValueCalled = true;
-
- Integer oldValue = this.value;
- this.value = value;
- firePropertyChanged(VALUE_PROPERTY, oldValue, value);
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TableModelAdapterTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TableModelAdapterTest.java
deleted file mode 100644
index f8e6dd04a9..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TableModelAdapterTest.java
+++ /dev/null
@@ -1,1201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.swt;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public class TableModelAdapterTest {
-
- private Shell shell;
- private WritablePropertyValueModel<Manager> subjectHolder;
-
- private ColumnAdapter<Employee> buildColumnAdapter() {
- return new TableColumnAdapter();
- }
-
- private WritablePropertyValueModel<Employee> buildEmployeeHolder() {
- return new SimplePropertyValueModel<Employee>();
- }
-
- private SimpleCollectionValueModel<Employee> buildEmployeeHolders() {
- return new SimpleCollectionValueModel<Employee>();
- }
-
- private ListValueModel<Employee> buildEmployeeListHolder() {
- return new ListAspectAdapter<Manager, Employee>(subjectHolder, Manager.EMPLOYEES_LIST) {
- @Override
- protected ListIterator<Employee> listIterator_() {
- return subject.employees();
- }
-
- @Override
- protected int size_() {
- return subject.employeesSize();
- }
- };
- }
-
- private ITableLabelProvider buildLabelProvider() {
- return new TableLabelProvider();
- }
-
- private SelectionChangeListener<Employee> buildSelectionChangeListener(final Collection<Employee> employees) {
- return new SelectionChangeListener<Employee>() {
- public void selectionChanged(SelectionChangeEvent<Employee> e) {
- employees.clear();
- CollectionTools.addAll(employees, e.selection());
- }
- };
- }
-
- private WritablePropertyValueModel<Manager> buildSubjectHolder() {
- return new SimplePropertyValueModel<Manager>();
- }
-
- @Before
- public void setUp() throws Exception {
-
- shell = new Shell(Display.getCurrent());
- subjectHolder = buildSubjectHolder();
- }
-
- @After
- public void tearDown() throws Exception {
-
- if (!shell.isDisposed()) {
- shell.dispose();
- }
-
- shell = null;
- subjectHolder = null;
- }
-
- @Test
- public void testChanged() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Make sure the Table was populated
- Assert.assertEquals("The number of TableItems should be 3", 3, table.getItemCount());
-
- // Change the list of Employees
- ArrayList<Employee> employees = new ArrayList<Employee>(3);
- employees.add(employee3);
- employees.add(employee2);
- employees.add(employee1);
- manager.changeEmployees(employees);
-
- Assert.assertEquals("The number of TableItems should be 3", 3, table.getItemCount());
-
- testTableItemProperties(table, 0, expectedName3, expectedManager3, expectedTitle3);
- testTableItemProperties(table, 1, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, 2, expectedName1, expectedManager1, expectedTitle1);
- }
-
- @Test
- public void testCleared() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Make sure the Table was populated
- Assert.assertEquals("The number of TableItems should be 3", 3, table.getItemCount());
-
- // Test removing them all
- manager.removeAllEmployees();
-
- Assert.assertEquals("The list holder should have been cleared", 0, listHolder.size());
- Assert.assertEquals("The Table should have been cleared", 0, table.getItemCount());
- }
-
- @Test
- public void testItemAdded() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName = "Dali";
- String expectedManager = "WTP";
- String expectedTitle = "plug-in";
-
- Employee employee = manager.addEmployee(expectedName, expectedTitle, expectedManager);
- Assert.assertNotNull("The new Employee was not created", employee);
-
- // Retrieve the TableItem representing the new Employee
- int index = tableModel.indexOf(employee);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- testTableItemProperties(table, index, expectedName, expectedManager, expectedTitle);
- }
-
- @Test
- public void testItemMoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Make sure the Employees were added to the Table
- Assert.assertEquals("The number of TableItem should be 3", 3, table.getItemCount());
-
- // Move an Employee up the list
- manager.moveEmployeeUp(employee2);
-
- int index1 = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 was not moved in the table model", 1, index1);
-
- int index2 = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not moved in the table model", 0, index2);
-
- int index3 = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 should not have been moved in the table model", 2, index3);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
-
- // Move an Employee down the list
- manager.moveEmployeeDown(employee1);
-
- index1 = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 should not have been moved in the table model", 2, index1);
-
- index2 = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not moved in the table model", 0, index2);
-
- index3 = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 was not moved in the table model", 1, index3);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
- }
-
- @Test
- public void testItemRemoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName = "Dali";
- String expectedManager = "WTP";
- String expectedTitle = "plug-in";
-
- Employee employee = manager.addEmployee(expectedName, expectedTitle, expectedManager);
- Assert.assertNotNull("The new Employee was not created", employee);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- // Make sure it was added to the model
- int index = tableModel.indexOf(employee);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index);
- testTableItemProperties(table, index, expectedName, expectedManager, expectedTitle);
-
- // Retrieve the TableItem representing the new Employee
- TableItem tableItem = table.getItem(index);
- Assert.assertNotNull("No TableItem was found for the new Employee", tableItem);
-
- // Now test the item being removed
- manager.removeEmployee(employee);
- index = tableModel.indexOf(employee);
- Assert.assertEquals("The Employee was not removed from the table model", -1, index);
- Assert.assertEquals("The number of TableItem should be 0", 0, table.getItemCount());
- }
-
- @Test
- public void testItemReplaced() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- Employee employee1 = manager.addEmployee(expectedName1, expectedTitle1, expectedManager1);
- Assert.assertNotNull("The new Employee was not created", employee1);
-
- // Make sure it was added to the model
- int index1 = tableModel.indexOf(employee1);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index1);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- // Retrieve the TableItem representing the new Employee
- TableItem tableItem = table.getItem(index1);
- Assert.assertNotNull("No TableItem was found for the new Employee", tableItem);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
-
- // Replace the Employee
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- manager.replace(employee1, employee2);
-
- int index2 = tableModel.indexOf(employee2);
- Assert.assertSame("The Employee that got replaced should be at index " + index1, index1, index2);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- }
-
- @Test
- public void testItemsAdded() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Retrieve the TableItems representing the employees
- Assert.assertEquals("The number of TableItem should be 3", 3, table.getItemCount());
-
- int index = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 was not added to the table model", 0, index);
-
- index = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not added to the table model", 1, index);
-
- index = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 was not added to the table model", 2, index);
-
- // Make sure the TableItem was correctly populated
- testTableItemProperties(table, 0, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, 1, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, 2, expectedName3, expectedManager3, expectedTitle3);
- }
-
- @Test
- public void testItemsMoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- String expectedName4 = "Dali_4";
- String expectedManager4 = "WTP_4";
- String expectedTitle4 = "plug-in_4";
-
- String expectedName5 = "Dali_5";
- String expectedManager5 = "WTP_5";
- String expectedTitle5 = "plug-in_5";
-
- String expectedName6 = "Dali_6";
- String expectedManager6 = "WTP_6";
- String expectedTitle6 = "plug-in_6";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
- Employee employee4 = new Employee(expectedName4, expectedTitle4, expectedManager4);
- Employee employee5 = new Employee(expectedName5, expectedTitle5, expectedManager5);
- Employee employee6 = new Employee(expectedName6, expectedTitle6, expectedManager6);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
- manager.addEmployee(employee4);
- manager.addEmployee(employee5);
- manager.addEmployee(employee6);
-
- // Make sure the Employees were added to the Table
- Assert.assertEquals("The number of TableItem should be 6", 6, table.getItemCount());
-
- // Move an Employee up the list
- ArrayList<Employee> employees = new ArrayList<Employee>(3);
- employees.add(employee3);
- employees.add(employee4);
- employees.add(employee5);
- manager.moveEmployees(employees, 0);
-
- int index1 = tableModel.indexOf(employee1);
- int index2 = tableModel.indexOf(employee2);
- int index3 = tableModel.indexOf(employee3);
- int index4 = tableModel.indexOf(employee4);
- int index5 = tableModel.indexOf(employee5);
- int index6 = tableModel.indexOf(employee6);
-
- Assert.assertEquals("The Employee 1 is not at the right index", 3, index1);
- Assert.assertEquals("The Employee 2 is not at the right index", 4, index2);
- Assert.assertEquals("The Employee 3 is not at the right index", 0, index3);
- Assert.assertEquals("The Employee 4 is not at the right index", 1, index4);
- Assert.assertEquals("The Employee 5 is not at the right index", 2, index5);
- Assert.assertEquals("The Employee 6 is not at the right index", 5, index6);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
- testTableItemProperties(table, index4, expectedName4, expectedManager4, expectedTitle4);
- testTableItemProperties(table, index5, expectedName5, expectedManager5, expectedTitle5);
- testTableItemProperties(table, index6, expectedName6, expectedManager6, expectedTitle6);
-
- // Move an Employee down the list
- employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee2);
- manager.moveEmployees(employees, 4);
-
- index1 = tableModel.indexOf(employee1);
- index2 = tableModel.indexOf(employee2);
- index3 = tableModel.indexOf(employee3);
- index4 = tableModel.indexOf(employee4);
- index5 = tableModel.indexOf(employee5);
- index6 = tableModel.indexOf(employee6);
-
- Assert.assertEquals("The Employee 1 is not at the right index", 4, index1);
- Assert.assertEquals("The Employee 2 is not at the right index", 5, index2);
- Assert.assertEquals("The Employee 3 is not at the right index", 0, index3);
- Assert.assertEquals("The Employee 4 is not at the right index", 1, index4);
- Assert.assertEquals("The Employee 5 is not at the right index", 2, index5);
- Assert.assertEquals("The Employee 6 is not at the right index", 3, index6);
-
- testTableItemProperties(table, index1, expectedName1, expectedManager1, expectedTitle1);
- testTableItemProperties(table, index2, expectedName2, expectedManager2, expectedTitle2);
- testTableItemProperties(table, index3, expectedName3, expectedManager3, expectedTitle3);
- testTableItemProperties(table, index4, expectedName4, expectedManager4, expectedTitle4);
- testTableItemProperties(table, index5, expectedName5, expectedManager5, expectedTitle5);
- testTableItemProperties(table, index6, expectedName6, expectedManager6, expectedTitle6);
- }
-
- @Test
- public void testItemsRemoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Retrieve the TableItems representing the employees
- Assert.assertEquals("The number of TableItem should be 3", 3, table.getItemCount());
-
- int index = tableModel.indexOf(employee1);
- Assert.assertEquals("The Employee 1 was not added to the table model", 0, index);
-
- index = tableModel.indexOf(employee2);
- Assert.assertEquals("The Employee 2 was not added to the table model", 1, index);
-
- index = tableModel.indexOf(employee3);
- Assert.assertEquals("The Employee 3 was not added to the table model", 2, index);
-
- // Remove 2 items
- ArrayList<Employee> employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee3);
- manager.removeEmployees(employees);
-
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
- }
-
- @Test
- public void testPropertyChanged() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- WritablePropertyValueModel<Employee> selectedItemHolder = buildEmployeeHolder();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create a new Employee
- String expectedName = "Dali";
- String expectedManager = "WTP";
- String expectedTitle = "plug-in";
-
- Employee employee = manager.addEmployee(expectedName, expectedTitle, expectedManager);
- Assert.assertNotNull("The new Employee was not created", employee);
-
- // Make sure it was added to the model
- int index = tableModel.indexOf(employee);
- Assert.assertEquals("The new Employee was not added to the table model", 0, index);
- Assert.assertEquals("The number of TableItem should be 1", 1, table.getItemCount());
-
- // Retrieve the TableItem representing the new Employee
- TableItem tableItem = table.getItem(index);
- Assert.assertNotNull("No TableItem was found for the new Employee", tableItem);
-
- // Name property
- String actualName = tableItem.getText(TableColumnAdapter.NAME_COLUMN);
- Assert.assertEquals("TableItem[NAME_COLUMN] was not set correctly", expectedName, actualName);
-
- expectedName = "Jpt";
- employee.setName(expectedName);
-
- actualName = tableItem.getText(TableColumnAdapter.NAME_COLUMN);
- Assert.assertEquals("TableItem[NAME_COLUMN] was not set correctly", expectedName, actualName);
-
- // Manager property
- String actualManager = tableItem.getText(TableColumnAdapter.MANAGER_COLUMN);
- Assert.assertEquals("TableItem[MANAGER_COLUMN] was not set correctly", expectedManager, actualManager);
-
- expectedManager = "boss";
- employee.setManager(expectedManager);
-
- actualManager = tableItem.getText(TableColumnAdapter.MANAGER_COLUMN);
- Assert.assertEquals("TableItem[MANAGER_COLUMN] was not set correctly", expectedManager, actualManager);
-
- // Title property
- String actualTitle = tableItem.getText(TableColumnAdapter.TITLE_COLUMN);
- Assert.assertEquals("TableItem[TITLE_COLUMN] was not set correctly", expectedTitle, actualTitle);
-
- expectedTitle = "EclipseLink";
- employee.setTitle(expectedTitle);
-
- actualTitle = tableItem.getText(TableColumnAdapter.TITLE_COLUMN);
- Assert.assertEquals("TableItem[TITLE_COLUMN] was not set correctly", expectedTitle, actualTitle);
- }
-
- @Test
- public void testSelectedItemsAddedRemoved() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- SimpleCollectionValueModel<Employee> selectedItemsHolder = buildEmployeeHolders();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemsHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Test adding selected items
- ArrayList<Employee> employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee3);
- selectedItemsHolder.addAll(employees);
-
- Collection<Employee> actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be 2", 2, actualEmployees.size());
-
- actualEmployees.remove(employee1);
- actualEmployees.remove(employee3);
-
- Assert.assertTrue("The selected items was not retrieved correctly", actualEmployees.isEmpty());
-
- // Test removing selected items
- selectedItemsHolder.remove(employee1);
-
- actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be 1", 1, actualEmployees.size());
-
- actualEmployees.remove(employee3);
-
- Assert.assertTrue("The selected items was not retrieved correctly", actualEmployees.isEmpty());
- }
-
- @Test
- public void testSelectedItemsCleared() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- ListValueModel<Employee> listHolder = buildEmployeeListHolder();
- SimpleCollectionValueModel<Employee> selectedItemsHolder = buildEmployeeHolders();
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- listHolder,
- selectedItemsHolder,
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Test adding selected items
- ArrayList<Employee> employees = new ArrayList<Employee>(2);
- employees.add(employee1);
- employees.add(employee3);
- selectedItemsHolder.addAll(employees);
-
- Collection<Employee> actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be 2", 2, actualEmployees.size());
-
- actualEmployees.remove(employee1);
- actualEmployees.remove(employee3);
- Assert.assertTrue("The selected items was not retrieved correctly", actualEmployees.isEmpty());
-
- // Test removing selected items
- selectedItemsHolder.clear();
-
- actualEmployees = tableModel.selectedItems();
- Assert.assertNotNull("The collection of selected items can't be null", actualEmployees);
- Assert.assertEquals("The count of selected items should be ", 0, actualEmployees.size());
- }
-
- @Test
- public void testSelectionChangeListener() {
-
- Table table = new Table(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.MULTI);
-
- Manager manager = new Manager();
- subjectHolder.setValue(manager);
-
- TableModel tableModel = new TableModel(
- buildEmployeeListHolder(),
- buildEmployeeHolder(),
- table,
- buildColumnAdapter(),
- buildLabelProvider()
- );
-
- Collection<Employee> employees = new ArrayList<Employee>();
- tableModel.addSelectionChangeListener(buildSelectionChangeListener(employees));
-
- // Create Employees
- String expectedName1 = "Dali_1";
- String expectedManager1 = "WTP_1";
- String expectedTitle1 = "plug-in_1";
-
- String expectedName2 = "Dali_2";
- String expectedManager2 = "WTP_2";
- String expectedTitle2 = "plug-in_2";
-
- String expectedName3 = "Dali_3";
- String expectedManager3 = "WTP_3";
- String expectedTitle3 = "plug-in_3";
-
- Employee employee1 = new Employee(expectedName1, expectedTitle1, expectedManager1);
- Employee employee2 = new Employee(expectedName2, expectedTitle2, expectedManager2);
- Employee employee3 = new Employee(expectedName3, expectedTitle3, expectedManager3);
-
- manager.addEmployee(employee1);
- manager.addEmployee(employee2);
- manager.addEmployee(employee3);
-
- // Test adding selected items
- table.setSelection(new int[] { 0, 2 });
-
- // It seems a manual selection doesn't send any selection event
- tableModel.tableSelectionChanged(null);
-
- Assert.assertNotNull("The collection of selected items can't be null", employees);
- Assert.assertEquals("The count of selected items should be 2", 2, employees.size());
-
- employees.remove(employee1);
- employees.remove(employee3);
- Assert.assertTrue("The selected items was not retrieved correctly", employees.isEmpty());
-
- // Test adding selected items
- employees.add(employee1);
- employees.add(employee3);
- table.deselectAll();
-
- // It seems a manual selection doesn't send any selection event
- tableModel.tableSelectionChanged(null);
-
- Assert.assertNotNull("The collection of selected items can't be null", employees);
- Assert.assertEquals("The count of selected items should be 0", 0, employees.size());
- }
-
- private void testTableItemProperties(Table table,
- int index,
- String expectedName,
- String expectedManager,
- String expectedTitle)
- {
- TableItem tableItem = table.getItem(index);
- Assert.assertNotNull("No TableItem was found for the Employee", tableItem);
-
- String actualName = tableItem.getText(TableColumnAdapter.NAME_COLUMN);
- Assert.assertEquals("TableItem[NAME_COLUMN] was not set correctly", expectedName, actualName);
-
- String actualTitle = tableItem.getText(TableColumnAdapter.TITLE_COLUMN);
- Assert.assertEquals("TableItem[TITLE_COLUMN] was not set correctly", expectedTitle, actualTitle);
-
- String actualManager = tableItem.getText(TableColumnAdapter.MANAGER_COLUMN);
- Assert.assertEquals("TableItem[MANAGER_COLUMN] was not set correctly", expectedManager, actualManager);
- }
-
- private class Employee extends AbstractModel {
-
- private String manager;
- private String name;
- private String title;
-
- static final String MANAGER_PROPERTY = "manager";
- static final String NAME_PROPERTY = "name";
- static final String TITLE_PROPERTY = "title";
-
- Employee(String name, String title, String manager) {
- super();
-
- this.name = name;
- this.title = title;
- this.manager = manager;
- }
-
- String getManager() {
- return manager;
- }
-
- String getName() {
- return name;
- }
-
- String getTitle() {
- return title;
- }
-
- void setManager(String manager) {
- String oldManager = this.manager;
- this.manager = manager;
- firePropertyChanged(MANAGER_PROPERTY, oldManager, manager);
- }
-
- void setName(String name) {
- String oldName = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, oldName, name);
- }
-
- void setTitle(String title) {
- String oldTitle = this.title;
- this.title = title;
- firePropertyChanged(TITLE_PROPERTY, oldTitle, title);
- }
- }
-
- private class Manager extends AbstractModel {
-
- private List<Employee> employees;
-
- static final String EMPLOYEES_LIST = "employees";
-
- Manager() {
- super();
- employees = new ArrayList<Employee>();
- }
-
- Employee addEmployee(Employee employee) {
- addItemToList(employee, employees, EMPLOYEES_LIST);
- return employee;
- }
-
- Employee addEmployee(String name, String title, String manager) {
- Employee employee = new Employee(name, title, manager);
- return addEmployee(employee);
- }
-
- void changeEmployees(List<Employee> newEmployees) {
- this.synchronizeList(newEmployees, this.employees, EMPLOYEES_LIST);
- }
-
- ListIterator<Employee> employees() {
- return new CloneListIterator<Employee>(employees);
- }
-
- int employeesSize() {
- return employees.size();
- }
-
- void moveEmployeeDown(Employee employee) {
- int index = employees.indexOf(employee);
- moveItemInList(index + 1, index, employees, EMPLOYEES_LIST);
- }
-
- void moveEmployees(Collection<Employee> employees, int targetIndex) {
-
- int sourceIndex = Integer.MAX_VALUE;
-
- for (Employee employee : employees) {
- sourceIndex = Math.min(sourceIndex, this.employees.indexOf(employee));
- }
-
- moveItemsInList(
- targetIndex,
- sourceIndex,
- employees.size(),
- this.employees,
- EMPLOYEES_LIST
- );
- }
-
- void moveEmployeeUp(Employee employee) {
- int index = employees.indexOf(employee);
- moveItemInList(index - 1, index, employees, EMPLOYEES_LIST);
- }
-
- void removeAllEmployees() {
- clearList(employees, EMPLOYEES_LIST);
- }
-
- void removeEmployee(Employee employee) {
- removeItemFromList(employee, employees, EMPLOYEES_LIST);
- }
-
- void removeEmployees(Collection<Employee> employees) {
- removeItemsFromList(employees.iterator(), this.employees, EMPLOYEES_LIST);
- }
-
- void replace(Employee oldEmployee, Employee newEmployee) {
- replaceItemInList(oldEmployee, newEmployee, employees, EMPLOYEES_LIST);
- }
- }
-
- private class TableColumnAdapter implements ColumnAdapter<Employee> {
-
- static final int COLUMN_COUNT = 3;
- static final int MANAGER_COLUMN = 2;
- static final int NAME_COLUMN = 0;
- static final int TITLE_COLUMN = 1;
-
- private WritablePropertyValueModel<String> buildManagerHolder(Employee subject) {
- return new PropertyAspectAdapter<Employee, String>(Employee.MANAGER_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getManager();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setManager(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(Employee subject) {
- return new PropertyAspectAdapter<Employee, String>(Employee.NAME_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildTitleHolder(Employee subject) {
- return new PropertyAspectAdapter<Employee, String>(Employee.TITLE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getTitle();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setTitle(value);
- }
- };
- }
-
- public WritablePropertyValueModel<?>[] cellModels(Employee subject) {
- WritablePropertyValueModel<?>[] holders = new WritablePropertyValueModel<?>[3];
- holders[NAME_COLUMN] = buildNameHolder(subject);
- holders[TITLE_COLUMN] = buildTitleHolder(subject);
- holders[MANAGER_COLUMN] = buildManagerHolder(subject);
- return holders;
- }
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
- return String.valueOf(columnIndex);
- }
- }
-
- private class TableLabelProvider extends LabelProvider
- implements ITableLabelProvider {
-
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- Employee employee = (Employee) element;
-
- if (columnIndex == TableColumnAdapter.NAME_COLUMN) {
- return employee.getName();
- }
-
- if (columnIndex == TableColumnAdapter.TITLE_COLUMN) {
- return employee.getTitle();
- }
-
- return employee.getManager();
- }
- }
-
- private class TableModel extends TableModelAdapter<Employee> {
-
- TableModel(ListValueModel<Employee> listHolder,
- CollectionValueModel<Employee> selectedItemsHolder,
- Table table,
- ColumnAdapter<Employee> columnAdapter,
- ITableLabelProvider labelProvider) {
-
- super(listHolder,
- selectedItemsHolder,
- table,
- columnAdapter,
- labelProvider);
- }
-
- TableModel(ListValueModel<Employee> listHolder,
- WritablePropertyValueModel<Employee> selectedItemHolder,
- Table table,
- ColumnAdapter<Employee> columnAdapter,
- ITableLabelProvider labelProvider) {
-
- super(listHolder,
- new PropertyCollectionValueModelAdapter<Employee>(selectedItemHolder),
- table,
- columnAdapter,
- labelProvider);
- }
-
- @Override
- protected int indexOf(Employee item) {
- return super.indexOf(item);
- }
-
- @Override
- protected Collection<Employee> selectedItems() {
- return super.selectedItems();
- }
-
- @Override
- protected void tableSelectionChanged(SelectionEvent event) {
- super.tableSelectionChanged(event);
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
deleted file mode 100644
index 810c151526..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.swt.TriStateCheckBoxModelAdapter;
-import org.eclipse.jpt.common.ui.internal.widgets.DefaultWidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Play around with a set of tri-state check boxes.
- */
-public class TriStateCheckBoxModelAdapterUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<Boolean> flag1Holder;
- private final WritablePropertyValueModel<Boolean> flag2Holder;
- private final WritablePropertyValueModel<Boolean> notFlag2Holder;
-
- public static void main(String[] args) throws Exception {
- Window window = new TriStateCheckBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private TriStateCheckBoxModelAdapterUITest(String[] args) {
- super(null);
- this.testModel = new TestModel(Boolean.TRUE, Boolean.FALSE);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isFlag1();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isFlag2();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isNotFlag2();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value);
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control checkBoxPanel = this.buildCheckBoxPanel(mainPanel);
- this.buildControlPanel(mainPanel, checkBoxPanel);
- return mainPanel;
- }
-
- private Control buildCheckBoxPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlag1CheckBox(panel);
- this.buildFlag2CheckBox(panel);
- this.buildNotFlag2CheckBox(panel);
- this.buildUnattachedCheckBox(panel);
-
- return panel;
- }
-
- private void buildFlag1CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "flag 1", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.flag1Holder, checkBox);
- }
-
- private void buildFlag2CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "flag 2", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.flag2Holder, checkBox);
- }
-
- private void buildNotFlag2CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "next flag 2", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.notFlag2Holder, checkBox);
- }
-
- private void buildUnattachedCheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "unattached", DefaultWidgetFactory.instance());
- checkBox.addSelectionListener(this.buildUnattachedSelectionListener());
- }
-
- private SelectionListener buildUnattachedSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- System.out.println("unattached default selected: " + e);
- }
- public void widgetSelected(SelectionEvent e) {
- System.out.println("unattached selected: " + e);
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlipFlag1Button(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildFlipFlag1Button(Composite parent) {
- this.buildFlipFlag1ACI().fill(parent);
- }
-
- private ActionContributionItem buildFlipFlag1ACI() {
- Action action = new Action("next flag 1", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.nextFlag1();
- }
- };
- action.setToolTipText("next flag 1");
- return new ActionContributionItem(action);
- }
-
- void nextFlag1() {
- this.testModel.nextFlag1();
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private Boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private Boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private Boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(Boolean flag1, Boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = this.next(flag2);
- }
- private Boolean next(Boolean b) {
- return (b == null) ? Boolean.TRUE : b.booleanValue() ? Boolean.FALSE : null;
- }
- public Boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(Boolean flag1) {
- Boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public void nextFlag1() {
- this.setFlag1(this.next(this.flag1));
- }
- public Boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(Boolean flag2) {
- Boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = this.next(flag2);
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public void nextFlag2() {
- this.setFlag2(this.next(this.flag2));
- }
- public Boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(Boolean notFlag2) {
- this.setFlag2(this.next(flag2));
- }
- public void nextNotFlag2() {
- this.setNotFlag2(this.next(this.notFlag2));
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlAlignerTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlAlignerTest.java
deleted file mode 100644
index 1c2904e0e7..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlAlignerTest.java
+++ /dev/null
@@ -1,803 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.fail;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jpt.common.ui.internal.util.ControlAligner;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class ControlAlignerTest {
-
- private ControlAligner controlAligner;
- private Composite parent;
- private Shell shell;
-
- private Layout buildSpacerLayout() {
- return new Layout() {
- @Override
- protected Point computeSize(Composite composite,
- int widthHint,
- int heightHint,
- boolean flushCache) {
-
- return new Point(widthHint, heightHint);
- }
-
- @Override
- protected void layout(Composite composite, boolean flushCache) {
- GridData data = (GridData) composite.getLayoutData();
- composite.setBounds(0, 0, data.widthHint, data.heightHint);
- }
- };
- }
-
- @Before
- public void setUp() {
-
- controlAligner = new ControlAligner();
-
- shell = new Shell(Display.getCurrent());
- shell.setLayout(new GridLayout(1, false));
-
- parent = new Composite(shell, SWT.NONE);
- parent.setLayout(new GridLayout(1, false));
- parent.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- }
-
- @After
- public void tearDown() {
-
- if (controlAligner != null) {
- controlAligner.dispose();
- controlAligner = null;
- }
-
- if (shell != null) {
- shell.dispose();
- shell = null;
- }
- }
-
- @Test
- public void testAddControl1() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- updateGridData(label);
-
- controlAligner.add(label);
-
- assertEquals(
- "The maximum width should be 0,",
- 0,
- controlAligner.getMaximumWidth()
- );
-
- label.setText("This is a ControlAligner");
-// parent.layout(true, true);
-
- Point size = label.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControl2() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("This is a ControlAligner");
- updateGridData(button);
-
- controlAligner.add(button);
- parent.layout(true, true);
-
- Point size = button.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControl3() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
-// parent.layout(true, true);
-
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControlAligner1() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControlAligner2() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-
- controlAligner.add(controlAligner2);
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test(expected=IllegalArgumentException.class)
- public void testAddControlAlignerToItself() throws Exception {
- controlAligner.add(controlAligner);
- fail("A ControlAligner can't be added to itself");
- }
-
- @Test
- public void testDialog_AddControl1() throws Exception {
-
- final int[] maximumWidth = new int[1];
- final int[] size = new int[1];
-
- TitleAreaDialog dialog = new TitleAreaDialog(SWTUtil.getShell()) {
-
- private Label label;
-
- @Override
- protected Control createDialogArea(Composite parent) {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- label = new Label(pane, SWT.LEFT);
- label.setText("This is a ControlAligner");
- updateGridData(label);
-
- controlAligner.add(label);
-
- return parent;
- }
-
- @Override
- protected void initializeBounds() {
- super.initializeBounds();
- size[0] = label.getSize().x;
- maximumWidth[0] = controlAligner.getMaximumWidth();
- }
- };
-
- dialog.create();
- dialog.close();
-
- assertEquals(
- "The width should be " + size[0] + ",",
- size[0],
- maximumWidth[0]
- );
- }
-
- @Test
- public void testDialog_AddControl2() throws Exception {
-
- final int[] maximumWidth = new int[1];
- final int[] sizes = new int[2];
-
- TitleAreaDialog dialog = new TitleAreaDialog(SWTUtil.getShell()) {
-
- private Button button;
- private Label label;
-
- @Override
- protected Control createDialogArea(Composite parent) {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- label = new Label(pane, SWT.NULL);
- label.setText("This is a ControlAligner");
- updateGridData(label);
-
- controlAligner.add(label);
-
- button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
- controlAligner.add(button);
-
- return parent;
- }
-
- @Override
- protected void initializeBounds() {
- super.initializeBounds();
- sizes[0] = label.getSize().x;
- sizes[1] = button.getSize().x;
- maximumWidth[0] = controlAligner.getMaximumWidth();
- }
- };
-
- dialog.create();
- dialog.close();
-
- int labelSize = sizes[0];
- int buttonSize = sizes[1];
- int max = Math.max(labelSize, buttonSize);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- maximumWidth[0]
- );
- }
-
- @Test
- public void testDispose() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- label.dispose();
-
- Point newButtonSize = button.getSize();
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- newButtonSize.x
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- newButtonSize.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testHierarchyOfControlAligners() throws Exception {
-
- // Aligner1
- // ^
- // |-Aligner2
- // ^
- // |-Aligner3
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
-
- ControlAligner controlAligner3 = new ControlAligner();
- controlAligner2.add(controlAligner3);
-
- // Test 1
- Label label1 = new Label(parent, SWT.NULL);
- label1.setText("This is a label widget");
- parent.layout(true, true);
-
- int labelWidth1 = label1.getSize().x;
- controlAligner3.add(label1);
-
- assertEquals(controlAligner3.getMaximumWidth(), labelWidth1);
- assertEquals(controlAligner2.getMaximumWidth(), labelWidth1);
- assertEquals(controlAligner.getMaximumWidth(), labelWidth1);
-
- // Test 2
- Label label2 = new Label(parent, SWT.NULL);
- label2.setText("ShortLabel");
- controlAligner2.add(label2);
- parent.layout(true);
-
- int newLabelWidth1 = label1.getSize().x;
- int newLabelWidth2 = label2.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
-
- // Test 3
- Label label3 = new Label(parent, SWT.NULL);
- label3.setText("A very long label that takes a lot of horizontal space");
-// parent.layout(true);
- controlAligner.add(label3);
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- int newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
-
- // Make sure all the locked are removed
- assertEquals(ReflectionTools.getFieldValue_(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label2
- label2.setText("mm");
-// parent.layout(true);
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
-
- assertEquals(ReflectionTools.getFieldValue_(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label1
- label1.setText("a");
-// parent.layout(true);
-
- Composite parent1 = new Composite(SWTUtil.getShell(), SWT.NULL);
- parent1.setLayout(new GridLayout());
-
- Label tempLabel = new Label(parent1, SWT.NULL);
- tempLabel.setText("a");
-// parent1.layout(true);
-
- int realWidth = tempLabel.getSize().x;
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, controlAligner.getMaximumWidth());
- assertFalse(newLabelWidth1 == realWidth);
-
- assertEquals(ReflectionTools.getFieldValue_(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label1
- label1.setText("Yes another big long long text so that all the labels will have to take the size of this label to make sure ControlAligner works correctly");
-// parent.layout(true);
-
- // Weird: It seems no notification is sent, fire one manually
- Event event = new Event();
- event.widget = label1;
- event.type = SWT.Resize;
- label1.notifyListeners(SWT.Resize, event);
-
- Composite parent2 = new Composite(SWTUtil.getShell(), SWT.NULL);
- parent2.setLayout(new GridLayout());
-
- tempLabel = new Label(parent2, SWT.NULL);
- tempLabel.setText(label1.getText());
- parent2.layout(true);
-
- realWidth = tempLabel.getSize().x;
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(controlAligner3.getMaximumWidth(), controlAligner2.getMaximumWidth());
- assertEquals(controlAligner2.getMaximumWidth(), controlAligner.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(controlAligner.getMaximumWidth(), newLabelWidth1);
- assertEquals(realWidth, newLabelWidth1);
-
- assertEquals(ReflectionTools.getFieldValue_(controlAligner, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner2, "locked"), Boolean.FALSE);
- assertEquals(ReflectionTools.getFieldValue_(controlAligner3, "locked"), Boolean.FALSE);
- }
-
- @Test
- public void testRemoveControl1() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("This is a ControlAligner");
- updateGridData(button);
-
- controlAligner.add(button);
- parent.layout(true, true);
-
- Point size = button.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
-
- controlAligner.remove(button);
-
- assertEquals(
- "The width should be 0, ",
- 0,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControl2() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-// parent.layout(true, true);
-
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- controlAligner.remove(label);
-
- Point newButtonSize = button.getSize();
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- newButtonSize.x
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- newButtonSize.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControl4() throws Exception {
-
- Composite pane = new Composite(parent, SWT.NULL);
- pane.setLayout(new GridLayout(3, false));
- pane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Widget 1
- Label label = new Label(pane, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
- controlAligner.add(label);
-
- // Widget 2
- Composite spacer = new Composite(pane, SWT.NULL);
- spacer.setLayout(buildSpacerLayout());
- updateGridData(spacer);
- controlAligner.add(spacer);
-
- // Widget 3
- Button button = new Button(pane, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
- controlAligner.add(button);
-
-// parent.layout(true, true);
-
- // Make sure the 3 widgets have the same width
- Point labelSize = label.getSize();
- Point spacerSize = spacer.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
- max = Math.max(max, spacerSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The spacer's width should be " + max + ",",
- max,
- spacerSize.x
- );
-
- // Remove the label (the widest widget) and make sure the width was
- // correctly calculated
- controlAligner.remove(label);
-
- spacerSize = spacer.getSize();
- buttonSize = button.getSize();
- int max2 = Math.max(spacerSize.x, buttonSize.x);
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- max2
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- max2,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The spacer's width should have been adjusted",
- max2,
- spacerSize.x
- );
- }
-
- @Test
- public void testRemoveControlAligner1() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- // Test 1
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
-
- // Test 2
- controlAligner.remove(label1);
-
- width = label2.getSize().x;
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControlAligner2() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- controlAligner.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-// parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- // Test 1
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
-
- // Test 2
- controlAligner2.remove(label2);
-
- width = label1.getSize().x;
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- private void updateGridData(Control control) {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = false;
- control.setLayoutData(data);
- }
-} \ No newline at end of file
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlEnablerTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlEnablerTest.java
deleted file mode 100644
index d6406a1bb9..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlEnablerTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class ControlEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- Combo combo = new Combo(parent, SWT.BORDER);
-
- SWTTools.controlEnabledState(booleanHolder, combo);
-
- assertTrue(
- "The Combo should be enabled",
- combo.isEnabled()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The Combo should not be enabled",
- combo.isEnabled()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The Combo should be enabled",
- combo.isEnabled()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The Combo should not be enabled",
- combo.isEnabled()
- );
-
- // Dispose
- combo.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
deleted file mode 100644
index 49111bdef5..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlSwitcherTest.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.part.PageBook;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class ControlSwitcherTest {
-
- private PageBook pageBook;
- private Composite pane1;
- private Composite pane2;
- private Composite parent;
-
- private Composite buildPane1() {
-
- if (pane1 == null) {
-
- pane1 = new Composite(pageBook, SWT.NULL);
- pane1.setLayout(new GridLayout(2, false));
-
- Label label = new Label(pane1, SWT.NULL);
- label.setText("&Test2:");
-
- Text text = new Text(pane1, SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Combo combo = new Combo(pane1, SWT.BORDER);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- combo.setLayoutData(data);
- }
-
- return pane1;
- }
-
- private Composite buildPane2() {
-
- if (pane2 == null) {
-
- pane2 = new Composite(pageBook, SWT.NULL);
- pane2.setLayout(new GridLayout(2, false));
-
- Label label = new Label(pane2, SWT.NULL);
- label.setText("&Test1:");
-
- Text text = new Text(pane2, SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
-
- return pane2;
- }
-
- private Transformer<Boolean, Control> buildTransformer() {
- return new Transformer<Boolean, Control>() {
- public Control transform(Boolean value) {
- return (value == null) ? null : (value ? pane1 : pane2);
- }
- };
- }
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
-
- pageBook = new PageBook(parent, SWT.NULL);
- pageBook.setLayoutData(new GridData());
- }
-
- @After
- public void tearDown() {
-
- if (parent != null) {
-
- parent.dispose();
-
- parent = null;
- pageBook = null;
- }
- }
-
- @Test
- public void testSwitch() {
-
- SimplePropertyValueModel<Boolean> switchHolder = new SimplePropertyValueModel<Boolean>();
- Transformer<Boolean, Control> transformer = buildTransformer();
-
- pane1 = buildPane1();
- pane1.setVisible(false);
-
- pane2 = buildPane2();
- pane2.setVisible(false);
-
- new ControlSwitcher(
- switchHolder,
- transformer,
- pageBook
- );
-
- // Test 1
- switchHolder.setValue(true);
- Control control = (Control) ReflectionTools.getFieldValue(pageBook, "currentPage");
-
- assertNotNull(
- "The page book's page shouldn't be null",
- control
- );
-
- assertSame(
- "The current pane should be pane1",
- pane1,
- control
- );
-
- Point pane1Size = pane1.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point pageBookSize = pageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- assertEquals(
- "The width of the PageBook should be the same as the width of pane1",
- pane1Size.x,
- pageBookSize.x
- );
-
- assertEquals(
- "The height of the PageBook should be the same as the height of pane1",
- pane1Size.y,
- pageBookSize.y
- );
-
- // Test 2
- switchHolder.setValue(false);
- control = (Control) ReflectionTools.getFieldValue(pageBook, "currentPage");
-
- assertNotNull(
- "The page book's page shouldn't be null",
- control
- );
-
- assertSame(
- "The current pane should be pane2",
- pane2,
- control
- );
-
- Point pane2Size = pane2.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- pageBookSize = pageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- assertEquals(
- "The width of the PageBook should be the same as the width of pane2",
- pane2Size.x,
- pageBookSize.x
- );
-
- assertEquals(
- "The height of the PageBook should be the same as the height of pane2",
- pane2Size.y,
- pageBookSize.y
- );
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlVisibilityEnablerTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlVisibilityEnablerTest.java
deleted file mode 100644
index f978ed1618..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/ControlVisibilityEnablerTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class ControlVisibilityEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- Combo combo = new Combo(parent, SWT.BORDER);
-
- SWTTools.controlVisibleState(booleanHolder, combo);
-
- assertTrue(
- "The Combo should be visible",
- combo.isVisible()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The Combo should not be visible",
- combo.isVisible()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The Combo should be visible",
- combo.isVisible()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The Combo should not be visible",
- combo.isVisible()
- );
-
- // Dispose
- combo.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/JptUiUtilTests.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/JptUiUtilTests.java
deleted file mode 100644
index 38f00d21d0..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/JptUiUtilTests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@SuiteClasses
-({
- ControlAlignerTest.class,
- ControlSwitcherTest.class,
- ControlEnablerTest.class,
- ControlVisibilityEnablerTest.class,
- LabeledButtonTest.class,
- LabeledLabelTest.class,
- LabeledControlUpdaterTest.class,
- PaneEnablerTest.class,
- PaneVisibilityEnablerTest.class,
-})
-@RunWith(Suite.class)
-public final class JptUiUtilTests {
-
- private JptUiUtilTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(new JUnit4TestAdapter(JptUiUtilTests.class));
- return suite;
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledButtonTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledButtonTest.java
deleted file mode 100644
index 52515acb41..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledButtonTest.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.common.ui.internal.util.LabeledButton;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class LabeledButtonTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testLabeledButton1() {
- Button button = new Button(parent, SWT.NULL);
- new LabeledButton(button);
- }
-
- @Test(expected=AssertionFailedException.class)
- public void testLabeledButton2() {
- new LabeledButton(null);
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- labeledButton.setImage(expected);
-
- assertEquals(
- "The Button didn't receive the Image",
- expected,
- button.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- button.dispose();
-
- // This should not fail but simply do nothing
- labeledButton.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- String expected = "This is a test";
- labeledButton.setText(expected);
-
- assertEquals(
- "The Button didn't receive the text",
- expected,
- button.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- button.dispose();
-
- // This should not fail but simply do nothing
- String expected = "This is a test";
- labeledButton.setText(expected);
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledControlUpdaterTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledControlUpdaterTest.java
deleted file mode 100644
index 2238dc972f..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledControlUpdaterTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import org.eclipse.jpt.common.ui.internal.util.LabeledControlUpdater;
-import org.eclipse.jpt.common.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class LabeledControlUpdaterTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<Image> imageHolder = new SimplePropertyValueModel<Image>();
- new LabeledControlUpdater(labeledLabel, null, imageHolder);
-
- labeledLabel.setImage(expected);
-
- assertEquals(
- "The Label didn't receive the Image",
- expected,
- label.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<Image> imageHolder = new SimplePropertyValueModel<Image>();
- new LabeledControlUpdater(labeledLabel, null, imageHolder);
-
- label.dispose();
- labeledLabel.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
-
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<String> textHolder = new SimplePropertyValueModel<String>();
- new LabeledControlUpdater(labeledLabel, textHolder);
-
- String expected = "This is a test";
- textHolder.setValue(expected);
-
- assertEquals(
- "The Label didn't receive the text",
- expected,
- label.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
-
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<String> textHolder = new SimplePropertyValueModel<String>();
- new LabeledControlUpdater(labeledLabel, textHolder);
-
- label.dispose();
-
- String expected = "This is a test";
- textHolder.setValue(expected);
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledLabelTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledLabelTest.java
deleted file mode 100644
index d43bcee4fb..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/LabeledLabelTest.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.common.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class LabeledLabelTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testLabeledButton1() {
- Label label = new Label(parent, SWT.NULL);
- new LabeledLabel(label);
- }
-
- @Test(expected=AssertionFailedException.class)
- public void testLabeledButton2() {
- new LabeledLabel(null);
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- labeledLabel.setImage(expected);
-
- assertEquals(
- "The Label didn't receive the Image",
- expected,
- label.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- label.dispose();
-
- // This should not fail but simply do nothing
- labeledLabel.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- String expected = "This is a test";
- labeledLabel.setText(expected);
-
- assertEquals(
- "The Label didn't receive the text",
- expected,
- label.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- label.dispose();
-
- // This should not fail but simply do nothing
- String expected = "This is a test";
- labeledLabel.setText(expected);
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneEnablerTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneEnablerTest.java
deleted file mode 100644
index b68fd99686..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneEnablerTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class PaneEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- DialogPane<Node> pane = new DialogPane<Node>(
- new SimplePropertyValueModel<Node>(),
- parent)
- {
- @Override
- protected void initializeLayout(Composite container) {
- }
- };
-
- new PaneEnabler(booleanHolder, pane);
-
- assertTrue(
- "The pane should be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The pane should not be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The pane should be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The pane should not be enabled",
- pane.getControl().isEnabled()
- );
-
- // Dispose
- pane.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java
deleted file mode 100644
index e0ac3ce2ad..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import org.eclipse.jpt.common.ui.internal.util.PaneVisibilityEnabler;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("nls")
-public final class PaneVisibilityEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- DialogPane<Node> pane = new DialogPane<Node>(
- new SimplePropertyValueModel<Node>(),
- parent)
- {
- @Override
- protected void initializeLayout(Composite container) {
- }
- };
-
- new PaneVisibilityEnabler(booleanHolder, pane);
-
- assertTrue(
- "The pane should be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The pane should not be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The pane should be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The pane should not be visible",
- pane.getControl().isVisible()
- );
-
- // Dispose
- pane.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/BooleanStateControllerUITest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/BooleanStateControllerUITest.java
deleted file mode 100644
index f1568bd867..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/BooleanStateControllerUITest.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.utility.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Play around with boolean state controllers ('enabled' and 'visible').
- * <p>
- * Note the behavior of composites:<ul>
- * <li>When a composite is disabled, its children are disabled but <em>not</em>
- * grayed out.
- * <li>When a composite is made invisible, its children are also made
- * invisible.
- * </ul>
- */
-@SuppressWarnings("nls")
-public class BooleanStateControllerUITest
- extends ApplicationWindow
-{
- private final WritablePropertyValueModel<Boolean> enabledHolder;
- private final WritablePropertyValueModel<Boolean> visibleHolder;
- private final SimpleListValueModel<String> listHolder;
- private final WritablePropertyValueModel<String> listSelectionHolder;
-
- public static void main(String[] args) throws Exception {
- Window window = new BooleanStateControllerUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private BooleanStateControllerUITest(@SuppressWarnings("unused") String[] args) {
- super(null);
- this.enabledHolder = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.visibleHolder = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.listHolder = this.buildListHolder();
- this.listSelectionHolder = new SimplePropertyValueModel<String>(null);
- }
-
- private SimpleListValueModel<String> buildListHolder() {
- SimpleListValueModel<String> result = new SimpleListValueModel<String>();
- result.add("zero");
- result.add("one");
- result.add("two");
- result.add("three");
- result.add("four");
- result.add("five");
- result.add("six");
- result.add("seven");
- return result;
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(500, 150);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control widgetPanel = this.buildWidgetPanels(mainPanel);
- this.buildControlPanel(mainPanel, widgetPanel);
- return mainPanel;
- }
-
- private Control buildWidgetPanels(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout(SWT.VERTICAL));
-
- this.buildWidgetPanel1(panel);
- this.buildWidgetPanel2(panel);
-
- return panel;
- }
-
- private void buildWidgetPanel1(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayout(new FillLayout(SWT.HORIZONTAL));
-
- Button enabledComboBoxCheckBox = this.buildEnabledComboBoxCheckBox(panel);
- SWTTools.bind(this.enabledHolder, enabledComboBoxCheckBox);
-
- Button visibleComboBoxCheckBox = this.buildVisibleComboBoxCheckBox(panel);
- SWTTools.bind(this.visibleHolder, visibleComboBoxCheckBox);
-
- Label comboBoxLabel = this.buildComboBoxLabel(panel);
- Combo comboBox = this.buildComboBox(panel);
- SWTTools.bind(this.listHolder, this.listSelectionHolder, comboBox);
- SWTTools.controlEnabledState(this.enabledHolder, comboBoxLabel, comboBox);
- SWTTools.controlVisibleState(this.visibleHolder, comboBoxLabel, comboBox);
- }
-
- private Button buildEnabledComboBoxCheckBox(Composite parent) {
- return this.buildCheckBox(parent, "enabled");
- }
-
- private Button buildVisibleComboBoxCheckBox(Composite parent) {
- return this.buildCheckBox(parent, "visible");
- }
-
- private Button buildCheckBox(Composite parent, String text) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText(text);
- return checkBox;
- }
-
- private Label buildComboBoxLabel(Composite parent) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText("list:");
- return label;
- }
-
- private Combo buildComboBox(Composite parent) {
- return new Combo(parent, SWT.READ_ONLY);
- }
-
- private void buildWidgetPanel2(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayout(new FillLayout(SWT.HORIZONTAL));
-
- Button checkBox1 = this.buildCheckBox(panel, "one");
- this.buildCheckBox(panel, "two");
- this.buildCheckBox(panel, "three");
- this.buildCheckBox(panel, "four");
-
- SWTTools.controlEnabledState(this.enabledHolder, panel, checkBox1);
- SWTTools.controlVisibleState(this.visibleHolder, panel);
- }
-
- private void buildControlPanel(Composite parent, Control widgetPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(widgetPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildClearEnabledModelButton(panel);
- this.buildClearVisibleModelButton(panel);
- this.buildNullSelectionModelButton(panel);
- this.buildNextButton(panel);
- }
-
- private void buildClearEnabledModelButton(Composite parent) {
- this.buildClearEnabledModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearEnabledModelACI() {
- Action action = new Action("clear enabled model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- BooleanStateControllerUITest.this.clearEnabledModel();
- }
- };
- action.setToolTipText("clear enabled model");
- return new ActionContributionItem(action);
- }
-
- void clearEnabledModel() {
- this.enabledHolder.setValue(null);
- }
-
- private void buildClearVisibleModelButton(Composite parent) {
- this.buildClearVisibleModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearVisibleModelACI() {
- Action action = new Action("clear visible model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- BooleanStateControllerUITest.this.clearVisibleModel();
- }
- };
- action.setToolTipText("clear visible model");
- return new ActionContributionItem(action);
- }
-
- void clearVisibleModel() {
- this.visibleHolder.setValue(null);
- }
-
- private void buildNullSelectionModelButton(Composite parent) {
- this.buildNullSelectionModelACI().fill(parent);
- }
-
- private ActionContributionItem buildNullSelectionModelACI() {
- Action action = new Action("null selection model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- BooleanStateControllerUITest.this.setSelectionModelNull();
- }
- };
- action.setToolTipText("null selection model");
- return new ActionContributionItem(action);
- }
-
- void setSelectionModelNull() {
- this.listSelectionHolder.setValue(null);
- }
-
- private void buildNextButton(Composite parent) {
- this.buildNextACI().fill(parent);
- }
-
- private ActionContributionItem buildNextACI() {
- Action action = new Action("next", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- BooleanStateControllerUITest.this.next();
- }
- };
- action.setToolTipText("next");
- return new ActionContributionItem(action);
- }
-
- void next() {
- this.listSelectionHolder.setValue(this.getNextListSelection());
- }
-
- private String getNextListSelection() {
- return this.listHolder.get(this.getNextListSelectionIndex());
- }
-
- private int getNextListSelectionIndex() {
- int index = this.getListSelectionIndex();
- if (index == -1) {
- return 0;
- }
- index++;
- return (index == this.listHolder.size()) ? 0 : index;
- }
-
- private int getListSelectionIndex() {
- return this.listHolder.indexOf(this.getListSelection());
- }
-
- private String getListSelection() {
- return this.listSelectionHolder.getValue();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/CheckBoxModelBindingUITest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/CheckBoxModelBindingUITest.java
deleted file mode 100644
index 6d211010a9..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/CheckBoxModelBindingUITest.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.utility.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Play around with a set of check boxes.
- */
-@SuppressWarnings("nls")
-public class CheckBoxModelBindingUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<Boolean> flag1Holder;
- private final WritablePropertyValueModel<Boolean> flag2Holder;
- private final WritablePropertyValueModel<Boolean> notFlag2Holder;
-
- public static void main(String[] args) throws Exception {
- Window window = new CheckBoxModelBindingUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private CheckBoxModelBindingUITest(@SuppressWarnings("unused") String[] args) {
- super(null);
- this.testModel = new TestModel(true, true);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag1());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNotFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value.booleanValue());
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control checkBoxPanel = this.buildCheckBoxPanel(mainPanel);
- this.buildControlPanel(mainPanel, checkBoxPanel);
- return mainPanel;
- }
-
- private Control buildCheckBoxPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlag1CheckBox(panel);
- this.buildFlag2CheckBox(panel);
- this.buildNotFlag2CheckBox(panel);
- this.buildUnattachedCheckBox(panel);
-
- return panel;
- }
-
- private void buildFlag1CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("flag 1");
- SWTTools.bind(this.flag1Holder, checkBox);
- }
-
- private void buildFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("flag 2");
- SWTTools.bind(this.flag2Holder, checkBox);
- }
-
- private void buildNotFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("not flag 2");
- SWTTools.bind(this.notFlag2Holder, checkBox);
- }
-
- private void buildUnattachedCheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("unattached");
- checkBox.addSelectionListener(this.buildUnattachedSelectionListener());
- }
-
- private SelectionListener buildUnattachedSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- System.out.println("unattached default selected: " + e);
- }
- public void widgetSelected(SelectionEvent e) {
- System.out.println("unattached selected: " + e);
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlipFlag1Button(panel);
- this.buildNotFlag2ToggleButton(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildFlipFlag1Button(Composite parent) {
- this.buildFlipFlag1ACI().fill(parent);
- }
-
- private ActionContributionItem buildFlipFlag1ACI() {
- Action action = new Action("flip flag 1", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelBindingUITest.this.flipFlag1();
- }
- };
- action.setToolTipText("flip flag 1");
- return new ActionContributionItem(action);
- }
-
- void flipFlag1() {
- this.testModel.setFlag1( ! this.testModel.isFlag1());
- }
-
- private void buildNotFlag2ToggleButton(Composite parent) {
- Button checkBox = new Button(parent, SWT.TOGGLE);
- checkBox.setText("not flag 2");
- SWTTools.bind(this.notFlag2Holder, checkBox);
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelBindingUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelBindingUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelBindingUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- public static class TestModel extends AbstractModel {
- private boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(boolean flag1, boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = ! flag2;
- }
- public boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(boolean flag1) {
- boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(boolean flag2) {
- boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = ! flag2;
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(boolean notFlag2) {
- this.setFlag2( ! notFlag2);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java
deleted file mode 100644
index dad37d9521..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.utility.swt;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Play around with a set of read-only combo-boxes.
- */
-@SuppressWarnings("nls")
-public class DropDownListBoxModelBindingUITest
- extends ApplicationWindow
-{
- final TaskList taskList;
- private final WritablePropertyValueModel<TaskList> taskListHolder;
- private Text taskTextField;
-
- public static void main(String[] args) throws Exception {
- Window window = new DropDownListBoxModelBindingUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private DropDownListBoxModelBindingUITest(@SuppressWarnings("unused") String[] args) {
- super(null);
- this.taskList = new TaskList();
- this.taskListHolder = new SimplePropertyValueModel<TaskList>(this.taskList);
- this.taskList.addTask("swim");
- this.taskList.addTask("bike");
- this.taskList.addTask("run");
- Task rest = this.taskList.addTask("rest");
- this.taskList.addTask("repeat");
- this.taskList.setPriorityTask(rest);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(800, 300);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control taskListPanel = this.buildTaskListPanel(mainPanel);
- this.buildControlPanel(mainPanel, taskListPanel);
- return mainPanel;
- }
-
- private Control buildTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -30);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- this.buildTaskListPanel_(panel); // false = native (Combo)
-
- return panel;
- }
-
- private Control buildTaskListPanel_(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(50);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- this.buildPrimitiveTaskListPanel(panel);
- this.buildObjectTaskListPanel(panel);
-
- return panel;
- }
-
- private void buildPrimitiveTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(50);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedPrimitiveListPanel(panel);
- this.buildStandardSortedPrimitiveListPanel(panel);
- this.buildCustomSortedPrimitiveListPanel(panel);
- }
-
- private void buildObjectTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(50);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedObjectListPanel(panel);
- this.buildStandardSortedObjectListPanel(panel);
- this.buildCustomSortedObjectListPanel(panel);
- }
-
- private void buildUnsortedPrimitiveListPanel(Composite parent) {
- String label = "primitive unsorted";
- this.buildComboBoxPanel(parent, label, this.buildUnsortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter());
- }
-
- private void buildStandardSortedPrimitiveListPanel(Composite parent) {
- String label = "primitive sorted";
- this.buildComboBoxPanel(parent, label, this.buildStandardSortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter());
- }
-
- private void buildCustomSortedPrimitiveListPanel(Composite parent) {
- String label = "primitive reverse sorted";
- this.buildComboBoxPanel(parent, label, this.buildCustomSortedPrimitiveListModel(), this.buildPriorityTaskNameAdapter());
- }
-
- private void buildUnsortedObjectListPanel(Composite parent) {
- String label = "object unsorted";
- this.buildComboBoxPanel(parent, label, this.buildUnsortedObjectListModel(), this.buildPriorityTaskAdapter());
- }
-
- private void buildStandardSortedObjectListPanel(Composite parent) {
- String label = "object sorted";
- this.buildComboBoxPanel(parent, label, this.buildStandardSortedObjectListModel(), this.buildPriorityTaskAdapter());
- }
-
- private void buildCustomSortedObjectListPanel(Composite parent) {
- String label = "object reverse sorted";
- this.buildComboBoxPanel(parent, label, this.buildCustomSortedObjectListModel(), this.buildPriorityTaskAdapter());
- }
-
- private ListValueModel<String> buildUnsortedPrimitiveListModel() {
- return this.buildPrimitiveTaskListAdapter();
- }
-
- private ListValueModel<String> buildStandardSortedPrimitiveListModel() {
- return new SortedListValueModelWrapper<String>(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListValueModel<String> buildCustomSortedPrimitiveListModel() {
- return new SortedListValueModelWrapper<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator());
- }
-
- private ListValueModel<Task> buildUnsortedObjectListModel() {
- return this.buildObjectTaskListAdapter();
- }
-
- private ListValueModel<Task> buildStandardSortedObjectListModel() {
- return new SortedListValueModelWrapper<Task>(this.buildObjectTaskListAdapter());
- }
-
- private ListValueModel<Task> buildCustomSortedObjectListModel() {
- return new SortedListValueModelWrapper<Task>(this.buildObjectTaskListAdapter(), this.buildCustomTaskComparator());
- }
-
- private <E> void buildComboBoxPanel(Composite parent, String label, ListValueModel<E> model, WritablePropertyValueModel<E> selectedItemModel) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayout(new FormLayout());
-
- Label comboBoxLabel = new Label(panel, SWT.LEFT | SWT.VERTICAL);
- comboBoxLabel.setText(label);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0, 3);
- fd.bottom = new FormAttachment(0, 20);
- fd.left = new FormAttachment(0, 5);
- fd.right = new FormAttachment(100);
- comboBoxLabel.setLayoutData(fd);
-
- Combo comboBox = this.buildComboBox(panel);
- fd = new FormData();
- fd.top = new FormAttachment(comboBoxLabel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- comboBox.setLayoutData(fd);
- SWTTools.bind(model, selectedItemModel, comboBox); // use #toString()
- }
-
- private Combo buildComboBox(Composite parent) {
- return new Combo(parent, SWT.READ_ONLY);
- }
-
- private Comparator<String> buildCustomStringComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private Comparator<Task> buildCustomTaskComparator() {
- return new Comparator<Task>() {
- public int compare(Task to1, Task to2) {
- return to2.compareTo(to1);
- }
- };
- }
-
- private ListValueModel<String> buildPrimitiveTaskListAdapter() {
- return new ListAspectAdapter<TaskList, String>(this.taskListHolder, TaskList.TASK_NAMES_LIST) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.taskNames();
- }
- };
- }
-
- private ListValueModel<Task> buildObjectTaskListAdapter() {
- return new ListAspectAdapter<TaskList, Task>(this.taskListHolder, TaskList.TASKS_LIST) {
- @Override
- protected ListIterator<Task> listIterator_() {
- return this.subject.tasks();
- }
- };
- }
-
- private WritablePropertyValueModel<Task> buildPriorityTaskAdapter() {
- return new PriorityTaskAdapter(this.taskListHolder);
- }
-
- static class PriorityTaskAdapter
- extends PropertyAspectAdapter<TaskList, Task>
- {
- PriorityTaskAdapter(WritablePropertyValueModel<TaskList> taskListHolder) {
- super(taskListHolder, TaskList.PRIORITY_TASK_PROPERTY);
- }
- @Override
- protected Task buildValue_() {
- return this.subject.getPriorityTask();
- }
- @Override
- protected void setValue_(Task value) {
- this.subject.setPriorityTask(value);
- }
- }
-
- private WritablePropertyValueModel<String> buildPriorityTaskNameAdapter() {
- return new PriorityTaskNameAdapter(this.taskListHolder);
- }
-
- static class PriorityTaskNameAdapter
- extends PropertyAspectAdapter<TaskList, String>
- {
- PriorityTaskNameAdapter(WritablePropertyValueModel<TaskList> taskListHolder) {
- super(taskListHolder, TaskList.PRIORITY_TASK_NAME_PROPERTY);
- }
- @Override
- protected String buildValue_() {
- return this.subject.getPriorityTaskName();
- }
- @Override
- protected void setValue_(String value) {
- // ignore
- }
- }
-
- private void buildControlPanel(Composite parent, Control taskListPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(taskListPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control misc = this.buildMiscTaskPanel(panel);
- this.buildAddRemoveTaskPanel(panel, misc);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildMiscTaskPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -400);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildClearListACI().fill(panel);
- this.buildClearModelACI().fill(panel);
- this.buildRestoreModelACI().fill(panel);
- this.buildChangePriorityTaskACI().fill(panel);
- this.buildClearPriorityTaskACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildClearListACI() {
- Action action = new Action("clear list", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- DropDownListBoxModelBindingUITest.this.clearTasks();
- }
- };
- action.setToolTipText("clear all the tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- DropDownListBoxModelBindingUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- DropDownListBoxModelBindingUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildChangePriorityTaskACI() {
- Action action = new Action("change priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- DropDownListBoxModelBindingUITest.this.changePriorityTask();
- }
- };
- action.setToolTipText("change the priority task");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearPriorityTaskACI() {
- Action action = new Action("clear priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- DropDownListBoxModelBindingUITest.this.clearPriorityTask();
- }
- };
- action.setToolTipText("clear the priority task");
- return new ActionContributionItem(action);
- }
-
- private void buildAddRemoveTaskPanel(Composite parent, Control clearButton) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(clearButton);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control addButton = this.buildAddButton(panel);
- Control removeButton = this.buildRemoveButton(panel);
- this.buildTaskTextField(panel, addButton, removeButton);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildAddButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(0, 50);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildAddACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildAddACI() {
- Action action = new Action("add", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- DropDownListBoxModelBindingUITest.this.addTask();
- }
- };
- action.setToolTipText("add a task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildRemoveButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -50);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildRemoveACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildRemoveACI() {
- Action action = new Action("remove", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- DropDownListBoxModelBindingUITest.this.removeTask();
- }
- };
- action.setToolTipText("remove the task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- private void buildTaskTextField(Composite parent, Control addButton, Control removeButton) {
- this.taskTextField = new Text(parent, SWT.SINGLE | SWT.BORDER);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(addButton);
- fd.right = new FormAttachment(removeButton);
- this.taskTextField.setLayoutData(fd);
- }
-
- private String taskTextFieldText() {
- return this.taskTextField.getText();
- }
-
- void addTask() {
- String taskText = this.taskTextFieldText();
- if (taskText.length() != 0) {
- this.taskList.addTask(taskText);
- }
- }
-
- void removeTask() {
- String task = this.taskTextFieldText();
- if (task.length() != 0) {
- this.taskList.removeTask(task);
- }
- }
-
- void clearTasks() {
- this.taskList.clearTasks();
- }
-
- void clearModel() {
- this.taskListHolder.setValue(null);
- }
-
- void restoreModel() {
- this.taskListHolder.setValue(this.taskList);
- }
-
- void changePriorityTask() {
- boolean found = false;
- for (Task task : this.taskList.getTasks()) {
- if (this.taskList.getPriorityTask() == task) {
- found = true;
- } else {
- if (found) {
- this.taskList.setPriorityTask(task);
- return;
- }
- }
- }
- Iterator<Task> tasks = this.taskList.tasks();
- if (tasks.hasNext()) {
- this.taskList.setPriorityTask(tasks.next());
- }
- }
-
- void clearPriorityTask() {
- this.taskList.setPriorityTask(null);
- }
-
-
- // ********** TaskList **********
-
- // note absence of validation...
- public static class TaskList extends AbstractModel {
- private final List<String> taskNames = new ArrayList<String>();
- public static final String TASK_NAMES_LIST = "taskNames";
- private final List<Task> tasks = new ArrayList<Task>();
- public static final String TASKS_LIST = "tasks";
- private String priorityTaskName = null;
- public static final String PRIORITY_TASK_NAME_PROPERTY = "priorityTaskName";
- private Task priorityTask = null;
- public static final String PRIORITY_TASK_PROPERTY = "priorityTask";
- public TaskList() {
- super();
- }
- public ListIterator<String> taskNames() {
- return this.taskNames.listIterator();
- }
- public Iterable<Task> getTasks() {
- return this.tasks;
- }
- public ListIterator<Task> tasks() {
- return this.tasks.listIterator();
- }
- public String getPriorityTaskName() {
- return this.priorityTaskName;
- }
- public Task getPriorityTask() {
- return this.priorityTask;
- }
- public Task addTask(String taskName) {
- this.addItemToList(taskName, this.taskNames, TASK_NAMES_LIST);
- Task task = new Task(taskName);
- this.addItemToList(task, this.tasks, TASKS_LIST);
- return task;
- }
- public void removeTask(String taskName) {
- int index = this.taskNames.indexOf(taskName);
- if (index != -1) {
- Task task = this.tasks.get(index);
- if (task == this.priorityTask) {
- this.setPriorityTask(null);
- }
- // assume the indexes match...
- this.removeItemFromList(index, this.taskNames, TASK_NAMES_LIST);
- this.removeItemFromList(index, this.tasks, TASKS_LIST);
- }
- }
- public void clearTasks() {
- this.setPriorityTask(null);
- this.clearList(this.taskNames, TASK_NAMES_LIST);
- this.clearList(this.tasks, TASKS_LIST);
- }
- private void setPriorityTaskName(String priorityTaskName) {
- String old = this.priorityTaskName;
- this.priorityTaskName = priorityTaskName;
- this.firePropertyChanged(PRIORITY_TASK_NAME_PROPERTY, old, priorityTaskName);
- }
- public void setPriorityTask(Task priorityTask) {
- Task old = this.priorityTask;
- this.priorityTask = priorityTask;
- this.firePropertyChanged(PRIORITY_TASK_PROPERTY, old, priorityTask);
- this.setPriorityTaskName((priorityTask == null) ? null : priorityTask.getName());
- }
- }
-
-
- // ********** Task **********
-
- public static class Task extends AbstractModel implements Displayable {
- private String name;
- private int instanceCount;
- private static int INSTANCE_COUNT = 1;
- public Task(String name) {
- this.name = name;
- this.instanceCount = INSTANCE_COUNT++;
- }
- public String displayString() {
- return this.name + ": " + this.instanceCount;
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return this.displayString();
- }
- }
-
- public interface Displayable extends Model, Comparable<Displayable> {
-
- String displayString();
- String DISPLAY_STRING_PROPERTY = "displayString";
-
-
- // ********** helper implementations **********
-
- Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- Comparator<Displayable> DEFAULT_COMPARATOR =
- new Comparator<Displayable>() {
- public int compare(Displayable d1, Displayable d2) {
- // disallow duplicates based on object identity
- if (d1 == d2) {
- return 0;
- }
-
- // first compare display strings using the default collator
- int result = DEFAULT_COLLATOR.compare(d1.displayString(), d2.displayString());
- if (result != 0) {
- return result;
- }
-
- // then compare using object-id
- result = System.identityHashCode(d1) - System.identityHashCode(d2);
- if (result != 0) {
- return result;
- }
-
- // It's unlikely that we get to this point; but, just in case, we will return -1.
- // Unfortunately, this introduces some mild unpredictability to the sort order
- // (unless the objects are always passed into this method in the same order).
- return -1; // if all else fails, indicate that o1 < o2
- }
- @Override
- public String toString() {
- return "Displayable.DEFAULT_COMPARATOR";
- }
- };
-
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java
deleted file mode 100644
index 1cb0d57c62..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.utility.swt;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Play around with a set of list boxes.
- */
-@SuppressWarnings("nls")
-public class ListBoxModelBindingUITest
- extends ApplicationWindow
-{
- final TaskList taskList;
- private final WritablePropertyValueModel<TaskList> taskListHolder;
- private Text taskTextField;
-
- public static void main(String[] args) throws Exception {
- Window window = new ListBoxModelBindingUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private ListBoxModelBindingUITest(@SuppressWarnings("unused") String[] args) {
- super(null);
- this.taskList = new TaskList();
- this.taskListHolder = new SimplePropertyValueModel<TaskList>(this.taskList);
- this.taskList.addTask("swim");
- this.taskList.addTask("bike");
- this.taskList.addTask("run");
- Task rest = this.taskList.addTask("rest");
- this.taskList.addPriorityTask(rest);
- Task repeat = this.taskList.addTask("repeat");
- this.taskList.addPriorityTask(repeat);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(800, 400);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control taskListPanel = this.buildTaskListPanel(mainPanel);
- this.buildControlPanel(mainPanel, taskListPanel);
- return mainPanel;
- }
-
- private Control buildTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -30);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- this.buildPrimitiveTaskListPanel(panel);
- this.buildObjectTaskListPanel(panel);
-
- return panel;
- }
-
- private void buildPrimitiveTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(50);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedPrimitiveListPanel(panel);
- this.buildStandardSortedPrimitiveListPanel(panel);
- this.buildCustomSortedPrimitiveListPanel(panel);
- }
-
- private void buildObjectTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(50);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedObjectListPanel(panel);
- this.buildStandardSortedObjectListPanel(panel);
- this.buildCustomSortedObjectListPanel(panel);
- }
-
- private void buildUnsortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive unsorted", this.buildUnsortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildStandardSortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive sorted", this.buildStandardSortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildCustomSortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive reverse sorted", this.buildCustomSortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildUnsortedObjectListPanel(Composite parent) {
- this.buildListPanel(parent, "object unsorted", this.buildUnsortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildStandardSortedObjectListPanel(Composite parent) {
- this.buildListPanel(parent, "object sorted", this.buildStandardSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildCustomSortedObjectListPanel(Composite parent) {
- this.buildListPanel(parent, "object reverse sorted", this.buildCustomSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private ListValueModel<String> buildUnsortedPrimitiveListModel() {
- return this.buildPrimitiveTaskListAdapter();
- }
-
- private ListValueModel<String> buildStandardSortedPrimitiveListModel() {
- return new SortedListValueModelWrapper<String>(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListValueModel<String> buildCustomSortedPrimitiveListModel() {
- return new SortedListValueModelWrapper<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator());
- }
-
- private ListValueModel<Task> buildUnsortedObjectListModel() {
- return this.buildObjectTaskListAdapter();
- }
-
- private ListValueModel<Task> buildStandardSortedObjectListModel() {
- return new SortedListValueModelWrapper<Task>(this.buildObjectTaskListAdapter());
- }
-
- private ListValueModel<Task> buildCustomSortedObjectListModel() {
- return new SortedListValueModelWrapper<Task>(this.buildObjectTaskListAdapter(), this.buildCustomTaskComparator());
- }
-
- private <E> org.eclipse.swt.widgets.List buildListPanel(Composite parent, String label, ListValueModel<E> model, WritableCollectionValueModel<E> selectedItemsModel) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayout(new FormLayout());
-
- Label listLabel = new Label(panel, SWT.LEFT | SWT.VERTICAL);
- listLabel.setText(label);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0, 3);
- fd.bottom = new FormAttachment(0, 20);
- fd.left = new FormAttachment(0, 5);
- fd.right = new FormAttachment(100);
- listLabel.setLayoutData(fd);
-
- org.eclipse.swt.widgets.List listBox = new org.eclipse.swt.widgets.List(panel, SWT.MULTI | SWT.BORDER);
- fd = new FormData();
- fd.top = new FormAttachment(listLabel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- listBox.setLayoutData(fd);
- SWTTools.bind(model, selectedItemsModel, listBox); // use #toString()
- return listBox;
- }
-
- private Comparator<String> buildCustomStringComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private Comparator<Task> buildCustomTaskComparator() {
- return new Comparator<Task>() {
- public int compare(Task to1, Task to2) {
- return to2.compareTo(to1);
- }
- };
- }
-
- private ListValueModel<String> buildPrimitiveTaskListAdapter() {
- return new ListAspectAdapter<TaskList, String>(this.taskListHolder, TaskList.TASK_NAMES_LIST) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.taskNames();
- }
- };
- }
-
- private ListValueModel<Task> buildObjectTaskListAdapter() {
- return new ListAspectAdapter<TaskList, Task>(this.taskListHolder, TaskList.TASKS_LIST) {
- @Override
- protected ListIterator<Task> listIterator_() {
- return this.subject.tasks();
- }
- };
- }
-
- private WritableCollectionValueModel<Task> buildPriorityTaskListAdapter() {
- return new PriorityTaskListAdapter(this.taskListHolder);
- }
-
- static class PriorityTaskListAdapter
- extends CollectionAspectAdapter<TaskList, Task>
- implements WritableCollectionValueModel<Task>
- {
- PriorityTaskListAdapter(WritablePropertyValueModel<TaskList> taskListHolder) {
- super(taskListHolder, TaskList.PRIORITY_TASKS_COLLECTION);
- }
- @Override
- protected Iterator<Task> iterator_() {
- return this.subject.priorityTasks();
- }
- public void setValues(Iterable<Task> values) {
- this.subject.setPriorityTasks(values);
- }
- }
-
- private void buildControlPanel(Composite parent, Control taskListPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(taskListPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control misc = this.buildMiscTaskPanel(panel);
- this.buildAddRemoveTaskPanel(panel, misc);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildMiscTaskPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -400);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildClearListACI().fill(panel);
- this.buildClearModelACI().fill(panel);
- this.buildRestoreModelACI().fill(panel);
- this.buildAddPriorityTaskACI().fill(panel);
- this.buildRemovePriorityTaskACI().fill(panel);
- this.buildClearPriorityTasksACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildClearListACI() {
- Action action = new Action("clear list", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.clearTasks();
- }
- };
- action.setToolTipText("clear all the tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildAddPriorityTaskACI() {
- Action action = new Action("add priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.addPriorityTask();
- }
- };
- action.setToolTipText("add a task to the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRemovePriorityTaskACI() {
- Action action = new Action("remove priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.removePriorityTask();
- }
- };
- action.setToolTipText("remove a task from the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearPriorityTasksACI() {
- Action action = new Action("clear priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.clearPriorityTasks();
- }
- };
- action.setToolTipText("clear the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private void buildAddRemoveTaskPanel(Composite parent, Control clearButton) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(clearButton);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control addButton = this.buildAddButton(panel);
- Control removeButton = this.buildRemoveButton(panel);
- this.buildTaskTextField(panel, addButton, removeButton);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildAddButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(0, 50);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildAddACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildAddACI() {
- Action action = new Action("add", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.addTask();
- }
- };
- action.setToolTipText("add a task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildRemoveButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -50);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildRemoveACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildRemoveACI() {
- Action action = new Action("remove", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelBindingUITest.this.removeTask();
- }
- };
- action.setToolTipText("remove the task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- private void buildTaskTextField(Composite parent, Control addButton, Control removeButton) {
- this.taskTextField = new Text(parent, SWT.SINGLE | SWT.BORDER);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(addButton);
- fd.right = new FormAttachment(removeButton);
- this.taskTextField.setLayoutData(fd);
- }
-
- private String taskTextFieldText() {
- return this.taskTextField.getText();
- }
-
- void addTask() {
- String taskText = this.taskTextFieldText();
- if (taskText.length() != 0) {
- this.taskList.addTask(taskText);
- }
- }
-
- void removeTask() {
- String task = this.taskTextFieldText();
- if (task.length() != 0) {
- this.taskList.removeTask(task);
- }
- }
-
- void clearTasks() {
- this.taskList.clearTasks();
- }
-
- void clearModel() {
- this.taskListHolder.setValue(null);
- }
-
- void restoreModel() {
- this.taskListHolder.setValue(this.taskList);
- }
-
- void addPriorityTask() {
- Iterator<Task> tasks = this.taskList.tasks();
- while (tasks.hasNext()) {
- if (this.taskList.addPriorityTask(tasks.next())) {
- return;
- }
- }
- }
-
- void removePriorityTask() {
- Iterator<Task> pTasks = this.taskList.priorityTasks();
- if (pTasks.hasNext()) {
- this.taskList.removePriorityTask(pTasks.next());
- }
- }
-
- void clearPriorityTasks() {
- this.taskList.clearPriorityTasks();
- }
-
-
- // ********** TaskList **********
-
- // note absence of validation...
- public static class TaskList extends AbstractModel {
- private final List<String> taskNames = new ArrayList<String>();
- public static final String TASK_NAMES_LIST = "taskNames";
- private final List<Task> tasks = new ArrayList<Task>();
- public static final String TASKS_LIST = "tasks";
- private final Collection<Task> priorityTasks = new HashSet<Task>();
- public static final String PRIORITY_TASKS_COLLECTION = "priorityTasks";
- public TaskList() {
- super();
- }
- public ListIterator<String> taskNames() {
- return this.taskNames.listIterator();
- }
- public ListIterator<Task> tasks() {
- return this.tasks.listIterator();
- }
- public Iterator<Task> priorityTasks() {
- return this.priorityTasks.iterator();
- }
- public Task addTask(String taskName) {
- this.addItemToList(taskName, this.taskNames, TASK_NAMES_LIST);
- Task task = new Task(taskName);
- this.addItemToList(task, this.tasks, TASKS_LIST);
- return task;
- }
- public void removeTask(String taskName) {
- int index = this.taskNames.indexOf(taskName);
- if (index != -1) {
- this.removeItemFromList(index, this.taskNames, TASK_NAMES_LIST);
- // assume the indexes match...
- Task removedTask = this.removeItemFromList(index, this.tasks, TASKS_LIST);
- this.removeItemFromCollection(removedTask, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- }
- public void clearTasks() {
- this.clearCollection(this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- this.clearList(this.taskNames, TASK_NAMES_LIST);
- this.clearList(this.tasks, TASKS_LIST);
- }
- public boolean addPriorityTask(Task task) {
- return this.addItemToCollection(task, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void removePriorityTask(Task task) {
- this.removeItemFromCollection(task, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void clearPriorityTasks() {
- this.clearCollection(this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void setPriorityTasks(Iterable<Task> tasks) {
- this.priorityTasks.clear();
- CollectionTools.addAll(this.priorityTasks, tasks);
- this.fireCollectionChanged(PRIORITY_TASKS_COLLECTION, this.priorityTasks);
- }
- }
-
-
- // ********** Task **********
-
- public static class Task extends AbstractModel implements Displayable {
- private String name;
- private int instanceCount;
- private static int INSTANCE_COUNT = 1;
- public Task(String name) {
- this.name = name;
- this.instanceCount = INSTANCE_COUNT++;
- }
- public String displayString() {
- return this.name + ": " + this.instanceCount;
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return this.displayString();
- }
- }
-
- public interface Displayable extends Model, Comparable<Displayable> {
-
- String displayString();
- String DISPLAY_STRING_PROPERTY = "displayString";
-
-
- // ********** helper implementations **********
-
- Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- Comparator<Displayable> DEFAULT_COMPARATOR =
- new Comparator<Displayable>() {
- public int compare(Displayable d1, Displayable d2) {
- // disallow duplicates based on object identity
- if (d1 == d2) {
- return 0;
- }
-
- // first compare display strings using the default collator
- int result = DEFAULT_COLLATOR.compare(d1.displayString(), d2.displayString());
- if (result != 0) {
- return result;
- }
-
- // then compare using object-id
- result = System.identityHashCode(d1) - System.identityHashCode(d2);
- if (result != 0) {
- return result;
- }
-
- // It's unlikely that we get to this point; but, just in case, we will return -1.
- // Unfortunately, this introduces some mild unpredictability to the sort order
- // (unless the objects are always passed into this method in the same order).
- return -1; // if all else fails, indicate that o1 < o2
- }
- @Override
- public String toString() {
- return "Displayable.DEFAULT_COMPARATOR";
- }
- };
-
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/TextFieldModelBindingUITest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/TextFieldModelBindingUITest.java
deleted file mode 100644
index 5bd6f16dd2..0000000000
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/utility/swt/TextFieldModelBindingUITest.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.ui.tests.internal.utility.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Play around with a set of entry fields.
- */
-@SuppressWarnings("nls")
-public class TextFieldModelBindingUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private static final String DEFAULT_NAME = "Scooby Doo";
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<String> nameHolder;
- private final WritablePropertyValueModel<String> allCapsNameHolder;
-
-
- public static void main(String[] args) throws Exception {
- Window window = new TextFieldModelBindingUITest();
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private TextFieldModelBindingUITest() {
- super(null);
- this.testModel = new TestModel(DEFAULT_NAME);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.nameHolder = this.buildNameHolder(this.testModelHolder);
- this.allCapsNameHolder = this.buildAllCapsNameHolder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.name();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildAllCapsNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.name().toUpperCase();
- }
- @Override
- protected void setValue_(String value) {
- // do nothing
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(this.getClass().getSimpleName());
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control textFieldPanel = this.buildTextFieldPanel(mainPanel);
- this.buildControlPanel(mainPanel, textFieldPanel);
- return mainPanel;
- }
-
- private Control buildTextFieldPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildNameTextField(panel);
- this.buildReadOnlyNameTextField(panel);
- this.buildAllCapsNameTextField(panel);
-
- return panel;
- }
-
- private void buildNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- SWTTools.bind(this.nameHolder, textField);
- }
-
- private void buildReadOnlyNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- SWTTools.bind(this.nameHolder, textField);
- }
-
- private void buildAllCapsNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- SWTTools.bind(this.allCapsNameHolder, textField);
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildResetNameButton(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildResetNameButton(Composite parent) {
- this.buildResetNameACI().fill(parent);
- }
-
- private ActionContributionItem buildResetNameACI() {
- Action action = new Action("reset name", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelBindingUITest.this.resetName();
- }
- };
- action.setToolTipText("reset name");
- return new ActionContributionItem(action);
- }
-
- void resetName() {
- this.testModel.setName(DEFAULT_NAME);
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelBindingUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelBindingUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelBindingUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("name: " + this.testModel.name());
- }
-
-
- // ********** model class **********
-
- class TestModel extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public TestModel(String name) {
- this.name = name;
- }
- public String name() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.name + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/.classpath b/common/tests/org.eclipse.jpt.common.utility.tests/.classpath
deleted file mode 100644
index 5c128f330d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/.cvsignore b/common/tests/org.eclipse.jpt.common.utility.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/.project b/common/tests/org.eclipse.jpt.common.utility.tests/.project
deleted file mode 100644
index 898e230aaf..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.common.utility.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/.settings/org.eclipse.jdt.core.prefs b/common/tests/org.eclipse.jpt.common.utility.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 03215865ea..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:06:57 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/META-INF/MANIFEST.MF b/common/tests/org.eclipse.jpt.common.utility.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index eeb203128b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.common.utility.tests
-Bundle-Version: 2.0.100.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.common.utility.tests.internal;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.enumerations;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.iterables;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.iterators;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.model.listener;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.model.value;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.model.value.prefs;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.model.value.swing;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.node;x-internal:=true,
- org.eclipse.jpt.common.utility.tests.internal.synchronizers;x-internal:=true
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/about.html b/common/tests/org.eclipse.jpt.common.utility.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/build.properties b/common/tests/org.eclipse.jpt.common.utility.tests/build.properties
deleted file mode 100644
index ebe9c08ef9..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/plugin.properties b/common/tests/org.eclipse.jpt.common.utility.tests/plugin.properties
deleted file mode 100644
index 8ea447bc75..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Common Utility Tests
-providerName = Eclipse Web Tools Platform
-
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/resource/ClassTools.java b/common/tests/org.eclipse.jpt.common.utility.tests/resource/ClassTools.java
deleted file mode 100644
index aac17b6044..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/resource/ClassTools.java
+++ /dev/null
@@ -1,1680 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package test;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Collections;
-import java.util.Stack;
-
-/**
- * Convenience methods related to the java.lang.reflect package.
- * These methods provide shortcuts for manipulating objects via
- * reflection; particularly when dealing with fields and/or methods that
- * are not publicly accessible or are inherited.
- *
- * In most cases, all the exceptions are handled and
- * wrapped in java.lang.RuntimeExceptions; so these methods should
- * be used when you are confident that you will not having any problems
- * using reflection.
- *
- * There are also a number of methods whose names
- * begin with "attempt". These methods will throw a NoSuchMethodException
- * or NoSuchFieldException when appropriate, allowing you to probe
- * for methods that should be present but might not.
- */
-public final class ClassTools {
-
- public static final Class<?>[] ZERO_PARAMETER_TYPES = new Class[0];
- public static final Object[] ZERO_PARAMETERS = new Object[0];
- private static final String CR = StringTools.CR;
-
- public static final char NESTED_CLASS_NAME_SEPARATOR = '$';
-
- public static final char ARRAY_INDICATOR = '[';
- public static final char TYPE_DECLARATION_ARRAY_OPEN = '[';
- public static final char TYPE_DECLARATION_ARRAY_CLOSE = ']';
-
- public static final char REFERENCE_CLASS_CODE = 'L';
- public static final char REFERENCE_CLASS_NAME_DELIMITER = ';';
-
- private static Primitive[] PRIMITIVES; // pseudo-'final' - lazy-initialized
- public static final char BYTE_CODE = 'B';
- public static final char CHAR_CODE = 'C';
- public static final char DOUBLE_CODE = 'D';
- public static final char FLOAT_CODE = 'F';
- public static final char INT_CODE = 'I';
- public static final char LONG_CODE = 'J';
- public static final char SHORT_CODE = 'S';
- public static final char BOOLEAN_CODE = 'Z';
- public static final char VOID_CODE = 'V';
- private static int MAX_PRIMITIVE_CLASS_NAME_LENGTH = -1; // pseudo-'final' - lazy-initialized
- private static int MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH = -1; // pseudo-'final' - lazy-initialized
-
- public static final String VOID_CLASS_NAME = void.class.getName();
- public static final String VOID_WRAPPER_CLASS_NAME = java.lang.Void.class.getName();
-
-
- /**
- * Return all the fields for the
- * specified class, including inherited fields.
- * Class#allFields()
- */
- @Deprecated
- public static Field[] allFields(Class<?> javaClass) {
- Stack<Field> stack = new Stack<Field>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- pushDeclaredFields(tempClass, stack);
- }
- Collections.reverse(stack);
- return stack.toArray(new Field[stack.size()]);
- }
-
- /**
- * Return all the methods for the
- * specified class, including inherited methods.
- * Class#allMethods()
- */
- public static Method[] allMethods(Class<?> javaClass) {
- Stack<Method> stack = new Stack<Method>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- pushDeclaredMethods(tempClass, stack);
- }
- Collections.reverse(stack);
- return stack.toArray(new Method[stack.size()]);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Throw an exception if the default constructor is not defined.
- * Class#newInstance() throws NoSuchMethodException
- */
- @Deprecated
- public static <T> T attemptNewInstance(Class<T> javaClass) throws NoSuchMethodException {
- return attemptNewInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Throw an exception if the constructor is not defined.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static <T> T attemptNewInstance(Class<T> javaClass, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- try {
- return constructor(javaClass, parameterTypes).newInstance(parameters);
- } catch (InstantiationException ie) {
- throw new RuntimeException(ie + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), ie);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), iae);
- } catch (InvocationTargetException ite) {
- throw new RuntimeException(fullyQualifiedConstructorSignature(javaClass, parameterTypes) + CR + ite.getTargetException(), ite);
- }
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Throw an exception if the constructor is not defined.
- * Class#newInstance(Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static <T> T attemptNewInstance(Class<T> javaClass, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptNewInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Object#getFieldValue(String fieldName) throws NoSuchFieldException
- */
- public static Object attemptToGetFieldValue(Object object, String fieldName) throws NoSuchFieldException {
- try {
- return field(object, fieldName).get(object);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae);
- }
- }
-
- /**
- * Attempt to get a static field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Class#getStaticFieldValue(String fieldName) throws NoSuchFieldException
- */
- public static Object attemptToGetStaticFieldValue(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
- try {
- return field(javaClass, fieldName).get(null);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae);
- }
- }
-
- /**
- * Convenience method.
- * Attempt to execute a zero-argument method,
- * given the receiver and method name.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName) throws NoSuchMethodException {
- return attemptToExecuteMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptToExecuteMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- return executeMethod(method(receiver, methodName, parameterTypes), receiver, parameters);
- }
-
- /**
- * Attempt to execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * If the executed method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethodWithException(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters)
- throws Throwable, NoSuchMethodException
- {
- return executeMethodWithException(method(receiver, methodName, parameterTypes), receiver, parameters);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a zero-argument static method,
- * given the class and method name.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return attemptToExecuteStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Attempt to execute a static method, given the class,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- return executeStaticMethod(staticMethod(javaClass, methodName, parameterTypes), parameters);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a static method, given the class,
- * method name, parameter type, and parameter.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptToExecuteStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to set a field value, given the
- * containing object, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Object#setFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException
- */
- public static void attemptToSetFieldValue(Object object, String fieldName, Object fieldValue) throws NoSuchFieldException {
- try {
- field(object, fieldName).set(object, fieldValue);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae);
- }
- }
-
- /**
- * Attempt to set a static field value, given the
- * containing class, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Class#setStaticFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException
- */
- public static void attemptToSetStaticFieldValue(Class<?> javaClass, String fieldName, Object fieldValue) throws NoSuchFieldException {
- try {
- field(javaClass, fieldName).set(null, fieldValue);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae);
- }
- }
-
- /**
- * Convenience method.
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor() throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass) throws NoSuchMethodException {
- return constructor(javaClass, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return the constructor for the specified class
- * and formal parameter types.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor(Class<?>[] parameterTypes) throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Constructor<T> constructor = javaClass.getDeclaredConstructor(parameterTypes);
- constructor.setAccessible(true);
- return constructor;
- }
-
- /**
- * Convenience method.
- * Return the constructor for the specified class
- * and formal parameter type.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor(Class<?> parameterType) throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass, Class<?> parameterType) throws NoSuchMethodException {
- return constructor(javaClass, new Class[] {parameterType});
- }
-
- /**
- * Return the declared fields for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- * Class#accessibleDeclaredFields()
- */
- public static Field[] declaredFields(Class<?> javaClass) {
- Field[] fields = javaClass.getDeclaredFields();
- for (Field field : fields) {
- field.setAccessible(true);
- }
- return fields;
- }
-
- /**
- * Return the declared methods for the
- * specified class.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- * Class#accessibleDeclaredMethods()
- */
- public static Method[] declaredMethods(Class<?> javaClass) {
- Method[] methods = javaClass.getDeclaredMethods();
- for (Method method : methods) {
- method.setAccessible(true);
- }
- return methods;
- }
-
- /**
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#defaultConstructor()
- */
- public static <T> Constructor<T> defaultConstructor(Class<T> javaClass) throws NoSuchMethodException {
- return constructor(javaClass);
- }
-
- /**
- * Return a field for the specified class and field name.
- * If the class does not directly
- * define the field, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- */
- public static Field field(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
- Field field = null;
- try {
- field = javaClass.getDeclaredField(fieldName);
- } catch (NoSuchFieldException ex) {
- Class<?> superclass = javaClass.getSuperclass();
- if (superclass == null) {
- throw ex;
- }
- // recurse
- return field(superclass, fieldName);
- }
- field.setAccessible(true);
- return field;
- }
-
- /**
- * Convenience method.
- * Return a field for the specified object and field name.
- * If the object's class does not directly
- * define the field, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- */
- public static Field field(Object object, String fieldName) throws NoSuchFieldException {
- return field(object.getClass(), fieldName);
- }
-
- /*
- * Return a string representation of the specified constructor.
- */
- private static String fullyQualifiedConstructorSignature(Class<?> javaClass, Class<?>[] parameterTypes) {
- return fullyQualifiedMethodSignature(javaClass, null, parameterTypes);
- }
-
- /*
- * Return a string representation of the specified field.
- */
- private static String fullyQualifiedFieldName(Class<?> javaClass, String fieldName) {
- StringBuilder sb = new StringBuilder(200);
- sb.append(javaClass.getName());
- sb.append('.');
- sb.append(fieldName);
- return sb.toString();
- }
-
- /*
- * Return a string representation of the specified field.
- */
- private static String fullyQualifiedFieldName(Object object, String fieldName) {
- return fullyQualifiedFieldName(object.getClass(), fieldName);
- }
-
- /*
- * Return a string representation of the specified method.
- */
- private static String fullyQualifiedMethodSignature(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) {
- StringBuilder sb = new StringBuilder(200);
- sb.append(javaClass.getName());
- // this check allows us to use this code for constructors, where the methodName is null
- if (methodName != null) {
- sb.append('.');
- sb.append(methodName);
- }
- sb.append('(');
- int max = parameterTypes.length - 1;
- if (max != -1) {
- // stop one short of the end of the array
- for (int i = 0; i < max; i++) {
- sb.append(parameterTypes[i].getName());
- sb.append(", ");
- }
- sb.append(parameterTypes[max].getName());
- }
- sb.append(')');
- return sb.toString();
- }
-
- /*
- * Return a string representation of the specified method.
- */
- private static String fullyQualifiedMethodSignature(Object receiver, String methodName, Class<?>[] parameterTypes) {
- return fullyQualifiedMethodSignature(receiver.getClass(), methodName, parameterTypes);
- }
-
- /**
- * Get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Object#getFieldValue(String fieldName)
- */
- public static Object fieldValue(Object object, String fieldName) {
- try {
- return attemptToGetFieldValue(object, fieldName);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe);
- }
- }
-
- /**
- * Get a static field value, given the containing class and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Class#getStaticFieldValue(String fieldName)
- */
- public static Object staticFieldValue(Class<?> javaClass, String fieldName) {
- try {
- return attemptToGetStaticFieldValue(javaClass, fieldName);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe);
- }
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument method, given the receiver and method name.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName)
- */
- public static Object executeMethod(Object receiver, String methodName) {
- return executeMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptToExecuteMethod(receiver, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Convenience method.
- * Execute a one-argument method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?> parameterType, Object parameter) {
- return executeMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument method, given the receiver and method name.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName)
- */
- public static Object executeMethodWithException(Object receiver, String methodName)
- throws Throwable
- {
- return executeMethodWithException(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Execute a one-argument method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeMethodWithException(Object receiver, String methodName, Class<?> parameterType, Object parameter)
- throws Throwable
- {
- return executeMethodWithException(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeMethodWithException(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters)
- throws Throwable
- {
- try {
- return attemptToExecuteMethodWithException(receiver, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Execute the specified method with the specified parameters.
- * Return its result.
- * Convert exceptions to RuntimeExceptions.
- */
- public static Object executeMethod(Method method, Object receiver, Object[] parameters) {
- try {
- return method.invoke(receiver, parameters);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + method, iae);
- } catch (InvocationTargetException ite) {
- throw new RuntimeException(method + CR + ite.getTargetException(), ite);
- }
- }
-
- /**
- * Execute the specified method with the specified parameters.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Convert all other exceptions to RuntimeExceptions.
- */
- public static Object executeMethodWithException(Method method, Object receiver, Object[] parameters)
- throws Throwable
- {
- try {
- return method.invoke(receiver, parameters);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + method, iae);
- } catch (InvocationTargetException ite) {
- Throwable cause = ite.getCause();
- if (cause == null) {
- throw new RuntimeException(method.toString(), ite);
- }
- throw cause;
- }
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument static method,
- * given the class and method name.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName) {
- return executeStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Execute a static method, given the class,
- * method name, parameter types, and parameters.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptToExecuteStaticMethod(javaClass, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Convenience method.
- * Execute a static method, given the class,
- * method name, parameter type, and parameter.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterType, Object parameter) {
- return executeStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Execute the specified static method with the specified parameters.
- * Return its result.
- * Convert exceptions to RuntimeExceptions.
- */
- public static Object executeStaticMethod(Method method, Object[] parameters) {
- return executeMethod(method, null, parameters);
- }
-
- /**
- * Convenience method.
- * Return a zero-argument method for the specified class
- * and method name. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return method(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return a method for the specified class, method name,
- * and formal parameter types. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Method method = null;
- try {
- method = javaClass.getDeclaredMethod(methodName, parameterTypes);
- } catch (NoSuchMethodException ex) {
- Class<?> superclass = javaClass.getSuperclass();
- if (superclass == null) {
- throw ex;
- }
- // recurse
- return method(superclass, methodName, parameterTypes);
- }
- method.setAccessible(true);
- return method;
- }
-
- /**
- * Convenience method.
- * Return a method for the specified class, method name,
- * and formal parameter type. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName, Class<?> parameterType) throws NoSuchMethodException {
- return method(javaClass, methodName, new Class[] {parameterType});
- }
-
- /**
- * Convenience method.
- * Return a zero-argument method for the specified object
- * and method name. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName) throws NoSuchMethodException {
- return method(object.getClass(), methodName);
- }
-
- /**
- * Convenience method.
- * Return a method for the specified object, method name,
- * and formal parameter types. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- return method(object.getClass(), methodName, parameterTypes);
- }
-
- /**
- * Convenience method.
- * Return a method for the specified object, method name,
- * and formal parameter type. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName, Class<?> parameterType) throws NoSuchMethodException {
- return method(object.getClass(), methodName, parameterType);
- }
-
- /**
- * Convenience method.
- * Return the specified class (without the checked exception).
- */
- public static Class<?> classForName(String className) {
- try {
- return Class.forName(className);
- } catch (ClassNotFoundException ex) {
- throw new RuntimeException(className, ex);
- }
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static <T> T newInstance(Class<T> javaClass) {
- return newInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static Object newInstance(String className) throws ClassNotFoundException {
- return newInstance(className, null);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static Object newInstance(String className, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, true, classLoader));
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptNewInstance(javaClass, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), nsme);
- }
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object newInstance(String className, Class<?>[] parameterTypes, Object[] parameters) throws ClassNotFoundException {
- return newInstance(className, parameterTypes, parameters, null);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object newInstance(String className, Class<?>[] parameterTypes, Object[] parameters, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, true, classLoader), parameterTypes, parameters);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?> parameterType, Object parameter) {
- return newInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static Object newInstance(String className, Class<?> parameterType, Object parameter) throws ClassNotFoundException {
- return newInstance(className, parameterType, parameter, null);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static Object newInstance(String className, Class<?> parameterType, Object parameter, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, false, classLoader), parameterType, parameter);
- }
-
- /*
- * Push the declared fields for the specified class
- * onto the top of the stack.
- */
- private static void pushDeclaredFields(Class<?> javaClass, Stack<Field> stack) {
- Field[] fields = declaredFields(javaClass);
- for (int i = fields.length; i-- > 0; ) {
- stack.push(fields[i]);
- }
- }
-
- /*
- * Push the declared methods for the specified class
- * onto the top of the stack.
- */
- private static void pushDeclaredMethods(Class<?> javaClass, Stack<Method> stack) {
- Method[] methods = declaredMethods(javaClass);
- for (int i = methods.length; i-- > 0; ) {
- stack.push(methods[i]);
- }
- }
-
- /**
- * Set a field value, given the containing object, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Object#setFieldValue(String fieldName, Object fieldValue)
- */
- public static void setFieldValue(Object object, String fieldName, Object fieldValue) {
- try {
- attemptToSetFieldValue(object, fieldName, fieldValue);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe);
- }
- }
-
- /**
- * Set a static field value, given the containing class, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Class#setStaticFieldValue(String fieldName, Object fieldValue)
- */
- public static void setStaticFieldValue(Class<?> javaClass, String fieldName, Object fieldValue) {
- try {
- attemptToSetStaticFieldValue(javaClass, fieldName, fieldValue);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe);
- }
- }
-
- /**
- * Return the short name of the object's class.
- * Class#getShortName()
- */
- public static String shortClassNameForObject(Object object) {
- return shortNameFor(object.getClass());
- }
-
- /**
- * Return the short name of the class (e.g. "Object").
- * Class#getShortName()
- */
- public static String shortNameForClassNamed(String className) {
- return className.substring(className.lastIndexOf('.') + 1);
- }
-
- /**
- * Return the short name of the class (e.g. "Object").
- * Class#getShortName()
- */
- public static String shortNameFor(Class<?> javaClass) {
- return shortNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the nested name of the object's class.
- * Class#getNestedName()
- */
- public static String nestedClassNameForObject(Object object) {
- return nestedNameFor(object.getClass());
- }
-
- /**
- * Return the nested name of the class (e.g. "Entry").
- * Class#getNestedName()
- */
- public static String nestedNameForClassNamed(String className) {
- return className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1);
- }
-
- /**
- * Return the nested name of the class (e.g. "Entry").
- * Class#getNestedName()
- */
- public static String nestedNameFor(Class<?> javaClass) {
- return nestedNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the "toString()" name of the object's class.
- */
- public static String toStringClassNameForObject(Object object) {
- return toStringNameFor(object.getClass());
- }
-
- /**
- * Return the "toString()" name of the class.
- * "Member" classes will return only the final name:
- * "com.foo.bar.TopLevelClass$MemberClass$NestedMemberClass"
- * => "NestedMemberClass"
- * "Local" and "anonymous" classes will still return the embedded '$'s:
- * "com.foo.bar.TopLevelClass$1LocalClass"
- * => "TopLevelClass$1LocalClass"
- * "com.foo.bar.TopLevelClass$1"
- * => "TopLevelClass$1"
- */
- public static String toStringNameForClassNamed(String className) {
- return classNamedIsMember(className) ?
- className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1)
- :
- className.substring(className.lastIndexOf('.') + 1);
- }
-
- /**
- * Return the "toString()" name of the class.
- */
- public static String toStringNameFor(Class<?> javaClass) {
- return toStringNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the package name of the class (e.g. "java.lang").
- * Class#getPackageName()
- */
- public static String packageNameFor(Class<?> javaClass) {
- return packageNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the package name of the class (e.g. "java.lang").
- * Class#getPackageName()
- */
- public static String packageNameForClassNamed(String className) {
- int lastPeriod = className.lastIndexOf('.');
- if (lastPeriod == -1) {
- return "";
- }
- return className.substring(0, lastPeriod);
- }
-
- /**
- * Return the short name of the class,
- * followed by its package name (e.g. "Object (java.lang)").
- * Class#getShortNameWithPackage()
- */
- public static String shortNameWithPackage(Class<?> javaClass) {
- StringBuilder sb = new StringBuilder(200);
- sb.append(shortNameFor(javaClass));
- if ( ! javaClass.isPrimitive()) {
- sb.append(" (");
- sb.append(packageNameFor(javaClass));
- sb.append(')');
- }
- return sb.toString();
- }
-
- /**
- * Convenience method.
- * Return a zero-argument, static method for the specified class
- * and method name. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return staticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return a static method for the specified class, method name,
- * and formal parameter types. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Method method = method(javaClass, methodName, parameterTypes);
- if (Modifier.isStatic(method.getModifiers())) {
- return method;
- }
- throw new NoSuchMethodException(fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes));
- }
-
- /**
- * Convenience method.
- * Return a static method for the specified class, method name,
- * and formal parameter type. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName, Class<?> parameterTypes) throws NoSuchMethodException {
- return staticMethod(javaClass, methodName, new Class[] {parameterTypes});
- }
-
- /**
- * Return whether the specified class can be "declared" in code;
- * i.e. it is either a "top-level" class or a "member" class, but it
- * is not an "array" class. This method rolls together all the checks
- * from the other methods for a bit of a performance tweak.
- * Class#isDeclarable()
- */
- public static boolean classNamedIsDeclarable(String className) {
- if (className.charAt(0) == ARRAY_INDICATOR) {
- return false; // it is an "array" class
- }
- int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (index == -1) {
- return true; // it is a "top-level" class
- }
- do {
- // the character immediately after each dollar sign cannot be a digit
- index++;
- if (Character.isDigit(className.charAt(index))) {
- return false;
- }
- index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index);
- } while (index != -1);
- return true;
- }
-
- /**
- * Return whether the specified class is a "top-level" class,
- * as opposed to a "member", "local", or "anonymous" class,
- * using the standard jdk naming conventions (i.e. the class
- * name does NOT contain a '$': "TopLevelClass").
- * Class#isTopLevel()
- */
- public static boolean classNamedIsTopLevel(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- return className.indexOf(NESTED_CLASS_NAME_SEPARATOR) == -1;
- }
-
- /**
- * Return whether the specified class is a "member" class,
- * as opposed to a "top-level", "local", or "anonymous" class,
- * using the standard jdk naming conventions (i.e. the class
- * name contains at least one '$' and all the names between
- * each '$' are legal class names:
- * "TopLevelClass$MemberClass$NestedMemberClass").
- * Class#isMember()
- */
- public static boolean classNamedIsMember(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (index == -1) {
- return false; // it is a "top-level" class
- }
- do {
- // the character immediately after each dollar sign cannot be a digit
- index++;
- if (Character.isDigit(className.charAt(index))) {
- return false;
- }
- index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index);
- } while (index != -1);
- return true;
- }
-
- /**
- * Return whether the specified class is a "local" class,
- * as opposed to a "top-level", "member", or "anonymous" class,
- * using the standard jdk (or Eclipse) naming conventions.
- * In the jdk, the class name ends with '$nnnXXX' where the '$' is
- * followed by a series of numeric digits which are followed by the
- * local class name: "TopLevelClass$1LocalClass".
- * In Eclipse, the class name ends with '$nnn$XXX' where the '$' is
- * followed by a series of numeric digits which are separated from
- * the local class name by another '$': "TopLevelClass$1$LocalClass".
- * Class#isLocal()
- */
- public static boolean classNamedIsLocal(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (dollar == -1) {
- return false;
- }
- if ( ! Character.isDigit(className.charAt(dollar + 1))) {
- return false;
- }
- int len = className.length();
- for (int i = dollar + 2; i < len; i++) {
- if (Character.isJavaIdentifierStart(className.charAt(i))) {
- return true;
- }
- }
- // all the characters past the $ are digits (anonymous)
- return false;
- }
-
- /**
- * Return whether the specified class is an "anonymous" class,
- * as opposed to a "top-level", "member", or "local" class,
- * using the standard jdk naming conventions (i.e. the class
- * name ends with '$nnn' where all the characters past the
- * last '$' are numeric digits: "TopLevelClass$1").
- * Class#isAnonymous()
- */
- public static boolean classNamedIsAnonymous(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (dollar == -1) {
- return false;
- }
- int start = dollar + 1;
- for (int i = className.length(); i-- > start; ) {
- if ( ! Character.isDigit(className.charAt(i))) {
- return false;
- }
- }
- // all the characters past the $ are digits
- return true;
- }
-
- /**
- * Return the "array depth" of the specified class.
- * The depth is the number of dimensions for an array type.
- * Non-array types have a depth of zero.
- * Class#getArrayDepth()
- */
- public static int arrayDepthFor(Class<?> javaClass) {
- int depth = 0;
- while (javaClass.isArray()) {
- depth++;
- javaClass = javaClass.getComponentType();
- }
- return depth;
- }
-
- /**
- * Return the "array depth" of the specified object.
- * The depth is the number of dimensions for an array.
- * Non-arrays have a depth of zero.
- */
- public static int arrayDepthForObject(Object object) {
- return arrayDepthFor(object.getClass());
- }
-
- /**
- * Return the "array depth" of the specified class.
- * The depth is the number of dimensions for an array type.
- * Non-array types have a depth of zero.
- * @see java.lang.Class#getName()
- * Class#getArrayDepth()
- */
- public static int arrayDepthForClassNamed(String className) {
- int depth = 0;
- while (className.charAt(depth) == ARRAY_INDICATOR) {
- depth++;
- }
- return depth;
- }
-
- /**
- * Return whether the specified class is an array type.
- * @see java.lang.Class#getName()
- */
- public static boolean classNamedIsArray(String className) {
- return className.charAt(0) == ARRAY_INDICATOR;
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * A non-array type simply returns itself.
- * Class#getElementType()
- */
- public static Class<?> elementTypeFor(Class<?> javaClass) {
- while (javaClass.isArray()) {
- javaClass = javaClass.getComponentType();
- }
- return javaClass;
- }
-
- /**
- * Return the "element type" of the specified object.
- * The element type is the base type held by an array.
- * A non-array simply returns its class.
- */
- public static Class<?> elementTypeForObject(Object object) {
- return elementTypeFor(object.getClass());
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * Non-array types simply return themselves.
- * Class#getElementType()
- */
- public static String elementTypeNameFor(Class<?> javaClass) {
- return elementTypeFor(javaClass).getName();
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * Non-array types simply return themselves.
- * @see java.lang.Class#getName()
- * Class#getElementType()
- */
- public static String elementTypeNameForClassNamed(String className) {
- int depth = arrayDepthForClassNamed(className);
- if (depth == 0) {
- // the name is in the form: "java.lang.Object" or "int"
- return className;
- }
- int last = className.length() - 1;
- if (className.charAt(depth) == REFERENCE_CLASS_CODE) {
- // the name is in the form: "[[[Ljava.lang.Object;"
- return className.substring(depth + 1, last); // drop the trailing ';'
- }
- // the name is in the form: "[[[I"
- return classNameForCode(className.charAt(last));
- }
-
- /**
- * Return whether the specified class is a "reference"
- * class (i.e. neither 'void' nor one of the primitive variable classes,
- * ['boolean', 'int', 'float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsReference(String className) {
- return ! classNamedIsPrimitive(className);
- }
-
- /**
- * Return whether the specified class is a primitive
- * class (i.e. 'void' or one of the primitive variable classes,
- * ['boolean', 'int', 'float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsPrimitive(String className) {
- if (classNamedIsArray(className) || (className.length() > maxPrimitiveClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsVariablePrimitive(String className) {
- return classNamedIsPrimitive(className)
- && ( ! className.equals(VOID_CLASS_NAME));
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. 'java.lang.Void' or one of the primitive variable wrapper classes,
- * ['java.lang.Boolean', 'java.lang.Integer', 'java.lang.Float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsPrimitiveWrapperClass(String className) {
- if (classNamedIsArray(className) || (className.length() > maxPrimitiveWrapperClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].wrapperClass.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsVariablePrimitiveWrapperClass(String className) {
- return classNamedIsPrimitiveWrapperClass(className)
- && ( ! className.equals(VOID_WRAPPER_CLASS_NAME));
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. 'java.lang.Void' or one of the primitive variable wrapper classes,
- * ['java.lang.Boolean', 'java.lang.Integer', 'java.lang.Float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classIsPrimitiveWrapperClass(Class<?> javaClass) {
- if (javaClass.isArray() || (javaClass.getName().length() > maxPrimitiveWrapperClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].wrapperClass == javaClass) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classIsVariablePrimitiveWrapperClass(Class<?> javaClass) {
- return classIsPrimitiveWrapperClass(javaClass)
- && (javaClass != java.lang.Void.class);
- }
-
- /**
- * Return the class name for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static String classNameForCode(char classCode) {
- return classForCode(classCode).getName();
- }
-
- /**
- * Return the class name for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static String classNameForCode(int classCode) {
- return classNameForCode((char) classCode);
- }
-
- /**
- * Return the class for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> classForCode(char classCode) {
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].code == classCode) {
- return codes[i].javaClass;
- }
- }
- throw new IllegalArgumentException(String.valueOf(classCode));
- }
-
- /**
- * Return the class for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> classForCode(int classCode) {
- return classForCode((char) classCode);
- }
-
- /**
- * Return the class code for the specified class.
- * @see java.lang.Class#getName()
- */
- public static char codeForClass(Class<?> javaClass) {
- if (( ! javaClass.isArray()) && (javaClass.getName().length() <= maxPrimitiveClassNameLength())) {
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass == javaClass) {
- return codes[i].code;
- }
- }
- }
- throw new IllegalArgumentException(javaClass.getName());
- }
-
- /**
- * Return the class code for the specified class.
- * @see java.lang.Class#getName()
- */
- public static char codeForClassNamed(String className) {
- if (( ! classNamedIsArray(className)) && (className.length() <= maxPrimitiveClassNameLength())) {
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(className)) {
- return codes[i].code;
- }
- }
- }
- throw new IllegalArgumentException(className);
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> classForTypeDeclaration(String typeDeclaration) throws ClassNotFoundException {
- return classForTypeDeclaration(typeDeclaration, ClassTools.class.getClassLoader());
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- public static Class<?> classForTypeDeclaration(String typeDeclaration, ClassLoader classLoader) throws ClassNotFoundException {
- TypeDeclaration td = typeDeclaration(typeDeclaration);
- return classForTypeDeclaration(td.elementTypeName, td.arrayDepth);
- }
-
- private static TypeDeclaration typeDeclaration(String typeDeclaration) {
- typeDeclaration = StringTools.removeAllWhitespace(typeDeclaration);
- int arrayDepth = arrayDepthForTypeDeclaration_(typeDeclaration);
- String elementTypeName = typeDeclaration.substring(0, typeDeclaration.length() - (arrayDepth * 2));
- return new TypeDeclaration(elementTypeName, arrayDepth);
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> classForTypeDeclaration(String elementTypeName, int arrayDepth) throws ClassNotFoundException {
- return classForTypeDeclaration(elementTypeName, arrayDepth, null);
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- // see the "Evaluation" of jdk bug 6446627 for a discussion of loading classes
- public static Class<?> classForTypeDeclaration(String elementTypeName, int arrayDepth, ClassLoader classLoader) throws ClassNotFoundException {
- // primitives cannot be loaded via Class#forName(),
- // so check for a primitive class name first
- Primitive pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(elementTypeName)) {
- pcc = codes[i];
- break;
- }
- }
- }
-
- // non-array
- if (arrayDepth == 0) {
- return (pcc == null) ? Class.forName(elementTypeName, false, classLoader) : pcc.javaClass;
- }
-
- // array
- StringBuilder sb = new StringBuilder(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append(ARRAY_INDICATOR);
- }
- if (pcc == null) {
- sb.append(REFERENCE_CLASS_CODE);
- sb.append(elementTypeName);
- sb.append(REFERENCE_CLASS_NAME_DELIMITER);
- } else {
- sb.append(pcc.code);
- }
- return Class.forName(sb.toString(), false, classLoader);
- }
-
- /**
- * Return the class name for the specified "type declaration"; e.g.
- * "int[]" -> "[I"
- * @see java.lang.Class#getName()
- */
- public static String classNameForTypeDeclaration(String typeDeclaration) {
- TypeDeclaration td = typeDeclaration(typeDeclaration);
- return classNameForTypeDeclaration(td.elementTypeName, td.arrayDepth);
- }
-
- /**
- * Return the array depth for the specified "type declaration"; e.g.
- * "int[]" -> 1
- */
- public static int arrayDepthForTypeDeclaration(String typeDeclaration) {
- return arrayDepthForTypeDeclaration_(StringTools.removeAllWhitespace(typeDeclaration));
- }
-
- /*
- * Assume no whitespace in the type declaration.
- */
- private static int arrayDepthForTypeDeclaration_(String typeDeclaration) {
- int last = typeDeclaration.length() - 1;
- int depth = 0;
- int close = last;
- while (typeDeclaration.charAt(close) == TYPE_DECLARATION_ARRAY_CLOSE) {
- if (typeDeclaration.charAt(close - 1) == TYPE_DECLARATION_ARRAY_OPEN) {
- depth++;
- } else {
- throw new IllegalArgumentException("invalid type declaration: " + typeDeclaration);
- }
- close = last - (depth * 2);
- }
- return depth;
- }
-
- /**
- * Return the class name for the specified "type declaration".
- * @see java.lang.Class#getName()
- */
- public static String classNameForTypeDeclaration(String elementTypeName, int arrayDepth) {
- // non-array
- if (arrayDepth == 0) {
- return elementTypeName;
- }
-
- if (elementTypeName.equals(VOID_CLASS_NAME)) {
- throw new IllegalArgumentException("'" + VOID_CLASS_NAME + "' must have an array depth of zero: " + arrayDepth + '.');
- }
- // array
- StringBuilder sb = new StringBuilder(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append(ARRAY_INDICATOR);
- }
-
- // look for a primitive first
- Primitive pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(elementTypeName)) {
- pcc = codes[i];
- break;
- }
- }
- }
-
- if (pcc == null) {
- sb.append(REFERENCE_CLASS_CODE);
- sb.append(elementTypeName);
- sb.append(REFERENCE_CLASS_NAME_DELIMITER);
- } else {
- sb.append(pcc.code);
- }
-
- return sb.toString();
- }
-
- private static int maxPrimitiveClassNameLength() {
- if (MAX_PRIMITIVE_CLASS_NAME_LENGTH == -1) {
- MAX_PRIMITIVE_CLASS_NAME_LENGTH = calculateMaxPrimitiveClassNameLength();
- }
- return MAX_PRIMITIVE_CLASS_NAME_LENGTH;
- }
-
- private static int calculateMaxPrimitiveClassNameLength() {
- int max = -1;
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- int len = codes[i].javaClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static int maxPrimitiveWrapperClassNameLength() {
- if (MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH == -1) {
- MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH = calculateMaxPrimitiveWrapperClassNameLength();
- }
- return MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH;
- }
-
- private static int calculateMaxPrimitiveWrapperClassNameLength() {
- int max = -1;
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- int len = codes[i].wrapperClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static Primitive[] primitives() {
- if (PRIMITIVES == null) {
- PRIMITIVES = buildPrimitives();
- }
- return PRIMITIVES;
- }
-
- /**
- * NB: void.class.isPrimitive() == true
- */
- private static Primitive[] buildPrimitives() {
- Primitive[] result = new Primitive[9];
- result[0] = new Primitive(BYTE_CODE, java.lang.Byte.class);
- result[1] = new Primitive(CHAR_CODE, java.lang.Character.class);
- result[2] = new Primitive(DOUBLE_CODE, java.lang.Double.class);
- result[3] = new Primitive(FLOAT_CODE, java.lang.Float.class);
- result[4] = new Primitive(INT_CODE, java.lang.Integer.class);
- result[5] = new Primitive(LONG_CODE, java.lang.Long.class);
- result[6] = new Primitive(SHORT_CODE, java.lang.Short.class);
- result[7] = new Primitive(BOOLEAN_CODE, java.lang.Boolean.class);
- result[8] = new Primitive(VOID_CODE, java.lang.Void.class);
- return result;
- }
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private ClassTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** member classes **********
-
- private static class Primitive {
- final char code;
- final Class<?> javaClass;
- final Class<?> wrapperClass;
- private static final String WRAPPER_CLASS_TYPE_FIELD_NAME = "TYPE";
- // e.g. java.lang.Boolean.TYPE => boolean.class
- Primitive(char code, Class<?> wrapperClass) {
- this.code = code;
- this.wrapperClass = wrapperClass;
- this.javaClass = (Class<?>) staticFieldValue(wrapperClass, WRAPPER_CLASS_TYPE_FIELD_NAME);
- }
- }
-
- private static class TypeDeclaration {
- final String elementTypeName;
- final int arrayDepth;
- TypeDeclaration(String elementTypeName, int arrayDepth) {
- this.elementTypeName = elementTypeName;
- this.arrayDepth = arrayDepth;
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java
deleted file mode 100644
index b5f840729f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ArrayToolsTests.java
+++ /dev/null
@@ -1,3523 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.Range;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.ReverseComparator;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
-
-@SuppressWarnings("nls")
-public class ArrayToolsTests extends TestCase {
-
- public ArrayToolsTests(String name) {
- super(name);
- }
-
-
- // ********** instantiation **********
-
- public void testNewArrayObjectArray() {
- String[] array1 = new String[2];
- String[] array2 = ArrayTools.newArray(array1);
- array2[0] = "foo";
- array2[1] = "bar";
- assertEquals(String.class, array2.getClass().getComponentType());
- assertEquals(2, array2.length);
- }
-
- public void testNewArrayObjectArrayInt() {
- String[] array1 = new String[2];
- String[] array2 = ArrayTools.newArray(array1, 5);
- array2[0] = "foo";
- array2[4] = "bar";
- assertEquals(String.class, array2.getClass().getComponentType());
- assertEquals(5, array2.length);
- }
-
- public void testNewArrayObjectArrayInt_Exception() {
- String[] array1 = new String[2];
- Object[] array2 = ArrayTools.newArray(array1, 5);
- boolean exCaught = false;
- try {
- array2[1] = Integer.valueOf(7);
- fail("bogus array: " + Arrays.toString(array2));
- } catch (ArrayStoreException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testComponentType() {
- String[] array = new String[2];
- Class<? extends String> javaClass = ArrayTools.componentType(array);
- assertEquals(String.class, javaClass);
- }
-
- public void testNewArrayClassInt() {
- String[] array = ArrayTools.newArray(String.class, 5);
- array[0] = "foo";
- array[4] = "bar";
- assertEquals(String.class, array.getClass().getComponentType());
- assertEquals(5, array.length);
- }
-
- public void testNewArrayClassInt_Exception() {
- Object[] array = ArrayTools.newArray(String.class, 5);
- boolean exCaught = false;
- try {
- array[1] = Integer.valueOf(7);
- fail("bogus array: " + Arrays.toString(array));
- } catch (ArrayStoreException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testNewArrayClassInt_Primitive() {
- boolean exCaught = false;
- try {
- Object[] array = ArrayTools.newArray(int.class, 5);
- fail("bogus array: " + Arrays.toString(array));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- // ********** conversion **********
-
- public void testArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = ArrayTools.array(iterable);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = ArrayTools.array(iterable, 3);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_String() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = ArrayTools.array(iterable, new String[0]);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_Object() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = ArrayTools.array(iterable, new Object[0]);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableIntObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = ArrayTools.array(iterable, 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator() {
- Object[] a = ArrayTools.array(this.buildStringList1().iterator());
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator_Empty() {
- Object[] a = ArrayTools.array(EmptyIterator.instance());
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorInt() {
- Object[] a = ArrayTools.array(this.buildStringList1().iterator(), 3);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorInt_Empty() {
- Object[] a = ArrayTools.array(EmptyIterator.instance(), 3);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_String() {
- String[] a = ArrayTools.array(this.buildStringList1().iterator(), new String[0]);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorObjectArray_Empty() {
- String[] a = ArrayTools.array(EmptyIterator.<String>instance(), new String[0]);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_Empty_ClearArray() {
- String[] a = ArrayTools.array(EmptyIterator.<String>instance(), new String[5]);
- assertEquals(5, a.length);
- assertNull(a[0]);
- }
-
- public void testArrayIteratorObjectArray_Object() {
- Object[] a = ArrayTools.array(this.buildStringList1().iterator(), new Object[0]);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray() {
- String[] a = ArrayTools.array(this.buildStringList1().iterator(), 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(ArrayTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray_Empty() {
- String[] a = ArrayTools.array(EmptyIterator.<String>instance(), 3, new String[0]);
- assertEquals(0, a.length);
- }
-
-
- // ********** add **********
-
- public void testAddObjectArrayObject_Object() {
- Object[] a = ArrayTools.add(this.buildObjectArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(ArrayTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_String() {
- String[] a = ArrayTools.add(this.buildStringArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(ArrayTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_EmptyArray() {
- String[] a = new String[0];
- a = ArrayTools.add(a, "twenty");
- assertEquals(1, a.length);
- assertTrue(ArrayTools.contains(a, "twenty"));
- assertEquals("twenty", a[0]);
- }
-
- public void testAddObjectArrayIntObject_Object() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = ArrayTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject_String() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = ArrayTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "X", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject_End() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = ArrayTools.add(a, 4, "X");
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "c", "d", "X" }, a));
- }
-
- public void testAddObjectArrayIntObject_Zero() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = ArrayTools.add(a, 0, "X");
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "X", "a", "b", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject_Exception() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- boolean exCaught = false;
- try {
- a = ArrayTools.add(a, 33, "X");
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddCharArrayChar() {
- char[] a = ArrayTools.add(this.buildCharArray(), 'd');
- assertEquals(4, a.length);
- assertTrue(ArrayTools.contains(a, 'd'));
- }
-
- public void testAddCharArrayChar_Empty() {
- char[] a = new char[0];
- a = ArrayTools.add(a, 'd');
- assertEquals(1, a.length);
- assertTrue(ArrayTools.contains(a, 'd'));
- assertTrue(Arrays.equals(new char[] { 'd' }, a));
- }
-
- public void testAddCharArrayIntChar() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = ArrayTools.add(a, 2, 'X');
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'c', 'd' }, a));
- }
-
- public void testAddCharArrayIntChar_Zero() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = ArrayTools.add(a, 0, 'X');
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'X', 'a', 'b', 'c', 'd' }, a));
- }
-
- public void testAddCharArrayIntChar_End() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = ArrayTools.add(a, 4, 'X');
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'X' }, a));
- }
-
- public void testAddIntArrayInt() {
- int[] a = ArrayTools.add(this.buildIntArray(), 30);
- assertEquals(4, a.length);
- assertTrue(ArrayTools.contains(a, 30));
- }
-
- public void testAddIntArrayInt_Empty() {
- int[] a = new int[0];
- a = ArrayTools.add(a, 30);
- assertEquals(1, a.length);
- assertTrue(ArrayTools.contains(a, 30));
- assertTrue(Arrays.equals(new int[] { 30 }, a));
- }
-
- public void testAddIntArrayIntInt() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = ArrayTools.add(a, 2, 99);
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 99, 3, 4 }, a));
- }
-
- public void testAddIntArrayIntInt_Zero() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = ArrayTools.add(a, 0, 99);
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 99, 1, 2, 3, 4 }, a));
- }
-
- public void testAddIntArrayIntInt_End() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = ArrayTools.add(a, 4, 99);
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 99 }, a));
- }
-
-
- // ********** add all **********
-
- public void testAddAllObjectArrayCollection_String() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_Object() {
- Object[] a = this.buildObjectArray1();
- Collection<String> c = this.buildStringList2();
- Object[] newArray = ArrayTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = ArrayTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntCollection_String() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, 1, c);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_String_End() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, 3, c);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, 0, c);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyArray_Exception() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- boolean exCaught = false;
- try {
- String[] newArray = ArrayTools.addAll(a, 3, c);
- fail("bogus array: " + Arrays.toString(newArray));
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = ArrayTools.addAll(a, 1, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterable_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, 1, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, 0, iterable);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = ArrayTools.addAll(a, 1, iterable);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterableInt_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, 1, iterable, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = ArrayTools.addAll(a, 0, iterable, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = ArrayTools.addAll(a, 1, iterable, 0);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterator_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = ArrayTools.addAll(a, 1, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = ArrayTools.addAll(a, 0, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = ArrayTools.addAll(a, 1, iterator);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIteratorInt_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = ArrayTools.addAll(a, 1, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = ArrayTools.addAll(a, 0, iterator, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = ArrayTools.addAll(a, 1, iterator, 0);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = ArrayTools.addAll(a, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterableInt() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = ArrayTools.addAll(a, iterable, 33);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList1().iterator();
- String[] newArray = ArrayTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_Object() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = ArrayTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIterator_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = ArrayTools.addAll(a, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = ArrayTools.addAll(a, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = ArrayTools.addAll(a, iterator, 0);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayObjectArray_Object() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = ArrayTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, a1));
- assertTrue(ArrayTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_String() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = this.buildStringArray2();
- String[] newArray = ArrayTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, (Object[]) a1));
- assertTrue(ArrayTools.containsAll(newArray, (Object[]) a2));
- }
-
- public void testAddAllObjectArrayObjectArray_ObjectString() {
- Object[] a1 = this.buildObjectArray1();
- String[] a2 = this.buildStringArray2();
- Object[] newArray = ArrayTools.addAll(a1, (Object[]) a2);
-
- assertEquals(6, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, a1));
- assertTrue(ArrayTools.containsAll(newArray, (Object[]) a2));
- }
-
- public void testAddAllObjectArrayObjectArray_EmptyArray1() {
- Object[] a1 = new Object[0];
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = ArrayTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_EmptyArray2() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = new Object[0];
- Object[] newArray = ArrayTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(ArrayTools.containsAll(newArray, a1));
- }
-
- public void testAddAllObjectArrayIntObjectArray_Object() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = ArrayTools.addAll(a, 2, new Object[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_String() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = ArrayTools.addAll(a, 2, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_ObjectString() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = ArrayTools.addAll(a, 2, (Object[]) new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_End() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = ArrayTools.addAll(a, 4, (Object[]) new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d", "X", "X", "X" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_Zero() {
- Object[] a = new Object[0];
- a = ArrayTools.addAll(a, 0, (Object[]) new String[] { "X", "X", "X" });
- assertEquals(3, a.length);
- assertTrue(ArrayTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_EmptyArray2() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = ArrayTools.addAll(a, 4, (Object[]) new String[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_EmptyArray1() {
- Object[] a = new String[0];
- a = ArrayTools.addAll(a, 0, new Object[] { "a", "b", "c", "d" });
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d" }, a));
- }
-
- public void testAddAllCharArrayCharArray() {
- char[] a = ArrayTools.addAll(this.buildCharArray(), new char[] { 'd', 'e' });
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 'd'));
- assertTrue(ArrayTools.contains(a, 'e'));
- }
-
- public void testAddAllCharArrayCharArray_EmptyArray2() {
- char[] a = ArrayTools.addAll(this.buildCharArray(), new char[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllCharArrayCharArrayEmptyArray1() {
- char[] a = ArrayTools.addAll(new char[0], new char[] { 'd', 'e' });
- assertEquals(2, a.length);
- assertTrue(ArrayTools.contains(a, 'd'));
- assertTrue(ArrayTools.contains(a, 'e'));
- }
-
- public void testAddAllCharArrayIntCharArray() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = ArrayTools.addAll(a, 2, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'X', 'X', 'c', 'd' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_End() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = ArrayTools.addAll(a, 4, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'X', 'X', 'X' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_EmptyArray1() {
- char[] a = new char[0];
- a = ArrayTools.addAll(a, 0, new char[] { 'X', 'X', 'X' });
- assertEquals(3, a.length);
- assertTrue(ArrayTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'X', 'X', 'X' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_EmptyArray2() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = ArrayTools.addAll(a, 2, new char[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd' }, a));
- }
-
- public void testAddAllIntArrayIntArray() {
- int[] a = ArrayTools.addAll(this.buildIntArray(), new int[] { 30, 40 });
- assertEquals(5, a.length);
- assertTrue(ArrayTools.contains(a, 30));
- assertTrue(ArrayTools.contains(a, 40));
- }
-
- public void testAddAllIntArrayIntArray_EmptyArray2() {
- int[] a = ArrayTools.addAll(this.buildIntArray(), new int[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllIntArrayIntArray_EmptyArray1() {
- int[] a = ArrayTools.addAll(new int[0], new int[] { 30, 40 });
- assertEquals(2, a.length);
- assertTrue(ArrayTools.contains(a, 30));
- assertTrue(ArrayTools.contains(a, 40));
- }
-
- public void testAddAllIntArrayIntIntArray() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = ArrayTools.addAll(a, 2, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 99, 99, 99, 3, 4 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_End() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = ArrayTools.addAll(a, 4, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(ArrayTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 99, 99, 99 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_EmptyArray2() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = ArrayTools.addAll(a, 2, new int[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_EmptyArray1() {
- int[] a = new int[0];
- a = ArrayTools.addAll(a, 0, new int[] { 99, 99, 99 });
- assertEquals(3, a.length);
- assertTrue(ArrayTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 99, 99, 99 }, a));
- }
-
-
- // ********** clear **********
-
- public void testClearObjectArray() {
- String[] a = this.buildStringArray1();
- assertEquals(3, a.length);
- a = ArrayTools.clear(a);
- assertEquals(0, a.length);
- }
-
- public void testClearObjectArray_Empty() {
- String[] a = new String[0];
- assertEquals(0, a.length);
- a = ArrayTools.clear(a);
- assertEquals(0, a.length);
- }
-
-
- // ********** concatenate **********
-
- public void testConcatenateObjectArrayArray() {
- String[] aArray = new String[] { "a", "b", "c", "d" };
- String[] eArray = new String[] { "e", "f", "g", "h" };
- String[] iArray = new String[] { "i", "j", "k", "l" };
-
- String[] expected = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l" };
- String[] actual = ArrayTools.concatenate(aArray, eArray, iArray);
- assertTrue(Arrays.equals(expected, actual));
- }
-
- public void testConcatenateObjectArrayArray_Empty() {
- String[] aArray = new String[] { };
- String[] eArray = new String[0];
- String[] iArray = new String[0];
-
- String[] expected = new String[0];
- String[] actual = ArrayTools.concatenate(aArray, eArray, iArray);
- assertEquals(0, actual.length);
- assertTrue(Arrays.equals(expected, actual));
- }
-
- public void testConcatenateCharArrayArray() {
- char[] aArray = new char[] { 'a', 'b', 'c', 'd' };
- char[] eArray = new char[] { 'e', 'f', 'g', 'h' };
- char[] iArray = new char[] { 'i', 'j', 'k', 'l' };
-
- char[] expected = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l' };
- char[] actual = ArrayTools.concatenate(aArray, eArray, iArray);
- assertTrue(Arrays.equals(expected, actual));
- }
-
- public void testConcatenateCharArrayArray_Empty() {
- char[] aArray = new char[] { };
- char[] eArray = new char[0];
- char[] iArray = new char[0];
-
- char[] expected = new char[0];
- char[] actual = ArrayTools.concatenate(aArray, eArray, iArray);
- assertEquals(0, actual.length);
- assertTrue(Arrays.equals(expected, actual));
- }
-
- public void testConcatenateIntArrayArray() {
- int[] aArray = new int[] { 'a', 'b', 'c', 'd' };
- int[] eArray = new int[] { 'e', 'f', 'g', 'h' };
- int[] iArray = new int[] { 'i', 'j', 'k', 'l' };
-
- int[] expected = new int[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l' };
- int[] actual = ArrayTools.concatenate(aArray, eArray, iArray);
- assertTrue(Arrays.equals(expected, actual));
- }
-
- public void testConcatenateIntArrayArray_Empty() {
- int[] aArray = new int[] { };
- int[] eArray = new int[0];
- int[] iArray = new int[0];
-
- int[] expected = new int[0];
- int[] actual = ArrayTools.concatenate(aArray, eArray, iArray);
- assertEquals(0, actual.length);
- assertTrue(Arrays.equals(expected, actual));
- }
-
-
- // ********** contains **********
-
- public void testContainsObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertTrue(ArrayTools.contains(a, "one"));
- assertFalse(ArrayTools.contains(a, null));
- Object[] a2 = ArrayTools.add(a, null);
- assertTrue(ArrayTools.contains(a2, null));
- }
-
- public void testContainsObjectArrayObject_EmptyArray() {
- Object[] a = new Object[0];
- assertFalse(ArrayTools.contains(a, "one"));
- assertFalse(ArrayTools.contains(a, null));
- }
-
- public void testContainsCharArrayChar() {
- char[] a = this.buildCharArray();
- assertTrue(ArrayTools.contains(a, 'a'));
- assertFalse(ArrayTools.contains(a, 'z'));
- char[] a2 = ArrayTools.add(a, 'z');
- assertTrue(ArrayTools.contains(a2, 'z'));
- }
-
- public void testContainsCharArrayObject_EmptyArray() {
- char[] a = new char[0];
- assertFalse(ArrayTools.contains(a, 'a'));
- }
-
- public void testContainsIntArrayInt() {
- int[] a = this.buildIntArray();
- assertTrue(ArrayTools.contains(a, 10));
- assertFalse(ArrayTools.contains(a, 55));
- int[] a2 = ArrayTools.add(a, 55);
- assertTrue(ArrayTools.contains(a2, 55));
- }
-
- public void testContainsIntArrayObject_EmptyArray() {
- int[] a = new int[0];
- assertFalse(ArrayTools.contains(a, 'a'));
- }
-
-
- // ********** contains all **********
-
- public void testContainsAllObjectArrayCollection() {
- assertTrue(ArrayTools.containsAll(this.buildObjectArray1(), this.buildStringList1()));
- assertFalse(ArrayTools.containsAll(this.buildObjectArray1(), this.buildStringList2()));
- }
-
- public void testContainsAllObjectArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(ArrayTools.containsAll(this.buildObjectArray1(), iterable));
- iterable = this.buildStringList2();
- assertFalse(ArrayTools.containsAll(this.buildObjectArray1(), iterable));
- }
-
- public void testContainsAllObjectArrayIterator() {
- assertTrue(ArrayTools.containsAll(this.buildObjectArray1(), this.buildStringList1().iterator()));
- assertFalse(ArrayTools.containsAll(this.buildObjectArray1(), this.buildStringList2().iterator()));
- }
-
- public void testContainsAllObjectArrayIterator_Empty() {
- assertTrue(ArrayTools.containsAll(this.buildObjectArray1(), EmptyIterator.instance()));
- }
-
- public void testContainsAllObjectArrayObjectArray() {
- assertTrue(ArrayTools.containsAll(this.buildObjectArray1(), this.buildObjectArray1()));
- assertFalse(ArrayTools.containsAll(this.buildObjectArray1(), this.buildObjectArray2()));
- }
-
- public void testContainsAllCharArrayCharArray() {
- assertTrue(ArrayTools.containsAll(this.buildCharArray(), this.buildCharArray()));
- assertFalse(ArrayTools.containsAll(this.buildCharArray(), new char[] { 'x', 'y' }));
- }
-
- public void testContainsAllIntArrayIntArray() {
- assertTrue(ArrayTools.containsAll(this.buildIntArray(), this.buildIntArray()));
- assertFalse(ArrayTools.containsAll(this.buildIntArray(), new int[] { 444, 888 }));
- }
-
-
- // ********** diff **********
-
- public void testDiffEnd() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = new String("a");
- String b_ = new String("b");
- String c_ = new String("c");
- String d_ = new String("d");
- String e_ = new String("e");
- assertTrue((a != a_) && a.equals(a_));
- assertTrue((b != b_) && b.equals(b_));
- assertTrue((c != c_) && c.equals(c_));
- assertTrue((d != d_) && d.equals(d_));
- assertTrue((e != e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(-1, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, ArrayTools.diffEnd(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(-1, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, ArrayTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, ArrayTools.diffEnd(array1, array2));
- }
-
- public void testDiffRange() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(5, -1), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), ArrayTools.diffRange(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(new Range(5, -1), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), ArrayTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), ArrayTools.diffRange(array1, array2));
- }
-
- public void testDiffStart() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = new String("a");
- String b_ = new String("b");
- String c_ = new String("c");
- String d_ = new String("d");
- String e_ = new String("e");
- assertTrue((a != a_) && a.equals(a_));
- assertTrue((b != b_) && b.equals(b_));
- assertTrue((c != c_) && c.equals(c_));
- assertTrue((d != d_) && d.equals(d_));
- assertTrue((e != e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(5, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, ArrayTools.diffStart(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c__));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(5, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, ArrayTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, ArrayTools.diffStart(array1, array2));
- }
-
-
- // ********** identity diff **********
-
- public void testIdentityDiffEnd() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(-1, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, ArrayTools.identityDiffEnd(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(2, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, ArrayTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, ArrayTools.identityDiffEnd(array1, array2));
- }
-
- public void testIdentityDiffRange() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(5, -1), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), ArrayTools.identityDiffRange(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(new Range(2, 2), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), ArrayTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), ArrayTools.identityDiffRange(array1, array2));
- }
-
- public void testIdentityDiffStart() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(5, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, ArrayTools.identityDiffStart(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(2, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, ArrayTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, ArrayTools.identityDiffStart(array1, array2));
- }
-
-
- // ********** elements are identical **********
-
- public void testElementsAreIdenticalObjectArrayObjectArray() {
- Object[] a1 = new Object[4];
- for (int i = 0; i < a1.length; i++) {
- a1[i] = String.valueOf(i * 1000);
- }
-
- Object[] a2 = new Object[a1.length];
- for (int i = 0; i < a2.length; i++) {
- a2[i] = a1[i];
- }
-
- assertTrue(ArrayTools.elementsAreIdentical(a1, a2));
- a2[2] = "2000";
- assertFalse(ArrayTools.elementsAreIdentical(a1, a2));
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testElementsAreIdenticalObjectArrayObjectArray_BothNull() {
- Object[] a1 = null;
- Object[] a2 = null;
- assertTrue(ArrayTools.elementsAreIdentical(a1, a2));
- }
-
- public void testElementsAreIdenticalObjectArrayObjectArray_OneNull() {
- Object[] a1 = null;
- Object[] a2 = new Object[0];
- assertFalse(ArrayTools.elementsAreIdentical(a1, a2));
- }
-
- public void testElementsAreIdenticalObjectArrayObjectArray_DifferentLengths() {
- Object[] a1 = new String[] {"foo", "bar"};
- Object[] a2 = new String[] {"foo", "bar", "baz"};
- assertFalse(ArrayTools.elementsAreIdentical(a1, a2));
- }
-
-
- // ********** index of **********
-
- public void testIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, ArrayTools.indexOf(a, "one"));
- }
-
- public void testIndexOfObjectArrayObject_NotFound() {
- Object[] a = this.buildObjectArray1();
- assertEquals(-1, ArrayTools.indexOf(a, "twenty"));
- }
-
- public void testIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- a = ArrayTools.add(a, null);
- assertEquals(a.length - 1, ArrayTools.indexOf(a, null));
- }
-
- public void testIndexOfObjectArrayObject_Null_NotFound() {
- Object[] a = this.buildObjectArray1();
- assertEquals(-1, ArrayTools.indexOf(a, null));
- }
-
- public void testIdentityIndexOfObjectArrayObject() {
- String foo = "foo";
- String bar = "bar";
- String baz = "baz";
- Object[] a = new Object[3];
- a[0] = foo;
- a[1] = bar;
- a[2] = baz;
- assertEquals(1, ArrayTools.identityIndexOf(a, bar));
- }
-
- public void testIdentityIndexOfObjectArrayObject_NotFound() {
- String foo = "foo";
- String bar = "bar";
- String baz = "baz";
- Object[] a = new Object[3];
- a[0] = foo;
- a[1] = bar;
- a[2] = baz;
- assertEquals(-1, ArrayTools.identityIndexOf(a, new String("bar")));
- }
-
- public void testIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, ArrayTools.indexOf(a, 'b'));
- a = ArrayTools.add(a, 'd');
- assertEquals(a.length - 1, ArrayTools.indexOf(a, 'd'));
- }
-
- public void testIndexOfCharArrayChar_NotFound() {
- char[] a = this.buildCharArray();
- assertEquals(-1, ArrayTools.indexOf(a, 'z'));
- }
-
- public void testIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, ArrayTools.indexOf(a, 10));
- a = ArrayTools.add(a, 30);
- assertEquals(a.length - 1, ArrayTools.indexOf(a, 30));
- }
-
- public void testIndexOfIntArrayInt_NotFound() {
- int[] a = this.buildIntArray();
- assertEquals(-1, ArrayTools.indexOf(a, 1000));
- }
-
-
- // ********** insertion index of **********
-
- public void testInsertionIndexOfObjectArrayComparable() {
- String[] a = new String[] { "A", "C", "D" };
- assertEquals(1, ArrayTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "C", "D" };
- assertEquals(2, ArrayTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(4, ArrayTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(6, ArrayTools.insertionIndexOf(a, "E"));
-
- a = new String[] { "B", "B", "B", "C", "D" };
- assertEquals(0, ArrayTools.insertionIndexOf(a, "A"));
-
- a = new String[] { "A", "A", "B", "B", "C", "D" };
- assertEquals(2, ArrayTools.insertionIndexOf(a, "A"));
- }
-
- public void testInsertionIndexOfObjectArrayObjectComparator() {
- Comparator<String> c = new ReverseComparator<String>();
- String[] a = new String[] { "D", "C", "A" };
- assertEquals(2, ArrayTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "A" };
- assertEquals(3, ArrayTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(5, ArrayTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(0, ArrayTools.insertionIndexOf(a, "E", c));
-
- a = new String[] { "D", "C", "B", "B", "B" };
- assertEquals(5, ArrayTools.insertionIndexOf(a, "A", c));
-
- a = new String[] { "D", "C", "B", "B", "A", "A" };
- assertEquals(6, ArrayTools.insertionIndexOf(a, "A", c));
- }
-
-
- // ********** last index of **********
-
- public void testLastIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, ArrayTools.lastIndexOf(a, "one"));
- }
-
- public void testLastIndexOfObjectArrayObject_NotFound() {
- Object[] a = this.buildObjectArray1();
- assertEquals(-1, ArrayTools.lastIndexOf(a, "twenty"));
- }
-
- public void testLastIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- a = ArrayTools.add(a, null);
- assertEquals(a.length - 1, ArrayTools.lastIndexOf(a, null));
- }
-
- public void testLastIndexOfObjectArrayObject_Null_NotFound() {
- Object[] a = this.buildObjectArray1();
- assertEquals(-1, ArrayTools.lastIndexOf(a, null));
- }
-
- public void testLastIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, ArrayTools.lastIndexOf(a, 'b'));
- a = ArrayTools.add(a, 'd');
- assertEquals(a.length - 1, ArrayTools.lastIndexOf(a, 'd'));
- }
-
- public void testLastIndexOfCharArrayChar_NotFound() {
- char[] a = this.buildCharArray();
- assertEquals(-1, ArrayTools.lastIndexOf(a, 'z'));
- }
-
- public void testLastIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, ArrayTools.lastIndexOf(a, 10));
- a = ArrayTools.add(a, 30);
- assertEquals(a.length - 1, ArrayTools.lastIndexOf(a, 30));
- }
-
- public void testLastIndexOfIntArrayInt_NotFound() {
- int[] a = this.buildIntArray();
- assertEquals(-1, ArrayTools.lastIndexOf(a, 1000));
- }
-
-
- // ********** min/max **********
-
- public void testMinCharArray() {
- assertEquals('a', ArrayTools.min(this.buildCharArray()));
- }
-
- public void testMinCharArray_Exception() {
- char[] array = new char[0];
- boolean exCaught = false;
- try {
- char c = ArrayTools.min(array);
- fail("bogus char: " + c);
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testMinIntArray() {
- assertEquals(0, ArrayTools.min(this.buildIntArray()));
- }
-
- public void testMinIntArray_Exception() {
- int[] array = new int[0];
- boolean exCaught = false;
- try {
- int i = ArrayTools.min(array);
- fail("bogus int: " + i);
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testMaxCharArray1() {
- assertEquals('c', ArrayTools.max(this.buildCharArray()));
- }
-
- public void testMaxCharArray2() {
- char[] array = new char[] { 'x', 'a', 'b', 'c' };
- assertEquals('x', ArrayTools.max(array));
- }
-
- public void testMaxCharArray_Exception() {
- char[] array = new char[0];
- boolean exCaught = false;
- try {
- char c = ArrayTools.max(array);
- fail("bogus char: " + c);
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testMaxIntArray1() {
- assertEquals(20, ArrayTools.max(this.buildIntArray()));
- }
-
- public void testMaxIntArray2() {
- int[] array = new int[] { 77, 3, 1, -3 };
- assertEquals(77, ArrayTools.max(array));
- }
-
- public void testMaxIntArray_Exception() {
- int[] array = new int[0];
- boolean exCaught = false;
- try {
- int i = ArrayTools.max(array);
- fail("bogus int: " + i);
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- // ********** move **********
-
- public void testMoveObjectArrayIntInt() {
- String[] array = new String[] { "0", "1", "2", "3", "4", "5" };
-
- String[] result = ArrayTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result));
-
- result = ArrayTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result));
-
- result = ArrayTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
-
- result = ArrayTools.move(array, 4, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
- }
-
- public void testMoveObjectArrayIntIntInt() {
- String[] array = new String[] { "0", "1", "2", "3", "4", "5" };
-
- String[] result = ArrayTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result));
-
- result = ArrayTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result));
-
- result = ArrayTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
-
- result = ArrayTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = ArrayTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result));
-
- result = ArrayTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = ArrayTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = ArrayTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
- }
-
- public void testMoveIntArrayIntInt() {
- int[] array = new int[] { 0, 1, 2, 3, 4, 5 };
-
- int[] result = ArrayTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 1, 3, 4, 2, 5 }, result));
-
- result = ArrayTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 1, 3, 4, 2 }, result));
-
- result = ArrayTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
-
- result = ArrayTools.move(array, 2, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
- }
-
- public void testMoveIntArrayIntIntInt() {
- int[] array = new int[] { 0, 1, 2, 3, 4, 5 };
-
- int[] result = ArrayTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 1, 3, 4, 2, 5 }, result));
-
- result = ArrayTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 1, 3, 4, 2 }, result));
-
- result = ArrayTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
-
- result = ArrayTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = ArrayTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 3, 2, 4, 5, 1 }, result));
-
- result = ArrayTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = ArrayTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = ArrayTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
- }
-
- public void testMoveCharArrayIntInt() {
- char[] array = new char[] { 'a', 'b', 'c', 'd', 'e', 'f' };
-
- char[] result = ArrayTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'd', 'e', 'c', 'f' }, result));
-
- result = ArrayTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'b', 'd', 'e', 'c' }, result));
-
- result = ArrayTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'e', 'b', 'd', 'c' }, result));
-
- result = ArrayTools.move(array, 2, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'e', 'b', 'd', 'c' }, result));
- }
-
- public void testMoveCharArrayIntIntInt() {
- char[] array = new char[] { 'a', 'b', 'b', 'c', 'd', 'e' };
-
- char[] result = ArrayTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'b', 'e' }, result));
-
- result = ArrayTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'b', 'c', 'd', 'b' }, result));
-
- result = ArrayTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'd', 'b', 'c', 'b' }, result));
-
- result = ArrayTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = ArrayTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'c', 'b', 'd', 'e', 'b' }, result));
-
- result = ArrayTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = ArrayTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = ArrayTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
- }
-
-
- // ********** remove **********
-
- public void testRemoveObjectArrayObject_Object() {
- Object[] a = this.buildObjectArray1();
- a = ArrayTools.add(a, "three");
- a = ArrayTools.add(a, "four");
- a = ArrayTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(ArrayTools.contains(a, "three"));
- a = ArrayTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(ArrayTools.contains(a, "three"));
- assertTrue(ArrayTools.contains(a, "four"));
- assertTrue(ArrayTools.contains(a, "five"));
- }
-
- public void testRemoveObjectArrayObject_String() {
- String[] a = this.buildStringArray1();
- a = ArrayTools.add(a, "three");
- a = ArrayTools.add(a, "four");
- a = ArrayTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(ArrayTools.contains(a, "three"));
- a = ArrayTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(ArrayTools.contains(a, "three"));
- assertTrue(ArrayTools.contains(a, "four"));
- assertTrue(ArrayTools.contains(a, "five"));
- }
-
- public void testRemoveCharArrayChar() {
- char[] a = this.buildCharArray();
- a = ArrayTools.add(a, 'd');
- a = ArrayTools.add(a, 'e');
- a = ArrayTools.add(a, 'f');
-
- assertEquals(6, a.length);
- assertTrue(ArrayTools.contains(a, 'd'));
- a = ArrayTools.remove(a, 'd');
- assertEquals(5, a.length);
- assertFalse(ArrayTools.contains(a, 'd'));
- assertTrue(ArrayTools.contains(a, 'e'));
- assertTrue(ArrayTools.contains(a, 'f'));
- }
-
- public void testRemoveIntArrayInt() {
- int[] a = this.buildIntArray();
- a = ArrayTools.add(a, 30);
- a = ArrayTools.add(a, 40);
- a = ArrayTools.add(a, 50);
-
- assertEquals(6, a.length);
- assertTrue(ArrayTools.contains(a, 30));
- a = ArrayTools.remove(a, 30);
- assertEquals(5, a.length);
- assertFalse(ArrayTools.contains(a, 30));
- assertTrue(ArrayTools.contains(a, 40));
- assertTrue(ArrayTools.contains(a, 50));
- }
-
-
- // ********** remove all **********
-
- public void testRemoveAllObjectArrayObjectArray() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[] { "E", "B" };
- String[] a3 = ArrayTools.removeAll(a1, (Object[]) a2);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayObjectArray_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[0];
- String[] a3 = ArrayTools.removeAll(a1, (Object[]) a2);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayObjectArray_NoMatches() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[] { "X", "Y", "Z" };
- String[] a3 = ArrayTools.removeAll(a1, (Object[]) a2);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayIterable() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = ArrayTools.removeAll(a1, iterable);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIterableInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = ArrayTools.removeAll(a1, iterable, 7);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = ArrayTools.removeAll(a1, iterable.iterator());
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIterator_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a3 = ArrayTools.removeAll(a1, EmptyIterator.instance());
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayIteratorInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = ArrayTools.removeAll(a1, iterable.iterator(), 7);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIteratorInt_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a3 = ArrayTools.removeAll(a1, EmptyIterator.instance(), 7);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = ArrayTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayCollection_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = new ArrayList<String>();
- String[] a3 = ArrayTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayCollection_EmptyArray() {
- String[] a1 = new String[0];
- Collection<String> collection = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = ArrayTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, a3));
- assertEquals(0, a3.length);
- }
-
- public void testRemoveAllObjectArrayCollection_NoMatches() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "X", "Y", "Z" });
- String[] a3 = ArrayTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllCharArrayCharArray() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'E', 'B' };
- assertTrue(Arrays.equals(new char[] { 'A', 'A', 'C', 'C', 'D', 'D', 'F', 'F' }, ArrayTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllCharArrayCharArray_Empty1() {
- char[] a1 = new char[0];
- char[] a2 = new char[] { 'E', 'B' };
- assertTrue(Arrays.equals(a1, ArrayTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllCharArrayCharArray_Empty2() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[0];
- assertTrue(Arrays.equals(a1, ArrayTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllCharArrayCharArray_NoMatches() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'X', 'Z' };
- assertTrue(Arrays.equals(a1, ArrayTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 5, 2 };
- assertTrue(Arrays.equals(new int[] { 1, 1, 3, 3, 4, 4, 6, 6 }, ArrayTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray_Empty1() {
- int[] a1 = new int[0];
- int[] a2 = new int[] { 5, 2 };
- assertTrue(Arrays.equals(a1, ArrayTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray_Empty2() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[0];
- assertTrue(Arrays.equals(a1, ArrayTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray_NoMatches() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 52, 67 };
- assertTrue(Arrays.equals(a1, ArrayTools.removeAll(a1, a2)));
- }
-
-
- // ********** remove all occurrences **********
-
- public void testRemoveAllOccurrencesObjectArrayObject() {
- String[] a = this.buildStringArray1();
- assertEquals(3, a.length);
- a = ArrayTools.removeAllOccurrences(a, "three");
- assertEquals(3, a.length);
- a = ArrayTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
- a = ArrayTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
-
- a = ArrayTools.add(a, "five");
- a = ArrayTools.add(a, "five");
- a = ArrayTools.add(a, "five");
- assertEquals(5, a.length);
- a = ArrayTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
- a = ArrayTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
-
- a = ArrayTools.add(a, null);
- a = ArrayTools.add(a, null);
- a = ArrayTools.add(a, null);
- assertEquals(5, a.length);
- a = ArrayTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- a = ArrayTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesObjectArrayObject_Empty() {
- String[] a = new String[0];
- a = ArrayTools.removeAllOccurrences(a, "three");
- assertEquals(0, a.length);
- }
-
- public void testRemoveAllOccurrencesCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(3, a.length);
- a = ArrayTools.removeAllOccurrences(a, 'd');
- assertEquals(3, a.length);
- a = ArrayTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
- a = ArrayTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
-
- a = ArrayTools.add(a, 'g');
- a = ArrayTools.add(a, 'g');
- a = ArrayTools.add(a, 'g');
- assertEquals(5, a.length);
- a = ArrayTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- a = ArrayTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesCharArrayChar_Empty() {
- char[] a = new char[0];
- a = ArrayTools.removeAllOccurrences(a, 'a');
- assertEquals(0, a.length);
- }
-
- public void testRemoveAllOccurrencesIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(3, a.length);
- a = ArrayTools.removeAllOccurrences(a, 55);
- assertEquals(3, a.length);
- a = ArrayTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
- a = ArrayTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
-
- a = ArrayTools.add(a, 77);
- a = ArrayTools.add(a, 77);
- a = ArrayTools.add(a, 77);
- assertEquals(5, a.length);
- a = ArrayTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- a = ArrayTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesIntArrayInt_Empty() {
- int[] a = new int[0];
- a = ArrayTools.removeAllOccurrences(a, 22);
- assertEquals(0, a.length);
- }
-
-
- // ********** remove duplicate elements **********
-
- public void testRemoveDuplicateElementsObjectArray() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- String[] array = ArrayTools.removeDuplicateElements(list.toArray(new String[list.size()]));
- int i = 0;
- assertEquals("zero", array[i++]);
- assertEquals("one", array[i++]);
- assertEquals("two", array[i++]);
- assertEquals(i, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray_Empty() {
- String[] array = ArrayTools.removeDuplicateElements(new String[0]);
- assertEquals(0, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray_SingleElement() {
- String[] array = ArrayTools.removeDuplicateElements(new String[] { "foo" });
- assertEquals(1, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray_NoDuplicates() {
- String[] a1 = new String[] { "foo", "bar", "baz" };
- String[] a2 = ArrayTools.removeDuplicateElements(a1);
- assertEquals(3, a2.length);
- assertTrue(Arrays.equals(a1, a2));
- }
-
-
- // ********** remove element at index **********
-
- public void testRemoveElementAtIndexObjectArrayInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = ArrayTools.removeElementAtIndex(a, 3);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "A", "D" }, a));
- }
-
- public void testRemoveElementAtIndexCharArrayInt() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = ArrayTools.removeElementAtIndex(a, 3);
- assertTrue(Arrays.equals(new char[] { 'A', 'B', 'A', 'A', 'D' }, a));
- }
-
- public void testRemoveElementAtIndexIntArrayInt() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = ArrayTools.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- public void testRemoveFirstObjectArray() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = ArrayTools.removeFirst(a);
- assertTrue(Arrays.equals(new String[] { "B", "A", "C", "A", "D" }, a));
- }
-
- public void testRemoveFirstCharArray() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = ArrayTools.removeFirst(a);
- assertTrue(Arrays.equals(new char[] { 'B', 'A', 'C', 'A', 'D' }, a));
- }
-
- public void testRemoveFirstIntArray() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = ArrayTools.removeFirst(a);
- assertTrue(Arrays.equals(new int[] { 6, 7, 33, 2, 11 }, a));
- }
-
- public void testRemoveLastObjectArray() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = ArrayTools.removeLast(a);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "C", "A" }, a));
- }
-
- public void testRemoveLastCharArray() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = ArrayTools.removeLast(a);
- assertTrue(Arrays.equals(new char[] { 'A', 'B', 'A', 'C', 'A' }, a));
- }
-
- public void testRemoveLastIntArray() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = ArrayTools.removeLast(a);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7, 33, 2 }, a));
- }
-
-
- // ********** remove elements at index **********
-
- public void testRemoveElementsAtIndexObjectArrayIntInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = ArrayTools.removeElementsAtIndex(a, 3, 2);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "D" }, a));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt_ZeroLength() {
- String[] a1 = new String[] { "A", "B", "A", "C", "A", "D" };
- String[] a2 = ArrayTools.removeElementsAtIndex(a1, 3, 0);
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt_Empty() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = ArrayTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = ArrayTools.removeElementsAtIndex(a, 0, 5);
- assertTrue(Arrays.equals(new char[] { 'D' }, a));
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt_ZeroLength() {
- char[] a1 = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- char[] a2 = ArrayTools.removeElementsAtIndex(a1, 3, 0);
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt_Empty() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = ArrayTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = ArrayTools.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt_ZeroLength() {
- int[] a1 = new int[] { 8, 6, 7, 33, 2, 11 };
- int[] a2 = ArrayTools.removeElementsAtIndex(a1, 3, 0);
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt_Empty() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = ArrayTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
-
- // ********** replace all **********
-
- public void testReplaceAllObjectArrayObjectObject_Object() {
- Object[] a = new Object[] { "A", "B", "A", "C", "A", "D" };
- a = ArrayTools.replaceAll(a, "A", "Z");
- assertTrue(Arrays.equals(new Object[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllObjectArrayObjectObject_String() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = ArrayTools.replaceAll(a, "A", "Z");
- assertTrue(Arrays.equals(new String[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllObjectArrayObjectObject_Null() {
- String[] a = new String[] { null, "B", null, "C", null, "D" };
- a = ArrayTools.replaceAll(a, null, "Z");
- assertTrue(Arrays.equals(new String[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllCharArrayCharChar() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = ArrayTools.replaceAll(a, 'A', 'Z');
- assertTrue(Arrays.equals(new char[] { 'Z', 'B', 'Z', 'C', 'Z', 'D' }, a));
- }
-
- public void testReplaceAllIntArrayIntInt() {
- int[] a = new int[] { 0, 1, 0, 7, 0, 99 };
- a = ArrayTools.replaceAll(a, 0, 13);
- assertTrue(Arrays.equals(new int[] { 13, 1, 13, 7, 13, 99 }, a));
- }
-
-
- // ********** retain all **********
-
- public void testRetainAllObjectArrayObjectArray() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Object[] a2 = new Object[] { "E", "B", new Integer(7) };
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, ArrayTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllObjectArrayObjectArray_EmptyObjectArray1() {
- String[] a1 = new String[0];
- String[] a2 = new String[] { "E", "B", "" };
- String[] a3 = ArrayTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_EmptyObjectArray2() {
- String[] a1 = new String[] { "E", "B", "" };
- String[] a2 = new String[0];
- String[] a3 = ArrayTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_BothEmpty() {
- String[] a1 = new String[0];
- String[] a2 = new String[0];
- String[] a3 = ArrayTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterable() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, ArrayTools.retainAll(a1, iterable)));
- }
-
- public void testRetainAllObjectArrayIterable_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = ArrayTools.retainAll(a1, iterable);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterableInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, ArrayTools.retainAll(a1, iterable, 3)));
- }
-
- public void testRetainAllObjectArrayIterableInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = ArrayTools.retainAll(a1, iterable, 3);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, ArrayTools.retainAll(a1, iterator)));
- }
-
- public void testRetainAllObjectArrayIterator_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = ArrayTools.retainAll(a1, iterator);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterator_EmptyIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- assertTrue(Arrays.equals(new String[0], ArrayTools.retainAll(a1, EmptyIterator.instance())));
- }
-
- public void testRetainAllObjectArrayIteratorInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, ArrayTools.retainAll(a1, iterator, 3)));
- }
-
- public void testRetainAllObjectArrayIteratorInt_EmptyIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- assertTrue(Arrays.equals(new String[0], ArrayTools.retainAll(a1, EmptyIterator.instance(), 3)));
- }
-
- public void testRetainAllObjectArrayIteratorInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = ArrayTools.retainAll(a1, iterator, 3);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, ArrayTools.retainAll(a1, collection)));
- }
-
- public void testRetainAllObjectArrayCollection_EmptyObjectArray() {
- String[] a1 = new String[0];
- Collection<String> collection = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = ArrayTools.retainAll(a1, collection);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection_EmptyCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = new ArrayList<String>();
- String[] a3 = ArrayTools.retainAll(a1, collection);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection_All() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" });
- assertTrue(Arrays.equals(a1, ArrayTools.retainAll(a1, collection)));
- }
-
- public void testRetainAllCharArrayCharArray() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'E', 'B' };
- assertTrue(Arrays.equals(new char[] { 'B', 'B', 'E', 'E' }, ArrayTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllCharArrayCharArray_EmptyCharArray1() {
- char[] a1 = new char[0];
- char[] a2 = new char[] { 'E', 'B' };
- assertSame(a1, ArrayTools.retainAll(a1, a2));
- }
-
- public void testRetainAllCharArrayCharArray_EmptyCharArray2() {
- char[] a1 = new char[] { 'E', 'B' };
- char[] a2 = new char[0];
- assertEquals(0, ArrayTools.retainAll(a1, a2).length);
- }
-
- public void testRetainAllCharArrayCharArray_RetainAll() {
- char[] a1 = new char[] { 'E', 'B', 'E', 'B', 'E', 'B', 'E', 'B', 'E' };
- char[] a2 = new char[] { 'E', 'B' };
- assertSame(a1, ArrayTools.retainAll(a1, a2));
- }
-
- public void testRetainAllIntArrayIntArray() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 5, 2 };
- assertTrue(Arrays.equals(new int[] { 2, 2, 5, 5 }, ArrayTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllIntArrayIntArray_EmptyIntArray1() {
- int[] a1 = new int[0];
- int[] a2 = new int[] { 5, 2 };
- assertSame(a1, ArrayTools.retainAll(a1, a2));
- }
-
- public void testRetainAllIntArrayIntArray_EmptyIntArray2() {
- int[] a1 = new int[] { 5, 2 };
- int[] a2 = new int[0];
- assertEquals(0, ArrayTools.retainAll(a1, a2).length);
- }
-
- public void testRetainAllIntArrayIntArray_RetainAll() {
- int[] a1 = new int[] { 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5 };
- int[] a2 = new int[] { 5, 2 };
- assertSame(a1, ArrayTools.retainAll(a1, a2));
- }
-
-
- // ********** reverse **********
-
- public void testReverseObjectArray_Object() {
- Object[] a = this.buildObjectArray1();
- a = ArrayTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseObjectArray_String() {
- String[] a = this.buildStringArray1();
- a = ArrayTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseObjectArray_Singleton() {
- String[] a1 = new String[] { "foo" };
- String[] a2 = ArrayTools.reverse(a1);
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testReverseCharArray() {
- char[] a = this.buildCharArray();
- a = ArrayTools.reverse(a);
- assertEquals('c', a[0]);
- assertEquals('b', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testReverseCharArray_Singleton() {
- char[] a1 = new char[] { 'f' };
- char[] a2 = ArrayTools.reverse(a1);
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testReverseIntArray() {
- int[] a = this.buildIntArray();
- a = ArrayTools.reverse(a);
- assertEquals(20, a[0]);
- assertEquals(10, a[1]);
- assertEquals(0, a[2]);
- }
-
- public void testReverseIntArray_Singleton() {
- int[] a1 = new int[] { 7 };
- int[] a2 = ArrayTools.reverse(a1);
- assertTrue(Arrays.equals(a1, a2));
- }
-
-
- // ********** rotate **********
-
- public void testRotateObjectArray() {
- String[] a = this.buildStringArray1();
- a = ArrayTools.rotate(a);
- assertEquals("two", a[0]);
- assertEquals("zero", a[1]);
- assertEquals("one", a[2]);
- }
-
- public void testRotateObjectArray_Zero() {
- String[] a1 = new String[0];
- String[] a2 = ArrayTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArray_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = ArrayTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt() {
- String[] a = this.buildStringArray1();
- a = ArrayTools.rotate(a, 2);
- assertEquals("one", a[0]);
- assertEquals("two", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testRotateObjectArrayInt_ZeroDistance() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = ArrayTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_NegativeDistance() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = ArrayTools.rotate(a1, -1);
- assertEquals("one", a2[0]);
- assertEquals("two", a2[1]);
- assertEquals("zero", a2[2]);
- }
-
- public void testRotateObjectArrayInt_Zero() {
- String[] a1 = new String[0];
- String[] a2 = ArrayTools.rotate(a1, 7);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = ArrayTools.rotate(a1, 8);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArray() {
- char[] a = this.buildCharArray();
- a = ArrayTools.rotate(a);
- assertEquals('c', a[0]);
- assertEquals('a', a[1]);
- assertEquals('b', a[2]);
- }
-
- public void testRotateCharArray_Zero() {
- char[] a1 = new char[0];
- char[] a2 = ArrayTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArray_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = ArrayTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt() {
- char[] a = this.buildCharArray();
- a = ArrayTools.rotate(a, 2);
- assertEquals('b', a[0]);
- assertEquals('c', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testRotateCharArrayInt_ZeroDistance() {
- char[] a1 = new char[] { 'a', 'b', 'c' };
- char[] a2 = ArrayTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_NegativeDistance() {
- char[] a = this.buildCharArray();
- a = ArrayTools.rotate(a, -1);
- assertEquals('b', a[0]);
- assertEquals('c', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testRotateCharArrayInt_Zero() {
- char[] a1 = new char[0];
- char[] a2 = ArrayTools.rotate(a1, 2001);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = ArrayTools.rotate(a1, 22);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArray() {
- int[] a = this.buildIntArray();
- a = ArrayTools.rotate(a);
- assertEquals(20, a[0]);
- assertEquals(0, a[1]);
- assertEquals(10, a[2]);
- }
-
- public void testRotateIntArray_Zero() {
- int[] a1 = new int[0];
- int[] a2 = ArrayTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArray_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = ArrayTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt() {
- int[] a = this.buildIntArray();
- a = ArrayTools.rotate(a, 2);
- assertEquals(10, a[0]);
- assertEquals(20, a[1]);
- assertEquals(0, a[2]);
- }
-
- public void testRotateIntArrayInt_ZeroDistance() {
- int[] a1 = new int[] { 3, 2, 1 };
- int[] a2 = ArrayTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_NegativeDistance() {
- int[] a = this.buildIntArray();
- a = ArrayTools.rotate(a, -1);
- assertEquals(10, a[0]);
- assertEquals(20, a[1]);
- assertEquals(0, a[2]);
- }
-
- public void testRotateIntArrayInt_Zero() {
- int[] a1 = new int[0];
- int[] a2 = ArrayTools.rotate(a1, 3);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = ArrayTools.rotate(a1, 44);
- assertSame(a1, a2);
- }
-
-
- // ********** shuffle **********
-
- public void testShuffleObjectArray() {
- String[] array1 = this.buildStringArray1();
- String[] array2 = ArrayTools.shuffle(this.buildStringArray1());
- assertEquals(array1.length, array2.length);
- assertTrue(ArrayTools.containsAll(array1, (Object[]) array2));
- }
-
- public void testShuffleObjectArray_Singleton() {
- String[] array1 = new String[] { "foo" };
- String[] array2 = ArrayTools.shuffle(new String[] { "foo" });
- assertEquals(array1.length, array2.length);
- assertTrue(ArrayTools.containsAll(array1, (Object[]) array2));
- }
-
- public void testShuffleCharArray() {
- char[] array1 = this.buildCharArray();
- char[] array2 = ArrayTools.shuffle(this.buildCharArray());
- assertEquals(array1.length, array2.length);
- assertTrue(ArrayTools.containsAll(array1, array2));
- }
-
- public void testShuffleCharArray_Singleton() {
- char[] array1 = new char[] { 'f' };
- char[] array2 = ArrayTools.shuffle(new char[] { 'f' });
- assertEquals(array1.length, array2.length);
- assertTrue(ArrayTools.containsAll(array1, array2));
- }
-
- public void testShuffleIntArray() {
- int[] array1 = this.buildIntArray();
- int[] array2 = ArrayTools.shuffle(this.buildIntArray());
- assertEquals(array1.length, array2.length);
- assertTrue(ArrayTools.containsAll(array1, array2));
- }
-
- public void testShuffleIntArray_Singleton() {
- int[] array1 = new int[] { 7 };
- int[] array2 = ArrayTools.shuffle(new int[] { 7 });
- assertEquals(array1.length, array2.length);
- assertTrue(ArrayTools.containsAll(array1, array2));
- }
-
-
- // ********** sub-array **********
-
- public void testSubArrayObjectArrayIntInt() {
- String[] array = new String[] {"foo", "bar", "baz", "joo", "jar", "jaz"};
- String[] result = new String[] {"foo", "bar", "baz", "joo"};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 0, 4)));
-
- result = new String[] {"jar"};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 4, 5)));
-
- result = new String[0];
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 5, 5)));
-
- result = new String[] {"joo", "jar", "jaz"};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 3, 6)));
- }
-
- public void testSubArrayIntArrayIntInt() {
- int[] array = new int[] {77, 99, 333, 4, 9090, 42};
- int[] result = new int[] {77, 99, 333, 4};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 0, 4)));
-
- result = new int[] {9090};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 4, 5)));
-
- result = new int[0];
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 5, 5)));
-
- result = new int[] {4, 9090, 42};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 3, 6)));
- }
-
- public void testSubArrayCharArrayIntInt() {
- char[] array = new char[] {'a', 'b', 'c', 'd', 'e', 'f'};
- char[] result = new char[] {'a', 'b', 'c', 'd'};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 0, 4)));
-
- result = new char[] {'e'};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 4, 5)));
-
- result = new char[0];
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 5, 5)));
-
- result = new char[] {'d', 'e', 'f'};
- assertTrue(Arrays.equals(result, ArrayTools.subArray(array, 3, 6)));
- }
-
-
- // ********** swap **********
-
- public void testSwapObjectArray() {
- String[] a = this.buildStringArray1();
- a = ArrayTools.swap(a, 1, 2);
- assertEquals("zero", a[0]);
- assertEquals("two", a[1]);
- assertEquals("one", a[2]);
- }
-
- public void testSwapObjectArray_SameIndices() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = this.buildStringArray1();
- a1 = ArrayTools.swap(a1, 1, 1);
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testSwapCharArray() {
- char[] a = this.buildCharArray();
- a = ArrayTools.swap(a, 1, 2);
- assertEquals('a', a[0]);
- assertEquals('c', a[1]);
- assertEquals('b', a[2]);
- }
-
- public void testSwapCharArray_SameIndices() {
- char[] a1 = this.buildCharArray();
- char[] a2 = this.buildCharArray();
- a1 = ArrayTools.swap(a1, 1, 1);
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testSwapIntArray() {
- int[] a = this.buildIntArray();
- a = ArrayTools.swap(a, 1, 2);
- assertEquals(0, a[0]);
- assertEquals(20, a[1]);
- assertEquals(10, a[2]);
- }
-
- public void testSwapIntArray_SameIndices() {
- int[] a1 = this.buildIntArray();
- int[] a2 = this.buildIntArray();
- a1 = ArrayTools.swap(a1, 1, 1);
- assertTrue(Arrays.equals(a1, a2));
- }
-
-
- // ********** Arrays enhancements **********
-
- public void testFillBooleanArrayBoolean() {
- boolean[] a1 = new boolean[9];
- boolean[] a2 = ArrayTools.fill(a1, true);
- for (boolean x : a1) {
- assertTrue(x);
- }
- assertSame(a1, a2);
- }
-
- public void testFillBooleanArrayIntIntBoolean() {
- boolean[] a1 = new boolean[9];
- boolean[] a2 = ArrayTools.fill(a1, false);
- int from = 3;
- int to = 6;
- boolean[] a3 = ArrayTools.fill(a2, from, to, true);
- for (int i = 0; i < a1.length; i++) {
- boolean x = a1[i];
- if (i < from || i >= to) {
- assertFalse(x);
- } else {
- assertTrue(x);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillByteArrayByte() {
- byte[] a1 = new byte[9];
- byte[] a2 = ArrayTools.fill(a1, (byte) 77);
- for (byte x : a1) {
- assertEquals(77, x);
- }
- assertSame(a1, a2);
- }
-
- public void testFillByteArrayIntIntByte() {
- byte[] a1 = new byte[9];
- byte[] a2 = ArrayTools.fill(a1, (byte) 3);
- int from = 3;
- int to = 6;
- byte[] a3 = ArrayTools.fill(a2, from, to, (byte) 77);
- for (int i = 0; i < a1.length; i++) {
- byte x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertEquals(77, x);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillCharArrayChar() {
- char[] a1 = new char[9];
- char[] a2 = ArrayTools.fill(a1, 'c');
- for (char x : a1) {
- assertEquals('c', x);
- }
- assertSame(a1, a2);
- }
-
- public void testFillCharArrayIntIntChar() {
- char[] a1 = new char[9];
- char[] a2 = ArrayTools.fill(a1, 'a');
- int from = 3;
- int to = 6;
- char[] a3 = ArrayTools.fill(a2, from, to, 'c');
- for (int i = 0; i < a1.length; i++) {
- char x = a1[i];
- if (i < from || i >= to) {
- assertEquals('a', x);
- } else {
- assertEquals('c', x);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillDoubleArrayDouble() {
- double[] a1 = new double[9];
- double[] a2 = ArrayTools.fill(a1, 77.77);
- for (double x : a1) {
- assertEquals(77.77, x, 0.0);
- }
- assertSame(a1, a2);
- }
-
- public void testFillDoubleArrayIntIntDouble() {
- double[] a1 = new double[9];
- double[] a2 = ArrayTools.fill(a1, 3.3);
- int from = 3;
- int to = 6;
- double[] a3 = ArrayTools.fill(a2, from, to, 77.77);
- for (int i = 0; i < a1.length; i++) {
- double x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3.3, x, 0.0);
- } else {
- assertEquals(77.77, x, 0.0);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillFloatArrayFloat() {
- float[] a1 = new float[9];
- float[] a2 = ArrayTools.fill(a1, 77.77f);
- for (float x : a1) {
- assertEquals(77.77f, x, 0.0);
- }
- assertSame(a1, a2);
- }
-
- public void testFillFloatArrayIntIntFloat() {
- float[] a1 = new float[9];
- float[] a2 = ArrayTools.fill(a1, 3.3f);
- int from = 3;
- int to = 6;
- float[] a3 = ArrayTools.fill(a2, from, to, 77.77f);
- for (int i = 0; i < a1.length; i++) {
- float x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3.3f, x, 0.0);
- } else {
- assertEquals(77.77f, x, 0.0);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillIntArrayInt() {
- int[] a1 = new int[9];
- int[] a2 = ArrayTools.fill(a1, 77);
- for (int x : a1) {
- assertEquals(77, x);
- }
- assertSame(a1, a2);
- }
-
- public void testFillIntArrayIntIntInt() {
- int[] a1 = new int[9];
- int[] a2 = ArrayTools.fill(a1, 3);
- int from = 3;
- int to = 6;
- int[] a3 = ArrayTools.fill(a2, from, to, 77);
- for (int i = 0; i < a1.length; i++) {
- int x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertEquals(77, x);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillObjectArrayObject() {
- String[] a1 = new String[9];
- String[] a2 = ArrayTools.fill(a1, "77");
- for (String x : a1) {
- assertEquals("77", x);
- }
- assertSame(a1, a2);
- }
-
- public void testFillObjectArrayIntIntObject() {
- String[] a1 = new String[9];
- String[] a2 = ArrayTools.fill(a1, "3");
- int from = 3;
- int to = 6;
- String[] a3 = ArrayTools.fill(a2, from, to, "77");
- for (int i = 0; i < a1.length; i++) {
- String x = a1[i];
- if (i < from || i >= to) {
- assertEquals("3", x);
- } else {
- assertEquals("77", x);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillLongArrayLong() {
- long[] a1 = new long[9];
- long[] a2 = ArrayTools.fill(a1, 77);
- for (long x : a1) {
- assertEquals(77, x);
- }
- assertSame(a1, a2);
- }
-
- public void testFillLongArrayIntIntLong() {
- long[] a1 = new long[9];
- long[] a2 = ArrayTools.fill(a1, 3);
- int from = 3;
- int to = 6;
- long[] a3 = ArrayTools.fill(a2, from, to, 77);
- for (int i = 0; i < a1.length; i++) {
- long x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertEquals(77, x);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testFillShortArrayShort() {
- short[] a1 = new short[9];
- short[] a2 = ArrayTools.fill(a1, (short) 77);
- for (short x : a1) {
- assertEquals(77, x);
- }
- assertSame(a1, a2);
- }
-
- public void testFillShortArrayIntIntShort() {
- short[] a1 = new short[9];
- short[] a2 = ArrayTools.fill(a1, (short) 3);
- int from = 3;
- int to = 6;
- short[] a3 = ArrayTools.fill(a2, from, to, (short) 77);
- for (int i = 0; i < a1.length; i++) {
- short x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertEquals(77, x);
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortByteArray() {
- byte[] a1 = new byte[3];
- a1[0] = (byte) 33;
- a1[1] = (byte) 11;
- a1[2] = (byte) 22;
- byte[] a2 = ArrayTools.sort(a1);
- byte last = (byte) 0;
- for (byte x : a1) {
- assertTrue(last < x);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortByteArrayIntInt() {
- byte[] a1 = new byte[9];
- byte[] a2 = ArrayTools.fill(a1, (byte) 3);
- a2[3] = (byte) 33;
- a2[4] = (byte) 11;
- a2[5] = (byte) 22;
- int from = 3;
- int to = 6;
- byte[] a3 = ArrayTools.sort(a2, from, to);
- byte last = (byte) 0;
- for (int i = 0; i < a1.length; i++) {
- byte x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertTrue(last < x);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortCharArray() {
- char[] a1 = new char[3];
- a1[0] = 'z';
- a1[1] = 'b';
- a1[2] = 'm';
- char[] a2 = ArrayTools.sort(a1);
- char last = 'a';
- for (char x : a1) {
- assertTrue(last < x);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortCharArrayIntInt() {
- char[] a1 = new char[9];
- char[] a2 = ArrayTools.fill(a1, 'c');
- a2[3] = 'z';
- a2[4] = 'b';
- a2[5] = 'm';
- int from = 3;
- int to = 6;
- char[] a3 = ArrayTools.sort(a2, from, to);
- char last = 'a';
- for (int i = 0; i < a1.length; i++) {
- char x = a1[i];
- if (i < from || i >= to) {
- assertEquals('c', x);
- } else {
- assertTrue(last < x);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortDoubleArray() {
- double[] a1 = new double[3];
- a1[0] = 33.33;
- a1[1] = 11.11;
- a1[2] = 22.22;
- double[] a2 = ArrayTools.sort(a1);
- double last = 0;
- for (double x : a1) {
- assertTrue(last < x);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortDoubleArrayIntInt() {
- double[] a1 = new double[9];
- double[] a2 = ArrayTools.fill(a1, 3.3);
- a2[3] = 33.33;
- a2[4] = 11.11;
- a2[5] = 22.22;
- int from = 3;
- int to = 6;
- double[] a3 = ArrayTools.sort(a2, from, to);
- double last = 0;
- for (int i = 0; i < a1.length; i++) {
- double x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3.3, x, 0.0);
- } else {
- assertTrue(last < x);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortFloatArray() {
- float[] a1 = new float[3];
- a1[0] = 33.33f;
- a1[1] = 11.11f;
- a1[2] = 22.22f;
- float[] a2 = ArrayTools.sort(a1);
- float last = 0;
- for (float x : a1) {
- assertTrue(last < x);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortFloatArrayIntInt() {
- float[] a1 = new float[9];
- float[] a2 = ArrayTools.fill(a1, 3.3f);
- a2[3] = 33.33f;
- a2[4] = 11.11f;
- a2[5] = 22.22f;
- int from = 3;
- int to = 6;
- float[] a3 = ArrayTools.sort(a2, from, to);
- float last = 0;
- for (int i = 0; i < a1.length; i++) {
- float x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3.3f, x, 0.0);
- } else {
- assertTrue(last < x);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortIntArray() {
- int[] a1 = new int[3];
- a1[0] = 33;
- a1[1] = 11;
- a1[2] = 22;
- int[] a2 = ArrayTools.sort(a1);
- int last = 0;
- for (int x : a1) {
- assertTrue(last < x);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortIntArrayIntInt() {
- int[] a1 = new int[9];
- int[] a2 = ArrayTools.fill(a1, 3);
- a2[3] = 33;
- a2[4] = 11;
- a2[5] = 22;
- int from = 3;
- int to = 6;
- int[] a3 = ArrayTools.sort(a2, from, to);
- int last = 0;
- for (int i = 0; i < a1.length; i++) {
- int x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertTrue(last < x);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortObjectArray() {
- String[] a1 = new String[3];
- a1[0] = "y";
- a1[1] = "b";
- a1[2] = "m";
- String[] a2 = ArrayTools.sort(a1);
- String last = "a";
- for (String x : a1) {
- assertTrue(last.compareTo(x) < 0);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortObjectArrayComparator() {
- String[] a1 = new String[3];
- a1[0] = "y";
- a1[1] = "b";
- a1[2] = "m";
- String[] a2 = ArrayTools.sort(a1, new ReverseComparator<String>());
- String last = "z";
- for (String x : a1) {
- assertTrue(last.compareTo(x) > 0);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortObjectArrayIntInt() {
- String[] a1 = new String[9];
- String[] a2 = ArrayTools.fill(a1, "c");
- a2[3] = "y";
- a2[4] = "b";
- a2[5] = "m";
- int from = 3;
- int to = 6;
- String[] a3 = ArrayTools.sort(a2, from, to);
- String last = "a";
- for (int i = 0; i < a1.length; i++) {
- String x = a1[i];
- if (i < from || i >= to) {
- assertEquals("c", x);
- } else {
- assertTrue(last.compareTo(x) < 0);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortObjectArrayIntIntComparator() {
- String[] a1 = new String[9];
- String[] a2 = ArrayTools.fill(a1, "c");
- a2[3] = "y";
- a2[4] = "b";
- a2[5] = "m";
- int from = 3;
- int to = 6;
- String[] a3 = ArrayTools.sort(a2, from, to, new ReverseComparator<String>());
- String last = "z";
- for (int i = 0; i < a1.length; i++) {
- String x = a1[i];
- if (i < from || i >= to) {
- assertEquals("c", x);
- } else {
- assertTrue(last.compareTo(x) > 0);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortLongArray() {
- long[] a1 = new long[3];
- a1[0] = 33;
- a1[1] = 11;
- a1[2] = 22;
- long[] a2 = ArrayTools.sort(a1);
- long last = 0;
- for (long x : a1) {
- assertTrue(last < x);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortLongArrayIntInt() {
- long[] a1 = new long[9];
- long[] a2 = ArrayTools.fill(a1, 3);
- a2[3] = 33;
- a2[4] = 11;
- a2[5] = 22;
- int from = 3;
- int to = 6;
- long[] a3 = ArrayTools.sort(a2, from, to);
- long last = 0;
- for (int i = 0; i < a1.length; i++) {
- long x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertTrue(last < x);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
- public void testSortShortArray() {
- short[] a1 = new short[3];
- a1[0] = (short) 33;
- a1[1] = (short) 11;
- a1[2] = (short) 22;
- short[] a2 = ArrayTools.sort(a1);
- short last = (short) 0;
- for (short x : a1) {
- assertTrue(last < x);
- last = x;
- }
- assertSame(a1, a2);
- }
-
- public void testSortShortArrayIntInt() {
- short[] a1 = new short[9];
- short[] a2 = ArrayTools.fill(a1, (short) 3);
- a2[3] = (short) 33;
- a2[4] = (short) 11;
- a2[5] = (short) 22;
- int from = 3;
- int to = 6;
- short[] a3 = ArrayTools.sort(a2, from, to);
- short last = (short) 0;
- for (int i = 0; i < a1.length; i++) {
- short x = a1[i];
- if (i < from || i >= to) {
- assertEquals(3, x);
- } else {
- assertTrue(last < x);
- last = x;
- }
- }
- assertSame(a1, a2);
- assertSame(a1, a3);
- }
-
-
- // ********** constructor **********
-
- public void testConstructor() {
- boolean exCaught = false;
- try {
- Object at = ReflectionTools.newInstance(ArrayTools.class);
- fail("bogus: " + at);
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- if (ex.getCause().getCause() instanceof UnsupportedOperationException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
-
- // ********** utility **********
-
- private Object[] buildObjectArray1() {
- return new Object[] { "zero", "one", "two" };
- }
-
- private String[] buildStringArray1() {
- return new String[] { "zero", "one", "two" };
- }
-
- private char[] buildCharArray() {
- return new char[] { 'a', 'b', 'c' };
- }
-
- private int[] buildIntArray() {
- return new int[] { 0, 10, 20 };
- }
-
- private Object[] buildObjectArray2() {
- return new Object[] { "three", "four", "five" };
- }
-
- private String[] buildStringArray2() {
- return new String[] { "three", "four", "five" };
- }
-
- private List<String> buildStringList1() {
- List<String> l = new ArrayList<String>();
- this.addToCollection1(l);
- return l;
- }
-
- private List<Object> buildObjectList1() {
- List<Object> l = new ArrayList<Object>();
- this.addToCollection1(l);
- return l;
- }
-
- private void addToCollection1(Collection<? super String> c) {
- c.add("zero");
- c.add("one");
- c.add("two");
- }
-
- private List<String> buildStringList2() {
- List<String> l = new ArrayList<String>();
- this.addToCollection2(l);
- return l;
- }
-
- private void addToCollection2(Collection<? super String> c) {
- c.add("three");
- c.add("four");
- c.add("five");
- }
-
- private Vector<String> buildStringVector1() {
- Vector<String> v = new Vector<String>();
- this.addToCollection1(v);
- return v;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/AsynchronousCommandExecutorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/AsynchronousCommandExecutorTests.java
deleted file mode 100644
index f8b32dcd28..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/AsynchronousCommandExecutorTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.AsynchronousCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StatefulCommandExecutor;
-
-public class AsynchronousCommandExecutorTests
- extends MultiThreadedTestCase
-{
- public AsynchronousCommandExecutorTests(String name) {
- super(name);
- }
-
- public void testExecution() throws Exception {
- TestCommand command = new TestCommand();
- StatefulCommandExecutor commandExecutor = new AsynchronousCommandExecutor(this.buildThreadFactory());
- commandExecutor.start();
- commandExecutor.execute(command);
- commandExecutor.execute(command);
- commandExecutor.execute(command);
- Thread.sleep(TWO_TICKS); // wait for the command to execute
- commandExecutor.stop();
- assertEquals(3, command.count);
- }
-
- static class TestCommand implements Command {
- int count = 0;
- public void execute() {
- this.count++;
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BagTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BagTests.java
deleted file mode 100644
index e018dfaeea..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BagTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-
-@SuppressWarnings("nls")
-public class BagTests extends TestCase {
-
- public BagTests(String name) {
- super(name);
- }
-
- public void testEmptyBag_iterator() throws Exception {
- assertFalse(Bag.Empty.instance().iterator().hasNext());
- }
-
- public void testEmptyBag_size() throws Exception {
- assertEquals(0, Bag.Empty.instance().size());
- }
-
- public void testEmptyBag_uniqueIterator() throws Exception {
- assertFalse(Bag.Empty.instance().uniqueIterator().hasNext());
- }
-
- public void testEmptyBag_uniqueCount() throws Exception {
- assertEquals(0, Bag.Empty.instance().uniqueCount());
- }
-
- public void testEmptyBag_count() throws Exception {
- assertEquals(0, Bag.Empty.instance().count("foo"));
- }
-
- public void testEmptyBag_entries() throws Exception {
- assertFalse(Bag.Empty.instance().entries().hasNext());
- }
-
- public void testEmptyBag_remove() throws Exception {
- assertFalse(Bag.Empty.instance().remove("foo", 3));
- }
-
- public void testEmptyBag_add() throws Exception {
- boolean exCaught = false;
- try {
- Bag.Empty.instance().add("foo", 3);
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEmptyBag_equals() throws Exception {
- assertTrue(Bag.Empty.instance().equals(Bag.Empty.instance()));
- assertFalse(Bag.Empty.instance().equals("foo"));
-
- Bag<Object> bag = new HashBag<Object>();
- assertTrue(Bag.Empty.instance().equals(bag));
- bag.add("foo");
- assertFalse(Bag.Empty.instance().equals(bag));
- }
-
- public void testEmptyBag_hashCode() throws Exception {
- assertEquals(0, Bag.Empty.instance().hashCode());
- }
-
- public void testEmptyBag_serialization() throws Exception {
- Bag<?> xxx = TestTools.serialize(Bag.Empty.instance());
- assertSame(Bag.Empty.instance(), xxx);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiFilterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiFilterTests.java
deleted file mode 100644
index b2d1564479..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiFilterTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BidiFilter;
-
-@SuppressWarnings("nls")
-public class BidiFilterTests extends TestCase {
-
- public BidiFilterTests(String name) {
- super(name);
- }
-
- public void testNullBidiFilter_accept() throws Exception {
- assertTrue(BidiFilter.Null.instance().accept("foo"));
- }
-
- public void testNullBidiFilter_reverseAccept() throws Exception {
- assertTrue(BidiFilter.Null.instance().reverseAccept("foo"));
- }
-
- public void testNullBidiFilter_toString() throws Exception {
- assertNotNull(BidiFilter.Null.instance().toString());
- }
-
- public void testNullBidiFilter_serialization() throws Exception {
- BidiFilter<?> xxx = TestTools.serialize(BidiFilter.Null.instance());
- assertSame(BidiFilter.Null.instance(), xxx);
- }
-
- public void testOpaqueBidiFilter_accept() throws Exception {
- assertFalse(BidiFilter.Opaque.instance().accept("foo"));
- }
-
- public void testOpaqueBidiFilter_reverseAccept() throws Exception {
- assertFalse(BidiFilter.Opaque.instance().reverseAccept("foo"));
- }
-
- public void testOpaqueBidiFilter_toString() throws Exception {
- assertNotNull(BidiFilter.Opaque.instance().toString());
- }
-
- public void testOpaqueBidiFilter_serialization() throws Exception {
- BidiFilter<?> xxx = TestTools.serialize(BidiFilter.Opaque.instance());
- assertSame(BidiFilter.Opaque.instance(), xxx);
- }
-
- public void testDisabledBidiFilter_accept() throws Exception {
- boolean exCaught = false;
- try {
- BidiFilter.Disabled.instance().accept("foo");
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledBidiFilter_reverseAccept() throws Exception {
- boolean exCaught = false;
- try {
- BidiFilter.Disabled.instance().reverseAccept("foo");
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledBidiFilter_toString() throws Exception {
- assertNotNull(BidiFilter.Disabled.instance().toString());
- }
-
- public void testDisabledBidiFilter_serialization() throws Exception {
- BidiFilter<?> xxx = TestTools.serialize(BidiFilter.Disabled.instance());
- assertSame(BidiFilter.Disabled.instance(), xxx);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiStringConverterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiStringConverterTests.java
deleted file mode 100644
index cf0400b104..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiStringConverterTests.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BidiStringConverter;
-
-@SuppressWarnings("nls")
-public class BidiStringConverterTests extends TestCase {
-
- public BidiStringConverterTests(String name) {
- super(name);
- }
-
- public void testDefaultBidiStringConverter_convertToString() throws Exception {
- assertEquals("foo", BidiStringConverter.Default.instance().convertToString("foo"));
- assertNull(BidiStringConverter.Default.instance().convertToString(null));
- }
-
- public void testDefaultBidiStringConverter_convertToObject() throws Exception {
- assertEquals("foo", BidiStringConverter.Default.instance().convertToObject("foo"));
- assertNull(BidiStringConverter.Default.instance().convertToString(null));
- }
-
- public void testDefaultBidiStringConverter_toString() throws Exception {
- assertNotNull(BidiStringConverter.Default.instance().toString());
- }
-
- public void testDefaultBidiStringConverter_serialization() throws Exception {
- BidiStringConverter<?> xxx = TestTools.serialize(BidiStringConverter.Default.instance());
- assertSame(BidiStringConverter.Default.instance(), xxx);
- }
-
- public void testDisabledBidiStringConverter_convertToString() throws Exception {
- boolean exCaught = false;
- try {
- BidiStringConverter.Disabled.instance().convertToString("foo");
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledBidiStringConverter_convertToObject() throws Exception {
- boolean exCaught = false;
- try {
- BidiStringConverter.Disabled.instance().convertToObject("foo");
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledBidiStringConverter_toString() throws Exception {
- assertNotNull(BidiStringConverter.Disabled.instance().toString());
- }
-
- public void testDisabledBidiStringConverter_serialization() throws Exception {
- BidiStringConverter<?> xxx = TestTools.serialize(BidiStringConverter.Disabled.instance());
- assertSame(BidiStringConverter.Disabled.instance(), xxx);
- }
-
- public void testBooleanBidiStringConverter_convertToString() throws Exception {
- assertEquals("true", BidiStringConverter.BooleanConverter.instance().convertToString(Boolean.TRUE));
- assertEquals("false", BidiStringConverter.BooleanConverter.instance().convertToString(Boolean.FALSE));
- assertNull(BidiStringConverter.BooleanConverter.instance().convertToString(null));
- }
-
- public void testBooleanBidiStringConverter_convertToObject() throws Exception {
- assertEquals(Boolean.TRUE, BidiStringConverter.BooleanConverter.instance().convertToObject("true"));
- assertEquals(Boolean.TRUE, BidiStringConverter.BooleanConverter.instance().convertToObject("TRUE"));
- assertEquals(Boolean.FALSE, BidiStringConverter.BooleanConverter.instance().convertToObject("false"));
- assertEquals(Boolean.FALSE, BidiStringConverter.BooleanConverter.instance().convertToObject("xxxx"));
- assertNull(BidiStringConverter.BooleanConverter.instance().convertToObject(null));
- }
-
- public void testBooleanBidiStringConverter_toString() throws Exception {
- assertNotNull(BidiStringConverter.BooleanConverter.instance().toString());
- }
-
- public void testBooleanBidiStringConverter_serialization() throws Exception {
- BidiStringConverter<?> xxx = TestTools.serialize(BidiStringConverter.BooleanConverter.instance());
- assertSame(BidiStringConverter.BooleanConverter.instance(), xxx);
- }
-
- public void testIntegerBidiStringConverter_convertToString() throws Exception {
- assertEquals("7", BidiStringConverter.IntegerConverter.instance().convertToString(Integer.valueOf(7)));
- assertNull(BidiStringConverter.IntegerConverter.instance().convertToString(null));
- }
-
- public void testIntegerBidiStringConverter_convertToObject() throws Exception {
- assertEquals(Integer.valueOf(7), BidiStringConverter.IntegerConverter.instance().convertToObject("7"));
- assertNull(BidiStringConverter.IntegerConverter.instance().convertToObject(null));
- }
-
- public void testIntegerBidiStringConverter_toString() throws Exception {
- assertNotNull(BidiStringConverter.IntegerConverter.instance().toString());
- }
-
- public void testIntegerBidiStringConverter_serialization() throws Exception {
- BidiStringConverter<?> xxx = TestTools.serialize(BidiStringConverter.IntegerConverter.instance());
- assertSame(BidiStringConverter.IntegerConverter.instance(), xxx);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiTransformerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiTransformerTests.java
deleted file mode 100644
index 973f153f45..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BidiTransformerTests.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BidiTransformer;
-
-@SuppressWarnings("nls")
-public class BidiTransformerTests extends TestCase {
-
- public BidiTransformerTests(String name) {
- super(name);
- }
-
- public void testNullBidiTransformer_transform() throws Exception {
- assertEquals("foo", BidiTransformer.Null.instance().transform("foo"));
- assertNull(BidiTransformer.Null.instance().transform(null));
- }
-
- public void testNullBidiTransformer_reverseTransform() throws Exception {
- assertEquals("foo", BidiTransformer.Null.instance().reverseTransform("foo"));
- assertNull(BidiTransformer.Null.instance().transform(null));
- }
-
- public void testNullBidiTransformer_toString() throws Exception {
- assertNotNull(BidiTransformer.Null.instance().toString());
- }
-
- public void testNullBidiTransformer_serialization() throws Exception {
- BidiTransformer<?, ?> xxx = TestTools.serialize(BidiTransformer.Null.instance());
- assertSame(BidiTransformer.Null.instance(), xxx);
- }
-
- public void testDisabledBidiTransformer_transform() throws Exception {
- boolean exCaught = false;
- try {
- BidiTransformer.Disabled.instance().transform("foo");
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledBidiTransformer_reverseTransform() throws Exception {
- boolean exCaught = false;
- try {
- BidiTransformer.Disabled.instance().reverseTransform("foo");
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledBidiTransformer_toString() throws Exception {
- assertNotNull(BidiTransformer.Disabled.instance().toString());
- }
-
- public void testDisabledBidiTransformer_serialization() throws Exception {
- BidiTransformer<?, ?> xxx = TestTools.serialize(BidiTransformer.Disabled.instance());
- assertSame(BidiTransformer.Disabled.instance(), xxx);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BitToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BitToolsTests.java
deleted file mode 100644
index dd1941237b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BitToolsTests.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.lang.reflect.InvocationTargetException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-
-public class BitToolsTests extends TestCase {
-
- public BitToolsTests(String name) {
- super(name);
- }
-
- public void testFlagIsSetIntInt() {
- assertTrue(BitTools.flagIsSet(0x0003, 0x0001));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0001));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0101));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0103));
-
- assertFalse(BitTools.flagIsSet(0x0303, 0x1103));
- assertFalse(BitTools.flagIsSet(0x0000, 0x1103));
- }
-
- public void testFlagIsOffIntInt() {
- assertFalse(BitTools.flagIsOff(0x0003, 0x0001));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0001));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0101));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0103));
-
- assertTrue(BitTools.flagIsOff(0x2204, 0x1103));
- assertTrue(BitTools.flagIsOff(0x0000, 0x1103));
- }
-
- public void testOnlyFlagIsSetIntInt() {
- assertFalse(BitTools.onlyFlagIsSet(0x0003, 0x0001));
- assertTrue(BitTools.onlyFlagIsSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagIsSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagIsSet(0x0101, 0x0101));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagIsSet(0x0103, 0x0103));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagIsSet(0x1103, 0x1103));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0000, 0x1103));
- assertTrue(BitTools.onlyFlagIsSet(0x0103, 0x0103));
- }
-
- public void testOnlyFlagIsOffIntInt() {
- assertFalse(BitTools.onlyFlagIsOff(0x0003, 0x0001));
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFFFE, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFEFE, 0x0101));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFEFC, 0x0103));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFEEFC, 0x1103));
- }
-
- public void testAllFlagsAreSetIntInt() {
- assertTrue(BitTools.allFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0001));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0101));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0103));
-
- assertFalse(BitTools.allFlagsAreSet(0x0303, 0x1103));
- assertFalse(BitTools.allFlagsAreSet(0x0000, 0x1103));
- }
-
- public void testAllFlagsAreOffIntInt() {
- assertFalse(BitTools.allFlagsAreOff(0x0003, 0x0001));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0001));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0101));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0103));
-
- assertTrue(BitTools.allFlagsAreOff(0x2204, 0x1103));
- assertTrue(BitTools.allFlagsAreOff(0x0000, 0x1103));
- }
-
- public void testOnlyFlagsAreSetIntInt() {
- assertFalse(BitTools.onlyFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagsAreSet(0x0101, 0x0101));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, 0x0103));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagsAreSet(0x1103, 0x1103));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0000, 0x1103));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, 0x0103));
- }
-
- public void testOnlyFlagsAreOffIntInt() {
- assertFalse(BitTools.onlyFlagsAreOff(0x0003, 0x0001));
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFFFE, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFE, 0x0101));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFC, 0x0103));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFEEFC, 0x1103));
- }
-
- public void testAnyFlagsAreSetIntInt() {
- assertTrue(BitTools.anyFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.anyFlagsAreSet(0xFFFF, 0x0001));
- assertTrue(BitTools.anyFlagsAreSet(0x0003, 0xFFFF));
-
- assertFalse(BitTools.anyFlagsAreSet(0x0303, 0x1010));
- assertFalse(BitTools.anyFlagsAreSet(0x0000, 0xFFFF));
- }
-
- public void testAnyFlagsAreOffIntInt() {
- assertTrue(BitTools.anyFlagsAreOff(0x333E, 0x0001));
- assertTrue(BitTools.anyFlagsAreOff(0xFFFE, 0x0001));
- assertTrue(BitTools.anyFlagsAreOff(0x0003, 0xFFFF));
-
- assertFalse(BitTools.anyFlagsAreOff(0x7373, 0x1010));
- assertFalse(BitTools.anyFlagsAreOff(0xFFFF, 0xFFFF));
- }
-
- public void testAllFlagsAreSetIntIntArray() {
- assertTrue(BitTools.allFlagsAreSet(0x0003, new int[] { 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.allFlagsAreSet(0x0303, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- assertFalse(BitTools.allFlagsAreSet(0x0000, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testAllFlagsAreOffIntIntArray() {
- assertFalse(BitTools.allFlagsAreOff(0x0003, new int[] { 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0100, 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0100, 0x0002, 0x0001 }));
-
- assertTrue(BitTools.allFlagsAreOff(0x0303, new int[] { 0x1000, 0x0400, 0x0020, 0x0000 }));
- assertTrue(BitTools.allFlagsAreOff(0x0000, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testOnlyFlagsAreSetIntIntArray() {
- assertFalse(BitTools.onlyFlagsAreSet(0x0003, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0101, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x011, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x1103, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0000, new int[] { 0x011, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, new int[] { 0x0101, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testOnlyFlagsAreOffIntIntArray() {
- assertFalse(BitTools.onlyFlagsAreOff(0x0003, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFFFE, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFE, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFC, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFEEFC, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testAnyFlagsAreSetIntIntArray() {
- assertTrue(BitTools.anyFlagsAreSet(0x0003, new int[] { 0x0001 }));
- assertTrue(BitTools.anyFlagsAreSet(0xFFFF, new int[] { 0x0001 }));
- assertTrue(BitTools.anyFlagsAreSet(0x0303, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
-
- assertFalse(BitTools.anyFlagsAreSet(0x0303, new int[] { 0x1000, 0x0010 }));
- assertFalse(BitTools.anyFlagsAreSet(0x0000, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
- }
-
- public void testAnyFlagsAreOffIntIntArray() {
- assertFalse(BitTools.anyFlagsAreOff(0x0003, new int[] { 0x0001 }));
- assertFalse(BitTools.anyFlagsAreOff(0xFFFF, new int[] { 0x0001 }));
- assertFalse(BitTools.anyFlagsAreOff(0x0303, new int[] { 0x0100, 0x0200, 0x0003, 0x0002 }));
-
- assertTrue(BitTools.anyFlagsAreOff(0x0303, new int[] { 0x0100, 0x0010 }));
- assertTrue(BitTools.anyFlagsAreOff(0x0000, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
- }
-
- public void testOrFlags() {
- assertEquals(0x0001, BitTools.orFlags(new int[] { 0x0001, 0x0000 }));
- assertEquals(0x0011, BitTools.orFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0xF011, BitTools.orFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- }
-
- public void testAndFlags() {
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0001 }));
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0x0000, BitTools.andFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0011, 0xF001 }));
- }
-
- public void testXorFlags() {
- assertEquals(0x0001, BitTools.xorFlags(new int[] { 0x0001, 0x0000 }));
- assertEquals(0x0010, BitTools.xorFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0xF010, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- assertEquals(0xFF11, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000, 0x0F01 }));
- assertEquals(0xF010, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000, 0x0F01, 0x0F01 }));
- }
-
- public void testConstructor() {
- boolean exCaught = false;
- try {
- Object at = ReflectionTools.newInstance(BitTools.class);
- fail("bogus: " + at); //$NON-NLS-1$
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- if (ex.getCause().getCause() instanceof UnsupportedOperationException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BooleanToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BooleanToolsTests.java
deleted file mode 100644
index f134a70e87..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/BooleanToolsTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.lang.reflect.InvocationTargetException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BooleanTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-
-public class BooleanToolsTests extends TestCase {
- private static final Boolean TRUE = Boolean.TRUE;
- private static final Boolean FALSE = Boolean.FALSE;
-
- public BooleanToolsTests(String name) {
- super(name);
- }
-
- public void testNOT() {
- assertEquals(FALSE, BooleanTools.not(TRUE));
- assertEquals(TRUE, BooleanTools.not(FALSE));
- }
-
- public void testAND() {
- assertEquals(TRUE, BooleanTools.and(TRUE, TRUE));
- assertEquals(FALSE, BooleanTools.and(TRUE, FALSE));
- assertEquals(FALSE, BooleanTools.and(FALSE, TRUE));
- assertEquals(FALSE, BooleanTools.and(FALSE, FALSE));
- }
-
- public void testOR() {
- assertEquals(TRUE, BooleanTools.or(TRUE, TRUE));
- assertEquals(TRUE, BooleanTools.or(TRUE, FALSE));
- assertEquals(TRUE, BooleanTools.or(FALSE, TRUE));
- assertEquals(FALSE, BooleanTools.or(FALSE, FALSE));
- }
-
- public void testXOR() {
- assertEquals(FALSE, BooleanTools.xor(TRUE, TRUE));
- assertEquals(TRUE, BooleanTools.xor(TRUE, FALSE));
- assertEquals(TRUE, BooleanTools.xor(FALSE, TRUE));
- assertEquals(FALSE, BooleanTools.xor(FALSE, FALSE));
- }
-
- public void testNAND() {
- assertEquals(FALSE, BooleanTools.nand(TRUE, TRUE));
- assertEquals(TRUE, BooleanTools.nand(TRUE, FALSE));
- assertEquals(TRUE, BooleanTools.nand(FALSE, TRUE));
- assertEquals(TRUE, BooleanTools.nand(FALSE, FALSE));
- }
-
- public void testNOR() {
- assertEquals(FALSE, BooleanTools.nor(TRUE, TRUE));
- assertEquals(FALSE, BooleanTools.nor(TRUE, FALSE));
- assertEquals(FALSE, BooleanTools.nor(FALSE, TRUE));
- assertEquals(TRUE, BooleanTools.nor(FALSE, FALSE));
- }
-
- public void testXNOR() {
- assertEquals(TRUE, BooleanTools.xnor(TRUE, TRUE));
- assertEquals(FALSE, BooleanTools.xnor(TRUE, FALSE));
- assertEquals(FALSE, BooleanTools.xnor(FALSE, TRUE));
- assertEquals(TRUE, BooleanTools.xnor(FALSE, FALSE));
- }
-
- public void testConstructor() {
- boolean exCaught = false;
- try {
- Object at = ReflectionTools.newInstance(BooleanTools.class);
- fail("bogus: " + at); //$NON-NLS-1$
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- if (ex.getCause().getCause() instanceof UnsupportedOperationException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClassNameTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClassNameTests.java
deleted file mode 100644
index 8e070b6d18..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClassNameTests.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-
-@SuppressWarnings("nls")
-public class ClassNameTests extends TestCase {
-
- public ClassNameTests(String name) {
- super(name);
- }
-
- public void testIsArray() {
- assertFalse(ClassName.isArray(int.class.getName()));
- assertTrue(ClassName.isArray(int[].class.getName()));
- assertTrue(ClassName.isArray(int[][].class.getName()));
-
- assertFalse(ClassName.isArray(java.lang.String.class.getName()));
- assertTrue(ClassName.isArray(java.lang.String[].class.getName()));
- assertTrue(ClassName.isArray(java.lang.String[][].class.getName()));
- }
-
- public void testGetElementTypeName() {
- assertEquals(java.util.Vector.class.getName(), ClassName.getElementTypeName(java.util.Vector.class.getName()));
- assertEquals(int.class.getName(), ClassName.getElementTypeName(int.class.getName()));
- assertEquals(void.class.getName(), ClassName.getElementTypeName(void.class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassName.getElementTypeName(java.util.Vector[].class.getName()));
- assertEquals(int.class.getName(), ClassName.getElementTypeName(int[].class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassName.getElementTypeName(java.util.Vector[][][].class.getName()));
- assertEquals(int.class.getName(), ClassName.getElementTypeName(int[][][].class.getName()));
- }
-
- public void testGetArrayDepth() {
- assertEquals(0, ClassName.getArrayDepth(java.util.Vector.class.getName()));
- assertEquals(0, ClassName.getArrayDepth(int.class.getName()));
- assertEquals(0, ClassName.getArrayDepth(void.class.getName()));
- assertEquals(1, ClassName.getArrayDepth(java.util.Vector[].class.getName()));
- assertEquals(1, ClassName.getArrayDepth(int[].class.getName()));
- assertEquals(3, ClassName.getArrayDepth(java.util.Vector[][][].class.getName()));
- assertEquals(3, ClassName.getArrayDepth(int[][][].class.getName()));
- }
-
- public void testGetComponentTypeName() {
- assertEquals(null, ClassName.getComponentTypeName(java.lang.Object.class.getName()));
- assertEquals(java.lang.Object.class.getName(), ClassName.getComponentTypeName(java.lang.Object[].class.getName()));
- assertEquals(java.lang.Object[].class.getName(), ClassName.getComponentTypeName(java.lang.Object[][].class.getName()));
-
- assertEquals(null, ClassName.getComponentTypeName(int.class.getName()));
- assertEquals(int.class.getName(), ClassName.getComponentTypeName(int[].class.getName()));
- assertEquals(int[].class.getName(), ClassName.getComponentTypeName(int[][].class.getName()));
- }
-
- public void testGetSimpleName() throws Exception {
- assertEquals("Object", ClassName.getSimpleName(java.lang.Object.class.getName()));
- assertEquals("Object[]", ClassName.getSimpleName(java.lang.Object[].class.getName()));
- assertEquals("Object[][]", ClassName.getSimpleName(java.lang.Object[][].class.getName()));
-
- assertEquals(java.util.Map.class.getSimpleName(), ClassName.getSimpleName(java.util.Map.class.getName()));
- assertEquals(java.util.Map.Entry.class.getSimpleName(), ClassName.getSimpleName(java.util.Map.Entry.class.getName()));
-
- assertEquals("int", ClassName.getSimpleName(int.class.getName()));
- assertEquals("int[]", ClassName.getSimpleName(int[].class.getName()));
- assertEquals("int[][]", ClassName.getSimpleName(int[][].class.getName()));
-
- Object anonObject = new Object() {
- // anonymous class
- };
- assertEquals("", ClassName.getSimpleName(anonObject.getClass().getName()));
-
- class Local {
- // anonymous class
- }
- Local localObject = new Local();
- assertEquals("Local", ClassName.getSimpleName(localObject.getClass().getName()));
- }
-
- public void testGetPackageName() throws Exception {
- assertEquals(java.lang.Object.class.getPackage().getName(), ClassName.getPackageName(java.lang.Object.class.getName()));
- assertEquals("", ClassName.getPackageName(java.lang.Object[].class.getName()));
- assertEquals("", ClassName.getPackageName(java.lang.Object[][].class.getName()));
-
- assertEquals(java.util.Map.class.getPackage().getName(), ClassName.getPackageName(java.util.Map.class.getName()));
- assertEquals(java.util.Map.Entry.class.getPackage().getName(), ClassName.getPackageName(java.util.Map.Entry.class.getName()));
-
- assertEquals("", ClassName.getPackageName(int.class.getName()));
- assertEquals("", ClassName.getPackageName(int[].class.getName()));
- assertEquals("", ClassName.getPackageName(int[][].class.getName()));
-
- assertEquals("", ClassName.getPackageName(void.class.getName()));
-
- Object anonObject = new Object() {
- // anonymous class
- };
- assertEquals(anonObject.getClass().getPackage().getName(), ClassName.getPackageName(anonObject.getClass().getName()));
- }
-
- public void testIsTopLevel() throws Exception {
- assertTrue(ClassName.isTopLevel(java.util.Map.class.getName())); // top-level
- assertFalse(ClassName.isTopLevel(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassName.isTopLevel(Class.forName(this.getClass().getName() + "$1LocalClass").getName())); // local
- assertFalse(ClassName.isTopLevel(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassName.isTopLevel(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassName.isTopLevel(array.getClass().getName()));
- Class<?> localClass = Class.forName(this.getClass().getName() + "$1LocalClass"); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassName.isTopLevel(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassName.isTopLevel(array.getClass().getName()));
- }
-
- public void testIsMember() throws Exception {
- assertFalse(ClassName.isMember(java.util.Map.class.getName())); // top-level
- assertTrue(ClassName.isMember(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassName.isMember(Class.forName(this.getClass().getName() + "$1LocalClass").getName())); // local
- assertFalse(ClassName.isMember(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassName.isMember(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassName.isMember(array.getClass().getName()));
- Class<?> localClass = Class.forName(this.getClass().getName() + "$1LocalClass"); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassName.isMember(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassName.isMember(array.getClass().getName()));
-
- // test a few edge cases
- assertTrue(ClassName.isMember("java.util.Map$a1"));
- assertTrue(ClassName.isMember("java.util.Map$1aa$aaa")); // member inside local
- assertTrue(ClassName.isMember("java.util.Map$1$aaa")); // member inside anonymous
- assertTrue(ClassName.isMember("java.util.Map$a1$aaa$bbb"));
- assertTrue(ClassName.isMember("java.util.Map$1a1$aaa")); // member inside local
- assertFalse(ClassName.isMember("java.util.Map$1a"));
- assertTrue(ClassName.isMember("java.util.Map$a12345$b12345"));
- assertFalse(ClassName.isMember("java.util.Map$12345a"));
- assertFalse(ClassName.isMember("java.util.Map$333"));
- assertFalse(ClassName.isMember("java.util.Map3$333"));
- }
-
- public void testIsLocal() throws Exception {
- class LocalClass {
- void foo() {
- System.getProperty("foo");
- }
- }
- new LocalClass().foo();
- assertFalse(ClassName.isLocal(java.util.Map.class.getName())); // top-level
- assertFalse(ClassName.isLocal(java.util.Map.Entry.class.getName())); // member
- assertTrue(ClassName.isLocal(Class.forName(this.getClass().getName() + "$1LocalClass").getName())); // local
- assertFalse(ClassName.isLocal(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassName.isLocal(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassName.isLocal(array.getClass().getName()));
- Class<?> localClass = Class.forName(this.getClass().getName() + "$1LocalClass"); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassName.isLocal(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassName.isLocal(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassName.isLocal("java.util.Map$a1"));
- assertFalse(ClassName.isLocal("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassName.isLocal("java.util.Map$11$aaa"));
- assertTrue(ClassName.isLocal("java.util.Map$1a"));
- assertTrue(ClassName.isLocal("java.util.Map$2abc"));
- assertTrue(ClassName.isLocal("java.util.Map$2abc1"));
- assertFalse(ClassName.isLocal("java.util.Map$a12345$b12345"));
- assertTrue(ClassName.isLocal("java.util.Map$12345$1234a"));
- assertFalse(ClassName.isLocal("java.util.Map$333"));
- assertFalse(ClassName.isLocal("java.util.Map3$333"));
- }
-
- public void testIsAnonymous() throws Exception {
- assertFalse(ClassName.isAnonymous(java.util.Map.class.getName())); // top-level
- assertFalse(ClassName.isAnonymous(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassName.isAnonymous(Class.forName(this.getClass().getName() + "$1LocalClass").getName())); // local
- assertTrue(ClassName.isAnonymous(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassName.isAnonymous(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassName.isAnonymous(array.getClass().getName()));
- Class<?> localClass = Class.forName(this.getClass().getName() + "$1LocalClass"); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassName.isAnonymous(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassName.isAnonymous(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassName.isAnonymous("java.util.Map$a1"));
- assertFalse(ClassName.isAnonymous("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassName.isAnonymous("java.util.Map$1a1$aaa"));
- assertFalse(ClassName.isAnonymous("java.util.Map$1$a"));
- assertFalse(ClassName.isAnonymous("java.util.Map$1a"));
- assertFalse(ClassName.isAnonymous("java.util.Map$a12345$b12345"));
- assertFalse(ClassName.isAnonymous("java.util.Map$12345$a1234"));
- assertTrue(ClassName.isAnonymous("java.util.Map$333"));
- assertTrue(ClassName.isAnonymous("java.util.Map3$333"));
- }
-
- public void testIsReference() throws Exception {
- assertFalse(ClassName.isReference(int.class.getName())); // top-level
-
- assertTrue(ClassName.isReference(java.util.Map.class.getName())); // top-level
- assertTrue(ClassName.isReference(java.util.Map.Entry.class.getName())); // member
- assertTrue(ClassName.isReference(Class.forName(this.getClass().getName() + "$1LocalClass").getName())); // local
- assertTrue(ClassName.isReference(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertTrue(ClassName.isReference(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertTrue(ClassName.isReference(array.getClass().getName()));
- Class<?> localClass = Class.forName(this.getClass().getName() + "$1LocalClass"); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertTrue(ClassName.isReference(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertTrue(ClassName.isReference(array.getClass().getName()));
- }
-
- public void testIsPrimitive() {
- assertTrue(void.class.isPrimitive());
-
- assertTrue(ClassName.isPrimitive(void.class.getName()));
- assertTrue(ClassName.isPrimitive(int.class.getName()));
- assertTrue(ClassName.isPrimitive(float.class.getName()));
- assertTrue(ClassName.isPrimitive(boolean.class.getName()));
-
- assertFalse(ClassName.isPrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassName.isPrimitive(java.lang.String.class.getName()));
- assertFalse(ClassName.isPrimitive(java.lang.Boolean.class.getName()));
- assertFalse(ClassName.isPrimitive(java.lang.Integer.class.getName()));
- }
-
- public void testIsPrimitiveWrapper() {
- assertFalse(ClassName.isPrimitiveWrapper(void.class.getName()));
- assertFalse(ClassName.isPrimitiveWrapper(int.class.getName()));
- assertFalse(ClassName.isPrimitiveWrapper(float.class.getName()));
- assertFalse(ClassName.isPrimitiveWrapper(boolean.class.getName()));
-
- assertFalse(ClassName.isPrimitiveWrapper(java.lang.reflect.Field.class.getName()));
- assertFalse(ClassName.isPrimitiveWrapper(java.lang.String.class.getName()));
- assertTrue(ClassName.isPrimitiveWrapper(java.lang.Boolean.class.getName()));
- assertTrue(ClassName.isPrimitiveWrapper(java.lang.Integer.class.getName()));
- }
-
- public void testIsVariablePrimitive() {
- assertFalse(ClassName.isVariablePrimitive(void.class.getName()));
-
- assertTrue(ClassName.isVariablePrimitive(int.class.getName()));
- assertTrue(ClassName.isVariablePrimitive(float.class.getName()));
- assertTrue(ClassName.isVariablePrimitive(boolean.class.getName()));
-
- assertFalse(ClassName.isVariablePrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassName.isVariablePrimitive(java.lang.String.class.getName()));
- assertFalse(ClassName.isVariablePrimitive(java.lang.Boolean.class.getName()));
- }
-
- public void testIsVariablePrimitiveWrapper() {
- assertFalse(ClassName.isVariablePrimitiveWrapper(java.lang.Void.class.getName()));
-
- assertTrue(ClassName.isVariablePrimitiveWrapper(java.lang.Integer.class.getName()));
- assertTrue(ClassName.isVariablePrimitiveWrapper(java.lang.Float.class.getName()));
- assertTrue(ClassName.isVariablePrimitiveWrapper(java.lang.Boolean.class.getName()));
-
- assertFalse(ClassName.isVariablePrimitiveWrapper(java.lang.Number.class.getName()));
- assertFalse(ClassName.isVariablePrimitiveWrapper(java.lang.String.class.getName()));
- assertFalse(ClassName.isVariablePrimitiveWrapper(java.lang.Object.class.getName()));
- }
-
- public void testGetWrapperClassName() {
- assertEquals(java.lang.Void.class.getName(), ClassName.getWrapperClassName(void.class.getName()));
- assertEquals(java.lang.Integer.class.getName(), ClassName.getWrapperClassName(int.class.getName()));
- assertEquals(java.lang.Float.class.getName(), ClassName.getWrapperClassName(float.class.getName()));
- assertEquals(java.lang.Boolean.class.getName(), ClassName.getWrapperClassName(boolean.class.getName()));
-
- assertNull(ClassName.getWrapperClassName(java.lang.String.class.getName()));
- }
-
- public void testGetPrimitiveClassName() {
- assertEquals(void.class.getName(), ClassName.getPrimitiveClassName(java.lang.Void.class.getName()));
- assertEquals(int.class.getName(), ClassName.getPrimitiveClassName(java.lang.Integer.class.getName()));
- assertEquals(float.class.getName(), ClassName.getPrimitiveClassName(java.lang.Float.class.getName()));
- assertEquals(boolean.class.getName(), ClassName.getPrimitiveClassName(java.lang.Boolean.class.getName()));
-
- assertNull(ClassName.getPrimitiveClassName(java.lang.String.class.getName()));
- }
-
- public void testAreAutoboxEquivalents() {
- assertTrue(ClassName.areAutoboxEquivalents(Integer.class.getName(), Integer.class.getName()));
- assertTrue(ClassName.areAutoboxEquivalents(int.class.getName(), Integer.class.getName()));
- assertTrue(ClassName.areAutoboxEquivalents(Integer.class.getName(), int.class.getName()));
- assertFalse(ClassName.areAutoboxEquivalents(int.class.getName(), Boolean.class.getName()));
- assertTrue(ClassName.areAutoboxEquivalents(String.class.getName(), String.class.getName()));
- }
-
- public void testForCode() {
- assertEquals("byte", ClassName.forCode('B'));
- assertEquals("char", ClassName.forCode('C'));
- assertEquals("double", ClassName.forCode('D'));
- assertEquals("float", ClassName.forCode('F'));
- assertEquals("int", ClassName.forCode('I'));
- assertEquals("long", ClassName.forCode('J'));
- assertEquals("short", ClassName.forCode('S'));
- assertEquals("boolean", ClassName.forCode('Z'));
- assertEquals("void", ClassName.forCode('V'));
-
- assertNull(ClassName.forCode('X'));
-
- assertEquals("byte", ClassName.forCode((int) 'B'));
- assertEquals("char", ClassName.forCode((int) 'C'));
- assertEquals("double", ClassName.forCode((int) 'D'));
- assertEquals("float", ClassName.forCode((int) 'F'));
- assertEquals("int", ClassName.forCode((int) 'I'));
- assertEquals("long", ClassName.forCode((int) 'J'));
- assertEquals("short", ClassName.forCode((int) 'S'));
- assertEquals("boolean", ClassName.forCode((int) 'Z'));
- assertEquals("void", ClassName.forCode((int) 'V'));
-
- assertNull(ClassName.forCode((int) 'X'));
- }
-
- public void testGetCodeForClassName() {
- assertEquals('I', ClassName.getCodeForClassName(int.class.getName()));
- assertEquals('I', ClassName.getCodeForClassName("int"));
- assertEquals('B', ClassName.getCodeForClassName(byte.class.getName()));
- assertEquals('B', ClassName.getCodeForClassName("byte"));
-
- assertEquals((char) 0, ClassName.getCodeForClassName(java.lang.Object.class.getName()));
- }
-
- public void testConstructor() {
- boolean exCaught = false;
- try {
- Object at = ReflectionTools.newInstance(ClassName.class);
- fail("bogus: " + at); //$NON-NLS-1$
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- if (ex.getCause().getCause() instanceof UnsupportedOperationException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClasspathTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClasspathTests.java
deleted file mode 100644
index 6542662416..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ClasspathTests.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.Classpath;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-
-@SuppressWarnings("nls")
-public class ClasspathTests extends TestCase {
- private static final String JAVA_HOME = System.getProperty("java.home");
-
- public ClasspathTests(String name) {
- super(name);
- }
-
- public void testCompressed() {
- String path = "";
-
- // no changes
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;;C:\\jdk\\jaws.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- // no changes
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\..\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk1\\jdk2\\jdk3\\..\\..\\..\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().getPath();
- assertEquals(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- }
-
- public void testConvertToClassName() {
- String fileName = "java/lang/String.class";
- File file = new File(fileName);
- String className = Classpath.convertToClassName(file);
- assertEquals(java.lang.String.class.getName(), className);
- }
-
- public void testConvertToClass() throws ClassNotFoundException {
- String fileName = "java/lang/String.class";
- File file = new File(fileName);
- Class<?> javaClass = Classpath.convertToClass(file);
- assertEquals(java.lang.String.class, javaClass);
- }
-
- public void testConvertToArchiveClassFileEntryName() {
- String fileName = Classpath.convertToArchiveClassFileEntryName(java.lang.String.class);
- assertEquals("java/lang/String.class", fileName);
- }
-
- public void testConvertToArchiveEntryNameBase() {
- String fileName = Classpath.convertToArchiveEntryNameBase(java.lang.String.class);
- assertEquals("java/lang/String", fileName);
- }
-
- public void testConvertToClassFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToClassFileName(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String.class", fileName);
- }
-
- public void testConvertToClassFileString() {
- char sc = File.separatorChar;
- File file = Classpath.convertToClassFile(java.lang.String.class.getName());
- assertEquals("java" + sc + "lang" + sc + "String.class", file.getPath());
- }
-
- public void testConvertToClassFileClass() {
- char sc = File.separatorChar;
- File file = Classpath.convertToClassFile(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String.class", file.getPath());
- }
-
- public void testConvertToJavaFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToJavaFileName(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String.java", fileName);
- }
-
- public void testConvertToJavaFileString() {
- char sc = File.separatorChar;
- File file = Classpath.convertToJavaFile(java.lang.String.class.getName());
- assertEquals("java" + sc + "lang" + sc + "String.java", file.getPath());
- }
-
- public void testConvertToJavaFileClass() {
- char sc = File.separatorChar;
- File file = Classpath.convertToJavaFile(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String.java", file.getPath());
- }
-
- public void testConvertToFileNameBase() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToFileNameBase(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String", fileName);
- }
-
- public void testConvertToURLs() {
- Iterator<URL> entries = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).getURLs().iterator();
- assertEquals(this.morphURL("/C:/jdk/rt.jar"), entries.next().getPath());
- assertEquals(this.morphURL("/C:/jdk/i18n.jar"), entries.next().getPath());
- assertEquals(this.morphURL("/C:/jdk/jaws.jar"), entries.next().getPath());
- assertEquals(this.morphURL("/C:/foo/classes"), entries.next().getPath());
- assertEquals(this.morphURL("/C:/bar/bar.jar"), entries.next().getPath());
- assertFalse(entries.hasNext());
- }
-
- public void testGetEntries() {
- Classpath cp = new Classpath(this.morph("C:\\jdk\\rt.jar;;.;C:\\jdk\\i18n.jar;;;C:\\jdk\\jaws.jar;;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\bar\\bar.jar;"));
- Iterator<Classpath.Entry> entries = cp.getEntries().iterator();
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries.next().getFileName());
- assertEquals(this.morph("."), entries.next().getFileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries.next().getFileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries.next().getFileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries.next().getFileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries.next().getFileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries.next().getFileName());
- assertFalse(entries.hasNext());
-
- cp = cp.compressed();
- entries = cp.getEntries().iterator();
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries.next().getFileName());
- assertEquals(this.morph("."), entries.next().getFileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries.next().getFileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries.next().getFileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries.next().getFileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries.next().getFileName());
- assertFalse(entries.hasNext());
- }
-
- public void testGetEntryForFileNamed() {
- Classpath.Entry entry = null;
-
- // in the middle - qualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).getEntryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.getFileName());
-
- // in the middle - unqualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;rt.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).getEntryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.getFileName());
-
- // at the beginning - qualified
- entry = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).getEntryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.getFileName());
-
- // at the beginning - unqualified
- entry = new Classpath(this.morph("rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).getEntryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.getFileName());
-
- // at the end - qualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rt.jar")).getEntryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.getFileName());
-
- // at the end - unqualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;rt.jar")).getEntryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.getFileName());
-
- // alone - qualified
- entry = new Classpath(this.morph("C:\\jdk\\rt.jar")).getEntryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.getFileName());
-
- // alone - unqualified
- entry = new Classpath("rt.jar").getEntryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.getFileName());
-
- // trick entry at the beginning
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).getEntryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.getFileName());
-
- // trick entry in the middle
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).getEntryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.getFileName());
-
- // trick entry at the end
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).getEntryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.getFileName());
-
- // missing
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).getEntryForFileNamed("rt.jar");
- assertEquals("path entry should not be found", null, entry);
-
- }
-
- public void testGetEntryForClassNamed() {
- assertNotNull(Classpath.completeClasspath().getEntryForClassNamed(java.lang.String.class.getName()));
- assertNull(Classpath.completeClasspath().getEntryForClassNamed("foo.bar.Baz"));
- }
-
- public void testLocationForClass() {
- Class<?> javaClass = Classpath.class;
- File entry = new File(Classpath.locationFor(javaClass));
- if (entry.isFile() || entry.isDirectory()) {
- assertTrue(entry.exists());
- }
- if (entry.isDirectory()) {
- assertTrue(new File(entry, Classpath.convertToClassFileName(javaClass)).exists());
- }
- }
-
- public void testRtJarName() throws IOException {
- File rtFile = new File(Classpath.rtJarName());
- assertTrue("rt.jar does not exist", rtFile.exists());
-
- JarFile rtJarFile = new JarFile(rtFile);
- JarEntry entry = rtJarFile.getJarEntry("java/lang/Object.class");
- rtJarFile.close();
- assertTrue("bogus rt.jar", entry != null);
- }
-
- public void testJREClassNames() {
- assertTrue("Vector is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().getClassNames(), java.util.Vector.class.getName()));
- assertTrue("File is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().getClassNames(), java.io.File.class.getName()));
- }
-
- public void testJavaExtensionDirectoryNames() {
- char sep = File.separatorChar;
- String stdExtDirName = JAVA_HOME + sep + "lib" + sep + "ext";
- assertTrue("standard extension dir name missing: " + stdExtDirName, ArrayTools.contains(Classpath.javaExtensionDirectoryNames(), stdExtDirName));
- }
-
- public void testJavaExtensionDirectories() {
- char sep = File.separatorChar;
- File stdExtDir = new File(JAVA_HOME + sep + "lib" + sep + "ext");
- assertTrue("standard extension dir missing: " + stdExtDir.getParent(), ArrayTools.contains(Classpath.javaExtensionDirectories(), stdExtDir));
- }
-
- public void testJavaExtensionClasspathEntries() {
- char sep = File.separatorChar;
- String jdk = System.getProperty("java.version");
- if (jdk.startsWith("1.4") || jdk.startsWith("1.5") || jdk.startsWith("1.6")) {
- Collection<String> jarNames = new ArrayList<String>();
- Iterable<Classpath.Entry> entries = Classpath.javaExtensionClasspath().getEntries();
- for (Classpath.Entry entry : entries) {
- jarNames.add(entry.getFileName());
- }
- String stdExtJarName = JAVA_HOME + sep + "lib" + sep + "ext" + sep + "dnsns.jar";
- String msg = "jdk 1.4.x standard extension jar missing: " + stdExtJarName;
- boolean jarPresent = jarNames.contains(stdExtJarName);
- if (Tools.jvmIsSun() || (Tools.jvmIsIBM() && jdk.startsWith("1.6"))) {
- assertTrue(msg, jarPresent);
- }
- } else {
- fail("we need to update this test for the current jdk");
- }
- }
-
- public void testJavaExtensionClassNames() {
- String jdk = System.getProperty("java.version");
- if (jdk.startsWith("1.4") || jdk.startsWith("1.5") || jdk.startsWith("1.6")) {
- String className = "sun.net.spi.nameservice.dns.DNSNameService";
- String msg = "jdk 1.4.x standard extension class missing: " + className;
- boolean classPresent = CollectionTools.contains(Classpath.javaExtensionClasspath().classNames(), className);
- if (Tools.jvmIsSun() || (Tools.jvmIsIBM() && jdk.startsWith("1.6"))) {
- assertTrue(msg, classPresent);
- }
- } else {
- fail("we need to update this test for the current jdk");
- }
- }
-
- public void testJavaClasspathClassNames() {
- String className = this.getClass().getName();
- ClassLoader cl = this.getClass().getClassLoader();
- // make sure we are running under the "normal" class loader;
- // when the tests are executed as an ANT task, they are run under
- // an ANT class loader and the "Java" classpath does not include this class
- if (cl.getClass().getName().startsWith("sun.misc")) {
- assertTrue("class missing: " + className, CollectionTools.contains(Classpath.javaClasspath().getClassNames(), className));
- }
- }
-
- public void testCompleteClasspathClassNames() {
- String className = this.getClass().getName();
- ClassLoader cl = this.getClass().getClassLoader();
- // make sure we are running under the "normal" class loader;
- // when the tests are executed as an ANT task, they are run under
- // an ANT class loader and the "Java" classpath does not include this class
- if (cl.getClass().getName().startsWith("sun.misc")) {
- assertTrue("class missing: " + className, CollectionTools.contains(Classpath.completeClasspath().getClassNames(), className));
- }
- }
-
- public void testClasspathForClass() {
- assertNotNull(Classpath.classpathFor(java.lang.String.class));
- }
-
- public void testAddClassNamesTo() {
- Collection<String> classNames = new ArrayList<String>(1000);
- Classpath.bootClasspath().addClassNamesTo(classNames);
- assertTrue(classNames.contains(java.util.Vector.class.getName()));
- }
-
- public void testToString() {
- assertNotNull(Classpath.bootClasspath().toString());
- }
-
- public void testEntry_getCanonicalFile() {
- Classpath.Entry entry = Classpath.bootClasspath().getEntryForClassNamed(java.lang.String.class.getName());
- assertTrue(entry.getCanonicalFile().getPath().endsWith(".jar"));
- }
-
- public void testEntry_getCanonicalFileName() {
- Classpath.Entry entry = Classpath.bootClasspath().getEntryForClassNamed(java.lang.String.class.getName());
- String name = entry.getCanonicalFileName();
- if (Tools.jvmIsSun()) {
- assertTrue(name.endsWith("rt.jar"));
- } else if (Tools.jvmIsIBM()) {
- assertTrue(name.endsWith("vm.jar"));
- }
- }
-
- public void testEntry_equals() {
- Classpath.Entry entry = Classpath.bootClasspath().getEntryForClassNamed(java.lang.String.class.getName());
- assertFalse(entry.equals("foo"));
- }
-
- public void testEntry_containsClass() {
- Classpath.Entry entry = Classpath.bootClasspath().getEntryForClassNamed(java.lang.String.class.getName());
- assertTrue(entry.contains(java.lang.String.class));
- }
-
- public void testEntry_containsString() {
- Classpath.Entry entry = Classpath.bootClasspath().getEntryForClassNamed(java.lang.String.class.getName());
- assertTrue(entry.contains(java.lang.String.class.getName()));
- }
-
- public void testEntry_getClassNames() {
- Classpath.Entry entry = Classpath.bootClasspath().getEntryForClassNamed(java.lang.String.class.getName());
- assertTrue(CollectionTools.contains(entry.getClassNames(), java.lang.String.class.getName()));
- }
-
- public void testEntry_classNames() {
- Classpath.Entry entry = Classpath.bootClasspath().getEntryForClassNamed(java.lang.String.class.getName());
- assertTrue(CollectionTools.contains(entry.classNames(), java.lang.String.class.getName()));
- }
-
- /**
- * morph the specified path to a platform-independent path
- */
- private String morph(String path) {
- String result = path;
- result = result.replace('\\', File.separatorChar);
- result = result.replace(';', File.pathSeparatorChar);
- if (!ArrayTools.contains(File.listRoots(), new File("C:\\"))) {
- result = result.replaceAll("C:", "");
- }
- return result;
- }
-
- /**
- * morph the specified URL to a platform-independent path
- */
- private String morphURL(String url) {
- String result = url;
- if (!ArrayTools.contains(File.listRoots(), new File("C:\\"))) {
- result = result.replaceAll("/C:", "");
- }
- return result;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CollectionToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CollectionToolsTests.java
deleted file mode 100644
index 5bb02201fd..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CollectionToolsTests.java
+++ /dev/null
@@ -1,2418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import java.util.Random;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.Range;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.ReverseComparator;
-import org.eclipse.jpt.common.utility.internal.enumerations.EmptyEnumeration;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
-
-@SuppressWarnings("nls")
-public class CollectionToolsTests extends TestCase {
-
- public CollectionToolsTests(String name) {
- super(name);
- }
-
-
- // ********** add all **********
-
- public void testAddAllCollectionIterable_StringModified() {
- List<String> list1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, iterable2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(this.buildStringList2()));
- }
-
- public void testAddAllCollectionIterable_StringUnmodified() {
- Set<String> set1 = this.buildStringSet1();
- Iterable<String> iterable3 = this.buildStringList1(); // same elements as set1
- assertFalse(CollectionTools.addAll(set1, iterable3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(this.buildStringList1()));
- }
-
- public void testAddAllCollectionIterable_ObjectModified() {
- List<Object> list1 = this.buildObjectList1();
- Iterable<String> iterable2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, iterable2));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll((List<String>) iterable2));
- }
-
- public void testAddAllCollectionIterable_ObjectUnmodified() {
- Set<Object> set1 = this.buildObjectSet1();
- Iterable<String> iterable3 = this.buildStringList1(); // same elements as set1
- assertFalse(CollectionTools.addAll(set1, iterable3));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll((List<String>) iterable3));
- }
-
- public void testAddAllCollectionIterable_EmptyIterable() {
- Set<Object> set1 = this.buildObjectSet1();
- assertFalse(CollectionTools.addAll(set1, EmptyIterable.instance()));
- assertEquals(3, set1.size());
- }
-
- public void testAddAllCollectionIterableInt_Modified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- Iterable<String> iterable2 = list2;
- assertTrue(CollectionTools.addAll(list1, iterable2, list2.size()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(this.buildStringList2()));
- }
-
- public void testAddAllCollectionIterableInt_Unmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list1 = this.buildStringList1(); // same elements as set1
- Iterable<String> iterable3 = list1;
- assertFalse(CollectionTools.addAll(set1, iterable3, list1.size()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(this.buildStringList1()));
- }
-
- public void testAddAllCollectionIterator_StringModified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIterator_StringUnmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIterator_ObjectModified() {
- List<Object> list1 = this.buildObjectList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIterator_ObjectUnmodified() {
- Set<Object> set1 = this.buildObjectSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIterator_EmptyIterator() {
- List<String> list1 = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list1, EmptyIterator.<String>instance()));
- assertEquals(3, list1.size());
- }
-
- public void testAddAllCollectionIteratorInt_Modified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator(), 3));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIteratorInt_Unmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator(), 3));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIteratorInt_EmptyIterator() {
- List<String> list1 = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list1, EmptyIterator.<String>instance(), 0));
- assertEquals(3, list1.size());
- }
-
- public void testAddAllCollectionObjectArray_StringModified() {
- List<String> list = this.buildStringList1();
- String[] a = this.buildStringArray1();
- assertTrue(CollectionTools.addAll(list, a));
- assertEquals(6, list.size());
- assertTrue(list.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllCollectionObjectArray_StringListEmptyArray() {
- List<String> list = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_StringUnmodified() {
- Set<String> set = this.buildStringSet1();
- String[] a = this.buildStringArray1();
- assertFalse(CollectionTools.addAll(set, a));
- assertEquals(3, set.size());
- assertTrue(set.containsAll(CollectionTools.collection(a)));
-
- assertFalse(CollectionTools.addAll(set, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_StringSetEmptyArray() {
- Set<String> set = this.buildStringSet1();
- assertFalse(CollectionTools.addAll(set, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_ObjectModified() {
- List<Object> list = this.buildObjectList1();
- String[] a = this.buildStringArray1();
-
- assertTrue(CollectionTools.addAll(list, a));
- assertEquals(6, list.size());
- assertTrue(list.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllCollectionObjectArray_ObjectUnmodified() {
- String[] a = this.buildStringArray1();
- Set<Object> set = this.buildObjectSet1();
- assertFalse(CollectionTools.addAll(set, a));
- assertEquals(3, set.size());
- assertTrue(set.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllListIntObjectArray() {
- List<String> list = this.buildStringList1();
- CollectionTools.addAll(list, 2, new String[] { "X", "X", "X" });
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntObjectArray_Zero() {
- List<String> list = new ArrayList<String>();
- CollectionTools.addAll(list, 0, new String[] { "X", "X", "X" });
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntObjectArray_EmptyArray() {
- List<String> list = this.buildStringList1();
- CollectionTools.addAll(list, 2, new String[0]);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 2, iterable);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable_Zero() {
- List<String> list = new ArrayList<String>();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 0, iterable);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable_EmptyIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = EmptyIterable.instance();
- CollectionTools.addAll(list, 2, iterable);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 2, iterable, 3);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt_Zero() {
- List<String> list = new ArrayList<String>();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 0, iterable, 3);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt_EmptyIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = EmptyIterable.instance();
- CollectionTools.addAll(list, 2, iterable, 0);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 2, iterator);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator_Zero() {
- List<String> list = new ArrayList<String>();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 0, iterator);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator_EmptyIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = EmptyIterator.instance();
- CollectionTools.addAll(list, 2, iterator);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 2, iterator, 3);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt_Zero() {
- List<String> list = new ArrayList<String>();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 0, iterator, 3);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt_EmptyIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = EmptyIterator.instance();
- CollectionTools.addAll(list, 2, iterator, 0);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
-
- // ********** bag **********
-
- public void testBagEnumeration_String() {
- Bag<String> b = CollectionTools.bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumeration_Object() {
- Bag<Object> b = CollectionTools.<Object>bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumeration_Empty() {
- Bag<Object> b = CollectionTools.<Object>bag(EmptyEnumeration.instance());
- assertEquals(0, b.size());
- }
-
- public void testBagEnumerationInt() {
- Bag<String> b = CollectionTools.bag(this.buildStringVector1().elements(), 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumerationInt_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyEnumeration.<String>instance(), 3);
- assertEquals(0, b.size());
- }
-
- public void testBagIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Bag<String> b = CollectionTools.bag(iterable);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Bag<String> b = CollectionTools.bag(iterable, 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterator_String() {
- Bag<String> b = CollectionTools.bag(this.buildStringList1().iterator());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterator_StringObject() {
- Collection<String> c = new ArrayList<String>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- Bag<Object> b = CollectionTools.<Object>bag(c.iterator());
- assertEquals(4, b.size());
- assertTrue(b.containsAll(c));
- }
-
- public void testBagIterator_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyIterator.<String>instance());
- assertEquals(0, b.size());
- }
-
- public void testBagIteratorInt() {
- Bag<String> b = CollectionTools.bag(this.buildStringList1().iterator(), 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIteratorInt_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyIterator.<String>instance(), 3);
- assertEquals(0, b.size());
- }
-
- public void testBagObjectArray() {
- Bag<String> b = CollectionTools.bag(this.buildStringArray1());
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, (Object[]) this.buildStringArray1()));
- }
-
- public void testBagObjectArray_Vararg() {
- Bag<String> b = CollectionTools.bag("foo", "bar", "baz");
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, new Object[]{"foo", "bar", "baz"}));
- }
-
- public void testBagObjectArray_Empty() {
- Bag<String> b = CollectionTools.bag(Bag.Empty.<String>instance());
- assertEquals(0, b.size());
- }
-
-
- // ********** collection **********
-
- public void testCollectionEnumeration() {
- Collection<String> c = CollectionTools.collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionEnumeration_ObjectString() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionEnumerationInt() {
- Collection<String> c = CollectionTools.collection(this.buildStringVector1().elements(), 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Collection<String> c = CollectionTools.collection(iterable);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Collection<String> c = CollectionTools.collection(iterable, 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterator() {
- Collection<String> c = CollectionTools.collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterator_ObjectString() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIteratorInt() {
- Collection<String> c = CollectionTools.collection(this.buildStringList1().iterator(), 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionObjectArray() {
- Collection<String> c = CollectionTools.collection(this.buildStringArray1());
- assertEquals(3, c.size());
- assertTrue(CollectionTools.containsAll(c, (Object[]) this.buildStringArray1()));
- }
-
-
- // ********** contains **********
-
- public void testContainsEnumerationObject_String() {
- Vector<String> v = this.buildStringVector1();
- assertTrue(CollectionTools.contains(v.elements(), "one"));
- assertFalse(CollectionTools.contains(v.elements(), null));
- v.add(null);
- assertTrue(CollectionTools.contains(v.elements(), null));
- }
-
- public void testContainsEnumerationObject_Object() {
- Vector<Object> c = new Vector<Object>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- String one = "one";
- assertTrue(CollectionTools.contains(c.elements(), one));
- assertFalse(CollectionTools.contains(c.elements(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.elements(), null));
- }
-
- public void testContainsIterableObject() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = c;
- assertTrue(CollectionTools.contains(iterable, "one"));
- assertFalse(CollectionTools.contains(iterable, null));
- c.add(null);
- assertTrue(CollectionTools.contains(iterable, null));
- }
-
- public void testContainsIteratorObject_String() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.contains(c.iterator(), "one"));
- assertFalse(CollectionTools.contains(c.iterator(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.iterator(), null));
- }
-
- public void testContainsIteratorObject_Object() {
- Collection<Object> c = new HashBag<Object>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- String one = "one";
- assertTrue(CollectionTools.contains(c.iterator(), one));
- assertFalse(CollectionTools.contains(c.iterator(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.iterator(), null));
- }
-
-
- // ********** contains all **********
-
- public void testContainsAllCollectionIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), iterable));
- }
-
- public void testContainsAllCollectionIterator_String() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildStringList1().iterator()));
- }
-
- public void testContainsAllCollectionIterator_Object() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("two");
- c2.add("zero");
- c2.add("one");
- assertTrue(CollectionTools.containsAll(c1, c2.iterator()));
- }
-
- public void testContainsAllCollectionObjectArray_StringObject() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildObjectArray1()));
- }
-
- public void testContainsAllCollectionObjectArray() {
- Object[] a = new Object[] { "zero", "one", "two" };
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), a));
- }
-
- public void testContainsAllIterableCollection() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildStringList1()));
- }
-
- public void testContainsAllIterableIntCollection() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildStringList1()));
- }
-
- public void testContainsAllIterableIterable() {
- Iterable<String> iterable1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable1, iterable2));
- }
-
- public void testContainsAllIterableIntIterable() {
- Iterable<String> iterable1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable1, 3, iterable2));
- }
-
- public void testContainsAllIterableIterator() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildStringList1().iterator()));
- }
-
- public void testContainsAllIterableIntIterator() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildStringList1().iterator()));
- }
-
- public void testContainsAllIterableObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildObjectArray1()));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(iterable, this.buildObjectArray1()));
- }
-
- public void testContainsAllIterableIntObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildObjectArray1()));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(iterable, 3, this.buildObjectArray1()));
- }
-
- public void testContainsAllIteratorCollection_StringString() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList2()));
- }
-
- public void testContainsAllIteratorCollection_ObjectString() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
- assertTrue(CollectionTools.containsAll(c1.iterator(), c2));
- }
-
- public void testContainsAllIteratorIntCollection() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 5, this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 5, this.buildStringList2()));
- }
-
- public void testContainsAllIteratorIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), iterable));
- }
-
- public void testContainsAllIteratorIntIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, iterable));
- }
-
- public void testContainsAllIteratorIterator_StringString() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList2().iterator()));
- }
-
- public void testContainsAllIteratorIterator_ObjectString() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
- assertTrue(CollectionTools.containsAll(c1.iterator(), c2.iterator()));
- }
-
- public void testContainsAllIteratorIntIterator() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildStringList2().iterator()));
- }
-
- public void testContainsAllIteratorObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray2()));
- }
-
- public void testContainsAllIteratorIntObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildObjectArray2()));
- }
-
-
- // ********** diff **********
-
- public void testDiffEndListList() {
- List<String> list1 = new ArrayList<String>();
- list1.add("a");
- list1.add("b");
- list1.add("c");
- List<String> list2 = new ArrayList<String>();
- list2.add(new String("a"));
- list2.add(new String("b"));
- list2.add(new String("c"));
- assertEquals(-1, CollectionTools.diffEnd(list1, list2));
- }
-
- public void testDiffRangeListList() {
- List<String> list1 = new ArrayList<String>();
- list1.add("a");
- list1.add("b");
- list1.add("c");
- List<String> list2 = new ArrayList<String>();
- list2.add(new String("a"));
- list2.add(new String("b"));
- list2.add(new String("c"));
- assertEquals(new Range(3, -1), CollectionTools.diffRange(list1, list2));
- }
-
- public void testDiffStartListList() {
- List<String> list1 = new ArrayList<String>();
- list1.add("a");
- list1.add("b");
- list1.add("c");
- List<String> list2 = new ArrayList<String>();
- list2.add(new String("a"));
- list2.add(new String("b"));
- list2.add(new String("c"));
- assertEquals(3, CollectionTools.diffStart(list1, list2));
- }
-
-
- // ********** identity diff **********
-
- public void testIdentityDiffEndListList() {
- List<String> list1 = new ArrayList<String>();
- list1.add("a");
- list1.add("b");
- list1.add("c");
- List<String> list2 = new ArrayList<String>();
- list2.add("a");
- list2.add("b");
- list2.add("c");
- assertEquals(-1, CollectionTools.identityDiffEnd(list1, list2));
- }
-
- public void testIdentityDiffRangeListList() {
- List<String> list1 = new ArrayList<String>();
- list1.add("a");
- list1.add("b");
- list1.add("c");
- List<String> list2 = new ArrayList<String>();
- list2.add("a");
- list2.add("b");
- list2.add("c");
- assertEquals(new Range(3, -1), CollectionTools.identityDiffRange(list1, list2));
- }
-
- public void testIdentityDiffStartListList() {
- List<String> list1 = new ArrayList<String>();
- list1.add("a");
- list1.add("b");
- list1.add("c");
- List<String> list2 = new ArrayList<String>();
- list2.add("a");
- list2.add("b");
- list2.add("c");
- assertEquals(3, CollectionTools.identityDiffStart(list1, list2));
- }
-
-
- // ********** elements are equal **********
-
- public void testElementsAreDifferentIterableIterable() {
- List<String> list1 = new ArrayList<String>();
- list1.add("1000");
- list1.add("2000");
- list1.add("3000");
- list1.add("4000");
-
- List<String> list2 = new ArrayList<String>();
-
- assertTrue(CollectionTools.elementsAreDifferent(list1, list2));
- assertFalse(CollectionTools.elementsAreEqual(list1, list2));
- }
-
- public void testElementsAreDifferentIteratorIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("1000");
- list1.add("2000");
- list1.add("3000");
- list1.add("4000");
-
- List<String> list2 = new ArrayList<String>();
-
- assertTrue(CollectionTools.elementsAreDifferent(list1.iterator(), list2.iterator()));
- assertFalse(CollectionTools.elementsAreEqual(list1, list2));
- }
-
- public void testElementsAreEqualIterableIterable() {
- List<String> list1 = new ArrayList<String>();
- list1.add("1000");
- list1.add("2000");
- list1.add("3000");
- list1.add("4000");
-
- List<String> list2 = new ArrayList<String>();
- for (int i = 0; i < list1.size(); i++) {
- list2.add(String.valueOf((i + 1) * 1000));
- }
- assertFalse(CollectionTools.elementsAreIdentical(list1, list2));
- assertFalse(CollectionTools.elementsAreDifferent(list1, list2));
- assertTrue(CollectionTools.elementsAreEqual(list1, list2));
- }
-
- public void testElementsAreEqualIteratorIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("1000");
- list1.add("2000");
- list1.add("3000");
- list1.add("4000");
-
- List<String> list2 = new ArrayList<String>();
- for (int i = 0; i < list1.size(); i++) {
- list2.add(String.valueOf((i + 1) * 1000));
- }
- assertFalse(CollectionTools.elementsAreIdentical(list1.iterator(), list2.iterator()));
- assertFalse(CollectionTools.elementsAreDifferent(list1.iterator(), list2.iterator()));
- assertTrue(CollectionTools.elementsAreEqual(list1.iterator(), list2.iterator()));
- }
-
-
- // ********** elements are identical **********
-
- public void testElementsAreIdenticalIterableIterable() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
- Iterable<String> iterable1 = list1;
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- Iterable<String> iterable2 = list2;
- assertTrue(CollectionTools.elementsAreIdentical(iterable1, iterable2));
- assertTrue(CollectionTools.elementsAreEqual(iterable1, iterable2));
- }
-
- public void testElementsAreIdenticalIteratorIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- assertTrue(CollectionTools.elementsAreIdentical(list1.iterator(), list2.iterator()));
- assertTrue(CollectionTools.elementsAreEqual(list1.iterator(), list2.iterator()));
- }
-
- public void testElementsAreIdenticalIteratorIterator_Not() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- list2.remove(0);
- assertFalse(CollectionTools.elementsAreIdentical(list1.iterator(), list2.iterator()));
- assertFalse(CollectionTools.elementsAreEqual(list1.iterator(), list2.iterator()));
- }
-
- public void testElementsAreIdenticalIteratorIterator_DifferentSizes() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- list2.remove(3);
- assertFalse(CollectionTools.elementsAreIdentical(list1.iterator(), list2.iterator()));
- assertFalse(CollectionTools.elementsAreEqual(list1.iterator(), list2.iterator()));
- }
-
- public void testElementsAreNotIdenticalIterableIterable() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
- Iterable<String> iterable1 = list1;
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- Iterable<String> iterable2 = list2;
- assertFalse(CollectionTools.elementsAreNotIdentical(iterable1, iterable2));
- assertTrue(CollectionTools.elementsAreEqual(iterable1, iterable2));
- }
-
- public void testElementsAreNotIdenticalIteratorIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- assertFalse(CollectionTools.elementsAreNotIdentical(list1.iterator(), list2.iterator()));
- assertTrue(CollectionTools.elementsAreEqual(list1.iterator(), list2.iterator()));
- }
-
- public void testElementsAreNotIdenticalIteratorIterator_Not() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- list2.remove(0);
- assertTrue(CollectionTools.elementsAreNotIdentical(list1.iterator(), list2.iterator()));
- assertFalse(CollectionTools.elementsAreEqual(list1.iterator(), list2.iterator()));
- }
-
- public void testElementsAreNotIdenticalIteratorIterator_DifferentSizes() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- list2.remove(3);
- assertTrue(CollectionTools.elementsAreNotIdentical(list1.iterator(), list2.iterator()));
- assertFalse(CollectionTools.elementsAreEqual(list1.iterator(), list2.iterator()));
- }
-
-
- // ********** get **********
-
- public void testGetIterableInt() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = list;
- String o = CollectionTools.get(iterable, 1);
- assertEquals("one", o);
- list.add(null);
- o = CollectionTools.get(iterable, 3);
- assertNull(o);
- }
-
- public void testGetIteratorInt1() {
- List<String> list = this.buildStringList1();
- String o = CollectionTools.get(list.iterator(), 1);
- assertEquals("one", o);
- list.add(null);
- o = CollectionTools.get(list.iterator(), list.size() - 1);
- assertNull(o);
- }
-
- public void testGetIteratorInt2() {
- List<String> list = this.buildStringList1();
- boolean exCaught = false;
- try {
- CollectionTools.get(list.iterator(), list.size());
- fail();
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- // ********** hash code **********
-
- public void testHashCodeIterable1() {
- Iterable<String> iterable = null;
- assertEquals(0, CollectionTools.hashCode(iterable));
- }
-
- public void testHashCodeIterable2() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = list;
- int hashCode = CollectionTools.hashCode(iterable);
- assertEquals(list.hashCode(), hashCode);
-
- list.add(null);
- hashCode = CollectionTools.hashCode(iterable);
- assertEquals(list.hashCode(), hashCode);
- }
-
-
- // ********** index of **********
-
- public void testIndexOfIterableObject_String() {
- Iterable<String> iterable = this.buildStringList1();
- assertEquals(1, CollectionTools.indexOf(iterable, "one"));
- }
-
- public void testIndexOfIteratorObject_String() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.indexOf(list.iterator(), "one"));
- }
-
- public void testIndexOfIteratorObject_String_Not() {
- List<String> list = this.buildStringList1();
- assertEquals(-1, CollectionTools.indexOf(list.iterator(), null));
- assertEquals(-1, CollectionTools.indexOf(list.iterator(), "shazam"));
- }
-
- public void testIndexOfIteratorObject_Null() {
- List<String> list = this.buildStringList1();
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.iterator(), null));
- }
-
- public void testIndexOfIteratorObject_Object() {
- List<Object> list = new ArrayList<Object>();
- list.add("0");
- list.add("1");
- list.add("2");
- list.add("3");
-
- String one = "1";
- assertEquals(1, CollectionTools.indexOf(list.iterator(), one));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.iterator(), null));
- }
-
-
- // ********** insertion index of **********
-
- public void testInsertionIndexOfListComparableRandomAccess() {
- List<String> list = Arrays.asList(new String[] { "A", "C", "D" });
- assertEquals(1, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "C", "D" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" });
- assertEquals(4, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" });
- assertEquals(6, CollectionTools.insertionIndexOf(list, "E"));
-
- list = Arrays.asList(new String[] { "B", "B", "B", "C", "D" });
- assertEquals(0, CollectionTools.insertionIndexOf(list, "A"));
-
- list = Arrays.asList(new String[] { "A", "A", "B", "B", "C", "D" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "A"));
- }
-
- public void testInsertionIndexOfListComparableNonRandomAccess() {
- List<String> list = new LinkedList<String>(Arrays.asList(new String[] { "A", "C", "D" }));
- assertEquals(1, CollectionTools.insertionIndexOf(list, "B"));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "A", "B", "C", "D" }));
- assertEquals(1, CollectionTools.insertionIndexOf(list, "B"));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" }));
- assertEquals(1, CollectionTools.insertionIndexOf(list, "B"));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" }));
- assertEquals(6, CollectionTools.insertionIndexOf(list, "E"));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "B", "B", "B", "C", "D" }));
- assertEquals(0, CollectionTools.insertionIndexOf(list, "A"));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "A", "A", "B", "B", "C", "D" }));
- assertEquals(0, CollectionTools.insertionIndexOf(list, "A"));
- }
-
- public void testInsertionIndexOfListObjectComparatorRandomAccess() {
- Comparator<String> c = new ReverseComparator<String>();
- List<String> list = Arrays.asList(new String[] { "D", "C", "A" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "A" });
- assertEquals(3, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" });
- assertEquals(5, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" });
- assertEquals(0, CollectionTools.insertionIndexOf(list, "E", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B" });
- assertEquals(5, CollectionTools.insertionIndexOf(list, "A", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "A", "A" });
- assertEquals(6, CollectionTools.insertionIndexOf(list, "A", c));
- }
-
- public void testInsertionIndexOfListObjectComparatorNonRandomAccess() {
- Comparator<String> c = new ReverseComparator<String>();
- List<String> list = new LinkedList<String>(Arrays.asList(new String[] { "D", "C", "A" }));
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "D", "C", "B", "A" }));
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" }));
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" }));
- assertEquals(0, CollectionTools.insertionIndexOf(list, "E", c));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "D", "C", "B", "B", "B" }));
- assertEquals(5, CollectionTools.insertionIndexOf(list, "A", c));
-
- list = new LinkedList<String>(Arrays.asList(new String[] { "D", "C", "B", "B", "A", "A" }));
- assertEquals(4, CollectionTools.insertionIndexOf(list, "A", c));
- }
-
-
- // ********** is empty **********
-
- public void testIsEmptyIterable() {
- assertFalse(CollectionTools.isEmpty(buildObjectList1()));
- assertTrue(CollectionTools.isEmpty(EmptyIterable.instance()));
- }
-
- public void testIsEmptyIterator() {
- assertFalse(CollectionTools.isEmpty(buildObjectList1().iterator()));
- assertTrue(CollectionTools.isEmpty(EmptyIterator.instance()));
- }
-
-
- // ********** iterable/iterator **********
-
- public void testIterableObjectArray() {
- String[] strings = this.buildStringArray1();
- int i = 0;
- for (String string : CollectionTools.iterable(strings)) {
- assertEquals(strings[i++], string);
- }
- }
-
- public void testIteratorObjectArray() {
- String[] a = this.buildStringArray1();
- int i = 0;
- for (Iterator<String> stream = CollectionTools.iterator(a); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
-
- // ********** last **********
-
- public void testLastIterable1() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = list;
- assertEquals("two", CollectionTools.last(iterable));
- list.add(null);
- assertEquals(null, CollectionTools.last(iterable));
- }
-
- public void testLastIterable2() {
- Iterable<String> iterable = new ArrayList<String>();
- boolean exCaught = false;
- try {
- CollectionTools.last(iterable);
- fail();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testLastIterator1() {
- List<String> list = this.buildStringList1();
- assertEquals("two", CollectionTools.last(list.iterator()));
- list.add(null);
- assertEquals(null, CollectionTools.last(list.iterator()));
- }
-
- public void testLastIterator2() {
- List<String> list = new ArrayList<String>();
- boolean exCaught = false;
- try {
- CollectionTools.last(list.iterator());
- fail();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- // ********** last index of **********
-
- public void testLastIndexOfIterableObject() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = list;
- assertEquals(1, CollectionTools.lastIndexOf(iterable, "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.lastIndexOf(iterable, null));
- }
-
- public void testLastIndexOfIterableIntObject() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = list;
- assertEquals(1, CollectionTools.lastIndexOf(iterable, 23, "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.lastIndexOf(iterable, 42, null));
- }
-
- public void testLastIndexOfIteratorObject() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.lastIndexOf(list.iterator(), "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.lastIndexOf(list.iterator(), null));
- }
-
- public void testLastIndexOfIteratorObject_Empty() {
- assertEquals(-1, CollectionTools.lastIndexOf(EmptyIterator.instance(), "foo"));
- }
-
- public void testLastIndexOfIteratorIntObject() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.lastIndexOf(list.iterator(), 3, "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.lastIndexOf(list.iterator(), 4, null));
- }
-
- public void testLastIndexOfIteratorIntObject_Empty() {
- assertEquals(-1, CollectionTools.lastIndexOf(EmptyIterator.instance(), 42, "foo"));
- }
-
-
- // ********** list **********
-
- public void testListIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertEquals(this.buildStringList1(), CollectionTools.list(iterable));
- }
-
- public void testListIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- assertEquals(this.buildStringList1(), CollectionTools.list(iterable, 3));
- }
-
- public void testListIterator_String() {
- List<String> list = CollectionTools.list(this.buildStringList1().iterator());
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIterator_StringObject() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<Object> list2 = CollectionTools.<Object>list(list1.iterator());
- assertEquals(list1, list2);
- }
-
- public void testListIterator_Empty() {
- assertEquals(0, CollectionTools.list(EmptyIterator.instance()).size());
- }
-
- public void testListIteratorInt() {
- List<String> list = CollectionTools.list(this.buildStringList1().iterator(), 3);
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIteratorInt_Empty() {
- assertEquals(0, CollectionTools.list(EmptyIterator.instance(), 5).size());
- }
-
- public void testListObjectArray() {
- List<String> list = CollectionTools.list(this.buildStringArray1());
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIteratorObjectArray() {
- String[] a = this.buildStringArray1();
- int i = 0;
- for (ListIterator<String> stream = CollectionTools.listIterator(a); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
- public void testListIteratorObjectArrayInt() {
- String[] a = this.buildStringArray1();
- int i = 1;
- for (ListIterator<String> stream = CollectionTools.listIterator(a, 1); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
-
- // ********** move **********
-
- public void testMoveListIntIntRandomAccess() {
- List<String> list = new ArrayList<String>();
- CollectionTools.addAll(list, new String[] { "0", "1", "2", "3", "4", "5" });
-
- List<String> result = CollectionTools.move(list, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
- }
-
- public void testMoveListIntIntSequentialAccess() {
- List<String> list = new LinkedList<String>();
- CollectionTools.addAll(list, new String[] { "0", "1", "2", "3", "4", "5" });
-
- List<String> result = CollectionTools.move(list, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
- }
-
- public void testMoveListIntIntIntRandomAccess() {
- List<String> list = new ArrayList<String>(Arrays.asList(new String[] { "0", "1", "2", "3", "4", "5" }));
-
- List<String> result = CollectionTools.move(list, 4, 2, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 0);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
- }
-
- public void testMoveListIntIntIntSequentialAccess() {
- List<String> list = new LinkedList<String>(Arrays.asList(new String[] { "0", "1", "2", "3", "4", "5" }));
-
- List<String> result = CollectionTools.move(list, 4, 2, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 0);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
- }
-
-
- // ********** remove all **********
-
- public void testRemoveAllCollectionIterable() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, iterable));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.removeAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterableInt() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, iterable, 4));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.removeAll(c, iterable, 55));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterator_Empty() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, this.buildStringList1().iterator()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, this.buildStringList2().iterator()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, EmptyIterator.instance()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIteratorInt_Empty() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, this.buildStringList1().iterator(), 5));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, this.buildStringList2().iterator(), 5));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, EmptyIterator.instance(), 0));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterator_Duplicates() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionIterator_ObjectString() {
- Collection<Object> c = new ArrayList<Object>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionObjectArray_Empty() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, this.buildObjectArray1()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, this.buildObjectArray2()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, new Object[0]));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionObjectArray_Duplicates() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, (Object[]) a));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c,(Object[]) a));
- }
-
- public void testRemoveAllCollectionObjectArray_MoreDuplicates() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("a");
- c.add("d");
- c.add("d");
- c.add("a");
- c.add("c");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, (Object[]) a));
- assertEquals(3, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c, (Object[]) a));
- }
-
-
- // ********** remove all occurrences **********
-
- public void testRemoveAllOccurrencesCollectionObject() {
- Collection<String> c = this.buildStringList1();
- assertEquals(3, c.size());
- assertFalse(CollectionTools.removeAllOccurrences(c, "three"));
- assertTrue(CollectionTools.removeAllOccurrences(c, "two"));
- assertFalse(CollectionTools.removeAllOccurrences(c, "two"));
- assertEquals(2, c.size());
-
- c.add("five");
- c.add("five");
- c.add("five");
- assertEquals(5, c.size());
- assertTrue(CollectionTools.removeAllOccurrences(c, "five"));
- assertFalse(CollectionTools.removeAllOccurrences(c, "five"));
- assertEquals(2, c.size());
-
- c.add(null);
- c.add(null);
- c.add(null);
- assertEquals(5, c.size());
- assertTrue(CollectionTools.removeAllOccurrences(c, null));
- assertFalse(CollectionTools.removeAllOccurrences(c, null));
- assertEquals(2, c.size());
- }
-
-
- // ********** remove elements at index **********
-
- public void testRemoveElementsAtIndexListIntInt() {
- List<String> list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "A", "C", "A", "D" }));
- List<String> removed = CollectionTools.removeElementsAtIndex(list, 3, 2);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "D" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "C", "A" }, removed.toArray()));
-
- list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" }));
- removed = CollectionTools.removeElementsAtIndex(list, 3, 3);
- assertTrue(Arrays.equals(new String[] { "A", "B", "C" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "D", "E", "F" }, removed.toArray()));
-
- list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" }));
- removed = CollectionTools.removeElementsAtIndex(list, 0, 3);
- assertTrue(Arrays.equals(new String[] { "D", "E", "F" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "A", "B", "C" }, removed.toArray()));
- }
-
-
- // ********** remove duplicate elements **********
-
- public void testRemoveDuplicateElementsList1() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- assertTrue(CollectionTools.removeDuplicateElements(list));
- int i = 0;
- assertEquals("zero", list.get(i++));
- assertEquals("one", list.get(i++));
- assertEquals("two", list.get(i++));
- assertEquals(i, list.size());
- }
-
- public void testRemoveDuplicateElementsList2() {
- List<String> list = this.buildStringVector1();
- assertFalse(CollectionTools.removeDuplicateElements(list));
- int i = 0;
- assertEquals("zero", list.get(i++));
- assertEquals("one", list.get(i++));
- assertEquals("two", list.get(i++));
- assertEquals(i, list.size());
- }
-
- public void testRemoveDuplicateElementsList_Empty() {
- List<String> list = new ArrayList<String>();
- assertFalse(CollectionTools.removeDuplicateElements(list));
- assertEquals(0, list.size());
- }
-
- public void testRemoveDuplicateElementsList_SingleElement() {
- List<String> list = new ArrayList<String>();
- list.add("zero");
- assertFalse(CollectionTools.removeDuplicateElements(list));
- assertEquals(1, list.size());
- }
-
-
- // ********** retain all **********
-
- public void testRetainAllCollectionIterable() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- iterable = this.buildStringList2();
- assertTrue(CollectionTools.retainAll(c, iterable));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterableInt() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- iterable = this.buildStringList2();
- assertTrue(CollectionTools.retainAll(c, iterable, 7));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterator() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildStringList2().iterator()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterator_ObjectString() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
-
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
-
- assertFalse(CollectionTools.retainAll(c1, c2.iterator()));
- assertEquals(c2.size(), c1.size());
- assertEquals(c2, c1);
-
- Collection<String> c3 = new ArrayList<String>();
- c3.add("three");
- c3.add("four");
- c3.add("five");
- }
-
- public void testRetainAllCollectionIterator_EmptyIterator() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, EmptyIterator.instance()));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIterator_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator()));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIterator_EmptyCollectionEmptyIterator() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, EmptyIterator.instance()));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIteratorInt() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator(), 8));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildStringList2().iterator(), 9));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIteratorInt_EmptyIterator() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, EmptyIterator.instance(), 0));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIteratorInt_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator(), 3));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIteratorInt_EmptyCollectionEmptyIterator() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, EmptyIterator.instance(), 0));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionObjectArray() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildObjectArray1()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildObjectArray2()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionObjectArray_EmptyObjectArray() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, new Object[0]));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionObjectArray_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, (Object[]) new String[] { "foo" }));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionObjectArray_EmptyCollectionEmptyObjectArray() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, (Object[]) new String[0]));
- assertEquals(0, c.size());
- }
-
-
- // ********** reverse list **********
-
- public void testReverseListIterable() {
- Iterable<String> iterable = this.buildStringList1();
- List<String> actual = CollectionTools.reverseList(iterable);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- List<String> actual = CollectionTools.reverseList(iterable, 10);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterator_String() {
- List<String> actual = CollectionTools.reverseList(this.buildStringList1().iterator());
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterator_Object() {
- List<Object> actual = CollectionTools.<Object>reverseList(this.buildStringList1().iterator());
- List<Object> expected = this.buildObjectList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIteratorInt() {
- List<String> actual = CollectionTools.reverseList(this.buildStringList1().iterator(), 33);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
-
- // ********** rotate **********
-
- public void testRotateList() {
- List<String> actual = CollectionTools.rotate(this.buildStringList1());
- List<String> expected = this.buildStringList1();
- Collections.rotate(expected, 1);
- assertEquals(expected, actual);
- }
-
-
- // ********** set **********
-
- public void testSetIterable() {
- Iterable<String> iterable = this.buildStringSet1();
- assertEquals(this.buildStringSet1(), CollectionTools.set(iterable));
- }
-
- public void testSetIterableInt() {
- Iterable<String> iterable = this.buildStringSet1();
- assertEquals(this.buildStringSet1(), CollectionTools.set(iterable, 22));
- }
-
- public void testSetIterator_String() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator()));
- }
-
- public void testSetIterator_Object() {
- List<String> list = new ArrayList<String>();
- list.add("0");
- list.add("1");
- list.add("2");
- list.add("3");
- list.add("0");
- list.add("1");
- list.add("2");
- list.add("3");
- Set<String> set = new HashSet<String>();
- set.addAll(list);
-
- assertEquals(set, CollectionTools.<Object>set(list.iterator()));
- }
-
- public void testSetIteratorInt() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator(), 3));
- }
-
- public void testSetObjectArray() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().toArray()));
- }
-
-
- // ********** singleton iterator **********
-
- public void testSingletonIterator_String() {
- Iterator<String> stream = CollectionTools.singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator_Object() {
- Iterator<Object> stream = CollectionTools.<Object>singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator_Cast() {
- Iterator<Object> stream = CollectionTools.singletonIterator((Object) "foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonListIterator_String() {
- ListIterator<String> stream = CollectionTools.singletonListIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- assertFalse(stream.hasNext());
- assertTrue(stream.hasPrevious());
- assertEquals("foo", stream.previous());
- }
-
-
- // ********** size **********
-
- public void testSizeIterable() {
- Iterable<Object> iterable = this.buildObjectList1();
- assertEquals(3, CollectionTools.size(iterable));
- }
-
- public void testSizeIterator() {
- assertEquals(3, CollectionTools.size(this.buildObjectList1().iterator()));
- }
-
-
- // ********** sort **********
-
- public void testSortIterable() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>();
- ss.addAll(list);
-
- Iterable<String> iterable1 = list;
- Iterable<String> iterable2 = CollectionTools.<String>sort(iterable1);
- assertTrue(CollectionTools.elementsAreEqual(ss, iterable2));
- }
-
- public void testSortIterableInt() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>();
- ss.addAll(list);
-
- Iterable<String> iterable1 = list;
- Iterable<String> iterable2 = CollectionTools.<String>sort(iterable1, 77);
- assertTrue(CollectionTools.elementsAreEqual(ss, iterable2));
- }
-
- public void testSortIterableComparator() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>(new ReverseComparator<String>());
- ss.addAll(list);
-
- Iterable<String> iterable1 = list;
- Iterable<String> iterable2 = CollectionTools.<String>sort(iterable1, new ReverseComparator<String>());
- assertTrue(CollectionTools.elementsAreEqual(ss, iterable2));
- }
-
- public void testSortIterableComparatorInt() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>(new ReverseComparator<String>());
- ss.addAll(list);
-
- Iterable<String> iterable1 = list;
- Iterable<String> iterable2 = CollectionTools.<String>sort(iterable1, new ReverseComparator<String>(), 77);
- assertTrue(CollectionTools.elementsAreEqual(ss, iterable2));
- }
-
- public void testSortIterator() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>();
- ss.addAll(list);
-
- Iterator<String> iterator1 = list.iterator();
- Iterator<String> iterator2 = CollectionTools.<String>sort(iterator1);
- assertTrue(CollectionTools.elementsAreEqual(ss.iterator(), iterator2));
- }
-
- public void testSortIteratorInt() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>();
- ss.addAll(list);
-
- Iterator<String> iterator1 = list.iterator();
- Iterator<String> iterator2 = CollectionTools.<String>sort(iterator1, 77);
- assertTrue(CollectionTools.elementsAreEqual(ss.iterator(), iterator2));
- }
-
- public void testSortIteratorComparator() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>(new ReverseComparator<String>());
- ss.addAll(list);
-
- Iterator<String> iterator1 = list.iterator();
- Iterator<String> iterator2 = CollectionTools.<String>sort(iterator1, new ReverseComparator<String>());
- assertTrue(CollectionTools.elementsAreEqual(ss.iterator(), iterator2));
- }
-
- public void testSortIteratorComparatorInt() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss = new TreeSet<String>(new ReverseComparator<String>());
- ss.addAll(list);
-
- Iterator<String> iterator1 = list.iterator();
- Iterator<String> iterator2 = CollectionTools.<String>sort(iterator1, new ReverseComparator<String>(), 77);
- assertTrue(CollectionTools.elementsAreEqual(ss.iterator(), iterator2));
- }
-
-
- // ********** sorted set **********
-
- public void testSortedSetIterable() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.addAll(list);
-
- Iterable<String> iterable = list;
- SortedSet<String> ss2 = CollectionTools.<String>sortedSet(iterable);
- assertEquals(ss1, ss2);
- }
-
- public void testSortedSetIterableInt() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.addAll(list);
-
- Iterable<String> iterable = list;
- SortedSet<String> ss2 = CollectionTools.<String>sortedSet(iterable, 5);
- assertEquals(ss1, ss2);
- }
-
- public void testSortedSetIterableComparator() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss1 = new TreeSet<String>(new ReverseComparator<String>());
- ss1.addAll(list);
-
- Iterable<String> iterable = list;
- SortedSet<String> ss2 = CollectionTools.<String>sortedSet(iterable, new ReverseComparator<String>());
- assertEquals(ss1, ss2);
- }
-
- public void testSortedSetIterableComparatorInt() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss1 = new TreeSet<String>(new ReverseComparator<String>());
- ss1.addAll(list);
-
- Iterable<String> iterable = list;
- SortedSet<String> ss2 = CollectionTools.<String>sortedSet(iterable, new ReverseComparator<String>(), 5);
- assertEquals(ss1, ss2);
- }
-
- public void testSortedSetIterator() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.sortedSet(this.buildSortedStringSet1().iterator()));
- }
-
- public void testSortedSetIterator_TreeSet() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(ss1.iterator());
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetIteratorInt() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.sortedSet(this.buildSortedStringSet1().iterator(), 8));
- }
-
- public void testSortedSetObjectArray() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.sortedSet(this.buildStringSet1().toArray(new String[0])));
- }
-
- public void testSortedSetObjectArrayComparator() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("0");
- list.add("2");
- list.add("3");
- list.add("1");
-
- SortedSet<String> ss1 = new TreeSet<String>(new ReverseComparator<String>());
- ss1.addAll(list);
-
- String[] array = list.toArray(new String[list.size()]);
- SortedSet<String> ss2 = CollectionTools.<String>sortedSet(array, new ReverseComparator<String>());
- assertEquals(ss1, ss2);
- }
-
-
- // ********** Old School Vector **********
-
- public void testVectorIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Vector<String> v = CollectionTools.vector(iterable);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Vector<String> v = CollectionTools.vector(iterable, 8);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterator_String() {
- Vector<String> v = CollectionTools.vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterator_Object() {
- Vector<Object> v = CollectionTools.<Object>vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIteratorInt() {
- Vector<String> v = CollectionTools.vector(this.buildStringList1().iterator(), 7);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorObjectArray() {
- Vector<String> v = CollectionTools.vector(this.buildStringArray1());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
-
- // ********** single-use iterable **********
-
- public void testIterableIterator() {
- Iterator<Object> emptyIterator = EmptyIterator.instance();
- Iterable<Object> emptyIterable = CollectionTools.iterable(emptyIterator);
-
- assertFalse(emptyIterable.iterator().hasNext());
-
- boolean exceptionThrown = false;
- try {
- emptyIterator = emptyIterable.iterator();
- fail("invalid iterator: " + emptyIterator);
- } catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
- assertTrue("IllegalStateException not thrown.", exceptionThrown);
- }
-
- public void testIterableIterator_NPE() {
- Iterator<Object> nullIterator = null;
- boolean exceptionThrown = false;
- try {
- Iterable<Object> emptyIterable = CollectionTools.iterable(nullIterator);
- fail("invalid iterable: " + emptyIterable);
- } catch (NullPointerException ise) {
- exceptionThrown = true;
- }
- assertTrue(exceptionThrown);
- }
-
- public void testIterableIterator_ToString() {
- Iterator<Object> emptyIterator = EmptyIterator.instance();
- Iterable<Object> emptyIterable = CollectionTools.iterable(emptyIterator);
- assertNotNull(emptyIterable.toString());
- }
-
-
- // ********** java.util.Collections enhancements **********
-
- public void testCopyListList() {
- List<String> src = this.buildStringList1();
- List<String> dest = new ArrayList<String>();
- for (String s : src) {
- dest.add(s.toUpperCase());
- }
- List<String> result = CollectionTools.copy(dest, src);
- assertSame(dest, result);
- assertTrue(CollectionTools.elementsAreIdentical(src, dest));
- }
-
- public void testFillListObject() {
- List<String> list = this.buildStringList1();
- List<String> result = CollectionTools.fill(list, "foo");
- assertSame(list, result);
- for (String string : result) {
- assertEquals("foo", string);
- }
- }
-
- public void testShuffleList() {
- List<String> list = this.buildStringList1();
- List<String> result = CollectionTools.shuffle(list);
- assertSame(list, result);
- }
-
- public void testShuffleListRandom() {
- List<String> list = this.buildStringList1();
- List<String> result = CollectionTools.shuffle(list, new Random());
- assertSame(list, result);
- }
-
- public void testSortList() {
- List<String> list = this.buildStringList1();
- SortedSet<String> ss = new TreeSet<String>();
- ss.addAll(list);
- List<String> result = CollectionTools.sort(list);
- assertSame(list, result);
- assertTrue(CollectionTools.elementsAreEqual(ss, result));
- }
-
- public void testSwapListIntInt() {
- List<String> list = this.buildStringList1();
- List<String> result = CollectionTools.swap(list, 0, 1);
- assertSame(list, result);
- List<String> original = this.buildStringList1();
- assertEquals(original.get(0), result.get(1));
- assertEquals(original.get(1), result.get(0));
- assertEquals(original.get(2), result.get(2));
- }
-
- public void testConstructor() {
- boolean exCaught = false;
- try {
- Object at = ReflectionTools.newInstance(CollectionTools.class);
- fail("bogus: " + at); //$NON-NLS-1$
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- if (ex.getCause().getCause() instanceof UnsupportedOperationException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
-
- // ********** test harness **********
-
- private Object[] buildObjectArray1() {
- return new Object[] { "zero", "one", "two" };
- }
-
- private String[] buildStringArray1() {
- return new String[] { "zero", "one", "two" };
- }
-
- private Object[] buildObjectArray2() {
- return new Object[] { "three", "four", "five" };
- }
-
- private Vector<String> buildStringVector1() {
- Vector<String> v = new Vector<String>();
- this.addToCollection1(v);
- return v;
- }
-
- private List<String> buildStringList1() {
- List<String> l = new ArrayList<String>();
- this.addToCollection1(l);
- return l;
- }
-
- private List<Object> buildObjectList1() {
- List<Object> l = new ArrayList<Object>();
- this.addToCollection1(l);
- return l;
- }
-
- private void addToCollection1(Collection<? super String> c) {
- c.add("zero");
- c.add("one");
- c.add("two");
- }
-
- private List<String> buildStringList2() {
- List<String> l = new ArrayList<String>();
- this.addToCollection2(l);
- return l;
- }
-
- private void addToCollection2(Collection<? super String> c) {
- c.add("three");
- c.add("four");
- c.add("five");
- }
-
- private Set<String> buildStringSet1() {
- Set<String> s = new HashSet<String>();
- this.addToCollection1(s);
- return s;
- }
-
- private Set<Object> buildObjectSet1() {
- Set<Object> s = new HashSet<Object>();
- this.addToCollection1(s);
- return s;
- }
-
- private SortedSet<String> buildSortedStringSet1() {
- SortedSet<String> s = new TreeSet<String>();
- this.addToCollection1(s);
- return s;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandExecutorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandExecutorTests.java
deleted file mode 100644
index 693b9c91b4..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandExecutorTests.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.ThreadLocalCommandExecutor;
-
-public class CommandExecutorTests
- extends MultiThreadedTestCase
-{
-
- public CommandExecutorTests(String name) {
- super(name);
- }
-
- public void testDefaultCommandExecutor_toString() throws Exception {
- CommandExecutor commandExecutor = CommandExecutor.Default.instance();
- assertNotNull(commandExecutor.toString());
- }
-
- public void testDefaultCommandExecutor_serialization() throws Exception {
- CommandExecutor commandExecutor1 = CommandExecutor.Default.instance();
- CommandExecutor commandExecutor2 = TestTools.serialize(commandExecutor1);
- assertSame(commandExecutor1, commandExecutor2);
- }
-
- public void testDefaultCommandExecutor() {
- TestCommand testCommand = new TestCommand();
- assertEquals(0, testCommand.count);
- CommandExecutor commandExecutor = CommandExecutor.Default.instance();
- commandExecutor.execute(testCommand);
- assertEquals(1, testCommand.count);
- }
-
- static class TestCommand implements Command {
- int count = 0;
- public void execute() {
- this.count++;
- }
- }
-
- public void testThreadLocalCommandExecutor_toString() throws Exception {
- CommandExecutor commandExecutor = new ThreadLocalCommandExecutor();
- assertNotNull(commandExecutor.toString());
- }
-
- public void testThreadLocalCommandExecutor() throws Exception {
- ThreadLocalCommandExecutor threadLocalCommandExecutor = new ThreadLocalCommandExecutor();
- TestRunnable testRunnable1 = new TestRunnable(threadLocalCommandExecutor, 1);
- Thread thread1 = this.buildThread(testRunnable1);
- thread1.run();
-
- TestRunnable testRunnable2 = new TestRunnable(threadLocalCommandExecutor, 2);
- Thread thread2 = this.buildThread(testRunnable2);
- thread2.run();
-
- TestRunnable testRunnable3 = new TestRunnable(threadLocalCommandExecutor, 3, null);
- Thread thread3 = this.buildThread(testRunnable3);
- thread3.run();
-
- thread1.join();
- thread2.join();
- thread3.join();
-
- assertEquals(1, testRunnable1.testCommand.count);
- assertEquals(1, testRunnable1.testCommandExecutor.count);
-
- assertEquals(2, testRunnable2.testCommand.count);
- assertEquals(2, testRunnable2.testCommandExecutor.count);
-
- assertEquals(3, testRunnable3.testCommand.count);
- assertNull(testRunnable3.testCommandExecutor);
- }
-
- static class TestCommandExecutor implements CommandExecutor {
- int count = 0;
- public void execute(Command command) {
- this.count++;
- command.execute();
- }
- }
-
- static class TestRunnable implements Runnable {
- final ThreadLocalCommandExecutor threadLocalCommandExecutor;
- final int executionCount;
- final TestCommand testCommand = new TestCommand();
- final TestCommandExecutor testCommandExecutor;
- TestRunnable(ThreadLocalCommandExecutor threadLocalCommandExecutor, int executionCount) {
- this(threadLocalCommandExecutor, executionCount, new TestCommandExecutor());
- }
- TestRunnable(ThreadLocalCommandExecutor threadLocalCommandExecutor, int executionCount, TestCommandExecutor testCommandExecutor) {
- super();
- this.threadLocalCommandExecutor = threadLocalCommandExecutor;
- this.executionCount = executionCount;
- this.testCommandExecutor = testCommandExecutor;
- }
- public void run() {
- this.threadLocalCommandExecutor.set(this.testCommandExecutor);
- for (int i = 0; i < this.executionCount; i++) {
- this.threadLocalCommandExecutor.execute(this.testCommand);
- }
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandRunnableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandRunnableTests.java
deleted file mode 100644
index 623b2b2449..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandRunnableTests.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.CommandRunnable;
-
-@SuppressWarnings("nls")
-public class CommandRunnableTests extends TestCase {
- boolean commandExecuted = false;
-
- public CommandRunnableTests(String name) {
- super(name);
- }
-
- public void testNullCommand() {
- boolean exCaught = false;
- try {
- Runnable runnable = new CommandRunnable(null);
- fail("bogus: " + runnable);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRun() {
- Runnable runnable = new CommandRunnable(this.buildCommand());
- runnable.run();
- assertTrue(this.commandExecuted);
- }
-
- public void testToString() {
- Runnable runnable = new CommandRunnable(this.buildCommand());
- assertNotNull(runnable.toString());
- }
-
- private Command buildCommand() {
- return new Command() {
- public void execute() {
- CommandRunnableTests.this.commandExecuted = true;
- }
- };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandTests.java
deleted file mode 100644
index 0eb8392e8b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CommandTests.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.CommandRunnable;
-import org.eclipse.jpt.common.utility.internal.RunnableCommand;
-import org.eclipse.jpt.common.utility.internal.ThreadLocalCommand;
-
-public class CommandTests
- extends MultiThreadedTestCase
-{
- public CommandTests(String name) {
- super(name);
- }
-
- public void testNullCommand() {
- Command command = Command.Null.instance();
- command.execute(); // just make sure it doesn't blow up?
- }
-
- public void testNullCommand_toString() {
- Command command = Command.Null.instance();
- assertNotNull(command.toString());
- }
-
- public void testNullCommand_serialization() throws Exception {
- Command command1 = Command.Null.instance();
- Command command2 = TestTools.serialize(command1);
- assertSame(command1, command2);
- }
-
- public void testDisabledCommand() {
- Command command = Command.Disabled.instance();
- boolean exCaught = false;
- try {
- command.execute();
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledCommand_toString() {
- Command command = Command.Disabled.instance();
- assertNotNull(command.toString());
- }
-
- public void testDisabledCommand_serialization() throws Exception {
- Command command1 = Command.Disabled.instance();
- Command command2 = TestTools.serialize(command1);
- assertSame(command1, command2);
- }
-
- public void testRunnableCommand() {
- SimpleTestRunnable testRunnable = new SimpleTestRunnable();
- assertFalse(testRunnable.ran);
- Command command = new RunnableCommand(testRunnable);
- command.execute();
- assertTrue(testRunnable.ran);
- }
-
- static class SimpleTestRunnable implements Runnable {
- boolean ran = false;
- public void run() {
- this.ran = true;
- }
- }
-
- public void testCommandRunnable() {
- TestCommand testCommand = new TestCommand();
- assertEquals(0, testCommand.count);
- Runnable runnable = new CommandRunnable(testCommand);
- runnable.run();
- assertEquals(1, testCommand.count);
- }
-
- static class TestCommand implements Command {
- int count = 0;
- public void execute() {
- this.count++;
- }
- }
-
- public void testThreadLocalCommand() throws Exception {
- ThreadLocalCommand threadLocalCommand = new ThreadLocalCommand();
- TestRunnable testRunnable1 = new TestRunnable(threadLocalCommand, 1);
- Thread thread1 = this.buildThread(testRunnable1);
- thread1.run();
-
- TestRunnable testRunnable2 = new TestRunnable(threadLocalCommand, 2);
- Thread thread2 = this.buildThread(testRunnable2);
- thread2.run();
-
- thread1.join();
- thread2.join();
-
- assertEquals(1, testRunnable1.testCommand.count);
-
- assertEquals(2, testRunnable2.testCommand.count);
- }
-
- static class TestCommandExecutor implements CommandExecutor {
- int count = 0;
- public void execute(Command command) {
- this.count++;
- command.execute();
- }
- }
-
- static class TestRunnable implements Runnable {
- final ThreadLocalCommand threadLocalCommand;
- final int executionCount;
- final TestCommand testCommand = new TestCommand();
- TestRunnable(ThreadLocalCommand threadLocalCommand, int executionCount) {
- super();
- this.threadLocalCommand = threadLocalCommand;
- this.executionCount = executionCount;
- }
- public void run() {
- this.threadLocalCommand.set(this.testCommand);
- for (int i = 0; i < this.executionCount; i++) {
- this.threadLocalCommand.execute();
- }
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CompositeCommandTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CompositeCommandTests.java
deleted file mode 100644
index cfabc54bef..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/CompositeCommandTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.CommandRunnable;
-import org.eclipse.jpt.common.utility.internal.CompositeCommand;
-
-public class CompositeCommandTests extends TestCase {
- boolean command1Executed = false;
- boolean command2Executed = false;
-
- public CompositeCommandTests(String name) {
- super(name);
- }
-
- public void testRun() {
- Runnable runnable = new CommandRunnable(this.buildCompositeCommand());
- runnable.run();
- assertTrue(this.command1Executed);
- assertTrue(this.command2Executed);
- }
-
- public void testToString() {
- Runnable runnable = new CommandRunnable(this.buildCompositeCommand());
- assertNotNull(runnable.toString());
- }
-
- private Command buildCompositeCommand() {
- return new CompositeCommand(
- this.buildCommand1(),
- this.buildCommand2()
- );
- }
-
- private Command buildCommand1() {
- return new Command() {
- public void execute() {
- CompositeCommandTests.this.command1Executed = true;
- }
- };
- }
-
- private Command buildCommand2() {
- return new Command() {
- public void execute() {
- CompositeCommandTests.this.command2Executed = true;
- }
- };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ExceptionHandlerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ExceptionHandlerTests.java
deleted file mode 100644
index 23097f3ab5..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ExceptionHandlerTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.ExceptionHandler;
-
-public class ExceptionHandlerTests extends TestCase {
-
- public ExceptionHandlerTests(String name) {
- super(name);
- }
-
- public void testNullExceptionHandler() {
- ExceptionHandler exceptionHandler = ExceptionHandler.Null.instance();
- exceptionHandler.handleException(new NullPointerException()); // just make sure it doesn't blow up?
- }
-
- public void testNullExceptionHandlerToString() {
- ExceptionHandler exceptionHandler = ExceptionHandler.Null.instance();
- assertNotNull(exceptionHandler.toString());
- }
-
- public void testRuntimeExceptionHandler() {
- Exception npe = new NullPointerException();
- ExceptionHandler exceptionHandler = ExceptionHandler.Runtime.instance();
- boolean exCaught = false;
- try {
- exceptionHandler.handleException(npe);
- fail();
- } catch (RuntimeException ex) {
- assertSame(npe, ex.getCause());
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRuntimeExceptionHandlerToString() {
- ExceptionHandler exceptionHandler = ExceptionHandler.Runtime.instance();
- assertNotNull(exceptionHandler.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FileToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FileToolsTests.java
deleted file mode 100644
index 5483b8588d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FileToolsTests.java
+++ /dev/null
@@ -1,593 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.FileTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-
-@SuppressWarnings("nls")
-public class FileToolsTests extends TestCase {
- private File tempDir;
-
- public FileToolsTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.tempDir = this.buildTempDir();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- this.deleteDir(this.tempDir);
- }
-
- public void testFilesIn() {
- Collection<File> files = CollectionTools.collection(FileTools.filesIn(this.tempDir.getPath()));
- assertEquals("invalid file count", 3, files.size());
- }
-
- public void testDirectoriesIn() {
- Collection<File> files = CollectionTools.collection(FileTools.directoriesIn(this.tempDir.getPath()));
- assertEquals("invalid directory count", 2, files.size());
- }
-
- public void testFilesInTree() {
- Collection<File> files = CollectionTools.collection(FileTools.filesInTree(this.tempDir.getPath()));
- assertEquals("invalid file count", 9, files.size());
- }
-
- public void testDirectoriesInTree() {
- Collection<File> files = CollectionTools.collection(FileTools.directoriesInTree(this.tempDir.getPath()));
- assertEquals("invalid directory count", 3, files.size());
- }
-
- public void testDeleteDirectory() throws IOException {
- // build another temporary directory just for this test
- File dir = this.buildTempDir();
- assertTrue("temporary directory not created", dir.exists());
- FileTools.deleteDirectory(dir.getPath());
- assertFalse("temporary directory not deleted", dir.exists());
- }
-
- public void testDeleteDirectoryContents() throws IOException {
- // build another temporary directory just for this test
- File dir = this.buildTempDir();
- assertTrue("temporary directory not created", dir.exists());
- FileTools.deleteDirectoryContents(dir.getPath());
- assertTrue("temporary directory should not have been deleted", dir.exists());
- assertTrue("temporary directory contents not deleted", dir.listFiles().length == 0);
- dir.delete();
- }
-
- public void testCopyToFile() throws IOException {
- File destFile = new File(this.tempDir, "destfile.txt");
- this.copyToFile(destFile, "testCopyToFile");
- }
-
- public void testCopyToPreExistingFile() throws IOException {
- File destFile = new File(this.tempDir, "destfile.txt");
- Writer writer = new OutputStreamWriter(new FileOutputStream(destFile));
- writer.write("this text should be replaced...");
- writer.close();
- this.copyToFile(destFile, "testCopyToPreExistingFile");
- }
-
- private void copyToFile(File destFile, String writeString) throws IOException {
- File sourceFile = new File(this.tempDir, "sourcefile.txt");
- char[] readBuffer = new char[writeString.length()];
-
- Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile));
- writer.write(writeString);
- writer.close();
-
- FileTools.copyToFile(sourceFile, destFile);
-
- Reader reader = new InputStreamReader(new FileInputStream(destFile));
- reader.read(readBuffer);
- reader.close();
- String readString = new String(readBuffer);
- assertEquals(writeString, readString);
- }
-
- public void testCopyToDirectory() throws IOException {
- File sourceFile = new File(this.tempDir, "sourcefile.txt");
- String writeString = "testCopyToDirectory";
-
- File destDir = new File(this.tempDir, "destdir");
- destDir.mkdir();
- File destFile = new File(destDir, "sourcefile.txt");
- char[] readBuffer = new char[writeString.length()];
-
- Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile));
- writer.write(writeString);
- writer.close();
-
- FileTools.copyToDirectory(sourceFile, destDir);
-
- Reader reader = new InputStreamReader(new FileInputStream(destFile));
- reader.read(readBuffer);
- reader.close();
- String readString = new String(readBuffer);
- assertEquals(writeString, readString);
-
- FileTools.copyToDirectory(sourceFile, destDir); //Try again with the directory is already created
- reader = new InputStreamReader(new FileInputStream(destFile));
- reader.read(readBuffer);
- reader.close();
- readString = new String(readBuffer);
- assertEquals(writeString, readString);
- }
-
- public void testFilter() throws IOException {
- String prefix = "XXXtestFileXXX";
- File testFile1 = new File(this.tempDir, prefix + "1");
- testFile1.createNewFile();
- File testFile2 = new File(this.tempDir, prefix + "2");
- testFile2.createNewFile();
-
- FileFilter filter = this.buildFileFilter(prefix);
- Iterator<File> filteredFilesIterator = FileTools.filter(FileTools.filesIn(this.tempDir), filter);
- Collection<File> filteredFiles = CollectionTools.collection(filteredFilesIterator);
- assertEquals(2, filteredFiles.size());
- assertTrue(filteredFiles.contains(testFile1));
- assertTrue(filteredFiles.contains(testFile2));
- }
-
- private FileFilter buildFileFilter(final String prefix) {
- return new FileFilter() {
- public boolean accept(File file) {
- return file.getName().startsWith(prefix);
- }
- };
- }
-
- public void testStripExtension() {
- assertEquals("foo", FileTools.stripExtension("foo.xml"));
- assertEquals("foo.bar", FileTools.stripExtension("foo.bar.xml"));
- assertEquals("foo", FileTools.stripExtension("foo"));
- assertEquals("foo", FileTools.stripExtension("foo."));
- }
-
- public void testExtension() {
- assertEquals(".xml", FileTools.extension("foo.xml"));
- assertEquals(".xml", FileTools.extension("foo.bar.xml"));
- assertEquals("", FileTools.extension("foo"));
- assertEquals("", FileTools.extension("foo,xml"));
- assertEquals(".", FileTools.extension("foo."));
- }
-
- public void testEmptyTemporaryDirectory() throws IOException {
- File tempDir1 = FileTools.temporaryDirectory();
- File testFile1 = new File(tempDir1, "junk");
- testFile1.createNewFile();
-
- File tempDir2 = FileTools.emptyTemporaryDirectory();
- assertEquals(tempDir1, tempDir2);
- assertTrue(tempDir2.isDirectory());
- assertEquals(0, tempDir2.listFiles().length);
- tempDir2.delete();
- }
-
- public void testCanonicalFileName() {
- File file1 = new File("foo");
- file1 = new File(file1, "bar");
- file1 = new File(file1, "baz");
- file1 = new File(file1, "..");
- file1 = new File(file1, "..");
- file1 = new File(file1, "bar");
- file1 = new File(file1, "baz");
- File file2 = new File(System.getProperty("user.dir"));
- file2 = new File(file2, "foo");
- file2 = new File(file2, "bar");
- file2 = new File(file2, "baz");
- File file3 = FileTools.canonicalFile(file1);
- assertEquals(file2, file3);
- }
-
- public void testPathFiles() {
- File[] expected;
- File[] actual;
-
- if (Tools.osIsWindows()) {
- expected = new File[] { new File("C:/"), new File("C:/foo"), new File("C:/foo/bar"), new File("C:/foo/bar/baz.txt") };
- actual = this.pathFiles(new File("C:/foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
- }
-
- expected = new File[] { new File("/"), new File("/foo"), new File("/foo/bar"), new File("/foo/bar/baz.txt") };
- actual = this.pathFiles(new File("/foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File("foo"), new File("foo/bar"), new File("foo/bar/baz.txt") };
- actual = this.pathFiles(new File("foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File(".."), new File("../foo"), new File("../foo/bar"), new File("../foo/bar/baz.txt") };
- actual = this.pathFiles(new File("../foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File("."), new File("./foo"), new File("./foo/bar"), new File("./foo/bar/baz.txt") };
- actual = this.pathFiles(new File("./foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
- }
-
- private File[] pathFiles(File file) {
- return (File[]) ReflectionTools.executeStaticMethod(FileTools.class, "pathFiles", File.class, file);
- }
-
- public void testRelativeParentFile() {
- assertEquals(new File(".."), this.relativeParentFile(1));
- assertEquals(new File("../.."), this.relativeParentFile(2));
- assertEquals(new File("../../.."), this.relativeParentFile(3));
-
- boolean exCaught = false;
- try {
- File file = this.relativeParentFile(0);
- fail("invalid return: " + file);
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- InvocationTargetException ite = (InvocationTargetException) ex.getCause();
- if (ite.getTargetException() instanceof IllegalArgumentException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- private File relativeParentFile(int len) {
- return (File) ReflectionTools.executeStaticMethod(FileTools.class, "relativeParentFile", int.class, new Integer(len));
- }
-
- public void testConvertToRelativeFile() {
- String prefix = Tools.osIsWindows() ? "C:" : "";
- File file;
- File dir;
- File relativeFile;
-
- if (Tools.osIsWindows()) {
- // on Windows, a drive must be specified for a file to be absolute (i.e. not relative)
- this.verifyUnchangedRelativeFile("/dir1/dir2/file.txt", "C:/dir1/dir2");
- // different drives
- this.verifyUnchangedRelativeFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2");
- }
- this.verifyUnchangedRelativeFile("dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedRelativeFile("./dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedRelativeFile("../../dir1/dir2/file.txt", prefix + "/dir1/dir2");
-
- file = new File(prefix + "/dir1/dir2");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("."), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/../dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("dir3/dir4/dir5/file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../../file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../../dirA/dirB/dirC/file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../.."), relativeFile);
-
- file = new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar");
- dir = new File(prefix + "/My Documents/My Workspace/Project 1");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("lib/toplink.jar"), relativeFile);
- }
-
- private void verifyUnchangedRelativeFile(String fileName, String dirName) {
- File file = new File(fileName);
- File dir = new File(dirName);
- File relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(file, relativeFile);
- }
-
- public void testConvertToAbsoluteFile() {
- String prefix = Tools.osIsWindows() ? "C:" : "";
- File file;
- File dir;
- File absoluteFile;
-
- if (Tools.osIsWindows()) {
- // on Windows, a drive must be specified for a file to be absolute (i.e. not relative)
- this.verifyUnchangedAbsoluteFile("C:/dir1/dir2/file.txt", "C:/dir1/dir2");
- // different drives
- this.verifyUnchangedAbsoluteFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2");
- }
- this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedAbsoluteFile(prefix + "/./dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/../../dir1/dir2/file.txt", prefix + "/dir1/dir2");
-
- file = new File(".");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile);
-
- file = new File("./file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("../dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("dir3/dir4/dir5/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt"), absoluteFile);
-
- file = new File("../../../file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- // too many ".." directories will resolve to the root;
- // this is consistent with Windows and Linux command shells
- file = new File("../../../../../../../../file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/file.txt"), absoluteFile);
-
- file = new File("../file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("../../../dirA/dirB/dirC/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt"), absoluteFile);
-
- file = new File("../../..");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile);
-
- file = new File("lib/toplink.jar");
- dir = new File(prefix + "/My Documents/My Workspace/Project 1");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar"), absoluteFile);
- }
-
- public void testFileNameIsReserved() {
- boolean expected = Tools.osIsWindows();
- assertEquals(expected, FileTools.fileNameIsReserved("CON"));
- assertEquals(expected, FileTools.fileNameIsReserved("con"));
- assertEquals(expected, FileTools.fileNameIsReserved("cON"));
- assertEquals(expected, FileTools.fileNameIsReserved("AUX"));
- assertEquals(expected, FileTools.fileNameIsReserved("COM3"));
- assertEquals(expected, FileTools.fileNameIsReserved("LPT3"));
- assertEquals(expected, FileTools.fileNameIsReserved("nUL"));
- assertEquals(expected, FileTools.fileNameIsReserved("Prn"));
- }
-
- public void testFileHasAnyReservedComponents() {
- boolean expected = Tools.osIsWindows();
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("C:/CON")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("/con/foo")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/temp/cON")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("bar//baz//AUX")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("COM3//ttt")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("d:/LPT3/xxx")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/my docs and stuff/tuesday/nUL")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("Prn")));
- }
-
- public void testShortenFileNameFile() {
- if (Tools.osIsWindows()) {
- this.verifyShortenFileNameFileWin();
- } else {
- this.verifyShortenFileNameFileNonWin();
- }
- }
-
- private void verifyShortenFileNameFileWin() {
- File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt");
- String fileName = FileTools.shortenFileName(file);
- assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
-
- file = new File("C:/");
- fileName = FileTools.shortenFileName(file);
- assertEquals("C:\\", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- private void verifyShortenFileNameFileNonWin() {
- File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(file);
- assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
-
- file = new File("/home");
- fileName = FileTools.shortenFileName(file);
- assertEquals("/home", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- public void testShortenFileNameFileInt() {
- if (Tools.osIsWindows()) {
- this.verifyShortenFileNameFileIntWin();
- } else {
- this.verifyShortenFileNameFileIntNonWin();
- }
- }
-
- private void verifyShortenFileNameFileIntWin() {
- File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt");
- String fileName = FileTools.shortenFileName(file, 31);
- assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName);
- assertEquals(31, fileName.length());
-
- file = new File("C:/This is the file name.txt");
- fileName = FileTools.shortenFileName(file, 10);
- assertEquals("C:\\This is the file name.txt", fileName);
- assertEquals(28, fileName.length());
- }
-
- private void verifyShortenFileNameFileIntNonWin() {
- File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(file, 31);
- assertEquals("/home/.../desktop/Project/Text.txt", fileName);
- assertEquals(34, fileName.length());
-
- file = new File("/This is the file name.txt");
- fileName = FileTools.shortenFileName(file, 10);
- assertEquals("/This is the file name.txt", fileName);
- assertEquals(26, fileName.length());
- }
-
- public void testShortenFileNameURL() throws Exception {
- if (Tools.osIsWindows()) {
- this.verifyShortenFileNameURLWin();
- } else {
- this.verifyShortenFileNameURLNonWin();
- }
- }
-
- private void verifyShortenFileNameURLWin() throws Exception {
- URL url = new URL("file", "", "C:/Documents and Settings/Administrator/Desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url);
- assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- private void verifyShortenFileNameURLNonWin() throws Exception {
- URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url);
- assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- public void testShortenFileNameURLInt() throws Exception {
- if (Tools.osIsWindows()) {
- this.verifyShortenFileNameURLIntWin();
- } else {
- this.verifyShortenFileNameURLIntNonWin();
- }
- }
-
- private void verifyShortenFileNameURLIntWin() throws Exception {
- URL url = new URL("file", "", "/C:/Documents and Settings/Administrator/Desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url, 31);
- assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName);
- assertEquals(31, fileName.length());
- }
-
- private void verifyShortenFileNameURLIntNonWin() throws Exception {
- URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url, 31);
- assertEquals("/home/.../desktop/Project/Text.txt", fileName);
- assertEquals(34, fileName.length());
- }
-
- private void verifyUnchangedAbsoluteFile(String fileName, String dirName) {
- File file = new File(fileName);
- File dir = new File(dirName);
- File absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(file, absoluteFile);
- }
-
- private File buildTempDir() throws IOException {
- // build a new directory for each test, to prevent any cross-test effects
- File dir = FileTools.newTemporaryDirectory(this.getClass().getSimpleName() + "." + this.getName());
-
- File file0a = new File(dir, "file0a");
- file0a.createNewFile();
- File file0b = new File(dir, "file0b");
- file0b.createNewFile();
- File file0c = new File(dir, "file0c");
- file0c.createNewFile();
-
- File subdir1 = new File(dir, "subdir1");
- subdir1.mkdir();
- File file1a = new File(subdir1, "file1a");
- file1a.createNewFile();
- File file1b = new File(subdir1, "file1b");
- file1b.createNewFile();
-
- File subdir2 = new File(dir, "subdir2");
- subdir2.mkdir();
- File file2a = new File(subdir2, "file2a");
- file2a.createNewFile();
- File file2b = new File(subdir2, "file2b");
- file2b.createNewFile();
-
- File subdir3 = new File(subdir2, "subdir3");
- subdir3.mkdir();
- File file3a = new File(subdir3, "file3a");
- file3a.createNewFile();
- File file3b = new File(subdir3, "file3b");
- file3b.createNewFile();
-
- return dir;
- }
-
- private void deleteDir(File dir) {
- FileTools.deleteDirectory(dir);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FilterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FilterTests.java
deleted file mode 100644
index b27a0a3543..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/FilterTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.Filter;
-
-@SuppressWarnings("nls")
-public class FilterTests extends TestCase {
-
- public FilterTests(String name) {
- super(name);
- }
-
- public void testNullFilter() {
- Filter<String> filter = Filter.Null.instance();
- assertTrue(filter.accept(""));
- assertTrue(filter.accept("foo"));
- assertTrue(filter.accept("bar"));
- }
-
- public void testNullFilter_toString() {
- Filter<String> filter = Filter.Null.instance();
- assertNotNull(filter.toString());
- }
-
- public void testNullFilter_serialization() throws Exception {
- Filter<String> filter = Filter.Null.instance();
- assertSame(filter, TestTools.serialize(filter));
- }
-
- public void testOpaqueFilter() {
- Filter<String> filter = Filter.Opaque.instance();
- assertFalse(filter.accept(""));
- assertFalse(filter.accept("foo"));
- assertFalse(filter.accept("bar"));
- }
-
- public void testOpaqueFilter_toString() {
- Filter<String> filter = Filter.Opaque.instance();
- assertNotNull(filter.toString());
- }
-
- public void testOpaqueFilter_serialization() throws Exception {
- Filter<String> filter = Filter.Opaque.instance();
- assertSame(filter, TestTools.serialize(filter));
- }
-
- public void testDisabledFilter() {
- Filter<String> filter = Filter.Disabled.instance();
- boolean exCaught = false;
- try {
- assertFalse(filter.accept("foo"));
- fail();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testDisabledFilter_toString() {
- Filter<String> filter = Filter.Disabled.instance();
- assertNotNull(filter.toString());
- }
-
- public void testDisabledFilter_serialization() throws Exception {
- Filter<String> filter = Filter.Disabled.instance();
- assertSame(filter, TestTools.serialize(filter));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/HashBagTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/HashBagTests.java
deleted file mode 100644
index df2a10bd28..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/HashBagTests.java
+++ /dev/null
@@ -1,555 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.Tools;
-
-@SuppressWarnings("nls")
-public class HashBagTests extends TestCase {
- private HashBag<String> bag;
-
- public HashBagTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bag = this.buildBag();
- }
-
- private HashBag<String> buildBag() {
- HashBag<String> b = new HashBag<String>();
- b.add(null);
- b.add(new String("one"));
- b.add(new String("two"));
- b.add(new String("two"));
- b.add(new String("three"));
- b.add(new String("three"));
- b.add(new String("three"));
- b.add(new String("four"));
- b.add(new String("four"));
- b.add(new String("four"));
- b.add(new String("four"));
- return b;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add(new String("foo"));
- c.add(new String("foo"));
- c.add(new String("bar"));
- c.add(new String("bar"));
- c.add(new String("bar"));
- return c;
- }
-
- public void testCtorCollection() {
- Collection<String> c = this.buildCollection();
- Bag<String> b = new HashBag<String>(c);
- for (String s : c) {
- assertTrue(b.contains(s));
- }
- }
-
- public void testCtorIntFloat() {
- boolean exCaught;
-
- exCaught = false;
- try {
- this.bag = new HashBag<String>(-20, 0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- this.bag = new HashBag<String>(20, -0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAdd() {
- // the other adds took place in setUp
- assertTrue(this.bag.add("five"));
-
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains("five"));
- }
-
- public void testAddCount() {
- // the other adds took place in setUp
- this.bag.add("minus3", -3);
- this.bag.add("zero", 0);
- this.bag.add("five", 5);
-
- assertFalse(this.bag.contains("minus3"));
- assertFalse(this.bag.contains("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(5, this.bag.count("five"));
-
- this.bag.add("three", 2);
- assertEquals(5, this.bag.count("three"));
- }
-
- public void testAddAll() {
- Collection<String> c = this.buildCollection();
- assertTrue(this.bag.addAll(c));
- for (String s : c) {
- assertTrue(this.bag.contains(s));
- }
- }
-
- public void testClear() {
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains(null));
- assertEquals(11, this.bag.size());
- this.bag.clear();
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.contains("four"));
- assertFalse(this.bag.contains(null));
- assertEquals(0, this.bag.size());
- }
-
- public void testClone() {
- Bag<String> bag2 = this.bag.clone();
- assertTrue(this.bag != bag2);
- assertEquals(this.bag, bag2);
- assertTrue(this.bag.hashCode() == bag2.hashCode());
- }
-
- public void testContains() {
- assertTrue(this.bag.contains(null));
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains(new String("four")));
- assertTrue(this.bag.contains("fo" + "ur"));
- assertFalse(this.bag.contains("five"));
- }
-
- public void testContainsAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(null);
- c.add(new String("one"));
- c.add(new String("two"));
- c.add(new String("three"));
- c.add(new String("four"));
- assertTrue(this.bag.containsAll(c));
- }
-
- public void testCount() {
- assertEquals(0, this.bag.count("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(0, this.bag.count("five"));
- }
-
- public void testEquals() {
- Bag<String> bag2 = this.buildBag();
- assertEquals(this.bag, bag2);
- bag2.add("five");
- assertFalse(this.bag.equals(bag2));
- Collection<String> c = new ArrayList<String>(this.bag);
- assertFalse(this.bag.equals(c));
- }
-
- public void testHashCode() {
- Bag<String> bag2 = this.buildBag();
- assertEquals(this.bag.hashCode(), bag2.hashCode());
- }
-
- public void testIsEmpty() {
- assertFalse(this.bag.isEmpty());
- this.bag.clear();
- assertTrue(this.bag.isEmpty());
- this.bag.add("foo");
- assertFalse(this.bag.isEmpty());
- }
-
- public void testEmptyIterator() {
- this.bag.clear();
- Iterator<String> iterator = this.bag.iterator();
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.iterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(11, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- iterator.remove();
- assertEquals(10, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.iterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUniqueIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.uniqueIterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- Object next = null;
- while (iterator.hasNext() && !"four".equals(next)) {
- next = iterator.next();
- }
- iterator.remove();
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEntries() {
- int i = 0;
- Iterator<Bag.Entry<String>> iterator = this.bag.entries();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- Bag.Entry<String> next = null;
- while (iterator.hasNext()) {
- next = iterator.next();
- if (next.getElement().equals("four")) {
- iterator.remove();
- break;
- }
- }
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testHashingDistribution() throws Exception {
- Bag<String> bigBag = new HashBag<String>();
- for (int i = 0; i < 10000; i++) {
- bigBag.add("object" + i);
- }
-
- java.lang.reflect.Field field = bigBag.getClass().getDeclaredField("table");
- field.setAccessible(true);
- Object[] table = (Object[]) field.get(bigBag);
- int bucketCount = table.length;
- int filledBucketCount = 0;
- for (Object o : table) {
- if (o != null) {
- filledBucketCount++;
- }
- }
- float loadFactor = ((float) filledBucketCount) / ((float) bucketCount);
- if ((loadFactor < 0.20) || (loadFactor > 0.80)) {
- String msg = "poor load factor: " + loadFactor;
- if (Tools.jvmIsSun()) {
- fail(msg);
- } else {
- // poor load factor is seen in the Eclipse build environment for some reason...
- System.out.println(this.getClass().getName() + '.' + this.getName() + " - " + msg);
- TestTools.printSystemProperties();
- }
- }
- }
-
- public void testRemove() {
- assertTrue(this.bag.remove("one"));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.remove("one"));
-
- assertTrue(this.bag.remove("two"));
- assertTrue(this.bag.remove("two"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.remove("two"));
- }
-
- public void testRemoveCount() {
- assertFalse(this.bag.remove("one", 0));
- assertTrue(this.bag.contains("one"));
-
- assertTrue(this.bag.remove("one", 1));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.remove("one"));
-
- assertFalse(this.bag.remove("two", -3));
- assertTrue(this.bag.remove("two", 1));
- assertTrue(this.bag.contains("two"));
-
- assertTrue(this.bag.remove("two", 1));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.remove("two"));
-
- assertTrue(this.bag.remove("three", 3));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.remove("three"));
- }
-
- public void testRemoveAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue(this.bag.removeAll(c));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.remove("one"));
- assertFalse(this.bag.remove("three"));
- assertFalse(this.bag.removeAll(c));
- }
-
- public void testRetainAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue(this.bag.retainAll(c));
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("three"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.contains("four"));
- assertFalse(this.bag.remove("two"));
- assertFalse(this.bag.remove("four"));
- assertFalse(this.bag.retainAll(c));
- }
-
- public void testSize() {
- assertTrue(this.bag.size() == 11);
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- assertEquals(16, this.bag.size());
- }
-
- public void testSerialization() throws Exception {
- Bag<String> bag2 = TestTools.serialize(this.bag);
-
- assertTrue("same object?", this.bag != bag2);
- assertEquals(11, bag2.size());
- assertEquals(this.bag, bag2);
- // look for similar elements
- assertTrue(bag2.contains(null));
- assertTrue(bag2.contains("one"));
- assertTrue(bag2.contains("two"));
- assertTrue(bag2.contains("three"));
- assertTrue(bag2.contains("four"));
-
- int nullCount = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0;
- for (String s : bag2) {
- if (s == null) {
- nullCount++;
- } else if (s.equals("one")) {
- oneCount++;
- } else if (s.equals("two")) {
- twoCount++;
- } else if (s.equals("three")) {
- threeCount++;
- } else if (s.equals("four")) {
- fourCount++;
- }
- }
- assertEquals(1, nullCount);
- assertEquals(1, oneCount);
- assertEquals(2, twoCount);
- assertEquals(3, threeCount);
- assertEquals(4, fourCount);
- }
-
- public void testToArray() {
- Object[] a = this.bag.toArray();
- assertEquals(11, a.length);
- assertTrue(ArrayTools.contains(a, null));
- assertTrue(ArrayTools.contains(a, "one"));
- assertTrue(ArrayTools.contains(a, "two"));
- assertTrue(ArrayTools.contains(a, "three"));
- assertTrue(ArrayTools.contains(a, "four"));
- }
-
- public void testToArrayObjectArray() {
- String[] a = new String[12];
- a[11] = "not null";
- String[] b = this.bag.toArray(a);
- assertEquals(a, b);
- assertEquals(12, a.length);
- assertTrue(ArrayTools.contains(a, null));
- assertTrue(ArrayTools.contains(a, "one"));
- assertTrue(ArrayTools.contains(a, "two"));
- assertTrue(ArrayTools.contains(a, "three"));
- assertTrue(ArrayTools.contains(a, "four"));
- assertTrue(a[11] == null);
- }
-
- public void testToString() {
- String s = this.bag.toString();
- assertTrue(s.startsWith("["));
- assertTrue(s.endsWith("]"));
- int commaCount = 0;
- for (int i = 0; i < s.length(); i++) {
- if (s.charAt(i) == ',') {
- commaCount++;
- }
- }
- assertEquals(10, commaCount);
- assertTrue(s.indexOf("one") != -1);
- assertTrue(s.indexOf("two") != -1);
- assertTrue(s.indexOf("three") != -1);
- assertTrue(s.indexOf("four") != -1);
- assertTrue(s.indexOf("null") != -1);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IdentityHashBagTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IdentityHashBagTests.java
deleted file mode 100644
index f1738bdeb5..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IdentityHashBagTests.java
+++ /dev/null
@@ -1,573 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.IdentityHashBag;
-import org.eclipse.jpt.common.utility.internal.Tools;
-
-@SuppressWarnings("nls")
-public class IdentityHashBagTests extends TestCase {
- private IdentityHashBag<String> bag;
- private String one = "one";
- private String two = "two";
- private String three = "three";
- private String four = "four";
- private String foo = "foo";
- private String bar = "bar";
-
- public IdentityHashBagTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bag = this.buildBag();
- }
-
- protected IdentityHashBag<String> buildBag() {
- IdentityHashBag<String> result = new IdentityHashBag<String>();
- result.add(null);
- result.add(this.one);
- result.add(this.two);
- result.add(this.two);
- result.add(this.three);
- result.add(this.three);
- result.add(this.three);
- result.add(this.four);
- result.add(this.four);
- result.add(this.four);
- result.add(this.four);
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.foo);
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.bar);
- c.add(this.bar);
- return c;
- }
-
- public void testCtorCollection() {
- Collection<String> c = this.buildCollection();
- IdentityHashBag<String> localBag = new IdentityHashBag<String>(c);
- for (String s : c) {
- assertTrue(localBag.contains(s));
- }
- }
-
- public void testCtorIntFloat() {
- boolean exCaught;
-
- exCaught = false;
- try {
- this.bag = new IdentityHashBag<String>(-20, 0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
-
- exCaught = false;
- try {
- this.bag = new IdentityHashBag<String>(20, -0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
- }
-
- public void testAdd() {
- // the other adds took place in setUp
- String five = "five";
- assertTrue(this.bag.add(five));
-
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
- assertTrue(this.bag.contains(five));
- }
-
- public void testAddCount() {
- String minus3 = "minus3";
- String zero = "zero";
- String five = "five";
- // the other adds took place in setUp
- this.bag.add(minus3, -3);
- this.bag.add(zero, 0);
- this.bag.add(five, 5);
-
- assertFalse(this.bag.contains(minus3));
- assertFalse(this.bag.contains(zero));
- assertEquals(1, this.bag.count(this.one));
- assertEquals(2, this.bag.count(this.two));
- assertEquals(3, this.bag.count(this.three));
- assertEquals(4, this.bag.count(this.four));
- assertEquals(5, this.bag.count(five));
-
- this.bag.add(this.three, 2);
- assertEquals(5, this.bag.count(this.three));
- }
-
- public void testAddAll() {
- Collection<String> c = this.buildCollection();
- assertTrue(this.bag.addAll(c));
- for (String s : c) {
- assertTrue(this.bag.contains(s));
- }
- }
-
- public void testClear() {
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
- assertTrue(this.bag.contains(null));
- assertEquals(11, this.bag.size());
- this.bag.clear();
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.contains(this.four));
- assertFalse(this.bag.contains(null));
- assertEquals(0, this.bag.size());
- }
-
- public void testClone() {
- IdentityHashBag<String> bag2 = this.bag.clone();
- assertTrue("bad clone", this.bag != bag2);
- assertEquals("bad clone", this.bag, bag2);
- assertTrue("bad clone", this.bag.hashCode() == bag2.hashCode());
- }
-
- public void testContains() {
- assertTrue(this.bag.contains(null));
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
-
- assertFalse(this.bag.contains(new String("four")));
- assertFalse(this.bag.contains("five"));
- }
-
- public void testContainsAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(null);
- c.add(this.one);
- c.add(this.two);
- c.add(this.three);
- c.add(this.four);
- assertTrue(this.bag.containsAll(c));
- c.add(new String(this.four));
- assertFalse(this.bag.containsAll(c));
- }
-
- public void testCount() {
- assertEquals(0, this.bag.count("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(0, this.bag.count("five"));
- }
-
- public void testEquals() {
- IdentityHashBag<String> bag2 = this.buildBag();
- assertEquals(this.bag, bag2);
- bag2.add("five");
- assertFalse(this.bag.equals(bag2));
- Collection<String> c = new ArrayList<String>(this.bag);
- assertFalse(this.bag.equals(c));
- }
-
- public void testHashCode() {
- IdentityHashBag<String> bag2 = this.buildBag();
- assertEquals(this.bag.hashCode(), bag2.hashCode());
- }
-
- public void testIsEmpty() {
- assertFalse(this.bag.isEmpty());
- this.bag.clear();
- assertTrue(this.bag.isEmpty());
- this.bag.add("foo");
- assertFalse(this.bag.isEmpty());
- }
-
- public void testEmptyIterator() {
- this.bag.clear();
- Iterator<String> iterator = this.bag.iterator();
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- public void testIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.iterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(11, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
-
- iterator.remove();
- assertEquals(10, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
-
- // start over
- iterator = this.bag.iterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue("ConcurrentModificationException not thrown", exCaught);
- }
-
- public void testUniqueIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.uniqueIterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- Object next = null;
- while (iterator.hasNext() && !this.four.equals(next)) {
- next = iterator.next();
- }
- iterator.remove();
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- String five = "five";
- this.bag.add(five);
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEntries() {
- int i = 0;
- Iterator<org.eclipse.jpt.common.utility.internal.Bag.Entry<String>> iterator = this.bag.entries();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- org.eclipse.jpt.common.utility.internal.Bag.Entry<String> next = null;
- while (iterator.hasNext()) {
- next = iterator.next();
- if (next.getElement().equals(this.four)) {
- iterator.remove();
- break;
- }
- }
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.entries();
- String five = "five";
- this.bag.add(five);
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testHashingDistribution() throws Exception {
- IdentityHashBag<String> bigBag = new IdentityHashBag<String>();
- for (int i = 0; i < 10000; i++) {
- bigBag.add("object" + i);
- }
-
- java.lang.reflect.Field field = bigBag.getClass().getDeclaredField("table");
- field.setAccessible(true);
- Object[] table = (Object[]) field.get(bigBag);
- int bucketCount = table.length;
- int filledBucketCount = 0;
- for (int i = 0; i < bucketCount; i++) {
- if (table[i] != null) {
- filledBucketCount++;
- }
- }
- float loadFactor = ((float) filledBucketCount) / ((float) bucketCount);
- if ((loadFactor < 0.20) || (loadFactor > 0.80)) {
- String msg = "poor load factor: " + loadFactor;
- if (Tools.jvmIsSun()) {
- fail(msg);
- } else {
- // poor load factor is seen in the Eclipse build environment for some reason...
- System.out.println(this.getClass().getName() + '.' + this.getName() + " - " + msg);
- TestTools.printSystemProperties();
- }
- }
- }
-
- public void testRemove() {
- assertTrue(this.bag.remove(this.one));
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.remove(this.one));
-
- assertTrue(this.bag.remove(this.two));
- assertTrue(this.bag.remove(this.two));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.remove(this.two));
-
- assertFalse(this.bag.remove(new String(this.three)));
- }
-
- public void testRemoveCount() {
- assertFalse(this.bag.remove(this.one, 0));
- assertTrue(this.bag.contains(this.one));
-
- assertTrue(this.bag.remove(this.one, 1));
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.remove(this.one));
-
- assertFalse(this.bag.remove(this.two, -3));
- assertTrue(this.bag.remove(this.two, 1));
- assertTrue(this.bag.contains(this.two));
-
- assertTrue(this.bag.remove(this.two, 1));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.remove(this.two));
-
- assertTrue(this.bag.remove(this.three, 3));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.remove(this.three));
- }
-
- public void testRemoveAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.one);
- c.add(new String(this.two));
- c.add(this.three);
- assertTrue(this.bag.removeAll(c));
- assertFalse(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.remove(this.one));
- assertTrue(this.bag.remove(this.two));
- assertFalse(this.bag.remove(this.three));
- assertFalse(this.bag.removeAll(c));
- }
-
- public void testRetainAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.one);
- c.add(new String(this.two));
- c.add(this.three);
- assertTrue(this.bag.retainAll(c));
- assertTrue(this.bag.contains(this.one));
- assertFalse(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertFalse(this.bag.contains(this.four));
- assertFalse(this.bag.remove(this.two));
- assertFalse(this.bag.remove(this.four));
- assertFalse(this.bag.retainAll(c));
- }
-
- public void testSize() {
- assertTrue(this.bag.size() == 11);
- String five = "five";
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(new String(five));
- assertEquals(16, this.bag.size());
- }
-
- public void testSerialization() throws Exception {
- IdentityHashBag<String> bag2 = TestTools.serialize(this.bag);
-
- assertTrue("same object?", this.bag != bag2);
- assertEquals(11, bag2.size());
- assertEquals(CollectionTools.bag(this.bag.iterator()), CollectionTools.bag(bag2.iterator()));
- // look for similar elements
- assertTrue(CollectionTools.bag(bag2.iterator()).contains(null));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("one"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("two"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("three"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("four"));
-
- int nullCount = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0;
- for (String next : bag2) {
- if (next == null)
- nullCount++;
- else if (next.equals("one"))
- oneCount++;
- else if (next.equals("two"))
- twoCount++;
- else if (next.equals("three"))
- threeCount++;
- else if (next.equals("four"))
- fourCount++;
- }
- assertEquals(1, nullCount);
- assertEquals(1, oneCount);
- assertEquals(2, twoCount);
- assertEquals(3, threeCount);
- assertEquals(4, fourCount);
- }
-
- public void testToArray() {
- Object[] a = this.bag.toArray();
- assertEquals(11, a.length);
- assertTrue(ArrayTools.contains(a, null));
- assertTrue(ArrayTools.contains(a, this.one));
- assertTrue(ArrayTools.contains(a, this.two));
- assertTrue(ArrayTools.contains(a, this.three));
- assertTrue(ArrayTools.contains(a, this.four));
- }
-
- public void testToArrayObjectArray() {
- String[] a = new String[12];
- a[11] = "not null";
- String[] b = this.bag.toArray(a);
- assertEquals(a, b);
- assertEquals(12, a.length);
- assertTrue(ArrayTools.contains(a, null));
- assertTrue(ArrayTools.contains(a, this.one));
- assertTrue(ArrayTools.contains(a, this.two));
- assertTrue(ArrayTools.contains(a, this.three));
- assertTrue(ArrayTools.contains(a, this.four));
- assertTrue(a[11] == null);
- }
-
- public void testToString() {
- String s = this.bag.toString();
- assertTrue(s.startsWith("["));
- assertTrue(s.endsWith("]"));
- int commaCount = 0;
- for (int i = 0; i < s.length(); i++) {
- if (s.charAt(i) == ',') {
- commaCount++;
- }
- }
- assertEquals("invalid number of commas", 10, commaCount);
- assertTrue(s.indexOf("one") != -1);
- assertTrue(s.indexOf("two") != -1);
- assertTrue(s.indexOf("three") != -1);
- assertTrue(s.indexOf("four") != -1);
- assertTrue(s.indexOf("null") != -1);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IndentingPrintWriterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IndentingPrintWriterTests.java
deleted file mode 100644
index 33d331b5f6..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/IndentingPrintWriterTests.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.io.StringWriter;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.IndentingPrintWriter;
-
-@SuppressWarnings("nls")
-public class IndentingPrintWriterTests extends TestCase {
- StringWriter sw1;
- StringWriter sw2;
- IndentingPrintWriter ipw1;
- IndentingPrintWriter ipw2;
-
- static final String CR = System.getProperty("line.separator");
-
- public IndentingPrintWriterTests(String name) {
- super(name);
- }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- this.sw1 = new StringWriter();
- this.ipw1 = new IndentingPrintWriter(this.sw1);
- this.sw2 = new StringWriter();
- this.ipw2 = new IndentingPrintWriter(this.sw2, " "); // indent with 4 spaces instead of a tab
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIndent() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- }
-
- public void testUndent() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- this.ipw1.undent();
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- }
-
- public void testIncrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- }
-
- public void testDecrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- this.ipw1.decrementIndentLevel();
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- }
-
- public void testPrintTab() {
- String expected = "foo0" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "\t\tfoo2" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "foo0" + CR;
-
- this.ipw1.println("foo0");
- this.ipw1.indent();
- this.ipw1.println("foo1");
- this.ipw1.println("foo1");
- this.ipw1.indent();
- this.ipw1.println("foo2");
- this.ipw1.undent();
- this.ipw1.println("foo1");
- this.ipw1.println("foo1");
- this.ipw1.undent();
- this.ipw1.println("foo0");
-
- assertEquals("bogus output", expected, this.sw1.toString());
- }
-
- public void testPrintSpaces() {
- String expected = "foo0" + CR + " foo1" + CR + " foo1" + CR + " foo2" + CR + " foo1" + CR + " foo1" + CR + "foo0" + CR;
-
- this.ipw2.println("foo0");
- this.ipw2.indent();
- this.ipw2.println("foo1");
- this.ipw2.println("foo1");
- this.ipw2.indent();
- this.ipw2.println("foo2");
- this.ipw2.undent();
- this.ipw2.println("foo1");
- this.ipw2.println("foo1");
- this.ipw2.undent();
- this.ipw2.println("foo0");
-
- assertEquals("bogus output", expected, this.sw2.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JDBCTypeTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JDBCTypeTests.java
deleted file mode 100644
index 7853463449..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JDBCTypeTests.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.sql.Types;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.JDBCType;
-
-@SuppressWarnings("nls")
-public class JDBCTypeTests extends TestCase {
-
- public JDBCTypeTests(String name) {
- super(name);
- }
-
- public void testTypesSize() {
- assertEquals(Types.class.getDeclaredFields().length, JDBCType.types().length);
- }
-
- public void testName() {
- JDBCType jdbcType;
- jdbcType = JDBCType.type(Types.VARCHAR);
- assertEquals("VARCHAR", jdbcType.name());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals("INTEGER", jdbcType.name());
- }
-
- public void testCode() {
- JDBCType jdbcType;
- jdbcType = JDBCType.type(Types.VARCHAR);
- assertEquals(Types.VARCHAR, jdbcType.code());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals(Types.INTEGER, jdbcType.code());
- }
-
- public void testInvalidTypeCode() throws Exception {
- boolean exCaught = false;
- try {
- JDBCType jdbcType = JDBCType.type(55);
- fail("invalid JDBCType: " + jdbcType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidTypeName() throws Exception {
- boolean exCaught = false;
- try {
- JDBCType jdbcType = JDBCType.type("VARCHAR2");
- fail("invalid JDBCType: " + jdbcType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JavaTypeTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JavaTypeTests.java
deleted file mode 100644
index da07a02a38..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JavaTypeTests.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.common.utility.internal.SimpleJavaType;
-
-@SuppressWarnings("nls")
-public class JavaTypeTests extends TestCase {
-
- public JavaTypeTests(String name) {
- super(name);
- }
-
- public void testInvalidElementTypeNull() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(null, 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidElementTypeEmpty() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType("", 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidElementTypeArray() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(java.lang.Object[].class.getName(), 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidArrayDepthNegative() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(java.lang.Object.class.getName(), -2);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidVoidArray() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new SimpleJavaType(void.class.getName(), 2);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testElementTypeName() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals("java.lang.Object", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals("int", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals("int", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals("void", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map$Entry", javaType.getElementTypeName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals("java.util.Map$Entry", javaType.getElementTypeName());
- }
-
- public void testArrayDepth() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals(1, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals(1, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals(2, javaType.getArrayDepth());
- }
-
- public void testIsArray() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertTrue(javaType.isArray());
-
- javaType = new SimpleJavaType(int.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(int[].class);
- assertTrue(javaType.isArray());
-
- javaType = new SimpleJavaType(void.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertFalse(javaType.isArray());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertTrue(javaType.isArray());
- }
-
- public void testJavaClass() throws Exception {
- this.verifyJavaClass(java.lang.Object.class);
- this.verifyJavaClass(java.lang.Object[].class);
- this.verifyJavaClass(int.class);
- this.verifyJavaClass(int[].class);
- this.verifyJavaClass(void.class);
- this.verifyJavaClass(java.util.Map.Entry.class);
- this.verifyJavaClass(java.util.Map.Entry[][].class);
- }
-
- private void verifyJavaClass(Class<?> javaClass) throws Exception {
- JavaType javaType = new SimpleJavaType(javaClass);
- assertEquals(javaClass, javaType.getJavaClass());
- }
-
- public void testJavaClassName() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals("[Ljava.lang.Object;", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals("int", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals("[I", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals("void", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map$Entry", javaType.getJavaClassName());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals("[[Ljava.util.Map$Entry;", javaType.getJavaClassName());
- }
-
- public void testDescribes() throws Exception {
- this.verifyDescribes(java.lang.Object.class);
- this.verifyDescribes(java.lang.Object[].class);
- this.verifyDescribes(int.class);
- this.verifyDescribes(int[].class);
- this.verifyDescribes(void.class);
- this.verifyDescribes(java.util.Map.Entry.class);
- this.verifyDescribes(java.util.Map.Entry[][].class);
- }
-
- private void verifyDescribes(Class<?> javaClass) throws Exception {
- JavaType javaType = new SimpleJavaType(javaClass);
- assertTrue(javaType.describes(javaClass));
- }
-
- public void testDeclaration() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.declaration());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertEquals("java.lang.Object[]", javaType.declaration());
-
- javaType = new SimpleJavaType(int.class);
- assertEquals("int", javaType.declaration());
-
- javaType = new SimpleJavaType(int[].class);
- assertEquals("int[]", javaType.declaration());
-
- javaType = new SimpleJavaType(void.class);
- assertEquals("void", javaType.declaration());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map.Entry", javaType.declaration());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertEquals("java.util.Map.Entry[][]", javaType.declaration());
- }
-
- public void testIsPrimitive() throws Exception {
- JavaType javaType;
- javaType = new SimpleJavaType(java.lang.Object.class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(java.lang.Object[].class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(int.class);
- assertTrue(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(int[].class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(void.class);
- assertTrue(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(java.util.Map.Entry.class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new SimpleJavaType(java.util.Map.Entry[][].class);
- assertFalse(javaType.isPrimitive());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JptCommonUtilityTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JptCommonUtilityTests.java
deleted file mode 100644
index 883607e128..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/JptCommonUtilityTests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.common.utility.tests.internal.enumerations.JptUtilityEnumerationsTests;
-import org.eclipse.jpt.common.utility.tests.internal.iterables.JptUtilityIterablesTests;
-import org.eclipse.jpt.common.utility.tests.internal.iterators.JptUtilityIteratorsTests;
-import org.eclipse.jpt.common.utility.tests.internal.model.JptUtilityModelTests;
-import org.eclipse.jpt.common.utility.tests.internal.node.JptUtilityNodeTests;
-import org.eclipse.jpt.common.utility.tests.internal.synchronizers.JptUtilitySynchronizersTests;
-
-/**
- * decentralize test creation code
- */
-public class JptCommonUtilityTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCommonUtilityTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityEnumerationsTests.suite());
- suite.addTest(JptUtilityIterablesTests.suite());
- suite.addTest(JptUtilityIteratorsTests.suite());
- suite.addTest(JptUtilityModelTests.suite());
- suite.addTest(JptUtilityNodeTests.suite());
- suite.addTest(JptUtilitySynchronizersTests.suite());
-
- suite.addTestSuite(ArrayToolsTests.class);
- suite.addTestSuite(AsynchronousCommandExecutorTests.class);
- suite.addTestSuite(BagTests.class);
- suite.addTestSuite(BidiFilterTests.class);
- suite.addTestSuite(BidiStringConverterTests.class);
- suite.addTestSuite(BidiTransformerTests.class);
- suite.addTestSuite(BitToolsTests.class);
- suite.addTestSuite(SimpleBooleanReferenceTests.class);
- suite.addTestSuite(BooleanToolsTests.class);
- suite.addTestSuite(ClasspathTests.class);
- suite.addTestSuite(ClassNameTests.class);
- suite.addTestSuite(CollectionToolsTests.class);
- suite.addTestSuite(CommandExecutorTests.class);
- suite.addTestSuite(CommandRunnableTests.class);
- suite.addTestSuite(CommandTests.class);
- suite.addTestSuite(CompositeCommandTests.class);
- suite.addTestSuite(ExceptionHandlerTests.class);
- suite.addTestSuite(FileToolsTests.class);
- suite.addTestSuite(FilterTests.class);
- suite.addTestSuite(HashBagTests.class);
- suite.addTestSuite(IdentityHashBagTests.class);
- suite.addTestSuite(IndentingPrintWriterTests.class);
- suite.addTestSuite(SimpleIntReferenceTests.class);
- suite.addTestSuite(JavaTypeTests.class);
- suite.addTestSuite(JDBCTypeTests.class);
- suite.addTestSuite(KeyedSetTests.class);
- suite.addTestSuite(ListenerListTests.class);
- suite.addTestSuite(MethodSignatureTests.class);
- suite.addTestSuite(NameToolsTests.class);
- suite.addTestSuite(NotNullFilterTests.class);
- suite.addTestSuite(RangeTests.class);
- suite.addTestSuite(ReflectionToolsTests.class);
- suite.addTestSuite(ReverseComparatorTests.class);
- suite.addTestSuite(SimpleAssociationTests.class);
- suite.addTestSuite(SimpleObjectReferenceTests.class);
- suite.addTestSuite(SimpleQueueTests.class);
- suite.addTestSuite(SimpleStackTests.class);
- suite.addTestSuite(StringToolsTests.class);
- suite.addTestSuite(SynchronizedBooleanTests.class);
- suite.addTestSuite(SynchronizedIntTests.class);
- suite.addTestSuite(SynchronizedObjectTests.class);
- suite.addTestSuite(SynchronizedQueueTests.class);
- suite.addTestSuite(SynchronizedStackTests.class);
- suite.addTestSuite(ToolsTests.class);
- suite.addTestSuite(VersionComparatorTests.class);
- suite.addTestSuite(XMLStringEncoderTests.class);
-
- return suite;
- }
-
- private JptCommonUtilityTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/KeyedSetTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/KeyedSetTests.java
deleted file mode 100644
index 7c27e5d2a6..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/KeyedSetTests.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.KeyedSet;
-
-@SuppressWarnings("nls")
-public class KeyedSetTests
- extends TestCase {
-
- private KeyedSet<String, String> nicknames;
-
-
- public KeyedSetTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.nicknames = this.buildNicknames();
- }
-
- private KeyedSet<String, String> buildNicknames() {
- KeyedSet<String, String> ks = new KeyedSet<String, String>();
- ks.addItem("Jimmy", "James Sullivan");
- ks.addKey("Sully", "James Sullivan");
- ks.addItem("Bob", "Robert McKenna");
- ks.addKey("Mac", "Robert McKenna");
- return ks;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAddItem() {
- // items added in setup
- assertTrue(this.nicknames.containsItem("James Sullivan"));
- assertTrue(this.nicknames.containsItem("Robert McKenna"));
-
- assertFalse(this.nicknames.containsItem("John Teasdale"));
- this.nicknames.addItem("Jack", "John Teasdale");
- assertTrue(this.nicknames.containsItem("John Teasdale"));
-
- this.nicknames.addItem("Teaser", "John Teasdale");
- assertTrue(this.nicknames.containsItem("John Teasdale"));
- assertTrue(this.nicknames.containsKey("Teaser"));
- }
-
- public void testAddKey() {
- // items added in setup
- assertTrue(this.nicknames.containsKey("Jimmy"));
- assertTrue(this.nicknames.containsKey("Sully"));
- assertTrue(this.nicknames.containsKey("Bob"));
- assertTrue(this.nicknames.containsKey("Mac"));
-
- assertFalse(this.nicknames.containsKey("Robbie"));
- this.nicknames.addKey("Robbie", "Robert McKenna");
- assertTrue(this.nicknames.containsKey("Robbie"));
-
- boolean exceptionCaught = false;
- try {
- this.nicknames.addKey("Teaser", "John Teasdale");
- }
- catch (IllegalArgumentException iae) {
- exceptionCaught = true;
- }
- assertTrue(exceptionCaught);
- }
-
- public void testGetItem() {
- // items added in setup
- assertEquals(this.nicknames.getItem("Jimmy"), "James Sullivan");
- assertEquals(this.nicknames.getItem("Sully"), "James Sullivan");
- assertEquals(this.nicknames.getItem("Bob"), "Robert McKenna");
- assertEquals(this.nicknames.getItem("Mac"), "Robert McKenna");
- assertNull(this.nicknames.getItem("Jack"));
- }
-
- public void testRemoveItem() {
- // items added in setup
- assertTrue(this.nicknames.containsItem("James Sullivan"));
- assertTrue(this.nicknames.containsKey("Jimmy"));
- assertTrue(this.nicknames.containsKey("Sully"));
-
- assertTrue(this.nicknames.removeItem("James Sullivan"));
- assertFalse(this.nicknames.containsItem("James Sullivan"));
- assertFalse(this.nicknames.containsKey("Jimmy"));
- assertFalse(this.nicknames.containsKey("Sully"));
-
- assertFalse(this.nicknames.removeItem("William Goldberg"));
- }
-
- public void testRemoveKey() {
- // items added in setup
- assertTrue(this.nicknames.containsItem("James Sullivan"));
- assertTrue(this.nicknames.containsKey("Jimmy"));
- assertTrue(this.nicknames.containsKey("Sully"));
-
- assertTrue(this.nicknames.removeKey("Jimmy"));
- assertTrue(this.nicknames.containsItem("James Sullivan"));
- assertFalse(this.nicknames.containsKey("Jimmy"));
- assertTrue(this.nicknames.containsKey("Sully"));
-
- assertTrue(this.nicknames.removeKey("Sully"));
- assertFalse(this.nicknames.containsItem("James Sullivan"));
- assertFalse(this.nicknames.containsKey("Jimmy"));
- assertFalse(this.nicknames.containsKey("Sully"));
-
- assertFalse(this.nicknames.removeKey("Billy"));
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java
deleted file mode 100644
index 7dd0f52e9f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ListenerListTests.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.io.Serializable;
-import java.util.EventListener;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.Tools;
-
-@SuppressWarnings("nls")
-public class ListenerListTests extends TestCase {
-
- public ListenerListTests(String name) {
- super(name);
- }
-
- public void testGetListeners() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener1 = new LocalListener();
- Listener listener2 = new LocalListener();
- Iterable<Listener> listeners = listenerList.getListeners();
- assertEquals(0, CollectionTools.size(listeners));
-
- listenerList.add(listener1);
- listenerList.add(listener2);
- listeners = listenerList.getListeners();
- assertEquals(2, CollectionTools.size(listeners));
- assertTrue(CollectionTools.contains(listeners, listener1));
- assertTrue(CollectionTools.contains(listeners, listener2));
- }
-
- public void testSize() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener1 = new LocalListener();
- Listener listener2 = new LocalListener();
- assertEquals(0, listenerList.size());
-
- listenerList.add(listener1);
- listenerList.add(listener2);
- assertEquals(2, listenerList.size());
- }
-
- public void testIsEmpty() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener1 = new LocalListener();
- Listener listener2 = new LocalListener();
- assertTrue(listenerList.isEmpty());
-
- listenerList.add(listener1);
- listenerList.add(listener2);
- assertFalse(listenerList.isEmpty());
- }
-
- public void testAdd_null() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- boolean exCaught = false;
- try {
- listenerList.add(null);
- fail("invalid listener list: " + listenerList);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAdd_duplicate() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener = new LocalListener();
- listenerList.add(listener);
-
- boolean exCaught = false;
- try {
- listenerList.add(listener);
- fail("invalid listener list: " + listenerList);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemove() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener1 = new LocalListener();
- Listener listener2 = new LocalListener();
- listenerList.add(listener1);
- listenerList.add(listener2);
- assertTrue(CollectionTools.contains(listenerList.getListeners(), listener1));
- assertTrue(CollectionTools.contains(listenerList.getListeners(), listener2));
-
- listenerList.remove(listener1);
- assertFalse(CollectionTools.contains(listenerList.getListeners(), listener1));
- assertTrue(CollectionTools.contains(listenerList.getListeners(), listener2));
-
- listenerList.remove(listener2);
- assertFalse(CollectionTools.contains(listenerList.getListeners(), listener2));
- }
-
- public void testRemove_null() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- boolean exCaught = false;
- try {
- listenerList.remove(null);
- fail("invalid listener list: " + listenerList);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemove_unregistered() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener = new LocalListener();
- listenerList.add(listener);
- listenerList.remove(listener);
-
- boolean exCaught = false;
- try {
- listenerList.remove(listener);
- fail("invalid listener list: " + listenerList);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testClear() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener1 = new LocalListener();
- Listener listener2 = new LocalListener();
- listenerList.add(listener1);
- listenerList.add(listener2);
- assertTrue(CollectionTools.contains(listenerList.getListeners(), listener1));
- assertTrue(CollectionTools.contains(listenerList.getListeners(), listener2));
-
- listenerList.clear();
- assertFalse(CollectionTools.contains(listenerList.getListeners(), listener1));
- assertFalse(CollectionTools.contains(listenerList.getListeners(), listener2));
- }
-
- public void testSerialization() throws Exception {
- // This test doesn't pass in the Eclipse build environment (Linux/IBM VM) for some reason
- if (Tools.jvmIsSun()) {
- this.verifySerialization();
- }
- }
-
- private void verifySerialization() throws Exception {
- ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- Listener listener1 = new LocalListener();
- Listener listener2 = new LocalListener();
- listenerList.add(listener1);
- listenerList.add(listener2);
-
- ListenerList<Listener> listenerList2 = TestTools.serialize(listenerList);
- assertNotSame(listenerList, listenerList2);
- assertEquals(2, listenerList2.size());
-
- Listener listener3 = new NonSerializableListener();
- listenerList.add(listener3);
-
- listenerList2 = TestTools.serialize(listenerList);
- assertNotSame(listenerList, listenerList2);
- assertEquals(2, listenerList2.size());
-
- }
-
- interface Listener extends EventListener {
- void somethingHappened();
- }
-
- static class LocalListener implements Listener, Serializable {
- public void somethingHappened() {
- // do nothing
- }
- }
-
- static class NonSerializableListener implements Listener {
- public void somethingHappened() {
- // do nothing
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MethodSignatureTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MethodSignatureTests.java
deleted file mode 100644
index 6558e2f45f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MethodSignatureTests.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.SimpleJavaType;
-import org.eclipse.jpt.common.utility.internal.SimpleMethodSignature;
-
-@SuppressWarnings("nls")
-public class MethodSignatureTests extends TestCase {
-
- public MethodSignatureTests(String name) {
- super(name);
- }
-
- public void testInvalidNameNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature((String) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidNameEmpty() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("");
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypesNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", (JavaType[]) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypesNullItem() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new JavaType[1]);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypesVoidItem() throws Exception {
- JavaType jt = new SimpleJavaType(void.class.getName());
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new JavaType[] {jt});
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypeNamesNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", (String[]) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterTypeNamesNullItem() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new String[1]);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterJavaClassesNull() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", (Class<?>[]) null);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidParameterJavaClassesNullItem() throws Exception {
- boolean exCaught = false;
- try {
- MethodSignature methodSignature = new SimpleMethodSignature("foo", new Class[1]);
- fail("invalid MethodSignature: " + methodSignature);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testGetSignature0() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method0"));
- assertEquals("method0()", ms.getSignature());
- }
-
- public void testGetSignature1() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method1"));
- assertEquals("method1(int)", ms.getSignature());
- }
-
- public void testGetSignature2() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method2"));
- assertEquals("method2(int, java.lang.String)", ms.getSignature());
- }
-
- public void testGetSignature3() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method3"));
- assertEquals("method3(int, java.lang.String, java.lang.Object[][])", ms.getSignature());
- }
-
- public void testGetName() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method2"));
- assertEquals("method2", ms.getName());
- }
-
- public void testGetParameterTypes() throws Exception {
- MethodSignature ms = new SimpleMethodSignature(this.getMethod("method3"));
- JavaType[] expected = new JavaType[3];
- expected[0] = new SimpleJavaType("int");
- expected[1] = new SimpleJavaType("java.lang.String");
- expected[2] = new SimpleJavaType("java.lang.Object", 2);
- assertTrue(Arrays.equals(expected, ms.getParameterTypes()));
- }
-
- public void testEquals() throws Exception {
- Object ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- Object ms2 = new SimpleMethodSignature(this.getMethod("method3"));
- assertNotSame(ms1, ms2);
- assertEquals(ms1, ms1);
- assertEquals(ms1, ms2);
- assertEquals(ms1.hashCode(), ms2.hashCode());
-
- Object ms3 = new SimpleMethodSignature(this.getMethod("method2"));
- assertNotSame(ms1, ms3);
- assertFalse(ms1.equals(ms3));
- }
-
- public void testClone() throws Exception {
- SimpleMethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- SimpleMethodSignature ms2 = (SimpleMethodSignature) ms1.clone();
- assertNotSame(ms1, ms2);
- assertEquals(ms1, ms2);
- }
-
- public void testSerialization() throws Exception {
- SimpleMethodSignature ms1 = new SimpleMethodSignature(this.getMethod("method3"));
- SimpleMethodSignature ms2 = TestTools.serialize(ms1);
- assertNotSame(ms1, ms2);
- assertEquals(ms1, ms2);
- }
-
- private Method getMethod(String methodName) {
- for (Method method : this.getClass().getMethods()) {
- if (method.getName().equals(methodName)) {
- return method;
- }
- }
- throw new IllegalArgumentException("method not found: " + methodName);
- }
-
- public void method0() { /* used by tests */ }
- @SuppressWarnings("unused") public void method1(int foo) { /* used by tests */ }
- @SuppressWarnings("unused") public void method2(int foo, String bar) { /* used by tests */ }
- @SuppressWarnings("unused") public void method3(int foo, String bar, Object[][] baz) { /* used by tests */ }
-
- @SuppressWarnings("unused") public void methodA(int foo, String bar) { /* used by tests */ }
- @SuppressWarnings("unused") public void methodA(int foo, String bar, String baz) { /* used by tests */ }
-
- @SuppressWarnings("unused") public void methodB(int foo, Object bar) { /* used by tests */ }
- @SuppressWarnings("unused") public void methodB(int foo, String bar) { /* used by tests */ }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MultiThreadedTestCase.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MultiThreadedTestCase.java
deleted file mode 100644
index 10ac313cc0..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/MultiThreadedTestCase.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Vector;
-import java.util.concurrent.ThreadFactory;
-
-import org.eclipse.jpt.common.utility.internal.CompositeException;
-
-import junit.framework.TestCase;
-
-/**
- * This test case helps simplify the testing of multi-threaded code.
- */
-@SuppressWarnings("nls")
-public abstract class MultiThreadedTestCase
- extends TestCase
-{
- private final ArrayList<Thread> threads = new ArrayList<Thread>();
- /* private */ final Vector<Throwable> exceptions = new Vector<Throwable>();
-
- /**
- * The default "tick" is one second.
- * Specify the appropriate system property to override.
- */
- public static final String TICK_SYSTEM_PROPERTY_NAME = "org.eclipse.jpt.common.utility.tests.tick";
- public static final long TICK = Long.getLong(TICK_SYSTEM_PROPERTY_NAME, 1000).longValue();
- public static final long TWO_TICKS = 2 * TICK;
- public static final long THREE_TICKS = 3 * TICK;
-
- /**
- * Default constructor.
- */
- public MultiThreadedTestCase() {
- super();
- }
-
- /**
- * Named constructor.
- */
- public MultiThreadedTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /**
- * Stop all the threads constructed during the test case.
- * If any exceptions were thrown by the threads, re-throw them here.
- */
- @Override
- protected void tearDown() throws Exception {
- for (Thread thread : this.threads) {
- if (thread.isAlive()) {
- throw new IllegalStateException("thread is still alive: " + thread);
- }
- }
- if ( ! this.exceptions.isEmpty()) {
- throw new CompositeException(this.exceptions);
- }
- TestTools.clear(this);
- super.tearDown();
- }
-
- protected Thread buildThread(Runnable runnable) {
- return this.buildThread(runnable, null);
- }
-
- protected Thread buildThread(Runnable runnable, String name) {
- Thread thread = new Thread(new RunnableWrapper(runnable));
- if (name != null) {
- thread.setName(name);
- }
- this.threads.add(thread);
- return thread;
- }
-
- protected ThreadFactory buildThreadFactory() {
- return new TestThreadFactory();
- }
-
- /**
- * Convenience method that handles {@link InterruptedException}.
- */
- public void sleep(long millis) {
- TestTools.sleep(millis);
- }
-
-
- /**
- * Wrap a runnable and log any exception it throws.
- */
- public class TestThreadFactory implements ThreadFactory {
- public Thread newThread(Runnable r) {
- return MultiThreadedTestCase.this.buildThread(r);
- }
- }
-
- /**
- * Simplify runnables that execute call that throws checked exceptions.
- */
- public abstract class TestRunnable implements Runnable {
- public final void run() {
- try {
- this.run_();
- } catch (Throwable ex) {
- throw new RuntimeException(ex);
- }
- }
- protected abstract void run_() throws Throwable;
- }
-
- /**
- * Wrap a runnable and log any exception it throws.
- */
- private class RunnableWrapper implements Runnable {
- private final Runnable runnable;
- RunnableWrapper(Runnable runnable) {
- super();
- this.runnable = runnable;
- }
- public void run() {
- try {
- this.runnable.run();
- } catch (Throwable ex) {
- MultiThreadedTestCase.this.exceptions.add(ex);
- }
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NameToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NameToolsTests.java
deleted file mode 100644
index d486aab6b7..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NameToolsTests.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.NameTools;
-
-@SuppressWarnings("nls")
-public class NameToolsTests extends TestCase {
-
- public NameToolsTests(String name) {
- super(name);
- }
-
- public void testStringAbsentIgnoreCase() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameForIgnoreCase("Taupe", colorCollection);
- assertEquals("Taupe", returned);
- }
-
- public void testStringPresentCaseDiffers() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameFor("green", colorCollection);
- assertEquals("green", returned);
- }
-
- public void testStringPresentIgnoreCase() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameForIgnoreCase("green", colorCollection);
- assertEquals("green2", returned);
- }
-
- public void testStringPresentWithAppendices() {
- List<String> colorCollection = this.buildColorCollection();
- colorCollection.add("Red1");
- colorCollection.add("red2");
- String returned = NameTools.uniqueNameForIgnoreCase("red", colorCollection);
- colorCollection.remove("Red1");
- colorCollection.remove("red2");
- assertEquals("red3", returned);
- }
-
- private List<String> buildColorCollection() {
- List<String> colorCollection = new ArrayList<String>();
- colorCollection.add("Red");
- colorCollection.add("Orange");
- colorCollection.add("Yellow");
- colorCollection.add("Green");
- colorCollection.add("Blue");
- colorCollection.add("Indigo");
- colorCollection.add("Violet");
- return colorCollection;
- }
-
- public void testUniqueNameForCollection1() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle Corporation");
- strings.add("Oracle2");
- strings.add("oracle1");
- strings.add("Oracl");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings));
-
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings));
- }
-
- public void testUniqueNameForCollection2() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings));
-
- strings.add("Oracle Corporation");
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings));
- }
-
- public void testUniqueNameForCollection3() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- }
-
- public void testUniqueNameForIterator1() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle Corporation");
- strings.add("Oracle2");
- strings.add("oracle1");
- strings.add("Oracl");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator()));
-
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator()));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator()));
- }
-
- public void testUniqueNameForIterator2() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator()));
-
- strings.add("Oracle Corporation");
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator()));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator()));
- }
-
- public void testUniqueNameForIterator3() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- }
-
- public void testBuildQualifiedDatabaseObjectName() {
- assertEquals("catalog.schema.name", NameTools.buildQualifiedDatabaseObjectName("catalog", "schema", "name"));
- assertEquals("catalog..name", NameTools.buildQualifiedDatabaseObjectName("catalog", null, "name"));
- assertEquals("schema.name", NameTools.buildQualifiedDatabaseObjectName(null, "schema", "name"));
- assertEquals("name", NameTools.buildQualifiedDatabaseObjectName(null, null, "name"));
- }
-
- public void testJavaReservedWords() {
- assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "class"));
- assertFalse(CollectionTools.contains(NameTools.javaReservedWords(), "Class"));
- assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "private"));
- }
-
- public void testconvertToJavaIdentifierString() {
- assertEquals("foo", NameTools.convertToJavaIdentifier("foo"));
- assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1"));
- assertEquals("private_", NameTools.convertToJavaIdentifier("private"));
- assertEquals("throw_", NameTools.convertToJavaIdentifier("throw"));
- assertEquals("_foo", NameTools.convertToJavaIdentifier("1foo"));
- assertEquals("foo_", NameTools.convertToJavaIdentifier("foo%"));
- assertEquals("foo__bar__", NameTools.convertToJavaIdentifier("foo bar "));
- }
-
- public void testconvertToJavaIdentifierStringChar() {
- assertEquals("foo", NameTools.convertToJavaIdentifier("foo", '$'));
- assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1", '$'));
- assertEquals("private$", NameTools.convertToJavaIdentifier("private", '$'));
- assertEquals("throwss", NameTools.convertToJavaIdentifier("throw", 's'));
- assertEquals("$foo", NameTools.convertToJavaIdentifier("1foo", '$'));
- assertEquals("foo$", NameTools.convertToJavaIdentifier("foo%", '$'));
- assertEquals("foo$$bar$$", NameTools.convertToJavaIdentifier("foo bar ", '$'));
-
- boolean exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("1foo", '7');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('7') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("foo%", '^');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('^') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("private", '^');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('^') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- }
-
- public void testStringIsLegalJavaIdentifier() {
- assertFalse(NameTools.stringIsLegalJavaIdentifier("class"));
- assertTrue(NameTools.stringIsLegalJavaIdentifier("clasS"));
-
- assertFalse(NameTools.stringIsLegalJavaIdentifier("7foo"));
- assertFalse(NameTools.stringIsLegalJavaIdentifier("foo@bar"));
- assertTrue(NameTools.stringIsLegalJavaIdentifier("_foo"));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NotNullFilterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NotNullFilterTests.java
deleted file mode 100644
index caf06708ae..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/NotNullFilterTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-
-@SuppressWarnings("nls")
-public class NotNullFilterTests extends TestCase {
-
- public NotNullFilterTests(String name) {
- super(name);
- }
-
- public void testNotNullFilter() {
- Filter<String> filter = NotNullFilter.instance();
- assertTrue(filter.accept(""));
- assertFalse(filter.accept(null));
- assertTrue(filter.accept("foo"));
- assertTrue(filter.accept("bar"));
- }
-
- public void testToString() {
- Filter<String> filter = NotNullFilter.instance();
- assertNotNull(filter.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/RangeTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/RangeTests.java
deleted file mode 100644
index dcd959295a..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/RangeTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.Range;
-
-public class RangeTests extends TestCase {
-
- public RangeTests(String name) {
- super(name);
- }
-
- public void testIncludes() {
- Range range = new Range(5, 17);
- assertFalse(range.includes(-55));
- assertFalse(range.includes(0));
- assertFalse(range.includes(4));
- assertTrue(range.includes(5));
- assertTrue(range.includes(6));
- assertTrue(range.includes(16));
- assertTrue(range.includes(17));
- assertFalse(range.includes(18));
- assertFalse(range.includes(200));
- }
-
- public void testEquals() {
- Range range1 = new Range(5, 17);
- Range range2 = new Range(5, 17);
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
-
- range2 = new Range(17, 5);
- assertFalse(range1.equals(range2));
- assertFalse(range2.equals(range1));
- // although they are unequal, they can have the same hash code
- assertEquals(range1.hashCode(), range2.hashCode());
-
- range2 = new Range(5, 15);
- assertFalse(range1.equals(range2));
- assertFalse(range2.equals(range1));
- }
-
- public void testClone() {
- Range range1 = new Range(5, 17);
- Range range2 = range1.clone();
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
- }
-
- public void testSerialization() throws Exception {
- Range range1 = new Range(5, 17);
- Range range2 = TestTools.serialize(range1);
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReflectionToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReflectionToolsTests.java
deleted file mode 100644
index d210cb0f5f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReflectionToolsTests.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-@SuppressWarnings("nls")
-public class ReflectionToolsTests extends TestCase {
-
- private static String testStaticField;
-
- public ReflectionToolsTests(String name) {
- super(name);
- }
-
-// this is no longer true - it appears the JLS now defines the generated names...
-// /**
-// * Return the compiler-generated class name. The Eclipse compiler generates
-// * "local" classes with names in the form "com.foo.Outer$1$Local"; while the
-// * JDK compiler generates "com.foo.Outer$1Local". There might be other
-// * differences.... ~bjv
-// */
-// public static String compilerDependentClassNameFor(String className) {
-// int index = className.indexOf("$1$");
-// if (index == -1) {
-// return className;
-// }
-// try {
-// Class.forName(className);
-// } catch (ClassNotFoundException ex) {
-// return className.substring(0, index + 2) + className.substring(index + 3);
-// }
-// return className;
-// }
-//
-// private static String munge(String className) {
-// return compilerDependentClassNameFor(className);
-// }
-
- public void testAllFields() {
- int fieldCount = 0;
- fieldCount += java.util.Vector.class.getDeclaredFields().length;
- fieldCount += java.util.AbstractList.class.getDeclaredFields().length;
- fieldCount += java.util.AbstractCollection.class.getDeclaredFields().length;
- fieldCount += java.lang.Object.class.getDeclaredFields().length;
- Iterable<Field> fields = ReflectionTools.getAllFields(java.util.Vector.class);
- assertEquals(fieldCount, CollectionTools.size(fields));
- assertTrue(CollectionTools.contains(this.fieldNames(fields), "modCount"));
- assertTrue(CollectionTools.contains(this.fieldNames(fields), "serialVersionUID"));
- assertTrue(CollectionTools.contains(this.fieldNames(fields), "capacityIncrement"));
- assertTrue(CollectionTools.contains(this.fieldNames(fields), "elementCount"));
- assertTrue(CollectionTools.contains(this.fieldNames(fields), "elementData"));
- assertTrue(fields.iterator().next().isAccessible());
- }
-
- public void testAllMethods() {
- int methodCount = 0;
- methodCount += java.util.Vector.class.getDeclaredMethods().length;
- methodCount += java.util.AbstractList.class.getDeclaredMethods().length;
- methodCount += java.util.AbstractCollection.class.getDeclaredMethods().length;
- methodCount += java.lang.Object.class.getDeclaredMethods().length;
- Iterable<Method> methods = ReflectionTools.getAllMethods(java.util.Vector.class);
- assertEquals(methodCount, CollectionTools.size(methods));
- assertTrue(CollectionTools.contains(this.methodNames(methods), "wait"));
- assertTrue(CollectionTools.contains(this.methodNames(methods), "addElement"));
- assertTrue(methods.iterator().next().isAccessible());
- }
-
- public void testNewInstanceClass() {
- Vector<?> v = ReflectionTools.newInstance(java.util.Vector.class);
- assertNotNull(v);
- assertEquals(0, v.size());
- }
-
- public void testNewInstanceClassClassObject() {
- int initialCapacity = 200;
- Vector<?> v = ReflectionTools.newInstance(java.util.Vector.class, int.class, new Integer(initialCapacity));
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ReflectionTools.getFieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
- }
-
- public void testNewInstanceClassClassArrayObjectArray() {
- int initialCapacity = 200;
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = int.class;
- Object[] parms = new Object[1];
- parms[0] = new Integer(initialCapacity);
- Vector<?> v = ReflectionTools.newInstance(java.util.Vector.class, parmTypes, parms);
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ReflectionTools.getFieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- parms[0] = new Integer(-1);
- boolean exCaught = false;
- try {
- v = ReflectionTools.newInstance(java.util.Vector.class, parmTypes, parms);
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue("RuntimeException not thrown", exCaught);
-
- parmTypes[0] = java.lang.String.class;
- parms[0] = "foo";
- exCaught = false;
- try {
- v = ReflectionTools.newInstance(java.util.Vector.class, parmTypes, parms);
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof NoSuchMethodException) {
- exCaught = true;
- }
- }
- assertTrue("NoSuchMethodException not thrown", exCaught);
- }
-
- public void testFieldValue() {
- int initialCapacity = 200;
- Vector<?> v = new Vector<Object>(initialCapacity);
- Object[] elementData = (Object[]) ReflectionTools.getFieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- // test inherited field
- Integer modCountInteger = (Integer) ReflectionTools.getFieldValue(v, "modCount");
- int modCount = modCountInteger.intValue();
- assertEquals(0, modCount);
-
- boolean exCaught = false;
- Object bogusFieldValue = null;
- try {
- bogusFieldValue = ReflectionTools.getFieldValue(v, "bogusField");
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof NoSuchFieldException) {
- exCaught = true;
- }
- }
- assertTrue("NoSuchFieldException not thrown: " + bogusFieldValue, exCaught);
- }
-
- public void testExecuteMethodObjectString() {
- Vector<String> v = new Vector<String>();
- int size = ((Integer) ReflectionTools.executeMethod(v, "size")).intValue();
- assertEquals(0, size);
-
- v.addElement("foo");
- size = ((Integer) ReflectionTools.executeMethod(v, "size")).intValue();
- assertEquals(1, size);
- }
-
- public void testExecuteMethodObjectStringClassObject() {
- Vector<String> v = new Vector<String>();
- boolean booleanResult = ((Boolean) ReflectionTools.executeMethod(v, "add", Object.class, "foo")).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
- Object voidResult = ReflectionTools.executeMethod(v, "addElement", Object.class, "bar");
- assertNull(voidResult);
- }
-
- public void testExecuteMethodObjectStringClassArrayObjectArray() {
- Vector<String> v = new Vector<String>();
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = java.lang.Object.class;
- Object[] parms = new Object[1];
- parms[0] = "foo";
- boolean booleanResult = ((Boolean) ReflectionTools.executeMethod(v, "add", parmTypes, parms)).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- Object bogusMethodReturnValue = null;
- try {
- bogusMethodReturnValue = ReflectionTools.executeMethod(v, "bogusMethod", parmTypes, parms);
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof NoSuchMethodException) {
- exCaught = true;
- }
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusMethodReturnValue, exCaught);
- }
-
- public void testExecuteStaticMethodClassString() {
- Double randomObject = (Double) ReflectionTools.executeStaticMethod(java.lang.Math.class, "random");
- assertNotNull(randomObject);
- double random = randomObject.doubleValue();
- assertTrue(random >= 0);
- assertTrue(random < 1);
- }
-
- public void testExecuteStaticMethodClassStringClassObject() {
- String s = (String) ReflectionTools.executeStaticMethod(java.lang.String.class, "valueOf", boolean.class, Boolean.TRUE);
- assertNotNull(s);
- assertEquals("true", s);
- }
-
- public void testExecuteStaticMethodClassStringClassArrayObjectArray() {
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = boolean.class;
- Object[] parms = new Object[1];
- parms[0] = Boolean.TRUE;
- String s = (String) ReflectionTools.executeStaticMethod(java.lang.String.class, "valueOf", parmTypes, parms);
- assertNotNull(s);
- assertEquals("true", s);
-
- boolean exCaught = false;
- Object bogusStaticMethodReturnValue = null;
- try {
- bogusStaticMethodReturnValue = ReflectionTools.executeStaticMethod(java.lang.String.class, "bogusStaticMethod", parmTypes, parms);
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof NoSuchMethodException) {
- exCaught = true;
- }
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught);
-
- // test non-static method
- exCaught = false;
- try {
- bogusStaticMethodReturnValue = ReflectionTools.executeStaticMethod(java.lang.String.class, "toString");
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof NoSuchMethodException) {
- exCaught = true;
- }
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught);
- }
-
- public void testSetFieldValue() {
- Vector<String> v = new Vector<String>();
- Object[] newElementData = new Object[5];
- newElementData[0] = "foo";
- ReflectionTools.setFieldValue(v, "elementData", newElementData);
- ReflectionTools.setFieldValue(v, "elementCount", new Integer(1));
- // test inherited field
- ReflectionTools.setFieldValue(v, "modCount", new Integer(1));
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- try {
- ReflectionTools.setFieldValue(v, "bogusField", "foo");
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof NoSuchFieldException) {
- exCaught = true;
- }
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testSetStaticFieldValue() {
- ReflectionTools.setStaticFieldValue(this.getClass(), "testStaticField", "new value");
- assertEquals(testStaticField, "new value");
-
- boolean exCaught = false;
- try {
- ReflectionTools.setStaticFieldValue(this.getClass(), "bogusStaticField", "new value");
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof NoSuchFieldException) {
- exCaught = true;
- }
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testSimpleName() {
- assertEquals("Vector", java.util.Vector.class.getSimpleName());
- assertEquals("Entry", java.util.Map.Entry.class.getSimpleName());
- assertEquals("int", int.class.getSimpleName());
- assertEquals("int[]", int[].class.getSimpleName());
- assertEquals("int[][]", int[][].class.getSimpleName());
- assertEquals("void", void.class.getSimpleName());
- }
-
- public void testPackageName() {
- assertEquals("java.util", java.util.Vector.class.getPackage().getName());
- assertEquals("java.util", java.util.Map.Entry.class.getPackage().getName());
- }
-
- public void testArrayDepthFor() {
- assertEquals(0, ReflectionTools.getArrayDepth(java.util.Vector.class));
- assertEquals(0, ReflectionTools.getArrayDepth(int.class));
- assertEquals(0, ReflectionTools.getArrayDepth(void.class));
- assertEquals(1, ReflectionTools.getArrayDepth(java.util.Vector[].class));
- assertEquals(1, ReflectionTools.getArrayDepth(int[].class));
- assertEquals(3, ReflectionTools.getArrayDepth(java.util.Vector[][][].class));
- assertEquals(3, ReflectionTools.getArrayDepth(int[][][].class));
- }
-
- public void testElementTypeFor() {
- assertEquals(java.util.Vector.class, ReflectionTools.getElementType(java.util.Vector.class));
- assertEquals(int.class, ReflectionTools.getElementType(int.class));
- assertEquals(void.class, ReflectionTools.getElementType(void.class));
- assertEquals(java.util.Vector.class, ReflectionTools.getElementType(java.util.Vector[].class));
- assertEquals(int.class, ReflectionTools.getElementType(int[].class));
- assertEquals(java.util.Vector.class, ReflectionTools.getElementType(java.util.Vector[][][].class));
- assertEquals(int.class, ReflectionTools.getElementType(int[][][].class));
- }
-
- public void testClassIsPrimitiveWrapperClass() {
- assertTrue(ReflectionTools.classIsPrimitiveWrapper(java.lang.Void.class));
- assertTrue(ReflectionTools.classIsPrimitiveWrapper(java.lang.Boolean.class));
- assertTrue(ReflectionTools.classIsPrimitiveWrapper(java.lang.Integer.class));
- assertTrue(ReflectionTools.classIsPrimitiveWrapper(java.lang.Float.class));
-
- assertFalse(ReflectionTools.classIsPrimitiveWrapper(java.lang.String.class));
- assertFalse(ReflectionTools.classIsPrimitiveWrapper(void.class));
- assertFalse(ReflectionTools.classIsPrimitiveWrapper(int.class));
- }
-
- public void testClassIsVariablePrimitiveWrapperClass() {
- assertFalse(ReflectionTools.classIsVariablePrimitiveWrapper(java.lang.Void.class));
-
- assertTrue(ReflectionTools.classIsVariablePrimitiveWrapper(java.lang.Boolean.class));
- assertTrue(ReflectionTools.classIsVariablePrimitiveWrapper(java.lang.Integer.class));
- assertTrue(ReflectionTools.classIsVariablePrimitiveWrapper(java.lang.Float.class));
-
- assertFalse(ReflectionTools.classIsVariablePrimitiveWrapper(java.lang.String.class));
- assertFalse(ReflectionTools.classIsVariablePrimitiveWrapper(void.class));
- assertFalse(ReflectionTools.classIsVariablePrimitiveWrapper(int.class));
- }
-
- public void testWrapperClass() {
- assertEquals(java.lang.Void.class, ReflectionTools.getWrapperClass(void.class));
- assertEquals(java.lang.Integer.class, ReflectionTools.getWrapperClass(int.class));
- assertEquals(java.lang.Float.class, ReflectionTools.getWrapperClass(float.class));
- assertEquals(java.lang.Boolean.class, ReflectionTools.getWrapperClass(boolean.class));
-
- assertNull(ReflectionTools.getWrapperClass(java.lang.String.class));
- }
-
- public void testClassForTypeDeclarationStringInt() throws Exception {
- assertEquals(int.class, ReflectionTools.getClassForTypeDeclaration("int", 0));
- assertEquals(int[].class, ReflectionTools.getClassForTypeDeclaration("int", 1));
- assertEquals(int[][][].class, ReflectionTools.getClassForTypeDeclaration("int", 3));
-
- assertEquals(Object.class, ReflectionTools.getClassForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class, ReflectionTools.getClassForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class, ReflectionTools.getClassForTypeDeclaration("void", 0));
- try {
- ReflectionTools.getClassForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (RuntimeException ex) {
- // expected
- }
- }
-
- public void testCodeForClass() {
- assertEquals('I', ReflectionTools.getCodeForClass(int.class));
- assertEquals('B', ReflectionTools.getCodeForClass(byte.class));
- }
-
- public void testClassNameForTypeDeclarationString() throws Exception {
- assertEquals("int", ReflectionTools.getClassNameForTypeDeclaration("int"));
- assertEquals("[I", ReflectionTools.getClassNameForTypeDeclaration("int[]"));
- assertEquals("[[I", ReflectionTools.getClassNameForTypeDeclaration("int [ ] [ ]"));
-
- assertEquals("java.lang.Object", ReflectionTools.getClassNameForTypeDeclaration("java.lang.Object"));
- assertEquals("[Ljava.lang.Object;", ReflectionTools.getClassNameForTypeDeclaration("java.lang.Object\t[]"));
- assertEquals("[[Ljava.lang.Object;", ReflectionTools.getClassNameForTypeDeclaration("java.lang.Object\t[]\t[]"));
- }
-
- public void testArrayDepthForTypeDeclarationString() throws Exception {
- assertEquals(0, ReflectionTools.getArrayDepthForTypeDeclaration("java.lang.Object"));
- assertEquals(1, ReflectionTools.getArrayDepthForTypeDeclaration("java.lang.Object[]"));
- assertEquals(3, ReflectionTools.getArrayDepthForTypeDeclaration("java.lang.Object[][][]"));
-
- assertEquals(0, ReflectionTools.getArrayDepthForTypeDeclaration("int"));
- assertEquals(1, ReflectionTools.getArrayDepthForTypeDeclaration("int[]"));
- assertEquals(3, ReflectionTools.getArrayDepthForTypeDeclaration("int[][][]"));
-
- assertEquals(0, ReflectionTools.getArrayDepthForTypeDeclaration("float"));
- assertEquals(1, ReflectionTools.getArrayDepthForTypeDeclaration("float [ ]"));
- assertEquals(3, ReflectionTools.getArrayDepthForTypeDeclaration("float[] [] []"));
- }
-
- public void testElementTypeNameForTypeDeclarationString() throws Exception {
- assertEquals("java.lang.Object", ReflectionTools.getElementTypeNameForTypeDeclaration("java.lang.Object"));
- assertEquals("java.lang.Object", ReflectionTools.getElementTypeNameForTypeDeclaration("java.lang.Object[]"));
- assertEquals("java.lang.Object", ReflectionTools.getElementTypeNameForTypeDeclaration("java.lang.Object[][][]"));
-
- assertEquals("int", ReflectionTools.getElementTypeNameForTypeDeclaration("int"));
- assertEquals("int", ReflectionTools.getElementTypeNameForTypeDeclaration("int[]"));
- assertEquals("int", ReflectionTools.getElementTypeNameForTypeDeclaration("int[][][]"));
-
- assertEquals("float", ReflectionTools.getElementTypeNameForTypeDeclaration("float"));
- assertEquals("float", ReflectionTools.getElementTypeNameForTypeDeclaration("float [ ]"));
- assertEquals("float", ReflectionTools.getElementTypeNameForTypeDeclaration("float[] [] []"));
- }
-
- public void testClassNameForTypeDeclarationStringInt() throws Exception {
- assertEquals(int.class.getName(), ReflectionTools.getClassNameForTypeDeclaration("int", 0));
- assertEquals(int[].class.getName(), ReflectionTools.getClassNameForTypeDeclaration("int", 1));
- assertEquals(int[][][].class.getName(), ReflectionTools.getClassNameForTypeDeclaration("int", 3));
-
- assertEquals(Object.class.getName(), ReflectionTools.getClassNameForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class.getName(), ReflectionTools.getClassNameForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class.getName(), ReflectionTools.getClassNameForTypeDeclaration("void", 0));
- try {
- ReflectionTools.getClassNameForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (IllegalArgumentException ex) {
- // expected
- }
- }
-
- private Iterable<String> fieldNames(Iterable<Field> fields) {
- return new TransformationIterable<Field, String>(fields) {
- @Override
- protected String transform(Field field) {
- return field.getName();
- }
- };
- }
-
- private Iterable<String> methodNames(Iterable<Method> methods) {
- return new TransformationIterable<Method, String>(methods) {
- @Override
- protected String transform(Method method) {
- return method.getName();
- }
- };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReverseComparatorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReverseComparatorTests.java
deleted file mode 100644
index 1287868a13..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ReverseComparatorTests.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReverseComparator;
-
-@SuppressWarnings("nls")
-public class ReverseComparatorTests extends TestCase {
- private Comparator<String> naturalReverseComparator;
- private Comparator<String> customComparator;
- private Comparator<String> customReverseComparator;
-
- public ReverseComparatorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.naturalReverseComparator = new ReverseComparator<String>();
- this.customComparator = this.buildCustomComparator();
- this.customReverseComparator = new ReverseComparator<String>(this.customComparator);
- }
-
- private Comparator<String> buildCustomComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- String lower1 = s1.toLowerCase();
- String lower2 = s2.toLowerCase();
- int result = lower1.compareTo(lower2);
- if (result == 0) {
- return s1.compareTo(s2); // use case to differentiate "equal" strings
- }
- return result;
- }
- };
- }
-
- private List<String> buildUnsortedList() {
- List<String> result = new ArrayList<String>();
- result.add("T");
- result.add("Z");
- result.add("Y");
- result.add("M");
- result.add("m");
- result.add("a");
- result.add("B");
- result.add("b");
- result.add("A");
- return result;
- }
-
- private List<String> buildNaturallySortedList() {
- List<String> result = new ArrayList<String>(this.buildUnsortedList());
- Collections.sort(result);
- return result;
- }
-
- private List<String> buildCustomSortedList() {
- List<String> result = new ArrayList<String>(this.buildUnsortedList());
- Collections.sort(result, this.customComparator);
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testNatural() {
- List<String> list = this.buildUnsortedList();
- Collections.sort(list, this.naturalReverseComparator);
- this.verifyList(this.buildNaturallySortedList(), list);
- }
-
- public void testCustom() {
- List<String> list = this.buildUnsortedList();
- Collections.sort(list, this.customReverseComparator);
- this.verifyList(this.buildCustomSortedList(), list);
- }
-
- private void verifyList(List<String> normal, List<String> reverse) {
- int size = normal.size();
- int max = size - 1;
- for (int i = 0; i < size; i++) {
- assertEquals(normal.get(i), reverse.get(max - i));
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleAssociationTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleAssociationTests.java
deleted file mode 100644
index 96fe163217..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleAssociationTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.common.utility.internal.Association;
-import org.eclipse.jpt.common.utility.internal.SimpleAssociation;
-
-@SuppressWarnings("nls")
-public class SimpleAssociationTests extends TestCase {
- private SimpleAssociation<String, String> assoc;
-
- public static Test suite() {
- return new TestSuite(SimpleAssociationTests.class);
- }
-
- public SimpleAssociationTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.assoc = new SimpleAssociation<String, String>("foo", "bar");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetKey() {
- assertEquals("foo", this.assoc.getKey());
- }
-
- public void testGetValue() {
- assertEquals("bar", this.assoc.getValue());
- }
-
- public void testSetValue() {
- assertEquals("bar", this.assoc.getValue());
- this.assoc.setValue("baz");
- assertEquals("baz", this.assoc.getValue());
- }
-
- public void testEquals() {
- assertFalse(this.assoc.equals("foo"));
-
- assertEquals(this.assoc, this.copy(this.assoc));
-
- SimpleAssociation<String, String> assoc2 = new SimpleAssociation<String, String>("foo", "baz");
- assertFalse(this.assoc.equals(assoc2));
-
- assoc2 = new SimpleAssociation<String, String>("fop", "bar");
- assertFalse(this.assoc.equals(assoc2));
-
- SimpleAssociation<String, String> assoc3 = new SimpleAssociation<String, String>(null, null);
- SimpleAssociation<String, String> assoc4 = new SimpleAssociation<String, String>(null, null);
- assertEquals(assoc3, assoc4);
- }
-
- public void testHashCode() {
- assertEquals(this.assoc.hashCode(), this.copy(this.assoc).hashCode());
-
- SimpleAssociation<String, String> assoc2 = new SimpleAssociation<String, String>(null, null);
- assertEquals(assoc2.hashCode(), this.copy(assoc2).hashCode());
- }
-
- public void testToString() {
- assertNotNull(this.assoc.toString());
- }
-
- public void testClone() {
- this.verifyClone(this.assoc, this.assoc.clone());
- }
-
- private void verifyClone(Association<String, String> expected, Association<String, String> actual) {
- assertEquals(expected, actual);
- assertNotSame(expected, actual);
- assertEquals(expected.getKey(), actual.getKey());
- assertSame(expected.getKey(), actual.getKey());
- assertEquals(expected.getValue(), actual.getValue());
- assertSame(expected.getValue(), actual.getValue());
- }
-
- public void testSerialization() throws Exception {
- @SuppressWarnings("cast")
- Association<String, String> assoc2 = (Association<String, String>) TestTools.serialize(this.assoc);
-
- assertEquals(this.assoc, assoc2);
- assertNotSame(this.assoc, assoc2);
- assertEquals(this.assoc.getKey(), assoc2.getKey());
- assertNotSame(this.assoc.getKey(), assoc2.getKey());
- assertEquals(this.assoc.getValue(), assoc2.getValue());
- assertNotSame(this.assoc.getValue(), assoc2.getValue());
- }
-
- private SimpleAssociation<String, String> copy(SimpleAssociation<String, String> sa) {
- return new SimpleAssociation<String, String>(sa.getKey(), sa.getValue());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleBooleanReferenceTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleBooleanReferenceTests.java
deleted file mode 100644
index 04c06ddde3..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleBooleanReferenceTests.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.SimpleBooleanReference;
-
-@SuppressWarnings("nls")
-public class SimpleBooleanReferenceTests extends TestCase {
-
- public SimpleBooleanReferenceTests(String name) {
- super(name);
- }
-
- public void testGetValue() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertTrue(br.getValue());
- }
-
- public void testGetValueDefault() {
- SimpleBooleanReference br = new SimpleBooleanReference();
- assertFalse(br.getValue());
- }
-
- public void testIs() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertTrue(br.is(true));
- assertFalse(br.is(false));
- }
-
- public void testIsNot() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertFalse(br.isNot(true));
- assertTrue(br.isNot(false));
- }
-
- public void testIsTrue() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertTrue(br.isTrue());
- }
-
- public void testIsFalse() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertFalse(br.isFalse());
- br.setFalse();
- assertTrue(br.isFalse());
- }
-
- public void testSetValue() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertTrue(br.getValue());
- br.setValue(false);
- assertFalse(br.getValue());
- }
-
- public void testFlip() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertTrue(br.getValue());
- assertFalse(br.flip());
- assertFalse(br.getValue());
- assertTrue(br.flip());
- assertTrue(br.getValue());
- }
-
- public void testSetNotBoolean() {
- SimpleBooleanReference br = new SimpleBooleanReference(false);
- assertFalse(br.getValue());
- br.setNot(true);
- assertFalse(br.getValue());
- br.setNot(true);
- assertFalse(br.getValue());
- br.setNot(false);
- assertTrue(br.getValue());
- }
-
- public void testSetTrue() {
- SimpleBooleanReference br = new SimpleBooleanReference(false);
- assertFalse(br.getValue());
- br.setTrue();
- assertTrue(br.getValue());
- }
-
- public void testSetFalse() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- assertTrue(br.getValue());
- br.setFalse();
- assertFalse(br.getValue());
- }
-
- public void testClone() {
- SimpleBooleanReference br = new SimpleBooleanReference(true);
- SimpleBooleanReference clone = br.clone();
- assertTrue(clone.getValue());
- }
-
- public void testToString() {
- SimpleBooleanReference br1 = new SimpleBooleanReference(true);
- assertEquals("[true]", br1.toString());
- br1.setFalse();
- assertEquals("[false]", br1.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleIntReferenceTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleIntReferenceTests.java
deleted file mode 100644
index 196570b6de..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleIntReferenceTests.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.SimpleIntReference;
-
-@SuppressWarnings("nls")
-public class SimpleIntReferenceTests extends TestCase {
-
- public SimpleIntReferenceTests(String name) {
- super(name);
- }
-
- public void testCtors() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertEquals(0, ir.getValue());
- ir = new SimpleIntReference(7);
- assertEquals(7, ir.getValue());
- ir = new SimpleIntReference(-7);
- assertEquals(-7, ir.getValue());
- }
-
- public void testEqualsInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertTrue(ir.equals(0));
- assertFalse(ir.equals(7));
-
- ir = new SimpleIntReference(7);
- assertTrue(ir.equals(7));
- assertFalse(ir.equals(0));
- }
-
- public void testNotEqualInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertFalse(ir.notEqual(0));
- assertTrue(ir.notEqual(7));
-
- ir = new SimpleIntReference(7);
- assertFalse(ir.notEqual(7));
- assertTrue(ir.notEqual(0));
- }
-
- public void testIsZero() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertTrue(ir.isZero());
-
- ir = new SimpleIntReference(7);
- assertFalse(ir.isZero());
- }
-
- public void testIsNotZero() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertFalse(ir.isNotZero());
-
- ir = new SimpleIntReference(7);
- assertTrue(ir.isNotZero());
- }
-
- public void testIsGreaterThanInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertTrue(ir.isGreaterThan(-1));
- assertFalse(ir.isGreaterThan(0));
- assertFalse(ir.isGreaterThan(7));
- }
-
- public void testIsGreaterThanOrEqualInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertTrue(ir.isGreaterThanOrEqual(-1));
- assertTrue(ir.isGreaterThanOrEqual(0));
- assertFalse(ir.isGreaterThanOrEqual(7));
- }
-
- public void testIsLessThanInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertFalse(ir.isLessThan(-1));
- assertFalse(ir.isLessThan(0));
- assertTrue(ir.isLessThan(7));
- }
-
- public void testIsLessThanOrEqualInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference();
- assertFalse(ir.isLessThanOrEqual(-1));
- assertTrue(ir.isLessThanOrEqual(0));
- assertTrue(ir.isLessThanOrEqual(7));
- }
-
- public void testIsPositive() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertFalse(ir.isPositive());
-
- ir = new SimpleIntReference();
- assertFalse(ir.isPositive());
-
- ir = new SimpleIntReference(7);
- assertTrue(ir.isPositive());
- }
-
- public void testIsNotPositive() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertTrue(ir.isNotPositive());
-
- ir = new SimpleIntReference();
- assertTrue(ir.isNotPositive());
-
- ir = new SimpleIntReference(7);
- assertFalse(ir.isNotPositive());
- }
-
- public void testIsNegative() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertTrue(ir.isNegative());
-
- ir = new SimpleIntReference();
- assertFalse(ir.isNegative());
-
- ir = new SimpleIntReference(7);
- assertFalse(ir.isNegative());
- }
-
- public void testIsNotNegative() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertFalse(ir.isNotNegative());
-
- ir = new SimpleIntReference();
- assertTrue(ir.isNotNegative());
-
- ir = new SimpleIntReference(7);
- assertTrue(ir.isNotNegative());
- }
-
- public void testSetValueInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(-3, ir.setValue(4));
- assertEquals(4, ir.getValue());
- }
-
- public void testAbs() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(3, ir.abs());
-
- ir.setValue(3);
- assertEquals(3, ir.getValue());
- assertEquals(3, ir.abs());
- }
-
- public void testNeg() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(3, ir.neg());
-
- ir.setValue(3);
- assertEquals(3, ir.getValue());
- assertEquals(-3, ir.neg());
- }
-
- public void testSetZero() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(-3, ir.setZero());
- assertEquals(0, ir.getValue());
- }
-
- public void testAddInt() {
- SimpleIntReference ir;
- int value;
- ir = new SimpleIntReference();
- assertEquals(0, ir.getValue());
-
- value = ir.add(3);
- assertEquals(3, value);
-
- ir.setValue(3);
- value = ir.add(-7);
- assertEquals(-4, value);
- }
-
- public void testIncrement() {
- SimpleIntReference ir;
- int value;
- ir = new SimpleIntReference();
- assertEquals(0, ir.getValue());
-
- value = ir.increment();
- assertEquals(1, value);
- assertEquals(1, ir.getValue());
- }
-
- public void testSubtractInt() {
- SimpleIntReference ir;
- int count;
- ir = new SimpleIntReference();
- assertEquals(0, ir.getValue());
-
- count = ir.subtract(3);
- assertEquals(-3, count);
-
- ir.setValue(-3);
- count = ir.subtract(-7);
- assertEquals(4, count);
- }
-
- public void testDecrement() {
- SimpleIntReference ir;
- int count;
- ir = new SimpleIntReference();
- assertEquals(0, ir.getValue());
-
- count = ir.decrement();
- assertEquals(-1, count);
- assertEquals(-1, ir.getValue());
- }
-
- public void testMultiplyInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(3);
- assertEquals(3, ir.getValue());
- assertEquals(9, ir.multiply(3));
- }
-
- public void testDivideInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(24);
- assertEquals(24, ir.getValue());
- assertEquals(8, ir.divide(3));
- }
-
- public void testRemainderInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(25);
- assertEquals(25, ir.getValue());
- assertEquals(1, ir.remainder(3));
- }
-
- public void testMinInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(25);
- assertEquals(25, ir.getValue());
- assertEquals(3, ir.min(3));
- assertEquals(25, ir.min(33));
- }
-
- public void testMaxInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(25);
- assertEquals(25, ir.getValue());
- assertEquals(25, ir.max(3));
- assertEquals(30, ir.max(30));
- }
-
- public void testPowInt() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(5);
- assertEquals(5, ir.getValue());
- assertTrue(ir.pow(2) == 25L);
- }
-
- public void testCompareToIntReference() {
- SimpleIntReference ir1 = new SimpleIntReference(44);
- SimpleIntReference ir2 = new SimpleIntReference(44);
- assertTrue(ir1.compareTo(ir2) == 0);
- ir2 = new SimpleIntReference(55);
- assertTrue(ir1.compareTo(ir2) < 0);
- ir2 = new SimpleIntReference(33);
- assertTrue(ir1.compareTo(ir2) > 0);
- }
-
- public void testClone() {
- SimpleIntReference ir1 = new SimpleIntReference(44);
- SimpleIntReference ir2 = ir1.clone();
- assertEquals(44, ir2.getValue());
- assertNotSame(ir1, ir2);
- }
-
- public void testSerialization() throws Exception {
- SimpleIntReference ir1 = new SimpleIntReference(44);
- SimpleIntReference ir2 = TestTools.serialize(ir1);
- assertEquals(44, ir2.getValue());
- assertNotSame(ir1, ir2);
- }
-
- public void testToString() {
- SimpleIntReference ir;
- ir = new SimpleIntReference(5);
- assertEquals("[5]", ir.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleObjectReferenceTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleObjectReferenceTests.java
deleted file mode 100644
index ea91ac9f7c..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleObjectReferenceTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.SimpleObjectReference;
-
-@SuppressWarnings("nls")
-public class SimpleObjectReferenceTests extends TestCase {
-
- public SimpleObjectReferenceTests(String name) {
- super(name);
- }
-
- public void testGetValue() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>();
- assertNull(or.getValue());
- or.setValue("foo");
- assertEquals("foo", or.getValue());
- }
-
- public void testValueEqualsObject() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>();
- assertTrue(or.valueEquals(null));
- assertFalse(or.valueEquals("foo"));
-
- or.setValue("foo");
- assertFalse(or.valueEquals(null));
- assertTrue(or.valueEquals("foo"));
- }
-
- public void testValueNotEqualObject() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>();
- assertFalse(or.valueNotEqual(null));
- assertTrue(or.valueNotEqual("foo"));
-
- or.setValue("foo");
- assertTrue(or.valueNotEqual(null));
- assertFalse(or.valueNotEqual("foo"));
- }
-
- public void testIsNull() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>();
- assertTrue(or.isNull());
- or.setValue("foo");
- assertFalse(or.isNull());
- }
-
- public void testIsNotNull() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>();
- assertFalse(or.isNotNull());
- or.setValue("foo");
- assertTrue(or.isNotNull());
- }
-
- public void testSetNull() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>();
- assertNull(or.getValue());
- or.setValue("foo");
- assertEquals("foo", or.getValue());
- or.setNull();
- assertNull(or.getValue());
- }
-
- public void testClone() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>("foo");
- @SuppressWarnings("cast")
- SimpleObjectReference<String> clone = (SimpleObjectReference<String>) or.clone();
- assertEquals("foo", clone.getValue());
- assertNotSame(or, clone);
- }
-
- public void testToString() {
- SimpleObjectReference<String> or = new SimpleObjectReference<String>();
- assertEquals("[null]", or.toString());
- or.setValue("foo");
- assertEquals("[foo]", or.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleQueueTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleQueueTests.java
deleted file mode 100644
index 4fb99dbc5a..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleQueueTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.common.utility.internal.Queue;
-import org.eclipse.jpt.common.utility.internal.SimpleQueue;
-
-@SuppressWarnings("nls")
-public class SimpleQueueTests
- extends MultiThreadedTestCase
-{
-
- public SimpleQueueTests(String name) {
- super(name);
- }
-
- Queue<String> buildQueue() {
- return new SimpleQueue<String>();
- }
-
- public void testIsEmpty() {
- Queue<String> queue = this.buildQueue();
- assertTrue(queue.isEmpty());
- queue.enqueue("first");
- assertFalse(queue.isEmpty());
- queue.enqueue("second");
- assertFalse(queue.isEmpty());
- queue.dequeue();
- assertFalse(queue.isEmpty());
- queue.dequeue();
- assertTrue(queue.isEmpty());
- }
-
- public void testEnqueueAndDequeue() {
- Queue<String> queue = this.buildQueue();
- String first = "first";
- String second = "second";
-
- queue.enqueue(first);
- queue.enqueue(second);
- assertEquals(first, queue.dequeue());
- assertEquals(second, queue.dequeue());
- }
-
- public void testEnqueueAndPeek() {
- Queue<String> queue = this.buildQueue();
- String first = "first";
- String second = "second";
-
- queue.enqueue(first);
- queue.enqueue(second);
- assertEquals(first, queue.peek());
- assertEquals(first, queue.peek());
- assertEquals(first, queue.dequeue());
- assertEquals(second, queue.peek());
- assertEquals(second, queue.peek());
- assertEquals(second, queue.dequeue());
- }
-
- public void testEmptyQueueExceptionPeek() {
- Queue<String> queue = this.buildQueue();
- String first = "first";
- String second = "second";
-
- queue.enqueue(first);
- queue.enqueue(second);
- assertEquals(first, queue.peek());
- assertEquals(first, queue.dequeue());
- assertEquals(second, queue.peek());
- assertEquals(second, queue.dequeue());
-
- boolean exCaught = false;
- try {
- queue.peek();
- fail();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEmptyQueueExceptionDequeue() {
- Queue<String> queue = this.buildQueue();
- String first = "first";
- String second = "second";
-
- queue.enqueue(first);
- queue.enqueue(second);
- assertEquals(first, queue.peek());
- assertEquals(first, queue.dequeue());
- assertEquals(second, queue.peek());
- assertEquals(second, queue.dequeue());
-
- boolean exCaught = false;
- try {
- queue.dequeue();
- fail();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testClone() {
- SimpleQueue<String> queue = (SimpleQueue<String>) this.buildQueue();
- queue.enqueue("first");
- queue.enqueue("second");
- queue.enqueue("third");
-
- this.verifyClone(queue, queue.clone());
- }
-
- public void testSerialization() throws Exception {
- Queue<String> queue = this.buildQueue();
- queue.enqueue("first");
- queue.enqueue("second");
- queue.enqueue("third");
-
- this.verifyClone(queue, TestTools.serialize(queue));
- }
-
- private void verifyClone(Queue<String> original, Queue<String> clone) {
- assertNotSame(original, clone);
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.dequeue(), clone.dequeue());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.dequeue(), clone.dequeue());
- assertEquals(original.isEmpty(), clone.isEmpty());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.dequeue(), clone.dequeue());
- assertTrue(original.isEmpty());
- assertEquals(original.isEmpty(), clone.isEmpty());
-
- original.enqueue("fourth");
- assertFalse(original.isEmpty());
- // clone should still be empty
- assertTrue(clone.isEmpty());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleStackTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleStackTests.java
deleted file mode 100644
index b73d8633e3..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SimpleStackTests.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.common.utility.internal.SimpleStack;
-import org.eclipse.jpt.common.utility.internal.Stack;
-
-@SuppressWarnings("nls")
-public class SimpleStackTests
- extends MultiThreadedTestCase
-{
- public SimpleStackTests(String name) {
- super(name);
- }
-
- Stack<String> buildStack() {
- return new SimpleStack<String>();
- }
-
- public void testIsEmpty() {
- Stack<String> stack = this.buildStack();
- assertTrue(stack.isEmpty());
- stack.push("first");
- assertFalse(stack.isEmpty());
- stack.push("second");
- assertFalse(stack.isEmpty());
- stack.pop();
- assertFalse(stack.isEmpty());
- stack.pop();
- assertTrue(stack.isEmpty());
- }
-
- public void testPushAndPop() {
- Stack<String> stack = this.buildStack();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.pop());
- assertEquals(first, stack.pop());
- }
-
- public void testPushAndPeek() {
- Stack<String> stack = this.buildStack();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
- }
-
- public void testEmptyStackExceptionPeek() {
- Stack<String> stack = this.buildStack();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
-
- boolean exCaught = false;
- try {
- stack.peek();
- fail();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEmptyStackExceptionPop() {
- Stack<String> stack = this.buildStack();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
-
- boolean exCaught = false;
- try {
- stack.pop();
- fail();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testClone() {
- SimpleStack<String> stack = (SimpleStack<String>) this.buildStack();
- stack.push("first");
- stack.push("second");
- stack.push("third");
-
- this.verifyClone(stack, stack.clone());
- }
-
- public void testSerialization() throws Exception {
- Stack<String> stack = this.buildStack();
- stack.push("first");
- stack.push("second");
- stack.push("third");
-
- this.verifyClone(stack, TestTools.serialize(stack));
- }
-
- private void verifyClone(Stack<String> original, Stack<String> clone) {
- assertNotSame(original, clone);
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertEquals(original.isEmpty(), clone.isEmpty());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertTrue(original.isEmpty());
- assertEquals(original.isEmpty(), clone.isEmpty());
-
- original.push("fourth");
- assertFalse(original.isEmpty());
- // clone should still be empty
- assertTrue(clone.isEmpty());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java
deleted file mode 100644
index b34bab2474..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/StringToolsTests.java
+++ /dev/null
@@ -1,1871 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.io.StringWriter;
-import java.io.Writer;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-@SuppressWarnings("nls")
-public class StringToolsTests extends TestCase {
-
- public StringToolsTests(String name) {
- super(name);
- }
-
- private static void assertEquals(String expected, char[] actual) {
- assertEquals(expected, new String(actual));
- }
-
- // ********** padding/truncating **********
-
- public void testPad() {
- assertEquals("fred", StringTools.pad("fred", 4));
- assertEquals("fred ", StringTools.pad("fred", 6));
- boolean exThrown = false;
- try {
- assertEquals("fr", StringTools.pad("fred", 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadCharArray() {
- assertEquals("fred", StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 4));
- assertEquals("fred ", StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 6));
- boolean exThrown = false;
- try {
- assertEquals("fr", StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnWriter() {
- Writer writer;
- writer = new StringWriter();
- StringTools.padOn("fred", 4, writer);
- assertEquals("fred", writer.toString());
-
- writer = new StringWriter();
- StringTools.padOn("fred", 6, writer);
- assertEquals("fred ", writer.toString());
-
- writer = new StringWriter();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, writer);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnStringBuffer() {
- StringBuffer sb;
- sb = new StringBuffer();
- StringTools.padOn("fred", 4, sb);
- assertEquals("fred", sb.toString());
-
- sb = new StringBuffer();
- StringTools.padOn("fred", 6, sb);
- assertEquals("fred ", sb.toString());
-
- sb = new StringBuffer();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnStringBuilder() {
- StringBuilder sb;
- sb = new StringBuilder();
- StringTools.padOn("fred", 4, sb);
- assertEquals("fred", sb.toString());
-
- sb = new StringBuilder();
- StringTools.padOn("fred", 6, sb);
- assertEquals("fred ", sb.toString());
-
- sb = new StringBuilder();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOrTruncate() {
- assertEquals("fred", StringTools.padOrTruncate("fred", 4));
- assertEquals("fred ", StringTools.padOrTruncate("fred", 6));
- assertEquals("fr", StringTools.padOrTruncate("fred", 2));
- }
-
- public void testPadOrTruncateCharArray() {
- assertEquals("fred", StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 4));
- assertEquals("fred ", StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 6));
- assertEquals("fr", StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 2));
- }
-
- public void testPadOrTruncateOnWriter() {
- this.verifyPadOrTruncateOnWriter("fred", "fred", 4);
- this.verifyPadOrTruncateOnWriter("fred ", "fred", 6);
- this.verifyPadOrTruncateOnWriter("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnWriter(String expected, String string, int length) {
- Writer writer = new StringWriter();
- StringTools.padOrTruncateOn(string, length, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testPadOrTruncateOnStringBuffer() {
- this.verifyPadOrTruncateOnStringBuffer("fred", "fred", 4);
- this.verifyPadOrTruncateOnStringBuffer("fred ", "fred", 6);
- this.verifyPadOrTruncateOnStringBuffer("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnStringBuffer(String expected, String string, int length) {
- StringBuffer sb = new StringBuffer();
- StringTools.padOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testPadOrTruncateOnStringBuilder() {
- this.verifyPadOrTruncateOnStringBuilder("fred", "fred", 4);
- this.verifyPadOrTruncateOnStringBuilder("fred ", "fred", 6);
- this.verifyPadOrTruncateOnStringBuilder("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnStringBuilder(String expected, String string, int length) {
- StringBuilder sb = new StringBuilder();
- StringTools.padOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testZeroPad() {
- assertEquals("1234", StringTools.zeroPad("1234", 4));
- assertEquals("001234", StringTools.zeroPad("1234", 6));
- boolean exThrown = false;
- try {
- assertEquals("12", StringTools.zeroPad("1234", 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadCharArray() {
- assertEquals("1234", StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 4));
- assertEquals("001234", StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 6));
- boolean exThrown = false;
- try {
- assertEquals("12", StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnWriter() {
- Writer writer;
- writer = new StringWriter();
- StringTools.zeroPadOn("1234", 4, writer);
- assertEquals("1234", writer.toString());
-
- writer = new StringWriter();
- StringTools.zeroPadOn("1234", 6, writer);
- assertEquals("001234", writer.toString());
-
- writer = new StringWriter();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, writer);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnStringBuffer() {
- StringBuffer sb;
- sb = new StringBuffer();
- StringTools.zeroPadOn("1234", 4, sb);
- assertEquals("1234", sb.toString());
-
- sb = new StringBuffer();
- StringTools.zeroPadOn("1234", 6, sb);
- assertEquals("001234", sb.toString());
-
- sb = new StringBuffer();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnStringBuilder() {
- StringBuilder sb;
- sb = new StringBuilder();
- StringTools.zeroPadOn("1234", 4, sb);
- assertEquals("1234", sb.toString());
-
- sb = new StringBuilder();
- StringTools.zeroPadOn("1234", 6, sb);
- assertEquals("001234", sb.toString());
-
- sb = new StringBuilder();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOrTruncate() {
- assertEquals("1234", StringTools.zeroPadOrTruncate("1234", 4));
- assertEquals("001234", StringTools.zeroPadOrTruncate("1234", 6));
- assertEquals("34", StringTools.zeroPadOrTruncate("1234", 2));
- }
-
- public void testZeroPadOrTruncateCharArray() {
- assertEquals("1234", StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 4));
- assertEquals("001234", StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 6));
- assertEquals("34", StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 2));
- }
-
- public void testZeroPadOrTruncateOnWriter() {
- this.verifyZeroPadOrTruncateOnWriter("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnWriter("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnWriter("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnWriter(String expected, String string, int length) {
- Writer writer = new StringWriter();
- StringTools.zeroPadOrTruncateOn(string, length, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testZeroPadOrTruncateOnStringBuffer() {
- this.verifyZeroPadOrTruncateOnStringBuffer("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnStringBuffer("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnStringBuffer("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnStringBuffer(String expected, String string, int length) {
- StringBuffer sb = new StringBuffer();
- StringTools.zeroPadOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testZeroPadOrTruncateOnStringBuilder() {
- this.verifyZeroPadOrTruncateOnStringBuilder("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnStringBuilder("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnStringBuilder("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnStringBuilder(String expected, String string, int length) {
- StringBuilder sb = new StringBuilder();
- StringTools.zeroPadOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** separating **********
-
- public void testSeparateStringCharInt() {
- this.verifySeparate("012345", '-', 22, "012345");
- this.verifySeparate("012345", '-', 6, "012345");
- this.verifySeparate("012345", '-', 5, "01234-5");
- this.verifySeparate("012345", '-', 4, "0123-45");
- this.verifySeparate("012345", '-', 3, "012-345");
- this.verifySeparate("012345", '-', 2, "01-23-45");
- this.verifySeparate("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparate(String string, char separator, int segmentLength, String expected) {
- assertEquals(expected, StringTools.separate(string, separator, segmentLength));
- }
-
- public void testSeparateOnStringCharIntWriter() {
- this.verifySeparateOnWriter("012345", '-', 22, "012345");
- this.verifySeparateOnWriter("012345", '-', 6, "012345");
- this.verifySeparateOnWriter("012345", '-', 5, "01234-5");
- this.verifySeparateOnWriter("012345", '-', 4, "0123-45");
- this.verifySeparateOnWriter("012345", '-', 3, "012-345");
- this.verifySeparateOnWriter("012345", '-', 2, "01-23-45");
- this.verifySeparateOnWriter("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparateOnWriter(String string, char separator, int segmentLength, String expected) {
- Writer writer = new StringWriter();
- StringTools.separateOn(string, separator, segmentLength, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testSeparateOnStringCharIntStringBuffer() {
- this.verifySeparateOnStringBuffer("012345", '-', 22, "012345");
- this.verifySeparateOnStringBuffer("012345", '-', 6, "012345");
- this.verifySeparateOnStringBuffer("012345", '-', 5, "01234-5");
- this.verifySeparateOnStringBuffer("012345", '-', 4, "0123-45");
- this.verifySeparateOnStringBuffer("012345", '-', 3, "012-345");
- this.verifySeparateOnStringBuffer("012345", '-', 2, "01-23-45");
- this.verifySeparateOnStringBuffer("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparateOnStringBuffer(String string, char separator, int segmentLength, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.separateOn(string, separator, segmentLength, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testSeparateOnStringCharIntStringBuilder() {
- this.verifySeparateOnStringBuilder("012345", '-', 22, "012345");
- this.verifySeparateOnStringBuilder("012345", '-', 6, "012345");
- this.verifySeparateOnStringBuilder("012345", '-', 5, "01234-5");
- this.verifySeparateOnStringBuilder("012345", '-', 4, "0123-45");
- this.verifySeparateOnStringBuilder("012345", '-', 3, "012-345");
- this.verifySeparateOnStringBuilder("012345", '-', 2, "01-23-45");
- this.verifySeparateOnStringBuilder("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparateOnStringBuilder(String string, char separator, int segmentLength, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.separateOn(string, separator, segmentLength, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testSeparateCharArrayCharInt() {
- this.verifySeparateCharArray("012345", '-', 22, "012345");
- this.verifySeparateCharArray("012345", '-', 6, "012345");
- this.verifySeparateCharArray("012345", '-', 5, "01234-5");
- this.verifySeparateCharArray("012345", '-', 4, "0123-45");
- this.verifySeparateCharArray("012345", '-', 3, "012-345");
- this.verifySeparateCharArray("012345", '-', 2, "01-23-45");
- this.verifySeparateCharArray("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparateCharArray(String string, char separator, int segmentLength, String expected) {
- assertEquals(expected, StringTools.separate(string.toCharArray(), separator, segmentLength));
- }
-
- public void testSeparateOnCharArrayCharIntWriter() {
- this.verifySeparateCharArrayOnWriter("012345", '-', 22, "012345");
- this.verifySeparateCharArrayOnWriter("012345", '-', 6, "012345");
- this.verifySeparateCharArrayOnWriter("012345", '-', 5, "01234-5");
- this.verifySeparateCharArrayOnWriter("012345", '-', 4, "0123-45");
- this.verifySeparateCharArrayOnWriter("012345", '-', 3, "012-345");
- this.verifySeparateCharArrayOnWriter("012345", '-', 2, "01-23-45");
- this.verifySeparateCharArrayOnWriter("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparateCharArrayOnWriter(String string, char separator, int segmentLength, String expected) {
- Writer writer = new StringWriter();
- StringTools.separateOn(string.toCharArray(), separator, segmentLength, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testSeparateOnCharArrayCharIntStringBuffer() {
- this.verifySeparateCharArrayOnStringBuffer("012345", '-', 22, "012345");
- this.verifySeparateCharArrayOnStringBuffer("012345", '-', 6, "012345");
- this.verifySeparateCharArrayOnStringBuffer("012345", '-', 5, "01234-5");
- this.verifySeparateCharArrayOnStringBuffer("012345", '-', 4, "0123-45");
- this.verifySeparateCharArrayOnStringBuffer("012345", '-', 3, "012-345");
- this.verifySeparateCharArrayOnStringBuffer("012345", '-', 2, "01-23-45");
- this.verifySeparateCharArrayOnStringBuffer("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparateCharArrayOnStringBuffer(String string, char separator, int segmentLength, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.separateOn(string.toCharArray(), separator, segmentLength, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testSeparateOnCharArrayCharIntStringBuilder() {
- this.verifySeparateCharArrayOnStringBuilder("012345", '-', 22, "012345");
- this.verifySeparateCharArrayOnStringBuilder("012345", '-', 6, "012345");
- this.verifySeparateCharArrayOnStringBuilder("012345", '-', 5, "01234-5");
- this.verifySeparateCharArrayOnStringBuilder("012345", '-', 4, "0123-45");
- this.verifySeparateCharArrayOnStringBuilder("012345", '-', 3, "012-345");
- this.verifySeparateCharArrayOnStringBuilder("012345", '-', 2, "01-23-45");
- this.verifySeparateCharArrayOnStringBuilder("012345", '-', 1, "0-1-2-3-4-5");
- }
-
- private void verifySeparateCharArrayOnStringBuilder(String string, char separator, int segmentLength, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.separateOn(string.toCharArray(), separator, segmentLength, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** delimiting **********
-
- public void testDelimit() {
- this.verifyDelimit("Employee", "123", "123Employee123");
- this.verifyDelimit("123", "123", "123123123");
- this.verifyDelimit("", "123", "123123");
- }
-
- private void verifyDelimit(String string, String delimiter, String expectedString) {
- assertEquals(expectedString, StringTools.delimit(string, delimiter));
- }
-
- public void testDelimitOnWriter() {
- this.verifyDelimitOnWriter("Employee", "123", "123Employee123");
- this.verifyDelimitOnWriter("123", "123", "123123123");
- this.verifyDelimitOnWriter("", "123", "123123");
- }
-
- private void verifyDelimitOnWriter(String string, String delimiter, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.delimitOn(string, delimiter, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testDelimitOnStringBuffer() {
- this.verifyDelimitOnStringBuffer("Employee", "123", "123Employee123");
- this.verifyDelimitOnStringBuffer("123", "123", "123123123");
- this.verifyDelimitOnStringBuffer("", "123", "123123");
- }
-
- private void verifyDelimitOnStringBuffer(String string, String delimiter, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.delimitOn(string, delimiter, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testDelimitOnStringBuilder() {
- this.verifyDelimitOnStringBuilder("Employee", "123", "123Employee123");
- this.verifyDelimitOnStringBuilder("123", "123", "123123123");
- this.verifyDelimitOnStringBuilder("", "123", "123123");
- }
-
- private void verifyDelimitOnStringBuilder(String string, String delimiter, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.delimitOn(string, delimiter, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testQuote() {
- this.verifyQuote("Employee", "\"Employee\"");
- this.verifyQuote("123", "\"123\"");
- this.verifyQuote("", "\"\"");
- this.verifyQuote("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuote(String string, String expectedString) {
- assertEquals(expectedString, StringTools.quote(string));
- }
-
- public void testQuoteOnWriter() {
- this.verifyQuoteOnWriter("Employee", "\"Employee\"");
- this.verifyQuoteOnWriter("123", "\"123\"");
- this.verifyQuoteOnWriter("", "\"\"");
- this.verifyQuoteOnWriter("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuoteOnWriter(String string, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.quoteOn(string, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testQuoteOnStringBuffer() {
- this.verifyQuoteOnStringBuffer("Employee", "\"Employee\"");
- this.verifyQuoteOnStringBuffer("123", "\"123\"");
- this.verifyQuoteOnStringBuffer("", "\"\"");
- this.verifyQuoteOnStringBuffer("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuoteOnStringBuffer(String string, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.quoteOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testQuoteOnStringBuilder() {
- this.verifyQuoteOnStringBuilder("Employee", "\"Employee\"");
- this.verifyQuoteOnStringBuilder("123", "\"123\"");
- this.verifyQuoteOnStringBuilder("", "\"\"");
- this.verifyQuoteOnStringBuilder("Emp\"loyee", "\"Emp\"\"loyee\"");
- }
-
- private void verifyQuoteOnStringBuilder(String string, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.quoteOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- // ********** removing characters **********
-
- public void testRemoveFirstOccurrence() {
- this.verifyRemoveFirstOccurrence("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrence("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrence("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrence("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrence("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrence(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeFirstOccurrence(string, charToRemove));
- }
-
- public void testRemoveFirstOccurrenceCharArray() {
- this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceCharArray("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceCharArray("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceCharArray("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceCharArray(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeFirstOccurrence(string.toCharArray(), charToRemove));
- }
-
- public void testRemoveFirstOccurrenceOnWriter() {
- this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnWriter("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnWriter("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnWriter("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnWriter(String string, char charToRemove, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveFirstOccurrenceOnStringBuffer() {
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnStringBuffer(String string, char charToRemove, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveFirstOccurrenceOnStringBuilder() {
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnStringBuilder(String string, char charToRemove, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllOccurrences() {
- this.verifyRemoveAllOccurrences("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrences(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrences("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrences(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrences(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllOccurrences(string, charToRemove));
- }
-
- public void testRemoveAllOccurrencesCharArray() {
- this.verifyRemoveAllOccurrencesCharArray("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesCharArray(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesCharArray("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesCharArray(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesCharArray(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllOccurrences(string.toCharArray(), charToRemove));
- }
-
- public void testRemoveAllOccurrencesOnWriter() {
- this.verifyRemoveAllOccurrencesOnWriter("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnWriter(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnWriter("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnWriter(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnWriter(String string, char charToRemove, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeAllOccurrencesOn(string, charToRemove, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveAllOccurrencesOnStringBuffer() {
- this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnStringBuffer(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnStringBuffer(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnStringBuffer(String string, char charToRemove, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeAllOccurrencesOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllOccurrencesOnStringBuilder() {
- this.verifyRemoveAllOccurrencesOnStringBuilder("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnStringBuilder(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnStringBuilder("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnStringBuilder(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnStringBuilder(String string, char charToRemove, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeAllOccurrencesOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllWhitespace() {
- this.verifyRemoveAllWhitespace("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespace("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespace("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespace(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespace(String string, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllWhitespace(string));
- }
-
- public void testRemoveAllWhitespaceCharArray() {
- this.verifyRemoveAllWhitespaceCharArray("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceCharArray("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceCharArray("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceCharArray(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceCharArray(String string, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllWhitespace(string.toCharArray()));
- }
-
- public void testRemoveAllWhitespaceOnWriter() {
- this.verifyRemoveAllWhitespaceOnWriter("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnWriter("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceOnWriter("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnWriter(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnWriter(String string, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeAllWhitespaceOn(string, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveAllWhitespaceOnStringBuffer() {
- this.verifyRemoveAllWhitespaceOnStringBuffer("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnStringBuffer("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceOnStringBuffer("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnStringBuffer(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnStringBuffer(String string, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeAllWhitespaceOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllWhitespaceOnStringBuilder() {
- this.verifyRemoveAllWhitespaceOnStringBuilder("Employee Fred\t", "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnStringBuilder("\tEmployee\n", "Employee");
- this.verifyRemoveAllWhitespaceOnStringBuilder("Employee \t Foo", "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnStringBuilder(" Emp\tloyee \n Foo", "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnStringBuilder(String string, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeAllWhitespaceOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-//////////////////////////////
- public void testCompressWhitespace() {
- this.verifyCompressWhitespace("Employee Fred\t", "Employee Fred ");
- this.verifyCompressWhitespace("\tEmployee \n", " Employee ");
- this.verifyCompressWhitespace("Employee \t Foo", "Employee Foo");
- this.verifyCompressWhitespace(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
- }
-
- private void verifyCompressWhitespace(String string, String expectedString) {
- assertEquals(expectedString, StringTools.compressWhitespace(string));
- }
-
- public void testCompressWhitespaceCharArray() {
- this.verifyCompressWhitespaceCharArray("Employee Fred\t", "Employee Fred ");
- this.verifyCompressWhitespaceCharArray("\tEmployee \n", " Employee ");
- this.verifyCompressWhitespaceCharArray("Employee \t Foo", "Employee Foo");
- this.verifyCompressWhitespaceCharArray(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
- }
-
- private void verifyCompressWhitespaceCharArray(String string, String expectedString) {
- assertEquals(expectedString, StringTools.compressWhitespace(string.toCharArray()));
- }
-
- public void testCompressWhitespaceOnWriter() {
- this.verifyCompressWhitespaceOnWriter("Employee Fred\t", "Employee Fred ");
- this.verifyCompressWhitespaceOnWriter("\tEmployee \n", " Employee ");
- this.verifyCompressWhitespaceOnWriter("Employee \t Foo", "Employee Foo");
- this.verifyCompressWhitespaceOnWriter(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
- }
-
- private void verifyCompressWhitespaceOnWriter(String string, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.compressWhitespaceOn(string, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testCompressWhitespaceOnStringBuffer() {
- this.verifyCompressWhitespaceOnStringBuffer("Employee Fred\t", "Employee Fred ");
- this.verifyCompressWhitespaceOnStringBuffer("\tEmployee \n", " Employee ");
- this.verifyCompressWhitespaceOnStringBuffer("Employee \t Foo", "Employee Foo");
- this.verifyCompressWhitespaceOnStringBuffer(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
- }
-
- private void verifyCompressWhitespaceOnStringBuffer(String string, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.compressWhitespaceOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testCompressWhitespaceOnStringBuilder() {
- this.verifyCompressWhitespaceOnStringBuilder("Employee Fred\t", "Employee Fred ");
- this.verifyCompressWhitespaceOnStringBuilder("\tEmployee \n", " Employee ");
- this.verifyCompressWhitespaceOnStringBuilder("Employee \t Foo", "Employee Foo");
- this.verifyCompressWhitespaceOnStringBuilder(" Emp\tloyee \n Foo ", " Emp loyee Foo ");
- }
-
- private void verifyCompressWhitespaceOnStringBuilder(String string, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.compressWhitespaceOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- // ********** common prefix **********
-
- public void testCommonPrefixLength() {
- assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "fooBBB"));
- assertEquals(3, StringTools.commonPrefixLength("foo", "fooBBB"));
- assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "foo"));
- assertEquals(3, StringTools.commonPrefixLength("foo", "foo"));
- }
-
- public void testCommonPrefixLengthMax() {
- assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "fooBBB", 2));
- assertEquals(2, StringTools.commonPrefixLength("foo", "fooBBB", 2));
- assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "foo", 2));
- assertEquals(2, StringTools.commonPrefixLength("foo", "foo", 2));
- }
-
- // ********** capitalization **********
-
- public void testCapitalizeCharArray() {
- this.verifyCapitalizeCharArray("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeCharArray("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeCharArray("", new char[0]);
- this.verifyCapitalizeCharArray("A", new char[] { 'a' });
- this.verifyCapitalizeCharArray("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeCharArray(String expected, char[] string) {
- assertEquals(expected, StringTools.capitalize(string));
- }
-
- public void testCapitalizeString() {
- this.verifyCapitalizeString("Oracle", "Oracle");
- this.verifyCapitalizeString("Oracle", "oracle");
- this.verifyCapitalizeString(" ", " ");
- this.verifyCapitalizeString("ORACLE", "ORACLE");
- this.verifyCapitalizeString("", "");
- this.verifyCapitalizeString("A", "a");
- this.verifyCapitalizeString("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeString(String expected, String string) {
- assertEquals(expected, StringTools.capitalize(string));
- }
-
- public void testCapitalizeOnCharArrayStringBuffer() {
- this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayStringBuffer("", new char[0]);
- this.verifyCapitalizeOnCharArrayStringBuffer("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayStringBuffer("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayStringBuffer(String expected, char[] string) {
- StringBuffer sb = new StringBuffer();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnCharArrayStringBuilder() {
- this.verifyCapitalizeOnCharArrayStringBuilder("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuilder("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuilder(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayStringBuilder("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayStringBuilder("", new char[0]);
- this.verifyCapitalizeOnCharArrayStringBuilder("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayStringBuilder("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayStringBuilder(String expected, char[] string) {
- StringBuilder sb = new StringBuilder();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnStringStringBuffer() {
- this.verifyCapitalizeOnStringStringBuffer("Oracle", "Oracle");
- this.verifyCapitalizeOnStringStringBuffer("Oracle", "oracle");
- this.verifyCapitalizeOnStringStringBuffer(" ", " ");
- this.verifyCapitalizeOnStringStringBuffer("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringStringBuffer("", "");
- this.verifyCapitalizeOnStringStringBuffer("A", "a");
- this.verifyCapitalizeOnStringStringBuffer("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnStringStringBuilder() {
- this.verifyCapitalizeOnStringStringBuilder("Oracle", "Oracle");
- this.verifyCapitalizeOnStringStringBuilder("Oracle", "oracle");
- this.verifyCapitalizeOnStringStringBuilder(" ", " ");
- this.verifyCapitalizeOnStringStringBuilder("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringStringBuilder("", "");
- this.verifyCapitalizeOnStringStringBuilder("A", "a");
- this.verifyCapitalizeOnStringStringBuilder("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnCharArrayWriter() {
- this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayWriter("", new char[0]);
- this.verifyCapitalizeOnCharArrayWriter("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayWriter("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayWriter(String expected, char[] string) {
- Writer writer = new StringWriter();
- StringTools.capitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testCapitalizeOnStringWriter() {
- this.verifyCapitalizeOnStringWriter("Oracle", "Oracle");
- this.verifyCapitalizeOnStringWriter("Oracle", "oracle");
- this.verifyCapitalizeOnStringWriter(" ", " ");
- this.verifyCapitalizeOnStringWriter("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringWriter("", "");
- this.verifyCapitalizeOnStringWriter("A", "a");
- this.verifyCapitalizeOnStringWriter("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.capitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUnapitalizeCharArray() {
- this.verifyUncapitalizeCharArray("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeCharArray("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeCharArray("", new char[0]);
- this.verifyUncapitalizeCharArray("a", new char[] { 'A' });
- this.verifyUncapitalizeCharArray("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeCharArray(String expected, char[] string) {
- assertEquals(expected, StringTools.uncapitalize(string));
- }
-
- public void testUncapitalizeString() {
- this.verifyUncapitalizeString("oracle", "Oracle");
- this.verifyUncapitalizeString("oracle", "oracle");
- this.verifyUncapitalizeString(" ", " ");
- this.verifyUncapitalizeString("ORACLE", "ORACLE");
- this.verifyUncapitalizeString("", "");
- this.verifyUncapitalizeString("a", "A");
- this.verifyUncapitalizeString("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeString(String expected, String string) {
- assertEquals(expected, StringTools.uncapitalize(string));
- }
-
- public void testUncapitalizeOnCharArrayStringBuffer() {
- this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("", new char[0]);
- this.verifyUncapitalizeOnCharArrayStringBuffer("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayStringBuffer(String expected, char[] string) {
- StringBuffer sb = new StringBuffer();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnCharArrayStringBuilder() {
- this.verifyUncapitalizeOnCharArrayStringBuilder("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuilder(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("", new char[0]);
- this.verifyUncapitalizeOnCharArrayStringBuilder("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayStringBuilder(String expected, char[] string) {
- StringBuilder sb = new StringBuilder();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnStringStringBuffer() {
- this.verifyUncapitalizeOnStringStringBuffer("oracle", "Oracle");
- this.verifyUncapitalizeOnStringStringBuffer("oracle", "oracle");
- this.verifyUncapitalizeOnStringStringBuffer(" ", " ");
- this.verifyUncapitalizeOnStringStringBuffer("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringStringBuffer("", "");
- this.verifyUncapitalizeOnStringStringBuffer("a", "A");
- this.verifyUncapitalizeOnStringStringBuffer("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnStringStringBuilder() {
- this.verifyUncapitalizeOnStringStringBuilder("oracle", "Oracle");
- this.verifyUncapitalizeOnStringStringBuilder("oracle", "oracle");
- this.verifyUncapitalizeOnStringStringBuilder(" ", " ");
- this.verifyUncapitalizeOnStringStringBuilder("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringStringBuilder("", "");
- this.verifyUncapitalizeOnStringStringBuilder("a", "A");
- this.verifyUncapitalizeOnStringStringBuilder("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnCharArrayWriter() {
- this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayWriter("", new char[0]);
- this.verifyUncapitalizeOnCharArrayWriter("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayWriter("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayWriter(String expected, char[] string) {
- Writer writer = new StringWriter();
- StringTools.uncapitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUncapitalizeOnStringWriter() {
- this.verifyUncapitalizeOnStringWriter("oracle", "Oracle");
- this.verifyUncapitalizeOnStringWriter("oracle", "oracle");
- this.verifyUncapitalizeOnStringWriter(" ", " ");
- this.verifyUncapitalizeOnStringWriter("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringWriter("", "");
- this.verifyUncapitalizeOnStringWriter("a", "A");
- this.verifyUncapitalizeOnStringWriter("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.uncapitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- // ********** #toString() **********
-
- public void testBuildToStringClassName_anonymous() {
- Object o = new Object(){/*anonymous subclass of Object*/};
- assertEquals("Object", StringTools.buildToStringClassName(o.getClass()));
- }
-
- public void testBuildToStringClassName_member() {
- assertEquals("Map.Entry", StringTools.buildToStringClassName(java.util.Map.Entry.class));
- }
-
- public void testBuildToStringClassName_local() {
- class Foo {
- Bar bar = new Bar();
- class Bar {
- Bar() {
- super();
- }
- }
- Foo() {
- super();
- }
- }
- Foo foo = new Foo();
- assertEquals("StringToolsTests.Foo", StringTools.buildToStringClassName(foo.getClass()));
- assertEquals("StringToolsTests.Foo.Bar", StringTools.buildToStringClassName(foo.bar.getClass()));
- }
-
- // ********** queries **********
-
- public void testStringIsEmptyString() {
- assertTrue(StringTools.stringIsEmpty((String) null));
- assertTrue(StringTools.stringIsEmpty(""));
- assertTrue(StringTools.stringIsEmpty(" "));
- assertTrue(StringTools.stringIsEmpty(" \t\t "));
- assertTrue(StringTools.stringIsEmpty(" \t\t " + StringTools.CR));
- }
-
- public void testStringIsEmptyCharArray() {
- assertTrue(StringTools.stringIsEmpty((char[]) null));
- this.verifyStringIsEmptyCharArray("");
- this.verifyStringIsEmptyCharArray(" \t\t ");
- this.verifyStringIsEmptyCharArray(" ");
- this.verifyStringIsEmptyCharArray(" \t\t " + StringTools.CR);
- }
-
- private void verifyStringIsEmptyCharArray(String string) {
- assertTrue(StringTools.stringIsEmpty(string.toCharArray()));
- }
-
- public void testStringsAreEqualStringString() {
- assertTrue(StringTools.stringsAreEqual((String) null, (String) null));
- assertFalse(StringTools.stringsAreEqual(null, "asdf"));
- assertFalse(StringTools.stringsAreEqual("asdf", null));
- assertTrue(StringTools.stringsAreEqual("asdf", "asdf"));
- assertFalse(StringTools.stringsAreEqual("asdf", "ASDF"));
- }
-
- public void testStringsAreEqualCharArrayCharArray() {
- assertTrue(StringTools.stringsAreEqual((char[]) null, (char[]) null));
- assertFalse(StringTools.stringsAreEqual((char[]) null, "asdf".toCharArray()));
- assertFalse(StringTools.stringsAreEqual("asdf".toCharArray(), (char[]) null));
- assertTrue(StringTools.stringsAreEqual("asdf".toCharArray(), "asdf".toCharArray()));
- assertFalse(StringTools.stringsAreEqual("asdf".toCharArray(), "ASDF".toCharArray()));
- }
-
- public void testStringsAreEqualIgnoreCaseStringString() {
- assertTrue(StringTools.stringsAreEqualIgnoreCase((String) null, (String) null));
- assertFalse(StringTools.stringsAreEqualIgnoreCase(null, "asdf"));
- assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf", null));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "asdf"));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "ASDF"));
- }
-
- public void testStringsAreEqualIgnoreCaseCharArrayCharArray() {
- assertTrue(StringTools.stringsAreEqualIgnoreCase((char[]) null, (char[]) null));
- assertFalse(StringTools.stringsAreEqualIgnoreCase((char[]) null, "asdf".toCharArray()));
- assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), (char[]) null));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "asdf".toCharArray()));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray()));
- }
-
- public void testStringStartsWithIgnoreCaseStringString() {
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "as"));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "aS"));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", ""));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "A"));
-
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "bsdf"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "g"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdg"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfg"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfgggggg"));
- }
-
- public void testStringStartsWithIgnoreCaseCharArrayCharArray() {
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "as".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "aS".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "A".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdf".toCharArray()));
-
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "bsdf".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "g".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdg".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfg".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfgggggg".toCharArray()));
- }
-
- public void testCharactersAreEqualIgnoreCase() {
- assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'a'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'A'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'a'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'A'));
-
- assertFalse(StringTools.charactersAreEqualIgnoreCase('a', 'b'));
- assertFalse(StringTools.charactersAreEqualIgnoreCase('A', 'b'));
- }
-
- public void testStringIsUppercase() {
- this.verifyStringIsUppercase("FOO");
- this.verifyStringIsUppercase("FOO2");
- this.verifyStringIsUppercase("F O O");
- this.denyStringIsUppercase("Foo");
- this.denyStringIsUppercase("");
- }
-
- private void verifyStringIsUppercase(String s) {
- assertTrue(StringTools.stringIsUppercase(s));
- assertTrue(StringTools.stringIsUppercase(s.toCharArray()));
- }
-
- private void denyStringIsUppercase(String s) {
- assertFalse(StringTools.stringIsUppercase(s));
- assertFalse(StringTools.stringIsUppercase(s.toCharArray()));
- }
-
- public void testStringIsLowercase() {
- this.verifyStringIsLowercase("foo");
- this.verifyStringIsLowercase("foo2");
- this.verifyStringIsLowercase("f o o");
- this.denyStringIsLowercase("Foo");
- this.denyStringIsLowercase("");
- }
-
- private void verifyStringIsLowercase(String s) {
- assertTrue(StringTools.stringIsLowercase(s));
- assertTrue(StringTools.stringIsLowercase(s.toCharArray()));
- }
-
- private void denyStringIsLowercase(String s) {
- assertFalse(StringTools.stringIsLowercase(s));
- assertFalse(StringTools.stringIsLowercase(s.toCharArray()));
- }
-
- // ********** convert camel-case to all-caps **********
-
- public void testConvertCamelCaseToAllCaps() {
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test"));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST"));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest"));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest"));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTESTTest"));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest"));
- assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT"));
- }
-
- public void testConvertCamelCaseToAllCapsOnWriter() {
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.convertCamelCaseToAllCapsOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertCamelCaseToAllCapsOnStringBuffer() {
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertCamelCaseToAllCapsOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertCamelCaseToAllCapsOnStringBuilder() {
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- StringTools.convertCamelCaseToAllCapsOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertCamelCaseToAllCapsMaxLength() {
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 44));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 4));
- assertEquals("TES", StringTools.convertCamelCaseToAllCaps("test", 3));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST", 5));
- assertEquals("TE", StringTools.convertCamelCaseToAllCaps("TEST", 2));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest", 9));
- assertEquals("TEST_TES", StringTools.convertCamelCaseToAllCaps("testTest", 8));
- assertEquals("TEST_T", StringTools.convertCamelCaseToAllCaps("testTest", 6));
- assertEquals("TEST_", StringTools.convertCamelCaseToAllCaps("testTest", 5));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("testTest", 4));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 9));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 1100));
- assertEquals("TEST_TEST_", StringTools.convertCamelCaseToAllCaps("testTESTTest", 10));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest", 14));
- assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 16));
- assertEquals("TEST_TEST_TEST_", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 15));
- }
-
- public void testConvertCamelCaseToAllCapsMaxLengthOnWriter() {
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 44);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TES", "test", 3);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "TEST", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TE", "TEST", 2);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "testTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TES", "testTest", 8);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_T", "testTest", 6);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_", "testTest", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "testTest", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 1100);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_", "testTESTTest", 10);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST", "TestTESTTest", 14);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_T", "TestTESTTestT", 16);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_", "TestTESTTestT", 15);
- }
-
- private void verifyConvertCamelCaseToAllCapsMaxLengthOnWriter(String expected, String string, int max) {
- Writer writer = new StringWriter();
- StringTools.convertCamelCaseToAllCapsOn(string, max, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertCamelCaseToAllCapsMaxLengthOnStringBuffer() {
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "test", 44);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "test", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TES", "test", 3);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "TEST", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TE", "TEST", 2);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "testTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TES", "testTest", 8);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_T", "testTest", 6);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_", "testTest", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "testTest", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "TestTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "TestTest", 1100);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_", "testTESTTest", 10);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST", "TestTESTTest", 14);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST_T", "TestTESTTestT", 16);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST_", "TestTESTTestT", 15);
- }
-
- private void verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer(String expected, String string, int max) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertCamelCaseToAllCapsOn(string, max, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** convert underscores to all-caps **********
-
- public void testConvertUnderscoresToCamelCase() {
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST_", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST____", false));
- assertEquals("Test", StringTools.convertUnderscoresToCamelCase("TEST", true));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TeST", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST___TEST", false));
- assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", true));
- assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", false));
- assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", true));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", false));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", true));
- }
-
- public void testConvertUnderscoresToCamelCaseLowercase() {
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test_", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test____", false));
- assertEquals("Test", StringTools.convertUnderscoresToCamelCase("test", true));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test_test", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test___test", false));
- assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("test_test", true));
- assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", false));
- assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", true));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", false));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", true));
- }
-
- public void testConvertUnderscoresToCamelCaseOnWriter() {
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST_", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST____", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TeST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST___TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "TEST_TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "TEST_TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__TEST_TEST_TEST_T", true);
- }
-
- public void testConvertUnderscoresToCamelCaseOnWriterLowercase() {
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test_", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test____", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test___test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "test_test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "test_test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__test_test_test_t", true);
- }
-
- private void verifyConvertUnderscoresToCamelCaseOnWriter(String expected, String string, boolean capitalizeFirstLetter) {
- Writer writer = new StringWriter();
- StringTools.convertUnderscoresToCamelCaseOn(string, capitalizeFirstLetter, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertUnderscoresToCamelCaseOnStringBuffer() {
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST_", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST____", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("Test", "TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TeST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "TEST___TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTest", "TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTest", "TEST_TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTest", "TEST_TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "_TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "__TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "_TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "__TEST_TEST_TEST_T", true);
- }
-
- public void testConvertUnderscoresToCamelCaseOnStringBufferLowercase() {
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test_", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test____", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("Test", "test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "test___test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTest", "test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTest", "test_test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTest", "test_test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "_test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "__test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "_test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "__test_test_test_t", true);
- }
-
- private void verifyConvertUnderscoresToCamelCaseOnStringBuffer(String expected, String string, boolean capitalizeFirstLetter) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertUnderscoresToCamelCaseOn(string, capitalizeFirstLetter, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** delimiting **********
-
- public void testStringIsQuoted() {
- this.denyStringIsQuoted("foo");
- this.verifyStringIsQuoted("\"foo\"");
-
- this.denyStringIsQuoted("");
- this.verifyStringIsQuoted("\"\"");
-
- this.denyStringIsQuoted("\"");
- this.denyStringIsQuoted(" ");
- this.denyStringIsQuoted("''");
- this.denyStringIsQuoted("'foo'");
- }
-
- private void verifyStringIsQuoted(String s) {
- assertTrue(StringTools.stringIsQuoted(s));
- assertTrue(StringTools.stringIsQuoted(s.toCharArray()));
- }
-
- private void denyStringIsQuoted(String s) {
- assertFalse(StringTools.stringIsQuoted(s));
- assertFalse(StringTools.stringIsQuoted(s.toCharArray()));
- }
-
- public void testStringIsParenthetical() {
- this.denyStringIsParenthetical("foo");
- this.verifyStringIsParenthetical("(foo)");
-
- this.denyStringIsParenthetical("");
- this.verifyStringIsParenthetical("()");
-
- this.denyStringIsParenthetical("(");
- this.denyStringIsParenthetical(" ");
- this.denyStringIsParenthetical("''");
- this.denyStringIsParenthetical("'foo'");
- }
-
- private void verifyStringIsParenthetical(String s) {
- assertTrue(StringTools.stringIsParenthetical(s));
- assertTrue(StringTools.stringIsParenthetical(s.toCharArray()));
- }
-
- private void denyStringIsParenthetical(String s) {
- assertFalse(StringTools.stringIsParenthetical(s));
- assertFalse(StringTools.stringIsParenthetical(s.toCharArray()));
- }
-
- public void testStringIsBracketed() {
- this.denyStringIsBracketed("foo");
- this.verifyStringIsBracketed("[foo]");
-
- this.denyStringIsBracketed("");
- this.verifyStringIsBracketed("[]");
-
- this.denyStringIsBracketed("[");
- this.denyStringIsBracketed(" ");
- this.denyStringIsBracketed("''");
- this.denyStringIsBracketed("'foo'");
- }
-
- private void verifyStringIsBracketed(String s) {
- assertTrue(StringTools.stringIsBracketed(s));
- assertTrue(StringTools.stringIsBracketed(s.toCharArray()));
- }
-
- private void denyStringIsBracketed(String s) {
- assertFalse(StringTools.stringIsBracketed(s));
- assertFalse(StringTools.stringIsBracketed(s.toCharArray()));
- }
-
- public void testStringIsBraced() {
- this.denyStringIsBraced("foo");
- this.verifyStringIsBraced("{foo}");
-
- this.denyStringIsBraced("");
- this.verifyStringIsBraced("{}");
-
- this.denyStringIsBraced("{");
- this.denyStringIsBraced(" ");
- this.denyStringIsBraced("''");
- this.denyStringIsBraced("'foo'");
- }
-
- private void verifyStringIsBraced(String s) {
- assertTrue(StringTools.stringIsBraced(s));
- assertTrue(StringTools.stringIsBraced(s.toCharArray()));
- }
-
- private void denyStringIsBraced(String s) {
- assertFalse(StringTools.stringIsBraced(s));
- assertFalse(StringTools.stringIsBraced(s.toCharArray()));
- }
-
- public void testStringIsChevroned() {
- this.denyStringIsChevroned("foo");
- this.verifyStringIsChevroned("<foo>");
-
- this.denyStringIsChevroned("");
- this.verifyStringIsChevroned("<>");
-
- this.denyStringIsChevroned("{");
- this.denyStringIsChevroned(" ");
- this.denyStringIsChevroned("''");
- this.denyStringIsChevroned("'foo'");
- }
-
- private void verifyStringIsChevroned(String s) {
- assertTrue(StringTools.stringIsChevroned(s));
- assertTrue(StringTools.stringIsChevroned(s.toCharArray()));
- }
-
- private void denyStringIsChevroned(String s) {
- assertFalse(StringTools.stringIsChevroned(s));
- assertFalse(StringTools.stringIsChevroned(s.toCharArray()));
- }
-
- public void testStringIsDelimited() {
- this.denyStringIsDelimited("foo", '?');
- this.verifyStringIsDelimited("?foo?", '?');
-
- this.denyStringIsDelimited("", '?');
- this.verifyStringIsDelimited("\"\"", '"');
- this.verifyStringIsDelimited("?xx?", '?');
- this.denyStringIsDelimited("?xx]", '?');
-
- this.denyStringIsDelimited("\"", '"');
- this.denyStringIsDelimited(" ", ' ');
- this.denyStringIsDelimited("''", '"');
- this.denyStringIsDelimited("'foo'", '?');
- }
-
- private void verifyStringIsDelimited(String s, char c) {
- assertTrue(StringTools.stringIsDelimited(s, c));
- assertTrue(StringTools.stringIsDelimited(s.toCharArray(), c));
- }
-
- private void denyStringIsDelimited(String s, char c) {
- assertFalse(StringTools.stringIsDelimited(s, c));
- assertFalse(StringTools.stringIsDelimited(s.toCharArray(), c));
- }
-
- public void testStringIsDelimited2() {
- this.denyStringIsDelimited2("foo", '[', ']');
- this.verifyStringIsDelimited2("{foo}", '{', '}');
-
- this.denyStringIsDelimited2("", '[', ']');
- this.verifyStringIsDelimited2("[]", '[', ']');
- this.verifyStringIsDelimited2("[xx]", '[', ']');
- this.denyStringIsDelimited2("?xx]", '[', ']');
-
- this.denyStringIsDelimited2("\"", '[', ']');
- this.denyStringIsDelimited2(" ", '[', ']');
- this.denyStringIsDelimited2("''", '[', ']');
- this.denyStringIsDelimited2("'foo'", '[', ']');
- }
-
- private void verifyStringIsDelimited2(String s, char start, char end) {
- assertTrue(StringTools.stringIsDelimited(s, start, end));
- assertTrue(StringTools.stringIsDelimited(s.toCharArray(), start, end));
- }
-
- private void denyStringIsDelimited2(String s, char start, char end) {
- assertFalse(StringTools.stringIsDelimited(s, start, end));
- assertFalse(StringTools.stringIsDelimited(s.toCharArray(), start, end));
- }
-
- // ********** undelimiting **********
-
- public void testUndelimit() {
- this.verifyUndelimit("\"foo\"", "foo");
- this.verifyUndelimit("\"\"", "");
- this.verifyUndelimit("'foo'", "foo");
- this.verifyUndelimit("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimit("\"foo\"\"\"", "foo\"");
- this.verifyUndelimit("\"\"\"foo\"", "\"foo");
- this.verifyUndelimit("[foo]", "foo");
- this.verifyUndelimit("\"\"\"", "\"");
- this.verifyUndelimit("\"foo\"bar\"", "foo\"");
- this.verifyUndelimit("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimit(String s, String expected) {
- assertEquals(expected, StringTools.undelimit(s));
- assertEquals(expected, StringTools.undelimit(s.toCharArray()));
- }
-
- public void testUndelimitInt() {
- this.verifyUndelimitInt("\"foo\"", 2, "o");
- this.verifyUndelimitInt("\"\"foo\"\"", 2, "foo");
- this.verifyUndelimitInt("'foo'", 2, "o");
- }
-
- private void verifyUndelimitInt(String s, int count, String expected) {
- assertEquals(expected, StringTools.undelimit(s, count));
- assertEquals(expected, StringTools.undelimit(s.toCharArray(), count));
- }
-
- public void testUndelimitIntException() {
- this.denyUndelimitInt("\"\"", 2);
- this.denyUndelimitInt("'o'", 2);
- }
-
- private void denyUndelimitInt(String s, int count) {
- boolean exCaught = false;
- try {
- String bogus = StringTools.undelimit(s, count);
- fail("invalid string: " + bogus);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- char[] bogus = StringTools.undelimit(s.toCharArray(), count);
- fail("invalid string: " + new String(bogus));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUndelimitOnWriter() {
- this.verifyUndelimitOnWriter("\"foo\"", "foo");
- this.verifyUndelimitOnWriter("\"\"", "");
- this.verifyUndelimitOnWriter("'foo'", "foo");
- this.verifyUndelimitOnWriter("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimitOnWriter("\"foo\"\"\"", "foo\"");
- this.verifyUndelimitOnWriter("\"\"\"foo\"", "\"foo");
- this.verifyUndelimitOnWriter("[foo]", "foo");
- this.verifyUndelimitOnWriter("\"\"\"", "\"");
- this.verifyUndelimitOnWriter("\"foo\"bar\"", "foo\"");
- this.verifyUndelimitOnWriter("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimitOnWriter(String s, String expected) {
- Writer writer = new StringWriter();
- StringTools.undelimitOn(s, writer);
- assertEquals(expected, writer.toString());
-
- writer = new StringWriter();
- StringTools.undelimitOn(s.toCharArray(), writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUndelimitOnStringBuffer() {
- this.verifyUndelimitOnStringBuffer("\"foo\"", "foo");
- this.verifyUndelimitOnStringBuffer("\"\"", "");
- this.verifyUndelimitOnStringBuffer("'foo'", "foo");
- this.verifyUndelimitOnStringBuffer("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimitOnStringBuffer("\"foo\"\"\"", "foo\"");
- this.verifyUndelimitOnStringBuffer("\"\"\"foo\"", "\"foo");
- this.verifyUndelimitOnStringBuffer("[foo]", "foo");
- this.verifyUndelimitOnStringBuffer("\"\"\"", "\"");
- this.verifyUndelimitOnStringBuffer("\"foo\"bar\"", "foo\"");
- this.verifyUndelimitOnStringBuffer("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimitOnStringBuffer(String s, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.undelimitOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuffer();
- StringTools.undelimitOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUndelimitOnStringBuilder() {
- this.verifyUndelimitOnStringBuilder("\"foo\"", "foo");
- this.verifyUndelimitOnStringBuilder("\"\"", "");
- this.verifyUndelimitOnStringBuilder("'foo'", "foo");
- this.verifyUndelimitOnStringBuilder("\"fo\"\"o\"", "fo\"o");
- this.verifyUndelimitOnStringBuilder("\"foo\"\"\"", "foo\"");
- this.verifyUndelimitOnStringBuilder("\"\"\"foo\"", "\"foo");
- this.verifyUndelimitOnStringBuilder("[foo]", "foo");
- this.verifyUndelimitOnStringBuilder("\"\"\"", "\"");
- this.verifyUndelimitOnStringBuilder("\"foo\"bar\"", "foo\"");
- this.verifyUndelimitOnStringBuilder("\"foo\"\"", "foo\"");
- }
-
- private void verifyUndelimitOnStringBuilder(String s, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.undelimitOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuilder();
- StringTools.undelimitOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUndelimitOnWriterCount() {
- this.verifyUndelimitOnWriterCount("\"foo\"", 2, "o");
- this.verifyUndelimitOnWriterCount("\"\"\"\"", 2, "");
- this.verifyUndelimitOnWriterCount("XXfooXX", 2, "foo");
- }
-
- private void verifyUndelimitOnWriterCount(String s, int count, String expected) {
- Writer writer = new StringWriter();
- StringTools.undelimitOn(s, count, writer);
- assertEquals(expected, writer.toString());
-
- writer = new StringWriter();
- StringTools.undelimitOn(s.toCharArray(), count, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUndelimitOnStringBufferCount() {
- this.verifyUndelimitOnStringBufferCount("\"foo\"", 2, "o");
- this.verifyUndelimitOnStringBufferCount("\"\"\"\"", 2, "");
- this.verifyUndelimitOnStringBufferCount("XXfooXX", 2, "foo");
- }
-
- private void verifyUndelimitOnStringBufferCount(String s, int count, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.undelimitOn(s, count, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuffer();
- StringTools.undelimitOn(s.toCharArray(), count, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUndelimitOnStringBuilderCount() {
- this.verifyUndelimitOnStringBuilderCount("\"foo\"", 2, "o");
- this.verifyUndelimitOnStringBuilderCount("\"\"\"\"", 2, "");
- this.verifyUndelimitOnStringBuilderCount("XXfooXX", 2, "foo");
- }
-
- private void verifyUndelimitOnStringBuilderCount(String s, int count, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.undelimitOn(s, count, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuilder();
- StringTools.undelimitOn(s.toCharArray(), count, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** converting to Java string literal **********
-
- public void testConvertToJavaStringLiteral() {
- this.verifyConvertToJavaStringLiteral("", "\"\"");
- this.verifyConvertToJavaStringLiteral("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteral("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteral("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteral("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteral("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteral("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteral(String s, String expected) {
- assertEquals(expected, StringTools.convertToJavaStringLiteral(s));
- assertEquals(expected, StringTools.convertToJavaStringLiteral(s.toCharArray()));
- }
-
- public void testConvertToJavaStringLiteralOnStringBuffer() {
- this.verifyConvertToJavaStringLiteralOnStringBuffer("", "\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuffer("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteralOnStringBuffer(String s, String expected) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertToJavaStringLiteralOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuffer();
- StringTools.convertToJavaStringLiteralOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertToJavaStringLiteralOnStringBuilder() {
- this.verifyConvertToJavaStringLiteralOnStringBuilder("", "\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteralOnStringBuilder("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteralOnStringBuilder(String s, String expected) {
- StringBuilder sb = new StringBuilder();
- StringTools.convertToJavaStringLiteralOn(s, sb);
- assertEquals(expected, sb.toString());
-
- sb = new StringBuilder();
- StringTools.convertToJavaStringLiteralOn(s.toCharArray(), sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertToJavaStringLiteralOnWriter() {
- this.verifyConvertToJavaStringLiteralOnWriter("", "\"\"");
- this.verifyConvertToJavaStringLiteralOnWriter("\"\"", "\"\\\"\\\"\"");
- this.verifyConvertToJavaStringLiteralOnWriter("'foo'", "\"'foo'\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\bbar", "\"foo\\bbar\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\n\tbar", "\"foo\\n\\tbar\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\"bar", "\"foo\\\"bar\"");
- this.verifyConvertToJavaStringLiteralOnWriter("foo\\bar", "\"foo\\\\bar\"");
- }
-
- private void verifyConvertToJavaStringLiteralOnWriter(String s, String expected) {
- Writer writer = new StringWriter();
- StringTools.convertToJavaStringLiteralOn(s, writer);
- assertEquals(expected, writer.toString());
-
- writer = new StringWriter();
- StringTools.convertToJavaStringLiteralOn(s.toCharArray(), writer);
- assertEquals(expected, writer.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedBooleanTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedBooleanTests.java
deleted file mode 100644
index d5f31f861b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedBooleanTests.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import org.eclipse.jpt.common.utility.internal.SynchronizedBoolean;
-
-public class SynchronizedBooleanTests
- extends MultiThreadedTestCase
-{
- private volatile SynchronizedBoolean sb;
- volatile boolean timeoutOccurred;
- volatile long startTime;
- volatile long endTime;
-
-
- public SynchronizedBooleanTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.sb = new SynchronizedBoolean();
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- }
-
- public void testGetValue() throws Exception {
- assertFalse(this.sb.getValue());
- }
-
- public void testIs() throws Exception {
- assertTrue(this.sb.is(false));
- }
-
- public void testIsNot() throws Exception {
- assertTrue(this.sb.isNot(true));
- }
-
- public void testIsTrue() throws Exception {
- assertFalse(this.sb.isTrue());
- }
-
- public void testIsFalse() throws Exception {
- assertTrue(this.sb.isFalse());
- }
-
- public void testSetValueFalse() throws Exception {
- this.sb.setValue(false);
- assertFalse(this.sb.getValue());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
- }
-
- public void testSetValueTrue() throws Exception {
- this.sb.setValue(true);
- assertTrue(this.sb.getValue());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
- }
-
- public void testFlip() throws Exception {
- assertTrue(this.sb.flip());
- assertFalse(this.sb.flip());
- }
-
- public void testFalseAndTrue() throws Exception {
- assertFalse(this.sb.and(true));
- assertFalse(this.sb.getValue());
- }
-
- public void testTrueAndTrue() throws Exception {
- this.sb.setValue(true);
- assertTrue(this.sb.and(true));
- assertTrue(this.sb.getValue());
- }
-
- public void testFalseAndFalse() throws Exception {
- assertFalse(this.sb.and(false));
- assertFalse(this.sb.getValue());
- }
-
- public void testTrueAndFalse() throws Exception {
- this.sb.setValue(true);
- assertFalse(this.sb.and(false));
- assertFalse(this.sb.getValue());
- }
-
- public void testFalseOrTrue() throws Exception {
- assertTrue(this.sb.or(true));
- assertTrue(this.sb.getValue());
- }
-
- public void testTrueOrTrue() throws Exception {
- this.sb.setValue(true);
- assertTrue(this.sb.or(true));
- assertTrue(this.sb.getValue());
- }
-
- public void testFalseOrFalse() throws Exception {
- assertFalse(this.sb.or(false));
- assertFalse(this.sb.getValue());
- }
-
- public void testTrueOrFalse() throws Exception {
- this.sb.setValue(true);
- assertTrue(this.sb.or(false));
- assertTrue(this.sb.getValue());
- }
-
- public void testFalseXorTrue() throws Exception {
- assertTrue(this.sb.xor(true));
- assertTrue(this.sb.getValue());
- }
-
- public void testTrueXorTrue() throws Exception {
- this.sb.setValue(true);
- assertFalse(this.sb.xor(true));
- assertFalse(this.sb.getValue());
- }
-
- public void testFalseXorFalse() throws Exception {
- assertFalse(this.sb.xor(false));
- assertFalse(this.sb.getValue());
- }
-
- public void testTrueXorFalse() throws Exception {
- this.sb.setValue(true);
- assertTrue(this.sb.xor(false));
- assertTrue(this.sb.getValue());
- }
-
- public void testSetNotTrue() throws Exception {
- this.sb.setNot(true);
- assertFalse(this.sb.getValue());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
- }
-
- public void testSetNotFalse() throws Exception {
- this.sb.setNot(false);
- assertTrue(this.sb.getValue());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
- }
-
- public void testSetFalse() throws Exception {
- this.sb.setFalse();
- assertFalse(this.sb.getValue());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
- }
-
- public void testSetTrue() throws Exception {
- this.sb.setTrue();
- assertTrue(this.sb.getValue());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
- }
-
- public void testCommitFalseSuccess() throws Exception {
- assertTrue(this.sb.commit(false, false));
- assertFalse(this.sb.getValue());
- }
-
- public void testCommitTrueSuccess() throws Exception {
- assertTrue(this.sb.commit(false, true));
- assertTrue(this.sb.getValue());
- }
-
- public void testCommitFalseFailure() throws Exception {
- assertFalse(this.sb.commit(true, false));
- assertFalse(this.sb.getValue());
- }
-
- public void testCommitTrueFailure() throws Exception {
- assertFalse(this.sb.commit(true, true));
- assertFalse(this.sb.getValue());
- }
-
- public void testSwapSame() throws Exception {
- assertFalse(this.sb.swap(this.sb));
- assertFalse(this.sb.getValue());
- }
-
- public void testSwapSameValue() throws Exception {
- SynchronizedBoolean sb2 = new SynchronizedBoolean();
- assertFalse(this.sb.swap(sb2));
- assertFalse(this.sb.getValue());
- assertFalse(sb2.getValue());
- }
-
- public void testSwapDifferentValue() throws Exception {
- SynchronizedBoolean sb2 = new SynchronizedBoolean(true);
- assertTrue(this.sb.swap(sb2));
- assertTrue(this.sb.getValue());
- assertFalse(sb2.getValue());
- }
-
- public void testGetMutexThis() throws Exception {
- assertSame(this.sb, this.sb.getMutex());
- }
-
- public void testGetMutexObject() throws Exception {
- Object mutex = new Object();
- SynchronizedBoolean syncBool = new SynchronizedBoolean(mutex);
- assertSame(mutex, syncBool.getMutex());
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to true
- */
- public void testWaitUntilTrue() throws Exception {
- this.verifyWaitUntilTrue(0); // 0 = indefinite wait
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to true by t2
- assertTrue(this.sb.getValue());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() > TICK);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to true
- */
- public void testWaitUntilTrueTimeout() throws Exception {
- this.verifyWaitUntilTrue(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.getValue());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() < THREE_TICKS);
- }
-
- private void verifyWaitUntilTrue(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetTrueCommand(), this.buildWaitUntilTrueCommand(t2Timeout));
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to false
- */
- public void testWaitToSetFalse() throws Exception {
- this.verifyWaitToSetFalse(0); // 0 = indefinite wait
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to false by t2
- assertFalse(this.sb.getValue());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() > TICK);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to false
- */
- public void testWaitToSetFalseTimeout() throws Exception {
- this.verifyWaitToSetFalse(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.getValue());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() < THREE_TICKS);
- }
-
- private void verifyWaitToSetFalse(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetTrueCommand(), this.buildWaitToSetFalseCommand(t2Timeout));
- }
-
- private void executeThreads(Command t1Command, Command t2Command) throws Exception {
- this.sb.setFalse();
- Runnable r1 = this.buildRunnable(t1Command, this.sb, TWO_TICKS);
- Runnable r2 = this.buildRunnable(t2Command, this.sb, 0);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- }
-
- private Command buildSetTrueCommand() {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) {
- syncBool.setTrue();
- }
- };
- }
-
- private Command buildWaitUntilTrueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) throws InterruptedException {
- SynchronizedBooleanTests.this.startTime = System.currentTimeMillis();
- SynchronizedBooleanTests.this.timeoutOccurred = ! syncBool.waitUntilTrue(timeout);
- SynchronizedBooleanTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Command buildWaitToSetFalseCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) throws InterruptedException {
- SynchronizedBooleanTests.this.startTime = System.currentTimeMillis();
- SynchronizedBooleanTests.this.timeoutOccurred = ! syncBool.waitToSetFalse(timeout);
- SynchronizedBooleanTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedBoolean syncBool, final long delay) {
- return new TestRunnable() {
- @Override
- public void run_() throws InterruptedException {
- if (delay != 0) {
- Thread.sleep(delay);
- }
- command.execute(syncBool);
- }
- };
- }
-
- long calculateElapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedBoolean syncBool) throws InterruptedException;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedIntTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedIntTests.java
deleted file mode 100644
index 18df9552c5..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedIntTests.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import org.eclipse.jpt.common.utility.internal.SynchronizedInt;
-
-@SuppressWarnings("nls")
-public class SynchronizedIntTests
- extends MultiThreadedTestCase
-{
- private volatile SynchronizedInt si;
- volatile boolean timeoutOccurred;
- volatile int value = 7;
- volatile long startTime;
- volatile long endTime;
- volatile int sIntValue;
-
-
- public SynchronizedIntTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.si = new SynchronizedInt();
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.sIntValue = 0;
- }
-
- public void testGetValue() throws Exception {
- assertEquals(0, this.si.getValue());
- }
-
- public void testEqualsInt() throws Exception {
- assertTrue(this.si.equals(0));
- this.si.setValue(this.value);
- assertTrue(this.si.equals(7));
- }
-
- public void testNotEqualInt() throws Exception {
- assertTrue(this.si.notEqual(7));
- this.si.setValue(this.value);
- assertTrue(this.si.notEqual(0));
- }
-
- public void testIsZero() throws Exception {
- assertTrue(this.si.isZero());
- this.si.setValue(this.value);
- assertFalse(this.si.isZero());
- }
-
- public void testIsNotZero() throws Exception {
- assertFalse(this.si.isNotZero());
- this.si.setValue(this.value);
- assertTrue(this.si.isNotZero());
- }
-
- public void testIsGreaterThan() throws Exception {
- assertTrue(this.si.isGreaterThan(-1));
- assertFalse(this.si.isGreaterThan(0));
- assertFalse(this.si.isGreaterThan(1));
- this.si.setValue(this.value);
- assertTrue(this.si.isGreaterThan(-1));
- assertFalse(this.si.isGreaterThan(7));
- assertFalse(this.si.isGreaterThan(8));
- }
-
- public void testIsGreaterThanOrEqual() throws Exception {
- assertTrue(this.si.isGreaterThanOrEqual(-1));
- assertTrue(this.si.isGreaterThanOrEqual(0));
- assertFalse(this.si.isGreaterThanOrEqual(1));
- this.si.setValue(this.value);
- assertTrue(this.si.isGreaterThanOrEqual(-1));
- assertTrue(this.si.isGreaterThanOrEqual(7));
- assertFalse(this.si.isGreaterThanOrEqual(8));
- }
-
- public void testIsLessThan() throws Exception {
- assertFalse(this.si.isLessThan(-1));
- assertFalse(this.si.isLessThan(0));
- assertTrue(this.si.isLessThan(1));
- this.si.setValue(this.value);
- assertFalse(this.si.isLessThan(-1));
- assertFalse(this.si.isLessThan(7));
- assertTrue(this.si.isLessThan(8));
- }
-
- public void testIsLessThanOrEqual() throws Exception {
- assertFalse(this.si.isLessThanOrEqual(-1));
- assertTrue(this.si.isLessThanOrEqual(0));
- assertTrue(this.si.isLessThanOrEqual(1));
- this.si.setValue(this.value);
- assertFalse(this.si.isLessThanOrEqual(-1));
- assertTrue(this.si.isLessThanOrEqual(7));
- assertTrue(this.si.isLessThanOrEqual(8));
- }
-
- public void testIsPositive() throws Exception {
- assertFalse(this.si.isPositive());
- this.si.setValue(this.value);
- assertTrue(this.si.isPositive());
- this.si.setValue(-3);
- assertFalse(this.si.isPositive());
- }
-
- public void testIsNotPositive() throws Exception {
- assertTrue(this.si.isNotPositive());
- this.si.setValue(this.value);
- assertFalse(this.si.isNotPositive());
- this.si.setValue(-3);
- assertTrue(this.si.isNotPositive());
- }
-
- public void testIsNegative() throws Exception {
- assertFalse(this.si.isNegative());
- this.si.setValue(this.value);
- assertFalse(this.si.isNegative());
- this.si.setValue(-3);
- assertTrue(this.si.isNegative());
- }
-
- public void testIsNotNegative() throws Exception {
- assertTrue(this.si.isNotNegative());
- this.si.setValue(this.value);
- assertTrue(this.si.isNotNegative());
- this.si.setValue(-3);
- assertFalse(this.si.isNotNegative());
- }
-
- public void testSetValue() throws Exception {
- this.si.setValue(0);
- assertEquals(0, this.si.getValue());
- assertFalse(this.si.isNotZero());
- assertTrue(this.si.isZero());
-
- this.si.setValue(this.value);
- assertEquals(this.value, this.si.getValue());
- assertTrue(this.si.isNotZero());
- assertFalse(this.si.isZero());
- }
-
- public void testAbs() throws Exception {
- assertEquals(0, this.si.abs());
- assertEquals(0, this.si.getValue());
- this.si.setValue(this.value);
- assertEquals(this.value, this.si.abs());
- assertEquals(this.value, this.si.getValue());
- this.si.setValue(-this.value);
- assertEquals(this.value, this.si.abs());
- }
-
- public void testNeg() throws Exception {
- assertEquals(0, this.si.neg());
- assertEquals(0, this.si.getValue());
- this.si.setValue(this.value);
- assertEquals(-this.value, this.si.neg());
- this.si.setValue(-this.value);
- assertEquals(this.value, this.si.neg());
- }
-
- public void testSetZero() throws Exception {
- this.si.setZero();
- assertEquals(0, this.si.getValue());
- assertFalse(this.si.isNotZero());
- assertTrue(this.si.isZero());
- }
-
- public void testGetMutexThis() throws Exception {
- assertSame(this.si, this.si.getMutex());
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to 0
- */
- public void testWaitUntilZero() throws Exception {
- this.verifyWaitUntilZero(0); // 0 = indefinite wait
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to 0 by t2
- assertEquals(0, this.si.getValue());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > " + TICK + "): " + time, time > TICK);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to 0
- */
- public void testWaitUntilZeroTimeout() throws Exception {
- this.verifyWaitUntilZero(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to 0 by t1
- assertEquals(0, this.si.getValue());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < " + THREE_TICKS + "): " + time, time < THREE_TICKS);
- }
-
- private void verifyWaitUntilZero(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetZeroCommand(), this.buildWaitUntilZeroCommand(t2Timeout));
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to 0;
- * then t2 will set the value to 7
- */
- public void testWaitToSetValue() throws Exception {
- this.verifyWaitToSetValue(0); // 0 = indefinite wait
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to an object by t2
- assertTrue(this.si.isNotZero());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > " + TICK + "): " + time, time > TICK);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to 0
- */
- public void testWaitToSetValueTimeout() throws Exception {
- this.verifyWaitToSetValue(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to zero by t1
- assertTrue(this.si.isZero());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < " + THREE_TICKS + "): " + time, time < THREE_TICKS);
- }
-
- private void verifyWaitToSetValue(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetZeroCommand(), this.buildWaitToSetValueCommand(t2Timeout));
- }
-
- /**
- * t2 will wait until t1 is finished "initializing" the value;
- * then t2 will get the newly-initialized value (42)
- */
- public void testExecute() throws Exception {
- this.si.setValue(0);
- Runnable r1 = this.buildRunnable(this.buildInitializeValueCommand(), this.si, 0);
- // give t1 a head start
- Runnable r2 = this.buildRunnable(this.buildGetValueCommand(), this.si, TICK);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- assertEquals(42, this.si.getValue());
- assertEquals(42, this.sIntValue);
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > " + TWO_TICKS + "): " + time, time > TWO_TICKS);
- }
-
- private void executeThreads(Command t1Command, Command t2Command) throws Exception {
- this.si.setValue(this.value);
- Runnable r1 = this.buildRunnable(t1Command, this.si, TWO_TICKS);
- Runnable r2 = this.buildRunnable(t2Command, this.si, 0);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- }
-
- private Command buildSetZeroCommand() {
- return new Command() {
- public void execute(SynchronizedInt sInt) {
- sInt.setZero();
- }
- };
- }
-
- private Command buildWaitUntilZeroCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedInt sInt) throws InterruptedException {
- SynchronizedIntTests.this.startTime = System.currentTimeMillis();
- SynchronizedIntTests.this.timeoutOccurred = ! sInt.waitUntilZero(timeout);
- SynchronizedIntTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Command buildWaitToSetValueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedInt sInt) throws InterruptedException {
- SynchronizedIntTests.this.startTime = System.currentTimeMillis();
- SynchronizedIntTests.this.timeoutOccurred = ! sInt.waitToSetValue(SynchronizedIntTests.this.value, timeout);
- SynchronizedIntTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Command buildInitializeValueCommand() {
- return new Command() {
- public void execute(final SynchronizedInt sInt) throws InterruptedException {
- sInt.execute(
- new org.eclipse.jpt.common.utility.Command() {
- public void execute() {
- // pretend to perform some long initialization process
- try {
- Thread.sleep(5 * TICK);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- sInt.setValue(42);
- }
- }
- );
- }
- };
- }
-
- private Command buildGetValueCommand() {
- return new Command() {
- public void execute(SynchronizedInt sInt) throws InterruptedException {
- SynchronizedIntTests.this.startTime = System.currentTimeMillis();
- SynchronizedIntTests.this.sIntValue = sInt.getValue();
- SynchronizedIntTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedInt sInt, final long sleep) {
- return new TestRunnable() {
- @Override
- protected void run_() throws InterruptedException {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(sInt);
- }
- };
- }
-
- private long calculateElapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedInt sInt) throws InterruptedException;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedObjectTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedObjectTests.java
deleted file mode 100644
index cffe99690a..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedObjectTests.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import org.eclipse.jpt.common.utility.internal.SynchronizedObject;
-
-@SuppressWarnings("nls")
-public class SynchronizedObjectTests
- extends MultiThreadedTestCase
-{
- private volatile SynchronizedObject<Object> so;
- volatile boolean timeoutOccurred;
- volatile Object value = new Object();
- volatile long startTime;
- volatile long endTime;
- volatile Object soValue;
-
-
- public SynchronizedObjectTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.so = new SynchronizedObject<Object>();
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.soValue = null;
- }
-
- public void testAccessors() throws Exception {
- this.so.setValue(null);
- assertNull(this.so.getValue());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- this.so.setValue(this.value);
- assertEquals(this.value, this.so.getValue());
- assertTrue(this.so.isNotNull());
- assertFalse(this.so.isNull());
-
- this.so.setNull();
- assertNull(this.so.getValue());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- assertSame(this.so, this.so.getMutex());
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to null
- */
- public void testWaitUntilNull() throws Exception {
- this.verifyWaitUntilNull(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to null by t2
- assertNull(this.so.getValue());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > " + TICK + "): " + time, time > TICK);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitUntilNullTimeout() throws Exception {
- this.verifyWaitUntilNull(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to null by t1
- assertNull(this.so.getValue());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < " + THREE_TICKS + "): " + time, time < THREE_TICKS);
- }
-
- private void verifyWaitUntilNull(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetNullCommand(), this.buildWaitUntilNullCommand(t2Timeout));
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to null;
- * then t2 will set the value to an object
- */
- public void testWaitToSetValue() throws Exception {
- this.verifyWaitToSetValue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to an object by t2
- assertTrue(this.so.isNotNull());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > " + TICK + "): " + time, time > TICK);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitToSetValueTimeout() throws Exception {
- this.verifyWaitToSetValue(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to null by t1
- assertTrue(this.so.isNull());
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < " + THREE_TICKS + "): " + time, time < THREE_TICKS);
- }
-
- private void verifyWaitToSetValue(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetNullCommand(), this.buildWaitToSetValueCommand(t2Timeout));
- }
-
- /**
- * t2 will wait until t1 is finished "initializing" the value;
- * then t2 will get the newly-initialized value ("foo")
- */
- public void testExecute() throws Exception {
- this.so.setValue(null);
- Runnable r1 = this.buildRunnable(this.buildInitializeValueCommand(), this.so, 0);
- // give t1 a head start of 100 ms
- Runnable r2 = this.buildRunnable(this.buildGetValueCommand(), this.so, TICK);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- assertEquals("foo", this.so.getValue());
- assertEquals("foo", this.soValue);
- // make a reasonable guess about how long t2 took
- long time = this.calculateElapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > " + TWO_TICKS + "): " + time, time > TWO_TICKS);
- }
-
- private void executeThreads(Command t1Command, Command t2Command) throws Exception {
- this.so.setValue(this.value);
- Runnable r1 = this.buildRunnable(t1Command, this.so, TWO_TICKS);
- Runnable r2 = this.buildRunnable(t2Command, this.so, 0);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- }
-
- private Command buildSetNullCommand() {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) {
- sObject.setNull();
- }
- };
- }
-
- private Command buildWaitUntilNullCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws InterruptedException {
- SynchronizedObjectTests.this.startTime = System.currentTimeMillis();
- SynchronizedObjectTests.this.timeoutOccurred = ! sObject.waitUntilNull(timeout);
- SynchronizedObjectTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Command buildWaitToSetValueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws InterruptedException {
- SynchronizedObjectTests.this.startTime = System.currentTimeMillis();
- SynchronizedObjectTests.this.timeoutOccurred = ! sObject.waitToSetValue(SynchronizedObjectTests.this.value, timeout);
- SynchronizedObjectTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Command buildInitializeValueCommand() {
- return new Command() {
- public void execute(final SynchronizedObject<Object> sObject) throws InterruptedException {
- sObject.execute(
- new org.eclipse.jpt.common.utility.Command() {
- public void execute() {
- // pretend to perform some long initialization process
- try {
- Thread.sleep(5 * TICK);
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- sObject.setValue("foo");
- }
- }
- );
- }
- };
- }
-
- private Command buildGetValueCommand() {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws InterruptedException {
- SynchronizedObjectTests.this.startTime = System.currentTimeMillis();
- SynchronizedObjectTests.this.soValue = sObject.getValue();
- SynchronizedObjectTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedObject<Object> sObject, final long sleep) {
- return new TestRunnable() {
- @Override
- protected void run_() throws InterruptedException {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(sObject);
- }
- };
- }
-
- private long calculateElapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedObject<Object> so) throws InterruptedException;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedQueueTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedQueueTests.java
deleted file mode 100644
index c2d7687e17..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedQueueTests.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.common.utility.internal.Queue;
-import org.eclipse.jpt.common.utility.internal.SimpleQueue;
-import org.eclipse.jpt.common.utility.internal.SynchronizedQueue;
-
-@SuppressWarnings("nls")
-public class SynchronizedQueueTests extends SimpleQueueTests {
- private volatile SynchronizedQueue<String> sq;
- volatile boolean timeoutOccurred;
- volatile long startTime;
- volatile long endTime;
- volatile Object dequeuedObject;
-
- static final String ITEM_1 = new String();
- static final String ITEM_2 = new String();
-
- public SynchronizedQueueTests(String name) {
- super(name);
- }
-
- @Override
- Queue<String> buildQueue() {
- return new SynchronizedQueue<String>();
- }
-
- @Override
- public void testClone() {
- // synchronized queue is not cloneable
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.sq = new SynchronizedQueue<String>();
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.dequeuedObject = null;
- }
-
- /**
- * test first with an unsynchronized queue,
- * then with a synchronized queue
- */
- public void testConcurrentAccess() throws Exception {
- this.verifyConcurrentAccess(new SlowSimpleQueue<String>(), "first");
- this.verifyConcurrentAccess(new SlowSynchronizedQueue<String>(), "second");
- }
-
- private void verifyConcurrentAccess(SlowQueue<String> slowQueue, String expected) throws Exception {
- slowQueue.enqueue("first");
- slowQueue.enqueue("second");
-
- Thread thread = this.buildThread(this.buildRunnable(slowQueue));
- thread.start();
- Thread.sleep(TWO_TICKS);
-
- assertEquals(expected, slowQueue.dequeue());
- thread.join();
- assertTrue(slowQueue.isEmpty());
- }
-
- private Runnable buildRunnable(final SlowQueue<String> slowQueue) {
- return new Runnable() {
- public void run() {
- slowQueue.slowDequeue();
- }
- };
- }
-
-
- private interface SlowQueue<E> extends Queue<E> {
- Object slowDequeue();
- }
-
- private class SlowSimpleQueue<E> extends SimpleQueue<E> implements SlowQueue<E> {
- SlowSimpleQueue() {
- super();
- }
- public Object slowDequeue() {
- try {
- Thread.sleep(5 * TICK);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.dequeue();
- }
-
- }
-
- private class SlowSynchronizedQueue<E> extends SynchronizedQueue<E> implements SlowQueue<E> {
- SlowSynchronizedQueue() {
- super();
- }
- public synchronized Object slowDequeue() {
- try {
- Thread.sleep(5 * TICK);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.dequeue();
- }
-
- }
-
-
- // ********** waits **********
-
- public void testWaitToDequeue() throws Exception {
- this.verifyWaitToDequeue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and an item should have been dequeued by t2...
- assertSame(ITEM_1, this.dequeuedObject);
- // ...and the queue should be empty
- assertTrue(this.sq.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() > TICK);
- }
-
- public void testWaitToDequeueTimeout() throws Exception {
- this.verifyWaitToDequeue(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the queue was never dequeued...
- assertNull(this.dequeuedObject);
- // ...and it still holds the item
- assertSame(ITEM_1, this.sq.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() < THREE_TICKS);
- }
-
- private void verifyWaitToDequeue(long timeout) throws Exception {
- Runnable r1 = this.buildRunnable(this.buildEnqueueCommand(), this.sq, TWO_TICKS);
- Runnable r2 = this.buildRunnable(this.buildWaitToDequeueCommand(timeout), this.sq, 0);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- }
-
- public void testWaitToEnqueue() throws Exception {
- this.verifyWaitToEnqueue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the queue gets dequeued by t1...
- assertSame(ITEM_1, this.dequeuedObject);
- // ...and an item is enqueued on to the queue by t2
- assertFalse(this.sq.isEmpty());
- assertSame(ITEM_2, this.sq.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() > TICK);
- }
-
- public void testWaitToEnqueueTimeout() throws Exception {
- this.verifyWaitToEnqueue(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the queue is eventually dequeued by t1...
- assertSame(ITEM_1, this.dequeuedObject);
- // ...but nothing is enqueued on to the queue by t2
- assertTrue(this.sq.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() < THREE_TICKS);
- }
-
- private void verifyWaitToEnqueue(long timeout) throws Exception {
- this.sq.enqueue(ITEM_1);
- Runnable r1 = this.buildRunnable(this.buildDequeueCommand(), this.sq, TWO_TICKS);
- Runnable r2 = this.buildRunnable(this.buildWaitToEnqueueCommand(timeout), this.sq, 0);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- }
-
- private Command buildEnqueueCommand() {
- return new Command() {
- public void execute(SynchronizedQueue<String> synchronizedQueue) {
- synchronizedQueue.enqueue(ITEM_1);
- }
- };
- }
-
- private Command buildWaitToDequeueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedQueue<String> synchronizedQueue) throws InterruptedException {
- SynchronizedQueueTests.this.startTime = System.currentTimeMillis();
- try {
- SynchronizedQueueTests.this.dequeuedObject = synchronizedQueue.waitToDequeue(timeout);
- } catch (NoSuchElementException ex) {
- SynchronizedQueueTests.this.timeoutOccurred = true;
- }
- SynchronizedQueueTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Command buildDequeueCommand() {
- return new Command() {
- public void execute(SynchronizedQueue<String> synchronizedQueue) {
- SynchronizedQueueTests.this.dequeuedObject = synchronizedQueue.dequeue();
- }
- };
- }
-
- private Command buildWaitToEnqueueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedQueue<String> synchronizedQueue) throws InterruptedException {
- SynchronizedQueueTests.this.startTime = System.currentTimeMillis();
- SynchronizedQueueTests.this.timeoutOccurred = ! synchronizedQueue.waitToEnqueue(ITEM_2, timeout);
- SynchronizedQueueTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedQueue<String> synchronizedQueue, final long sleep) {
- return new TestRunnable() {
- @Override
- protected void run_() throws Throwable {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(synchronizedQueue);
- }
- };
- }
-
- long calculateElapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedQueue<String> synchronizedQueue) throws InterruptedException;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedStackTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedStackTests.java
deleted file mode 100644
index 16cb62f345..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/SynchronizedStackTests.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.util.EmptyStackException;
-import org.eclipse.jpt.common.utility.internal.SimpleStack;
-import org.eclipse.jpt.common.utility.internal.Stack;
-import org.eclipse.jpt.common.utility.internal.SynchronizedStack;
-
-@SuppressWarnings("nls")
-public class SynchronizedStackTests
- extends SimpleStackTests
-{
- private volatile SynchronizedStack<String> ss;
- volatile boolean timeoutOccurred;
- volatile long startTime;
- volatile long endTime;
- volatile Object poppedObject;
-
- static final String ITEM_1 = new String();
- static final String ITEM_2 = new String();
-
- public SynchronizedStackTests(String name) {
- super(name);
- }
-
- @Override
- Stack<String> buildStack() {
- return new SynchronizedStack<String>();
- }
-
- @Override
- public void testClone() {
- // synchronized stack is not cloneable
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.ss = new SynchronizedStack<String>();
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.poppedObject = null;
- }
-
- /**
- * test first with an unsynchronized stack,
- * then with a synchronized stack
- */
- public void testConcurrentAccess() throws Exception {
- this.verifyConcurrentAccess(new SlowSimpleStack<String>(), "second");
- this.verifyConcurrentAccess(new SlowSynchronizedStack<String>(), "first");
- }
-
- private void verifyConcurrentAccess(SlowStack<String> slowStack, String expected) throws Exception {
- slowStack.push("first");
- slowStack.push("second");
-
- Thread thread = this.buildThread(this.buildRunnable(slowStack));
- thread.start();
- Thread.sleep(TWO_TICKS);
-
- assertEquals(expected, slowStack.pop());
- thread.join();
- assertTrue(slowStack.isEmpty());
- }
-
- private Runnable buildRunnable(final SlowStack<String> slowStack) {
- return new Runnable() {
- public void run() {
- slowStack.slowPop();
- }
- };
- }
-
-
- private interface SlowStack<E> extends Stack<E> {
- Object slowPop();
- }
-
- private class SlowSimpleStack<E> extends SimpleStack<E> implements SlowStack<E> {
- SlowSimpleStack() {
- super();
- }
- public Object slowPop() {
- try {
- Thread.sleep(5 * TICK);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.pop();
- }
-
- }
-
- private class SlowSynchronizedStack<E> extends SynchronizedStack<E> implements SlowStack<E> {
- SlowSynchronizedStack() {
- super();
- }
- public synchronized Object slowPop() {
- try {
- Thread.sleep(5 * TICK);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.pop();
- }
-
- }
-
-
- // ********** waits **********
-
- public void testWaitToPop() throws Exception {
- this.verifyWaitToPop(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and an item should have been popped by t2...
- assertSame(ITEM_1, this.poppedObject);
- // ...and the stack should be empty
- assertTrue(this.ss.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() > TICK);
- }
-
- public void testWaitToPopTimeout() throws Exception {
- this.verifyWaitToPop(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the stack was never popped...
- assertNull(this.poppedObject);
- // ...and it still holds the item
- assertSame(ITEM_1, this.ss.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() < THREE_TICKS);
- }
-
- private void verifyWaitToPop(long timeout) throws Exception {
- Runnable r1 = this.buildRunnable(this.buildPushCommand(), this.ss, TWO_TICKS);
- Runnable r2 = this.buildRunnable(this.buildWaitToPopCommand(timeout), this.ss, 0);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- }
-
- public void testWaitToPush() throws Exception {
- this.verifyWaitToPush(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the stack gets popped by t1...
- assertSame(ITEM_1, this.poppedObject);
- // ...and an item is pushed on to the stack by t2
- assertFalse(this.ss.isEmpty());
- assertSame(ITEM_2, this.ss.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() > TICK);
- }
-
- public void testWaitToPushTimeout() throws Exception {
- this.verifyWaitToPush(TICK);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the stack is eventually popped by t1...
- assertSame(ITEM_1, this.poppedObject);
- // ...but nothing is pushed on to the stack by t2
- assertTrue(this.ss.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.calculateElapsedTime() < THREE_TICKS);
- }
-
- private void verifyWaitToPush(long timeout) throws Exception {
- this.ss.push(ITEM_1);
- Runnable r1 = this.buildRunnable(this.buildPopCommand(), this.ss, TWO_TICKS);
- Runnable r2 = this.buildRunnable(this.buildWaitToPushCommand(timeout), this.ss, 0);
- Thread t1 = this.buildThread(r1);
- Thread t2 = this.buildThread(r2);
- t1.start();
- t2.start();
- t1.join();
- t2.join();
- }
-
- private Command buildPushCommand() {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) {
- synchronizedStack.push(ITEM_1);
- }
- };
- }
-
- private Command buildWaitToPopCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) throws InterruptedException {
- SynchronizedStackTests.this.startTime = System.currentTimeMillis();
- try {
- SynchronizedStackTests.this.poppedObject = synchronizedStack.waitToPop(timeout);
- } catch (EmptyStackException ex) {
- SynchronizedStackTests.this.timeoutOccurred = true;
- }
- SynchronizedStackTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Command buildPopCommand() {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) {
- SynchronizedStackTests.this.poppedObject = synchronizedStack.pop();
- }
- };
- }
-
- private Command buildWaitToPushCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) throws InterruptedException {
- SynchronizedStackTests.this.startTime = System.currentTimeMillis();
- SynchronizedStackTests.this.timeoutOccurred = ! synchronizedStack.waitToPush(ITEM_2, timeout);
- SynchronizedStackTests.this.endTime = System.currentTimeMillis();
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedStack<String> synchronizedStack, final long sleep) {
- return new TestRunnable() {
- @Override
- protected void run_() throws Throwable {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(synchronizedStack);
- }
- };
- }
-
- long calculateElapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedStack<String> synchronizedStack) throws InterruptedException;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/TestTools.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/TestTools.java
deleted file mode 100644
index f66f31c21f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/TestTools.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import junit.framework.TestCase;
-import junit.framework.TestFailure;
-import junit.framework.TestResult;
-
-/**
- * various tools that can be used by test cases
- */
-public final class TestTools {
-
- /**
- * Convenience method that handles {@link InterruptedException}.
- */
- public static void sleep(long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * test an object's implementation of Serializable by serializing the
- * specified object to a byte array; then de-serializing the byte array and
- * returning the resultant object
- */
- public static <T> T serialize(T o) throws IOException, ClassNotFoundException {
- ByteArrayOutputStream baOutStream = new ByteArrayOutputStream(2000);
- ObjectOutputStream outStream = new ObjectOutputStream(baOutStream);
- outStream.writeObject(o);
- outStream.close();
-
- ByteArrayInputStream baInStream = new ByteArrayInputStream(baOutStream.toByteArray());
- ObjectInputStream inStream = new ObjectInputStream(baInStream);
- T o2 = readObject(inStream);
- inStream.close();
-
- return o2;
- }
-
- @SuppressWarnings("unchecked")
- private static <T> T readObject(ObjectInput objectInput) throws IOException, ClassNotFoundException {
- return (T) objectInput.readObject();
- }
-
- /**
- * redirect std out and std err to the specified stream
- */
- public static void redirectSystemStreamsTo(OutputStream outputStream) {
- redirectSystemStreamsTo(new PrintStream(outputStream));
- }
-
- /**
- * redirect std out and std err to the specified stream
- */
- public static void redirectSystemStreamsTo(PrintStream printStream) {
- System.setOut(printStream);
- System.setErr(printStream);
- }
-
- /**
- * Sort and print out all the current Java System properties on the
- * console.
- */
- public static void printSystemProperties() {
- synchronized (System.out) {
- printSystemPropertiesOn(System.out);
- }
- }
-
- /**
- * Sort and print out all the current Java System properties on the
- * specified print stream.
- */
- public static void printSystemPropertiesOn(PrintStream stream) {
- SortedSet<String> sortedKeys = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
- for (Object key : System.getProperties().keySet()) {
- sortedKeys.add((String) key);
- }
- for (String key : sortedKeys) {
- stream.print(key);
- stream.print(" => "); //$NON-NLS-1$
- stream.print(System.getProperty(key));
- stream.println();
- }
- }
-
- /**
- * execute the specified test and return a text output of its results
- */
- public static String execute(TestCase testCase) {
- long start = System.currentTimeMillis();
- TestResult result = testCase.run();
- long end = System.currentTimeMillis();
-
- StringWriter stringWriter = new StringWriter();
- PrintWriter writer = new PrintWriter(stringWriter);
- writer.print(testCase.getName());
- writer.print(": "); //$NON-NLS-1$
- if (result.wasSuccessful()) {
- writer.println("OK"); //$NON-NLS-1$
- } else {
- TestFailure failure = null;
- if (result.failures().hasMoreElements()) {
- failure = result.failures().nextElement();
- } else {
- failure = result.errors().nextElement();
- }
- failure.thrownException().printStackTrace(writer);
- }
- writer.print("elapsed time: "); //$NON-NLS-1$
- long elapsed = end - start;
- writer.print(elapsed / 1000L);
- writer.println(" sec."); //$NON-NLS-1$
- return stringWriter.toString();
- }
-
- /**
- * Clear out all the instance variable of the specified test case, allowing
- * the various test fixtures to be garbage-collected. Typically this is
- * called in the #tearDown() method.
- */
- public static void clear(TestCase testCase) throws IllegalAccessException {
- for (Class<?> clazz = testCase.getClass(); clazz != TestCase_class; clazz = clazz.getSuperclass()) {
- for (Field field : clazz.getDeclaredFields()) {
- // leave primitives alone - they don't get garbage-collected, and we can't set them to null...
- if (field.getType().isPrimitive()) {
- continue;
- }
- // leave static fields alone (?)
- if (Modifier.isStatic(field.getModifiers())) {
- continue;
- }
- field.setAccessible(true);
- field.set(testCase, null);
- }
- }
- }
-
- private static final Class<TestCase> TestCase_class = TestCase.class;
-
- /**
- * Workaround for a JUnit bug: JUnit does not configure the testing Thread
- * with a context class loader. This should probably happen in
- * TestRunner.doRunTest(Test), just before starting the thread.
- */
- public static void setUpJUnitThreadContextClassLoader() {
- Thread.currentThread().setContextClassLoader(TestTools.class.getClassLoader());
- }
-
- /**
- * suppressed constructor
- */
- private TestTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ToolsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ToolsTests.java
deleted file mode 100644
index bf7fcba128..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/ToolsTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import org.eclipse.jpt.common.utility.internal.Tools;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("nls")
-public class ToolsTests extends TestCase {
-
- public ToolsTests(String name) {
- super(name);
- }
-
- public void testValuesAreEqual1() {
- assertTrue(Tools.valuesAreEqual(null, null));
- }
-
- public void testValuesAreEqual2() {
- assertFalse(Tools.valuesAreEqual(null, "foo"));
- }
-
- public void testValuesAreEqual3() {
- assertFalse(Tools.valuesAreEqual("foo", null));
- }
-
- public void testValuesAreEqual4() {
- assertTrue(Tools.valuesAreEqual("foo", "foo"));
- }
-
- public void testValuesAreEqual5() {
- assertFalse(Tools.valuesAreEqual("foo", "bar"));
- }
-
- public void testValuesAreDifferent1() {
- assertFalse(Tools.valuesAreDifferent(null, null));
- }
-
- public void testValuesAreDifferent2() {
- assertTrue(Tools.valuesAreDifferent(null, "foo"));
- }
-
- public void testValuesAreDifferent3() {
- assertTrue(Tools.valuesAreDifferent("foo", null));
- }
-
- public void testValuesAreDifferent4() {
- assertFalse(Tools.valuesAreDifferent("foo", "foo"));
- }
-
- public void testValuesAreDifferent5() {
- assertTrue(Tools.valuesAreDifferent("foo", "bar"));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/VersionComparatorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/VersionComparatorTests.java
deleted file mode 100644
index 3a7eff17a3..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/VersionComparatorTests.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Comparator;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.VersionComparator;
-import org.eclipse.jpt.common.utility.internal.VersionComparator.SegmentParser;
-
-@SuppressWarnings("nls")
-public class VersionComparatorTests
- extends TestCase
-{
- public VersionComparatorTests(String name) {
- super(name);
- }
-
- public void testVersionIsEqual_integer() {
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.0", "2.0.0") == 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.0", "2.0.0.0") == 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.0.0.0.0.0000", "2.0") == 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.-1", "2.0.-1") == 0);
- }
-
- public void testVersionIsLess_integer() {
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.0", "2.0.1") < 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.5.0", "2.14") < 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.5.0", "2.5.0.0.1.0") < 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.5.0.0.0.-1", "2.5") < 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.-1", "2.0.0") < 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.-1", "2") < 0);
- }
-
- public void testVersionIsGreater_integer() {
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.2", "2.0.1") > 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.2", "2.0.1") > 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.5.0.0.1.0", "2.5.0") > 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.5", "2.5.0.0.0.-1") > 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.0", "2.0.-1") > 0);
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2", "2.0.-1") > 0);
- }
-
- public void testVersionIsEqual_integer_comma() {
- Comparator<String> versionComparator = new VersionComparator<BigDecimal>(",", DecimalSegmentParser.instance());
- assertTrue(versionComparator.compare("2,0,0", "2,0,0") == 0);
- assertTrue(versionComparator.compare("2,0.0,0", "2,0,0") == 0);
- assertTrue(versionComparator.compare("2,0.0,0", "2,0,0.0") == 0);
- assertTrue(versionComparator.compare("2.0,0.0,0", "2,0,0.0") == 0);
- }
-
- public void testVersionIsLess_integer_comma() {
- Comparator<String> versionComparator = new VersionComparator<BigDecimal>(",", DecimalSegmentParser.instance());
- assertTrue(versionComparator.compare("2,0,0", "2,0,1") < 0);
- assertTrue(versionComparator.compare("2,0.0,0", "2,0,1") < 0);
- assertTrue(versionComparator.compare("2,0,0", "2,0,1.0") < 0);
- assertTrue(versionComparator.compare("2.0,0,0", "2,0,1") < 0);
- }
-
- public void testVersionIsGreater_integer_comma() {
- Comparator<String> versionComparator = new VersionComparator<BigDecimal>(",", DecimalSegmentParser.instance());
- assertTrue(versionComparator.compare("2,0,2", "2,0,1") > 0);
- assertTrue(versionComparator.compare("2,0,2.1", "2,0,1") > 0);
- assertTrue(versionComparator.compare("2,0,2", "2,0,1.9") > 0);
- assertTrue(versionComparator.compare("2.000,0,2", "2,0,1") > 0);
- }
-
- public void testVersionIsEqual_subclass() {
- Comparator<String> versionComparator = new VersionComparator<Integer>() {
- @Override
- protected Integer parseSegment(int index, String s) {
- return Integer.valueOf(s);
- }
- @Override
- protected Integer getZero() {
- return Integer.valueOf(0);
- }
- };
- assertTrue(versionComparator.compare("2.0.0", "2.0.0") == 0);
- assertTrue(versionComparator.compare("2.0.0", "2.0.0.0") == 0);
- assertTrue(versionComparator.compare("2.0.0.0", "2.0") == 0);
- assertTrue(versionComparator.compare("2.0.-1", "2.0.-1") == 0);
- }
-
- public void testVersionIsLess_subclass() {
- Comparator<String> versionComparator = new VersionComparator<Integer>() {
- @Override
- protected Integer parseSegment(int index, String s) {
- return Integer.valueOf(s);
- }
- @Override
- protected Integer getZero() {
- return Integer.valueOf(0);
- }
- };
- assertTrue(versionComparator.compare("2.0.0", "2.0.1") < 0);
- assertTrue(versionComparator.compare("2.5.0", "2.14") < 0);
- assertTrue(versionComparator.compare("2.5.0", "2.5.0.0.1.0") < 0);
- assertTrue(versionComparator.compare("2.0.-1", "2.0.0") < 0);
- assertTrue(versionComparator.compare("2.0.-1", "2") < 0);
- }
-
- public void testVersionIsGreater_subclass() {
- Comparator<String> versionComparator = new VersionComparator<Integer>() {
- @Override
- protected Integer parseSegment(int index, String s) {
- return Integer.valueOf(s);
- }
- @Override
- protected Integer getZero() {
- return Integer.valueOf(0);
- }
- };
- assertTrue(versionComparator.compare("2.0.2", "2.0.1") > 0);
- assertTrue(versionComparator.compare("2.0.2", "2.0.1") > 0);
- assertTrue(versionComparator.compare("2.5.0.0.1.0", "2.5.0") > 0);
- assertTrue(versionComparator.compare("2.0.0", "2.0.-1") > 0);
- assertTrue(versionComparator.compare("2", "2.0.-1") > 0);
- }
-
- public void testBadString() {
- boolean exCaught = false;
- try {
- // note the letter 'O' instead of the numeral '0'
- assertTrue(VersionComparator.INTEGER_VERSION_COMPARATOR.compare("2.0.0", "2.O.O") == 0);
- } catch (NumberFormatException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusSubclass1() {
- Comparator<String> versionComparator = new VersionComparator<Integer>() {
- // bogus - must override parseSegment(...)
- @Override
- protected Integer getZero() {
- return Integer.valueOf(0);
- }
- };
- boolean exCaught = false;
- try {
- assertTrue(versionComparator.compare("2.0.0", "2.0.0") == 0);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusSubclass2() {
- Comparator<String> versionComparator = new VersionComparator<Integer>() {
- @Override
- protected Integer parseSegment(int index, String s) {
- return Integer.valueOf(s);
- }
- // bogus - must getZero()
- };
- boolean exCaught = false;
- try {
- assertTrue(versionComparator.compare("2.0.0", "2.0.0.0.0") == 0);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- static final class DecimalSegmentParser
- implements SegmentParser<BigDecimal>, Serializable
- {
- public static final SegmentParser<BigDecimal> INSTANCE = new DecimalSegmentParser();
- public static SegmentParser<BigDecimal> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private DecimalSegmentParser() {
- super();
- }
- // simply parse the segment as an integer
- public BigDecimal parse(int segmentIndex, String segment) {
- return new BigDecimal(segment);
- }
- public BigDecimal getZero() {
- return ZERO;
- }
- private static final BigDecimal ZERO = new BigDecimal(0);
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/XMLStringEncoderTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/XMLStringEncoderTests.java
deleted file mode 100644
index 461313cb72..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/XMLStringEncoderTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.FileTools;
-import org.eclipse.jpt.common.utility.internal.XMLStringEncoder;
-
-@SuppressWarnings("nls")
-public class XMLStringEncoderTests extends TestCase {
-
- public XMLStringEncoderTests(String name) {
- super(name);
- }
-
- public void testEncodeNoCharacterSequences() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "foo";
- assertEquals(s, encoder.encode(s));
-
- s = "123foo123";
- assertEquals(s, encoder.encode(s));
- }
-
- public void testEncodeCharacterSequences() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "?foo?";
- String expected = "&#x3f;foo&#x3f;";
- assertEquals(expected, encoder.encode(s));
-
- s = "?foo&123";
- expected = "&#x3f;foo&#x26;123";
- assertEquals(expected, encoder.encode(s));
- }
-
- public void testDenormalizeValidFileName() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "foo";
- assertEquals(s, encoder.decode(s));
-
- s = "123foo123";
- assertEquals(s, encoder.decode(s));
- }
-
- public void testDenormalizeInvalidFileName() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "&#x3f;foo&#x3f;";
- String expected = "?foo?";
- assertEquals(expected, encoder.decode(s));
-
- s = "&#x3f;foo&#x26;123";
- expected = "?foo&123";
- assertEquals(expected, encoder.decode(s));
- }
-
- public void testRoundTripNoCharacterSequences() {
- this.verifyRoundTrip("foo");
- this.verifyRoundTrip("123foo456");
- }
-
- public void testRoundTripCharacterSequences() {
- this.verifyRoundTrip("?foo?");
- this.verifyRoundTrip("?foo&123&&&&&&>>>>");
- }
-
- private void verifyRoundTrip(String s) {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- String actual = encoder.encode(s);
- assertEquals(s, encoder.decode(actual));
- }
-
- public void testInvalidCharacterSequence1() {
- this.verifyIllegalStateException("foo&");
- }
-
- public void testInvalidCharacterSequence2() {
- this.verifyIllegalStateException("foo&#");
- }
-
- public void testInvalidCharacterSequence3() {
- this.verifyIllegalStateException("foo&#x");
- }
-
- public void testInvalidCharacterSequence4() {
- this.verifyIllegalStateException("foo&#x3");
- }
-
- public void testInvalidCharacterSequence5() {
- this.verifyIllegalStateException("foo&#x;");
- }
-
- public void testInvalidCharacterSequence6() {
- this.verifyIllegalStateException("foo&A");
- }
-
- public void testInvalidCharacterSequence7() {
- this.verifyIllegalStateException("foo&#A");
- }
-
- private void verifyIllegalStateException(String s) {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- boolean exCaught = false;
- try {
- s = encoder.decode(s);
- fail(s);
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidCharacterSequence8() {
- String s = "foo&#xZZZZ;";
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- boolean exCaught = false;
- try {
- s = encoder.decode(s);
- fail(s);
- } catch (NumberFormatException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/EmptyEnumerationTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/EmptyEnumerationTests.java
deleted file mode 100644
index 1efc9c81bb..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/EmptyEnumerationTests.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.enumerations;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.enumerations.EmptyEnumeration;
-
-@SuppressWarnings("nls")
-public class EmptyEnumerationTests extends TestCase {
-
- public EmptyEnumerationTests(String name) {
- super(name);
- }
-
- public void testHasMoreElements() {
- int i = 0;
- for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNextElement() {
- for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) {
- fail("bogus element: " + stream.nextElement());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Enumeration<Object> stream = EmptyEnumeration.instance();
- Object element = null;
- while (stream.hasMoreElements()) {
- element = stream.nextElement();
- }
- try {
- element = stream.nextElement();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/IteratorEnumerationTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/IteratorEnumerationTests.java
deleted file mode 100644
index cd6cbaa8af..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/IteratorEnumerationTests.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.enumerations;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.enumerations.IteratorEnumeration;
-
-@SuppressWarnings("nls")
-public class IteratorEnumerationTests extends TestCase {
-
- public IteratorEnumerationTests(String name) {
- super(name);
- }
-
- public void testHasMoreElements() {
- int i = 0;
- for (Enumeration<String> stream = this.buildEnumeration(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasMoreElementsUpcast() {
- int i = 0;
- for (Enumeration<Object> stream = this.buildEnumerationUpcast(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNextElement() {
- Iterator<String> iterator = this.buildIterator();
- for (Enumeration<String> stream = this.buildEnumeration(); stream.hasMoreElements();) {
- assertEquals("bogus element", iterator.next(), stream.nextElement());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Enumeration<String> stream = this.buildEnumeration();
- String string = null;
- while (stream.hasMoreElements()) {
- string = stream.nextElement();
- }
- try {
- string = stream.nextElement();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- private Enumeration<String> buildEnumeration() {
- return this.buildEnumeration(this.buildIterator());
- }
-
- private Enumeration<Object> buildEnumerationUpcast() {
- return this.buildEnumerationUpcast(this.buildIterator());
- }
-
- private Enumeration<String> buildEnumeration(Iterator<String> iterator) {
- return new IteratorEnumeration<String>(iterator);
- }
-
- private Enumeration<Object> buildEnumerationUpcast(Iterator<String> iterator) {
- return new IteratorEnumeration<Object>(iterator);
- }
-
- private Iterator<String> buildIterator() {
- return this.buildVector().iterator();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/JptUtilityEnumerationsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/JptUtilityEnumerationsTests.java
deleted file mode 100644
index d5dfb0f0a8..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/enumerations/JptUtilityEnumerationsTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.enumerations;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityEnumerationsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityEnumerationsTests.class.getPackage().getName());
-
- suite.addTestSuite(EmptyEnumerationTests.class);
- suite.addTestSuite(IteratorEnumerationTests.class);
-
- return suite;
- }
-
- private JptUtilityEnumerationsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayIterableTests.java
deleted file mode 100644
index 0c6e2da5a2..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayIterableTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-
-@SuppressWarnings("nls")
-public class ArrayIterableTests extends TestCase {
-
- public ArrayIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- int i = 1;
- for (String string : this.buildIterable()) {
- assertEquals(i++, Integer.parseInt(string));
- }
- }
-
- public void testSubIterator() {
- int i = 3;
- for (String string : this.buildIterable(2)) {
- assertEquals(i++, Integer.parseInt(string));
- }
- }
-
- public void testIllegalArgumentException() {
- this.triggerIllegalArgumentException(-1, 1);
- this.triggerIllegalArgumentException(8, 1);
- this.triggerIllegalArgumentException(0, -1);
- this.triggerIllegalArgumentException(0, 9);
- }
-
- private void triggerIllegalArgumentException(int start, int length) {
- boolean exCaught = false;
- try {
- Iterable<String> iterable = this.buildIterable(start, length);
- fail("bogus iterable: " + iterable);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private Iterable<String> buildIterable() {
- return this.buildIterable(0);
- }
-
- private Iterable<String> buildIterable(int start) {
- return this.buildIterable(this.buildArray(), start);
- }
-
- private Iterable<String> buildIterable(String[] array, int start) {
- return new ArrayIterable<String>(array, start);
- }
-
- private Iterable<String> buildIterable(int start, int length) {
- return this.buildIterable(this.buildArray(), start, length);
- }
-
- private Iterable<String> buildIterable(String[] array, int start, int length) {
- return new ArrayIterable<String>(array, start, length);
- }
-
- private String[] buildArray() {
- return new String[] { "1", "2", "3", "4", "5", "6", "7", "8" };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayListIterableTests.java
deleted file mode 100644
index f7cd40fcb8..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ArrayListIterableTests.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ListIterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-@SuppressWarnings("nls")
-public class ArrayListIterableTests extends TestCase {
-
- public ArrayListIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- int i = 1;
- ListIterable<String> iterable = this.buildIterable();
- for (String string : iterable) {
- assertEquals(i++, Integer.parseInt(string));
- }
- ListIterator<String> stream = iterable.iterator();
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- assertEquals(--i, Integer.parseInt(stream.previous()));
- }
- }
-
- public void testSubIterator() {
- int i = 3;
- for (String string : this.buildIterable(2)) {
- assertEquals(i++, Integer.parseInt(string));
- }
- }
-
- public void testIllegalArgumentException() {
- this.triggerIllegalArgumentException(-1, 1);
- this.triggerIllegalArgumentException(8, 1);
- this.triggerIllegalArgumentException(0, -1);
- this.triggerIllegalArgumentException(0, 9);
- }
-
- private void triggerIllegalArgumentException(int start, int length) {
- boolean exCaught = false;
- try {
- Iterable<String> iterable = this.buildIterable(start, length);
- fail("bogus iterable: " + iterable);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private ListIterable<String> buildIterable() {
- return this.buildIterable(0);
- }
-
- private ListIterable<String> buildIterable(int start) {
- return this.buildIterable(this.buildArray(), start);
- }
-
- private ListIterable<String> buildIterable(String[] array, int start) {
- return (start == 0) ?
- new ArrayListIterable<String>(array) :
- new ArrayListIterable<String>(array, start);
- }
-
- private ListIterable<String> buildIterable(int start, int length) {
- return this.buildIterable(this.buildArray(), start, length);
- }
-
- private ListIterable<String> buildIterable(String[] array, int start, int length) {
- return new ArrayListIterable<String>(array, start, length);
- }
-
- private String[] buildArray() {
- return new String[] { "1", "2", "3", "4", "5", "6", "7", "8" };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ChainIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ChainIterableTests.java
deleted file mode 100644
index ae8423bfd5..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ChainIterableTests.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.AbstractCollection;
-import java.util.AbstractList;
-import java.util.Iterator;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ChainIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ChainIterator;
-
-@SuppressWarnings("nls")
-public class ChainIterableTests extends TestCase {
- private final static Class<?>[] VECTOR_HIERARCHY = { Vector.class, AbstractList.class, AbstractCollection.class, Object.class };
-
- public ChainIterableTests(String name) {
- super(name);
- }
-
-
- public void testNextLink() {
- int i = 0;
- for (Class<?> clazz : this.buildIterable()) {
- assertEquals(VECTOR_HIERARCHY[i++], clazz);
- }
- }
-
- public void testLinker() {
- int i = 0;
- for (Class<?> clazz : new ChainIterable<Class<?>>(Vector.class, this.buildLinker())) {
- assertEquals(VECTOR_HIERARCHY[i++], clazz);
- }
- }
-
- public void testException() {
- Iterable<Class<?>> iterable = new ChainIterable<Class<?>>(Vector.class);
- Iterator<Class<?>> iterator = iterable.iterator();
- boolean exCaught = false;
- try {
- Class<?> clazz = iterator.next();
- fail("bogus class: " + clazz);
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testToString() {
- assertNotNull(this.buildIterable().toString());
- }
-
- private Iterable<Class<?>> buildIterable() {
- return this.buildChainIterable(Vector.class);
- }
-
- private Iterable<Class<?>> buildChainIterable(Class<?> startLink) {
- // chain up the class's hierarchy
- return new ChainIterable<Class<?>>(startLink) {
- @Override
- protected Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
- private ChainIterator.Linker<Class<?>> buildLinker() {
- return new ChainIterator.Linker<Class<?>>() {
- public Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CloneIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CloneIterableTests.java
deleted file mode 100644
index 03292ec25d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CloneIterableTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-
-@SuppressWarnings("nls")
-public abstract class CloneIterableTests extends TestCase {
- Iterable<String> iterable;
-
- public CloneIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- List<String> c = new ArrayList<String>();
- c.add("0");
- c.add("1");
- c.add("2");
- c.add("3");
- assertEquals(4, c.size());
- this.iterable = this.buildIterable(c);
- int i = 0;
- for (String s : this.iterable) {
- assertEquals(String.valueOf(i++), s);
- c.remove("3");
- }
- assertEquals(4, i);
- assertEquals(3, c.size());
- }
-
- public void testRemove() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildRemovingIterable(collection);
-
- Object removed = "three";
- assertTrue(CollectionTools.contains(this.iterable, removed));
- for (Iterator<String> iterator = this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals(removed)) {
- iterator.remove();
- }
- }
- assertFalse(collection.contains(removed));
- }
-
- public void testRemover() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildIterableWithRemover(collection);
-
- Object removed = "three";
- assertTrue(CollectionTools.contains(this.iterable, removed));
- for (Iterator<String> iterator = this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals(removed)) {
- iterator.remove();
- }
- }
- assertFalse(collection.contains(removed));
- }
-
- public void testMissingRemover() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildIterable(collection);
- assertNotNull(this.iterable.toString());
-
- Object removed = "three";
- assertTrue(CollectionTools.contains(this.iterable, removed));
- boolean exCaught = false;
- for (Iterator<String> iterator = this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals(removed)) {
- try {
- iterator.remove();
- fail();
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- public void testToString() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildIterable(collection);
- assertNotNull(iterable.toString());
- }
-
- abstract Iterable<String> buildIterable(List<String> c);
-
- abstract Iterable<String> buildRemovingIterable(List<String> c);
-
- abstract Iterable<String> buildIterableWithRemover(List<String> c);
-
- CloneIterator.Remover<String> buildRemover(final Collection<String> c) {
- return new CloneIterator.Remover<String>() {
- public void remove(String current) {
- c.remove(current);
- }
- };
- }
-
- CloneListIterator.Mutator<String> buildMutator(final List<String> list) {
- return new CloneListIterator.Mutator<String>() {
- public void add(int index, String string) {
- list.add(index, string);
- }
- public void set(int index, String string) {
- list.set(index, string);
- }
- public void remove(int index) {
- list.remove(index);
- }
- };
- }
-
- List<String> buildCollection() {
- List<String> c = new ArrayList<String>();
- c.add("one");
- c.add("two");
- c.add("three");
- c.add("four");
- c.add("five");
- c.add("six");
- c.add("seven");
- c.add("eight");
- return c;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeIterableTests.java
deleted file mode 100644
index bd5516f161..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeIterableTests.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-
-@SuppressWarnings("nls")
-public class CompositeIterableTests extends TestCase {
-
- public CompositeIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- Collection<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- Collection<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
-
- @SuppressWarnings("unchecked")
- Iterable<String> composite = new CompositeIterable<String>(c1, c2);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testExtraElement1() {
- Collection<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- Iterable<String> composite = new CompositeIterable<String>(c1, "4");
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testExtraElement2() {
- Collection<String> c1 = new ArrayList<String>();
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- Iterable<String> composite = new CompositeIterable<String>("0", c1);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testCollectionOfIterables() {
- Collection<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- Collection<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
-
- Collection<Iterable<String>> collection = new ArrayList<Iterable<String>>();
- collection.add(c1);
- collection.add(c2);
- Iterable<String> composite = new CompositeIterable<String>(collection);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testToString() {
- Collection<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- Collection<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
-
- @SuppressWarnings("unchecked")
- Iterable<String> composite = new CompositeIterable<String>(c1, c2);
- assertNotNull(composite.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeListIterableTests.java
deleted file mode 100644
index baf06cf3fb..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/CompositeListIterableTests.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListListIterable;
-
-@SuppressWarnings("nls")
-public class CompositeListIterableTests extends TestCase {
-
- public CompositeListIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- List<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
-
- @SuppressWarnings("unchecked")
- Iterable<String> composite = new CompositeListIterable<String>(c1, c2);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testExtraElement1() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- Iterable<String> composite = new CompositeListIterable<String>(c1, "4");
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testExtraElement2() {
- List<String> c1 = new ArrayList<String>();
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- Iterable<String> composite = new CompositeListIterable<String>("0", c1);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testCollectionOfIterables() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- List<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
-
- List<ListIterable<String>> collection = new ArrayList<ListIterable<String>>();
- collection.add(new ListListIterable<String>(c1));
- collection.add(new ListListIterable<String>(c2));
- Iterable<String> composite = new CompositeListIterable<String>(collection);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testToString() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
-
- List<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
-
- @SuppressWarnings("unchecked")
- Iterable<String> composite = new CompositeListIterable<String>(c1, c2);
- assertNotNull(composite.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyIterableTests.java
deleted file mode 100644
index 1afe2303eb..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyIterableTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class EmptyIterableTests extends TestCase {
-
- public EmptyIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- for (String s : EmptyIterable.<String>instance()) {
- fail("bogus element: " + s);
- }
- }
-
- public void testToString() {
- assertNotNull(EmptyIterable.instance().toString());
- }
-
- public void testSerialization() throws Exception {
- Iterable<String> iterable = EmptyIterable.instance();
- assertSame(iterable, TestTools.serialize(iterable));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyListIterableTests.java
deleted file mode 100644
index 761555cbbe..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/EmptyListIterableTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class EmptyListIterableTests extends TestCase {
-
- public EmptyListIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- for (String s : EmptyListIterable.<String>instance()) {
- fail("bogus element: " + s);
- }
- }
-
- public void testToString() {
- assertNotNull(EmptyListIterable.instance().toString());
- }
-
- public void testSerialization() throws Exception {
- Iterable<String> iterable = EmptyListIterable.instance();
- assertSame(iterable, TestTools.serialize(iterable));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/FilteringIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/FilteringIterableTests.java
deleted file mode 100644
index fa1b5613f3..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/FilteringIterableTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-
-@SuppressWarnings("nls")
-public class FilteringIterableTests extends TestCase {
- private static final String PREFIX = "prefix";
-
- public FilteringIterableTests(String name) {
- super(name);
- }
-
- public void testAccept() {
- int i = 0;
- for (String s : this.buildIterable()) {
- assertTrue(s.contains(PREFIX));
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testFilter() {
- Filter<String> filter = this.buildFilter();
- int i = 0;
- for (String s : new FilteringIterable<String>(this.buildNestedIterable(), filter)) {
- assertTrue(s.contains(PREFIX));
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testToString() {
- assertNotNull(this.buildIterable().toString());
- }
-
- public void testMissingFilter() {
- boolean exCaught = false;
- Iterable<String> iterable = new FilteringIterable<String>(this.buildNestedIterable());
- try {
- Iterator<String> iterator = iterable.iterator();
- fail("bogus iterator: " + iterator);
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private Iterable<String> buildIterable() {
- return this.buildFilteringIterable(this.buildNestedIterable());
- }
-
- private Iterable<String> buildFilteringIterable(Iterable<String> nestedIterable) {
- return new FilteringIterable<String>(nestedIterable) {
- @Override
- protected boolean accept(String s) {
- return s.startsWith(PREFIX);
- }
- };
- }
-
- private Filter<String> buildFilter() {
- return new Filter<String>() {
- public boolean accept(String s) {
- return s.startsWith(PREFIX);
- }
- };
- }
-
- private Iterable<String> buildNestedIterable() {
- Collection<String> c = new ArrayList<String>();
- c.add(PREFIX + "1");
- c.add(PREFIX + "2");
- c.add(PREFIX + "3");
- c.add("4");
- c.add(PREFIX + "5");
- c.add(PREFIX + "6");
- c.add(PREFIX + "7");
- c.add("8");
- return c;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/GraphIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/GraphIterableTests.java
deleted file mode 100644
index bb39c41b85..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/GraphIterableTests.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.GraphIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.GraphIterator;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class GraphIterableTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<GraphNode> nodes = new ArrayList<GraphNode>();
-
- public GraphIterableTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testNeighbors1() {
- for (GraphNode gn : this.buildGraphIterable1()) {
- assertTrue(this.nodes.contains(gn));
- }
- }
-
- private Iterable<GraphNode> buildGraphIterable1() {
- return new GraphIterable<GraphNode>(this.buildGraphRoot()) {
- @Override
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- public void testNeighbors2() {
- for (GraphNode gn : this.buildGraphIterable2()) {
- assertTrue(this.nodes.contains(gn));
- }
- }
-
- private Iterable<GraphNode> buildGraphIterable2() {
- return new GraphIterable<GraphNode>(this.buildGraphRoot(), this.buildMisterRogers());
- }
-
- public void testNeighbors3() {
- for (GraphNode gn : this.buildGraphIterable3()) {
- assertTrue(this.nodes.contains(gn));
- }
- }
-
- private Iterable<GraphNode> buildGraphIterable3() {
- return new GraphIterable<GraphNode>(new GraphNode[] { this.buildGraphRoot() }) {
- @Override
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- public void testNeighbors4() {
- for (GraphNode gn : this.buildGraphIterable4()) {
- assertTrue(this.nodes.contains(gn));
- }
- }
-
- private Iterable<GraphNode> buildGraphIterable4() {
- return new GraphIterable<GraphNode>(new GraphNode[] { this.buildGraphRoot() }, this.buildMisterRogers());
- }
-
- public void testToString() {
- assertNotNull(this.buildGraphIterable1().toString());
- }
-
- public void testMissingMisterRogers() {
- boolean exCaught = false;
- try {
- for (GraphNode gn : new GraphIterable<GraphNode>(this.buildGraphRoot())) {
- assertTrue(this.nodes.contains(gn));
- }
- fail();
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private GraphIterator.MisterRogers<GraphNode> buildMisterRogers() {
- return new GraphIterator.MisterRogers<GraphNode>() {
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- private GraphNode buildGraphRoot() {
- GraphNode ncNode = new GraphNode("North Carolina");
- GraphNode vaNode = new GraphNode("Virginia");
- GraphNode scNode = new GraphNode("South Carolina");
- GraphNode gaNode = new GraphNode("Georgia");
- GraphNode flNode = new GraphNode("Florida");
- GraphNode alNode = new GraphNode("Alabama");
- GraphNode msNode = new GraphNode("Mississippi");
- GraphNode tnNode = new GraphNode("Tennessee");
-
- ncNode.setNeighbors(new GraphNode[] { vaNode, scNode, gaNode, tnNode });
- vaNode.setNeighbors(new GraphNode[] { ncNode, tnNode });
- scNode.setNeighbors(new GraphNode[] { ncNode, gaNode });
- gaNode.setNeighbors(new GraphNode[] { ncNode, scNode, flNode, alNode, tnNode });
- flNode.setNeighbors(new GraphNode[] { gaNode });
- alNode.setNeighbors(new GraphNode[] { gaNode, msNode, tnNode });
- msNode.setNeighbors(new GraphNode[] { alNode, tnNode });
- tnNode.setNeighbors(new GraphNode[] { vaNode, ncNode, gaNode, alNode, msNode });
-
- return ncNode;
- }
-
- public class GraphNode {
- private String name;
-
- private Collection<GraphNode> neighbors = new ArrayList<GraphNode>();
-
- public GraphNode(String name) {
- super();
- GraphIterableTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- void setNeighbors(GraphNode[] neighbors) {
- this.neighbors = CollectionTools.list(neighbors);
- }
-
- public Iterator<GraphNode> neighbors() {
- return this.neighbors.iterator();
- }
-
- public int neighborsSize() {
- return this.neighbors.size();
- }
-
- @Override
- public String toString() {
- return "GraphNode(" + this.name + ")";
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/JptUtilityIterablesTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/JptUtilityIterablesTests.java
deleted file mode 100644
index 6da560d319..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/JptUtilityIterablesTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityIterablesTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityIterablesTests.class.getPackage().getName());
-
- suite.addTestSuite(ArrayIterableTests.class);
- suite.addTestSuite(ArrayListIterableTests.class);
- suite.addTestSuite(ChainIterableTests.class);
- suite.addTestSuite(CompositeIterableTests.class);
- suite.addTestSuite(CompositeListIterableTests.class);
- suite.addTestSuite(EmptyIterableTests.class);
- suite.addTestSuite(EmptyListIterableTests.class);
- suite.addTestSuite(FilteringIterableTests.class);
- suite.addTestSuite(SuperIterableWrapperTests.class);
- suite.addTestSuite(GraphIterableTests.class);
- suite.addTestSuite(LiveCloneIterableTests.class);
- suite.addTestSuite(LiveCloneListIterableTests.class);
- suite.addTestSuite(PeekableIterableTests.class);
- suite.addTestSuite(QueueIterableTests.class);
- suite.addTestSuite(ReadOnlyCompositeListIterableTests.class);
- suite.addTestSuite(ReadOnlyIterableTests.class);
- suite.addTestSuite(ReadOnlyListIterableTests.class);
- suite.addTestSuite(SingleElementIterableTests.class);
- suite.addTestSuite(SingleElementListIterableTests.class);
- suite.addTestSuite(SnapshotCloneIterableTests.class);
- suite.addTestSuite(SnapshotCloneListIterableTests.class);
- suite.addTestSuite(StackIterableTests.class);
- suite.addTestSuite(TransformationIterableTests.class);
- suite.addTestSuite(TransformationListIterableTests.class);
- suite.addTestSuite(TreeIterableTests.class);
-
- return suite;
- }
-
- private JptUtilityIterablesTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneIterableTests.java
deleted file mode 100644
index 96fde7ffde..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneIterableTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-
-@SuppressWarnings("nls")
-public class LiveCloneIterableTests extends CloneIterableTests {
-
- public LiveCloneIterableTests(String name) {
- super(name);
- }
-
- @Override
- public void testIterator() {
- super.testIterator();
- // iterable should now return only 3 strings (since it's "live")
- int i = 0;
- for (String s : this.iterable) {
- assertEquals(String.valueOf(i++), s);
- }
- assertEquals(3, i);
- }
-
- @Override
- public void testRemove() {
- super.testRemove();
- // "live" clone iterable will no longer contain the element removed from the
- // original collection
- assertFalse(CollectionTools.contains(this.iterable, "three"));
- }
-
- @Override
- public void testRemover() {
- super.testRemover();
- // "live" clone iterable will no longer contain the element removed from the
- // original collection
- assertFalse(CollectionTools.contains(this.iterable, "three"));
- }
-
- @Override
- Iterable<String> buildIterable(List<String> c) {
- return new LiveCloneIterable<String>(c);
- }
-
- @Override
- Iterable<String> buildRemovingIterable(final List<String> c) {
- return new LiveCloneIterable<String>(c) {
- @Override
- protected void remove(String current) {
- c.remove(current);
- }
- };
- }
-
- @Override
- Iterable<String> buildIterableWithRemover(List<String> c) {
- return new LiveCloneIterable<String>(c, this.buildRemover(c));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneListIterableTests.java
deleted file mode 100644
index 0d70c000ea..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/LiveCloneListIterableTests.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-
-@SuppressWarnings("nls")
-public class LiveCloneListIterableTests extends LiveCloneIterableTests {
-
- public LiveCloneListIterableTests(String name) {
- super(name);
- }
-
- public void testAdd() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildRemovingIterable(collection);
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("two")) {
- iterator.add(added);
- }
- }
- assertTrue(collection.contains(added));
- // "live" clone iterable will contain the element added to the
- // original collection
- assertTrue(CollectionTools.contains(this.iterable, added));
- }
-
- public void testMissingMutatorAdd() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildIterable(collection);
- assertNotNull(this.iterable.toString());
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- boolean exCaught = false;
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("three")) {
- try {
- iterator.add(added);
- fail();
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- public void testSet() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildRemovingIterable(collection);
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("two")) {
- iterator.set(added);
- }
- }
- assertTrue(collection.contains(added));
- assertFalse(collection.contains("two"));
- // "live" clone iterable will contain the element added to the
- // original collection
- assertTrue(CollectionTools.contains(this.iterable, added));
- assertFalse(CollectionTools.contains(this.iterable, "two"));
- }
-
- public void testMissingMutatorSet() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildIterable(collection);
- assertNotNull(this.iterable.toString());
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- boolean exCaught = false;
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("three")) {
- try {
- iterator.set(added);
- fail();
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- @Override
- Iterable<String> buildIterable(List<String> c) {
- return new LiveCloneListIterable<String>(c);
- }
-
- @Override
- Iterable<String> buildRemovingIterable(final List<String> c) {
- return new LiveCloneListIterable<String>(c) {
- @Override
- protected void add(int index, String element) {
- c.add(index, element);
- }
- @Override
- protected void remove(int index) {
- c.remove(index);
- }
- @Override
- protected void set(int index, String element) {
- c.set(index, element);
- }
- };
- }
-
- @Override
- Iterable<String> buildIterableWithRemover(List<String> c) {
- return new LiveCloneListIterable<String>(c, this.buildMutator(c));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/PeekableIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/PeekableIterableTests.java
deleted file mode 100644
index 634992e5db..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/PeekableIterableTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.PeekableIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.PeekableIterator;
-
-@SuppressWarnings("nls")
-public class PeekableIterableTests extends TestCase {
-
- public PeekableIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- PeekableIterable<String> iterable = this.buildIterable();
- PeekableIterator<String> iterator = iterable.iterator();
- assertEquals("one", iterator.peek());
- }
-
- public void testToString() {
- assertNotNull(this.buildIterable().toString());
- }
-
- private PeekableIterable<String> buildIterable() {
- return new PeekableIterable<String>(this.buildNestedIterable());
- }
-
- private Iterable<String> buildNestedIterable() {
- return new ArrayIterable<String>(this.buildArray());
- }
-
- private String[] buildArray() {
- return new String[] {"one", "two", "three"};
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/QueueIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/QueueIterableTests.java
deleted file mode 100644
index 649f336336..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/QueueIterableTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Queue;
-import org.eclipse.jpt.common.utility.internal.SimpleQueue;
-import org.eclipse.jpt.common.utility.internal.iterables.QueueIterable;
-
-@SuppressWarnings("nls")
-public class QueueIterableTests extends TestCase {
-
- public QueueIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- Iterable<String> iterable = this.buildIterable();
- for (String s : iterable) {
- assertNotNull(s);
- }
- }
-
- public void testToString() {
- assertNotNull(this.buildIterable().toString());
- }
-
- private Iterable<String> buildIterable() {
- return new QueueIterable<String>(this.buildQueue());
- }
-
- private Queue<String> buildQueue() {
- Queue<String> q = new SimpleQueue<String>();
- q.enqueue("foo");
- q.enqueue("bar");
- q.enqueue("baz");
- return q;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyCompositeListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyCompositeListIterableTests.java
deleted file mode 100644
index f217b39b2d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyCompositeListIterableTests.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ReadOnlyCompositeListIterable;
-
-@SuppressWarnings("nls")
-public class ReadOnlyCompositeListIterableTests extends TestCase {
-
- public ReadOnlyCompositeListIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
- ListIterable<String> li1 = new ListListIterable<String>(c1);
-
- List<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
- ListIterable<String> li2 = new ListListIterable<String>(c2);
-
- @SuppressWarnings("unchecked")
- Iterable<String> composite = new ReadOnlyCompositeListIterable<String>(li1, li2);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testExtraElement1() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
- ListIterable<String> li1 = new ListListIterable<String>(c1);
-
- Iterable<String> composite = new ReadOnlyCompositeListIterable<String>(li1, "4");
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testExtraElement2() {
- List<String> c1 = new ArrayList<String>();
- c1.add("1");
- c1.add("2");
- c1.add("3");
- ListIterable<String> li1 = new ListListIterable<String>(c1);
-
- Iterable<String> composite = new ReadOnlyCompositeListIterable<String>("0", li1);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testCollectionOfIterables() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
- ListIterable<String> li1 = new ListListIterable<String>(c1);
-
- List<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
- ListIterable<String> li2 = new ListListIterable<String>(c2);
-
- List<ListIterable<String>> collection = new ArrayList<ListIterable<String>>();
- collection.add(li1);
- collection.add(li2);
- ListIterable<ListIterable<String>> li = new ListListIterable<ListIterable<String>>(collection);
-
- Iterable<String> composite = new ReadOnlyCompositeListIterable<String>(li);
- int i = 0;
- for (String s : composite) {
- assertEquals(String.valueOf(i++), s);
- }
- }
-
- public void testToString() {
- List<String> c1 = new ArrayList<String>();
- c1.add("0");
- c1.add("1");
- c1.add("2");
- c1.add("3");
- ListIterable<String> li1 = new ListListIterable<String>(c1);
-
- List<String> c2 = new ArrayList<String>();
- c2.add("4");
- c2.add("5");
- c2.add("6");
- c2.add("7");
- ListIterable<String> li2 = new ListListIterable<String>(c2);
-
- @SuppressWarnings("unchecked")
- Iterable<String> composite = new ReadOnlyCompositeListIterable<String>(li1, li2);
- assertNotNull(composite.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyIterableTests.java
deleted file mode 100644
index 4399851f65..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyIterableTests.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ReadOnlyIterable;
-
-@SuppressWarnings("nls")
-public class ReadOnlyIterableTests extends TestCase {
-
- public ReadOnlyIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- Iterator<String> nestedIterator = this.buildVector().iterator();
- for (String s : this.buildReadOnlyIterable()) {
- assertEquals(nestedIterator.next(), s);
- }
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildReadOnlyIterable().iterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- public void testToString() {
- assertNotNull(this.buildReadOnlyIterable().toString());
- }
-
- private Iterable<String> buildReadOnlyIterable() {
- return new ReadOnlyIterable<String>(this.buildVector());
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyListIterableTests.java
deleted file mode 100644
index 8a923ff3e4..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/ReadOnlyListIterableTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ReadOnlyListIterable;
-
-@SuppressWarnings("nls")
-public class ReadOnlyListIterableTests extends TestCase {
-
- public ReadOnlyListIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- Iterator<String> nestedIterator = this.buildVector().iterator();
- for (String s : this.buildReadOnlyListIterable()) {
- assertEquals(nestedIterator.next(), s);
- }
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildReadOnlyListIterable().iterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- public void testToString() {
- assertNotNull(this.buildReadOnlyListIterable().toString());
- }
-
- private Iterable<String> buildReadOnlyListIterable() {
- return new ReadOnlyListIterable<String>(this.buildNestedListIterable());
- }
-
- private ListIterable<String> buildNestedListIterable() {
- return new ListListIterable<String>(this.buildVector());
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementIterableTests.java
deleted file mode 100644
index 49061d3773..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementIterableTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-
-@SuppressWarnings("nls")
-public class SingleElementIterableTests extends TestCase {
-
- public SingleElementIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- for (String s : this.buildSingleElementIterable()) {
- assertEquals(this.singleElement(), s);
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildSingleElementIterable().iterator();
- String string = stream.next();
- try {
- string = stream.next();
- fail("bogus element: " + string);
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildSingleElementIterable().iterator(); stream.hasNext(); ) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- protected Iterable<String> buildSingleElementIterable() {
- return new SingleElementIterable<String>(this.singleElement());
- }
-
- protected String singleElement() {
- return "single element";
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementListIterableTests.java
deleted file mode 100644
index d11520f7de..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SingleElementListIterableTests.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-
-@SuppressWarnings("nls")
-public class SingleElementListIterableTests extends TestCase {
-
- public SingleElementListIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- for (String s : this.buildSingleElementListIterable()) {
- assertEquals(this.singleElement(), s);
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildSingleElementListIterable().iterator();
- String string = stream.next();
- try {
- string = stream.next();
- fail("bogus element: " + string);
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildSingleElementListIterable().iterator(); stream.hasNext(); ) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testToString() {
- assertNotNull(this.buildSingleElementListIterable().toString());
- }
-
- protected Iterable<String> buildSingleElementListIterable() {
- return new SingleElementListIterable<String>(this.singleElement());
- }
-
- protected String singleElement() {
- return "single element";
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneIterableTests.java
deleted file mode 100644
index 384006c45e..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneIterableTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-
-@SuppressWarnings("nls")
-public class SnapshotCloneIterableTests extends CloneIterableTests {
-
- public SnapshotCloneIterableTests(String name) {
- super(name);
- }
-
- @Override
- public void testIterator() {
- super.testIterator();
- // "snapshot" iterable should still return 4 strings (since the original collection was cloned)
- int i = 0;
- for (String s : this.iterable) {
- assertEquals(String.valueOf(i++), s);
- }
- assertEquals(4, i);
- }
-
- @Override
- public void testRemove() {
- super.testRemove();
- // "snapshot" clone iterable will still contain the element removed from the
- // original collection
- assertTrue(CollectionTools.contains(this.iterable, "three"));
- }
-
- @Override
- public void testRemover() {
- super.testRemover();
- // "snapshot" clone iterable will still contain the element removed from the
- // original collection
- assertTrue(CollectionTools.contains(this.iterable, "three"));
- }
-
- @Override
- Iterable<String> buildIterable(List<String> c) {
- return new SnapshotCloneIterable<String>(c);
- }
-
- @Override
- Iterable<String> buildRemovingIterable(final List<String> c) {
- return new SnapshotCloneIterable<String>(c) {
- @Override
- protected void remove(String current) {
- c.remove(current);
- }
- };
- }
-
- @Override
- Iterable<String> buildIterableWithRemover(List<String> c) {
- return new SnapshotCloneIterable<String>(c, this.buildRemover(c));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneListIterableTests.java
deleted file mode 100644
index a6c5c1376b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SnapshotCloneListIterableTests.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneListIterable;
-
-@SuppressWarnings("nls")
-public class SnapshotCloneListIterableTests extends SnapshotCloneIterableTests {
-
- public SnapshotCloneListIterableTests(String name) {
- super(name);
- }
-
- public void testAdd() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildRemovingIterable(collection);
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("two")) {
- iterator.add(added);
- }
- }
- assertTrue(collection.contains(added));
- // "snapshot" clone iterable not will contain the element added to the
- // original collection
- assertFalse(CollectionTools.contains(this.iterable, added));
- }
-
- public void testMissingMutatorAdd() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildIterable(collection);
- assertNotNull(this.iterable.toString());
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- boolean exCaught = false;
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("three")) {
- try {
- iterator.add(added);
- fail();
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- public void testSet() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildRemovingIterable(collection);
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- assertTrue(CollectionTools.contains(this.iterable, "two"));
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("two")) {
- iterator.set(added);
- }
- }
- assertTrue(collection.contains(added));
- assertFalse(collection.contains("two"));
- // "snapshot" clone iterable will not be changed
- assertFalse(CollectionTools.contains(this.iterable, added));
- assertTrue(CollectionTools.contains(this.iterable, "two"));
- }
-
- public void testMissingMutatorSet() {
- final List<String> collection = this.buildCollection();
- this.iterable = this.buildIterable(collection);
- assertNotNull(this.iterable.toString());
-
- String added = "xxxx";
- assertFalse(CollectionTools.contains(this.iterable, added));
- boolean exCaught = false;
- for (ListIterator<String> iterator = (ListIterator<String>) this.iterable.iterator(); iterator.hasNext(); ) {
- if (iterator.next().equals("three")) {
- try {
- iterator.set(added);
- fail();
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- @Override
- Iterable<String> buildIterable(List<String> c) {
- return new SnapshotCloneListIterable<String>(c);
- }
-
- @Override
- Iterable<String> buildRemovingIterable(final List<String> c) {
- return new SnapshotCloneListIterable<String>(c) {
- @Override
- protected void add(int index, String element) {
- c.add(index, element);
- }
- @Override
- protected void remove(int index) {
- c.remove(index);
- }
- @Override
- protected void set(int index, String element) {
- c.set(index, element);
- }
- };
- }
-
- @Override
- Iterable<String> buildIterableWithRemover(List<String> c) {
- return new SnapshotCloneListIterable<String>(c, this.buildMutator(c));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/StackIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/StackIterableTests.java
deleted file mode 100644
index 70a95bcd8a..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/StackIterableTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.SimpleStack;
-import org.eclipse.jpt.common.utility.internal.Stack;
-import org.eclipse.jpt.common.utility.internal.iterables.StackIterable;
-
-@SuppressWarnings("nls")
-public class StackIterableTests extends TestCase {
-
- public StackIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- Iterator<String> iterator = this.buildIterable().iterator();
- assertEquals("three", iterator.next());
- assertEquals("two", iterator.next());
- assertEquals("one", iterator.next());
- }
-
- public void testToString() {
- assertNotNull(this.buildIterable().toString());
- }
-
- private Iterable<String> buildIterable() {
- return new StackIterable<String>(this.buildStack());
- }
-
- private Stack<String> buildStack() {
- Stack<String> stack = new SimpleStack<String>();
- stack.push("one");
- stack.push("two");
- stack.push("three");
- return stack;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SuperIterableWrapperTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SuperIterableWrapperTests.java
deleted file mode 100644
index c65608ef5d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/SuperIterableWrapperTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
-
-@SuppressWarnings("nls")
-public class SuperIterableWrapperTests extends TestCase {
-
- public SuperIterableWrapperTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- String concat = "";
- for (String s : list) {
- concat += s;
- }
- assertEquals("foobarbaz", concat);
-
- Iterable<Object> iterable = new SuperIterableWrapper<Object>(list);
- concat = "";
- for (Object s : iterable) {
- concat += s;
- }
- assertEquals("foobarbaz", concat);
- }
-
- public void testToString() {
- Iterable<Object> iterable = new SuperIterableWrapper<Object>(Collections.emptyList());
- assertNotNull(iterable.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationIterableTests.java
deleted file mode 100644
index 5a16de67c8..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationIterableTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-
-@SuppressWarnings("nls")
-public class TransformationIterableTests extends TestCase {
-
- public TransformationIterableTests(String name) {
- super(name);
- }
-
- public void testTransform1() {
- int i = 1;
- for (Integer integer : this.buildIterable1()) {
- assertEquals(i++, integer.intValue());
- }
- }
-
- private Iterable<Integer> buildIterable1() {
- return this.buildTransformationIterable1(this.buildNestedIterable());
- }
-
- private Iterable<Integer> buildTransformationIterable1(Iterable<String> nestedIterable) {
- // transform each string into an integer with a value of the string's length
- return new TransformationIterable<String, Integer>(nestedIterable) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- public void testTransform2() {
- int i = 1;
- for (Integer integer : this.buildIterable2()) {
- assertEquals(i++, integer.intValue());
- }
- }
-
- private Iterable<Integer> buildIterable2() {
- return this.buildTransformationIterable2(this.buildNestedIterable());
- }
-
- private Iterable<Integer> buildTransformationIterable2(Iterable<String> nestedIterable) {
- // transform each string into an integer with a value of the string's length
- return new TransformationIterable<String, Integer>(nestedIterable, this.buildTransformer());
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Iterable<String> buildNestedIterable() {
- Collection<String> c = new ArrayList<String>();
- c.add("1");
- c.add("22");
- c.add("333");
- c.add("4444");
- c.add("55555");
- c.add("666666");
- c.add("7777777");
- c.add("88888888");
- return c;
- }
-
- public void testToString() {
- assertNotNull(this.buildIterable1().toString());
- }
-
- public void testMissingTransformer() {
- Iterable<Integer> iterable = new TransformationIterable<String, Integer>(this.buildNestedIterable());
- boolean exCaught = false;
- try {
- int i = 1;
- for (Integer integer : iterable) {
- assertEquals(i++, integer.intValue());
- }
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationListIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationListIterableTests.java
deleted file mode 100644
index 6ac6a16d07..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TransformationListIterableTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationListIterable;
-
-@SuppressWarnings("nls")
-public class TransformationListIterableTests extends TestCase {
-
- public TransformationListIterableTests(String name) {
- super(name);
- }
-
- public void testTransform1() {
- int i = 1;
- for (Integer integer : this.buildIterable1()) {
- assertEquals(i++, integer.intValue());
- }
- }
-
- private Iterable<Integer> buildIterable1() {
- return this.buildTransformationListIterable1(this.buildNestedList());
- }
-
- private Iterable<Integer> buildTransformationListIterable1(List<String> nestedList) {
- // transform each string into an integer with a value of the string's length
- return new TransformationListIterable<String, Integer>(nestedList) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- public void testTransform2() {
- int i = 1;
- for (Integer integer : this.buildIterable2()) {
- assertEquals(i++, integer.intValue());
- }
- }
-
- private Iterable<Integer> buildIterable2() {
- return this.buildTransformationListIterable2(this.buildNestedList());
- }
-
- private Iterable<Integer> buildTransformationListIterable2(List<String> nestedList) {
- // transform each string into an integer with a value of the string's length
- return new TransformationListIterable<String, Integer>(nestedList, this.buildTransformer());
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private List<String> buildNestedList() {
- List<String> c = new ArrayList<String>();
- c.add("1");
- c.add("22");
- c.add("333");
- c.add("4444");
- c.add("55555");
- c.add("666666");
- c.add("7777777");
- c.add("88888888");
- return c;
- }
-
- public void testToString() {
- assertNotNull(this.buildIterable1().toString());
- }
-
- public void testMissingTransformer() {
- Iterable<Integer> iterable = new TransformationListIterable<String, Integer>(this.buildNestedList());
- boolean exCaught = false;
- try {
- int i = 1;
- for (Integer integer : iterable) {
- assertEquals(i++, integer.intValue());
- }
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TreeIterableTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TreeIterableTests.java
deleted file mode 100644
index dda3533e2b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterables/TreeIterableTests.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterables.TreeIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class TreeIterableTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<TreeNode> nodes = new ArrayList<TreeNode>();
-
- public TreeIterableTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator1() {
- for (TreeNode tn : this.buildTreeIterable1()) {
- assertTrue(this.nodes.contains(tn));
- }
- }
-
- public void testIterator2() {
- for (TreeNode tn : this.buildTreeIterable2()) {
- assertTrue(this.nodes.contains(tn));
- }
- }
-
- public void testMidwife1() {
- for (TreeNode tn : new TreeIterable<TreeNode>(this.buildTree(), this.buildMidwife())) {
- assertTrue(this.nodes.contains(tn));
- }
- }
-
- public void testMidwife2() {
- for (TreeNode tn : new TreeIterable<TreeNode>(new TreeNode[] { this.buildTree() }, this.buildMidwife())) {
- assertTrue(this.nodes.contains(tn));
- }
- }
-
- public void testToString() {
- assertNotNull(this.buildTreeIterable1().toString());
- }
-
- public void testMissingMidwife() {
- boolean exCaught = false;
- try {
- for (TreeNode tn : new TreeIterable<TreeNode>(this.buildTree())) {
- assertTrue(this.nodes.contains(tn));
- }
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private Iterable<TreeNode> buildTreeIterable1() {
- return new TreeIterable<TreeNode>(this.buildTree()) {
- @Override
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- private Iterable<TreeNode> buildTreeIterable2() {
- return new TreeIterable<TreeNode>(new TreeNode[] { this.buildTree() }) {
- @Override
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- private TreeIterator.Midwife<TreeNode> buildMidwife() {
- return new TreeIterator.Midwife<TreeNode>() {
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- private TreeNode buildTree() {
- TreeNode root = new TreeNode("root");
- TreeNode child1 = new TreeNode(root, "child 1");
- new TreeNode(child1, "grandchild 1A");
- TreeNode child2 = new TreeNode(root, "child 2");
- new TreeNode(child2, "grandchild 2A");
- TreeNode grandchild2B = new TreeNode(child2, "grandchild 2B");
- new TreeNode(grandchild2B, "great-grandchild 2B1");
- new TreeNode(grandchild2B, "great-grandchild 2B2");
- TreeNode grandchild2C = new TreeNode(child2, "grandchild 2C");
- new TreeNode(grandchild2C, "great-grandchild 2C1");
- new TreeNode(root, "child 3");
- return root;
- }
-
- public class TreeNode {
- private String name;
- private Collection<TreeNode> children = new ArrayList<TreeNode>();
-
- public TreeNode(String name) {
- super();
- TreeIterableTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public TreeNode(TreeNode parent, String name) {
- this(name);
- parent.addChild(this);
- }
-
- public String getName() {
- return this.name;
- }
-
- private void addChild(TreeNode child) {
- this.children.add(child);
- }
-
- public Iterator<TreeNode> children() {
- return this.children.iterator();
- }
-
- public int childrenSize() {
- return this.children.size();
- }
-
- @Override
- public String toString() {
- return "TreeNode(" + this.name + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayIteratorTests.java
deleted file mode 100644
index 8c8cda0ae7..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayIteratorTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class ArrayIteratorTests extends TestCase {
-
- public ArrayIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext(); ) {
- stream.next();
- i++;
- }
- assertEquals(this.buildArray().length, i);
- }
-
- public void testNext() {
- int i = 1;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext(); ) {
- assertEquals("bogus element", i++, Integer.parseInt(stream.next()));
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext(); ) {
- if (stream.next().equals("3")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalArgumentException() {
- this.triggerIllegalArgumentException(-1, 1);
- this.triggerIllegalArgumentException(8, 1);
- this.triggerIllegalArgumentException(0, -1);
- this.triggerIllegalArgumentException(0, 9);
- }
-
- public void testGenerics() {
- Integer[] integers = new Integer[3];
- integers[0] = new Integer(0);
- integers[1] = new Integer(1);
- integers[2] = new Integer(2);
- int i = 0;
- for (Iterator<Number> stream = this.buildGenericIterator(integers); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(integers.length, i);
- }
-
- Iterator<Number> buildGenericIterator(Integer[] integers) {
- return new ArrayIterator<Number>(integers);
- }
-
- public void testVarargs() {
- int i = 0;
- for (Iterator<Number> stream = this.buildVarArgIterator(); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(3, i);
- }
-
- Iterator<Number> buildVarArgIterator() {
- return new ArrayIterator<Number>(new Integer(0), new Integer(1), new Integer(2));
- }
-
- void triggerIllegalArgumentException(int start, int length) {
- boolean exCaught = false;
- Iterator<String> stream = null;
- try {
- stream = this.buildIterator(start, length);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown: " + stream, exCaught);
- }
-
- Iterator<String> buildIterator() {
- return this.buildIterator(this.buildArray());
- }
-
- Iterator<String> buildIterator(String[] array) {
- return new ArrayIterator<String>(array);
- }
-
- Iterator<String> buildIterator(int start, int length) {
- return this.buildIterator(this.buildArray(), start, length);
- }
-
- Iterator<String> buildIterator(String[] array, int start, int length) {
- return new ArrayIterator<String>(array, start, length);
- }
-
- String[] buildArray() {
- return new String[] { "1", "2", "3", "4", "5", "6", "7", "8" };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayListIteratorTests.java
deleted file mode 100644
index cae1762c27..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ArrayListIteratorTests.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayListIterator;
-
-@SuppressWarnings("nls")
-public class ArrayListIteratorTests extends ArrayIteratorTests {
-
- public ArrayListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasPrevious() {
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- int i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(this.buildArray().length, i);
- }
-
- public void testPrevious() {
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- int i = this.buildArray().length;
- while (stream.hasPrevious()) {
- assertEquals("bogus element", i--, Integer.parseInt(stream.previous()));
- }
- }
-
- public void testNextIndex() {
- int i = 0;
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- assertEquals(i, stream.nextIndex());
- stream.next();
- i++;
- }
- assertEquals(i, stream.nextIndex());
- }
-
- public void testPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- assertEquals(i - 1, stream.previousIndex());
- stream.next();
- i++;
- }
- assertEquals(i - 1, stream.previousIndex());
- }
-
- @Override
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildListIterator();
- String string = null;
- try {
- string = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationExceptionAdd() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildListIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.add("3.5");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testUnsupportedOperationExceptionSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildListIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.set("three");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- Iterator<Number> buildGenericIterator(Integer[] integers) {
- return new ArrayListIterator<Number>(integers);
- }
-
- @Override
- Iterator<Number> buildVarArgIterator() {
- return new ArrayListIterator<Number>(new Integer(0), new Integer(1), new Integer(2));
- }
-
- private ListIterator<String> buildListIterator() {
- return this.buildListIterator(this.buildArray());
- }
-
- private ListIterator<String> buildListIterator(String[] array) {
- return new ArrayListIterator<String>(array);
- }
-
- @Override
- Iterator<String> buildIterator(String[] array) {
- return new ArrayListIterator<String>(array);
- }
-
- @Override
- Iterator<String> buildIterator(String[] array, int start, int length) {
- return new ArrayListIterator<String>(array, start, length);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ChainIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ChainIteratorTests.java
deleted file mode 100644
index b4cdcf1569..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ChainIteratorTests.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.AbstractCollection;
-import java.util.AbstractList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.ChainIterator;
-
-@SuppressWarnings("nls")
-public class ChainIteratorTests extends TestCase {
- private final static Class<?>[] VECTOR_HIERARCHY = { Vector.class, AbstractList.class, AbstractCollection.class, Object.class };
-
- public ChainIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(VECTOR_HIERARCHY.length, i);
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(VECTOR_HIERARCHY.length, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext(); i++) {
- assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next());
- }
- }
-
- public void testInnerNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildInnerIterator(); stream.hasNext(); i++) {
- assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Class<?>> stream = this.buildIterator();
- Class<?> javaClass = null;
- while (stream.hasNext()) {
- javaClass = stream.next();
- }
- try {
- javaClass = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + javaClass, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next() == AbstractCollection.class) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<Class<?>> buildIterator() {
- return this.buildChainIterator(Vector.class, this.buildLinker());
- }
-
- private Iterator<Class<?>> buildInnerIterator() {
- return this.buildInnerChainIterator(Vector.class);
- }
-
- private Iterator<Class<?>> buildChainIterator(Class<?> startLink, ChainIterator.Linker<Class<?>> linker) {
- return new ChainIterator<Class<?>>(startLink, linker);
- }
-
- private ChainIterator.Linker<Class<?>> buildLinker() {
- // chain up the class's hierarchy
- return new ChainIterator.Linker<Class<?>>() {
- public Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
- private Iterator<Class<?>> buildInnerChainIterator(Class<?> startLink) {
- // chain up the class's hierarchy
- return new ChainIterator<Class<?>>(startLink) {
- @Override
- protected Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
- public void testInvalidChainIterator() {
- // missing method override
- Iterator<Class<?>> iterator = new ChainIterator<Class<?>>(Vector.class);
- boolean exCaught = false;
- try {
- Class<?> c = iterator.next();
- fail("invalid class: " + c.getName());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneIteratorTests.java
deleted file mode 100644
index 19c45dfd35..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneIteratorTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CloneIteratorTests
- extends MultiThreadedTestCase
-{
- Collection<String> originalCollection;
-
- private Collection<String> concurrentCollection;
-
- public CloneIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalCollection = this.buildCollection();
- }
-
- public void testHasNext() {
- int originalSize = this.originalCollection.size();
- int i = 0;
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- stream.next();
- // should allow concurrent modification
- this.originalCollection.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalCollection.size());
- assertEquals(originalSize, i);
- }
-
- public void testNext() {
- Iterator<String> nestedIterator = this.originalCollection.iterator();
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildCloneIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemoveDefault() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testRemoveEliminator() {
- CloneIterator.Remover<String> eliminator = new CloneIterator.Remover<String>() {
- public void remove(String element) {
- CloneIteratorTests.this.originalCollection.remove(element);
- }
- };
- this.verifyRemove(new CloneIterator<String>(this.originalCollection, eliminator));
- }
-
- public void testRemoveSubclass() {
- this.verifyRemove(new CloneIterator<String>(this.originalCollection) {
- @Override
- protected void remove(String current) {
- CloneIteratorTests.this.originalCollection.remove(current);
- }
- });
- }
-
- /**
- * Test concurrent access: First build a clone iterator in a separate thread
- * that hangs momentarily during its construction; then modify the shared
- * collection in this thread. This would cause a
- * ConcurrentModificationException in the other thread if the clone iterator
- * were not synchronized on the original collection.
- */
- public void testConcurrentAccess() throws Exception {
- SlowCollection<String> slow = new SlowCollection<String>();
- this.populateCollection(slow);
- // using the unsynchronized collection will cause the test to fail
- // this.originalCollection = slow;
- this.originalCollection = Collections.synchronizedCollection(slow);
-
- this.concurrentCollection = new ArrayList<String>();
- Thread thread = this.buildThread(this.buildRunnable());
- thread.start();
- while ( ! slow.hasStartedClone()) {
- // wait for the other thread to start the clone...
- Thread.yield();
- }
- // ...then sneak in an extra element
- this.originalCollection.add("seventeen");
- thread.join();
- Collection<String> expected = new ArrayList<String>();
- this.populateCollection(expected);
- assertEquals(expected, this.concurrentCollection);
- }
-
- private Runnable buildRunnable() {
- return new TestRunnable() {
- @Override
- protected void run_() throws Throwable {
- CloneIteratorTests.this.loopWithCloneIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneIterator() {
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- this.concurrentCollection.add(stream.next());
- }
- }
-
- private void verifyRemove(Iterator<String> iterator) {
- Object removed = "three";
- assertTrue(this.originalCollection.contains(removed));
- // try to remove before calling #next()
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- while (iterator.hasNext()) {
- if (iterator.next().equals(removed)) {
- iterator.remove();
- // try to remove twice
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- }
- assertFalse(this.originalCollection.contains(removed));
- }
-
- private Iterator<String> buildCloneIterator() {
- return this.buildCloneIterator(this.originalCollection);
- }
-
- private Iterator<String> buildCloneIterator(Collection<String> c) {
- return new CloneIterator<String>(c);
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = this.buildEmptyCollection();
- this.populateCollection(c);
- return c;
- }
-
- protected Collection<String> buildEmptyCollection() {
- return new ArrayList<String>();
- }
-
- private void populateCollection(Collection<String> c) {
- c.add("one");
- c.add("two");
- c.add("three");
- c.add("four");
- c.add("five");
- c.add("six");
- c.add("seven");
- c.add("eight");
- }
-
- // ********** custom collection **********
- static class SlowCollection<E> extends ArrayList<E> {
- private static final long serialVersionUID = 1L;
- private boolean hasStartedClone = false;
-
- public SlowCollection() {
- super();
- }
-
- @Override
- public Object[] toArray() {
- this.setHasStartedClone(true);
- // take a little snooze before returning the array
- TestTools.sleep(100);
- return super.toArray();
- }
-
- synchronized void setHasStartedClone(boolean hasStartedClone) {
- this.hasStartedClone = hasStartedClone;
- }
-
- synchronized boolean hasStartedClone() {
- return this.hasStartedClone;
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneListIteratorTests.java
deleted file mode 100644
index 0f3a841306..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CloneListIteratorTests.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.common.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CloneListIteratorTests
- extends MultiThreadedTestCase
-{
- List<String> originalList;
-
- private List<String> concurrentList;
-
- public CloneListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalList = this.buildList();
- }
-
- public void testHasNext() {
- int originalSize = this.originalList.size();
- int i = 0;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- stream.next();
- // should allow concurrent modification
- this.originalList.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalList.size());
- assertEquals(originalSize, i);
- }
-
- public void testNext() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- }
-
- public void testIndex() {
- ListIterator<String> cloneListIterator = this.buildCloneListIterator();
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- for (int i = 0; i < 7; i++) {
- nestedListIterator.next();
- cloneListIterator.next();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
-
- for (int i = 0; i < 3; i++) {
- nestedListIterator.previous();
- cloneListIterator.previous();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
-
- while (nestedListIterator.hasNext()) {
- nestedListIterator.next();
- cloneListIterator.next();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
- }
-
- public void testHasPrevious() {
- int originalSize = this.originalList.size();
- int i = 0;
- ListIterator<String> stream = this.buildCloneListIterator();
- while (stream.hasNext()) {
- stream.next();
- this.originalList.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalList.size());
- originalSize = this.originalList.size();
- while (stream.hasPrevious()) {
- stream.previous();
- // should allow concurrent modification
- this.originalList.add("bar");
- i--;
- }
- assertTrue(originalSize != this.originalList.size());
- assertEquals(0, i);
- }
-
- public void testPrevious() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildCloneListIterator();
- while (stream.hasNext()) {
- nestedListIterator.next();
- stream.next();
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildCloneListIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
-
- exCaught = false;
- while (stream.hasPrevious()) {
- string = stream.previous();
- }
- try {
- string = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testModifyDefault() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
-
- exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.add("three and a half");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
-
- exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.set("another three");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testModifyMutatorNext() {
- this.verifyModifyNext(new CloneListIterator<String>(this.originalList, this.buildMutator()));
- }
-
- public void testModifyMutatorPrevious() {
- this.verifyModifyPrevious(new CloneListIterator<String>(this.originalList, this.buildMutator()));
- }
-
- private CloneListIterator.Mutator<String> buildMutator() {
- return new CloneListIterator.Mutator<String>() {
- public void add(int index, String o) {
- CloneListIteratorTests.this.originalList.add(index, o);
- }
-
- public void remove(int index) {
- CloneListIteratorTests.this.originalList.remove(index);
- }
-
- public void set(int index, String o) {
- CloneListIteratorTests.this.originalList.set(index, o);
- }
- };
- }
-
- public void testModifySubclassNext() {
- this.verifyModifyNext(this.buildSubclass());
- }
-
- public void testModifySubclassPrevious() {
- this.verifyModifyPrevious(this.buildSubclass());
- }
-
- private ListIterator<String> buildSubclass() {
- return new CloneListIterator<String>(this.originalList) {
- @Override
- protected void add(int currentIndex, String o) {
- CloneListIteratorTests.this.originalList.add(currentIndex, o);
- }
-
- @Override
- protected void remove(int currentIndex) {
- CloneListIteratorTests.this.originalList.remove(currentIndex);
- }
-
- @Override
- protected void set(int currentIndex, String o) {
- CloneListIteratorTests.this.originalList.set(currentIndex, o);
- }
- };
- }
-
- private void verifyModifyNext(ListIterator<String> iterator) {
- String removed = "three";
- String addedAfter = "five";
- String added = "five and a half";
- String replaced = "seven";
- String replacement = "another seven";
- assertTrue(this.originalList.contains(removed));
- assertTrue(this.originalList.contains(addedAfter));
- assertTrue(this.originalList.contains(replaced));
- // try to remove before calling #next()
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- while (iterator.hasNext()) {
- String next = iterator.next();
- if (next.equals(addedAfter)) {
- iterator.add(added);
- }
- if (next.equals(removed)) {
- iterator.remove();
- // try to remove twice
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
- if (next.equals(replaced)) {
- iterator.set(replacement);
- }
- }
- assertTrue(this.originalList.contains(added));
- assertFalse(this.originalList.contains(removed));
- assertFalse(this.originalList.contains(replaced));
- assertTrue(this.originalList.contains(replacement));
- }
-
- private void verifyModifyPrevious(ListIterator<String> iterator) {
- String removed = "three";
- String addedBefore = "five";
- String added = "four and a half";
- String replaced = "seven";
- String replacement = "another seven";
- assertTrue(this.originalList.contains(removed));
- assertTrue(this.originalList.contains(addedBefore));
- assertTrue(this.originalList.contains(replaced));
- while (iterator.hasNext()) {
- iterator.next();
- }
- while (iterator.hasPrevious()) {
- Object previous = iterator.previous();
- if (previous.equals(addedBefore)) {
- iterator.add(added);
- }
- if (previous.equals(removed)) {
- iterator.remove();
- // try to remove twice
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- if (previous.equals(replaced)) {
- iterator.set(replacement);
- }
- }
- assertTrue(this.originalList.contains(added));
- assertFalse(this.originalList.contains(removed));
- assertFalse(this.originalList.contains(replaced));
- assertTrue(this.originalList.contains(replacement));
- }
-
- private ListIterator<String> buildCloneListIterator() {
- return this.buildCloneListIterator(this.originalList);
- }
-
- private ListIterator<String> buildCloneListIterator(List<String> list) {
- return new CloneListIterator<String>(list);
- }
-
- private ListIterator<String> buildNestedListIterator() {
- return this.originalList.listIterator();
- }
-
- private List<String> buildList() {
- List<String> list = this.buildEmptyList();
- this.populateList(list);
- return list;
- }
-
- private void populateList(List<String> list) {
- list.add("zero");
- list.add("one");
- list.add("two");
- list.add("three");
- list.add("four");
- list.add("five");
- list.add("six");
- list.add("seven");
- list.add("eight");
- list.add("nine");
- }
-
- protected List<String> buildEmptyList() {
- return new ArrayList<String>();
- }
-
- /**
- * Test concurrent access: First build a clone iterator in a separate thread
- * that hangs momentarily during its construction; then modify the shared
- * collection in this thread. This would cause a
- * ConcurrentModificationException in the other thread if the clone iterator
- * were not synchronized on the original collection.
- */
- public void testConcurrentAccess() throws Exception {
- CloneIteratorTests.SlowCollection<String> slow = new CloneIteratorTests.SlowCollection<String>();
- this.populateList(slow);
- // using the unsynchronized list will cause the test to fail
- // this.originalList = slow;
- this.originalList = Collections.synchronizedList(slow);
-
- this.concurrentList = new ArrayList<String>();
- Thread thread = this.buildThread(this.buildRunnable());
- thread.start();
- while ( ! slow.hasStartedClone()) {
- // wait for the other thread to start the clone...
- Thread.yield();
- }
- // ...then sneak in an extra element
- this.originalList.add("seventeen");
- thread.join();
- List<String> expected = new ArrayList<String>();
- this.populateList(expected);
- assertEquals(expected, this.concurrentList);
- }
-
- private Runnable buildRunnable() {
- return new TestRunnable() {
- @Override
- protected void run_() throws Throwable {
- CloneListIteratorTests.this.loopWithCloneListIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneListIterator() {
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- this.concurrentList.add(stream.next());
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeIteratorTests.java
deleted file mode 100644
index 2a7dbd7c01..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeIteratorTests.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
-
-@SuppressWarnings("nls")
-public class CompositeIteratorTests extends TestCase {
-
- public CompositeIteratorTests(String name) {
- super(name);
- }
-
- public void testHasAnother() {
- this.verifyHasAnother(this.buildCompositeIterator());
- }
-
- public void testHasAnother2() {
- this.verifyHasAnother(this.buildCompositeIterator2());
- }
-
- public void testHasAnother3() {
- this.verifyHasAnother(this.buildCompositeIterator3());
- }
-
- void verifyHasAnother(Iterator<String> stream) {
- this.verifyHasAnother(8, stream);
- }
-
- void verifyHasAnother(int expected, Iterator<String> stream) {
- int i = 0;
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(expected, i);
- }
-
- public void testAnother() {
- this.verifyAnother(this.buildCompositeIterator());
- }
-
- public void testAnother2() {
- this.verifyAnother(this.buildCompositeIterator2());
- }
-
- public void testAnother3() {
- this.verifyAnother(this.buildCompositeIterator3());
- }
-
- void verifyAnother(Iterator<String> stream) {
- this.verifyAnother(1, stream);
- }
-
- void verifyAnother(int start, Iterator<String> stream) {
- int index = start;
- while (stream.hasNext()) {
- assertEquals("bogus element", String.valueOf(index++), stream.next().substring(0, 1));
- }
- }
-
- public void testRemove() {
- this.verifyRemove();
- }
-
- protected void verifyRemove() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- Iterator<String> stream = this.buildCompositeIterator(list.listIterator());
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.remove();
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to remove from the previous iterator
- stream.remove();
- }
- }
- stream.remove();
-
- assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size());
- assertFalse("element still in collection 1", list1.contains("333"));
- assertFalse("last element still in collection 1", list1.contains(lastElement1));
- assertTrue("wrong element removed from collection 1", list1.contains("22"));
-
- assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size());
- assertFalse("element still in collection 3", list3.contains("88888888"));
- assertTrue("wrong element removed from collection 3", list3.contains("666666"));
- }
-
- public void testSingleElement() {
- String item = "0";
- this.verifyHasAnother(9, this.buildCompositeIterator(item, this.buildCompositeIterator()));
- this.verifyAnother(0, this.buildCompositeIterator(item, this.buildCompositeIterator()));
- }
-
- public void testNoSuchElementException() {
- this.verifyNoSuchElementException(this.buildCompositeIterator());
- }
-
- void verifyNoSuchElementException(Iterator<String> stream) {
- boolean exCaught = false;
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- this.verifyUnsupportedOperationException(this.buildUnmodifiableCompositeIterator());
- }
-
- void verifyUnsupportedOperationException(Iterator<String> stream) {
- boolean exCaught = false;
- while (stream.hasNext()) {
- Object string = stream.next();
- if (string.equals("333")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- this.verifyIllegalStateException();
- }
-
- void verifyIllegalStateException() {
- this.verifyIllegalStateException(this.buildCompositeIterator());
- }
-
- void verifyIllegalStateException(Iterator<String> stream) {
- boolean exCaught = false;
- try {
- stream.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- public void testEmptyHasAnother1() {
- this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator1());
- }
-
- void verifyEmptyHasAnother(Iterator<String> stream) {
- int i = 0;
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testEmptyNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildEmptyCompositeIterator1());
- }
-
- public void testEmptyIllegalStateException1() {
- this.verifyEmptyIllegalStateException1();
- }
-
- void verifyEmptyIllegalStateException1() {
- this.verifyIllegalStateException(this.buildEmptyCompositeIterator1());
- }
-
- public void testEmptyHasAnother2() {
- this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyIllegalStateException2() {
- this.verifyEmptyIllegalStateException2();
- }
-
- void verifyEmptyIllegalStateException2() {
- this.verifyIllegalStateException(this.buildEmptyCompositeIterator2());
- }
-
- Iterator<String> buildCompositeIterator() {
- return this.buildCompositeIterator(this.buildIterators());
- }
-
- Iterator<String> buildEmptyCompositeIterator1() {
- return this.buildCompositeIterator(this.buildEmptyIterators1());
- }
-
- Iterator<String> buildEmptyCompositeIterator2() {
- return this.buildCompositeIterator(this.buildEmptyIterators2());
- }
-
- Iterator<String> buildUnmodifiableCompositeIterator() {
- return this.buildCompositeIterator(this.buildUnmodifiableIterators());
- }
-
- // leave unchecked so we can override in subclass
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new CompositeIterator<String>(iterators);
- }
-
- // use vararg constructor
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new CompositeIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- // use vararg constructor
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new CompositeIterator<String>(new Iterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- Iterator<String> buildCompositeIterator(String string, Iterator<String> iterator) {
- return new CompositeIterator<String>(string, iterator);
- }
-
- ListIterator<Iterator<String>> buildIterators() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildIterator1());
- list.add(this.buildIterator2());
- list.add(this.buildIterator3());
- return list.listIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIterators1() {
- return this.buildEmptyIteratorIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIterators2() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildEmptyStringIterator());
- list.add(this.buildEmptyStringIterator());
- list.add(this.buildEmptyStringIterator());
- return list.listIterator();
- }
-
- ListIterator<Iterator<String>> buildUnmodifiableIterators() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildUnmodifiableIterator1());
- list.add(this.buildUnmodifiableIterator2());
- list.add(this.buildUnmodifiableIterator3());
- return list.listIterator();
- }
-
- ListIterator<String> buildIterator1() {
- return this.buildList1().listIterator();
- }
-
- ListIterator<String> buildIterator2() {
- return this.buildList2().listIterator();
- }
-
- ListIterator<String> buildIterator3() {
- return this.buildList3().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator1() {
- return this.buildUnmodifiableList1().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator2() {
- return this.buildUnmodifiableList2().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator3() {
- return this.buildUnmodifiableList3().listIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIteratorIterator() {
- return (new ArrayList<Iterator<String>>()).listIterator();
- }
-
- ListIterator<String> buildEmptyStringIterator() {
- return (new ArrayList<String>()).listIterator();
- }
-
- List<String> buildList1() {
- List<String> list = new ArrayList<String>();
- list.add("1");
- list.add("22");
- list.add("333");
- list.add("4444");
- return list;
- }
-
- List<String> buildList2() {
- return new ArrayList<String>();
- }
-
- List<String> buildList3() {
- List<String> list = new ArrayList<String>();
- list.add("55555");
- list.add("666666");
- list.add("7777777");
- list.add("88888888");
- return list;
- }
-
- List<String> buildUnmodifiableList1() {
- return Collections.unmodifiableList(this.buildList1());
- }
-
- List<String> buildUnmodifiableList2() {
- return Collections.unmodifiableList(this.buildList2());
- }
-
- List<String> buildUnmodifiableList3() {
- return Collections.unmodifiableList(this.buildList3());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeListIteratorTests.java
deleted file mode 100644
index 5544e86355..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/CompositeListIteratorTests.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeListIterator;
-
-@SuppressWarnings("nls")
-public class CompositeListIteratorTests extends ReadOnlyCompositeListIteratorTests {
-
- public CompositeListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- public void testRemove() {
- super.testRemove();
- List<String> list1 = this.buildList1();
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- // position to end of stream
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (previous.equals("333")) {
- stream.remove();
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.remove();
- }
- }
- stream.remove();
-
- assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size());
- assertFalse("element still in collection 1", list1.contains("1"));
- assertFalse("element still in collection 1", list1.contains("333"));
-
- assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size());
- assertFalse("first element still in collection 3", list3.contains(firstElement3));
- assertTrue("wrong element removed from collection 3", list3.contains("666666"));
- }
-
- public void testAdd() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.add("3.5");
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to add to the iterator
- stream.add("something in 3");
- }
- }
- stream.add("finale");
- boolean checkForFinale = true;
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (checkForFinale) {
- checkForFinale = false;
- assertEquals("added element dropped", "finale", previous);
- }
- if (previous.equals("333")) {
- stream.add("2.5");
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.add("old start of 3");
- }
- }
- stream.add("prelude");
- assertEquals("added element dropped", "prelude", stream.previous());
-
- assertEquals("elements not added to collection 1", this.buildList1().size() + 3, list1.size());
- assertEquals("element not added to collection 1", "prelude", list1.get(0));
- assertEquals("element not added to collection 1", "2.5", list1.get(3));
- assertEquals("element not added to collection 1", "3.5", list1.get(5));
-
- assertEquals("elements not added to collection 3", this.buildList3().size() + 3, list3.size());
- assertEquals("element not added to collection 3", "something in 3", list3.get(0));
- assertEquals("element not added to collection 3", "old start of 3", list3.get(1));
- assertEquals("element not added to collection 3", "finale", list3.get(list3.size() - 1));
-
- // add to the front
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- stream.previous();
- }
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- stream.previous();
- }
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- // add to the middle
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.next();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.next();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.previous();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.previous();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- // add to the end
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.hasNext());
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
- }
-
- public void testSet() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- // position to end of stream
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.set("333a");
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to remove from the previous iterator
- stream.set("end of 1");
- }
- }
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (previous.equals("22")) {
- stream.set("22a");
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.set("start of 3");
- }
- }
-
- assertEquals("element(s) added to collection 1", this.buildList1().size(), list1.size());
- assertEquals("element not set in collection 1", "22a", list1.get(1));
- assertFalse("element not set in collection 1", list1.contains("22"));
- assertEquals("element not set in collection 1", "333a", list1.get(2));
- assertFalse("element not set in collection 1", list1.contains("333"));
- assertEquals("element not set in collection 1", "end of 1", list1.get(list1.size() - 1));
- assertFalse("element not set in collection 1", list1.contains(lastElement1));
-
- assertEquals("element(s) added to collection 3", this.buildList3().size(), list3.size());
- assertEquals("element not set in collection 3", "start of 3", list3.get(0));
- assertFalse("element not set in collection 3", list3.contains(firstElement3));
- }
-
- @Override
- public void testNextIndexPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator();
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasNext()) {
- Object next = stream.next();
- i++;
- if (next.equals("333")) {
- stream.remove();
- i--;
- }
- if (next.equals("7777777")) {
- stream.add("7.5");
- i++;
- }
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 8, i);
-
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- i--;
- if (previous.equals("666666")) {
- stream.remove();
- // removing a previous element, does not change the cursor
- }
- if (previous.equals("22")) {
- stream.add("1.5");
- i++;
- }
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 0, i);
- }
-
- @Override
- public void testIllegalStateException() {
- this.verifyIllegalStateException();
- }
-
- @Override
- public void testEmptyIllegalStateException1() {
- this.verifyEmptyIllegalStateException1();
- }
-
- @Override
- public void testEmptyIllegalStateException2() {
- this.verifyEmptyIllegalStateException2();
- }
-
- // unchecked so we can override the unchecked method in superclass
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new CompositeListIterator<String>((ListIterator<ListIterator<String>>) iterators);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new CompositeListIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new CompositeListIterator<String>(new ListIterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- @Override
- ListIterator<String> buildCompositeListIterator(String string, ListIterator<String> iterator) {
- return new CompositeListIterator<String>(string, iterator);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyIteratorTests.java
deleted file mode 100644
index 511e484849..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyIteratorTests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
-
-@SuppressWarnings("nls")
-public class EmptyIteratorTests extends TestCase {
-
- public EmptyIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Object> stream = EmptyIterator.instance(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNext() {
- for (Iterator<String> stream = EmptyIterator.instance(); stream.hasNext();) {
- fail("bogus element: " + stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Number> stream = EmptyIterator.instance();
- Object element = null;
- while (stream.hasNext()) {
- element = stream.next();
- }
- try {
- element = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- try {
- EmptyIterator.instance().remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyListIteratorTests.java
deleted file mode 100644
index 1892415b13..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EmptyListIteratorTests.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-
-@SuppressWarnings("nls")
-public class EmptyListIteratorTests extends TestCase {
-
- public EmptyListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (ListIterator<Object> stream = EmptyListIterator.instance(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNext() {
- for (ListIterator<Object> stream = EmptyListIterator.instance(); stream.hasNext();) {
- fail("bogus element: " + stream.next());
- }
- }
-
- public void testNextIndex() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- assertEquals(0, stream.nextIndex());
- }
-
- public void testHasPrevious() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- int i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(0, i);
-
- while (stream.hasNext()) {
- stream.next();
- }
- i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testPrevious() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- while (stream.hasPrevious()) {
- fail("bogus element: " + stream.previous());
- }
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- fail("bogus element: " + stream.previous());
- }
- }
-
- public void testPreviousIndex() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- assertEquals(-1, stream.previousIndex());
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<Object> stream = EmptyListIterator.instance();
- Object element = null;
- while (stream.hasNext()) {
- element = stream.next();
- }
- try {
- element = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown (next): " + element, exCaught);
- while (stream.hasPrevious()) {
- element = stream.previous();
- }
- try {
- element = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown (previous): " + element, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- try {
- EmptyListIterator.instance().remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (remove)", exCaught);
- try {
- EmptyListIterator.instance().set(new Object());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (set)", exCaught);
- try {
- EmptyListIterator.instance().add(new Object());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (add)", exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EnumerationIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EnumerationIteratorTests.java
deleted file mode 100644
index a7c7d289e6..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/EnumerationIteratorTests.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.EnumerationIterator;
-
-@SuppressWarnings("nls")
-public class EnumerationIteratorTests extends TestCase {
-
- public EnumerationIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNext() {
- Enumeration<String> enumeration = this.buildEnumeration();
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus element", enumeration.nextElement(), stream.next());
- }
- }
-
- public void testNextUpcast() {
- Enumeration<String> enumeration = this.buildEnumeration();
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus element", enumeration.nextElement(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<String> buildIterator() {
- return this.buildIterator(this.buildEnumeration());
- }
-
- private Iterator<String> buildIterator(Enumeration<String> enumeration) {
- return new EnumerationIterator<String>(enumeration);
- }
-
- private Enumeration<String> buildEnumeration() {
- return this.buildVector().elements();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
- private Iterator<Object> buildIteratorUpcast() {
- return this.buildIteratorUpcast(this.buildEnumeration());
- }
-
- private Iterator<Object> buildIteratorUpcast(Enumeration<String> enumeration) {
- return new EnumerationIterator<Object>(enumeration);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/FilteringIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/FilteringIteratorTests.java
deleted file mode 100644
index 6fe920b713..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/FilteringIteratorTests.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.SimpleFilter;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-
-@SuppressWarnings("nls")
-public class FilteringIteratorTests extends TestCase {
-
- private static final String PREFIX = "prefix";
-
- public FilteringIteratorTests(String name) {
- super(name);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- String string = stream.next();
- if (string.equals(PREFIX + "3")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildAcceptIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testAcceptHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testAcceptNext() {
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testInnerNext() {
- for (Iterator<String> stream = this.buildInnerIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testRejectHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildRejectIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(2, i);
- }
-
- public void testRejectNext() {
- for (Iterator<String> stream = this.buildRejectIterator(); stream.hasNext();) {
- assertFalse("bogus reject", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testBothHasNext() {
- // if both accept() and reject() are overridden, accept() is used
- int i = 0;
- for (Iterator<String> stream = this.buildBothIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testLoadNext() {
- // loadNext() used to cause a NPE when executing during the
- // constructor because the "outer" class is not bound until completion
- // of the constructor
- for (Iterator<String> stream = this.buildInnerIterator2(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testFilterHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildFilterIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testFilterNext() {
- for (Iterator<String> stream = this.buildFilterIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- private Iterator<String> buildFilteredIterator(Iterator<String> nestedIterator, Filter<String> filter) {
- return new FilteringIterator<String>(nestedIterator, filter);
- }
-
- private Iterator<String> buildInnerFilteredIterator(Iterator<String> nestedIterator) {
- return new FilteringIterator<String>(nestedIterator) {
- @Override
- protected boolean accept(String s) {
- return s.startsWith(PREFIX);
- }
- };
- }
-
- String getPrefix() {
- return PREFIX;
- }
-
- // this inner iterator will call the "outer" object
- private Iterator<String> buildInnerFilteredIterator2(Iterator<String> nestedIterator) {
- return new FilteringIterator<String>(nestedIterator) {
- @Override
- protected boolean accept(String s) {
- return s.startsWith(FilteringIteratorTests.this.getPrefix());
- }
- };
- }
-
- private Iterator<String> buildNestedIterator() {
- Collection<String> c = new ArrayList<String>();
- c.add(PREFIX + "1");
- c.add(PREFIX + "2");
- c.add(PREFIX + "3");
- c.add("4");
- c.add(PREFIX + "5");
- c.add(PREFIX + "6");
- c.add(PREFIX + "7");
- c.add("8");
- return c.iterator();
- }
-
- private Iterator<String> buildAcceptIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildAcceptFilter(PREFIX));
- }
-
- private Iterator<String> buildInnerIterator() {
- return this.buildInnerFilteredIterator(this.buildNestedIterator());
- }
-
- // this inner iterator will call the "outer" object
- private Iterator<String> buildInnerIterator2() {
- return this.buildInnerFilteredIterator2(this.buildNestedIterator());
- }
-
- private Iterator<String> buildFilterIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildFilterFilter(PREFIX));
- }
-
- private Filter<String> buildAcceptFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean accept(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- private Iterator<String> buildRejectIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildRejectFilter(PREFIX));
- }
-
- private Filter<String> buildRejectFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean reject(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- // use anonymous inner Filter
- private Filter<String> buildFilterFilter(final String prefix) {
- return new Filter<String>() {
- public boolean accept(String s) {
- return s.startsWith(prefix);
- }
- };
- }
-
- private Iterator<String> buildBothIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildBothFilter(PREFIX));
- }
-
- private Filter<String> buildBothFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean reject(String s) {
- return s.startsWith(this.criterion);
- }
-
- @Override
- public boolean accept(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- public void testInvalidFilteringIterator() {
- boolean exCaught = false;
- try {
- // missing method override
- Iterator<String> iterator = new FilteringIterator<String>(this.buildNestedIterator());
- String s = iterator.next();
- fail("invalid string: " + s);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/GraphIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/GraphIteratorTests.java
deleted file mode 100644
index e320f28988..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/GraphIteratorTests.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.GraphIterator;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class GraphIteratorTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<GraphNode> nodes = new ArrayList<GraphNode>();
-
- public GraphIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext1() {
- this.verifyHasNext(this.buildGraphIterator1());
- }
-
- public void testHasNext2() {
- this.verifyHasNext(this.buildGraphIterator2());
- }
-
- private void verifyHasNext(Iterator<GraphNode> iterator) {
- int i = 0;
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(this.nodes.size(), i);
- }
-
- public void testNext1() {
- this.verifyNext(this.buildGraphIterator1());
- }
-
- public void testNext2() {
- this.verifyNext(this.buildGraphIterator2());
- }
-
- private void verifyNext(Iterator<GraphNode> iterator) {
- while (iterator.hasNext()) {
- assertTrue("bogus element", this.nodes.contains(iterator.next()));
- }
- }
-
- public void testNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildGraphIterator1());
- }
-
- public void testNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildGraphIterator2());
- }
-
- private void verifyNoSuchElementException(Iterator<GraphNode> iterator) {
- boolean exCaught = false;
- while (iterator.hasNext()) {
- iterator.next();
- }
- try {
- iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- public void testSize1() {
- this.verifySize(this.buildGraphIterator1());
- }
-
- public void testSize2() {
- this.verifySize(this.buildGraphIterator2());
- }
-
- private void verifySize(Iterator<GraphNode> iterator) {
- int iteratorSize = CollectionTools.size(iterator);
- int actualSize = this.nodes.size();
- assertTrue("Too few items in iterator.", iteratorSize >= actualSize);
- assertTrue("Too many items in iterator.", iteratorSize <= actualSize);
- }
-
- public void testInvalidGraphIterator() {
- boolean exCaught = false;
- try {
- // missing method override
- Iterator<GraphNode> iterator = new GraphIterator<GraphNode>(this.buildGraphRoot());
- GraphNode gn = iterator.next();
- fail("invalid graph node: " + gn);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- /**
- * build a graph iterator with an explicit misterRogers
- */
- private Iterator<GraphNode> buildGraphIterator1() {
- return new GraphIterator<GraphNode>(this.buildGraphRoot(), this.buildMisterRogers());
- }
-
- private GraphIterator.MisterRogers<GraphNode> buildMisterRogers() {
- return new GraphIterator.MisterRogers<GraphNode>() {
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- /**
- * build a graph iterator with an override
- */
- private Iterator<GraphNode> buildGraphIterator2() {
- return new GraphIterator<GraphNode>(this.buildGraphRoot()) {
- @Override
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- private GraphNode buildGraphRoot() {
- GraphNode ncNode = new GraphNode("North Carolina");
- GraphNode vaNode = new GraphNode("Virginia");
- GraphNode scNode = new GraphNode("South Carolina");
- GraphNode gaNode = new GraphNode("Georgia");
- GraphNode flNode = new GraphNode("Florida");
- GraphNode alNode = new GraphNode("Alabama");
- GraphNode msNode = new GraphNode("Mississippi");
- GraphNode tnNode = new GraphNode("Tennessee");
-
- ncNode.setNeighbors(new GraphNode[] { vaNode, scNode, gaNode, tnNode });
- vaNode.setNeighbors(new GraphNode[] { ncNode, tnNode });
- scNode.setNeighbors(new GraphNode[] { ncNode, gaNode });
- gaNode.setNeighbors(new GraphNode[] { ncNode, scNode, flNode, alNode, tnNode });
- flNode.setNeighbors(new GraphNode[] { gaNode });
- alNode.setNeighbors(new GraphNode[] { gaNode, msNode, tnNode });
- msNode.setNeighbors(new GraphNode[] { alNode, tnNode });
- tnNode.setNeighbors(new GraphNode[] { vaNode, ncNode, gaNode, alNode, msNode });
-
- return ncNode;
- }
-
- public class GraphNode {
- private String name;
-
- private Collection<GraphNode> neighbors = new ArrayList<GraphNode>();
-
- public GraphNode(String name) {
- super();
- GraphIteratorTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- void setNeighbors(GraphNode[] neighbors) {
- this.neighbors = CollectionTools.list(neighbors);
- }
-
- public Iterator<GraphNode> neighbors() {
- return this.neighbors.iterator();
- }
-
- public int neighborsSize() {
- return this.neighbors.size();
- }
-
- @Override
- public String toString() {
- return "GraphNode(" + this.name + ")";
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/JptUtilityIteratorsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
deleted file mode 100644
index 54fb276ecb..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityIteratorsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityIteratorsTests.class.getPackage().getName());
-
- suite.addTestSuite(ArrayIteratorTests.class);
- suite.addTestSuite(ArrayListIteratorTests.class);
- suite.addTestSuite(ChainIteratorTests.class);
- suite.addTestSuite(CloneIteratorTests.class);
- suite.addTestSuite(CloneListIteratorTests.class);
- suite.addTestSuite(CompositeIteratorTests.class);
- suite.addTestSuite(CompositeListIteratorTests.class);
- suite.addTestSuite(EmptyIteratorTests.class);
- suite.addTestSuite(EmptyListIteratorTests.class);
- suite.addTestSuite(EnumerationIteratorTests.class);
- suite.addTestSuite(FilteringIteratorTests.class);
- suite.addTestSuite(SuperIteratorWrapperTests.class);
- suite.addTestSuite(GraphIteratorTests.class);
- suite.addTestSuite(PeekableIteratorTests.class);
- suite.addTestSuite(ReadOnlyCompositeListIteratorTests.class);
- suite.addTestSuite(ReadOnlyIteratorTests.class);
- suite.addTestSuite(ReadOnlyListIteratorTests.class);
- suite.addTestSuite(SingleElementIteratorTests.class);
- suite.addTestSuite(SingleElementListIteratorTests.class);
- suite.addTestSuite(SynchronizedIteratorTests.class);
- suite.addTestSuite(SynchronizedListIteratorTests.class);
- suite.addTestSuite(TransformationIteratorTests.class);
- suite.addTestSuite(TransformationListIteratorTests.class);
- suite.addTestSuite(TreeIteratorTests.class);
-
- return suite;
- }
-
- private JptUtilityIteratorsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/PeekableIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/PeekableIteratorTests.java
deleted file mode 100644
index 00a056f9a2..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/PeekableIteratorTests.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.PeekableIterator;
-
-@SuppressWarnings("nls")
-public class PeekableIteratorTests extends TestCase {
-
- public PeekableIteratorTests(String name) {
- super(name);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- String string = stream.next();
- if (string.equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildPeekableIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testNext() {
- Iterator<String> stream = this.buildPeekableIterator();
- assertEquals("zero", stream.next());
- assertEquals("one", stream.next());
- assertEquals("two", stream.next());
- assertEquals("three", stream.next());
- assertEquals("four", stream.next());
- assertEquals("five", stream.next());
- }
-
- public void testNextUpcast() {
- Iterator<Object> stream = this.buildPeekableIteratorUpcast();
- assertEquals("zero", stream.next());
- assertEquals("one", stream.next());
- assertEquals("two", stream.next());
- assertEquals("three", stream.next());
- assertEquals("four", stream.next());
- assertEquals("five", stream.next());
- }
-
- public void testPeek() {
- Object next = null;
- for (PeekableIterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- Object peek = stream.peek();
- assertTrue("peek and next are prematurely identical", peek != next);
- next = stream.next();
- assertTrue("peek and next are not identical", peek == next);
- }
- }
-
- public void testPeekUpcast() {
- Object next = null;
- for (PeekableIterator<Object> stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) {
- Object peek = stream.peek();
- assertTrue("peek and next are prematurely identical", peek != next);
- next = stream.next();
- assertTrue("peek and next are not identical", peek == next);
- }
- }
-
- private PeekableIterator<String> buildPeekableIterator() {
- return this.buildPeekableIterator(this.buildNestedIterator());
- }
-
- private PeekableIterator<Object> buildPeekableIteratorUpcast() {
- return this.buildPeekableIteratorUpcast(this.buildNestedIterator());
- }
-
- private PeekableIterator<String> buildPeekableIterator(Iterator<String> nestedIterator) {
- return new PeekableIterator<String>(nestedIterator);
- }
-
- private PeekableIterator<Object> buildPeekableIteratorUpcast(Iterator<String> nestedIterator) {
- return new PeekableIterator<Object>(nestedIterator);
- }
-
- private Iterator<String> buildNestedIterator() {
- Collection<String> c = new ArrayList<String>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- c.add("four");
- c.add("five");
- return c.iterator();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
deleted file mode 100644
index dd1eea6db4..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyCompositeListIterator;
-
-@SuppressWarnings("nls")
-public class ReadOnlyCompositeListIteratorTests extends CompositeIteratorTests {
-
- public ReadOnlyCompositeListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- void verifyHasAnother(Iterator<String> stream) {
- super.verifyHasAnother(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- int i = 0;
- while (stream2.hasPrevious()) {
- stream2.previous();
- i++;
- }
- assertEquals(8, i);
- }
-
- @Override
- void verifyAnother(Iterator<String> stream) {
- super.verifyAnother(stream);
- int i = 8;
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- while (stream2.hasPrevious()) {
- assertEquals("bogus element", String.valueOf(i--), stream2.previous().substring(0, 1));
- }
- }
-
- public void testNextIndexPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator();
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasNext()) {
- stream.next();
- i++;
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 8, i);
-
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 0, i);
- }
-
- public void testPreviousIndex() {
- // TODO
- }
-
- @Override
- public void testRemove() {
- // #remove() is not supported
- }
-
- @Override
- public void testIllegalStateException() {
- // #remove() is not supported
- }
-
- @Override
- public void testEmptyIllegalStateException1() {
- // #remove() is not supported
- }
-
- @Override
- public void testEmptyIllegalStateException2() {
- // #remove() is not supported
- }
-
- @Override
- void verifyNoSuchElementException(Iterator<String> stream) {
- super.verifyNoSuchElementException(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- boolean exCaught = false;
- String string = null;
- while (stream2.hasPrevious()) {
- string = stream2.previous();
- }
- try {
- string = stream2.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- @Override
- void verifyUnsupportedOperationException(Iterator<String> stream) {
- super.verifyUnsupportedOperationException(stream);
- boolean exCaught = false;
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- while (stream2.hasPrevious()) {
- Object string = stream2.previous();
- if (string.equals("333")) {
- try {
- stream2.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- void verifyIllegalStateException(Iterator<String> stream) {
- super.verifyIllegalStateException(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- boolean exCaught = false;
- try {
- stream2.set("junk");
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- @Override
- void verifyEmptyHasAnother(Iterator<String> stream) {
- super.verifyEmptyHasAnother(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- int i = 0;
- while (stream2.hasPrevious()) {
- stream2.previous();
- i++;
- }
- assertEquals(0, i);
- }
-
- // unchecked so we can override the unchecked method in superclass
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new ReadOnlyCompositeListIterator<String>((ListIterator<ListIterator<String>>) iterators);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new ReadOnlyCompositeListIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new ReadOnlyCompositeListIterator<String>(new ListIterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- Iterator<String> buildCompositeIterator(String string, ListIterator<String> iterator) {
- return this.buildCompositeListIterator(string, iterator);
- }
-
- ListIterator<String> buildCompositeListIterator(String string, ListIterator<String> iterator) {
- return new ReadOnlyCompositeListIterator<String>(string, iterator);
- }
-
- public void testVariedNestedIterators() {
- List<Integer> integerList = new ArrayList<Integer>();
- integerList.add(new Integer(42));
- integerList.add(new Integer(42));
- integerList.add(new Integer(111));
- integerList.add(new Integer(77));
-
- List<Float> floatList = new ArrayList<Float>();
- floatList.add(new Float(42.42f));
- floatList.add(new Float(22.22f));
- floatList.add(new Float(111.111f));
- floatList.add(new Float(77.77f));
-
- List<List<? extends Number>> list = new ArrayList<List<? extends Number>>();
- list.add(integerList);
- list.add(floatList);
- ListIterator<Number> li = new ReadOnlyCompositeListIterator<Number>(list);
- while (li.hasNext()) {
- assertTrue(li.next().intValue() > 0);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
deleted file mode 100644
index f00417064d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyIterator;
-
-@SuppressWarnings("nls")
-public class ReadOnlyIteratorTests extends TestCase {
-
- public ReadOnlyIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNext() {
- Iterator<String> nestedIterator = this.buildNestedIterator();
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNextUpcast() {
- Iterator<String> nestedIterator = this.buildNestedIterator();
- for (Iterator<Object> stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildReadOnlyIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<String> buildReadOnlyIterator() {
- return this.buildReadOnlyIterator(this.buildNestedIterator());
- }
-
- private Iterator<Object> buildReadOnlyIteratorUpcast() {
- return this.buildReadOnlyIteratorUpcast(this.buildNestedIterator());
- }
-
- private Iterator<String> buildReadOnlyIterator(Iterator<String> nestedIterator) {
- return new ReadOnlyIterator<String>(nestedIterator);
- }
-
- private Iterator<Object> buildReadOnlyIteratorUpcast(Iterator<String> nestedIterator) {
- return new ReadOnlyIterator<Object>(nestedIterator);
- }
-
- private Iterator<String> buildNestedIterator() {
- return this.buildVector().iterator();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
deleted file mode 100644
index 9d81a2ad37..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyListIterator;
-
-@SuppressWarnings("nls")
-public class ReadOnlyListIteratorTests extends TestCase {
-
- public ReadOnlyListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(this.buildList().size(), i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testHasNextAndHasPreviousUpcast() {
- int i = 0;
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(this.buildList().size(), i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testNextAndPrevious() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNextAndPreviousUpcast() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNextIndexAndPreviousIndex() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex());
- nestedListIterator.next();
- stream.next();
- }
- assertEquals("bogus index", this.buildList().size(), stream.nextIndex());
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex());
- nestedListIterator.previous();
- stream.previous();
- }
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testNextIndexAndPreviousIndexUpcast() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex());
- nestedListIterator.next();
- stream.next();
- }
- assertEquals("bogus index", this.buildList().size(), stream.nextIndex());
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex());
- nestedListIterator.previous();
- stream.previous();
- }
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.set("bogus");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testAdd() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.add("bogus");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private ListIterator<String> buildReadOnlyListIterator() {
- return this.buildReadOnlyListIterator(this.buildNestedListIterator());
- }
-
- private ListIterator<Object> buildReadOnlyListIteratorUpcast() {
- return this.buildReadOnlyListIteratorUpcast(this.buildNestedListIterator());
- }
-
- private ListIterator<String> buildReadOnlyListIterator(ListIterator<String> nestedListIterator) {
- return new ReadOnlyListIterator<String>(nestedListIterator);
- }
-
- private ListIterator<Object> buildReadOnlyListIteratorUpcast(ListIterator<String> nestedListIterator) {
- return new ReadOnlyListIterator<Object>(nestedListIterator);
- }
-
- private ListIterator<String> buildNestedListIterator() {
- return this.buildList().listIterator();
- }
-
- private List<String> buildList() {
- List<String> l = new ArrayList<String>();
- l.add("one");
- l.add("two");
- l.add("three");
- l.add("four");
- l.add("five");
- l.add("six");
- l.add("seven");
- l.add("eight");
- return l;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementIteratorTests.java
deleted file mode 100644
index 4fce5a6826..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementIteratorTests.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementIterator;
-
-@SuppressWarnings("nls")
-public class SingleElementIteratorTests extends TestCase {
-
- public SingleElementIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(1, i);
- }
-
- public void testNext() {
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- assertEquals("bogus element", this.singleElement(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildSingleElementIterator();
- String string = stream.next();
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- protected Iterator<String> buildSingleElementIterator() {
- return new SingleElementIterator<String>(this.singleElement());
- }
-
- protected String singleElement() {
- return "single element";
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementListIteratorTests.java
deleted file mode 100644
index d393a65201..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SingleElementListIteratorTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementListIterator;
-
-@SuppressWarnings("nls")
-public class SingleElementListIteratorTests extends SingleElementIteratorTests {
-
- public SingleElementListIteratorTests(String name) {
- super(name);
- }
-
- public void testNextIndex() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus index", 0, stream.nextIndex());
- stream.next();
- }
- assertEquals("bogus index", 1, stream.nextIndex());
- }
-
- public void testHasPrevious() {
- int i = 0;
- ListIterator<String> stream = this.buildSingleElementListIterator();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(1, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(2, i);
- }
-
- public void testPrevious() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- while (stream.hasNext()) {
- assertEquals("bogus element", this.singleElement(), stream.next());
- }
-
- while (stream.hasPrevious()) {
- assertEquals("bogus element", this.singleElement(), stream.previous());
- }
- }
-
- public void testPreviousIndex() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- while (stream.hasNext()) {
- assertEquals("bogus index", 0, stream.nextIndex());
- stream.next();
- }
-
- while (stream.hasPrevious()) {
- assertEquals("bogus index", 0, stream.previousIndex());
- stream.previous();
- }
-
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testAdd() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- try {
- stream.add("foo");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
-
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildSingleElementListIterator(); stream.hasNext();) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.set("foo");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- protected Iterator<String> buildSingleElementIterator() {
- return new SingleElementListIterator<String>(this.singleElement());
- }
-
- protected ListIterator<String> buildSingleElementListIterator() {
- return (ListIterator<String>) this.buildSingleElementIterator();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SuperIteratorWrapperTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SuperIteratorWrapperTests.java
deleted file mode 100644
index 4bb6dc626d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SuperIteratorWrapperTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.iterators.SuperIteratorWrapper;
-
-@SuppressWarnings("nls")
-public class SuperIteratorWrapperTests extends TestCase {
-
- public SuperIteratorWrapperTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- String concat = "";
- for (Iterator<String> stream = list.iterator(); stream.hasNext(); ) {
- concat += stream.next();
- }
- assertEquals("foobarbaz", concat);
-
- Iterator<Object> iterator = new SuperIteratorWrapper<Object>(list);
- concat = "";
- while (iterator.hasNext()) {
- Object next = iterator.next();
- if (next.equals("bar")) {
- iterator.remove();
- } else {
- concat += next;
- }
- }
- assertEquals("foobaz", concat);
- assertEquals(2, list.size());
- assertFalse(list.contains("bar"));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedIteratorTests.java
deleted file mode 100644
index e30238fe74..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedIteratorTests.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.SynchronizedIterator;
-import org.eclipse.jpt.common.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SynchronizedIteratorTests
- extends MultiThreadedTestCase
-{
- public SynchronizedIteratorTests(String name) {
- super(name);
- }
-
- /**
- * test that an unsynchronized iterator will produce corrupt output;
- * thread 1 will read the first element from the iterator
- * and then sleep for a bit, allowing thread 2 to sneak in and
- * read the same element from the iterator
- */
- public void testUnsynchronizedNext() throws Exception {
- TestIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- NextTestRunnable<String> runnable2 = new NextTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // both threads should have read the same element from the iterator :-(
- assertEquals("foo", runnable1.next);
- assertEquals("foo", runnable2.next);
- }
-
- /**
- * test that a synchronized iterator will produce valid output;
- * thread 1 will read the first element from the iterator
- * and then sleep for a bit, but thread 2 will be locked out and
- * wait to read the second element from the iterator
- */
- public void testSynchronizedNext() throws Exception {
- TestIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- Iterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- NextTestRunnable<String> runnable2 = new NextTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the threads should have read the correct elements from the iterator :-)
- assertEquals("foo", runnable1.next);
- assertEquals("bar", runnable2.next);
- }
-
- public void testUnsynchronizedHasNext() throws Exception {
- TestIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
- iterator.next();
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- HasNextTestRunnable<String> runnable2 = new HasNextTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the last element,
- // but thread 2 will think there are more elements on the iterator :-(
- assertEquals("baz", runnable1.next);
- assertEquals(true, runnable2.hasNext);
- }
-
- public void testSynchronizedHasNext() throws Exception {
- TestIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- Iterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
- iterator.next();
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- HasNextTestRunnable<String> runnable2 = new HasNextTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the last element,
- // and thread 2 will think there are no more elements on the iterator :-)
- assertEquals("baz", runnable1.next);
- assertEquals(false, runnable2.hasNext);
- }
-
- public void testUnsynchronizedRemove() throws Exception {
- TestIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- RemoveTestRunnable<String> runnable2 = new RemoveTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the wrong element was removed :-(
- assertEquals("bar", runnable1.next);
- assertFalse(iterator.list.contains("foo"));
- assertTrue(iterator.list.contains("bar"));
- assertTrue(iterator.list.contains("baz"));
- }
-
- public void testSynchronizedRemove() throws Exception {
- TestIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- Iterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- RemoveTestRunnable<String> runnable2 = new RemoveTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the correct element was removed :-)
- assertEquals("bar", runnable1.next);
- assertTrue(nestedIterator.list.contains("foo"));
- assertFalse(nestedIterator.list.contains("bar"));
- assertTrue(nestedIterator.list.contains("baz"));
- }
-
- TestIterator<String> buildTestIterator(long delay) {
- return new TestIterator<String>(delay, this.buildArray());
- }
-
- String[] buildArray() {
- return new String[] {"foo", "bar", "baz"};
- }
-
- Iterator<String> buildSynchronizedIterator(Iterator<String> nestedIterator) {
- return new SynchronizedIterator<String>(nestedIterator);
- }
-
-
- /**
- * next runnable
- */
- class NextTestRunnable<E> implements Runnable {
- final Iterator<E> iterator;
- E next;
-
- NextTestRunnable(Iterator<E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public void run() {
- this.next = this.iterator.next();
- }
-
- }
-
- /**
- * has next runnable
- */
- class HasNextTestRunnable<E> implements Runnable {
- final Iterator<E> iterator;
- boolean hasNext;
-
- HasNextTestRunnable(Iterator<E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public void run() {
- this.hasNext = this.iterator.hasNext();
- }
-
- }
-
- /**
- * remove runnable
- */
- class RemoveTestRunnable<E> implements Runnable {
- final Iterator<E> iterator;
-
- RemoveTestRunnable(Iterator<E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public void run() {
- this.iterator.remove();
- }
-
- }
-
- /**
- * Test iterator: If {@link #next()} is called while executing on the
- * {@link slowThread}, the iterator will delay for the configured time.
- */
- static class TestIterator<E> implements Iterator<E> {
- final long delay;
- final ArrayList<E> list = new ArrayList<E>();
- int nextIndex = 0;
- int lastIndex = -1;
- Thread slowThread;
-
- TestIterator(long delay, E... array) {
- super();
- this.delay = delay;
- CollectionTools.addAll(this.list, array);
- }
-
- public boolean hasNext() {
- return this.nextIndex != this.list.size();
- }
-
- public E next() {
- if (this.hasNext()) {
- E next = this.list.get(this.nextIndex);
- if (Thread.currentThread() == this.slowThread) {
- TestTools.sleep(this.delay);
- }
- this.lastIndex = this.nextIndex++;
- return next;
- }
- throw new NoSuchElementException();
- }
-
- public void remove() {
- if (this.lastIndex == -1) {
- throw new IllegalStateException();
- }
- this.list.remove(this.lastIndex);
- if (this.lastIndex < this.nextIndex) { // check necessary for ListIterator
- this.nextIndex--;
- }
- this.lastIndex = -1;
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedListIteratorTests.java
deleted file mode 100644
index dbf0ac5b57..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/SynchronizedListIteratorTests.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.common.utility.internal.iterators.SynchronizedListIterator;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SynchronizedListIteratorTests
- extends SynchronizedIteratorTests
-{
- public SynchronizedListIteratorTests(String name) {
- super(name);
- }
-
- public void testUnsynchronizedPrevious() throws Exception {
- TestListIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
- iterator.next();
- iterator.next();
-
- PreviousTestRunnable<String> runnable1 = new PreviousTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- PreviousTestRunnable<String> runnable2 = new PreviousTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // both threads should have read the same element from the iterator :-(
- assertEquals("bar", runnable1.previous);
- assertEquals("bar", runnable2.previous);
- }
-
- public void testSynchronizedPrevious() throws Exception {
- TestListIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- ListIterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
- iterator.next();
- iterator.next();
-
- PreviousTestRunnable<String> runnable1 = new PreviousTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- PreviousTestRunnable<String> runnable2 = new PreviousTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the threads should have read the correct elements from the iterator :-)
- assertEquals("bar", runnable1.previous);
- assertEquals("foo", runnable2.previous);
- }
-
- public void testUnsynchronizedHasPrevious() throws Exception {
- TestListIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
- iterator.next();
-
- PreviousTestRunnable<String> runnable1 = new PreviousTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- HasPreviousTestRunnable<String> runnable2 = new HasPreviousTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the first element,
- // but thread 2 will think there are more "previous" elements on the iterator :-(
- assertEquals("foo", runnable1.previous);
- assertEquals(true, runnable2.hasPrevious);
- }
-
- public void testSynchronizedHasPrevious() throws Exception {
- TestListIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- ListIterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
- iterator.next();
-
- PreviousTestRunnable<String> runnable1 = new PreviousTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- HasPreviousTestRunnable<String> runnable2 = new HasPreviousTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the first element,
- // and thread 2 will think there are no more "previous" elements on the iterator :-)
- assertEquals("foo", runnable1.previous);
- assertEquals(false, runnable2.hasPrevious);
- }
-
- public void testUnsynchronizedNextIndex() throws Exception {
- TestListIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- NextIndexTestRunnable<String> runnable2 = new NextIndexTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the first element,
- // but thread 2 will think the next index is still 0 :-(
- assertEquals("foo", runnable1.next);
- assertEquals(0, runnable2.nextIndex);
- }
-
- public void testSynchronizedNextIndex() throws Exception {
- TestListIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- ListIterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- NextIndexTestRunnable<String> runnable2 = new NextIndexTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the first element,
- // and thread 2 will think the next index is 1 :-)
- assertEquals("foo", runnable1.next);
- assertEquals(1, runnable2.nextIndex);
- }
-
- public void testUnsynchronizedPreviousIndex() throws Exception {
- TestListIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
- iterator.next();
-
- PreviousTestRunnable<String> runnable1 = new PreviousTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- PreviousIndexTestRunnable<String> runnable2 = new PreviousIndexTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the first element,
- // but thread 2 will think the next index is still 0 :-(
- assertEquals("foo", runnable1.previous);
- assertEquals(0, runnable2.previousIndex);
- }
-
- public void testSynchronizedPreviousIndex() throws Exception {
- TestListIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- ListIterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
- iterator.next();
-
- PreviousTestRunnable<String> runnable1 = new PreviousTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- PreviousIndexTestRunnable<String> runnable2 = new PreviousIndexTestRunnable<String>(iterator);
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // thread 1 will have the first element,
- // and thread 2 will think the next index is -1 :-)
- assertEquals("foo", runnable1.previous);
- assertEquals(-1, runnable2.previousIndex);
- }
-
- public void testUnsynchronizedSet() throws Exception {
- TestListIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- SetTestRunnable<String> runnable2 = new SetTestRunnable<String>(iterator, "xxx");
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the wrong element was set :-(
- assertEquals("bar", runnable1.next);
- assertFalse(iterator.list.contains("foo"));
- assertTrue(iterator.list.contains("xxx"));
- assertTrue(iterator.list.contains("bar"));
- assertTrue(iterator.list.contains("baz"));
- }
-
- public void testSynchronizedSet() throws Exception {
- TestListIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- ListIterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- SetTestRunnable<String> runnable2 = new SetTestRunnable<String>(iterator, "xxx");
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the right element was set :-)
- assertEquals("bar", runnable1.next);
- assertTrue(nestedIterator.list.contains("foo"));
- assertFalse(nestedIterator.list.contains("bar"));
- assertTrue(nestedIterator.list.contains("xxx"));
- assertTrue(nestedIterator.list.contains("baz"));
- }
-
- public void testUnsynchronizedAdd() throws Exception {
- TestListIterator<String> iterator = this.buildTestIterator(TWO_TICKS);
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- AddTestRunnable<String> runnable2 = new AddTestRunnable<String>(iterator, "xxx");
- Thread thread2 = this.buildThread(runnable2);
- iterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the element was added at the wrong index :-(
- assertEquals("bar", runnable1.next);
- assertTrue(iterator.list.contains("foo"));
- assertEquals(0, iterator.list.indexOf("xxx"));
- assertTrue(iterator.list.contains("xxx"));
- assertTrue(iterator.list.contains("bar"));
- assertTrue(iterator.list.contains("baz"));
- }
-
- public void testSynchronizedAdd() throws Exception {
- TestListIterator<String> nestedIterator = this.buildTestIterator(TWO_TICKS);
- ListIterator<String> iterator = this.buildSynchronizedIterator(nestedIterator);
- iterator.next();
-
- NextTestRunnable<String> runnable1 = new NextTestRunnable<String>(iterator);
- Thread thread1 = this.buildThread(runnable1);
- AddTestRunnable<String> runnable2 = new AddTestRunnable<String>(iterator, "xxx");
- Thread thread2 = this.buildThread(runnable2);
- nestedIterator.slowThread = thread1;
-
- thread1.start();
-
- // allow thread 1 to read the first element and get bogged down
- this.sleep(TICK);
- thread2.start();
-
- // wait for the threads to finish
- thread1.join();
- thread2.join();
-
- // the element was added at the correct index :-)
- assertEquals("bar", runnable1.next);
- assertTrue(nestedIterator.list.contains("foo"));
- assertEquals(1, nestedIterator.list.indexOf("xxx"));
- assertTrue(nestedIterator.list.contains("xxx"));
- assertTrue(nestedIterator.list.contains("bar"));
- assertTrue(nestedIterator.list.contains("baz"));
- }
-
- @Override
- ListIterator<String> buildSynchronizedIterator(Iterator<String> nestedIterator) {
- return new SynchronizedListIterator<String>((ListIterator<String>) nestedIterator);
- }
-
- @Override
- TestListIterator<String> buildTestIterator(long delay) {
- return new TestListIterator<String>(delay, this.buildArray());
- }
-
- /**
- * previous runnable
- */
- class PreviousTestRunnable<E> implements Runnable {
- final ListIterator<E> iterator;
- E previous;
-
- PreviousTestRunnable(ListIterator<E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public void run() {
- this.previous = this.iterator.previous();
- }
-
- }
-
- /**
- * has previous runnable
- */
- class HasPreviousTestRunnable<E> implements Runnable {
- final ListIterator<E> iterator;
- boolean hasPrevious;
-
- HasPreviousTestRunnable(ListIterator<E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public void run() {
- this.hasPrevious = this.iterator.hasPrevious();
- }
-
- }
-
- /**
- * next index runnable
- */
- class NextIndexTestRunnable<E> implements Runnable {
- final ListIterator<E> iterator;
- int nextIndex;
-
- NextIndexTestRunnable(ListIterator<E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public void run() {
- this.nextIndex = this.iterator.nextIndex();
- }
-
- }
-
- /**
- * previous index runnable
- */
- class PreviousIndexTestRunnable<E> implements Runnable {
- final ListIterator<E> iterator;
- int previousIndex;
-
- PreviousIndexTestRunnable(ListIterator<E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public void run() {
- this.previousIndex = this.iterator.previousIndex();
- }
-
- }
-
- /**
- * set runnable
- */
- class SetTestRunnable<E> implements Runnable {
- final ListIterator<E> iterator;
- final E element;
-
- SetTestRunnable(ListIterator<E> iterator, E element) {
- super();
- this.iterator = iterator;
- this.element = element;
- }
-
- public void run() {
- this.iterator.set(this.element);
- }
-
- }
-
- /**
- * add runnable
- */
- class AddTestRunnable<E> implements Runnable {
- final ListIterator<E> iterator;
- final E element;
-
- AddTestRunnable(ListIterator<E> iterator, E element) {
- super();
- this.iterator = iterator;
- this.element = element;
- }
-
- public void run() {
- this.iterator.add(this.element);
- }
-
- }
-
- /**
- * Test iterator: If {@link #next()} or {@link #previous()} is called
- * while executing on the {@link slowThread}, the iterator will delay
- * for the configured time.
- */
- static class TestListIterator<E> extends TestIterator<E> implements ListIterator<E> {
-
- TestListIterator(long delay, E... array) {
- super(delay, array);
- }
-
- public int nextIndex() {
- return this.nextIndex;
- }
-
- public boolean hasPrevious() {
- return this.nextIndex != 0;
- }
-
- public E previous() {
- if (this.hasPrevious()) {
- E previous = this.list.get(this.previousIndex());
- if (Thread.currentThread() == this.slowThread) {
- TestTools.sleep(this.delay);
- }
- this.nextIndex--;
- this.lastIndex = this.nextIndex;
- return previous;
- }
- throw new NoSuchElementException();
- }
-
- public int previousIndex() {
- return this.nextIndex - 1;
- }
-
- public void set(E e) {
- if (this.lastIndex == -1) {
- throw new IllegalStateException();
- }
- this.list.set(this.lastIndex, e);
- }
-
- public void add(E e) {
- this.list.add(this.lastIndex, e);
- this.lastIndex++;
- this.lastIndex = -1;
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationIteratorTests.java
deleted file mode 100644
index af7185a792..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationIteratorTests.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-
-@SuppressWarnings("nls")
-public class TransformationIteratorTests extends TestCase {
-
- public TransformationIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, stream.next().intValue());
- }
- }
-
- public void testNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, ((Integer) stream.next()).intValue());
- }
- }
-
- public void testInnerNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildInnerIterator(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, stream.next().intValue());
- }
- }
-
- public void testRemove() {
- Collection<String> c = this.buildCollection();
- for (Iterator<Integer> stream = this.buildInnerTransformationIterator(c.iterator()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildCollection().size() - 1, c.size());
- assertFalse("element still in collection", c.contains("333"));
- assertTrue("wrong element removed", c.contains("22"));
- }
-
- public void testInnerRemove() {
- Collection<String> c = this.buildCollection();
- for (Iterator<Integer> stream = this.buildTransformationIterator(c.iterator(), this.buildTransformer()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildCollection().size() - 1, c.size());
- assertFalse("element still in collection", c.contains("333"));
- assertTrue("wrong element removed", c.contains("22"));
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Integer> stream = this.buildIterator();
- Integer integer = null;
- while (stream.hasNext()) {
- integer = stream.next();
- }
- try {
- integer = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + integer, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Integer> stream = this.buildUnmodifiableIterator(); stream.hasNext();) {
- int i = stream.next().intValue();
- if (i == 3) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- boolean exCaught = false;
- try {
- this.buildIterator().remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- private Iterator<Integer> buildIterator() {
- return this.buildTransformationIterator(this.buildNestedIterator(), this.buildTransformer());
- }
-
- private Iterator<Object> buildIteratorUpcast() {
- return this.buildTransformationIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast());
- }
-
- private Iterator<Integer> buildInnerIterator() {
- return this.buildInnerTransformationIterator(this.buildNestedIterator());
- }
-
- private Iterator<Integer> buildUnmodifiableIterator() {
- return this.buildTransformationIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer());
- }
-
- private Iterator<Integer> buildTransformationIterator(Iterator<String> nestedIterator, Transformer<String, Integer> transformer) {
- return new TransformationIterator<String, Integer>(nestedIterator, transformer);
- }
-
- private Iterator<Object> buildTransformationIteratorUpcast(Iterator<String> nestedIterator, Transformer<Object, Integer> transformer) {
- return new TransformationIterator<Object, Object>(nestedIterator, transformer);
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Transformer<Object, Integer> buildTransformerUpcast() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<Object, Integer>() {
- public Integer transform(Object next) {
- return new Integer(((String) next).length());
- }
- };
- }
-
- private Iterator<Integer> buildInnerTransformationIterator(Iterator<String> nestedIterator) {
- // transform each string into an integer with a value of the string's length
- return new TransformationIterator<String, Integer>(nestedIterator) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Iterator<String> buildNestedIterator() {
- return this.buildCollection().iterator();
- }
-
- private Iterator<String> buildUnmodifiableNestedIterator() {
- return this.buildUnmodifiableCollection().iterator();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add("1");
- c.add("22");
- c.add("333");
- c.add("4444");
- c.add("55555");
- c.add("666666");
- c.add("7777777");
- c.add("88888888");
- return c;
- }
-
- private Collection<String> buildUnmodifiableCollection() {
- return Collections.unmodifiableCollection(this.buildCollection());
- }
-
- public void testInvalidTransformationIterator() {
- // missing method override
- Iterator<Integer> iterator = new TransformationIterator<String, Integer>(this.buildCollection().iterator());
- boolean exCaught = false;
- try {
- Integer integer = iterator.next();
- fail("invalid integer: " + integer);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationListIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationListIteratorTests.java
deleted file mode 100644
index 9a438096ba..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TransformationListIteratorTests.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationListIterator;
-
-@SuppressWarnings("nls")
-public class TransformationListIteratorTests extends TestCase {
-
- public TransformationListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testHasNextAndHasPreviousUpcast() {
- int i = 0;
- ListIterator<Object> stream = this.buildIteratorUpcast();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testInnerHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testNextAndPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.next().intValue());
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previous().intValue());
- }
- }
-
- public void testInnerNextAndPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.next().intValue());
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previous().intValue());
- }
- }
-
- public void testNextIndexAndPreviousIndex() {
- int i = -1;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.nextIndex());
- stream.next();
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previousIndex());
- stream.previous();
- }
- }
-
- public void testInnerNextIndexAndPreviousIndex() {
- int i = -1;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.nextIndex());
- stream.next();
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previousIndex());
- stream.previous();
- }
- }
-
- public void testRemove() {
- List<String> l = this.buildList();
- for (ListIterator<Integer> stream = this.buildInnerTransformationListIterator(l.listIterator()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildList().size() - 1, l.size());
- assertFalse("element still in list", l.contains("333"));
- assertTrue("wrong element removed", l.contains("22"));
- }
-
- public void testInnerRemove() {
- List<String> l = this.buildList();
- for (ListIterator<Integer> stream = this.buildTransformationListIterator(l.listIterator(), this.buildTransformer()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildList().size() - 1, l.size());
- assertFalse("element still in list", l.contains("333"));
- assertTrue("wrong element removed", l.contains("22"));
- }
-
- public void testUnsupportedOperationExceptionOnAdd() {
- ListIterator<Integer> stream = this.buildIterator();
- boolean exCaught = false;
- try {
- stream.add(new Integer(0));
- fail("exception not thrown");
- } catch (UnsupportedOperationException e) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUnsupportedOperationExceptionOnSet() {
- ListIterator<Integer> stream = this.buildIterator();
- boolean exCaught = false;
- try {
- stream.set(new Integer(0));
- fail("exception not thrown");
- } catch (UnsupportedOperationException e) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<Integer> stream = this.buildIterator();
- Integer integer = null;
- while (stream.hasNext()) {
- integer = stream.next();
- }
- try {
- integer = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + integer, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Integer> stream = this.buildUnmodifiableIterator(); stream.hasNext();) {
- int i = stream.next().intValue();
- if (i == 3) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- boolean exCaught = false;
- try {
- this.buildIterator().remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- private ListIterator<Integer> buildIterator() {
- return this.buildTransformationListIterator(this.buildNestedIterator(), this.buildTransformer());
- }
-
- private ListIterator<Object> buildIteratorUpcast() {
- return this.buildTransformationListIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast());
- }
-
- private ListIterator<Integer> buildInnerIterator() {
- return this.buildInnerTransformationListIterator(this.buildNestedIterator());
- }
-
- private ListIterator<Integer> buildUnmodifiableIterator() {
- return this.buildTransformationListIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer());
- }
-
- private ListIterator<Integer> buildTransformationListIterator(ListIterator<String> nestedIterator, Transformer<String, Integer> transformer) {
- return new TransformationListIterator<String, Integer>(nestedIterator, transformer);
- }
-
- private ListIterator<Object> buildTransformationListIteratorUpcast(ListIterator<String> nestedIterator, Transformer<Object, Integer> transformer) {
- return new TransformationListIterator<Object, Object>(nestedIterator, transformer);
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Transformer<Object, Integer> buildTransformerUpcast() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<Object, Integer>() {
- public Integer transform(Object next) {
- return new Integer(((String) next).length());
- }
- };
- }
-
- private ListIterator<Integer> buildInnerTransformationListIterator(ListIterator<String> nestedIterator) {
- // transform each string into an integer with a value of the string's length
- return new TransformationListIterator<String, Integer>(nestedIterator) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private ListIterator<String> buildNestedIterator() {
- return this.buildList().listIterator();
- }
-
- private ListIterator<String> buildUnmodifiableNestedIterator() {
- return this.buildUnmodifiableList().listIterator();
- }
-
- private List<String> buildList() {
- List<String> l = new ArrayList<String>();
- l.add("1");
- l.add("22");
- l.add("333");
- l.add("4444");
- l.add("55555");
- l.add("666666");
- l.add("7777777");
- l.add("88888888");
- return l;
- }
-
- private List<String> buildUnmodifiableList() {
- return Collections.unmodifiableList(this.buildList());
- }
-
- public void testInvalidTransformationListIterator() {
- // missing method override
- Iterator<Integer> iterator = new TransformationListIterator<String, Integer>(this.buildList().listIterator());
- boolean exCaught = false;
- try {
- Integer integer = iterator.next();
- fail("invalid integer: " + integer);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TreeIteratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TreeIteratorTests.java
deleted file mode 100644
index f800e12bde..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/iterators/TreeIteratorTests.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class TreeIteratorTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<TreeNode> nodes = new ArrayList<TreeNode>();
-
- public TreeIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext1() {
- this.verifyHasNext(this.buildTreeIterator1());
- }
-
- public void testHasNext2() {
- this.verifyHasNext(this.buildTreeIterator2());
- }
-
- private void verifyHasNext(Iterator<TreeNode> iterator) {
- int i = 0;
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(this.nodes.size(), i);
- }
-
- public void testNext1() {
- this.verifyNext(this.buildTreeIterator1());
- }
-
- public void testNext2() {
- this.verifyNext(this.buildTreeIterator2());
- }
-
- private void verifyNext(Iterator<TreeNode> iterator) {
- while (iterator.hasNext()) {
- assertTrue("bogus element", this.nodes.contains(iterator.next()));
- }
- }
-
- public void testNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildTreeIterator1());
- }
-
- public void testNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildTreeIterator2());
- }
-
- private void verifyNoSuchElementException(Iterator<TreeNode> iterator) {
- boolean exCaught = false;
- while (iterator.hasNext()) {
- iterator.next();
- }
- try {
- iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- public void testRemove1() {
- this.verifyRemove(this.buildTreeIterator1());
- }
-
- public void testRemove2() {
- this.verifyRemove(this.buildTreeIterator2());
- }
-
- private void verifyRemove(Iterator<TreeNode> iterator) {
- String parentName = "child 2";
- String childName = "grandchild 2A";
- int startSize = this.childrenSize(parentName);
- while (iterator.hasNext()) {
- TreeNode node = iterator.next();
- if (node.getName().equals(childName)) {
- iterator.remove();
- }
- }
- int endSize = this.childrenSize(parentName);
- assertEquals(startSize - 1, endSize);
- }
-
- private int childrenSize(String nodeName) {
- for (Iterator<TreeNode> stream = this.nodes.iterator(); stream.hasNext();) {
- TreeNode node = stream.next();
- if (node.getName().equals(nodeName)) {
- return node.childrenSize();
- }
- }
- throw new IllegalArgumentException(nodeName);
- }
-
- /**
- * build a tree iterator with an explicit midwife
- */
- private Iterator<TreeNode> buildTreeIterator1() {
- return new TreeIterator<TreeNode>(this.buildTree(), this.buildMidwife());
- }
-
- private TreeIterator.Midwife<TreeNode> buildMidwife() {
- return new TreeIterator.Midwife<TreeNode>() {
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- /**
- * build a tree iterator with an override
- */
- private Iterator<TreeNode> buildTreeIterator2() {
- return new TreeIterator<TreeNode>(this.buildTree()) {
- @Override
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- public void testInvalidTreeIterator() {
- // missing method override
- Iterator<TreeNode> iterator = new TreeIterator<TreeNode>(this.buildTree());
- boolean exCaught = false;
- try {
- TreeNode tn = iterator.next();
- fail("invalid tree node: " + tn);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- private TreeNode buildTree() {
- TreeNode root = new TreeNode("root");
- TreeNode child1 = new TreeNode(root, "child 1");
- new TreeNode(child1, "grandchild 1A");
- TreeNode child2 = new TreeNode(root, "child 2");
- new TreeNode(child2, "grandchild 2A");
- TreeNode grandchild2B = new TreeNode(child2, "grandchild 2B");
- new TreeNode(grandchild2B, "great-grandchild 2B1");
- new TreeNode(grandchild2B, "great-grandchild 2B2");
- TreeNode grandchild2C = new TreeNode(child2, "grandchild 2C");
- new TreeNode(grandchild2C, "great-grandchild 2C1");
- new TreeNode(root, "child 3");
- return root;
- }
-
- private class TreeNode {
- private String name;
- private Collection<TreeNode> children = new ArrayList<TreeNode>();
-
- public TreeNode(String name) {
- super();
- TreeIteratorTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public TreeNode(TreeNode parent, String name) {
- this(name);
- parent.addChild(this);
- }
-
- public String getName() {
- return this.name;
- }
-
- private void addChild(TreeNode child) {
- this.children.add(child);
- }
-
- public Iterator<TreeNode> children() {
- return this.children.iterator();
- }
-
- public int childrenSize() {
- return this.children.size();
- }
-
- @Override
- public String toString() {
- return "TreeNode(" + this.name + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/ChangeSupportTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/ChangeSupportTests.java
deleted file mode 100644
index 2166827530..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/ChangeSupportTests.java
+++ /dev/null
@@ -1,4575 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EventListener;
-import java.util.HashSet;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.TreeChangeAdapter;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ChangeSupportTests
- extends TestCase
-{
- TestModel testModel;
- static final String TEST_TO_STRING = "this is a test";
-
- ChangeListener changeListener = new Adapter();
-
- StateChangeEvent stateChangeEvent;
- boolean stateChangedCalled = false;
-
- PropertyChangeEvent propertyChangeEvent;
- boolean propertyChangeCalled = false;
- static final String PROPERTY_NAME = "propertyName";
- static final Object OLD_OBJECT_VALUE = new Object();
- static final Object NEW_OBJECT_VALUE = new Object();
- static final Integer OLD_INT_VALUE = new Integer(27);
- static final Boolean OLD_BOOLEAN_VALUE = Boolean.TRUE;
- static final Integer NEW_INT_VALUE = new Integer(42);
- static final Boolean NEW_BOOLEAN_VALUE = Boolean.FALSE;
-
- CollectionEvent collectionEvent;
- boolean itemsAddedCollectionCalled = false;
- boolean itemsRemovedCollectionCalled = false;
- boolean collectionChangedCalled = false;
- boolean collectionClearedCalled = false;
- static final String COLLECTION_NAME = "collectionName";
- static final Object ADDED_OBJECT_VALUE = new Object();
- static final Object ADDED_OBJECT_VALUE_2 = new Object();
- static final Object REMOVED_OBJECT_VALUE = new Object();
- static final int TARGET_INDEX = 7;
- static final int SOURCE_INDEX = 22;
-
- ListEvent listEvent;
- boolean itemsAddedListCalled = false;
- boolean itemsRemovedListCalled = false;
- boolean itemsReplacedListCalled = false;
- boolean itemsMovedListCalled = false;
- boolean listChangedCalled = false;
- boolean listClearedCalled = false;
- static final String LIST_NAME = "listName";
- static final int ADD_INDEX = 3;
- static final int REMOVE_INDEX = 5;
- static final int REPLACE_INDEX = 2;
-
- TreeEvent treeEvent;
- boolean nodeAddedCalled = false;
- boolean nodeRemovedCalled = false;
- boolean treeChangedCalled = false;
- boolean treeClearedCalled = false;
- static final String TREE_NAME = "treeName";
- static final List<Object> OBJECT_PATH = Arrays.asList(new Object[] {new Object(), new Object(), new String()});
-
-
- public ChangeSupportTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testModel = new TestModel();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
-
- // ********** general tests **********
-
- public void testNullSource() {
- boolean exCaught = false;
- try {
- ChangeSupport cs = new ChangeSupport(null);
- fail("bogus change support: " + cs);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- // ********** state change tests **********
-
- public void testFireStateChange() {
- this.stateChangeEvent = null;
- this.stateChangedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireStateChange();
- assertNotNull(this.stateChangeEvent);
- assertEquals(this.testModel, this.stateChangeEvent.getSource());
- assertTrue(this.stateChangedCalled);
- }
-
- public void testHasAnyStateChangeListeners() {
- assertTrue(this.testModel.hasNoStateChangeListeners());
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.hasAnyStateChangeListeners());
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.hasNoStateChangeListeners());
- }
-
- public void testHasAnyStateChangeListenersDuplicate() {
- assertTrue(this.testModel.hasNoStateChangeListeners());
- this.testModel.addChangeListener(this.changeListener);
- boolean exCaught = false;
- try {
- this.testModel.addChangeListener(this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- assertTrue(this.testModel.hasAnyStateChangeListeners());
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.hasNoStateChangeListeners());
-
- exCaught = false;
- try {
- this.testModel.removeChangeListener(this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(this.testModel.hasNoStateChangeListeners());
- }
-
- public void testAddNullStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.addStateChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeChangeListener(this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeChangeListener(this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addChangeListener(this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(new Adapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(new StateChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- // ********** property change tests **********
-
- public void testFirePropertyChangedEvent() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedEvent();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedEvent();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedEvent();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedEvent();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedEventNoChange() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedEventNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedEventNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedEventNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedEventNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedObjectObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedObjectObjectNoChange() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObjectObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObjectObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObjectObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObjectObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedObjectNoChange() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedObjectNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedIntInt() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedIntIntNoChange() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedIntIntNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedIntIntNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedIntIntNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedIntIntNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedBooleanBoolean() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangedBooleanBooleanNoChange() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBooleanNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBooleanNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBooleanNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- this.testModel.testFirePropertyChangedBooleanBooleanNoChange();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testHasAnyPropertyChangeListeners() {
- assertTrue(this.testModel.hasNoPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.hasNoPropertyChangeListeners(PROPERTY_NAME));
-
- assertTrue(this.testModel.hasNoPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this.changeListener);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this.changeListener);
- assertTrue(this.testModel.hasNoPropertyChangeListeners(PROPERTY_NAME));
- }
-
- public void testAddNullPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.addChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullPropertyListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addPropertyChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", new PropertyChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", new PropertyChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", new PropertyChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private void verifyPropertyChangeEvent(Object oldValue, Object newValue) {
- this.verifyPropertyChangeEvent(this.testModel, oldValue, newValue);
- }
-
- private void verifyPropertyChangeEvent(Object source, Object oldValue, Object newValue) {
- assertNotNull(this.propertyChangeEvent);
- assertEquals(source, this.propertyChangeEvent.getSource());
- assertEquals(PROPERTY_NAME, this.propertyChangeEvent.getPropertyName());
- assertEquals(oldValue, this.propertyChangeEvent.getOldValue());
- assertEquals(newValue, this.propertyChangeEvent.getNewValue());
- }
-
-
- // ********** collection change tests **********
-
- public void testFireItemsAddedCollectionEvent() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollectionEvent();
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollectionEvent();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollectionEvent();
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollectionEvent();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemsAddedCollectionEventNoChange() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemsAddedCollection() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollection();
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollection();
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemsAddedCollectionNoChange() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsAddedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemAddedCollection() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemsRemovedCollectionEvent() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEvent();
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEvent();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEvent();
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEvent();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireItemsRemovedCollectionEventNoChange() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollectionEventNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireItemsRemovedCollection() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollection();
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollection();
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireItemsRemovedCollectionNoChange() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedCollectionNoChange();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireItemRemovedCollection() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireCollectionCleared() {
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
- }
-
- public void testFireCollectionChangedEvent() {
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireCollectionChangedEvent();
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireCollectionChangedEvent();
- assertNull(this.collectionEvent);
- assertFalse(this.collectionChangedCalled);
-
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireCollectionChangedEvent();
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireCollectionChangedEvent();
- assertNull(this.collectionEvent);
- assertFalse(this.collectionChangedCalled);
- }
-
- public void testFireCollectionChanged() {
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionEvent);
- assertFalse(this.collectionChangedCalled);
-
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionEvent);
- assertFalse(this.collectionChangedCalled);
- }
-
- public void testAddItemToCollection() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testAddItemToCollection());
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testAddItemToCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testAddItemToCollection());
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testAddItemToCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testAddItemToCollectionNoChange() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testAddItemToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testAddItemToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testAddItemToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testAddItemToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testAddItemsToCollection() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollection());
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollection());
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testAddItemsToCollectionNoChange() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testAddItemsToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testAddItemsToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testAddItemsToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testAddItemsToCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testAddItemsToCollectionMixed() {
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollectionMixed());
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE_2);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollectionMixed());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollectionMixed());
- this.verifyCollectionEvent(ADDED_OBJECT_VALUE_2);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testAddItemsToCollectionMixed());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testRemoveItemFromCollection() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testRemoveItemFromCollection());
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testRemoveItemFromCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRemoveItemFromCollection());
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRemoveItemFromCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testRemoveItemFromCollectionNoChange() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemFromCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemFromCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemFromCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemFromCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testRemoveItemsFromCollection() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testRemoveItemsFromCollection());
- this.verifyCollectionChangeEvent2(REMOVED_OBJECT_VALUE, "foo", "bar");
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testRemoveItemsFromCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRemoveItemsFromCollection());
- this.verifyCollectionChangeEvent2(REMOVED_OBJECT_VALUE, "foo", "bar");
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRemoveItemsFromCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testRemoveItemsFromCollectionNoChange1() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testRemoveItemsFromCollectionNoChange2() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testRemoveItemsFromCollectionNoChange3() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange3());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange3());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange3());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRemoveItemsFromCollectionNoChange3());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testRetainItemsInCollection1() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection1());
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection1());
- this.verifyCollectionEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- // collection cleared...
- public void testRetainItemsInCollection2() {
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection2());
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection2());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection2());
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testRetainItemsInCollection2());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
- }
-
- public void testRetainItemsInCollectionNoChange1() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange1());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testRetainItemsInCollectionNoChange2() {
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testRetainItemsInCollectionNoChange2());
- assertNull(this.collectionEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testClearCollection() {
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.testClearCollection());
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.testClearCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testClearCollection());
- this.verifyCollectionEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.testClearCollection());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
- }
-
- public void testClearCollectionNoChange() {
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- assertFalse(this.testModel.testClearCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- assertFalse(this.testModel.testClearCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testClearCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertFalse(this.testModel.testClearCollectionNoChange());
- assertNull(this.collectionEvent);
- assertFalse(this.collectionClearedCalled);
- }
-
- public void testSynchronizeCollection1() {
- CollectionSynchListener csl = new CollectionSynchListener();
- this.testModel.addChangeListener(csl);
- assertTrue(this.testModel.testSynchronizeCollection1());
- assertTrue(csl.itemsAdded);
- assertTrue(csl.itemsRemoved);
- assertFalse(csl.collectionChanged);
- assertFalse(csl.collectionCleared);
- assertEquals(2, csl.addedItems.size());
- assertTrue(CollectionTools.containsAll(csl.addedItems, new Object[] {"joo", "jar"}));
- assertEquals(2, csl.removedItems.size());
- assertTrue(CollectionTools.containsAll(csl.removedItems, new Object[] {"foo", "bar"}));
- }
-
- public void testSynchronizeCollection2() {
- CollectionSynchListener csl = new CollectionSynchListener();
- this.testModel.addChangeListener(csl);
- assertTrue(this.testModel.testSynchronizeCollection2());
- assertFalse(csl.itemsAdded);
- assertFalse(csl.itemsRemoved);
- assertFalse(csl.collectionChanged);
- assertTrue(csl.collectionCleared);
- assertTrue(csl.addedItems.isEmpty());
- assertTrue(csl.removedItems.isEmpty());
- }
-
- public void testSynchronizeCollection3() {
- CollectionSynchListener csl = new CollectionSynchListener();
- this.testModel.addChangeListener(csl);
- assertTrue(this.testModel.testSynchronizeCollection3());
- assertTrue(csl.itemsAdded);
- assertFalse(csl.itemsRemoved);
- assertFalse(csl.collectionChanged);
- assertFalse(csl.collectionCleared);
- assertEquals(3, csl.addedItems.size());
- assertTrue(CollectionTools.containsAll(csl.addedItems, new Object[] {"joo", "jar", "baz"}));
- assertTrue(csl.removedItems.isEmpty());
- }
-
- class CollectionSynchListener extends ChangeAdapter {
- boolean itemsAdded = false;
- boolean itemsRemoved = false;
- boolean collectionChanged = false;
- boolean collectionCleared = false;
- Collection<Object> addedItems = new ArrayList<Object>();
- Collection<Object> removedItems = new ArrayList<Object>();
- @Override
- public void collectionChanged(CollectionChangeEvent event) {
- this.collectionChanged = true;
- }
- @Override
- public void collectionCleared(CollectionClearEvent event) {
- this.collectionCleared = true;
- }
- @Override
- public void itemsAdded(CollectionAddEvent event) {
- this.itemsAdded = true;
- CollectionTools.addAll(this.addedItems, event.getItems());
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent event) {
- this.itemsRemoved = true;
- CollectionTools.addAll(this.removedItems, event.getItems());
- }
- }
-
- public void testHasAnyCollectionChangeListeners() {
- assertTrue(this.testModel.hasNoCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.hasNoCollectionChangeListeners(COLLECTION_NAME));
-
- assertTrue(this.testModel.hasNoCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this.changeListener);
- assertTrue(this.testModel.hasNoCollectionChangeListeners(COLLECTION_NAME));
- }
-
- public void testAddNullCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.addCollectionChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", new CollectionChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", new CollectionChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private void verifyCollectionEvent(Object item) {
- assertNotNull(this.collectionEvent);
- assertEquals(this.testModel, this.collectionEvent.getSource());
- assertEquals(COLLECTION_NAME, this.collectionEvent.getCollectionName());
- if (item != null) {
- assertEquals(item, this.getCollectionEventItems().iterator().next());
- }
- }
-
- private Iterable<?> getCollectionEventItems() {
- if (this.collectionEvent instanceof CollectionAddEvent) {
- return ((CollectionAddEvent) this.collectionEvent).getItems();
- } else if (this.collectionEvent instanceof CollectionRemoveEvent) {
- return ((CollectionRemoveEvent) this.collectionEvent).getItems();
- }
- throw new IllegalStateException();
- }
-
- private void verifyCollectionChangeEvent2(Object... items) {
- assertNotNull(this.collectionEvent);
- assertEquals(this.testModel, this.collectionEvent.getSource());
- assertEquals(COLLECTION_NAME, this.collectionEvent.getCollectionName());
- assertEquals(items.length, this.getCollectionEventItemsSize());
- for (Object item : items) {
- assertTrue(CollectionTools.contains(this.getCollectionEventItems(), item));
- }
- }
-
- private int getCollectionEventItemsSize() {
- if (this.collectionEvent instanceof CollectionAddEvent) {
- return ((CollectionAddEvent) this.collectionEvent).getItemsSize();
- } else if (this.collectionEvent instanceof CollectionRemoveEvent) {
- return ((CollectionRemoveEvent) this.collectionEvent).getItemsSize();
- }
- throw new IllegalStateException();
- }
-
-
- // ********** list change tests **********
-
- public void testFireItemsAddedListEvent() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedListEvent();
- this.verifyListAddEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedListEvent();
- this.verifyListAddEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemsAddedListEventNoChange() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemsAddedList() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedList();
- this.verifyListAddEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedList();
- this.verifyListAddEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemsAddedListNoChange() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsAddedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsAddedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemAddedList() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemAddedList();
- this.verifyListAddEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemAddedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemAddedList();
- this.verifyListAddEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemAddedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemsRemovedListEvent() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedListEvent();
- this.verifyListRemoveEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedListEvent();
- this.verifyListRemoveEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemsRemovedListEventNoChange() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemsRemovedList() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedList();
- this.verifyListRemoveEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedList();
- this.verifyListRemoveEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemsRemovedListNoChange() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsRemovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsRemovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemRemovedList() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemRemovedList();
- this.verifyListRemoveEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemRemovedList();
- this.verifyListRemoveEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemsReplacedListEvent() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedListEvent();
- this.verifyListReplaceEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedListEvent();
- this.verifyListReplaceEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemsReplacedListEventNoChange() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemsReplacedList() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedList();
- this.verifyListReplaceEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedList();
- this.verifyListReplaceEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemsReplacedListNoChange() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsReplacedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsReplacedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemReplacedList() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemReplacedList();
- this.verifyListReplaceEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemReplacedList();
- this.verifyListReplaceEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemsMovedListEvent() {
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedListEvent();
- this.verifyListMoveEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedListEvent();
- this.verifyListMoveEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedListEvent();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireItemsMovedListEventNoChange() {
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedListEventNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireItemsMovedList() {
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedList();
- this.verifyListMoveEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedList();
- this.verifyListMoveEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireItemsMovedListNoChange() {
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemsMovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemsMovedListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireItemMovedList() {
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireItemMovedList();
- this.verifyListMoveEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireItemMovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemMovedList();
- this.verifyListMoveEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireItemMovedList();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireListClearedEvent() {
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireListClearedEvent();
- this.verifyListClearEvent();
- assertTrue(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireListClearedEvent();
- assertNull(this.listEvent);
- assertFalse(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListClearedEvent();
- this.verifyListClearEvent();
- assertTrue(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListClearedEvent();
- assertNull(this.listEvent);
- assertFalse(this.listClearedCalled);
- }
-
- public void testFireListCleared() {
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireListCleared();
- this.verifyListClearEvent();
- assertTrue(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireListCleared();
- assertNull(this.listEvent);
- assertFalse(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListCleared();
- this.verifyListClearEvent();
- assertTrue(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListCleared();
- assertNull(this.listEvent);
- assertFalse(this.listClearedCalled);
- }
-
- public void testFireListChangedEvent() {
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireListChangedEvent();
- this.verifyListChangeEvent();
- assertTrue(this.listChangedCalled);
-
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireListChangedEvent();
- assertNull(this.listEvent);
- assertFalse(this.listChangedCalled);
-
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListChangedEvent();
- this.verifyListChangeEvent();
- assertTrue(this.listChangedCalled);
-
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListChangedEvent();
- assertNull(this.listEvent);
- assertFalse(this.listChangedCalled);
- }
-
- public void testFireListChanged() {
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent();
- assertTrue(this.listChangedCalled);
-
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireListChanged();
- assertNull(this.listEvent);
- assertFalse(this.listChangedCalled);
-
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent();
- assertTrue(this.listChangedCalled);
-
- this.listEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testFireListChanged();
- assertNull(this.listEvent);
- assertFalse(this.listChangedCalled);
- }
-
- public void testAddItemToListIndex() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testAddItemToListIndex();
- this.verifyListAddEvent(2, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testAddItemToListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemToListIndex();
- this.verifyListAddEvent(2, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemToListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testAddItemToList() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testAddItemToList();
- this.verifyListAddEvent(3, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testAddItemToList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemToList();
- this.verifyListAddEvent(3, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemToList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testAddItemsToListIndex() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testAddItemsToListIndex();
- this.verifyListAddEvent(2, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testAddItemsToListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToListIndex();
- this.verifyListAddEvent(2, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testAddItemsToListIndexNoChange() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testAddItemsToListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testAddItemsToListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testAddItemsToList() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testAddItemsToList();
- this.verifyListAddEvent(3, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testAddItemsToList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToList();
- this.verifyListAddEvent(3, "joo");
- assertTrue(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToList();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testAddItemsToListNoChange() {
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testAddItemsToListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testAddItemsToListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testAddItemsToListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testRemoveItemFromListIndex() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testRemoveItemFromListIndex();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testRemoveItemFromListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemFromListIndex();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemFromListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testRemoveItemFromList() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testRemoveItemFromList();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testRemoveItemFromList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemFromList();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemFromList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testRemoveItemsFromListIndex() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromListIndex();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromListIndex();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromListIndex();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testRemoveItemsFromListIndexNoChange() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromListIndexNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testRemoveItemsFromList() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromList();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromList();
- this.verifyListRemoveEvent(1, "bar");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testRemoveItemsFromListNoChange() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testRemoveItemsFromListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRemoveItemsFromListNoChange();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testRetainItemsInList() {
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testRetainItemsInList();
- this.verifyListRemoveEvent(0, "foo");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testRetainItemsInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRetainItemsInList();
- this.verifyListRemoveEvent(0, "foo");
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testRetainItemsInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testReplaceItemInList() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testReplaceItemInList();
- this.verifyListReplaceEvent(1, "xxx", "bar");
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testReplaceItemInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testReplaceItemInList();
- this.verifyListReplaceEvent(1, "xxx", "bar");
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testReplaceItemInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testSetItemsInList() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testSetItemsInList();
- this.verifyListReplaceEvent(1, "xxx", "bar");
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testSetItemsInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testSetItemsInList();
- this.verifyListReplaceEvent(1, "xxx", "bar");
- assertTrue(this.itemsReplacedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testSetItemsInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testMoveItemsInList() {
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testMoveItemsInList();
- this.verifyListMoveEvent(2, 4, 2);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testMoveItemsInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testMoveItemsInList();
- this.verifyListMoveEvent(2, 4, 2);
- assertTrue(this.itemsMovedListCalled);
-
- this.listEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testMoveItemsInList();
- assertNull(this.listEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testClearList() {
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testClearList();
- this.verifyListClearEvent();
- assertTrue(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testClearList();
- assertNull(this.listEvent);
- assertFalse(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testClearList();
- this.verifyListClearEvent();
- assertTrue(this.listClearedCalled);
-
- this.listEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testClearList();
- assertNull(this.listEvent);
- assertFalse(this.listClearedCalled);
- }
-
- public void testSynchronizeList() {
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.itemsRemovedListCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testSynchronizeList();
- assertNotNull(this.listEvent);
- assertTrue(this.itemsReplacedListCalled);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.itemsRemovedListCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testSynchronizeList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testSynchronizeList();
- assertNotNull(this.listEvent);
- assertTrue(this.itemsReplacedListCalled);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listEvent = null;
- this.itemsReplacedListCalled = false;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- this.testModel.testSynchronizeList();
- assertNull(this.listEvent);
- assertFalse(this.itemsReplacedListCalled);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testHasAnyListChangeListeners() {
- assertTrue(this.testModel.hasNoListChangeListeners(LIST_NAME));
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.hasNoListChangeListeners(LIST_NAME));
-
- assertTrue(this.testModel.hasNoListChangeListeners(LIST_NAME));
- this.testModel.addListChangeListener(LIST_NAME, this.changeListener);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeListChangeListener(LIST_NAME, this.changeListener);
- assertTrue(this.testModel.hasNoListChangeListeners(LIST_NAME));
- }
-
- public void testAddNullListListener() {
- boolean exCaught = false;
- try {
- this.testModel.addListChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusListListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addListChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", new ListChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", new ListChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private void verifyListAddEvent(int index, Object item) {
- assertNotNull(this.listEvent);
- assertEquals(this.testModel, this.listEvent.getSource());
- assertEquals(LIST_NAME, this.listEvent.getListName());
- assertEquals(index, ((ListAddEvent) this.listEvent).getIndex());
- assertEquals(item, ((ListAddEvent) this.listEvent).getItems().iterator().next());
- }
-
- private void verifyListRemoveEvent(int index, Object item) {
- assertNotNull(this.listEvent);
- assertEquals(this.testModel, this.listEvent.getSource());
- assertEquals(LIST_NAME, this.listEvent.getListName());
- assertEquals(index, ((ListRemoveEvent) this.listEvent).getIndex());
- assertEquals(item, ((ListRemoveEvent) this.listEvent).getItems().iterator().next());
- }
-
- private void verifyListReplaceEvent(int index, Object newItem, Object oldItem) {
- assertNotNull(this.listEvent);
- assertEquals(this.testModel, this.listEvent.getSource());
- assertEquals(LIST_NAME, this.listEvent.getListName());
- assertEquals(index, ((ListReplaceEvent) this.listEvent).getIndex());
- assertEquals(newItem, ((ListReplaceEvent) this.listEvent).getNewItems().iterator().next());
- assertEquals(oldItem, ((ListReplaceEvent) this.listEvent).getOldItems().iterator().next());
- }
-
- private void verifyListMoveEvent(int targetIndex, int sourceIndex) {
- this.verifyListMoveEvent(targetIndex, sourceIndex, 1);
- }
-
- private void verifyListMoveEvent(int targetIndex, int sourceIndex, int length) {
- assertNotNull(this.listEvent);
- assertEquals(this.testModel, this.listEvent.getSource());
- assertEquals(LIST_NAME, this.listEvent.getListName());
- assertEquals(targetIndex, ((ListMoveEvent) this.listEvent).getTargetIndex());
- assertEquals(sourceIndex, ((ListMoveEvent) this.listEvent).getSourceIndex());
- assertEquals(length, ((ListMoveEvent) this.listEvent).getLength());
- }
-
- private void verifyListClearEvent() {
- assertNotNull(this.listEvent);
- assertEquals(this.testModel, this.listEvent.getSource());
- assertEquals(LIST_NAME, this.listEvent.getListName());
- assertEquals(ListClearEvent.class, this.listEvent.getClass());
- }
-
- private void verifyListChangeEvent() {
- assertNotNull(this.listEvent);
- assertEquals(this.testModel, this.listEvent.getSource());
- assertEquals(LIST_NAME, this.listEvent.getListName());
- assertEquals(ListChangeEvent.class, this.listEvent.getClass());
- }
-
-
- // ********** tree change tests **********
-
- public void testFireNodeAddedTree() {
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireNodeAddedTree();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireNodeAddedTree();
- assertNull(this.treeEvent);
- assertFalse(this.nodeAddedCalled);
-
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeAddedTree();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeAddedTree();
- assertNull(this.treeEvent);
- assertFalse(this.nodeAddedCalled);
- }
-
- public void testFireNodeAddedTreeEvent() {
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireNodeAddedTreeEvent();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireNodeAddedTreeEvent();
- assertNull(this.treeEvent);
- assertFalse(this.nodeAddedCalled);
-
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeAddedTreeEvent();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeAddedTreeEvent();
- assertNull(this.treeEvent);
- assertFalse(this.nodeAddedCalled);
- }
-
- public void testFireNodeRemovedTreeEvent() {
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireNodeRemovedTreeEvent();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireNodeRemovedTreeEvent();
- assertNull(this.treeEvent);
- assertFalse(this.nodeRemovedCalled);
-
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeRemovedTreeEvent();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeRemovedTreeEvent();
- assertNull(this.treeEvent);
- assertFalse(this.nodeRemovedCalled);
- }
-
- public void testFireNodeRemovedTree() {
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireNodeRemovedTree();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireNodeRemovedTree();
- assertNull(this.treeEvent);
- assertFalse(this.nodeRemovedCalled);
-
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeRemovedTree();
- this.verifyTreeEvent(OBJECT_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireNodeRemovedTree();
- assertNull(this.treeEvent);
- assertFalse(this.nodeRemovedCalled);
- }
-
- public void testFireTreeClearedEvent() {
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireTreeClearedEvent();
- this.verifyTreeEvent(null);
- assertTrue(this.treeClearedCalled);
-
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireTreeClearedEvent();
- assertNull(this.treeEvent);
- assertFalse(this.treeClearedCalled);
-
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeClearedEvent();
- this.verifyTreeEvent(null);
- assertTrue(this.treeClearedCalled);
-
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeClearedEvent();
- assertNull(this.treeEvent);
- assertFalse(this.treeClearedCalled);
- }
-
- public void testFireTreeCleared() {
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireTreeCleared();
- this.verifyTreeEvent(null);
- assertTrue(this.treeClearedCalled);
-
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeEvent);
- assertFalse(this.treeClearedCalled);
-
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeCleared();
- this.verifyTreeEvent(null);
- assertTrue(this.treeClearedCalled);
-
- this.treeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeEvent);
- assertFalse(this.treeClearedCalled);
- }
-
- public void testFireTreeChangedEvent() {
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireTreeChangedEvent();
- this.verifyTreeEvent(null);
- assertTrue(this.treeChangedCalled);
-
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireTreeChangedEvent();
- assertNull(this.treeEvent);
- assertFalse(this.treeChangedCalled);
-
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeChangedEvent();
- this.verifyTreeEvent(null);
- assertTrue(this.treeChangedCalled);
-
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeChangedEvent();
- assertNull(this.treeEvent);
- assertFalse(this.treeChangedCalled);
- }
-
- public void testFireTreeChanged() {
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addChangeListener(this.changeListener);
- this.testModel.testFireTreeChanged();
- this.verifyTreeEvent(null);
- assertTrue(this.treeChangedCalled);
-
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeChangeListener(this.changeListener);
- this.testModel.testFireTreeChanged();
- assertNull(this.treeEvent);
- assertFalse(this.treeChangedCalled);
-
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeChanged();
- this.verifyTreeEvent(null);
- assertTrue(this.treeChangedCalled);
-
- this.treeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- this.testModel.testFireTreeChanged();
- assertNull(this.treeEvent);
- assertFalse(this.treeChangedCalled);
- }
-
- public void testHasAnyTreeChangeListeners() {
- assertTrue(this.testModel.hasNoTreeChangeListeners(TREE_NAME));
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeChangeListener(this.changeListener);
- assertTrue(this.testModel.hasNoTreeChangeListeners(TREE_NAME));
-
- assertTrue(this.testModel.hasNoTreeChangeListeners(TREE_NAME));
- this.testModel.addTreeChangeListener(TREE_NAME, this.changeListener);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeTreeChangeListener(TREE_NAME, this.changeListener);
- assertTrue(this.testModel.hasNoTreeChangeListeners(TREE_NAME));
- }
-
- public void testAddNullTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.addTreeChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this.changeListener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addTreeChangeListener("foo", this.changeListener);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", new TreeChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", new TreeChangeAdapter());
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- private void verifyTreeEvent(List<?> path) {
- assertNotNull(this.treeEvent);
- assertEquals(this.testModel, this.treeEvent.getSource());
- assertEquals(TREE_NAME, this.treeEvent.getTreeName());
- assertEquals(path, this.getListPath());
- }
-
- private List<?> getListPath() {
- Iterable<?> iterable = this.getPath();
- return (iterable == null) ? null : CollectionTools.list(iterable);
- }
-
- private Iterable<?> getPath() {
- if (this.treeEvent instanceof TreeAddEvent) {
- return ((TreeAddEvent) this.treeEvent).getPath();
- }
- if (this.treeEvent instanceof TreeRemoveEvent) {
- return ((TreeRemoveEvent) this.treeEvent).getPath();
- }
- return null;
- }
-
-
-
- // ********** convenience method tests **********
-
- public void testElementsAreEqual() {
- Collection<String> c1 = new ArrayList<String>();
- c1.add("foo");
- c1.add("bar");
- c1.add("baz");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("foo");
- c2.add("bar");
- c2.add("baz");
- assertTrue(this.testModel.testElementsAreEqual(c1, c2));
- }
-
- public void testElementsAreDifferent() {
- Collection<String> c1 = new ArrayList<String>();
- c1.add("foo");
- c1.add("bar");
- c1.add("baz");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("baz");
- c2.add("bar");
- c2.add("foo");
- assertTrue(this.testModel.testElementsAreDifferent(c1, c2));
- }
-
-
- // ********** AbstractModel tests **********
-
- public void testAbstractModelValuesAreEqual1() {
- assertTrue(this.testModel.testValuesAreEqual(null, null));
- }
-
- public void testAbstractModelValuesAreEqual2() {
- assertTrue(this.testModel.testValuesAreEqual("foo", "foo"));
- }
-
- public void testAbstractModelValuesAreEqual3() {
- assertFalse(this.testModel.testValuesAreEqual("foo", null));
- }
-
- public void testAbstractModelValuesAreEqual4() {
- assertFalse(this.testModel.testValuesAreEqual(null, "foo"));
- }
-
- public void testAbstractModelValuesAreEqual5() {
- assertFalse(this.testModel.testValuesAreEqual("bar", "foo"));
- }
-
- public void testAbstractModelValuesAreDifferent1() {
- assertFalse(this.testModel.testValuesAreDifferent(null, null));
- }
-
- public void testAbstractModelValuesAreDifferent2() {
- assertFalse(this.testModel.testValuesAreDifferent("foo", "foo"));
- }
-
- public void testAbstractModelValuesAreDifferent3() {
- assertTrue(this.testModel.testValuesAreDifferent("foo", null));
- }
-
- public void testAbstractModelValuesAreDifferent4() {
- assertTrue(this.testModel.testValuesAreDifferent(null, "foo"));
- }
-
- public void testAbstractModelValuesAreDifferent5() {
- assertTrue(this.testModel.testValuesAreDifferent("bar", "foo"));
- }
-
- public void testAbstractModelAttributeValueHasChanged1() {
- assertFalse(this.testModel.testAttributeValueHasChanged(null, null));
- }
-
- public void testAbstractModelAttributeValueHasChanged2() {
- assertFalse(this.testModel.testAttributeValueHasChanged("foo", "foo"));
- }
-
- public void testAbstractModelAttributeValueHasChanged3() {
- assertTrue(this.testModel.testAttributeValueHasChanged("foo", null));
- }
-
- public void testAbstractModelAttributeValueHasChanged4() {
- assertTrue(this.testModel.testAttributeValueHasChanged(null, "foo"));
- }
-
- public void testAbstractModelAttributeValueHasChanged5() {
- assertTrue(this.testModel.testAttributeValueHasChanged("bar", "foo"));
- }
-
- public void testAbstractModelAttributeValueHasNotChanged1() {
- assertTrue(this.testModel.testAttributeValueHasNotChanged(null, null));
- }
-
- public void testAbstractModelAttributeValueHasNotChanged2() {
- assertTrue(this.testModel.testAttributeValueHasNotChanged("foo", "foo"));
- }
-
- public void testAbstractModelAttributeValueHasNotChanged3() {
- assertFalse(this.testModel.testAttributeValueHasNotChanged("foo", null));
- }
-
- public void testAbstractModelAttributeValueHasNotChanged4() {
- assertFalse(this.testModel.testAttributeValueHasNotChanged(null, "foo"));
- }
-
- public void testAbstractModelAttributeValueHasNotChanged5() {
- assertFalse(this.testModel.testAttributeValueHasNotChanged("bar", "foo"));
- }
-
- public void testAbstractModelClone() {
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addChangeListener(this.changeListener);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
-
- // verify that the clone does not have any listeners
- TestModel clone = this.testModel.clone();
- assertFalse(clone.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- clone.addChangeListener(this.changeListener);
- assertTrue(clone.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- // check original
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
-
- // now test events fired by original
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.testFirePropertyChangedObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- // now test events fired by clone
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- clone.testFirePropertyChangedObjectObject();
- this.verifyPropertyChangeEvent(clone, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
- }
-
- public void testAbstractModelToString() {
- assertTrue(this.testModel.toString().contains('(' + TEST_TO_STRING + ')'));
- }
-
-
- // ********** listener implementations **********
-
- class Adapter implements ChangeListener {
- public void stateChanged(StateChangeEvent e) {
- ChangeSupportTests.this.stateChangedCalled = true;
- ChangeSupportTests.this.stateChangeEvent = e;
- }
-
- public void propertyChanged(PropertyChangeEvent e) {
- ChangeSupportTests.this.propertyChangeCalled = true;
- ChangeSupportTests.this.propertyChangeEvent = e;
- }
-
-
- public void itemsAdded(CollectionAddEvent e) {
- ChangeSupportTests.this.itemsAddedCollectionCalled = true;
- ChangeSupportTests.this.collectionEvent = e;
- }
- public void itemsRemoved(CollectionRemoveEvent e) {
- ChangeSupportTests.this.itemsRemovedCollectionCalled = true;
- ChangeSupportTests.this.collectionEvent = e;
- }
- public void collectionCleared(CollectionClearEvent e) {
- ChangeSupportTests.this.collectionClearedCalled = true;
- ChangeSupportTests.this.collectionEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- ChangeSupportTests.this.collectionChangedCalled = true;
- ChangeSupportTests.this.collectionEvent = e;
- }
-
- public void itemsAdded(ListAddEvent e) {
- ChangeSupportTests.this.itemsAddedListCalled = true;
- ChangeSupportTests.this.listEvent = e;
- }
- public void itemsRemoved(ListRemoveEvent e) {
- ChangeSupportTests.this.itemsRemovedListCalled = true;
- ChangeSupportTests.this.listEvent = e;
- }
- public void itemsReplaced(ListReplaceEvent e) {
- ChangeSupportTests.this.itemsReplacedListCalled = true;
- ChangeSupportTests.this.listEvent = e;
- }
- public void itemsMoved(ListMoveEvent e) {
- ChangeSupportTests.this.itemsMovedListCalled = true;
- ChangeSupportTests.this.listEvent = e;
- }
- public void listCleared(ListClearEvent e) {
- ChangeSupportTests.this.listClearedCalled = true;
- ChangeSupportTests.this.listEvent = e;
- }
- public void listChanged(ListChangeEvent e) {
- ChangeSupportTests.this.listChangedCalled = true;
- ChangeSupportTests.this.listEvent = e;
- }
-
- public void nodeAdded(TreeAddEvent e) {
- ChangeSupportTests.this.nodeAddedCalled = true;
- ChangeSupportTests.this.treeEvent = e;
- }
- public void nodeRemoved(TreeRemoveEvent e) {
- ChangeSupportTests.this.nodeRemovedCalled = true;
- ChangeSupportTests.this.treeEvent = e;
- }
- public void treeCleared(TreeClearEvent e) {
- ChangeSupportTests.this.treeClearedCalled = true;
- ChangeSupportTests.this.treeEvent = e;
- }
- public void treeChanged(TreeChangeEvent e) {
- ChangeSupportTests.this.treeChangedCalled = true;
- ChangeSupportTests.this.treeEvent = e;
- }
- }
-
-
- // ********** inner class **********
-
- private static class TestModel extends AbstractModel implements Cloneable {
- TestModel() {
- super();
- }
-
- // ***** state
- public void testFireStateChange() {
- this.fireStateChanged();
- }
-
- // ***** property
- public void testFirePropertyChangedEvent() {
- this.firePropertyChanged(new PropertyChangeEvent(this, PROPERTY_NAME, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE));
- }
-
- public void testFirePropertyChangedEventNoChange() {
- this.firePropertyChanged(new PropertyChangeEvent(this, PROPERTY_NAME, OLD_OBJECT_VALUE, OLD_OBJECT_VALUE));
- }
-
- public void testFirePropertyChangedObjectObject() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangedObjectObjectNoChange() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_OBJECT_VALUE, OLD_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangedObject() {
- this.firePropertyChanged(PROPERTY_NAME, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangedObjectNoChange() {
- this.firePropertyChanged(PROPERTY_NAME, null);
- }
-
- public void testFirePropertyChangedIntInt() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_INT_VALUE.intValue(), NEW_INT_VALUE.intValue());
- }
-
- public void testFirePropertyChangedIntIntNoChange() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_INT_VALUE.intValue(), OLD_INT_VALUE.intValue());
- }
-
- public void testFirePropertyChangedBooleanBoolean() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_BOOLEAN_VALUE.booleanValue(), NEW_BOOLEAN_VALUE.booleanValue());
- }
-
- public void testFirePropertyChangedBooleanBooleanNoChange() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_BOOLEAN_VALUE.booleanValue(), OLD_BOOLEAN_VALUE.booleanValue());
- }
-
- // ***** collection
- public void testFireItemsAddedCollectionEvent() {
- this.fireItemsAdded(new CollectionAddEvent(this, COLLECTION_NAME, ADDED_OBJECT_VALUE));
- }
-
- public void testFireItemsAddedCollectionEventNoChange() {
- this.fireItemsAdded(new CollectionAddEvent(this, COLLECTION_NAME, Collections.emptySet()));
- }
-
- public void testFireItemsAddedCollection() {
- this.fireItemsAdded(COLLECTION_NAME, Collections.singleton(ADDED_OBJECT_VALUE));
- }
-
- public void testFireItemsAddedCollectionNoChange() {
- this.fireItemsAdded(COLLECTION_NAME, Collections.emptySet());
- }
-
- public void testFireItemAddedCollection() {
- this.fireItemAdded(COLLECTION_NAME, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemsRemovedCollectionEvent() {
- this.fireItemsRemoved(new CollectionRemoveEvent(this, COLLECTION_NAME, REMOVED_OBJECT_VALUE));
- }
-
- public void testFireItemsRemovedCollectionEventNoChange() {
- this.fireItemsRemoved(new CollectionRemoveEvent(this, COLLECTION_NAME, Collections.emptySet()));
- }
-
- public void testFireItemsRemovedCollection() {
- this.fireItemsRemoved(COLLECTION_NAME, Collections.singleton(REMOVED_OBJECT_VALUE));
- }
-
- public void testFireItemsRemovedCollectionNoChange() {
- this.fireItemsRemoved(COLLECTION_NAME, Collections.emptySet());
- }
-
- public void testFireItemRemovedCollection() {
- this.fireItemRemoved(COLLECTION_NAME, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireCollectionCleared() {
- this.fireCollectionCleared(COLLECTION_NAME);
- }
-
- public void testFireCollectionChangedEvent() {
- this.fireCollectionChanged(new CollectionChangeEvent(this, COLLECTION_NAME, Collections.emptySet()));
- }
-
- public void testFireCollectionChanged() {
- this.fireCollectionChanged(COLLECTION_NAME, Collections.emptySet());
- }
-
- public boolean testAddItemToCollection() {
- return this.addItemToCollection(ADDED_OBJECT_VALUE, new ArrayList<Object>(), COLLECTION_NAME);
- }
-
- public boolean testAddItemToCollectionNoChange() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(ADDED_OBJECT_VALUE);
- return this.addItemToCollection(ADDED_OBJECT_VALUE, collection, COLLECTION_NAME);
- }
-
- public boolean testAddItemsToCollection() {
- return this.addItemsToCollection(Collections.singleton(ADDED_OBJECT_VALUE), new ArrayList<Object>(), COLLECTION_NAME);
- }
-
- public boolean testAddItemsToCollectionNoChange() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(ADDED_OBJECT_VALUE);
- return this.addItemsToCollection(Collections.singleton(ADDED_OBJECT_VALUE), collection, COLLECTION_NAME);
- }
-
- public boolean testAddItemsToCollectionMixed() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(ADDED_OBJECT_VALUE);
- return this.addItemsToCollection(new Object[] {ADDED_OBJECT_VALUE, ADDED_OBJECT_VALUE_2}, collection, COLLECTION_NAME);
- }
-
- public boolean testRemoveItemFromCollection() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- return this.removeItemFromCollection(REMOVED_OBJECT_VALUE, collection, COLLECTION_NAME);
- }
-
- public boolean testRemoveItemFromCollectionNoChange() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- return this.removeItemFromCollection("foo", collection, COLLECTION_NAME);
- }
-
- public boolean testRemoveItemsFromCollection() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- collection.add("foo");
- collection.add("bar");
- return this.removeItemsFromCollection(new Object[] {"foo", "bar", REMOVED_OBJECT_VALUE}, collection, COLLECTION_NAME);
- }
-
- public boolean testRemoveItemsFromCollectionNoChange1() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- return this.removeItemsFromCollection(Collections.emptySet(), collection, COLLECTION_NAME);
- }
-
- public boolean testRemoveItemsFromCollectionNoChange2() {
- Collection<Object> collection = new HashSet<Object>();
- return this.removeItemsFromCollection(Collections.singleton("foo"), collection, COLLECTION_NAME);
- }
-
- public boolean testRemoveItemsFromCollectionNoChange3() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- return this.removeItemsFromCollection(Collections.singleton("foo"), collection, COLLECTION_NAME);
- }
-
- public boolean testRetainItemsInCollection1() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- collection.add("foo");
- collection.add("bar");
- return this.retainItemsInCollection(new Object[] {"foo", "bar"}, collection, COLLECTION_NAME);
- }
-
- public boolean testRetainItemsInCollection2() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- collection.add("foo");
- collection.add("bar");
- return this.retainItemsInCollection(Collections.emptySet(), collection, COLLECTION_NAME);
- }
-
- public boolean testRetainItemsInCollectionNoChange1() {
- Collection<Object> collection = new HashSet<Object>();
- return this.retainItemsInCollection(new Object[] {"foo", "bar"}, collection, COLLECTION_NAME);
- }
-
- public boolean testRetainItemsInCollectionNoChange2() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- collection.add("foo");
- collection.add("bar");
- return this.retainItemsInCollection(new Object[] {"foo", "bar", REMOVED_OBJECT_VALUE}, collection, COLLECTION_NAME);
- }
-
- public boolean testClearCollection() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add(REMOVED_OBJECT_VALUE);
- collection.add("foo");
- collection.add("bar");
- return this.clearCollection(collection, COLLECTION_NAME);
- }
-
- public boolean testClearCollectionNoChange() {
- Collection<Object> collection = new HashSet<Object>();
- return this.clearCollection(collection, COLLECTION_NAME);
- }
-
- public boolean testSynchronizeCollection1() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add("foo");
- collection.add("bar");
- collection.add("baz");
- Collection<Object> newCollection = new HashSet<Object>();
- newCollection.add("joo");
- newCollection.add("jar");
- newCollection.add("baz");
- boolean result = this.synchronizeCollection(newCollection, collection, COLLECTION_NAME);
- assertEquals(newCollection, collection);
- return result;
- }
-
- public boolean testSynchronizeCollection2() {
- Collection<Object> collection = new HashSet<Object>();
- collection.add("foo");
- collection.add("bar");
- collection.add("baz");
- Collection<Object> newCollection = new HashSet<Object>();
- boolean result = this.synchronizeCollection(newCollection, collection, COLLECTION_NAME);
- assertEquals(newCollection, collection);
- return result;
- }
-
- public boolean testSynchronizeCollection3() {
- Collection<Object> collection = new HashSet<Object>();
- Collection<Object> newCollection = new HashSet<Object>();
- newCollection.add("joo");
- newCollection.add("jar");
- newCollection.add("baz");
- boolean result = this.synchronizeCollection(newCollection, collection, COLLECTION_NAME);
- assertEquals(newCollection, collection);
- return result;
- }
-
- // ***** list
- public void testFireItemsAddedListEvent() {
- this.fireItemsAdded(new ListAddEvent(this, LIST_NAME, ADD_INDEX, ADDED_OBJECT_VALUE));
- }
-
- public void testFireItemsAddedListEventNoChange() {
- this.fireItemsAdded(new ListAddEvent(this, LIST_NAME, ADD_INDEX, Collections.emptyList()));
- }
-
- public void testFireItemsAddedList() {
- this.fireItemsAdded(LIST_NAME, ADD_INDEX, Collections.singletonList(ADDED_OBJECT_VALUE));
- }
-
- public void testFireItemsAddedListNoChange() {
- this.fireItemsAdded(LIST_NAME, ADD_INDEX, Collections.emptyList());
- }
-
- public void testFireItemAddedList() {
- this.fireItemAdded(LIST_NAME, ADD_INDEX, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemsRemovedListEvent() {
- this.fireItemsRemoved(new ListRemoveEvent(this, LIST_NAME, REMOVE_INDEX, REMOVED_OBJECT_VALUE));
- }
-
- public void testFireItemsRemovedListEventNoChange() {
- this.fireItemsRemoved(new ListRemoveEvent(this, LIST_NAME, REMOVE_INDEX, Collections.emptyList()));
- }
-
- public void testFireItemsRemovedList() {
- this.fireItemsRemoved(LIST_NAME, REMOVE_INDEX, Collections.singletonList(REMOVED_OBJECT_VALUE));
- }
-
- public void testFireItemsRemovedListNoChange() {
- this.fireItemsRemoved(LIST_NAME, REMOVE_INDEX, Collections.emptyList());
- }
-
- public void testFireItemRemovedList() {
- this.fireItemRemoved(LIST_NAME, REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemsReplacedListEvent() {
- this.fireItemsReplaced(new ListReplaceEvent(this, LIST_NAME, REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE));
- }
-
- public void testFireItemsReplacedListEventNoChange() {
- this.fireItemsReplaced(new ListReplaceEvent(this, LIST_NAME, REPLACE_INDEX, Collections.emptyList(), Collections.emptyList()));
- }
-
- public void testFireItemsReplacedList() {
- this.fireItemsReplaced(LIST_NAME, REPLACE_INDEX, Collections.singletonList(ADDED_OBJECT_VALUE), Collections.singletonList(REMOVED_OBJECT_VALUE));
- }
-
- public void testFireItemsReplacedListNoChange() {
- this.fireItemsReplaced(LIST_NAME, REPLACE_INDEX, Collections.emptyList(), Collections.emptyList());
- }
-
- public void testFireItemReplacedList() {
- this.fireItemReplaced(LIST_NAME, REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemsMovedListEvent() {
- this.fireItemsMoved(new ListMoveEvent(this, LIST_NAME, TARGET_INDEX, SOURCE_INDEX, 1));
- }
-
- public void testFireItemsMovedListEventNoChange() {
- this.fireItemsMoved(new ListMoveEvent(this, LIST_NAME, SOURCE_INDEX, SOURCE_INDEX, 1));
- }
-
- public void testFireItemsMovedList() {
- this.fireItemsMoved(LIST_NAME, TARGET_INDEX, SOURCE_INDEX, 1);
- }
-
- public void testFireItemsMovedListNoChange() {
- this.fireItemsMoved(LIST_NAME, SOURCE_INDEX, SOURCE_INDEX, 1);
- }
-
- public void testFireItemMovedList() {
- this.fireItemMoved(LIST_NAME, TARGET_INDEX, SOURCE_INDEX);
- }
-
- public void testFireListClearedEvent() {
- this.fireListCleared(new ListClearEvent(this, LIST_NAME));
- }
-
- public void testFireListCleared() {
- this.fireListCleared(LIST_NAME);
- }
-
- public void testFireListChangedEvent() {
- this.fireListChanged(new ListChangeEvent(this, LIST_NAME, Collections.emptyList()));
- }
-
- public void testFireListChanged() {
- this.fireListChanged(LIST_NAME, Collections.emptyList());
- }
-
- public void testAddItemToListIndex() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.addItemToList(2, "joo", list, LIST_NAME);
- }
-
- public void testAddItemToList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.addItemToList("joo", list, LIST_NAME);
- }
-
- public void testAddItemsToListIndex() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.addItemsToList(2, Collections.singletonList("joo"), list, LIST_NAME);
- }
-
- public void testAddItemsToListIndexNoChange() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.addItemsToList(2, Collections.<String>emptyList(), list, LIST_NAME);
- }
-
- public void testAddItemsToList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.addItemsToList(Collections.singletonList("joo"), list, LIST_NAME);
- }
-
- public void testAddItemsToListNoChange() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.addItemsToList(Collections.<String>emptyList(), list, LIST_NAME);
- }
-
- public void testRemoveItemFromListIndex() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.removeItemFromList(1, list, LIST_NAME);
- }
-
- public void testRemoveItemFromList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.removeItemFromList("bar", list, LIST_NAME);
- }
-
- public void testRemoveItemsFromListIndex() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.removeItemsFromList(1, 1, list, LIST_NAME);
- }
-
- public void testRemoveItemsFromListIndexNoChange() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.removeItemsFromList(2, 0, list, LIST_NAME);
- }
-
- public void testRemoveItemsFromList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.removeItemsFromList(Collections.singletonList("bar"), list, LIST_NAME);
- }
-
- public void testRemoveItemsFromListNoChange() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.addItemsToList(Collections.<String>emptyList(), list, LIST_NAME);
- }
-
- public void testRetainItemsInList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.retainItemsInList(new String[] {"bar", "baz"}, list, LIST_NAME);
- }
-
- public void testReplaceItemInList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.replaceItemInList("bar", "xxx", list, LIST_NAME);
- }
-
- public void testSetItemsInList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.setItemsInList(1, new String[] {"xxx"}, list, LIST_NAME);
- }
-
- public void testMoveItemsInList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- list.add("xxx");
- list.add("yyy");
- list.add("zzz");
- this.moveItemsInList(2, 4, 2, list, LIST_NAME);
- }
-
- public void testClearList() {
- List<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- list.add("baz");
- this.clearList(list, LIST_NAME);
- }
-
- public void testSynchronizeList() {
- List<String> oldList = new ArrayList<String>();
- oldList.add("foo");
- oldList.add("bar");
- oldList.add("baz");
- oldList.add("xxx");
- oldList.add("yyy");
- oldList.add("zzz");
- List<String> newList = new ArrayList<String>();
- newList.add("foo");
- newList.add("ppp");
- newList.add("baz");
- newList.add("xxx");
- newList.add("qqq");
- this.synchronizeList(newList, oldList, LIST_NAME);
- assertEquals(newList, oldList);
- }
-
- // ***** tree
- public void testFireNodeAddedTreeEvent() {
- this.fireNodeAdded(new TreeAddEvent(this, TREE_NAME, OBJECT_PATH));
- }
-
- public void testFireNodeAddedTree() {
- this.fireNodeAdded(TREE_NAME, OBJECT_PATH);
- }
-
- public void testFireNodeRemovedTreeEvent() {
- this.fireNodeRemoved(new TreeRemoveEvent(this, TREE_NAME, OBJECT_PATH));
- }
-
- public void testFireNodeRemovedTree() {
- this.fireNodeRemoved(TREE_NAME, OBJECT_PATH);
- }
-
- public void testFireTreeClearedEvent() {
- this.fireTreeCleared(new TreeClearEvent(this, TREE_NAME));
- }
-
- public void testFireTreeCleared() {
- this.fireTreeCleared(TREE_NAME);
- }
-
- public void testFireTreeChangedEvent() {
- this.fireTreeChanged(new TreeChangeEvent(this, TREE_NAME, OBJECT_PATH));
- }
-
- public void testFireTreeChanged() {
- this.fireTreeChanged(TREE_NAME, OBJECT_PATH);
- }
-
- public boolean testAttributeValueHasChanged(Object value1, Object value2) {
- return this.attributeValueHasChanged(value1, value2);
- }
-
- public boolean testAttributeValueHasNotChanged(Object value1, Object value2) {
- return this.attributeValueHasNotChanged(value1, value2);
- }
-
- // ***** misc
- @Override
- public TestModel clone() {
- try {
- return (TestModel) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean testValuesAreDifferent(Object value1, Object value2) {
- return this.valuesAreDifferent(value1, value2);
- }
-
- public boolean testValuesAreEqual(Object value1, Object value2) {
- return this.valuesAreEqual(value1, value2);
- }
-
- public boolean testElementsAreDifferent(Iterable<?> iterable1, Iterable<?> iterable2) {
- return this.getChangeSupport().elementsAreDifferent(iterable1, iterable2);
- }
-
- public boolean testElementsAreEqual(Iterable<?> iterable1, Iterable<?> iterable2) {
- return this.getChangeSupport().elementsAreEqual(iterable1, iterable2);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(TEST_TO_STRING);
- }
-
- }
-
-
- // ********** serialization test **********
- public void testSerialization() throws java.io.IOException, ClassNotFoundException {
- if (Tools.jvmIsSun()) {
- // This test doesn't pass in the Eclipse build environment (Linux/IBM JVM) for some reason
- this.verifySerialization();
- }
- }
-
- private void verifySerialization() throws java.io.IOException, ClassNotFoundException {
- LocalModel model1 = new LocalModel();
- Foo foo1 = new Foo();
- Bar bar1 = new Bar();
- Joo joo1 = new Joo();
- Jar jar1 = new Jar();
- model1.addStateChangeListener(foo1);
- model1.addStateChangeListener(bar1);
- model1.addListChangeListener("foo", joo1);
- model1.addListChangeListener("foo", jar1);
-
- Iterable<EventListener> listeners1 = this.getListeners(model1, StateChangeListener.class, null);
- Object[] listenersArray1 = ArrayTools.array(listeners1);
- assertEquals(2, listenersArray1.length);
- // the order of these could change...
- assertEquals(Foo.class, listenersArray1[0].getClass());
- assertEquals(Bar.class, listenersArray1[1].getClass());
-
- listeners1 = this.getListeners(model1, ListChangeListener.class, "foo");
- listenersArray1 = ArrayTools.array(listeners1);
- assertEquals(2, listenersArray1.length);
- // the order of these could change...
- assertEquals(Joo.class, listenersArray1[0].getClass());
- assertEquals(Jar.class, listenersArray1[1].getClass());
-
- LocalModel model2 = TestTools.serialize(model1);
-
- Iterable<EventListener> listeners2 = this.getListeners(model2, StateChangeListener.class, null);
- Object[] listenersArray2 = ArrayTools.array(listeners2);
- assertEquals(1, listenersArray2.length);
- assertEquals(Foo.class, listenersArray2[0].getClass());
-
- listeners2 = this.getListeners(model2, ListChangeListener.class, "foo");
- listenersArray2 = ArrayTools.array(listeners2);
- assertEquals(1, listenersArray2.length);
- assertEquals(Joo.class, listenersArray2[0].getClass());
- }
-
- private Iterable<EventListener> getListeners(LocalModel model, Class<? extends EventListener> listenerClass, String aspectName) {
- return this.getListenerList(model, listenerClass, aspectName).getListeners();
- }
-
- @SuppressWarnings("unchecked")
- private ListenerList<EventListener> getListenerList(LocalModel model, Class<? extends EventListener> listenerClass, String aspectName) {
- ChangeSupport changeSupport = (ChangeSupport) ReflectionTools.getFieldValue(model, "changeSupport");
- return (ListenerList<EventListener>) ReflectionTools.executeMethod(changeSupport, "getListenerList_", new Class<?>[] {Class.class, String.class}, new Object[] {listenerClass, aspectName});
- }
-
- // we have to manually handle 'changeSupport' since AbstractModel is not Serializable
- private static class LocalModel extends AbstractModel implements Serializable {
- LocalModel() {
- super();
- }
- private synchronized void writeObject(ObjectOutputStream s) throws IOException {
- s.defaultWriteObject();
- s.writeObject(this.changeSupport);
- }
- private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
- s.defaultReadObject();
- this.changeSupport = (ChangeSupport) s.readObject();
- }
- }
-
- private static class Foo implements Serializable, StateChangeListener {
- Foo() {
- super();
- }
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
- }
-
- private static class Bar implements StateChangeListener {
- Bar() {
- super();
- }
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
- }
-
- private static class Joo extends ListChangeAdapter implements Serializable {
- Joo() {
- super();
- }
- }
-
- private static class Jar extends ListChangeAdapter {
- Jar() {
- super();
- }
- }
-
-
- // ********** bug(?) test **********
-
- private static final String ISE_MESSAGE = "this object is no longer listening to localA";
-
- /**
- * Test the following situation:
- * - both B and C are listening to A
- * - C is also listening to B
- * - when B receives an event from A, it will fire an event to C
- * - when C receives an event from B, it will STOP listening to A
- * - the event from B to C may be preceded or followed (depending on
- * the hash positions of listeners) by an event from A to C:
- * - if the A to C event comes first, no problem
- * - but if the A to B event comes first, the A to C event should NOT happen
- */
- public void testIndirectRemoveStateListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyStateListeners();
- }
- }
- );
- }
-
- public void testIndirectRemovePropertyListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyPropertyListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveCollectionListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyCollectionListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveListListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyListListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveTreeListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyTreeListeners();
- }
- }
- );
- }
-
- public void verifyIndirectRemoveListener(NotifyCommand command) {
- LocalA localA = new LocalA();
- LocalB localB = new LocalB(localA);
-
- // build a bunch of LocalCs so at least one of them is notified AFTER the LocalB;
- // using 1000 seemed to fail very consistently before ChangeSupport was fixed
- LocalC[] localCs = new LocalC[1000];
- for (int i = localCs.length; i-- > 0; ) {
- localCs[i] = new LocalC(localA, localB);
- }
-
- boolean exCaught = false;
- try {
- command.notifyListeners(localA);
- } catch (IllegalStateException ex) {
- if (ex.getMessage() == ISE_MESSAGE) {
- exCaught = true;
- } else {
- throw ex;
- }
- }
- assertFalse(exCaught);
-
- for (int i = localCs.length; i-- > 0; ) {
- assertFalse(localCs[i].isListeningToLocalA());
- }
- }
-
- private interface NotifyCommand {
- void notifyListeners(LocalA localA);
- }
-
- /**
- * This object simply fires a state change event. Both LocalB and LocalC
- * will be listeners.
- */
- private static class LocalA extends AbstractModel {
- LocalA() {
- super();
- }
- void notifyStateListeners() {
- this.fireStateChanged();
- }
- void notifyPropertyListeners() {
- this.firePropertyChanged("foo", 1, 2);
- }
- void notifyCollectionListeners() {
- this.fireCollectionChanged("foo", Collections.emptySet());
- }
- void notifyListListeners() {
- this.fireListChanged("foo", Collections.emptyList());
- }
- void notifyTreeListeners() {
- this.fireTreeChanged("foo", Collections.emptySet());
- }
- }
-
- /**
- * This object will fire state change events whenever it receives
- * a state change event from localA.
- */
- private static class LocalB
- extends AbstractModel
- implements ChangeListener
- {
- LocalB(LocalA localA) {
- super();
- localA.addChangeListener(this);
- }
-
- public void stateChanged(StateChangeEvent e) {
- this.fireStateChanged();
- }
-
- public void propertyChanged(PropertyChangeEvent evt) {
- this.firePropertyChanged("bar", 1, 2);
- }
-
- public void collectionChanged(CollectionChangeEvent e) {
- this.fireCollectionChanged("bar", Collections.emptySet());
- }
- public void collectionCleared(CollectionClearEvent e) {/*ignore*/}
- public void itemsAdded(CollectionAddEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionRemoveEvent e) {/*ignore*/}
-
- public void listChanged(ListChangeEvent e) {
- this.fireListChanged("bar", Collections.emptyList());
- }
- public void listCleared(ListClearEvent e) {/*ignore*/}
- public void itemsAdded(ListAddEvent e) {/*ignore*/}
- public void itemsRemoved(ListRemoveEvent e) {/*ignore*/}
- public void itemsReplaced(ListReplaceEvent e) {/*ignore*/}
- public void itemsMoved(ListMoveEvent e) {/*ignore*/}
-
- public void treeChanged(TreeChangeEvent e) {
- this.fireTreeChanged("bar", Collections.emptySet());
- }
- public void treeCleared(TreeClearEvent e) {/*ignore*/}
- public void nodeAdded(TreeAddEvent e) {/*ignore*/}
- public void nodeRemoved(TreeRemoveEvent e) {/*ignore*/}
-
- }
-
- /**
- * This object will listen to two other objects, localA and localB.
- * If this object receives notification from localB, it will stop listening to
- * localA. If this object receives notification from localA, it will check to
- * see whether it still listening to localA. If this object is no longer
- * listening to localA, it will complain about receiving the event and
- * throw an exception.
- */
- private static class LocalC
- extends AbstractModel
- implements ChangeListener
- {
- private LocalA localA;
- private LocalB localB;
- private boolean listeningToLocalA;
-
- LocalC(LocalA localA, LocalB localB) {
- super();
- this.localA = localA;
- this.localB = localB;
-
- localA.addChangeListener(this);
- this.listeningToLocalA = true;
-
- localB.addChangeListener(this);
- }
- boolean isListeningToLocalA() {
- return this.listeningToLocalA;
- }
-
- public void stateChanged(StateChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
-
- public void propertyChanged(PropertyChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
-
- public void collectionChanged(CollectionChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void collectionCleared(CollectionClearEvent e) {/*ignore*/}
- public void itemsAdded(CollectionAddEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionRemoveEvent e) {/*ignore*/}
-
- public void listChanged(ListChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void listCleared(ListClearEvent e) {/*ignore*/}
- public void itemsAdded(ListAddEvent e) {/*ignore*/}
- public void itemsRemoved(ListRemoveEvent e) {/*ignore*/}
- public void itemsReplaced(ListReplaceEvent e) {/*ignore*/}
- public void itemsMoved(ListMoveEvent e) {/*ignore*/}
-
- public void treeChanged(TreeChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void treeCleared(TreeClearEvent e) {/*ignore*/}
- public void nodeAdded(TreeAddEvent e) {/*ignore*/}
- public void nodeRemoved(TreeRemoveEvent e) {/*ignore*/}
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/JptUtilityModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/JptUtilityModelTests.java
deleted file mode 100644
index f4f64ef801..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/JptUtilityModelTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.common.utility.tests.internal.model.listener.JptUtilityModelListenerTests;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.JptUtilityModelValueTests;
-
-public class JptUtilityModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityModelListenerTests.suite());
- suite.addTest(JptUtilityModelValueTests.suite());
-
- suite.addTestSuite(ChangeSupportTests.class);
- suite.addTestSuite(NewEventTests.class);
- suite.addTestSuite(SingleAspectChangeSupportTests.class);
-
- return suite;
- }
-
- private JptUtilityModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/NewEventTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/NewEventTests.java
deleted file mode 100644
index 2ce4ac0c49..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/NewEventTests.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model;
-
-import java.util.EventListener;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-/**
- * test what it takes to add a new type of event to
- * model and change support
- */
-public class NewEventTests extends TestCase {
- private Foo foo;
-
- public NewEventTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Foo();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNoFooChangeListeners() {
- assertTrue(this.foo.hasNoFooChangeListeners());
- LocalListener listener = new LocalListener();
- this.foo.addFooChangeListener(listener);
- assertFalse(this.foo.hasNoFooChangeListeners());
- this.foo.removeFooChangeListener(listener);
- assertTrue(this.foo.hasNoFooChangeListeners());
- }
-
- public void testHasAnyFooChangeListeners() {
- assertFalse(this.foo.hasAnyFooChangeListeners());
- LocalListener listener = new LocalListener();
- this.foo.addFooChangeListener(listener);
- assertTrue(this.foo.hasAnyFooChangeListeners());
- this.foo.removeFooChangeListener(listener);
- assertFalse(this.foo.hasAnyFooChangeListeners());
- }
-
- public void testFireFooChangeEvent() {
- LocalListener listener = new LocalListener();
- assertFalse(listener.receivedFooEvent);
- this.foo.addFooChangeListener(listener);
- this.foo.foo();
- assertTrue(listener.receivedFooEvent);
- }
-
-
- // ********** harness classes **********
-
- class Foo extends AbstractFooModel {
- Foo() {
- super();
- }
- void foo() {
- this.fireFooChangeEvent();
- }
- }
-
- class LocalListener implements FooChangeListener {
- boolean receivedFooEvent = false;
- LocalListener() {
- super();
- }
- public void fooChanged(FooChangeEvent event) {
- this.receivedFooEvent = true;
- }
- }
-
- interface FooModel extends Model {
- void addFooChangeListener(FooChangeListener listener);
- void removeFooChangeListener(FooChangeListener listener);
- }
-
- interface FooChangeListener extends EventListener {
- void fooChanged(FooChangeEvent event);
- }
-
- static class FooChangeEvent extends ChangeEvent {
- private static final long serialVersionUID = 1L;
- public FooChangeEvent(FooModel source) {
- super(source);
- }
- public FooChangeEvent clone(Model newSource) {
- return new FooChangeEvent((FooModel) newSource);
- }
- }
-
- static class AbstractFooModel extends AbstractModel implements FooModel {
- @Override
- protected synchronized FooChangeSupport getChangeSupport() {
- return (FooChangeSupport) super.getChangeSupport();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new FooChangeSupport(this);
- }
- public void addFooChangeListener(FooChangeListener listener) {
- this.getChangeSupport().addFooChangeListener(listener);
- }
- public void removeFooChangeListener(FooChangeListener listener) {
- this.getChangeSupport().removeFooChangeListener(listener);
- }
- protected void fireFooChangeEvent() {
- this.getChangeSupport().fireFooChanged();
- }
- public boolean hasAnyFooChangeListeners() {
- return this.getChangeSupport().hasAnyFooChangeListeners();
- }
- public boolean hasNoFooChangeListeners() {
- return ! this.hasAnyFooChangeListeners();
- }
- }
-
- static class FooChangeSupport extends ChangeSupport {
- FooChangeSupport(FooModel source) {
- super(source);
- }
- protected static final Class<FooChangeListener> FOO_CHANGE_LISTENER_CLASS = FooChangeListener.class;
- void addFooChangeListener(FooChangeListener listener) {
- this.addListener(FOO_CHANGE_LISTENER_CLASS, listener);
- }
- void removeFooChangeListener(FooChangeListener listener) {
- this.removeListener(FOO_CHANGE_LISTENER_CLASS, listener);
- }
- public boolean hasAnyFooChangeListeners() {
- return this.hasAnyListeners(FOO_CHANGE_LISTENER_CLASS);
- }
- private ListenerList<FooChangeListener> getFooChangeListenerList() {
- return this.getListenerList(FOO_CHANGE_LISTENER_CLASS);
- }
- private Iterable<FooChangeListener> getFooChangeListeners() {
- ListenerList<FooChangeListener> listenerList = this.getFooChangeListenerList();
- return (listenerList == null) ? null : listenerList.getListeners();
- }
- private boolean hasFooChangeListener(FooChangeListener listener) {
- return CollectionTools.contains(this.getFooChangeListeners(), listener);
- }
- public void fireFooChanged() {
- Iterable<FooChangeListener> listeners = this.getFooChangeListeners();
- if (listeners != null) {
- FooChangeEvent event = null;
- for (FooChangeListener listener : listeners) {
- if (this.hasFooChangeListener(listener)) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new FooChangeEvent((FooModel) this.source);
- }
- listener.fooChanged(event);
- }
- }
- }
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/SingleAspectChangeSupportTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/SingleAspectChangeSupportTests.java
deleted file mode 100644
index a0dae05267..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/SingleAspectChangeSupportTests.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.TreeChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.TreeChangeListener;
-
-@SuppressWarnings("nls")
-public class SingleAspectChangeSupportTests extends TestCase {
-
- public SingleAspectChangeSupportTests(String name) {
- super(name);
- }
-
- public void testAddPropertyChangeListenerInvalidClass() {
- Model model = new StateTestModel();
- boolean exCaught = false;
- PropertyChangeListener listener = new PropertyChangeAdapter();
- try {
- model.addPropertyChangeListener("foo", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddPropertyChangeListenerInvalidAspect() {
- Model model = new PropertyTestModel();
- boolean exCaught = false;
- PropertyChangeListener listener = new PropertyChangeAdapter();
- try {
- model.addPropertyChangeListener("bar", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddCollectionChangeListenerInvalidClass() {
- Model model = new StateTestModel();
- boolean exCaught = false;
- CollectionChangeListener listener = new CollectionChangeAdapter();
- try {
- model.addCollectionChangeListener("foo", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddCollectionChangeListenerInvalidAspect() {
- Model model = new CollectionTestModel();
- boolean exCaught = false;
- CollectionChangeListener listener = new CollectionChangeAdapter();
- try {
- model.addCollectionChangeListener("bar", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddListChangeListenerInvalidClass() {
- Model model = new StateTestModel();
- boolean exCaught = false;
- ListChangeListener listener = new ListChangeAdapter();
- try {
- model.addListChangeListener("foo", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddListChangeListenerInvalidAspect() {
- Model model = new ListTestModel();
- boolean exCaught = false;
- ListChangeListener listener = new ListChangeAdapter();
- try {
- model.addListChangeListener("bar", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddTreeChangeListenerInvalidClass() {
- Model model = new StateTestModel();
- boolean exCaught = false;
- TreeChangeListener listener = new TreeChangeAdapter();
- try {
- model.addTreeChangeListener("foo", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddTreeChangeListenerInvalidAspect() {
- Model model = new TreeTestModel();
- boolean exCaught = false;
- TreeChangeListener listener = new TreeChangeAdapter();
- try {
- model.addTreeChangeListener("bar", listener);
- fail("bogus listener: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- // ********** test models **********
-
- static class StateTestModel extends AbstractModel {
- StateTestModel() {
- super();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, StateChangeListener.class, null);
- }
- }
-
- static class PropertyTestModel extends AbstractModel {
- PropertyTestModel() {
- super();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, "foo");
- }
- }
-
- static class CollectionTestModel extends AbstractModel {
- CollectionTestModel() {
- super();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, "foo");
- }
- }
-
- static class ListTestModel extends AbstractModel {
- ListTestModel() {
- super();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, "foo");
- }
- }
-
- static class TreeTestModel extends AbstractModel {
- TreeTestModel() {
- super();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, TreeChangeListener.class, "foo");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java
deleted file mode 100644
index 1de3f75c49..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.listener;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelListenerTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelListenerTests.class.getPackage().getName());
-
- suite.addTestSuite(ReflectiveCollectionChangeListenerTests.class);
- suite.addTestSuite(ReflectiveListChangeListenerTests.class);
- suite.addTestSuite(ReflectivePropertyChangeListenerTests.class);
- suite.addTestSuite(ReflectiveStateChangeListenerTests.class);
- suite.addTestSuite(ReflectiveTreeChangeListenerTests.class);
-
- return suite;
- }
-
- private JptUtilityModelListenerTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
deleted file mode 100644
index 96ae5c351a..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ReflectiveChangeListener;
-
-@SuppressWarnings("nls")
-public class ReflectiveCollectionChangeListenerTests extends TestCase {
-
- public ReflectiveCollectionChangeListenerTests(String name) {
- super(name);
- }
-
- private CollectionChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedZeroArgument", "itemRemovedZeroArgument", "collectionClearedZeroArgument", "collectionChangedZeroArgument");
- }
-
- private CollectionChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedSingleArgument", "itemRemovedSingleArgument", "collectionClearedSingleArgument", "collectionChangedSingleArgument");
- }
-
- public void testItemAddedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertTrue(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertTrue(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertTrue(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- boolean exCaught = false;
- try {
- CollectionChangeListener listener = ReflectiveChangeListener.buildCollectionChangeListener(target, "collectionChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- Method method = ReflectionTools.getMethod(target, "collectionChangedDoubleArgument", new Class[] {CollectionChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- CollectionChangeListener listener = ReflectiveChangeListener.buildCollectionChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- // build a COLLECTION change listener and hack it so we
- // can add it as a LIST change listener
- Object listener = ReflectiveChangeListener.buildCollectionChangeListener(target, "collectionEventSingleArgument");
- testModel.addListChangeListener("bogus list", (ListChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeList();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- class TestModel extends AbstractModel {
- private Collection<String> strings = new ArrayList<String>();
- public static final String STRINGS_COLLECTION = "strings";
- TestModel() {
- super();
- }
- Iterator<String> strings() {
- return new CloneIterator<String>(this.strings) {
- @Override
- protected void remove(String s) {
- TestModel.this.removeString(s);
- }
- };
- }
- void addString(String string) {
- this.addItemToCollection(string, this.strings, STRINGS_COLLECTION);
- }
- void removeString(String string) {
- this.removeItemFromCollection(string, this.strings, STRINGS_COLLECTION);
- }
- void clearStrings() {
- this.clearCollection(this.strings, STRINGS_COLLECTION);
- }
- void replaceStrings(String[] newStrings) {
- this.strings.clear();
- CollectionTools.addAll(this.strings, newStrings);
- this.fireCollectionChanged(STRINGS_COLLECTION, this.strings);
- }
- void changeList() {
- this.fireListChanged("bogus list", Collections.emptyList());
- }
- }
-
- class Target {
- TestModel testModel;
- String collectionName;
- String string;
- boolean itemAddedZeroArgumentFlag = false;
- boolean itemAddedSingleArgumentFlag = false;
- boolean itemRemovedZeroArgumentFlag = false;
- boolean itemRemovedSingleArgumentFlag = false;
- boolean collectionClearedZeroArgumentFlag = false;
- boolean collectionClearedSingleArgumentFlag = false;
- boolean collectionChangedZeroArgumentFlag = false;
- boolean collectionChangedSingleArgumentFlag = false;
- boolean collectionEventSingleArgumentFlag = false;
- Target(TestModel testModel, String collectionName, String string) {
- super();
- this.testModel = testModel;
- this.collectionName = collectionName;
- this.string = string;
- }
- void itemAddedZeroArgument() {
- this.itemAddedZeroArgumentFlag = true;
- }
- void itemAddedSingleArgument(CollectionAddEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertEquals(this.string, e.getItems().iterator().next());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(CollectionRemoveEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- assertEquals(this.string, e.getItems().iterator().next());
- }
- void collectionClearedZeroArgument() {
- this.collectionClearedZeroArgumentFlag = true;
- }
- void collectionClearedSingleArgument(CollectionClearEvent e) {
- this.collectionClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- }
- void collectionChangedZeroArgument() {
- this.collectionChangedZeroArgumentFlag = true;
- }
- void collectionChangedSingleArgument(CollectionChangeEvent e) {
- this.collectionChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- }
- void collectionEventSingleArgument(CollectionEvent e) {
- this.collectionEventSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.getCollectionName());
- }
- void collectionChangedDoubleArgument(CollectionChangeEvent e, Object o) {
- fail("bogus event: " + e + " object: " + o);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
deleted file mode 100644
index 34f6c9b49f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ReflectiveChangeListener;
-
-@SuppressWarnings("nls")
-public class ReflectiveListChangeListenerTests extends TestCase {
-
- public ReflectiveListChangeListenerTests(String name) {
- super(name);
- }
-
- private ListChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedZeroArgument", "itemRemovedZeroArgument", "itemReplacedZeroArgument", "itemMovedZeroArgument", "listClearedZeroArgument", "listChangedZeroArgument");
- }
-
- private ListChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedSingleArgument", "itemRemovedSingleArgument", "itemReplacedSingleArgument", "itemMovedSingleArgument", "listClearedSingleArgument", "listChangedSingleArgument");
- }
-
- public void testItemAddedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertTrue(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertTrue(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertTrue(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertTrue(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertTrue(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertTrue(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertTrue(target.listChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- boolean exCaught = false;
- try {
- ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, "listChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- Method method = ReflectionTools.getMethod(target, "listChangedDoubleArgument", new Class[] {ListChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- // build a LIST change listener and hack it so we
- // can add it as a COLLECTION change listener
- Object listener = ReflectiveChangeListener.buildListChangeListener(target, "listEventSingleArgument");
- testModel.addCollectionChangeListener("bogus collection", (CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- class TestModel extends AbstractModel {
- private List<String> strings = new ArrayList<String>();
- public static final String STRINGS_LIST = "strings";
- TestModel() {
- super();
- }
- ListIterator<String> strings() {
- return new CloneListIterator<String>(this.strings);
- }
- void addString(String string) {
- this.addItemToList(string, this.strings, STRINGS_LIST);
- }
- void removeString(String string) {
- this.removeItemFromList(this.strings.indexOf(string), this.strings, STRINGS_LIST);
- }
- void replaceString(String oldString, String newString) {
- this.setItemInList(this.strings.indexOf(oldString), newString, this.strings, STRINGS_LIST);
- }
- void moveString(int targetIndex, int sourceIndex) {
- this.moveItemInList(targetIndex, sourceIndex, this.strings, STRINGS_LIST);
- }
- void clearStrings() {
- this.clearList(this.strings, STRINGS_LIST);
- }
- void replaceAllStrings(String[] newStrings) {
- this.strings.clear();
- CollectionTools.addAll(this.strings, newStrings);
- this.fireListChanged(STRINGS_LIST, this.strings);
- }
- void changeCollection() {
- this.fireCollectionChanged("bogus collection", Collections.emptySet());
- }
- }
-
- class Target {
- TestModel testModel;
- String listName;
- String string;
- int index;
- String replacedString;
- int sourceIndex;
- boolean itemAddedZeroArgumentFlag = false;
- boolean itemAddedSingleArgumentFlag = false;
- boolean itemRemovedZeroArgumentFlag = false;
- boolean itemRemovedSingleArgumentFlag = false;
- boolean itemReplacedZeroArgumentFlag = false;
- boolean itemReplacedSingleArgumentFlag = false;
- boolean itemMovedZeroArgumentFlag = false;
- boolean itemMovedSingleArgumentFlag = false;
- boolean listClearedZeroArgumentFlag = false;
- boolean listClearedSingleArgumentFlag = false;
- boolean listChangedZeroArgumentFlag = false;
- boolean listChangedSingleArgumentFlag = false;
- boolean listEventSingleArgumentFlag = false;
- Target(TestModel testModel, String listName, String string, int index) {
- super();
- this.testModel = testModel;
- this.listName = listName;
- this.string = string;
- this.index = index;
- }
- Target(TestModel testModel, String listName, String string, int index, String replacedString) {
- this(testModel, listName, string, index);
- this.replacedString = replacedString;
- }
- Target(TestModel testModel, String listName, int targetIndex, int sourceIndex) {
- super();
- this.testModel = testModel;
- this.listName = listName;
- this.index = targetIndex;
- this.sourceIndex = sourceIndex;
- }
- void itemAddedZeroArgument() {
- this.itemAddedZeroArgumentFlag = true;
- }
- void itemAddedSingleArgument(ListAddEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.getItems().iterator().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(ListRemoveEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.getItems().iterator().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemReplacedZeroArgument() {
- this.itemReplacedZeroArgumentFlag = true;
- }
- void itemReplacedSingleArgument(ListReplaceEvent e) {
- this.itemReplacedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.string, e.getNewItems().iterator().next());
- assertEquals(this.replacedString, e.getOldItems().iterator().next());
- assertEquals(this.index, e.getIndex());
- }
- void itemMovedZeroArgument() {
- this.itemMovedZeroArgumentFlag = true;
- }
- void itemMovedSingleArgument(ListMoveEvent e) {
- this.itemMovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- assertEquals(this.index, e.getTargetIndex());
- assertEquals(this.sourceIndex, e.getSourceIndex());
- }
- void listChangedZeroArgument() {
- this.listChangedZeroArgumentFlag = true;
- }
- void listClearedSingleArgument(ListClearEvent e) {
- this.listClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- }
- void listClearedZeroArgument() {
- this.listClearedZeroArgumentFlag = true;
- }
- void listChangedSingleArgument(ListChangeEvent e) {
- this.listChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- }
- void listChangedDoubleArgument(ListChangeEvent e, Object o) {
- fail("bogus event: " + e + " - object: " + o);
- }
- void listEventSingleArgument(ListEvent e) {
- this.listEventSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.getListName());
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
deleted file mode 100644
index 9b27d57fcb..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-
-@SuppressWarnings("nls")
-public class ReflectivePropertyChangeListenerTests extends TestCase {
-
- public ReflectivePropertyChangeListenerTests(String name) {
- super(name);
- }
-
- public void testZeroArgumentNamedProperty() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedZeroArgument"));
- testModel.setValue(99);
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgument2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ReflectionTools.getMethod(target, "propertyChangedSingleArgument2", new Class[] {Object.class});
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, method));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testSingleArgumentNamedProperty() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument"));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgumentNamedProperty2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ReflectionTools.getMethod(target, "propertyChangedSingleArgument2", new Class[] {Object.class});
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, method));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- // build a PROPERTY change listener and hack it so we
- // can add it as a STATE change listener
- Object listener = ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument");
- testModel.addStateChangeListener((StateChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.setValue(99);
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- boolean exCaught = false;
- try {
- PropertyChangeListener listener = ReflectiveChangeListener.buildPropertyChangeListener(target, "stateChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ReflectionTools.getMethod(target, "propertyChangedDoubleArgument", new Class[] {PropertyChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- PropertyChangeListener listener = ReflectiveChangeListener.buildPropertyChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
-
- class TestModel extends AbstractModel {
- private int value = 0;
- public static final String VALUE_PROPERTY = "value";
- TestModel(int value) {
- super();
- this.value = value;
- }
- void setValue(int value) {
- int old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- if (old != value) {
- this.fireStateChanged();
- }
- }
- }
-
- class Target {
- TestModel testModel;
- String propertyName;
- Object oldValue;
- Object newValue;
- boolean zeroArgumentFlag = false;
- boolean singleArgumentFlag = false;
- Target(TestModel testModel, String propertyName, int oldValue, int newValue) {
- super();
- this.testModel = testModel;
- this.propertyName = propertyName;
- this.oldValue = new Integer(oldValue);
- this.newValue = new Integer(newValue);
- }
- void propertyChangedZeroArgument() {
- this.zeroArgumentFlag = true;
- }
- void propertyChangedSingleArgument(PropertyChangeEvent e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.propertyName, e.getPropertyName());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- }
- void propertyChangedSingleArgument2(Object o) {
- PropertyChangeEvent e = (PropertyChangeEvent) o;
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.propertyName, e.getPropertyName());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- }
- void propertyChangedDoubleArgument(PropertyChangeEvent e, Object o) {
- fail("bogus event: " + e + " - object: " + o);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
deleted file mode 100644
index 9a799e37db..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-
-@SuppressWarnings("nls")
-public class ReflectiveStateChangeListenerTests extends TestCase {
-
- public ReflectiveStateChangeListenerTests(String name) {
- super(name);
- }
-
- public void testZeroArgument() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedZeroArgument"));
- testModel.changeState();
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- public void testSingleArgument() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedSingleArgument"));
- testModel.changeState();
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- Method method = ReflectionTools.getMethod(target, "stateChangedSingleArgument2", new Class[] {Object.class});
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, method));
- testModel.changeState();
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- // build a STATE change listener and hack it so we
- // can add it as a PROPERTY change listener
- Object listener = ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedSingleArgument");
- testModel.addPropertyChangeListener("value", (PropertyChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeProperty();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- boolean exCaught = false;
- try {
- StateChangeListener listener = ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- Method method = ReflectionTools.getMethod(target, "stateChangedDoubleArgument", new Class[] {StateChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- StateChangeListener listener = ReflectiveChangeListener.buildStateChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
-
- class TestModel extends AbstractModel {
- TestModel() {
- super();
- }
- void changeState() {
- this.fireStateChanged();
- }
- void changeProperty() {
- this.firePropertyChanged("value", 55, 42);
- }
- }
-
- class Target {
- TestModel testModel;
- boolean zeroArgumentFlag = false;
- boolean singleArgumentFlag = false;
- Target(TestModel testModel) {
- super();
- this.testModel = testModel;
- }
- void stateChangedZeroArgument() {
- this.zeroArgumentFlag = true;
- }
- void stateChangedSingleArgument(StateChangeEvent e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- }
- void stateChangedSingleArgument2(Object e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, ((StateChangeEvent) e).getSource());
- }
- void stateChangedDoubleArgument(StateChangeEvent e, Object o) {
- fail("bogus event: " + e + " - object: " + o);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
deleted file mode 100644
index e6dbfe7253..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.listener;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.TreeChangeListener;
-
-@SuppressWarnings("nls")
-public class ReflectiveTreeChangeListenerTests extends TestCase {
-
- public ReflectiveTreeChangeListenerTests(String name) {
- super(name);
- }
-
- private TreeChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedZeroArgument", "nodeRemovedZeroArgument", "treeClearedZeroArgument", "treeChangedZeroArgument");
- }
-
- private TreeChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedSingleArgument", "nodeRemovedSingleArgument", "treeClearedSingleArgument", "treeChangedSingleArgument");
- }
-
- public void testNodeAddedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.addNode("root", "child");
- assertTrue(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeAddedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.addNode("root", "child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertTrue(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertTrue(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertTrue(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertTrue(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertTrue(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertTrue(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertTrue(target.treeChangedSingleArgumentFlag);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- // build a TREE change listener and hack it so we
- // can add it as a COLLECTION change listener
- Object listener = ReflectiveChangeListener.buildTreeChangeListener(target, "treeEventSingleArgument");
- testModel.addCollectionChangeListener("bogus collection", (CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- class TestModel extends AbstractModel {
- private final String root;
- private Map<String, Collection<String>> childrenLists = new HashMap<String, Collection<String>>();
- private Map<String, String> parents = new HashMap<String, String>();
- public static final String STRINGS_TREE = "strings";
- TestModel(String root) {
- super();
- if (root == null) {
- throw new NullPointerException();
- }
- this.root = root;
- this.childrenLists.put(root, new ArrayList<String>());
- this.parents.put(root, null);
- }
- String getRoot() {
- return this.root;
- }
- private List<String> path(String node) {
- String temp = node;
- List<String> reversePath = new ArrayList<String>();
- do {
- reversePath.add(temp);
- temp = this.parents.get(temp);
- } while (temp != null);
- return CollectionTools.reverse(reversePath);
- }
- Iterator<String> strings() {
- return new CloneIterator<String>(this.childrenLists.keySet()) {
- @Override
- protected void remove(String s) {
- TestModel.this.removeNode(s);
- }
- };
- }
- void addNode(String parent, String child) {
- if ((parent == null) || (child == null)) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.get(parent);
- if (children == null) {
- throw new IllegalStateException("cannot add a child to a non-existent parent");
- }
-
- if (this.childrenLists.get(child) != null) {
- throw new IllegalStateException("cannot add a child that is already in the tree");
- }
-
- children.add(child);
- this.childrenLists.put(child, new ArrayList<String>());
- this.parents.put(child, parent);
- this.fireNodeAdded(STRINGS_TREE, this.path(child));
- }
- void removeNode(String node) {
- if (node == null) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.get(node);
- if (children == null) {
- throw new IllegalStateException("node is not in tree");
- }
- List<String> path = this.path(node);
- for (String s : children) {
- this.removeNode(s);
- }
- this.childrenLists.remove(node);
- this.parents.remove(node);
- this.fireNodeRemoved(STRINGS_TREE, path);
- }
- void replaceNode(String oldNode, String newNode) {
- if ((oldNode == null) || (newNode == null)) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.remove(oldNode);
- if (children == null) {
- throw new IllegalStateException("old node is not in tree");
- }
- this.childrenLists.put(newNode, children);
- for (String child : children) {
- this.parents.put(child, newNode);
- }
-
- String parent = this.parents.remove(oldNode);
- this.parents.put(newNode, parent);
-
- this.fireTreeChanged(STRINGS_TREE, this.path(newNode));
- }
- void clearTree() {
- this.childrenLists.clear();
- this.childrenLists.put(root, new ArrayList<String>());
- this.parents.clear();
- this.parents.put(root, null);
- this.fireTreeCleared(STRINGS_TREE);
- }
- void changeCollection() {
- this.fireCollectionChanged("bogus collection", Collections.emptySet());
- }
- }
-
- class Target {
- TestModel testModel;
- String treeName;
- List<String> path;
- boolean nodeAddedZeroArgumentFlag = false;
- boolean nodeAddedSingleArgumentFlag = false;
- boolean nodeRemovedZeroArgumentFlag = false;
- boolean nodeRemovedSingleArgumentFlag = false;
- boolean treeClearedZeroArgumentFlag = false;
- boolean treeClearedSingleArgumentFlag = false;
- boolean treeChangedZeroArgumentFlag = false;
- boolean treeChangedSingleArgumentFlag = false;
- boolean treeEventSingleArgumentFlag = false;
- Target(TestModel testModel, String treeName, String[] path) {
- super();
- this.testModel = testModel;
- this.treeName = treeName;
- this.path = Arrays.asList(path);
- }
- void nodeAddedZeroArgument() {
- this.nodeAddedZeroArgumentFlag = true;
- }
- void nodeAddedSingleArgument(TreeAddEvent e) {
- this.nodeAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertEquals(this.path, CollectionTools.list(e.getPath()));
- }
- void nodeRemovedZeroArgument() {
- this.nodeRemovedZeroArgumentFlag = true;
- }
- void nodeRemovedSingleArgument(TreeRemoveEvent e) {
- this.nodeRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- assertEquals(this.path, CollectionTools.list(e.getPath()));
- }
- void treeClearedZeroArgument() {
- this.treeClearedZeroArgumentFlag = true;
- }
- void treeClearedSingleArgument(TreeClearEvent e) {
- this.treeClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- }
- void treeChangedZeroArgument() {
- this.treeChangedZeroArgumentFlag = true;
- }
- void treeChangedSingleArgument(TreeChangeEvent e) {
- this.treeChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- }
- void treeEventSingleArgument(TreeEvent e) {
- this.treeChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.getTreeName());
- }
- void collectionChangedDoubleArgument(TreeChangeEvent e, Object o) {
- fail("bogus event: " + e + " - object: " + o);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
deleted file mode 100644
index 6bee40b1f2..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Date;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class BufferedWritablePropertyValueModelTests extends TestCase {
- private Employee employee;
- private WritablePropertyValueModel<Employee> employeeHolder;
- PropertyChangeEvent employeeEvent;
-
- private WritablePropertyValueModel<Integer> idAdapter;
- private WritablePropertyValueModel<String> nameAdapter;
- private WritablePropertyValueModel<Date> hireDateAdapter;
- PropertyChangeEvent adapterEvent;
-
- private BufferedWritablePropertyValueModel.Trigger trigger;
- private BufferedWritablePropertyValueModel<Integer> bufferedIDHolder;
- private BufferedWritablePropertyValueModel<String> bufferedNameHolder;
- private BufferedWritablePropertyValueModel<Date> bufferedHireDateHolder;
- PropertyChangeEvent bufferedEvent;
-
- public BufferedWritablePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.employee = new Employee(17, "Freddy", new Date());
- this.employeeHolder = new SimplePropertyValueModel<Employee>(this.employee);
-
- this.trigger = new BufferedWritablePropertyValueModel.Trigger();
-
- this.idAdapter = this.buildIDAdapter(this.employeeHolder);
- this.bufferedIDHolder = new BufferedWritablePropertyValueModel<Integer>(this.idAdapter, this.trigger);
-
- this.nameAdapter = this.buildNameAdapter(this.employeeHolder);
- this.bufferedNameHolder = new BufferedWritablePropertyValueModel<String>(this.nameAdapter, this.trigger);
-
- this.hireDateAdapter = this.buildHireDateAdapter(this.employeeHolder);
- this.bufferedHireDateHolder = new BufferedWritablePropertyValueModel<Date>(this.hireDateAdapter, this.trigger);
- }
-
- private WritablePropertyValueModel<Integer> buildIDAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, Integer>(eHolder, Employee.ID_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getID());
- }
- @Override
- protected void setValue_(Integer value) {
- this.subject.setID(value.intValue());
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildNameAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, String>(eHolder, Employee.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Date> buildHireDateAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, Date>(eHolder, Employee.HIRE_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getHireDate();
- }
- @Override
- protected void setValue_(Date value) {
- this.subject.setHireDate(value);
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetValue() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(17), this.bufferedIDHolder.getValue());
-
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Freddy", this.bufferedNameHolder.getValue());
-
- Date temp = this.employee.getHireDate();
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(temp, this.bufferedHireDateHolder.getValue());
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
- }
-
- public void testTriggerAccept() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- Date temp = this.employee.getHireDate();
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
-
- this.trigger.accept();
-
- assertEquals(323, this.employee.getID());
- assertEquals(new Integer(323), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- assertEquals("Ripley", this.employee.getName());
- assertEquals("Ripley", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- assertEquals(null, this.employee.getHireDate());
- assertEquals(null, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
- }
-
- public void testTriggerReset() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(323), this.bufferedIDHolder.getValue());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- Date temp = this.employee.getHireDate();
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(null, this.bufferedHireDateHolder.getValue());
-
- this.trigger.reset();
-
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.getValue());
- assertEquals(new Integer(17), this.bufferedIDHolder.getValue());
-
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Freddy", this.bufferedNameHolder.getValue());
-
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.getValue());
- assertEquals(temp, this.bufferedHireDateHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
-
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
-
- this.bufferedIDHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
- }
-
- public void testPropertyChange1() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- PropertyChangeListener adapterListener = this.buildAdapterListener();
- this.nameAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, adapterListener);
-
- PropertyChangeListener employeeListener = this.buildEmployeeListener();
- this.employee.addPropertyChangeListener(Employee.NAME_PROPERTY, employeeListener);
-
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- ChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addChangeListener(bufferedListener);
-
- ChangeListener adapterListener = this.buildAdapterListener();
- this.nameAdapter.addChangeListener(adapterListener);
-
- ChangeListener employeeListener = this.buildEmployeeListener();
- this.employee.addChangeListener(employeeListener);
-
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Ripley");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Freddy", "Ripley");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Charlie");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Ripley", "Charlie");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.trigger.accept();
- assertNull(this.bufferedEvent);
- this.verifyEvent(this.adapterEvent, this.nameAdapter, PropertyValueModel.VALUE, "Freddy", "Charlie");
- this.verifyEvent(this.employeeEvent, this.employee, Employee.NAME_PROPERTY, "Freddy", "Charlie");
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Jason");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Charlie", "Jason");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.trigger.reset();
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Jason", "Charlie");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
- }
-
- /**
- * changing the value should trigger buffering
- */
- public void testBuffering1() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
- assertTrue(this.bufferedNameHolder.isBuffering());
- }
-
- /**
- * setting to the same value should not trigger buffering (?)
- */
- public void testBuffering2() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedNameHolder.setValue("Freddy");
- assertEquals("Freddy", this.bufferedNameHolder.getValue());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertFalse(this.bufferedNameHolder.isBuffering());
- }
-
- /**
- * setting to the original value should not trigger buffering (?)
- */
- public void testBuffering3() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
- assertTrue(this.bufferedNameHolder.isBuffering());
-
- this.bufferedNameHolder.setValue("Freddy");
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Freddy", this.bufferedNameHolder.getValue());
- assertFalse(this.bufferedNameHolder.isBuffering());
- }
-
- /**
- * back-door changes are ignored - "Last One In Wins"
- */
- public void testChangeConflict1() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- this.nameAdapter.setValue("Jason");
- assertEquals("Jason", this.employee.getName());
- assertEquals("Jason", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
-
- this.trigger.accept();
- // "Jason" is dropped on the floor...
- assertEquals("Ripley", this.employee.getName());
- assertEquals("Ripley", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
- }
-
- /**
- * back-door changes can de-activate buffering (?)
- */
- public void testChangeConflict2() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
- assertTrue(this.bufferedNameHolder.isBuffering());
-
- this.nameAdapter.setValue("Ripley");
- assertEquals("Ripley", this.employee.getName());
- assertEquals("Ripley", this.nameAdapter.getValue());
- assertEquals("Ripley", this.bufferedNameHolder.getValue());
- assertFalse(this.bufferedNameHolder.isBuffering());
- }
-
- private ChangeListener buildBufferedListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.bufferedEvent = e;
- }
- };
- }
-
- private ChangeListener buildAdapterListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.adapterEvent = e;
- }
- };
- }
-
- private ChangeListener buildEmployeeListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.employeeEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent event, Object source, String propertyName, Object oldValue, Object newValue) {
- assertEquals(source, event.getSource());
- assertEquals(propertyName, event.getPropertyName());
- assertEquals(oldValue, event.getOldValue());
- assertEquals(newValue, event.getNewValue());
- }
-
-
- // ********** inner class **********
-
- class Employee extends AbstractModel {
- private int id;
- public static final String ID_PROPERTY = "id";
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Date hireDate;
- public static final String HIRE_DATE_PROPERTY = "hireDate";
-
- Employee(int id, String name, Date hireDate) {
- super();
- this.id = id;
- this.name = name;
- this.hireDate = hireDate;
- }
- int getID() {
- return this.id;
- }
- void setID(int id) {
- int old = this.id;
- this.id = id;
- this.firePropertyChanged(ID_PROPERTY, old, id);
- }
- String getName() {
- return this.name;
- }
- void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- Date getHireDate() {
- return this.hireDate;
- }
- void setHireDate(Date hireDate) {
- Object old = this.hireDate;
- this.hireDate = hireDate;
- this.firePropertyChanged(HIRE_DATE_PROPERTY, old, hireDate);
- }
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java
deleted file mode 100644
index f17f265cf1..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BidiTransformer;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CachingTransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CachingTransformationPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<Person> objectHolder;
- PropertyChangeEvent event;
-
- private PropertyValueModel<Person> transformationObjectHolder;
- PropertyChangeEvent transformationEvent;
-
- public CachingTransformationPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<Person>(new Person("Karen", "Peggy", null));
- this.transformationObjectHolder = new CachingTransformationPropertyValueModel<Person, Person>(this.objectHolder, this.buildTransformer());
- }
-
- private BidiTransformer<Person, Person> buildTransformer() {
- return new BidiTransformer<Person, Person>() {
- public Person transform(Person p) {
- return (p == null) ? null : p.getParent();
- }
- public Person reverseTransform(Person p) {
- return (p == null) ? null : p.getChild();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- ChangeListener listener = this.buildTransformationChangeListener();
- this.transformationObjectHolder.addChangeListener(listener);
-
- Person person = this.objectHolder.getValue();
- assertEquals("Karen", person.getName());
- Person parent = this.transformationObjectHolder.getValue();
- assertEquals(person.getParent().getName(), parent.getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent, this.transformationObjectHolder.getValue());
-
- Person person1 = new Person("Matt", "Mitch", null);
- this.objectHolder.setValue(person1);
- Person parent2 = this.transformationObjectHolder.getValue();
- assertEquals(person1.getParent().getName(), parent2.getName());
- assertNotSame(person1.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent2, this.transformationObjectHolder.getValue());
-
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- Person person3 = new Person("Karen", "Peggy", null);
- this.objectHolder.setValue(person3);
- assertEquals("Karen", person3.getName());
- Person parent3 = this.transformationObjectHolder.getValue();
- assertEquals(person3.getParent().getName(), parent3.getName());
- assertNotSame(person3.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent3, this.transformationObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildTransformationChangeListener();
- this.transformationObjectHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removeChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addChangeListener(this.buildChangeListener());
- this.transformationObjectHolder.addChangeListener(this.buildTransformationChangeListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.transformationEvent = null;
- Person karen = this.objectHolder.getValue();
- Person peggyParent = this.transformationObjectHolder.getValue();
- Person peggy = new Person("Peggy", "Marian", null);
- this.objectHolder.setValue(peggy);
- Person marianParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, karen, peggy);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, peggyParent, marianParent);
-
- this.event = null;
- this.transformationEvent = null;
- Person matt = new Person("Matt", "Mitch", null);
- this.objectHolder.setValue(matt);
- Person mitchParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, peggy, matt);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, marianParent, mitchParent);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, matt, null);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, mitchParent, null);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue(matt);
- mitchParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, null, matt);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, null, mitchParent);
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildTransformationListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationPropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private ChangeListener buildTransformationChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationPropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-
- class Person extends AbstractModel {
-
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- private String parentName;
- public static final String PARENT_NAME_PROPERTY = "parentName";
-
- private Person child;
-
- public Person(String name, String parentName, Person child) {
- this.name = name;
- this.parentName = parentName;
- this.child = child;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public Person getParent() {
- return new Person(this.parentName, null, this);
- }
-
- public String getParentName() {
- return this.parentName;
- }
-
- public void setParentName(String newParentName) {
- String oldParentName = this.parentName;
- this.parentName = newParentName;
- firePropertyChanged(PARENT_NAME_PROPERTY, oldParentName, newParentName);
- }
-
- public Person getChild() {
- return this.child;
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
deleted file mode 100644
index 3560f4a814..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BidiTransformer;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CachingTransformationWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CachingTransformationWritablePropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<Person> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<Person> transformationObjectHolder;
- PropertyChangeEvent transformationEvent;
-
- public CachingTransformationWritablePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<Person>(new Person("Karen", "Peggy", null));
- this.transformationObjectHolder = new CachingTransformationWritablePropertyValueModel<Person, Person>(this.objectHolder, this.buildTransformer());
- }
-
- private BidiTransformer<Person, Person> buildTransformer() {
- return new BidiTransformer<Person, Person>() {
- public Person transform(Person p) {
- return (p == null) ? null : p.getParent();
- }
- public Person reverseTransform(Person p) {
- return (p == null) ? null : p.getChild();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- ChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addChangeListener(listener);
-
-
- Person person = this.objectHolder.getValue();
- assertEquals("Karen", person.getName());
- Person parent = this.transformationObjectHolder.getValue();
- assertEquals(person.getParent().getName(), parent.getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent, this.transformationObjectHolder.getValue());
-
- Person person1 = new Person("Matt", "Mitch", null);
- this.objectHolder.setValue(person1);
- Person parent2 = this.transformationObjectHolder.getValue();
- assertEquals(person1.getParent().getName(), parent2.getName());
- assertNotSame(person1.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent2, this.transformationObjectHolder.getValue());
-
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- Person person3 = new Person("Karen", "Peggy", null);
- this.objectHolder.setValue(person3);
- assertEquals("Karen", person3.getName());
- Person parent3 = this.transformationObjectHolder.getValue();
- assertEquals(person3.getParent().getName(), parent3.getName());
- assertNotSame(person3.getParent(), this.transformationObjectHolder.getValue());
- assertEquals(parent3, this.transformationObjectHolder.getValue());
- }
-
- public void testSetValue() {
- ChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addChangeListener(listener);
-
- Person person = new Person("Chris", "Noel", null);
- this.transformationObjectHolder.setValue(person.getParent());
- assertEquals(person, this.objectHolder.getValue());
- assertEquals(person.getParent().getName(), this.transformationObjectHolder.getValue().getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
-
- Person person2 = new Person("Jon", "Elizabeth", null);
- this.transformationObjectHolder.setValue(person2.getParent());
- assertEquals(person2, this.objectHolder.getValue());
- assertEquals(person2.getParent().getName(), this.transformationObjectHolder.getValue().getName());
- assertNotSame(person2.getParent(), this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue(person.getParent());
- assertEquals(person, this.objectHolder.getValue());
- assertEquals(person.getParent().getName(), this.transformationObjectHolder.getValue().getName());
- assertNotSame(person.getParent(), this.transformationObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removeChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addChangeListener(this.buildListener());
- this.transformationObjectHolder.addChangeListener(this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.transformationEvent = null;
- Person oldPerson = this.objectHolder.getValue();
- Person oldParent = this.transformationObjectHolder.getValue();
- Person newPerson = new Person("Karen" , "Peggy", null);
- this.objectHolder.setValue(newPerson);
- Person newParent = this.transformationObjectHolder.getValue();
- this.verifyEvent(this.event, this.objectHolder, oldPerson, newPerson);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, oldParent, newParent);
-
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue("Foo");
-// this.verifyEvent(this.event, this.objectHolder, "baz", "Foo");
-// this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAZ", "FOO");
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue("FOO");
-// this.verifyEvent(this.event, this.objectHolder, "Foo", "FOO");
-// assertNull(this.transformationEvent);
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue(null);
-// this.verifyEvent(this.event, this.objectHolder, "FOO", null);
-// this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", null);
-//
-// this.event = null;
-// this.transformationEvent = null;
-// this.objectHolder.setValue("bar");
-// this.verifyEvent(this.event, this.objectHolder, null, "bar");
-// this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, null, "BAR");
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationWritablePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private ChangeListener buildTransformationListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- CachingTransformationWritablePropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-
- class Person extends AbstractModel {
-
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- private String parentName;
- public static final String PARENT_NAME_PROPERTY = "parentName";
-
- private Person child;
-
- public Person(String name, String parentName, Person child) {
- this.name = name;
- this.parentName = parentName;
- this.child = child;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public Person getParent() {
- return new Person(this.parentName, null, this);
- }
-
- public String getParentName() {
- return this.parentName;
- }
-
- public void setParentName(String newParentName) {
- String oldParentName = this.parentName;
- this.parentName = newParentName;
- firePropertyChanged(PARENT_NAME_PROPERTY, oldParentName, newParentName);
- }
-
- public Person getChild() {
- return this.child;
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionAspectAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
deleted file mode 100644
index b9542f9d21..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CollectionAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalCollectionAspectAdapter aa1;
- private CollectionEvent event1;
- private CollectionChangeListener listener1;
- private String event1Type;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String CHANGE = "change";
- private static final String CLEAR = "clear";
-
- private TestSubject subject2;
-
- public CollectionAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- this.subject1.addNames(this.subject1Names());
- this.subject1.addDescriptions(this.subject1Descriptions());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addCollectionChangeListener(CollectionValueModel.VALUES, this.listener1);
- this.event1 = null;
- this.event1Type = null;
-
- this.subject2 = new TestSubject();
- this.subject2.addNames(this.subject2Names());
- this.subject2.addDescriptions(this.subject2Descriptions());
- }
-
- private Collection<String> subject1Names() {
- Collection<String> result = new HashBag<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private Collection<String> subject1Descriptions() {
- Collection<String> result = new HashBag<String>();
- result.add("this.subject1 description1");
- result.add("this.subject1 description2");
- return result;
- }
-
- private Collection<String> subject2Names() {
- Collection<String> result = new HashBag<String>();
- result.add("baz");
- result.add("bam");
- return result;
- }
-
- private Collection<String> subject2Descriptions() {
- Collection<String> result = new HashBag<String>();
- result.add("this.subject2 description1");
- result.add("this.subject2 description2");
- return result;
- }
-
- private LocalCollectionAspectAdapter buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new LocalCollectionAspectAdapter(subjectHolder);
- }
-
- private CollectionChangeListener buildValueChangeListener1() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, ADD);
- }
- public void itemsRemoved(CollectionRemoveEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, REMOVE);
- }
- public void collectionCleared(CollectionClearEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CLEAR);
- }
- public void collectionChanged(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CHANGE);
- }
- };
- }
-
- void value1Changed(CollectionEvent e, String eventType) {
- this.event1 = e;
- this.event1Type = eventType;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals(this.subject2Names(), CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertFalse(this.aa1.iterator().hasNext());
-
- this.event1 = null;
- this.event1Type = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.addName("jam");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, ADD);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("jam", ((CollectionAddEvent) this.event1).getItems().iterator().next());
- Collection<String> namesPlus = this.subject1Names();
- namesPlus.add("jam");
- assertEquals(namesPlus, CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.aa1.addAll(Collections.singleton("jaz"));
- assertNotNull(this.event1);
- assertEquals(this.event1Type, ADD);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("jaz", ((CollectionAddEvent) this.event1).getItems().iterator().next());
- namesPlus.add("jaz");
- assertEquals(namesPlus, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.removeName("foo");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, REMOVE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("foo", ((CollectionRemoveEvent) this.event1).getItems().iterator().next());
- Collection<String> namesMinus = this.subject1Names();
- namesMinus.remove("foo");
- assertEquals(namesMinus, CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.aa1.removeAll(Collections.singleton("bar"));
- assertNotNull(this.event1);
- assertEquals(this.event1Type, REMOVE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- assertEquals("bar", ((CollectionRemoveEvent) this.event1).getItems().iterator().next());
- namesMinus.remove("bar");
- assertEquals(namesMinus, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testCollectionChange() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.addTwoNames("jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.getCollectionName());
- Collection<String> namesPlus2 = this.subject1Names();
- namesPlus2.add("jam");
- namesPlus2.add("jaz");
- assertEquals(namesPlus2, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.subject1.names()));
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.names()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.aa1.iterator()));
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- this.aa1.removeCollectionChangeListener(CollectionValueModel.VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- assertFalse(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- ChangeListener listener2 = new ChangeAdapter();
- this.aa1.addChangeListener(listener2);
- assertTrue(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- this.aa1.removeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- assertFalse(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
-
- // ********** inner class **********
-
- private class TestSubject extends AbstractModel {
- private Collection<String> names;
- public static final String NAMES_COLLECTION = "names";
- private Collection<String> descriptions;
- public static final String DESCRIPTIONS_COLLECTION = "descriptions";
-
- public TestSubject() {
- this.names = new HashBag<String>();
- this.descriptions = new HashBag<String>();
- }
- public Iterator<String> names() {
- return new ReadOnlyIterator<String>(this.names);
- }
- public void addName(String name) {
- if (this.names.add(name)) {
- this.fireItemAdded(NAMES_COLLECTION, name);
- }
- }
- public void addNames(Iterator<String> newNames) {
- while (newNames.hasNext()) {
- this.addName(newNames.next());
- }
- }
- public void addNames(Collection<String> newNames) {
- this.addNames(newNames.iterator());
- }
- public void addTwoNames(String name1, String name2) {
- if (this.names.add(name1) | this.names.add(name2)) {
- this.fireCollectionChanged(NAMES_COLLECTION, this.names);
- }
- }
- public void removeName(String name) {
- if (this.names.remove(name)) {
- this.fireItemRemoved(NAMES_COLLECTION, name);
- }
- }
- public Iterator<String> descriptions() {
- return new ReadOnlyIterator<String>(this.descriptions);
- }
- public void addDescription(String description) {
- if (this.descriptions.add(description)) {
- this.fireItemAdded(DESCRIPTIONS_COLLECTION, description);
- }
- }
- public void addDescriptions(Iterator<String> newDescriptions) {
- while (newDescriptions.hasNext()) {
- this.addDescription(newDescriptions.next());
- }
- }
- public void addDescriptions(Collection<String> newDescriptions) {
- this.addDescriptions(newDescriptions.iterator());
- }
- public void removeDescription(String description) {
- if (this.descriptions.remove(description)) {
- this.fireItemRemoved(DESCRIPTIONS_COLLECTION, description);
- }
- }
- }
-
- // this is not a typical aspect adapter - the value is determined by the aspect name
- private class LocalCollectionAspectAdapter extends CollectionAspectAdapter<TestSubject, String> {
-
- LocalCollectionAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- super(subjectHolder, TestSubject.NAMES_COLLECTION);
- }
-
- @Override
- protected Iterator<String> iterator_() {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- return this.subject.names();
- }
- if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- return this.subject.descriptions();
- }
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
-
- public void add(String item) {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- this.subject.addName(item);
- } else if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- this.subject.addDescription(item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
- }
-
- public void addAll(Collection<String> items) {
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- this.add(stream.next());
- }
- }
-
- public void remove(Object item) {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- this.subject.removeName((String) item);
- } else if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- this.subject.removeDescription((String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
- }
-
- public void removeAll(Collection<String> items) {
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- this.remove(stream.next());
- }
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
deleted file mode 100644
index 7c0a154f5b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CollectionListValueModelAdapterTests extends TestCase {
- private ListValueModel<String> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- private Collection<String> wrappedCollection;
-
- public CollectionListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollection = new HashBag<String>();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>(this.wrappedCollection);
- this.adapter = new CollectionListValueModelAdapter<String>(this.wrappedCollectionHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- private Collection<String> adapterCollection() {
- return CollectionTools.collection(this.adapter.iterator());
- }
-
- public void testStaleValue() {
- ListChangeListener listener = new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- };
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
-
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterCollection = this.adapterCollection();
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- public void testAdd() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testRemove() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertTrue(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListRemoveEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener cl = new ChangeAdapter();
- this.adapter.addChangeListener(cl);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeChangeListener(cl);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testCollectionChangedToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void listCleared(ListClearEvent e) {/* OK */}
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedCollectionHolder.setValues(new HashBag<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListRemoveEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- bag.add("foo");
- bag.add("bar");
- this.wrappedCollectionHolder.setValues(bag);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListRemoveEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- this.wrappedCollectionHolder.setValues(bag);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListAddEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListRemoveEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListReplaceEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListMoveEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListClearEvent e) {
- fail("unexpected event");
- }
- public void listChanged(ListChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
deleted file mode 100644
index 559c12635d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CollectionPropertyValueModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Boolean> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- PropertyChangeEvent event;
-
- public CollectionPropertyValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>();
- this.adapter = new LocalAdapter(this.wrappedCollectionHolder, "666");
- this.event = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private boolean booleanValue() {
- return this.adapter.getValue().booleanValue();
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(this.wrappedCollectionHolder.iterator());
- }
-
- public void testValue() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- });
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.add("111");
- assertFalse(this.booleanValue());
-
- this.wrappedCollectionHolder.add("222");
- assertFalse(this.booleanValue());
-
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.remove("666");
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.clear();
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
- }
-
- public void testSetValue() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- });
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.adapter.setValue(Boolean.TRUE);
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.setValue(Boolean.FALSE);
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
- }
-
- public void testEventFiring() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CollectionPropertyValueModelAdapterTests.this.event = e;
- }
- });
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("111");
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("222");
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("666");
- this.verifyEvent(false, true);
-
- this.wrappedCollectionHolder.remove("666");
- this.verifyEvent(true, false);
-
- this.wrappedCollectionHolder.add("666");
- this.verifyEvent(false, true);
-
- this.wrappedCollectionHolder.clear();
- this.verifyEvent(true, false);
- }
-
- private void verifyEvent(boolean oldValue, boolean newValue) {
- assertEquals(this.adapter, this.event.getSource());
- assertEquals(Boolean.valueOf(oldValue), this.event.getOldValue());
- assertEquals(Boolean.valueOf(newValue), this.event.getNewValue());
- this.event = null;
- }
-
- public void testStaleValue() {
- PropertyChangeListener listener = new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- };
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- ChangeListener listener = new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- };
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.addChangeListener(listener);
- assertTrue(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.removeChangeListener(listener);
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
-
- // ********** member class **********
-
- /**
- * the value is true if the wrapped collection contains the specified item,
- * otherwise the value is false
- */
- static class LocalAdapter
- extends CollectionPropertyValueModelAdapter<Boolean>
- implements WritablePropertyValueModel<Boolean>
- {
- private String item;
-
- LocalAdapter(CollectionValueModel<String> collectionHolder, String item) {
- super(collectionHolder);
- this.item = item;
- }
-
- // ********** CollectionPropertyValueModelAdapter implementation **********
- /**
- * always return a Boolean
- */
- @Override
- public Boolean getValue() {
- Boolean result = super.getValue();
- return (result == null) ? Boolean.FALSE : result;
- }
- @SuppressWarnings("unchecked")
- public void setValue(Boolean value) {
- if (this.booleanValue()) {
- if ( ! this.booleanValueOf(value)) {
- // the value is changing from true to false
- ((SimpleCollectionValueModel<String>) this.collectionModel).remove(this.item);
- }
- } else {
- if (this.booleanValueOf(value)) {
- // the value is changing from false to true
- ((SimpleCollectionValueModel<String>) this.collectionModel).add(this.item);
- }
- }
- }
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(CollectionTools.contains(this.collectionModel.iterator(), this.item));
- }
-
- // ********** internal methods **********
- private boolean booleanValue() {
- return this.booleanValueOf(this.value);
- }
- private boolean booleanValueOf(Object b) {
- return (b == null) ? false : ((Boolean) b).booleanValue();
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeBooleanPropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeBooleanPropertyValueModelTests.java
deleted file mode 100644
index 1cd4bb25cb..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeBooleanPropertyValueModelTests.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeBooleanPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-public class CompositeBooleanPropertyValueModelTests extends TestCase {
- private SimplePropertyValueModel<Boolean> pvm1;
- private WritablePropertyValueModel<Boolean> pvm2;
- private WritablePropertyValueModel<Boolean> pvm3;
- private WritablePropertyValueModel<Boolean> pvm4;
- private Collection<WritablePropertyValueModel<Boolean>> collection;
- private SimpleCollectionValueModel<WritablePropertyValueModel<Boolean>> cvm;
- private PropertyValueModel<Boolean> compositePVM;
- PropertyChangeEvent event;
-
-
- public CompositeBooleanPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.pvm1 = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.pvm2 = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.pvm3 = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.pvm4 = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.collection = new ArrayList<WritablePropertyValueModel<Boolean>>();
- this.collection.add(this.pvm1);
- this.collection.add(this.pvm2);
- this.collection.add(this.pvm3);
- this.collection.add(this.pvm4);
- this.cvm = new SimpleCollectionValueModel<WritablePropertyValueModel<Boolean>>(this.collection);
-
- this.compositePVM = this.buildCompositePVM(cvm);
- }
-
- private PropertyValueModel<Boolean> buildCompositePVM(CollectionValueModel<WritablePropertyValueModel<Boolean>> pvms) {
- return CompositeBooleanPropertyValueModel.and(pvms);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetValue() {
- assertNull(this.compositePVM.getValue());
- ChangeListener listener = this.buildListener();
- this.compositePVM.addChangeListener(listener);
- assertTrue(this.compositePVM.getValue().booleanValue());
- }
-
- public void testValueAndListeners1() {
- assertNull(this.compositePVM.getValue());
- ChangeListener listener = this.buildListener();
- this.compositePVM.addChangeListener(listener);
- assertTrue(this.compositePVM.getValue().booleanValue());
- this.compositePVM.removeChangeListener(listener);
- assertNull(this.compositePVM.getValue());
- }
-
- public void testValueAndListeners2() {
- assertNull(this.compositePVM.getValue());
- ChangeListener listener = this.buildListener();
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(this.compositePVM.getValue().booleanValue());
- this.compositePVM.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertNull(this.compositePVM.getValue());
- }
-
- public void testPropertyChange1() {
- this.compositePVM.addChangeListener(this.buildListener());
- this.verifyPropertyChange();
- }
-
- public void testPropertyChange2() {
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.verifyPropertyChange();
- }
-
- private void verifyPropertyChange() {
- this.event = null;
- this.pvm1.setValue(Boolean.FALSE);
- this.verifyEvent(true, false);
-
- this.event = null;
- this.pvm2.setValue(Boolean.FALSE);
- assertNull(this.event); // no change
-
- this.event = null;
- this.pvm2.setValue(Boolean.TRUE);
- assertNull(this.event); // no change
-
- this.event = null;
- this.pvm1.setValue(Boolean.TRUE);
- this.verifyEvent(false, true);
-
- this.event = null;
- this.pvm4.setValue(Boolean.FALSE);
- this.verifyEvent(true, false);
- }
-
- public void testCollectionChange1() {
- this.compositePVM.addChangeListener(this.buildListener());
- this.verifyCollectionChange();
- }
-
- public void testCollectionChange2() {
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.verifyCollectionChange();
- }
-
- private void verifyCollectionChange() {
- this.event = null;
- WritablePropertyValueModel<Boolean> pvm = new SimplePropertyValueModel<Boolean>(Boolean.FALSE);
- this.cvm.add(pvm);
- this.verifyEvent(true, false);
-
- this.event = null;
- this.cvm.remove(pvm);
- this.verifyEvent(false, true);
-
- this.event = null;
- this.cvm.clear();
- this.verifyEvent(Boolean.TRUE, null);
-
- Collection<WritablePropertyValueModel<Boolean>> c2 = new ArrayList<WritablePropertyValueModel<Boolean>>();
- c2.add(this.pvm1);
- c2.add(this.pvm2);
- this.event = null;
- this.cvm.setValues(c2);
- this.verifyEvent(null, Boolean.TRUE);
- }
-
- public void testLazyListening1() {
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildListener();
-
- this.compositePVM.addChangeListener(listener);
- assertTrue(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.compositePVM.removeChangeListener(listener);
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testLazyListening2() {
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildListener();
-
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.compositePVM.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- CompositeBooleanPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(boolean oldValue, boolean newValue) {
- this.verifyEvent(Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
-
- private void verifyEvent(Boolean oldValue, Boolean newValue) {
- assertEquals(this.compositePVM, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.getPropertyName());
- assertEquals(oldValue, this.event.getOldValue());
- assertEquals(newValue, this.event.getNewValue());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
deleted file mode 100644
index 1f0c74218c..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CompositeCollectionValueModelTests extends TestCase {
- private Neighborhood neighborhood;
- private WritablePropertyValueModel<Neighborhood> neighborhoodHolder;
-
- public CompositeCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.neighborhood = new Neighborhood("Hanna-Barbera");
- this.neighborhoodHolder = new SimplePropertyValueModel<Neighborhood>(this.neighborhood);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSynch1() {
- this.verifySynch(this.buildAllMembersComposite(this.neighborhoodHolder));
- }
-
- public void testSynch2() {
- this.verifySynch(this.buildAllMembersComposite2(this.neighborhoodHolder));
- }
-
- private void verifySynch(CollectionValueModel<Member> compositeCVM) {
- assertEquals(0, CollectionTools.size(compositeCVM.iterator()));
- Bag<Family> familiesSynch = new CoordinatedBag<Family>(this.buildFamiliesAspectAdapter(this.neighborhoodHolder));
- Bag<Member> membersSynch = new CoordinatedBag<Member>(compositeCVM);
- this.populateNeighborhood(this.neighborhood);
-
- Family jetsons = this.neighborhood.familyNamed("Jetson");
-
- assertEquals(3, familiesSynch.size());
- assertEquals(12, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(12, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.removeMember(jetsons.memberNamed("Astro"));
- assertEquals(3, familiesSynch.size());
- assertEquals(11, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(11, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.removeMember(jetsons.memberNamed("Judy"));
- assertEquals(3, familiesSynch.size());
- assertEquals(10, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(10, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.addMember("Fido");
- assertEquals(3, familiesSynch.size());
- assertEquals(11, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(11, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- this.neighborhood.removeFamily(jetsons);
- assertEquals(2, familiesSynch.size());
- assertEquals(7, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(7, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- Family bears = this.neighborhood.addFamily("Bear");
- bears.addMember("Yogi");
- assertEquals(3, familiesSynch.size());
- assertEquals(8, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(8, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- bears.addMember("Boo-Boo");
- assertEquals(3, familiesSynch.size());
- assertEquals(9, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(9, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- Neighborhood n2 = new Neighborhood("Hanna-Barbera 2");
- this.neighborhoodHolder.setValue(n2);
- this.populateNeighborhood(n2);
- assertEquals(3, familiesSynch.size());
- assertEquals(12, CollectionTools.size(n2.allMembers()));
- assertEquals(12, membersSynch.size());
- assertEquals(CollectionTools.bag(n2.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
- }
-
- public void testNoTransformer() {
- SimpleCollectionValueModel<String> subCVM1 = new SimpleCollectionValueModel<String>();
- SimpleCollectionValueModel<String> subCVM2 = new SimpleCollectionValueModel<String>();
- Collection<CollectionValueModel<String>> collection = new ArrayList<CollectionValueModel<String>>();
- collection.add(subCVM1);
- collection.add(subCVM2);
- Bag<String> synchBag = new CoordinatedBag<String>(new CompositeCollectionValueModel<CollectionValueModel<String>, String>(collection));
-
- assertEquals(0, synchBag.size());
-
- subCVM1.add("foo");
- subCVM1.add("bar");
- subCVM1.add("baz");
- assertEquals(3, synchBag.size());
- assertTrue(synchBag.contains("foo"));
-
- subCVM2.add("joo");
- subCVM2.add("jar");
- subCVM2.add("jaz");
- assertEquals(6, synchBag.size());
- assertTrue(synchBag.contains("foo"));
- assertTrue(synchBag.contains("jaz"));
-
- subCVM1.remove("baz");
- assertEquals(5, synchBag.size());
- assertFalse(synchBag.contains("baz"));
- }
-
- public void testDuplicateItem() {
- Bag<Member> synchBag = new CoordinatedBag<Member>(this.buildAllMembersComposite(this.neighborhoodHolder));
- this.populateNeighborhood(this.neighborhood);
- boolean exCaught = false;
- try {
- this.neighborhood.addFamily(this.neighborhood.familyNamed("Jetson"));
- } catch (IllegalStateException ex) {
- if (ex.getMessage().indexOf("duplicate component") != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- assertEquals(12, synchBag.size());
- }
-
- public void testHasListeners() {
- CompositeCollectionValueModel<Family, Member> compositeCVM = this.buildAllMembersComposite(this.neighborhoodHolder);
- CoordinatedBag<Member> synchBag = new CoordinatedBag<Member>(compositeCVM);
- this.populateNeighborhood(this.neighborhood);
- Family jetsons = this.neighborhood.familyNamed("Jetson");
-
- assertTrue(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
-
- compositeCVM.removeCollectionChangeListener(CollectionValueModel.VALUES, synchBag);
- assertFalse(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertFalse(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
-
- compositeCVM.addCollectionChangeListener(CollectionValueModel.VALUES, synchBag);
- assertTrue(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
- }
-
- private void populateNeighborhood(Neighborhood n) {
- Family family1 = n.addFamily("Flintstone");
- family1.addMember("Fred");
- family1.addMember("Wilma");
- family1.addMember("Pebbles");
- family1.addMember("Dino");
- Family family2 = n.addFamily("Rubble");
- family2.addMember("Barney");
- family2.addMember("Betty");
- family2.addMember("Bamm-Bamm");
- Family family3 = n.addFamily("Jetson");
- family3.addMember("George");
- family3.addMember("Jane");
- family3.addMember("Judy");
- family3.addMember("Elroy");
- family3.addMember("Astro");
- }
-
- private CollectionValueModel<Family> buildFamiliesAspectAdapter(PropertyValueModel<Neighborhood> communeHolder) {
- return new CollectionAspectAdapter<Neighborhood, Family>(communeHolder, Neighborhood.FAMILIES_COLLECTION) {
- @Override
- protected Iterator<Family> iterator_() {
- return this.subject.families();
- }
- };
- }
-
- CollectionValueModel<Member> buildMembersAdapter(Family family) {
- return new CollectionAspectAdapter<Family, Member>(Family.MEMBERS_COLLECTION, family) {
- @Override
- protected Iterator<Member> iterator_() {
- return this.subject.members();
- }
- };
- }
-
- private CompositeCollectionValueModel<Family, Member> buildAllMembersComposite(PropertyValueModel<Neighborhood> communeHolder) {
- // override #transform(Object)
- return new CompositeCollectionValueModel<Family, Member>(this.buildFamiliesAspectAdapter(communeHolder)) {
- @Override
- protected CollectionValueModel<Member> transform(Family family) {
- return CompositeCollectionValueModelTests.this.buildMembersAdapter(family);
- }
- };
- }
-
- private CollectionValueModel<Member> buildAllMembersComposite2(PropertyValueModel<Neighborhood> communeHolder) {
- // build a custom Transformer
- return new CompositeCollectionValueModel<Family, Member>(this.buildFamiliesAspectAdapter(communeHolder), this.buildTransformer());
- }
-
- private Transformer<Family, CollectionValueModel<Member>> buildTransformer() {
- return new Transformer<Family, CollectionValueModel<Member>>() {
- public CollectionValueModel<Member> transform(Family family) {
- return CompositeCollectionValueModelTests.this.buildMembersAdapter(family);
- }
- @Override
- public String toString() {
- return "Local Transformer";
- }
- };
- }
-
-
-// ********** inner classes **********
-
- /**
- * inner class
- */
- public class Neighborhood extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Collection<Family> families = new ArrayList<Family>();
- public static final String FAMILIES_COLLECTION = "families";
-
- public Neighborhood(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<Family> families() {
- return this.families.iterator();
- }
-
- public Family addFamily(String familyName) {
- return this.addFamily(new Family(familyName));
- }
-
- // backdoor to allow duplicates
- public Family addFamily(Family family) {
- this.addItemToCollection(family, this.families, FAMILIES_COLLECTION);
- return family;
- }
-
- public void removeFamily(Family family) {
- this.removeItemFromCollection(family, this.families, FAMILIES_COLLECTION);
- }
-
- public Family familyNamed(String familyName) {
- for (Family family : this.families) {
- if (family.getName().equals(familyName)) {
- return family;
- }
- }
- throw new IllegalArgumentException(familyName);
- }
-
- public Iterator<Member> allMembers() {
- return new CompositeIterator<Member>(this.membersIterators());
- }
-
- private Iterator<Iterator<Member>> membersIterators() {
- return new TransformationIterator<Family, Iterator<Member>>(this.families()) {
- @Override
- protected Iterator<Member> transform(Family family) {
- return family.members();
- }
- };
- }
-
- public Member memberNamed(String familyName, String memberName) {
- return this.familyNamed(familyName).memberNamed(memberName);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-
- /**
- * inner class
- */
- public class Family extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Collection<Member> members = new ArrayList<Member>();
- public static final String MEMBERS_COLLECTION = "members";
-
- public Family(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<Member> members() {
- return this.members.iterator();
- }
-
- public Member addMember(String memberName) {
- Member member = new Member(memberName);
- this.addItemToCollection(member, this.members, MEMBERS_COLLECTION);
- return member;
- }
-
- public void removeMember(Member member) {
- this.removeItemFromCollection(member, this.members, MEMBERS_COLLECTION);
- }
-
- public Member memberNamed(String memberName) {
- for (Member member : this.members) {
- if (member.getName().equals(memberName)) {
- return member;
- }
- }
- throw new IllegalArgumentException(memberName);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-
- /**
- * inner class
- */
- public class Member extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Member(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeListValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeListValueModelTests.java
deleted file mode 100644
index 82cf531454..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositeListValueModelTests.java
+++ /dev/null
@@ -1,1248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CompositeListValueModelTests extends TestCase {
- private LocalListValueModel<String> lvm0;
- private LocalListValueModel<String> lvm1;
- private LocalListValueModel<String> lvm2;
- private LocalListValueModel<String> lvm3;
- private LocalListValueModel<LocalListValueModel<String>> uberLVM;
- private CompositeListValueModel<LocalListValueModel<String>, String> compositeLVM;
-
- public CompositeListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.lvm0 = new LocalListValueModel<String>();
- this.lvm0.add("aaa");
- this.lvm0.add("bbb");
- this.lvm0.add("ccc");
-
- this.lvm1 = new LocalListValueModel<String>();
- this.lvm1.add("ddd");
- this.lvm1.add("eee");
-
- this.lvm2 = new LocalListValueModel<String>();
- this.lvm2.add("fff");
-
- this.lvm3 = new LocalListValueModel<String>();
- this.lvm3.add("ggg");
- this.lvm3.add("hhh");
- this.lvm3.add("iii");
- this.lvm3.add("jjj");
- this.lvm3.add("kkk");
-
- this.uberLVM = new LocalListValueModel<LocalListValueModel<String>>();
- this.uberLVM.add(this.lvm0);
- this.uberLVM.add(this.lvm1);
- this.uberLVM.add(this.lvm2);
- this.uberLVM.add(this.lvm3);
-
- this.compositeLVM = new CompositeListValueModel<LocalListValueModel<String>, String>((ListValueModel<LocalListValueModel<String>>) this.uberLVM);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetInt() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals("aaa", this.compositeLVM.get(0));
- assertEquals("aaa", coordList.get(0));
- assertEquals("bbb", this.compositeLVM.get(1));
- assertEquals("bbb", coordList.get(1));
- assertEquals("ccc", this.compositeLVM.get(2));
- assertEquals("ccc", coordList.get(2));
-
- assertEquals("ddd", this.compositeLVM.get(3));
- assertEquals("ddd", coordList.get(3));
- assertEquals("eee", this.compositeLVM.get(4));
- assertEquals("eee", coordList.get(4));
-
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
-
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testIterator() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals("aaa", this.compositeLVM.iterator().next());
- assertEquals("aaa", coordList.iterator().next());
- Iterator<String> stream1 = coordList.iterator();
- for (Iterator<String> stream2 = this.compositeLVM.iterator(); stream2.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- assertFalse(stream1.hasNext());
- }
-
- public void testSize() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals(11, this.compositeLVM.size());
- assertEquals(11, coordList.size());
- }
-
- public void testToArray() {
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- }
-
- public void testHasListeners() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- assertTrue(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.compositeLVM.removeListChangeListener(ListValueModel.LIST_VALUES, coordList);
- assertFalse(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, coordList);
- assertTrue(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testAddSource_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- LocalListValueModel<String> lvm = new LocalListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(0, lvm);
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddSource_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- LocalListValueModel<String> lvm = new LocalListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(2, lvm);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddSource_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- LocalListValueModel<String> lvm = new LocalListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(lvm);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testAddSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- LocalListValueModel<String> lvmA = new LocalListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- LocalListValueModel<String> lvmB = new LocalListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- Collection<LocalListValueModel<String>> c = new ArrayList<LocalListValueModel<String>>();
- c.add(lvmA);
- c.add(lvmB);
- this.uberLVM.addAll(2, c);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "ppp", "qqq", "rrr", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(12));
- assertEquals("ggg", coordList.get(12));
- }
-
- public void testRemoveSource_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(0);
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testRemoveSource_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveSource_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testRemoveSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(2, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("eee", this.compositeLVM.get(4));
- assertEquals("eee", coordList.get(4));
- }
-
- public void testReplaceSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- LocalListValueModel<String> lvmA = new LocalListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- LocalListValueModel<String> lvmB = new LocalListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- List<LocalListValueModel<String>> list = new ArrayList<LocalListValueModel<String>>();
- list.add(lvmA);
- list.add(lvmB);
- this.uberLVM.set(2, list);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "ppp", "qqq", "rrr" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("qqq", this.compositeLVM.get(9));
- assertEquals("qqq", coordList.get(9));
- }
-
- public void testMoveSources_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(0, 2, 2);
-
- Object[] expected = new Object[] { "fff", "ggg", "hhh", "iii", "jjj", "kkk", "aaa", "bbb", "ccc", "ddd", "eee" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(1));
- assertEquals("ggg", coordList.get(1));
- }
-
- public void testMoveSources_Middle() {
- LocalListValueModel<String> lvm4 = new LocalListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- LocalListValueModel<String> lvm5 = new LocalListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(1, 3, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ggg", "hhh", "iii", "jjj", "kkk", "lll", "mmm", "ddd", "eee", "fff", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testMoveSources_End() {
- LocalListValueModel<String> lvm4 = new LocalListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- LocalListValueModel<String> lvm5 = new LocalListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(3, 0, 3);
-
- Object[] expected = new Object[] { "ggg", "hhh", "iii", "jjj", "kkk", "lll", "mmm", "nnn", "ooo", "ppp", "qqq", "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(0));
- assertEquals("ggg", coordList.get(0));
- }
-
- public void testMoveSource() {
- LocalListValueModel<String> lvm4 = new LocalListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- LocalListValueModel<String> lvm5 = new LocalListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(3, 1);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "ddd", "eee", "lll", "mmm", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ooo", this.compositeLVM.get(14));
- assertEquals("ooo", coordList.get(14));
- }
-
- public void testClearSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.clear();
-
- Object[] expected = new Object[0];
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- }
-
- public void testChangeSources1() {
- List<LocalListValueModel<String>> newList = new ArrayList<LocalListValueModel<String>>();
- LocalListValueModel<String> lvm4 = new LocalListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- newList.add(lvm4);
-
- LocalListValueModel<String> lvm5 = new LocalListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- newList.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.setListValues(newList);
-
- Object[] expected = new Object[] { "lll", "mmm", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ooo", this.compositeLVM.get(3));
- assertEquals("ooo", coordList.get(3));
- }
-
- public void testChangeSources2() {
- List<LocalListValueModel<String>> newList = new ArrayList<LocalListValueModel<String>>();
- LocalListValueModel<String> lvm4 = new LocalListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- newList.add(lvm4);
-
- LocalListValueModel<String> lvm5 = new LocalListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- newList.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.changeListValues(newList);
-
- Object[] expected = new Object[] { "lll", "mmm", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ooo", this.compositeLVM.get(3));
- assertEquals("ooo", coordList.get(3));
- }
-
- public void testChangeSources3() {
- ListChangeListener listener = new ErrorListener();
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
-
- List<LocalListValueModel<String>> newList = new ArrayList<LocalListValueModel<String>>();
- newList.add(this.lvm0);
- newList.add(this.lvm1);
- newList.add(this.lvm2);
- newList.add(this.lvm3);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.changeListValues(newList);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ddd", this.compositeLVM.get(3));
- assertEquals("ddd", coordList.get(3));
- }
-
- public void testChangeSources4() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsAdded(ListAddEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
-
- List<LocalListValueModel<String>> newList = new ArrayList<LocalListValueModel<String>>();
- newList.add(this.lvm0);
- newList.add(this.lvm1);
- newList.add(this.lvm2);
- newList.add(this.lvm3);
- LocalListValueModel<String> lvm4 = new LocalListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- newList.add(lvm4);
-
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.changeListValues(newList);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "lll", "mmm" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ddd", this.compositeLVM.get(3));
- assertEquals("ddd", coordList.get(3));
- }
-
- public void testChangeSources5() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsRemoved(ListRemoveEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
-
- List<LocalListValueModel<String>> newList = new ArrayList<LocalListValueModel<String>>();
- newList.add(this.lvm0);
- newList.add(this.lvm1);
- newList.add(this.lvm2);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.changeListValues(newList);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ddd", this.compositeLVM.get(3));
- assertEquals("ddd", coordList.get(3));
- }
-
- public void testChangeSources6() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsAdded(ListAddEvent event) { /* OK */ }
- @Override
- public void itemsRemoved(ListRemoveEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
-
- List<LocalListValueModel<String>> newList = new ArrayList<LocalListValueModel<String>>();
- newList.add(this.lvm0);
- newList.add(this.lvm1);
-
- LocalListValueModel<String> lvm4 = new LocalListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- newList.add(lvm4);
-
- newList.add(this.lvm3);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.changeListValues(newList);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "lll", "mmm", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ddd", this.compositeLVM.get(3));
- assertEquals("ddd", coordList.get(3));
- }
-
- public void testAddItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.add(0, "xxx");
-
- Object[] expected = new Object[] { "xxx", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testAddItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.add(1, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testAddItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.add(5, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testAddItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.addAll(0, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.addAll(1, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "yyy", "zzz", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.addAll(5, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testRemoveItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.remove(0);
-
- Object[] expected = new Object[] { "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.remove(0);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(4);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testRemoveItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.remove(0, 3);
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testRemoveItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(1, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("kkk", this.compositeLVM.get(7));
- assertEquals("kkk", coordList.get(7));
- }
-
- public void testRemoveItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(3, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.set(0, "xxx");
-
- Object[] expected = new Object[] { "xxx", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.set(0, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(4, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "xxx" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.set(0, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(1, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "xxx", "yyy", "zzz", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("kkk", this.compositeLVM.get(10));
- assertEquals("kkk", coordList.get(10));
- }
-
- public void testReplaceItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(3, Arrays.asList(new String[] { "xxx", "yyy" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "xxx", "yyy" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.move(2, 0);
-
- Object[] expected = new Object[] { "bbb", "ccc", "aaa", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.move(0, 1);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "eee", "ddd", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.move(0, 4);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "kkk", "ggg", "hhh", "iii", "jjj" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testMoveItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.move(1, 0, 2);
-
- Object[] expected = new Object[] { "ccc", "aaa", "bbb", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.add("eee.1");
- this.lvm1.add("eee.2");
- this.lvm1.add("eee.3");
- this.lvm1.move(1, 2, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee.1", "eee.2", "eee.3", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testMoveItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.move(0, 2, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "iii", "jjj", "kkk", "ggg", "hhh" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testClearItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.clear();
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testClearItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.clear();
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(4));
- assertEquals("ggg", coordList.get(4));
- }
-
- public void testClearItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.clear();
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testChangeItems_Begin1() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.setListValues(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testChangeItems_Middle1() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.setListValues(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "xxx", "yyy", "zzz", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testChangeItems_End1() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.setListValues(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testChangeItems_Begin2() {
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, new ErrorListener());
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.changeListValues(Arrays.asList(new String[] { "aaa", "bbb", "ccc" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testChangeItems_Middle2() {
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, new ErrorListener());
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.changeListValues(Arrays.asList(new String[] { "ddd", "eee" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("hhh", this.compositeLVM.get(7));
- assertEquals("hhh", coordList.get(7));
- }
-
- public void testChangeItems_End2() {
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, new ErrorListener());
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.changeListValues(Arrays.asList(new String[] { "ggg", "hhh", "iii", "jjj", "kkk" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testChangeItems_Begin3() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsReplaced(ListReplaceEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.changeListValues(Arrays.asList(new String[] { "aaa", "bbb", "xxx" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "xxx", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testChangeItems_Middle3() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsReplaced(ListReplaceEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.changeListValues(Arrays.asList(new String[] { "ddd", "xxx" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "xxx", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("hhh", this.compositeLVM.get(7));
- assertEquals("hhh", coordList.get(7));
- }
-
- public void testChangeItems_End3() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsReplaced(ListReplaceEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.changeListValues(Arrays.asList(new String[] { "ggg", "hhh", "iii", "xxx", "kkk" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "xxx", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testChangeItems_Begin4() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsAdded(ListAddEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.changeListValues(Arrays.asList(new String[] { "aaa", "bbb", "ccc", "xxx" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "xxx", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(6));
- assertEquals("fff", coordList.get(6));
- }
-
- public void testChangeItems_Middle4() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsAdded(ListAddEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.changeListValues(Arrays.asList(new String[] { "ddd", "eee", "xxx" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testChangeItems_End4() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsAdded(ListAddEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.changeListValues(Arrays.asList(new String[] { "ggg", "hhh", "iii", "jjj", "kkk", "xxx" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testChangeItems_Begin5() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsRemoved(ListRemoveEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.changeListValues(Arrays.asList(new String[] { "aaa" }));
-
- Object[] expected = new Object[] { "aaa", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("iii", this.compositeLVM.get(6));
- assertEquals("iii", coordList.get(6));
- }
-
- public void testChangeItems_Middle5() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsRemoved(ListRemoveEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.changeListValues(Arrays.asList(new String[] { "ddd" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("iii", this.compositeLVM.get(7));
- assertEquals("iii", coordList.get(7));
- }
-
- public void testChangeItems_End5() {
- ListChangeListener listener = new ErrorListener() {
- @Override
- public void itemsRemoved(ListRemoveEvent event) { /* OK */ }
- };
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.changeListValues(Arrays.asList(new String[] { "ggg", "hhh", "iii" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- class ErrorListener implements ListChangeListener {
- public void itemsAdded(ListAddEvent event) {
- fail();
- }
- public void itemsRemoved(ListRemoveEvent event) {
- fail();
- }
- public void itemsMoved(ListMoveEvent event) {
- fail();
- }
- public void itemsReplaced(ListReplaceEvent event) {
- fail();
- }
- public void listCleared(ListClearEvent event) {
- fail();
- }
- public void listChanged(ListChangeEvent event) {
- fail();
- }
- }
-
- class LocalListValueModel<E> extends SimpleListValueModel<E> {
- LocalListValueModel() {
- super();
- }
- void changeListValues(Iterable<E> listValues) {
- if (listValues == null) {
- throw new NullPointerException();
- }
- this.list.clear();
- CollectionTools.addAll(this.list, listValues);
- this.fireListChanged(LIST_VALUES, this.list);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositePropertyValueModelTests.java
deleted file mode 100644
index 5fa2413fea..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CompositePropertyValueModelTests.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.value.CompositePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-public class CompositePropertyValueModelTests extends TestCase {
- private SimplePropertyValueModel<Integer> pvm1;
- private WritablePropertyValueModel<Integer> pvm2;
- private WritablePropertyValueModel<Integer> pvm3;
- private WritablePropertyValueModel<Integer> pvm4;
- private Collection<WritablePropertyValueModel<Integer>> collection;
- private SimpleCollectionValueModel<WritablePropertyValueModel<Integer>> cvm;
- private PropertyValueModel<Integer> compositePVM;
- PropertyChangeEvent event;
-
-
- public CompositePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.pvm1 = new SimplePropertyValueModel<Integer>(Integer.valueOf(1));
- this.pvm2 = new SimplePropertyValueModel<Integer>(Integer.valueOf(2));
- this.pvm3 = new SimplePropertyValueModel<Integer>(Integer.valueOf(3));
- this.pvm4 = new SimplePropertyValueModel<Integer>(Integer.valueOf(4));
- this.collection = new ArrayList<WritablePropertyValueModel<Integer>>();
- this.collection.add(this.pvm1);
- this.collection.add(this.pvm2);
- this.collection.add(this.pvm3);
- this.collection.add(this.pvm4);
- this.cvm = new SimpleCollectionValueModel<WritablePropertyValueModel<Integer>>(this.collection);
-
- this.compositePVM = this.buildCompositePVM(cvm);
- }
-
- private <T extends PropertyValueModel<?>> PropertyValueModel<Integer> buildCompositePVM(CollectionValueModel<T> pvms) {
- return new CompositePropertyValueModel<Integer>(pvms) {
- @Override
- protected Integer buildValue() {
- int sum = 0;
- for (PropertyValueModel<Integer> each : this.getCollectionModel()) {
- sum += each.getValue().intValue();
- }
- return Integer.valueOf(sum);
- }
- @Override
- @SuppressWarnings("unchecked")
- protected CollectionValueModel<PropertyValueModel<Integer>> getCollectionModel() {
- return (CollectionValueModel<PropertyValueModel<Integer>>) super.getCollectionModel();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetValue() {
- assertNull(this.compositePVM.getValue());
- ChangeListener listener = this.buildListener();
- this.compositePVM.addChangeListener(listener);
- assertEquals(10, this.compositePVM.getValue().intValue());
- }
-
- public void testValueAndListeners1() {
- assertNull(this.compositePVM.getValue());
- ChangeListener listener = this.buildListener();
- this.compositePVM.addChangeListener(listener);
- assertEquals(10, this.compositePVM.getValue().intValue());
- this.compositePVM.removeChangeListener(listener);
- assertNull(this.compositePVM.getValue());
- }
-
- public void testValueAndListeners2() {
- assertNull(this.compositePVM.getValue());
- ChangeListener listener = this.buildListener();
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertEquals(10, this.compositePVM.getValue().intValue());
- this.compositePVM.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertNull(this.compositePVM.getValue());
- }
-
- public void testPropertyChange1() {
- this.compositePVM.addChangeListener(this.buildListener());
- this.verifyPropertyChange();
- }
-
- public void testPropertyChange2() {
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.verifyPropertyChange();
- }
-
- private void verifyPropertyChange() {
- this.event = null;
- this.pvm1.setValue(Integer.valueOf(5));
- this.verifyEvent(10, 14);
-
- this.event = null;
- this.pvm4.setValue(Integer.valueOf(0));
- this.verifyEvent(14, 10);
- }
-
- public void testCollectionChange1() {
- this.compositePVM.addChangeListener(this.buildListener());
- this.verifyCollectionChange();
- }
-
- public void testCollectionChange2() {
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.verifyCollectionChange();
- }
-
- private void verifyCollectionChange() {
- this.event = null;
- WritablePropertyValueModel<Integer> pvm = new SimplePropertyValueModel<Integer>(Integer.valueOf(77));
- this.cvm.add(pvm);
- this.verifyEvent(10, 87);
-
- this.event = null;
- this.cvm.remove(pvm);
- this.verifyEvent(87, 10);
-
- this.event = null;
- this.cvm.clear();
- this.verifyEvent(10, 0);
-
- Collection<WritablePropertyValueModel<Integer>> c2 = new ArrayList<WritablePropertyValueModel<Integer>>();
- c2.add(this.pvm1);
- c2.add(this.pvm2);
- this.event = null;
- this.cvm.setValues(c2);
- this.verifyEvent(0, 3);
- }
-
- public void testLazyListening1() {
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildListener();
-
- this.compositePVM.addChangeListener(listener);
- assertTrue(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.compositePVM.removeChangeListener(listener);
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testLazyListening2() {
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildListener();
-
- this.compositePVM.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.compositePVM.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(this.pvm1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- CompositePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(int oldValue, int newValue) {
- assertEquals(this.compositePVM, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.getPropertyName());
- assertEquals(Integer.valueOf(oldValue), this.event.getOldValue());
- assertEquals(Integer.valueOf(newValue), this.event.getNewValue());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedBag.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedBag.java
deleted file mode 100644
index 508a4d62f4..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedBag.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-
-/**
- * Helper class that keeps an internal collection in synch with the
- * collection held by a collection value model.
- */
-class CoordinatedBag<E> implements Bag<E>, CollectionChangeListener {
-
- private Bag<E> bag = new HashBag<E>();
-
- CoordinatedBag(CollectionValueModel<E> cvm) {
- cvm.addCollectionChangeListener(CollectionValueModel.VALUES, this);
- }
-
-
- // ********** Collection implementation **********
-
- public boolean add(E o) {
- return this.bag.add(o);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.bag.addAll(c);
- }
-
- public void clear() {
- this.bag.clear();
- }
-
- public boolean contains(Object o) {
- return this.bag.contains(o);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.bag.containsAll(c);
- }
-
- public boolean isEmpty() {
- return this.bag.isEmpty();
- }
-
- public Iterator<E> iterator() {
- return this.bag.iterator();
- }
-
- public boolean remove(Object o) {
- return this.bag.remove(o);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.bag.removeAll(c);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.bag.retainAll(c);
- }
-
- public int size() {
- return this.bag.size();
- }
-
- public Object[] toArray() {
- return this.bag.toArray();
- }
-
- public <T> T[] toArray(T[] a) {
- return this.bag.toArray(a);
- }
-
-
- // ********** Bag implementation **********
-
- public int count(Object o) {
- return this.bag.count(o);
- }
-
- public boolean add(E o, int count) {
- return this.bag.add(o, count);
- }
-
- public boolean remove(Object o, int count) {
- return this.bag.remove(o, count);
- }
-
- public Iterator<E> uniqueIterator() {
- return this.bag.uniqueIterator();
- }
-
- public int uniqueCount() {
- return this.bag.uniqueCount();
- }
-
- public Iterator<Bag.Entry<E>> entries() {
- return this.bag.entries();
- }
-
- // ********** CollectionChangeListener implementation **********
-
- @SuppressWarnings("unchecked")
- public void itemsAdded(CollectionAddEvent event) {
- for (E item : (Iterable<E>) event.getItems()) {
- this.bag.add(item);
- }
- }
-
- @SuppressWarnings("unchecked")
- public void itemsRemoved(CollectionRemoveEvent event) {
- for (E item : (Iterable<E>) event.getItems()) {
- this.bag.remove(item);
- }
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- this.bag.clear();
- }
-
- @SuppressWarnings("unchecked")
- public void collectionChanged(CollectionChangeEvent event) {
- this.bag.clear();
- CollectionTools.addAll(this.bag, ((CollectionValueModel<E>) event.getSource()).iterator());
- }
-
-
- // ********** standard methods **********
-
- @Override
- public boolean equals(Object o) {
- return this.bag.equals(o);
- }
-
- @Override
- public int hashCode() {
- return this.bag.hashCode();
- }
-
- @Override
- public String toString() {
- return this.bag.toString();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedList.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedList.java
deleted file mode 100644
index 95cf02457b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/CoordinatedList.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.ListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-
-/**
- * Helper class that keeps an internal list in synch with the
- * list held by a list value model.
- */
-public class CoordinatedList<E> implements List<E>, ListChangeListener, ListDataListener {
- private List<E> list = new ArrayList<E>();
-
- public CoordinatedList(ListValueModel<E> listValueModel) {
- listValueModel.addListChangeListener(ListValueModel.LIST_VALUES, this);
- for (Iterator<E> stream = listValueModel.iterator(); stream.hasNext(); ) {
- this.add(stream.next());
- }
- }
-
- public CoordinatedList(ListModel listModel) {
- listModel.addListDataListener(this);
- for (int i = 0; i < listModel.getSize(); i++) {
- this.add(i, this.getElementAt(listModel, i));
- }
- }
-
-
- // ********** List implementation **********
-
- public void add(int index, E element) {
- this.list.add(index, element);
- }
-
- public boolean add(E o) {
- return this.list.add(o);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.list.addAll(c);
- }
-
- public boolean addAll(int index, Collection<? extends E> c) {
- return this.list.addAll(index, c);
- }
-
- public void clear() {
- this.list.clear();
- }
-
- public boolean contains(Object o) {
- return this.list.contains(o);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.list.containsAll(c);
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
- public int indexOf(Object o) {
- return this.list.indexOf(o);
- }
-
- public boolean isEmpty() {
- return this.list.isEmpty();
- }
-
- public Iterator<E> iterator() {
- return this.list.iterator();
- }
-
- public int lastIndexOf(Object o) {
- return this.list.lastIndexOf(o);
- }
-
- public ListIterator<E> listIterator() {
- return this.list.listIterator();
- }
-
- public ListIterator<E> listIterator(int index) {
- return this.list.listIterator(index);
- }
-
- public E remove(int index) {
- return this.list.remove(index);
- }
-
- public boolean remove(Object o) {
- return this.list.remove(o);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.list.removeAll(c);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.list.retainAll(c);
- }
-
- public E set(int index, E element) {
- return this.list.set(index, element);
- }
-
- public int size() {
- return this.list.size();
- }
-
- public List<E> subList(int fromIndex, int toIndex) {
- return this.list.subList(fromIndex, toIndex);
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
- public <T> T[] toArray(T[] a) {
- return this.list.toArray(a);
- }
-
-
- // ********** ListChangeListener implementation **********
-
- public void itemsAdded(ListAddEvent e) {
- int i = e.getIndex();
- for (E item : this.getItems(e)) {
- this.list.add(i++, item);
- }
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- int base = e.getIndex();
- for (int i = e.getItemsSize(); i-- > 0; ) {
- this.list.remove(base + i); // remove from end
- }
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- int i = e.getIndex();
- for (E item : this.getNewItems(e)) {
- this.list.set(i++, item);
- }
- }
-
- public void itemsMoved(ListMoveEvent e) {
- CollectionTools.move(this.list, e.getTargetIndex(), e.getSourceIndex(), e.getLength());
- }
-
- public void listCleared(ListClearEvent e) {
- this.list.clear();
- }
-
- public void listChanged(ListChangeEvent e) {
- this.list.clear();
- CollectionTools.addAll(this.list, this.getSource(e).iterator());
- }
-
-
- // ********** ListDataListener implementation **********
-
- public void contentsChanged(ListDataEvent e) {
- this.list.clear();
- ListModel lm = (ListModel) e.getSource();
- int size = lm.getSize();
- for (int i = 0; i < size; i++) {
- this.list.add(i, this.getElementAt(lm, i));
- }
- }
-
- public void intervalAdded(ListDataEvent e) {
- ListModel lm = (ListModel) e.getSource();
- int start = Math.min(e.getIndex0(), e.getIndex1());
- int end = Math.max(e.getIndex0(), e.getIndex1());
- for (int i = start; i <= end; i++) {
- this.list.add(i, this.getElementAt(lm, i));
- }
- }
-
- public void intervalRemoved(ListDataEvent e) {
- int start = Math.min(e.getIndex0(), e.getIndex1());
- int end = Math.max(e.getIndex0(), e.getIndex1());
- int length = end - start + 1;
- for (int i = 1; i <= length; i++) {
- this.list.remove(start);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public boolean equals(Object o) {
- return this.list.equals(o);
- }
-
- @Override
- public int hashCode() {
- return this.list.hashCode();
- }
-
- @Override
- public String toString() {
- return this.list.toString();
- }
-
-
- // ********** internal methods **********
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private E getElementAt(ListModel listModel, int index) {
- return (E) listModel.getElementAt(index);
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Iterable<E> getItems(ListAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Iterable<E> getNewItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getNewItems();
- }
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private ListValueModel<E> getSource(ListChangeEvent event) {
- return (ListValueModel<E>) event.getSource();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
deleted file mode 100644
index 56e1a25d14..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ExtendedListValueModelWrapperTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> extendedListHolder;
- ListEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
- public ExtendedListValueModelWrapperTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- this.extendedListHolder = this.buildExtendedListHolder(this.listHolder);
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("A");
- result.add("B");
- result.add("C");
- result.add("D");
- return result;
- }
-
- private List<String> buildExtendedList() {
- List<String> extendedList = new ArrayList<String>();
- extendedList.addAll(this.buildPrefix());
- extendedList.addAll(this.buildList());
- extendedList.addAll(this.buildSuffix());
- return extendedList;
- }
-
- private List<String> buildPrefix() {
- List<String> prefix = new ArrayList<String>();
- prefix.add("x");
- prefix.add("y");
- prefix.add("z");
- return prefix;
- }
-
- private List<String> buildSuffix() {
- List<String> suffix = new ArrayList<String>();
- suffix.add("i");
- suffix.add("j");
- return suffix;
- }
-
- private ListValueModel<String> buildExtendedListHolder(ListValueModel<String> lvm) {
- return new ExtendedListValueModelWrapper<String>(this.buildPrefix(), lvm, this.buildSuffix());
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildExtendedList(), CollectionTools.list(this.extendedListHolder.iterator()));
- }
-
- public void testSize() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildExtendedList().size(), CollectionTools.size(this.extendedListHolder.iterator()));
- assertEquals(this.buildExtendedList().size(), this.extendedListHolder.size());
- }
-
- private boolean extendedListContains(Object item) {
- return CollectionTools.contains(this.extendedListHolder.iterator(), item);
- }
-
- private boolean extendedListContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.extendedListHolder.iterator(), items);
- }
-
- private boolean extendedListContainsAny(Collection<String> items) {
- List<String> extendedList = CollectionTools.list(this.extendedListHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (extendedList.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- private boolean listContains(Object item) {
- return CollectionTools.contains(this.listHolder.iterator(), item);
- }
-
- private boolean listContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.listHolder.iterator(), items);
- }
-
-// private boolean listContainsAny(Collection<String> items) {
-// List<String> extendedList = CollectionTools.list(this.listHolder.iterator());
-// for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
-// if (extendedList.contains(stream.next())) {
-// return true;
-// }
-// }
-// return false;
-// }
-//
- public void testAdd1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContains("E"));
- this.listHolder.add(4, "E");
- assertTrue(this.extendedListContains("E"));
- assertTrue(this.listContains("E"));
- }
-
- public void testAdd2() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContains(null));
- this.listHolder.add(4, null);
- assertTrue(this.extendedListContains(null));
- assertTrue(this.listContains(null));
- }
-
- private List<String> buildAddList() {
- List<String> addList = new ArrayList<String>();
- addList.add("E");
- addList.add("F");
- return addList;
- }
-
- public void testAddAll1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContainsAny(this.buildAddList()));
- this.listHolder.addAll(4, this.buildAddList());
- assertTrue(this.extendedListContainsAll(this.buildAddList()));
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testRemove1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertTrue(this.extendedListContains("B"));
- this.listHolder.remove(this.buildList().indexOf("B"));
- assertFalse(this.extendedListContains("B"));
- assertFalse(this.listContains("B"));
- }
-
- public void testListChangeGeneric() {
- this.extendedListHolder.addChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChangeNamed() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(4, "E");
- this.verifyEvent(ADD, 7, "E");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(5, null);
- this.verifyEvent(ADD, 8, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(5);
- this.verifyEvent(REMOVE, 8, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(4);
- this.verifyEvent(REMOVE, 7, "E");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildList(), CollectionTools.list(((ListAddEvent) this.event).getItems()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "AA");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(((ListReplaceEvent) this.event).getNewItems(), "A"));
- assertTrue(CollectionTools.contains(((ListReplaceEvent) this.event).getNewItems(), "AA"));
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(ListAddEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = ADD;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- @Override
- public void itemsRemoved(ListRemoveEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REMOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- @Override
- public void itemsReplaced(ListReplaceEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REPLACE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- @Override
- public void itemsMoved(ListMoveEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = MOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- @Override
- public void listCleared(ListClearEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = CLEAR;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- @Override
- public void listChanged(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = CHANGE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String type) {
- assertEquals(type, this.eventType);
- assertEquals(this.extendedListHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.getListName());
- }
-
- private void verifyEvent(String type, int index, Object item) {
- this.verifyEvent(type);
- if (type == ADD) {
- assertEquals(index, ((ListAddEvent) this.event).getIndex());
- assertEquals(item, ((ListAddEvent) this.event).getItems().iterator().next());
- } else if (type == REMOVE) {
- assertEquals(index, ((ListRemoveEvent) this.event).getIndex());
- assertEquals(item, ((ListRemoveEvent) this.event).getItems().iterator().next());
- }
- }
-
- public void testHasListeners() {
- /*
- * adding listeners to the extended list will cause listeners
- * to be added to the wrapped list;
- * likewise, removing listeners from the extended list will
- * cause listeners to be removed from the wrapped list
- */
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener listener = this.buildListener();
-
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.removeChangeListener(listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
deleted file mode 100644
index df0787fe93..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.FilteringCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class FilteringCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> collectionHolder;
- CollectionAddEvent addEvent;
- CollectionRemoveEvent removeEvent;
- CollectionClearEvent collectionClearedEvent;
- CollectionChangeEvent collectionChangedEvent;
-
- private CollectionValueModel<String> filteredCollectionHolder;
- CollectionAddEvent filteredAddEvent;
- CollectionRemoveEvent filteredRemoveEvent;
- CollectionClearEvent filteredCollectionClearedEvent;
- CollectionChangeEvent filteredCollectionChangedEvent;
-
- public FilteringCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = new SimpleCollectionValueModel<String>(buildCollection());
- this.filteredCollectionHolder = new FilteringCollectionValueModel<String>(this.collectionHolder, this.buildFilter());
- }
-
- private Collection<String> buildCollection() {
- Collection<String> collection = new Vector<String>();
- collection.add("foo");
- return collection;
- }
-
- private Filter<String> buildFilter() {
- return new Filter<String>() {
- public boolean accept(String s) {
- return s.startsWith("b");
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- // add a listener to "activate" the wrapper
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.add("bar");
- Iterator<String> collectionHolderValue = this.collectionHolder.iterator();
- assertEquals("foo", collectionHolderValue.next());
- assertEquals("bar", collectionHolderValue.next());
- assertTrue(this.filteredCollectionHolder.iterator().hasNext());
- assertEquals("bar", this.filteredCollectionHolder.iterator().next());
-
- this.collectionHolder.remove("bar");
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.remove("foo");
- assertFalse(this.collectionHolder.iterator().hasNext());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.add("foo");
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
- }
-
- public void testSetValue() {
- // add a listener to "activate" the wrapper
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- Collection<String> newCollection = new Vector<String>();
- newCollection.add("fox");
- newCollection.add("baz");
-
- this.collectionHolder.setValues(newCollection);
-
- Iterator<String> collectionValues = this.collectionHolder.iterator();
- assertEquals("fox", collectionValues.next());
- assertEquals("baz", collectionValues.next());
- Iterator<String> filteredCollectionValues = this.filteredCollectionHolder.iterator();
- assertEquals("baz", filteredCollectionValues.next());
- assertFalse(filteredCollectionValues.hasNext());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- ChangeListener listener = this.buildFilteredChangeListener();
- this.filteredCollectionHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.filteredCollectionHolder.removeChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.filteredCollectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testCollectionChange1() {
- this.collectionHolder.addChangeListener(this.buildChangeListener());
- this.filteredCollectionHolder.addChangeListener(this.buildFilteredChangeListener());
- this.verifyCollectionChanges();
- }
-
- public void testCollectionChange2() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildListener());
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
- this.verifyCollectionChanges();
- }
-
- private void clearEvents() {
- this.addEvent = null;
- this.removeEvent = null;
- this.collectionClearedEvent = null;
- this.collectionChangedEvent = null;
- this.filteredAddEvent = null;
- this.filteredRemoveEvent = null;
- this.filteredCollectionClearedEvent = null;
- this.filteredCollectionChangedEvent = null;
- }
-
- private void verifyCollectionChanges() {
- clearEvents();
- this.collectionHolder.add("bar");
- Collection<String> tempCollection = new Vector<String>();
- tempCollection.add("bar");
- this.verifyEvent(this.addEvent, this.collectionHolder, tempCollection);
- this.verifyEvent(this.filteredAddEvent, this.filteredCollectionHolder, tempCollection);
-
- clearEvents();
- this.collectionHolder.remove("foo");
- tempCollection.remove("bar");
- tempCollection.add("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, tempCollection);
- assertNull(this.filteredRemoveEvent);
-
-
- clearEvents();
- this.collectionHolder.remove("bar");
- tempCollection.add("bar");
- tempCollection.remove("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, tempCollection);
- this.verifyEvent(this.filteredRemoveEvent, this.filteredCollectionHolder, tempCollection);
-
-
- clearEvents();
- this.collectionHolder.add("foo");
- tempCollection.remove("bar");
- tempCollection.add("foo");
- this.verifyEvent(this.addEvent, this.collectionHolder, tempCollection);
- assertNull(this.filteredAddEvent);
-
-
- clearEvents();
- Collection<String> newCollection = new Vector<String>();
- newCollection.add("fox");
- newCollection.add("baz");
-
- this.collectionHolder.setValues(newCollection);
-
- this.verifyEvent(this.collectionChangedEvent, this.collectionHolder);
-
- tempCollection.remove("foo");
- tempCollection.add("baz");
- this.verifyEvent(this.filteredCollectionChangedEvent, this.filteredCollectionHolder);
-
- }
-
- private CollectionChangeListener buildListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent e) {
- FilteringCollectionValueModelTests.this.addEvent = e;
- }
- public void itemsRemoved(CollectionRemoveEvent e) {
- FilteringCollectionValueModelTests.this.removeEvent = e;
- }
- public void collectionCleared(CollectionClearEvent e) {
- FilteringCollectionValueModelTests.this.collectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionChangedEvent = e;
- }
- };
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- FilteringCollectionValueModelTests.this.addEvent = e;
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- FilteringCollectionValueModelTests.this.removeEvent = e;
- }
- @Override
- public void collectionCleared(CollectionClearEvent e) {
- FilteringCollectionValueModelTests.this.collectionClearedEvent = e;
- }
- @Override
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionChangedEvent = e;
- }
- };
- }
-
- private CollectionChangeListener buildFilteredListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent e) {
- FilteringCollectionValueModelTests.this.filteredAddEvent = e;
- }
- public void itemsRemoved(CollectionRemoveEvent e) {
- FilteringCollectionValueModelTests.this.filteredRemoveEvent = e;
- }
- public void collectionCleared(CollectionClearEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionChangedEvent = e;
- }
- };
- }
-
- private ChangeListener buildFilteredChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- FilteringCollectionValueModelTests.this.filteredAddEvent = e;
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- FilteringCollectionValueModelTests.this.filteredRemoveEvent = e;
- }
- @Override
- public void collectionCleared(CollectionClearEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionClearedEvent = e;
- }
- @Override
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionChangedEvent = e;
- }
- };
- }
-
- private void verifyEvent(CollectionChangeEvent event, Object source) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- }
-
- private void verifyEvent(CollectionAddEvent event, Object source, Object items) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- assertEquals(items, CollectionTools.vector(event.getItems()));
- }
-
- private void verifyEvent(CollectionRemoveEvent event, Object source, Object items) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- assertEquals(items, CollectionTools.vector(event.getItems()));
- }
-
- public void testRemoveFilteredItem() {
- // build collection with TestItems
- SimpleCollectionValueModel<TestItem> tiHolder = new SimpleCollectionValueModel<TestItem>(this.buildCollection2());
- CollectionValueModel<TestItem> filteredTIHolder = new FilteringCollectionValueModel<TestItem>(tiHolder, this.buildFilter2());
- // add a listener to "activate" the wrapper
- filteredTIHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- assertEquals(0, filteredTIHolder.size());
-
- tiHolder.add(new TestItem("bar"));
- assertEquals(1, filteredTIHolder.size());
-
- TestItem baz = new TestItem("baz");
- tiHolder.add(baz);
- assertEquals(2, filteredTIHolder.size());
- // before removing it, change the item so that it is filtered
- baz.name = "jaz";
- tiHolder.remove(baz);
- // this would fail because the item was not removed from
- // the filtered collection cache... but we've fixed it now
- assertEquals(1, filteredTIHolder.size());
- }
-
- private Collection<TestItem> buildCollection2() {
- Collection<TestItem> collection = new Vector<TestItem>();
- collection.add(new TestItem("foo"));
- return collection;
- }
-
- private Filter<TestItem> buildFilter2() {
- return new Filter<TestItem>() {
- public boolean accept(TestItem ti) {
- return ti.name.startsWith("b");
- }
- };
- }
-
-
- // ********** TestItem inner class **********
-
- private class TestItem {
- String name;
- TestItem(String name) {
- super();
- this.name = name;
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
deleted file mode 100644
index a20db7f063..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BidiFilter;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.FilteringWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class FilteringPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<String> filteredObjectHolder;
- PropertyChangeEvent filteredEvent;
-
- public FilteringPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- this.filteredObjectHolder = new FilteringWritablePropertyValueModel<String>(this.objectHolder, this.buildFilter());
- }
-
- private BidiFilter<String> buildFilter() {
- return new BidiFilter<String>() {
- public boolean accept(String s) {
- return (s != null) && s.startsWith("b");
- }
- public boolean reverseAccept(String s) {
- return (s != null) && s.startsWith("b");
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- assertNull(this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- assertNotNull(this.filteredObjectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertNotNull(this.filteredObjectHolder.getValue());
- assertEquals("baz", this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.filteredObjectHolder.getValue());
-
- this.objectHolder.setValue("foo");
- assertEquals("foo", this.objectHolder.getValue());
- assertNull(this.filteredObjectHolder.getValue());
- }
-
- public void testSetValue() {
- this.filteredObjectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.filteredObjectHolder.setValue("foo");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.filteredObjectHolder.setValue(null);
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("bar", this.filteredObjectHolder.getValue());
-
- this.filteredObjectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertEquals("baz", this.filteredObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildFilteredListener();
- this.filteredObjectHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.filteredObjectHolder.removeChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.filteredObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.filteredObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addChangeListener(this.buildListener());
- this.filteredObjectHolder.addChangeListener(this.buildFilteredListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.filteredObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildFilteredListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, "foo", "bar");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, null, "bar");
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(this.event, this.objectHolder, "bar", "baz");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, "bar", "baz");
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("foo");
- this.verifyEvent(this.event, this.objectHolder, "baz", "foo");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, "baz", null);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("fop");
- this.verifyEvent(this.event, this.objectHolder, "foo", "fop");
- assertNull(this.filteredEvent);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, "fop", null);
- assertNull(this.filteredEvent);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, null, "bar");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, null, "bar");
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- FilteringPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private ChangeListener buildFilteredListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- FilteringPropertyValueModelTests.this.filteredEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
deleted file mode 100644
index 7ede9fcd6a..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemCollectionListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.swing.Displayable;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ItemCollectionListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemCollectionListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("foo");
- this.bar = new Junk("bar");
- this.baz = new Junk("baz");
- this.joo = new Junk("joo");
- this.jar = new Junk("jar");
- this.jaz = new Junk("jaz");
-
- this.tom = new Junk("tom");
- this.dick = new Junk("dick");
- this.harry = new Junk("harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(collectionHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_COLLECTION));
-
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertTrue(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelWrapper<Junk>(new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.removeStuff("bar");
- this.bar.addStuff("zzz");
- this.bar.addStuff("bar");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.removeStuff("zzz");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable, Comparable<Junk> {
- private Collection<String> stuff;
- public static final String STUFF_COLLECTION = "stuff";
-
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public String displayString() {
- return toString();
- }
-
- public Icon icon() {
- return null;
- }
-
- public int compareTo(Junk o) {
- return this.displayString().compareTo(o.displayString());
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
deleted file mode 100644
index d566ece7d8..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemListListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.swing.Displayable;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ItemListListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemListListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("foo");
- this.bar = new Junk("bar");
- this.baz = new Junk("baz");
- this.joo = new Junk("joo");
- this.jar = new Junk("jar");
- this.jaz = new Junk("jaz");
-
- this.tom = new Junk("tom");
- this.dick = new Junk("dick");
- this.harry = new Junk("harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(collectionHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
-
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertTrue(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelWrapper<Junk>(new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.removeStuff("bar");
- this.bar.addStuff("zzz");
- this.bar.addStuff("bar");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.removeStuff("zzz");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable, Comparable<Junk> {
- private List<String> stuff;
- public static final String STUFF_LIST = "stuff";
-
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
- public void addStuff(String stuffItem) {
- this.stuff.add(stuffItem);
- fireItemAdded(STUFF_LIST, this.stuff.indexOf(stuffItem), stuffItem);
- }
-
- public void removeStuff(String stuffItem) {
- int index = this.stuff.indexOf(stuffItem);
- this.stuff.remove(stuffItem);
- fireItemRemoved(STUFF_LIST, index, stuffItem);
- }
-
- public String displayString() {
- return toString();
- }
-
- public Icon icon() {
- return null;
- }
-
- public int compareTo(Junk o) {
- return this.displayString().compareTo(o.displayString());
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
deleted file mode 100644
index 35fce2a3e9..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.swing.Icon;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.swing.Displayable;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ItemPropertyListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemPropertyListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("this.foo");
- this.bar = new Junk("this.bar");
- this.baz = new Junk("this.baz");
- this.joo = new Junk("this.joo");
- this.jar = new Junk("this.jar");
- this.jaz = new Junk("this.jaz");
-
- this.tom = new Junk("this.tom");
- this.dick = new Junk("this.dick");
- this.harry = new Junk("this.harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(collectionHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.setValues(this.buildCollection());
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(listHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- // test concurrent modification exception
- listHolder.setListValues(this.buildList());
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<Junk> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<Junk>() {
- public int compare(Junk o1, Junk o2) {
- return o2.displayString().compareTo(o1.displayString());
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<Junk> comparator) {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(collectionHolder, comparator), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.setValues(this.buildCollection());
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<Junk> comparator) {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelWrapper<Junk>(listHolder, comparator), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.add(0, this.tom);
- listHolder.add(0, this.dick);
- listHolder.add(0, this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.setListValues(this.buildList());
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void compareSort(ListValueModel<Junk> listValueModel, List<Junk> list, Comparator<Junk> comparator) {
- SortedSet<Junk> ss = new TreeSet<Junk>(comparator);
- for (int i = 0; i < listValueModel.size(); i++) {
- ss.add(listValueModel.get(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<Junk> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
-
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelWrapper<Junk>(listHolder), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertTrue(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertTrue(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertTrue(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelWrapper<Junk>(listHolder), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelWrapper<Junk>(new ItemPropertyListValueModelAdapter<Junk>(listHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.setName("zzz");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.setName("this.bar");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable, Comparable<Junk> {
- private String name;
- public Junk(String name) {
- this.name = name;
- }
- public String displayString() {
- return this.name;
- }
- public Icon icon() {
- return null;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- public int compareTo(Junk o) {
- return this.displayString().compareTo(o.displayString());
- }
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
deleted file mode 100644
index 18730739e9..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemStateListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ItemStateListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemStateListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("this.foo");
- this.bar = new Junk("this.bar");
- this.baz = new Junk("this.baz");
- this.joo = new Junk("this.joo");
- this.jar = new Junk("this.jar");
- this.jaz = new Junk("this.jaz");
-
- this.tom = new Junk("this.tom");
- this.dick = new Junk("this.dick");
- this.harry = new Junk("this.harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(collectionHolder);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(listHolder);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<Junk> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<Junk>() {
- public int compare(Junk o1, Junk o2) {
- return o2.compareTo(o1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<Junk> comparator) {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(collectionHolder, comparator));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<Junk> comparator) {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelWrapper<Junk>(listHolder, comparator));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.add(0, this.tom);
- listHolder.add(0, this.dick);
- listHolder.add(0, this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void compareSort(ListValueModel<Junk> listValueModel, List<Junk> list, Comparator<Junk> comparator) {
- SortedSet<Junk> ss = new TreeSet<Junk>(comparator);
- for (int i = 0; i < listValueModel.size(); i++) {
- ss.add(listValueModel.get(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<Junk> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
-
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelWrapper<Junk>(listHolder));
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyStateChangeListeners());
- assertTrue(this.foo.hasAnyStateChangeListeners());
- assertTrue(this.jaz.hasAnyStateChangeListeners());
- assertTrue(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelWrapper<Junk>(listHolder));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelWrapper<Junk>(new ItemStateListValueModelAdapter<Junk>(listHolder));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.setName("zzz");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.setName("this.bar");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
- // ********** Junk class **********
- private class Junk extends AbstractModel implements Comparable<Junk> {
- private String name;
- public Junk(String name) {
- this.name = name;
- }
- public void setName(String name) {
- this.name = name;
- this.fireStateChanged();
- }
- public int compareTo(Junk j) {
- return this.name.compareTo(j.name);
- }
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/JptUtilityModelValueTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/JptUtilityModelValueTests.java
deleted file mode 100644
index 9812dd32bd..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/JptUtilityModelValueTests.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.prefs.JptUtilityModelValuePrefsTests;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.JptUtilityModelValueSwingTests;
-
-public class JptUtilityModelValueTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValueTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityModelValuePrefsTests.suite());
- suite.addTest(JptUtilityModelValueSwingTests.suite());
-
- suite.addTestSuite(BufferedWritablePropertyValueModelTests.class);
- suite.addTestSuite(CachingTransformationPropertyValueModelTests.class);
- suite.addTestSuite(CachingTransformationWritablePropertyValueModelTests.class);
- suite.addTestSuite(CollectionAspectAdapterTests.class);
- suite.addTestSuite(CollectionListValueModelAdapterTests.class);
- suite.addTestSuite(CollectionPropertyValueModelAdapterTests.class);
- suite.addTestSuite(CompositeBooleanPropertyValueModelTests.class);
- suite.addTestSuite(CompositeCollectionValueModelTests.class);
- suite.addTestSuite(CompositeListValueModelTests.class);
- suite.addTestSuite(CompositePropertyValueModelTests.class);
- suite.addTestSuite(ExtendedListValueModelWrapperTests.class);
- suite.addTestSuite(FilteringCollectionValueModelTests.class);
- suite.addTestSuite(FilteringPropertyValueModelTests.class);
- suite.addTestSuite(ItemCollectionListValueModelAdapterTests.class);
- suite.addTestSuite(ItemListListValueModelAdapterTests.class);
- suite.addTestSuite(ItemPropertyListValueModelAdapterTests.class);
- suite.addTestSuite(ItemStateListValueModelAdapterTests.class);
- suite.addTestSuite(ListAspectAdapterTests.class);
- suite.addTestSuite(ListCollectionValueModelAdapterTests.class);
- suite.addTestSuite(ListCuratorTests.class);
- suite.addTestSuite(NullCollectionValueModelTests.class);
- suite.addTestSuite(NullListValueModelTests.class);
- suite.addTestSuite(NullPropertyValueModelTests.class);
- suite.addTestSuite(PropertyAspectAdapterTests.class);
- suite.addTestSuite(PropertyCollectionValueModelAdapterTests.class);
- suite.addTestSuite(PropertyListValueModelAdapterTests.class);
- suite.addTestSuite(ReadOnlyWritablePropertyValueModelWrapperTests.class);
- suite.addTestSuite(SetCollectionValueModelTests.class);
- suite.addTestSuite(SimpleCollectionValueModelTests.class);
- suite.addTestSuite(SimpleListValueModelTests.class);
- suite.addTestSuite(SimplePropertyValueModelTests.class);
- suite.addTestSuite(SortedListValueModelAdapterTests.class);
- suite.addTestSuite(SortedListValueModelWrapperTests.class);
- suite.addTestSuite(StaticCollectionValueModelTests.class);
- suite.addTestSuite(StaticListValueModelTests.class);
- suite.addTestSuite(StaticValueModelTests.class);
- suite.addTestSuite(TransformationListValueModelTests.class);
- suite.addTestSuite(TransformationListValueModelTests.TransformerTests.class);
- suite.addTestSuite(TransformationPropertyValueModelTests.class);
- suite.addTestSuite(TreeAspectAdapterTests.class);
- suite.addTestSuite(ValueCollectionAdapterTests.class);
- suite.addTestSuite(ValueListAdapterTests.class);
- suite.addTestSuite(ValuePropertyAdapterTests.class);
- suite.addTestSuite(ValueStateAdapterTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValueTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListAspectAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListAspectAdapterTests.java
deleted file mode 100644
index d6f3fd2999..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListAspectAdapterTests.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ListAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalListAspectAdapter aa1;
- private ListEvent event1;
- private ListChangeListener listener1;
-
- private TestSubject subject2;
-
- public ListAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- this.subject1.addNames(this.subject1Names());
- this.subject1.addDescriptions(this.subject1Descriptions());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject();
- this.subject2.addNames(this.subject2Names());
- this.subject2.addDescriptions(this.subject2Descriptions());
- }
-
- private List<String> subject1Names() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- result.add("bam");
- return result;
- }
-
- private List<String> subject1Descriptions() {
- List<String> result = new ArrayList<String>();
- result.add("this.subject1 description1");
- result.add("this.subject1 description2");
- return result;
- }
-
- private List<String> subject2Names() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- result.add("jam");
- return result;
- }
-
- private List<String> subject2Descriptions() {
- List<String> result = new ArrayList<String>();
- result.add("this.subject2 description1");
- result.add("this.subject2 description2");
- return result;
- }
-
- private LocalListAspectAdapter buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new LocalListAspectAdapter(subjectHolder);
- }
-
- private ListChangeListener buildValueChangeListener1() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListRemoveEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListReplaceEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsMoved(ListMoveEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listCleared(ListClearEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject2Names(), CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertFalse(this.aa1.iterator().hasNext());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addName("jam");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject1Names().size(), ((ListAddEvent) this.event1).getIndex());
- assertEquals("jam", ((ListAddEvent) this.event1).getItems().iterator().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.add("jam");
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- this.aa1.add(2, "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(2, ((ListAddEvent) this.event1).getIndex());
- assertEquals("jaz", ((ListAddEvent) this.event1).getItems().iterator().next());
- namesPlus.add(2, "jaz");
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testDefaultAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- List<String> items = new ArrayList<String>();
- items.add("joo");
- items.add("jar");
- items.add("jaz");
- items.add("jam");
-
- this.event1 = null;
- this.aa1.addAll(2, items);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(5, ((ListAddEvent) this.event1).getIndex()); // only the last "add" event will still be there
- assertEquals("jam", ((ListAddEvent) this.event1).getItems().iterator().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.addAll(2, items);
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- String removedName = this.subject1.removeName(0); // should be "foo"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, ((ListRemoveEvent) this.event1).getIndex());
- assertEquals(removedName, ((ListRemoveEvent) this.event1).getItems().iterator().next());
- List<String> namesMinus = this.subject1Names();
- namesMinus.remove(0);
- assertEquals(namesMinus, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- Object removedItem = this.aa1.remove(0);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, ((ListRemoveEvent) this.event1).getIndex());
- assertEquals(removedItem, ((ListRemoveEvent) this.event1).getItems().iterator().next());
- namesMinus.remove(0);
- assertEquals(namesMinus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testDefaultLength() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- List<String> items = new ArrayList<String>();
- items.add("bar");
- items.add("baz");
-
- this.event1 = null;
- this.aa1.remove(1, 2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(1, ((ListRemoveEvent) this.event1).getIndex()); // only the last "remove" event will still be there
- assertEquals("baz", ((ListRemoveEvent) this.event1).getItems().iterator().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.remove(1);
- namesPlus.remove(1);
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testReplace() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- String replacedName = this.subject1.setName(0, "jelly"); // should be "foo"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, ((ListReplaceEvent) this.event1).getIndex());
- assertEquals("jelly", ((ListReplaceEvent) this.event1).getNewItems().iterator().next());
- assertEquals(replacedName, ((ListReplaceEvent) this.event1).getOldItems().iterator().next());
- List<String> namesChanged = this.subject1Names();
- namesChanged.set(0, "jelly");
- assertEquals(namesChanged, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- replacedName = this.subject1.setName(1, "roll"); // should be "bar"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(1, ((ListReplaceEvent) this.event1).getIndex());
- assertEquals("roll", ((ListReplaceEvent) this.event1).getNewItems().iterator().next());
- assertEquals(replacedName, ((ListReplaceEvent) this.event1).getOldItems().iterator().next());
- namesChanged = this.subject1Names();
- namesChanged.set(0, "jelly");
- namesChanged.set(1, "roll");
- assertEquals(namesChanged, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testListChange() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addTwoNames("jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- List<String> namesPlus2 = this.subject1Names();
- namesPlus2.add(0, "jaz");
- namesPlus2.add(0, "jam");
- assertEquals(namesPlus2, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.subject1.names()));
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testGet() {
- assertEquals(this.subject1Names().get(0), this.subject1.getName(0));
- assertEquals(this.subject1Names().get(0), this.aa1.get(0));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.names()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.aa1.listIterator()));
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- this.aa1.removeListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- assertFalse(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener listener2 = new ChangeAdapter();
- this.aa1.addChangeListener(listener2);
- assertTrue(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- this.aa1.removeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- assertFalse(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- // ********** inner class **********
-
- class TestSubject extends AbstractModel {
- private List<String> names;
- public static final String NAMES_LIST = "names";
- private List<String> descriptions;
- public static final String DESCRIPTIONS_LIST = "descriptions";
-
- public TestSubject() {
- this.names = new ArrayList<String>();
- this.descriptions = new ArrayList<String>();
- }
- public ListIterator<String> names() {
- return new ReadOnlyListIterator<String>(this.names);
- }
- public String getName(int index) {
- return this.names.get(index);
- }
- public void addName(int index, String name) {
- this.names.add(index, name);
- this.fireItemAdded(NAMES_LIST, index, name);
- }
- public void addName(String name) {
- this.addName(this.names.size(), name);
- }
- public void addNames(ListIterator<String> newNames) {
- while (newNames.hasNext()) {
- this.addName(newNames.next());
- }
- }
- public void addNames(List<String> newNames) {
- this.addNames(newNames.listIterator());
- }
- public void addTwoNames(String name1, String name2) {
- this.names.add(0, name2);
- this.names.add(0, name1);
- this.fireListChanged(NAMES_LIST, this.names);
- }
- public String removeName(int index) {
- String removedName = this.names.remove(index);
- this.fireItemRemoved(NAMES_LIST, index, removedName);
- return removedName;
- }
- public String setName(int index, String name) {
- String replacedName = this.names.set(index, name);
- this.fireItemReplaced(NAMES_LIST, index, name, replacedName);
- return replacedName;
- }
- public ListIterator<String> descriptions() {
- return new ReadOnlyListIterator<String>(this.descriptions);
- }
- public String getDescription(int index) {
- return this.descriptions.get(index);
- }
- public void addDescription(int index, String description) {
- this.descriptions.add(index, description);
- this.fireItemAdded(DESCRIPTIONS_LIST, index, description);
- }
- public void addDescription(String description) {
- this.addDescription(this.descriptions.size(), description);
- }
- public void addDescriptions(ListIterator<String> newDescriptions) {
- while (newDescriptions.hasNext()) {
- this.addDescription(newDescriptions.next());
- }
- }
- public void addDescriptions(List<String> newDescriptions) {
- this.addDescriptions(newDescriptions.listIterator());
- }
- public String removeDescription(int index) {
- String removedDescription = this.descriptions.remove(index);
- this.fireItemRemoved(DESCRIPTIONS_LIST, index, removedDescription);
- return removedDescription;
- }
- public String setDescription(int index, String description) {
- String replacedDescription = this.descriptions.set(index, description);
- this.fireItemReplaced(DESCRIPTIONS_LIST, index, description, replacedDescription);
- return replacedDescription;
- }
- }
-
-
- // this is not a typical aspect adapter - the value is determined by the aspect name
- class LocalListAspectAdapter extends ListAspectAdapter<TestSubject, String> {
-
- LocalListAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- super(subjectHolder, TestSubject.NAMES_LIST);
- }
-
- @Override
- protected ListIterator<String> listIterator_() {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.names();
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.descriptions();
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public void add(int index, Object item) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- this.subject.addName(index, (String) item);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- this.subject.addDescription(index, (String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public void addAll(int index, List<String> items) {
- for (int i = 0; i < items.size(); i++) {
- this.add(index + i, items.get(i));
- }
- }
-
- public String remove(int index) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.removeName(index);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.removeDescription(index);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public List<String> remove(int index, int length) {
- List<String> removedItems = new ArrayList<String>(length);
- for (int i = 0; i < length; i++) {
- removedItems.add(this.remove(index));
- }
- return removedItems;
- }
-
- public Object replace(int index, Object item) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.setName(index, (String) item);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.setDescription(index, (String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
deleted file mode 100644
index c499ad37ab..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ListCollectionValueModelAdapterTests extends TestCase {
- CollectionValueModel<String> adapter;
- private SimpleListValueModel<String> wrappedListHolder;
- private List<String> wrappedList;
-
- public ListCollectionValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedList = new ArrayList<String>();
- this.wrappedListHolder = new SimpleListValueModel<String>(this.wrappedList);
- this.adapter = new ListCollectionValueModelAdapter<String>(this.wrappedListHolder);
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(this.wrappedList.iterator());
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testStaleValues() {
- CollectionChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- };
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
-
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testAdd() {
- Bag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- List<String> synchList = new CoordinatedList<String>(this.wrappedListHolder);
- this.wrappedListHolder.add(0, "foo");
- assertTrue(this.wrappedList.contains("foo"));
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- assertEquals(6, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals(this.wrappedCollection(), CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection(), synchCollection);
- }
-
- public void testRemove() {
- Bag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- List<String> synchList = new CoordinatedList<String>(this.wrappedListHolder);
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- assertEquals("jaz", this.wrappedListHolder.remove(5));
- assertFalse(this.wrappedList.contains("jaz"));
- assertEquals("foo", this.wrappedListHolder.remove(0));
- assertFalse(this.wrappedList.contains("foo"));
- assertEquals(4, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals(this.wrappedCollection(), CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection(), synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- this.wrappedListHolder.remove(5);
- assertFalse(this.wrappedList.contains("jaz"));
- this.wrappedListHolder.remove(0);
- assertFalse(this.wrappedList.contains("foo"));
- assertEquals(4, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testReplace() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- assertEquals("foo", e.getItems().iterator().next());
- assertFalse(CollectionTools.contains(ListCollectionValueModelAdapterTests.this.adapter.iterator(), "joo"));
- assertEquals(2, ListCollectionValueModelAdapterTests.this.adapter.size());
- }
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- assertEquals("joo", e.getItems().iterator().next());
- assertEquals(3, ListCollectionValueModelAdapterTests.this.adapter.size());
- }
- });
- this.wrappedListHolder.set(0, "joo");
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- CoordinatedBag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- ChangeListener cl = new ChangeAdapter();
- this.adapter.addChangeListener(cl);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeChangeListener(cl);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- @Override
- public void collectionCleared(CollectionClearEvent e) {/* OK */}
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedListHolder.setListValues(new ArrayList<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- this.wrappedListHolder.setListValues(list);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- this.wrappedListHolder.setListValues(list);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** inner class **********
-
- class TestListener implements CollectionChangeListener {
- public void itemsAdded(CollectionAddEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionRemoveEvent e) {
- fail("unexpected event");
- }
- public void collectionCleared(CollectionClearEvent e) {
- fail("unexpected event");
- }
- public void collectionChanged(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCuratorTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCuratorTests.java
deleted file mode 100644
index 8aa2573750..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ListCuratorTests.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCurator;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public final class ListCuratorTests
- extends TestCase
-{
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
-
- private ListCurator<TestSubject, String> curator;
- private ListChangeListener listener1;
- private ListEvent event1;
-
- private TestSubject subject2;
-
- public ListCuratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject(this.subject1Names());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.curator = this.buildListCurator(this.subjectHolder1);
- this.listener1 = this.buildListChangeListener1();
- this.curator.addListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject(this.subject2Names());
- }
-
- private List<String> subject1Names() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("alpha");
- list.add("bravo");
- list.add("charlie");
- list.add("delta");
- return list;
- }
-
- private List<String> subject2Names() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("echo");
- list.add("foxtrot");
- list.add("glove");
- list.add("hotel");
- return list;
- }
-
- private ListCurator<TestSubject, String> buildListCurator(PropertyValueModel<TestSubject> subjectHolder) {
- return new ListCurator<TestSubject, String>(subjectHolder) {
- @Override
- public Iterator<String> iteratorForRecord() {
- return this.subject.strings();
- }
- };
- }
-
- private ListChangeListener buildListChangeListener1() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListRemoveEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListReplaceEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsMoved(ListMoveEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listCleared(ListClearEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject2Names(), CollectionTools.list(this.curator.listIterator()));
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertFalse(this.curator.iterator().hasNext());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addString("echo");
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(this.subject1Names().size(), ((ListAddEvent) this.event1).getIndex());
- assertEquals("echo", ((ListAddEvent) this.event1).getItems().iterator().next());
- List<String> stringsPlus = this.subject1Names();
- stringsPlus.add("echo");
- assertEquals(stringsPlus, CollectionTools.list(this.curator.listIterator()));
-
- this.event1 = null;
- this.subject1.addString(0, "zulu");
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, ((ListAddEvent) this.event1).getIndex());
- assertEquals("zulu", ((ListAddEvent) this.event1).getItems().iterator().next());
- stringsPlus.add(0, "zulu");
- assertEquals(stringsPlus, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- String removedString = this.subject1.removeString(0); // should be "alpha"
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(0, ((ListRemoveEvent) this.event1).getIndex());
- assertEquals(removedString, ((ListRemoveEvent) this.event1).getItems().iterator().next());
- List<String> stringsMinus = this.subject1Names();
- stringsMinus.remove(0);
- assertEquals(stringsMinus, CollectionTools.list(this.curator.listIterator()));
-
- removedString = this.subject1.removeString(2); // should be "delta"
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(2, ((ListRemoveEvent) this.event1).getIndex());
- assertEquals(removedString, ((ListRemoveEvent) this.event1).getItems().iterator().next());
- stringsMinus.remove(2);
- assertEquals(stringsMinus, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testCompleteListChange() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subject1.setStrings(this.subject2Names());
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- List<String> newStrings = this.subject2Names();
- assertEquals(newStrings, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testPartialListChange() {
- List<String> startingList = CollectionTools.list(this.curator.listIterator());
- assertEquals(this.subject1Names(), startingList);
- assertNull(this.event1);
-
- String identicalString = startingList.get(1); // should be "bravo"
- String nonidenticalString = startingList.get(0); // should be "alpha"
- List<String> newStrings = CollectionTools.list(new String[] {new String("bravo"), new String("alpha"), "echo", "delta", "foxtrot"});
- this.subject1.setStrings(newStrings);
-
- List<String> finalList = CollectionTools.list(this.curator.listIterator());
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.getListName());
- assertEquals(newStrings, finalList);
- assertTrue(identicalString == finalList.get(0));
- assertTrue(nonidenticalString != finalList.get(1));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.subject1.strings()));
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testGet() {
- assertEquals(this.subject1Names().get(0), this.subject1.getString(0));
- assertEquals(this.subject1Names().get(0), this.curator.get(0));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.strings()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.curator.listIterator()));
- assertEquals(this.subject1Names().size(), this.curator.size());
- }
-
- public void testHasListeners() {
- assertTrue(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyStateChangeListeners());
- this.curator.removeListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyStateChangeListeners());
- assertFalse(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener listener2 = this.buildChangeListener();
- this.curator.addChangeListener(listener2);
- assertTrue(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyStateChangeListeners());
- this.curator.removeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyStateChangeListeners());
- assertFalse(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(ListAddEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- @Override
- public void itemsRemoved(ListRemoveEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- @Override
- public void itemsReplaced(ListReplaceEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- @Override
- public void itemsMoved(ListMoveEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- @Override
- public void listCleared(ListClearEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- @Override
- public void listChanged(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- };
- }
-
-
- // **************** Inner Class *******************************************
-
- class TestSubject extends AbstractModel {
- private List<String> strings;
-
- public TestSubject() {
- this.strings = new ArrayList<String>();
- }
-
- public TestSubject(List<String> strings) {
- this();
- this.setStrings(strings);
- }
-
- public String getString(int index) {
- return this.strings.get(index);
- }
-
- public ListIterator<String> strings() {
- return new ReadOnlyListIterator<String>(this.strings);
- }
-
- public void addString(int index, String string) {
- this.strings.add(index, string);
- this.fireStateChanged();
- }
-
- public void addString(String string) {
- this.addString(this.strings.size(), string);
- }
-
- public String removeString(int index) {
- String string = this.strings.get(index);
- this.removeString(string);
- return string;
- }
-
- public void removeString(String string) {
- this.strings.remove(string);
- this.fireStateChanged();
- }
-
- public void setStrings(List<String> strings) {
- this.strings = new ArrayList<String>(strings);
- this.fireStateChanged();
- }
-
- public void setStrings(String[] strings) {
- this.strings = CollectionTools.list(strings);
- this.fireStateChanged();
- }
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullCollectionValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullCollectionValueModelTests.java
deleted file mode 100644
index 786bd931eb..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullCollectionValueModelTests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.model.value.NullCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-public class NullCollectionValueModelTests extends TestCase {
- private CollectionValueModel<Object> collectionHolder;
-
- public NullCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = new NullCollectionValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSize() {
- assertEquals(0, this.collectionHolder.size());
- }
-
- public void testIterator() {
- assertFalse(this.collectionHolder.iterator().hasNext());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullListValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullListValueModelTests.java
deleted file mode 100644
index 63ba4ac5cf..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullListValueModelTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-public class NullListValueModelTests extends TestCase {
- private ListValueModel<Object> listHolder;
-
- public NullListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new NullListValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGet() {
- boolean exCaught = false;
- try {
- this.listHolder.get(0);
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testSize() {
- assertEquals(0, this.listHolder.size());
- }
-
- public void testIterator() {
- assertFalse(this.listHolder.iterator().hasNext());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullPropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullPropertyValueModelTests.java
deleted file mode 100644
index eaf6422b9b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/NullPropertyValueModelTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.model.value.NullPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-public class NullPropertyValueModelTests extends TestCase {
- private PropertyValueModel<Object> valueHolder;
-
- public NullPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new NullPropertyValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertNull(this.valueHolder.getValue());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyAspectAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
deleted file mode 100644
index a9a4ec6c28..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class PropertyAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private PropertyAspectAdapter<TestSubject, String> aa1;
- private PropertyChangeEvent event1;
- private PropertyChangeListener listener1;
-
- private TestSubject subject2;
-
- private PropertyChangeEvent multipleValueEvent;
-
- private PropertyChangeEvent customValueEvent;
-
-
- public PropertyAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject("foo", "test subject 1");
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject> (this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject("bar", "test subject 2");
- }
-
- private PropertyAspectAdapter<TestSubject, String> buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY) {
- // this is not a aspect adapter - the value is determined by the aspect name
- @Override
- protected String buildValue_() {
- if (this.propertyNames[0] == TestSubject.NAME_PROPERTY) {
- return this.subject.getName();
- } else if (this.propertyNames[0] == TestSubject.DESCRIPTION_PROPERTY) {
- return this.subject.getDescription();
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.propertyNames[0]);
- }
- }
- @Override
- protected void setValue_(String value) {
- if (this.propertyNames[0] == TestSubject.NAME_PROPERTY) {
- this.subject.setName(value);
- } else if (this.propertyNames[0] == TestSubject.DESCRIPTION_PROPERTY) {
- this.subject.setDescription(value);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.propertyNames[0]);
- }
- }
- };
- }
-
- private ChangeListener buildValueChangeListener1() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(PropertyChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals("foo", this.aa1.getValue());
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("foo", this.event1.getOldValue());
- assertEquals("bar", this.event1.getNewValue());
- assertEquals("bar", this.aa1.getValue());
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("bar", this.event1.getOldValue());
- assertNull(this.event1.getNewValue());
- assertNull(this.aa1.getValue());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals(null, this.event1.getOldValue());
- assertEquals("foo", this.event1.getNewValue());
- assertEquals("foo", this.aa1.getValue());
- }
-
- public void testPropertyChange() {
- assertEquals("foo", this.aa1.getValue());
- assertNull(this.event1);
-
- this.subject1.setName("baz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("foo", this.event1.getOldValue());
- assertEquals("baz", this.event1.getNewValue());
- assertEquals("baz", this.aa1.getValue());
-
- this.event1 = null;
- this.subject1.setName(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals("baz", this.event1.getOldValue());
- assertEquals(null, this.event1.getNewValue());
- assertEquals(null, this.aa1.getValue());
-
- this.event1 = null;
- this.subject1.setName("foo");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.getPropertyName());
- assertEquals(null, this.event1.getOldValue());
- assertEquals("foo", this.event1.getNewValue());
- assertEquals("foo", this.aa1.getValue());
- }
-
- public void testValue() {
- assertEquals("foo", this.subject1.getName());
- assertEquals("foo", this.aa1.getValue());
- }
-
- public void testStaleValue() {
- assertEquals("foo", this.subject1.getName());
- assertEquals("foo", this.aa1.getValue());
-
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals(null, this.aa1.getValue());
-
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals("foo", this.aa1.getValue());
-
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- this.subjectHolder1.setValue(this.subject2);
- assertEquals(null, this.aa1.getValue());
-
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals("bar", this.aa1.getValue());
- }
-
- public void testSetValue() {
- this.aa1.setValue("baz");
- assertEquals("baz", this.aa1.getValue());
- assertEquals("baz", this.subject1.getName());
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertFalse(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- assertFalse(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- ChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addChangeListener(listener2);
- assertTrue(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- this.aa1.removeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- assertFalse(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testMultipleAspectAdapter() {
- TestSubject testSubject = new TestSubject("fred", "husband");
- WritablePropertyValueModel<TestSubject> testSubjectHolder = new SimplePropertyValueModel<TestSubject>(testSubject);
- WritablePropertyValueModel<String> testAA = this.buildMultipleAspectAdapter(testSubjectHolder);
- PropertyChangeListener testListener = this.buildMultipleValueChangeListener();
- testAA.addPropertyChangeListener(PropertyValueModel.VALUE, testListener);
- assertEquals("fred:husband", testAA.getValue());
-
- this.multipleValueEvent = null;
- testSubject.setName("wilma");
- assertEquals("wilma:husband", testAA.getValue());
- assertEquals("fred:husband", this.multipleValueEvent.getOldValue());
- assertEquals("wilma:husband", this.multipleValueEvent.getNewValue());
-
- this.multipleValueEvent = null;
- testSubject.setDescription("wife");
- assertEquals("wilma:wife", testAA.getValue());
- assertEquals("wilma:husband", this.multipleValueEvent.getOldValue());
- assertEquals("wilma:wife", this.multipleValueEvent.getNewValue());
- }
-
- private WritablePropertyValueModel<String> buildMultipleAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY, TestSubject.DESCRIPTION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName() + ":" + this.subject.getDescription();
- }
- };
- }
-
- private PropertyChangeListener buildMultipleValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.multipleValueChanged(e);
- }
- };
- }
-
- void multipleValueChanged(PropertyChangeEvent e) {
- this.multipleValueEvent = e;
- }
-
- /**
- * test a bug where we would call #buildValue() in
- * #engageNonNullSubject(), when we needed to call
- * it in #engageSubject(), so the cached value would
- * be rebuilt when the this.subject was set to null
- */
- public void testCustomBuildValueWithNullSubject() {
- TestSubject customSubject = new TestSubject("fred", "laborer");
- WritablePropertyValueModel<TestSubject> customSubjectHolder = new SimplePropertyValueModel<TestSubject>(customSubject);
- WritablePropertyValueModel<String> customAA = this.buildCustomAspectAdapter(customSubjectHolder);
- PropertyChangeListener customListener = this.buildCustomValueChangeListener();
- customAA.addPropertyChangeListener(PropertyValueModel.VALUE, customListener);
- assertEquals("fred", customAA.getValue());
-
- this.customValueEvent = null;
- customSubject.setName("wilma");
- assertEquals("wilma", customAA.getValue());
- assertEquals("fred", this.customValueEvent.getOldValue());
- assertEquals("wilma", this.customValueEvent.getNewValue());
-
- this.customValueEvent = null;
- customSubjectHolder.setValue(null);
- // this would fail - the value would be null...
- assertEquals("<unnamed>", customAA.getValue());
- assertEquals("wilma", this.customValueEvent.getOldValue());
- assertEquals("<unnamed>", this.customValueEvent.getNewValue());
- }
-
- /**
- * Test a bug:
- * If two listeners were added to an aspect adapter, one with an
- * aspect name and one without, the aspect adapter would add its
- * 'subjectChangeListener' to its 'subjectHolder' twice. As a result,
- * the following code will trigger an IllegalArgumentException
- * if the bug is present; otherwise, it completes silently.
- */
- public void testDuplicateListener() {
- ChangeListener listener2 = new ChangeAdapter();
- this.aa1.addChangeListener(listener2);
- }
-
- private WritablePropertyValueModel<String> buildCustomAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY) {
- @Override
- protected String buildValue() {
- return (this.subject == null) ? "<unnamed>" : this.subject.getName();
- }
- };
- }
-
- private PropertyChangeListener buildCustomValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.customValueChanged(e);
- }
- };
- }
-
- void customValueChanged(PropertyChangeEvent e) {
- this.customValueEvent = e;
- }
-
-
- // ********** test model **********
-
- private static class TestSubject extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private String description;
- public static final String DESCRIPTION_PROPERTY = "description";
-
- public TestSubject(String name, String description) {
- this.name = name;
- this.description = description;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- public String getDescription() {
- return this.description;
- }
- public void setDescription(String description) {
- Object old = this.description;
- this.description = description;
- this.firePropertyChanged(DESCRIPTION_PROPERTY, old, description);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
deleted file mode 100644
index 1ef4cddd88..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import javax.swing.JList;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class PropertyCollectionValueModelAdapterTests extends TestCase {
- private CollectionValueModel<String> adapter;
- private WritablePropertyValueModel<String> wrappedValueHolder;
-
- public PropertyCollectionValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedValueHolder = new SimplePropertyValueModel<String>();
- this.adapter = new PropertyCollectionValueModelAdapter<String>(this.wrappedValueHolder);
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(new SingleElementIterator<String>(this.wrappedValueHolder.getValue()));
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
- }
-
- public void testStaleValue() {
- CollectionChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- };
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- this.wrappedValueHolder.setValue("foo");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
-
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- CoordinatedBag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- ChangeListener cl = new ChangeAdapter();
- this.adapter.addChangeListener(cl);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeChangeListener(cl);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue("foo");
- assertEquals(1, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener());
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** member class **********
-
- static class TestListener implements CollectionChangeListener {
- public void collectionChanged(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void collectionCleared(CollectionClearEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(CollectionAddEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
deleted file mode 100644
index 180cfe55dc..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class PropertyListValueModelAdapterTests extends TestCase {
- private ListValueModel<String> adapter;
- private WritablePropertyValueModel<String> wrappedValueHolder;
-
- public PropertyListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedValueHolder = new SimplePropertyValueModel<String>();
- this.adapter = new PropertyListValueModelAdapter<String>(this.wrappedValueHolder);
- }
-
- private Collection<String> wrappedList() {
- return CollectionTools.list(new SingleElementIterator<String>(this.wrappedValueHolder.getValue()));
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListAddEvent event) {/* OK */}
- });
- assertFalse(this.adapter.iterator().hasNext());
- this.wrappedValueHolder.setValue("foo");
- List<String> adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
- }
-
- public void testGetInt() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListAddEvent event) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- assertEquals("foo", this.adapter.get(0));
- }
-
- public void testToArray1() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListAddEvent event) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- Object[] array = this.adapter.toArray();
- assertEquals("foo", array[0]);
- assertEquals(1, array.length);
- }
-
- public void testToArray2() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener());
- Object[] array = this.adapter.toArray();
- assertEquals(0, array.length);
- }
-
- public void testStaleValue() {
- ListChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(ListAddEvent event) {/* OK */}
- };
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- this.wrappedValueHolder.setValue("foo");
- List<String> adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
-
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(0, adapterList.size());
- assertEquals(new ArrayList<String>(), adapterList);
-
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener cl = new ChangeAdapter();
- this.adapter.addChangeListener(cl);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeChangeListener(cl);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.wrappedValueHolder.setValue("foo");
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsRemoved(ListRemoveEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testListChangedFromEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListAddEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue("foo");
- assertEquals(1, jList.getModel().getSize());
- }
-
- public void testListItemChanged() {
- this.wrappedValueHolder.setValue("foo");
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsReplaced(ListReplaceEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
- assertEquals(1, jList.getModel().getSize());
- assertEquals("foo", jList.getModel().getElementAt(0));
-
- this.wrappedValueHolder.setValue("bar");
- assertEquals(1, jList.getModel().getSize());
- assertEquals("bar", jList.getModel().getElementAt(0));
- }
-
- public void testListChangedFromEmptyToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener());
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** member class **********
-
- static class TestListener implements ListChangeListener {
- public void listChanged(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void listCleared(ListClearEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(ListAddEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListRemoveEvent event) {
- fail("unexpected event");
- }
- public void itemsMoved(ListMoveEvent event) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListReplaceEvent event) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ReadOnlyWritablePropertyValueModelWrapperTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ReadOnlyWritablePropertyValueModelWrapperTests.java
deleted file mode 100644
index 938f6e9073..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ReadOnlyWritablePropertyValueModelWrapperTests.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ReadOnlyWritablePropertyValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ReadOnlyWritablePropertyValueModelWrapperTests
- extends TestCase
-{
- private WritablePropertyValueModel<String> objectHolder;
-
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<String> wrapperObjectHolder;
-
- PropertyChangeEvent wrapperEvent;
-
-
- public ReadOnlyWritablePropertyValueModelWrapperTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- this.wrapperObjectHolder = new ReadOnlyWritablePropertyValueModelWrapper<String>(this.objectHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("foo", this.wrapperObjectHolder.getValue());
-
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("bar", this.wrapperObjectHolder.getValue());
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.wrapperObjectHolder.getValue());
-
- this.objectHolder.setValue("foo");
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("foo", this.wrapperObjectHolder.getValue());
- }
-
- public void testSetValue() {
- boolean exceptionOccurred = false;
- try {
- this.wrapperObjectHolder.setValue("bar");
- }
- catch (UnsupportedOperationException uoe) {
- exceptionOccurred = true;
- }
-
- assertTrue(exceptionOccurred);
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("foo", this.wrapperObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = buildWrapperListener();
- this.wrapperObjectHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.wrapperObjectHolder.removeChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.wrapperObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.wrapperObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addChangeListener(this.buildListener());
- this.wrapperObjectHolder.addChangeListener(this.buildWrapperListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.wrapperObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildWrapperListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.wrapperEvent = null;
- this.objectHolder.setValue("bar");
- verifyEvent(this.event, this.objectHolder, "foo", "bar");
- verifyEvent(this.wrapperEvent, this.wrapperObjectHolder, "foo", "bar");
-
- this.event = null;
- this.wrapperEvent = null;
- this.objectHolder.setValue(null);
- verifyEvent(this.event, this.objectHolder, "bar", null);
- verifyEvent(this.wrapperEvent, this.wrapperObjectHolder, "bar", null);
-
- this.event = null;
- this.wrapperEvent = null;
- this.objectHolder.setValue("foo");
- verifyEvent(this.event, this.objectHolder, null, "foo");
- verifyEvent(this.wrapperEvent, this.wrapperObjectHolder, null, "foo");
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- ReadOnlyWritablePropertyValueModelWrapperTests.this.event = e;
- }
- };
- }
-
- private ChangeListener buildWrapperListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- ReadOnlyWritablePropertyValueModelWrapperTests.this.wrapperEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SetCollectionValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SetCollectionValueModelTests.java
deleted file mode 100644
index cddfb7d38b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SetCollectionValueModelTests.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SetCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> collectionHolder;
- CollectionAddEvent addEvent;
- CollectionRemoveEvent removeEvent;
- CollectionClearEvent collectionClearedEvent;
- CollectionChangeEvent collectionChangedEvent;
-
- private CollectionValueModel<String> setHolder;
- CollectionAddEvent setAddEvent;
- CollectionRemoveEvent setRemoveEvent;
- CollectionClearEvent setClearedEvent;
- CollectionChangeEvent setChangedEvent;
-
- public SetCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = new SimpleCollectionValueModel<String>(this.buildCollection());
- this.setHolder = new SetCollectionValueModel<String>(this.collectionHolder);
- }
-
- private Collection<String> buildCollection() {
- Collection<String> collection = new ArrayList<String>();
- collection.add("foo");
- collection.add("foo");
- return collection;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- // add a listener to "activate" the wrapper
- this.setHolder.addChangeListener(this.buildSetChangeListener());
-
- this.verify(this.collectionHolder, "foo", "foo");
- this.verify(this.setHolder, "foo");
-
- this.collectionHolder.add("bar");
- this.collectionHolder.add("bar");
- this.verify(this.collectionHolder, "foo", "foo", "bar", "bar");
- this.verify(this.setHolder, "foo", "bar");
-
- this.collectionHolder.remove("bar");
- this.verify(this.collectionHolder, "foo", "foo", "bar");
- this.verify(this.setHolder, "foo", "bar");
-
- this.collectionHolder.remove("bar");
- this.verify(this.collectionHolder, "foo", "foo");
- this.verify(this.setHolder, "foo");
-
- this.collectionHolder.remove("foo");
- this.verify(this.collectionHolder, "foo");
- this.verify(this.setHolder, "foo");
-
- this.collectionHolder.remove("foo");
- assertFalse(this.collectionHolder.iterator().hasNext());
- assertFalse(this.setHolder.iterator().hasNext());
- }
-
- public void testSize() {
- // add a listener to "activate" the wrapper
- this.setHolder.addChangeListener(this.buildSetChangeListener());
-
- assertEquals(2, this.collectionHolder.size());
- assertEquals(1, this.setHolder.size());
-
- this.collectionHolder.add("bar");
- this.collectionHolder.add("bar");
- assertEquals(4, this.collectionHolder.size());
- assertEquals(2, this.setHolder.size());
-
- this.collectionHolder.remove("bar");
- assertEquals(3, this.collectionHolder.size());
- assertEquals(2, this.setHolder.size());
-
- this.collectionHolder.remove("bar");
- assertEquals(2, this.collectionHolder.size());
- assertEquals(1, this.setHolder.size());
-
- this.collectionHolder.remove("foo");
- assertEquals(1, this.collectionHolder.size());
- assertEquals(1, this.setHolder.size());
-
- this.collectionHolder.remove("foo");
- assertEquals(0, this.collectionHolder.size());
- assertEquals(0, this.setHolder.size());
- }
-
- public void testBulkChange() {
- // add a listener to "activate" the wrapper
- this.setHolder.addChangeListener(this.buildSetChangeListener());
-
- Collection<String> newCollection = new ArrayList<String>();
- newCollection.add("fox");
- newCollection.add("fox");
- newCollection.add("bat");
-
- this.collectionHolder.setValues(newCollection);
- this.verify(this.collectionHolder, "fox", "fox", "bat");
- this.verify(this.setHolder, "fox", "bat");
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- ChangeListener listener = this.buildSetChangeListener();
- this.setHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.setHolder.removeChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.setHolder.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.setHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testEvents1() {
- this.collectionHolder.addChangeListener(this.buildChangeListener());
- this.setHolder.addChangeListener(this.buildSetChangeListener());
- this.verifyEvents();
- }
-
- public void testEvents2() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildCollectionChangeListener());
- this.setHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildSetCollectionChangeListener());
- this.verifyEvents();
- }
-
- private void clearEvents() {
- this.addEvent = null;
- this.removeEvent = null;
- this.collectionClearedEvent = null;
- this.collectionChangedEvent = null;
- this.setAddEvent = null;
- this.setRemoveEvent = null;
- this.setClearedEvent = null;
- this.setChangedEvent = null;
- }
-
- private void verifyEvents() {
- this.clearEvents();
- this.collectionHolder.add("bar");
- this.verifyEvent(this.addEvent, this.collectionHolder, "bar");
- this.verifyEvent(this.setAddEvent, this.setHolder, "bar");
-
- this.clearEvents();
- this.collectionHolder.remove("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, "foo");
- assertNull(this.setRemoveEvent);
-
- this.clearEvents();
- this.collectionHolder.add("bar");
- this.verifyEvent(this.addEvent, this.collectionHolder, "bar");
- assertNull(this.setAddEvent);
-
- this.clearEvents();
- this.collectionHolder.remove("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, "foo");
- this.verifyEvent(this.setRemoveEvent, this.setHolder, "foo");
-
- this.clearEvents();
- this.collectionHolder.add("foo");
- this.verifyEvent(this.addEvent, this.collectionHolder, "foo");
- this.verifyEvent(this.setAddEvent, this.setHolder, "foo");
-
- this.clearEvents();
- this.collectionHolder.clear();
- this.verifyEvent(this.collectionClearedEvent, this.collectionHolder);
- this.verifyEvent(this.setClearedEvent, this.setHolder);
-
- this.clearEvents();
- Collection<String> newCollection = new ArrayList<String>();
- newCollection.add("fox");
- newCollection.add("fox");
- newCollection.add("bat");
- newCollection.add("bat");
- newCollection.add("bat");
- this.collectionHolder.setValues(newCollection);
- this.verifyEvent(this.collectionChangedEvent, this.collectionHolder, "fox", "fox", "bat", "bat", "bat");
- this.verifyEvent(this.setChangedEvent, this.setHolder, "fox", "bat");
-
- }
-
- private CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- SetCollectionValueModelTests.this.addEvent = event;
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- SetCollectionValueModelTests.this.removeEvent = event;
- }
- public void collectionCleared(CollectionClearEvent event) {
- SetCollectionValueModelTests.this.collectionClearedEvent = event;
- }
- public void collectionChanged(CollectionChangeEvent event) {
- SetCollectionValueModelTests.this.collectionChangedEvent = event;
- }
- };
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(CollectionAddEvent event) {
- SetCollectionValueModelTests.this.addEvent = event;
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent event) {
- SetCollectionValueModelTests.this.removeEvent = event;
- }
- @Override
- public void collectionCleared(CollectionClearEvent event) {
- SetCollectionValueModelTests.this.collectionClearedEvent = event;
- }
- @Override
- public void collectionChanged(CollectionChangeEvent event) {
- SetCollectionValueModelTests.this.collectionChangedEvent = event;
- }
- };
- }
-
- private CollectionChangeListener buildSetCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- SetCollectionValueModelTests.this.setAddEvent = event;
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- SetCollectionValueModelTests.this.setRemoveEvent = event;
- }
- public void collectionCleared(CollectionClearEvent event) {
- SetCollectionValueModelTests.this.setClearedEvent = event;
- }
- public void collectionChanged(CollectionChangeEvent event) {
- SetCollectionValueModelTests.this.setChangedEvent = event;
- }
- };
- }
-
- private ChangeListener buildSetChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(CollectionAddEvent event) {
- SetCollectionValueModelTests.this.setAddEvent = event;
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent event) {
- SetCollectionValueModelTests.this.setRemoveEvent = event;
- }
- @Override
- public void collectionCleared(CollectionClearEvent event) {
- SetCollectionValueModelTests.this.setClearedEvent = event;
- }
- @Override
- public void collectionChanged(CollectionChangeEvent event) {
- SetCollectionValueModelTests.this.setChangedEvent = event;
- }
- };
- }
-
- private void verify(CollectionValueModel<String> cvm, String... expectedItems) {
- Bag<String> actual = CollectionTools.bag(cvm);
- Bag<String> expected = CollectionTools.bag(expectedItems);
- assertEquals(expected, actual);
- }
-
- private void verifyEvent(CollectionAddEvent event, Object source, Object... expectedItems) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- assertEquals(CollectionTools.bag(expectedItems), CollectionTools.bag(event.getItems()));
- }
-
- private void verifyEvent(CollectionRemoveEvent event, Object source, Object... expectedItems) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- assertEquals(CollectionTools.bag(expectedItems), CollectionTools.bag(event.getItems()));
- }
-
- private void verifyEvent(CollectionClearEvent event, Object source) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- }
-
- private void verifyEvent(CollectionChangeEvent event, Object source, Object... expectedItems) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.getCollectionName());
- assertEquals(CollectionTools.bag(expectedItems), CollectionTools.bag(event.getCollection()));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
deleted file mode 100644
index e3e4a70a58..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SimpleCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> bagHolder;
- CollectionEvent bagEvent;
- String bagEventType;
-
- private SimpleCollectionValueModel<String> setHolder;
- CollectionEvent setEvent;
- String setEventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String CHANGE = "change";
- private static final String CLEAR = "clear";
-
-
- public SimpleCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bagHolder = new SimpleCollectionValueModel<String>(this.buildBag());
- this.setHolder = new SimpleCollectionValueModel<String>(this.buildSet());
- }
-
- private Bag<String> buildBag() {
- Bag<String> result = new HashBag<String>();
- this.addItemsTo(result);
- return result;
- }
-
- private Set<String> buildSet() {
- Set<String> result = new HashSet<String>();
- this.addItemsTo(result);
- return result;
- }
-
- private void addItemsTo(Collection<String> c) {
- c.add("foo");
- c.add("bar");
- c.add("baz");
- }
-
- private Bag<String> buildAddItems() {
- Bag<String> result = new HashBag<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
- private Bag<String> buildRemoveItems() {
- Bag<String> result = new HashBag<String>();
- result.add("foo");
- result.add("baz");
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(this.buildBag(), CollectionTools.bag(this.bagHolder.iterator()));
- assertEquals(this.buildSet(), CollectionTools.set(this.setHolder.iterator()));
- }
-
- public void testSize() {
- assertEquals(this.buildBag().size(), CollectionTools.size(this.bagHolder.iterator()));
- assertEquals(this.buildSet().size(), CollectionTools.size(this.setHolder.iterator()));
- }
-
- private boolean bagHolderContains(Object item) {
- return CollectionTools.contains(this.bagHolder.iterator(), item);
- }
-
- private boolean setHolderContains(Object item) {
- return CollectionTools.contains(this.setHolder.iterator(), item);
- }
-
- private boolean bagHolderContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.bagHolder.iterator(), items);
- }
-
- private boolean setHolderContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.setHolder.iterator(), items);
- }
-
- private boolean bagHolderContainsAny(Collection<String> items) {
- Bag<String> bag = CollectionTools.bag(this.bagHolder.iterator());
- for (String string : items) {
- if (bag.contains(string)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean setHolderContainsAny(Collection<String> items) {
- Set<String> set = CollectionTools.set(this.setHolder.iterator());
- for (String string : items) {
- if (set.contains(string)) {
- return true;
- }
- }
- return false;
- }
-
- public void testAdd() {
- assertFalse(this.bagHolderContains("joo"));
- this.bagHolder.add("joo");
- assertTrue(this.bagHolderContains("joo"));
-
- assertFalse(this.bagHolderContains(null));
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
-
- assertFalse(this.setHolderContains("joo"));
- this.setHolder.add("joo");
- assertTrue(this.setHolderContains("joo"));
-
- assertFalse(this.setHolderContains(null));
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- }
-
- public void testAddAll() {
- assertFalse(this.bagHolderContainsAny(this.buildAddItems()));
- this.bagHolder.addAll(this.buildAddItems());
- assertTrue(this.bagHolderContainsAll(this.buildAddItems()));
-
- assertFalse(this.setHolderContainsAny(this.buildAddItems()));
- this.setHolder.addAll(this.buildAddItems());
- assertTrue(this.setHolderContainsAll(this.buildAddItems()));
- }
-
- public void testRemove() {
- assertTrue(this.bagHolderContains("bar"));
- this.bagHolder.remove("bar");
- assertFalse(this.bagHolderContains("bar"));
-
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
- this.bagHolder.remove(null);
- assertFalse(this.bagHolderContains(null));
-
- assertTrue(this.setHolderContains("bar"));
- this.setHolder.remove("bar");
- assertFalse(this.setHolderContains("bar"));
-
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- this.setHolder.remove(null);
- assertFalse(this.setHolderContains(null));
- }
-
- public void testRemoveAll() {
- assertTrue(this.bagHolderContainsAll(this.buildRemoveItems()));
- this.bagHolder.removeAll(this.buildRemoveItems());
- assertFalse(this.bagHolderContainsAny(this.buildRemoveItems()));
-
- assertTrue(this.setHolderContainsAll(this.buildRemoveItems()));
- this.setHolder.removeAll(this.buildRemoveItems());
- assertFalse(this.setHolderContainsAny(this.buildRemoveItems()));
- }
-
- public void testSetValues() {
- assertTrue(this.bagHolderContains("bar"));
- assertFalse(this.bagHolderContains("jar"));
- this.bagHolder.setValues(this.buildAddItems());
- assertFalse(this.bagHolderContains("bar"));
- assertTrue(this.bagHolderContains("jar"));
-
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
- this.bagHolder.remove(null);
- assertFalse(this.bagHolderContains(null));
-
- this.bagHolder.setValues(new HashBag<String>());
- assertFalse(this.bagHolderContains("jar"));
-
- assertTrue(this.setHolderContains("bar"));
- assertFalse(this.setHolderContains("jar"));
- this.setHolder.setValues(this.buildAddItems());
- assertFalse(this.setHolderContains("bar"));
- assertTrue(this.setHolderContains("jar"));
-
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- this.setHolder.remove(null);
- assertFalse(this.setHolderContains(null));
-
- this.setHolder.setValues(new HashBag<String>());
- assertFalse(this.setHolderContains("jar"));
- }
-
- public void testCollectionChange1() {
- this.bagHolder.addChangeListener(this.buildBagListener());
- this.verifyBagChange();
-
- this.setHolder.addChangeListener(this.buildSetListener());
- this.verifySetChange();
- }
-
- public void testCollectionChange2() {
- this.bagHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildBagListener());
- this.verifyBagChange();
-
- this.setHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildSetListener());
- this.verifySetChange();
- }
-
- private void verifyBagChange() {
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("foo");
- this.verifyBagEvent(ADD, "foo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("foo");
- this.verifyBagEvent(ADD, "foo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("joo");
- this.verifyBagEvent(ADD, "joo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add(null);
- this.verifyBagEvent(ADD, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add(null);
- this.verifyBagEvent(ADD, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.remove("joo");
- this.verifyBagEvent(REMOVE, "joo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.remove(null);
- this.verifyBagEvent(REMOVE, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.setValues(this.buildBag());
- this.verifyBagEvent(CHANGE);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.addAll(this.buildBag());
- this.verifyBagEvent(ADD);
- assertEquals(this.buildBag(), CollectionTools.bag(((CollectionAddEvent) this.bagEvent).getItems()));
- }
-
- private void verifySetChange() {
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("foo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("joo");
- this.verifySetEvent(ADD, "joo");
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("joo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add(null);
- this.verifySetEvent(ADD, null);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add(null);
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove("joo");
- this.verifySetEvent(REMOVE, "joo");
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove("joo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove(null);
- this.verifySetEvent(REMOVE, null);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.setValues(this.buildSet());
- this.verifySetEvent(CHANGE);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.addAll(this.buildSet());
- assertNull(this.setEvent);
- assertNull(this.setEventType);
- }
-
- private ChangeListener buildBagListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = ADD;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = REMOVE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- @Override
- public void collectionCleared(CollectionClearEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CLEAR;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- @Override
- public void collectionChanged(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CHANGE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- };
- }
-
- private ChangeListener buildSetListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = ADD;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = REMOVE;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- @Override
- public void collectionCleared(CollectionClearEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = CLEAR;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- @Override
- public void collectionChanged(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = CHANGE;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- };
- }
-
- private void verifyBagEvent(String eventType) {
- assertEquals(eventType, this.bagEventType);
- assertEquals(this.bagHolder, this.bagEvent.getSource());
- assertEquals(CollectionValueModel.VALUES, this.bagEvent.getCollectionName());
- }
-
- private void verifyBagEvent(String eventType, Object item) {
- this.verifyBagEvent(eventType);
- assertEquals(item, this.getBagEventItems().iterator().next());
- }
-
- private Iterable<?> getBagEventItems() {
- if (this.bagEvent instanceof CollectionAddEvent) {
- return ((CollectionAddEvent) this.bagEvent).getItems();
- } else if (this.bagEvent instanceof CollectionRemoveEvent) {
- return ((CollectionRemoveEvent) this.bagEvent).getItems();
- }
- throw new IllegalStateException();
- }
-
- private void verifySetEvent(String eventType) {
- assertEquals(eventType, this.setEventType);
- assertEquals(this.setHolder, this.setEvent.getSource());
- assertEquals(CollectionValueModel.VALUES, this.setEvent.getCollectionName());
- }
-
- private void verifySetEvent(String eventType, Object item) {
- this.verifySetEvent(eventType);
- assertEquals(item, this.getSetEventItems().iterator().next());
- }
-
- private Iterable<?> getSetEventItems() {
- if (this.setEvent instanceof CollectionAddEvent) {
- return ((CollectionAddEvent) this.setEvent).getItems();
- } else if (this.setEvent instanceof CollectionRemoveEvent) {
- return ((CollectionRemoveEvent) this.setEvent).getItems();
- }
- throw new IllegalStateException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleListValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleListValueModelTests.java
deleted file mode 100644
index 50db81128b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimpleListValueModelTests.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SimpleListValueModelTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- ListEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
-
- public SimpleListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- return result;
- }
-
- private List<String> buildAddList() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
-// private List<String> buildRemoveList() {
-// List<String> result = new ArrayList<String>();
-// result.add("foo");
-// result.add("bar");
-// return result;
-// }
-//
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(this.buildList(), CollectionTools.list(this.listHolder.iterator()));
- }
-
- public void testListIterator() {
- assertEquals(this.buildList(), CollectionTools.list(this.listHolder.listIterator()));
- }
-
- public void testListIteratorInt() {
- assertEquals(CollectionTools.list(this.buildList().listIterator(1)), CollectionTools.list(this.listHolder.listIterator(1)));
- }
-
- public void testSize() {
- assertEquals(this.buildList().size(), this.listHolder.size());
- }
-
- private boolean listContains(Object item) {
- return CollectionTools.contains(this.listHolder.listIterator(), item);
- }
-
- private boolean listContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.listHolder.listIterator(), items);
- }
-
- private boolean listContainsAny(Collection<String> items) {
- Set<String> set = CollectionTools.set(this.listHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (set.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- public void testAddObject() {
- assertFalse(this.listContains("joo"));
- this.listHolder.add("joo");
- assertTrue(this.listContains("joo"));
-
- assertFalse(this.listContains(null));
- this.listHolder.add(null);
- assertTrue(this.listContains(null));
- }
-
- public void testAddIntObject() {
- assertFalse(this.listContains("joo"));
- this.listHolder.add(2, "joo");
- assertTrue(this.listContains("joo"));
-
- assertFalse(this.listContains(null));
- this.listHolder.add(0, null);
- assertTrue(this.listContains(null));
- }
-
- public void testAddAllCollection() {
- assertFalse(this.listContainsAny(this.buildAddList()));
- this.listHolder.addAll(this.buildAddList());
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testAddAllIntCollection() {
- assertFalse(this.listContainsAny(this.buildAddList()));
- this.listHolder.addAll(2, this.buildAddList());
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testClear() {
- assertFalse(this.listHolder.isEmpty());
- this.listHolder.clear();
- assertTrue(this.listHolder.isEmpty());
- }
-
- public void testContainsObject() {
- assertTrue(this.listHolder.contains("foo"));
- assertFalse(this.listHolder.contains("joo"));
- }
-
- public void testContainsAllCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add("foo");
- c.add("bar");
- assertTrue(this.listHolder.containsAll(c));
-
- c.add("joo");
- assertFalse(this.listHolder.containsAll(c));
- }
-
- public void testEquals() {
- assertEquals(new SimpleListValueModel<String>(this.buildList()), this.listHolder);
- assertFalse(this.listHolder.equals(new SimpleListValueModel<String>(this.buildAddList())));
- assertFalse(this.listHolder.equals(this.buildList()));
- assertFalse(this.listHolder.equals(new SimpleListValueModel<String>()));
- }
-
- public void testGetInt() {
- assertEquals("foo", this.listHolder.get(0));
- assertEquals("bar", this.listHolder.get(1));
- assertEquals("baz", this.listHolder.get(2));
- }
-
- public void testHashCode() {
- assertEquals(new SimpleListValueModel<String>(this.buildList()).hashCode(), this.listHolder.hashCode());
- }
-
- public void testIndexOfObject() {
- assertEquals(0, this.listHolder.indexOf("foo"));
- assertEquals(1, this.listHolder.indexOf("bar"));
- assertEquals(2, this.listHolder.indexOf("baz"));
- assertEquals(-1, this.listHolder.indexOf("joo"));
- }
-
- public void testLastIndexOfObject() {
- assertEquals(0, this.listHolder.lastIndexOf("foo"));
- assertEquals(1, this.listHolder.lastIndexOf("bar"));
- assertEquals(2, this.listHolder.lastIndexOf("baz"));
- assertEquals(-1, this.listHolder.lastIndexOf("joo"));
-
- this.listHolder.add("foo");
- assertEquals(3, this.listHolder.lastIndexOf("foo"));
- }
-
- public void testIsEmpty() {
- assertFalse(this.listHolder.isEmpty());
- this.listHolder.clear();
- assertTrue(this.listHolder.isEmpty());
- }
-
- public void testRemove() {
- assertTrue(this.listContains("bar"));
- this.listHolder.remove(this.buildList().indexOf("bar"));
- assertFalse(this.listContains("bar"));
-
- this.listHolder.add(1, null);
- assertTrue(this.listContains(null));
- this.listHolder.remove(1);
- assertFalse(this.listContains(null));
- }
-
- public void testSetValues() {
- List<String> newList = new ArrayList<String>();
- newList.add("joo");
- newList.add("jar");
- newList.add("jaz");
-
- assertTrue(this.listContains("bar"));
- assertFalse(this.listContains("jar"));
- this.listHolder.setListValues(newList);
- assertFalse(this.listContains("bar"));
- assertTrue(this.listContains("jar"));
-
- this.listHolder.add(1, null);
- assertTrue(this.listContains(null));
- this.listHolder.remove(1);
- assertFalse(this.listContains(null));
-
- this.listHolder.setListValues(new ArrayList<String>());
- assertFalse(this.listContains("jar"));
- }
-
- public void testListChange1() {
- this.listHolder.addChangeListener(this.buildChangeListener());
- this.verifyListChange();
- }
-
- public void testListChange2() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, "joo");
- this.verifyEvent(ADD, 1, "joo");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, null);
- this.verifyEvent(ADD, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, "joo");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.setListValues(this.buildList());
- this.verifyEvent(CHANGE);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildList(), CollectionTools.list(((ListAddEvent) this.event).getItems()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(((ListReplaceEvent) this.event).getNewItems(), "foo"));
- assertTrue(CollectionTools.contains(((ListReplaceEvent) this.event).getNewItems(), "joo"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- SimpleListValueModelTests.this.eventType = ADD;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsRemoved(ListRemoveEvent e) {
- SimpleListValueModelTests.this.eventType = REMOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsReplaced(ListReplaceEvent e) {
- SimpleListValueModelTests.this.eventType = REPLACE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsMoved(ListMoveEvent e) {
- SimpleListValueModelTests.this.eventType = MOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void listCleared(ListClearEvent e) {
- SimpleListValueModelTests.this.eventType = CLEAR;
- SimpleListValueModelTests.this.event = e;
- }
- public void listChanged(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = CHANGE;
- SimpleListValueModelTests.this.event = e;
- }
- };
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(ListAddEvent e) {
- SimpleListValueModelTests.this.eventType = ADD;
- SimpleListValueModelTests.this.event = e;
- }
- @Override
- public void itemsRemoved(ListRemoveEvent e) {
- SimpleListValueModelTests.this.eventType = REMOVE;
- SimpleListValueModelTests.this.event = e;
- }
- @Override
- public void itemsReplaced(ListReplaceEvent e) {
- SimpleListValueModelTests.this.eventType = REPLACE;
- SimpleListValueModelTests.this.event = e;
- }
- @Override
- public void itemsMoved(ListMoveEvent e) {
- SimpleListValueModelTests.this.eventType = MOVE;
- SimpleListValueModelTests.this.event = e;
- }
- @Override
- public void listCleared(ListClearEvent e) {
- SimpleListValueModelTests.this.eventType = CLEAR;
- SimpleListValueModelTests.this.event = e;
- }
- @Override
- public void listChanged(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = CHANGE;
- SimpleListValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String e) {
- assertEquals(e, this.eventType);
- assertEquals(this.listHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.getListName());
- }
-
- private void verifyEvent(String e, int index, Object item) {
- this.verifyEvent(e);
- if (e == ADD) {
- assertEquals(index, ((ListAddEvent) this.event).getIndex());
- assertEquals(item, ((ListAddEvent) this.event).getItems().iterator().next());
- } else if (e == REMOVE) {
- assertEquals(index, ((ListRemoveEvent) this.event).getIndex());
- assertEquals(item, ((ListRemoveEvent) this.event).getItems().iterator().next());
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimplePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
deleted file mode 100644
index 48f61d5273..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SimplePropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
-
- public SimplePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- }
-
- public void testSetValue() {
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- this.objectHolder.setValue(null);
- assertEquals(null, this.objectHolder.getValue());
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addChangeListener(this.buildListener());
- this.verifyPropertyChange();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.verifyPropertyChange();
- }
-
- private void verifyPropertyChange() {
- this.event = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent("foo", "bar");
-
- this.event = null;
- this.objectHolder.setValue(null);
- this.verifyEvent("bar", null);
-
- this.event = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(null, "baz");
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- SimplePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(Object oldValue, Object newValue) {
- assertEquals(this.objectHolder, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.getPropertyName());
- assertEquals(oldValue, this.event.getOldValue());
- assertEquals(newValue, this.event.getNewValue());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
deleted file mode 100644
index 46607e8921..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.TreeSet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.ReverseComparator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SortedListValueModelAdapterTests extends TestCase {
- private SortedListValueModelAdapter<String> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- private Collection<String> wrappedCollection;
-
-
- public SortedListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollection = new HashBag<String>();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>(this.wrappedCollection);
- this.adapter = new SortedListValueModelAdapter<String>(this.wrappedCollectionHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual) {
- this.verifyList(expected, actual, null);
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual, Comparator<String> comparator) {
- Collection<String> sortedSet = new TreeSet<String>(comparator);
- sortedSet.addAll(expected);
- List<String> expectedList = new ArrayList<String>(sortedSet);
- List<String> actualList = CollectionTools.list(actual.iterator());
- assertEquals(expectedList, actualList);
- }
-
- public void testAdd() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListReplaceEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- assertEquals(3, this.adapter.size());
- this.verifyList(this.wrappedCollection, this.adapter);
- }
-
- public void testAddItem() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testRemoveItem() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListRemoveEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListReplaceEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- }
-
- public void testSetComparator() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
-
- this.adapter.setComparator(new ReverseComparator<String>());
- this.verifyList(this.wrappedCollection, this.adapter, new ReverseComparator<String>());
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener cl = new ChangeAdapter();
- this.adapter.addChangeListener(cl);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeChangeListener(cl);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testCollectionChange() {
- this.wrappedCollectionHolder.add("fred");
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListReplaceEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.setValues(Arrays.asList(new String[] {"foo", "bar", "baz"}));
- assertEquals(3, this.adapter.size());
- this.verifyList(this.wrappedCollection, this.adapter);
- }
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListAddEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListRemoveEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListReplaceEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListMoveEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListClearEvent e) {
- fail("unexpected event");
- }
- public void listChanged(ListChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelWrapperTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelWrapperTests.java
deleted file mode 100644
index 0f4f945eec..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/SortedListValueModelWrapperTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.TreeSet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReverseComparator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SortedListValueModelWrapperTests extends TestCase {
- private List<String> list;
- private SimpleListValueModel<String> listModel;
- private SortedListValueModelWrapper<String> sortedListModel;
-
-
- public SortedListValueModelWrapperTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.list = new ArrayList<String>();
- this.listModel = new SimpleListValueModel<String>(this.list);
- this.sortedListModel = new SortedListValueModelWrapper<String>(this.listModel);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual) {
- this.verifyList(expected, actual, null);
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual, Comparator<String> comparator) {
- Collection<String> sortedSet = new TreeSet<String>(comparator);
- sortedSet.addAll(expected);
- List<String> expectedList = new ArrayList<String>(sortedSet);
- List<String> actualList = CollectionTools.list(actual);
- assertEquals(expectedList, actualList);
- }
-
- public void testAdd() {
- this.sortedListModel.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListReplaceEvent e) {/* OK */}
- });
- this.listModel.add("foo");
- this.listModel.add("bar");
- this.listModel.add("baz");
- assertEquals(3, this.sortedListModel.size());
- this.verifyList(this.list, this.sortedListModel);
- }
-
- public void testAddItem() {
- List<String> sortedSynchList = new CoordinatedList<String>(this.sortedListModel);
- List<String> synchList = new CoordinatedList<String>(this.listModel);
- this.listModel.add("foo");
- assertTrue(this.list.contains("foo"));
- this.listModel.add("bar");
- this.listModel.add("baz");
- this.listModel.add("joo");
- this.listModel.add("jar");
- this.listModel.add("jaz");
- assertEquals(6, this.list.size());
-
- this.verifyList(this.list, this.sortedListModel);
- assertEquals(this.list, synchList);
- assertEquals(CollectionTools.list(this.sortedListModel), sortedSynchList);
- }
-
- public void testRemoveItem() {
- List<String> sortedSynchList = new CoordinatedList<String>(this.sortedListModel);
- List<String> synchList = new CoordinatedList<String>(this.listModel);
- this.listModel.add("foo");
- this.listModel.add("bar");
- this.listModel.add("baz");
- this.listModel.add("joo");
- this.listModel.add("jar");
- this.listModel.add("jaz");
- this.listModel.remove("jaz");
- assertFalse(this.list.contains("jaz"));
- this.listModel.remove("foo");
- assertFalse(this.list.contains("foo"));
- assertEquals(4, this.list.size());
-
- this.verifyList(this.list, this.sortedListModel);
- assertEquals(this.list, synchList);
- assertEquals(CollectionTools.list(this.sortedListModel), sortedSynchList);
- }
-
- public void testReplaceItem() {
- List<String> sortedSynchList = new CoordinatedList<String>(this.sortedListModel);
- List<String> synchList = new CoordinatedList<String>(this.listModel);
- this.listModel.add("foo");
- assertTrue(this.list.contains("foo"));
- this.listModel.add("bar");
- this.listModel.add("baz");
- this.listModel.add("joo");
- this.listModel.add("jar");
- this.listModel.add("jaz");
- assertEquals(6, this.list.size());
- this.listModel.set(3, "ttt");
- this.listModel.set(4, "xxx");
- assertTrue(this.list.contains("xxx"));
-
- this.verifyList(this.list, this.sortedListModel);
- assertEquals(this.list, synchList);
- assertEquals(CollectionTools.list(this.sortedListModel), sortedSynchList);
- }
-
- public void testListSynch() {
- this.sortedListModel.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListAddEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListRemoveEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListReplaceEvent e) {/* OK */}
- });
- this.listModel.add("foo");
- this.listModel.add("bar");
- this.listModel.add("baz");
- this.listModel.add("joo");
- this.listModel.add("jar");
- this.listModel.add("jaz");
- this.listModel.remove("jaz");
- assertFalse(this.list.contains("jaz"));
- this.listModel.remove("foo");
- assertFalse(this.list.contains("foo"));
- assertEquals(4, this.list.size());
-
- this.verifyList(this.list, this.sortedListModel);
- }
-
- public void testSetComparator() {
- List<String> sortedSynchList = new CoordinatedList<String>(this.sortedListModel);
- List<String> synchList = new CoordinatedList<String>(this.listModel);
- this.listModel.add("foo");
- assertTrue(this.list.contains("foo"));
- this.listModel.add("bar");
- this.listModel.add("baz");
- this.listModel.add("joo");
- this.listModel.add("jar");
- this.listModel.add("jaz");
- assertEquals(6, this.list.size());
-
- this.verifyList(this.list, this.sortedListModel);
- assertEquals(this.list, synchList);
- assertEquals(CollectionTools.list(this.sortedListModel), sortedSynchList);
-
- this.sortedListModel.setComparator(new ReverseComparator<String>());
- this.verifyList(this.list, this.sortedListModel, new ReverseComparator<String>());
- assertEquals(this.list, synchList);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.sortedListModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> sortedSynchList = new CoordinatedList<String>(this.sortedListModel);
- assertTrue(((AbstractModel) this.sortedListModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.sortedListModel.removeListChangeListener(ListValueModel.LIST_VALUES, sortedSynchList);
- assertFalse(((AbstractModel) this.sortedListModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener cl = new ChangeAdapter();
- this.sortedListModel.addChangeListener(cl);
- assertTrue(((AbstractModel) this.sortedListModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.sortedListModel.removeChangeListener(cl);
- assertFalse(((AbstractModel) this.sortedListModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testListChange() {
- this.listModel.add("fred");
- this.sortedListModel.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void listChanged(ListChangeEvent e) {/* OK */}
- });
- this.listModel.setListValues(Arrays.asList(new String[] {"foo", "bar", "baz"}));
- assertEquals(3, this.sortedListModel.size());
- this.verifyList(this.list, this.sortedListModel);
- }
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListAddEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListRemoveEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListReplaceEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListMoveEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListClearEvent e) {
- fail("unexpected event");
- }
- public void listChanged(ListChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticCollectionValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
deleted file mode 100644
index 920f57d506..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class StaticCollectionValueModelTests extends TestCase {
-
- private static final Collection<String> COLLECTION = buildCollection();
- private static Collection<String> buildCollection() {
- Collection<String> result = new HashBag<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private CollectionValueModel<String> collectionHolder;
-
-
- public StaticCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = this.buildCollectionHolder();
- }
-
- private CollectionValueModel<String> buildCollectionHolder() {
- return new StaticCollectionValueModel<String>(COLLECTION);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(buildCollection(), CollectionTools.bag(this.collectionHolder.iterator()));
- }
-
- public void testSize() {
- assertEquals(buildCollection().size(), this.collectionHolder.size());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticListValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticListValueModelTests.java
deleted file mode 100644
index 620a4ab071..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticListValueModelTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class StaticListValueModelTests extends TestCase {
-
- private static final List<String> LIST = buildList();
- private static List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private ListValueModel<String> listHolder;
-
-
- public StaticListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new StaticListValueModel<String>(LIST);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGet() {
- List<String> expected = buildList();
- for (int i = 0; i < this.listHolder.size(); i++) {
- assertEquals(expected.get(i), this.listHolder.get(i));
- }
- }
-
- public void testIterator() {
- assertEquals(buildList(), CollectionTools.list(this.listHolder.listIterator()));
- }
-
- public void testSize() {
- assertEquals(buildList().size(), this.listHolder.size());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticValueModelTests.java
deleted file mode 100644
index 535a700f52..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/StaticValueModelTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class StaticValueModelTests extends TestCase {
- private PropertyValueModel<String> objectHolder;
- private static final PropertyValueModel<String> OBJECT_HOLDER = new StaticPropertyValueModel<String>("foo");
-
-
- public StaticValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = OBJECT_HOLDER;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- }
-
- public void testToString() {
- assertTrue(this.objectHolder.toString().indexOf("foo") >= 0);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
deleted file mode 100644
index 78963bc685..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationListValueModelTests.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class TransformationListValueModelTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> transformedListHolder;
- ListEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
-
- public TransformationListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- this.transformedListHolder = this.buildTransformedListHolder(this.listHolder);
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- return result;
- }
-
- private List<String> buildTransformedList() {
- return this.transform(this.buildList());
- }
-
- private List<String> transform(List<String> list) {
- List<String> result = new ArrayList<String>(list.size());
- for (String string : list) {
- if (string == null) {
- result.add(null);
- } else {
- result.add(string.toUpperCase());
- }
- }
- return result;
- }
-
- private List<String> buildAddList() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
- private List<String> buildTransformedAddList() {
- return this.transform(this.buildAddList());
- }
-
-// private List<String> buildRemoveList() {
-// List<String> result = new ArrayList<String>();
-// result.add("foo");
-// result.add("bar");
-// return result;
-// }
-//
-// private List<String> buildTransformedRemoveList() {
-// return this.transform(this.buildRemoveList());
-// }
-//
- ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModel<String, String>(lvm) {
- @Override
- protected String transformItem_(String s) {
- return s.toUpperCase();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.transformedListHolder.iterator()));
- }
-
- public void testStaleValues() {
- ListChangeListener listener = this.buildListener();
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.transformedListHolder.iterator()));
-
- this.transformedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertEquals(Collections.EMPTY_LIST, CollectionTools.list(this.transformedListHolder.iterator()));
- }
-
- public void testSize() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildTransformedList().size(), CollectionTools.size(this.transformedListHolder.iterator()));
- }
-
- private boolean transformedListContains(Object item) {
- return CollectionTools.contains(this.transformedListHolder.iterator(), item);
- }
-
- private boolean transformedListContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.transformedListHolder.iterator(), items);
- }
-
- private boolean transformedListContainsAny(Collection<String> items) {
- List<String> transformedList = CollectionTools.list(this.transformedListHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (transformedList.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- public void testAdd() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.transformedListContains("JOO"));
- this.listHolder.add(2, "joo");
- assertTrue(this.transformedListContains("JOO"));
-
- assertFalse(this.transformedListContains(null));
- this.listHolder.add(0, null);
- assertTrue(this.transformedListContains(null));
- }
-
- public void testAddAll() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.transformedListContainsAny(this.buildTransformedAddList()));
- this.listHolder.addAll(2, this.buildAddList());
- assertTrue(this.transformedListContainsAll(this.buildTransformedAddList()));
- }
-
- public void testRemove() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertTrue(this.transformedListContains("BAR"));
- this.listHolder.remove(this.buildList().indexOf("bar"));
- assertFalse(this.transformedListContains("BAR"));
-
- this.listHolder.add(1, null);
- assertTrue(this.transformedListContains(null));
- this.listHolder.remove(1);
- assertFalse(this.transformedListContains(null));
- }
-
- public void testListChangeGeneric() {
- this.transformedListHolder.addChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChangeNamed() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, "joo");
- this.verifyEvent(ADD, 1, "JOO");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, null);
- this.verifyEvent(ADD, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, "JOO");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildTransformedList(), CollectionTools.list(((ListAddEvent) this.event).getItems()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(((ListReplaceEvent) this.event).getNewItems(), "FOO"));
- assertTrue(CollectionTools.contains(((ListReplaceEvent) this.event).getNewItems(), "JOO"));
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void itemsAdded(ListAddEvent e) {
- TransformationListValueModelTests.this.eventType = ADD;
- TransformationListValueModelTests.this.event = e;
- }
- @Override
- public void itemsRemoved(ListRemoveEvent e) {
- TransformationListValueModelTests.this.eventType = REMOVE;
- TransformationListValueModelTests.this.event = e;
- }
- @Override
- public void itemsReplaced(ListReplaceEvent e) {
- TransformationListValueModelTests.this.eventType = REPLACE;
- TransformationListValueModelTests.this.event = e;
- }
- @Override
- public void itemsMoved(ListMoveEvent e) {
- TransformationListValueModelTests.this.eventType = MOVE;
- TransformationListValueModelTests.this.event = e;
- }
- @Override
- public void listCleared(ListClearEvent e) {
- TransformationListValueModelTests.this.eventType = CLEAR;
- TransformationListValueModelTests.this.event = e;
- }
- @Override
- public void listChanged(ListChangeEvent e) {
- TransformationListValueModelTests.this.eventType = CHANGE;
- TransformationListValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String type) {
- assertEquals(type, this.eventType);
- assertEquals(this.transformedListHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.getListName());
- }
-
- private void verifyEvent(String type, int index, Object item) {
- this.verifyEvent(type);
- if (type == ADD) {
- assertEquals(index, ((ListAddEvent) this.event).getIndex());
- assertEquals(item, ((ListAddEvent) this.event).getItems().iterator().next());
- } else if (type == REMOVE) {
- assertEquals(index, ((ListRemoveEvent) this.event).getIndex());
- assertEquals(item, ((ListRemoveEvent) this.event).getItems().iterator().next());
- }
- }
-
- public void testHasListeners() {
- /*
- * adding listeners to the transformed list will cause listeners
- * to be added to the wrapped list;
- * likewise, removing listeners from the transformed list will
- * cause listeners to be removed from the wrapped list
- */
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ChangeListener listener = this.buildListener();
-
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.removeChangeListener(listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- /**
- * execute the same set of tests again, but by passing a Transformer to the adapter
- * (as opposed to overriding #transformItem(Object))
- */
- public static class TransformerTests extends TransformationListValueModelTests {
- public TransformerTests(String name) {
- super(name);
- }
- @Override
- ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModel<String, String>(lvm, this.buildTransformer());
- }
- private Transformer<String, String> buildTransformer() {
- return new Transformer<String, String>() {
- public String transform(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- };
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
deleted file mode 100644
index 8344919d69..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.BidiTransformer;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class TransformationPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<String> transformationObjectHolder;
- PropertyChangeEvent transformationEvent;
-
- public TransformationPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- this.transformationObjectHolder = new TransformationWritablePropertyValueModel<String, String>(this.objectHolder, this.buildTransformer());
- }
-
- private BidiTransformer<String, String> buildTransformer() {
- return new BidiTransformer<String, String>() {
- public String transform(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- public String reverseTransform(String s) {
- return (s == null) ? null : s.toLowerCase();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("FOO", this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("BAR", this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertEquals("BAZ", this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- this.objectHolder.setValue("foo");
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("FOO", this.transformationObjectHolder.getValue());
- }
-
- public void testSetValue() {
- this.transformationObjectHolder.setValue("BAR");
- assertEquals("bar", this.objectHolder.getValue());
- assertEquals("BAR", this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue("Foo");
- assertEquals("foo", this.objectHolder.getValue());
- assertEquals("FOO", this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue(null);
- assertNull(this.objectHolder.getValue());
- assertNull(this.transformationObjectHolder.getValue());
-
- this.transformationObjectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.getValue());
- assertEquals("BAZ", this.transformationObjectHolder.getValue());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- ChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removeChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addChangeListener(this.buildListener());
- this.transformationObjectHolder.addChangeListener(this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, "foo", "bar");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", "BAR");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(this.event, this.objectHolder, "bar", "baz");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAR", "BAZ");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("Foo");
- this.verifyEvent(this.event, this.objectHolder, "baz", "Foo");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAZ", "FOO");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("FOO");
- this.verifyEvent(this.event, this.objectHolder, "Foo", "FOO");
- assertNull(this.transformationEvent);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, "FOO", null);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", null);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, null, "bar");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, null, "BAR");
- }
-
- private ChangeListener buildListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- TransformationPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private ChangeListener buildTransformationListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- TransformationPropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- assertEquals(oldValue, e.getOldValue());
- assertEquals(newValue, e.getNewValue());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TreeAspectAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TreeAspectAdapterTests.java
deleted file mode 100644
index 22ffb59825..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/TreeAspectAdapterTests.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TreeAspectAdapter;
-import org.eclipse.jpt.common.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeEvent;
-import org.eclipse.jpt.common.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.TreeValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class TreeAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private TreeAspectAdapter<TestSubject, List<TestNode>> aa1;
- private TreeEvent event1;
- private TreeChangeListener listener1;
-
- private TestSubject subject2;
-
-
- public TreeAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- TestNode root, node;
-
- root = this.subject1.getRootNameNode();
- node = this.subject1.addName(root, "name 1.1");
- this.subject1.addName(node, "name 1.1.1");
- this.subject1.addName(node, "name 1.1.2");
- node = this.subject1.addName(root, "name 1.2");
- this.subject1.addName(node, "name 1.2.1");
- node = this.subject1.addName(root, "name 1.3");
-
- root = this.subject1.getRootDescriptionNode();
- node = this.subject1.addDescription(root, "description 1.1");
- this.subject1.addDescription(node, "description 1.1.1");
- this.subject1.addDescription(node, "description 1.1.2");
- node = this.subject1.addDescription(root, "description 1.2");
- this.subject1.addDescription(node, "description 1.2.1");
- node = this.subject1.addDescription(root, "description 1.3");
-
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addTreeChangeListener(TreeValueModel.NODES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject();
-
- root = this.subject2.getRootNameNode();
- node = this.subject2.addName(root, "name 2.1");
- this.subject2.addName(node, "name 2.1.1");
- this.subject2.addName(node, "name 2.1.2");
- node = this.subject2.addName(root, "name 2.2");
- this.subject2.addName(node, "name 2.2.1");
- node = this.subject2.addName(root, "name 2.3");
-
- root = this.subject2.getRootDescriptionNode();
- node = this.subject2.addDescription(root, "description 2.1");
- this.subject2.addDescription(node, "description 2.1.1");
- this.subject2.addDescription(node, "description 2.1.2");
- node = this.subject2.addDescription(root, "description 2.2");
- this.subject2.addDescription(node, "description 2.2.1");
- node = this.subject2.addDescription(root, "description 2.3");
- }
-
- private TreeAspectAdapter<TestSubject, List<TestNode>> buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new TreeAspectAdapter<TestSubject, List<TestNode>>(subjectHolder, TestSubject.NAMES_TREE) {
- // this is not a typical aspect adapter - the value is determined by the aspect name
- @Override
- protected Iterator<List<TestNode>> nodes_() {
- if (this.treeNames[0] == TestSubject.NAMES_TREE) {
- return this.subject.namePaths();
- }
- if (this.treeNames[0] == TestSubject.DESCRIPTIONS_TREE) {
- return this.subject.descriptionPaths();
- }
- throw new IllegalStateException("invalid aspect name: " + this.treeNames[0]);
- }
- };
- }
-
- private ChangeListener buildValueChangeListener1() {
- return new ChangeAdapter() {
- @Override
- public void nodeAdded(TreeAddEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- @Override
- public void nodeRemoved(TreeRemoveEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- @Override
- public void treeCleared(TreeClearEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- @Override
- public void treeChanged(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(TreeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- }
-
- public void testTreeStructureChange() {
- assertNull(this.event1);
-
- this.subject1.addTwoNames(this.subject1.getRootNameNode(), "jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.getTreeName());
- assertTrue(this.subject1.containsNameNode("jam"));
- assertTrue(this.subject1.containsNameNode("jaz"));
- }
-
- public void testNodes() {
- assertEquals(this.convertToNames(this.subject1.namePaths()), this.convertToNames(this.aa1.nodes()));
- }
-
- private Collection<String> convertToNames(Iterator<List<TestNode>> namePaths) {
- Collection<String> result = new HashBag<String>();
- while (namePaths.hasNext()) {
- List<TestNode> path = namePaths.next();
- StringBuffer sb = new StringBuffer();
- sb.append('[');
- for (int i = 0; i < path.size(); i++) {
- sb.append(path.get(i).getText());
- if (i < path.size() - 1) {
- sb.append(':');
- }
- }
- sb.append(']');
- result.add(sb.toString());
- }
- return result;
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- assertTrue(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- this.aa1.removeTreeChangeListener(TreeValueModel.NODES, this.listener1);
- assertFalse(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- assertFalse(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
-
- ChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addChangeListener(listener2);
- assertTrue(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- assertTrue(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- this.aa1.removeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- assertFalse(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- }
-
- // ********** inner classes **********
-
- class TestSubject extends AbstractModel {
- private TestNode rootNameNode;
- public static final String NAMES_TREE = "names";
- private TestNode rootDescriptionNode;
- public static final String DESCRIPTIONS_TREE = "descriptions";
-
- public TestSubject() {
- this.rootNameNode = new TestNode("root name");
- this.rootDescriptionNode = new TestNode("root description");
- }
- public TestNode getRootNameNode() {
- return this.rootNameNode;
- }
- public Iterator<TestNode> nameNodes() {
- return new TreeIterator<TestNode>(this.rootNameNode) {
- @Override
- public Iterator<TestNode> children(TestNode next) {
- return next.children();
- }
- };
- }
- public Iterator<List<TestNode>> namePaths() {
- return new TransformationIterator<TestNode, List<TestNode>>(this.nameNodes()) {
- @Override
- protected List<TestNode> transform(TestNode next) {
- return next.getPath();
- }
- };
- }
- public TestNode addName(TestNode parent, String name) {
- TestNode child = new TestNode(name);
- parent.addChild(child);
- this.fireNodeAdded(NAMES_TREE, child.getPath());
- return child;
- }
- public void addTwoNames(TestNode parent, String name1, String name2) {
- parent.addChild(new TestNode(name1));
- parent.addChild(new TestNode(name2));
- this.fireTreeChanged(NAMES_TREE, parent.getPath());
- }
- public void removeNameNode(TestNode nameNode) {
- nameNode.getParent().removeChild(nameNode);
- this.fireNodeRemoved(NAMES_TREE, nameNode.getPath());
- }
- public boolean containsNameNode(String name) {
- return this.nameNode(name) != null;
- }
- public TestNode nameNode(String name) {
- for (Iterator<TestNode> stream = this.nameNodes(); stream.hasNext(); ) {
- TestNode node = stream.next();
- if (node.getText().equals(name)) {
- return node;
- }
- }
- return null;
- }
- public TestNode getRootDescriptionNode() {
- return this.rootDescriptionNode;
- }
- public Iterator<TestNode> descriptionNodes() {
- return new TreeIterator<TestNode>(this.rootDescriptionNode) {
- @Override
- public Iterator<TestNode> children(TestNode next) {
- return next.children();
- }
- };
- }
- public Iterator<List<TestNode>> descriptionPaths() {
- return new TransformationIterator<TestNode, List<TestNode>>(this.descriptionNodes()) {
- @Override
- protected List<TestNode> transform(TestNode next) {
- return next.getPath();
- }
- };
- }
- public TestNode addDescription(TestNode parent, String description) {
- TestNode child = new TestNode(description);
- parent.addChild(child);
- this.fireNodeAdded(DESCRIPTIONS_TREE, child.getPath());
- return child;
- }
- public void removeDescriptionNode(TestNode descriptionNode) {
- descriptionNode.getParent().removeChild(descriptionNode);
- this.fireNodeRemoved(DESCRIPTIONS_TREE, descriptionNode.getPath());
- }
- public boolean containsDescriptionNode(String name) {
- for (Iterator<TestNode> stream = this.descriptionNodes(); stream.hasNext(); ) {
- TestNode node = stream.next();
- if (node.getText().equals(name)) {
- return true;
- }
- }
- return false;
- }
- }
-
- class TestNode {
- private final String text;
- private TestNode parent;
- private final Collection<TestNode> children;
-
- public TestNode(String text) {
- this.text = text;
- this.children = new HashBag<TestNode>();
- }
- public String getText() {
- return this.text;
- }
- public TestNode getParent() {
- return this.parent;
- }
- private void setParent(TestNode parent) {
- this.parent = parent;
- }
- public Iterator<TestNode> children() {
- return new ReadOnlyIterator<TestNode>(this.children);
- }
- public void addChild(TestNode child) {
- this.children.add(child);
- child.setParent(this);
- }
- public void removeChild(TestNode child) {
- this.children.remove(child);
- }
- public List<TestNode> getPath() {
- return CollectionTools.reverseList(this.buildAntiPath());
- }
- private Iterator<TestNode> buildAntiPath() {
- return new ChainIterator<TestNode>(this) {
- @Override
- protected TestNode nextLink(TestNode currentLink) {
- return currentLink.getParent();
- }
- };
- }
- @Override
- public String toString() {
- return "TestNode(" + this.text + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueCollectionAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
deleted file mode 100644
index 316c2c4812..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueCollectionAdapter;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ValueCollectionAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueCollectionAdapter<Junk> junkHolder2;
-
-
- public ValueCollectionAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueCollectionAdapter<Junk>(this.junkHolder, Junk.STUFF_COLLECTION);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removeChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testCollectionAdd() {
- LocalListener l = new LocalListener(this.junkHolder2);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.addStuff("bar");
- assertTrue(l.eventReceived());
- }
-
- public void testCollectionRemove() {
- LocalListener l = new LocalListener(this.junkHolder2);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.removeStuff("foo");
- assertTrue(l.eventReceived());
- }
-
-
- class LocalListener extends ChangeAdapter {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- @Override
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
-
- private class Junk extends AbstractModel {
- private Collection<String> stuff;
- public static final String STUFF_COLLECTION = "stuff";
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueListAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueListAdapterTests.java
deleted file mode 100644
index 4a447a431c..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueListAdapterTests.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ValueListAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueListAdapter<Junk> junkHolder2;
-
-
- public ValueListAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueListAdapter<Junk>(this.junkHolder, Junk.STUFF_LIST);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removeChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testListAdd() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.addStuff("bar");
- assertTrue(l.eventReceived());
- }
-
- public void testListRemove() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.removeStuff("foo");
- assertTrue(l.eventReceived());
- }
-
- public void testListReplace() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.replaceStuff("foo", "bar");
- assertTrue(l.eventReceived());
- }
-
-
- class LocalListener extends ChangeAdapter {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- @Override
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private class Junk extends AbstractModel {
- private List<String> stuff;
- public static final String STUFF_LIST = "stuff";
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToList(stuffItem, this.stuff, STUFF_LIST);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromList(stuffItem, this.stuff, STUFF_LIST);
- }
-
- public void replaceStuff(String oldStuffItem, String newStuffItem) {
- this.replaceItemInList(oldStuffItem, newStuffItem, this.stuff, STUFF_LIST);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValuePropertyAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
deleted file mode 100644
index c3f5be6675..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValuePropertyAdapter;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ValuePropertyAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValuePropertyAdapter<Junk> junkHolder2;
-
-
- public ValuePropertyAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValuePropertyAdapter<Junk>(this.junkHolder, Junk.NAME_PROPERTY);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removeChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testChangeProperty() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.setName("bar");
- assertTrue(l.eventReceived());
- }
-
-
- class LocalListener extends ChangeAdapter {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- @Override
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- class Junk extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Junk(String name) {
- this.name = name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueStateAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueStateAdapterTests.java
deleted file mode 100644
index d23581257a..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/ValueStateAdapterTests.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueStateAdapter;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ValueStateAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueStateAdapter<Junk> junkHolder2;
-
-
- public ValueStateAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueStateAdapter<Junk>(this.junkHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removeChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyStateChangeListeners());
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyStateChangeListeners());
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyStateChangeListeners());
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testChangeState() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addChangeListener(l);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.setName("bar");
- assertTrue(l.eventReceived());
- }
-
-
- class LocalListener extends ChangeAdapter {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.getOldValue());
- assertEquals(this.newValue, e.getNewValue());
- assertEquals(PropertyValueModel.VALUE, e.getPropertyName());
- }
- @Override
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- class Junk extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Junk(String name) {
- this.name = name;
- }
-
- public void setName(String name) {
- this.name = name;
- this.fireStateChanged();
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java
deleted file mode 100644
index ad966a9607..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.prefs;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValuePrefsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValuePrefsTests.class.getPackage().getName());
-
- suite.addTestSuite(PreferencesCollectionValueModelTests.class);
- suite.addTestSuite(PreferencePropertyValueModelTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValuePrefsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
deleted file mode 100644
index 35ea6e729f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.prefs;
-
-import java.util.prefs.NodeChangeEvent;
-import java.util.prefs.NodeChangeListener;
-import java.util.prefs.PreferenceChangeEvent;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-@SuppressWarnings("nls")
-public class PreferencePropertyValueModelTests extends PreferencesTestCase {
- private WritablePropertyValueModel<Preferences> nodeHolder;
- PreferencePropertyValueModel<String> preferenceAdapter;
- PropertyChangeEvent event;
- PropertyChangeListener listener;
- boolean listenerRemoved = false;
- PreferenceChangeEvent preferenceEvent;
- private static final String KEY_NAME = "foo";
- private static final String STRING_VALUE = "original string value";
-
- public PreferencePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testNode.put(KEY_NAME, STRING_VALUE);
-
- this.nodeHolder = new SimplePropertyValueModel<Preferences>(this.testNode);
- this.preferenceAdapter = new PreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME);
- this.listener = this.buildValueChangeListener();
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.event = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- private PropertyChangeListener buildValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (PreferencePropertyValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- public void testSubjectHolder() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- String ANOTHER_STRING_VALUE = "some other value";
- Preferences anotherNode = this.classNode.node("another test node");
- anotherNode.put(KEY_NAME, ANOTHER_STRING_VALUE);
-
- this.nodeHolder.setValue(anotherNode);
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- assertEquals(ANOTHER_STRING_VALUE, this.preferenceAdapter.getValue());
-
- this.event = null;
- this.nodeHolder.setValue(null);
- this.verifyEvent(ANOTHER_STRING_VALUE, null);
- assertNull(this.preferenceAdapter.getValue());
-
- this.event = null;
- this.nodeHolder.setValue(this.testNode);
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testPreferenceChange() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- this.testNode.put(KEY_NAME, STRING_VALUE + STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyEvent(STRING_VALUE, STRING_VALUE + STRING_VALUE);
- assertEquals(STRING_VALUE + STRING_VALUE, this.preferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- this.verifyEvent(STRING_VALUE + STRING_VALUE, null);
- assertNull(this.preferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testValue() throws Exception {
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, "<missing preference>"));
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testSetValue() throws Exception {
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
- assertEquals(ANOTHER_STRING_VALUE, this.preferenceAdapter.getValue());
- assertEquals(ANOTHER_STRING_VALUE, this.testNode.get(KEY_NAME, "<missing preference>"));
- }
-
- public void testHasListeners() throws Exception {
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- ChangeListener listener2 = this.buildChangeListener();
- this.preferenceAdapter.addChangeListener(listener2);
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferenceAdapter.removeChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void propertyChanged(PropertyChangeEvent e) {
- if (PreferencePropertyValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- public void testRemoveAndReAddPreference() throws Exception {
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- // remove the preference entirely...
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.testNode.get(KEY_NAME, null));
- this.verifyEvent(STRING_VALUE, null);
- assertNull(this.preferenceAdapter.getValue());
-
- // ...then re-add it with the same key
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- // rebuild the adapter with a default value
- String DEFAULT_VALUE = "default value";
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.preferenceAdapter = new PreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME, DEFAULT_VALUE);
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- // remove the preference entirely...
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.testNode.get(KEY_NAME, null));
- this.verifyEvent(STRING_VALUE, DEFAULT_VALUE);
- assertEquals(DEFAULT_VALUE, this.preferenceAdapter.getValue());
-
- // ...then re-add it with the same key
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- this.verifyEvent(DEFAULT_VALUE, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testUnsynchronizedValue() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- assertNull(this.event);
-
- // remove the this.listener so the adapter no longer listens to the preference
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- this.testNode.put(KEY_NAME, STRING_VALUE + STRING_VALUE);
- this.waitForEventQueueToClear();
- // no this.event should have been fired...
- assertNull(this.event);
- // ...and the adapter's value should be null
- assertNull(this.preferenceAdapter.getValue());
-
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.event);
- assertNull(this.preferenceAdapter.getValue());
-
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertNull(this.event);
- assertNull(this.preferenceAdapter.getValue());
-
- // add the this.listener so the adapter synchs
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertEquals(STRING_VALUE, this.preferenceAdapter.getValue());
- }
-
- public void testIntegerPreference() throws Exception {
- // stop listening to the node and convert it to an integer
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- PreferencePropertyValueModel<Integer> integerPreferenceAdapter = new PreferencePropertyValueModel<Integer>(this.nodeHolder, KEY_NAME);
- this.testNode.putInt(KEY_NAME, 123);
- integerPreferenceAdapter = PreferencePropertyValueModel.forInteger(this.testNode, KEY_NAME, 0);
- integerPreferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertEquals(new Integer(123), integerPreferenceAdapter.getValue());
- assertNull(this.event);
-
- this.testNode.putInt(KEY_NAME, 246);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(123), new Integer(246));
- assertEquals(new Integer(246), integerPreferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(246), new Integer(0));
- assertEquals(new Integer(0), integerPreferenceAdapter.getValue());
-
- this.event = null;
- this.testNode.putInt(KEY_NAME, 123);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(0), new Integer(123));
- assertEquals(new Integer(123), integerPreferenceAdapter.getValue());
- }
-
- /**
- * test a situation where
- * - we are listening to the node when it gets removed from the preferences "repository"
- * - we get notification that it has been removed
- * - we try to remove our this.listener
- * - the node will throw an IllegalStateException - the adapter should handle it OK...
- */
- public void testRemoveNode() throws Exception {
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- Preferences parent = this.testNode.parent();
- parent.addNodeChangeListener(this.buildParentNodeChangeListener());
- this.testNode.removeNode();
- this.testNode.flush(); // this seems to be required for the this.event to trigger...
- this.waitForEventQueueToClear();
-
- assertTrue(this.listenerRemoved);
- assertTrue(this.preferenceAdapter.hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- private NodeChangeListener buildParentNodeChangeListener() {
- return new NodeChangeListener() {
- public void childAdded(NodeChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- public void childRemoved(NodeChangeEvent e) {
- if (e.getChild() == PreferencePropertyValueModelTests.this.testNode) {
- PreferencePropertyValueModelTests.this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, PreferencePropertyValueModelTests.this.listener);
- // this line of code will not execute if the line above triggers an exception
- PreferencePropertyValueModelTests.this.listenerRemoved = true;
- }
- }
- };
- }
-
- public void testSetSameValue() {
- assertNull(this.event);
- assertNull(this.preferenceEvent);
- this.testNode.addPreferenceChangeListener(this.buildPreferenceChangeListener());
-
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
-
- // now set to *same* value - nothing should happen...
- this.event = null;
- this.preferenceEvent = null;
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- assertNull(this.event);
- assertNull(this.preferenceEvent);
- }
-
- public void testSetSameValueForcePassThrough() throws Exception {
- assertNull(this.event);
- assertNull(this.preferenceEvent);
-
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.preferenceAdapter = new AlwaysUpdatePreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME);
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- this.testNode.addPreferenceChangeListener(this.buildPreferenceChangeListener());
-
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
-
- // now set to *same* value - only one this.event should fire
- this.event = null;
- this.preferenceEvent = null;
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- assertNull(this.event);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
- assertNull(this.event);
- }
-
- private PreferenceChangeListener buildPreferenceChangeListener() {
- return new PreferenceChangeListener() {
- public void preferenceChange(PreferenceChangeEvent evt) {
- PreferencePropertyValueModelTests.this.preferenceEvent = evt;
- }
- };
- }
-
- private void verifyEvent(Model source, Object oldValue, Object newValue) {
- assertNotNull(this.event);
- assertEquals(source, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.getPropertyName());
- assertEquals(oldValue, this.event.getOldValue());
- assertEquals(newValue, this.event.getNewValue());
- }
-
- private void verifyEvent(Object oldValue, Object newValue) {
- this.verifyEvent(this.preferenceAdapter, oldValue, newValue);
- }
-
- private void verifyPreferenceEvent(Object newValue) {
- assertNotNull(this.preferenceEvent);
- assertEquals(this.testNode, this.preferenceEvent.getSource());
- assertEquals(KEY_NAME, this.preferenceEvent.getKey());
- assertEquals(newValue, this.preferenceEvent.getNewValue());
- assertEquals(newValue, this.testNode.get(KEY_NAME, "<missing preference>"));
- }
-
- private boolean nodeHasAnyPrefListeners(Preferences node) throws Exception {
- PreferenceChangeListener[] prefListeners = (PreferenceChangeListener[]) ReflectionTools.getFieldValue(node, "prefListeners");
- return prefListeners.length > 0;
- }
-
-
- /**
- * Use this adapter to test out always passing through the new value
- * to the preference.
- */
- private class AlwaysUpdatePreferencePropertyValueModel<P> extends PreferencePropertyValueModel<P> {
-
- AlwaysUpdatePreferencePropertyValueModel(PropertyValueModel<Preferences> preferencesHolder, String key) {
- super(preferencesHolder, key);
- }
-
- @Override
- protected boolean preferenceIsToBeSet(Object oldValue, Object newValue) {
- return true;
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
deleted file mode 100644
index ed7e6ff7d8..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.prefs;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.prefs.NodeChangeEvent;
-import java.util.prefs.NodeChangeListener;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.prefs.PreferencesCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-@SuppressWarnings("nls")
-public class PreferencesCollectionValueModelTests extends PreferencesTestCase {
- private Map<String, String> expectedValues;
- private WritablePropertyValueModel<Preferences> nodeHolder;
- PreferencesCollectionValueModel<String> preferencesAdapter;
- CollectionEvent event;
- CollectionChangeListener listener;
- private PropertyChangeListener itemListener;
- boolean listenerRemoved = false;
- private static final String KEY_NAME_1 = "foo 1";
- private static final String KEY_NAME_2 = "foo 2";
- private static final String KEY_NAME_3 = "foo 3";
- private static final String STRING_VALUE_1 = "original string value 1";
- private static final String STRING_VALUE_2 = "original string value 2";
- private static final String STRING_VALUE_3 = "original string value 3";
-
- public PreferencesCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.expectedValues = new HashMap<String, String>();
- this.testNode.put(KEY_NAME_1, STRING_VALUE_1); this.expectedValues.put(KEY_NAME_1, STRING_VALUE_1);
- this.testNode.put(KEY_NAME_2, STRING_VALUE_2); this.expectedValues.put(KEY_NAME_2, STRING_VALUE_2);
- this.testNode.put(KEY_NAME_3, STRING_VALUE_3); this.expectedValues.put(KEY_NAME_3, STRING_VALUE_3);
-
- this.nodeHolder = new SimplePropertyValueModel<Preferences>(this.testNode);
- this.preferencesAdapter = new PreferencesCollectionValueModel<String>(this.nodeHolder);
- this.listener = this.buildCollectionChangeListener();
- this.itemListener = this.buildItemListener();
- this.preferencesAdapter.addCollectionChangeListener(CollectionValueModel.VALUES, this.listener);
- this.event = null;
- }
-
- private CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void collectionChanged(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void collectionCleared(CollectionClearEvent e) {
- this.logEvent(e);
- }
- public void itemsAdded(CollectionAddEvent e) {
- this.logEvent(e);
- }
- public void itemsRemoved(CollectionRemoveEvent e) {
- this.logEvent(e);
- }
- private void logEvent(CollectionEvent e) {
- if (PreferencesCollectionValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencesCollectionValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildItemListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- };
- }
-
- public void testSubjectHolder() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String ANOTHER_KEY_NAME_1 = "another key 1";
- String ANOTHER_KEY_NAME_2 = "another key 2";
- String ANOTHER_KEY_NAME_3 = "another key 3";
- String ANOTHER_STRING_VALUE_1 = "another string value 1";
- String ANOTHER_STRING_VALUE_2 = "another string value 2";
- String ANOTHER_STRING_VALUE_3 = "another string value 3";
- Preferences anotherNode = this.classNode.node("another test node");
- this.expectedValues.clear();
- anotherNode.put(ANOTHER_KEY_NAME_1, ANOTHER_STRING_VALUE_1); this.expectedValues.put(ANOTHER_KEY_NAME_1, ANOTHER_STRING_VALUE_1);
- anotherNode.put(ANOTHER_KEY_NAME_2, ANOTHER_STRING_VALUE_2); this.expectedValues.put(ANOTHER_KEY_NAME_2, ANOTHER_STRING_VALUE_2);
- anotherNode.put(ANOTHER_KEY_NAME_3, ANOTHER_STRING_VALUE_3); this.expectedValues.put(ANOTHER_KEY_NAME_3, ANOTHER_STRING_VALUE_3);
-
- this.nodeHolder.setValue(anotherNode);
- // collectionChanged does not pass any items in the this.event
- this.verifyEvent();
- this.verifyAdapter(this.preferencesAdapter);
-
- this.event = null;
- this.expectedValues.clear();
- this.nodeHolder.setValue(null);
- this.verifyEvent();
- assertFalse(this.preferencesAdapter.iterator().hasNext());
-
- this.event = null;
- this.nodeHolder.setValue(this.testNode);
- this.verifyEvent();
- this.expectedValues.clear();
- this.expectedValues.put(KEY_NAME_1, STRING_VALUE_1);
- this.expectedValues.put(KEY_NAME_2, STRING_VALUE_2);
- this.expectedValues.put(KEY_NAME_3, STRING_VALUE_3);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testAddPreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String ANOTHER_KEY_NAME = "another key";
- String ANOTHER_STRING_VALUE = "another string value";
- this.testNode.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- Map<String, String> expectedItems = new HashMap<String, String>();
- expectedItems.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.verifyEvent(expectedItems);
- this.expectedValues.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testRemovePreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- this.testNode.remove(KEY_NAME_2);
- this.waitForEventQueueToClear();
-
- assertNotNull(this.event);
- assertEquals(this.preferencesAdapter, this.event.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event.getCollectionName());
- assertEquals(1, ((CollectionRemoveEvent) this.event).getItemsSize());
- @SuppressWarnings("unchecked")
- String key = ((PreferencePropertyValueModel<String>) ((CollectionRemoveEvent) this.event).getItems().iterator().next()).getKey();
- assertEquals(KEY_NAME_2, key);
-
- this.expectedValues.remove(KEY_NAME_2);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testChangePreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String DIFFERENT = "something completely different";
- this.testNode.put(KEY_NAME_2, DIFFERENT);
- this.waitForEventQueueToClear();
-
- assertNull(this.event);
-
- this.expectedValues.put(KEY_NAME_2, DIFFERENT);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testValues() throws Exception {
- this.verifyNode(this.testNode);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- /**
- * test a situation where
- * - we are listening to the node when it gets removed from the preferences "repository"
- * - we get notification that it has been removed
- * - we try to remove our this.listener
- * - the node will throw an IllegalStateException - the adapter should handle it OK...
- */
- public void testRemoveNode() throws Exception {
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- Preferences parent = this.testNode.parent();
- parent.addNodeChangeListener(this.buildParentNodeChangeListener());
- this.testNode.removeNode();
- this.testNode.flush(); // this seems to be required for the this.event to trigger...
- this.waitForEventQueueToClear();
-
- assertTrue(this.listenerRemoved);
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- private NodeChangeListener buildParentNodeChangeListener() {
- return new NodeChangeListener() {
- public void childAdded(NodeChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- public void childRemoved(NodeChangeEvent e) {
- if (e.getChild() == PreferencesCollectionValueModelTests.this.testNode) {
- PreferencesCollectionValueModelTests.this.preferencesAdapter.removeCollectionChangeListener(CollectionValueModel.VALUES, PreferencesCollectionValueModelTests.this.listener);
- // this line of code will not execute if the line above triggers an exception
- PreferencesCollectionValueModelTests.this.listenerRemoved = true;
- }
- }
- };
- }
-
- public void testHasListeners() throws Exception {
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferencesAdapter.removeCollectionChangeListener(CollectionValueModel.VALUES, this.listener);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- ChangeListener listener2 = this.buildChangeListener();
- this.preferencesAdapter.addChangeListener(listener2);
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferencesAdapter.removeChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeAdapter() {
- @Override
- public void collectionChanged(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- @Override
- public void collectionCleared(CollectionClearEvent e) {
- this.logEvent(e);
- }
- @Override
- public void itemsAdded(CollectionAddEvent e) {
- this.logEvent(e);
- }
- @Override
- public void itemsRemoved(CollectionRemoveEvent e) {
- this.logEvent(e);
- }
- private void logEvent(CollectionEvent e) {
- if (PreferencesCollectionValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencesCollectionValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(Map<String, String> items) {
- this.verifyEvent();
- assertEquals(items.size(), ((CollectionAddEvent) this.event).getItemsSize());
- @SuppressWarnings("unchecked")
- Iterable<PreferencePropertyValueModel<String>> eventItems = (Iterable<PreferencePropertyValueModel<String>>) ((CollectionAddEvent) this.event).getItems();
- this.verifyItems(items, eventItems);
- }
-
- private void verifyEvent() {
- assertNotNull(this.event);
- assertEquals(this.preferencesAdapter, this.event.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event.getCollectionName());
- }
-
- private void verifyNode(Preferences node) throws Exception {
- String[] keys = node.keys();
- assertEquals(this.expectedValues.size(), keys.length);
- for (int i = 0; i < keys.length; i++) {
- assertEquals(this.expectedValues.get(keys[i]), node.get(keys[i], "<missing preference>"));
- }
- }
-
- private void verifyAdapter(PreferencesCollectionValueModel<String> cvm) {
- assertEquals(this.expectedValues.size(), cvm.size());
- this.verifyItems(this.expectedValues, cvm);
- }
-
- private void verifyItems(Map<String, String> expected, Iterable<PreferencePropertyValueModel<String>> actual) {
- for (PreferencePropertyValueModel<String> model : actual) {
- model.addPropertyChangeListener(PropertyValueModel.VALUE, this.itemListener);
- assertEquals(expected.get(model.getKey()), model.getValue());
- model.removePropertyChangeListener(PropertyValueModel.VALUE, this.itemListener);
- }
- }
-
- private boolean nodeHasAnyPrefListeners(Preferences node) throws Exception {
- PreferenceChangeListener[] prefListeners = (PreferenceChangeListener[]) ReflectionTools.getFieldValue(node, "prefListeners");
- return prefListeners.length > 0;
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesTestCase.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
deleted file mode 100644
index 3ae2c74db7..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.prefs;
-
-import java.util.EventObject;
-import java.util.List;
-import java.util.prefs.AbstractPreferences;
-import java.util.prefs.Preferences;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-/**
- * set up and tear down a test node for any subclass that
- * needs to test preferences-related stuff
- */
-@SuppressWarnings("nls")
-public abstract class PreferencesTestCase extends TestCase {
- protected Preferences classNode;
- public Preferences testNode;
- protected static final String TEST_NODE_NAME = "test node";
-
- public PreferencesTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- Preferences packageNode = Preferences.userNodeForPackage(this.getClass());
- this.classNode = packageNode.node(this.getClass().getSimpleName());
- // clean out any leftover crap...
- if ((this.classNode.keys().length > 0) || (this.classNode.childrenNames().length > 0)) {
- this.classNode.removeNode();
- // ...and re-create the node
- this.classNode = packageNode.node(this.getClass().getSimpleName());
- }
- this.testNode = this.classNode.node(TEST_NODE_NAME);
- }
-
- @Override
- protected void tearDown() throws Exception {
- // wait for all the events to be delivered before tearing down
- this.waitForEventQueueToClear();
- Preferences node = this.classNode.parent();
- this.classNode.removeNode();
- while (this.nodeIsVestigial(node)) {
- Preferences parent = node.parent();
- node.removeNode();
- node = parent;
- }
- TestTools.clear(this);
- super.tearDown();
- }
-
- private boolean nodeIsVestigial(Preferences node) throws Exception {
- return (node != null)
- && (node.keys().length == 0)
- && (node.childrenNames().length == 0)
- && (node != Preferences.userRoot());
- }
-
- protected void waitForEventQueueToClear() {
- while ( ! this.preferencesEventQueue().isEmpty()) {
- TestTools.sleep(100);
- }
- TestTools.sleep(100);
- }
-
- @SuppressWarnings("unchecked")
- private List<EventObject> preferencesEventQueue() {
- return (List<EventObject>) ReflectionTools.getStaticFieldValue(AbstractPreferences.class, "eventQueue");
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
deleted file mode 100644
index 47a7c8e320..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.ButtonModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class CheckBoxModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Boolean> booleanHolder;
- private ButtonModel buttonModelAdapter;
- boolean eventFired;
-
- public CheckBoxModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.booleanHolder = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.buttonModelAdapter = new CheckBoxModelAdapter(this.booleanHolder) {
- @Override
- protected PropertyChangeListener buildBooleanChangeListener() {
- return this.buildBooleanChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetSelected() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- this.buttonModelAdapter.setSelected(false);
- assertTrue(this.eventFired);
- assertEquals(Boolean.FALSE, this.booleanHolder.getValue());
- }
-
- public void testSetValue() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- assertTrue(this.buttonModelAdapter.isSelected());
- this.booleanHolder.setValue(Boolean.FALSE);
- assertTrue(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- assertTrue(this.buttonModelAdapter.isSelected());
- this.booleanHolder.setValue(null);
- assertTrue(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
-
- this.eventFired = false;
- this.booleanHolder.setValue(Boolean.FALSE);
- assertFalse(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Boolean> localBooleanHolder = (SimplePropertyValueModel<Boolean>) this.booleanHolder;
- assertFalse(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.buttonModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.buttonModelAdapter.addChangeListener(listener);
- assertTrue(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.buttonModelAdapter);
-
- this.buttonModelAdapter.removeChangeListener(listener);
- assertFalse(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.buttonModelAdapter);
- }
-
- private void verifyHasNoListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ReflectionTools.getFieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ReflectionTools.getFieldValue(model, "listenerList");
- assertFalse(listenerList.getListenerList().length == 0);
- }
-
-
- // ********** member class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
deleted file mode 100644
index 6c7464e0f5..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.WindowConstants;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of check boxes.
- */
-@SuppressWarnings("nls")
-public class CheckBoxModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Boolean> flag1Holder;
- private WritablePropertyValueModel<Boolean> flag2Holder;
- private WritablePropertyValueModel<Boolean> notFlag2Holder;
- private ButtonModel flag1ButtonModel;
- private ButtonModel flag2ButtonModel;
- private ButtonModel notFlag2ButtonModel;
-
- public static void main(String[] args) throws Exception {
- new CheckBoxModelAdapterUITest().exec();
- }
-
- private CheckBoxModelAdapterUITest() {
- super();
- }
-
- private void exec() throws Exception {
- this.testModel = new TestModel(true, true);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag1ButtonModel = this.buildCheckBoxModelAdapter(this.flag1Holder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.flag2ButtonModel = this.buildCheckBoxModelAdapter(this.flag2Holder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- this.notFlag2ButtonModel = this.buildCheckBoxModelAdapter(this.notFlag2Holder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag1());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNotFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value.booleanValue());
- }
- };
- }
-
- private ButtonModel buildCheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder) {
- return new CheckBoxModelAdapter(booleanHolder);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildCheckBoxPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildCheckBoxPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildFlag1CheckBox());
- taskListPanel.add(this.buildFlag2CheckBox());
- taskListPanel.add(this.buildNotFlag2CheckBox());
- taskListPanel.add(this.buildUnattachedCheckBox());
- return taskListPanel;
- }
-
- private JCheckBox buildFlag1CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("flag 1");
- checkBox.setModel(this.flag1ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildFlag2CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("flag 2");
- checkBox.setModel(this.flag2ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildNotFlag2CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("not flag 2");
- checkBox.setModel(this.notFlag2ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildUnattachedCheckBox() {
- JCheckBox checkBox = new JCheckBox("unattached");
- checkBox.getModel().addItemListener(this.buildUnattachedItemListener());
- return checkBox;
- }
-
- private ItemListener buildUnattachedItemListener() {
- return new ItemListener() {
- public void itemStateChanged(ItemEvent e) {
- System.out.println("unattached state changed: " + e);
- }
- };
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildFlipFlag1Button());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildFlipFlag1Button() {
- return new JButton(this.buildFlipFlag1Action());
- }
-
- private Action buildFlipFlag1Action() {
- Action action = new AbstractAction("flip flag 1") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.flipFlag1();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void flipFlag1() {
- this.testModel.setFlag1( ! this.testModel.isFlag1());
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(boolean flag1, boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = ! flag2;
- }
- public boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(boolean flag1) {
- boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(boolean flag2) {
- boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = ! flag2;
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(boolean notFlag2) {
- this.setFlag2( ! notFlag2);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
deleted file mode 100644
index 891611573d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import javax.swing.ComboBoxModel;
-import javax.swing.ListModel;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.common.utility.internal.swing.Displayable;
-import org.eclipse.jpt.common.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.CoordinatedList;
-
-@SuppressWarnings("nls")
-public class ComboBoxModelAdapterTests extends TestCase {
-
- public ComboBoxModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- // nothing yet...
- }
-
- @Override
- protected void tearDown() throws Exception {
- // nothing yet...
- super.tearDown();
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Displayable> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- SimplePropertyValueModel<Object> selectionHolder = new SimplePropertyValueModel<Object>(listHolder.iterator().next());
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- ComboBoxModel comboBoxModel = new ComboBoxModelAdapter(listHolder, selectionHolder);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(comboBoxModel);
-
- CoordinatedList<Displayable> synchList = new CoordinatedList<Displayable>(comboBoxModel);
- PropertyChangeListener selectionListener = this.buildSelectionListener();
- selectionHolder.addPropertyChangeListener(PropertyValueModel.VALUE, selectionListener);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(comboBoxModel);
-
- comboBoxModel.removeListDataListener(synchList);
- selectionHolder.removePropertyChangeListener(PropertyValueModel.VALUE, selectionListener);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(comboBoxModel);
- }
-
- private PropertyChangeListener buildSelectionListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent evt) {
- // do nothing...
- }
- };
- }
-
- private void verifyHasNoListeners(ListModel listModel) throws Exception {
- boolean hasNoListeners = ((Boolean) ReflectionTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ReflectionTools.executeMethod(listModel, "hasListDataListeners")).booleanValue();
- assertTrue(hasListeners);
- }
-
- private SimpleListValueModel<Displayable> buildListHolder() {
- return new SimpleListValueModel<Displayable>(this.buildList());
- }
-
- private List<Displayable> buildList() {
- List<Displayable> list = new ArrayList<Displayable>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Displayable> c) {
- c.add(new SimpleDisplayable("foo"));
- c.add(new SimpleDisplayable("bar"));
- c.add(new SimpleDisplayable("baz"));
- c.add(new SimpleDisplayable("joo"));
- c.add(new SimpleDisplayable("jar"));
- c.add(new SimpleDisplayable("jaz"));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
deleted file mode 100644
index c750bdf997..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ComboBoxModel;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.ListCellRenderer;
-import javax.swing.UIManager;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.common.utility.internal.swing.FilteringListBrowser;
-import org.eclipse.jpt.common.utility.internal.swing.ListChooser;
-import org.eclipse.jpt.common.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-
-/**
- * Play around with a set of combo-boxes.
- *
- * DefaultLongListBrowserDialogUITest subclasses this class; so be
- * careful when making changes.
- */
-@SuppressWarnings("nls")
-public class ComboBoxModelAdapterUITest {
-
- protected JFrame window;
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Object> colorHolder;
- private SimpleListValueModel<String> colorListHolder;
- protected ComboBoxModel colorComboBoxModel;
- private int nextColorNumber = 0;
-
- public static void main(String[] args) throws Exception {
- new ComboBoxModelAdapterUITest().exec();
- }
-
- protected ComboBoxModelAdapterUITest() {
- super();
- }
-
- protected void exec() throws Exception {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); // Metal LAF
-// UIManager.setLookAndFeel(com.sun.java.swing.plaf.windows.WindowsLookAndFeel.class.getName());
-// UIManager.setLookAndFeel(com.sun.java.swing.plaf.motif.MotifLookAndFeel.class.getName());
-// UIManager.setLookAndFeel(oracle.bali.ewt.olaf.OracleLookAndFeel.class.getName());
- this.testModel = this.buildTestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.colorHolder = this.buildColorHolder(this.testModelHolder);
- this.colorListHolder = this.buildColorListHolder();
- this.colorComboBoxModel = this.buildComboBoxModelAdapter(this.colorListHolder, this.colorHolder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildColorHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.COLOR_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setColor((String) value);
- }
- };
- }
-
- protected TestModel buildTestModel() {
- return new TestModel();
- }
-
- private SimpleListValueModel<String> buildColorListHolder() {
- return new SimpleListValueModel<String>(TestModel.validColors());
-// return new AbstractReadOnlyListValueModel() {
-// public Object value() {
-// return new ArrayListIterator(TestModel.VALID_COLORS);
-// }
-// public int size() {
-// return TestModel.VALID_COLORS.length;
-// }
-// };
- }
-
- protected ListValueModel<String> uiColorListHolder() {
- return this.colorListHolder;
- }
-
- private ComboBoxModel buildComboBoxModelAdapter(ListValueModel<String> listHolder, WritablePropertyValueModel<Object> selectionHolder) {
- return new ComboBoxModelAdapter(listHolder, selectionHolder);
- }
-
- private void openWindow() {
- this.window = new JFrame(this.getClass().getSimpleName());
- this.window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- this.window.addWindowListener(this.buildWindowListener());
- this.window.getContentPane().add(this.buildMainPanel(), "Center");
- this.window.setLocation(300, 300);
- this.window.setSize(400, 150);
- this.window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildComboBoxPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- protected JPanel buildComboBoxPanel() {
- JPanel panel = new JPanel(new GridLayout(1, 0));
- panel.add(this.buildComboBox());
- panel.add(this.buildComboBox());
- panel.add(this.buildListChooser1());
- panel.add(this.buildListChooser2());
- return panel;
- }
-
- private JComboBox buildComboBox() {
- JComboBox comboBox = new JComboBox(this.colorComboBoxModel);
- comboBox.setRenderer(this.buildComboBoxRenderer());
- return comboBox;
- }
-
- protected ListCellRenderer buildComboBoxRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- protected String buildText(Object value) {
- return super.buildText(value);
- }
- };
- }
-
- private ListChooser buildListChooser1() {
- return new LocalListChooser1(this.colorComboBoxModel);
- }
-
- private ListChooser buildListChooser2() {
- return new LocalListChooser2(this.colorComboBoxModel);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(2, 0));
- controlPanel.add(this.buildResetColorButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- controlPanel.add(this.buildAddTenButton());
- controlPanel.add(this.buildRemoveTenButton());
- return controlPanel;
- }
-
- // ********** reset color button **********
- private JButton buildResetColorButton() {
- return new JButton(this.buildResetColorAction());
- }
-
- private Action buildResetColorAction() {
- Action action = new AbstractAction("reset color") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.resetColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetColor() {
- this.testModel.setColor(TestModel.DEFAULT_COLOR);
- }
-
- // ********** clear model button **********
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- // ********** restore model button **********
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- // ********** print model button **********
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println(this.testModel);
- }
-
- // ********** add 20 button **********
- private JButton buildAddTenButton() {
- return new JButton(this.buildAddTenAction());
- }
-
- private Action buildAddTenAction() {
- Action action = new AbstractAction("add 20") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.addTen();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addTen() {
- for (int i = this.nextColorNumber; i < this.nextColorNumber + 20; i++) {
- this.colorListHolder.add(this.colorListHolder.size(), "color" + i);
- }
- this.nextColorNumber += 20;
- }
-
- // ********** remove 20 button **********
- private JButton buildRemoveTenButton() {
- return new JButton(this.buildRemoveTenAction());
- }
-
- private Action buildRemoveTenAction() {
- Action action = new AbstractAction("remove 20") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.removeTen();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void removeTen() {
- for (int i = 0; i < 20; i++) {
- if (this.colorListHolder.size() > 0) {
- this.colorListHolder.remove(this.colorListHolder.size() - 1);
- }
- }
- }
-
-
- protected static class TestModel extends AbstractModel {
- private String color;
- public static final String COLOR_PROPERTY = "color";
- public static final String RED = "red";
- public static final String ORANGE = "orange";
- public static final String YELLOW = "yellow";
- public static final String GREEN = "green";
- public static final String BLUE = "blue";
- public static final String INDIGO = "indigo";
- public static final String VIOLET = "violet";
- public static final String DEFAULT_COLOR = RED;
- public static List<String> validColors;
- public static final String[] DEFAULT_VALID_COLORS = {
- RED,
- ORANGE,
- YELLOW,
- GREEN,
- BLUE,
- INDIGO,
- VIOLET
- };
-
- public static List<String> validColors() {
- if (validColors == null) {
- validColors = buildDefaultValidColors();
- }
- return validColors;
- }
- public static List<String> buildDefaultValidColors() {
- List<String> result = new ArrayList<String>();
- CollectionTools.addAll(result, DEFAULT_VALID_COLORS);
- return result;
- }
-
- public TestModel() {
- this(DEFAULT_COLOR);
- }
- public TestModel(String color) {
- this.color = color;
- }
- public String getColor() {
- return this.color;
- }
- public void setColor(String color) {
- this.checkColor(color);
- Object old = this.color;
- this.color = color;
- this.firePropertyChanged(COLOR_PROPERTY, old, color);
- }
- public void checkColor(String c) {
- if ( ! validColors().contains(c)) {
- throw new IllegalArgumentException(c);
- }
- }
- @Override
- public String toString() {
- return "TestModel(" + this.color + ")";
- }
- }
-
-
- private class LocalListChooser1 extends ListChooser {
- public LocalListChooser1(ComboBoxModel model) {
- super(model);
- }
- }
-
-
- private class LocalListChooser2 extends ListChooser {
- public LocalListChooser2(ComboBoxModel model) {
- super(model);
- }
- @Override
- protected ListBrowser buildBrowser() {
- return new FilteringListBrowser<String>();
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
deleted file mode 100644
index ed00f4cf18..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.ListCellRenderer;
-import org.eclipse.jpt.common.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-
-/**
- *
- */
-@SuppressWarnings("nls")
-public class ComboBoxModelAdapterUITest2 extends ComboBoxModelAdapterUITest {
-
- public static void main(String[] args) throws Exception {
- new ComboBoxModelAdapterUITest2().exec();
- }
-
- public ComboBoxModelAdapterUITest2() {
- super();
- }
-
- /**
- * use a different model that allows the color to be set to null
- */
- @Override
- protected TestModel buildTestModel() {
- return new TestModel2();
- }
-
- /**
- * add a null to the front of the list
- */
- @Override
- protected ListValueModel<String> uiColorListHolder() {
- // the default is to prepend the wrapped list with a null item
- return new ExtendedListValueModelWrapper<String>(super.uiColorListHolder());
- }
-
- /**
- * convert null to some text
- */
- @Override
- protected ListCellRenderer buildComboBoxRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- protected String buildText(Object value) {
- return (value == null) ? "<none selected>" : super.buildText(value);
- }
- };
- }
-
-
- protected static class TestModel2 extends TestModel {
- /**
- * null is OK here
- */
- @Override
- public void checkColor(String color) {
- if (color == null) {
- return;
- }
- super.checkColor(color);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
deleted file mode 100644
index 2b09c75e48..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.util.Date;
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class DateSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public DateSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(new Date());
- this.spinnerModelAdapter = new DateSpinnerModelAdapter(this.valueHolder) {
- @Override
- protected PropertyChangeListener buildDateChangeListener() {
- return this.buildDateChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- Date newDate = new Date();
- newDate.setTime(777777);
- this.spinnerModelAdapter.setValue(newDate);
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.valueHolder.getValue()).getTime());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- }
-
- public void testDefaultValue() throws Exception {
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertFalse(((Date) this.spinnerModelAdapter.getValue()).getTime() == 777777);
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((DateSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((DateSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
- public void testNullInitialValue() {
- Date today = new Date();
- this.valueHolder = new SimplePropertyValueModel<Object>();
- this.spinnerModelAdapter = new DateSpinnerModelAdapter(this.valueHolder, today) {
- @Override
- protected PropertyChangeListener buildDateChangeListener() {
- return this.buildDateChangeListener_();
- }
- };
-
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(today, this.spinnerModelAdapter.getValue());
-
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
-
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- }
-
-
- // ********** inner class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
deleted file mode 100644
index 52206d000e..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.DocumentEvent.EventType;
-import javax.swing.text.Document;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class DocumentAdapterTests extends TestCase {
- private WritablePropertyValueModel<String> stringHolder;
- Document documentAdapter;
- boolean eventFired;
-
- public DocumentAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.stringHolder = new SimplePropertyValueModel<String>("0123456789");
- this.documentAdapter = new DocumentAdapter(this.stringHolder) {
- @Override
- protected PropertyChangeListener buildStringListener() {
- return this.buildStringListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testRemove() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void removeUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.REMOVE, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the removal of "23456"
- assertEquals(2, e.getOffset());
- assertEquals(5, e.getLength());
- }
- });
- this.documentAdapter.remove(2, 5);
- assertTrue(this.eventFired);
- assertEquals("01789", this.stringHolder.getValue());
- }
-
- public void testInsert() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.INSERT, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the insert of "xxxxxx"
- assertEquals(2, e.getOffset());
- assertEquals(5, e.getLength());
- }
- });
- this.documentAdapter.insertString(2, "xxxxx", null);
- assertTrue(this.eventFired);
- assertEquals("01xxxxx23456789", this.stringHolder.getValue());
- }
-
- public void testSetValue() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.INSERT, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the insert of "foo"
- assertEquals(0, e.getOffset());
- assertEquals(3, e.getLength());
- }
- @Override
- public void removeUpdate(DocumentEvent e) {
- assertEquals(EventType.REMOVE, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the removal of "0123456789"
- assertEquals(0, e.getOffset());
- assertEquals(10, e.getLength());
- }
- });
- assertEquals("0123456789", this.documentAdapter.getText(0, this.documentAdapter.getLength()));
- this.stringHolder.setValue("foo");
- assertTrue(this.eventFired);
- assertEquals("foo", this.documentAdapter.getText(0, this.documentAdapter.getLength()));
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<String> localStringHolder = (SimplePropertyValueModel<String>) this.stringHolder;
- assertFalse(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.documentAdapter);
-
- DocumentListener listener = new TestDocumentListener();
- this.documentAdapter.addDocumentListener(listener);
- assertTrue(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.documentAdapter);
-
- this.documentAdapter.removeDocumentListener(listener);
- assertFalse(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.documentAdapter);
- }
-
- private void verifyHasNoListeners(Object document) throws Exception {
- Object delegate = ReflectionTools.getFieldValue(document, "delegate");
- Object[] listeners = (Object[]) ReflectionTools.executeMethod(delegate, "getDocumentListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object document) throws Exception {
- Object delegate = ReflectionTools.getFieldValue(document, "delegate");
- Object[] listeners = (Object[]) ReflectionTools.executeMethod(delegate, "getDocumentListeners");
- assertFalse(listeners.length == 0);
- }
-
-
-private class TestDocumentListener implements DocumentListener {
- TestDocumentListener() {
- super();
- }
- public void changedUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
- public void insertUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
- public void removeUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
-}
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
deleted file mode 100644
index f199f51150..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import javax.swing.WindowConstants;
-import javax.swing.text.AbstractDocument;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.PlainDocument;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of entry fields.
- */
-@SuppressWarnings("nls")
-public class DocumentAdapterUITest {
-
- private TestModel testModel;
- private static final String DEFAULT_NAME = "Scooby Doo";
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<String> nameHolder;
- private Document nameDocument;
- private Document upperCaseNameDocument;
-
- public static void main(String[] args) throws Exception {
- new DocumentAdapterUITest().exec();
- }
-
- private DocumentAdapterUITest() {
- super();
- }
-
- private void exec() throws Exception {
- this.testModel = new TestModel(DEFAULT_NAME);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.nameHolder = this.buildNameHolder(this.testModelHolder);
- this.nameDocument = this.buildNameDocument(this.nameHolder);
- this.upperCaseNameDocument = this.buildUpperCaseNameDocument(this.nameHolder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private Document buildNameDocument(WritablePropertyValueModel<String> stringHolder) {
- return new DocumentAdapter(stringHolder);
- }
-
- private Document buildUpperCaseNameDocument(WritablePropertyValueModel<String> stringHolder) {
- return new DocumentAdapter(stringHolder, this.buildUpperCaseNameDocumentDelegate());
- }
-
- private AbstractDocument buildUpperCaseNameDocumentDelegate() {
- return new PlainDocument() {
- @Override
- public void insertString(int offset, String string, AttributeSet a) throws BadLocationException {
- if (string == null) {
- return;
- }
- char[] upper = string.toCharArray();
- for (int i = 0; i < upper.length; i++) {
- upper[i] = Character.toUpperCase(upper[i]);
- }
- super.insertString(offset, new String(upper), a);
- }
- };
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTextFieldPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTextFieldPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildNameTextField());
- taskListPanel.add(this.buildReadOnlyNameTextField());
- taskListPanel.add(this.buildUpperCaseNameTextField());
- return taskListPanel;
- }
-
- private JTextField buildNameTextField() {
- return new JTextField(this.nameDocument, null, 0);
- }
-
- private JTextField buildReadOnlyNameTextField() {
- JTextField nameTextField = this.buildNameTextField();
- nameTextField.setEditable(false);
- return nameTextField;
- }
-
- private JTextField buildUpperCaseNameTextField() {
- return new JTextField(this.upperCaseNameDocument, null, 0);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetNameButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetNameButton() {
- return new JButton(this.buildResetNameAction());
- }
-
- private Action buildResetNameAction() {
- Action action = new AbstractAction("reset name") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.resetName();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetName() {
- this.testModel.setName(DEFAULT_NAME);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("name: " + this.testModel.getName());
- }
-
-
- private class TestModel extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public TestModel(String name) {
- this.name = name;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.getName() + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java
deleted file mode 100644
index 93c6b41c9d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValueSwingTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValueSwingTests.class.getPackage().getName());
-
- suite.addTestSuite(CheckBoxModelAdapterTests.class);
- suite.addTestSuite(ComboBoxModelAdapterTests.class);
- suite.addTestSuite(DateSpinnerModelAdapterTests.class);
- suite.addTestSuite(DocumentAdapterTests.class);
- suite.addTestSuite(ListModelAdapterTests.class);
- suite.addTestSuite(ListSpinnerModelAdapterTests.class);
- suite.addTestSuite(NumberSpinnerModelAdapterTests.class);
- suite.addTestSuite(ObjectListSelectionModelTests.class);
- suite.addTestSuite(PrimitiveListTreeModelTests.class);
- suite.addTestSuite(RadioButtonModelAdapterTests.class);
- suite.addTestSuite(SpinnerModelAdapterTests.class);
- suite.addTestSuite(TableModelAdapterTests.class);
- suite.addTestSuite(TreeModelAdapterTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValueSwingTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
deleted file mode 100644
index 0be426de9f..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.swing.ListModel;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.CoordinatedList;
-
-@SuppressWarnings("nls")
-public class ListModelAdapterTests extends TestCase {
-
- public ListModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- // nothing yet...
- }
-
- @Override
- protected void tearDown() throws Exception {
- // nothing yet...
- super.tearDown();
- }
-
- private ListModelAdapter buildListModel(ListValueModel<String> listHolder) {
- return new ListModelAdapter(listHolder) {
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListModel buildListModel(CollectionValueModel<String> collectionHolder) {
- return new ListModelAdapter(collectionHolder) {
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<String> collectionHolder = this.buildCollectionHolder();
- ListModel listModel = this.buildListModel(collectionHolder);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- collectionHolder.add("tom");
- collectionHolder.add("dick");
- collectionHolder.add("harry");
- collectionHolder.add(null);
- assertEquals(10, synchList.size());
- this.compare(listModel, synchList);
-
- collectionHolder.remove("foo");
- collectionHolder.remove("jar");
- collectionHolder.remove("harry");
- collectionHolder.remove(null);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(listHolder);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- listHolder.add(6, "tom");
- listHolder.add(7, "dick");
- listHolder.add(8, "harry");
- listHolder.add(9, null);
- assertEquals(10, synchList.size());
- this.compare(listModel, synchList);
-
- listHolder.remove(9);
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
- }
-
- public void testSetModel() {
- SimpleListValueModel<String> listHolder1 = this.buildListHolder();
- ListModelAdapter listModel = this.buildListModel(listHolder1);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertTrue(listHolder1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- SimpleListValueModel<String> listHolder2 = this.buildListHolder2();
- listModel.setModel(listHolder2);
- assertEquals(3, synchList.size());
- this.compare(listModel, synchList);
- assertTrue(listHolder1.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(listHolder2.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- listModel.setModel(new SimpleListValueModel<String>());
- assertEquals(0, synchList.size());
- this.compare(listModel, synchList);
- assertTrue(listHolder1.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(listHolder2.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void compare(ListModel listModel, List<String> list) {
- assertEquals(listModel.getSize(), list.size());
- for (int i = 0; i < listModel.getSize(); i++) {
- assertEquals(listModel.getElementAt(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<String> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<String> comparator) {
- SimpleCollectionValueModel<String> collectionHolder = this.buildCollectionHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelAdapter<String>(collectionHolder, comparator));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- collectionHolder.add("tom");
- collectionHolder.add("dick");
- collectionHolder.add("harry");
- assertEquals(9, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- collectionHolder.remove("foo");
- collectionHolder.remove("jar");
- collectionHolder.remove("harry");
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<String> comparator) {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelWrapper<String>(listHolder, comparator));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- listHolder.add(0, "tom");
- listHolder.add(0, "dick");
- listHolder.add(0, "harry");
- assertEquals(9, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listModel, synchList, comparator);
- }
-
- private void compareSort(ListModel listModel, List<String> list, Comparator<String> comparator) {
- SortedSet<String> ss = new TreeSet<String>(comparator);
- for (int i = 0; i < listModel.getSize(); i++) {
- ss.add((String) listModel.getElementAt(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<String> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListModel listModel = this.buildListModel(listHolder);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasNoListeners(listModel);
-
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasListeners(listModel);
-
- listModel.removeListDataListener(synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasNoListeners(listModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(listHolder);
- this.verifyHasNoListeners(listModel);
- assertEquals(6, listModel.getSize());
-
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- this.verifyHasListeners(listModel);
- assertEquals(6, listModel.getSize());
-
- listModel.removeListDataListener(synchList);
- this.verifyHasNoListeners(listModel);
- assertEquals(6, listModel.getSize());
- }
-
- public void testGetElementAt() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelWrapper<String>(listHolder));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- this.verifyHasListeners(listModel);
- assertEquals("bar", listModel.getElementAt(0));
- assertEquals("bar", synchList.get(0));
- }
-
- private void verifyHasNoListeners(ListModel listModel) throws Exception {
- boolean hasNoListeners = ((Boolean) ReflectionTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ReflectionTools.executeMethod(listModel, "hasListDataListeners")).booleanValue();
- assertTrue(hasListeners);
- }
-
- private SimpleCollectionValueModel<String> buildCollectionHolder() {
- return new SimpleCollectionValueModel<String>(this.buildCollection());
- }
-
- private Collection<String> buildCollection() {
- Bag<String> bag = new HashBag<String>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<String> buildListHolder() {
- return new SimpleListValueModel<String>(this.buildList());
- }
-
- private List<String> buildList() {
- List<String> list = new ArrayList<String>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<String> c) {
- c.add("foo");
- c.add("bar");
- c.add("baz");
- c.add("joo");
- c.add("jar");
- c.add("jaz");
- }
-
- private SimpleListValueModel<String> buildListHolder2() {
- return new SimpleListValueModel<String>(this.buildList2());
- }
-
- private List<String> buildList2() {
- List<String> list = new ArrayList<String>();
- this.populateCollection2(list);
- return list;
- }
-
- private void populateCollection2(Collection<String> c) {
- c.add("tom");
- c.add("dick");
- c.add("harry");
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java
deleted file mode 100644
index 17fd76236d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.TextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.ListModel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.internal.swing.Displayable;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-/**
- * an example UI for testing various permutations of the ListModelAdapter
- */
-@SuppressWarnings("nls")
-public class ListModelAdapterUITest {
-
- private WritablePropertyValueModel<TaskList> taskListHolder;
- private TextField taskTextField;
-
- public static void main(String[] args) throws Exception {
- new ListModelAdapterUITest().exec(args);
- }
-
- private ListModelAdapterUITest() {
- super();
- }
-
- private void exec(@SuppressWarnings("unused") String[] args) throws Exception {
- this.taskListHolder = new SimplePropertyValueModel<TaskList>(new TaskList());
- this.openWindow();
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(800, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTaskListPanel(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(0, 1));
- taskListPanel.add(this.buildPrimitiveTaskListPanel());
- taskListPanel.add(this.buildDisplayableTaskListPanel());
- return taskListPanel;
- }
-
- private Component buildPrimitiveTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildUnsortedPrimitiveListPanel());
- taskListPanel.add(this.buildStandardSortedPrimitiveListPanel());
- taskListPanel.add(this.buildCustomSortedPrimitiveListPanel());
- return taskListPanel;
- }
-
- private Component buildDisplayableTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildUnsortedDisplayableListPanel());
- taskListPanel.add(this.buildStandardSortedDisplayableListPanel());
- taskListPanel.add(this.buildCustomSortedDisplayableListPanel());
- return taskListPanel;
- }
-
- private Component buildUnsortedPrimitiveListPanel() {
- return this.buildListPanel("primitive unsorted", this.buildUnsortedPrimitiveListModel());
- }
-
- private Component buildStandardSortedPrimitiveListPanel() {
- return this.buildListPanel("primitive sorted", this.buildStandardSortedPrimitiveListModel());
- }
-
- private Component buildCustomSortedPrimitiveListPanel() {
- return this.buildListPanel("primitive reverse sorted", this.buildCustomSortedPrimitiveListModel());
- }
-
- private Component buildUnsortedDisplayableListPanel() {
- return this.buildListPanel("displayable unsorted", this.buildUnsortedDisplayableListModel());
- }
-
- private Component buildStandardSortedDisplayableListPanel() {
- return this.buildListPanel("displayable sorted", this.buildStandardSortedDisplayableListModel());
- }
-
- private Component buildCustomSortedDisplayableListPanel() {
- return this.buildListPanel("displayable reverse sorted", this.buildCustomSortedDisplayableListModel());
- }
-
- private ListModel buildUnsortedPrimitiveListModel() {
- return new ListModelAdapter(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListModel buildStandardSortedPrimitiveListModel() {
- return new ListModelAdapter(new SortedListValueModelWrapper<String>(this.buildPrimitiveTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedPrimitiveListModel() {
- return new ListModelAdapter(new SortedListValueModelWrapper<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator()));
- }
-
- private ListModel buildUnsortedDisplayableListModel() {
- return new ListModelAdapter(this.buildDisplayableTaskListAdapter());
- }
-
- private ListModel buildStandardSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelWrapper<Task>(this.buildDisplayableTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelWrapper<Task>(this.buildDisplayableTaskListAdapter(), this.buildCustomTaskObjectComparator()));
- }
-
- private Component buildListPanel(String label, ListModel listModel) {
- JPanel listPanel = new JPanel(new BorderLayout());
- JLabel listLabel = new JLabel(" " + label);
- listPanel.add(listLabel, BorderLayout.NORTH);
-
- JList listBox = new JList();
- listBox.setModel(listModel);
- listBox.setDoubleBuffered(true);
- listLabel.setLabelFor(listBox);
- listPanel.add(new JScrollPane(listBox), BorderLayout.CENTER);
- return listPanel;
- }
-
- private Comparator<String> buildCustomStringComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private Comparator<Task> buildCustomTaskObjectComparator() {
- return new Comparator<Task>() {
- public int compare(Task to1, Task to2) {
- return to2.displayString().compareTo(to1.displayString());
- }
- };
- }
-
- private ListValueModel<String> buildPrimitiveTaskListAdapter() {
- return new ListAspectAdapter<TaskList, String>(TaskList.TASK_NAMES_LIST, this.taskList()) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.taskNames();
- }
- };
- }
-
- private ListValueModel<Task> buildDisplayableTaskListAdapter() {
- return new ListAspectAdapter<TaskList, Task>(TaskList.TASKS_LIST, this.taskList()) {
- @Override
- protected ListIterator<Task> listIterator_() {
- return this.subject.tasks();
- }
- };
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new BorderLayout());
- controlPanel.add(this.buildAddRemoveTaskPanel(), BorderLayout.CENTER);
- controlPanel.add(this.buildClearButton(), BorderLayout.EAST);
- return controlPanel;
- }
-
- private Component buildAddRemoveTaskPanel() {
- JPanel addRemoveTaskPanel = new JPanel(new BorderLayout());
- addRemoveTaskPanel.add(this.buildAddButton(), BorderLayout.WEST);
- addRemoveTaskPanel.add(this.buildTaskTextField(), BorderLayout.CENTER);
- addRemoveTaskPanel.add(this.buildRemoveButton(), BorderLayout.EAST);
- return addRemoveTaskPanel;
- }
-
- private String getTask() {
- return this.taskTextField.getText();
- }
-
- private TaskList taskList() {
- return this.taskListHolder.getValue();
- }
-
- void addTask() {
- String task = this.getTask();
- if (task.length() != 0) {
- this.taskList().addTask(task);
- }
- }
-
- void removeTask() {
- String task = this.getTask();
- if (task.length() != 0) {
- this.taskList().removeTask(task);
- }
- }
-
- void clearTasks() {
- this.taskList().clearTasks();
- }
-
- private TextField buildTaskTextField() {
- this.taskTextField = new TextField();
- return this.taskTextField;
- }
-
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.addTask();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- Action action = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.removeTask();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private JButton buildClearButton() {
- return new JButton(this.buildClearAction());
- }
-
- private Action buildClearAction() {
- Action action = new AbstractAction("clear") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.clearTasks();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- public class TaskList extends AbstractModel {
- private List<String> taskNames = new ArrayList<String>();
- private List<Task> taskObjects = new ArrayList<Task>();
- public static final String TASK_NAMES_LIST = "taskNames";
- public static final String TASKS_LIST = "tasks";
- TaskList() {
- super();
- }
- public ListIterator<String> taskNames() {
- return this.taskNames.listIterator();
- }
- public ListIterator<Task> tasks() {
- return this.taskObjects.listIterator();
- }
- public void addTask(String taskName) {
- int index = this.taskNames.size();
- this.taskNames.add(index, taskName);
- this.fireItemAdded(TASK_NAMES_LIST, index, taskName);
-
- Task taskObject = new Task(taskName);
- this.taskObjects.add(index, taskObject);
- this.fireItemAdded(TASKS_LIST, index, taskObject);
- }
- public void removeTask(String taskName) {
- int index = this.taskNames.indexOf(taskName);
- if (index != -1) {
- Object removedTask = this.taskNames.remove(index);
- this.fireItemRemoved(TASK_NAMES_LIST, index, removedTask);
- // assume the indexes match...
- Object removedTaskObject = this.taskObjects.remove(index);
- this.fireItemRemoved(TASKS_LIST, index, removedTaskObject);
- }
- }
- public void clearTasks() {
- this.taskNames.clear();
- this.fireListChanged(TASK_NAMES_LIST, this.taskNames);
- this.taskObjects.clear();
- this.fireListChanged(TASKS_LIST, this.taskObjects);
- }
- }
-
- public class Task extends AbstractModel implements Displayable {
- private String name;
- private Date creationTimeStamp;
- public Task(String name) {
- this.name = name;
- this.creationTimeStamp = new Date();
- }
- public String displayString() {
- return this.name + ": " + this.creationTimeStamp.getTime();
- }
- public Icon icon() {
- return null;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.displayString());
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
deleted file mode 100644
index 8260698bf7..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ListSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
- private static final String[] VALUE_LIST = {"red", "green", "blue"};
- private static final String DEFAULT_VALUE = VALUE_LIST[0];
-
- public ListSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(DEFAULT_VALUE);
- this.spinnerModelAdapter = new ListSpinnerModelAdapter(this.valueHolder, VALUE_LIST) {
- @Override
- protected PropertyChangeListener buildValueChangeListener() {
- return this.buildValueChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.valueHolder.getValue());
- this.spinnerModelAdapter.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.valueHolder.getValue());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.spinnerModelAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.spinnerModelAdapter.getValue());
-
- this.valueHolder.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.spinnerModelAdapter.getValue());
-
- this.eventFired = false;
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[0], this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((ListSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((ListSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
deleted file mode 100644
index be5d8e16db..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class NumberSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Number> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public NumberSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Number>(new Integer(0));
- this.spinnerModelAdapter = new NumberSpinnerModelAdapter(this.valueHolder, -33, 33, 1) {
- @Override
- protected PropertyChangeListener buildNumberChangeListener() {
- return this.buildNumberChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- this.spinnerModelAdapter.setValue(new Integer(5));
- assertTrue(this.eventFired);
- assertEquals(new Integer(5), this.valueHolder.getValue());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertEquals(new Integer(-33), this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Number> localValueHolder = (SimplePropertyValueModel<Number>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((NumberSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((NumberSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
- public void testNullInitialValue() {
- this.valueHolder = new SimplePropertyValueModel<Number>();
- this.spinnerModelAdapter = new NumberSpinnerModelAdapter(this.valueHolder, new Integer(-33), new Integer(33), new Integer(1), new Integer(0)) {
- @Override
- protected PropertyChangeListener buildNumberChangeListener() {
- return this.buildNumberChangeListener_();
- }
- };
-
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
-
- // ********** inner class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
deleted file mode 100644
index 4f55864415..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.DefaultListModel;
-import javax.swing.ListModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class ObjectListSelectionModelTests extends TestCase {
- private DefaultListModel listModel;
- private ObjectListSelectionModel selectionModel;
-
- public ObjectListSelectionModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listModel = this.buildListModel();
- this.selectionModel = this.buildSelectionModel(this.listModel);
- }
-
- private DefaultListModel buildListModel() {
- DefaultListModel lm = new DefaultListModel();
- lm.addElement("foo");
- lm.addElement("bar");
- lm.addElement("baz");
- return lm;
- }
-
- private ObjectListSelectionModel buildSelectionModel(ListModel lm) {
- return new ObjectListSelectionModel(lm);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testListDataListener() {
- this.selectionModel.addListSelectionListener(this.buildListSelectionListener());
- this.selectionModel.setSelectionInterval(0, 0);
- assertEquals("foo", this.selectionModel.selectedValue());
- this.listModel.set(0, "jar");
- assertEquals("jar", this.selectionModel.selectedValue());
- }
-
- public void testGetSelectedValue() {
- this.selectionModel.setSelectionInterval(0, 0);
- assertEquals("foo", this.selectionModel.selectedValue());
- }
-
- public void testGetSelectedValues() {
- this.selectionModel.setSelectionInterval(0, 0);
- this.selectionModel.addSelectionInterval(2, 2);
- assertEquals(2, this.selectionModel.selectedValues().length);
- assertTrue(ArrayTools.contains(this.selectionModel.selectedValues(), "foo"));
- assertTrue(ArrayTools.contains(this.selectionModel.selectedValues(), "baz"));
- }
-
- public void testSetSelectedValue() {
- this.selectionModel.setSelectedValue("foo");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(0, this.selectionModel.getMaxSelectionIndex());
- }
-
- public void testSetSelectedValues() {
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz"});
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(2, this.selectionModel.getMaxSelectionIndex());
- }
-
- public void testAddSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValue("jaz");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(5, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertFalse(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertFalse(this.selectionModel.isSelectedIndex(4));
- assertTrue(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testAddSelectedValues() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(4, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertTrue(this.selectionModel.isSelectedIndex(1));
- assertFalse(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertTrue(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testRemoveSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz", "jar"});
- this.selectionModel.removeSelectedValue("jar");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(2, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertTrue(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertFalse(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testRemoveSelectedValues() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz", "joo", "jar"});
- this.selectionModel.removeSelectedValues(new Object[] {"foo", "joo"});
- assertEquals(2, this.selectionModel.getMinSelectionIndex());
- assertEquals(4, this.selectionModel.getMaxSelectionIndex());
- assertFalse(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertTrue(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertTrue(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testGetAnchorSelectedValue() {
- this.selectionModel.setAnchorSelectionIndex(1);
- assertEquals("bar", this.selectionModel.getAnchorSelectedValue());
- }
-
- public void testGetLeadSelectedValue() {
- this.selectionModel.setSelectedValue("bar");
- assertEquals("bar", this.selectionModel.getLeadSelectedValue());
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz"});
- assertEquals("baz", this.selectionModel.getLeadSelectedValue());
- }
-
- public void testGetMinMaxSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertEquals("foo", this.selectionModel.getMinSelectedValue());
- assertEquals("jar", this.selectionModel.getMaxSelectedValue());
- }
-
- public void testValueIsSelected() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertTrue(this.selectionModel.valueIsSelected("foo"));
- assertTrue(this.selectionModel.valueIsSelected("bar"));
- assertTrue(this.selectionModel.valueIsSelected("jar"));
- assertFalse(this.selectionModel.valueIsSelected("baz"));
- }
-
- public void testHasListeners() throws Exception {
- ListSelectionListener listener = this.buildListSelectionListener();
- assertEquals(0, this.listModel.getListDataListeners().length);
- this.selectionModel.addListSelectionListener(listener);
- assertEquals(1, this.listModel.getListDataListeners().length);
- this.selectionModel.removeListSelectionListener(listener);
- assertEquals(0, this.listModel.getListDataListeners().length);
- }
-
- private ListSelectionListener buildListSelectionListener() {
- return new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- // do nothing for now...
- }
- };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
deleted file mode 100644
index eca1bee8dd..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeModel;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.PrimitiveListTreeModel;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class PrimitiveListTreeModelTests extends TestCase {
- TestModel testModel;
- private TreeModel treeModel;
-
- public PrimitiveListTreeModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testModel = this.buildTestModel();
- this.treeModel = this.buildTreeModel();
- }
-
- private TestModel buildTestModel() {
- return new TestModel();
- }
-
- private TreeModel buildTreeModel() {
- return new PrimitiveListTreeModel(this.buildListValueModel()) {
- @Override
- protected void primitiveChanged(int index, Object newValue) {
- if ( ! newValue.equals("")) {
- PrimitiveListTreeModelTests.this.testModel.replaceName(index, (String) newValue);
- }
- }
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListValueModel<?> buildListValueModel() {
- return new ListAspectAdapter<TestModel, String>(TestModel.NAMES_LIST, this.testModel) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.names();
- }
- @Override
- public String get(int index) {
- return this.subject.getName(index);
- }
- @Override
- public int size() {
- return this.subject.namesSize();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAddPrimitive() {
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {0}, new String[] {"foo"});
- }
- });
- this.testModel.addName("foo");
- }
-
- public void testRemovePrimitive() {
- this.testModel.addName("foo");
- this.testModel.addName("bar");
- this.testModel.addName("baz");
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {1}, new String[] {"bar"});
- }
- });
- String name = this.testModel.removeName(1);
- assertEquals("bar", name);
- }
-
- public void testReplacePrimitive() {
- this.testModel.addName("foo");
- this.testModel.addName("bar");
- this.testModel.addName("baz");
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesChanged(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {1}, new String[] {"jar"});
- }
- });
- String name = this.testModel.replaceName(1, "jar");
- assertEquals("bar", name);
- }
-
- void verifyTreeModelEvent(TreeModelEvent e, int[] expectedChildIndices, String[] expectedNames) {
- assertTrue(Arrays.equals(expectedChildIndices, e.getChildIndices()));
- Object[] actualChildren = e.getChildren();
- assertEquals(expectedNames.length, actualChildren.length);
- for (int i = 0; i < expectedNames.length; i++) {
- DefaultMutableTreeNode node = (DefaultMutableTreeNode) actualChildren[i];
- assertEquals(expectedNames[i], node.getUserObject());
- }
- assertEquals(1, e.getPath().length);
- assertEquals(this.treeModel.getRoot(), e.getPath()[0]);
- assertEquals(this.treeModel, e.getSource());
- }
-
-
-// ********** inner classes **********
-
- class TestModel extends AbstractModel {
- private final List<String> names;
- static final String NAMES_LIST = "names";
-
- TestModel() {
- super();
- this.names = new ArrayList<String>();
- }
-
- public ListIterator<String> names() {
- return new ReadOnlyListIterator<String>(this.names);
- }
- public int namesSize() {
- return this.names.size();
- }
- public String getName(int index) {
- return this.names.get(index);
- }
- public void addName(int index, String name) {
- this.addItemToList(index, name, this.names, NAMES_LIST);
- }
- public void addName(String name) {
- this.addName(this.namesSize(), name);
- }
- public void addNames(int index, List<String> list) {
- this.addItemsToList(index, this.names, list, NAMES_LIST);
- }
- public void addNames(List<String> list) {
- this.addNames(this.namesSize(), list);
- }
- public String removeName(int index) {
- return this.removeItemFromList(index, this.names, NAMES_LIST);
- }
- public List<String> removeNames(int index, int length) {
- return this.removeItemsFromList(index, length, this.names, NAMES_LIST);
- }
- public String replaceName(int index, String newName) {
- return this.setItemInList(index, newName, this.names, NAMES_LIST);
- }
- }
-
-
- public class TestTreeModelListener implements TreeModelListener {
- public void treeNodesChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesInserted(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesRemoved(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeStructureChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
deleted file mode 100644
index edd9e93504..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.ButtonModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class RadioButtonModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
-
- private ButtonModel redButtonModelAdapter;
- private ChangeListener redListener;
- boolean redEventFired;
-
- private ButtonModel greenButtonModelAdapter;
- private ChangeListener greenListener;
- boolean greenEventFired;
-
- private ButtonModel blueButtonModelAdapter;
- private ChangeListener blueListener;
- boolean blueEventFired;
-
-// private ButtonGroup buttonGroup; // DO NOT use a ButtonGroup
-
- private static final String RED = "red";
- private static final String GREEN = "green";
- private static final String BLUE = "blue";
-
- public RadioButtonModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(null);
-// buttonGroup = new ButtonGroup();
-
- this.redButtonModelAdapter = this.buildButtonModel(this.valueHolder, RED);
-// this.redButtonModelAdapter.setGroup(buttonGroup);
- this.redListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.redEventFired = true;
- }
- };
-
- this.greenButtonModelAdapter = this.buildButtonModel(this.valueHolder, GREEN);
-// this.greenButtonModelAdapter.setGroup(buttonGroup);
- this.greenListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.greenEventFired = true;
- }
- };
-
- this.blueButtonModelAdapter = this.buildButtonModel(this.valueHolder, BLUE);
-// this.blueButtonModelAdapter.setGroup(buttonGroup);
- this.blueListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.blueEventFired = true;
- }
- };
-
- this.clearFlags();
- }
-
- private ButtonModel buildButtonModel(WritablePropertyValueModel<Object> pvm, Object buttonValue) {
- return new RadioButtonModelAdapter(pvm, buttonValue) {
- @Override
- protected PropertyChangeListener buildBooleanChangeListener() {
- return this.buildBooleanChangeListener_();
- }
- };
- }
-
- private void listenToModelAdapters() {
- this.redButtonModelAdapter.addChangeListener(this.redListener);
- this.greenButtonModelAdapter.addChangeListener(this.greenListener);
- this.blueButtonModelAdapter.addChangeListener(this.blueListener);
- }
-
- private void clearFlags() {
- this.redEventFired = false;
- this.greenEventFired = false;
- this.blueEventFired = false;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetSelected() throws Exception {
- this.listenToModelAdapters();
-
- this.greenButtonModelAdapter.setSelected(true);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertFalse(this.blueEventFired);
- assertEquals(GREEN, this.valueHolder.getValue());
-
- this.clearFlags();
- this.blueButtonModelAdapter.setSelected(true);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertEquals(BLUE, this.valueHolder.getValue());
-
- this.clearFlags();
- this.redButtonModelAdapter.setSelected(true);
- assertTrue(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertEquals(RED, this.valueHolder.getValue());
- }
-
- public void testSetValue() throws Exception {
- this.listenToModelAdapters();
-
- this.greenButtonModelAdapter.setSelected(true);
-
- this.clearFlags();
- this.valueHolder.setValue(BLUE);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertTrue(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(RED);
- assertTrue(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertTrue(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
- }
-
- public void testDefaultValue() throws Exception {
- this.listenToModelAdapters();
-
- this.valueHolder.setValue(GREEN);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertTrue(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(null);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertFalse(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(BLUE);
- assertFalse(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertTrue(this.blueButtonModelAdapter.isSelected());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.redButtonModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
-
- this.redButtonModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
- }
-
- private void verifyHasNoListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ReflectionTools.getFieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ReflectionTools.getFieldValue(model, "listenerList");
- assertFalse(listenerList.getListenerList().length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
deleted file mode 100644
index 0b4ff59108..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-
-/**
- * Play around with a set of radio buttons.
- */
-@SuppressWarnings("nls")
-public class RadioButtonModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Object> colorHolder;
- private ButtonModel redButtonModel;
- private ButtonModel greenButtonModel;
- private ButtonModel blueButtonModel;
-
- public static void main(String[] args) throws Exception {
- new RadioButtonModelAdapterUITest().exec();
- }
-
- private RadioButtonModelAdapterUITest() {
- super();
- }
-
- private void exec() throws Exception {
- this.testModel = new TestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.colorHolder = this.buildColorHolder(this.testModelHolder);
- this.redButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.RED);
- this.greenButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.GREEN);
- this.blueButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.BLUE);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildColorHolder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Object>(subjectHolder, TestModel.COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setColor((String) value);
- }
- };
- }
-
- private ButtonModel buildRadioButtonModelAdapter(WritablePropertyValueModel<Object> colorPVM, String color) {
- return new RadioButtonModelAdapter(colorPVM, color);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setLocation(200, 200);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildRadioButtonPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildRadioButtonPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildRedRadioButton());
- taskListPanel.add(this.buildGreenRadioButton());
- taskListPanel.add(this.buildBlueRadioButton());
- return taskListPanel;
- }
-
- private JRadioButton buildRedRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("red");
- radioButton.setModel(this.redButtonModel);
- return radioButton;
- }
-
- private JRadioButton buildGreenRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("green");
- radioButton.setModel(this.greenButtonModel);
- return radioButton;
- }
-
- private JRadioButton buildBlueRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("blue");
- radioButton.setModel(this.blueButtonModel);
- return radioButton;
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetColorButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetColorButton() {
- return new JButton(this.buildResetColorAction());
- }
-
- private Action buildResetColorAction() {
- Action action = new AbstractAction("reset color") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.resetColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetColor() {
- this.testModel.setColor(TestModel.DEFAULT_COLOR);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println(this.testModel);
- }
-
-
- private static class TestModel extends AbstractModel {
- private String color;
- public static final String COLOR_PROPERTY = "color";
- public static final String RED = "red";
- public static final String GREEN = "green";
- public static final String BLUE = "blue";
- public static final String DEFAULT_COLOR = RED;
- public static final String[] VALID_COLORS = {
- RED,
- GREEN,
- BLUE
- };
-
- public TestModel() {
- this(DEFAULT_COLOR);
- }
- public TestModel(String color) {
- this.color = color;
- }
- public String getColor() {
- return this.color;
- }
- public void setColor(String color) {
- if ( ! ArrayTools.contains(VALID_COLORS, color)) {
- throw new IllegalArgumentException(color);
- }
- Object old = this.color;
- this.color = color;
- this.firePropertyChanged(COLOR_PROPERTY, old, color);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.color + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java
deleted file mode 100644
index 72cb1d2d31..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TableModelAdapterTests.PersonColumnAdapter;
-
-/**
- * Make it easy to test the table model adapter and
- * renderers without any editing allowed.
- */
-public class ReadOnlyTableModelAdapterUITest extends TableModelAdapterUITest {
-
- public static void main(String[] args) throws Exception {
- new ReadOnlyTableModelAdapterUITest().exec(args);
- }
-
- protected ReadOnlyTableModelAdapterUITest() {
- super();
- }
-
- @Override
- protected ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter() {
- @Override
- public boolean columnIsEditable(int index) {
- return false;
- }
- };
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
deleted file mode 100644
index 76a1c158f4..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.SpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public SpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(new Integer(0));
- this.spinnerModelAdapter = new SpinnerModelAdapter(this.valueHolder) {
- @Override
- protected PropertyChangeListener buildValueListener() {
- return this.buildValueListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- SpinnerModelAdapterTests.this.eventFired = true;
- assertEquals(SpinnerModelAdapterTests.this.spinnerModelAdapter, e.getSource());
- }
- });
- this.spinnerModelAdapter.setValue(new Integer(5));
- assertTrue(this.eventFired);
- assertEquals(new Integer(5), this.valueHolder.getValue());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- SpinnerModelAdapterTests.this.eventFired = true;
- assertEquals(SpinnerModelAdapterTests.this.spinnerModelAdapter, e.getSource());
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(Object adapter) throws Exception {
- Object delegate = ReflectionTools.getFieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ReflectionTools.executeMethod(delegate, "getChangeListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- Object delegate = ReflectionTools.getFieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ReflectionTools.executeMethod(delegate, "getChangeListeners");
- assertFalse(listeners.length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
deleted file mode 100644
index 26976caed9..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JSpinner;
-import javax.swing.SpinnerModel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of spinners.
- */
-@SuppressWarnings("nls")
-public class SpinnerModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
-
- private WritablePropertyValueModel<Object> birthDateHolder;
- private SpinnerModel birthDateSpinnerModel;
-
- private WritablePropertyValueModel<Number> ageHolder;
- private SpinnerModel ageSpinnerModel;
-
- private WritablePropertyValueModel<Object> eyeColorHolder;
- private SpinnerModel eyeColorSpinnerModel;
-
-
- public static void main(String[] args) throws Exception {
- new SpinnerModelAdapterUITest().exec();
- }
-
- private SpinnerModelAdapterUITest() {
- super();
- }
-
- private void exec() throws Exception {
- this.testModel = new TestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
-
- this.birthDateHolder = this.buildBirthDateHolder(this.testModelHolder);
- this.birthDateSpinnerModel = this.buildBirthDateSpinnerModel(this.birthDateHolder);
-
- this.ageHolder = this.buildAgeHolder(this.testModelHolder);
- this.ageSpinnerModel = this.buildAgeSpinnerModel(this.ageHolder);
-
- this.eyeColorHolder = this.buildEyeColorHolder(this.testModelHolder);
- this.eyeColorSpinnerModel = this.buildEyeColorSpinnerModel(this.eyeColorHolder);
-
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.BIRTH_DATE_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
- private SpinnerModel buildBirthDateSpinnerModel(WritablePropertyValueModel<Object> valueHolder) {
- return new DateSpinnerModelAdapter(valueHolder);
- }
-
- private WritablePropertyValueModel<Number> buildAgeHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Number>(vm, TestModel.AGE_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getAge());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setAge(value.intValue());
- }
- };
- }
-
- private SpinnerModel buildAgeSpinnerModel(WritablePropertyValueModel<Number> valueHolder) {
- return new NumberSpinnerModelAdapter(valueHolder, valueHolder.getValue().intValue(), TestModel.MIN_AGE, TestModel.MAX_AGE, 1);
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.EYE_COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
- private SpinnerModel buildEyeColorSpinnerModel(WritablePropertyValueModel<Object> valueHolder) {
- return new ListSpinnerModelAdapter(valueHolder, TestModel.VALID_EYE_COLORS);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(600, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildSpinnerPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildSpinnerPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildBirthDateSpinner());
- taskListPanel.add(this.buildAgeSpinner());
- taskListPanel.add(this.buildEyeColorSpinner());
- return taskListPanel;
- }
-
- private JSpinner buildBirthDateSpinner() {
- return new JSpinner(this.birthDateSpinnerModel);
- }
-
- private JSpinner buildAgeSpinner() {
- return new JSpinner(this.ageSpinnerModel);
- }
-
- private JSpinner buildEyeColorSpinner() {
- return new JSpinner(this.eyeColorSpinnerModel);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetModelButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetModelButton() {
- return new JButton(this.buildResetModelAction());
- }
-
- private Action buildResetModelAction() {
- Action action = new AbstractAction("reset model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.resetModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetModel() {
- this.testModel.setBirthDate(TestModel.DEFAULT_BIRTH_DATE);
- this.testModel.setEyeColor(TestModel.DEFAULT_EYE_COLOR);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("birth date: " + this.testModel.getBirthDate());
- System.out.println("age: " + this.testModel.getAge());
- System.out.println("eyes: " + this.testModel.getEyeColor());
- }
-
-
- static class TestModel extends AbstractModel {
- private Calendar birthCal = Calendar.getInstance();
- // "virtual" properties
- public static final String BIRTH_DATE_PROPERTY = "birthDate";
- public static final String AGE_PROPERTY = "age";
- public static final Date DEFAULT_BIRTH_DATE = new Date();
- public static final int DEFAULT_AGE = 0;
- public static final int MIN_AGE = 0;
- public static final int MAX_AGE = 150;
- private String eyeColor;
- public static final String EYE_COLOR_PROPERTY = "eyeColor";
- public static final String[] VALID_EYE_COLORS = {"blue", "brown", "green", "hazel", "pink"};
- public static final String DEFAULT_EYE_COLOR = VALID_EYE_COLORS[3];
-
- TestModel() {
- this(DEFAULT_BIRTH_DATE, DEFAULT_EYE_COLOR);
- }
- public TestModel(Date birthDate, String eyeColor) {
- this.setBirthDate(birthDate);
- this.setEyeColor(eyeColor);
- }
- public Date getBirthDate() {
- return (Date) this.birthCal.getTime().clone();
- }
- public void setBirthDate(Date birthDate) {
- Date oldBirthDate = this.getBirthDate();
- int oldAge = this.getAge();
- this.birthCal.setTimeInMillis(birthDate.getTime());
- int newAge = this.getAge();
- if (newAge < MIN_AGE || newAge > MAX_AGE) {
- throw new IllegalArgumentException(birthDate.toString());
- }
- this.firePropertyChanged(BIRTH_DATE_PROPERTY, oldBirthDate, this.getBirthDate());
- this.firePropertyChanged(AGE_PROPERTY, oldAge, newAge);
- }
- public int getAge() {
- Calendar currentCal = Calendar.getInstance();
- int age = currentCal.get(Calendar.YEAR) - this.birthCal.get(Calendar.YEAR);
- if (currentCal.get(Calendar.MONTH) < this.birthCal.get(Calendar.MONTH)) {
- age--;
- } else if (currentCal.get(Calendar.MONTH) == this.birthCal.get(Calendar.MONTH)) {
- if (currentCal.get(Calendar.DAY_OF_MONTH) < this.birthCal.get(Calendar.DAY_OF_MONTH)) {
- age--;
- }
- }
- return age;
- }
- public void setAge(int newAge) {
- if (newAge < MIN_AGE || newAge > MAX_AGE) {
- throw new IllegalArgumentException(String.valueOf(newAge));
- }
-
- int oldAge = this.getAge();
- int delta = newAge - oldAge;
-
- Calendar newBirthCal = Calendar.getInstance();
- newBirthCal.setTimeInMillis(this.birthCal.getTime().getTime());
- // if the age increased, the birth date must be "decreased"; and vice versa
- newBirthCal.set(Calendar.YEAR, newBirthCal.get(Calendar.YEAR) - delta);
- this.setBirthDate(newBirthCal.getTime());
- }
- public String getEyeColor() {
- return this.eyeColor;
- }
- public void setEyeColor(String eyeColor) {
- if ( ! ArrayTools.contains(VALID_EYE_COLORS, eyeColor)) {
- throw new IllegalArgumentException(eyeColor);
- }
- Object old = this.eyeColor;
- this.eyeColor = eyeColor;
- this.firePropertyChanged(EYE_COLOR_PROPERTY, old, eyeColor);
- }
- @Override
- public String toString() {
- return "TestModel(birth: " + this.getBirthDate() + " - eyes: " + this.eyeColor + ")";
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
deleted file mode 100644
index d7125a42ff..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class TableModelAdapterTests extends TestCase {
- private Crowd crowd;
- TableModelEvent event;
-
- public TableModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.crowd = this.buildCrowd();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetRowCount() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- assertEquals(0, tableModelAdapter.getRowCount());
- // we need to add a listener to wake up the adapter
- tableModelAdapter.addTableModelListener(this.buildTableModelListener());
- assertEquals(this.crowd.peopleSize(), tableModelAdapter.getRowCount());
- }
-
- public void testGetColumnCount() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- assertEquals(PersonColumnAdapter.COLUMN_COUNT, tableModelAdapter.getColumnCount());
- }
-
- public void testGetValueAt() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- tableModelAdapter.addTableModelListener(this.buildTableModelListener());
-
- List<String> sortedNames = this.sortedNames();
- for (int i = 0; i < this.crowd.peopleSize(); i++) {
- assertEquals(sortedNames.get(i), tableModelAdapter.getValueAt(i, PersonColumnAdapter.NAME_COLUMN));
- }
- }
-
- public void testSetValueAt() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(new TestTableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- TableModelAdapterTests.this.event = e;
- }
- });
-
- Person person = this.crowd.personNamed("Gollum");
- assertEquals(Person.EYE_COLOR_BLUE, person.getEyeColor());
- assertFalse(person.isEvil());
- assertEquals(0, person.getRank());
-
- for (int i = 0; i < tableModelAdapter.getRowCount(); i++) {
- if (tableModelAdapter.getValueAt(i, PersonColumnAdapter.NAME_COLUMN).equals("Gollum")) {
- tableModelAdapter.setValueAt(Person.EYE_COLOR_HAZEL, i, PersonColumnAdapter.EYE_COLOR_COLUMN);
- tableModelAdapter.setValueAt(Boolean.TRUE, i, PersonColumnAdapter.EVIL_COLUMN);
- tableModelAdapter.setValueAt(new Integer(-1), i, PersonColumnAdapter.RANK_COLUMN);
- break;
- }
- }
- assertNotNull(this.event);
- assertEquals(Person.EYE_COLOR_HAZEL, person.getEyeColor());
- assertTrue(person.isEvil());
- assertEquals(-1, person.getRank());
- }
-
- public void testAddRow() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // add a person to the end of the list so we only trigger one event
- this.crowd.addPerson("Zzzzz");
- assertNotNull(this.event);
- assertEquals(TableModelEvent.INSERT, this.event.getType());
- assertEquals(TableModelEvent.ALL_COLUMNS, this.event.getColumn());
- }
-
- public void testRemoveRow() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // removing a person should only trigger one event, since a re-sort is not needed
- this.crowd.removePerson(this.crowd.personNamed("Gollum"));
- assertNotNull(this.event);
- assertEquals(TableModelEvent.DELETE, this.event.getType());
- assertEquals(TableModelEvent.ALL_COLUMNS, this.event.getColumn());
- }
-
- public void testChangeCell() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // add a person to the end of the list so we only trigger one event
- Person person = this.crowd.personNamed("Gollum");
- person.setEvil(true);
- assertNotNull(this.event);
- assertEquals(TableModelEvent.UPDATE, this.event.getType());
- assertEquals(PersonColumnAdapter.EVIL_COLUMN, this.event.getColumn());
- }
-
- public void testLazyListListener() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- TableModelListener listener = this.buildTableModelListener();
- assertTrue(this.crowd.hasNoCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- tableModelAdapter.addTableModelListener(listener);
- assertTrue(this.crowd.hasAnyCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- tableModelAdapter.removeTableModelListener(listener);
- assertTrue(this.crowd.hasNoCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- }
-
- public void testLazyCellListener() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- TableModelListener listener = this.buildTableModelListener();
- Person person = this.crowd.personNamed("Gollum");
- assertTrue(person.hasNoPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.RANK_PROPERTY));
-
- tableModelAdapter.addTableModelListener(listener);
- assertTrue(person.hasAnyPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.RANK_PROPERTY));
-
- tableModelAdapter.removeTableModelListener(listener);
- assertTrue(person.hasNoPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.RANK_PROPERTY));
- }
-
- private TableModelAdapter<Person> buildTableModelAdapter() {
- return new TableModelAdapter<Person>(this.buildSortedPeopleAdapter(), this.buildColumnAdapter()) {
- @Override
- protected PropertyChangeListener buildCellListener() {
- return this.buildCellListener_();
- }
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListValueModel<Person> buildSortedPeopleAdapter() {
- return new SortedListValueModelAdapter<Person>(this.buildPeopleAdapter());
- }
-
- private CollectionValueModel<Person> buildPeopleAdapter() {
- return new CollectionAspectAdapter<Crowd, Person>(Crowd.PEOPLE_COLLECTION, this.crowd) {
- @Override
- protected Iterator<Person> iterator_() {
- return this.subject.people();
- }
- @Override
- protected int size_() {
- return this.subject.peopleSize();
- }
- };
- }
-
- private Crowd buildCrowd() {
- Crowd result = new Crowd();
- result.addPerson("Bilbo");
- result.addPerson("Gollum");
- result.addPerson("Frodo");
- result.addPerson("Samwise");
- return result;
- }
-
- private ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter();
- }
-
- private TableModelListener buildTableModelListener() {
- return new TestTableModelListener();
- }
-
- private List<String> sortedNames() {
- return new ArrayList<String>(CollectionTools.sortedSet(this.crowd.peopleNames()));
- }
-
- private TableModelListener buildSingleEventListener() {
- return new TestTableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- // we expect only a single event
- if (TableModelAdapterTests.this.event == null) {
- TableModelAdapterTests.this.event = e;
- } else {
- fail("unexpected event");
- }
- }
- };
- }
-
-
- // ********** classes **********
-
- public static class PersonColumnAdapter implements ColumnAdapter {
- public static final int COLUMN_COUNT = 7;
-
- public static final int NAME_COLUMN = 0;
- public static final int BIRTH_DATE_COLUMN = 1;
- public static final int GONE_WEST_DATE_COLUMN = 2;
- public static final int EYE_COLOR_COLUMN = 3;
- public static final int EVIL_COLUMN = 4;
- public static final int RANK_COLUMN = 5;
- public static final int ADVENTURE_COUNT_COLUMN = 6;
-
- private static final String[] COLUMN_NAMES = new String[] {
- "Name",
- "Birth",
- "Gone West",
- "Eyes",
- "Evil",
- "Rank",
- "Adventures"
- };
-
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int index) {
- return COLUMN_NAMES[index];
- }
-
- public Class<?> columnClass(int index) {
- switch (index) {
- case NAME_COLUMN: return Object.class;
- case BIRTH_DATE_COLUMN: return Date.class;
- case GONE_WEST_DATE_COLUMN: return Date.class;
- case EYE_COLOR_COLUMN: return Object.class;
- case EVIL_COLUMN: return Boolean.class;
- case RANK_COLUMN: return Integer.class;
- case ADVENTURE_COUNT_COLUMN:return Integer.class;
- default: return Object.class;
- }
- }
-
- public boolean columnIsEditable(int index) {
- return index != NAME_COLUMN;
- }
-
- public WritablePropertyValueModel<Object>[] cellModels(Object subject) {
- Person person = (Person) subject;
- @SuppressWarnings("unchecked")
- WritablePropertyValueModel<Object>[] result = new WritablePropertyValueModel[COLUMN_COUNT];
-
- result[NAME_COLUMN] = this.buildNameAdapter(person);
- result[BIRTH_DATE_COLUMN] = this.buildBirthDateAdapter(person);
- result[GONE_WEST_DATE_COLUMN] = this.buildGoneWestDateAdapter(person);
- result[EYE_COLOR_COLUMN] = this.buildEyeColorAdapter(person);
- result[EVIL_COLUMN] = this.buildEvilAdapter(person);
- result[RANK_COLUMN] = this.buildRankAdapter(person);
- result[ADVENTURE_COUNT_COLUMN] = this.buildAdventureCountAdapter(person);
-
- return result;
- }
-
- private WritablePropertyValueModel<Object> buildNameAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.NAME_PROPERTY, person) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setName((String) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.BIRTH_DATE_PROPERTY, person) {
- @Override
- protected Date buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildGoneWestDateAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.GONE_WEST_DATE_PROPERTY, person) {
- @Override
- protected Date buildValue_() {
- return this.subject.getGoneWestDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setGoneWestDate((Date) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.EYE_COLOR_PROPERTY, person) {
- @Override
- protected String buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildEvilAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.EVIL_PROPERTY, person) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isEvil());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEvil(((Boolean)value).booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildRankAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.RANK_PROPERTY, person) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getRank());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setRank(((Integer) value).intValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildAdventureCountAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.ADVENTURE_COUNT_PROPERTY, person) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getAdventureCount());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setAdventureCount(((Integer) value).intValue());
- }
- };
- }
-
- }
-
-
- public static class Crowd extends AbstractModel {
- private final Collection<Person> people;
- public static final String PEOPLE_COLLECTION = "people";
-
- public Crowd() {
- super();
- this.people = new ArrayList<Person>();
- }
-
-
- public Iterator<Person> people() {
- return new CloneIterator<Person>(this.people) {
- @Override
- protected void remove(Person person) {
- Crowd.this.removePerson(person);
- }
- };
- }
-
- public int peopleSize() {
- return this.people.size();
- }
-
- public Person addPerson(String name) {
- this.checkPersonName(name);
- return this.addPerson(new Person(this, name));
- }
-
- private Person addPerson(Person person) {
- this.addItemToCollection(person, this.people, PEOPLE_COLLECTION);
- return person;
- }
-
- public void removePerson(Person person) {
- this.removeItemFromCollection(person, this.people, PEOPLE_COLLECTION);
- }
-
- public void removePeople(Collection<Person> persons) {
- this.removeItemsFromCollection(persons, this.people, PEOPLE_COLLECTION);
- }
-
- public void removePeople(Iterator<Person> persons) {
- this.removeItemsFromCollection(persons, this.people, PEOPLE_COLLECTION);
- }
-
- void checkPersonName(String personName) {
- if (personName == null) {
- throw new NullPointerException();
- }
- if (CollectionTools.contains(this.peopleNames(), personName)) {
- throw new IllegalArgumentException(personName);
- }
- }
-
- public Iterator<String> peopleNames() {
- return new TransformationIterator<Person, String>(this.people.iterator()) {
- @Override
- protected String transform(Person person) {
- return person.getName();
- }
- };
- }
-
- public Person personNamed(String name) {
- for (Iterator<Person> stream = this.people.iterator(); stream.hasNext(); ) {
- Person person = stream.next();
- if (person.getName().equals(name)) {
- return person;
- }
- }
- return null;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, String.valueOf(this.people.size()) + " people");
- }
-
- }
-
-
- public static class Person extends AbstractModel implements Comparable<Person> {
- private Crowd crowd;
- private String name;
- public static final String NAME_PROPERTY= "name";
- private Date birthDate;
- public static final String BIRTH_DATE_PROPERTY= "birthDate";
- private Date goneWestDate;
- public static final String GONE_WEST_DATE_PROPERTY= "goneWestDate";
- private String eyeColor;
- public static final String EYE_COLOR_PROPERTY= "eyeColor";
- public static final String EYE_COLOR_BLUE = "blue";
- public static final String EYE_COLOR_GREEN = "green";
- public static final String EYE_COLOR_BROWN = "brown";
- public static final String EYE_COLOR_HAZEL = "hazel";
- public static final String EYE_COLOR_PINK = "pink";
- private static Collection<String> validEyeColors;
- public static final String DEFAULT_EYE_COLOR = EYE_COLOR_BLUE;
- private boolean evil;
- public static final String EVIL_PROPERTY= "evil";
- private int rank;
- public static final String RANK_PROPERTY= "rank";
- private int adventureCount;
- public static final String ADVENTURE_COUNT_PROPERTY= "adventureCount";
-
- Person(Crowd crowd, String name) {
- super();
- this.crowd = crowd;
- this.name = name;
- this.birthDate = new Date();
- Calendar c = Calendar.getInstance();
- c.add(Calendar.YEAR, 250);
- this.goneWestDate = new Date(c.getTimeInMillis());
- this.eyeColor = DEFAULT_EYE_COLOR;
- this.evil = false;
- this.rank = 0;
- this.adventureCount = 0;
- }
-
- public static Collection<String> getValidEyeColors() {
- if (validEyeColors == null) {
- validEyeColors = buildValidEyeColors();
- }
- return validEyeColors;
- }
-
- private static Collection<String> buildValidEyeColors() {
- Collection<String> result = new ArrayList<String>();
- result.add(EYE_COLOR_BLUE);
- result.add(EYE_COLOR_GREEN);
- result.add(EYE_COLOR_BROWN);
- result.add(EYE_COLOR_HAZEL);
- result.add(EYE_COLOR_PINK);
- return result;
- }
-
- public Crowd getCrowd() {
- return this.crowd;
- }
-
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- this.crowd.checkPersonName(name);
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Date getBirthDate() {
- return this.birthDate;
- }
- public void setBirthDate(Date birthDate) {
- Object old = this.birthDate;
- this.birthDate = birthDate;
- this.firePropertyChanged(BIRTH_DATE_PROPERTY, old, birthDate);
- }
-
- public Date getGoneWestDate() {
- return this.goneWestDate;
- }
- public void setGoneWestDate(Date goneWestDate) {
- Object old = this.goneWestDate;
- this.goneWestDate = goneWestDate;
- this.firePropertyChanged(GONE_WEST_DATE_PROPERTY, old, goneWestDate);
- }
-
- public String getEyeColor() {
- return this.eyeColor;
- }
- public void setEyeColor(String eyeColor) {
- if (! getValidEyeColors().contains(eyeColor)) {
- throw new IllegalArgumentException(eyeColor);
- }
- Object old = this.eyeColor;
- this.eyeColor = eyeColor;
- this.firePropertyChanged(EYE_COLOR_PROPERTY, old, eyeColor);
- }
-
- public boolean isEvil() {
- return this.evil;
- }
- public void setEvil(boolean evil) {
- boolean old = this.evil;
- this.evil = evil;
- this.firePropertyChanged(EVIL_PROPERTY, old, evil);
- }
-
- public int getRank() {
- return this.rank;
- }
- public void setRank(int rank) {
- int old = this.rank;
- this.rank = rank;
- this.firePropertyChanged(RANK_PROPERTY, old, rank);
- }
-
- public int getAdventureCount() {
- return this.adventureCount;
- }
- public void setAdventureCount(int adventureCount) {
- int old = this.adventureCount;
- this.adventureCount = adventureCount;
- this.firePropertyChanged(ADVENTURE_COUNT_PROPERTY, old, adventureCount);
- }
-
- public int compareTo(Person p) {
- return this.name.compareToIgnoreCase(p.name);
- }
-
- @Override
- public String toString() {
- return this.name +
- "\tborn: " + DateFormat.getDateInstance().format(this.birthDate) +
- "\tgone west: " + DateFormat.getDateInstance().format(this.goneWestDate) +
- "\teyes: " + this.eyeColor +
- "\tevil: " + this.evil +
- "\trank: " + this.rank +
- "\tadventures: " + this.adventureCount
- ;
- }
-
- }
-
-
- private class TestTableModelListener implements TableModelListener {
- TestTableModelListener() {
- super();
- }
- public void tableChanged(TableModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
deleted file mode 100644
index 07a614cb44..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
+++ /dev/null
@@ -1,733 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSpinner;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListSelectionModel;
-import javax.swing.SpinnerModel;
-import javax.swing.UIManager;
-import javax.swing.WindowConstants;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-import javax.swing.text.Document;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.common.utility.internal.swing.CheckBoxTableCellRenderer;
-import org.eclipse.jpt.common.utility.internal.swing.ComboBoxTableCellRenderer;
-import org.eclipse.jpt.common.utility.internal.swing.SpinnerTableCellRenderer;
-import org.eclipse.jpt.common.utility.internal.swing.TableCellEditorAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TableModelAdapterTests.Crowd;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TableModelAdapterTests.Person;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TableModelAdapterTests.PersonColumnAdapter;
-
-/**
- * an example UI for testing the TableModelAdapter
- * "name" column is read-only text field
- * "birth date" column is date text field
- * "gone west date" column is date spinner
- * "eye color" column is combo-box
- * "evil" column is check box
- * "rank" column is number text field
- * "adventure count" column is number spinner
- *
- * Note that the table model and row selection model share the same
- * list value model (the sorted people adapter)
- */
-@SuppressWarnings("nls")
-public class TableModelAdapterUITest {
- private SimpleCollectionValueModel<Object> eyeColorsHolder; // Object because it adapts to a combo-box
- private WritablePropertyValueModel<Crowd> crowdHolder;
- private WritablePropertyValueModel<Person> selectedPersonHolder;
- private ListValueModel<Person> sortedPeopleAdapter;
- private TableModel tableModel;
- private ObjectListSelectionModel rowSelectionModel;
- private Action removeAction;
- private Action renameAction;
-
- public static void main(String[] args) throws Exception {
- new TableModelAdapterUITest().exec(args);
- }
-
- protected TableModelAdapterUITest() {
- super();
- }
-
- protected void exec(@SuppressWarnings("unused") String[] args) throws Exception {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- this.eyeColorsHolder = this. buildEyeColorCollectionHolder();
- this.crowdHolder = this.buildCrowdHolder();
- this.selectedPersonHolder = this.buildSelectedPersonHolder();
- this.sortedPeopleAdapter = this.buildSortedPeopleAdapter();
- this.tableModel = this.buildTableModel();
- this.rowSelectionModel = this.buildRowSelectionModel();
- this.openWindow();
- }
-
- private SimpleCollectionValueModel<Object> buildEyeColorCollectionHolder() {
- return new SimpleCollectionValueModel<Object>(new ArrayList<Object>(Person.getValidEyeColors()));
- }
-
- private WritablePropertyValueModel<Crowd> buildCrowdHolder() {
- return new SimplePropertyValueModel<Crowd>(this.buildCrowd());
- }
-
- private Crowd buildCrowd() {
- Crowd crowd = new Crowd();
-
- Person p = crowd.addPerson("Bilbo");
- p.setEyeColor(Person.EYE_COLOR_BROWN);
- p.setRank(22);
- p.setAdventureCount(1);
-
- p = crowd.addPerson("Gollum");
- p.setEyeColor(Person.EYE_COLOR_PINK);
- p.setEvil(true);
- p.setRank(2);
- p.setAdventureCount(50);
-
- p = crowd.addPerson("Frodo");
- p.setEyeColor(Person.EYE_COLOR_BLUE);
- p.setRank(34);
- p.setAdventureCount(1);
-
- p = crowd.addPerson("Samwise");
- p.setEyeColor(Person.EYE_COLOR_GREEN);
- p.setRank(19);
- p.setAdventureCount(1);
-
- return crowd;
- }
-
- private WritablePropertyValueModel<Person> buildSelectedPersonHolder() {
- return new SimplePropertyValueModel<Person>();
- }
-
- private ListValueModel<Person> buildSortedPeopleAdapter() {
- return new SortedListValueModelWrapper<Person>(this.buildPeopleNameAdapter());
- }
-
- // the list will need to be re-sorted if a name changes
- private ListValueModel<Person> buildPeopleNameAdapter() {
- return new ItemPropertyListValueModelAdapter<Person>(this.buildPeopleAdapter(), Person.NAME_PROPERTY);
- }
-
- private CollectionValueModel<Person> buildPeopleAdapter() {
- return new CollectionAspectAdapter<Crowd, Person>(this.crowdHolder, Crowd.PEOPLE_COLLECTION) {
- @Override
- protected Iterator<Person> iterator_() {
- return this.subject.people();
- }
- @Override
- protected int size_() {
- return this.subject.peopleSize();
- }
- };
- }
-
- private TableModel buildTableModel() {
- return new TableModelAdapter<Person>(this.sortedPeopleAdapter, this.buildColumnAdapter());
- }
-
- protected ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter();
- }
-
- private ObjectListSelectionModel buildRowSelectionModel() {
- ObjectListSelectionModel rsm = new ObjectListSelectionModel(new ListModelAdapter(this.sortedPeopleAdapter));
- rsm.addListSelectionListener(this.buildRowSelectionListener());
- rsm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- return rsm;
- }
-
- private ListSelectionListener buildRowSelectionListener() {
- return new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()) {
- return;
- }
- TableModelAdapterUITest.this.rowSelectionChanged(e);
- }
- };
- }
-
- void rowSelectionChanged(@SuppressWarnings("unused") ListSelectionEvent event) {
- Person selection = (Person) this.rowSelectionModel.selectedValue();
- this.selectedPersonHolder.setValue(selection);
- boolean personSelected = (selection != null);
- this.removeAction.setEnabled(personSelected);
- this.renameAction.setEnabled(personSelected);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getSimpleName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setLocation(200, 200);
- window.setSize(600, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTablePane(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTablePane() {
- return new JScrollPane(this.buildTable());
- }
-
- private JTable buildTable() {
- JTable table = new JTable(this.tableModel);
- table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); // see Java bug 5007652
- table.setSelectionModel(this.rowSelectionModel);
- table.setDoubleBuffered(true);
- table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
- int rowHeight = 20; // start with minimum of 20
-
- // gone west column (spinner)
- TableColumn column = table.getColumnModel().getColumn(PersonColumnAdapter.GONE_WEST_DATE_COLUMN);
- SpinnerTableCellRenderer spinnerRenderer = this.buildDateSpinnerRenderer();
- column.setCellRenderer(spinnerRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildDateSpinnerRenderer()));
- rowHeight = Math.max(rowHeight, spinnerRenderer.preferredHeight());
-
- // eye color column (combo-box)
- // the jdk combo-box renderer looks like a text field
- // until the user starts an edit - use a custom one
- column = table.getColumnModel().getColumn(PersonColumnAdapter.EYE_COLOR_COLUMN);
- ComboBoxTableCellRenderer eyeColorRenderer = this.buildEyeColorComboBoxRenderer();
- column.setCellRenderer(eyeColorRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildEyeColorComboBoxRenderer()));
- rowHeight = Math.max(rowHeight, eyeColorRenderer.preferredHeight());
-
- // evil (check box)
- // the jdk check box renderer and editor suck - use a custom ones
- column = table.getColumnModel().getColumn(PersonColumnAdapter.EVIL_COLUMN);
- CheckBoxTableCellRenderer evilRenderer = new CheckBoxTableCellRenderer();
- column.setCellRenderer(evilRenderer);
- column.setCellEditor(new TableCellEditorAdapter(new CheckBoxTableCellRenderer()));
- rowHeight = Math.max(rowHeight, evilRenderer.preferredHeight());
-
- // adventure count column (spinner)
- column = table.getColumnModel().getColumn(PersonColumnAdapter.ADVENTURE_COUNT_COLUMN);
- spinnerRenderer = this.buildNumberSpinnerRenderer();
- column.setCellRenderer(spinnerRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildNumberSpinnerRenderer()));
- rowHeight = Math.max(rowHeight, spinnerRenderer.preferredHeight());
-
- table.setRowHeight(rowHeight);
- return table;
- }
-
- private SpinnerTableCellRenderer buildDateSpinnerRenderer() {
- return new SpinnerTableCellRenderer(new DateSpinnerModelAdapter(new SimplePropertyValueModel<Object>()));
- }
-
- private SpinnerTableCellRenderer buildNumberSpinnerRenderer() {
- return new SpinnerTableCellRenderer(new NumberSpinnerModelAdapter(new SimplePropertyValueModel<Number>()));
- }
-
- private ComboBoxTableCellRenderer buildEyeColorComboBoxRenderer() {
- return new ComboBoxTableCellRenderer(this.buildReadOnlyEyeColorComboBoxModel(), this.buildEyeColorRenderer());
- }
-
- private ComboBoxModel buildReadOnlyEyeColorComboBoxModel() {
- return new ComboBoxModelAdapter(this.eyeColorsHolder, new SimplePropertyValueModel<Object>());
- }
-
- private ListCellRenderer buildEyeColorRenderer() {
- return new EyeColorRenderer();
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(0, 1));
- controlPanel.add(this.buildButtonPanel());
- controlPanel.add(this.buildPersonPanel());
- return controlPanel;
- }
-
- private Component buildButtonPanel() {
- JPanel buttonPanel = new JPanel(new GridLayout(1, 0));
- buttonPanel.add(this.buildAddButton());
- buttonPanel.add(this.buildRemoveButton());
- buttonPanel.add(this.buildRenameButton());
- buttonPanel.add(this.buildAddEyeColorButton());
- buttonPanel.add(this.buildPrintButton());
- buttonPanel.add(this.buildResetButton());
- return buttonPanel;
- }
-
- private Component buildPersonPanel() {
- JPanel personPanel = new JPanel(new GridLayout(1, 0));
- personPanel.add(this.buildNameTextField());
- personPanel.add(this.buildBirthDateSpinner());
- personPanel.add(this.buildGoneWestDateSpinner());
- personPanel.add(this.buildEyeColorComboBox());
- personPanel.add(this.buildEvilCheckBox());
- personPanel.add(this.buildRankSpinner());
- personPanel.add(this.buildAdventureCountSpinner());
- return personPanel;
- }
-
-
- // ********** add button **********
-
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.addPerson();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addPerson() {
- String name = this.getNameFromUser();
- if (name != null) {
- this.setSelectedPerson(this.crowd().addPerson(name));
- }
- }
-
-
- // ********** remove button **********
-
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- this.removeAction = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.removePerson();
- }
- };
- this.removeAction.setEnabled(false);
- return this.removeAction;
- }
-
- void removePerson() {
- Person person = this.selectedPerson();
- if (person != null) {
- this.crowd().removePerson(person);
- }
- }
-
-
- // ********** rename button **********
-
- private JButton buildRenameButton() {
- return new JButton(this.buildRenameAction());
- }
-
- private Action buildRenameAction() {
- this.renameAction = new AbstractAction("rename") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.renamePerson();
- }
- };
- this.renameAction.setEnabled(false);
- return this.renameAction;
- }
-
- void renamePerson() {
- Person person = this.selectedPerson();
- if (person != null) {
- String name = this.promptUserForName(person.getName());
- if (name != null) {
- person.setName(name);
- this.setSelectedPerson(person);
- }
- }
- }
-
-
- // ********** add eye color button **********
-
- private JButton buildAddEyeColorButton() {
- return new JButton(this.buildAddEyeColorAction());
- }
-
- private Action buildAddEyeColorAction() {
- Action action = new AbstractAction("add eye color") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.addEyeColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addEyeColor() {
- String color = this.promptUserForEyeColor();
- if (color != null) {
- this.eyeColorsHolder.add(color);
- }
- }
-
- private String promptUserForEyeColor() {
- while (true) {
- String eyeColor = JOptionPane.showInputDialog("Eye Color");
- if (eyeColor == null) {
- return null; // user pressed <Cancel>
- }
- if ((eyeColor.length() == 0)) {
- JOptionPane.showMessageDialog(null, "The eye color is required.", "Invalid Eye Color", JOptionPane.ERROR_MESSAGE);
- } else if (CollectionTools.contains(this.eyeColorsHolder.iterator(), eyeColor)) {
- JOptionPane.showMessageDialog(null, "The eye color already exists.", "Invalid Eye Color", JOptionPane.ERROR_MESSAGE);
- } else {
- return eyeColor;
- }
- }
- }
-
-
- // ********** print button **********
-
- private JButton buildPrintButton() {
- return new JButton(this.buildPrintAction());
- }
-
- private Action buildPrintAction() {
- Action action = new AbstractAction("print") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.printCrowd();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printCrowd() {
- System.out.println(this.crowd());
- for (Iterator<Person> stream = this.crowd().people(); stream.hasNext(); ) {
- System.out.println("\t" + stream.next());
- }
- }
-
-
- // ********** reset button **********
-
- private JButton buildResetButton() {
- return new JButton(this.buildResetAction());
- }
-
- private Action buildResetAction() {
- Action action = new AbstractAction("reset") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.reset();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void reset() {
- this.crowdHolder.setValue(this.buildCrowd());
- }
-
-
- // ********** new name dialog **********
-
- private String getNameFromUser() {
- return this.promptUserForName(null);
- }
-
- private String promptUserForName(@SuppressWarnings("unused") String originalName) {
- while (true) {
- String name = JOptionPane.showInputDialog("Person Name");
- if (name == null) {
- return null; // user pressed <Cancel>
- }
- if ((name.length() == 0)) {
- JOptionPane.showMessageDialog(null, "The name is required.", "Invalid Name", JOptionPane.ERROR_MESSAGE);
- } else if (CollectionTools.contains(this.crowd().peopleNames(), name)) {
- JOptionPane.showMessageDialog(null, "The name already exists.", "Invalid Name", JOptionPane.ERROR_MESSAGE);
- } else {
- return name;
- }
- }
- }
-
-
- // ********** name text field **********
-
- private Component buildNameTextField() {
- JTextField textField = new JTextField(this.buildNameDocument(), null, 0);
- textField.setEditable(false);
- return textField;
- }
-
- private Document buildNameDocument() {
- return new DocumentAdapter(this.buildNameAdapter());
- }
-
- private WritablePropertyValueModel<String> buildNameAdapter() {
- return new PropertyAspectAdapter<Person, String>(this.selectedPersonHolder, Person.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
-
- // ********** birth date spinner **********
-
- private JSpinner buildBirthDateSpinner() {
- return new JSpinner(this.buildBirthDateSpinnerModel());
- }
-
- private SpinnerModel buildBirthDateSpinnerModel() {
- return new DateSpinnerModelAdapter(this.buildBirthDateAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.BIRTH_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
-
- // ********** gone west date spinner **********
-
- private JSpinner buildGoneWestDateSpinner() {
- return new JSpinner(this.buildGoneWestDateSpinnerModel());
- }
-
- private SpinnerModel buildGoneWestDateSpinnerModel() {
- return new DateSpinnerModelAdapter(this.buildGoneWestDateAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildGoneWestDateAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.GONE_WEST_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getGoneWestDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setGoneWestDate((Date) value);
- }
- };
- }
-
-
- // ********** eye color combo-box **********
-
- private JComboBox buildEyeColorComboBox() {
- return new JComboBox(this.buildEyeColorComboBoxModel());
- }
-
- private ComboBoxModel buildEyeColorComboBoxModel() {
- return new ComboBoxModelAdapter(this.eyeColorsHolder, this.buildEyeColorAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.EYE_COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
-
- // ********** evil check box **********
-
- private JCheckBox buildEvilCheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("evil");
- checkBox.setModel(this.buildEvilCheckBoxModel());
- return checkBox;
- }
-
- private ButtonModel buildEvilCheckBoxModel() {
- return new CheckBoxModelAdapter(this.buildEvilAdapter());
- }
-
- private WritablePropertyValueModel<Boolean> buildEvilAdapter() {
- return new PropertyAspectAdapter<Person, Boolean>(this.selectedPersonHolder, Person.EVIL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isEvil());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setEvil(value.booleanValue());
- }
- };
- }
-
-
- // ********** rank spinner **********
-
- private JSpinner buildRankSpinner() {
- return new JSpinner(this.buildRankSpinnerModel());
- }
-
- private SpinnerModel buildRankSpinnerModel() {
- return new NumberSpinnerModelAdapter(this.buildRankAdapter());
- }
-
- private WritablePropertyValueModel<Number> buildRankAdapter() {
- return new PropertyAspectAdapter<Person, Number>(this.selectedPersonHolder, Person.RANK_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getRank());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setRank(value.intValue());
- }
- };
- }
-
-
- // ********** adventure count spinner **********
-
- private JSpinner buildAdventureCountSpinner() {
- return new JSpinner(this.buildAdventureCountSpinnerModel());
- }
-
- private SpinnerModel buildAdventureCountSpinnerModel() {
- return new NumberSpinnerModelAdapter(this.buildAdventureCountAdapter());
- }
-
- private WritablePropertyValueModel<Number> buildAdventureCountAdapter() {
- return new PropertyAspectAdapter<Person, Number>(this.selectedPersonHolder, Person.ADVENTURE_COUNT_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getAdventureCount());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setAdventureCount(value.intValue());
- }
- };
- }
-
-
- // ********** queries **********
-
- private Crowd crowd() {
- return this.crowdHolder.getValue();
- }
-
- private Person selectedPerson() {
- if (this.rowSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return (Person) this.rowSelectionModel.selectedValue();
- }
-
- private void setSelectedPerson(Person person) {
- this.rowSelectionModel.setSelectedValue(person);
- }
-
-
- // ********** custom renderer **********
-
- /**
- * This is simply an example of a renderer for the embedded combo-box.
- * It does nothing special unless you uncomment the code below....
- */
- private class EyeColorRenderer extends DefaultListCellRenderer {
- EyeColorRenderer() {
- super();
- }
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- // just do something to show the renderer is working...
- // value = ">" + value;
- return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
deleted file mode 100644
index 77d6ac00d8..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
+++ /dev/null
@@ -1,812 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreeModel;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.IndentingPrintWriter;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.AbstractTreeNodeValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.common.utility.internal.swing.Displayable;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-
-@SuppressWarnings("nls")
-public class TreeModelAdapterTests extends TestCase {
- boolean eventFired;
-
- public TreeModelAdapterTests(String name) {
- super(name);
- }
-
- public void testGetRoot() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- assertEquals("root", root.getName());
-// root.dump();
-// rootNode.dump();
- }
-
- public void testGetChild() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- TestNode expected = rootNode.childNamed("node 1");
- TestNode actual = (TestNode) treeModel.getChild(rootNode, 1);
- assertEquals(expected, actual);
-
- expected = rootNode.childNamed("node 2");
- actual = (TestNode) treeModel.getChild(rootNode, 2);
- assertEquals(expected, actual);
- }
-
- public void testGetChildCount() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- assertEquals(5, treeModel.getChildCount(rootNode));
-
- TestNode node = rootNode.childNamed("node 1");
- assertEquals(1, treeModel.getChildCount(node));
- }
-
- public void testGetIndexOfChild() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- TestNode child = rootNode.childNamed("node 0");
- assertEquals(0, treeModel.getIndexOfChild(rootNode, child));
-
- child = rootNode.childNamed("node 1");
- assertEquals(1, treeModel.getIndexOfChild(rootNode, child));
-
- child = rootNode.childNamed("node 2");
- assertEquals(2, treeModel.getIndexOfChild(rootNode, child));
- TestNode grandchild = child.childNamed("node 2.2");
- assertEquals(2, treeModel.getIndexOfChild(child, grandchild));
- }
-
- public void testIsLeaf() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
- assertFalse(treeModel.isLeaf(rootNode));
- TestNode node = rootNode.childNamed("node 1");
- assertFalse(treeModel.isLeaf(node));
- node = rootNode.childNamed("node 3");
- assertTrue(treeModel.isLeaf(node));
- }
-
-
- public void testTreeNodesChanged() {
- // the only way to trigger a "node changed" event is to use an unsorted tree;
- // a sorted tree will will trigger only "node removed" and "node inserted" events
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesChanged(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestNode node = rootNode.childNamed("node 1");
- TestModel tm = node.getTestModel();
- tm.setName("node 1++");
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- node = node.childNamed("node 1.1");
- tm = node.getTestModel();
- tm.setName("node 1.1++");
- assertTrue(this.eventFired);
- }
-
- public void testTreeNodesInserted() {
- // use an unsorted tree so the nodes are not re-shuffled...
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestNode node = rootNode.childNamed("node 1");
- TestModel tm = node.getTestModel();
- tm.addChild("new child...");
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- node = node.childNamed("node 1.1");
- tm = node.getTestModel();
- tm.addChild("another new child...");
- assertTrue(this.eventFired);
- }
-
- public void testTreeNodesRemoved() {
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- root.removeChild(root.childNamed("node 3"));
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- TestNode node = rootNode.childNamed("node 2");
- TestModel tm = node.getTestModel();
- tm.removeChild(tm.childNamed("node 2.2"));
- assertTrue(this.eventFired);
- }
-
- public void testTreeStructureChanged() {
- WritablePropertyValueModel<TreeNodeValueModel<Object>> nodeHolder = new SimplePropertyValueModel<TreeNodeValueModel<Object>>(this.buildSortedRootNode());
- TreeModel treeModel = this.buildTreeModel(nodeHolder);
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- // do nothing
- }
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- // do nothing
- }
- @Override
- public void treeStructureChanged(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- nodeHolder.setValue(this.buildUnsortedRootNode());
- assertTrue(this.eventFired);
- }
-
- /**
- * test a problem we had where removing a child from a tree would cause
- * the JTree to call #equals(Object) on each node removed (actually, it was
- * TreePath, but that was because its own #equals(Object) was called by
- * JTree); and since we had already removed the last listener from the
- * aspect adapter, the aspect adapter would say its value was null; this
- * would cause a NPE until we tweaked TreeModelAdapter to remove its
- * listeners from a node only *after* the node had been completely
- * removed from the JTree
- * @see TreeModelAdapter#removeNode(Object[], int, TreeNodeValueModel)
- * @see TreeModelAdapter#addNode(Object[], int, TreeNodeValueModel)
- */
- public void testLazyInitialization() {
- TreeModel treeModel = this.buildSpecialTreeModel();
- JTree jTree = new JTree(treeModel);
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- // this would cause a NPE:
- root.removeChild(root.childNamed("node 3"));
- assertEquals(treeModel, jTree.getModel());
- }
-
-
- private TreeModel buildSortedTreeModel() {
- return this.buildTreeModel(this.buildSortedRootNode());
- }
-
- private TestNode buildSortedRootNode() {
- return new SortedTestNode(this.buildRoot());
- }
-
- private TreeModel buildUnsortedTreeModel() {
- return this.buildTreeModel(this.buildUnsortedRootNode());
- }
-
- private TestNode buildUnsortedRootNode() {
- return new UnsortedTestNode(this.buildRoot());
- }
-
- private TreeModel buildSpecialTreeModel() {
- return this.buildTreeModel(this.buildSpecialRootNode());
- }
-
- private TestNode buildSpecialRootNode() {
- return new SpecialTestNode(this.buildRoot());
- }
-
- private TestModel buildRoot() {
- TestModel root = new TestModel("root");
- /*Node node_0 = */root.addChild("node 0");
- TestModel node_1 = root.addChild("node 1");
- TestModel node_1_1 = node_1.addChild("node 1.1");
- /*Node node_1_1_1 = */node_1_1.addChild("node 1.1.1");
- TestModel node_2 = root.addChild("node 2");
- /*Node node_2_0 = */node_2.addChild("node 2.0");
- /*Node node_2_1 = */node_2.addChild("node 2.1");
- /*Node node_2_2 = */node_2.addChild("node 2.2");
- /*Node node_2_3 = */node_2.addChild("node 2.3");
- /*Node node_2_4 = */node_2.addChild("node 2.4");
- /*Node node_2_5 = */node_2.addChild("node 2.5");
- /*Node node_3 = */root.addChild("node 3");
- /*Node node_4 = */root.addChild("node 4");
- return root;
- }
-
-
- // ********** member classes **********
-
- /**
- * This is a typical model class with the typical change notifications
- * for #name and #children.
- */
- public static class TestModel extends AbstractModel {
-
- // the parent is immutable; the root's parent is null
- private final TestModel parent;
-
- // the name is mutable; so I guess it isn't the "primary key" :-)
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- private final Collection<TestModel> children;
- public static final String CHILDREN_COLLECTION = "children";
-
-
- public TestModel(String name) { // root ctor
- this(null, name);
- }
- private TestModel(TestModel parent, String name) {
- super();
- this.parent = parent;
- this.name = name;
- this.children = new HashBag<TestModel>();
- }
-
- public TestModel getParent() {
- return this.parent;
- }
-
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<TestModel> children() {
- return new ReadOnlyIterator<TestModel>(this.children);
- }
- public int childrenSize() {
- return this.children.size();
- }
- public TestModel addChild(String childName) {
- TestModel child = new TestModel(this, childName);
- this.addItemToCollection(child, this.children, CHILDREN_COLLECTION);
- return child;
- }
- public TestModel[] addChildren(String[] childNames) {
- TestModel[] newChildren = new TestModel[childNames.length];
- for (int i = 0; i < childNames.length; i++) {
- newChildren[i] = new TestModel(this, childNames[i]);
- }
- this.addItemsToCollection(newChildren, this.children, CHILDREN_COLLECTION);
- return newChildren;
- }
- public void removeChild(TestModel child) {
- this.removeItemFromCollection(child, this.children, CHILDREN_COLLECTION);
- }
- public void removeChildren(TestModel[] testModels) {
- this.removeItemsFromCollection(testModels, this.children, CHILDREN_COLLECTION);
- }
- public void clearChildren() {
- this.clearCollection(this.children, CHILDREN_COLLECTION);
- }
- public TestModel childNamed(String childName) {
- for (TestModel child : this.children) {
- if (child.getName().equals(childName)) {
- return child;
- }
- }
- throw new RuntimeException("child not found: " + childName);
- }
-
- public String dumpString() {
- StringWriter sw = new StringWriter();
- IndentingPrintWriter ipw = new IndentingPrintWriter(sw);
- this.dumpOn(ipw);
- return sw.toString();
- }
- public void dumpOn(IndentingPrintWriter writer) {
- writer.println(this);
- writer.indent();
- for (TestModel child : this.children) {
- child.dumpOn(writer);
- }
- writer.undent();
- }
- public void dumpOn(OutputStream stream) {
- IndentingPrintWriter writer = new IndentingPrintWriter(new OutputStreamWriter(stream));
- this.dumpOn(writer);
- writer.flush();
- }
- public void dump() {
- this.dumpOn(System.out);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.name);
- }
-
- }
-
-
- /**
- * This Node wraps a TestModel and converts into something that can
- * be used by TreeModelAdapter. It converts changes to the TestModel's
- * name into "state changes" to the Node; and converts the
- * TestModel's children into a ListValueModel of Nodes whose order is
- * determined by subclass implementations.
- */
- public static abstract class TestNode extends AbstractTreeNodeValueModel<Object> implements Displayable, Comparable<TestNode> {
- /** the model object wrapped by this node */
- private final TestModel testModel;
- /** this node's parent node; null for the root node */
- private final TestNode parent;
- /** this node's child nodes */
- private final ListValueModel<TreeNodeValueModel<Object>> childrenModel;
- /** a listener that notifies us when the model object's "internal state" changes */
- private final PropertyChangeListener testModelListener;
-
-
- // ********** constructors/initialization **********
-
- /**
- * root node constructor
- */
- public TestNode(TestModel testModel) {
- this(null, testModel);
- }
-
- /**
- * branch or leaf node constructor
- */
- public TestNode(TestNode parent, TestModel testModel) {
- super();
- this.parent = parent;
- this.testModel = testModel;
- this.childrenModel = this.buildChildrenModel(testModel);
- this.testModelListener = this.buildTestModelListener();
- }
-
- private PropertyChangeListener buildTestModelListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TestNode.this.testModelChanged(e);
- }
- };
- }
-
- /**
- * subclasses decide the order of the child nodes
- */
- protected abstract ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel model);
-
- /**
- * used by subclasses;
- * transform the test model children into nodes
- */
- protected ListValueModel<TreeNodeValueModel<Object>> buildNodeAdapter(TestModel model) {
- return new TransformationListValueModel<TestModel, TreeNodeValueModel<Object>>(this.buildChildrenAdapter(model)) {
- @Override
- protected TestNode transformItem(TestModel item) {
- return TestNode.this.buildChildNode(item);
- }
- };
- }
-
- /**
- * subclasses must build a concrete node for the specified test model
- */
- protected abstract TestNode buildChildNode(TestModel childTestModel);
-
- /**
- * return a collection value model on the specified model's children
- */
- protected CollectionValueModel<TestModel> buildChildrenAdapter(TestModel model) {
- return new CollectionAspectAdapter<TestModel, TestModel>(TestModel.CHILDREN_COLLECTION, model) {
- @Override
- protected Iterator<TestModel> iterator_() {
- return this.subject.children();
- }
- @Override
- protected int size_() {
- return this.subject.childrenSize();
- }
- };
- }
-
-
- // ********** TreeNodeValueModel implementation **********
-
- public TestModel getValue() {
- return this.testModel;
- }
-
- public TreeNodeValueModel<Object> parent() {
- return this.parent;
- }
-
- public ListValueModel<TreeNodeValueModel<Object>> childrenModel() {
- return this.childrenModel;
- }
-
-
- // ********** AbstractTreeNodeValueModel implementation **********
-
- @Override
- protected void engageValue() {
- this.testModel.addPropertyChangeListener(TestModel.NAME_PROPERTY, this.testModelListener);
- }
-
- @Override
- protected void disengageValue() {
- this.testModel.removePropertyChangeListener(TestModel.NAME_PROPERTY, this.testModelListener);
- }
-
-
- // ********** Displayable implementation **********
-
- public String displayString() {
- return this.testModel.getName();
- }
-
- public Icon icon() {
- return null;
- }
-
-
- // ********** debugging support **********
-
- public String dumpString() {
- StringWriter sw = new StringWriter();
- IndentingPrintWriter ipw = new IndentingPrintWriter(sw);
- this.dumpOn(ipw);
- return sw.toString();
- }
-
- public void dumpOn(IndentingPrintWriter writer) {
- writer.println(this);
- writer.indent();
- for (Iterator<TreeNodeValueModel<Object>> stream = this.childrenModel.iterator(); stream.hasNext(); ) {
- // cast to a TestNode (i.e. this won't work with a NameTestNode in the tree)
- ((TestNode) stream.next()).dumpOn(writer);
- }
- writer.undent();
- }
-
- public void dumpOn(OutputStream stream) {
- IndentingPrintWriter writer = new IndentingPrintWriter(new OutputStreamWriter(stream));
- this.dumpOn(writer);
- writer.flush();
- }
-
- public void dump() {
- this.dumpOn(System.out);
- }
-
-
- // ********** behavior **********
-
- /**
- * the model's name has changed, forward the event to our listeners
- */
- protected void testModelChanged(PropertyChangeEvent e) {
- // we need to notify listeners that our "internal state" has changed
- this.fireStateChanged();
- // our display string stays in synch with the model's name
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, e.getOldValue(), e.getNewValue());
- }
-
-
- // ********** queries **********
-
- public TestModel getTestModel() {
- return this.testModel;
- }
-
- /**
- * testing convenience method
- */
- public TestNode childNamed(String name) {
- for (Iterator<TreeNodeValueModel<Object>> stream = this.childrenModel.iterator(); stream.hasNext(); ) {
- TreeNodeValueModel<Object> childNode = stream.next();
- if (childNode instanceof TestNode) {
- if (((TestNode) childNode).getTestModel().getName().equals(name)) {
- return (TestNode) childNode;
- }
- }
- }
- throw new IllegalArgumentException("child not found: " + name);
- }
-
-
- // ********** standard methods **********
-
- public int compareTo(TestNode o) {
- return this.displayString().compareTo(o.displayString());
- }
-
- @Override
- public String toString() {
- return "Node(" + this.testModel + ")";
- }
-
- }
-
- /**
- * concrete implementation that keeps its children sorted
- */
- public static class SortedTestNode extends TestNode {
-
- // ********** constructors **********
- public SortedTestNode(TestModel testModel) {
- super(testModel);
- }
- public SortedTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** the list should be sorted */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- return new SortedListValueModelWrapper<TreeNodeValueModel<Object>>(this.buildDisplayStringAdapter(testModel));
- }
- /** the display string (name) of each node can change */
- protected ListValueModel<TreeNodeValueModel<Object>> buildDisplayStringAdapter(TestModel testModel) {
- return new ItemPropertyListValueModelAdapter<TreeNodeValueModel<Object>>(this.buildNodeAdapter(testModel), DISPLAY_STRING_PROPERTY);
- }
- /** children are also sorted nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new SortedTestNode(this, childNode);
- }
-
- }
-
-
- /**
- * concrete implementation that leaves its children unsorted
- */
- public static class UnsortedTestNode extends TestNode {
-
- // ********** constructors **********
- public UnsortedTestNode(TestModel testModel) {
- super(testModel);
- }
- public UnsortedTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** the list should NOT be sorted */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- return this.buildNodeAdapter(testModel);
- }
- /** children are also unsorted nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new UnsortedTestNode(this, childNode);
- }
-
- }
-
-
- /**
- * concrete implementation that leaves its children unsorted
- * and has a special set of children for "node 3"
- */
- public static class SpecialTestNode extends UnsortedTestNode {
-
- // ********** constructors **********
- public SpecialTestNode(TestModel testModel) {
- super(testModel);
- }
- public SpecialTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** return a different list of children for "node 3" */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- if (testModel.getName().equals("node 3")) {
- return this.buildSpecialChildrenModel();
- }
- return super.buildChildrenModel(testModel);
- }
- protected ListValueModel<TreeNodeValueModel<Object>> buildSpecialChildrenModel() {
- TreeNodeValueModel<Object>[] children = new NameTestNode[1];
- children[0] = new NameTestNode(this);
- return new SimpleListValueModel<TreeNodeValueModel<Object>>(Arrays.asList(children));
- }
- /** children are also special nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new SpecialTestNode(this, childNode);
- }
-
- }
-
-
- public static class NameTestNode extends AbstractTreeNodeValueModel<Object> {
- private final WritablePropertyValueModel<String> nameAdapter;
- private final SpecialTestNode specialNode; // parent node
- private final PropertyChangeListener nameListener;
- private final ListValueModel<TreeNodeValueModel<Object>> childrenModel;
-
- // ********** construction/initialization **********
-
- public NameTestNode(SpecialTestNode specialNode) {
- super();
- this.nameListener = this.buildNameListener();
- this.specialNode = specialNode;
- this.nameAdapter = this.buildNameAdapter();
- this.childrenModel = new NullListValueModel<TreeNodeValueModel<Object>>();
- }
- protected PropertyChangeListener buildNameListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- NameTestNode.this.nameChanged(e);
- }
- };
- }
- protected WritablePropertyValueModel<String> buildNameAdapter() {
- return new PropertyAspectAdapter<TestModel, String>(TestModel.NAME_PROPERTY, this.getTestModel()) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- public TestModel getTestModel() {
- return this.specialNode.getTestModel();
- }
-
- // ********** TreeNodeValueModel implementation **********
-
- public String getValue() {
- return this.nameAdapter.getValue();
- }
- @Override
- public void setValue(Object value) {
- this.nameAdapter.setValue((String) value);
- }
- public TreeNodeValueModel<Object> parent() {
- return this.specialNode;
- }
- public ListValueModel<TreeNodeValueModel<Object>> childrenModel() {
- return this.childrenModel;
- }
-
- // ********** AbstractTreeNodeValueModel implementation **********
-
- @Override
- protected void engageValue() {
- this.nameAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.nameListener);
- }
- @Override
- protected void disengageValue() {
- this.nameAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.nameListener);
- }
-
- // ********** behavior **********
-
- protected void nameChanged(PropertyChangeEvent e) {
- // we need to notify listeners that our "value" has changed
- this.firePropertyChanged(VALUE, e.getOldValue(), e.getNewValue());
- }
- }
-
- private TreeModel buildTreeModel(TestNode root) {
- return this.buildTreeModel(new StaticPropertyValueModel<TreeNodeValueModel<Object>>(root));
- }
-
- private TreeModel buildTreeModel(PropertyValueModel<TreeNodeValueModel<Object>> rootHolder) {
- return new TreeModelAdapter<Object>(rootHolder) {
- @Override
- protected ListChangeListener buildChildrenListener() {
- return this.buildChildrenListener_();
- }
- @Override
- protected StateChangeListener buildNodeStateListener() {
- return this.buildNodeStateListener_();
- }
- @Override
- protected PropertyChangeListener buildNodeValueListener() {
- return this.buildNodeValueListener_();
- }
- @Override
- protected PropertyChangeListener buildRootListener() {
- return this.buildRootListener_();
- }
- };
- }
-
-
-
- /**
- * listener that will blow up with any event;
- * override and implement expected event methods
- */
- public class TestTreeModelListener implements TreeModelListener {
- public void treeNodesChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesInserted(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesRemoved(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeStructureChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
deleted file mode 100644
index 967a02783e..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.TextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.WindowConstants;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.DefaultTreeSelectionModel;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.EnumerationIterator;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.common.utility.internal.swing.Displayable;
-import org.eclipse.jpt.common.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TreeModelAdapterTests.SortedTestNode;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestModel;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestNode;
-import org.eclipse.jpt.common.utility.tests.internal.model.value.swing.TreeModelAdapterTests.UnsortedTestNode;
-
-/**
- * an example UI for testing the TreeModelAdapter
- */
-@SuppressWarnings("nls")
-public class TreeModelAdapterUITest {
-
- // hold the tree so we can restore its expansion state
- private JTree tree;
- private WritablePropertyValueModel<TreeNodeValueModel<Object>> rootNodeHolder;
- private boolean sorted;
- private TreeModel treeModel;
- private TreeSelectionModel treeSelectionModel;
- private TextField nameTextField;
-
- public static void main(String[] args) throws Exception {
- new TreeModelAdapterUITest().exec();
- }
-
- private TreeModelAdapterUITest() {
- super();
- }
-
- private void exec() throws Exception {
- this.rootNodeHolder = this.buildRootNodeHolder();
- this.sorted = this.rootNodeHolder.getValue() instanceof SortedTestNode;
- this.treeModel = this.buildTreeModel();
- this.treeSelectionModel = this.buildTreeSelectionModel();
- this.nameTextField = new TextField();
- this.openWindow();
- }
-
- private WritablePropertyValueModel<TreeNodeValueModel<Object>> buildRootNodeHolder() {
- return new SimplePropertyValueModel<TreeNodeValueModel<Object>>(this.buildSortedRootNode());
- }
-
- private TestNode buildSortedRootNode() {
- return new SortedTestNode(this.buildRoot());
- }
-
- private TestNode buildUnsortedRootNode() {
- return new UnsortedTestNode(this.buildRoot());
- }
-
- private TestModel buildRoot() {
- TestModel root = new TestModel("root");
-
- TestModel node_1 = root.addChild("node 1");
- /*Node node_1_1 = */node_1.addChild("node 1.1");
-
- TestModel node_2 = root.addChild("node 2");
- /*Node node_2_1 = */node_2.addChild("node 2.1");
- TestModel node_2_2 = node_2.addChild("node 2.2");
- /*Node node_2_2_1 = */node_2_2.addChild("node 2.2.1");
- /*Node node_2_2_2 = */node_2_2.addChild("node 2.2.2");
- /*Node node_2_3 = */node_2.addChild("node 2.3");
- /*Node node_2_4 = */node_2.addChild("node 2.4");
- /*Node node_2_5 = */node_2.addChild("node 2.5");
-
- TestModel node_3 = root.addChild("node 3");
- TestModel node_3_1 = node_3.addChild("node 3.1");
- TestModel node_3_1_1 = node_3_1.addChild("node 3.1.1");
- /*Node node_3_1_1_1 = */node_3_1_1.addChild("node 3.1.1.1");
-
- /*Node node_4 = */root.addChild("node 4");
-
- return root;
- }
-
- private TreeModel buildTreeModel() {
- return new TreeModelAdapter<Object>(this.rootNodeHolder);
- }
-
- private TreeSelectionModel buildTreeSelectionModel() {
- TreeSelectionModel tsm = new DefaultTreeSelectionModel();
- tsm.addTreeSelectionListener(this.buildTreeSelectionListener());
- tsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
- return tsm;
- }
-
- private TreeSelectionListener buildTreeSelectionListener() {
- return new TreeSelectionListener() {
- public void valueChanged(TreeSelectionEvent e) {
- TreeModelAdapterUITest.this.treeSelectionChanged(e);
- }
- };
- }
-
- void treeSelectionChanged(@SuppressWarnings("unused") TreeSelectionEvent e) {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- this.nameTextField.setText(selectedTestModel.getName());
- }
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setLocation(300, 300);
- window.setSize(400, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTreePane(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTreePane() {
- return new JScrollPane(this.buildTree());
- }
-
- private JTree buildTree() {
- this.tree = new JTree(this.treeModel) {
- @Override
- public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
- return ((Displayable) value).displayString();
- }
- };
- this.tree.setSelectionModel(this.treeSelectionModel);
- this.tree.setRootVisible(true);
- this.tree.setShowsRootHandles(true);
- this.tree.setRowHeight(20);
- this.tree.setDoubleBuffered(true);
- return this.tree;
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(0, 1));
- controlPanel.add(this.buildAddRenameNodePanel());
- controlPanel.add(this.buildMiscPanel());
- return controlPanel;
- }
-
- private Component buildAddRenameNodePanel() {
- JPanel addRenameNodePanel = new JPanel(new BorderLayout());
- addRenameNodePanel.add(this.buildAddButton(), BorderLayout.WEST);
- addRenameNodePanel.add(this.nameTextField, BorderLayout.CENTER);
- addRenameNodePanel.add(this.buildRenameButton(), BorderLayout.EAST);
- return addRenameNodePanel;
- }
-
- private Component buildMiscPanel() {
- JPanel miscPanel = new JPanel(new GridLayout(1, 0));
- miscPanel.add(this.buildClearChildrenButton());
- miscPanel.add(this.buildRemoveButton());
- miscPanel.add(this.buildResetButton());
- return miscPanel;
- }
-
- private String getName() {
- return this.nameTextField.getText();
- }
-
- // ********** queries **********
- private TestNode selectedNode() {
- if (this.treeSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return (TestNode) this.treeSelectionModel.getSelectionPath().getLastPathComponent();
- }
-
- private TestModel selectedTestModel() {
- if (this.treeSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return this.selectedNode().getValue();
- }
-
- private TestNode rootNode() {
- return (TestNode) this.treeModel.getRoot();
- }
-
- private TestModel root() {
- return this.rootNode().getValue();
- }
-
- private Collection<TreePath> expandedPaths() {
- Enumeration<TreePath> stream = this.tree.getExpandedDescendants(new TreePath(this.rootNode()));
- if (stream == null) {
- return Collections.emptyList();
- }
- return CollectionTools.list(new EnumerationIterator<TreePath>(stream));
- }
-
- // ********** behavior **********
- private void setSelectedNode(TestNode selectedNode) {
- this.treeSelectionModel.setSelectionPath(new TreePath(selectedNode.path()));
- }
-
- private void expandPaths(Collection<TreePath> paths) {
- for (TreePath path : paths) {
- this.tree.expandPath(path);
- }
- }
-
- // ********** add **********
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.addNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * adding causes the tree to be sorted and nodes to be
- * removed and re-added; so we have to fiddle with the expansion state
- */
- void addNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- String name = this.getName();
- // save the expansion state and restore it after the add
- Collection<TreePath> paths = this.expandedPaths();
-
- selectedTestModel.addChild(name);
-
- this.expandPaths(paths);
- this.setSelectedNode(this.selectedNode().childNamed(name));
- }
- }
-
- // ********** remove **********
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- Action action = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.removeNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * we need to figure out which node to select after
- * the selected node is deleted
- */
- void removeNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- // do not allow the root to be removed
- if ((selectedTestModel != null) && (selectedTestModel != this.root())) {
- // save the parent and index, so we can select another, nearby, node
- // once the selected node is removed
- TestNode parentNode = (TestNode) this.selectedNode().parent();
- int childIndex = parentNode.indexOfChild(this.selectedNode());
-
- selectedTestModel.getParent().removeChild(selectedTestModel);
-
- int childrenSize = parentNode.childrenSize();
- if (childIndex < childrenSize) {
- // select the child that moved up and replaced the just-deleted child
- this.setSelectedNode((TestNode) parentNode.child(childIndex));
- } else {
- if (childrenSize == 0) {
- // if there are no more children, select the parent
- this.setSelectedNode(parentNode);
- } else {
- // if the child at the bottom of the list was deleted, select the next child up
- this.setSelectedNode((TestNode) parentNode.child(childIndex - 1));
- }
- }
- }
- }
-
- // ********** rename **********
- private JButton buildRenameButton() {
- return new JButton(this.buildRenameAction());
- }
-
- private Action buildRenameAction() {
- Action action = new AbstractAction("rename") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.renameNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * renaming causes the tree to be sorted and nodes to be
- * removed and re-added; so we have to fiddle with the expansion state
- */
- void renameNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- // save the node and re-select it after the rename
- TestNode selectedNode = this.selectedNode();
- // save the expansion state and restore it after the rename
- Collection<TreePath> paths = this.expandedPaths();
-
- selectedTestModel.setName(this.getName());
-
- this.expandPaths(paths);
- this.setSelectedNode(selectedNode);
- }
- }
-
- // ********** clear children **********
- private JButton buildClearChildrenButton() {
- return new JButton(this.buildClearChildrenAction());
- }
-
- private Action buildClearChildrenAction() {
- Action action = new AbstractAction("clear children") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.clearChildren();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * nothing special, we just want to test #fireCollectionChanged(String)
- */
- void clearChildren() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- selectedTestModel.clearChildren();
- }
- }
-
- // ********** reset **********
- private JButton buildResetButton() {
- return new JButton(this.buildResetAction());
- }
-
- private Action buildResetAction() {
- Action action = new AbstractAction("reset") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.reset();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * test the adapter's root node holder;
- * toggle between sorted and unsorted lists
- */
- void reset() {
- this.sorted = ! this.sorted;
- if (this.sorted) {
- this.rootNodeHolder.setValue(this.buildSortedRootNode());
- } else {
- this.rootNodeHolder.setValue(this.buildUnsortedRootNode());
- }
- this.tree.expandPath(new TreePath(this.rootNode()));
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java
deleted file mode 100644
index 74cd629a88..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/AbstractNodeTests.java
+++ /dev/null
@@ -1,495 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.node;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.internal.node.Problem;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class AbstractNodeTests extends TestCase {
- private TestWorkbenchModel root;
-
- public AbstractNodeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.root = this.buildRoot();
- }
-
- private TestWorkbenchModel buildRoot() {
- TestWorkbenchModel r = new RootTestWorkbenchModel("root");
- TestWorkbenchModel node1 = r.addTestChildNamed("node 1");
- TestWorkbenchModel node1_1 = node1.addTestChildNamed("node 1.1");
- node1_1.addTestChildNamed("node 1.1.1");
- node1_1.addTestChildNamed("node 1.1.2");
- node1_1.addTestChildNamed("node 1.1.3");
- node1.addTestChildNamed("node 1.2");
- TestWorkbenchModel node2 = r.addTestChildNamed("node 2");
- node2.addTestChildNamed("node 2.1");
- node2.addTestChildNamed("node 2.2");
- r.addTestChildNamed("node 3");
- r.addTestChildNamed("node 4");
-
- // mark the entire tree clean
- r.markEntireBranchClean();
- return r;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testTestWorkbenchModel() {
- // make sure our test class works OK...
- assertNull(this.root.testChildNamed(""));
- assertNotNull(this.root.testChildNamed("node 1"));
- assertTrue(this.root.testChildNamed("node 1").isClean());
- assertTrue(this.root.testChildNamed("node 1").isCleanBranch());
- assertNotNull(this.root.testChildNamed("node 2"));
- assertTrue(this.root.testChildNamed("node 2").isClean());
- assertTrue(this.root.testChildNamed("node 2").isCleanBranch());
- assertNull(this.root.testChildNamed("node 2.1"));
-
- assertNull(this.root.testDescendantNamed(""));
- assertNotNull(this.root.testDescendantNamed("node 1"));
- assertNotNull(this.root.testDescendantNamed("node 2"));
- assertNotNull(this.root.testDescendantNamed("node 2.1"));
- assertTrue(this.root.testDescendantNamed("node 2.1").isClean());
- assertTrue(this.root.testDescendantNamed("node 2.1").isCleanBranch());
- assertNotNull(this.root.testDescendantNamed("node 1.1.3"));
- assertTrue(this.root.testDescendantNamed("node 1.1.3").isClean());
- assertTrue(this.root.testDescendantNamed("node 1.1.3").isCleanBranch());
- }
-
- public void testParentAndChildren() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- assertEquals("node 1.1.3", node.getName());
- assertEquals(0, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertEquals("node 1.1", node.getName());
- assertEquals(3, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertEquals("node 1", node.getName());
- assertEquals(2, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertEquals("root", node.getName());
- assertEquals(4, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.getParent();
- assertNull(node);
- }
-
- public void testDirty() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirty());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
- }
-
- public void testDirtyUnchangedAttribute() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirty());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
-
- this.root.markEntireBranchClean();
- // set size to same number - should stay clean
- node.setSize(42);
- assertTrue(node.isClean());
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
- }
-
- public void testDirtyBranch() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirtyBranch());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isDirtyBranch());
-
- parent.setSize(77);
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
-
- node.markEntireBranchClean();
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchCleanChildDirtyParent() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setSize(77);
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
-
- // now, clean the child, but leave the parent dirty
- node.markEntireBranchClean();
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchCleanChildDirtyChild() {
- TestWorkbenchModel node1 = this.root.testDescendantNamed("node 1.1.1");
- node1.setSize(41);
- TestWorkbenchModel node2 = this.root.testDescendantNamed("node 1.1.2");
- node2.setSize(42);
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node1.getParent();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
-
- // now, clean the first child, but leave the second child dirty
- node1.markEntireBranchClean();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchForced() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
-
- assertTrue(node.isClean());
- assertTrue(node.isCleanBranch());
- assertTrue(parent.isClean());
- assertTrue(parent.isCleanBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isCleanBranch());
-
- this.root.markEntireBranchDirty();
-
- assertTrue(node.isDirty());
- assertTrue(node.isDirtyBranch());
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isDirty());
- assertTrue(this.root.isDirtyBranch());
- }
-
- public void testDirtyTransientAttribute() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- assertTrue(node.isDirty());
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isDirtyBranch());
-
- this.root.markEntireBranchClean();
-
- this.root.validateBranch();
-
- assertTrue(this.root.problemsSize() == 0);
- assertTrue(node.branchProblems().hasNext());
- assertTrue(parent.problemsSize() == 0);
- assertTrue(parent.branchProblems().hasNext());
- assertTrue(node.problemsSize() > 0);
-
- // since problems are transient, everything should still be clean
- assertTrue(node.isClean());
- assertTrue(node.isCleanBranch());
- assertTrue(parent.isClean());
- assertTrue(parent.isCleanBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isCleanBranch());
- }
-
- public void testProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
-
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- Problem problem1 = node.problems().next();
-
- // now create another problem that should remove the old problem
- node.setName("STILL BOGUS");
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- Problem problem2 = node.problems().next();
- assertFalse(problem1 == problem2);
- problem1 = problem2;
-
- // now create another problem that should replace the old problem
- node.setName("STILL BOGUS");
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- problem2 = node.problems().next();
- // the same problem should be there
- assertTrue(problem1.equals(problem2));
- }
-
- public void testBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, node.branchProblemsSize());
-
- node.setName("okie-dokie");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(2, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(1, parent.branchProblemsSize());
- assertEquals(0, node.problemsSize());
- assertEquals(0, node.branchProblemsSize());
- }
-
- public void testClearAllBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, node.branchProblemsSize());
-
- parent.clearAllBranchProblems();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(1, this.root.branchProblemsSize());
- assertEquals(0, parent.problemsSize());
- assertEquals(0, parent.branchProblemsSize());
- assertEquals(0, node.problemsSize());
- assertEquals(0, CollectionTools.size(node.branchProblems()));
- }
-
- public void testRemovedBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.getParent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, CollectionTools.size(this.root.branchProblems()));
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, CollectionTools.size(node.branchProblems()));
-
- // completely remove a node that has problems -
- // the entire tree should recalculate its "branch" problems
- parent.removeTestChild(node);
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(2, CollectionTools.size(this.root.branchProblems()));
- assertEquals(1, parent.problemsSize());
- assertEquals(1, parent.branchProblemsSize());
- }
-
-
- // ********** inner classes **********
-
- public class TestWorkbenchModel extends AbstractNode {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private int size;
- public static final String SIZE_PROPERTY = "size";
- private Collection<TestWorkbenchModel> testChildren;
- public static final String TEST_CHILDREN_COLLECTION = "children";
-
- // ********** construction/initialization **********
- public TestWorkbenchModel(TestWorkbenchModel parent, String name) {
- super(parent);
- if (name == null) {
- throw new NullPointerException();
- }
- this.name = name;
- }
- @Override
- protected void initialize() {
- super.initialize();
- this.size = 0;
- this.testChildren = new HashBag<TestWorkbenchModel>();
- }
-
- @Override
- protected void checkParent(Node parent) {
- // do nothing
- }
-
-
- // ********** accessors **********
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public int getSize() {
- return this.size;
- }
- public void setSize(int size) {
- int old = this.size;
- this.size = size;
- this.firePropertyChanged(SIZE_PROPERTY, old, size);
- }
-
- public Iterator<TestWorkbenchModel> testChildren() {
- return new CloneIterator<TestWorkbenchModel>(this.testChildren) {
- @Override
- protected void remove(TestWorkbenchModel current) {
- TestWorkbenchModel.this.removeTestChild(current);
- }
- };
- }
- public int testChildrenSize() {
- return this.testChildren.size();
- }
- private TestWorkbenchModel addTestChild(TestWorkbenchModel testChild) {
- this.addItemToCollection(testChild, this.testChildren, TEST_CHILDREN_COLLECTION);
- return testChild;
- }
- public TestWorkbenchModel addTestChildNamed(String childName) {
- if (this.testChildNamed(childName) != null) {
- throw new IllegalArgumentException(childName);
- }
- return this.addTestChild(new TestWorkbenchModel(this, childName));
- }
- public void removeTestChild(TestWorkbenchModel testChild) {
- this.removeItemFromCollection(testChild, this.testChildren, TEST_CHILDREN_COLLECTION);
- }
-
- // ********** queries **********
- public String displayString() {
- return this.name;
- }
- public TestWorkbenchModel testChildNamed(String childName) {
- for (TestWorkbenchModel testChild : this.testChildren) {
- if (testChild.getName().equals(childName)) {
- return testChild;
- }
- }
- return null;
- }
- public TestWorkbenchModel testDescendantNamed(String descendantName) {
- for (TestWorkbenchModel testDescendant : this.testChildren) {
- if (testDescendant.getName().equals(descendantName)) {
- return testDescendant;
- }
- // recurse...
- testDescendant = testDescendant.testDescendantNamed(descendantName);
- if (testDescendant != null) {
- return testDescendant;
- }
- }
- return null;
- }
-
- // ********** behavior **********
- @Override
- protected void addChildrenTo(List<Node> children) {
- super.addChildrenTo(children);
- children.addAll(this.testChildren);
- }
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- // names must be all lowercase...
- for (int i = this.name.length(); i-- > 0; ) {
- char c = this.name.charAt(i);
- if (Character.isLetter(c) && ! Character.isLowerCase(c)) {
- currentProblems.add(this.buildProblem("NAME_MUST_BE_LOWERCASE", 3 ,this.name));
- return;
- }
- }
- }
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
- }
-
-
- private class RootTestWorkbenchModel extends TestWorkbenchModel {
- public RootTestWorkbenchModel(String name) {
- super(null, name);
- }
- @Override
- public Validator getValidator() {
- return Node.NULL_VALIDATOR;
- }
- }
-
-}
-
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/JptUtilityNodeTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/JptUtilityNodeTests.java
deleted file mode 100644
index 16f6dce93d..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/node/JptUtilityNodeTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.node;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityNodeTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityNodeTests.class.getPackage().getName());
-
- suite.addTestSuite(AbstractNodeTests.class);
-
- return suite;
- }
-
- private JptUtilityNodeTests() {
- super();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/AsynchronousSynchronizerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/AsynchronousSynchronizerTests.java
deleted file mode 100644
index 3ddbadc460..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/AsynchronousSynchronizerTests.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.synchronizers;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.CompositeException;
-import org.eclipse.jpt.common.utility.internal.ConsumerThreadCoordinator;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.synchronizers.AsynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.common.utility.tests.internal.MultiThreadedTestCase;
-
-@SuppressWarnings("nls")
-public class AsynchronousSynchronizerTests
- extends MultiThreadedTestCase
-{
- PrimaryModel1 primaryModel1;
- SecondaryModel1 secondaryModel1;
- Command command1;
- Synchronizer synchronizer1;
-
- PrimaryModel2 primaryModel2;
- SecondaryModel2 secondaryModel2;
- Command command2;
- Synchronizer synchronizer2;
-
- public AsynchronousSynchronizerTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.primaryModel1 = new PrimaryModel1();
- this.secondaryModel1 = new SecondaryModel1(this.primaryModel1);
- this.command1 = new SynchronizeSecondaryModelCommand1(this.secondaryModel1);
- this.synchronizer1 = new AsynchronousSynchronizer(this.command1, this.buildThreadFactory());
- this.primaryModel1.setSynchronizer(this.synchronizer1);
-
- this.primaryModel2 = new PrimaryModel2();
- this.secondaryModel2 = new SecondaryModel2(this.primaryModel2);
- this.command2 = new SynchronizeSecondaryModelCommand2(this.primaryModel2, this.secondaryModel2);
- this.synchronizer2 = new AsynchronousSynchronizer(this.command2, this.buildThreadFactory());
- this.primaryModel2.setSynchronizer(this.synchronizer2);
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.synchronizer1.stop();
- this.synchronizer2.stop();
- super.tearDown();
- }
-
- public void testInitialization() {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- }
-
- public void testToString() {
- assertNotNull(this.synchronizer1.toString());
- }
-
- public void testChange() throws Exception {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.setCount(7);
-
- this.sleep(TICK);
- this.synchronizer1.stop();
- this.sleep(TICK);
-
- assertEquals(14, this.secondaryModel1.getDoubleCount());
-
- // re-start so tear-down works
- this.synchronizer1.start();
- }
-
- public void testStart() throws Exception {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.setSynchronizer(Synchronizer.Null.instance());
- this.primaryModel1.setCount(7);
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.setSynchronizer(this.synchronizer1);
- // the async synchronizer does not synchronize at start-up
- assertEquals(4, this.secondaryModel1.getDoubleCount());
-
- this.primaryModel1.setCount(8);
-
- this.sleep(TICK);
- this.synchronizer1.stop();
- this.sleep(TICK);
-
- assertEquals(16, this.secondaryModel1.getDoubleCount());
-
- // re-start so tear-down works
- this.synchronizer1.start();
- }
-
- public void testStop() throws Exception {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.dispose();
- this.primaryModel1.setCount(7);
- assertEquals(4, this.secondaryModel1.getDoubleCount());
-
- // re-start so tear-down works
- this.synchronizer1.start();
- }
-
- public void testDoubleStart() throws Exception {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- boolean exCaught = false;
- try {
- this.primaryModel1.startSynchronizer();
- fail();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- this.primaryModel1.setCount(7);
-
- this.sleep(TICK);
- this.synchronizer1.stop();
- this.sleep(TICK);
-
- assertEquals(14, this.secondaryModel1.getDoubleCount());
-
- // re-start so tear-down works
- this.synchronizer1.start();
- }
-
- public void testDoubleStop() throws Exception {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.dispose();
- boolean exCaught = false;
- try {
- this.primaryModel1.dispose();
- fail();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- this.primaryModel1.setCount(7);
- assertEquals(4, this.secondaryModel1.getDoubleCount());
-
- // re-start so tear-down works
- this.synchronizer1.start();
- }
-
- public void testRecursiveChange() throws Exception {
- assertEquals(4, this.secondaryModel2.getDoubleCount());
- this.primaryModel2.setCount(7);
-
- this.sleep(TICK);
- assertEquals(10, this.primaryModel2.getCountPlus3());
- assertEquals(14, this.secondaryModel2.getDoubleCount());
-
- this.sleep(TICK);
- assertEquals(20, this.secondaryModel2.getDoubleCountPlus3());
- }
-
- public void testNullCommand() {
- boolean exCaught = false;
- try {
- Synchronizer s = new AsynchronousSynchronizer(null, this.buildThreadFactory());
- fail("bogus: " + s);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testThreadName() {
- Synchronizer s = new AsynchronousSynchronizer(this.command1, this.buildThreadFactory(), "sync");
- s.start();
- ConsumerThreadCoordinator ctc = (ConsumerThreadCoordinator) ReflectionTools.getFieldValue(s, "consumerThreadCoordinator");
- Thread t = (Thread) ReflectionTools.getFieldValue(ctc, "thread");
- assertEquals("sync", t.getName());
- s.stop();
- }
-
- public void testSynchronizeCalledBeforeStart() throws Exception {
- SimpleCommand command = new SimpleCommand();
- Synchronizer synchronizer = new AsynchronousSynchronizer(command, this.buildThreadFactory());
-
- synchronizer.synchronize();
- synchronizer.start();
- this.sleep(TICK);
- synchronizer.stop();
- assertEquals(1, command.count);
- }
-
- public class SimpleCommand implements Command {
- int count = 0;
- public void execute() {
- this.count++;
- }
- }
-
- public void testException() throws Exception {
- BogusCommand command = new BogusCommand();
- Synchronizer synchronizer = new AsynchronousSynchronizer(command, this.buildThreadFactory());
- synchronizer.start();
-
- synchronizer.synchronize();
- this.sleep(TICK);
-
- synchronizer.synchronize();
- this.sleep(TICK);
-
- boolean exCaught = false;
- try {
- synchronizer.stop();
- fail();
- } catch (CompositeException ex) {
- assertEquals(2, ex.getExceptions().length);
- exCaught = true;
- }
- assertTrue(exCaught);
- assertEquals(2, command.count);
- }
-
- public class BogusCommand implements Command {
- int count = 0;
- public void execute() {
- this.count++;
- throw new NullPointerException();
- }
- }
-
-
- // ********** synchronize commands **********
- public static class SynchronizeSecondaryModelCommand1 implements Command {
- private final SecondaryModel1 secondaryModel;
-
- public SynchronizeSecondaryModelCommand1(SecondaryModel1 secondaryModel) {
- super();
- this.secondaryModel = secondaryModel;
- }
-
- public void execute() {
- this.secondaryModel.synchronize();
- }
-
- }
-
- /**
- * the primary model (subclass) has to synchronize with itself (superclass)
- */
- public static class SynchronizeSecondaryModelCommand2 extends SynchronizeSecondaryModelCommand1 {
- private final PrimaryModel2 primaryModel;
-
- public SynchronizeSecondaryModelCommand2(PrimaryModel2 primaryModel, SecondaryModel2 secondaryModel) {
- super(secondaryModel);
- this.primaryModel = primaryModel;
- }
-
- @Override
- public void execute() {
- super.execute();
- this.primaryModel.synchronize();
- }
-
- }
-
- // ********** primary models **********
- /**
- * this object will call the synchronizer whenever its count changes,
- * allowing interested parties to synchronize with the change
- */
- public static class PrimaryModel1 {
- protected Synchronizer synchronizer;
- protected int count = 2;
-
- public PrimaryModel1() {
- super();
- this.setSynchronizer_(Synchronizer.Null.instance());
- }
-
- public int getCount() {
- return this.count;
- }
- public void setCount(int count) {
- if (count != this.count) {
- this.count = count;
- this.stateChanged();
- }
- }
-
- protected void stateChanged() {
- this.synchronizer.synchronize();
- }
-
- public void setSynchronizer(Synchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.synchronizer.stop();
- this.setSynchronizer_(synchronizer);
- }
-
- protected void setSynchronizer_(Synchronizer synchronizer) {
- this.synchronizer = synchronizer;
- this.synchronizer.start();
- }
-
- public void startSynchronizer() {
- this.synchronizer.start(); // this should cause an exception
- }
- public void dispose() {
- this.synchronizer.stop();
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.getClass().getSimpleName());
- sb.append('(');
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
- public void toString(StringBuilder sb) {
- sb.append("count=");
- sb.append(this.count);
- }
-
- }
-
- /**
- * This model synchronizes with itself, triggering a recursive synchronization
- * with the change. Whenever the [inherited] 'count' changes, 'countPlus3'
- * is updated appropriately and another synchronize is initiated if appropriate.
- */
- public static class PrimaryModel2 extends PrimaryModel1 {
- private int countPlus3 = 0;
-
- public PrimaryModel2() {
- super();
- this.countPlus3 = this.count + 3;
- }
-
- public int getCountPlus3() {
- return this.countPlus3;
- }
- protected void setCountPlus3(int countPlus3) {
- if (countPlus3 != this.countPlus3) {
- this.countPlus3 = countPlus3;
- this.stateChanged();
- }
- }
-
- // synchronize with itself, so to speak
- public void synchronize() {
- this.setCountPlus3(this.count + 3);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(", countPlus3=");
- sb.append(this.countPlus3);
- }
-
- }
-
- // ********** secondary models **********
- /**
- * This dependent object updates its 'doubleCount' whenever the
- * PrimaryModel1's 'count' changes, via the 'synchronizer'.
- */
- public static class SecondaryModel1 {
- protected final PrimaryModel1 primaryModel;
- protected int doubleCount = 0;
-
- public SecondaryModel1(PrimaryModel1 primaryModel) {
- super();
- this.primaryModel = primaryModel;
- this.synchronize();
- }
-
- public void synchronize() {
- this.doubleCount = this.primaryModel.getCount() * 2;
- }
-
- public int getDoubleCount() {
- return this.doubleCount;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.getClass().getSimpleName());
- sb.append('(');
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
- public void toString(StringBuilder sb) {
- sb.append("doubleCount=");
- sb.append(this.doubleCount);
- }
-
- }
-
- public static class SecondaryModel2 extends SecondaryModel1 {
- private int doubleCountPlus3 = 0;
-
- public SecondaryModel2(PrimaryModel2 extendedPrimaryModel) {
- super(extendedPrimaryModel);
- }
-
- protected PrimaryModel2 getExtendedPrimaryModel() {
- return (PrimaryModel2) this.primaryModel;
- }
-
- @Override
- public void synchronize() {
- super.synchronize();
- int temp = this.getExtendedPrimaryModel().getCountPlus3() * 2;
- if (this.doubleCountPlus3 != temp) {
- this.doubleCountPlus3 = temp;
- }
- }
-
- public int getDoubleCountPlus3() {
- return this.doubleCountPlus3;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(", doubleCountPlus3=");
- sb.append(this.doubleCountPlus3);
- }
-
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/JptUtilitySynchronizersTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/JptUtilitySynchronizersTests.java
deleted file mode 100644
index 96acf3075b..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/JptUtilitySynchronizersTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.synchronizers;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilitySynchronizersTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilitySynchronizersTests.class.getPackage().getName());
-
- suite.addTestSuite(AsynchronousSynchronizerTests.class);
- suite.addTestSuite(SynchronizerTests.class);
- suite.addTestSuite(SynchronousSynchronizerTests.class);
-
- return suite;
- }
-
- private JptUtilitySynchronizersTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronizerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronizerTests.java
deleted file mode 100644
index 8f7c67bb69..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronizerTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.synchronizers;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-
-public class SynchronizerTests extends TestCase {
-
- public SynchronizerTests(String name) {
- super(name);
- }
-
- public void testNullSynchronizerStart() {
- Synchronizer synchronizer = Synchronizer.Null.instance();
- synchronizer.start(); // just make sure it doesn't blow up?
- }
-
- public void testNullSynchronizerSynchronize() {
- Synchronizer synchronizer = Synchronizer.Null.instance();
- synchronizer.synchronize(); // just make sure it doesn't blow up?
- }
-
- public void testNullSynchronizerStop() {
- Synchronizer synchronizer = Synchronizer.Null.instance();
- synchronizer.stop(); // just make sure it doesn't blow up?
- }
-
- public void testNullSynchronizerToString() {
- Synchronizer synchronizer = Synchronizer.Null.instance();
- assertNotNull(synchronizer.toString());
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java
deleted file mode 100644
index e7601bc657..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java
+++ /dev/null
@@ -1,756 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.tests.internal.synchronizers;
-
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.CompositeException;
-import org.eclipse.jpt.common.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.common.utility.internal.synchronizers.SynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.common.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.common.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class SynchronousSynchronizerTests
- extends MultiThreadedTestCase
-{
- PrimaryModel1 primaryModel1;
- SecondaryModel1 secondaryModel1;
- Command command1;
- Synchronizer synchronizer1;
-
- PrimaryModel2 primaryModel2;
- SecondaryModel2 secondaryModel2;
- Command command2;
- Synchronizer synchronizer2;
-
- public SynchronousSynchronizerTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.primaryModel1 = new PrimaryModel1();
- this.secondaryModel1 = new SecondaryModel1(this.primaryModel1);
- this.command1 = new SynchronizeSecondaryModelCommand1(this.secondaryModel1);
- this.synchronizer1 = new SynchronousSynchronizer(this.command1);
- this.primaryModel1.setSynchronizer(this.synchronizer1);
-
- this.primaryModel2 = new PrimaryModel2();
- this.secondaryModel2 = new SecondaryModel2(this.primaryModel2);
- this.command2 = new SynchronizeSecondaryModelCommand2(this.primaryModel2, this.secondaryModel2);
- this.synchronizer2 = new SynchronousSynchronizer(this.command2);
- this.primaryModel2.setSynchronizer(this.synchronizer2);
- }
-
- public void testInitialization() {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- }
-
- public void testToString() {
- assertNotNull(this.synchronizer1.toString());
- }
-
- public void testChange() {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.setCount(7);
- assertEquals(14, this.secondaryModel1.getDoubleCount());
- }
-
- public void testStart() {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.setSynchronizer(Synchronizer.Null.instance());
- this.primaryModel1.setCount(7);
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.setSynchronizer(this.synchronizer1);
- assertEquals(14, this.secondaryModel1.getDoubleCount());
- }
-
- public void testStop() {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.dispose();
- this.primaryModel1.setCount(7);
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- }
-
- public void testDoubleStart() {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- boolean exCaught = false;
- try {
- this.primaryModel1.startSynchronizer();
- fail();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- this.primaryModel1.setCount(7);
- assertEquals(14, this.secondaryModel1.getDoubleCount());
- }
-
- public void testDoubleStop() {
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- this.primaryModel1.dispose();
- boolean exCaught = false;
- try {
- this.primaryModel1.dispose();
- fail();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- this.primaryModel1.setCount(7);
- assertEquals(4, this.secondaryModel1.getDoubleCount());
- }
-
- public void testRecursiveChange() {
- assertEquals(4, this.secondaryModel2.getDoubleCount());
- this.primaryModel2.setCount(7);
- assertEquals(10, this.primaryModel2.getCountPlus3());
- assertEquals(14, this.secondaryModel2.getDoubleCount());
- assertEquals(20, this.secondaryModel2.getDoubleCountPlus3());
- }
-
- /**
- * Call #stop() from another thread.
- * Verify that no further synchronizations occur.
- * Verify the call to #stop() does not return until the pending
- * synchronization is complete (must set {@link #DEBUG} to true and
- * look at the console).
- *
- * ticks:
- * 0 - start "sync" thread (which will sleep for 1 tick);
- * start "stop" thread (which will sleep for 2 ticks)
- * 1 - "sync" thread wakes up and calls PrimaryModel1.setCount(int)
- * which triggers call to Synchronizer.synchronize() to begin
- * synchronization of SecondaryModel (which will run for 2 ticks;
- * i.e. it will finish on tick 3)
- * 2 - "stop" thread wakes up and calls Synchronizer.stop() and should
- * wait until synchronization is complete
- * 3 - synchronization completes first execution and should stop;
- * "stop" thread should run to completion once the synchronization has stopped
- */
- public void testCallStopFromAnotherThread() throws Exception {
- log("=====" + this.getName() + "=====");
- PrimaryModel2 primaryModel3 = new PrimaryModel2();
- // a synchronize will occur here:
- SecondaryModel3 secondaryModel3 = new SecondaryModel3(primaryModel3);
- Command command3 = new SynchronizeSecondaryModelCommand2(primaryModel3, secondaryModel3);
- Synchronizer synchronizer3 = new SynchronousSynchronizer(command3);
- // another synchronize will occur here:
- primaryModel3.setSynchronizer(synchronizer3);
- secondaryModel3.setTicks(2);
-
- assertEquals(2, primaryModel3.getCount());
- assertEquals(5, primaryModel3.getCountPlus3());
- assertEquals(4, secondaryModel3.getDoubleCount());
- assertEquals(10, secondaryModel3.getDoubleCountPlus3());
-
- Thread syncThread = this.buildTriggerSynchronizeThread(primaryModel3, 1);
- Thread stopThread = this.buildStopThread(synchronizer3, 2);
-
- log("ALL threads start");
- stopThread.start();
- syncThread.start();
-
- stopThread.join();
- syncThread.join();
-
- // 'doubleCount' is synchronized; but the synchronization is stopped
- // while that is happening (by the 'stopThread'), so 'doubleCountPlus3'
- // does not get synchronized
- assertEquals(7, primaryModel3.getCount());
- assertEquals(10, primaryModel3.getCountPlus3());
- assertEquals(14, secondaryModel3.getDoubleCount());
-
- // this does not get updated because it would've been updated by the
- // recursive call to #synchronize(), but by that time #stop() had been called
- assertEquals(10, secondaryModel3.getDoubleCountPlus3());
- }
-
- private Thread buildTriggerSynchronizeThread(PrimaryModel2 primaryModel, long ticks) {
- return this.buildThread(this.buildTriggerSynchronizeRunnable(primaryModel, ticks), "trigger sync");
- }
-
- private Runnable buildTriggerSynchronizeRunnable(final PrimaryModel2 primaryModel, final long ticks) {
- return new Runnable() {
- public void run() {
- TestTools.sleep(ticks * TICK);
- primaryModel.setCount(7);
- }
- };
- }
-
- private Thread buildStopThread(Synchronizer synchronizer, long ticks) {
- return this.buildThread(this.buildStopRunnable(synchronizer, ticks), "stop");
- }
-
- private Runnable buildStopRunnable(final Synchronizer synchronizer, final long ticks) {
- return new Runnable() {
- public void run() {
- TestTools.sleep(ticks * TICK);
- log("STOP thread Synchronizer.stop()");
- synchronizer.stop();
- log("STOP thread stop");
- }
- };
- }
-
- /**
- * Code cloned from {@link #testStopCalledFromAnotherThread()}.
- *
- * Interrupt the "stop" thread while it is waiting for the "synch" thread to finish.
- * Verify that no further synchronizations occur.
- * Verify the call to #stop() returns *before*
- * synchronization is complete (must set {@link #DEBUG} to true and
- * look at the console).
- *
- * ticks:
- * 0 - start "sync" thread (which will sleep for 1 tick);
- * start "stop" thread (which will sleep for 2 ticks);
- * start "interrupt" thread (which will sleep for 3 ticks)
- * 1 - "sync" thread wakes up and calls PrimaryModel1.setCount(int)
- * which triggers call to Synchronizer.synchronize() to begin
- * synchronization of SecondaryModel (which will run for 3 ticks;
- * i.e. it will finish on tick 4)
- * 2 - "stop" thread wakes up and calls Synchronizer.stop() and should
- * wait until it is interrupted
- * 3 - "interrupt" thread wakes up and interrupts "stop" thread;
- * both will run to completion at that point
- * 4 - synchronization completes first execution and should stop since the
- * "stop" thread, before it was interrupted, told the "synch" thread to stop
- */
- public void testInterruptStopThread() throws Exception {
- log("=====" + this.getName() + "=====");
- PrimaryModel2 primaryModel3 = new PrimaryModel2();
- // a synchronize will occur here:
- SecondaryModel3 secondaryModel3 = new SecondaryModel3(primaryModel3);
- Command command3 = new SynchronizeSecondaryModelCommand2(primaryModel3, secondaryModel3);
- Synchronizer synchronizer3 = new SynchronousSynchronizer(command3);
- // another synchronize will occur here:
- primaryModel3.setSynchronizer(synchronizer3);
- secondaryModel3.setTicks(3);
-
- assertEquals(2, primaryModel3.getCount());
- assertEquals(5, primaryModel3.getCountPlus3());
- assertEquals(4, secondaryModel3.getDoubleCount());
- assertEquals(10, secondaryModel3.getDoubleCountPlus3());
-
- Thread syncThread = this.buildTriggerSynchronizeThread(primaryModel3, 1);
- Thread stopThread = this.buildStopThread(synchronizer3, 2);
- Thread interruptThread = this.buildInterruptThread(stopThread, 3);
-
- log("ALL threads start");
- stopThread.start();
- syncThread.start();
- interruptThread.start();
-
- stopThread.join();
- syncThread.join();
- interruptThread.join();
-
- // 'doubleCount' is synchronized; but the synchronization is stopped
- // while that is happening (by the 'stopThread'), so 'doubleCountPlus3'
- // does not get synchronized
- assertEquals(7, primaryModel3.getCount());
- assertEquals(10, primaryModel3.getCountPlus3());
- assertEquals(14, secondaryModel3.getDoubleCount());
-
- // this does not get updated because it would've been updated by the
- // recursive call to #synchronize(), but by that time #stop() had been called
- assertEquals(10, secondaryModel3.getDoubleCountPlus3());
- }
-
- /**
- * Code cloned from {@link #testStopCalledFromAnotherThread()}.
- *
- * Interrupt the "sync" thread while it is synchronizing, cutting short the synchronization.
- * Verify that no further synchronizations occur.
- * Verify the call to #stop() does not return until the pending
- * synchronization is stops after it is interrupted (must set {@link #DEBUG} to true and
- * look at the console).
- *
- * ticks:
- * 0 - start "sync" thread (which will sleep for 1 tick)
- * start "stop" thread (which will sleep for 2 ticks)
- * start "interrupt" thread (which will sleep for 3 ticks)
- * 1 - "sync" thread wakes up and calls PrimaryModel1.setCount(int)
- * which triggers call to Synchronizer.synchronize() to begin
- * synchronization of SecondaryModel (which will run for 4 ticks;
- * i.e. it will finish on tick 5)
- * 2 - "stop" thread wakes up and calls Synchronizer.stop() and should
- * wait until the synchronization is interrupted
- * 3 - "interrupt" thread wakes up and interrupts "sync" thread;
- * the "interrupt" thread runs to completion, while the "sync" thread keeps
- * going for another tick before it stops in "mid-synchronize"
- * 4 - the "sync" thread acknowledges the interrupt and stops in
- * "mid-synchronize"; it will stop since the "stop" thread told it to at tick 2;
- * the "sync" and "stop" threads run to completion
- */
- public void testInterruptSyncThread() throws Exception {
- log("=====" + this.getName() + "=====");
- PrimaryModel2 primaryModel3 = new PrimaryModel2();
- // a synchronize will occur here:
- SecondaryModel3 secondaryModel3 = new SecondaryModel3(primaryModel3);
- Command command3 = new SynchronizeSecondaryModelCommand2(primaryModel3, secondaryModel3);
- Synchronizer synchronizer3 = new SynchronousSynchronizer(command3);
- // another synchronize will occur here:
- primaryModel3.setSynchronizer(synchronizer3);
- secondaryModel3.setTicks(4);
-
- assertEquals(2, primaryModel3.getCount());
- assertEquals(5, primaryModel3.getCountPlus3());
- assertEquals(4, secondaryModel3.getDoubleCount());
- assertEquals(10, secondaryModel3.getDoubleCountPlus3());
-
- Thread syncThread = this.buildTriggerSynchronizeThread(primaryModel3, 1);
- Thread stopThread = this.buildStopThread(synchronizer3, 2);
- Thread interruptThread = this.buildInterruptThread(syncThread, 3);
-
- log("ALL threads start");
- stopThread.start();
- syncThread.start();
- interruptThread.start();
-
- stopThread.join();
- syncThread.join();
- interruptThread.join();
-
- assertEquals(7, primaryModel3.getCount());
- assertEquals(10, primaryModel3.getCountPlus3());
-
- // none of the secondary model is synchronized because the synchronize()
- // method was interrupted before any synchronization had occurred
- assertEquals(4, secondaryModel3.getDoubleCount());
- assertEquals(10, secondaryModel3.getDoubleCountPlus3());
- }
-
- private Thread buildInterruptThread(Thread thread, long ticks) {
- return this.buildThread(this.buildInterruptRunnable(thread, ticks), "interrupt");
- }
-
- private Runnable buildInterruptRunnable(final Thread thread, final long ticks) {
- return new Runnable() {
- public void run() {
- TestTools.sleep(ticks * TICK);
- log("INTERRUPT thread Thread.interrupt()");
- thread.interrupt();
- }
- };
- }
-
- /**
- * Call #stop() during a long-running "synchronize"; then call #start()
- * while the #stop() is waiting for the "synchronize" to complete.
- *
- * ticks:
- * 0 - start "sync" thread (which will sleep for 1 tick)
- * start "stop" thread (which will sleep for 2 ticks)
- * start "start" thread (which will sleep for 3 ticks)
- * 1 - "sync" thread wakes up and calls Synchronizer.synchronize() to begin
- * synchronization (which will run for 3 ticks; i.e. it will finish on tick 4)
- * 2 - "stop" thread wakes up and calls Synchronizer.stop() and should
- * wait until the synchronization is finished (i.e. tick 4)
- * 3 - "start" thread wakes up and calls Synchronizer.start()
- * which will throw an exception
- * 4 - the "sync" thread finishes execution;
- * it will stop since the "stop" thread told it to at tick 2;
- * the "sync" and "stop" threads run to completion
- */
- public void testCallStartDuringStop() throws Exception {
- log("=====" + this.getName() + "=====");
- DelayCommand command = this.buildDelayCommand(3);
- Synchronizer synchronizer = new SynchronousSynchronizer(command);
- synchronizer.start();
-
- Thread syncThread = this.buildSynchronizeThread(synchronizer, 1);
- Thread stopThread = this.buildStopThread(synchronizer, 2);
- SynchronizedBoolean exCaught = new SynchronizedBoolean(false);
- Thread startThread = this.buildStartThread(synchronizer, 3, exCaught);
-
- log("ALL threads start");
- syncThread.start();
- stopThread.start();
- startThread.start();
-
- syncThread.join();
- stopThread.join();
- startThread.join();
-
- assertTrue(exCaught.getValue());
- assertEquals(2, command.count);
- }
-
- private DelayCommand buildDelayCommand(int ticks) {
- return new DelayCommand(ticks);
- }
-
- class DelayCommand implements Command {
- final long ticks;
- boolean first = true;
- int count = 0;
-
- DelayCommand(int ticks) {
- super();
- this.ticks = ticks;
- }
-
- public void execute() {
- this.count++;
- // do nothing for the first call (from #start())
- if (this.first) {
- log("EXEC first");
- this.first = false;
- return;
- }
- log("EXEC start " + this.count);
- TestTools.sleep(this.ticks * TICK);
- log("EXEC stop " + this.count);
- }
-
- }
-
- private Thread buildStartThread(Synchronizer synchronizer, long ticks, SynchronizedBoolean exCaught) {
- return this.buildThread(this.buildStartRunnable(synchronizer, ticks, exCaught), "start");
- }
-
- private Runnable buildStartRunnable(final Synchronizer synchronizer, final long ticks, final SynchronizedBoolean exCaught) {
- return new Runnable() {
- public void run() {
- TestTools.sleep(ticks * TICK);
- log("START thread Synchronizer.start()");
- try {
- synchronizer.start();
- } catch (IllegalStateException ex) {
- exCaught.setTrue();
- log("START thread exception");
- }
- log("START thread stop");
- }
- };
- }
-
- private Thread buildSynchronizeThread(Synchronizer synchronizer, long ticks) {
- return this.buildThread(this.buildSynchronizeRunnable(synchronizer, ticks), "synchronize");
- }
-
- private Runnable buildSynchronizeRunnable(final Synchronizer synchronizer, final long ticks) {
- return new Runnable() {
- public void run() {
- TestTools.sleep(ticks * TICK);
- log("SYNC thread Synchronizer.synchronize()");
- synchronizer.synchronize();
- log("SYNC thread stop");
- }
- };
- }
-
- public void testException() throws Exception {
- BogusCommand command = new BogusCommand();
- Synchronizer synchronizer = new SynchronousSynchronizer(command);
- synchronizer.start();
-
- try {
- synchronizer.synchronize();
- } catch (NullPointerException ex) {
- // ignore
- }
-
- boolean exCaught = false;
- try {
- // we used to hang here, before we began handling exceptions
- synchronizer.stop();
- fail();
- } catch (CompositeException ex) {
- assertEquals(1, ex.getExceptions().length);
- exCaught = true;
- }
- assertTrue(exCaught);
- // start + synchronize
- assertEquals(2, command.count);
- }
-
- public class BogusCommand implements Command {
- int count = 0;
- public void execute() {
- this.count++;
- if (this.count > 1) {
- throw new NullPointerException();
- }
- }
- }
-
-
- // ********** synchronize commands **********
- public static class SynchronizeSecondaryModelCommand1 implements Command {
- private final SecondaryModel1 secondaryModel;
-
- public SynchronizeSecondaryModelCommand1(SecondaryModel1 secondaryModel) {
- super();
- this.secondaryModel = secondaryModel;
- }
-
- public void execute() {
- this.secondaryModel.synchronize();
- }
-
- }
-
- /**
- * the primary model (subclass) has to synchronize with itself (superclass)
- */
- public static class SynchronizeSecondaryModelCommand2 extends SynchronizeSecondaryModelCommand1 {
- private final PrimaryModel2 primaryModel;
-
- public SynchronizeSecondaryModelCommand2(PrimaryModel2 primaryModel, SecondaryModel2 secondaryModel) {
- super(secondaryModel);
- this.primaryModel = primaryModel;
- }
-
- @Override
- public void execute() {
- super.execute();
- this.primaryModel.synchronize();
- }
-
- }
-
- // ********** primary models **********
- /**
- * this object will call the synchronizer whenever its count changes,
- * allowing interested parties to synchronize with the change
- */
- public static class PrimaryModel1 {
- protected Synchronizer synchronizer;
- protected int count = 2;
-
- public PrimaryModel1() {
- super();
- this.setSynchronizer_(Synchronizer.Null.instance());
- }
-
- public int getCount() {
- return this.count;
- }
- public void setCount(int count) {
- if (count != this.count) {
- this.count = count;
- this.stateChanged();
- }
- }
-
- protected void stateChanged() {
- this.synchronizer.synchronize();
- }
-
- public void setSynchronizer(Synchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.synchronizer.stop();
- this.setSynchronizer_(synchronizer);
- }
-
- protected void setSynchronizer_(Synchronizer synchronizer) {
- this.synchronizer = synchronizer;
- this.synchronizer.start();
- }
-
- public void startSynchronizer() {
- this.synchronizer.start(); // this should cause an exception
- }
- public void dispose() {
- this.synchronizer.stop();
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.getClass().getSimpleName());
- sb.append('(');
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
- public void toString(StringBuilder sb) {
- sb.append("count=");
- sb.append(this.count);
- }
-
- }
-
- /**
- * This model synchronizes with itself, triggering a recursive synchronization
- * with the change. Whenever the [inherited] 'count' changes, 'countPlus3'
- * is updated appropriately and another synchronize is initiated if appropriate.
- */
- public static class PrimaryModel2 extends PrimaryModel1 {
- private int countPlus3 = 0;
-
- public PrimaryModel2() {
- super();
- this.countPlus3 = this.count + 3;
- }
-
- public int getCountPlus3() {
- return this.countPlus3;
- }
- protected void setCountPlus3(int countPlus3) {
- if (countPlus3 != this.countPlus3) {
- this.countPlus3 = countPlus3;
- this.stateChanged();
- }
- }
-
- // synchronize with itself, so to speak
- public void synchronize() {
- this.setCountPlus3(this.count + 3);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(", countPlus3=");
- sb.append(this.countPlus3);
- }
-
- }
-
- // ********** secondary models **********
- /**
- * This dependent object updates its 'doubleCount' whenever the
- * PrimaryModel1's 'count' changes, via the 'synchronizer'.
- */
- public static class SecondaryModel1 {
- protected final PrimaryModel1 primaryModel;
- protected int doubleCount = 0;
-
- public SecondaryModel1(PrimaryModel1 primaryModel) {
- super();
- this.primaryModel = primaryModel;
- this.synchronize();
- }
-
- public void synchronize() {
- this.doubleCount = this.primaryModel.getCount() * 2;
- }
-
- public int getDoubleCount() {
- return this.doubleCount;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.getClass().getSimpleName());
- sb.append('(');
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
- public void toString(StringBuilder sb) {
- sb.append("doubleCount=");
- sb.append(this.doubleCount);
- }
-
- }
-
- public static class SecondaryModel2 extends SecondaryModel1 {
- private int doubleCountPlus3 = 0;
-
- public SecondaryModel2(PrimaryModel2 extendedPrimaryModel) {
- super(extendedPrimaryModel);
- }
-
- protected PrimaryModel2 getExtendedPrimaryModel() {
- return (PrimaryModel2) this.primaryModel;
- }
-
- @Override
- public void synchronize() {
- super.synchronize();
- int temp = this.getExtendedPrimaryModel().getCountPlus3() * 2;
- if (this.doubleCountPlus3 != temp) {
- this.doubleCountPlus3 = temp;
- }
- }
-
- public int getDoubleCountPlus3() {
- return this.doubleCountPlus3;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(", doubleCountPlus3=");
- sb.append(this.doubleCountPlus3);
- }
-
- }
-
- /**
- * Allow the time required to synchronize to be specified.
- * A (non-delayed) synchronize will execute before we have a chance to
- * change the tick count. (It is called in the SecondaryModel1 constructor.)
- */
- public static class SecondaryModel3 extends SecondaryModel2 {
- private long delay = 0;
- public SecondaryModel3(PrimaryModel2 primaryModel) {
- super(primaryModel);
- }
-
- public void setTicks(long ticks) {
- this.delay = ticks * TICK;
- }
-
- @Override
- public void synchronize() {
- // don't log anything until 'ticks' is set
- if (this.delay == 0) {
- super.synchronize();
- } else {
- log("SYNC thread start - sync duration will be: " + (this.delay / TICK) + " ticks");
- try {
- Thread.sleep(this.delay);
- } catch (InterruptedException ex) {
- log("SYNC thread interrupted");
- TestTools.sleep(TICK);
- return; // stop synchronize (i.e. don't call super.synchronize())
- }
- super.synchronize();
- log("SYNC thread stop");
- }
- }
-
- }
-
- public void testDEBUG() {
- assertFalse(DEBUG);
- }
-
- public static final boolean DEBUG = false;
- public static void log(String message) {
- if (DEBUG) {
- log_(message);
- }
- }
-
- private static void log_(String message) {
- System.out.print(timestamp());
- System.out.print(' ');
- System.out.print(message);
- System.out.println();
- }
-
- public static String timestamp() {
- return String.valueOf((System.currentTimeMillis() % 10000) / 1000f);
- }
-
-}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/test.xml b/common/tests/org.eclipse.jpt.common.utility.tests/test.xml
deleted file mode 100644
index 14635f2af1..0000000000
--- a/common/tests/org.eclipse.jpt.common.utility.tests/test.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?> <!-- Copyright (c) 2007, 2010 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation --> <project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.common.utility.tests"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.common.utility.tests.internal.JptCommonUtilityTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project
deleted file mode 100644
index 7064cbb9c5..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.properties
deleted file mode 100644
index 7d721a4154..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties
deleted file mode 100644
index 1ec5c11f47..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink DBWS Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - EclipseLink DBWS Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml
deleted file mode 100644
index 38ef9e1581..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.dbws.eclipselink.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.dbws.eclipselink.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.eclipselink.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.dbws.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.dbws.eclipselink.core.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="javax.wsdl"
- version="1.6.2.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.dbws"
- version="2.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.dbws.builder"
- version="2.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.dbws.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.mappings b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 80f93d0255..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - DBWS EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 1c3e2eb73b..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 1429a53f4c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - DBWS EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index c6c18cd9d0..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - DBWS EclipseLink Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index a8c9da3a8a..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - DBWS EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 1429a53f4c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - DBWS EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project
deleted file mode 100644
index b4ba97299c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index 931945e37c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.dbws.eclipselink.feature.source=org.eclipse.jpt.dbws.eclipselink.feature
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index 8150339a80..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink DBWS Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - EclipseLink DBWS Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2010, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index eefc6901f4..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.dbws.eclipselink_sdk.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.dbws.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.dbws.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project
deleted file mode 100644
index b3f1d9bfe7..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.properties
deleted file mode 100644
index e29906deb9..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties
deleted file mode 100644
index 0227502983..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JAXB Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - EclipseLink JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml
deleted file mode 100644
index 210f90d3d4..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.eclipselink.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jaxb.eclipselink.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.jaxb.feature" version="1.0.0"/>
- <import feature="org.eclipse.jpt.common.eclipselink.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.persistence.moxy"
- download-size="0"
- install-size="0"
- version="2.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.core.schemagen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index e21f19415d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - JAXB EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 57daebf248..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 8a4402b35f..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB EclipseLink Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index e21f19415d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - JAXB EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 57daebf248..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project
deleted file mode 100644
index a51d4183a3..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index c8dc8260e0..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jaxb.eclipselink.feature.source=org.eclipse.jpt.jaxb.eclipselink.feature
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index ebf310a10d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JAXB Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - EclipseLink JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2010, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index 5c05e8c602..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.eclipselink_sdk.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jaxb.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.feature/.project
deleted file mode 100644
index 6b7e145cd1..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/build.properties
deleted file mode 100644
index e29906deb9..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties
deleted file mode 100644
index 2aabe7d81f..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml
deleted file mode 100644
index 6f04142313..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jaxb.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jaxb.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.core.schemagen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 5bc4b671f1..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source - JAXB Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 86c4916ad2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index fba3ef0266..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 1a12bce83a..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 6f32073796..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source - JAXB Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008, 2010. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 86c4916ad2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project
deleted file mode 100644
index d48dee7bd4..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties
deleted file mode 100644
index 918f79e94d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB Core JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools JAXB JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml
deleted file mode 100644
index 7c26e5f952..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.tests.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.tests.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jaxb.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project
deleted file mode 100644
index dbf60be032..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties
deleted file mode 100644
index cb9672db24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jaxb.feature.source=org.eclipse.jpt.jaxb.feature
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties
deleted file mode 100644
index c924dcbcb8..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools SDK - JAXB Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence Tools - JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2010, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml
deleted file mode 100644
index eacc81fe3c..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb_sdk.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jaxb.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project
deleted file mode 100644
index de731ab893..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index c6c16f392a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.html b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini
deleted file mode 100644
index 6c107d466d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties
deleted file mode 100644
index 7ed9bf2fc2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - EclipseLink DBWS Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties
deleted file mode 100644
index 6c20e3b027..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml
deleted file mode 100644
index 434ae90d00..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.dbws.eclipselink.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.dbws.eclipselink.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.dbws.eclipselink.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.png b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties
deleted file mode 100644
index cdf657e329..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink DBWS Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath
deleted file mode 100644
index 64c5e31b7a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project
deleted file mode 100644
index 4c657b1ec5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.core.gen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7fd88b1dd7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:03 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
deleted file mode 100644
index be182acf00..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.core.gen;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.persistence.dbws.builder;bundle-version="[2.3.0,3.0.0)",
- javax.wsdl;bundle-version="[1.6.2,2.0.0)"
-Export-Package: org.eclipse.jpt.dbws.eclipselink.core.gen,
- org.eclipse.jpt.dbws.eclipselink.core.gen.internal;x-internal:=true
-Import-Package: org.eclipse.persistence.oxm
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H2>About This Content</H2>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties
deleted file mode 100644
index 5a838ab2cc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties
deleted file mode 100644
index 5d537fcf12..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - DBWS Support - Web Services Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java
deleted file mode 100644
index 4f6f4451a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.core.gen;
-
-import static java.util.logging.Level.INFO;
-import static java.util.logging.Level.SEVERE;
-import static org.eclipse.persistence.tools.dbws.DBWSPackager.ArchiveUse.ignore;
-
-import java.io.File;
-import java.util.logging.Level;
-
-import javax.wsdl.WSDLException;
-
-import org.eclipse.jpt.dbws.eclipselink.core.gen.internal.JptDbwsCoreMessages;
-import org.eclipse.jpt.dbws.eclipselink.core.gen.internal.Tools;
-import org.eclipse.persistence.oxm.XMLContext;
-import org.eclipse.persistence.oxm.XMLUnmarshaller;
-import org.eclipse.persistence.tools.dbws.DBWSBuilder;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModel;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModelProject;
-import org.eclipse.persistence.tools.dbws.DBWSPackager;
-import org.eclipse.persistence.tools.dbws.EclipsePackager;
-
-/**
- * Generate DBWS content
- *
- * Current command-line arguments:
- * [-builderFile dbws-builder.xml] - specifies source builder file
- * [-stageDir .\Output_Dir] - specifies destination directory
- * [-packageAs eclipse] - specifies the source package
- */
-public class Main
-{
- private String builderFile;
- private String stageDir;
- private String packageAs;
- @SuppressWarnings("unused")
- private boolean isDebugMode;
-
- // ********** static methods **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- // ********** constructors **********
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
-
- this.initializeWith(args);
-
- this.generate();
- }
-
- private void generate() {
-
- DBWSBuilder builder = new DBWSBuilder();
-
- DBWSBuilderModel model = this.buildBuilderModel(this.builderFile);
- if(model == null) {
- this.logMessage(INFO, JptDbwsCoreMessages.NO_GENERATION_PERFORMED);
- return;
- }
-
- builder.setProperties(model.properties);
- builder.setOperations(model.operations);
-
- if( ! this.jdbcDriverIsOnClasspath(builder.getDriver())) {
- return;
- }
-
- DBWSPackager packager = this.buildEclipsePackager();
-
- this.initializePackager(packager, builder, this.buildStageDir(this.stageDir));
- builder.setPackager(packager);
-
- try {
- builder.start();
- }
- catch(WSDLException e) {
- this.logMessage(SEVERE, JptDbwsCoreMessages.WSDL_EXCEPTION, e.getMessage());
- return;
- }
- catch(Exception e) {
- //TODO Clean-up Stage dir. ?
- this.logMessage(SEVERE, JptDbwsCoreMessages.GENERATION_FAILED, e.getMessage());
- e.printStackTrace();
- return;
- }
- this.logMessage(INFO, JptDbwsCoreMessages.GENERATION_COMPLETED);
- return;
-
- }
-
- // ********** internal methods **********
-
- private void initializeWith(String[] args) {
-
- this.builderFile = this.getArgumentBuilderFile(args);
- this.stageDir = this.getArgumentStageDir(args);
- this.packageAs = this.getArgumentPackageAs(args);
-
- this.isDebugMode = this.getArgumentDebugMode(args);
- }
-
- private void initializePackager(DBWSPackager packager, DBWSBuilder builder, File stageDir) {
-
- packager.setDBWSBuilder(builder);
- packager.setArchiveUse(ignore);
- packager.setAdditionalArgs(null);
- packager.setStageDir(stageDir);
- packager.setSessionsFileName(builder.getSessionsFileName());
- }
-
- private DBWSBuilderModel buildBuilderModel(String builderFileName) {
-
- File builderFile = this.getBuilderFile(builderFileName);
- return this.unmarshal(builderFile);
- }
-
- private DBWSBuilderModel unmarshal(File builderFile) {
- if((builderFile == null) || ( ! builderFile.exists())) {
- return null;
- }
- XMLContext context = new XMLContext(new DBWSBuilderModelProject());
- XMLUnmarshaller unmarshaller = context.createUnmarshaller();
-
- DBWSBuilderModel model = (DBWSBuilderModel)unmarshaller.unmarshal(builderFile);
- if(model.properties.size() == 0) {
- this.logMessage(SEVERE, JptDbwsCoreMessages.NO_OPERATIONS_SPECIFIED);
- return null;
- }
- return model;
- }
-
- private File getBuilderFile(String builderFileName) {
-
- File builderFile = new File(builderFileName);
- if( ! (builderFile.exists() && builderFile.isFile())) {
- this.logMessage(SEVERE,
- JptDbwsCoreMessages.UNABLE_TO_LOCATE_BUILDER_XML, builderFileName); //$NON-NLS-1$
- return null;
- }
- return builderFile;
- }
-
- private File buildStageDir(String stageDirName) {
- File dir = new File(stageDirName);
- if(( ! dir.exists()) || ( ! dir.isDirectory())) {
- dir = Tools.buildDirectory(stageDirName);
- }
- return dir;
- }
-
- private EclipsePackager buildEclipsePackager() {
- return new EclipsePackager() {
- @Override
- public void start() {
- // no need to check for the existence of stageDir, everything is in-memory
- }
- };
- }
-
- private boolean jdbcDriverIsOnClasspath(String jdbcDriverName) {
- try {
- Class.forName(jdbcDriverName);
- }
- catch (ClassNotFoundException cnfe) {
- this.logMessage(SEVERE, JptDbwsCoreMessages.DRIVER_NOT_ON_CLASSPATH, jdbcDriverName);
- return false;
- }
- return true;
- }
-
- private void logMessage(Level level, String key, Object argument) {
- Tools.logMessage(level, Tools.bind(key, argument));
- }
-
- private void logMessage(Level level, String key) {
- Tools.logMessage(level, Tools.getString(key));
- }
-
- // ********** argument queries **********
-
- private String getArgumentBuilderFile(String[] args) {
-
- return this.getArgumentValue("-builderFile", args); //$NON-NLS-1$
- }
-
- private String getArgumentStageDir(String[] args) {
-
- return this.getArgumentValue("-stageDir", args); //$NON-NLS-1$
- }
-
- private String getArgumentPackageAs(String[] args) {
-
- return this.getArgumentValue("-packageAs", args); //$NON-NLS-1$
- }
-
- private boolean getArgumentDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- private String getArgumentValue(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private boolean argumentExists(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java
deleted file mode 100644
index ff3fa9b9fb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.core.gen.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Localized messages used by Dali DBWS generation core.
- */
-public class JptDbwsCoreMessages
-{
-
- public static final String GENERATION_COMPLETED = "GENERATION_COMPLETED";
- public static final String GENERATION_FAILED = "GENERATION_FAILED";
- public static final String NO_GENERATION_PERFORMED = "NO_GENERATION_PERFORMED";
- public static final String WSDL_EXCEPTION = "WSDL_EXCEPTION";
- public static final String NO_OPERATIONS_SPECIFIED = "NO_OPERATIONS_SPECIFIED";
- public static final String UNABLE_TO_LOCATE_BUILDER_XML = "UNABLE_TO_LOCATE_BUILDER_XML";
- public static final String DRIVER_NOT_ON_CLASSPATH = "DRIVER_NOT_ON_CLASSPATH";
-
-
- private static final String BUNDLE_NAME = "org.eclipse.jpt.dbws.eclipselink.core.gen.internal.jpt_dbws_core"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private JptDbwsCoreMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java
deleted file mode 100644
index 7a49d7aaae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.core.gen.internal;
-
-import static java.util.logging.Level.SEVERE;
-
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.logging.Level;
-
-/**
- * Tools
- */
-public final class Tools
-{
- /** empty string */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- private static final String USER_DIRECTORY = System.getProperty("user.dir"); //$NON-NLS-1$
-
- // ********** queries **********
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(String string) {
- if (string == null) {
- return true;
- }
- int len = string.length();
- if (len == 0) {
- return true;
- }
- return stringIsEmpty_(string.toCharArray(), len);
- }
-
- private static boolean stringIsEmpty_(char[] s, int len) {
- for (int i = len; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- // ********** short name manipulation **********
-
-
- public static File buildDirectory(String dirName) {
- File currentDir = currentWorkingDirectory();
- File dir = new File(currentDir, dirName);
- dir.mkdir();
- return dir;
- }
-
- /**
- * Return a file representing the current working directory.
- */
- public static File currentWorkingDirectory() {
- return new File(USER_DIRECTORY); //$NON-NLS-1$
- }
-
- /**
- * Strip the extension from the specified file name
- * and return the result. If the file name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return fileName;
- }
- return fileName.substring(0, index);
- }
-
- public static String extractDirectory(String path) {
- if( ! path.contains(File.separator)) {
- return EMPTY_STRING;
- }
- return path.substring(0, path.lastIndexOf(File.separator));
- }
-
- public static void logMessage(Level level, String message) {
- if(level == SEVERE) {
- System.err.println('\n' + message);
- }
- else {
- System.out.println('\n' + message);
- }
- }
-
- // ********** NLS utilities **********
-
- public static String getString(String key) {
- return JptDbwsCoreMessages.getString(key);
- }
-
- public static String bind(String key, Object argument) {
- return MessageFormat.format(getString(key), argument);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties
deleted file mode 100644
index c49d70feb4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-GENERATION_COMPLETED = DBWSBuilder generation completed
-GENERATION_FAILED = DBWSBuilder generation failed: {0}
-NO_GENERATION_PERFORMED = DBWSBuilder no generation performed
-WSDL_EXCEPTION = WSDLException: {0}
-NO_OPERATIONS_SPECIFIED = No operations specified
-UNABLE_TO_LOCATE_BUILDER_XML = DBWSBuilder unable to locate builder XML file: {0}
-DRIVER_NOT_ON_CLASSPATH = JDBC driver not on classpath: {0}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
deleted file mode 100644
index 76f5da81fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project
deleted file mode 100644
index 7d3b57f9f6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3fa75e2387..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:08 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 8e3e367e5d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.dbws.eclipselink.core.gen;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.persistence.core;bundle-version="[2.3.0,3.0.0)",
- org.eclipse.persistence.dbws.builder;bundle-version="[2.3.0,3.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.500,2.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,2.0.0)"
-Export-Package: org.eclipse.jpt.dbws.eclipselink.core.internal.gen;x-internal:=true,
- org.eclipse.jpt.dbws.eclipselink.ui,
- org.eclipse.jpt.dbws.eclipselink.ui.internal;x-internal:=true,
- org.eclipse.jpt.dbws.eclipselink.ui.internal.actions;x-internal:=true,
- org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/about.html b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
deleted file mode 100644
index 377eb5ce7a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml
deleted file mode 100644
index 4bf2db832f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.dbws.eclipselink.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.dbws.eclipselink.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif
deleted file mode 100644
index 1ee05fa2e5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif
deleted file mode 100644
index cc0eeb7196..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif
deleted file mode 100644
index 3c0acadd2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif
deleted file mode 100644
index 77c16a0f87..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties
deleted file mode 100644
index efab1b2e17..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - DBWS UI
-providerName=Eclipse Web Tools Platform
-
-generateDBWS = Generate Database Web Services
-
-dbwsWizardCategoryName = Database Web Services
-
-generateDbwsFromXmlName = Web Services from Builder XML
-generateDbwsFromXmlDesc = Generate Web Services from Builder XML
-
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml
deleted file mode 100644
index 5c52d864fe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- Copyright (c) 2010, 2011 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.ui.menus">
-
- <!-- contributions for any popup -->
- <menuContribution
- locationURI="popup:org.eclipse.ui.popup.any">
-
- <menu
- id="org.eclipse.jpt.dbws.ui.menu.WebServices"
- label="%dbwsWizardCategoryName">
- </menu>
- </menuContribution>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.dbws"
- name="%dbwsWizardCategoryName"/>
-
- <wizard
- id="org.eclipse.jpt.dbws.ui.wizard.generateDbws"
- name="%generateDbwsFromXmlName"
- category="org.eclipse.jpt.dbws"
- class="org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen.DbwsGeneratorWizard"
- icon="icons/full/etool16/newclient_webserv_wiz.gif">
- <description>%generateDbwsFromXmlDesc</description>
- </wizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <!-- contributions to the "Generate" submenu -->
- <objectContribution
- id="org.eclipse.jpt.ui.xsdFileActions"
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*builder.xml">
-
- <filter
- name="projectNature"
- value="org.eclipse.jdt.core.javanature">
- </filter>
- <enablement>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.web"/>
- </enablement>
- <action
- id="org.eclipse.jpt.dbws.ui.generateDbws"
- label="%generateDBWS"
- menubarPath="org.eclipse.jpt.dbws.ui.menu.WebServices/content"
- class="org.eclipse.jpt.dbws.eclipselink.ui.internal.actions.GenerateDbwsAction">
- </action>
- </objectContribution>
-
- </extension>
-
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties
deleted file mode 100644
index 0d62c677d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-
-# DbwsGenerator
-DbwsGeneratorWizard_title = New Database Web Services from Builder XML
-DbwsGeneratorWizard_generatingDbws = Generating Database Web Services
-
-WebDynamicProjectWizardPage_title = Web Dynamic Project
-WebDynamicProjectWizardPage_desc = Specify project for Database Web Services
-WebDynamicProjectWizardPage_destinationProject = Select destination project:
-
-BuilderXmlWizardPage_title = Select Builder XML File
-BuilderXmlWizardPage_desc = Specify XML file to generate Database Web Services from
-
-BuilderXmlWizardPage_errorUriCannotBeLocated = The selected catalog entry specifies a URI that can not be located.
-
-JdbcDriverWizardPage_title = Driver files
-JdbcDriverWizardPage_desc = Specify driver JAR files
-
-JdbcDriverWizardPage_driverFiles = Driver files:
-
-JdbcDriverWizardPage_addButton = Add...
-JdbcDriverWizardPage_removeButton = Remove
-
-JdbcDriverWizardPage_chooseADriverFile = Driver File Selection
-
-DbwsGeneratorUi_runningDbwsWarningTitle = Generating Database Web Services
-DbwsGeneratorUi_runningDbwsWarningMessage = \
- Warning: Running DBWS Builder will overwrite existing files in your project.\
- \n\nAre you sure you want to continue?
-
-DbwsGeneratorUi_dbwsNotOnClasspathMessage = \
- Warning: DBWS Builder is not on your project classpath.\
- \n\nAre you sure you want to continue?
-
-DbwsGeneratorUi_notJavaProject = Not a java project
-DbwsGeneratorUi_notWebDynamicProject = Not a WebDynamic project
-
-BuilderXmlWizardPage_xmlCatalogTableTitle = XML Catalog
-BuilderXmlWizardPage_xmlCatalogKeyColumn = Key
-BuilderXmlWizardPage_xmlCatalogUriColumn = URI \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java
deleted file mode 100644
index 16c1e6c586..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.core.internal.gen;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * DbwsGenerator
- */
-public class DbwsGenerator extends AbstractJptGenerator
-{
- static public String LAUNCH_CONFIG_NAME = "DBWS Gen Run Config"; //$NON-NLS-1$
- static public String DBWS_GEN_PACKAGE_NAME = "org.eclipse.jpt.dbws.eclipselink.core.gen"; //$NON-NLS-1$
- static public String DBWS_GEN_CLASS = DBWS_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
-
- static public String DBWS_GEN_JAR_PREFIX = DBWS_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
-
- private final String builderFileName;
- private final String stageDirName;
- private final String driverJarList;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String builderFileName,
- String stageDirName,
- String driverJarList,
- IProgressMonitor monitor) {
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new DbwsGenerator(javaProject,
- builderFileName,
- stageDirName,
- driverJarList).generate(monitor);
- }
-
- // ********** constructors **********
-
- private DbwsGenerator(
- IJavaProject javaProject,
- String builderFileName,
- String stageDirName,
- String driverJarList) {
- super(javaProject);
- this.builderFileName = builderFileName;
- this.stageDirName = stageDirName;
- this.driverJarList = driverJarList;
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return DBWS_GEN_CLASS;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected String getBootstrapJarPrefix() {
- return DBWS_GEN_JAR_PREFIX;
- }
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // do nothing
-
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- try {
- this.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // DBWS_Gen jar
- classpath.add(this.getBootstrapJarClasspathEntry().getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // JDBC jar
- if( ! StringTools.stringIsEmpty(this.driverJarList)) {
- classpath.add(this.getJdbcJarClasspathEntry().getMemento());
- }
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
-
- StringBuffer programArguments = new StringBuffer();
-
- // builderFile
- programArguments.append(" -builderFile \""); //$NON-NLS-1$
- programArguments.append(this.builderFileName);
- programArguments.append('"');
-
- // stageDir
- programArguments.append(" -stageDir \""); //$NON-NLS-1$
- programArguments.append(this.stageDirName);
- programArguments.append('"');
-
- // packageAs
- programArguments.append(" -packageAs eclipse"); //$NON-NLS-1$
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- // ********** private methods **********
-
- private IRuntimeClasspathEntry getJdbcJarClasspathEntry() {
- return getArchiveClasspathEntry(this.buildJdbcJarPath());
- }
-
- private IPath buildJdbcJarPath() {
- return new Path(this.driverJarList);
- }
-
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java
deleted file mode 100644
index 25b0f74546..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptDbwsUiPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.dbws.eclipselink.ui"; //$NON-NLS-1$
-
- public static final String USER_CATALOG_ID = XMLCorePlugin.USER_CATALOG_ID; //$NON-NLS-1$
- public static final String DEFAULT_CATALOG_ID = XMLCorePlugin.DEFAULT_CATALOG_ID; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_ID = XMLCorePlugin.SYSTEM_CATALOG_ID; //$NON-NLS-1$
-
- // ********** singleton **********
- private static JptDbwsUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptDbwsUiPlugin instance() {
- return INSTANCE;
- }
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
- // ********** Image API **********
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- // ********** XMLCorePlugin API **********
-
- public ICatalog getDefaultXMLCatalog() {
- return XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- }
-
-
- // ********** constructors **********
-
- public JptDbwsUiPlugin() {
- super();
- if(INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java
deleted file mode 100644
index 8000bf3b6c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal;
-
-import java.io.File;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.dbws.eclipselink.core.internal.gen.DbwsGenerator;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen.DbwsGeneratorWizard;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.persistence.oxm.XMLContext;
-import org.eclipse.persistence.oxm.XMLUnmarshaller;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModel;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModelProject;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * DbwsGeneratorUi
- */
-public class DbwsGeneratorUi
-{
- private final IJavaProject javaProject;
- private final String builderXmlFile;
-
- private static final String WEB_FACET_ID = "jst.web"; //$NON-NLS-1$
- private static final String DRIVER_PROPERTY = "driver"; //$NON-NLS-1$
- private static final String DBWS_BUILDER_CLASS_NAME = "org.eclipse.persistence.tools.dbws.DBWSBuilder"; //$NON-NLS-1$
-
- // ********** static methods **********
-
- public static void generate(IFile xmlFile) {
- IProject project = xmlFile.getProject();
-
- if( ! projectIsWebDynamic(project)) {
- throw new RuntimeException(JptDbwsUiMessages.DbwsGeneratorUi_notWebDynamicProject);
- }
- IPath xmlPath = xmlFile.getProjectRelativePath();
-
- new DbwsGeneratorUi(project, xmlPath.toOSString()).generate();
- }
-
- public static boolean projectIsWebDynamic(IProject project) {
-
- IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(WEB_FACET_ID);
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(project);
- }
- catch (CoreException e) {
- return false;
- }
- return (facetedProject == null) ? false : facetedProject.hasProjectFacet(projectFacet);
- }
-
- public static IPath getWebContentPath(IProject project){
- IVirtualComponent component = ComponentCore.createComponent(project);
- IPath modulePath = component.getRootFolder().getProjectRelativePath();
- return modulePath;
- }
-
- public static boolean displayDBWSNotOnClasspathWarning(Shell shell) {
-
- String msg = JptDbwsUiMessages.DbwsGeneratorUi_dbwsNotOnClasspathMessage;
-
- return MessageDialog.openQuestion(
- shell,
- JptDbwsUiMessages.DbwsGeneratorUi_runningDbwsWarningTitle,
- msg);
- }
-
- public static boolean displayOverridingWebContentWarning(Shell shell) {
-
- String msg = JptDbwsUiMessages.DbwsGeneratorUi_runningDbwsWarningMessage;
-
- return MessageDialog.openQuestion(
- shell,
- JptDbwsUiMessages.DbwsGeneratorUi_runningDbwsWarningTitle,
- msg);
- }
-
- // ********** constructors **********
-
- private DbwsGeneratorUi(IProject webProject, String builderXmlFile) {
- super();
- if(webProject == null || StringTools.stringIsEmpty(builderXmlFile)) {
- throw new NullPointerException();
- }
- this.javaProject = this.getJavaProjectFrom(webProject);
- if(this.javaProject == null) {
- throw new RuntimeException(JptDbwsUiMessages.DbwsGeneratorUi_notJavaProject);
- }
- this.builderXmlFile = builderXmlFile;
- }
-
- // ********** generate **********
- /**
- * prompt the user with a wizard
- */
- protected void generate() {
-
- if( ! this.dbwsIsOnClasspath()) {
- if( ! displayDBWSNotOnClasspathWarning(this.getCurrentShell())) {
- return;
- }
- }
- if(this.classIsOnProjectsClasspath(
- this.getDriverNameFrom(this.builderXmlFile))) {
-
- if(displayOverridingWebContentWarning(this.getCurrentShell())) {
- this.scheduleGenerateDbwsJob();
- }
- return;
- }
- this.openWizardDialog();
- return;
- }
-
- // ********** internal methods **********
-
- private void openWizardDialog() {
-
- DbwsGeneratorWizard wizard = new DbwsGeneratorWizard(this.javaProject, this.builderXmlFile);
- wizard.setWindowTitle(JptDbwsUiMessages.DbwsGeneratorWizard_title);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if(returnCode != Window.OK) {
- return;
- }
- }
-
- private String getDriverNameFrom(String builderXmlFile) {
- try {
- DBWSBuilderModel model = this.buildBuilderModel(builderXmlFile);
- Map<String, String> properties = model.getProperties();
- return properties.get(DRIVER_PROPERTY);
- }
- catch(Exception e) {
- return null;
- }
- }
-
- private DBWSBuilderModel buildBuilderModel(String builderFileName) {
- String projectDirName = this.javaProject.getProject().getLocation().toOSString();
- File builderFile = this.getBuilderFile(projectDirName + File.separator + builderFileName);
- return this.unmarshal(builderFile);
- }
-
- private DBWSBuilderModel unmarshal(File builderFile) {
- if((builderFile == null) || ( ! builderFile.exists())) {
- return null;
- }
- XMLContext context = new XMLContext(new DBWSBuilderModelProject());
- XMLUnmarshaller unmarshaller = context.createUnmarshaller();
-
- DBWSBuilderModel model = (DBWSBuilderModel)unmarshaller.unmarshal(builderFile);
- if(model == null || model.properties.size() == 0) {
- return null;
- }
- return model;
- }
-
- private File getBuilderFile(String builderFileName) {
-
- File builderFile = new File(builderFileName);
- if( ! (builderFile.exists() && builderFile.isFile())) {
- return null;
- }
- return builderFile;
- }
-
- /**
- * Test if the given class is on the project's classpath.
- */
- private boolean classIsOnProjectsClasspath(String driverName) {
- try {
- if(StringTools.stringIsEmpty(driverName)) {
- return false;
- }
- IType genClass = this.javaProject.findType(driverName);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Test if the DBWS builder is on the project's classpath.
- */
- private boolean dbwsIsOnClasspath() {
- try {
- IType genClass = this.javaProject.findType(DBWS_BUILDER_CLASS_NAME);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- private IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- private void scheduleGenerateDbwsJob() {
-
- String stageDirName = this.javaProject.getProject().getLocation().toOSString();
-
- WorkspaceJob generateJob = new GenerateDbwsJob(
- this.javaProject,
- this.builderXmlFile,
- stageDirName,
- null // driverJarList
- );
- generateJob.schedule();
- }
-
- // ********** generate DBWS job **********
-
- public static class GenerateDbwsJob extends WorkspaceJob {
- private final IJavaProject project;
- final String builderFileName;
- final String stageDirName;
- final String driverJarList;
-
- public GenerateDbwsJob(IJavaProject project, String builderFileName, String stageDirName, String driverJarList) {
- super(JptDbwsUiMessages.DbwsGeneratorWizard_generatingDbws);
-
- this.project = project ;
- this.builderFileName = builderFileName;
- this.stageDirName = stageDirName;
- this.driverJarList = driverJarList;
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- DbwsGenerator.generate(this.project, this.builderFileName, this.stageDirName, this.driverJarList, monitor);
- return Status.OK_STATUS;
- }
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java
deleted file mode 100644
index 38beda8da7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal;
-
-@SuppressWarnings("nls")
-public class JptDbwsUiIcons
-{
- // **************** Wizard icons *******************************************
-
- public static final String DBWS_GEN_WIZ_BANNER = "full/wizban/webservicesclient_wiz";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java
deleted file mode 100644
index 1610eac2a3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali DBWS UI.
- *
- * @version 2.3
- */
-public class JptDbwsUiMessages {
-
- // DbwsGenerator
- public static String DbwsGeneratorWizard_title;
- public static String DbwsGeneratorWizard_generatingDbws;
-
- public static String WebDynamicProjectWizardPage_title;
- public static String WebDynamicProjectWizardPage_desc;
- public static String WebDynamicProjectWizardPage_destinationProject;
-
- public static String BuilderXmlWizardPage_title;
- public static String BuilderXmlWizardPage_desc;
-
- public static String BuilderXmlWizardPage_errorUriCannotBeLocated;
-
- public static String JdbcDriverWizardPage_title;
- public static String JdbcDriverWizardPage_desc;
-
- public static String JdbcDriverWizardPage_driverFiles;
-
- public static String JdbcDriverWizardPage_addButton;
- public static String JdbcDriverWizardPage_removeButton;
-
- public static String JdbcDriverWizardPage_chooseADriverFile;
-
- public static String DbwsGeneratorUi_runningDbwsWarningTitle;
- public static String DbwsGeneratorUi_runningDbwsWarningMessage;
- public static String DbwsGeneratorUi_dbwsNotOnClasspathMessage;
-
- public static String DbwsGeneratorUi_notJavaProject;
- public static String DbwsGeneratorUi_notWebDynamicProject;
-
- public static String BuilderXmlWizardPage_xmlCatalogTableTitle;
- public static String BuilderXmlWizardPage_xmlCatalogKeyColumn;
- public static String BuilderXmlWizardPage_xmlCatalogUriColumn;
-
-
-
-
- private static final String BUNDLE_NAME = "jpt_dbws_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptDbwsUiMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptDbwsUiMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.java
deleted file mode 100644
index 1dfee6b4b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
-
-/**
- * GenerateDbwsAction
- */
-public class GenerateDbwsAction extends ObjectAction
-{
-
- @Override
- protected void execute(IFile xmlFile) {
-
- DbwsGeneratorUi.generate(xmlFile);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.java
deleted file mode 100644
index 5c90f1e584..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * GenerateEntitiesAction
- */
-public abstract class ObjectAction extends ActionDelegate implements IObjectActionDelegate
-{
- private ISelection currentSelection;
-
- public ObjectAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- @Override
- public void run(IAction action) {
- if (this.currentSelection instanceof ITreeSelection) {
- for (Iterator<?> stream = ((ITreeSelection) this.currentSelection).iterator(); stream.hasNext(); ) {
- this.execute(stream.next());
- }
- }
- }
-
- protected void execute(Object selection) {
-
- if(selection instanceof IFile) {
- this.execute((IFile)selection);
- }
- }
-
- @SuppressWarnings("unused")
- protected void execute(IFile file) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java
deleted file mode 100644
index 5eb23fc72e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-
-/**
- * BuilderXmlWizardPage
- */
-public class BuilderXmlWizardPage extends WizardPage {
-
- private final IStructuredSelection initialSelection;
- private IProject targetProject;
-
- protected SelectFileOrXMLCatalogIdPanel selectSourcePanel;
-
- protected static final String[] browseXMLFilterExtensions = {".xml"}; //$NON-NLS-1$
-
- // ********** static method **********
-
- public static IFile getBuilderXmlFromSelection(IStructuredSelection selection) {
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IFile) {
- String elementExtension = ((IFile)firstElement).getFileExtension();
- if(elementExtension != null) {
- if(browseXMLFilterExtensions[0].endsWith(elementExtension)) {
- return ((IFile)firstElement);
- }
- }
- }
- return null;
- }
-
- // ********** constructor **********
-
- BuilderXmlWizardPage(IStructuredSelection selection) {
- super("BuilderXmlWizardPage"); //$NON-NLS-1$
-
- this.initialSelection = selection;
- }
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- this.setControl(composite);
-
- this.selectSourcePanel = new SelectFileOrXMLCatalogIdPanel(composite, this.initialSelection);
- this.selectSourcePanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- SelectFileOrXMLCatalogIdPanel.PanelListener listener = new SelectFileOrXMLCatalogIdPanel.PanelListener() {
- public void completionStateChanged() {
- selectFileOrXMLCatalogIdPanelChanged();
- }
- };
- this.selectSourcePanel.setListener(listener);
- Dialog.applyDialogFont(parent);
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible) {
-
- if(this.getBuilderXml() != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.getBuilderXml()));
- }
- else {
- this.updateTargetProject();
- IFile schema = getBuilderXmlFromSelection(this.initialSelection);
- if(schema != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(schema));
- }
- else {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.targetProject));
- }
- }
- this.selectSourcePanel.update();
-
- this.setTitle(JptDbwsUiMessages.BuilderXmlWizardPage_title);
- this.setDescription(JptDbwsUiMessages.BuilderXmlWizardPage_desc);
- this.selectSourcePanel.setFilterExtensions(browseXMLFilterExtensions);
- }
- this.selectSourcePanel.setVisibleHelper(visible);
- }
-
- // ********** IWizardPage implementation **********
-
- @Override
- public boolean isPageComplete() {
-
- return this.schemaOrUriSelected() && (this.getErrorMessage() == null);
- }
-
- // ********** intra-wizard methods **********
-
- public IFile getBuilderXml() {
- return this.selectSourcePanel.getFile();
- }
-
- public String getSourceURI() {
- String uri = this.selectSourcePanel.getXMLCatalogURI();
- if(uri == null) {
- IFile file = this.selectSourcePanel.getFile();
- if(file != null) {
- uri = URIHelper.getPlatformURI(file);
- }
- }
- return uri;
- }
-
- // ********** internal methods **********
-
- private void updateTargetProject() {
- IWizardPage previousPage = this.getPreviousPage();
-
- if(previousPage instanceof JavaProjectWizardPage) {
- // get project from previousPage
- this.targetProject = (((JavaProjectWizardPage)previousPage).getJavaProject()).getProject();
- }
- else if(initialSelection != null && ! this.initialSelection.isEmpty()) {
- // no previousPage - get project from initialSelection
- this.targetProject = this.getProjectFromInitialSelection();
- }
- }
-
- private IProject getProjectFromInitialSelection() {
- Object firstElement = initialSelection.getFirstElement();
- if(firstElement instanceof IProject) {
- return (IProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- return ((IResource) firstElement).getProject();
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject().getProject();
- }
- return null;
- }
-
- private boolean schemaOrUriSelected() {
- return ((this.getBuilderXml() != null) || (this.getSourceURI() != null));
- }
-
- private String computeErrorMessage() {
- String errorMessage = null;
- String uri = this.getSourceURI();
- if(uri != null) {
- if( ! URIHelper.isReadableURI(uri, false)) {
- errorMessage = JptDbwsUiMessages.BuilderXmlWizardPage_errorUriCannotBeLocated;
- }
- }
- return errorMessage;
- }
-
- private void selectFileOrXMLCatalogIdPanelChanged() {
- String errorMessage = this.computeErrorMessage();
- this.setErrorMessage(errorMessage);
- this.setPageComplete(this.isPageComplete());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
deleted file mode 100644
index a0c798a854..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-/**
- * DbwsGeneratorWizard
- */
-public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
-
- private IJavaProject javaProject;
- private String builderXmlFile;
- private IStructuredSelection selection;
-
- private WebDynamicProjectWizardPage projectWizardPage;
- private BuilderXmlWizardPage builderXmlWizardPage;
-
- // Dialog store id constant
- private static final String WIZARD_NAME = DbwsGeneratorWizard.class.getName();
- private static final String DBWS_SECTION_NAME = "DbwsSettings"; //$NON-NLS-1$
-
- private JdbcDriverWizardPage jdbcDriversPage;
-
- // ********** constructor **********
-
- public DbwsGeneratorWizard() {
- super();
-
- this.initialize();
- }
-
- public DbwsGeneratorWizard(IJavaProject javaProject, String builderXmlFile) {
- super();
-
- this.javaProject = javaProject;
- this.builderXmlFile = builderXmlFile;
-
- this.initialize();
- }
-
- private void initialize() {
- if(this.getDialogSettings() == null) {
- IDialogSettings dbwsSettings = JptDbwsUiPlugin.instance().getDialogSettings();
- IDialogSettings wizardSettings = dbwsSettings.getSection(DBWS_SECTION_NAME);
- if(wizardSettings == null) {
- wizardSettings = dbwsSettings.addNewSection(DBWS_SECTION_NAME);
- }
- this.setDialogSettings(wizardSettings);
- }
- }
-
- // ********** IWorkbenchWizard implementation **********
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
-
- this.setWindowTitle(JptDbwsUiMessages.DbwsGeneratorWizard_title);
-
- this.setDefaultPageImageDescriptor(JptDbwsUiPlugin.getImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
- this.setNeedsProgressMonitor(true);
- }
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
-
- if(this.selection != null) {
- // WebDynamicProjectWizardPage
- this.javaProject = this.getJavaProjectFromSelection(this.selection);
-
- this.projectWizardPage = this.buildWebDynamicProjectPage(this.javaProject);
- this.addPage(this.projectWizardPage);
-
- // BuilderXmlWizardPage
- IFile builderXmlSelected = BuilderXmlWizardPage.getBuilderXmlFromSelection(this.selection);
- if(builderXmlSelected == null) {
- this.builderXmlWizardPage = this.buildBuilderXmlPage(this.selection);
- this.addPage(this.builderXmlWizardPage);
- }
- else {
- this.builderXmlFile = this.makeRelativeToProjectPath(builderXmlSelected.getFullPath());
- }
- }
- // JdbcDriverWizardPage
- this.jdbcDriversPage = this.buildJdbcDriversPage();
- this.addPage(this.jdbcDriversPage);
- }
-
- @Override
- public boolean performFinish() {
-
- WizardPage currentPage = (WizardPage)getContainer().getCurrentPage();
- if(currentPage != null) {
- if( ! currentPage.isPageComplete()) {
- return false;
- }
- }
-
- String driverJarList = this.jdbcDriversPage.getDriverJarList();
- this.jdbcDriversPage.finish(); // persist settings
-
- if(DbwsGeneratorUi.displayOverridingWebContentWarning(this.getShell())) {
- this.generateDbws(driverJarList);
- }
- return true;
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- if(this.projectWizardPage != null) {
- this.javaProject = this.projectWizardPage.getJavaProject();
- }
- return this.javaProject;
- }
-
- public String getBuilderXmlPathOrUri() {
- if(this.builderXmlWizardPage != null) {
- IFile xmlFile = this.builderXmlWizardPage.getBuilderXml();
- if(xmlFile != null) {
- return this.makeRelativeToProjectPath(xmlFile.getFullPath());
- }
- else {
- return this.builderXmlWizardPage.getSourceURI();
- }
- }
- return this.builderXmlFile;
- }
-
- // ********** internal methods **********
-
- private WebDynamicProjectWizardPage buildWebDynamicProjectPage(IJavaProject javaProject) {
-
- WebDynamicProjectWizardPage projectWizardPage = new WebDynamicProjectWizardPage(javaProject);
- projectWizardPage.setTitle(JptDbwsUiMessages.WebDynamicProjectWizardPage_title);
- projectWizardPage.setDescription(JptDbwsUiMessages.WebDynamicProjectWizardPage_desc);
- projectWizardPage.setDestinationLabel(JptDbwsUiMessages.WebDynamicProjectWizardPage_destinationProject);
-
- return projectWizardPage;
- }
-
- private BuilderXmlWizardPage buildBuilderXmlPage(IStructuredSelection selection) {
- return new BuilderXmlWizardPage(selection);
- }
-
- private JdbcDriverWizardPage buildJdbcDriversPage() {
- return new JdbcDriverWizardPage(WIZARD_NAME);
- }
-
- private String makeRelativeToProjectPath(IPath path) {
- IPath relativePath = path.makeRelativeTo(this.getJavaProject().getProject().getFullPath());
- return relativePath.toOSString();
- }
-
- private void generateDbws(String driverJarList) {
-
- String stageDirName = this.getJavaProject().getProject().getLocation().toOSString();
-
- WorkspaceJob generateJob = new DbwsGeneratorUi.GenerateDbwsJob(
- this.getJavaProject(),
- this.getBuilderXmlPathOrUri(),
- stageDirName,
- driverJarList
- );
- generateJob.schedule();
- }
-
- private IJavaProject getJavaProjectFromSelection(IStructuredSelection selection) {
- if(selection == null) {
- return null;
- }
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IJavaProject) {
- return (IJavaProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- IProject project = ((IResource) firstElement).getProject();
- return getJavaProjectFrom(project);
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject();
- }
- return null;
- }
-
- private IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
deleted file mode 100644
index 8f5c9d1f07..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-/**
- * JdbcDriversWizardPage
- */
-public class JdbcDriverWizardPage extends WizardPage
-{
- private final String storedDriverClasspathId;
- private ArrayList<String> jarPaths;
-
- public static String BINDINGS_FILE_FILTER = "*.jar;*.zip"; //$NON-NLS-1$
- // dialog store id constants
- private static final String PAGE_ID = "DRIVER_CLASSPATH_ID"; //$NON-NLS-1$
- private static final String PATH_SEPARATOR = System.getProperty("path.separator"); //$NON-NLS-1$
-
- // ********** constructor **********
-
- protected JdbcDriverWizardPage(String wizardName) {
- super("Jdbc Driver"); //$NON-NLS-1$
-
- this.initialize();
-
- this.jarPaths = new ArrayList<String>();
- this.storedDriverClasspathId = wizardName + "." + PAGE_ID; //$NON-NLS-1$
- }
-
- protected void initialize() {
- this.setTitle(JptDbwsUiMessages.JdbcDriverWizardPage_title);
- this.setDescription(JptDbwsUiMessages.JdbcDriverWizardPage_desc);
- this.setImageDescriptor(JptDbwsUiPlugin.getImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
- }
-
- // ********** intra-wizard methods **********
-
- public void finish() {
- this.saveWidgetValues();
- }
-
- public String getDriverJarList() {
- return this.buildDriverJarListString();
- }
-
- // ********** internal methods **********
-
- /**
- * Initializes the JAR package from last used wizard page values.
- */
- private void initializeJarPaths() {
- IDialogSettings settings= this.getDialogSettings();
- if(settings != null) {
- // destination
- String[] driverPaths = settings.getArray(this.storedDriverClasspathId);
- if(driverPaths == null) {
- return; // ie.- no settings stored
- }
- this.jarPaths = new ArrayList<String>();
-
- CollectionTools.addAll(this.jarPaths, driverPaths);
- }
- }
-
- private void saveWidgetValues() {
- IDialogSettings settings= this.getDialogSettings();
-
- if(settings != null) {
- String[] driverPaths = this.jarPaths.toArray(new String[0]);
- settings.put(this.storedDriverClasspathId, driverPaths);
- }
- }
-
- private String buildDriverJarListString() {
- if(this.jarPaths.isEmpty()) {
- return StringTools.EMPTY_STRING;
- }
- StringBuffer result = new StringBuffer();
- for(String jar : this.jarPaths) {
- result.append(jar).append(PATH_SEPARATOR);
- }
- result.deleteCharAt(result.length() - 1); // remove last separator
- return result.toString();
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.initializeJarPaths();
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- new JarsGroup(composite);
-
- return composite;
- }
-
- // ********** private methods **********
-
- private void removeJarFile(String filePath) {
- this.jarPaths.remove(filePath);
- }
-
- private void addJarFile(String filePath) {
- if( ! this.jarPaths.contains(filePath)) {
- this.jarPaths.add(filePath);
- }
- }
-
- // ********** JarsGroup class **********
-
- private class JarsGroup {
-
-
- // ********** constructor **********
-
- private JarsGroup(Composite parent) {
- super();
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(2, false); //must be 4 for the package controls
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, HELP_CONTEXT_ID);
-
- this.buildLabel(composite, 2, JptDbwsUiMessages.JdbcDriverWizardPage_driverFiles);
-
- this.buildDriverFilesTable(composite);
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- IWizard wizard = getWizard();
-
- if( ! (wizard instanceof DbwsGeneratorWizard)) {
- throw new NullPointerException();
- }
- return ((DbwsGeneratorWizard)wizard).getJavaProject();
- }
-
- private ArrayList<String> getJarPaths() {
- return jarPaths;
- }
-
- // ********** private methods **********
-
- private TableViewer buildDriverFilesTable(Composite parent) {
-
- TableViewer tableViewer = this.buildTableViewer(parent, this.getJarPaths());
-
- this.buildAddRemoveButtons(parent, tableViewer);
- return tableViewer;
- }
-
- private TableViewer buildTableViewer(Composite parent, ArrayList<String> tableDataModel) {
-
- TableLayoutComposite tableLayout = new TableLayoutComposite(parent, SWT.NONE);
- this.addColumnsData(tableLayout);
-
- final Table table = new Table(tableLayout, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
- table.setLinesVisible(false);
-
- TableColumn column = new TableColumn(table, SWT.NONE, 0);
- column.setResizable(true);
-
- GridData gridData= new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 1;
- gridData.heightHint= SWTUtil.getTableHeightHint(table, 7);
- tableLayout.setLayoutData(gridData);
-
- TableViewer tableViewer = new TableViewer(table);
- tableViewer.setUseHashlookup(true);
- tableViewer.setLabelProvider(this.buildLabelProvider());
- tableViewer.setContentProvider(this.buildContentProvider());
-
- tableViewer.setInput(tableDataModel);
- tableViewer.refresh();
- return tableViewer;
- }
-
- private void buildAddRemoveButtons(Composite parent, final TableViewer tableViewer) {
-
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
- // Add buttons
- Button addButton = new Button(buttonComposite, SWT.PUSH);
- addButton.setText(JptDbwsUiMessages.JdbcDriverWizardPage_addButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- addButton.setLayoutData(gridData);
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- ArrayList<String> jarFiles = promptJarFiles();
- for(String jarFile : jarFiles) {
- addJarFile(jarFile);
- }
- tableViewer.refresh();
- }
- });
- // Remove buttons
- Button removeButton = new Button(buttonComposite, SWT.PUSH);
- removeButton.setText(JptDbwsUiMessages.JdbcDriverWizardPage_removeButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- removeButton.setLayoutData(gridData);
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- StructuredSelection selection = (StructuredSelection)tableViewer.getSelection();
- if(selection.isEmpty()) {
- return;
- }
- String jarFile = (String)selection.getFirstElement();
- removeJarFile(jarFile);
-
- tableViewer.refresh();
- }
- });
- addButton.setFocus();
- }
-
- private IBaseLabelProvider buildLabelProvider() {
- return new TableLabelProvider();
- }
-
- private IContentProvider buildContentProvider() {
- return new TableContentProvider();
- }
-
- private ArrayList<String> promptJarFiles() {
- String projectPath= this.getJavaProject().getProject().getLocation().toString();
-
- FileDialog dialog = new FileDialog(getShell(), SWT.MULTI);
- dialog.setText(JptDbwsUiMessages.JdbcDriverWizardPage_chooseADriverFile);
- dialog.setFilterPath(projectPath);
- dialog.setFilterExtensions(new String[] {BINDINGS_FILE_FILTER});
-
- dialog.open();
- String path = dialog.getFilterPath();
- String[] fileNames = dialog.getFileNames();
- ArrayList<String> results = new ArrayList<String>(fileNames.length);
- for(String fileName : fileNames) {
- results.add(path + File.separator + fileName);
- }
- return results;
- }
-
- private void addColumnsData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- /**
- * Build and return a label
- */
- private Label buildLabel(Composite parent, int span, String text) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- // ********** inner class **********
-
- private class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- return (String)element;
- }
- }
-
- private class TableContentProvider implements IStructuredContentProvider {
-
- TableContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return ((Collection<?>) inputElement).toArray();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
deleted file mode 100644
index 7f36cc306f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-
-public class SelectFileOrXMLCatalogIdPanel extends Composite implements SelectionListener {
-
- public interface PanelListener {
- void completionStateChanged();
- }
-
- protected PanelListener listener;
- protected PageBook pageBook;
-
- protected SelectFilePanel selectFilePanel;
- protected SelectXMLCatalogIdPanel selectXMLCatalogIdPanel;
-
- // ********** constructor **********
-
- public SelectFileOrXMLCatalogIdPanel(Composite parent, IStructuredSelection selection) {
- super(parent, SWT.NONE);
-
- // container group
- setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 400;
- gd.widthHint = 400;
- setLayoutData(gd);
-
- pageBook = new PageBook(this, SWT.NONE);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- selectFilePanel = new SelectFilePanel(pageBook, selection);
- this.setSingleFileViewDefaultSelection(selection);
-
- // Catalog
- ICatalog xmlCatalog = JptDbwsUiPlugin.instance().getDefaultXMLCatalog();
- selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
- selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateCompletionStateChange();
- }
- });
- Dialog.applyDialogFont(parent);
- pageBook.showPage(selectFilePanel.getControl());
- }
-
- public void setSingleFileViewDefaultSelection(ISelection selection) {
- this.selectFilePanel.setDefaultSelection(selection);
- }
-
- public IFile getFile() {
- return selectFilePanel.getFile();
- }
-
- public String getXMLCatalogURI() {
- return null; // XMLCatalog not supported
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- selectXMLCatalogIdPanel.setCatalogEntryType(catalogEntryType);
- }
-
- public void setFilterExtensions(String[] filterExtensions) {
- selectFilePanel.resetFilters();
- selectFilePanel.addFilterExtensions(filterExtensions);
-
- selectXMLCatalogIdPanel.getTableViewer().setFilterExtensions(filterExtensions);
- }
-
- public void setListener(PanelListener listener) {
- this.listener = listener;
- }
-
- public void setVisibleHelper(boolean isVisible) {
- selectFilePanel.setVisibleHelper(isVisible);
- }
-
- public void updateCompletionStateChange() {
- if (listener != null) {
- listener.completionStateChanged();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- pageBook.showPage(selectFilePanel.getControl());
-
- updateCompletionStateChange();
- }
-
- // ********** inner class **********
-
- protected class SelectFilePanel extends SelectSingleFileViewFacade implements SelectSingleFileViewFacade.Listener {
- protected Control control;
-
- public SelectFilePanel(Composite parent, IStructuredSelection selection) {
- super(selection, true);
- // String[] ext = {".dtd"};
- // addFilterExtensions(ext);
- control = createControl(parent);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
- SelectFilePanel.this.setListener(this);
- }
-
- public Control getControl() {
- return control;
- }
-
- public void setControlComplete(boolean isComplete) {
- updateCompletionStateChange();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.java
deleted file mode 100644
index c5363d54e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SelectSingleFileView
- *
- * Façade class to change accessibility of SelectSingleFileView.
- */
-@SuppressWarnings("restriction")
-public class SelectSingleFileViewFacade extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView {
-
- public static interface Listener extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView.Listener
- {}
-
- public SelectSingleFileViewFacade(IStructuredSelection selection, boolean isFileMandatory) {
- super(selection, isFileMandatory);
- }
-
- public void addFilterExtensions(String[] filterExtensions) {
- super.addFilterExtensions(filterExtensions);
- }
-
- public Composite createControl(Composite parent) {
- return super.createControl(parent);
- }
-
- public IFile getFile() {
- return super.getFile();
- }
-
- public void resetFilters() {
- super.resetFilters();
- }
-
- public void setVisibleHelper(boolean isVisible) {
- super.setVisibleHelper(isVisible);
- }
-
- public void setDefaultSelection(ISelection selection) {
- super.setDefaultSelection(selection);
- }
-
- public void setListener(Listener listener) {
- super.setListener(listener);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
deleted file mode 100644
index 3e1ec46a64..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-
-public class SelectXMLCatalogIdPanel extends Composite {
- protected int catalogEntryType;
- protected boolean doTableSizeHack = false;
-
- protected XMLCatalogTableViewer tableViewer;
- protected ICatalog fXmlCatalog;
-
- public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog) {
- super(parent, SWT.NONE);
- this.fXmlCatalog = xmlCatalog;
-
- GridLayout gridLayout = new GridLayout();
- this.setLayout(gridLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
- gd.widthHint = 700;
- this.setLayoutData(gd);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogTableTitle);
-
- tableViewer = createTableViewer(this);
- tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- tableViewer.setInput("dummy"); //$NON-NLS-1$
- }
-
- protected XMLCatalogTableViewer createTableViewer(Composite parent) {
- String headings[] = new String[2];
- headings[0] = JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogKeyColumn;
- headings[1] = JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogUriColumn;
-
- XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings) {
-
- protected void addXMLCatalogEntries(List list, ICatalogEntry[] entries) {
- for (int i = 0; i < entries.length; i++) {
- ICatalogEntry entry = entries[i];
- if (catalogEntryType == 0) {
- list.add(entry);
- }
- else if (catalogEntryType == entry.getEntryType()) {
- list.add(entry);
- }
- }
- }
-
- public Collection getXMLCatalogEntries() {
- List result = null;
-
- if ((fXmlCatalog == null) || doTableSizeHack) {
- // this lets us create a table with an initial height of
- // 10 rows
- // otherwise we get stuck with 0 row heigh table... that's
- // too small
- doTableSizeHack = false;
- result = new Vector();
- for (int i = 0; i < 6; i++) {
- result.add(""); //$NON-NLS-1$
- }
- }
- else {
- result = new Vector();
- INextCatalog[] nextCatalogs = fXmlCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (JptDbwsUiPlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog systemCatalog = referencedCatalog;
- addXMLCatalogEntries(result, systemCatalog.getCatalogEntries());
-
- }
- else if (JptDbwsUiPlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog userCatalog = referencedCatalog;
- addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
-
- }
- }
- }
- }
- return result;
- }
- };
- return theTableViewer;
- }
-
-
- public String getId() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getKey() : null;
- }
-
- public XMLCatalogTableViewer getTableViewer() {
- return tableViewer;
- }
-
- public String getURI() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getURI() : null;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof ICatalogEntry) {
- result = (ICatalogEntry) selectedObject;
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- this.catalogEntryType = catalogEntryType;
- tableViewer.refresh();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java
deleted file mode 100644
index 0e32bfda55..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
-
-/**
- * WebDynamicProjectWizardPage
- */
-public class WebDynamicProjectWizardPage extends JavaProjectWizardPage {
-
- public WebDynamicProjectWizardPage(IJavaProject javaProject) {
- super(javaProject);
- }
-
- @Override
- protected Iterable<IProject> getJavaProjects() {
- return new FilteringIterable<IProject>(CollectionTools.collection(this.getProjects())) {
- @Override
- protected boolean accept(IProject next) {
- return DbwsGeneratorUi.projectIsWebDynamic(next);
- }
- };
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
deleted file mode 100644
index c556561adf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-import com.ibm.icu.text.Collator;
-
-public class XMLCatalogTableViewer extends TableViewer {
-
- protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
-
- protected static Image dtdFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/dtdfile.gif"); //$NON-NLS-1$
- protected static Image unknownFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/text.gif"); //$NON-NLS-1$
- protected static Image xsdFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/XSDFile.gif"); //$NON-NLS-1$
- protected static Image errorImage = JptDbwsUiPlugin.getImage("icons/full/ovr16/error_ovr.gif"); //$NON-NLS-1$
-
- // ********** constructor **********
-
- public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
- super(parent, SWT.FULL_SELECTION);
-
- Table table = getTable();
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- for (int i = 0; i < columnProperties.length; i++) {
- TableColumn column = new TableColumn(table, i);
- column.setText(columnProperties[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(50, true));
- }
- table.setLayout(layout);
- table.setLinesVisible(false);
-
- setColumnProperties(columnProperties);
-
- setContentProvider(new CatalogEntryContentProvider());
- setLabelProvider(new CatalogEntryLabelProvider());
- }
-
- public Collection getXMLCatalogEntries() {
- return null;
- }
-
- public void menuAboutToShow(IMenuManager menuManager) {
- Action action = new Action("hello") { //$NON-NLS-1$
- public void run() {
- System.out.println("run!"); //$NON-NLS-1$
- }
- };
- menuManager.add(action);
- }
-
- public void setFilterExtensions(String[] extensions) {
- resetFilters();
- addFilter(new XMLCatalogTableViewerFilter(extensions));
- }
-
- // ********** inner class **********
-
- public class CatalogEntryContentProvider implements IStructuredContentProvider {
-
- public void dispose() {
- }
-
- public Object[] getElements(Object element) {
- Object[] array = getXMLCatalogEntries().toArray();
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- int result = 0;
- if ((o1 instanceof ICatalogEntry) && (o2 instanceof ICatalogEntry)) {
- ICatalogEntry mappingInfo1 = (ICatalogEntry) o1;
- ICatalogEntry mappingInfo2 = (ICatalogEntry) o2;
- result = Collator.getInstance().compare(mappingInfo1.getKey(), mappingInfo2.getKey());
- }
- return result;
- }
- };
- Arrays.sort(array, comparator);
- return array;
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
- public class CatalogEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object object, int columnIndex) {
- Image result = null;
- if (columnIndex == 0) {
- Image base = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- String uri = catalogEntry.getURI();
- if (uri.endsWith("dtd")) { //$NON-NLS-1$
- base = dtdFileImage;
- }
- else if (uri.endsWith("xsd")) { //$NON-NLS-1$
- base = xsdFileImage;
- }
- else {
- base = unknownFileImage;
- }
-
- if (base != null) {
- if (URIHelper.isReadableURI(uri, false)) {
- result = base;
- }
- else {
- // TODO... SSE port
- result = base;// imageFactory.createCompositeImage(base,
- // errorImage,
- // ImageFactory.BOTTOM_LEFT);
- }
- }
- }
- }
- return result;
- }
-
- public String getColumnText(Object object, int columnIndex) {
- String result = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- result = columnIndex == 0 ? catalogEntry.getKey() : catalogEntry.getURI();
- result = URIHelper.removePlatformResourceProtocol(result);
- }
- return result != null ? result : ""; //$NON-NLS-1$
- }
- }
-
- class XMLCatalogTableViewerFilter extends ViewerFilter {
- protected String[] extensions;
-
- public XMLCatalogTableViewerFilter(String[] extensions) {
- this.extensions = extensions;
- }
-
- public boolean isFilterProperty(Object element, Object property) {
- return false;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean result = false;
- if (element instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) element;
- for (int i = 0; i < extensions.length; i++) {
- if (catalogEntry.getURI().endsWith(extensions[i])) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project
deleted file mode 100644
index 98560920c2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 1eae124537..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties
deleted file mode 100644
index 9bd22c769c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - JAXB Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties
deleted file mode 100644
index 11a4e44db6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties,\
- component.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml
deleted file mode 100644
index bc275a758e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jaxb.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.png b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties
deleted file mode 100644
index fbe477feb2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
deleted file mode 100644
index 025cb3b6fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core.schemagen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b92672fdf6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:29 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
deleted file mode 100644
index 74056248bf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.core.schemagen;singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.xml.bind
-Export-Package: org.eclipse.jpt.jaxb.core.schemagen,
- org.eclipse.jpt.jaxb.core.schemagen.internal;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H2>About This Content</H2>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties
deleted file mode 100644
index d535c6112b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties
deleted file mode 100644
index 2e7dfca4c9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JAXB Support - Schema Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java
deleted file mode 100644
index 9f6a922785..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.schemagen;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jpt.jaxb.core.schemagen.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.schemagen.internal.Tools;
-
-/**
- * Generate a JAXB Schema
- *
- * Current command-line arguments:
- * [-s schema.xsd] - specifies the target schema
- * [-c className] - specifies the fully qualified class name
- *
- * [-p packageName] - specifies the source package // @deprecated
- */
-public class Main
-{
- private String[] sourceClassNames;
- private String targetSchemaName;
- @SuppressWarnings("unused")
- private boolean isDebugMode;
-
- static public String NO_FACTORY_CLASS = "doesnt contain ObjectFactory.class"; //$NON-NLS-1$
-
- // ********** static methods **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- // ********** constructors **********
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
-
- this.initializeWith(args);
-
- this.generate();
- }
-
- // ********** internal methods **********
-
- private void initializeWith(String[] args) {
- this.sourceClassNames = this.getSourceClassNames(args);
- this.targetSchemaName = this.getTargetSchemaName(args);
-
- this.isDebugMode = this.getDebugMode(args);
- }
-
- private void generate() {
- // Create the JAXBContext
- JAXBContext jaxbContext = this.buildJaxbContext();
-
- // Generate an XML Schema
- if(jaxbContext != null) {
- this.generateSchema(jaxbContext);
- }
- else {
- System.out.println(Tools.bind(JptJaxbCoreMessages.SCHEMA_NOT_CREATED, this.targetSchemaName));
- }
- }
-
- private JAXBContext buildJaxbContext() {
- System.out.println(Tools.getString(JptJaxbCoreMessages.LOADING_CLASSES));
- JAXBContext jaxbContext = null;
- try {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- Class[] sourceClasses = this.buildSourceClasses(this.sourceClassNames, loader);
-
- jaxbContext = JAXBContext.newInstance(sourceClasses);
- }
- catch(JAXBException ex) {
- this.handleException(ex);
- }
- return jaxbContext;
- }
-
- private void generateSchema(JAXBContext jaxbContext) {
- System.out.println(Tools.getString(JptJaxbCoreMessages.GENERATING_SCHEMA));
- System.out.flush();
-
- SchemaOutputResolver schemaOutputResolver =
- new JptSchemaOutputResolver(this.targetSchemaName);
-
- try {
- jaxbContext.generateSchema(schemaOutputResolver);
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private Class[] buildSourceClasses(String[] classNames, ClassLoader loader) {
-
- ArrayList<Class> sourceClasses = new ArrayList<Class>(classNames.length);
- for(String className: classNames) {
- try {
- sourceClasses.add(loader.loadClass(className));
- System.out.println(className);
- }
- catch (ClassNotFoundException e) {
- System.err.println(Tools.bind(JptJaxbCoreMessages.NOT_FOUND, className));
- }
- }
- System.out.flush();
- return sourceClasses.toArray(new Class[0]);
- }
-
- private void handleException(JAXBException ex) {
- String message = ex.getMessage();
- Throwable linkedEx = ex.getLinkedException();
- if(message != null && message.indexOf(NO_FACTORY_CLASS) > -1) {
- System.err.println(message);
- }
- else if(linkedEx != null && linkedEx instanceof ClassNotFoundException) {
- String errorMessage = Tools.bind(JptJaxbCoreMessages.CONTEXT_FACTORY_NOT_FOUND, linkedEx.getMessage());
- System.err.println(errorMessage);
- }
- else {
- ex.printStackTrace();
- }
- }
-
- // ********** argument queries **********
-
- private String[] getSourceClassNames(String[] args) {
-
- return this.getAllArgumentValue("-c", args); //$NON-NLS-1$
- }
-
- private String getTargetSchemaName(String[] args) {
-
- return this.getArgumentValue("-s", args); //$NON-NLS-1$
- }
-
- private boolean getDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- // ********** private methods **********
-
- private String getArgumentValue(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private String[] getAllArgumentValue(String argName, String[] args) {
- List<String> argValues = new ArrayList<String>();
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- argValues.add(args[j]);
- i++;
- }
- }
- }
- return argValues.toArray(new String[0]);
- }
-
- private boolean argumentExists(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- return true;
- }
- }
- return false;
- }
-
-}
-
-// ********** inner class **********
-
-class JptSchemaOutputResolver extends SchemaOutputResolver {
-
- private final String defaultSchemaName;
-
- // ********** constructor **********
-
- protected JptSchemaOutputResolver(String defaultSchemaName) {
- this.defaultSchemaName = defaultSchemaName;
- }
-
- // ********** overrides **********
-
- @Override
- public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException {
-
- String filePath = (Tools.stringIsEmpty(namespaceURI)) ?
- this.buildFileNameFrom(this.defaultSchemaName, suggestedFileName) :
- this.modifyFileName(namespaceURI);
-
- filePath = this.canonicalFileName(filePath);
- File file = new File(filePath);
- StreamResult result = new StreamResult(file);
- result.setSystemId(file.toURL().toExternalForm());
-
- System.out.print(Tools.bind(JptJaxbCoreMessages.SCHEMA_GENERATED, file));
- return result;
- }
-
- // ********** private methods **********
-
- private String buildFileNameFrom(String fileName, String suggestedFileName) {
-
- fileName = Tools.stripExtension(fileName);
-
- if(Tools.stringIsEmpty(fileName)) {
- return suggestedFileName;
- }
- String number = Tools.extractFileNumber(suggestedFileName);
-
- fileName = this.buildFileName(fileName, number);
- return Tools.appendXsdExtension(fileName);
- }
-
- private String buildFileName(String fileName, String number) {
-
- if(Tools.stringIsEmpty(number)) {
- return fileName;
- }
- return (number.equals("0")) ? fileName : fileName + number; //$NON-NLS-1$
- }
-
- private String modifyFileName(String namespaceURI) throws IOException {
-
- String dir = Tools.extractDirectory(this.defaultSchemaName);
-
- String fileName = Tools.stripProtocol(namespaceURI);
- fileName = fileName.replaceAll("/", "_"); //$NON-NLS-1$
- fileName = Tools.appendXsdExtension(fileName);
-
- String result = (Tools.stringIsEmpty(dir)) ? fileName : dir + File.separator + fileName;
-
- return result;
- }
-
- private String canonicalFileName(String fileName) {
- return this.canonicalFile(new File(fileName)).getAbsolutePath();
- }
-
- private File canonicalFile(File file) {
- try {
- return file.getCanonicalFile();
- }
- catch (IOException ioexception) {
- return file.getAbsoluteFile();
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java
deleted file mode 100644
index 49170533dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.schemagen.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Localized messages used by Dali JAXB core.
- */
-public class JptJaxbCoreMessages
-{
-
- public static final String LOADING_CLASSES = "LOADING_CLASSES";
- public static final String GENERATING_SCHEMA = "GENERATING_SCHEMA";
- public static final String SCHEMA_GENERATED = "SCHEMA_GENERATED";
- public static final String SCHEMA_NOT_CREATED = "SCHEMA_NOT_CREATED";
- public static final String NOT_FOUND = "NOT_FOUND";
- public static final String CONTEXT_FACTORY_NOT_FOUND = "CONTEXT_FACTORY_NOT_FOUND";
-
-
- private static final String BUNDLE_NAME = "org.eclipse.jpt.jaxb.core.schemagen.internal.jpt_jaxb_core"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private JptJaxbCoreMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.java
deleted file mode 100644
index 6427661dcd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.schemagen.internal;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-/**
- * Tools
- */
-public final class Tools
-{
- /** default file name used by the schemagen */
- static public String GEN_DEFAULT_NAME = "schema"; //$NON-NLS-1$
-
- /** empty string */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- // ********** queries **********
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(String string) {
- if (string == null) {
- return true;
- }
- int len = string.length();
- if (len == 0) {
- return true;
- }
- return stringIsEmpty_(string.toCharArray(), len);
- }
-
- private static boolean stringIsEmpty_(char[] s, int len) {
- for (int i = len; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- // ********** short name manipulation **********
-
- /**
- * Strip the extension from the specified file name
- * and return the result. If the file name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return fileName;
- }
- return fileName.substring(0, index);
- }
-
- public static String stripProtocol(String uri) {
-
- return uri.replaceFirst("http://", EMPTY_STRING);
- }
-
-
- public static String appendXsdExtension(String name) {
-
- return name + ".xsd"; //$NON-NLS-1$
- }
-
- public static String extractFileNumber(String fileName) {
-
- String result = stripExtension(fileName);
- if(Tools.stringIsEmpty(result)) {
- return EMPTY_STRING;
- }
- return result.replaceFirst(GEN_DEFAULT_NAME, EMPTY_STRING);
- }
-
- public static String extractDirectory(String path) {
- if( ! path.contains(File.separator)) {
- return EMPTY_STRING;
- }
- return path.substring(0, path.lastIndexOf(File.separator));
- }
-
- // ********** NLS utilities **********
-
- public static String getString(String key) {
- return JptJaxbCoreMessages.getString(key);
- }
-
- public static String bind(String key, Object argument) {
- return MessageFormat.format(getString(key), argument);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties
deleted file mode 100644
index b9112cd725..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-# Copyright (c) 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-LOADING_CLASSES = loading...
-GENERATING_SCHEMA = \ngenerating schema...
-SCHEMA_GENERATED = \nSchema {0} generated
-SCHEMA_NOT_CREATED = \nSchema {0} not created
-NOT_FOUND = \n\tNot found: {0}
-CONTEXT_FACTORY_NOT_FOUND = \nThe JAXBContextFactory {0} \n\
-specified in the jaxb.properties file could not be located on the project classpath. \n\
-The JAXB provider that defines this factory should be added to the project classpath, \n\
-or the jaxb.properties file should be removed to use the default provider.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath
deleted file mode 100644
index 934fb38085..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project
deleted file mode 100644
index 54ea9292fc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0569657a4d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:18 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
deleted file mode 100644
index b2a9c195b0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,54 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.core;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.402,2.0.0)",
- org.eclipse.jst.j2ee.core;bundle-version="[1.2.100,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.200,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.600,2.0.0)",
- org.eclipse.wst.xsd.core;bundle-version="[1.1.600,2.0.0)",
- org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.core,
- org.eclipse.jpt.jaxb.core.context,
- org.eclipse.jpt.jaxb.core.context.java,
- org.eclipse.jpt.jaxb.core.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.context;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.facet;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.gen;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.jaxb21;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.jaxb22;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.libprov;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.operations;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.platform;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex,
- org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops,
- org.eclipse.jpt.jaxb.core.internal.validation;x-internal:=true,
- org.eclipse.jpt.jaxb.core.libprov,
- org.eclipse.jpt.jaxb.core.platform,
- org.eclipse.jpt.jaxb.core.resource.java,
- org.eclipse.jpt.jaxb.core.resource.jaxbindex,
- org.eclipse.jpt.jaxb.core.resource.jaxbprops,
- org.eclipse.jpt.jaxb.core.xsd
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties
deleted file mode 100644
index 377eb5ce7a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml
deleted file mode 100644
index 1bf3de57da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.core">
- <description url=""></description>
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.jpt.jaxb.core" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties
deleted file mode 100644
index f5d65fa9c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB Core
-providerName = Eclipse Web Tools Platform
-
-JAXB_PLATFORMS = JAXB Platforms
-
-JAXB_INDEX_CONTENT = JAXB Index File
-JAXB_PROPERTIES_CONTENT = JAXB Properties File
-
-JAXB_PROBLEM_MARKER = JAXB Problem
-
-GENERIC_PLATFORM_GROUP_LABEL = Generic JAXB
-GENERIC_2_2_PLATFORM_LABEL = Generic JAXB 2.2
-GENERIC_2_1_PLATFORM_LABEL = Generic JAXB 2.1
-
-JAXB_FACET_LABEL = JAXB
-JAXB_FACET_DESCRIPTION = Adds support for data binding using the Java Architecture for XML Binding (JAXB).
-JAXB_TEMPLATE_LABEL = JAXB Project
-
-JAXB_NO_OP_LIBRARY_PROVIDER_MESSAGE = The JAXB facet requires a JAXB implementation library to be present on the project classpath. By disabling library configuration, the user takes on the responsibility of ensuring that the classpath is configured appropriately via alternate means.
-
-JAXB_JRE_LIBRARY_PROVIDER_LABEL = JRE
-JAXB_JRE_LIBRARY_PROVIDER_MESSAGE = The project JRE provides the annotations and implementation to support the chosen JAXB platform.
-
-JAXB_VALIDATOR = JAXB Validator
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml
deleted file mode 100644
index 72b573e81d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml
+++ /dev/null
@@ -1,319 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2010, 2011 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="jaxbPlatforms"
- name="%JAXB_PLATFORMS"
- schema="schema/jaxbPlatforms.exsd"/>
-
-
- <!-- ***** extensions ***** -->
-
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
-
- <content-type
- id="org.eclipse.jpt.jaxb.core.content.jaxbIndex"
- name="%JAXB_INDEX_CONTENT"
- base-type="org.eclipse.core.runtime.text"
- priority="high"
- file-names="jaxb.index"/>
-
- <content-type
- id="org.eclipse.jpt.jaxb.core.content.jaxbProperties"
- name="%JAXB_PROPERTIES_CONTENT"
- base-type="org.eclipse.jdt.core.javaProperties"
- priority="high"
- file-names="jaxb.properties"/>
-
- </extension>
-
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.platformResource"
- type="org.eclipse.core.resources.IResource"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.JaxbPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.javaElement"
- type="org.eclipse.jdt.core.IJavaElement"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.JaxbPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.jaxbPlatformDescription"
- type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.JaxbPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.jaxbLibraryProviderConfig"
- type="org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.JaxbPlatformTester"/>
-
- </extension>
-
- <!-- =================================================================================== -->
- <!-- Extension: JAXB Problem Marker -->
- <!-- **** Do NOT qualify the marker id with org.eclipse.jpt.jaxb.core, see bug 252891 -->
- <!-- =================================================================================== -->
- <extension
- point="org.eclipse.core.resources.markers"
- id="jaxbProblemMarker"
- name="%JAXB_PROBLEM_MARKER">
-
- <persistent value="true"/>
-
- <!-- Can't use text marker until we have specific models for each input type (XML, java)
- <super type="org.eclipse.core.resources.textmarker"/>
- -->
-
- <super type="org.eclipse.wst.validation.problemmarker2"/>
- <super type="org.eclipse.jdt.core.problem"/>
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.jaxb.core.jaxbPlatforms">
-
- <jaxbPlatformGroup
- id="generic"
- label="%GENERIC_PLATFORM_GROUP_LABEL"/>
-
- <jaxbPlatform
- id="generic_2_1"
- label="%GENERIC_2_1_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinitionFactory"
- group="generic"
- jaxbFacetVersion="2.1"
- default="false"/>
-
- <jaxbPlatform
- id="generic_2_2"
- label="%GENERIC_2_2_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinitionFactory"
- group="generic"
- jaxbFacetVersion="2.2"
- default="false"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.common.core.libraryValidators">
-
- <libraryValidator
- id="jaxbJreLibraryValidator"
- class="org.eclipse.jpt.jaxb.core.internal.libval.JaxbJreLibraryValidator">
- <enablement>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId" value="jaxb-jre-library-provider"/>
- </with>
- </enablement>
- </libraryValidator>
-
- <libraryValidator
- id="genericJaxbUserLibraryValidator"
- class="org.eclipse.jpt.jaxb.core.internal.libval.GenericJaxbUserLibraryValidator">
- <enablement>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId" value="jaxb-user-library-provider"/>
- </with>
- </enablement>
- </libraryValidator>
-
- <!--
- <libraryValidator
- id="genericEclipselinkBundlesLibraryValidator"
- class="org.eclipse.jpt.core.internal.libval.GenericEclipseLinkBundlesLibraryValidator">
- <enablement>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.core.extendsId" value="eclipselink-bundles-library-provider"/>
- </with>
- </enablement>
- </libraryValidator>
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider
- id="jaxb-no-op-library-provider"
- extends="jpt-no-op-library-provider">
- <param name="message" value="%JAXB_NO_OP_LIBRARY_PROVIDER_MESSAGE"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- <provider
- id="jaxb-jre-library-provider">
- <label>%JAXB_JRE_LIBRARY_PROVIDER_LABEL</label>
- <priority>900</priority>
- <param name="message" value="%JAXB_JRE_LIBRARY_PROVIDER_MESSAGE"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </and>
- </enablement>
- <action type="INSTALL">
- <config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbJreLibraryProviderInstallOperationConfig"/>
- <operation class="org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderOperation"/>
- </action>
- <action type="UNINSTALL">
- <operation class="org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderOperation"/>
- </action>
- </provider>
-
- <provider
- id="jaxb-user-library-provider"
- extends="wtp-user-library-provider">
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </enablement>
- <action type="INSTALL">
- <config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig"/>
- <operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperation"/>
- </action>
- </provider>
-
- <!--
- <provider
- id="jaxb-osgi-bundles-library-provider"
- extends="wtp-osgi-bundles-library-provider"
- abstract="true">
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </enablement>
- <action type="INSTALL">
- <config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbOsgiBundlesLibraryProviderInstallOperationConfig"/>
- <operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperation"/>
- </action>
- </provider>
-
- <provider
- id="jaxb-eclipselink-bundles-library-provider"
- extends="jaxb-osgi-bundles-library-provider"
- abstract="true"/>
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.runtimes">
-
- <supported>
- <facet id="jpt.jaxb"/>
- <runtime-component any="true"/>
- </supported>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.facets">
-
- <project-facet id="jpt.jaxb">
- <label>%JAXB_FACET_LABEL</label>
- <description>%JAXB_FACET_DESCRIPTION</description>
- <default-version version="2.1"/>
- </project-facet>
-
- <project-facet-version facet="jpt.jaxb" version="2.1">
- <constraint>
- <requires facet="java" version="[5.0"/>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jpt.jaxb" version="2.2">
- <constraint>
- <requires facet="java" version="[5.0"/>
- </constraint>
- </project-facet-version>
-
- <template id="jpt.jaxb.template">
- <label>%JAXB_TEMPLATE_LABEL</label>
- <fixed facet="jpt.jaxb"/>
- <fixed facet="java"/>
- </template>
-
- <action facet="jpt.jaxb" type="install" id="jpt.jaxb.install">
- <config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProvider"/>
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDelegate"/>
- </action>
-
- <action facet="jpt.jaxb" type="version-change" id="jpt.jaxb.version-change">
- <config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDataModelProvider"/>
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDelegate"/>
- </action>
-
- <action facet="jpt.jaxb" type="uninstall" id="jpt.jaxb.uninstall">
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetUninstallDelegate"/>
- </action>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.validation.validatorV2"
- id="jaxbValidator"
- name="%JAXB_VALIDATOR">
-
- <validator
- class="org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidator"
- markerId="org.eclipse.jpt.jaxb.core.jaxbProblemMarker">
- <include>
- <rules>
- <facet id="jpt.jaxb"/>
- </rules>
- </include>
- <include>
- <rules>
- <contentType id="org.eclipse.jdt.core.javaSource" exactMatch="false"/>
- <contentType id="org.eclipse.jpt.core.content.javaPackageInfo" exactMatch="false"/>
- <contentType id="org.eclipse.jpt.jaxb.core.content.jaxbProperties" exactMatch="false"/>
- </rules>
- </include>
- </validator>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties
deleted file mode 100644
index f69df28531..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties
+++ /dev/null
@@ -1,84 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-NO_JAXB_PROJECT = This project has the JAXB facet, but no JAXB content could be created. See the error log for more details.
-PROJECT_INVALID_LIBRARY_PROVIDER = The currently selected JAXB library provider is invalid.
-PROJECT_UNRESOLVED_SCHEMA = Cannot resolve the schema with location ''{0}''.
-
-PACKAGE_NO_SCHEMA_FOR_NAMESPACE = There is no schema specified on the project for the namespace ''{0}'' on the package ''{1}''. No schema-specific validation will be performed.
-PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED = The type must be specified for an XML Java type adapter on a package
-XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT = The attribute form default conflicts with what is specified on the schema
-XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT = The element form default conflicts with what is specified on the schema
-
-XML_ENUM__NON_SIMPLE_SCHEMA_TYPE = The type ''{0}'' must be associated with a simple schema type.
-
-XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = The namespace for an anonymous type should not be different from its package
-XML_TYPE__DUPLICATE_PROP = Duplicate property ''{0}''.
-XML_TYPE__MISSING_PROP = Missing required property ''{0}''.
-XML_TYPE__NONEXISTENT_PROP = Nonexistent property ''{0}''.
-XML_TYPE__TRANSIENT_PROP = The property ''{0}'' is transient and should not be included in the property order.
-XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM = The factory class element is ignored for enums.
-XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM = The factory method element is ignored for enums.
-XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM = The prop order element is ignored for enums.
-
-XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE = The xml type of the element declaration with name ''{0}'' and namespace ''{1}'' conflicts with the xml type of the associated class
-
-XML_ENUM_VALUE__INVALID_LEXICAL_VALUE = Invalid lexical value \"{0}\" for schema type ''{1}''.
-
-ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION = The annotation ''{0}'' is not allowed to be used in conjunction with ''{1}''.
-ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED = The type for XML Java type adapter is not defined.
-XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION = An XML element wrapper may only be defined on a collection or array property
-
-XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are annotated with @XmlAnyAttribute. At most one field or property per class is allowed.
-XML_ANY_ATTRIBUTE__NON_MAP_TYPE = The type of a field or property annotated with @XmlAnyAttribute must be assignable to java.util.Map.
-
-XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are annotated with @XmlAnyElement. At most one field or property per class is allowed.
-
-XML_ELEMENT__UNSPECIFIED_TYPE = Unspecified XML element type.
-XML_ELEMENT__ILLEGAL_TYPE = XML element type must be a sub-type of ''{0}''.
-
-XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = An element factory method must have a return type of ''javax.xml.bind.JAXBElement''.
-XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM = An element factory method must have a single parameter assignable to ''java.lang.Object''.
-XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME = XML element decl substitution head must not match its XML element.
-XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL = XML element decl substitution head must match another XML element decl.
-
-XML_ELEMENT_REF__UNSPECIFIED_TYPE = Unspecified XML element ref type.
-XML_ELEMENT_REF__ILLEGAL_TYPE = XML element ref type must be a sub-type of ''{0}''.
-XML_ELEMENT_REF__NO_ROOT_ELEMENT = No root element specified on type ''{0}'' or any of its sub-types.
-XML_ELEMENT_REF__NO_REGISTRY = No XML registry configured for this package.
-XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL = No XML element decl in the XML registry matching the namespace ''{0}'' and name ''{1}''.
-
-XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE = Duplicate type ''{0}'' in XML element refs.
-XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME = Duplicate element name ''{0}''in XML element refs.
-
-XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE = Duplicate type ''{0}'' in XML elements.
-XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME = Duplicate element name ''{0}'' in XML elements.
-
-XML_ID__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are mapped as XmlID. At most one field or property per class is allowed.
-XML_ID__ATTRIBUTE_TYPE_NOT_STRING = An attribute mapped as XmlID must have type ''java.lang.String''.
-XML_ID__SCHEMA_TYPE_NOT_ID = The schema type to which this attribute is mapped must be ''ID''.
-
-XML_IDREF__TYPE_DOES_NOT_CONTAIN_XML_ID = In order to be used with an XML ID ref, type ''{0}'' must contain a property or field mapped as an XML ID.
-XML_ID_REF__SCHEMA_TYPE_NOT_IDREF = In order to be used with XmlIDREF, The schema type of ''{0}'' must be ''IDREF''.
-
-XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE = An attribute mapped as XMLList must have a collection or array type.
-XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE = The type ''{0}'' must be mapped to a non-list simple schema type.
-
-XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME = Duplicate XML element decl name ''{0}'' {1}.
-
-XML_VALUE__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are annotated with @XmlValue. At most one field or property per class is allowed.
-XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED = Attribute ''{0}'' must be mapped as XmlAttribute because another attribute ''{1}'' is mapped as XmlValue
-
-XML_SCHEMA_TYPE__NON_SIMPLE_TYPE = The schema type ''{0}'' is not a simple type.
-XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE = The ''type'' element should be specified when defining a schema type on a package.
-XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE = The ''type'' element should not be specified when defining a schema type on a field or property.
-
-QNAME__MISSING_NAME = {0} name not specified
-QNAME__UNRESOLVED_COMPONENT = Cannot resolve {0} with namespace ''{1}'' and name ''{2}'' in this context \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties
deleted file mode 100644
index 14eabf9da3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-SchemaGenerator_creatingJAXBPropertiesFileTask = Creating jaxb.properties file
-
-ClassesGenerator_generatingClasses = Generating JAXB Classes from Schema
-ClassesGenerator_generatingClassesTask = Generating classes
-
-JaxbFacetConfig_validatePlatformNotSpecified = Platform must be specified
-JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion = Platform does not support the current JAXB facet version
-
-JreLibraryValidator_invalidPlatform = The JRE only provides implementation for a Generic JAXB platform.
-JreLibraryValidator_invalidJavaFacet = The specified Java version of {0} is insufficient to provide an implementation for JAXB version {1}. The JAXB implementation of a Java {0} runtime environment must be manually overridden by an endorsement mechanism of your choice.
-JreLibraryValidator_invalidJavaLibrary = The configured runtime is insufficient to provide an implementation for JAXB {0}.
-
-UserLibraryValidator_incompatibleJavaFacet = The specified Java version of {0} provides a JAXB implementation that conflicts with JAXB version {1}. The JAXB implementation of a Java {0} runtime environment must be manually overridden by an endorsement mechanism of your choice.
-UserLibraryValidator_incompatibleJavaLibrary = The configured runtime conflicts with JAXB version {0}.
-
-XML_ATTRIBUTE_DESC = XML attribute declaration
-XML_ELEMENT_DESC = XML element declaration
-XML_TYPE_DESC = XML type definition
-SUBSTITUTION_HEAD_DESC = XML element substitution head
-
-XML_ELEMENT_DECL__SCOPE = in the scope of ''{0}''
-
-PREFERENCES_FLUSH_JOB_NAME=Flush Preferences: {0}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd b/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd
deleted file mode 100644
index 92b9195c13..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.jaxb.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.jaxb.core" id="jaxbPlatforms" name="JAXB Platforms"/>
- </appinfo>
- <documentation>
- This is used for defining JAXB platforms and JAXB platform versions.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="jaxbPlatformGroup"/>
- <element ref="jaxbPlatform"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jaxbPlatformGroup">
- <annotation>
- <documentation>
- Declares a JAXB platform group. Acts as a sort of &quot;super&quot; platform. Most useful for enabling functionality for a set of platforms without having to enable the functionality for each platform separately.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique identifier for a JAXB platform group.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A translatable string representation of the JAXB platform group.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jaxbPlatform">
- <annotation>
- <documentation>
- Declares a JAXB platform. One JAXB platform will be selected per JAXB-faceted project. See &lt;samp&gt;org.eclipse.jpt.jaxb.core.JaxbPlatform&lt;/samp&gt; for more information on JAXB platforms. Also see the org.eclipse.jpt.jaxb.ui.jaxbPlatformUis extension point.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A translatable string representation of the platform.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="factoryClass" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;samp&gt;org.eclipse.jpt.jaxb.core.JaxbPlatformDefinitionFactory&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.jaxb.core.JaxbPlatformDefinitionFactory"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="group" type="string">
- <annotation>
- <documentation>
- Declares which JAXB platform group this platform belongs to. If none is specified, this platform will be assumed to belong to its own group with the same id.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jaxbFacetVersion" type="string">
- <annotation>
- <documentation>
- Declares the JAXB facet version for which this platform may be used. If no facet version is specified, this platform is available for all JAXB facet versions.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="default" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- Declares whether this platform should be used as a default JAXB platform for new JAXB project content. Note that if a workspace contains more than one default platform for a JAXB facet version, one of them will be chosen at random. By default, a platform is not a default platform.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- JPT 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;
-The following example is the included generic JAXB 2.2 platform and its platform group
-&lt;p&gt;
-&lt;pre&gt;
-&lt;extension point=&quot;org.eclipse.jpt.jaxb.core.jaxbPlatforms&quot;&gt;
-
- &lt;jaxbPlatformGroup
- id=&quot;generic&quot;
- label=&quot;%GENERIC_PLATFORM_GROUP_LABEL&quot;/&gt;
-
- &lt;jaxbPlatform
- id=&quot;generic_2_2&quot;
- label=&quot;%GENERIC_2_2_PLATFORM_LABEL&quot;
- factoryClass=&quot;org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinitionFactory&quot;
- group=&quot;generic&quot;
- jaxbFacetVersion=&quot;2.2&quot;
- default=&quot;false&quot;/&gt;
-
- &lt;/extension&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-Provisional API: This interface is part of an interim API that is still
-under development and expected to change significantly before reaching
-stability. It is available at this early stage to solicit feedback from
-pioneering adopters on the understanding that any code that uses this API
-will almost certainly be broken (repeatedly) as the API evolves.
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;The org.eclipse.jpt.jaxb.core plug-in provides the following jaxb platforms:
-&lt;ul&gt;
-&lt;li&gt;generic_2_2&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
-&lt;p&gt;and the following jaxb platform groups:
-&lt;ul&gt;
-&lt;li&gt;generic&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2010 Oracle. All rights reserved.
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0, which accompanies this distribution
-and is available at http://www.eclipse.org/legal/epl-v10.html.
-
-Contributors:
-Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java
deleted file mode 100644
index a6cda374d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-/**
- * Constants pertaining to the Generic JAXB platforms and their group.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class GenericJaxbPlatform {
-
- public static final JaxbPlatformGroupDescription GROUP
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup("generic"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_1
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("generic_2_1"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_2
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("generic_2_2"); //$NON-NLS-1$
-
-
- /**
- * Not for instantiation
- */
- private GenericJaxbPlatform() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
deleted file mode 100644
index c4056c7bd5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
+++ /dev/null
@@ -1,1038 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.AsynchronousCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.SimpleCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StatefulCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.jaxb.core.internal.SimpleJaxbProjectConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-import org.osgi.framework.BundleContext;
-
-/**
- * The JAXB project manager maintains a list of all JAXB projects in the workspace.
- * It keeps the list (and the state of the JAXB projects themselves)
- * synchronized with the workspace by listening for various
- * changes:<ul>
- * <li>Resource
- * <li>Java
- * <li>Faceted Project
- * </ul>
- * We use an Eclipse {@link ILock lock} to synchronize access to the JAXB
- * projects when dealing with these events. In an effort to reduce deadlocks,
- * the simple Resource and Java change events are dispatched to a background
- * thread, allowing us to handle the events outside of the workspace lock held
- * during resource and Java change notifications.
- * <p>
- * Events that trigger either the adding or removing of a JAXB project (e.g.
- * {@link IResourceChangeEvent#POST_CHANGE}) are handled "synchronously"
- * by allowing the background thread to handle any outstanding events before
- * updating the list of JAXB projects and returning execution to the event
- * source.
- * <p>
- * Various things that cause us to add or remove a JAXB project:<ul>
- * <li>The {@link JptJaxbCorePlugin} will "lazily" instantiate and {@link #start() start}
- * a JAXB project manager as appropriate. This will trigger the manager
- * to find and add all pre-existing JAXB projects.
- *
- * <li>Project created and facet installed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * <li>Project facet uninstalled<p>
- * {@link IFacetedProjectEvent.Type#PRE_UNINSTALL}
- *
- * <li>Project opened<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#ADDED} facet settings file
- * (<code>/.settings/org.eclipse.wst.common.project.facet.core.xml</code>)
- * <li>Project closed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file
- *
- * <li>Pre-existing project imported from directory or archive (created and opened)<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#ADDED} facet settings file
- * <li>Project renamed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file of old project
- * -> {@link IResourceDelta#ADDED} facet settings file of new project
- * <li>Project deleted<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file
- *
- * <li>Project facet installed by editing the facets settings file directly<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#CHANGED} facet settings file
- * <li>Project facet uninstalled by editing the facets settings file directly<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#CHANGED} facet settings file
- * </ul>
- */
-//TODO Still need to look at faceted project listener for facet uninstall
-class GenericJaxbProjectManager
- extends AbstractModel
- implements JaxbProjectManager {
-
- /**
- * All the JAXB projects in the workspace.
- */
- private final Vector<JaxbProject> jaxbProjects = new Vector<JaxbProject>();
-
- /**
- * Synchronize access to the JAXB projects.
- */
- /* private */ final ILock lock = this.getJobManager().newLock();
-
- /**
- * Determine how Resource and Java change events are
- * handled (i.e. synchronously or asynchronously).
- */
- private volatile StatefulCommandExecutor eventHandler = new AsynchronousCommandExecutor(JptCommonCoreMessages.DALI_EVENT_HANDLER_THREAD_NAME);
-
- /**
- * Listen for<ul>
- * <li>changes to projects and files
- * <li>clean builds
- * </ul>
- */
- private final IResourceChangeListener resourceChangeListener = new ResourceChangeListener();
-
- /**
- * The types of resource change events that interest
- * {@link #resourceChangeListener}.
- */
- private static final int RESOURCE_CHANGE_EVENT_TYPES =
- IResourceChangeEvent.POST_CHANGE |
- IResourceChangeEvent.POST_BUILD;
-
- /**
- * Listen for changes to this file to determine when the JAXB facet is
- * added to or removed from a "faceted" project.
- */
- private static final String FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME = FacetedProjectFramework.PLUGIN_ID + ".xml"; //$NON-NLS-1$
-
- /**
- * Listen for the JAXB facet being added to or removed from a "faceted" project.
- */
- private final IFacetedProjectListener facetedProjectListener = new FacetedProjectListener();
-
- /**
- * The types of faceted project events that interest
- * {@link #facetedProjectListener}.
- */
- private static final IFacetedProjectEvent.Type[] FACETED_PROJECT_EVENT_TYPES = new IFacetedProjectEvent.Type[] {
- IFacetedProjectEvent.Type.PRE_UNINSTALL
- };
-
- /**
- * Listen for Java changes (unless the Dali UI is active).
- * @see #javaElementChangeListenerIsActive()
- */
- private final JavaElementChangeListener javaElementChangeListener = new JavaElementChangeListener();
-
- /**
- * The types of resource change events that interest
- * {@link #javaElementChangeListener}.
- */
- private static final int JAVA_CHANGE_EVENT_TYPES =
- ElementChangedEvent.POST_CHANGE |
- ElementChangedEvent.POST_RECONCILE;
-
-
- // ********** constructor **********
-
- /**
- * Internal: called by {@link JptJUaxbCorePlugin Dali plug-in}.
- */
- GenericJaxbProjectManager() {
- super();
- }
-
-
- // ********** plug-in controlled life-cycle **********
-
- /**
- * Internal: called by {@link JptJaxbCorePlugin Dali plug-in}.
- */
- void start() {
- try {
- this.lock.acquire();
- this.start_();
- } finally {
- this.lock.release();
- }
- }
-
- private void start_() {
- debug("*** JAXB project manager START ***"); //$NON-NLS-1$
- try {
- this.buildJaxbProjects();
- this.eventHandler.start();
- this.getWorkspace().addResourceChangeListener(this.resourceChangeListener, RESOURCE_CHANGE_EVENT_TYPES);
- FacetedProjectFramework.addListener(this.facetedProjectListener, FACETED_PROJECT_EVENT_TYPES);
- JavaCore.addElementChangedListener(this.javaElementChangeListener, JAVA_CHANGE_EVENT_TYPES);
- } catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- this.stop_();
- }
- }
-
- /**
- * Side-effect: {@link #jaxbProjects} populated.
- */
- private void buildJaxbProjects() {
- try {
- this.buildJaxbProjects_();
- } catch (CoreException ex) {
- // if we have a problem, leave the currently built JAXB projects in
- // place and keep executing (should be OK...)
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- private void buildJaxbProjects_() throws CoreException {
- this.getWorkspace().getRoot().accept(new ResourceProxyVisitor(), IResource.NONE);
- }
-
- /**
- * Internal: called by {@link JptJaxbCorePlugin Dali plug-in}.
- */
- void stop() throws Exception {
- try {
- this.lock.acquire();
- this.stop_();
- } finally {
- this.lock.release();
- }
- }
-
- private void stop_() {
- debug("*** JAXB project manager STOP ***"); //$NON-NLS-1$
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- FacetedProjectFramework.removeListener(this.facetedProjectListener);
- this.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
- this.eventHandler.stop();
- this.clearJaxbProjects();
- }
-
- private void clearJaxbProjects() {
- // clone to prevent concurrent modification exceptions
- for (JaxbProject jaxbProject : this.getJaxbProjects_()) {
- this.removeJaxbProject(jaxbProject);
- }
- }
-
-
- // ********** JaxbProjectManager implementation **********
-
- public Iterable<JaxbProject> getJaxbProjects() {
- try {
- this.lock.acquire();
- return this.getJaxbProjects_();
- } finally {
- this.lock.release();
- }
- }
-
- private Iterable<JaxbProject> getJaxbProjects_() {
- return new LiveCloneIterable<JaxbProject>(this.jaxbProjects);
- }
-
- public int getJaxbProjectsSize() {
- return this.jaxbProjects.size();
- }
-
- public JaxbProject getJaxbProject(IProject project) {
- try {
- this.lock.acquire();
- return this.getJaxbProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- private JaxbProject getJaxbProject_(IProject project) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- if (jaxbProject.getProject().equals(project)) {
- return jaxbProject;
- }
- }
- return null;
- }
-
- public JaxbFile getJaxbFile(IFile file) {
- JaxbProject jaxbProject = this.getJaxbProject(file.getProject());
- return (jaxbProject == null) ? null : jaxbProject.getJaxbFile(file);
- }
-
- public void rebuildJaxbProject(IProject project) {
- try {
- this.lock.acquire();
- this.rebuildJaxbProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- /**
- * assumption: the JAXB project holder exists
- */
- private void rebuildJaxbProject_(IProject project) {
- this.removeJaxbProject(this.getJaxbProject_(project));
- this.addJaxbProject(project);
- }
-
- public boolean javaElementChangeListenerIsActive() {
- return this.javaElementChangeListener.isActive();
- }
-
- public void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive) {
- this.javaElementChangeListener.setActive(javaElementChangeListenerIsActive);
- }
-
- public IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public IJobManager getJobManager() {
- return Job.getJobManager();
- }
-
-
- // ********** adding/removing JAXB projects **********
-
- /* private */ void addJaxbProject(IProject project) {
- this.addJaxbProject(this.buildJaxbProject(project));
- }
-
- private void addJaxbProject(JaxbProject jaxbProject) {
- // figure out exactly when JAXB projects are added
- dumpStackTrace("add: ", jaxbProject); //$NON-NLS-1$
- // the JAXB project will be null if we have any problems building it...
- // (e.g. if we have problems getting the JAXB platform)
- if (jaxbProject != null) {
- this.addItemToCollection(jaxbProject, this.jaxbProjects, JAXB_PROJECTS_COLLECTION);
- }
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(IProject project) {
- return this.buildJaxbProject(this.buildJaxbProjectConfig(project));
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(JaxbProject.Config config) {
- JaxbPlatformDefinition platformDefinition = config.getPlatformDefinition();
- if (platformDefinition == null) {
- return null;
- }
- JaxbProject jaxbProject = this.buildJaxbProject(platformDefinition, config);
- if (jaxbProject == null) {
- return null;
- }
-// jaxbProject.setUpdateSynchronizer(new CallbackAsynchronousSynchronizer());
- return jaxbProject;
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(JaxbPlatformDefinition platformDefinition, JaxbProject.Config config) {
- try {
- return platformDefinition.getFactory().buildJaxbProject(config);
- }
- catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- return null;
- }
- }
-
- private JaxbProject.Config buildJaxbProjectConfig(IProject project) {
- SimpleJaxbProjectConfig config = new SimpleJaxbProjectConfig();
- config.setProject(project);
- config.setPlatformDefinition(JptJaxbCorePlugin.getJaxbPlatformManager().buildJaxbPlatformDefinition(project));
- return config;
- }
-
- /* private */ void removeJaxbProject(JaxbProject jaxbProject) {
- // figure out exactly when JAXB projects are removed
- dumpStackTrace("remove: ", jaxbProject); //$NON-NLS-1$
- this.removeItemFromCollection(jaxbProject, this.jaxbProjects, JAXB_PROJECTS_COLLECTION);
- jaxbProject.dispose();
- }
-
-
- // ********** Project POST_CHANGE **********
-
- /* private */ void projectChanged(IResourceDelta delta) {
- this.eventHandler.execute(this.buildProjectChangedCommand(delta));
- }
-
- private Command buildProjectChangedCommand(final IResourceDelta delta) {
- return new EventHandlerCommand("Project POST_CHANGE Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.projectChanged_(delta);
- }
- };
- }
-
- /**
- * Forward the specified resource delta to all our JAXB projects;
- * they will each determine whether the event is significant.
- */
- /* private */ void projectChanged_(IResourceDelta delta) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- jaxbProject.projectChanged(delta);
- }
- }
-
-
- // ********** Project POST_BUILD (CLEAN_BUILD) **********
-
- /* private */ void projectPostCleanBuild(IProject project) {
- this.executeAfterEventsHandled(this.buildProjectPostCleanBuildCommand(project));
- }
-
- private Command buildProjectPostCleanBuildCommand(final IProject project) {
- return new EventHandlerCommand("Project POST_BUILD (CLEAN_BUILD) Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.projectPostCleanBuild_(project);
- }
- };
- }
-
- /* private */ void projectPostCleanBuild_(IProject project) {
- JaxbProject jaxbProject = this.getJaxbProject_(project);
- if (jaxbProject != null) {
- this.removeJaxbProject(jaxbProject);
- this.addJaxbProject(project);
- }
- }
-
-
- // ********** File POST_CHANGE **********
-
- /**
- * The Faceted Project settings file has changed in some fashion, check
- * whether the JAXB facet has been added to or removed from the specified
- * project.
- */
- /* private */ void checkForJaxbFacetTransition(IProject project) {
- JaxbProject jaxbProject = this.getJaxbProject_(project);
-
- if (JaxbFacet.isInstalled(project)) {
- if (jaxbProject == null) { // JAXB facet added
- this.executeAfterEventsHandled(this.buildAddJaxbProjectCommand(project));
- }
- } else {
- if (jaxbProject != null) { // JAXB facet removed
- this.executeAfterEventsHandled(this.buildRemoveJaxbProjectCommand(jaxbProject));
- }
- }
- }
-
- private Command buildAddJaxbProjectCommand(final IProject project) {
- return new EventHandlerCommand("Add JAXB Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.addJaxbProject(project);
- }
- };
- }
-
- private Command buildRemoveJaxbProjectCommand(final JaxbProject jaxbProject) {
- return new EventHandlerCommand("Remove JAXB Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.removeJaxbProject(jaxbProject);
- }
- };
- }
-
- // ********** FacetedProject PRE_UNINSTALL **********
-
- /* private */ void jaxbFacetedProjectPreUninstall(IProjectFacetActionEvent event) {
- IProject project = event.getProject().getProject();
- this.executeAfterEventsHandled(this.buildJaxbFacetedProjectPreUninstallCommand(project));
- }
-
- private Command buildJaxbFacetedProjectPreUninstallCommand(final IProject project) {
- return new EventHandlerCommand("Faceted Project PRE_UNINSTALL Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.jaxbFacetedProjectPreUninstall_(project);
- }
- };
- }
-
- /* private */ void jaxbFacetedProjectPreUninstall_(IProject project) {
- // assume(?) this is the first event to indicate we need to remove the JAXB project from the JAXB project manager
- this.removeJaxbProject(this.getJaxbProject_(project));
- }
-
-
- // ********** Java element changed **********
-
- /* private */ void javaElementChanged(ElementChangedEvent event) {
- this.eventHandler.execute(this.buildJavaElementChangedCommand(event));
- }
-
- private Command buildJavaElementChangedCommand(final ElementChangedEvent event) {
- return new EventHandlerCommand("Java element changed Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.javaElementChanged_(event);
- }
- };
- }
-
- /**
- * Forward the Java element changed event to all the JAXB projects
- * because the event could affect multiple projects.
- */
- /* private */ void javaElementChanged_(ElementChangedEvent event) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- jaxbProject.javaElementChanged(event);
- }
- }
-
-
- // ********** miscellaneous **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.jaxbProjects);
- }
-
-
- // ********** event handler **********
-
- /**
- * If the event handler is executing asynchronously:<br>
- * Allow all the commands currently on the command executor's queue to execute.
- * Once they have executed, suspend the command executor and process the
- * specified command (on <em>this</em> thread, <em>not</em> the command
- * executor thread). Once the specified command is finished, allow the
- * command executor to resume processing its command queue.
- * <p>
- * If the event handler is executing synchronously:<br>
- * All the events have already been handled synchronously, so we simply
- * execute the specified command [sorta] directly.
- */
- private void executeAfterEventsHandled(Command command) {
- SynchronizedBoolean flag = new SynchronizedBoolean(false);
- this.eventHandler.execute(new PauseCommand(flag));
- try {
- flag.waitUntilTrue();
- } catch (InterruptedException ex) {
- // ignore - not sure why this thread would be interrupted
- }
- try {
- command.execute();
- } finally {
- flag.setFalse();
- }
- }
-
- /**
- * If this "pause" command is executing (asynchronously) on a different
- * thread than the JAXB project manager:<ol>
- * <li>it will set the flag to <code>true</code>, allowing the JAXB project
- * manager to resume executing on its own thread
- * <li>then it will suspend its command executor until the JAXB project
- * manager sets the flag back to <code>false</code>.
- * </ol>
- * If this "pause" command is executing (synchronously) on the same thread
- * as the JAXB project manager, it will simply set the flag to
- * <code>true</code> and return.
- */
- private static class PauseCommand
- implements Command
- {
- private final Thread producerThread;
- private final SynchronizedBoolean flag;
-
- PauseCommand(SynchronizedBoolean flag) {
- this(Thread.currentThread(), flag);
- }
-
- PauseCommand(Thread producerThread, SynchronizedBoolean flag) {
- super();
- this.producerThread = producerThread;
- this.flag = flag;
- }
-
- public void execute() {
- this.flag.setTrue();
- if (Thread.currentThread() != this.producerThread) {
- try {
- this.flag.waitUntilFalse();
- } catch (InterruptedException ex) {
- // ignore - the command executor will check for interruptions
- }
- }
- }
- }
-
- /**
- * This method is called (via reflection) when the test plug-in is loaded.
- * @see JptCoreTestsPlugin#start(BundleContext)
- */
- public void handleEventsSynchronously() {
- try {
- this.lock.acquire();
- this.handleEventsSynchronously_();
- } finally {
- this.lock.release();
- }
- }
-
- private void handleEventsSynchronously_() {
- this.eventHandler.stop();
- this.eventHandler = new SimpleCommandExecutor();
- this.eventHandler.start();
- }
-
-
- // ********** resource proxy visitor **********
-
- /**
- * Visit the workspace resource tree, adding a JAXB project to the
- * JAXB project manager for each open Eclipse project that has a JAXB facet.
- */
- private class ResourceProxyVisitor implements IResourceProxyVisitor {
- ResourceProxyVisitor() {
- super();
- }
-
- public boolean visit(IResourceProxy resourceProxy) {
- switch (resourceProxy.getType()) {
- case IResource.ROOT :
- return true; // all projects are in the "root"
- case IResource.PROJECT :
- this.processProject(resourceProxy);
- return false; // no nested projects
- case IResource.FOLDER :
- return false; // ignore
- case IResource.FILE :
- return false; // ignore
- default :
- return false;
- }
- }
-
- private void processProject(IResourceProxy resourceProxy) {
- if (resourceProxy.isAccessible()) { // the project exists and is open
- IProject project = (IProject) resourceProxy.requestResource();
- if (JaxbFacet.isInstalled(project)) {
- GenericJaxbProjectManager.this.addJaxbProject(project);
- }
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** event handler command **********
-
- /**
- * Command that holds the JAXB project manager lock while
- * executing.
- */
- private abstract class EventHandlerCommand
- implements Command
- {
- private final String name;
-
- EventHandlerCommand(String name) {
- super();
- this.name = name;
- }
-
- public final void execute() {
- try {
- GenericJaxbProjectManager.this.lock.acquire();
- this.execute_();
- } catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- } finally {
- GenericJaxbProjectManager.this.lock.release();
- }
- }
-
- abstract void execute_();
-
- @Override
- public String toString() {
- return this.name;
- }
- }
-
-
- // ********** resource change listener **********
-
- private class ResourceChangeListener implements IResourceChangeListener {
-
- ResourceChangeListener() {
- super();
- }
-
- /**
- * PRE_UNINSTALL is the only facet event we use for
- * removing JAXB projects. These are the cases where we listen for resource events.
- * <p>
- * Check for:<ul>
- * <li>facet settings file added/removed/changed
- * (<code>/.settings/org.eclipse.wst.common.project.facet.core.xml</code>)
- * <li>file add/remove - forwarded to the individual JAXB projects
- * <li>project clean
- * </ul>
- */
- public void resourceChanged(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.POST_CHANGE :
- this.processPostChangeEvent(event);
- break;
-
- // workspace or project events
- case IResourceChangeEvent.PRE_REFRESH :
- break; // ignore
- case IResourceChangeEvent.PRE_BUILD :
- break; // ignore
- case IResourceChangeEvent.POST_BUILD :
- this.processPostBuildEvent(event);
- break;
-
- // project-only events
- case IResourceChangeEvent.PRE_CLOSE :
- break; // ignore
- case IResourceChangeEvent.PRE_DELETE :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostChangeEvent(IResourceChangeEvent event) {
- debug("Resource POST_CHANGE"); //$NON-NLS-1$
- this.processPostChangeDelta(event.getDelta());
- }
-
- private void processPostChangeDelta(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.processPostChangeRootDelta(delta);
- break;
- case IResource.PROJECT :
- this.processPostChangeProjectDelta(delta);
- break;
- case IResource.FOLDER :
- this.processPostChangeFolderDelta((IFolder) resource, delta);
- break;
- case IResource.FILE :
- this.processPostChangeFileDelta((IFile) resource, delta);
- break;
- default :
- break;
- }
- }
-
- // ***** POST_CHANGE ROOT
- private void processPostChangeRootDelta(IResourceDelta delta) {
- this.processPostChangeDeltaChildren(delta);
- }
-
- // ***** POST_CHANGE PROJECT
- /**
- * Process the project first for the Opening project case.
- * The JAXB project will not be built until the children are processed
- * and we see that the facet metadata file is added.
- * Otherwise the JAXB project would be built and then we would process
- * the ADDED deltas for all the files in the project.
- */
- private void processPostChangeProjectDelta(IResourceDelta delta) {
- GenericJaxbProjectManager.this.projectChanged(delta);
- this.processPostChangeDeltaChildren(delta);
- }
-
- // ***** POST_CHANGE FOLDER
- private void processPostChangeFolderDelta(IFolder folder, IResourceDelta delta) {
- if (folder.getName().equals(".settings")) { //$NON-NLS-1$
- this.processPostChangeDeltaChildren(delta);
- }
- }
-
- // ***** POST_CHANGE FILE
- private void processPostChangeFileDelta(IFile file, IResourceDelta delta) {
- if (file.getName().equals(FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME)) {
- this.checkForFacetFileChanges(file, delta);
- }
- }
-
- private void checkForFacetFileChanges(IFile file, IResourceDelta delta) {
- switch (delta.getKind()) {
- case IResourceDelta.ADDED :
- case IResourceDelta.REMOVED :
- case IResourceDelta.CHANGED :
- GenericJaxbProjectManager.this.checkForJaxbFacetTransition(file.getProject());
- break;
- case IResourceDelta.ADDED_PHANTOM :
- break; // ignore
- case IResourceDelta.REMOVED_PHANTOM :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostChangeDeltaChildren(IResourceDelta delta) {
- for (IResourceDelta child : delta.getAffectedChildren()) {
- this.processPostChangeDelta(child); // recurse
- }
- }
-
- /**
- * A post build event has occurred.
- * Check for whether the build was a "clean" build and trigger project update.
- */
- // ***** POST_BUILD
- private void processPostBuildEvent(IResourceChangeEvent event) {
- debug("Resource POST_BUILD: ", event.getResource()); //$NON-NLS-1$
- if (event.getBuildKind() == IncrementalProjectBuilder.CLEAN_BUILD) {
- this.processPostCleanBuildDelta(event.getDelta());
- }
- }
-
- private void processPostCleanBuildDelta(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.processPostCleanBuildDeltaChildren(delta);
- break;
- case IResource.PROJECT :
- this.processProjectPostCleanBuild((IProject) resource);
- break;
- case IResource.FOLDER :
- break; // ignore
- case IResource.FILE :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostCleanBuildDeltaChildren(IResourceDelta delta) {
- for (IResourceDelta child : delta.getAffectedChildren()) {
- this.processPostCleanBuildDelta(child); // recurse
- }
- }
-
- private void processProjectPostCleanBuild(IProject project) {
- debug("\tProject CLEAN: ", project.getName()); //$NON-NLS-1$
- GenericJaxbProjectManager.this.projectPostCleanBuild(project);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** faceted project listener **********
-
- /**
- * Forward the Faceted project change event back to the JAXB project manager.
- */
- private class FacetedProjectListener implements IFacetedProjectListener {
-
- FacetedProjectListener() {
- super();
- }
-
- /**
- * Check for:<ul>
- * <li>un-install of JAXB facet
- * </ul>
- */
- public void handleEvent(IFacetedProjectEvent event) {
- switch (event.getType()) {
- case PRE_UNINSTALL :
- this.processPreUninstallEvent((IProjectFacetActionEvent) event);
- break;
- default :
- break;
- }
- }
-
- private void processPreUninstallEvent(IProjectFacetActionEvent event) {
- debug("Facet PRE_UNINSTALL: ", event.getProjectFacet()); //$NON-NLS-1$
- if (event.getProjectFacet().equals(JaxbFacet.FACET)) {
- GenericJaxbProjectManager.this.jaxbFacetedProjectPreUninstall(event);
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** Java element change listener **********
-
- /**
- * Forward the Java element change event back to the JAXB project manager.
- */
- private class JavaElementChangeListener implements IElementChangedListener {
- /**
- * A flag to activate/deactivate the listener
- * so we can ignore Java events whenever Dali is manipulating the Java
- * source code via the Dali model. We do this because the 0.5 sec delay
- * between the Java source being changed and the corresponding event
- * being fired causes us no end of pain.
- */
- private volatile boolean active = true;
-
- JavaElementChangeListener() {
- super();
- }
-
- public void elementChanged(ElementChangedEvent event) {
- if (this.active) {
- GenericJaxbProjectManager.this.javaElementChanged(event);
- }
- }
-
- void setActive(boolean active) {
- this.active = active;
- }
-
- boolean isActive() {
- return this.active;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** DEBUG **********
-
- // @see JaxbProjectManagerTests#testDEBUG()
- private static final boolean DEBUG = false;
-
- /**
- * trigger #toString() call and string concatenation only if DEBUG is true
- */
- /* private */ static void debug(String message, Object object) {
- if (DEBUG) {
- debug_(message + object);
- }
- }
-
- /* private */ static void debug(String message) {
- if (DEBUG) {
- debug_(message);
- }
- }
-
- private static void debug_(String message) {
- System.out.println(Thread.currentThread().getName() + ": " + message); //$NON-NLS-1$
- }
-
- /* private */ static void dumpStackTrace() {
- dumpStackTrace(null);
- }
-
- /* private */ static void dumpStackTrace(String message, Object object) {
- if (DEBUG) {
- dumpStackTrace_(message + object);
- }
- }
-
- /* private */ static void dumpStackTrace(String message) {
- if (DEBUG) {
- dumpStackTrace_(message);
- }
- }
-
- private static void dumpStackTrace_(String message) {
- // lock System.out so the stack elements are printed out contiguously
- synchronized (System.out) {
- if (message != null) {
- debug_(message);
- }
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- // skip the first 3 elements - those are this method and 2 methods in Thread
- for (int i = 3; i < stackTrace.length; i++) {
- StackTraceElement element = stackTrace[i];
- if (element.getMethodName().equals("invoke0")) { //$NON-NLS-1$
- break; // skip all elements outside of the JUnit test
- }
- System.out.println("\t" + element); //$NON-NLS-1$
- }
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
deleted file mode 100644
index 1f647ca770..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class JaxbFacet {
-
- public static final String ID = "jpt.jaxb"; //$NON-NLS-1$
-
- public static final IProjectFacet FACET = ProjectFacetsManager.getProjectFacet(ID);
-
- public static final IProjectFacetVersion VERSION_2_1 = FACET.getVersion("2.1"); //$NON-NLS-1$
-
- public static final IProjectFacetVersion VERSION_2_2 = FACET.getVersion("2.2"); //$NON-NLS-1$
-
-
- public static boolean isInstalled(final IProject project) {
- try {
- return FacetedProjectFramework.hasProjectFacet(project, ID);
- }
- catch (CoreException e) {
- JptJaxbCorePlugin.log(e);
- return false;
- }
- }
-
-
- /**
- * Not for instantiation
- */
- private JaxbFacet() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java
deleted file mode 100644
index c97623657c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * Use a JAXB factory to build any core (e.g. {@link JaxbProject})
- * model object or any Java (e.g. {@link XmlType}) context model objects
- * <p>
- * Assumes a base JAXB project context structure
- * corresponding to the JAXB spec:
- * <pre>
- * RootContext
- * |- jaxb packages/types
- * |- jaxb attributes/methods
- * </pre>
- * ... and associated objects.
- *<p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @see org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_Factory
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbFactory {
-
- // ********** Core Model **********
-
- /**
- * Construct a JaxbProject for the specified config, to be
- * added to the specified JAXB project. Return null if unable to create
- * the JAXB file (e.g. the content type is unrecognized).
- */
- JaxbProject buildJaxbProject(JaxbProject.Config config);
-
- /**
- * Construct a JAXB file for the specified JAXB project, file, content type,
- * and resource model.
- */
- JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel);
-
-
- // ********** Non-resource-specific context nodes **********
-
- /**
- * Build a (/an updated) root context node to be associated with the given
- * JAXB project.
- * The root context node will be built once, but updated many times.
- * @see JaxbProject#update(org.eclipse.core.runtime.IProgressMonitor)
- */
- JaxbContextRoot buildContextRoot(JaxbProject jaxbProject);
-
- JaxbPackage buildPackage(JaxbContextRoot parent, String packageName);
-
-
- // ********** Java context nodes **********
-
- JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage);
-
- XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent);
-
- XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation);
-
- JaxbClass buildJaxbClass(JaxbContextRoot parent, JavaResourceType resourceType);
-
- JaxbEnum buildJaxbEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum);
-
- JaxbClassMapping buildJaxbClassMapping(JaxbClass parent);
-
- JaxbEnumMapping buildJaxbEnumMapping(JaxbEnum parent);
-
- XmlRegistry buildXmlRegistry(JaxbClass parent);
-
- JaxbElementFactoryMethod buildJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod);
-
- XmlRootElement buildJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation xmlRootElementAnnotation);
-
- JaxbPersistentAttribute buildJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor);
-
- JaxbPersistentAttribute buildJavaPersistentField(JaxbClassMapping parent, JavaResourceField resourceField);
-
- JaxbPersistentAttribute buildJavaPersistentProperty(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
- JaxbAttributeMapping buildJavaNullAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlAnyAttributeMapping buildJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlAnyElementMapping buildJavaXmlAnyElementMapping(JaxbPersistentAttribute parent);
-
- XmlAttributeMapping buildJavaXmlAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlElementMapping buildJavaXmlElementMapping(JaxbPersistentAttribute parent);
-
- XmlElementRefMapping buildJavaXmlElementRefMapping(JaxbPersistentAttribute parent);
-
- XmlElementRefsMapping buildJavaXmlElementRefsMapping(JaxbPersistentAttribute parent);
-
- XmlElementsMapping buildJavaXmlElementsMapping(JaxbPersistentAttribute parent);
-
- JaxbAttributeMapping buildJavaXmlTransientMapping(JaxbPersistentAttribute parent);
-
- XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent);
-
- JaxbEnumConstant buildJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java
deleted file mode 100644
index a3e133a33d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-/**
- * A JAXB Project contains JAXB files for all files in the project that
- * are relevant to the JAXB spec.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbFile
- extends JaxbNode
-{
- /**
- * Return the JAXB file's Eclipse file.
- */
- IFile getFile();
-
- /**JAXB
- * Return the JPA file's content type.
- */
- IContentType getContentType();
-
- /**
- * Return the resource model corresponding to the JPA file; typically a JPA
- * compilation unit, a JPA XML resource, or a JPA package fragment root (JAR).
- */
- JptResourceModel getResourceModel();
-
- /**
- * Convenience method. Return the resource model corresponding to the JPA
- * file if the file's content is a "kind-of" the specified content type;
- * otherwise, return null. This is useful when a client has looked up the
- * JPA file via a file name [and assumed content type].
- * @see #getResourceModel()
- */
- JptResourceModel getResourceModel(IContentType contentType);
-
-
- // ********** root structure nodes **********
-
-// /**
-// * Return the JPA file's root structure nodes.
-// */
-// Iterator<JpaStructureNode> rootStructureNodes();
-// String ROOT_STRUCTURE_NODES_COLLECTION = "rootStructureNodes"; //$NON-NLS-1$
-//
-// /**
-// * Return the count of the JPA file's root context model objects.
-// */
-// int rootStructureNodesSize();
-//
-// /**
-// * Add a root structure node.
-// * There is the potential for multiple root structure nodes
-// * for a particular key. For example, a Java file that is listed
-// * both as a <class> in the persistence.xml and as an <entity> in
-// * an orm.xml file. In this case the orm.xml file needs to set
-// * the root structure node after the Java class reference.
-// * Last one in during project "update" wins.
-// */
-// void addRootStructureNode(Object key, JpaStructureNode rootStructureNode);
-//
-// /**
-// * @see #addRootStructureNode(Object, JpaStructureNode)
-// */
-// void removeRootStructureNode(Object key);
-//
-// /**
-// * Return the structure node best corresponding to the location in the file.
-// */
-// JpaStructureNode getStructureNode(int textOffset);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java
deleted file mode 100644
index a4eb6c5099..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.core.IResourcePart;
-import org.eclipse.jpt.common.utility.model.Model;
-
-/**
- * JAXB-specific protocol. All JAXB objects belong to a JAXB project, are
- * associated with a resource, and have a parent (excepting the JAXB project).
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbNode
- extends Model, IAdaptable, IResourcePart
-{
- /**
- * Return the JAXB project the node belongs to.
- */
- JaxbProject getJaxbProject();
-
- /**
- * Return the JAXB node's parent. The JAXB project will not have a parent.
- */
- JaxbNode getParent();
-
- void stateChanged();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java
deleted file mode 100644
index ca7799c966..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * A JAXB project is associated with an Eclipse project (and its corresponding
- * Java project). It holds the "resource" model that corresponds to the various
- * JPA-related resources (the <code>persistence.xml</code> file, its mapping files
- * [<code>orm.xml</code>],
- * and the Java source files). It also holds the "context" model that represents
- * the JPA metadata, as derived from spec-defined defaults, Java source code
- * annotations, and XML descriptors.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbProject
- extends JaxbNode
-{
-
- // ********** general **********
-
- /**
- * Return the JAXB project's name, which is the same as the associated
- * Eclipse project's name.
- */
- String getName();
-
- /**
- * Return the Eclipse project associated with the JAXB project.
- */
- IProject getProject();
-
- /**
- * Return the Java project associated with the JAXB project.
- */
- IJavaProject getJavaProject();
-
- /**
- * Return the vendor-specific JAXB platform that builds the JAXB project
- * and its contents.
- */
- JaxbPlatform getPlatform();
-
- /**
- * Return the schema library used for validating and user assist
- */
- SchemaLibrary getSchemaLibrary();
-
- /**
- * The JAXB project has been removed from the JJAXBPA model. Clean up any
- * hooks to external resources etc.
- */
- void dispose();
-
-
- // ********** JAXB files **********
-
- /**
- * ID string used when the JAXB project's collection of JAXB files changes.
- * @see #addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener)
- */
- String JAXB_FILES_COLLECTION = "jaxbFiles"; //$NON-NLS-1$
-
- /**
- * Return the JAXB project's JAXB files.
- */
- Iterable<JaxbFile> getJaxbFiles();
-
- /**
- * Return the size of the JAXB project's JAXB files.
- */
- int getJaxbFilesSize();
-
- /**
- * Return the JAXB file corresponding to the specified file.
- * Return null if there is no JAXB file associated with the specified file.
- */
- JaxbFile getJaxbFile(IFile file);
-
-
-// // ********** external Java resource compilation units **********
-//
-// /**
-// * ID string used when the JPA project's collection of external Java
-// * resource compilation units changes.
-// * @see #addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener)
-// */
-// String EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION = "externalJavaResourceCompilationUnits"; //$NON-NLS-1$
-//
-// /**
-// * Return the JPA project's external Java resource compilation units.
-// */
-// Iterator<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits();
-//
-// /**
-// * Return the size of the JPA project's external Java resource compilation units.
-// */
-// int externalJavaResourceCompilationUnitsSize();
-//
-//
-// // ********** external Java resource persistent types **********
-//
-// /**
-// * Return the JPA project's external Java resource persistent type cache.
-// */
-// JavaResourcePersistentTypeCache getExternalJavaResourcePersistentTypeCache();
-//
-
- // ********** Java resources **********
-
- /**
- * Return the Java resource packages for the project.
- * Return null if invalid or absent. These correspond to package-info.java files
- */
- Iterable<JavaResourcePackage> getJavaResourcePackages();
-
- /**
- * Return the Java resource package for the specified package.
- * Return null if invalid or absent.
- */
- JavaResourcePackage getJavaResourcePackage(String packageName);
-
- /**
- * Return the java resource packages that are annotated with
- * 1 or more valid JAXB package annotations
- */
- Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages();
-
- /**
- * Return the java resource package for the specified package if and only if it has
- * recognized annotations.
- * Return null otherwise.
- */
- JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName);
-
-// /**
-// * Return the Java resource package fragement root for the specified JAR.
-// * Return null if absent.
-// */
-// JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(String jarFileName);
-
- /**
- * Return all {@link JavaResourceAbstractType}s that are represented by java source within this project
- */
- Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes();
-
- /**
- * Return all {@link JavaResourceAbstractType}s that are represented by java source within this project,
- * that are also annotated with a recognized annotation (and are persistable)
- */
- Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes();
-
-// /**
-// * Return the names of the JAXB project's annotated Java classes
-// */
-// Iterable<String> getAnnotatedJavaSourceClassNames();
-
- /**
- * Return the {@link JavaResourceAbstractType} with the specified type name, regardless of
- * what kind it is.
- * Return null if absent.
- */
- JavaResourceAbstractType getJavaResourceType(String typeName);
-
- /**
- * Return the {@link JavaResourceAbstractType} with the specified type name and kind.
- * Return null if invalid or absent or if the kind does not match.
- */
- JavaResourceAbstractType getJavaResourceType(String typeName, JavaResourceAbstractType.Kind kind);
-
-
- // **************** jaxb.index resources **********************************
-
- /**
- * Return all jaxb.index resource models within the project
- */
- Iterable<JaxbIndexResource> getJaxbIndexResources();
-
- /**
- * Return the first jaxb.index resource model (could be multiple if there are multiple locations
- * for a given package) with the given package name
- */
- JaxbIndexResource getJaxbIndexResource(String packageName);
-
-
- // **************** jaxb.properties resources *****************************
-
- /**
- * Return all jaxb.properties resource models within the project
- */
- Iterable<JaxbPropertiesResource> getJaxbPropertiesResources();
-
- /**
- * Return the first jaxb.properties resource model (could be multiple if there are multiple locations
- * for a given package) with the given package name
- */
- JaxbPropertiesResource getJaxbPropertiesResource(String packageName);
-
-
- // **************** context model *****************************************
-
- /**
- * Return the root of the JAXB project's context model.
- */
- JaxbContextRoot getContextRoot();
-
- /**
- * Return all types/package infos that are primary context objects for the
- * given compilation unit
- */
- Iterable<? extends JavaContextNode> getPrimaryJavaNodes(ICompilationUnit cu);
-
-
- // ********** model synchronization **********
-
- /**
- * Synchronize the JPA project with the specified project resource
- * delta, watching for added and removed files in particular.
- */
- void projectChanged(IResourceDelta delta);
-
- /**
- * Synchronize the JPA project with the specified Java change.
- */
- void javaElementChanged(ElementChangedEvent event);
-
-
-
- // ********** synchronize context model with resource model **********
-
- /**
- * Return the synchronizer that will synchronize the context model with
- * the resource model whenever the resource model changes.
- */
- Synchronizer getContextModelSynchronizer();
-
- /**
- * Set the synchronizer that will keep the context model synchronized with
- * the resource model whenever the resource model changes.
- * Before setting the synchronizer, clients should save the current
- * synchronizer so it can be restored later.
- *
- * @see #getContextModelSynchronizer()
- */
- void setContextModelSynchronizer(Synchronizer synchronizer);
-
- /**
- * The JAXB project's resource model has changed; synchronize the JPA
- * project's context model with it. This method is typically called when the
- * resource model state has changed when it is synchronized with its
- * underlying Eclipse resource as the result of an Eclipse resource change
- * event. This method can also be called when a client (e.g. a JUnit test
- * case) has manipulated the resource model via its API (as opposed to
- * modifying the underlying Eclipse resource directly) and needs the context
- * model to be synchronized accordingly (since manipulating the resource
- * model via its API will not trigger this method). Whether the context
- * model is synchronously (or asynchronously) depends on the current context
- * model synchronizer.
- *
- * @see #synchronizeContextModelAndWait()
- */
- void synchronizeContextModel();
-
- /**
- * Force the JAXB project's context model to synchronize with it resource
- * model <em>synchronously</em>.
- *
- * @see #synchronizeContextModel()
- * @see #updateAndWait()
- */
- void synchronizeContextModelAndWait();
-
- /**
- * This is the callback used by the context model synchronizer to perform
- * the actual "synchronize".
- */
- IStatus synchronizeContextModel(IProgressMonitor monitor);
-
- // ********** project "update" **********
-
- /**
- * Return the synchronizer that will update the context model whenever
- * it has any changes. This allows any intra-JAXB project dependencies to
- * be updated.
- */
- CallbackSynchronizer getUpdateSynchronizer();
-
- /**
- * Set the synchronizer that will update the context model whenever
- * it has any changes. This allows any intra-JAXB project dependencies to
- * be updated.
- * Before setting the update synchronizer, clients should save the current
- * synchronizer so it can be restored later.
- *
- * @see #getUpdateSynchronizer()
- */
- void setUpdateSynchronizer(CallbackSynchronizer synchronizer);
-
- /**
- * Force the JAXB project to "update" <em>synchronously</em>.
- *
- * @see #synchronizeContextModelAndWait()
- */
- void updateAndWait();
-
- /**
- * This is the callback used by the update synchronizer to perform the
- * actual "update".
- */
- IStatus update(IProgressMonitor monitor);
-
-
-
-
-// // ********** utility **********
-//
-// /**
-// * Return an {@link IFile} that best represents the given runtime location
-// */
-// IFile getPlatformFile(IPath runtimePath);
-
-
- // ********** validation **********
-
- /**
- * Return project's validation messages.
- */
- Iterable<IMessage> getValidationMessages(IReporter reporter);
-
-
- // ********** modifying shared documents **********
-
- /**
- * Set a thread-specific implementation of the {@link CommandExecutor}
- * interface that will be used to execute a command to modify a shared
- * document. If necessary, the command executor can be cleared by
- * setting it to null.
- * This allows background clients to modify documents that are
- * already present in the UI. See implementations of {@link CommandExecutor}.
- */
- void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor);
-
- /**
- * Return the project-wide implementation of the
- * {@link CommandExecutor} interface.
- */
- CommandExecutor getModifySharedDocumentCommandExecutor();
-
-
- // ********** construction config **********
-
- /**
- * The settings used to construct a JAXB project.
- */
- interface Config {
-
- /**
- * Return the Eclipse project to be associated with the new JAXB project.
- */
- IProject getProject();
-
- /**
- * Return the JAXB platform definition to be associated with the new JAXB project.
- */
- JaxbPlatformDefinition getPlatformDefinition();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java
deleted file mode 100644
index 68258577ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.model.Model;
-
-
-/**
- * The JAXB project manager holds all the JAXB projects in the workspace.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbProjectManager
- extends Model {
-
- /**
- * Return the JAXB model's JAXB projects.
- */
- Iterable<JaxbProject> getJaxbProjects();
- public static final String JAXB_PROJECTS_COLLECTION = "jaxbProjects"; //$NON-NLS-1$
-
- /**
- * Return the size of the JAXB model's list of JAXB projects.
- */
- int getJaxbProjectsSize();
-
- /**
- * Return the JAXB project corresponding to the specified Eclipse project.
- * Return null if unable to associate the specified Eclipse project
- * with a JAXB project.
- */
- JaxbProject getJaxbProject(IProject project);
-
- /**
- * Return the JAXB file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JAXB file.
- */
- JaxbFile getJaxbFile(IFile file);
-
- /**
- * The JAXB settings associated with the specified Eclipse project
- * have changed in such a way as to require the associated
- * JPA project to be completely rebuilt
- * (e.g. when the user changes a project's JAXB platform).
- */
- void rebuildJaxbProject(IProject project);
-
- /**
- * Return whether the model's Java change listener is active.
- */
- boolean javaElementChangeListenerIsActive();
-
- /**
- * Set whether the model's Java change listener is active.
- */
- void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java
deleted file mode 100644
index 5a7c5eab5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-/**
- * Map a content type to a JAXB resource model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbResourceModelProvider
-{
- /**
- * Return the file content type the provider is for.
- */
- IContentType getContentType();
-
- /**
- * Build a JAXB resource model for the specified JAXB project and file.
- * Use the specified factory for creation so extenders can simply override
- * the appropriate creation method instead of building a provider for the
- * same content.
- */
- JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
deleted file mode 100644
index 2c08acecf2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformManagerImpl;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * The Dali JAXB core plug-in lifecycle implementation.
- * A number of globally-available constants and methods.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class JptJaxbCorePlugin
- extends Plugin {
-
- private static volatile boolean flushPreferences = true;
-
- /**
- * The plug-in identifier of Dali JAXB core
- * (value <code>"org.eclipse.jpt.jaxb.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- /**
- * The node for storing a JAXB project's platform in the project's preferences.
- */
- public static final String PLATFORM_PREF_NODE = "platform"; //$NON-NLS-1$
-
- /**
- * The key for storing the platform id
- */
- public static final String PLATFORM_ID_PREF_KEY = "platform-id"; //$NON-NLS-1$
-
- /**
- * The node for storing a JAXB project's schemas in the project's preferences.
- */
- public static final String SCHEMAS_PREF_NODE = "schemas"; //$NON-NLS-1$
-
- /**
- * The node prefix for storing a particular JAXB project schema in the project's preferences.
- * Specific schema nodes are followed by integers ("schema-1", "schema-2", etc.)
- */
- public static final String SCHEMA_PREF_NODE_PREFIX = "schema-"; //$NON-NLS-1$
-
- /**
- * The key for storing a schema namespace in the project's preferences
- */
- public static final String SCHEMA_NAMESPACE_PREF_KEY = "namespace"; //$NON-NLS-1$
-
- /**
- * The key for storing a schema location (such as a uri or catalog key) in the project's preferences
- */
- public static final String SCHEMA_LOCATION_PREF_KEY = "location"; //$NON-NLS-1$
-
- /**
- * The key for storing the default JAXB platform ID for JAXB 2.1 in the workspace preferences.
- */
- public static final String DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY =
- "defaultJaxbPlatform_" + JaxbFacet.VERSION_2_1.getVersionString(); //$NON-NLS-1$
-
- /**
- * The key for storing the default JAXB platform ID for JAXB 2.2 in the workspace preferences.
- */
- public static final String DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY =
- "defaultJaxbPlatform_" + JaxbFacet.VERSION_2_2.getVersionString(); //$NON-NLS-1$
-
- /**
- * The identifier for the JAXB validation marker
- * (value <code>"org.eclipse.jpt.jaxb.core.jaxbProblemMarker"</code>).
- */
- public static final String VALIDATION_MARKER_ID = PLUGIN_ID + ".jaxbProblemMarker"; //$NON-NLS-1$
-
- /**
- * The content type for jaxb.index files
- */
- public static final IContentType JAXB_INDEX_CONTENT_TYPE = getJaxbContentType("jaxbIndex");
-
- /**
- * The resource type for jaxb.index files
- */
- public static final JptResourceType JAXB_INDEX_RESOURCE_TYPE = new JptResourceType(JAXB_INDEX_CONTENT_TYPE);
-
- /**
- * The content type for jaxb.properties files
- */
- public static final IContentType JAXB_PROPERTIES_CONTENT_TYPE = getJaxbContentType("jaxbProperties");
-
- /**
- * The resource type for jaxb.properties files
- */
- public static final JptResourceType JAXB_PROPERTIES_RESOURCE_TYPE = new JptResourceType(JAXB_PROPERTIES_CONTENT_TYPE);
-
- private static IContentType getJaxbContentType(String contentType) {
- return getContentType(CONTENT_PREFIX_ + contentType);
- }
-
- public static final String CONTENT_PREFIX = PLUGIN_ID_ + "content"; //$NON-NLS-1$
-
- public static final String CONTENT_PREFIX_ = CONTENT_PREFIX + '.';
-
- private static IContentType getContentType(String contentType) {
- return Platform.getContentTypeManager().getContentType(contentType);
- }
-
-
- // **************** fields ************************************************
-
- private volatile GenericJaxbProjectManager projectManager;
-
-
- // **************** singleton *********************************************
-
- private static JptJaxbCorePlugin INSTANCE;
-
- /**
- * Return the singleton plug-in
- */
- public static JptJaxbCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Return the singular JAXB project manager corresponding to the current workspace.
- */
- public static JaxbProjectManager getProjectManager() {
- return INSTANCE.getProjectManager_();
- }
-
- /**
- * Return the JAXB project corresponding to the specified Eclipse project,
- * or <code>null</code> if unable to associate the specified project with a
- * JAXB project.
- */
- public static JaxbProject getJaxbProject(IProject project) {
- return getProjectManager().getJaxbProject(project);
- }
-
- public static JaxbPlatformManager getJaxbPlatformManager() {
- return JaxbPlatformManagerImpl.instance();
- }
-
- /**
- * Return the default Dali preferences
- * @see JpaPreferenceInitializer
- */
- public static IEclipsePreferences getDefaultPreferences() {
- return getPreferences(DefaultScope.INSTANCE);
- }
-
- /**
- * Return the Dali preferences for the current workspace instance.
- */
- public static IEclipsePreferences getWorkspacePreferences() {
- return getPreferences(InstanceScope.INSTANCE);
- }
-
- /**
- * Return the Dali preferences for the specified context.
- */
- private static IEclipsePreferences getPreferences(IScopeContext context) {
- return context.getNode(PLUGIN_ID);
- }
-
- /**
- * Set the workspace preference.
- */
- public static void setWorkspacePreference(String preferenceKey, String preferenceValue) {
- IEclipsePreferences prefs = getWorkspacePreferences();
- prefs.put(preferenceKey, preferenceValue);
- flush(prefs);
- }
-
- /**
- * This method is called (via reflection) when the test plug-in is loaded.
- * The preferences end up getting flushed after the test case has deleted
- * its project, resulting in resource exceptions in the log, e.g.
- * <pre>
- * Resource '/JpaProjectManagerTests' is not open.
- * </pre>
- * See <code>JptJaxbCoreTestsPlugin.start(BundleContext)</code>
- */
- @SuppressWarnings("unused")
- private static void doNotFlushPreferences() {
- flushPreferences = false;
- }
-
- /**
- * Flush preferences in an asynchronous Job because the flush request will
- * trigger a lock on the project, which can cause us some deadlocks (e.g.
- * when deleting the metamodel source folder).
- * Note: the flush will also remove the prefs node if it is empty
- */
- private static void flush(IEclipsePreferences prefs) {
- if (flushPreferences) {
- new PreferencesFlushJob(prefs).schedule();
- }
- }
-
- private static class PreferencesFlushJob extends Job {
- private final IEclipsePreferences prefs;
- PreferencesFlushJob(IEclipsePreferences prefs) {
- super(NLS.bind(JptJaxbCoreMessages.PREFERENCES_FLUSH_JOB_NAME, prefs.absolutePath()));
- this.prefs = prefs;
- }
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- prefs.flush();
- } catch(BackingStoreException ex) {
- log(ex);
- }
- return Status.OK_STATUS;
- }
- }
-
- public static Preferences getProjectPreferences(IProject project) {
- try {
- IFacetedProject fproj = ProjectFacetsManager.create(project);
- return fproj.getPreferences(JaxbFacet.FACET);
- }
- catch (BackingStoreException bse) {
- log(bse);
- }
- catch (CoreException ce) {
- log(ce);
- }
- return null;
- }
-
- /**
- * Set the default {@link JaxbPlatformDescription} for new JAXB projects with the given
- * JAXB facet version.
- */
- public static void setDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion, JaxbPlatformDescription platform) {
- String preferenceKey = null;
- if (JaxbFacet.VERSION_2_1.equals(jaxbFacetVersion)) {
- preferenceKey = DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (JaxbFacet.VERSION_2_2.equals(jaxbFacetVersion)) {
- preferenceKey = DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JAXB facet version: " + jaxbFacetVersion); //$NON-NLS-1$
- }
- setWorkspacePreference(preferenceKey, platform.getId());
- }
-
- /**
- * Return the default {@link JaxbPlatformDescription} for new JAXB projects with the given
- * JAXB facet version.
- */
- public static JaxbPlatformDescription getDefaultPlatform(IProjectFacetVersion jaxbFacetVersion) {
-
- JaxbPlatformDescription defaultPlatform =
- getDefaultPlatform(
- jaxbFacetVersion,
- getWorkspacePreferences(),
- getDefaultPreferences());
- if (defaultPlatform == null) {
- // if the platform ID stored in the workspace prefs is invalid (i.e. null), look in the default prefs
- defaultPlatform = getDefaultPlatform(jaxbFacetVersion, getDefaultPreferences());
- }
- return defaultPlatform;
- }
-
- private static JaxbPlatformDescription getDefaultPlatform(
- IProjectFacetVersion jaxbFacetVersion, Preferences ... nodes) {
-
- JaxbPlatformDescription defaultDefaultPlatform;
- String preferenceKey;
- if (jaxbFacetVersion.equals(JaxbFacet.VERSION_2_1)) {
- defaultDefaultPlatform = GenericJaxbPlatform.VERSION_2_1;
- preferenceKey = DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (jaxbFacetVersion.equals(JaxbFacet.VERSION_2_2)) {
- defaultDefaultPlatform = GenericJaxbPlatform.VERSION_2_2;
- preferenceKey = DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JAXB facet version: " + jaxbFacetVersion); //$NON-NLS-1$
- }
- return getDefaultPlatform(jaxbFacetVersion, preferenceKey, defaultDefaultPlatform, nodes);
- }
-
- private static JaxbPlatformDescription getDefaultPlatform(
- IProjectFacetVersion jaxbFacetVersion, String preferenceKey,
- JaxbPlatformDescription defaultDefault, Preferences ... nodes) {
-
- String defaultDefaultId = (defaultDefault == null) ? null : defaultDefault.getId();
- String defaultPlatformId = Platform.getPreferencesService().get(preferenceKey, defaultDefaultId, nodes);
- JaxbPlatformDescription defaultPlatform = getJaxbPlatformManager().getJaxbPlatform(defaultPlatformId);
- if (defaultPlatform != null && defaultPlatform.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return defaultPlatform;
- }
- else if (defaultDefault != null && defaultDefault.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return defaultDefault;
- }
- return null;
- }
-
- /**
- * Return the JAXB platform ID associated with the specified Eclipse project.
- */
- public static String getJaxbPlatformId(IProject project) {
- Preferences prefs = getProjectPreferences(project);
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- return platformPrefs.get(PLATFORM_ID_PREF_KEY, GenericJaxbPlatform.VERSION_2_1.getId());
- }
-
- /**
- * Return the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public static JaxbPlatformDescription getJaxbPlatformDescription(IProject project) {
- String jpaPlatformId = getJaxbPlatformId(project);
- return getJaxbPlatformManager().getJaxbPlatform(jpaPlatformId);
- }
-
- /**
- * Set the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public static void setJaxbPlatform(IProject project, JaxbPlatformDescription platform) {
- Preferences prefs = getProjectPreferences(project);
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- platformPrefs.put(PLATFORM_ID_PREF_KEY, platform.getId());
- try {
- platformPrefs.flush();
- }
- catch (BackingStoreException bse) {
- log(bse);
- }
- }
-
- public static Map<String, String> getSchemaLocationMap(IProject project) {
- Map<String, String> schemaLocationMap = new HashMap<String, String>();
- Preferences prefs = getProjectPreferences(project);
- Preferences schemasPrefs = prefs.node(SCHEMAS_PREF_NODE);
- try {
- boolean checkAnotherNode = true;
- for (int i = 1; checkAnotherNode; i++ ) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- if (schemasPrefs.nodeExists(nodeName)) {
- Preferences schemaPrefs = schemasPrefs.node(nodeName);
- String namespace = schemaPrefs.get(SCHEMA_NAMESPACE_PREF_KEY, null);
- String location = schemaPrefs.get(SCHEMA_LOCATION_PREF_KEY, null);
- if (namespace != null) {
- schemaLocationMap.put(namespace, location);
- }
- }
- else {
- checkAnotherNode = false;
- }
- }
- }
- catch (BackingStoreException bse) {
- // this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
- }
- return schemaLocationMap;
- }
-
- public static void setSchemaLocationMap(IProject project, Map<String, String> schemaLocationMap) {
- Preferences prefs = getProjectPreferences(project);
- Preferences schemasPrefs = prefs.node(SCHEMAS_PREF_NODE);
- try {
- int i = 1;
- for (String namespace : schemaLocationMap.keySet()) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- Preferences schemaPref = schemasPrefs.node(nodeName);
- schemaPref.put(SCHEMA_NAMESPACE_PREF_KEY, namespace);
- schemaPref.put(SCHEMA_LOCATION_PREF_KEY, schemaLocationMap.get(namespace));
- i ++;
- }
- boolean checkAnotherNode = true;
- for ( ; checkAnotherNode; i++ ) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- if (schemasPrefs.nodeExists(nodeName)) {
- schemasPrefs.node(nodeName).removeNode();
- }
- else {
- checkAnotherNode = false;
- }
- }
- schemasPrefs.flush();
- }
- catch (BackingStoreException bse) {
- // this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
- }
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbCorePlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // nothing yet...
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- try {
- if (this.projectManager != null) {
- this.projectManager.stop();
- this.projectManager = null;
- }
- } finally {
- super.stop(context);
- }
- }
-
- private synchronized GenericJaxbProjectManager getProjectManager_() {
- if (this.projectManager == null) {
- this.projectManager = this.buildProjectManager();
- this.projectManager.start();
- }
- return this.projectManager;
- }
-
- private GenericJaxbProjectManager buildProjectManager() {
- return new GenericJaxbProjectManager();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java
deleted file mode 100644
index 00bc71254d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-/**
- * Identifiers for JAXB class/attribute mapping types
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-@SuppressWarnings("nls")
-public interface MappingKeys {
-
- String XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY = "xml-any-attribute";
- String XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY = "xml-any-element";
- String XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY = "xml-attribute";
- String XML_ELEMENT_ATTRIBUTE_MAPPING_KEY = "xml-element";
- String XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY = "xml-elements";
- String XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY = "xml-element-ref";
- String XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY = "xml-element-refs";
- String XML_MIXED_ATTRIBUTE_MAPPING_KEY = "xml-mixed";
- String XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY = "xml-transient";
- String XML_VALUE_ATTRIBUTE_MAPPING_KEY = "xml-value";
-
- /** mapping key for attribute mappings that are unrecognized */
- String NULL_ATTRIBUTE_MAPPING_KEY = null;
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java
deleted file mode 100644
index 4680681b9a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.Map;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-/**
- * Entry point for accessing project schema resources
- *
- * @noimplement
- * @version 3.0
- * @since 3.0
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SchemaLibrary {
-
- /**
- * Return the project settings that indicate how schema keys are mapped to actual
- * resolvable schemas
- */
- public Map<String, String> getSchemaLocations();
-
- /**
- * Set the project settings that indicate how schema keys are mapped to actual
- * resolvable schemas.
- */
- public void setSchemaLocations(Map<String, String> schemaLocations);
-
- /**
- * Return the XsdSchema identified by the given namespace, if it exists and is resolvable.
- * Return null otherwise.
- */
- public XsdSchema getSchema(String namespace);
-
- /**
- * Refresh the schema with the given namespace, if it exists and is resolvable.
- * Do nothing otherwise.
- */
- public void refreshSchema(String namespace);
-
- /**
- * Refresh all schemas within the library.
- */
- public void refreshAllSchemas();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java
deleted file mode 100644
index 3aa84db340..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB accessor (field/property).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface Accessor
- extends JavaContextNode {
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- boolean isFor(JavaResourceField resourceField);
-
- boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
- /**
- * Return the type name of the java attribute, or the item type name of a collection or array.
- */
- String getJavaResourceAttributeBaseTypeName();
-
- /**
- * (See JAXB 2.2 Spec, sect. 5.5.2)
- * Return true if the java attribute type is an extension of java.util.Collection or a single
- * dimensional array (except for byte[], which is treated like a non-array)
- */
- boolean isJavaResourceAttributeCollectionType();
-
- /**
- * Return whether the java resource attribute type is a subtype of the given type
- * This might not return the same thing as getJavaResourceAttribute().typeIsSubTypeOf(String).
- */
- boolean isJavaResourceAttributeTypeSubTypeOf(String typeName);
-
-
- //**************** static methods *****************
-
- final class AccessorTools {
-
- public static final String BYTE_ARRAY_CLASS_NAME = "byte[]";
- public static final String COLLECTION_CLASS_NAME = Collection.class.getName();
- public static final String OBJECT_CLASS_NAME = Object.class.getName();
-
- public static String getBaseTypeName(JavaResourceAttribute attribute) {
- if (attribute.typeIsArray()) {
- if (BYTE_ARRAY_CLASS_NAME.equals(attribute.getTypeName())) {
- return BYTE_ARRAY_CLASS_NAME;
- }
- else if (attribute.getTypeArrayDimensionality() == 1) {
- return attribute.getTypeArrayComponentTypeName();
- }
- }
- else if (attribute.typeIsSubTypeOf(COLLECTION_CLASS_NAME)) {
- if (attribute.getTypeTypeArgumentNamesSize() == 1) {
- return attribute.getTypeTypeArgumentName(0);
- }
- return OBJECT_CLASS_NAME;
- }
- return attribute.getTypeName();
- }
-
- /**
- * @see JaxbPersistentAttribute#isJavaResourceAttributeCollectionType()
- */
- public static boolean isCollectionType(JavaResourceAttribute attribute) {
- if (attribute.typeIsArray()) {
- if (attribute.getTypeArrayDimensionality() == 1
- && ! BYTE_ARRAY_CLASS_NAME.equals(attribute.getTypeName())) {
- return true;
- }
- return false;
- }
- else if (attribute.typeIsSubTypeOf(COLLECTION_CLASS_NAME)) {
- return true;
- }
-
- return false;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java
deleted file mode 100644
index 8e6fa15976..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB attribute mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbAttributeMapping
- extends JavaContextNode {
-
- String getKey();
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- JaxbPersistentAttribute getPersistentAttribute();
-
- JaxbClassMapping getClassMapping();
-
-
- // ***** default *****
-
- String DEFAULT_PROPERTY = "default"; //$NON-NLS-1$
-
- /**
- * Return whether the mapping is its attribute's <em>default</em> mapping
- * (as opposed to its <em>specified</em> mapping).
- */
- boolean isDefault();
-
-
- // ***** misc *****
-
- /**
- * Return the (fully qualified) type of the attribute
- * (or the item type if in a collection/array)
- */
- String getBoundTypeName();
-
- /**
- * Return the (fully qualified) type used to map the bound type.
- * (Usually the same as the value type, except when an XmlJavaTypeAdapter is used.)
- */
- String getValueTypeName();
-
- /**
- * Return the (fully qualified) type of the data actually written to xml.
- * (Usually the same as the value type, except when an XmlIDREF is used.)
- */
- String getDataTypeName();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- /**
- * Return whether the attribute is mapped to a particle
- * (e.g. XmlElement, XmlElements, XmlElementRef, XmlElementRefs)
- */
- boolean isParticleMapping();
-
- /**
- * Return whether the attribute is specifically excluded from being mapped
- * (e.g. XmlTransient)
- */
- boolean isTransient();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java
deleted file mode 100644
index 5f9e757bcd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Holds the attributes represented by a particular JavaResourceType and XmlAccessType.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbAttributesContainer
- extends JavaContextNode {
-
- /**
- * Return true if this JaxbAtributesContainer contains attributes for the given JavaResourceType.
- */
- boolean isFor(JavaResourceType javaResourceType);
-
-
- /********** attributes **********/
-
- Iterable<JaxbPersistentAttribute> getAttributes();
-
- int getAttributesSize();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbBasicMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbBasicMapping.java
deleted file mode 100644
index 7a301f26ba..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbBasicMapping.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-
-/**
- * Represents a JAXB mapping of an attribute to a single xml attribute or element
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbBasicMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** xml schema type *****
-
- String XML_SCHEMA_TYPE_PROPERTY = "xmlSchemaType"; //$NON-NLS-1$
-
- XmlSchemaType getXmlSchemaType();
-
- XmlSchemaType addXmlSchemaType();
-
- void removeXmlSchemaType();
-
-
- // ***** XmlList *****
-
- String XML_LIST_PROPERTY = "xmlList"; //$NON-NLS-1$
-
- XmlList getXmlList();
-
- XmlList addXmlList();
-
- void removeXmlList();
-
-
- // ***** XmlID *****
-
- String XML_ID_PROPERTY = "xmlID"; //$NON-NLS-1$
-
- XmlID getXmlID();
-
- XmlID addXmlID();
-
- void removeXmlID();
-
-
- // ***** XmlIDREF *****
-
- String XML_IDREF_PROPERTY = "xmlIDREF"; //$NON-NLS-1$
-
- XmlIDREF getXmlIDREF();
-
- XmlIDREF addXmlIDREF();
-
- void removeXmlIDREF();
-
-
- // ***** XmlAttachmentRef *****
-
- String XML_ATTACHMENT_REF_PROPERTY = "xmlAttachmentRef"; //$NON-NLS-1$
-
- XmlAttachmentRef getXmlAttachmentRef();
-
- XmlAttachmentRef addXmlAttachmentRef();
-
- void removeXmlAttachmentRef();
-
-
- // ***** misc *****
-
- XsdFeature getXsdFeature();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java
deleted file mode 100644
index 6a85bf3de7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-
-/**
- * Represents a <i>class</i> in a JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbClass
- extends JaxbType {
-
- // ***** overrides *****
-
- JavaResourceType getJavaResourceType();
-
- public JaxbClassMapping getMapping();
-
-
- // ***** XmlRegistry *****
-
- String XML_REGISTRY_PROPERTY = "xmlRegistry"; //$NON-NLS-1$
-
- XmlRegistry getXmlRegistry();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java
deleted file mode 100644
index 52e64fc4bf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-
-public interface JaxbClassMapping
- extends JaxbTypeMapping, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- // ***** overrides *****
-
- JaxbClass getJaxbType();
-
-
- // ***** XmlType.factoryClass *****
-
- String FACTORY_CLASS_PROPERTY = "factoryClass"; //$NON-NLS-1$
-
- /**
- * factory class corresponds to the XmlType annotation factoryClass element
- */
- String getFactoryClass();
-
- void setFactoryClass(String factoryClass);
-
-
- // ***** XmlType.factoryMethod *****
-
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
- /**
- * factory method corresponds to the XmlType annotation factoryMethod element
- */
- String getFactoryMethod();
-
- void setFactoryMethod(String factoryMethod);
-
-
- // ***** XmlType.propOrder *****
-
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- /**
- * propOrder corresponds to the XmlType annotation propOrder element
- */
- ListIterable<String> getPropOrder();
-
- String getProp(int index);
-
- int getPropOrderSize();
-
- void addProp(int index, String prop);
-
- void removeProp(int index);
-
- void removeProp(String prop);
-
- void moveProp(int targetIndex, int sourceIndex);
-
-
- // ***** superclass *****
-
- String SUPERCLASS_PROPERTY = "superclass"; //$NON-NLS-1$
-
- JaxbClassMapping getSuperclass();
-
-
- // ***** attributes *****
-
- String ATTRIBUTES_COLLECTION = "attributes"; //$NON-NLS-1$
-
- Iterable<JaxbPersistentAttribute> getAttributes();
-
- int getAttributesSize();
-
-
- // ***** included attributes *****
-
- String INCLUDED_ATTRIBUTES_COLLECTION = "includedAttributes"; //$NON-NLS-1$
-
- /**
- * <i>Included</i> attributes come from any direct superclasses that are mapped as @XmlTransient.
- * (As opposed to <i>inherited</i> attributes, which a class has by way of <i>any</i> mapped superclasses.)
- * If there is an intervening class that is not transient, then that class will hold any
- * included attributes from any direct superclass that are mapped as @XmlTransient.
- * @see JaxbClassMapping#getSuperclass()
- */
- Iterable<JaxbPersistentAttribute> getIncludedAttributes();
-
- int getIncludedAttributesSize();
-
-
- // ***** misc attributes *****
-
- /**
- * Return all attributes that are defined by this class.
- * This is the combined set of #getAttributes() and #getIncludedAttributes()
- */
- Iterable<JaxbPersistentAttribute> getAllLocallyDefinedAttributes();
-
- /**
- * <i>Inherited</i> attributes are any attributes this class mapping has whose source
- * is a superclass.
- * Inherited attributes include <i>included</i> attributes.
- */
- Iterable<JaxbPersistentAttribute> getInheritedAttributes();
-
-
- // ***** misc *****
-
- /**
- * Return the id attribute mapping for this class mapping, if it has one.
- * (Will return the first one it finds, if this class has more than one.)
- */
- JaxbAttributeMapping getXmlIdMapping();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
deleted file mode 100644
index 9918f02d62..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-
-/**
- * Common protocol for JAXB objects that have a context, as opposed to
- * resource objects.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbContextNode
- extends JaxbNode {
-
- /**
- * Return the root of the context model
- */
- JaxbContextRoot getContextRoot();
-
- /**
- * Return the resource type of the context node's resource.
- */
- JptResourceType getResourceType();
-
-
- // ********** updating **********
-
- void synchronizeWithResourceModel();
-
- /**
- * Update the context model with the content of the JAXB resource model.
- */
- void update();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java
deleted file mode 100644
index f203a01b64..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Root of the JAXB context model.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbContextRoot
- extends JaxbContextNode {
-
- // ***** packages *****
-
- static String PACKAGES_COLLECTION = "packages"; //$NON-NLS-1$
-
- /**
- * The set of packages. Includes any package with any interesting JAXB content.
- */
- Iterable<JaxbPackage> getPackages();
-
- /**
- * Return the package with the given name
- */
- JaxbPackage getPackage(String packageName);
-
- int getPackagesSize();
-
-
- // ***** jaxb types *****
-
- public final static String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Return the set of all JAXB types within this context root.
- */
- Iterable<JaxbType> getTypes();
-
- /**
- * Return the type with the given (fully qualified) type name
- */
- JaxbType getType(String typeName);
-
- int getTypesSize();
-
- /**
- * Return the set of types that are in the given package
- */
- Iterable<JaxbType> getTypes(JaxbPackage jaxbPackage);
-
- /**
- * The set of jaxb classes. These may be explicitly or implicitly included.
- */
- Iterable<JaxbClass> getClasses();
-
- /**
- * Return the set of jaxb classes that are in the given package
- */
- Iterable<JaxbClass> getClasses(JaxbPackage jaxbPackage);
-
- /**
- * The set of jaxb enums. These may be explicitly or implicitly included.
- */
- Iterable<JaxbEnum> getEnums();
-
- /**
- * Return the set of jaxb enums that are in the given package
- */
- Iterable<JaxbEnum> getEnums(JaxbPackage jaxbPackage);
-
- /**
- * Return the set of {@link XmlRegistry}(ie)s that are in the given package
- */
- Iterable<XmlRegistry> getXmlRegistries(JaxbPackage jaxbPackage);
-
- /**
- * Return the {@link JaxbTypeMapping} for the given (fully qualified) type name
- */
- JaxbTypeMapping getTypeMapping(String typeName);
-
- /**
- * Return the {@link JaxbClassMapping} for the given (fully qualified) type name
- */
- JaxbClassMapping getClassMapping(String typeName);
-
-
- // ***** misc *****
-
-
-
-
- // ***** validation *****
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
deleted file mode 100644
index 563907c44a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB element factory method
- * (A method inside an object factory (@XmlRegistry) with an explicit @XmlElementDecl annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbElementFactoryMethod
- extends JavaContextNode {
-
- JavaResourceMethod getResourceMethod();
-
- /**
- * Return the method name
- */
- String getName();
-
-
- // ***** scope *****
-
- /**
- * Corresponds to the XmlElementDecl annotation 'scope' element
- */
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
-
- String getScope();
-
- void setScope(String scope);
-
- String DEFAULT_SCOPE_CLASS_NAME = "javax.xml.bind.annotation.XmlElementDecl.GLOBAL"; //$NON-NLS-1$
-
- String getFullyQualifiedScope();
-
- /**
- * Return true if the scope is default or is specified to be XmlElementDecl.GLOBAL.
- */
- boolean isGlobalScope();
-
-
- // ***** qName *****
-
- JaxbQName getQName();
-
-
- // ***** substitution head qName *****
-
- JaxbQName getSubstitutionHeadQName();
-
-
- // ***** default value *****
-
- /**
- * Corresponds to the XmlElementDecl annotation 'defaultValue' element
- */
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- void setDefaultValue(String defaultValue);
-
- String DEFAULT_DEFAULT_VALUE = "\u0000"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java
deleted file mode 100644
index 5a98a688b8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-
-/**
- * Represents an <i>enum</i> in a JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbEnum
- extends JaxbType {
-
- // ***** covariant overrides *****
-
- JavaResourceEnum getJavaResourceType();
-
- public JaxbEnumMapping getMapping();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
deleted file mode 100644
index f84439f633..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB enum constant.
- * (A constant inside an enum with either an explicit or implicit @XmlEnumValue annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbEnumConstant
- extends JavaContextNode {
-
- JavaResourceEnumConstant getResourceEnumConstant();
-
- /**
- * Return the name of the enum constant. This will not change, a
- * new JaxbEnumConstant will be built if the name changes.
- */
- String getName();
-
-
- /**
- * Return the enum constant's value, whether specified or default.
- */
- String getValue();
-
- /**
- * The default value will be the name of the enum constant.
- * It will be used if the XmlEnumValue annotation is null.
- * @see getName()
- */
- String getDefaultValue();
-
- /**
- * Corresponds to the XmlEnumValue annotation 'value' element
- */
- String getSpecifiedValue();
- void setSpecifiedValue(String value);
- String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java
deleted file mode 100644
index 7d3b1db097..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-
-/**
- * Represents mapping metadata on an enum (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbEnumMapping
- extends JaxbTypeMapping {
-
- // ***** XmlEnum.value *****
-
- /**
- * Return the type specified for the XmlEnum.value, or "java.lang.String" if unspecified
- */
- String getXmlEnumValue();
-
- String SPECIFIED_XML_ENUM_VALUE_PROPERTY = "specifiedXmlEnum"; //$NON-NLS-1$
-
- /**
- * Return the value of the XmlEnum.value element
- */
- String getSpecifiedXmlEnumValue();
-
- void setSpecifiedXmlEnumValue(String xmlEnumValue);
-
- /**
- * Return the value of the XmlEnum.value element, taking into consideration imports
- */
- String getFullyQualifiedXmlEnumValue();
-
- String DEFAULT_XML_ENUM_VALUE = "java.lang.String"; //$NON-NLS-1$
-
-
- // ***** enum constants *****
-
- String ENUM_CONSTANTS_COLLECTION = "enumConstants"; //$NON-NLS-1$
-
- Iterable<JaxbEnumConstant> getEnumConstants();
-
- int getEnumConstantsSize();
-
-
- // ***** misc *****
-
- XsdSimpleTypeDefinition getValueXsdTypeDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java
deleted file mode 100644
index 739cbe8806..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPackage
- extends JaxbContextNode {
-
- /**
- * The package name.
- * This is unchanging in that, if a package name changes, a new JaxbPackage is created.
- */
- String getName();
-
- /**
- * The optional package-info
- */
- JaxbPackageInfo getPackageInfo();
- public final static String PACKAGE_INFO_PROPERTY = "package-info"; //$NON-NLS-1$
-
- /**
- * Return the namespace associated with this package, default or specified
- */
- String getNamespace();
-
- /**
- * Return the attribute form default associated with this package
- */
- XmlNsForm getAttributeFormDefault();
-
- /**
- * Return the element form default associated with this package
- */
- XmlNsForm getElementFormDefault();
-
- /**
- * Return whether this package has no useful information.
- * Useful information includes:
- * - annotated package-info.java
- * - jaxb.index
- * - object factory
- */
- boolean isEmpty();
-
- /**
- * Return the {@link XmlRegistry} for this package if there is one.
- * Return *one* if there are more than one (which is an error case at any rate)
- */
- XmlRegistry getRegistry();
-
- /**
- * Return the {@link XsdSchema} associated with this package, if there is one, null otherwise
- */
- XsdSchema getXsdSchema();
-
-
- // **************** validation ********************************************
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java
deleted file mode 100644
index 7a3e016b25..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbPackageInfo
- extends JavaContextNode, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- JavaResourcePackage getResourcePackage();
-
- JaxbPackage getJaxbPackage();
-
-
- // ***** XmlSchema *****
-
- /**
- * Return the XML schema for this package info, this will not be null.
- */
- XmlSchema getXmlSchema();
-
-
- // ***** XmlSchemaTypes *****
-
- String XML_SCHEMA_TYPES_LIST = "xmlSchemaTypes"; //$NON-NLS-1$
-
- ListIterable<XmlSchemaType> getXmlSchemaTypes();
-
- int getXmlSchemaTypesSize();
-
- XmlSchemaType addXmlSchemaType(int index);
-
- void removeXmlSchemaType(int index);
-
- void removeXmlSchemaType(XmlSchemaType xmlSchemaType);
-
- void moveXmlSchemaType(int targetIndex, int sourceIndex);
-
-
- // ***** XmlJavaTypeAdapters ******
-
- String XML_JAVA_TYPE_ADAPTERS_LIST = "xmlJavaTypeAdapters"; //$NON-NLS-1$
-
- ListIterable<XmlJavaTypeAdapter> getXmlJavaTypeAdapters();
-
- int getXmlJavaTypeAdaptersSize();
-
- XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index);
-
- void removeXmlJavaTypeAdapter(int index);
-
- void removeXmlJavaTypeAdapter(XmlJavaTypeAdapter xmlJavaTypeAdapter);
-
- void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex);
-
- /**
- * return an {@link XmlJavaTypeAdapter} for the given bound type name, if one exists
- */
- XmlJavaTypeAdapter getXmlJavaTypeAdapter(String boundTypeName);
-
-
- // ***** validation *****
-
- /**
- * Add validation messages to the specified list.
- */
- void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java
deleted file mode 100644
index d9321a53e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB attribute (field/property).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPersistentAttribute
- extends JavaContextNode {
-
- JaxbClassMapping getClassMapping();
-
-
- // ***** declaring class/ inheritance *****
-
- /**
- * Return the resource type where the source of the attribute is declared.
- * This may not be where the attribute is fully defined, as it may be inherited
- */
- JavaResourceType getDeclaringJavaResourceType();
-
- /**
- * Return true if the source of the attribute is defined in a superclass
- */
- boolean isInherited();
-
-
- // ***** name *****
-
- /**
- * Return the name of the attribute. This will not change, a
- * new JaxbPersistentAttribute will be built if the name changes.
- */
- String getName();
-
-
- // ***** resource attribute *****
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- /**
- * Return the type name of the java attribute, or the item type name of a collection or array.
- */
- String getJavaResourceAttributeBaseTypeName();
-
- /**
- * (See JAXB 2.2 Spec, sect. 5.5.2)
- * Return true if the java attribute type is an extension of java.util.Collection or a single
- * dimensional array (except for byte[], which is treated like a non-array)
- */
- boolean isJavaResourceAttributeCollectionType();
-
- /**
- * Return whether the java resource attribute type is a subtype of the given type
- * This might not return the same thing as getJavaResourceAttribute().typeIsSubTypeOf(String).
- */
- boolean isJavaResourceAttributeTypeSubTypeOf(String typeName);
-
- boolean isFor(JavaResourceField resourceField);
-
- boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
-
- // ********** mapping **********
-
- /**
- * Return the attribute's mapping. This is never <code>null</code>
- * (although, it may be a <em>null</em> mapping).
- * Set the mapping via {@link PersistentAttribute#setMappingKey(String)}.
- */
- JaxbAttributeMapping getMapping();
- String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- /**
- * Return the attribute's mapping key.
- */
- String getMappingKey();
-
- /**
- * Set the attribute's mapping.
- * If the specified key is <code>null</code>, clear the specified mapping,
- * allowing the attribute's mapping to default (if appropriate).
- * Return the new mapping (which may be a <em>null</em> mapping).
- */
- JaxbAttributeMapping setMappingKey(String key);
-
- /**
- * Return the key for the attribute's default mapping.
- * This can be <code>null</code> (e.g. for <em>specified</em>
- * <code>orm.xml</code> attributes).
- * @see JaxbAttributeMapping#isDefault()
- */
- String getDefaultMappingKey();
- String DEFAULT_MAPPING_KEY_PROPERTY = "defaultMappingKey"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java
deleted file mode 100644
index 5ef41785db..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a namespace, name pairing
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.?
- */
-public interface JaxbQName
- extends JavaContextNode {
-
- // ***** namespace *****
-
- static String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
- String getNamespace();
-
- String getDefaultNamespace();
-
- String getSpecifiedNamespace();
-
- void setSpecifiedNamespace(String namespace);
-
-
- // ***** name *****
-
- static String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- String getName();
-
- String getDefaultName();
-
- String getSpecifiedName();
-
- void setSpecifiedName(String name);
-
-
- // ***** validation *****
-
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- TextRange getNameTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java
deleted file mode 100644
index 2f573931d7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Represents a java class (or enum or interface) with JAXB metadata (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbType
- extends JavaContextNode, XmlAdaptable {
-
- // ***** kind *****
-
- Kind getKind();
-
-
- // ***** type mapping *****
-
- final String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- /**
- * Return the mapping of this type.
- * May be null.
- * Will <b>not</b> be null if this type has an XmlType annotation (or other mapping annotation)
- * or if this type is default mapped.
- */
- JaxbTypeMapping getMapping();
-
-
- // ***** default mapped *****
-
- final String DEFAULT_MAPPED_PROPERTY = "defaultMapped"; //$NON-NLS-1$
-
- /**
- * Return true if this type is mapped by reference.
- * (If this type has a default mapping by virtue of it being referenced by another mapped type.)
- */
- boolean isDefaultMapped();
-
- /**
- * Set this to <code>true</code> if this type is referenced by another mapped type.
- * (NB: should only be called by {@link JaxbContextRoot} object.)
- */
- void setDefaultMapped(boolean newValue);
-
-
- /**
- * Return the associated java resource type
- */
- JavaResourceAbstractType getJavaResourceType();
-
- /**
- * Return the name of the type without any package or type qualifiers
- */
- String getSimpleName();
-
- /**
- * Returns the type-qualified name of this type, including qualification for any
- * enclosing types, but not including package qualification.
- */
- String getTypeQualifiedName();
-
- /**
- * Returns the fully qualified name of this type, including qualification for any
- * enclosing types and packages.
- */
- String getFullyQualifiedName();
-
- /**
- * Return the name of the type's package. Empty string if none.
- */
- String getPackageName();
-
- /**
- * Return the {@link JaxbPackage} associated with this type
- */
- JaxbPackage getJaxbPackage();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
-
- // ****** validation *****
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter);
-
-
- public enum Kind {
-
- /**
- * {@link JaxbType}s of {@link Kind} CLASS may safely be cast as {@link JaxbClass}
- */
- CLASS,
-
- /**
- * {@link JaxbType}s of {@link Kind} ENUM may safely be cast as {@link JaxbEnum}
- */
- ENUM;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java
deleted file mode 100644
index ddc71113de..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-
-/**
- * Represents mapping metadata on a JaxbType (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbTypeMapping
- extends JavaContextNode {
-
- // ***** JaxbType *****
-
- JaxbType getJaxbType();
-
- JaxbPackage getJaxbPackage();
-
-
- // ***** XmlTransient *****
-
- String XML_TRANSIENT_PROPERTY = "xmlTransient"; //$NON-NLS-1$
-
- boolean isXmlTransient();
-
- void setXmlTransient(boolean newValue);
-
-
- // ***** XmlType.name and XmlType.namespace *****
-
- JaxbQName getQName();
-
-
- // ***** XmlRootElement *****
-
- String XML_ROOT_ELEMENT_PROPERTY = "xmlRootElement"; //$NON-NLS-1$
-
- XmlRootElement getXmlRootElement();
-
- XmlRootElement addXmlRootElement();
-
- void removeXmlRootElement();
-
-
- // ***** XmlSeeAlso *****
-
- String XML_SEE_ALSO_PROPERTY = "xmlSeeAlso"; //$NON-NLS-1$
-
- XmlSeeAlso getXmlSeeAlso();
-
- XmlSeeAlso addXmlSeeAlso();
-
- void removeXmlSeeAlso();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- XsdTypeDefinition getXsdTypeDefinition();
-
- /**
- * Return true if this class or a subclass (if it can have subclasses) has a root element defined
- */
- boolean hasRootElementInHierarchy();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java
deleted file mode 100644
index 7c3a887420..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Access Order
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessOrder {
-
- ALPHABETICAL(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.ALPHABETICAL
- ),
- UNDEFINED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder;
-
- XmlAccessOrder(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- if (javaAccessOrder == null) {
- throw new NullPointerException();
- }
- this.javaAccessOrder = javaAccessOrder;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder getJavaAccessOrder() {
- return this.javaAccessOrder;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessOrder fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- return (javaAccessOrder == null) ? null : fromJavaResourceModel_(javaAccessOrder);
- }
-
- private static XmlAccessOrder fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- for (XmlAccessOrder accessOrder : XmlAccessOrder.values()) {
- if (accessOrder.getJavaAccessOrder() == javaAccessOrder) {
- return accessOrder;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder toJavaResourceModel(XmlAccessOrder accessOrder) {
- return (accessOrder == null) ? null : accessOrder.getJavaAccessOrder();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java
deleted file mode 100644
index 6fa5eae416..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessOrderHolder
- extends JaxbContextNode {
-
- /**
- * Return the access order, whether specified or defaulted.
- * This should never return null since at least the default will be set
- */
- XmlAccessOrder getAccessOrder();
-
- /**
- * String constant associated with changes to the default access order
- */
- String DEFAULT_ACCESS_ORDER_PROPERTY = "defaultAccessOrder"; //$NON-NLS-1$
-
- /**
- * Return the default access order, never null
- */
- XmlAccessOrder getDefaultAccessOrder();
-
- /**
- * String constant associated with changes to the specified access order
- */
- String SPECIFIED_ACCESS_ORDER_PROPERTY = "specifiedAccessOrder"; //$NON-NLS-1$
-
- /**
- * Return the specified access order;
- */
- XmlAccessOrder getSpecifiedAccessOrder();
-
- /**
- * Set the specified access order.
- */
- void setSpecifiedAccessOrder(XmlAccessOrder newSpecifiedAccessOrder);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java
deleted file mode 100644
index b2c8fd639a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Access Type
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessType {
-
- FIELD(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD
- ),
- NONE(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE
- ),
- PROPERTY(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PROPERTY
- ),
- PUBLIC_MEMBER(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType;
-
- XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- if (javaAccessType == null) {
- throw new NullPointerException();
- }
- this.javaAccessType = javaAccessType;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType getJavaAccessType() {
- return this.javaAccessType;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessType fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- return (javaAccessType == null) ? null : fromJavaResourceModel_(javaAccessType);
- }
-
- private static XmlAccessType fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- for (XmlAccessType accessType : XmlAccessType.values()) {
- if (accessType.getJavaAccessType() == javaAccessType) {
- return accessType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType toJavaResourceModel(XmlAccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAccessType();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java
deleted file mode 100644
index 6a562650ca..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessTypeHolder
- extends JaxbContextNode {
-
- /**
- * Return the access type, whether specified or defaulted.
- * This should never return null since at least the default will be set
- */
- XmlAccessType getAccessType();
-
- /**
- * String constant associated with changes to the default access type
- */
- String DEFAULT_ACCESS_TYPE_PROPERTY = "defaultAccessType"; //$NON-NLS-1$
-
- /**
- * Return the default access type, never null
- */
- XmlAccessType getDefaultAccessType();
-
- /**
- * String constant associated with changes to the specified access type
- */
- String SPECIFIED_ACCESS_TYPE_PROPERTY = "specifiedAccessType"; //$NON-NLS-1$
-
- /**
- * Return the specified access type;
- */
- XmlAccessType getSpecifiedAccessType();
-
- /**
- * Set the specified access type.
- */
- void setSpecifiedAccessType(XmlAccessType newSpecifiedAccessType);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java
deleted file mode 100644
index 1597b485f7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-public interface XmlAdaptable
- extends JavaContextNode {
-
- // ***** XmlJavaTypeAdapter *****
-
- String XML_JAVA_TYPE_ADAPTER_PROPERTY = "xmlJavaTypeAdapter"; //$NON-NLS-1$
-
- XmlJavaTypeAdapter getXmlJavaTypeAdapter();
-
- XmlJavaTypeAdapter addXmlJavaTypeAdapter();
-
- void removeXmlJavaTypeAdapter();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java
deleted file mode 100644
index 3ba89d68a9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents an attribute mapping that may also have an XmlJavaTypeAdapter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlAdaptableMapping
- extends XmlAdaptable {
-
- /**
- * Return either the {@link XmlAdapter} defined here or any XmlAdapter defined at a higher level
- * that also applies here.
- */
- XmlAdapter getXmlAdapter();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java
deleted file mode 100644
index 99fc144c4b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-
-/**
- * Represents a java class used as an XmlAdapter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAdapter
- extends JaxbContextNode {
-
- static String MARSHAL_METHOD_NAME = "marshal"; //$NON-NLS-1$
-
-
- // ***** bound type *****
-
- /**
- * String associated with changes to the "boundType" property
- */
- static String BOUND_TYPE_PROPERTY = "boundType"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified bound type name (the type used in the java model)
- */
- String getBoundType();
-
-
- // ***** value type *****
-
- /**
- * String associated with changes to the "valueType" property
- */
- static String VALUE_TYPE_PROPERTY = "valueType"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified value type name (the type that corresponds to the xml schema)
- */
- String getValueType();
-
-
- // ***** misc *****
-
- JavaResourceType getJavaResourceType();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java
deleted file mode 100644
index d118b04ae4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml any attribute mapping (@XmlAnyAttribute)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyAttributeMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java
deleted file mode 100644
index f5695b1007..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml any element mapping (@XmlAnyElement)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyElementMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** lax *****
-
- boolean isLax();
-
- String SPECIFIED_LAX_PROPERTY = "specifiedLax"; //$NON-NLS-1$
-
- Boolean getSpecifiedLax();
-
- void setSpecifiedLax(Boolean specifiedLax);
-
- boolean isDefaultLax();
-
- boolean DEFAULT_LAX = false;
-
-
- // ***** value *****
-
- String getValue();
-
- String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
-
- String getSpecifiedValue();
-
- void setSpecifiedValue(String value);
-
- String DEFAULT_TYPE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- String DEFAULT_VALUE = "javax.xml.bind.annotation.W3CDomHandler"; //$NON-NLS-1$
-
-
- // ***** XmlElementRefs *****
-
- XmlElementRefs getXmlElementRefs();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java
deleted file mode 100644
index 903e3c246f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XmlAttachmentRef
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttachmentRef
- extends JavaContextNode {
-
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java
deleted file mode 100644
index d79ce44365..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml attribute mapping (@XmlAttribute)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttributeMapping
- extends JaxbBasicMapping {
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java
deleted file mode 100644
index 333cbcf353..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-
-/**
- * Represents an @XmlElement, whether at top level or nested in @XmlElements
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElement
- extends JavaContextNode {
-
- // ***** annotation *****
-
- XmlElementAnnotation getAnnotation(boolean createIfNull);
-
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** nillable *****
-
- boolean isNillable();
-
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- Boolean getSpecifiedNillable();
-
- void setSpecifiedNillable(Boolean specifiedNillable);
-
- String DEFAULT_NILLABLE_PROPERTY = "defaultNillable"; //$NON-NLS-1$
-
- boolean isDefaultNillable();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
-
- // ***** default value *****
-
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- void setDefaultValue(String defaultValue);
-
-
- // ***** type *****
-
- String getType();
-
- String getFullyQualifiedType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- /**
- * Return the schema element declaration referenced, if it can be resolved.
- */
- XsdElementDeclaration getXsdElement();
-
-
- // ***** validation *****
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java
deleted file mode 100644
index 80661f39d4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents a JAXB xml element mapping (@XmlElement)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementMapping
- extends JaxbBasicMapping {
-
- XmlElement getXmlElement();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
deleted file mode 100644
index 9a713bba4a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * Represents an @XmlElementRef, whether at top level or nested in @XmlElementRefs
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRef
- extends JavaContextNode {
-
- // ***** annotation *****
-
- XmlElementRefAnnotation getAnnotation();
-
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
-
- // ***** type *****
-
- String getType();
-
- String getFullyQualifiedType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
-
- // ***** validation *****
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java
deleted file mode 100644
index 51c8cd587d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents a JAXB xml element ref mapping (@XmlElementRef)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRefMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElementRef *****
-
- XmlElementRef getXmlElementRef();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java
deleted file mode 100644
index 01d8fdba14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-public interface XmlElementRefs
- extends JavaContextNode {
-
- // ***** XmlElementRefs *****
-
- String XML_ELEMENT_REFS_LIST = "xmlElementRefs"; //$NON-NLS-1$
-
- ListIterable<XmlElementRef> getXmlElementRefs();
-
- int getXmlElementRefsSize();
-
- XmlElementRef addXmlElementRef(int index);
-
- void removeXmlElementRef(int index);
-
- void removeXmlElementRef(XmlElementRef xmlElementRef);
-
- void moveXmlElementRef(int targetIndex, int sourceIndex);
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java
deleted file mode 100644
index 14a4a55934..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml element refs mapping (@XmlElementRefs)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRefsMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElementRefs *****
-
- XmlElementRefs getXmlElementRefs();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java
deleted file mode 100644
index 2f227762d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-
-
-/**
- * Represents a JAXB XML element wrapper
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementWrapper
- extends JavaContextNode {
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** nillable *****
-
- boolean isNillable();
-
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- Boolean getSpecifiedNillable();
-
- void setSpecifiedNillable(Boolean specifiedNillable);
-
- boolean isDefaultNillable();
-
- boolean DEFAULT_NILLABLE = false;
-
-
- // ***** required *****
-
- boolean isRequired();
-
- String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
- boolean DEFAULT_REQUIRED = false;
-
-
- // ***** misc *****
-
- XsdElementDeclaration getXsdElementDeclaration();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java
deleted file mode 100644
index fd4bd249ee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Represents a JAXB xml elements mapping (@XmlElements)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementsMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElements *****
-
- String XML_ELEMENTS_LIST = "xmlElements"; //$NON-NLS-1$
-
- ListIterable<XmlElement> getXmlElements();
-
- int getXmlElementsSize();
-
- XmlElement addXmlElement(int index);
-
- void removeXmlElement(int index);
-
- void removeXmlElement(XmlElement xmlElement);
-
- void moveXmlElement(int targetIndex, int sourceIndex);
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlIDREF *****
-
- String XML_IDREF_PROPERTY = "xmlIDREF"; //$NON-NLS-1$
-
- XmlIDREF getXmlIDREF();
-
- XmlIDREF addXmlIDREF();
-
- void removeXmlIDREF();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java
deleted file mode 100644
index 83169f9133..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XML ID (@XmlID)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlID
- extends JavaContextNode {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java
deleted file mode 100644
index 5eaefd3d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XML ID ref (@XmlIDREF)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDREF
- extends JavaContextNode {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
deleted file mode 100644
index a7b342bdbf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface XmlJavaTypeAdapter
- extends JavaContextNode {
-
- XmlJavaTypeAdapterAnnotation getAnnotation();
-
-
- // ***** value *****
-
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- String getValue();
-
- void setValue(String value);
-
- String getFullyQualifiedValue();
-
-
- // ***** xmlAdapter *****
-
- String XML_ADAPTER_PROPERTY = "xmlAdapter"; //$NON-NLS-1$
-
- /**
- * Object based on specified "value"
- */
- XmlAdapter getXmlAdapter();
-
-
- // ***** type *****
-
- String getType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
- String getFullyQualifiedType();
-
- String DEFAULT_TYPE = "javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlList.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlList.java
deleted file mode 100644
index 70e1fc55e3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlList.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XML list
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlList
- extends JavaContextNode {
-
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java
deleted file mode 100644
index dfc6df927a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents the @XmlMixed JAXB annotation
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMixed
- extends JavaContextNode {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java
deleted file mode 100644
index c83049ccc9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlNs
- extends
- JaxbContextNode
-{
- XmlNsAnnotation getResourceXmlNs();
-
- // ********** namespaceURI **********
- String getNamespaceURI();
- void setNamespaceURI(String namespaceURI);
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- // ********** prefix **********
- String getPrefix();
- void setPrefix(String prefix);
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java
deleted file mode 100644
index 25b8ebc374..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlNsForm {
-
- QUALIFIED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED
- ),
- UNQUALIFIED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED
- ),
- UNSET(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNSET
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm;
-
- XmlNsForm(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- if (javaNsForm == null) {
- throw new NullPointerException();
- }
- this.javaNsForm = javaNsForm;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm getJavaNsForm() {
- return this.javaNsForm;
- }
-
-
- // ********** static methods **********
-
- public static XmlNsForm fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- return (javaNsForm == null) ? null : fromJavaResourceModel_(javaNsForm);
- }
-
- private static XmlNsForm fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- for (XmlNsForm nsForm : XmlNsForm.values()) {
- if (nsForm.getJavaNsForm() == javaNsForm) {
- return nsForm;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm toJavaResourceModel(XmlNsForm nsForm) {
- return (nsForm == null) ? null : nsForm.getJavaNsForm();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java
deleted file mode 100644
index 33b17de687..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB registry
- * (A class with an explicit @XmlRegistry annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRegistry
- extends JavaContextNode {
-
- // ***** element factory methods ******
-
- String ELEMENT_FACTORY_METHODS_COLLECTION = "elementFactoryMethods"; //$NON-NLS-1$
-
- Iterable<JaxbElementFactoryMethod> getElementFactoryMethods();
-
- int getElementFactoryMethodsSize();
-
-
- // ***** misc *****
-
- JaxbPackage getJaxbPackage();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
deleted file mode 100644
index 9c57969d97..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB xml root element.
- * (A class with an explicit @XmlRootElement annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRootElement
- extends JavaContextNode {
-
- JaxbTypeMapping getTypeMapping();
-
- JaxbQName getQName();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
deleted file mode 100644
index 60c10d28e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchema
- extends JavaContextNode {
-
- /**
- * Return the specified namespace or "" (default value)
- */
- String getNamespace();
-
- /**
- * Return the specified namespace, null if it is not specified
- */
- String getSpecifiedNamespace();
-
- /**
- * Set the namespace, null to unspecify
- */
- void setSpecifiedNamespace(String namespace);
-
- /**
- * String constant associated with changes to the specified namespace
- */
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the XmlSchema annotation location element
- */
- String getLocation();
- void setLocation(String location);
- String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
- String DEFAULT_LOCATION = "##generate"; //$NON-NLS-1$
-
-
- // **************** attribute form default ********************************
-
- /**
- * Return the specified attribute form default or XmlNsForm.UNSET (default value)
- */
- XmlNsForm getAttributeFormDefault();
-
- /**
- * Return the specified attribute form default, null if it is not specified
- */
- XmlNsForm getSpecifiedAttributeFormDefault();
-
- /**
- * Set the attribute form default, null to unspecify
- */
- void setSpecifiedAttributeFormDefault(XmlNsForm attributeFormDefault);
-
- /**
- * String constant associated with changes to the specified attribute form default
- */
- String SPECIFIED_ATTRIBUTE_FORM_DEFAULT_PROPERTY = "attributeFormDefault"; //$NON-NLS-1$
-
-
- // **************** element form default ********************************
-
- /**
- * Return the specified element form default or XmlNsForm.UNSET (default value)
- */
- XmlNsForm getElementFormDefault();
-
- /**
- * Return the specified element form default, null if it is not specified
- */
- XmlNsForm getSpecifiedElementFormDefault();
-
- /**
- * Set the element form default, null to unspecify
- */
- void setSpecifiedElementFormDefault(XmlNsForm elementFormDefault);
-
- /**
- * String constant associated with changes to the specified attribute form default
- */
- String SPECIFIED_ELEMENT_FORM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
-
-
- // ********** xml namespace prefixes **********
-
- ListIterable<XmlNs> getXmlNsPrefixes();
- int getXmlNsPrefixesSize();
- XmlNs addXmlNsPrefix(int index);
- void removeXmlNsPrefix(int index);
- void removeXmlNsPrefix(XmlNs xmlNsPrefix);
- void moveXmlNsPrefix(int targetIndex, int sourceIndex);
- String XML_NS_PREFIXES_LIST = "xmlNsPrefixes"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
deleted file mode 100644
index 32ae281959..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.xsd.util.XSDUtil;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchemaType
- extends JavaContextNode {
-
- String DEFAULT_NAMESPACE = XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001;
-
- XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation();
-
- JaxbQName getQName();
-
-
- // ***** type *****
-
- /**
- * Corresponds to the XmlSchemaType annotation 'type' element
- */
- String getType();
- void setType(String type);
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java
deleted file mode 100644
index f291894fd8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Maintains a list of classes (class names here) to be added to the JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-
-public interface XmlSeeAlso
- extends JavaContextNode {
-
- // **************** value *************************************************
-
- public static final String CLASSES_LIST = "classes";
-
- ListIterable<String> getClasses();
-
- int getClassesSize();
-
- void addClass(int index, String clazz);
-
- void removeClass(int index);
-
- void moveClass(int targetIndex, int sourceIndex);
-
-
- // **************** misc **************************************************
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java
deleted file mode 100644
index 3ed188f52b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml value mapping (@XmlValue)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlValueMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java
deleted file mode 100644
index ff6fdc4ac3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface DefaultJavaAttributeMappingDefinition extends JavaAttributeMappingDefinition
-{
-
- /**
- * Return whether this mapping provider should be used for the given {@link JaxbPersistentAttribute}
- * in the default (ignoring all mapping annotations) case.
- */
- boolean isDefault(JaxbPersistentAttribute persistentAttribute);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java
deleted file mode 100644
index d427d8eb01..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaAttributeMappingDefinition
-{
- /**
- * Return the attribute mapping's key.
- */
- String getKey();
-
- /**
- * Return the attribute mapping's Java annotation name.
- */
- String getAnnotationName();
-
- /**
- * Build a Java attribute mapping for the specified attribute. Use the specified
- * factory for creation so extenders can simply override the appropriate
- * creation method instead of building a provider for the same key.
- */
- JaxbAttributeMapping buildMapping(JaxbPersistentAttribute attribute, JaxbFactory factory);
-
- /**
- * Return all fully qualified annotation names that are supported with this mapping type.
- * This includes all possible annotations, not just the ones that currently exist on the attribute.
- */
- Iterable<String> getSupportingAnnotationNames();
-
- /**
- * Return whether this mapping provider should be used for the given {@link PersistentAttribute}
- * in the specified (observing all mapping annotations) case.
- */
- boolean isSpecified(JaxbPersistentAttribute persistentAttribute);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java
deleted file mode 100644
index b2859f03dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public interface JavaContextNode
- extends JaxbContextNode {
-
- // **************** content assist ****************************************
-
- /**
- * Return the Java code-completion proposals for the specified position in the source code.
- */
- Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot);
-
-
- // ******************** validation ****************************************
-
- /**
- * Adds to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-
- /**
- * Return the text range for highlighting errors for this object
- */
- TextRange getValidationTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java
deleted file mode 100644
index 2bfd9edc6e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbProject.Config;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.GenericContextRoot;
-import org.eclipse.jpt.jaxb.core.internal.context.GenericPackage;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaClassMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaEnumConstant;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaEnumMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaJaxbClass;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaJaxbEnum;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPackageInfo;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlNs;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlRootElement;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlSchema;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlTransientMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * Central class that allows extenders to easily replace implementations of
- * various Dali interfaces.
- */
-public abstract class AbstractJaxbFactory
- implements JaxbFactory {
-
- protected AbstractJaxbFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- public JaxbProject buildJaxbProject(Config config) {
- return new GenericJaxbProject(config);
- }
-
- public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel) {
- return new GenericJaxbFile(jaxbProject, file, contentType, resourceModel);
- }
-
-
- // ********** Non-resource-specific context nodes **********
-
- public JaxbContextRoot buildContextRoot(JaxbProject parent) {
- return new GenericContextRoot(parent);
- }
-
- public JaxbPackage buildPackage(JaxbContextRoot parent, String packageName) {
- return new GenericPackage(parent, packageName);
- }
-
-
- // ***** Java context nodes *****
-
- public JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage) {
- return new GenericJavaPackageInfo(parent, resourcePackage);
- }
-
- public XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent) {
- return new GenericJavaXmlSchema(parent);
- }
-
- public XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
- return new GenericJavaXmlNs(parent, xmlNsAnnotation);
- }
-
- public JaxbClass buildJaxbClass(JaxbContextRoot parent, JavaResourceType resourceType) {
- return new GenericJavaJaxbClass(parent, resourceType);
- }
-
- public JaxbEnum buildJaxbEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum) {
- return new GenericJavaJaxbEnum(parent, resourceEnum);
- }
-
- public JaxbClassMapping buildJaxbClassMapping(JaxbClass parent) {
- return new GenericJavaClassMapping(parent);
- }
-
- public JaxbEnumMapping buildJaxbEnumMapping(JaxbEnum parent) {
- return new GenericJavaEnumMapping(parent);
- }
-
- public XmlRegistry buildXmlRegistry(JaxbClass parent) {
- return new GenericJavaXmlRegistry(parent);
- }
-
- public JaxbElementFactoryMethod buildJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod) {
- return new GenericJavaElementFactoryMethod(parent, resourceMethod);
- }
-
- public XmlRootElement buildJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation xmlRootElementAnnotation) {
- return new GenericJavaXmlRootElement(parent, xmlRootElementAnnotation);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor) {
- return new GenericJavaPersistentAttribute(parent, accessor);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentField(JaxbClassMapping parent, JavaResourceField resourceField) {
- return GenericJavaPersistentAttribute.buildPersistentField(parent, resourceField);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentProperty(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return GenericJavaPersistentAttribute.buildPersistentProperty(parent, resourceGetter, resourceSetter);
- }
-
- public JaxbAttributeMapping buildJavaNullAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaNullAttributeMapping(parent);
- }
-
- public JaxbAttributeMapping buildJavaXmlTransientMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlTransientMapping(parent);
- }
-
- public XmlAnyAttributeMapping buildJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAnyAttributeMapping(parent);
- }
-
- public XmlAnyElementMapping buildJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAnyElementMapping(parent);
- }
-
- public XmlAttributeMapping buildJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAttributeMapping(parent);
- }
-
- public XmlElementMapping buildJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementMapping(parent);
- }
-
- public XmlElementRefMapping buildJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementRefMapping(parent);
- }
-
- public XmlElementRefsMapping buildJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementRefsMapping(parent);
- }
-
- public XmlElementsMapping buildJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementsMapping(parent);
- }
-
- public XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlValueMapping(parent);
- }
-
- public JaxbEnumConstant buildJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant) {
- return new GenericJavaEnumConstant(parent, resourceEnumConstant);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java
deleted file mode 100644
index b1e56f477e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTModifiedDeclaration.Adapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.AspectChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-
-/**
- * Some common Dali behavior:<ul>
- * <li>containment hierarchy
- * <li>Eclipse adaptable
- * <li>update triggers
- * </ul>
- */
-public abstract class AbstractJaxbNode
- extends AbstractModel
- implements JaxbNode
-{
- private final JaxbNode parent;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJaxbNode(JaxbNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
- protected void checkParent(JaxbNode p) {
- if (p == null) {
- if (this.requiresParent()) {
- throw new IllegalArgumentException("'parent' cannot be null"); //$NON-NLS-1$
- }
- } else {
- if (this.forbidsParent()) {
- throw new IllegalArgumentException("'parent' must be null"); //$NON-NLS-1$
- }
- }
- }
-
- protected boolean requiresParent() {
- return true;
- }
-
- protected boolean forbidsParent() {
- return ! this.requiresParent(); // assume 'parent' is not optional
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new AspectChangeSupport(this, this.buildChangeSupportListener());
- }
-
- protected AspectChangeSupport.Listener buildChangeSupportListener() {
- return new AspectChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractJaxbNode.this.aspectChanged(aspectName);
- }
- };
- }
-
-
- // ********** IAdaptable implementation **********
-
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
-
- // ********** JaxbNode implementation **********
-
- public JaxbNode getParent() {
- return this.parent;
- }
-
- public IResource getResource() {
- return this.parent.getResource();
- }
-
- public JaxbProject getJaxbProject() {
- return this.parent.getJaxbProject();
- }
-
-
- // ********** convenience methods **********
-
- protected JaxbPlatform getPlatform() {
- return this.getJaxbProject().getPlatform();
- }
-
-// protected JaxbPlatform.Version getJaxbPlatformVersion() {
-// return this.getJaxbPlatform().getJaxbPlatformVersion();
-// }
-
- protected JaxbFactory getFactory() {
- return this.getPlatform().getFactory();
- }
-
- protected JaxbFile getJaxbFile(IFile file) {
- return this.getJaxbProject().getJaxbFile(file);
- }
-
-
- // ********** CallbackChangeSupport.Listener support **********
-
- protected void aspectChanged(String aspectName) {
- if (this.aspectTriggersUpdate(aspectName)) {
-// String msg = Thread.currentThread() + " aspect change: " + this + ": " + aspectName;
-// System.out.println(msg);
-// new Exception(msg).printStackTrace(System.out);
- this.stateChanged();
- }
- }
-
- private boolean aspectTriggersUpdate(String aspectName) {
- return ! this.aspectDoesNotTriggerUpdate(aspectName);
- }
-
- protected boolean aspectDoesNotTriggerUpdate(String aspectName) {
- // ignore state changes so we don't get a stack overflow :-)
- // (and we don't use state changes except here)
- return (aspectName == null) ||
- this.nonUpdateAspectNames().contains(aspectName);
- }
-
- protected final Set<String> nonUpdateAspectNames() {
- synchronized (nonUpdateAspectNameSets) {
- HashSet<String> nonUpdateAspectNames = nonUpdateAspectNameSets.get(this.getClass());
- if (nonUpdateAspectNames == null) {
- nonUpdateAspectNames = new HashSet<String>();
- this.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNameSets.put(this.getClass(), nonUpdateAspectNames);
- }
- return nonUpdateAspectNames;
- }
- }
-
- private static final HashMap<Class<? extends AbstractJaxbNode>, HashSet<String>> nonUpdateAspectNameSets = new HashMap<Class<? extends AbstractJaxbNode>, HashSet<String>>();
-
- protected void addNonUpdateAspectNamesTo(@SuppressWarnings("unused") Set<String> nonUpdateAspectNames) {
- // when you override this method, don't forget to include:
- // super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- }
-
- public void stateChanged() {
- this.fireStateChanged();
- if (this.parent != null) {
- this.parent.stateChanged();
- }
- }
-
-
- /**
- * Adapter used to synchronize a context collection container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class CollectionContainer<C, R> {
-
- protected final Vector<C> contextElements = new Vector<C>();
-
- protected CollectionContainer() {
- super();
- }
-
- /**
- * Return the container's current set of resource elements.
- * These are what the context elements will be synchronized to.
- */
- protected abstract Iterable<R> getResourceElements();
-
- /**
- * Return the resource element corresponding to the specified context
- * element.
- */
- protected abstract R getResourceElement(C contextElement);
-
- /**
- * Build and return a context element for the given resource element
- */
- protected abstract C buildContextElement(R resourceElement);
-
- /**
- * Return the property name for event notification when the collection is changed.
- */
- protected abstract String getContextElementsPropertyName();
-
- /**
- * clients needs to call initialize if necessary
- */
- public void initialize() {
- for (R resourceElement : this.getResourceElements()) {
- this.contextElements.add(this.buildContextElement(resourceElement));
- }
- }
-
- /**
- * Return an Iterable of the context elements
- */
- public Iterable<C> getContextElements() {
- return new LiveCloneIterable<C>(this.contextElements);
- }
-
- /**
- * Return the size of the context elements collection
- */
- public int getContextElementsSize() {
- return this.contextElements.size();
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- public C addContextElement(int index, R resourceElement) {
- return this.addContextElement_(index, this.buildContextElement(resourceElement));
- }
-
- /**
- * Add the specified context element to the collection ignoring
- * the specified index as we only have a collection
- */
- protected C addContextElement_(@SuppressWarnings("unused") int index, C contextElement) {
- AbstractJaxbNode.this.addItemToCollection(contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Remove the specified context element from the container.
- */
- public void removeContextElement(C element) {
- AbstractJaxbNode.this.removeItemFromCollection(element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- @SuppressWarnings("unused")
- protected void moveContextElement(int index, C element) {
- //no-op, not a list
- }
- }
-
- /**
- * Adapter used to synchronize a context collection container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ContextCollectionContainer<C extends JaxbContextNode, R> extends CollectionContainer<C, R> {
-
- protected ContextCollectionContainer() {
- super();
- }
-
- /**
- * Using the specified adapter, synchronize a context container with its
- * corresponding resource container: moving, removing, and adding elements
- * as necessary.
- * <p>
- * We can do this because:<ul>
- * <li>the XML translators will <em>move</em> the EMF elements when
- * appropriate (as opposed to simply rebuilding them in place).
- * <li>the Java resource model will re-use existing annotations when
- * appropriate (as opposed to simply rebuilding them in place).
- * </ul>
- */
- public void synchronizeWithResourceModel() {
- sync(true); // true = sync
- }
-
- /**
- * @see #synchronizeWithResourceModel(Adapter)
- */
- public void update() {
- sync(false); // false = update
- }
-
- /**
- * The specified <code>sync</code> flag controls whether any surviving
- * context nodes are either <em>synchronized</em> (<code>true</code>) or
- * <em>updated</em> (<code>false</code>).
- */
- protected void sync(boolean sync) {
- HashSet<C> contextElements = CollectionTools.set(this.getContextElements());
- int resourceIndex = 0;
-
- for (R resourceElement : this.getResourceElements()) {
- boolean match = false;
- for (Iterator<C> stream = contextElements.iterator(); stream.hasNext(); ) {
- C contextElement = stream.next();
- if (Tools.valuesAreEqual(this.getResourceElement(contextElement), resourceElement)) {
- // we don't know the source index because the element has been moved by previously moved elements
- this.moveContextElement(resourceIndex, contextElement);
- stream.remove();
- if (sync) {
- contextElement.synchronizeWithResourceModel();
- } else {
- contextElement.update();
- }
- match = true;
- break;
- }
- }
- if ( ! match) {
- // added elements are sync'ed during construction or will be
- // updated during the next "update" (which is triggered by
- // their addition to the model)
- this.addContextElement(resourceIndex, resourceElement);
- }
- resourceIndex++;
- }
- // remove any leftover context elements
- for (C contextElement : contextElements) {
- this.removeContextElement(contextElement);
- }
- }
- }
-
- /**
- * Adapter used to synchronize a context list container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ListContainer<C, R>
- extends CollectionContainer<C, R> {
-
- protected ListContainer() {
- super();
- }
-
- @Override
- public ListIterable<C> getContextElements() {
- return new LiveCloneListIterable<C>(this.contextElements);
- }
-
- @Override
- protected abstract ListIterable<R> getResourceElements();
-
- /**
- * Return the index of the specified context element.
- */
- public int indexOfContextElement(C contextElement) {
- return this.contextElements.indexOf(contextElement);
- }
-
- public C getContextElement(int index) {
- return this.contextElements.elementAt(index);
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- @Override
- protected C addContextElement_(int index, C contextElement) {
- AbstractJaxbNode.this.addItemToList(index, contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Move the context element at the specified target index to the
- * specified source index.
- */
- public void moveContextElement(int targetIndex, int sourceIndex) {
- this.moveContextElement(targetIndex, this.contextElements.get(sourceIndex));
- }
-
- /**
- * Move the specified context element to the specified index.
- */
- @Override
- public void moveContextElement(int index, C element) {
- AbstractJaxbNode.this.moveItemInList(index, element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- /**
- * Remove the context element at the specified index from the container.
- */
- public void removeContextElement(int index) {
- AbstractJaxbNode.this.removeItemFromList(index, this.contextElements, this.getContextElementsPropertyName());
- }
-
- public void synchronizeWithResourceModel() {
- ListIterable<R> resourceElements = getResourceElements();
-
- int index = 0;
- for (R resourceElement : resourceElements) {
- if (this.getContextElementsSize() > index) {
- if (this.getContextElement(index) != resourceElement) {
- this.addContextElement(index, resourceElement);
- }
- }
- else {
- this.addContextElement(index, resourceElement);
- }
- index++;
- }
-
- for ( ; index < this.getContextElementsSize(); ) {
- this.removeContextElement(index);
- }
- }
- }
-
- /**
- * Adapter used to synchronize a context list container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ContextListContainer<C extends JaxbContextNode, R>
- extends ContextCollectionContainer<C, R> {
-
- protected ContextListContainer() {
- super();
- }
-
- @Override
- public ListIterable<C> getContextElements() {
- return new LiveCloneListIterable<C>(this.contextElements);
- }
-
- @Override
- protected abstract ListIterable<R> getResourceElements();
-
- /**
- * Return the index of the specified context element.
- */
- public int indexOfContextElement(C contextElement) {
- return this.contextElements.indexOf(contextElement);
- }
-
- public C getContextElement(int index) {
- return this.contextElements.elementAt(index);
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- @Override
- protected C addContextElement_(int index, C contextElement) {
- AbstractJaxbNode.this.addItemToList(index, contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Move the context element at the specified target index to the
- * specified source index.
- */
- public void moveContextElement(int targetIndex, int sourceIndex) {
- this.moveContextElement(targetIndex, this.contextElements.get(sourceIndex));
- }
-
- /**
- * Move the specified context element to the specified index.
- */
- @Override
- public void moveContextElement(int index, C element) {
- AbstractJaxbNode.this.moveItemInList(index, element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- /**
- * Remove the context element at the specified index from the container.
- */
- public void removeContextElement(int index) {
- AbstractJaxbNode.this.removeItemFromList(index, this.contextElements, this.getContextElementsPropertyName());
- }
-
- @Override
- public void removeContextElement(C contextElement) {
- AbstractJaxbNode.this.removeItemFromList(contextElement, this.contextElements, this.getContextElementsPropertyName());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java
deleted file mode 100644
index dd75e3a83e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-/**
- * All the state in the JAXB platform definition should be "static"
- * (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractJaxbPlatformDefinition
- implements JaxbPlatformDefinition {
-
- private Map<String, String> javaToSchemaTypes;
-
- private AnnotationDefinition[] annotationDefinitions;
-
- private NestableAnnotationDefinition[] nestableAnnotationDefinitions;
-
- private JaxbResourceModelProvider[] resourceModelProviders;
-
- private ArrayList<DefaultJavaAttributeMappingDefinition> defaultJavaAttributeMappingDefinitions;
-
- private ArrayList<JavaAttributeMappingDefinition> specifiedJavaAttributeMappingDefinitions;
-
-// private ResourceDefinition[] resourceDefinitions;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractJaxbPlatformDefinition() {
- super();
- }
-
-
- // ***** platform-y things *****
-
- public String getSchemaTypeMapping(String javaTypeName) {
- if (this.javaToSchemaTypes == null) {
- this.javaToSchemaTypes = new HashMap<String, String>();
- this.javaToSchemaTypes.putAll(buildJavaToSchemaTypes());
- }
- return this.javaToSchemaTypes.get(javaTypeName);
- }
-
- protected Map<String, String> buildJavaToSchemaTypes() {
- return Collections.EMPTY_MAP;
- }
-
-
- // ********** annotation definitions **********
-
- public AnnotationDefinition[] getAnnotationDefinitions() {
- if (this.annotationDefinitions == null) {
- this.annotationDefinitions = this.buildAnnotationDefinitions();
- }
- return this.annotationDefinitions;
- }
-
- protected abstract AnnotationDefinition[] buildAnnotationDefinitions();
-
-
- // ********** nestable annotation definitions **********
-
- public NestableAnnotationDefinition[] getNestableAnnotationDefinitions() {
- if (this.nestableAnnotationDefinitions == null) {
- this.nestableAnnotationDefinitions = this.buildNestableAnnotationDefinitions();
- }
- return this.nestableAnnotationDefinitions;
- }
-
- protected abstract NestableAnnotationDefinition[] buildNestableAnnotationDefinitions();
-
-
- // ********** resource models **********
-
- public ListIterable<JaxbResourceModelProvider> getResourceModelProviders() {
- return new ArrayListIterable<JaxbResourceModelProvider>(getResourceModelProviders_());
- }
-
- protected synchronized JaxbResourceModelProvider[] getResourceModelProviders_() {
- if (this.resourceModelProviders == null) {
- this.resourceModelProviders = this.buildResourceModelProviders();
- }
- return this.resourceModelProviders;
- }
-
- protected abstract JaxbResourceModelProvider[] buildResourceModelProviders();
-
-
- // ********** Java attribute mappings **********
-
- public synchronized Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions() {
- if (this.defaultJavaAttributeMappingDefinitions == null) {
- this.defaultJavaAttributeMappingDefinitions = this.buildDefaultJavaAttributeMappingDefinitions();
- }
- return this.defaultJavaAttributeMappingDefinitions;
- }
-
- protected ArrayList<DefaultJavaAttributeMappingDefinition> buildDefaultJavaAttributeMappingDefinitions() {
- ArrayList<DefaultJavaAttributeMappingDefinition> definitions = new ArrayList<DefaultJavaAttributeMappingDefinition>();
- this.addDefaultJavaAttributeMappingDefinitionsTo(definitions);
- return definitions;
- }
-
- /**
- * To the specified list, add mapping definitions to use for analyzing the
- * default mapping of an attribute. The order is important,
- * as once a mapping definition tests positive for an attribute,
- * all following mapping definitions are ignored.
- */
- protected abstract void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions);
-
- public synchronized Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions() {
- if (this.specifiedJavaAttributeMappingDefinitions == null) {
- this.specifiedJavaAttributeMappingDefinitions = this.buildSpecifiedJavaAttributeMappingDefinitions();
- }
- return this.specifiedJavaAttributeMappingDefinitions;
- }
-
- protected ArrayList<JavaAttributeMappingDefinition> buildSpecifiedJavaAttributeMappingDefinitions() {
- ArrayList<JavaAttributeMappingDefinition> definitions = new ArrayList<JavaAttributeMappingDefinition>();
- this.addSpecifiedJavaAttributeMappingDefinitionsTo(definitions);
- return definitions;
- }
-
- /**
- * To the specified list, add mapping definitions to use for analyzing the
- * specified mapping of an attribute given all annotations on it. The order
- * is important, as once a mapping definition tests positive for an
- * attribute, all following mapping definitions are ignored.
- */
- protected abstract void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions);
-
-
-// // ********** Mapping Files **********
-//
-// public ListIterator<ResourceDefinition> resourceDefinitions() {
-// return new ArrayListIterator<ResourceDefinition>(getResourceDefinitions());
-// }
-//
-// protected synchronized ResourceDefinition[] getResourceDefinitions() {
-// if (this.resourceDefinitions == null) {
-// this.resourceDefinitions = this.buildResourceDefinitions();
-// }
-// return this.resourceDefinitions;
-// }
-//
-// protected abstract ResourceDefinition[] buildResourceDefinitions();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
deleted file mode 100644
index 537ff737ce..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
+++ /dev/null
@@ -1,1653 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageDeclaration;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.resource.ResourceLocator;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.ThreadLocalCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.synchronizers.CallbackSynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.internal.synchronizers.SynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformImpl;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * JAXB project. Holds all the JAXB stuff.
- *
- * The JAXB platform provides the hooks for vendor-specific stuff.
- *
- * The JAXB files are the "resource" model (i.e. objects that correspond directly
- * to Eclipse resources; e.g. Java source code files, XML files, JAR files).
- *
- * The root context node is the "context" model (i.e. objects that attempt to
- * model the JAXB spec, using the "resource" model as an adapter to the Eclipse
- * resources).
- */
-public abstract class AbstractJaxbProject
- extends AbstractJaxbNode
- implements JaxbProject {
-
- /**
- * The Eclipse project corresponding to the JAXB project.
- */
- protected final IProject project;
-
- /**
- * The vendor-specific JAXB platform that builds the JAXB project
- * and all its contents.
- */
- protected final JaxbPlatform jaxbPlatform;
-
- /**
- * The library of schemas associated with this project
- */
- protected final SchemaLibraryImpl schemaLibrary;
-
- /**
- * The JAXB files associated with the JAXB project:
- * java
- * jaxb.index
- * platform-specific files
- */
- protected final Vector<JaxbFile> jaxbFiles = new Vector<JaxbFile>();
-
-// /**
-// * The "external" Java resource compilation units (source). Populated upon demand.
-// */
-// protected final Vector<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits = new Vector<JavaResourceCompilationUnit>();
-//
-// /**
-// * The "external" Java resource persistent types (binary). Populated upon demand.
-// */
-// protected final JavaResourcePersistentTypeCache externalJavaResourcePersistentTypeCache;
-
- /**
- * Resource models notify this listener when they change. A project update
- * should occur any time a resource model changes.
- */
- protected final JptResourceModelListener resourceModelListener;
-
- /**
- * The root of the model representing the collated resources associated with
- * the JAXB project.
- */
- protected final JaxbContextRoot contextRoot;
-
- /**
- * A pluggable synchronizer that keeps the JAXB
- * project's context model synchronized with its resource model, either
- * synchronously or asynchronously (or not at all). A synchronous synchronizer
- * is the default. For performance reasons, a UI should
- * immediately change this to an asynchronous synchronizer. A synchronous
- * synchronizer can be used when the project is being manipulated by a "batch"
- * (or non-UI) client (e.g. when testing "synchronization"). A null updater
- * can used during tests that do not care whether "synchronization" occur.
- * Clients will need to explicitly configure the synchronizer if they require
- * an asynchronous synchronizer.
- */
- protected volatile Synchronizer contextModelSynchronizer;
- protected volatile boolean synchronizingContextModel = false;
-
- /**
- * A pluggable synchronizer that "updates" the JAXB project, either
- * synchronously or asynchronously (or not at all). A synchronous updater
- * is the default, allowing a newly-constructed JAXB project to be "updated"
- * upon return from the constructor. For performance reasons, a UI should
- * immediately change this to an asynchronous updater. A synchronous
- * updater can be used when the project is being manipulated by a "batch"
- * (or non-UI) client (e.g. when testing the "update" behavior). A null
- * updater can used during tests that do not care whether "synchronization"
- * occur.
- * Clients will need to explicitly configure the updater if they require
- * an asynchronous updater.
- */
- protected volatile CallbackSynchronizer updateSynchronizer;
- protected final CallbackSynchronizer.Listener updateSynchronizerListener;
-
- /**
- * Support for modifying documents shared with the UI.
- */
- protected final ThreadLocalCommandExecutor modifySharedDocumentCommandExecutor;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJaxbProject(JaxbProject.Config config) {
- super(null); // JPA project is the root of the containment tree
- if ((config.getProject() == null) || (config.getPlatformDefinition() == null)) {
- throw new NullPointerException();
- }
- this.project = config.getProject();
- this.jaxbPlatform = new JaxbPlatformImpl(config.getPlatformDefinition());
-
- this.schemaLibrary = new SchemaLibraryImpl(this);
-
- this.modifySharedDocumentCommandExecutor = this.buildModifySharedDocumentCommandExecutor();
-
- this.resourceModelListener = this.buildResourceModelListener();
- // build the JPA files corresponding to the Eclipse project's files
- InitialResourceProxyVisitor visitor = this.buildInitialResourceProxyVisitor();
- visitor.visitProject(this.project);
-
-// this.externalJavaResourcePersistentTypeCache = this.buildExternalJavaResourcePersistentTypeCache();
-
- this.contextRoot = this.buildContextRoot();
-
- // there *shouldn't* be any changes to the resource model...
- this.setContextModelSynchronizer_(this.buildSynchronousContextModelSynchronizer());
-
- this.updateSynchronizerListener = this.buildUpdateSynchronizerListener();
- // "update" the project before returning
- this.setUpdateSynchronizer_(this.buildSynchronousUpdateSynchronizer());
-
-// // start listening to this cache once the context model has been built
-// // and all the external types are faulted in
-// this.externalJavaResourcePersistentTypeCache.addResourceModelListener(this.resourceModelListener);
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public IResource getResource() {
- return this.project;
- }
-
- protected ThreadLocalCommandExecutor buildModifySharedDocumentCommandExecutor() {
- return new ThreadLocalCommandExecutor();
- }
-
- protected InitialResourceProxyVisitor buildInitialResourceProxyVisitor() {
- return new InitialResourceProxyVisitor();
- }
-//
-// protected JavaResourcePersistentTypeCache buildExternalJavaResourcePersistentTypeCache() {
-// return new BinaryPersistentTypeCache(this.jpaPlatform.getAnnotationProvider());
-// }
-
- protected JaxbContextRoot buildContextRoot() {
- return this.getFactory().buildContextRoot(this);
- }
-
- // ***** inner class
- protected class InitialResourceProxyVisitor implements IResourceProxyVisitor {
- protected InitialResourceProxyVisitor() {
- super();
- }
- protected void visitProject(IProject p) {
- try {
- p.accept(this, IResource.NONE);
- } catch (CoreException ex) {
- // shouldn't happen - we don't throw any CoreExceptions
- throw new RuntimeException(ex);
- }
- }
- // add a JPA file for every [appropriate] file encountered by the visitor
- public boolean visit(IResourceProxy resource) {
- switch (resource.getType()) {
- case IResource.ROOT : // shouldn't happen
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- AbstractJaxbProject.this.addJaxbFile_((IFile) resource.requestResource());
- return false; // no children
- default :
- return false; // no children
- }
- }
- }
-
-
-// // ********** miscellaneous **********
-//
-// /**
-// * Ignore changes to this collection. Adds can be ignored since they are triggered
-// * by requests that will, themselves, trigger updates (typically during the
-// * update of an object that calls a setter with the newly-created resource
-// * type). Deletes will be accompanied by manual updates.
-// */
-// @Override
-// protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
-// super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
-// nonUpdateAspectNames.add(EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// }
-
-
- // ********** general queries **********
-
- @Override
- public JaxbProject getJaxbProject() {
- return this;
- }
-
- public String getName() {
- return this.project.getName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- public IProject getProject() {
- return this.project;
- }
-
- public IJavaProject getJavaProject() {
- return JavaCore.create(this.project);
- }
-
- @Override
- public JaxbPlatform getPlatform() {
- return this.jaxbPlatform;
- }
-
- public SchemaLibrary getSchemaLibrary() {
- return this.schemaLibrary;
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<JavaResourceCompilationUnit> getCombinedJavaResourceCompilationUnits() {
- return this.getInternalJavaResourceCompilationUnits();
-// return new CompositeIterable<JavaResourceCompilationUnit>(
-// this.getInternalJavaResourceCompilationUnits(),
-// this.getExternalJavaResourceCompilationUnits()
-// );
- }
-
-
- // ********** JAXB files **********
-
- public Iterable<JaxbFile> getJaxbFiles() {
- return new LiveCloneIterable<JaxbFile>(this.jaxbFiles); // read-only
- }
-
- public int getJaxbFilesSize() {
- return this.jaxbFiles.size();
- }
-
- protected Iterable<JaxbFile> getJaxbFiles(final IContentType contentType) {
- return new FilteringIterable<JaxbFile>(this.getJaxbFiles()) {
- @Override
- protected boolean accept(JaxbFile jaxbFile) {
- return jaxbFile.getContentType().isKindOf(contentType);
- }
- };
- }
-
- @Override
- public JaxbFile getJaxbFile(IFile file) {
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- if (jaxbFile.getFile().equals(file)) {
- return jaxbFile;
- }
- }
- return null;
- }
-
- /**
- * Add a JAXB file for the specified file, if appropriate.
- * Return true if a JAXB File was created and added, false otherwise
- */
- protected boolean addJaxbFile(IFile file) {
- JaxbFile jaxbFile = this.addJaxbFile_(file);
- if (jaxbFile != null) {
- this.fireItemAdded(JAXB_FILES_COLLECTION, jaxbFile);
- return true;
- }
- return false;
- }
-
- /**
- * Add a JAXB file for the specified file, if appropriate, without firing
- * an event; useful during construction.
- * Return the new JAXB file, null if it was not created.
- */
- protected JaxbFile addJaxbFile_(IFile file) {
- if (isJavaFile(file)) {
- if (! getJavaProject().isOnClasspath(file)) {
- // a java (.jar or .java) file must be on the Java classpath
- return null;
- }
- }
- else if (! isInAcceptableResourceLocation(file)) {
- return null;
- }
-
- JaxbFile jaxbFile = null;
- try {
- jaxbFile = this.getPlatform().buildJaxbFile(this, file);
- }
- catch (Exception e) {
- //log any developer exceptions and don't build a JaxbFile rather
- //than completely failing to build the JaxbProject
- JptJaxbCorePlugin.log(e);
- }
- if (jaxbFile == null) {
- return null;
- }
- jaxbFile.getResourceModel().addResourceModelListener(this.resourceModelListener);
- this.jaxbFiles.add(jaxbFile);
- return jaxbFile;
- }
-
- /* file is .java or .jar */
- protected boolean isJavaFile(IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
- return contentType != null
- && (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)
- || contentType.isKindOf(JptCommonCorePlugin.JAR_CONTENT_TYPE));
- }
-
- /* (non-java resource) file is in acceptable resource location */
- protected boolean isInAcceptableResourceLocation(IFile file) {
- ResourceLocator resourceLocator = JptCommonCorePlugin.getResourceLocator(getProject());
- return resourceLocator.acceptResourceLocation(getProject(), file.getParent());
- }
-
- /**
- * Remove the JAXB file corresponding to the specified IFile, if it exists.
- * Return true if a JAXB File was removed, false otherwise
- */
- protected boolean removeJaxbFile(IFile file) {
- JaxbFile jaxbFile = this.getJaxbFile(file);
- if (jaxbFile != null) { // a JpaFile is not added for every IFile
- this.removeJaxbFile(jaxbFile);
- return true;
- }
- return false;
- }
-
- /**
- * Stop listening to the JAXB file and remove it.
- */
- protected void removeJaxbFile(JaxbFile jaxbFile) {
- jaxbFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- if ( ! this.removeItemFromCollection(jaxbFile, this.jaxbFiles, JAXB_FILES_COLLECTION)) {
- throw new IllegalArgumentException(jaxbFile.toString());
- }
- }
-
-
-// // ********** external Java resource persistent types (source or binary) **********
-//
-// protected JavaResourcePersistentType buildPersistableExternalJavaResourcePersistentType(String typeName) {
-// IType jdtType = this.findType(typeName);
-// return (jdtType == null) ? null : this.buildPersistableExternalJavaResourcePersistentType(jdtType);
-// }
-//
-// protected IType findType(String typeName) {
-// try {
-// return this.getJavaProject().findType(typeName);
-// } catch (JavaModelException ex) {
-// return null; // ignore exception?
-// }
-// }
-//
-// protected JavaResourcePersistentType buildPersistableExternalJavaResourcePersistentType(IType jdtType) {
-// JavaResourcePersistentType jrpt = this.buildExternalJavaResourcePersistentType(jdtType);
-// return ((jrpt != null) && jrpt.isPersistable()) ? jrpt : null;
-// }
-//
-// protected JavaResourcePersistentType buildExternalJavaResourcePersistentType(IType jdtType) {
-// return jdtType.isBinary() ?
-// this.buildBinaryExternalJavaResourcePersistentType(jdtType) :
-// this.buildSourceExternalJavaResourcePersistentType(jdtType);
-// }
-//
-// protected JavaResourcePersistentType buildBinaryExternalJavaResourcePersistentType(IType jdtType) {
-// return this.externalJavaResourcePersistentTypeCache.addPersistentType(jdtType);
-// }
-//
-// protected JavaResourcePersistentType buildSourceExternalJavaResourcePersistentType(IType jdtType) {
-// JavaResourceCompilationUnit jrcu = this.getExternalJavaResourceCompilationUnit(jdtType.getCompilationUnit());
-// String jdtTypeName = jdtType.getFullyQualifiedName('.'); // JDT member type names use '$'
-// for (Iterator<JavaResourcePersistentType> stream = jrcu.persistentTypes(); stream.hasNext(); ) {
-// JavaResourcePersistentType jrpt = stream.next();
-// if (jrpt.getQualifiedName().equals(jdtTypeName)) {
-// return jrpt;
-// }
-// }
-// // we can get here if the project JRE is removed;
-// // see SourceCompilationUnit#getPrimaryType(CompilationUnit)
-// // bug 225332
-// return null;
-// }
-//
-//
-// // ********** external Java resource persistent types (binary) **********
-//
-// public JavaResourcePersistentTypeCache getExternalJavaResourcePersistentTypeCache() {
-// return this.externalJavaResourcePersistentTypeCache;
-// }
-//
-//
-// // ********** external Java resource compilation units (source) **********
-//
-// public Iterator<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits() {
-// return this.getExternalJavaResourceCompilationUnits().iterator();
-// }
-//
-// protected Iterable<JavaResourceCompilationUnit> getExternalJavaResourceCompilationUnits() {
-// return new LiveCloneIterable<JavaResourceCompilationUnit>(this.externalJavaResourceCompilationUnits); // read-only
-// }
-//
-// public int externalJavaResourceCompilationUnitsSize() {
-// return this.externalJavaResourceCompilationUnits.size();
-// }
-//
-// /**
-// * Return the resource model compilation unit corresponding to the specified
-// * JDT compilation unit. If it does not exist, build it.
-// */
-// protected JavaResourceCompilationUnit getExternalJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// if (jrcu.getCompilationUnit().equals(jdtCompilationUnit)) {
-// // we will get here if the JRCU could not build its persistent type...
-// return jrcu;
-// }
-// }
-// return this.addExternalJavaResourceCompilationUnit(jdtCompilationUnit);
-// }
-//
-// /**
-// * Add an external Java resource compilation unit.
-// */
-// protected JavaResourceCompilationUnit addExternalJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// JavaResourceCompilationUnit jrcu = this.buildJavaResourceCompilationUnit(jdtCompilationUnit);
-// this.addItemToCollection(jrcu, this.externalJavaResourceCompilationUnits, EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// jrcu.addResourceModelListener(this.resourceModelListener);
-// return jrcu;
-// }
-//
-// protected JavaResourceCompilationUnit buildJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// return new SourceTypeCompilationUnit(
-// jdtCompilationUnit,
-// this.jpaPlatform.getAnnotationProvider(),
-// this.jpaPlatform.getAnnotationEditFormatter(),
-// this.modifySharedDocumentCommandExecutor
-// );
-// }
-//
-// protected boolean removeExternalJavaResourceCompilationUnit(IFile file) {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// if (jrcu.getFile().equals(file)) {
-// this.removeExternalJavaResourceCompilationUnit(jrcu);
-// return true;
-// }
-// }
-// return false;
-// }
-//
-// protected void removeExternalJavaResourceCompilationUnit(JavaResourceCompilationUnit jrcu) {
-// jrcu.removeResourceModelListener(this.resourceModelListener);
-// this.removeItemFromCollection(jrcu, this.externalJavaResourceCompilationUnits, EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// }
-
-
- // ********** context model **********
-
- public JaxbContextRoot getContextRoot() {
- return this.contextRoot;
- }
-
- public Iterable<? extends JavaContextNode> getPrimaryJavaNodes(ICompilationUnit cu) {
- IFile file = getCorrespondingResource(cu);
- if (file == null) {
- return EmptyIterable.instance();
- }
-
- IContentType contentType = PlatformTools.getContentType(file);
- if (contentType == null) {
- return EmptyIterable.instance();
- }
-
- if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
- try {
- return new FilteringIterable<JaxbPackageInfo>(
- new TransformationIterable<IPackageDeclaration, JaxbPackageInfo>(
- new ArrayIterable<IPackageDeclaration>(cu.getPackageDeclarations())) {
- @Override
- protected JaxbPackageInfo transform(IPackageDeclaration o) {
- JaxbPackage jaxbPackage = getContextRoot().getPackage(o.getElementName());
- return (jaxbPackage != null) ? jaxbPackage.getPackageInfo() : null;
- }
- },
- NotNullFilter.<JaxbPackageInfo>instance());
- }
- catch (JavaModelException jme) {
- return EmptyIterable.instance();
- }
- }
- else if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- try {
- return new FilteringIterable<JaxbType>(
- new TransformationIterable<IType, JaxbType>(
- new ArrayIterable<IType>(cu.getAllTypes())) {
- @Override
- protected JaxbType transform(IType o) {
- JaxbType jaxbType = getContextRoot().getType(o.getFullyQualifiedName('.'));
- return jaxbType;
- }
- },
- NotNullFilter.<JaxbType>instance());
- }
- catch (JavaModelException jme) {
- return EmptyIterable.instance();
- }
- }
-
- return EmptyIterable.instance();
- }
-
- private IFile getCorrespondingResource(ICompilationUnit cu) {
- try {
- return (IFile) cu.getCorrespondingResource();
- }
- catch (JavaModelException ex) {
- JptJaxbCorePlugin.log(ex);
- return null;
- }
- }
-
-
-// // ********** utility **********
-//
-// public IFile getPlatformFile(IPath runtimePath) {
-// return JptCorePlugin.getPlatformFile(this.project, runtimePath);
-// }
-
-
-//
-// /**
-// * If the specified file exists, is significant to the JPA project, and its
-// * content is a "kind of" the specified content type, return the JPA
-// * resource model corresponding to the file; otherwise, return null.
-// */
-// protected JpaResourceModel getResourceModel(IPath runtimePath, IContentType contentType) {
-// IFile file = this.getPlatformFile(runtimePath);
-// return file.exists() ? this.getResourceModel(file, contentType) : null;
-// }
-//
-// /**
-// * If the specified file is significant to the JPA project and its content
-// * is a "kind of" the specified content type, return the JPA resource model
-// * corresponding to the file; otherwise, return null.
-// */
-// protected JpaResourceModel getResourceModel(IFile file, IContentType contentType) {
-// JpaFile jpaFile = this.getJpaFile(file);
-// return (jpaFile == null) ? null : jpaFile.getResourceModel(contentType);
-// }
-
-
- // ********** annotated Java source classes **********
-
- public Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes() {
- return new CompositeIterable<JavaResourceAbstractType>(this.getInternalJavaSourceResourceTypeSets());
- }
-
- public Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes() {
- return new FilteringIterable<JavaResourceAbstractType>(getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType type) {
- return type.isAnnotated();
- }
- };
- }
-
-// public Iterable<String> getAnnotatedJavaSourceClassNames() {
-// return new TransformationIterable<JavaResourceType, String>(this.getInternalAnnotatedSourceJavaResourceTypes()) {
-// @Override
-// protected String transform(JavaResourceType type) {
-// return type.getQualifiedName();
-// }
-// };
-// }
-
- /*
- * Return the sets of {@link JavaResourceType}s that are represented by java source within this project
- */
- protected Iterable<Iterable<JavaResourceAbstractType>> getInternalJavaSourceResourceTypeSets() {
- return new TransformationIterable<JavaResourceCompilationUnit, Iterable<JavaResourceAbstractType>>(
- this.getInternalJavaResourceCompilationUnits()) {
- @Override
- protected Iterable<JavaResourceAbstractType> transform(JavaResourceCompilationUnit compilationUnit) {
- return compilationUnit.getTypes();
- }
- };
- }
-
- protected Iterable<JavaResourceCompilationUnit> getInternalJavaResourceCompilationUnits() {
- return new TransformationIterable<JaxbFile, JavaResourceCompilationUnit>(this.getJavaSourceJaxbFiles()) {
- @Override
- protected JavaResourceCompilationUnit transform(JaxbFile jaxbFile) {
- return (JavaResourceCompilationUnit) jaxbFile.getResourceModel();
- }
- };
- }
-
- /**
- * return JAXB files with Java source "content"
- */
- protected Iterable<JaxbFile> getJavaSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
- }
-
-
- // ********** Java resource package look-up **********
-
- public Iterable<JavaResourcePackage> getJavaResourcePackages(){
- return new FilteringIterable<JavaResourcePackage>(
- new TransformationIterable<JaxbFile, JavaResourcePackage>(this.getPackageInfoSourceJaxbFiles()) {
- @Override
- protected JavaResourcePackage transform(JaxbFile jaxbFile) {
- return ((JavaResourcePackageInfoCompilationUnit) jaxbFile.getResourceModel()).getPackage();
- }
- }) {
-
- @Override
- protected boolean accept(JavaResourcePackage resourcePackage) {
- return resourcePackage != null;
- }
- };
- }
-
- public JavaResourcePackage getJavaResourcePackage(String packageName) {
- for (JavaResourcePackage jrp : this.getJavaResourcePackages()) {
- if (jrp.getName().equals(packageName)) {
- return jrp;
- }
- }
- return null;
- }
-
- public Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages() {
- return new FilteringIterable<JavaResourcePackage>(this.getJavaResourcePackages()) {
- @Override
- protected boolean accept(JavaResourcePackage resourcePackage) {
- return resourcePackage.isAnnotated(); // i.e. the package has a valid package annotation
- }
- };
- }
-
- public JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName) {
- JavaResourcePackage jrp = getJavaResourcePackage(packageName);
- return (jrp != null && jrp.isAnnotated()) ? jrp : null;
- }
-
- /**
- * return JPA files with package-info source "content"
- */
- protected Iterable<JaxbFile> getPackageInfoSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE);
- }
-
-
- // ********** Java resource type look-up **********
-
-
- public JavaResourceAbstractType getJavaResourceType(String typeName) {
- for (JavaResourceAbstractType type : this.getJavaResourceTypes()) {
- if (type.getQualifiedName().equals(typeName)) {
- return type;
- }
- }
- return null;
-// // if we don't have a type already, try to build new one from the project classpath
-// return this.buildPersistableExternalJavaResourcePersistentType(typeName);
- }
-
- public JavaResourceAbstractType getJavaResourceType(String typeName, JavaResourceAbstractType.Kind kind) {
- JavaResourceAbstractType resourceType = getJavaResourceType(typeName);
- if (resourceType == null || resourceType.getKind() != kind) {
- return null;
- }
- return resourceType;
- }
-
- protected Iterable<JavaResourceAbstractType> getJavaResourceTypes() {
- return new CompositeIterable<JavaResourceAbstractType>(this.getJavaResourceTypeSets());
- }
-
- protected Iterable<Iterable<JavaResourceAbstractType>> getJavaResourceTypeSets() {
- return new TransformationIterable<JavaResourceNode.Root, Iterable<JavaResourceAbstractType>>(
- this.getJavaResourceNodeRoots()) {
- @Override
- protected Iterable<JavaResourceAbstractType> transform(JavaResourceNode.Root root) {
- return root.getTypes();
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<JavaResourceNode.Root> getJavaResourceNodeRoots() {
- return new CompositeIterable<JavaResourceNode.Root>(
- this.getInternalJavaResourceCompilationUnits()/*,
- this.getInternalJavaResourcePackageFragmentRoots(),
- this.getExternalJavaResourceCompilationUnits(),
- Collections.singleton(this.externalJavaResourcePersistentTypeCache)*/
- );
- }
-
-
-// // ********** JARs **********
-//
-// // TODO
-// public JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(String jarFileName) {
-//// return this.getJarResourcePackageFragmentRoot(this.convertToPlatformFile(jarFileName));
-// return this.getJavaResourcePackageFragmentRoot(this.getProject().getFile(jarFileName));
-// }
-//
-// protected JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(IFile jarFile) {
-// for (JavaResourcePackageFragmentRoot pfr : this.getInternalJavaResourcePackageFragmentRoots()) {
-// if (pfr.getFile().equals(jarFile)) {
-// return pfr;
-// }
-// }
-// return null;
-// }
-//
-// protected Iterable<JavaResourcePackageFragmentRoot> getInternalJavaResourcePackageFragmentRoots() {
-// return new TransformationIterable<JpaFile, JavaResourcePackageFragmentRoot>(this.getJarJpaFiles()) {
-// @Override
-// protected JavaResourcePackageFragmentRoot transform(JpaFile jpaFile) {
-// return (JavaResourcePackageFragmentRoot) jpaFile.getResourceModel();
-// }
-// };
-// }
-//
-// /**
-// * return JPA files with JAR "content"
-// */
-// protected Iterable<JpaFile> getJarJpaFiles() {
-// return this.getJpaFiles(JptCorePlugin.JAR_CONTENT_TYPE);
-// }
-
-
-
-//
-// // ********** Java source folder names **********
-//
-// public Iterable<String> getJavaSourceFolderNames() {
-// try {
-// return this.getJavaSourceFolderNames_();
-// } catch (JavaModelException ex) {
-// JptCorePlugin.log(ex);
-// return EmptyIterable.instance();
-// }
-// }
-//
-// protected Iterable<String> getJavaSourceFolderNames_() throws JavaModelException {
-// return new TransformationIterable<IPackageFragmentRoot, String>(this.getJavaSourceFolders()) {
-// @Override
-// protected String transform(IPackageFragmentRoot pfr) {
-// try {
-// return this.transform_(pfr);
-// } catch (JavaModelException ex) {
-// return "Error: " + pfr.getPath(); //$NON-NLS-1$
-// }
-// }
-// private String transform_(IPackageFragmentRoot pfr) throws JavaModelException {
-// return pfr.getUnderlyingResource().getProjectRelativePath().toString();
-// }
-// };
-// }
-//
-// protected Iterable<IPackageFragmentRoot> getJavaSourceFolders() throws JavaModelException {
-// return new FilteringIterable<IPackageFragmentRoot>(
-// this.getPackageFragmentRoots(),
-// SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER
-// );
-// }
-//
-// protected static final Filter<IPackageFragmentRoot> SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER =
-// new Filter<IPackageFragmentRoot>() {
-// public boolean accept(IPackageFragmentRoot pfr) {
-// try {
-// return this.accept_(pfr);
-// } catch (JavaModelException ex) {
-// return false;
-// }
-// }
-// private boolean accept_(IPackageFragmentRoot pfr) throws JavaModelException {
-// return pfr.exists() && (pfr.getKind() == IPackageFragmentRoot.K_SOURCE);
-// }
-// };
-//
-// protected Iterable<IPackageFragmentRoot> getPackageFragmentRoots() throws JavaModelException {
-// return new ArrayIterable<IPackageFragmentRoot>(this.getJavaProject().getPackageFragmentRoots());
-// }
-
-
- // **************** jaxb.index resources **********************************
-
- public Iterable<JaxbIndexResource> getJaxbIndexResources() {
- return new TransformationIterable<JaxbFile, JaxbIndexResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE)) {
- @Override
- protected JaxbIndexResource transform(JaxbFile o) {
- return (JaxbIndexResource) o.getResourceModel();
- }
- };
- }
-
- public JaxbIndexResource getJaxbIndexResource(String packageName) {
- for (JaxbIndexResource jir : getJaxbIndexResources()) {
- if (packageName.equals(jir.getPackageName())) {
- return jir;
- }
- }
- return null;
- }
-
-
- // **************** jaxb.properties resources *****************************
-
- public Iterable<JaxbPropertiesResource> getJaxbPropertiesResources() {
- return new TransformationIterable<JaxbFile, JaxbPropertiesResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE)) {
- @Override
- protected JaxbPropertiesResource transform(JaxbFile o) {
- return (JaxbPropertiesResource) o.getResourceModel();
- }
- };
- }
-
- public JaxbPropertiesResource getJaxbPropertiesResource(String packageName) {
- for (JaxbPropertiesResource jpr : getJaxbPropertiesResources()) {
- if (packageName.equals(jpr.getPackageName())) {
- return jpr;
- }
- }
- return null;
- }
-
-
- // ********** Java events **********
-
- // TODO handle changes to external projects
- public void javaElementChanged(ElementChangedEvent event) {
- this.processJavaDelta(event.getDelta());
- }
-
- /**
- * We recurse back here from {@link #processJavaDeltaChildren(IJavaElementDelta)}.
- */
- protected void processJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- this.processJavaModelDelta(delta);
- break;
- case IJavaElement.JAVA_PROJECT :
- this.processJavaProjectDelta(delta);
- break;
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- this.processJavaPackageFragmentRootDelta(delta);
- break;
- case IJavaElement.PACKAGE_FRAGMENT :
- this.processJavaPackageFragmentDelta(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- this.processJavaCompilationUnitDelta(delta);
- break;
- default :
- break; // ignore the elements inside a compilation unit
- }
- }
-
- protected void processJavaDeltaChildren(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.processJavaDelta(child); // recurse
- }
- }
-
- /**
- * Return whether the specified Java element delta is for a
- * {@link IJavaElementDelta#CHANGED CHANGED}
- * (as opposed to {@link IJavaElementDelta#ADDED ADDED} or
- * {@link IJavaElementDelta#REMOVED REMOVED}) Java element
- * and the specified flag is set.
- * (The delta flags are only significant if the delta
- * {@link IJavaElementDelta#getKind() kind} is
- * {@link IJavaElementDelta#CHANGED CHANGED}.)
- */
- protected boolean deltaFlagIsSet(IJavaElementDelta delta, int flag) {
- return (delta.getKind() == IJavaElementDelta.CHANGED) &&
- BitTools.flagIsSet(delta.getFlags(), flag);
- }
-
- // ***** model
- protected void processJavaModelDelta(IJavaElementDelta delta) {
- // process the Java model's projects
- this.processJavaDeltaChildren(delta);
- }
-
- // ***** project
- protected void processJavaProjectDelta(IJavaElementDelta delta) {
- // process the Java project's package fragment roots
- this.processJavaDeltaChildren(delta);
-
- // a classpath change can have pretty far-reaching effects...
- if (this.classpathHasChanged(delta)) {
- this.rebuild((IJavaProject) delta.getElement());
- }
- }
-
- /**
- * The specified Java project's classpath changed. Rebuild the JPA project
- * as appropriate.
- */
- protected void rebuild(IJavaProject javaProject) {
- // if the classpath has changed, we need to update everything since
- // class references could now be resolved (or not) etc.
- if (javaProject.equals(this.getJavaProject())) {
- this.removeDeadJpaFiles();
- this.synchronizeWithJavaSource(this.getInternalJavaResourceCompilationUnits());
- } else {
- // TODO see if changed project is on our classpath?
- //this.synchronizeWithJavaSource(this.getExternalJavaResourceCompilationUnits());
- }
- }
-
- /**
- * Loop through all our JPA files, remove any that are no longer on the
- * classpath.
- */
- protected void removeDeadJpaFiles() {
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- if (this.jaxbFileIsDead(jaxbFile)) {
- this.removeJaxbFile(jaxbFile);
- }
- }
- }
-
- protected boolean jaxbFileIsDead(JaxbFile jaxbFile) {
- return ! this.jaxbFileIsAlive(jaxbFile);
- }
-
- /**
- * Sometimes (e.g. during tests), when a project has been deleted, we get a
- * Java change event that indicates the Java project is CHANGED (as
- * opposed to REMOVED, which is what typically happens). The event's delta
- * indicates that everything in the Java project has been deleted and the
- * classpath has changed. All entries in the classpath have been removed;
- * but single entry for the Java project's root folder has been added. (!)
- * This means any file in the project is on the Java project's classpath.
- * This classpath change is what triggers us to rebuild the JPA project; so
- * we put an extra check here to make sure the JPA file's resource file is
- * still present.
- * <p>
- * This would not be a problem if Dali received the resource change event
- * <em>before</em> JDT and simply removed the JPA project; but JDT receives
- * the resource change event first and converts it into the problematic
- * Java change event....
- */
- protected boolean jaxbFileIsAlive(JaxbFile jaxbFile) {
- IFile file = jaxbFile.getFile();
- return this.getJavaProject().isOnClasspath(file) &&
- file.exists();
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.JAVA_PROJECT
- */
- protected boolean classpathHasChanged(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED);
- }
-
- protected void synchronizeWithJavaSource(Iterable<JavaResourceCompilationUnit> javaResourceCompilationUnits) {
- for (JavaResourceCompilationUnit javaResourceCompilationUnit : javaResourceCompilationUnits) {
- javaResourceCompilationUnit.synchronizeWithJavaSource();
- }
- }
-
-
- // ***** package fragment root
- protected void processJavaPackageFragmentRootDelta(IJavaElementDelta delta) {
- // process the Java package fragment root's package fragments
- this.processJavaDeltaChildren(delta);
-
- if (this.classpathEntryHasBeenAdded(delta)) {
- // TODO bug 277218
- } else if (this.classpathEntryHasBeenRemoved(delta)) { // should be mutually-exclusive w/added (?)
- // TODO bug 277218
- }
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
- */
- protected boolean classpathEntryHasBeenAdded(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_ADDED_TO_CLASSPATH);
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
- */
- protected boolean classpathEntryHasBeenRemoved(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_REMOVED_FROM_CLASSPATH);
- }
-
- // ***** package fragment
- protected void processJavaPackageFragmentDelta(IJavaElementDelta delta) {
- // process the java package fragment's compilation units
- this.processJavaDeltaChildren(delta);
- }
-
- // ***** compilation unit
- protected void processJavaCompilationUnitDelta(IJavaElementDelta delta) {
- if (this.javaCompilationUnitDeltaIsRelevant(delta)) {
- ICompilationUnit compilationUnit = (ICompilationUnit) delta.getElement();
- for (JavaResourceCompilationUnit jrcu : this.getCombinedJavaResourceCompilationUnits()) {
- if (jrcu.getCompilationUnit().equals(compilationUnit)) {
- jrcu.synchronizeWithJavaSource();
- // TODO ? this.resolveJavaTypes(); // might have new member types now...
- break; // there *shouldn't* be any more...
- }
- }
- }
- // ignore the java compilation unit's children
- }
-
- protected boolean javaCompilationUnitDeltaIsRelevant(IJavaElementDelta delta) {
- // ignore changes to/from primary working copy - no content has changed;
- // and make sure there are no other flags set that indicate *both* a
- // change to/from primary working copy *and* content has changed
- if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
- return false;
- }
-
- // ignore java notification for ADDED or REMOVED;
- // these are handled via resource notification
- return delta.getKind() == IJavaElementDelta.CHANGED;
- }
-
-
- // ********** validation **********
-
- public Iterable<IMessage> getValidationMessages(IReporter reporter) {
- List<IMessage> messages = new ArrayList<IMessage>();
- this.validate(messages, reporter);
- return new SnapshotCloneIterable<IMessage>(messages);
- }
-
- protected void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
-
- getSchemaLibrary().refreshAllSchemas();
-
- validateLibraryProvider(messages);
- validateSchemaLibrary(messages);
- this.contextRoot.validate(messages, reporter);
- }
-
- protected void validateLibraryProvider(List<IMessage> messages) {
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(getProject());
- IProjectFacetVersion facetVersion = facetedProject.getInstalledVersion(JaxbFacet.FACET);
- LibraryInstallDelegate lid = new LibraryInstallDelegate(facetedProject, facetVersion);
- ILibraryProvider lp = lid.getLibraryProvider();
- if (lid.getLibraryProviderOperationConfig() instanceof JaxbLibraryProviderInstallOperationConfig) {
- ((JaxbLibraryProviderInstallOperationConfig) lid.getLibraryProviderOperationConfig()).setJaxbPlatform(getPlatform().getDescription());
- }
- if (! lp.isEnabledFor(facetedProject, facetVersion) || ! lid.validate().isOK()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT_INVALID_LIBRARY_PROVIDER,
- this));
- }
- }
- catch (CoreException ce) {
- // fall through
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- protected void validateSchemaLibrary(List<IMessage> messages) {
- this.schemaLibrary.validate(messages);
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- this.contextModelSynchronizer.stop();
- this.updateSynchronizer.stop();
- this.updateSynchronizer.removeListener(this.updateSynchronizerListener);
- // the XML resources are held indefinitely by the WTP translator framework,
- // so we better remove our listener or the JAXB project will not be GCed
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- jaxbFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- }
- }
-
-
-
- // ********** resource model listener **********
-
- protected JptResourceModelListener buildResourceModelListener() {
- return new DefaultResourceModelListener();
- }
-
- protected class DefaultResourceModelListener
- implements JptResourceModelListener
- {
- protected DefaultResourceModelListener() {
- super();
- }
-
- public void resourceModelChanged(JptResourceModel jpaResourceModel) {
-// String msg = Thread.currentThread() + " resource model change: " + jpaResourceModel;
-// System.out.println(msg);
-// new Exception(msg).printStackTrace(System.out);
- AbstractJaxbProject.this.synchronizeContextModel(jpaResourceModel);
- }
-
- public void resourceModelReverted(JptResourceModel jpaResourceModel) {
-// IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
-// AbstractJaxbProject.this.removeJaxbFile(file);
-// AbstractJaxbProject.this.addJaxbFile(file);
- }
-
- public void resourceModelUnloaded(JptResourceModel jpaResourceModel) {
-// IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
-// AbstractJaxbProject.this.removeJaxbFile(file);
- }
- }
-
- protected void synchronizeContextModel(@SuppressWarnings("unused") JptResourceModel jpaResourceModel) {
- this.synchronizeContextModel();
- }
-
-
- // ********** resource events **********
-
- // TODO need to do the same thing for external projects and compilation units
- public void projectChanged(IResourceDelta delta) {
- if (delta.getResource().equals(this.getProject())) {
- this.internalProjectChanged(delta);
- } else {
-// this.externalProjectChanged(delta);
- }
- }
-
- protected void internalProjectChanged(IResourceDelta delta) {
- ResourceDeltaVisitor resourceDeltaVisitor = this.buildInternalResourceDeltaVisitor();
- resourceDeltaVisitor.visitDelta(delta);
- // at this point, if we have added and/or removed JpaFiles, an "update" will have been triggered;
- // any changes to the resource model during the "resolve" will trigger further "updates";
- // there should be no need to "resolve" external Java types (they can't have references to
- // the internal Java types)
- if (resourceDeltaVisitor.encounteredSignificantChange()) {
- this.resolveInternalJavaTypes();
- }
- }
-
- protected ResourceDeltaVisitor buildInternalResourceDeltaVisitor() {
- return new ResourceDeltaVisitor() {
- @Override
- public boolean fileChangeIsSignificant(IFile file, int deltaKind) {
- return AbstractJaxbProject.this.synchronizeJaxbFiles(file, deltaKind);
- }
- };
- }
-
- /**
- * Internal resource delta visitor callback.
- * Return true if a JaxbFile was either added or removed.
- */
- protected boolean synchronizeJaxbFiles(IFile file, int deltaKind) {
- switch (deltaKind) {
- case IResourceDelta.ADDED :
- return this.addJaxbFile(file);
- case IResourceDelta.REMOVED :
- return this.removeJaxbFile(file);
- case IResourceDelta.CHANGED :
- return this.checkForChangedFileContent(file);
- case IResourceDelta.ADDED_PHANTOM :
- break; // ignore
- case IResourceDelta.REMOVED_PHANTOM :
- break; // ignore
- default :
- break; // only worried about added/removed/changed files
- }
-
- return false;
- }
-
- protected boolean checkForChangedFileContent(IFile file) {
- JaxbFile jaxbFile = this.getJaxbFile(file);
- if (jaxbFile == null) {
- // the file might have changed its content to something that we are interested in
- return this.addJaxbFile(file);
- }
-
- if (jaxbFile.getContentType().equals(PlatformTools.getContentType(file))) {
- // content has not changed - ignore
- return false;
- }
-
- // the content type changed, we need to build a new JPA file
- // (e.g. the schema of an orm.xml file changed from JPA to EclipseLink)
- this.removeJaxbFile(jaxbFile);
- this.addJaxbFile(file);
- return true; // at the least, we have removed a JPA file
- }
-
- protected void resolveInternalJavaTypes() {
- for (JavaResourceCompilationUnit jrcu : this.getInternalJavaResourceCompilationUnits()) {
- jrcu.resolveTypes();
- }
- }
-
-// protected void externalProjectChanged(IResourceDelta delta) {
-// if (this.getJavaProject().isOnClasspath(delta.getResource())) {
-// ResourceDeltaVisitor resourceDeltaVisitor = this.buildExternalResourceDeltaVisitor();
-// resourceDeltaVisitor.visitDelta(delta);
-// // force an "update" here since adding and/or removing an external Java type
-// // will only trigger an "update" if the "resolve" causes something in the resource model to change
-// if (resourceDeltaVisitor.encounteredSignificantChange()) {
-// this.update();
-// this.resolveExternalJavaTypes();
-// this.resolveInternalJavaTypes();
-// }
-// }
-// }
-//
-// protected ResourceDeltaVisitor buildExternalResourceDeltaVisitor() {
-// return new ResourceDeltaVisitor() {
-// @Override
-// public boolean fileChangeIsSignificant(IFile file, int deltaKind) {
-// return AbstractJaxbProject.this.synchronizeExternalFiles(file, deltaKind);
-// }
-// };
-// }
-//
-// /**
-// * external resource delta visitor callback
-// * Return true if an "external" Java resource compilation unit
-// * was added or removed.
-// */
-// protected boolean synchronizeExternalFiles(IFile file, int deltaKind) {
-// switch (deltaKind) {
-// case IResourceDelta.ADDED :
-// return this.externalFileAdded(file);
-// case IResourceDelta.REMOVED :
-// return this.externalFileRemoved(file);
-// case IResourceDelta.CHANGED :
-// break; // ignore
-// case IResourceDelta.ADDED_PHANTOM :
-// break; // ignore
-// case IResourceDelta.REMOVED_PHANTOM :
-// break; // ignore
-// default :
-// break; // only worried about added/removed/changed files
-// }
-//
-// return false;
-// }
-//
-// protected boolean externalFileAdded(IFile file) {
-// IContentType contentType = PlatformTools.getContentType(file);
-// if (contentType == null) {
-// return false;
-// }
-// if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
-// return true;
-// }
-// if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
-// return true;
-// }
-// return false;
-// }
-//
-// protected boolean externalFileRemoved(IFile file) {
-// IContentType contentType = PlatformTools.getContentType(file);
-// if (contentType == null) {
-// return false;
-// }
-// if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
-// return this.removeExternalJavaResourceCompilationUnit(file);
-// }
-// if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
-// return this.externalJavaResourcePersistentTypeCache.removePersistentTypes(file);
-// }
-// return false;
-// }
-//
-// protected void resolveExternalJavaTypes() {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// jrcu.resolveTypes();
-// }
-// }
-
- // ***** resource delta visitors
- /**
- * add or remove a JPA file for every [appropriate] file encountered by the visitor
- */
- protected abstract class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected boolean encounteredSignificantChange = false;
-
- protected ResourceDeltaVisitor() {
- super();
- }
-
- protected void visitDelta(IResourceDelta delta) {
- try {
- delta.accept(this);
- } catch (CoreException ex) {
- // shouldn't happen - we don't throw any CoreExceptions
- throw new RuntimeException(ex);
- }
- }
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- this.fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (this.fileChangeIsSignificant(file, deltaKind)) {
- this.encounteredSignificantChange = true;
- }
- }
-
- protected abstract boolean fileChangeIsSignificant(IFile file, int deltaKind);
-
- /**
- * Return whether the visitor encountered some sort of "significant"
- * change while traversing the IResourceDelta
- * (e.g. a JPA file was added or removed).
- */
- protected boolean encounteredSignificantChange() {
- return this.encounteredSignificantChange;
- }
-
- }
-
-
- // ********** support for modifying documents shared with the UI **********
-
- public void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor) {
- this.modifySharedDocumentCommandExecutor.set(commandExecutor);
- }
-
- public CommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutor;
- }
-
-
- // ********** synchronize context model with resource model **********
-
- public Synchronizer getContextModelSynchronizer() {
- return this.contextModelSynchronizer;
- }
-
- public void setContextModelSynchronizer(Synchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.contextModelSynchronizer.stop();
- this.setContextModelSynchronizer_(synchronizer);
- }
-
- protected void setContextModelSynchronizer_(Synchronizer synchronizer) {
- this.contextModelSynchronizer = synchronizer;
- this.contextModelSynchronizer.start();
- }
-
- /**
- * Delegate to the context model synchronizer so clients can configure how
- * synchronizations occur.
- */
- public void synchronizeContextModel() {
- this.synchronizingContextModel = true;
- this.contextModelSynchronizer.synchronize();
- this.synchronizingContextModel = false;
-
- // There are some changes to the resource model that will not change
- // the existing context model and trigger an update (e.g. adding an
- // @Entity annotation when the the JPA project is automatically
- // discovering annotated classes); so we explicitly execute an update
- // here to discover those changes.
- this.update();
- }
-
- /**
- * Called by the context model synchronizer.
- */
- public IStatus synchronizeContextModel(IProgressMonitor monitor) {
- this.contextRoot.synchronizeWithResourceModel();
- return Status.OK_STATUS;
- }
-
- public void synchronizeContextModelAndWait() {
- Synchronizer temp = this.contextModelSynchronizer;
- this.setContextModelSynchronizer(this.buildSynchronousContextModelSynchronizer());
- this.synchronizeContextModel();
- this.setContextModelSynchronizer(temp);
- }
-
-
- // ********** default context model synchronizer (synchronous) **********
-
- protected Synchronizer buildSynchronousContextModelSynchronizer() {
- return new SynchronousSynchronizer(this.buildSynchronousContextModelSynchronizerCommand());
- }
-
- protected Command buildSynchronousContextModelSynchronizerCommand() {
- return new SynchronousContextModelSynchronizerCommand();
- }
-
- protected class SynchronousContextModelSynchronizerCommand
- implements Command
- {
- public void execute() {
- AbstractJaxbProject.this.synchronizeContextModel(new NullProgressMonitor());
- }
- }
-
-
- // ********** project "update" **********
-
- public CallbackSynchronizer getUpdateSynchronizer() {
- return this.updateSynchronizer;
- }
-
- public void setUpdateSynchronizer(CallbackSynchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.updateSynchronizer.stop();
- this.updateSynchronizer.removeListener(this.updateSynchronizerListener);
- this.setUpdateSynchronizer_(synchronizer);
- }
-
- protected void setUpdateSynchronizer_(CallbackSynchronizer synchronizer) {
- this.updateSynchronizer = synchronizer;
- this.updateSynchronizer.addListener(this.updateSynchronizerListener);
- this.updateSynchronizer.start();
- }
-
- @Override
- public void stateChanged() {
- super.stateChanged();
- this.update();
- }
-
- /**
- * The JAXB project's state has changed, "update" those parts of the
- * JAXB project that are dependent on other parts of the JAXB project.
- * <p>
- * Delegate to the update synchronizer so clients can configure how
- * updates occur.
- * <p>
- * Ignore any <em>updates</em> that occur while we are synchronizing
- * the context model with the resource model because we will <em>update</em>
- * the context model at the completion of the <em>sync</em>. This is really
- * only useful for synchronous <em>syncs</em> and <em>updates</em>; since
- * the job scheduling rules will prevent the <em>sync</em> and
- * <em>update</em> jobs from running concurrently.
- *
- * @see #updateAndWait()
- */
- protected void update() {
- if ( ! this.synchronizingContextModel) {
- this.updateSynchronizer.synchronize();
- }
- }
-
- /**
- * Called by the update synchronizer.
- */
- public IStatus update(IProgressMonitor monitor) {
- this.contextRoot.update();
- return Status.OK_STATUS;
- }
-
- /**
- * This is the callback used by the update synchronizer to notify the JAXB
- * project that the "update" has quiesced (i.e. the "update" has completed
- * and there are no outstanding requests for further "updates").
- */
- public void updateQuiesced() {
- //nothing yet
- }
-
- public void updateAndWait() {
- CallbackSynchronizer temp = this.updateSynchronizer;
- this.setUpdateSynchronizer(this.buildSynchronousUpdateSynchronizer());
- this.update();
- this.setUpdateSynchronizer(temp);
- }
-
-
- // ********** default update synchronizer (synchronous) **********
-
- protected CallbackSynchronizer buildSynchronousUpdateSynchronizer() {
- return new CallbackSynchronousSynchronizer(this.buildSynchronousUpdateSynchronizerCommand());
- }
-
- protected Command buildSynchronousUpdateSynchronizerCommand() {
- return new SynchronousUpdateSynchronizerCommand();
- }
-
- protected class SynchronousUpdateSynchronizerCommand
- implements Command
- {
- public void execute() {
- AbstractJaxbProject.this.update(new NullProgressMonitor());
- }
- }
-
-
- // ********** update synchronizer listener **********
-
- protected CallbackSynchronizer.Listener buildUpdateSynchronizerListener() {
- return new UpdateSynchronizerListener();
- }
-
- protected class UpdateSynchronizerListener
- implements CallbackSynchronizer.Listener
- {
- public void synchronizationQuiesced(CallbackSynchronizer synchronizer) {
- AbstractJaxbProject.this.updateQuiesced();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java
deleted file mode 100644
index 574ad14301..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-/**
- * The transition between a JAXB project and the resource model associated
- * with a file.
- * Hold the associated root structure nodes, which are hooks to the
- * context model.
- */
-public class GenericJaxbFile
- extends AbstractJaxbNode
- implements JaxbFile
-{
- /**
- * typically a .java or .xml file.
- */
- protected final IFile file;
-
- /**
- * cache the content type - if the content type changes, the JAXB project
- * will throw out the JAXB file and build a new one
- */
- protected final IContentType contentType;
-
- /**
- * the resource model corresponding to the file
- */
- protected final JptResourceModel resourceModel;
-
-// /**
-// * the root structure (context model) nodes corresponding to the resource
-// * model
-// */
-// protected final Hashtable<Object, JpaStructureNode> rootStructureNodes;
-
-
- // ********** construction **********
-
- public GenericJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel) {
- super(jaxbProject);
- this.file = file;
- this.contentType = contentType;
- this.resourceModel = resourceModel;
-// this.rootStructureNodes = new Hashtable<Object, JpaStructureNode>();
- }
-//
-// /**
-// * Changes to ROOT_STRUCTURE_NODES_COLLECTION do not need to trigger a
-// * project update. Only the UI cares about the root structure nodes.
-// * If a project update is allowed to happen, an infinite loop will result
-// * if any java class is specified in more than one location in the
-// * persistence unit.
-// */
-// @Override
-// protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
-// super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
-// nonUpdateAspectNames.add(ROOT_STRUCTURE_NODES_COLLECTION);
-// }
-
-
- // ********** file **********
-
- public IFile getFile() {
- return this.file;
- }
-
- public IContentType getContentType() {
- return this.contentType;
- }
-
- public JptResourceModel getResourceModel() {
- return this.resourceModel;
- }
-
- public JptResourceModel getResourceModel(IContentType ct) {
- return this.contentType.isKindOf(ct) ? this.resourceModel : null;
- }
-
-
-// // ********** root structure nodes **********
-//
-// public Iterator<JpaStructureNode> rootStructureNodes() {
-// return this.getRootStructureNodes().iterator();
-// }
-//
-// protected Iterable<JpaStructureNode> getRootStructureNodes() {
-// return new LiveCloneIterable<JpaStructureNode>(this.rootStructureNodes.values());
-// }
-//
-// public int rootStructureNodesSize() {
-// return this.rootStructureNodes.size();
-// }
-//
-// public void addRootStructureNode(Object key, JpaStructureNode rootStructureNode) {
-// JpaStructureNode old = this.rootStructureNodes.put(key, rootStructureNode);
-// if (rootStructureNode != old) {
-// if (old != null) {
-// this.fireItemRemoved(ROOT_STRUCTURE_NODES_COLLECTION, old);
-// }
-// this.fireItemAdded(ROOT_STRUCTURE_NODES_COLLECTION, rootStructureNode);
-// }
-// }
-//
-// public void removeRootStructureNode(Object key) {
-// this.fireItemRemoved(ROOT_STRUCTURE_NODES_COLLECTION, this.rootStructureNodes.remove(key));
-// }
-//
-// public JpaStructureNode getStructureNode(int textOffset) {
-// for (JpaStructureNode rootNode : this.getRootStructureNodes()) {
-// JpaStructureNode node = rootNode.getStructureNode(textOffset);
-// if (node != null) {
-// return node;
-// }
-// }
-// return null;
-// }
-
-
- // ********** misc **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.file);
- sb.append('[');
- sb.append(this.contentType.getName());
- sb.append(']');
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java
deleted file mode 100644
index 1b81017142..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-/**
- * Not much different from the abstract JAXB project.
- */
-public class GenericJaxbProject
- extends AbstractJaxbProject
-{
-
- // ********** constructor/initialization **********
-
- public GenericJaxbProject(JaxbProject.Config config) {
- super(config);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
deleted file mode 100644
index 82ca5ea88d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-
-/**
- * Java package-info.java source code
- */
-public class JavaPackageInfoResourceModelProvider
- implements JaxbResourceModelProvider
-{
- // singleton
- private static final JaxbResourceModelProvider INSTANCE = new JavaPackageInfoResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaPackageInfoResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE;
- }
-
- public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
- ICompilationUnit compilationUnit = JavaCore.createCompilationUnitFrom(file);
- try {
- if (compilationUnit.getPackageDeclarations().length > 0){
- return new SourcePackageInfoCompilationUnit(
- compilationUnit,
- jaxbProject.getPlatform().getAnnotationProvider(),
- jaxbProject.getPlatform().getAnnotationEditFormatter(),
- jaxbProject.getModifySharedDocumentCommandExecutor());
- }
- //ignore package-info placed in default package as
- //it doesn't have package declaration and can't hold annotations
- return null;
- } catch (JavaModelException e) {
- JptJaxbCorePlugin.log(e);
- // Ignore -- project is in a bad state. This will get recalled if necessary
- return null;
- }
- }
-
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
deleted file mode 100644
index 4066f112c8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-
-/**
- * Java source code
- */
-public class JavaResourceModelProvider
- implements JaxbResourceModelProvider
-{
- // singleton
- private static final JaxbResourceModelProvider INSTANCE = new JavaResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE;
- }
-
- public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return new SourceTypeCompilationUnit(
- JavaCore.createCompilationUnitFrom(file),
- jaxbProject.getPlatform().getAnnotationProvider(),
- jaxbProject.getPlatform().getAnnotationEditFormatter(),
- jaxbProject.getModifySharedDocumentCommandExecutor()
- );
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JaxbPlatformTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JaxbPlatformTester.java
deleted file mode 100644
index 6cd7bda963..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JaxbPlatformTester.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-
-public class JaxbPlatformTester
- extends PropertyTester {
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (! (property.equals("jaxbPlatform") || property.equals("jaxbPlatformGroup"))
- || ! (expectedValue instanceof String)) { //$NON-NLS-1$
- return false;
- }
-
- JaxbPlatformDescription platform = null;
-
- if (receiver instanceof IResource) {
- platform = platform(((IResource) receiver).getProject());
- }
- else if (receiver instanceof IJavaElement) {
- platform = platform(((IJavaElement) receiver).getResource().getProject());
- }
- else if (receiver instanceof JaxbPlatformDescription) {
- platform = (JaxbPlatformDescription) receiver;
- }
- else if (receiver instanceof JaxbLibraryProviderInstallOperationConfig) {
- platform = ((JaxbLibraryProviderInstallOperationConfig) receiver).getJaxbPlatform();
- }
-
- if (property.equals("jaxbPlatform")) {
- JaxbPlatformDescription otherPlatform = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform((String) expectedValue);
- return platform == null ? false : platform.equals(otherPlatform);
- }
- if (property.equals("jaxbPlatformGroup")) {
- JaxbPlatformGroupDescription group = (platform == null) ? null : platform.getGroup();
- JaxbPlatformGroupDescription otherGroup = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup((String) expectedValue);
- return group == null ? false : group.equals(otherGroup);
- }
- return false;
- }
-
- private JaxbPlatformDescription platform(IProject project) {
- return (project == null)
- ? null
- : JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform(JptJaxbCorePlugin.getJaxbPlatformId(project));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java
deleted file mode 100644
index 112a1158e0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali JAXB Core.
- */
-public class JptJaxbCoreMessages {
-
- public static String ClassesGenerator_generatingClasses;
- public static String ClassesGenerator_generatingClassesTask;
-
- public static String JaxbFacetConfig_validatePlatformNotSpecified;
- public static String JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion;
-
- public static String JreLibraryValidator_invalidPlatform;
- public static String JreLibraryValidator_invalidJavaFacet;
- public static String JreLibraryValidator_invalidJavaLibrary;
-
- public static String UserLibraryValidator_incompatibleJavaFacet;
- public static String UserLibraryValidator_incompatibleJavaLibrary;
-
- public static String PREFERENCES_FLUSH_JOB_NAME;
-
- public static String SchemaGenerator_creatingJAXBPropertiesFileTask;
-
- public static String XML_ATTRIBUTE_DESC;
- public static String XML_ELEMENT_DESC;
- public static String XML_TYPE_DESC;
- public static String SUBSTITUTION_HEAD_DESC;
-
- public static String XML_ELEMENT_DECL__SCOPE;
-
-
- private static final String BUNDLE_NAME = "jpt_jaxb_core"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptJaxbCoreMessages.class;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
-
- private JptJaxbCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
deleted file mode 100644
index 0002d52ace..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
-
-public class SchemaLibraryImpl
- implements SchemaLibrary {
-
- private JaxbProject project;
-
- private final Map<String, String> schemaLocations;
-
- private final Map<String, XSDResourceImpl> schemaResources;
-
- private Adapter schemaResourceAdapter = new SchemaResourceAdapter();
-
-
- SchemaLibraryImpl(JaxbProject project) {
- this.project = project;
- this.schemaLocations = new HashMap<String, String>();
- this.schemaResources = new HashMap<String, XSDResourceImpl>();
- readProjectPreferences();
- }
-
-
- public XsdSchema getSchema(String namespace) {
- String resolvedUri = getResolvedUri(namespace);
- if (resolvedUri == null) {
- return null;
- }
-
- XSDResourceImpl schemaResource = this.schemaResources.get(namespace);
- XSDSchema schema = (schemaResource == null) ? null : schemaResource.getSchema();
- if (schemaResource != null) {
- if (schema != null && schemaResource.getURI().toString().equals(resolvedUri) && schemaResource.isLoaded()) {
- return XsdUtil.getSchema(schema);
- }
- else {
- removeSchemaResource(namespace, schemaResource);
- }
- }
-
- schema = addSchema(namespace, resolvedUri);
- return XsdUtil.getSchema(schema);
- }
-
- protected String getResolvedUri(String namespace) {
- String location = this.schemaLocations.get(namespace);
- return XsdUtil.getResolvedUri(namespace, location);
- }
-
- protected XSDSchema addSchema(String namespace, String resolvedUri) {
- XSDSchema schema = XsdUtil.buildXSDModel(resolvedUri);
- XSDResourceImpl schemaResource = (schema == null) ? null : (XSDResourceImpl) schema.eResource();
- if (schemaResource != null) {
- schemaResource.eAdapters().add(this.schemaResourceAdapter);
- this.schemaResources.put(namespace, schemaResource);
- return schema;
- }
- return null;
- }
-
- protected void removeSchemaResource(XSDResourceImpl schemaResource) {
- for (String namespace : new SnapshotCloneIterable<String>(this.schemaResources.keySet())) {
- if (schemaResource.equals(this.schemaResources.get(namespace))) {
- removeSchemaResource(namespace, schemaResource);
- }
- }
- }
-
- protected void removeSchemaResource(String namespace, XSDResourceImpl schemaResource) {
- schemaResource.eAdapters().remove(this.schemaResourceAdapter);
- this.schemaResources.remove(namespace);
- }
-
- protected void readProjectPreferences() {
- Map<String, String> schemaMap = JptJaxbCorePlugin.getSchemaLocationMap(this.project.getProject());
- this.schemaLocations.putAll(schemaMap);
- }
-
- public Map<String, String> getSchemaLocations() {
- return Collections.unmodifiableMap(this.schemaLocations);
- }
-
- public void setSchemaLocations(Map<String, String> schemaLocations) {
- this.schemaLocations.clear();
- JptJaxbCorePlugin.setSchemaLocationMap(this.project.getProject(), schemaLocations);
- readProjectPreferences();
- }
-
- public void refreshSchema(String namespace) {
- String resolvedUri = getResolvedUri(namespace);
- if (resolvedUri == null) {
- return;
- }
-
- XSDResourceImpl schemaResource = this.schemaResources.get(namespace);
-
- if (schemaResource != null) {
- removeSchemaResource(schemaResource);
- }
-
- addSchema(namespace, resolvedUri);
- }
-
- public void refreshAllSchemas() {
- for (String namespace : new SnapshotCloneIterable<String>(this.schemaResources.keySet())) {
- refreshSchema(namespace);
- }
- }
-
- public void validate(List<IMessage> messages) {
- for (String namespace : this.schemaLocations.keySet()) {
- if (getSchema(namespace) == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT_UNRESOLVED_SCHEMA,
- new String[] {this.schemaLocations.get(namespace)},
- this.project));
- }
- }
- }
-
-
- private class SchemaResourceAdapter
- extends AdapterImpl {
-
- @Override
- public void notifyChanged(Notification msg) {
- if (msg.getFeatureID(Resource.class) == Resource.RESOURCE__IS_LOADED
- && msg.getNewBooleanValue() == false) {
- removeSchemaResource((XSDResourceImpl) msg.getNotifier());
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java
deleted file mode 100644
index f159ded880..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-/**
- * Straightforward implementation of the JAXB project config.
- */
-public class SimpleJaxbProjectConfig
- implements JaxbProject.Config {
-
- private IProject project;
-
- private JaxbPlatformDefinition platformDefinition;
-
-
- public SimpleJaxbProjectConfig() {
- super();
- }
-
-
- public IProject getProject() {
- return this.project;
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-
- public JaxbPlatformDefinition getPlatformDefinition() {
- return this.platformDefinition;
- }
-
- public void setPlatformDefinition(JaxbPlatformDefinition platformDefinition) {
- this.platformDefinition = platformDefinition;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.project.getName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java
deleted file mode 100644
index 5e270b27f4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbNode;
-
-public abstract class AbstractJaxbContextNode
- extends AbstractJaxbNode
- implements JaxbContextNode
-{
-
- // ********** constructor **********
-
- protected AbstractJaxbContextNode(JaxbNode parent) {
- super(parent);
- }
-
-
- // ********** synchronize/update **********
-
- public void synchronizeWithResourceModel() {
- // NOP
- }
-
- /**
- * convenience method
- */
- protected void synchronizeNodesWithResourceModel(Iterable<? extends JaxbContextNode> nodes) {
- for (JaxbContextNode node : nodes) {
- node.synchronizeWithResourceModel();
- }
- }
-
- public void update() {
- // NOP
- }
-
- /**
- * convenience method
- */
- protected void updateNodes(Iterable<? extends JaxbContextNode> nodes) {
- for (JaxbContextNode node : nodes) {
- node.update();
- }
- }
-
- // ********** containment hierarchy **********
-
- /**
- * covariant override
- */
- @Override
- public JaxbContextNode getParent() {
- return (JaxbContextNode) super.getParent();
- }
-
- /**
- * Overridden in:<ul>
- * <li>{@link org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode#getResourceType() AbstractJavaContextNode}
- * </ul>
- */
- public JptResourceType getResourceType() {
- return getParent().getResourceType();
- }
-
- /**
- * Overridden in:<ul>
- * <li>{@link org.eclipse.jpt.jaxb.core.internal.context.GenericContextRoot#getContextRoot() GenericContextRoot}
- * to return itself>
- * </ul>
- */
- public JaxbContextRoot getContextRoot() {
- return getParent().getContextRoot();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java
deleted file mode 100644
index cfce93aefe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * the context model root
- */
-public abstract class AbstractJaxbContextRoot
- extends AbstractJaxbContextNode
- implements JaxbContextRoot {
-
- /* This object has no parent, so it must point to the JAXB project explicitly. */
- protected final JaxbProject jaxbProject;
-
- /* The map of package name to JaxbPackage objects */
- protected final Map<String, JaxbPackage> packages;
-
- /* The map of class name to JaxbType objects */
- protected final Map<String, JaxbType> types;
-
-
- public AbstractJaxbContextRoot(JaxbProject jaxbProject) {
- super(null); // the JAXB project is not really a "parent"...
- if (jaxbProject == null) {
- throw new NullPointerException();
- }
- this.jaxbProject = jaxbProject;
- this.packages = new HashMap<String, JaxbPackage>();
- this.types = new HashMap<String, JaxbType>();
- initialize();
- }
-
-
- @Override
- public JaxbContextRoot getContextRoot() {
- return this;
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- protected void initialize() {
-
- // process packages with annotations first
- for (String pkg : calculateInitialPackageNames()) {
- this.packages.put(pkg, buildPackage(pkg));
- }
-
- // keep set of total types for remaining package initialization
- Set<String> totalTypeNames = new HashSet<String>();
-
- // process types with annotations and in jaxb.index files
- for (JavaResourceAbstractType resourceType : calculateInitialTypes()) {
- totalTypeNames.add(resourceType.getQualifiedName());
- addType_(buildType(resourceType));
- }
-
- // once all classes have been processed, add packages
- for (String pkg : calculatePackageNames(totalTypeNames)) {
- if (! this.packages.containsKey(pkg)) {
- this.packages.put(pkg, buildPackage(pkg));
- }
- }
-
-// // keep a master list of all types that we've processed so we don't process them again
-// final Set<String> totalTypes = CollectionTools.<String>set();
-//
-// // keep an running list of types that we need to scan for further referenced types
-// final Set<String> typesToScan = CollectionTools.<String>set();
-//
-// // process packages with annotations first
-// for (String pkg : calculateInitialPackageNames()) {
-// this.packages.put(pkg, buildPackage(pkg));
-// }
-//
-// // calculate initial types (annotated or listed in jaxb.index files)
-// final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialTypes();
-//
-// // while there are resource types to process or types to scan, continue to do so
-// while (! resourceTypesToProcess.isEmpty() || ! typesToScan.isEmpty()) {
-// for (JavaResourceAbstractType resourceType : new SnapshotCloneIterable<JavaResourceAbstractType>(resourceTypesToProcess)) {
-// String className = resourceType.getQualifiedName();
-// totalTypes.add(className);
-// typesToScan.add(className);
-// addType_(buildType(resourceType));
-// resourceTypesToProcess.remove(resourceType);
-// }
-//
-// for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
-// JaxbType jaxbType = getType(typeToScan);
-// if (jaxbType != null) {
-// for (String referencedTypeName : jaxbType.getReferencedXmlTypeNames()) {
-// if (! totalTypes.contains(referencedTypeName)) {
-// JavaResourceAbstractType referencedType = getJaxbProject().getJavaResourceType(referencedTypeName);
-// if (referencedType != null) {
-// resourceTypesToProcess.add(referencedType);
-// }
-// }
-// }
-// }
-// typesToScan.remove(typeToScan);
-// }
-// }
-//
-// // once all classes have been processed, add packages
-// for (String pkg : calculatePackageNames(totalTypes)) {
-// if (! this.packages.containsKey(pkg)) {
-// this.packages.put(pkg, buildPackage(pkg));
-// }
-// }
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- for (JaxbPackage each : getPackages()) {
- each.synchronizeWithResourceModel();
- }
- for (JaxbType each : getTypes()) {
- each.synchronizeWithResourceModel();
- }
- }
-
- @Override
- public void update() {
- super.update();
-
- // keep a master list of these so that objects are updated only once
- final Set<String> packagesToUpdate = CollectionTools.<String>set();
- final Set<String> typesToUpdate = CollectionTools.<String>set();
-
- // keep a (shrinking) running list of these so that we know which ones we do eventually need to remove
- final Set<String> packagesToRemove = CollectionTools.set(this.packages.keySet());
- final Set<String> typesToRemove = CollectionTools.set(this.types.keySet());
-
- // keep a master list of all types that we've processed so we don't process them again
- final Set<String> totalTypes = CollectionTools.<String>set();
-
- // keep an running list of types that we need to scan for further referenced types
- final Set<String> typesToScan = CollectionTools.<String>set();
-
- // process packages with annotations first
- for (String pkg : calculateInitialPackageNames()) {
- if (this.packages.containsKey(pkg)) {
- packagesToUpdate.add(pkg);
- packagesToRemove.remove(pkg);
- }
- else {
- this.addPackage(this.buildPackage(pkg));
- }
- }
-
- // calculate initial types (annotated or listed in jaxb.index files)
- final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialTypes();
-
- // store set of types that are referenced (and should therefore be default mapped)
- final Set<JavaResourceAbstractType> referencedTypes = new HashSet<JavaResourceAbstractType>();
-
- // while there are resource types to process or types to scan, continue to do so
- while (! resourceTypesToProcess.isEmpty() || ! typesToScan.isEmpty()) {
- for (JavaResourceAbstractType resourceType : new SnapshotCloneIterable<JavaResourceAbstractType>(resourceTypesToProcess)) {
- String className = resourceType.getQualifiedName();
- typesToRemove.remove(className);
- totalTypes.add(className);
- typesToScan.add(className);
- processType(resourceType, typesToUpdate, referencedTypes.contains(resourceType));
- resourceTypesToProcess.remove(resourceType);
- }
-
- for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
- JaxbType jaxbType = getType(typeToScan);
- if (jaxbType != null) {
- for (String referencedTypeName : jaxbType.getReferencedXmlTypeNames()) {
- if (! StringTools.stringIsEmpty(referencedTypeName) && ! totalTypes.contains(referencedTypeName)) {
- JavaResourceAbstractType referencedType = getJaxbProject().getJavaResourceType(referencedTypeName);
- if (referencedType != null) {
- resourceTypesToProcess.add(referencedType);
- referencedTypes.add(referencedType);
- }
- }
- }
- }
- typesToScan.remove(typeToScan);
- }
- }
-
- // once all classes have been processed, add packages
- for (String pkg : calculatePackageNames(totalTypes)) {
- if (this.packages.containsKey(pkg)) {
- packagesToUpdate.add(pkg);
- packagesToRemove.remove(pkg);
- }
- else {
- this.addPackage(this.buildPackage(pkg));
- }
- }
-
- for (String packageToUpdate : packagesToUpdate) {
- this.packages.get(packageToUpdate).update();
- }
-
- for (String typeToUpdate : typesToUpdate) {
- this.types.get(typeToUpdate).update();
- }
-
- for (String packageToRemove : packagesToRemove) {
- removePackage(packageToRemove);
- }
-
- for (String typeToRemove : typesToRemove) {
- removeType(typeToRemove);
- }
- }
-
- /**
- * calculate set of packages that can be determined purely by presence of package annotations
- */
- protected Set<String> calculateInitialPackageNames() {
- return CollectionTools.set(
- new TransformationIterable<JavaResourcePackage, String>(
- getJaxbProject().getAnnotatedJavaResourcePackages()) {
- @Override
- protected String transform(JavaResourcePackage o) {
- return o.getName();
- }
- });
- }
-
- /**
- * calculate set of packages that can be determined from type names
- */
- protected Set<String> calculatePackageNames(Set<String> typeNames) {
- Set<String> packageNames = CollectionTools.<String>set();
- for (String typeName : typeNames) {
- JaxbType jaxbType = this.types.get(typeName);
- if (jaxbType != null) {
- packageNames.add(jaxbType.getPackageName());
- }
- }
- return packageNames;
- }
-
- /*
- * Calculate set of initial types
- * This should be:
- * - all resource types with @XmlType, @XmlRootElement, or @XmlJavaTypeAdapter
- * - all resource classes with @XmlRegistry
- * - all resource enums with @XmlEnum
- * - all types listed in jaxb.index files.
- */
- protected Set<JavaResourceAbstractType> calculateInitialTypes() {
- Set<JavaResourceAbstractType> set = CollectionTools.set(
- new FilteringIterable<JavaResourceAbstractType>(
- getJaxbProject().getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType o) {
- if (o.getKind() == JavaResourceAbstractType.Kind.TYPE) {
- if (o.getAnnotation(JAXB.XML_REGISTRY) != null) {
- return true;
- }
- }
- if (o.getKind() == JavaResourceAbstractType.Kind.ENUM) {
- if (o.getAnnotation(JAXB.XML_ENUM) != null) {
- return true;
- }
- }
- return o.getAnnotation(JAXB.XML_TYPE) != null
- || o.getAnnotation(JAXB.XML_ROOT_ELEMENT) != null
- || o.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER) != null;
- }
- });
- CollectionTools.addAll(
- set,
- new FilteringIterable<JavaResourceAbstractType>(
- new TransformationIterable<String, JavaResourceAbstractType>(
- new CompositeIterable<String>(
- new TransformationIterable<JaxbIndexResource, Iterable<String>>(getJaxbProject().getJaxbIndexResources()) {
- @Override
- protected Iterable<String>transform(JaxbIndexResource o) {
- return o.getFullyQualifiedClassNames();
- }
- })) {
- @Override
- protected JavaResourceAbstractType transform(String o) {
- return getJaxbProject().getJavaResourceType(o);
- }
- },
- NotNullFilter.<JavaResourceAbstractType>instance()));
- return set;
- }
-
- protected void processType(JavaResourceAbstractType resourceType, Set<String> typesToUpdate, boolean defaultMapped) {
- JaxbType.Kind jaxbTypeKind = calculateJaxbTypeKind(resourceType);
- String className = resourceType.getQualifiedName();
-
- if (this.types.containsKey(className)) {
- JaxbType type = this.types.get(className);
- if (type.getKind() == jaxbTypeKind) {
- typesToUpdate.add(className);
- type.setDefaultMapped(defaultMapped);
- return;
- }
- else {
- this.removeType(className); // this will remove a type of another kind
- }
- }
-
- JaxbType type = buildType(resourceType);
- type.setDefaultMapped(defaultMapped);
- this.addType(type);
- }
-
- protected JaxbType.Kind calculateJaxbTypeKind(JavaResourceAbstractType resourceType) {
- if (resourceType.getKind() == JavaResourceAbstractType.Kind.ENUM) {
- return JaxbType.Kind.ENUM;
- }
- // else is of kind TYPE
- else {
- return JaxbType.Kind.CLASS;
- }
- }
-
- protected JaxbType buildType(JavaResourceAbstractType resourceType) {
- JaxbType.Kind kind = calculateJaxbTypeKind(resourceType);
- if (kind == JaxbType.Kind.ENUM) {
- return buildJaxbEnum((JavaResourceEnum) resourceType);
- }
- else {
- return buildJaxbClass((JavaResourceType) resourceType);
- }
- }
-
-
- // ***** AbstractJaxbNode overrides *****
-
- @Override
- public JaxbProject getJaxbProject() {
- return this.jaxbProject;
- }
-
- @Override
- public IResource getResource() {
- return this.getProject();
- }
-
- protected IProject getProject() {
- return this.jaxbProject.getProject();
- }
-
-
- // ***** packages *****
-
- public Iterable<JaxbPackage> getPackages() {
- return new LiveCloneIterable<JaxbPackage>(this.packages.values());
- }
-
- public int getPackagesSize() {
- return this.packages.size();
- }
-
- public JaxbPackage getPackage(String packageName) {
- for (JaxbPackage jaxbPackage : this.getPackages()) {
- if (StringTools.stringsAreEqual(jaxbPackage.getName(), packageName)) {
- return jaxbPackage;
- }
- }
- return null;
- }
-
- protected JaxbPackage addPackage(JaxbPackage contextPackage) {
- if (this.packages.containsKey(contextPackage.getName())) {
- throw new IllegalArgumentException("Package with that name already exists."); //$NON-NLS-1$
- }
- this.packages.put(contextPackage.getName(), contextPackage);
- fireItemAdded(PACKAGES_COLLECTION, contextPackage);
- return contextPackage;
- }
-
- protected void removePackage(JaxbPackage contextPackage) {
- this.removePackage(contextPackage.getName());
- }
-
- protected void removePackage(String packageName) {
- if (! this.packages.containsKey(packageName)) {
- throw new IllegalArgumentException("No package with that name exists."); //$NON-NLS-1$
- }
- JaxbPackage removedPackage = this.packages.remove(packageName);
- fireItemRemoved(PACKAGES_COLLECTION, removedPackage);
- }
-
- protected JaxbPackage buildPackage(String packageName) {
- return this.getFactory().buildPackage(this, packageName);
- }
-
- protected boolean isEmpty(JaxbPackage jaxbPackage) {
- return jaxbPackage.isEmpty();
- }
-
-
- // ***** types *****
-
- public Iterable<JaxbType> getTypes() {
- return new LiveCloneIterable<JaxbType>(this.types.values());
- }
-
- public int getTypesSize() {
- return this.types.size();
- }
-
- public JaxbType getType(String typeName) {
- return this.types.get(typeName);
- }
-
- protected void addType_(JaxbType type) {
- this.types.put(type.getFullyQualifiedName(), type);
- }
-
- protected void addType(JaxbType type) {
- if (this.types.containsKey(type.getFullyQualifiedName())) {
- throw new IllegalArgumentException("Type with that name already exists."); //$NON-NLS-1$
- }
- addType_(type);
- fireItemAdded(TYPES_COLLECTION, type);
- }
-
- protected void removeType(JaxbType type) {
- removeType(type.getFullyQualifiedName());
- }
-
- protected void removeType(String typeName) {
- if (! this.types.containsKey(typeName)) {
- throw new IllegalArgumentException("No type with that name exists."); //$NON-NLS-1$
- }
- JaxbType removedType = this.types.remove(typeName);
- fireItemRemoved(TYPES_COLLECTION, removedType);
- }
-
- public Iterable<JaxbType> getTypes(final JaxbPackage jaxbPackage) {
- return new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getPackageName().equals(jaxbPackage.getName());
- }
- };
- }
-
- public Iterable<JaxbClass> getClasses() {
- return new SubIterableWrapper<JaxbType, JaxbClass>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.CLASS;
- }
- });
- }
-
- public Iterable<JaxbClass> getClasses(JaxbPackage jaxbPackage) {
- return new SubIterableWrapper<JaxbType, JaxbClass>(
- new FilteringIterable<JaxbType>(getTypes(jaxbPackage)) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.CLASS;
- }
- });
- }
-
- public Iterable<JaxbEnum> getEnums() {
- return new SubIterableWrapper<JaxbType, JaxbEnum>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.ENUM;
- }
- });
- }
-
- public Iterable<JaxbEnum> getEnums(JaxbPackage jaxbPackage) {
- return new SubIterableWrapper<JaxbType, JaxbEnum>(
- new FilteringIterable<JaxbType>(getTypes(jaxbPackage)) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.ENUM;
- }
- });
- }
-
-
- protected JaxbClass buildJaxbClass(JavaResourceType resourceType) {
- return this.getFactory().buildJaxbClass(this, resourceType);
- }
-
- protected JaxbEnum buildJaxbEnum(JavaResourceEnum resourceEnum) {
- return this.getFactory().buildJaxbEnum(this, resourceEnum);
- }
-
- public Iterable<XmlRegistry> getXmlRegistries(JaxbPackage jaxbPackage) {
- return new FilteringIterable<XmlRegistry>(
- new TransformationIterable<JaxbClass, XmlRegistry>(getClasses(jaxbPackage)) {
- @Override
- protected XmlRegistry transform(JaxbClass o) {
- return o.getXmlRegistry();
- }
- },
- NotNullFilter.INSTANCE);
- }
-
- public JaxbTypeMapping getTypeMapping(String typeName) {
- JaxbType type = getType(typeName);
- return (type == null) ? null : type.getMapping();
- }
-
- public JaxbClassMapping getClassMapping(String typeName) {
- JaxbType type = getType(typeName);
- return (type == null || (type.getKind() != JaxbType.Kind.CLASS)) ?
- null : ((JaxbClass) type).getMapping();
- }
-
-
- @Override
- public void stateChanged() {
- super.stateChanged();
- // forward to JAXB project
- this.jaxbProject.stateChanged();
- }
-
-
- // **************** validation ********************************************
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- for (JaxbPackage pkg : this.packages.values()) {
- pkg.validate(messages, reporter);
- }
- for (JaxbType type : this.types.values()) {
- type.validate(messages, reporter);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java
deleted file mode 100644
index fe52fc03e0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-
-public class GenericContextRoot
- extends AbstractJaxbContextRoot {
-
- public GenericContextRoot(JaxbProject jaxbProject) {
- super(jaxbProject);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java
deleted file mode 100644
index 2d582719ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericPackage
- extends AbstractJaxbContextNode
- implements JaxbPackage {
-
- protected final String name;
-
- protected JaxbPackageInfo packageInfo;
-
-
- public GenericPackage(JaxbContextRoot parent, String name) {
- super(parent);
- this.name = name;
- JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
- if (jrp != null) {
- this.packageInfo = buildPackageInfo(jrp);
- }
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- if (this.packageInfo != null) {
- this.packageInfo.synchronizeWithResourceModel();
- }
- }
-
- //Building/removing of the packageInfo is in the update because this is dependent
- //on a JaxbFile being added/removed which only causes an update of the model.
- @Override
- public void update() {
- super.update();
- JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
- if (jrp == null) {
- this.setPackageInfo_(null);
- }
- else {
- if (this.packageInfo == null) {
- this.setPackageInfo_(this.buildPackageInfo(jrp));
- }
- else {
- this.packageInfo.update();
- }
- }
- }
-
-
- // **************** name **************************************************
-
- public String getName() {
- return this.name;
- }
-
-
- // **************** package info ******************************************
-
- public JaxbPackageInfo getPackageInfo() {
- return this.packageInfo;
- }
-
- protected void setPackageInfo_(JaxbPackageInfo packageInfo) {
- JaxbPackageInfo old = this.packageInfo;
- this.packageInfo = packageInfo;
- firePropertyChanged(PACKAGE_INFO_PROPERTY, old, this.packageInfo);
- }
-
- protected JaxbPackageInfo buildPackageInfo(JavaResourcePackage resourcePackage) {
- return getFactory().buildJavaPackageInfo(this, resourcePackage);
- }
-
- public boolean isEmpty() {
- return getPackageInfo() == null && getRegistry() == null;
- }
-
- public XmlRegistry getRegistry() {
- Iterable<XmlRegistry> registries = getContextRoot().getXmlRegistries(this);
- if (CollectionTools.isEmpty(registries)) {
- return null;
- }
- return CollectionTools.get(registries, 0);
- }
-
-
- // **************** misc **************************************************
-
- public String getNamespace() {
- return (getPackageInfo() == null) ? "" : getPackageInfo().getXmlSchema().getNamespace();
- }
-
- public XmlNsForm getAttributeFormDefault() {
- return (getPackageInfo() == null) ? XmlNsForm.UNSET : getPackageInfo().getXmlSchema().getAttributeFormDefault();
- }
-
- public XmlNsForm getElementFormDefault() {
- return (getPackageInfo() == null) ? XmlNsForm.UNSET : getPackageInfo().getXmlSchema().getElementFormDefault();
- }
-
- public XsdSchema getXsdSchema() {
- return getJaxbProject().getSchemaLibrary().getSchema(getNamespace());
- }
-
-
- // **************** validation ********************************************
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (! getJaxbProject().getSchemaLibrary().getSchemaLocations().containsKey(getNamespace())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.PACKAGE_NO_SCHEMA_FOR_NAMESPACE,
- new String[] {getNamespace(), this.name},
- this));
- }
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- if (this.packageInfo != null) {
- this.packageInfo.validate(messages, reporter);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java
deleted file mode 100644
index e9c0fdcf91..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptableMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaAdaptableAttributeMapping<A extends Annotation>
- extends AbstractJavaAttributeMapping<A>
- implements XmlAdaptableMapping {
-
- protected XmlJavaTypeAdapter xmlJavaTypeAdapter;
-
-
- public AbstractJavaAdaptableAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlJavaTypeAdapter();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlJavaTypeAdapter();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlJavaTypeAdapter();
- }
-
-
- // ***** XmlJavaTypeAdapter *****
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlJavaTypeAdapter;
- }
-
- protected void setXmlJavaTypeAdapter_(XmlJavaTypeAdapter xmlJavaTypeAdapter) {
- XmlJavaTypeAdapter oldXmlJavaTypeAdapter = this.xmlJavaTypeAdapter;
- this.xmlJavaTypeAdapter = xmlJavaTypeAdapter;
- firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldXmlJavaTypeAdapter, xmlJavaTypeAdapter);
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- throw new IllegalStateException();
- }
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) getJavaResourceAttribute().addAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- XmlJavaTypeAdapter xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- setXmlJavaTypeAdapter_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- setXmlJavaTypeAdapter_(null);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaAttributeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() {
- return (XmlJavaTypeAdapterAnnotation) getJavaResourceAttribute().getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected void initializeXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- this.xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- }
- }
-
- protected void syncXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.synchronizeWithResourceModel();
- }
- else {
- setXmlJavaTypeAdapter_(buildXmlJavaTypeAdapter(annotation));
- }
- }
- else {
- setXmlJavaTypeAdapter_(null);
- }
- }
-
- protected void updateXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.update();
- }
- }
-
-
- // ***** XmlAdapter *****
-
- public XmlAdapter getXmlAdapter() {
- // see if there is an xml adapter specified on this attribute
- if (this.xmlJavaTypeAdapter != null) {
- return this.xmlJavaTypeAdapter.getXmlAdapter();
- }
-
- String boundTypeName = getBoundTypeName();
-
- // see if there is an xml adapter specified on the type
- JaxbType boundType = getContextRoot().getType(boundTypeName);
- if (boundType != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = boundType.getXmlJavaTypeAdapter();
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
-
- // see if there is an xml adapter on the package
- JaxbPackageInfo pkgInfo = getJaxbClassMapping().getJaxbType().getJaxbPackage().getPackageInfo();
- if (pkgInfo != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = pkgInfo.getXmlJavaTypeAdapter(boundTypeName);
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
-
- // see if there is an xml adapter on the *type's* package
- JavaResourceAbstractType resourceType = getJaxbProject().getJavaResourceType(boundTypeName);
- if (resourceType != null) {
- JaxbPackage pkg = getContextRoot().getPackage(resourceType.getPackageName());
- if (pkg != null) {
- pkgInfo = pkg.getPackageInfo();
- if (pkgInfo != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = pkgInfo.getXmlJavaTypeAdapter(boundTypeName);
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
- }
- }
-
- return null;
- }
-
-
- // ***** misc *****
-
- @Override
- public String getValueTypeName() {
- XmlAdapter xmlAdapter = getXmlAdapter();
- return (xmlAdapter == null) ? super.getValueTypeName() : xmlAdapter.getValueType();
- }
-
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java
deleted file mode 100644
index 0703d861c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-public abstract class AbstractJavaAttributeMapping<A extends Annotation>
- extends AbstractJavaContextNode
- implements JaxbAttributeMapping {
-
- protected boolean default_;
-
- protected AbstractJavaAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.default_ = this.buildDefault();
- }
-
-
- public JaxbClassMapping getClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncDefault();
- }
-
-
- // ********** annotation **********
-
- @SuppressWarnings("unchecked")
- public A getAnnotation() {
- return (A) getJavaResourceAttribute().getAnnotation(getAnnotationName());
- }
-
- protected abstract String getAnnotationName();
-
- /**
- * This method should only be called when an annotation *must* be present (such as when setting fields on it).
- * For most mappings, this is equivalent to #getAnnotation(), but for default mappings (such as @XmlElement)
- * an annotation will be added if none currently exists.
- */
- public A getOrCreateAnnotation() {
- A annotation = getAnnotation();
- if (annotation == null) {
- getPersistentAttribute().setMappingKey(getKey());
- annotation = getAnnotation();
- if (annotation == null) {
- throw new IllegalStateException("missing annotation: " + this); //$NON-NLS-1$
- }
- }
- return annotation;
- }
-
-
- // ********** default **********
-
- public boolean isDefault() {
- return this.default_;
- }
-
- protected void setDefault(boolean default_) {
- boolean old = this.default_;
- this.default_ = default_;
- this.firePropertyChanged(DEFAULT_PROPERTY, old, default_);
- }
-
- public void syncDefault() {
- this.setDefault(this.buildDefault());
- }
-
- protected boolean buildDefault() {
- return this.getAnnotation() == null;
- }
-
-
- // ********** validation **********
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation() == null ? getJavaResourceAttribute().getNameTextRange(astRoot) : getAnnotation().getTextRange(astRoot);
- }
-
-
- // ********** misc **********
-
- public JaxbPersistentAttribute getPersistentAttribute() {
- return (JaxbPersistentAttribute) super.getParent();
- }
-
- public JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getPersistentAttribute().getJavaResourceAttribute();
- }
-
- public String getBoundTypeName() {
- return getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public String getValueTypeName() {
- return getBoundTypeName();
- }
-
- public String getDataTypeName() {
- return getValueTypeName();
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return new SingleElementIterable(getValueTypeName());
- }
-
- /* default impl */
- public boolean isParticleMapping() {
- return false;
- }
-
- /* default impl */
- public boolean isTransient() {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java
deleted file mode 100644
index 135d71ba06..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-
-public abstract class AbstractJavaAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- protected AbstractJavaAttributeMappingDefinition() {
- super();
- }
-
- /**
- * Default implementation. Override if the mapping definition needs to do more analysis.
- */
- public boolean isSpecified(JaxbPersistentAttribute persistentAttribute) {
- return persistentAttribute.getJavaResourceAttribute().getAnnotation(getAnnotationName())
- != null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
deleted file mode 100644
index bcf8327607..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaContextNode
- extends AbstractJaxbContextNode
- implements JavaContextNode {
-
- // **************** constructor *******************************************
-
- protected AbstractJavaContextNode(JaxbNode parent) {
- super(parent);
- }
-
-
- @Override
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
- // **************** content assist ****************************************
-
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- public abstract TextRange getValidationTextRange(CompilationUnit astRoot);
-
- /**
- * All subclass implementations {@link #validate(List, CompilationUnit))}
- * should be preceded by a "super" call to this method
- */
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java
deleted file mode 100644
index e47d9b79bc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaElementQName
- extends AbstractJavaQName {
-
- public AbstractJavaElementQName(JavaContextNode parent, AbstractJavaQName.AnnotationProxy proxy) {
- super(parent, proxy);
- }
-
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- protected abstract JaxbPersistentAttribute getPersistentAttribute();
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- protected abstract XmlElementWrapper getElementWrapper();
-
- @Override
- public String getDefaultName() {
- return getPersistentAttribute().getJavaResourceAttribute().getName();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType == null) {
- return EmptyIterable.instance();
- }
-
- XmlElementWrapper elementWrapper = getElementWrapper();
-
- if (elementWrapper == null) {
- return xsdType.getElementNameProposals(getNamespace(), filter);
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement != null) {
- return xsdWrapperElement.getElementNameProposals(getNamespace(), filter);
- }
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public String getDefaultNamespace() {
- return (getJaxbPackage().getElementFormDefault() == XmlNsForm.QUALIFIED) ?
- getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = getJaxbPackage().getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType == null) {
- return;
- }
-
- XsdElementDeclaration resolvedXsdElement = null;
-
- XmlElementWrapper elementWrapper = getElementWrapper();
-
- if (elementWrapper == null) {
- resolvedXsdElement = xsdType.getElement(getNamespace(), getName());
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement == null) {
- // there will be a separate message for unresolved wrapper element
- // no need to also have a message for the nested element
- return;
- }
- resolvedXsdElement = xsdWrapperElement.getElement(getNamespace(), getName());
- }
-
- if (resolvedXsdElement == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
deleted file mode 100644
index e345acfe1e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaQName
- extends AbstractJavaContextNode
- implements JaxbQName {
-
- protected final AnnotationProxy proxy;
-
- protected String specifiedNamespace;
-
- protected String specifiedName;
-
-
- public AbstractJavaQName(JavaContextNode parent, AnnotationProxy proxy) {
- super(parent);
- this.proxy = proxy;
- this.specifiedNamespace = getAnnotationNamespace();
- this.specifiedName = getAnnotationName();
- }
-
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedNamespace_(getAnnotationNamespace());
- setSpecifiedName_(getAnnotationName());
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- return StringTools.stringIsEmpty(getSpecifiedNamespace()) ? // namespace="" is actually interpreted as unspecified by JAXB tools
- getDefaultNamespace() : getSpecifiedNamespace();
- }
-
- public abstract String getDefaultNamespace();
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String newSpecifiedNamespace) {
- setAnnotationNamespace(newSpecifiedNamespace);
- setSpecifiedNamespace_(newSpecifiedNamespace);
- }
-
- protected void setSpecifiedNamespace_(String newSpecifiedNamespace) {
- String oldNamespace = this.specifiedNamespace;
- this.specifiedNamespace = newSpecifiedNamespace;
- firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, oldNamespace, newSpecifiedNamespace);
- }
-
- protected void setAnnotationNamespace(String newNamespace) {
- this.proxy.setNamespace(newNamespace);
- }
-
- protected String getAnnotationNamespace() {
- return this.proxy.getNamespace();
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.getSpecifiedName() == null ? getDefaultName() : getSpecifiedName();
- }
-
- public abstract String getDefaultName();
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- setAnnotationName(newSpecifiedName);
- setSpecifiedName_(newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String old = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, newSpecifiedName);
- }
-
- protected void setAnnotationName(String newName) {
- this.proxy.setName(newName);
- }
-
- protected String getAnnotationName() {
- return this.proxy.getName();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.proxy.namespaceTouches(pos, astRoot)) {
- return getNamespaceProposals(filter);
- }
-
- if (this.proxy.nameTouches(pos, astRoot)) {
- return getNameProposals(filter);
- }
-
- return EmptyIterable.instance();
- }
-
- protected abstract Iterable<String> getNamespaceProposals(Filter<String> filter);
-
- protected abstract Iterable<String> getNameProposals(Filter<String> filter);
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getParent().getValidationTextRange(astRoot);
- }
-
- protected TextRange getTextRange(TextRange textRange, CompilationUnit astRoot) {
- return (textRange != null) ? textRange : getParent().getValidationTextRange(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNamespaceTextRange(astRoot), astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNameTextRange(astRoot), astRoot);
- }
-
- /**
- * e.g. "XML element"
- */
- protected String getReferencedComponentTypeDescription() {
- // default impl
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateName(messages, reporter, astRoot);
-
- if (! StringTools.stringIsEmpty(getName())) {
- validateReference(messages, reporter, astRoot);
- }
- }
-
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__MISSING_NAME,
- new String[] { getReferencedComponentTypeDescription() },
- this,
- getNameTextRange(astRoot)));
- }
- }
-
- protected abstract void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-
- protected IMessage getUnresolveSchemaComponentMessage(CompilationUnit astRoot) {
- return DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__UNRESOLVED_COMPONENT,
- new String[] { getReferencedComponentTypeDescription(), getNamespace(), getName() },
- this,
- getNameTextRange(astRoot));
- }
-
-
- public interface AnnotationProxy {
-
- String getNamespace();
-
- void setNamespace(String namespace);
-
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- String getName();
-
- void setName(String name);
-
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
- TextRange getNameTextRange(CompilationUnit astRoot);
- }
-
-
- /**
- * represents a {@link QNameAnnotation}
- */
- public static abstract class AbstractQNameAnnotationProxy
- implements AnnotationProxy {
-
- protected abstract QNameAnnotation getAnnotation(boolean createIfNull);
-
- public String getNamespace() {
- QNameAnnotation annotation = getAnnotation(false);
- return annotation == null ? null : annotation.getNamespace();
- }
-
- public void setNamespace(String newSpecifiedNamespace) {
- getAnnotation(true).setNamespace(newSpecifiedNamespace);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.namespaceTouches(pos, astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNamespaceTextRange(astRoot);
- }
-
- public String getName() {
- QNameAnnotation annotation = getAnnotation(false);
- return annotation == null ? null : annotation.getName();
- }
-
- public void setName(String newSpecifiedName) {
- getAnnotation(true).setName(newSpecifiedName);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.nameTouches(pos, astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNameTextRange(astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java
deleted file mode 100644
index be64693272..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaType
- extends AbstractJavaContextNode
- implements JaxbType {
-
- protected final JavaResourceAbstractType resourceType;
-
- protected JaxbTypeMapping mapping;
-
- protected boolean defaultMapped = false;
-
- protected XmlJavaTypeAdapter xmlJavaTypeAdapter;
-
-
- protected AbstractJavaType(JaxbContextNode parent, JavaResourceAbstractType resourceType) {
- super(parent);
- this.resourceType = resourceType;
- initMapping();
- initXmlJavaTypeAdapter();
- }
-
-
- // ***** overrides *****
-
- @Override
- public IResource getResource() {
- return this.resourceType.getFile();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncMapping();
- syncXmlJavaTypeAdapter();
- }
-
- @Override
- public void update() {
- super.update();
- updateMapping();
- updateXmlJavaTypeAdapter();
- }
-
-
- // ***** mapping *****
-
- public JaxbTypeMapping getMapping() {
- return this.mapping;
- }
-
- protected void setMapping_(JaxbTypeMapping newMapping) {
- JaxbTypeMapping old = this.mapping;
- this.mapping = newMapping;
- firePropertyChanged(MAPPING_PROPERTY, old, newMapping);
- }
-
- protected abstract JaxbTypeMapping buildMapping();
-
- protected void initMapping() {
- if (isDefaultMapped() || isSpecifiedMapped()) {
- this.mapping = buildMapping();
- }
- }
-
- protected void syncMapping() {
- if (this.mapping != null) {
- this.mapping.synchronizeWithResourceModel();
- }
- }
-
- protected void updateMapping() {
- boolean isMapped = isDefaultMapped() || isSpecifiedMapped();
- if (isMapped) {
- if (this.mapping != null) {
- this.mapping.update();
- }
- else {
- setMapping_(buildMapping());
- }
- }
- else if (this.mapping != null) {
- setMapping_(null);
- }
- }
-
- /*
- * Return true if the annotations on this type indicate it should have a mapping
- */
- protected boolean isSpecifiedMapped() {
- return getXmlTypeAnnotation() != null
- || getXmlRootElementAnnotation() != null
- || getXmlTransientAnnotation() != null;
- }
-
- protected XmlTypeAnnotation getXmlTypeAnnotation() {
- return (XmlTypeAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TYPE);
- }
-
- protected XmlRootElementAnnotation getXmlRootElementAnnotation() {
- return (XmlRootElementAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ROOT_ELEMENT);
- }
-
- protected XmlTransientAnnotation getXmlTransientAnnotation() {
- return (XmlTransientAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TRANSIENT);
- }
-
-
- // ***** default mapped *****
-
- public boolean isDefaultMapped() {
- return this.defaultMapped;
- }
-
- public void setDefaultMapped(boolean newValue) {
- boolean old = this.defaultMapped;
- this.defaultMapped = newValue;
- firePropertyChanged(DEFAULT_MAPPED_PROPERTY, old, newValue);
- }
-
-
- // ***** XmlJavaTypeAdapter *****
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlJavaTypeAdapter;
- }
-
- protected void setXmlJavaTypeAdapter_(XmlJavaTypeAdapter xmlJavaTypeAdapter) {
- XmlJavaTypeAdapter oldXmlJavaTypeAdapter = this.xmlJavaTypeAdapter;
- this.xmlJavaTypeAdapter = xmlJavaTypeAdapter;
- firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldXmlJavaTypeAdapter, xmlJavaTypeAdapter);
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- throw new IllegalStateException();
- }
- XmlJavaTypeAdapterAnnotation annotation
- = (XmlJavaTypeAdapterAnnotation) getJavaResourceType().addAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- XmlJavaTypeAdapter xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- setXmlJavaTypeAdapter_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- setXmlJavaTypeAdapter_(null);
- }
-
- protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() {
- return (XmlJavaTypeAdapterAnnotation) getJavaResourceType().getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaTypeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected void initXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- this.xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- }
- }
-
- protected void syncXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.synchronizeWithResourceModel();
- }
- else {
- setXmlJavaTypeAdapter_(buildXmlJavaTypeAdapter(annotation));
- }
- }
- else {
- setXmlJavaTypeAdapter_(null);
- }
- }
-
- protected void updateXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.update();
- }
- }
-
-
- // ***** JaxbType misc *****
-
- public JavaResourceAbstractType getJavaResourceType() {
- return this.resourceType;
- }
-
- public String getSimpleName() {
- return this.resourceType.getName();
- }
-
- public String getTypeQualifiedName() {
- String packageName = getPackageName();
- return (packageName.length() == 0) ? getFullyQualifiedName() : getFullyQualifiedName().substring(packageName.length() + 1);
- }
-
- public String getFullyQualifiedName() {
- return this.resourceType.getQualifiedName();
- }
-
- public String getPackageName() {
- return this.resourceType.getPackageName();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getContextRoot().getPackage(getPackageName());
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- if (this.mapping != null) {
- return this.mapping.getReferencedXmlTypeNames();
- }
- return EmptyIterable.instance();
- }
-
-
- // ***** misc *****
-
- protected CompilationUnit buildASTRoot() {
- return this.resourceType.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.mapping != null) {
- result = this.mapping.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- if (this.xmlJavaTypeAdapter != null) {
- result = this.xmlJavaTypeAdapter.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- /**
- * Override as needed
- */
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJavaResourceType().getNameTextRange(astRoot);
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- // TODO temporary hack since we don't know yet where to put
- // any messages for types in another project
- IFile file = this.resourceType.getFile();
- // 'file' will be null if the type is "external" and binary;
- // the file will be in a different project if the type is "external" and source;
- // the type will be binary if it is in a JAR in the current project
- if ((file != null)
- && file.getProject().equals(getJaxbProject().getProject())
- && (this.resourceType instanceof SourceNode)) {
- // build the AST root here to pass down
- this.validate(messages, reporter, this.buildASTRoot());
- }
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.mapping != null) {
- this.mapping.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
deleted file mode 100644
index 75715d5b0b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
+++ /dev/null
@@ -1,478 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaTypeMapping
- extends AbstractJavaContextNode
- implements JaxbTypeMapping {
-
- protected boolean xmlTransient;
-
- protected final JaxbQName qName;
-
- protected XmlRootElement xmlRootElement;
-
- protected XmlSeeAlso xmlSeeAlso;
-
-
- protected AbstractJavaTypeMapping(JaxbType parent) {
- super(parent);
- initXmlTransient();
- this.qName = buildQName();
- initXmlRootElement();
- initializeXmlSeeAlso();
- }
-
-
- public JaxbType getJaxbType() {
- return (JaxbType) getParent();
- }
-
- protected JavaResourceAbstractType getJavaResourceType() {
- return getJaxbType().getJavaResourceType();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getJaxbType().getJaxbPackage();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlTransient();
- this.qName.synchronizeWithResourceModel();
- syncXmlRootElement();
- syncXmlSeeAlso();
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- updateXmlRootElement();
- updateXmlSeeAlso();
- }
-
-
- // ***** XmlTransient *****
-
- public boolean isXmlTransient() {
- return this.xmlTransient;
- }
-
- public void setXmlTransient(boolean newValue) {
- getJavaResourceType().addAnnotation(JAXB.XML_TRANSIENT);
- setXmlTransient_(newValue);
- }
-
- protected void setXmlTransient_(boolean newValue) {
- boolean old = this.xmlTransient;
- this.xmlTransient = newValue;
- firePropertyChanged(XML_TRANSIENT_PROPERTY, old, newValue);
- }
-
- protected XmlTransientAnnotation getXmlTransientAnnotation() {
- return (XmlTransientAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TRANSIENT);
- }
-
- protected void initXmlTransient() {
- this.xmlTransient = getXmlTransientAnnotation() != null;
- }
-
- protected void syncXmlTransient() {
- setXmlTransient_(getXmlTransientAnnotation() != null);
- }
-
-
- // ***** XmlType.name and namespace *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlTypeQName(this);
- }
-
- protected XmlTypeAnnotation getXmlTypeAnnotation() {
- return (XmlTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_TYPE);
- }
-
-
- // ***** XmlRootElement *****
-
- public XmlRootElement getXmlRootElement() {
- return this.xmlRootElement;
- }
-
- protected void setXmlRootElement_(XmlRootElement rootElement) {
- XmlRootElement old = this.xmlRootElement;
- this.xmlRootElement = rootElement;
- this.firePropertyChanged(XML_ROOT_ELEMENT_PROPERTY, old, rootElement);
- }
-
- public XmlRootElement addXmlRootElement() {
- if (this.xmlRootElement != null) {
- throw new IllegalStateException();
- }
-
- XmlRootElementAnnotation annotation
- = (XmlRootElementAnnotation) getJavaResourceType().addAnnotation(JAXB.XML_ROOT_ELEMENT);
-
- XmlRootElement xmlRootElement = buildXmlRootElement(annotation);
- setXmlRootElement_(xmlRootElement);
- return xmlRootElement;
- }
-
- public void removeXmlRootElement() {
- if (this.xmlRootElement == null) {
- throw new IllegalStateException();
- }
-
- getJavaResourceType().removeAnnotation(JAXB.XML_ROOT_ELEMENT);
- setXmlRootElement_(null);
- }
-
- protected XmlRootElementAnnotation getXmlRootElementAnnotation() {
- return (XmlRootElementAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ROOT_ELEMENT);
- }
-
- protected XmlRootElement buildXmlRootElement() {
- XmlRootElementAnnotation annotation = getXmlRootElementAnnotation();
- return annotation == null ? null : buildXmlRootElement(annotation);
- }
-
- protected XmlRootElement buildXmlRootElement(XmlRootElementAnnotation resourceRootElement) {
- return getFactory().buildJavaXmlRootElement(this, resourceRootElement);
- }
-
- protected void initXmlRootElement() {
- this.xmlRootElement = this.buildXmlRootElement();
- }
-
- protected void syncXmlRootElement() {
- XmlRootElementAnnotation annotation = getXmlRootElementAnnotation();
- if (annotation != null) {
- if (this.xmlRootElement != null) {
- this.xmlRootElement.synchronizeWithResourceModel();
- }
- else {
- setXmlRootElement_(buildXmlRootElement(annotation));
- }
- }
- else if (this.xmlRootElement != null) {
- setXmlRootElement_(null);
- }
- }
-
- protected void updateXmlRootElement() {
- if (this.xmlRootElement != null) {
- this.xmlRootElement.update();
- }
- }
-
-
- // ***** XmlSeeAlso *****
-
- public XmlSeeAlso getXmlSeeAlso() {
- return this.xmlSeeAlso;
- }
-
- protected void setXmlSeeAlso_(XmlSeeAlso xmlSeeAlso) {
- XmlSeeAlso old = this.xmlSeeAlso;
- this.xmlSeeAlso = xmlSeeAlso;
- firePropertyChanged(XML_SEE_ALSO_PROPERTY, old, xmlSeeAlso);
- }
-
- public XmlSeeAlso addXmlSeeAlso() {
- if (this.xmlSeeAlso != null) {
- throw new IllegalStateException();
- }
- XmlSeeAlsoAnnotation annotation
- = (XmlSeeAlsoAnnotation) getJavaResourceType().addAnnotation(JAXB.XML_SEE_ALSO);
-
- XmlSeeAlso xmlSeeAlso = buildXmlSeeAlso(annotation);
- setXmlSeeAlso_(xmlSeeAlso);
- return xmlSeeAlso;
- }
-
- public void removeXmlSeeAlso() {
- if (this.xmlSeeAlso == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(JAXB.XML_SEE_ALSO);
- setXmlSeeAlso_(null);
- }
-
- protected XmlSeeAlsoAnnotation getXmlSeeAlsoAnnotation() {
- return (XmlSeeAlsoAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_SEE_ALSO);
- }
-
- protected XmlSeeAlso buildXmlSeeAlso(XmlSeeAlsoAnnotation annotation) {
- return new GenericJavaXmlSeeAlso(this, annotation);
- }
-
- protected void initializeXmlSeeAlso() {
- XmlSeeAlsoAnnotation annotation = getXmlSeeAlsoAnnotation();
- this.xmlSeeAlso = (annotation == null) ?
- null
- : buildXmlSeeAlso(annotation);
- }
-
- protected void syncXmlSeeAlso() {
- XmlSeeAlsoAnnotation annotation = getXmlSeeAlsoAnnotation();
- if (annotation != null) {
- if (this.xmlSeeAlso != null) {
- this.xmlSeeAlso.synchronizeWithResourceModel();
- }
- else {
- setXmlSeeAlso_(buildXmlSeeAlso(annotation));
- }
- }
- else {
- setXmlSeeAlso_(null);
- }
- }
-
- protected void updateXmlSeeAlso() {
- if (this.xmlSeeAlso != null) {
- this.xmlSeeAlso.update();
- }
- }
-
-
- // ***** misc *****
-
- public final Iterable<String> getReferencedXmlTypeNames() {
- return (this.xmlTransient) ?
- getTransientReferencedXmlTypeNames()
- : getNonTransientReferencedXmlTypeNames();
- }
-
- protected Iterable<String> getTransientReferencedXmlTypeNames() {
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- if (this.xmlSeeAlso != null) {
- return this.xmlSeeAlso.getReferencedXmlTypeNames();
- }
- return EmptyIterable.instance();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- getJaxbProject().getSchemaLibrary().refreshSchema(getJaxbPackage().getNamespace());
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlRootElement != null) {
- result = this.xmlRootElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getXmlTypeAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : getJaxbType().getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // TODO - validation for xml transient and anything else
-
- if (! this.xmlTransient) {
- this.qName.validate(messages, reporter, astRoot);
-
- if (this.xmlRootElement != null) {
- this.xmlRootElement.validate(messages, reporter, astRoot);
- }
- }
- }
-
-
- // ***** misc *****
-
- public XsdTypeDefinition getXsdTypeDefinition() {
- XsdSchema xsdSchema = getJaxbPackage().getXsdSchema();
- if (xsdSchema == null) {
- return null;
- }
-
- if (! StringTools.stringIsEmpty(this.qName.getName())) {
- return xsdSchema.getTypeDefinition(this.qName.getNamespace(), this.qName.getName());
- }
-
- if (this.xmlRootElement != null) {
- XsdElementDeclaration xsdElement
- = xsdSchema.getElementDeclaration(
- this.xmlRootElement.getQName().getNamespace(),
- this.xmlRootElement.getQName().getName());
- if (xsdElement != null) {
- return xsdElement.getType();
- }
- }
-
- return null;
- }
-
- public boolean hasRootElementInHierarchy() {
- return this.xmlRootElement != null;
- }
-
-
- protected class XmlTypeQName
- extends AbstractJavaQName {
-
- protected XmlTypeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- public String getDefaultNamespace() {
- return AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage().getNamespace();
- }
-
- @Override
- public String getDefaultName() {
- return Introspector.decapitalize(AbstractJavaTypeMapping.this.getJaxbType().getSimpleName());
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getTypeNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_TYPE_DESC;
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // do not call super... - it is not an error if the name is ""
- // if name is absent (""), namespace cannot be different from package namespace
- if ("".equals(getName())
- && ! StringTools.stringsAreEqual(
- getNamespace(),
- AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage().getNamespace())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE,
- this,
- getXmlTypeAnnotation().getNamespaceTextRange(astRoot)));
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // if name is not absent (""), type must be from schema associated with this package
- String name = getName();
- String namespace = getNamespace();
-
- if (! StringTools.stringIsEmpty(name)) {
- XsdSchema schema = AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage().getXsdSchema();
-
- if (schema != null) {
- XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name);
- if (schemaType == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return AbstractJavaTypeMapping.this.getXmlTypeAnnotation();
- }
- }
-
-
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java
deleted file mode 100644
index 5a708727da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public abstract class AbstractJavaXmlJavaTypeAdapter
- extends AbstractJavaContextNode
- implements XmlJavaTypeAdapter {
-
- protected final XmlJavaTypeAdapterAnnotation annotation;
-
- protected String value;
-
- protected XmlAdapter xmlAdapter;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- protected AbstractJavaXmlJavaTypeAdapter(JaxbContextNode parent, XmlJavaTypeAdapterAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.value = getResourceValue();
- initializeXmlAdapter();
- this.specifiedType = getResourceTypeString();
- this.defaultType = buildDefaultType();
- }
-
-
- public XmlJavaTypeAdapterAnnotation getAnnotation() {
- return this.annotation;
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setValue_(getResourceValue());
- syncXmlAdapter();
- setSpecifiedType_(getResourceTypeString());
- setDefaultType(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlAdapter();
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- this.annotation.setValue(value);
- this.setValue_(value);
- }
-
- protected void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- protected String getResourceValue() {
- return this.annotation.getValue();
- }
-
- public String getFullyQualifiedValue() {
- return this.annotation.getFullyQualifiedValue();
- }
-
-
- // ***** xmlAdapter *****
-
- public XmlAdapter getXmlAdapter() {
- return this.xmlAdapter;
- }
-
- protected void setXmlAdapter_(XmlAdapter xmlAdapter) {
- XmlAdapter old = this.xmlAdapter;
- this.xmlAdapter = xmlAdapter;
- firePropertyChanged(XML_ADAPTER_PROPERTY, old, xmlAdapter);
- }
-
- protected JavaResourceType getXmlAdapterResourceType() {
- String xmlAdapterName = getFullyQualifiedValue();
- return (JavaResourceType) getJaxbProject().getJavaResourceType(xmlAdapterName, JavaResourceAbstractType.Kind.TYPE);
- }
-
- protected XmlAdapter buildXmlAdapter(JavaResourceType xmlAdapterResourceType) {
- return new GenericJavaXmlAdapter(this, xmlAdapterResourceType);
- }
-
- protected void initializeXmlAdapter() {
- JavaResourceType xmlAdapterResourceType = getXmlAdapterResourceType();
- if (xmlAdapterResourceType != null) {
- this.xmlAdapter = buildXmlAdapter(xmlAdapterResourceType);
- }
- }
-
- protected void syncXmlAdapter() {
- if (this.xmlAdapter != null) {
- this.xmlAdapter.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlAdapter() {
- JavaResourceType newResourceType = getXmlAdapterResourceType();
- if (newResourceType == null) {
- setXmlAdapter_(null);
- }
- else {
- if (this.xmlAdapter == null) {
- setXmlAdapter_(buildXmlAdapter(newResourceType));
- }
- else {
- JavaResourceType currentResourceType = this.xmlAdapter.getJavaResourceType();
- if (currentResourceType == null || ! currentResourceType.equals(newResourceType)) {
- setXmlAdapter_(buildXmlAdapter(newResourceType));
- }
- else {
- this.xmlAdapter.update();
- }
- }
- }
- }
-
-
- // ***** type *****
-
- public String getType() {
- return this.specifiedTypeNotSet() ? this.getDefaultType() : this.getSpecifiedType();
- }
-
- /**
- * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT
- */
- protected boolean specifiedTypeNotSet() {
- return getSpecifiedType() == null || getSpecifiedType().equals(DEFAULT_TYPE);
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(String defaultType) {
- String oldDefaultType = this.defaultType;
- this.defaultType = defaultType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldDefaultType, defaultType);
- }
-
- protected abstract String buildDefaultType();
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String location) {
- this.annotation.setType(location);
- this.setSpecifiedType_(location);
- }
-
- protected void setSpecifiedType_(String type) {
- String old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected String getResourceTypeString() {
- return this.annotation.getType();
- }
-
- public String getFullyQualifiedType() {
- return this.annotation.getFullyQualifiedType();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java
deleted file mode 100644
index d351834091..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-
-public class FieldAccessor
- extends AbstractJavaContextNode
- implements Accessor {
-
- protected final JavaResourceField resourceField;
-
-
- public FieldAccessor(JaxbClassMapping parent, JavaResourceField resourceField) {
- super(parent);
- this.resourceField = resourceField;
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getResourceField();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- return AccessorTools.getBaseTypeName(this.getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- return AccessorTools.isCollectionType(getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- return this.getJavaResourceAttribute().typeIsSubTypeOf(typeName);
- }
-
- public JavaResourceField getResourceField() {
- return this.resourceField;
- }
-
- public boolean isFor(JavaResourceField resourceField) {
- return this.resourceField == resourceField;
- }
-
- public boolean isFor(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- return false;
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
deleted file mode 100644
index 8d98ffa589..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeMappingXmlSchemaType
- extends GenericJavaXmlSchemaType {
-
- public GenericJavaAttributeMappingXmlSchemaType(JaxbAttributeMapping parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent, xmlSchemaTypeAnnotation);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return this.getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String fqType = getFullyQualifiedType();
- if (fqType != null && ! XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE,
- this,
- getTypeTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
deleted file mode 100644
index 8d751b01ad..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaAttributeXmlJavaTypeAdapter(JaxbAttributeMapping parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- // ********** type **********
-
- @Override
- protected String buildDefaultType() {
- return this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getType() == null || getType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED,
- this,
- getAnnotation().getTypeTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java
deleted file mode 100644
index 1c609bcf7d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java
+++ /dev/null
@@ -1,678 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.lang.reflect.Modifier;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributesContainer
- extends AbstractJavaContextNode
- implements JaxbAttributesContainer {
-
- protected JavaResourceType javaResourceType;
-
- protected Owner owner;
-
- protected final Vector<JaxbPersistentAttribute> attributes = new Vector<JaxbPersistentAttribute>();
-
- public GenericJavaAttributesContainer(JaxbClassMapping parent, Owner owner, JavaResourceType resourceType) {
- super(parent);
- this.javaResourceType = resourceType;
- this.owner = owner;
- this.initializeAttributes();
- }
-
-
- public JaxbClassMapping getJaxbClassMapping() {
- return (JaxbClassMapping) getParent();
- }
-
- public boolean isFor(JavaResourceType javaResourceType) {
- return this.javaResourceType == javaResourceType;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.synchronizeNodesWithResourceModel(this.getAttributes());
- }
-
- @Override
- public void update() {
- super.update();
- this.updateAttributes();
- }
-
- // ********** access type **********
-
- protected XmlAccessType getAccessType() {
- return this.owner.getAccessType();
- }
-
-
- // ********** attributes **********
-
- public Iterable<JaxbPersistentAttribute> getAttributes() {
- return new LiveCloneIterable<JaxbPersistentAttribute>(this.attributes);
- }
-
- public int getAttributesSize() {
- return this.attributes.size();
- }
-
- protected void addAttribute(JaxbPersistentAttribute attribute) {
- if (this.attributes.add(attribute)) {
- this.owner.fireAttributeAdded(attribute);
- }
- }
-
- protected void removeAttribute(JaxbPersistentAttribute attribute) {
- if (this.attributes.remove(attribute)) {
- this.owner.fireAttributeRemoved(attribute);
- }
- }
-
- protected JaxbPersistentAttribute buildField(JavaResourceField resourceField) {
- return getFactory().buildJavaPersistentField(getJaxbClassMapping(), resourceField);
- }
-
- protected JaxbPersistentAttribute buildProperty(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return getFactory().buildJavaPersistentProperty(getJaxbClassMapping(), resourceGetter, resourceSetter);
- }
-
- protected void initializeAttributes() {
- if (getJaxbClassMapping().isXmlTransient()) {
- return;
- }
- if (getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
- this.initializePublicMemberAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.FIELD) {
- this.intializeFieldAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.PROPERTY) {
- this.intializePropertyAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.NONE) {
- this.intializeNoneAccessAttributes();
- }
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PUBLIC_MEMBER
- * 1. all public, non-static, non-transient fields (transient modifier, @XmlTransient is brought to the context model)
- * 2. all annotated fields that aren't public
- * 3. all public getter/setter javabeans pairs
- * 4. all annotated methods (some will have a matching getter/setter, some will be standalone)
- */
- private void initializePublicMemberAccessAttributes() {
- this.initializeFieldAttributes(PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER);
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all persistable resource method getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistablePublicMemberAccess(getterMethod, setterMethod)) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.FIELD
- * 1. all non-transient fields
- * 2. all annotated methods getters/setters
- */
- private void intializeFieldAccessAttributes() {
- this.initializeFieldAttributes(this.buildNonTransientNonStaticResourceFieldsFilter());
- this.initializeAnnotatedPropertyAttributes();
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PROPERTY
- * 1. all getter/setter javabeans pairs
- * 2. all annotated fields
- * 3. all annotated methods getters/setters that don't have a matching pair
- */
- private void intializePropertyAccessAttributes() {
- this.initializeFieldAttributes(ANNOTATED_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistableProperties(getterMethod, setterMethod)) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.NONE
- * 1. all annotated fields
- * 2. all annotated methods getters/setters (some will have a matching getter/setter, some will be standalone)
- */
- private void intializeNoneAccessAttributes() {
- this.initializeFieldAttributes(ANNOTATED_RESOURCE_FIELDS_FILTER);
- this.initializeAnnotatedPropertyAttributes();
- }
-
- private void initializeFieldAttributes(Filter<JavaResourceField> filter) {
- for (JavaResourceField resourceField : this.getResourceFields(filter)) {
- this.attributes.add(this.buildField(resourceField));
- }
- }
-
- private void initializeRemainingResourceMethodAttributes(Collection<JavaResourceMethod> resourceMethods) {
- //iterate through remaining resource methods and search for those that are annotated.
- //all getter methods will already be used.
- for (JavaResourceMethod resourceMethod : resourceMethods) {
- if (resourceMethod.isAnnotated()) {
- //annotated setter(or other random method) with no corresponding getter, bring into context model for validation purposes
- this.attributes.add(this.buildProperty(null, resourceMethod));
- }
- }
- }
-
- private static boolean methodsArePersistableProperties(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- if (setterMethod != null) {
- return true;
- }
- //Lists do not have to have a corresponding setter method
- else if (getterMethod.getTypeName().equals("java.util.List")) { //$NON-NLS-1$
- return true;
- }
- else if (getterMethod.isAnnotated()) {
- //annotated getter with no corresponding setter, bring into context model for validation purposes
- return true;
- }
- return false;
- }
-
- private static boolean methodsArePersistablePublicMemberAccess(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- if (getterMethod.isPublic()) {
- if (setterMethod != null) {
- if (setterMethod.isPublic()) {
- return true;
- }
- }
- //Lists do not have to have a corresponding setter method
- else if (getterMethod.getTypeName().equals("java.util.List")) { //$NON-NLS-1$
- return true;
- }
- else if (getterMethod.isAnnotated()) {
- //annotated getter with no corresponding setter, bring into context model for validation purposes
- return true;
- }
- }
- else if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- return true;
- }
- return false;
- }
-
- private void initializeAnnotatedPropertyAttributes() {
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- protected Iterable<JavaResourceField> getResourceFields() {
- return this.javaResourceType.getFields();
- }
-
- protected Iterable<JavaResourceMethod> getResourceMethods() {
- return this.javaResourceType.getMethods();
- }
-
- protected Iterable<JavaResourceField> getResourceFields(Filter<JavaResourceField> filter) {
- return new FilteringIterable<JavaResourceField>(getResourceFields(), filter);
- }
-
- protected Iterable<JavaResourceMethod> getResourceMethods(Filter<JavaResourceMethod> filter) {
- return new FilteringIterable<JavaResourceMethod>(getResourceMethods(), filter);
- }
-
- protected Filter<JavaResourceField> buildNonTransientNonStaticResourceFieldsFilter() {
- return new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return memberIsNonTransientNonStatic(resourceField) || resourceField.isAnnotated();
- }
- };
- }
-
- protected static Filter<JavaResourceField> PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER = new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return memberIsPublicNonTransientNonStatic(resourceField) || resourceField.isAnnotated();
- }
- };
-
- protected Filter<JavaResourceMethod> buildPersistablePropertyGetterMethodsFilter() {
- return new Filter<JavaResourceMethod>() {
- public boolean accept(JavaResourceMethod resourceMethod) {
- return methodIsPersistablePropertyGetter(resourceMethod, getResourceMethods());
- }
- };
- }
-
- protected static boolean memberIsPublicNonTransientNonStatic(JavaResourceMember resourceMember) {
- return resourceMember.isPublic() && memberIsNonTransientNonStatic(resourceMember);
- }
-
- protected static boolean memberIsNonTransientNonStatic(JavaResourceMember resourceMember) {
- return !resourceMember.isTransient() && !resourceMember.isStatic();
- }
-
- protected static Filter<JavaResourceField> ANNOTATED_RESOURCE_FIELDS_FILTER =
- new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return resourceField.isAnnotated();
- }
- };
-
- /**
- * The attributes are synchronized during the <em>update</em> because
- * the list of resource attributes is determined by the access type
- * which can be controlled in a number of different places....
- */
- protected void updateAttributes() {
- if (getJaxbClassMapping().isXmlTransient()) {
- for (JaxbPersistentAttribute contextAttribute : getAttributes()) {
- this.removeAttribute(contextAttribute);
- }
- return;
- }
- if (getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
- this.syncPublicMemberAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.FIELD) {
- this.syncFieldAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.PROPERTY) {
- this.syncPropertyAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.NONE) {
- this.syncNoneAccessAttributes();
- }
- }
-
- /**
- * Sync the attributes for XmlAccessType.PUBLIC_MEMBER
- * 1. all public, non-static, non-transient fields (transient modifier, @XmlTransient is brought to the context model)
- * 2. all annotated fields that aren't public
- * 3. all public getter/setter javabeans pairs
- * 4. all annotated methods (some will have a matching getter/setter, some will be standalone)
- */
- private void syncPublicMemberAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all persistable resource method getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistablePublicMemberAccess(getterMethod, setterMethod)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.FIELD
- * 1. all non-transient fields
- * 2. all annotated methods getters/setters
- */
- private void syncFieldAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, this.buildNonTransientNonStaticResourceFieldsFilter());
- this.syncAnnotatedPropertyAttributes(contextAttributes);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PROPERTY
- * 1. all getter/setter javabeans pairs
- * 2. all annotated fields
- * 3. all annotated methods getters/setters that don't have a matching pair
- */
- private void syncPropertyAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, ANNOTATED_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistableProperties(getterMethod, setterMethod)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.NONE
- * 1. all annotated fields
- * 2. all annotated methods getters/setters (some will have a matching getter/setter, some will be standalone)
- */
- private void syncNoneAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, ANNOTATED_RESOURCE_FIELDS_FILTER);
- this.syncAnnotatedPropertyAttributes(contextAttributes);
- }
-
- private void syncAnnotatedPropertyAttributes(HashSet<JaxbPersistentAttribute> contextAttributes) {
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- private void syncFieldAttributes(HashSet<JaxbPersistentAttribute> contextAttributes, Filter<JavaResourceField> filter) {
- for (JavaResourceField resourceField : this.getResourceFields(filter)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext(); ) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(resourceField)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- // added elements are sync'ed during construction or will be
- // updated during the next "update" (which is triggered by
- // their addition to the model)
- this.addAttribute(this.buildField(resourceField));
- }
- }
- }
-
- private void syncRemainingResourceMethods(HashSet<JaxbPersistentAttribute> contextAttributes, Collection<JavaResourceMethod> resourceMethods) {
- //iterate through remaining resource methods and search for those that are annotated.
- //all getter methods will already be used.
- for (JavaResourceMethod resourceMethod : resourceMethods) {
- if (resourceMethod.isAnnotated()) {
- boolean match = false;
- //annotated setter(or other random method) with no corresponding getter, bring into context model for validation purposes
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(null, resourceMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(null, resourceMethod));
- }
- }
- }
-
- // remove any leftover context attributes
- for (JaxbPersistentAttribute contextAttribute : contextAttributes) {
- this.removeAttribute(contextAttribute);
- }
- }
-
- /**
- * Return whether the specified method is a "getter" method that
- * represents a property that may be "persisted".
- */
- protected static boolean methodIsPersistablePropertyGetter(JavaResourceMethod resourceMethod, Iterable<JavaResourceMethod> allMethods) {
- if (methodHasInvalidModifiers(resourceMethod)) {
- return false;
- }
- if (resourceMethod.isConstructor()) {
- return false;
- }
-
- String returnTypeName = resourceMethod.getTypeName();
- if (returnTypeName == null) {
- return false; // DOM method bindings can have a null name
- }
- if (returnTypeName.equals("void")) { //$NON-NLS-1$
- return false;
- }
- if (methodHasParameters(resourceMethod)) {
- return false;
- }
-
- boolean booleanGetter = methodIsBooleanGetter(resourceMethod);
-
- // if the type has both methods:
- // boolean isProperty()
- // boolean getProperty()
- // then #isProperty() takes precedence and we ignore #getProperty();
- // but only having #getProperty() is OK too
- // (see the JavaBeans spec 1.01)
- if (booleanGetter && methodHasValidSiblingIsMethod(resourceMethod, allMethods)) {
- return false; // since the type also defines #isProperty(), ignore #getProperty()
- }
- return true;
- }
-
- private static boolean methodIsBooleanGetter(JavaResourceMethod resourceMethod) {
- String returnTypeName = resourceMethod.getTypeName();
- String name = resourceMethod.getMethodName();
- boolean booleanGetter = false;
- if (name.startsWith("is")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- } else {
- return false;
- }
- } else if (name.startsWith("get")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- booleanGetter = true;
- }
- } else {
- return false;
- }
- return booleanGetter;
- }
-
- /**
- * Return whether the method's modifiers prevent it
- * from being a getter or setter for a "persistent" property.
- */
- private static boolean methodHasInvalidModifiers(JavaResourceMethod resourceMethod) {
- int modifiers = resourceMethod.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return true;
- }
- return false;
- }
-
- private static boolean methodHasParameters(JavaResourceMethod resourceMethod) {
- return resourceMethod.getParametersSize() != 0;
- }
-
- /**
- * Return whether the method has a sibling "is" method for the specified
- * property and that method is valid for a "persistable" property.
- * Pre-condition: the method is a "boolean getter" (e.g. 'public boolean getProperty()');
- * this prevents us from returning true when the method itself is an
- * "is" method.
- */
- private static boolean methodHasValidSiblingIsMethod(JavaResourceMethod getMethod, Iterable<JavaResourceMethod> resourceMethods) {
- String capitalizedAttributeName = StringTools.capitalize(getMethod.getName());
- for (JavaResourceMethod sibling : resourceMethods) {
- if ((sibling.getParametersSize() == 0)
- && sibling.getMethodName().equals("is" + capitalizedAttributeName)) { //$NON-NLS-1$
- return methodIsValidSibling(sibling, "boolean"); //$NON-NLS-1$
- }
- }
- return false;
- }
-
- /**
- * Return whether the method has a sibling "set" method
- * and that method is valid for a "persistable" property.
- */
- private static JavaResourceMethod getValidSiblingSetMethod(JavaResourceMethod getMethod, Collection<JavaResourceMethod> resourceMethods) {
- String capitalizedAttributeName = StringTools.capitalize(getMethod.getName());
- String parameterTypeErasureName = getMethod.getTypeName();
- for (JavaResourceMethod sibling : resourceMethods) {
- ListIterable<String> siblingParmTypeNames = sibling.getParameterTypeNames();
- if ((sibling.getParametersSize() == 1)
- && sibling.getMethodName().equals("set" + capitalizedAttributeName) //$NON-NLS-1$
- && siblingParmTypeNames.iterator().next().equals(parameterTypeErasureName)) {
- return methodIsValidSibling(sibling, "void") ? sibling : null; //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * Return whether the specified method is a valid sibling with the
- * specified return type.
- */
- private static boolean methodIsValidSibling(JavaResourceMethod resourceMethod, String returnTypeName) {
- if (resourceMethod == null) {
- return false;
- }
- if (methodHasInvalidModifiers(resourceMethod)) {
- return false;
- }
- if (resourceMethod.isConstructor()) {
- return false;
- }
- String rtName = resourceMethod.getTypeName();
- if (rtName == null) {
- return false; // DOM method bindings can have a null name
- }
- return rtName.equals(returnTypeName);
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- attribute.validate(messages, reporter, astRoot);
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJaxbClassMapping().getValidationTextRange(astRoot);
- }
-
-
- interface Owner {
-
- /**
- * Return the access type of the owner, to be used in determining which attributes to build
- */
- XmlAccessType getAccessType();
-
- /**
- * fire property change event for the added attribute
- */
- void fireAttributeAdded(JaxbPersistentAttribute attribute);
-
- /**
- * fire property change event for the removed attribute
- */
- void fireAttributeRemoved(JaxbPersistentAttribute attribute);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java
deleted file mode 100644
index c22b19c67f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbBasicMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttachmentRef;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.context.XmlList;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JaxbBasicSchemaComponentAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class GenericJavaBasicMapping<A extends JaxbBasicSchemaComponentAnnotation>
- extends AbstractJavaAdaptableAttributeMapping<A>
- implements JaxbBasicMapping {
-
- protected XmlSchemaType xmlSchemaType;
-
- protected XmlList xmlList;
-
- protected XmlID xmlID;
-
- protected XmlIDREF xmlIDREF;
-
- protected XmlAttachmentRef xmlAttachmentRef;
-
-
- public GenericJavaBasicMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlSchemaType();
- initializeXmlList();
- initializeXmlID();
- initializeXmlIDREF();
- initializeXmlAttachmentRef();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlSchemaType();
- syncXmlList();
- syncXmlID();
- syncXmlIDREF();
- syncXmlAttachmentRef();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlSchemaType();
- updateXmlList();
- updateXmlID();
- updateXmlIDREF();
- updateXmlAttachmentRef();
- }
-
-
- // ***** XmlSchemaType *****
-
- public XmlSchemaType getXmlSchemaType() {
- return this.xmlSchemaType;
- }
-
- protected void setXmlSchemaType_(XmlSchemaType xmlSchemaType) {
- XmlSchemaType oldXmlSchemaType = this.xmlSchemaType;
- this.xmlSchemaType = xmlSchemaType;
- this.firePropertyChanged(XML_SCHEMA_TYPE_PROPERTY, oldXmlSchemaType, xmlSchemaType);
- }
-
- public boolean hasXmlSchemaType() {
- return this.xmlSchemaType != null;
- }
-
- public XmlSchemaType addXmlSchemaType() {
- if (this.xmlSchemaType != null) {
- throw new IllegalStateException();
- }
- XmlSchemaTypeAnnotation annotation = (XmlSchemaTypeAnnotation) this.getJavaResourceAttribute().addAnnotation(0, JAXB.XML_SCHEMA_TYPE);
-
- XmlSchemaType xmlJavaTypeAdapter = this.buildXmlSchemaType(annotation);
- this.setXmlSchemaType_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlSchemaType() {
- if (this.xmlSchemaType == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_SCHEMA_TYPE);
- this.setXmlSchemaType_(null);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation annotation) {
- return new GenericJavaAttributeMappingXmlSchemaType(this, annotation);
- }
-
- protected XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() {
- return (XmlSchemaTypeAnnotation) this.getJavaResourceAttribute().getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- }
-
- protected void initializeXmlSchemaType() {
- XmlSchemaTypeAnnotation annotation = this.getXmlSchemaTypeAnnotation();
- if (annotation != null) {
- this.xmlSchemaType = this.buildXmlSchemaType(annotation);
- }
- }
-
- protected void updateXmlSchemaType() {
- if (this.xmlSchemaType != null) {
- this.xmlSchemaType.update();
- }
- }
-
- protected void syncXmlSchemaType() {
- XmlSchemaTypeAnnotation annotation = this.getXmlSchemaTypeAnnotation();
- if (annotation != null) {
- if (this.getXmlSchemaType() != null) {
- this.getXmlSchemaType().synchronizeWithResourceModel();
- }
- else {
- this.setXmlSchemaType_(this.buildXmlSchemaType(annotation));
- }
- }
- else {
- this.setXmlSchemaType_(null);
- }
- }
-
- //************ XmlList ***************
-
- public XmlList getXmlList() {
- return this.xmlList;
- }
-
- public XmlList addXmlList() {
- if (this.xmlList != null) {
- throw new IllegalStateException();
- }
- XmlListAnnotation annotation = (XmlListAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_LIST);
-
- XmlList xmlList = this.buildXmlList(annotation);
- this.setXmlList_(xmlList);
- return xmlList;
- }
-
- protected XmlList buildXmlList(XmlListAnnotation xmlListAnnotation) {
- return new GenericJavaXmlList(this, xmlListAnnotation);
- }
-
- public void removeXmlList() {
- if (this.xmlList == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_LIST);
- this.setXmlList_(null);
- }
-
- protected void initializeXmlList() {
- XmlListAnnotation annotation = this.getXmlListAnnotation();
- if (annotation != null) {
- this.xmlList = this.buildXmlList(annotation);
- }
- }
-
- protected XmlListAnnotation getXmlListAnnotation() {
- return (XmlListAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_LIST);
- }
-
- protected void syncXmlList() {
- XmlListAnnotation annotation = this.getXmlListAnnotation();
- if (annotation != null) {
- if (this.getXmlList() != null) {
- this.getXmlList().synchronizeWithResourceModel();
- }
- else {
- this.setXmlList_(this.buildXmlList(annotation));
- }
- }
- else {
- this.setXmlList_(null);
- }
- }
-
- protected void updateXmlList() {
- if (this.getXmlList() != null) {
- this.getXmlList().update();
- }
- }
-
- protected void setXmlList_(XmlList xmlList) {
- XmlList oldXmlList = this.xmlList;
- this.xmlList = xmlList;
- firePropertyChanged(XML_LIST_PROPERTY, oldXmlList, xmlList);
- }
-
-
- //************ XmlID ***************
-
- public XmlID getXmlID() {
- return this.xmlID;
- }
-
- public XmlID addXmlID() {
- if (this.xmlID != null) {
- throw new IllegalStateException();
- }
- XmlIDAnnotation annotation = (XmlIDAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ID);
-
- XmlID xmlID = this.buildXmlID(annotation);
- this.setXmlID_(xmlID);
- return xmlID;
- }
-
- protected XmlID buildXmlID(XmlIDAnnotation xmlIDAnnotation) {
- return new GenericJavaXmlID(this, xmlIDAnnotation);
- }
-
- public void removeXmlID() {
- if (this.xmlID == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ID);
- this.setXmlID_(null);
- }
-
- protected void initializeXmlID() {
- XmlIDAnnotation annotation = this.getXmlIDAnnotation();
- if (annotation != null) {
- this.xmlID = this.buildXmlID(annotation);
- }
- }
-
- protected XmlIDAnnotation getXmlIDAnnotation() {
- return (XmlIDAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ID);
- }
-
- protected void syncXmlID() {
- XmlIDAnnotation annotation = this.getXmlIDAnnotation();
- if (annotation != null) {
- if (this.getXmlID() != null) {
- this.getXmlID().synchronizeWithResourceModel();
- }
- else {
- this.setXmlID_(this.buildXmlID(annotation));
- }
- }
- else {
- this.setXmlID_(null);
- }
- }
-
- protected void updateXmlID() {
- if (this.getXmlID() != null) {
- this.getXmlID().update();
- }
- }
-
- protected void setXmlID_(XmlID xmlID) {
- XmlID oldXmlID = this.xmlID;
- this.xmlID = xmlID;
- firePropertyChanged(XML_ID_PROPERTY, oldXmlID, xmlID);
- }
-
-
- //************ XmlIDREF ***************
-
- public XmlIDREF getXmlIDREF() {
- return this.xmlIDREF;
- }
-
- protected void setXmlIDREF_(XmlIDREF xmlIDREF) {
- XmlIDREF oldXmlIDREF = this.xmlIDREF;
- this.xmlIDREF = xmlIDREF;
- firePropertyChanged(XML_IDREF_PROPERTY, oldXmlIDREF, xmlIDREF);
- }
-
- public XmlIDREF addXmlIDREF() {
- if (this.xmlIDREF != null) {
- throw new IllegalStateException();
- }
-
- getJavaResourceAttribute().addAnnotation(JAXB.XML_IDREF);
-
- XmlIDREF xmlIDREF = buildXmlIDREF();
- setXmlIDREF_(xmlIDREF);
- return xmlIDREF;
- }
-
- public void removeXmlIDREF() {
- if (this.xmlIDREF == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_IDREF);
- setXmlIDREF_(null);
- }
-
- protected void initializeXmlIDREF() {
- if (getXmlIDREFAnnotation() != null) {
- this.xmlIDREF = buildXmlIDREF();
- }
- }
-
- protected void syncXmlIDREF() {
- if (getXmlIDREFAnnotation() == null) {
- setXmlIDREF_(null);
- }
- else if (this.xmlIDREF == null) {
- setXmlIDREF_(buildXmlIDREF());
- }
- else {
- this.xmlIDREF.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlIDREF() {
- if (this.xmlIDREF != null) {
- this.xmlIDREF.update();
- }
- }
-
- protected XmlIDREFAnnotation getXmlIDREFAnnotation() {
- return (XmlIDREFAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_IDREF);
- }
-
- protected XmlIDREF buildXmlIDREF() {
- return new GenericJavaXmlIDREF(this, buildXmlIDREFContext());
- }
-
- protected abstract GenericJavaXmlIDREF.Context buildXmlIDREFContext();
-
-
- //************ XmlAttachmentRef ***************
-
- public XmlAttachmentRef getXmlAttachmentRef() {
- return this.xmlAttachmentRef;
- }
-
- public XmlAttachmentRef addXmlAttachmentRef() {
- if (this.xmlAttachmentRef != null) {
- throw new IllegalStateException();
- }
- XmlAttachmentRefAnnotation annotation = (XmlAttachmentRefAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ATTACHMENT_REF);
-
- XmlAttachmentRef xmlAttachmentRef = this.buildXmlAttachmentRef(annotation);
- this.setXmlAttachmentRef_(xmlAttachmentRef);
- return xmlAttachmentRef;
- }
-
- protected XmlAttachmentRef buildXmlAttachmentRef(XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation) {
- return new GenericJavaXmlAttachmentRef(this, xmlAttachmentRefAnnotation);
- }
-
- public void removeXmlAttachmentRef() {
- if (this.xmlAttachmentRef == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ATTACHMENT_REF);
- this.setXmlAttachmentRef_(null);
- }
-
- protected void initializeXmlAttachmentRef() {
- XmlAttachmentRefAnnotation annotation = this.getXmlAttachmentRefAnnotation();
- if (annotation != null) {
- this.xmlAttachmentRef = this.buildXmlAttachmentRef(annotation);
- }
- }
-
- protected XmlAttachmentRefAnnotation getXmlAttachmentRefAnnotation() {
- return (XmlAttachmentRefAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ATTACHMENT_REF);
- }
-
- protected void syncXmlAttachmentRef() {
- XmlAttachmentRefAnnotation annotation = this.getXmlAttachmentRefAnnotation();
- if (annotation != null) {
- if (this.getXmlAttachmentRef() != null) {
- this.getXmlAttachmentRef().synchronizeWithResourceModel();
- }
- else {
- this.setXmlAttachmentRef_(this.buildXmlAttachmentRef(annotation));
- }
- }
- else {
- this.setXmlAttachmentRef_(null);
- }
- }
-
- protected void updateXmlAttachmentRef() {
- if (this.getXmlAttachmentRef() != null) {
- this.getXmlAttachmentRef().update();
- }
- }
-
- protected void setXmlAttachmentRef_(XmlAttachmentRef xmlAttachmentRef) {
- XmlAttachmentRef oldXmlAttachmentRef = this.xmlAttachmentRef;
- this.xmlAttachmentRef = xmlAttachmentRef;
- firePropertyChanged(XML_ATTACHMENT_REF_PROPERTY, oldXmlAttachmentRef, xmlAttachmentRef);
- }
-
-
- // ***** misc *****
-
- @Override
- public String getDataTypeName() {
- if (this.xmlIDREF != null) {
- JaxbClassMapping referenceMapping = getContextRoot().getClassMapping(getValueTypeName());
- if (referenceMapping != null) {
- JaxbAttributeMapping idMapping = referenceMapping.getXmlIdMapping();
- if (idMapping != null) {
- return idMapping.getValueTypeName();
- }
- }
- }
- return getValueTypeName();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlSchemaType != null) {
- result = this.xmlSchemaType.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlSchemaType != null) {
- this.xmlSchemaType.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlList != null) {
- this.xmlList.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlID != null) {
- this.xmlID.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlIDREF != null) {
- this.xmlIDREF.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlAttachmentRef != null) {
- this.xmlAttachmentRef.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected abstract class XmlIDREFContext
- implements GenericJavaXmlIDREF.Context {
-
- public XmlIDREFAnnotation getAnnotation() {
- return GenericJavaBasicMapping.this.getXmlIDREFAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
deleted file mode 100644
index dc3632e9eb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
+++ /dev/null
@@ -1,1076 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ChainIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer;
-import org.eclipse.jpt.jaxb.core.context.JaxbBasicMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.omg.CORBA.PUBLIC_MEMBER;
-
-
-public class GenericJavaClassMapping
- extends AbstractJavaTypeMapping
- implements JaxbClassMapping {
-
- protected String factoryClass;
-
- protected String factoryMethod;
-
- protected final PropOrderContainer propOrderContainer;
-
- protected JaxbClassMapping superclass;
-
- protected XmlAccessType defaultAccessType;
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder defaultAccessOrder;
- protected XmlAccessOrder specifiedAccessOrder;
-
- protected boolean hasRootElementInHierarchy_loaded = false;
- protected boolean hasRootElementInHierarchy = false;
-
- protected final JaxbAttributesContainer attributesContainer;
-
- protected final Map<JaxbClassMapping, JaxbAttributesContainer> includedAttributesContainers;
-
- public GenericJavaClassMapping(JaxbClass parent) {
- super(parent);
- this.includedAttributesContainers = new HashMap<JaxbClassMapping, JaxbAttributesContainer>();
- this.propOrderContainer = new PropOrderContainer();
-
- initFactoryClass();
- initFactoryMethod();
- initPropOrder();
- initSpecifiedAccessType();
- initDefaultAccessType();
- initSpecifiedAccessOrder();
- initDefaultAccessOrder();
- this.attributesContainer = new GenericJavaAttributesContainer(this, buildAttributesContainerOwner(), getJavaResourceType());
- initIncludedAttributes();
- }
-
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- @Override
- public JaxbClass getJaxbType() {
- return (JaxbClass) super.getJaxbType();
- }
-
- protected JaxbPackageInfo getPackageInfo() {
- JaxbPackage jaxbPackage = getJaxbPackage();
- // jaxb package may be null during initialization/update
- return (jaxbPackage == null) ? null : jaxbPackage.getPackageInfo();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncFactoryClass();
- syncFactoryMethod();
- syncPropOrder();
- syncSpecifiedAccessType();
- syncSpecifiedAccessOrder();
- this.attributesContainer.synchronizeWithResourceModel();
- syncIncludedAttributes();
- }
-
- @Override
- public void update() {
- super.update();
- updateSuperclass();
- updateDefaultAccessType();
- updateDefaultAccessOrder();
- this.hasRootElementInHierarchy_loaded = false; // triggers that the value must be recalculated on next request
- this.attributesContainer.update();
- updateIncludedAttributes();
- }
-
-
- // ***** factory class *****
-
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- getXmlTypeAnnotation().setFactoryClass(factoryClass);
- setFactoryClass_(factoryClass);
- }
-
- protected void setFactoryClass_(String factoryClass) {
- String old = this.factoryClass;
- this.factoryClass = factoryClass;
- firePropertyChanged(FACTORY_CLASS_PROPERTY, old, factoryClass);
- }
-
- protected String getResourceFactoryClass() {
- return getXmlTypeAnnotation().getFactoryClass();
- }
-
- protected void initFactoryClass() {
- this.factoryClass = getResourceFactoryClass();
- }
-
- protected void syncFactoryClass() {
- setFactoryClass_(getResourceFactoryClass());
- }
-
-
- // ***** factory method *****
-
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- getXmlTypeAnnotation().setFactoryMethod(factoryMethod);
- setFactoryMethod_(factoryMethod);
- }
-
- protected void setFactoryMethod_(String factoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = factoryMethod;
- firePropertyChanged(FACTORY_METHOD_PROPERTY, old, factoryMethod);
- }
-
- protected String getResourceFactoryMethod() {
- return getXmlTypeAnnotation().getFactoryMethod();
- }
-
- protected void initFactoryMethod() {
- this.factoryMethod = getResourceFactoryMethod();
- }
-
- protected void syncFactoryMethod() {
- setFactoryMethod_(getResourceFactoryMethod());
- }
-
-
- // ***** prop order *****
-
- public ListIterable<String> getPropOrder() {
- return this.propOrderContainer.getContextElements();
- }
-
- public String getProp(int index) {
- return this.propOrderContainer.getContextElement(index);
- }
-
- public int getPropOrderSize() {
- return this.propOrderContainer.getContextElementsSize();
- }
-
- public void addProp(int index, String prop) {
- getXmlTypeAnnotation().addProp(index, prop);
- this.propOrderContainer.addContextElement(index, prop);
- }
-
- public void removeProp(String prop) {
- this.removeProp(this.propOrderContainer.indexOfContextElement(prop));
- }
-
- public void removeProp(int index) {
- this.getXmlTypeAnnotation().removeProp(index);
- this.propOrderContainer.removeContextElement(index);
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- this.getXmlTypeAnnotation().moveProp(targetIndex, sourceIndex);
- this.propOrderContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected void initPropOrder() {
- this.propOrderContainer.initialize();
- }
-
- protected void syncPropOrder() {
- this.propOrderContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<String> getResourcePropOrder() {
- ListIterable<String> result = getXmlTypeAnnotation().getPropOrder();
- if (CollectionTools.size(result) == 1 && StringTools.EMPTY_STRING.equals(CollectionTools.get(result, 0))) {
- return EmptyListIterable.instance();
- }
- return result;
- }
-
-
- // ***** XmlAccessorType *****
-
- public XmlAccessType getAccessType() {
- return (this.specifiedAccessType != null) ? this.specifiedAccessType : this.defaultAccessType;
- }
-
- public XmlAccessType getDefaultAccessType() {
- return this.defaultAccessType;
- }
-
- protected void setDefaultAccessType_(XmlAccessType access) {
- XmlAccessType old = this.defaultAccessType;
- this.defaultAccessType = access;
- firePropertyChanged(DEFAULT_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- public XmlAccessType getSpecifiedAccessType() {
- return this.specifiedAccessType;
- }
-
- public void setSpecifiedAccessType(XmlAccessType access) {
- getXmlAccessorTypeAnnotation().setValue(XmlAccessType.toJavaResourceModel(access));
- setSpecifiedAccessType_(access);
- }
-
- protected void setSpecifiedAccessType_(XmlAccessType access) {
- XmlAccessType old = this.specifiedAccessType;
- this.specifiedAccessType = access;
- firePropertyChanged(SPECIFIED_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- protected void initDefaultAccessType() {
- this.defaultAccessType = buildDefaultAccessType();
- }
-
- protected void updateDefaultAccessType() {
- setDefaultAccessType_(buildDefaultAccessType());
- }
-
- /**
- * Default access type is determined by the following, in order of precedence:
- * - @XmlAccessorType annotation on a mapped super class
- * - @XmlAccessorType annotation on the package
- * - default access type of {@link PUBLIC_MEMBER}
- */
- protected XmlAccessType buildDefaultAccessType() {
- XmlAccessType accessType = getSuperclassAccessType();
- if (accessType != null) {
- return accessType;
- }
- accessType = getPackageAccessType();
- if (accessType != null) {
- return accessType;
- }
- return XmlAccessType.PUBLIC_MEMBER;
- }
-
- protected XmlAccessType getSuperclassAccessType() {
- return this.superclass == null ? null : this.superclass.getSpecifiedAccessType();
- }
-
- protected XmlAccessType getPackageAccessType() {
- JaxbPackageInfo packageInfo = getPackageInfo();
- return (packageInfo == null) ? null : packageInfo.getAccessType();
- }
-
- protected XmlAccessorTypeAnnotation getXmlAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE);
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(getXmlAccessorTypeAnnotation().getValue());
- }
-
- protected void initSpecifiedAccessType() {
- this.specifiedAccessType = getResourceAccessType();
- }
-
- protected void syncSpecifiedAccessType() {
- setSpecifiedAccessType_(getResourceAccessType());
- }
-
-
- // ***** XmlAccessorOrder *****
-
- public XmlAccessOrder getAccessOrder() {
- return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : this.defaultAccessOrder;
- }
-
- public XmlAccessOrder getDefaultAccessOrder() {
- return this.defaultAccessOrder;
- }
-
- protected void setDefaultAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.defaultAccessOrder;
- this.defaultAccessOrder = accessOrder;
- firePropertyChanged(DEFAULT_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- public XmlAccessOrder getSpecifiedAccessOrder() {
- return this.specifiedAccessOrder;
- }
-
- public void setSpecifiedAccessOrder(XmlAccessOrder accessOrder) {
- getXmlAccessorOrderAnnotation().setValue(XmlAccessOrder.toJavaResourceModel(accessOrder));
- setSpecifiedAccessOrder_(accessOrder);
- }
-
- protected void setSpecifiedAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.specifiedAccessOrder;
- this.specifiedAccessOrder = accessOrder;
- firePropertyChanged(SPECIFIED_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- protected void initDefaultAccessOrder() {
- this.defaultAccessOrder = buildDefaultAccessOrder();
- }
-
- protected void updateDefaultAccessOrder() {
- setDefaultAccessOrder_(buildDefaultAccessOrder());
- }
-
- /**
- * Default access order is determined by the following, in order of precedence:
- * - @XmlAccessorOrder annotation on a mapped super class
- * - @XmlAccessorOrder annotation on the package
- * - default access order of {@link UNDEFINED}
- */
- protected XmlAccessOrder buildDefaultAccessOrder() {
- XmlAccessOrder accessOrder = getSuperclassAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- accessOrder = getPackageAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- return XmlAccessOrder.UNDEFINED;
- }
-
- protected XmlAccessOrder getSuperclassAccessOrder() {
- JaxbClassMapping superclass = this.superclass;
- while (superclass != null) {
- XmlAccessOrder accessOrder = superclass.getSpecifiedAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- superclass = superclass.getSuperclass();
- }
- return null;
- }
-
- protected XmlAccessOrder getPackageAccessOrder() {
- JaxbPackageInfo packageInfo = getPackageInfo();
- return packageInfo == null ? null : packageInfo.getAccessOrder();
- }
-
- protected XmlAccessorOrderAnnotation getXmlAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER);
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(getXmlAccessorOrderAnnotation().getValue());
- }
-
- protected void initSpecifiedAccessOrder() {
- this.specifiedAccessOrder = getResourceAccessOrder();
- }
-
- protected void syncSpecifiedAccessOrder() {
- setSpecifiedAccessOrder_(getResourceAccessOrder());
- }
-
-
- // ********** super class **********
-
- public JaxbClassMapping getSuperclass() {
- return this.superclass;
- }
-
- protected void setSuperclass_(JaxbClassMapping superclass) {
- JaxbClassMapping old = this.superclass;
- this.superclass = superclass;
- this.firePropertyChanged(SUPERCLASS_PROPERTY, old, superclass);
- }
-
- protected void updateSuperclass() {
- setSuperclass_(findSuperclass());
- }
-
- protected JaxbClassMapping findSuperclass() {
- JavaResourceType resourceType = getSuperclass(getJavaResourceType());
- while (resourceType != null && resourceType != this) {
- JaxbType jaxbType = getJaxbProject().getContextRoot().getType(resourceType.getQualifiedName());
-
- // if the superclass is not a class, return null
- if (jaxbType == null || jaxbType.getKind() != JaxbType.Kind.CLASS) {
- return null;
- }
-
- JaxbClassMapping jaxbClassMapping = ((JaxbClass) jaxbType).getMapping();
- // rare for a non-null superclass to not be mapped, but potentially possible mid-update
- if (jaxbClassMapping != null) {
- return jaxbClassMapping;
- }
- else {
- resourceType = getSuperclass(resourceType);
- }
- }
- return null;
- }
-
- protected JavaResourceType getSuperclass(JavaResourceType resourceType) {
- String superclassName = resourceType.getSuperclassQualifiedName();
- if (superclassName == null) {
- return null;
- }
-
- return (JavaResourceType) getJaxbProject().getJavaResourceType(
- superclassName, JavaResourceType.Kind.TYPE);
- }
-
-
- // ***** attributes *****
-
- public Iterable<JaxbPersistentAttribute> getAttributes() {
- return this.attributesContainer.getAttributes();
- }
-
- public int getAttributesSize() {
- return this.attributesContainer.getAttributesSize();
- }
-
- protected GenericJavaAttributesContainer.Owner buildAttributesContainerOwner() {
- return new GenericJavaAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaClassMapping.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemAdded(ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemRemoved(ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
-
- // ***** included attributes *****
-
- public Iterable<JaxbPersistentAttribute> getIncludedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(getIncludedAttributeSets());
- }
-
- protected Iterable<Iterable<JaxbPersistentAttribute>> getIncludedAttributeSets() {
- return new TransformationIterable<JaxbAttributesContainer, Iterable<JaxbPersistentAttribute>>(
- getIncludedAttributesContainers()) {
- @Override
- protected Iterable<JaxbPersistentAttribute> transform(JaxbAttributesContainer attributesContainer) {
- return attributesContainer.getAttributes();
- }
- };
- }
-
- protected Iterable<JaxbAttributesContainer> getIncludedAttributesContainers() {
- return new LiveCloneIterable<JaxbAttributesContainer>(this.includedAttributesContainers.values()); // read-only
- }
-
- public int getIncludedAttributesSize() {
- int size = 0;
- for (JaxbAttributesContainer attributesContainer : getIncludedAttributesContainers()) {
- size += attributesContainer.getAttributesSize();
- }
- return size;
- }
-
- protected void initIncludedAttributes() {
- // xml transient classes have no included attributes
- if (isXmlTransient()) {
- return;
- }
- JaxbClassMapping superclass = this.superclass;
- // only add inherited attributes for superclasses up until a mapped class is encountered
- while (superclass != null && superclass.isXmlTransient()) {
- this.includedAttributesContainers.put(superclass, buildIncludedAttributesContainer(superclass));
- superclass = superclass.getSuperclass();
- }
- }
-
- protected void syncIncludedAttributes() {
- for (JaxbAttributesContainer attributesContainer : this.includedAttributesContainers.values()) {
- attributesContainer.synchronizeWithResourceModel();
- }
- }
-
- protected void updateIncludedAttributes() {
- HashSet<JaxbClassMapping> oldSuperclasses
- = CollectionTools.set(this.includedAttributesContainers.keySet());
- Set<JaxbPersistentAttribute> oldAttributes = CollectionTools.set(getIncludedAttributes());
-
- if (! isXmlTransient()) {
- JaxbClassMapping superclass = this.superclass;
- // only add inherited attributes for superclasses up until a mapped class is encountered
- while (superclass != null && superclass.isXmlTransient()) {
- if (this.includedAttributesContainers.containsKey(superclass)) {
- this.includedAttributesContainers.get(superclass).update();
- oldSuperclasses.remove(superclass);
- }
- else {
- this.includedAttributesContainers.put(superclass, buildIncludedAttributesContainer(superclass));
- }
- superclass = superclass.getSuperclass();
- }
- }
-
- for (JaxbClassMapping oldSuperclass : oldSuperclasses) {
- this.includedAttributesContainers.remove(oldSuperclass);
- }
-
- Set<JaxbPersistentAttribute> newAttributes = CollectionTools.set(getIncludedAttributes());
- if (CollectionTools.elementsAreDifferent(oldAttributes, newAttributes)) {
- fireCollectionChanged(INCLUDED_ATTRIBUTES_COLLECTION, newAttributes);
- }
- }
-
- protected JaxbAttributesContainer buildIncludedAttributesContainer(JaxbClassMapping jaxbClassMapping) {
- return new GenericJavaAttributesContainer(this, buildIncludedAttributesContainerOwner(), jaxbClassMapping.getJaxbType().getJavaResourceType());
- }
-
- protected GenericJavaAttributesContainer.Owner buildIncludedAttributesContainerOwner() {
- return new GenericJavaAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaClassMapping.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemAdded(INCLUDED_ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemRemoved(INCLUDED_ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
-
- // ***** misc attributes *****
-
- public Iterable<JaxbPersistentAttribute> getAllLocallyDefinedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getAttributes(),
- getIncludedAttributes());
- }
-
- public Iterable<JaxbPersistentAttribute> getInheritedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getIncludedAttributes(),
- getOtherInheritedAttributes());
- }
-
- /**
- * return those inherited attributes that are not included
- */
- protected Iterable<JaxbPersistentAttribute> getOtherInheritedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- new TransformationIterable<JaxbClassMapping, Iterable<JaxbPersistentAttribute>>(
- new ChainIterable<JaxbClassMapping>(getSuperclass()) {
- @Override
- protected JaxbClassMapping nextLink(JaxbClassMapping currentLink) {
- return currentLink.getSuperclass();
- }
- }) {
- @Override
- protected Iterable<JaxbPersistentAttribute> transform(JaxbClassMapping o) {
- return o.getAttributes();
- }
- });
- }
-
-
- // ***** subClasses *****
-
- @Override
- public boolean hasRootElementInHierarchy() {
- if (! this.hasRootElementInHierarchy_loaded) {
- this.hasRootElementInHierarchy = calculateHasRootElementInHierarchy();
- this.hasRootElementInHierarchy_loaded = true;
- }
- return this.hasRootElementInHierarchy;
- }
-
- protected boolean calculateHasRootElementInHierarchy() {
- if (this.getXmlRootElement() != null) {
- return true;
- }
-
- for (JaxbType jaxbType : getJaxbProject().getContextRoot().getTypes()) {
- if (jaxbType.getMapping() != null
- && ! jaxbType.getMapping().isXmlTransient()
- && jaxbType.getMapping().getXmlRootElement() != null
- && JDTTools.typeIsSubType(
- getJaxbProject().getJavaProject(),
- jaxbType.getFullyQualifiedName(), getJaxbType().getFullyQualifiedName())) {
- return true;
- }
- }
-
- return false;
- }
-
-
- // ***** misc *****
-
- @Override
- protected Iterable<String> getTransientReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getJavaResourceType().getSuperclassQualifiedName()));
- }
-
- @Override
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getNonTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getJavaResourceType().getSuperclassQualifiedName()),
- new CompositeIterable<String>(
- new TransformationIterable<JaxbPersistentAttribute, Iterable<String>>(getAttributes()) {
- @Override
- protected Iterable<String> transform(JaxbPersistentAttribute o) {
- return o.getMapping().getReferencedXmlTypeNames();
- }
- }));
- }
-
- public JaxbAttributeMapping getXmlIdMapping() {
- Iterator<JaxbBasicMapping> idMappings = getBasicMappingsWithXmlID().iterator();
- return (idMappings.hasNext()) ? idMappings.next() : null;
- }
-
- protected Iterable<JaxbBasicMapping> getBasicMappingsWithXmlID(){
- return new FilteringIterable<JaxbBasicMapping>(getBasicMappings()){
- @Override
- protected boolean accept(JaxbBasicMapping basicMapping) {
- return basicMapping.getXmlID() != null;
- }
- };
- }
-
- protected Iterable<JaxbBasicMapping> getBasicMappings() {
- return new SubIterableWrapper<JaxbAttributeMapping, JaxbBasicMapping>(getBasicMappings_());
- }
-
- protected Iterable<JaxbAttributeMapping> getBasicMappings_(){
- return new FilteringIterable<JaxbAttributeMapping>(getAttributeMappings()){
- @Override
- protected boolean accept(JaxbAttributeMapping attributeMapping) {
- return (attributeMapping.getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY
- || attributeMapping.getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- }
- };
- }
-
- protected Iterable<? extends JaxbAttributeMapping> getAttributeMappings() {
- return new TransformationIterable<JaxbPersistentAttribute, JaxbAttributeMapping>(getAttributes()) {
- @Override
- protected JaxbAttributeMapping transform(JaxbPersistentAttribute attribute) {
- return attribute.getMapping();
- }
- };
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (propTouches(pos, astRoot)) {
- return getPropProposals(filter);
- }
-
- // TODO - factory methods?
-
- for (JaxbPersistentAttribute attribute : this.getAttributes()) {
- result = attribute.getJavaCompletionProposals(pos, filter, astRoot);
- if (!CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getPropProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<JaxbPersistentAttribute, String>(getAllLocallyDefinedAttributes()) {
- @Override
- protected String transform(JaxbPersistentAttribute o) {
- return o.getName();
- }
- },
- filter));
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // TODO - factory method?
-
- validatePropOrder(messages, reporter, astRoot);
-
- validateXmlAnyAttributeMapping(messages, astRoot);
- validateXmlAnyElementMapping(messages, astRoot);
- validateXmlValueMapping(messages, astRoot);
- validateXmlIDs(messages, astRoot);
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- attribute.validate(messages, reporter, astRoot);
- }
- }
-
- public void validatePropOrder(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (CollectionTools.isEmpty(getPropOrder())) {
- return;
- }
-
- // no duplicates
- // all attributes/included attributes with XmlElement/s/Ref/s must be listed
- // no nonexistent attributes (attributes mapped otherwise allowed) ...
- // *except* no transient attributes allowed
-
- Bag<String> props = CollectionTools.bag(getPropOrder());
- Set<String> allAttributes = new HashSet<String>();
- Set<String> requiredAttributes = new HashSet<String>();
- Set<String> transientAttributes = new HashSet<String>();
-
- for (JaxbPersistentAttribute attribute : getAllLocallyDefinedAttributes()) {
- allAttributes.add(attribute.getName());
-
- if (attribute.getMapping().isParticleMapping()) {
- requiredAttributes.add(attribute.getName());
- }
-
- if (attribute.getMapping().isTransient()) {
- transientAttributes.add(attribute.getName());
- }
- }
-
- Set<Integer> duplicateProps = new HashSet<Integer>();
- Set<String> missingProps = new HashSet<String>(requiredAttributes);
- Set<Integer> nonexistentProps = new HashSet<Integer>();
- Set<Integer> transientProps = new HashSet<Integer>();
-
- for (int i = 0; i < getPropOrderSize(); i ++ ) {
- String prop = getProp(i);
-
- if (props.count(prop) > 1) {
- duplicateProps.add(i);
- }
-
- if (missingProps.contains(prop)) {
- missingProps.remove(prop);
- }
-
- if (! allAttributes.contains(prop)) {
- nonexistentProps.add(i);
- }
-
- if (transientAttributes.contains(prop)) {
- transientProps.add(i);
- }
- }
-
- for (int i : duplicateProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__DUPLICATE_PROP,
- new String[] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
-
- for (String missingProp : missingProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__MISSING_PROP,
- new String[] { missingProp },
- this,
- getPropOrderTextRange(astRoot)));
- }
-
- for (int i : nonexistentProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__NONEXISTENT_PROP,
- new String[] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
-
- for (int i : transientProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__TRANSIENT_PROP,
- new String [] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
- }
-
- protected void validateXmlAnyAttributeMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlAnyElementMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlValueMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlIDs(List<IMessage> messages, CompilationUnit astRoot) {
-
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if ((attribute.getMappingKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY
- || attribute.getMappingKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY)
- && ((JaxbBasicMapping) attribute.getMapping()).getXmlID() != null) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if ((attribute.getMappingKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY
- || attribute.getMappingKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY)
- && ((JaxbBasicMapping) attribute.getMapping()).getXmlID() != null) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getPropOrderTextRange(astRoot);
- return (result != null) ? result : getValidationTextRange(astRoot);
- }
-
- protected TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getXmlTypeAnnotation().getPropTextRange(index, astRoot);
- }
-
- protected boolean propTouches(int pos, CompilationUnit astRoot) {
- if (getXmlTypeAnnotation().propOrderTouches(pos, astRoot)) {
- for (int i = 0; i < getXmlTypeAnnotation().getPropOrderSize(); i ++ ) {
- if (getXmlTypeAnnotation().propTouches(i, pos, astRoot)) {
- return true;
- }
- }
- }
- return false;
- }
-
-
- /**
- * xml prop order container
- */
- protected class PropOrderContainer
- extends ListContainer<String, String> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return PROP_ORDER_LIST;
- }
-
- @Override
- protected String buildContextElement(String resourceElement) {
- return resourceElement;
- }
-
- @Override
- protected ListIterable<String> getResourceElements() {
- return GenericJavaClassMapping.this.getResourcePropOrder();
- }
-
- @Override
- protected String getResourceElement(String contextElement) {
- return contextElement;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
deleted file mode 100644
index 375ff625d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaElementFactoryMethod
- extends AbstractJavaContextNode
- implements JaxbElementFactoryMethod {
-
- protected final JavaResourceMethod resourceMethod;
-
- protected String scope;
-
- protected JaxbQName qName;
-
- protected JaxbQName substitutionHeadQName;
-
- protected String defaultValue;
-
-
- public GenericJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod) {
- super(parent);
- this.resourceMethod = resourceMethod;
- this.scope = getResourceScope();
- this.qName = buildQName();
- this.substitutionHeadQName = buildSubstitutionHeadQName();
- this.defaultValue = this.getResourceDefaultValue();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlElementDeclQName(this);
- }
-
- protected JaxbQName buildSubstitutionHeadQName() {
- return new XmlElementDeclSubstitutionHeadQName(this);
- }
-
- protected XmlRegistry getRegistry() {
- return (XmlRegistry) getParent();
- }
-
- public JavaResourceMethod getResourceMethod() {
- return this.resourceMethod;
- }
-
- protected XmlElementDeclAnnotation getXmlElementDeclAnnotation() {
- return (XmlElementDeclAnnotation) getResourceMethod().getAnnotation(JAXB.XML_ELEMENT_DECL);
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setScope_(getResourceScope());
- this.qName.synchronizeWithResourceModel();
- this.substitutionHeadQName.synchronizeWithResourceModel();
- setDefaultValue_(getResourceDefaultValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- this.substitutionHeadQName.update();
- }
-
-
- // ***** JaxbElementFactoryMethod impl *****
-
- public String getName() {
- return this.resourceMethod.getName();
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- protected void setScope_(String scope) {
- String old = this.scope;
- this.scope = scope;
- firePropertyChanged(SCOPE_PROPERTY, old, scope);
- }
-
- public void setScope(String scope) {
- getXmlElementDeclAnnotation().setScope(scope);
- setScope_(scope);
- }
-
- protected String getResourceScope() {
- return getXmlElementDeclAnnotation().getScope();
- }
-
- public String getFullyQualifiedScope() {
- return (this.scope == null) ? DEFAULT_SCOPE_CLASS_NAME : getXmlElementDeclAnnotation().getFullyQualifiedScopeClassName();
- }
-
- public boolean isGlobalScope() {
- return DEFAULT_SCOPE_CLASS_NAME.equals(getFullyQualifiedScope());
- }
-
-
- // ***** qname *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- // ***** substitution head qname *****
-
- public JaxbQName getSubstitutionHeadQName() {
- return this.substitutionHeadQName;
- }
-
-
- // ***** default value *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- public void setDefaultValue(String defaultValue) {
- getXmlElementDeclAnnotation().setDefaultValue(defaultValue);
- setDefaultValue_(defaultValue);
- }
-
- protected String getResourceDefaultValue() {
- return getXmlElementDeclAnnotation().getDefaultValue();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.substitutionHeadQName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlElementDeclAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.qName.validate(messages, reporter, astRoot);
- this.substitutionHeadQName.validate(messages, reporter, astRoot);
-
- JavaResourceMethod resourceMethod = getResourceMethod();
- if (! JAXB.JAXB_ELEMENT.equals(resourceMethod.getTypeName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- if (resourceMethod.getParametersSize() != 1 ||
- ! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), resourceMethod.getParameterTypeName(0), Object.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
-
- protected class XmlElementDeclQName
- extends AbstractJavaQName {
-
- protected XmlElementDeclQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- return GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getNamespace();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- if (! GenericJavaElementFactoryMethod.this.isGlobalScope()) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType != null) {
- return xsdType.getElementNameProposals(getNamespace(), filter, true);
- }
- }
- }
-
- XsdSchema xsdSchema = GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getXsdSchema();
- if (xsdSchema != null) {
- return xsdSchema.getElementNameProposals(getNamespace(), filter);
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema xsdSchema = GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getXsdSchema();
- return (xsdSchema == null) ? EmptyIterable.<String>instance() : xsdSchema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (! GenericJavaElementFactoryMethod.this.isGlobalScope()) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType == null) {
- return;
- }
-
- if (xsdType.getElement(getNamespace(), getName(), true) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- else {
- XsdSchema xsdSchema = GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getXsdSchema();
- if (xsdSchema != null) {
- if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaElementFactoryMethod.this.getXmlElementDeclAnnotation();
- }
- }
-
-
- protected class XmlElementDeclSubstitutionHeadQName
- extends AbstractJavaQName {
-
- protected XmlElementDeclSubstitutionHeadQName(JavaContextNode parent) {
- super(parent, new SubstitutionHeadQNameAnnotationProxy());
- }
-
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- return GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getNamespace();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType != null) {
- return xsdType.getElementNameProposals(getNamespace(), filter);
- }
- }
-
- XsdSchema xsdSchema = GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getXsdSchema();
- if (xsdSchema != null) {
- return xsdSchema.getElementNameProposals(getNamespace(), filter);
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema xsdSchema = GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getXsdSchema();
- return (xsdSchema == null) ? EmptyIterable.<String>instance() : xsdSchema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.SUBSTITUTION_HEAD_DESC;
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // need to ignore the unspecified (null) case
- if ("".equals(getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__MISSING_NAME,
- new String[] { getReferencedComponentTypeDescription() },
- this,
- getNameTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(getName())) {
- if (Tools.valuesAreEqual(getName(), GenericJavaElementFactoryMethod.this.getQName().getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME,
- this,
- getNameTextRange(astRoot)));
- }
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdSchema xsdSchema = GenericJavaElementFactoryMethod.this.getRegistry().getJaxbPackage().getXsdSchema();
- if (xsdSchema != null) {
- if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
-
- for (JaxbElementFactoryMethod elementDecl : GenericJavaElementFactoryMethod.this.getRegistry().getElementFactoryMethods()) {
- if (Tools.valuesAreEqual(getName(), elementDecl.getSubstitutionHeadQName().getName())
- && Tools.valuesAreEqual(getNamespace(), elementDecl.getSubstitutionHeadQName().getNamespace())) {
- return;
- }
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL,
- new String[] { getNamespace(), getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
-
- protected class SubstitutionHeadQNameAnnotationProxy
- implements AbstractJavaQName.AnnotationProxy {
-
- protected XmlElementDeclAnnotation getAnnotation() {
- return GenericJavaElementFactoryMethod.this.getXmlElementDeclAnnotation();
- }
-
- public String getNamespace() {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return annotation == null ? null : annotation.getSubstitutionHeadNamespace();
- }
-
- public void setNamespace(String newSpecifiedNamespace) {
- getAnnotation().setSubstitutionHeadNamespace(newSpecifiedNamespace);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNamespaceTouches(pos, astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNamespaceTextRange(astRoot);
- }
-
- public String getName() {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return annotation == null ? null : annotation.getSubstitutionHeadName();
- }
-
- public void setName(String newSpecifiedName) {
- getAnnotation().setSubstitutionHeadName(newSpecifiedName);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNameTouches(pos, astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNameTextRange(astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
deleted file mode 100644
index fcfebe0488..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaEnumConstant
- extends AbstractJavaContextNode
- implements JaxbEnumConstant {
-
- final protected JavaResourceEnumConstant resourceEnumConstant;
-
- protected String specifiedValue;
-
- public GenericJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant) {
- super(parent);
- this.resourceEnumConstant = resourceEnumConstant;
- this.specifiedValue = this.getResourceEnumValue();
- }
-
-
- protected JaxbEnumMapping getEnumMapping() {
- return (JaxbEnumMapping) getParent();
- }
-
- public JavaResourceEnumConstant getResourceEnumConstant() {
- return this.resourceEnumConstant;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedValue_(this.getResourceEnumValue());
- }
-
-
- // ********** xml enum value annotation **********
-
- protected XmlEnumValueAnnotation getXmlEnumValueAnnotation() {
- return (XmlEnumValueAnnotation) this.getResourceEnumConstant().getNonNullAnnotation(JAXB.XML_ENUM_VALUE);
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.resourceEnumConstant.getName();
- }
-
- // ********** value **********
-
- public String getValue() {
- return this.getSpecifiedValue() != null ? this.getSpecifiedValue() : this.getDefaultValue();
- }
-
- public String getDefaultValue() {
- return this.getName();
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String value) {
- this.getXmlEnumValueAnnotation().setValue(value);
- this.setSpecifiedValue_(value);
- }
-
- protected void setSpecifiedValue_(String value) {
- String old = this.specifiedValue;
- this.specifiedValue = value;
- this.firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, value);
- }
-
- protected String getResourceEnumValue() {
- return this.getXmlEnumValueAnnotation().getValue();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (valueTouches(pos, astRoot)) {
- XsdTypeDefinition xsdType = getEnumMapping().getXsdTypeDefinition();
- if (xsdType != null && xsdType.getKind() == XsdTypeDefinition.Kind.SIMPLE) {
- XsdSimpleTypeDefinition xsdSimpleType = (XsdSimpleTypeDefinition) xsdType;
- return xsdSimpleType.getEnumValueProposals(filter);
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean valueTouches(int pos, CompilationUnit astRoot) {
- return getXmlEnumValueAnnotation().valueTouches(pos, astRoot);
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String value = getValue();
- XsdTypeDefinition xsdType = getEnumMapping().getXsdTypeDefinition();
-
- if (xsdType == null || xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- return;
- }
-
- if (! ((XsdSimpleTypeDefinition) xsdType).getXSDComponent().isValidLiteral(value)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ENUM_VALUE__INVALID_LEXICAL_VALUE,
- new String[] { value, xsdType.getName() },
- this,
- getValueTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceEnumConstant().getTextRange(astRoot);
- }
-
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
- return getXmlEnumValueAnnotation().getValueTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
deleted file mode 100644
index e664e53b6e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaEnumMapping
- extends AbstractJavaTypeMapping
- implements JaxbEnumMapping {
-
- protected String specifiedXmlEnumValue;
-
- protected final EnumConstantContainer enumConstantContainer;
-
-
- public GenericJavaEnumMapping(JaxbEnum parent) {
- super(parent);
- this.enumConstantContainer = new EnumConstantContainer();
-
- initXmlEnumValue();
- initEnumConstants();
- }
-
-
- @Override
- public JavaResourceEnum getJavaResourceType() {
- return (JavaResourceEnum) super.getJavaResourceType();
- }
-
-
- // ********** sync/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlEnumValue();
- syncEnumConstants();
- }
-
- @Override
- public void update() {
- super.update();
- updateEnumConstants();
- }
-
-
- // ***** XmlEnum.value *****
-
- public String getXmlEnumValue() {
- return (this.specifiedXmlEnumValue != null) ? this.specifiedXmlEnumValue : DEFAULT_XML_ENUM_VALUE;
- }
-
- public String getSpecifiedXmlEnumValue() {
- return this.specifiedXmlEnumValue;
- }
-
- public void setSpecifiedXmlEnumValue(String xmlEnumValue) {
- getXmlEnumAnnotation().setValue(xmlEnumValue);
- setSpecifiedXmlEnumValue_(xmlEnumValue);
- }
-
- protected void setSpecifiedXmlEnumValue_(String xmlEnumValue) {
- String old = this.specifiedXmlEnumValue;
- this.specifiedXmlEnumValue = xmlEnumValue;
- firePropertyChanged(SPECIFIED_XML_ENUM_VALUE_PROPERTY, old, xmlEnumValue);
- }
-
- public String getFullyQualifiedXmlEnumValue() {
- return (this.specifiedXmlEnumValue != null) ?
- getXmlEnumAnnotation().getFullyQualifiedValueClassName()
- : DEFAULT_XML_ENUM_VALUE;
- }
-
- protected XmlEnumAnnotation getXmlEnumAnnotation() {
- return (XmlEnumAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ENUM);
- }
-
- protected String getResourceXmlEnumValue() {
- return getXmlEnumAnnotation().getValue();
- }
-
- protected void initXmlEnumValue() {
- this.specifiedXmlEnumValue = getResourceXmlEnumValue();
- }
-
- protected void syncXmlEnumValue() {
- setSpecifiedXmlEnumValue_(getResourceXmlEnumValue());
- }
-
-
- // ***** enum constants *****
-
- public Iterable<JaxbEnumConstant> getEnumConstants() {
- return this.enumConstantContainer.getContextElements();
- }
-
- public int getEnumConstantsSize() {
- return this.enumConstantContainer.getContextElementsSize();
- }
-
- protected void initEnumConstants() {
- this.enumConstantContainer.initialize();
- }
-
- protected void syncEnumConstants() {
- this.enumConstantContainer.synchronizeWithResourceModel();
- }
-
- protected void updateEnumConstants() {
- this.enumConstantContainer.update();
- }
-
- protected Iterable<JavaResourceEnumConstant> getResourceEnumConstants() {
- return getJavaResourceType().getEnumConstants();
- }
-
- private JaxbEnumConstant buildEnumConstant(JavaResourceEnumConstant resourceEnumConstant) {
- return getFactory().buildJavaEnumConstant(this, resourceEnumConstant);
- }
-
-
- // ***** misc *****
-
- @Override
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- if (this.specifiedXmlEnumValue != null) {
- return new CompositeIterable<String>(
- super.getNonTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getFullyQualifiedXmlEnumValue()));
- }
- return super.getNonTransientReferencedXmlTypeNames();
- }
-
- public XsdSimpleTypeDefinition getValueXsdTypeDefinition() {
- XsdTypeDefinition xsdType = getValueXsdTypeDefinition_();
- if (xsdType == null || xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- return null;
- }
- return (XsdSimpleTypeDefinition) xsdType;
- }
-
- protected XsdTypeDefinition getValueXsdTypeDefinition_() {
- String fqXmlEnumValue = getFullyQualifiedXmlEnumValue();
-
- JaxbType jaxbType = getContextRoot().getType(fqXmlEnumValue);
- if (jaxbType != null) {
- JaxbTypeMapping typeMapping = jaxbType.getMapping();
- if (typeMapping != null) {
- return typeMapping.getXsdTypeDefinition();
- }
- }
- else {
- String typeMapping = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(fqXmlEnumValue);
- if (typeMapping != null) {
- XsdSchema xsdSchema = XsdUtil.getSchemaForSchema();
- return xsdSchema.getTypeDefinition(typeMapping);
- }
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (JaxbEnumConstant constant : getEnumConstants()) {
- result = constant.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateXmlType(messages, reporter, astRoot);
- validateXmlEnum(messages, reporter, astRoot);
-
- for (JaxbEnumConstant constant : getEnumConstants()) {
- constant.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XmlTypeAnnotation annotation = getXmlTypeAnnotation();
-
- if (annotation.getFactoryClass() != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM,
- this,
- annotation.getFactoryClassTextRange(astRoot)));
- }
-
- if (annotation.getFactoryMethod() != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM,
- this,
- annotation.getFactoryMethodTextRange(astRoot)));
- }
-
- if (! CollectionTools.isEmpty(annotation.getPropOrder())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM,
- this,
- annotation.getPropOrderTextRange(astRoot)));
- }
- }
-
- protected void validateXmlEnum(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdSchema xsdSchema = getJaxbPackage().getXsdSchema();
- XsdTypeDefinition xsdType = getValueXsdTypeDefinition_();
-
- if ((xsdSchema != null && xsdType == null)
- || (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ENUM__NON_SIMPLE_SCHEMA_TYPE,
- new String[] { getFullyQualifiedXmlEnumValue() },
- this,
- getXmlEnumValueTextRange(astRoot)));
- }
- }
-
- protected TextRange getXmlEnumValueTextRange(CompilationUnit astRoot) {
- return getXmlEnumAnnotation().getValueTextRange(astRoot);
- }
-
-
- /**
- * enum constant container adapter
- */
- protected class EnumConstantContainer
- extends ContextCollectionContainer<JaxbEnumConstant, JavaResourceEnumConstant> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return ENUM_CONSTANTS_COLLECTION;
- }
-
- @Override
- protected JaxbEnumConstant buildContextElement(JavaResourceEnumConstant resourceElement) {
- return GenericJavaEnumMapping.this.buildEnumConstant(resourceElement);
- }
-
- @Override
- protected Iterable<JavaResourceEnumConstant> getResourceElements() {
- return GenericJavaEnumMapping.this.getResourceEnumConstants();
- }
-
- @Override
- protected JavaResourceEnumConstant getResourceElement(JaxbEnumConstant contextElement) {
- return contextElement.getResourceEnumConstant();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java
deleted file mode 100644
index 05a0a9d496..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaJaxbClass
- extends AbstractJavaType
- implements JaxbClass {
-
- protected XmlRegistry xmlRegistry;
-
-
- public GenericJavaJaxbClass(JaxbContextNode parent, JavaResourceType resourceType) {
- super(parent, resourceType);
- initXmlRegistry();
- }
-
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- public Kind getKind() {
- return JaxbType.Kind.CLASS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlRegistry();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlRegistry();
- }
-
-
- // ***** mapping *****
-
- @Override
- public JaxbClassMapping getMapping() {
- return (JaxbClassMapping) super.getMapping();
- }
-
- @Override
- protected JaxbClassMapping buildMapping() {
- return getFactory().buildJaxbClassMapping(this);
- }
-
- @Override
- protected boolean isSpecifiedMapped() {
- return getXmlTypeAnnotation() != null
- || getXmlRootElementAnnotation() != null
- || getXmlTransientAnnotation() != null;
- }
-
-
- // ***** XmlRegistry *****
-
- public XmlRegistry getXmlRegistry() {
- return this.xmlRegistry;
- }
-
- protected void setXmlRegistry_(XmlRegistry xmlRegistry) {
- XmlRegistry old = this.xmlRegistry;
- this.xmlRegistry = xmlRegistry;
- firePropertyChanged(XML_REGISTRY_PROPERTY, old, xmlRegistry);
- }
-
- protected XmlRegistryAnnotation getXmlRegistryAnnotation() {
- return (XmlRegistryAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_REGISTRY);
- }
-
- protected XmlRegistry buildXmlRegistry() {
- return getFactory().buildXmlRegistry(this);
- }
-
- protected void initXmlRegistry() {
- if (getXmlRegistryAnnotation() != null) {
- this.xmlRegistry = buildXmlRegistry();
- }
- }
-
- protected void syncXmlRegistry() {
- XmlRegistryAnnotation annotation = getXmlRegistryAnnotation();
- if (annotation != null) {
- if (this.xmlRegistry != null) {
- this.xmlRegistry.synchronizeWithResourceModel();
- }
- else {
- setXmlRegistry_(buildXmlRegistry());
- }
- }
- else if (this.xmlRegistry != null) {
- setXmlRegistry_(null);
- }
- }
-
- protected void updateXmlRegistry() {
- if (this.xmlRegistry != null) {
- this.xmlRegistry.update();
- }
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlRegistry != null) {
- this.xmlRegistry.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java
deleted file mode 100644
index 3cf53874dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-
-public class GenericJavaJaxbEnum
- extends AbstractJavaType
- implements JaxbEnum {
-
- public GenericJavaJaxbEnum(JaxbContextNode parent, JavaResourceEnum resourceType) {
- super(parent, resourceType);
- }
-
-
- @Override
- public JavaResourceEnum getJavaResourceType() {
- return (JavaResourceEnum) super.getJavaResourceType();
- }
-
- public Kind getKind() {
- return JaxbType.Kind.ENUM;
- }
-
-
- // ***** mapping *****
-
- @Override
- public JaxbEnumMapping getMapping() {
- return (JaxbEnumMapping) super.getMapping();
- }
-
- @Override
- protected JaxbEnumMapping buildMapping() {
- return getFactory().buildJaxbEnumMapping(this);
- }
-
- @Override
- protected boolean isSpecifiedMapped() {
- return super.isSpecifiedMapped()
- || getXmlEnumAnnotation() != null;
- }
-
- protected XmlEnumAnnotation getXmlEnumAnnotation() {
- return (XmlEnumAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ENUM);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java
deleted file mode 100644
index 190d888858..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-public class GenericJavaNullAttributeMapping
- extends AbstractJavaAttributeMapping<Annotation> {
-
- public GenericJavaNullAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public String getAnnotationName() {
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java
deleted file mode 100644
index 2184e7ba08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageInfo
- extends AbstractJavaContextNode
- implements JaxbPackageInfo {
-
- protected final JavaResourcePackage resourcePackage;
-
- protected final XmlSchema xmlSchema;
-
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder specifiedAccessOrder;
-
- protected final ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation> xmlSchemaTypeContainer;
-
- protected final ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapterContainer;
-
- public GenericJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage) {
- super(parent);
- this.resourcePackage = resourcePackage;
- this.xmlSchema = getFactory().buildJavaXmlSchema(this);
- this.specifiedAccessType = getResourceAccessType();
- this.specifiedAccessOrder = getResourceAccessOrder();
- this.xmlSchemaTypeContainer = this.buildXmlSchemaTypeContainer();
- this.xmlJavaTypeAdapterContainer = this.buildXmlJavaTypeAdapterContainer();
- }
-
- @Override
- public JaxbPackage getParent() {
- return (JaxbPackage) super.getParent();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getParent();
- }
-
-
- // **************** AbstractJaxbNode impl *********************************
-
- @Override
- public IResource getResource() {
- return this.resourcePackage.getFile();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlSchema.synchronizeWithResourceModel();
- this.setSpecifiedAccessType_(this.getResourceAccessType());
- this.setSpecifiedAccessOrder_(this.getResourceAccessOrder());
- this.syncXmlSchemaTypes();
- this.syncXmlJavaTypeAdapters();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlSchema.update();
- this.updateXmlSchemaTypes();
- this.updateXmlJavaTypeAdapters();
- }
-
-
- // ********** JaxbPackageInfo implementation **********
-
- public JavaResourcePackage getResourcePackage() {
- return this.resourcePackage;
- }
-
- // ********** xml schema **********
-
- public XmlSchema getXmlSchema() {
- return this.xmlSchema;
- }
-
- // ********** access type **********
-
- public XmlAccessType getAccessType() {
- return (this.specifiedAccessType != null) ? this.specifiedAccessType : this.getDefaultAccessType();
- }
-
- public XmlAccessType getSpecifiedAccessType() {
- return this.specifiedAccessType;
- }
-
- public void setSpecifiedAccessType(XmlAccessType access) {
- this.getAccessorTypeAnnotation().setValue(XmlAccessType.toJavaResourceModel(access));
- this.setSpecifiedAccessType_(access);
- }
-
- protected void setSpecifiedAccessType_(XmlAccessType access) {
- XmlAccessType old = this.specifiedAccessType;
- this.specifiedAccessType = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- public XmlAccessType getDefaultAccessType() {
- return XmlAccessType.PUBLIC_MEMBER;
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(this.getAccessorTypeAnnotation().getValue());
- }
-
- protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) this.resourcePackage.getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE);
- }
-
-
- // ********** access order **********
-
- public XmlAccessOrder getAccessOrder() {
- return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : this.getDefaultAccessOrder();
- }
-
- public XmlAccessOrder getSpecifiedAccessOrder() {
- return this.specifiedAccessOrder;
- }
-
- public void setSpecifiedAccessOrder(XmlAccessOrder accessOrder) {
- this.getAccessorOrderAnnotation().setValue(XmlAccessOrder.toJavaResourceModel(accessOrder));
- this.setSpecifiedAccessOrder_(accessOrder);
- }
-
- protected void setSpecifiedAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.specifiedAccessOrder;
- this.specifiedAccessOrder = accessOrder;
- this.firePropertyChanged(SPECIFIED_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- public XmlAccessOrder getDefaultAccessOrder() {
- return XmlAccessOrder.UNDEFINED;
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(this.getAccessorOrderAnnotation().getValue());
- }
-
- protected XmlAccessorOrderAnnotation getAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) this.resourcePackage.getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER);
- }
-
-
- // ********** xml schema types **********
-
- public ListIterable<XmlSchemaType> getXmlSchemaTypes() {
- return this.xmlSchemaTypeContainer.getContextElements();
- }
-
- public int getXmlSchemaTypesSize() {
- return this.xmlSchemaTypeContainer.getContextElementsSize();
- }
-
- public XmlSchemaType addXmlSchemaType(int index) {
- XmlSchemaTypeAnnotation annotation = (XmlSchemaTypeAnnotation) this.resourcePackage.addAnnotation(index, JAXB.XML_SCHEMA_TYPE);
- return this.xmlSchemaTypeContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlSchemaType(XmlSchemaType xmlSchemaType) {
- this.removeXmlSchemaType(this.xmlSchemaTypeContainer.indexOfContextElement(xmlSchemaType));
- }
-
- public void removeXmlSchemaType(int index) {
- this.resourcePackage.removeAnnotation(index, JAXB.XML_SCHEMA_TYPE);
- this.xmlSchemaTypeContainer.removeContextElement(index);
- }
-
- public void moveXmlSchemaType(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, JAXB.XML_SCHEMA_TYPE);
- this.xmlSchemaTypeContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- return new GenericJavaPackageXmlSchemaType(this, xmlSchemaTypeAnnotation);
- }
-
- protected void syncXmlSchemaTypes() {
- this.xmlSchemaTypeContainer.synchronizeWithResourceModel();
- }
-
- protected void updateXmlSchemaTypes() {
- this.xmlSchemaTypeContainer.update();
- }
-
- protected ListIterable<XmlSchemaTypeAnnotation> getXmlSchemaTypeAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlSchemaTypeAnnotation>(
- this.resourcePackage.getAnnotations(JAXB.XML_SCHEMA_TYPE));
- }
-
- protected ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation> buildXmlSchemaTypeContainer() {
- XmlSchemaTypeContainer container = new XmlSchemaTypeContainer();
- container.initialize();
- return container;
- }
-
-
- // ********** xml java type adapters **********
-
- public ListIterable<XmlJavaTypeAdapter> getXmlJavaTypeAdapters() {
- return this.xmlJavaTypeAdapterContainer.getContextElements();
- }
-
- public int getXmlJavaTypeAdaptersSize() {
- return this.xmlJavaTypeAdapterContainer.getContextElementsSize();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index) {
- XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.resourcePackage.addAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER);
- return this.xmlJavaTypeAdapterContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlJavaTypeAdapter(XmlJavaTypeAdapter xmlSchemaType) {
- this.removeXmlJavaTypeAdapter(this.xmlJavaTypeAdapterContainer.indexOfContextElement(xmlSchemaType));
- }
-
- public void removeXmlJavaTypeAdapter(int index) {
- this.resourcePackage.removeAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.xmlJavaTypeAdapterContainer.removeContextElement(index);
- }
-
- public void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.xmlJavaTypeAdapterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaPackageXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected void updateXmlJavaTypeAdapters() {
- this.xmlJavaTypeAdapterContainer.update();
- }
-
- protected void syncXmlJavaTypeAdapters() {
- this.xmlJavaTypeAdapterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlJavaTypeAdapterAnnotation> getXmlJavaTypeAdapterAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlJavaTypeAdapterAnnotation>(
- this.resourcePackage.getAnnotations(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- protected ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> buildXmlJavaTypeAdapterContainer() {
- XmlJavaTypeAdapterContainer container = new XmlJavaTypeAdapterContainer();
- container.initialize();
- return container;
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter(String boundTypeName) {
- for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) {
- if (boundTypeName.equals(adapter.getFullyQualifiedType())) {
- return adapter;
- }
- }
- return null;
- }
-
-
- // **************** misc **************************************************
-
- protected CompilationUnit buildASTRoot() {
- return this.resourcePackage.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
- // **************** content assist ****************************************
-
- //This doesn't actually work yet because of JDT bug (bugs.eclipse.org/326610)
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- getJaxbProject().getSchemaLibrary().refreshSchema(getJaxbPackage().getNamespace());
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlSchema.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- for (XmlSchemaType xmlSchemaType : this.getXmlSchemaTypes()) {
- result = xmlSchemaType.getJavaCompletionProposals(pos, filter, astRoot);
- if (!CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourcePackage.getNameTextRange(astRoot);
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- IFile file = this.resourcePackage.getFile();
- // 'file' will be null if the type is "external" and binary;
- // the file will be in a different project if the type is "external" and source;
- // the type will be binary if it is in a JAR in the current project
- if ((file != null)
- && file.getProject().equals(getJaxbProject().getProject())
- && (this.resourcePackage instanceof SourceNode)) {
- // build the AST root here to pass down
- this.validate(messages, reporter, this.buildASTRoot());
- }
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlSchema.validate(messages, reporter, astRoot);
-
- for (XmlSchemaType schemaType : getXmlSchemaTypes()) {
- schemaType.validate(messages, reporter, astRoot);
- }
-
- for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) {
- adapter.validate(messages, reporter, astRoot);
- }
- }
-
-
- /**
- * xml schema type container
- */
- protected class XmlSchemaTypeContainer
- extends ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return XML_SCHEMA_TYPES_LIST;
- }
- @Override
- protected XmlSchemaType buildContextElement(XmlSchemaTypeAnnotation resourceElement) {
- return GenericJavaPackageInfo.this.buildXmlSchemaType(resourceElement);
- }
- @Override
- protected ListIterable<XmlSchemaTypeAnnotation> getResourceElements() {
- return GenericJavaPackageInfo.this.getXmlSchemaTypeAnnotations();
- }
- @Override
- protected XmlSchemaTypeAnnotation getResourceElement(XmlSchemaType contextElement) {
- return contextElement.getXmlSchemaTypeAnnotation();
- }
- }
-
- /**
- * xml java type adapter container
- */
- protected class XmlJavaTypeAdapterContainer
- extends ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XML_JAVA_TYPE_ADAPTERS_LIST;
- }
-
- @Override
- protected XmlJavaTypeAdapter buildContextElement(XmlJavaTypeAdapterAnnotation resourceElement) {
- return GenericJavaPackageInfo.this.buildXmlJavaTypeAdapter(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlJavaTypeAdapterAnnotation> getResourceElements() {
- return GenericJavaPackageInfo.this.getXmlJavaTypeAdapterAnnotations();
- }
-
- @Override
- protected XmlJavaTypeAdapterAnnotation getResourceElement(XmlJavaTypeAdapter contextElement) {
- return contextElement.getAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
deleted file mode 100644
index f4ee9e71f5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaPackageXmlJavaTypeAdapter(JaxbPackageInfo parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- protected String buildDefaultType() {
- //there is no default type on a package level XmlJavaTypeAdapter, it must be specified
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getSpecifiedType() == null || getSpecifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED,
- this,
- getAnnotation().getTypeTextRange(astRoot)));
- }
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java
deleted file mode 100644
index 04480116be..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageXmlSchemaType
- extends GenericJavaXmlSchemaType
-{
-
- public GenericJavaPackageXmlSchemaType(JaxbPackageInfo parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent, xmlSchemaTypeAnnotation);
- }
-
- @Override
- public JaxbPackageInfo getParent() {
- return (JaxbPackageInfo) super.getParent();
- }
-
- protected JaxbPackageInfo getJaxbPackageInfo() {
- return getParent();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return getJaxbPackageInfo().getJaxbPackage();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String fqType = getFullyQualifiedType();
- if (fqType == null || XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java
deleted file mode 100644
index e43168f95a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPersistentAttribute
- extends AbstractJavaContextNode
- implements JaxbPersistentAttribute {
-
- protected final Accessor accessor;
-
- protected JaxbAttributeMapping mapping; // never null
-
- protected String defaultMappingKey;
-
-
-
- public static JaxbPersistentAttribute buildPersistentProperty(
- JaxbClassMapping parent,
- JavaResourceMethod resourceGetter,
- JavaResourceMethod resourceSetter) {
- return new GenericJavaPersistentAttribute(
- parent, new PropertyAccessor(parent, resourceGetter, resourceSetter));
- }
-
- public static JaxbPersistentAttribute buildPersistentField(
- JaxbClassMapping parent,
- JavaResourceField resourceField) {
- return new GenericJavaPersistentAttribute(
- parent, new FieldAccessor(parent, resourceField));
- }
-
-
- public GenericJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor) {
- super(parent);
- this.accessor = accessor;
- // keep non-null at all times
- this.mapping = this.buildMapping();
- }
-
- public JaxbClassMapping getClassMapping() {
- return (JaxbClassMapping) super.getParent();
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncMapping();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateMapping();
- }
-
-
- // ***** declaring class/ inheritance *****
-
- public JavaResourceType getDeclaringJavaResourceType() {
- return this.accessor.getJavaResourceAttribute().getResourceType();
- }
-
- public boolean isInherited() {
- return getDeclaringJavaResourceType() != getClassMapping().getJaxbType().getJavaResourceType();
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.getJavaResourceAttribute().getName();
- }
-
-
- // ***** accessor *****
-
- public boolean isFor(JavaResourceField resourceField) {
- return this.accessor.isFor(resourceField);
- }
-
- public boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return this.accessor.isFor(resourceGetter, resourceSetter);
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.accessor.getJavaResourceAttribute();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- return this.accessor.getJavaResourceAttributeBaseTypeName();
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- return this.accessor.isJavaResourceAttributeCollectionType();
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- return this.accessor.isJavaResourceAttributeTypeSubTypeOf(typeName);
- }
-
- // ********** mapping **********
-
- public JaxbAttributeMapping getMapping() {
- return this.mapping;
- }
-
- /**
- * Clients do not set the mapping directly.
- * @see #setMappingKey(String)
- */
- protected void setMapping(JaxbAttributeMapping mapping) {
- JaxbAttributeMapping old = this.mapping;
- this.mapping = mapping;
- this.firePropertyChanged(MAPPING_PROPERTY, old, mapping);
- }
-
- public String getMappingKey() {
- return this.mapping.getKey();
- }
-
- /**
- * Possible transitions:
- * <table border>
- * <th>
- * <th>null mapping/default<br>
- * <code>key = null</code>
- * <th>specified mapping A<br>
- * <code>key = "A"</code>
- * <th>specified mapping B<br>
- * <code>key = "B"</code>
- * <tr>
- * <th>[default] null mapping
- * <td>do nothing
- * <td>add annotation A<br>
- * set new mapping A
- * <td>add annotation B<br>
- * set new mapping B
- * <tr>
- * <th>default mapping A
- * <td>do nothing
- * <td>add annotation A<br>
- * <em>re-use</em> default mapping A
- * <td>add annotation B<br>
- * set new mapping B
- * <tr>
- * <th>specified mapping A
- * <td>remove annotation A<br>
- * set new default or null mapping
- * <td>do nothing
- * <td>remove annotation A<br>
- * add annotation B<br>
- * set new mapping B
- * </table>
- * The "do nothing" transitions are handled in this method.
- */
- public JaxbAttributeMapping setMappingKey(String key) {
- if (this.mapping.isDefault()) {
- if (key == null) {
- // leave the default mapping unchanged
- } else {
- this.setMappingKey_(key); // replace the default mapping
- }
- } else {
- if (this.valuesAreEqual(key, this.mapping.getKey())) {
- // leave the specified mapping unchanged
- } else {
- this.setMappingKey_(key); // replace the specified mapping
- }
- }
- return this.mapping;
- }
-
- /**
- * We have either:<ul>
- * <li>a <em>default</em> mapping and a non-<code>null</code> key
- * </ul>or<ul>
- * <li>a <em>specified</em> mapping and a different (possibly
- * <code>null</code>) key
- * </ul>
- */
- protected void setMappingKey_(String key) {
- JavaAttributeMappingDefinition definition = this.getSpecifiedMappingDefinition(key);
- if (definition == null) {
- // our mapping is "specified" and the key is null;
- // check for a default definition
- definition = this.getDefaultMappingDefinition();
- Iterable<String> supportingAnnotationNames = (definition != null) ? definition.getSupportingAnnotationNames() : EmptyIterable.<String>instance();
- // clear any mapping annotation(s);
- // leave the "default" mapping's supporting annotations;
- // if there is no "default" mapping, clear all supporting annotations too(?)
- this.setMappingAnnotation(null, supportingAnnotationNames);
- } else {
- this.setMappingAnnotation(definition);
- }
- // note: 'definition' can still be null (if the key is null and there is no "default" mapping)
- this.setMapping(this.buildMapping(definition));
- }
-
- /**
- * pre-condition: definition is not <code>null</code>
- */
- protected void setMappingAnnotation(JavaAttributeMappingDefinition definition) {
- this.setMappingAnnotation(definition.getAnnotationName(), definition.getSupportingAnnotationNames());
- }
-
- protected void setMappingAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- this.getJavaResourceAttribute().setPrimaryAnnotation(primaryAnnotationName, supportingAnnotationNames);
- }
-
- protected JaxbAttributeMapping buildMapping(JavaAttributeMappingDefinition definition) {
- return (definition == null) ? this.buildNullMapping() : this.buildMapping_(definition);
- }
-
- protected JaxbAttributeMapping buildNullMapping() {
- return this.getFactory().buildJavaNullAttributeMapping(this);
- }
-
- /**
- * pre-condition: definition is not null
- * <p>
- * If we are converting a <em>default</em> mapping to its <em>specified</em>
- * manifestation, we just keep the same mapping and create its annotation.
- * We do <em>not</em> do the same thing when converting a <em>specified</em>
- * mapping to its <em>default</em> manifestation. We rebuild the
- * entire mapping, simplifying the clearing of all its state. We do this
- * because we allow clients to modify a <em>default</em> mapping (or any of
- * its components) directly,
- * modifying its state and triggering a conversion to a <em>specified</em>
- * mapping. The only way to convert a <em>specified</em> mapping to a
- * <em>default</em> mapping is by {@link #setMappingKey(String) setting the
- * mapping key} to <code>null</code>.
- */
- protected JaxbAttributeMapping buildMapping_(JavaAttributeMappingDefinition definition) {
- // 'mapping' is null during construction
- if ((this.mapping != null) && this.mapping.isDefault() && Tools.valuesAreEqual(this.mapping.getKey(), definition.getKey())) {
- this.mapping.synchronizeWithResourceModel(); // the mapping instance hasn't changed, but some resource differences may have resulted
- return this.mapping;
- }
- return definition.buildMapping(this, this.getFactory());
- }
-
- /**
- * We only look for a <em>specified</em> mapping here.
- * We look for a default mapping during <em>update</em>.
- */
- protected JaxbAttributeMapping buildMapping() {
- return this.buildMapping(this.getSpecifiedMappingDefinition());
- }
-
- /**
- * Look for a <em>specified</em> mapping and sync our mapping.
- */
- protected void syncMapping() {
- JavaAttributeMappingDefinition definition = this.getSpecifiedMappingDefinition();
- if (definition == null) {
- if (this.mapping.isDefault()) {
- // null/default => null/default
- this.mapping.synchronizeWithResourceModel();
- } else {
- // specified => null/default
- definition = this.getDefaultMappingDefinition();
- this.setMapping(this.buildMapping(definition));
- }
- } else {
- if (this.mapping.isDefault()) {
- // null/default => specified
- // (will not change mapping instance if keys are the same, but will sync the mapping)
- this.setMapping(this.buildMapping(definition));
- } else {
- // specified => specified
- if (this.valuesAreEqual(definition.getKey(), this.mapping.getKey())) {
- this.mapping.synchronizeWithResourceModel();
- } else {
- this.setMapping(this.buildMapping(definition));
- }
- }
- }
- }
-
- /**
- * Return the "specified" mapping definition for the specified key.
- */
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition(String key) {
- if (key == null) {
- return null;
- }
- for (JavaAttributeMappingDefinition definition : this.getSpecifiedMappingDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), key)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("invalid mapping key: " + key); //$NON-NLS-1$
- }
-
- /**
- * Return the mapping definition for the mapping currently specified in the
- * source code.
- */
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition() {
- for (JavaAttributeMappingDefinition definition : this.getSpecifiedMappingDefinitions()) {
- if (definition.isSpecified(this)) {
- return definition;
- }
- }
- return null;
- }
-
- protected Iterable<JavaAttributeMappingDefinition> getSpecifiedMappingDefinitions() {
- return this.getPlatform().getSpecifiedJavaAttributeMappingDefinitions();
- }
-
-
- // ********** default mapping **********
-
- public String getDefaultMappingKey() {
- return this.defaultMappingKey;
- }
-
- protected void setDefaultMappingKey(String mappingKey) {
- String old = this.defaultMappingKey;
- this.defaultMappingKey = mappingKey;
- this.firePropertyChanged(DEFAULT_MAPPING_KEY_PROPERTY, old, mappingKey);
- }
-
- /**
- * If a mapping annotation is specified, we would have already set a
- * <em>specified</em> mapping in {@link #syncMapping()}. We need only check
- * for changes to the <em>default</em> mapping.
- */
- protected void updateMapping() {
- JavaAttributeMappingDefinition definition = this.getDefaultMappingDefinition();
- String newDefaultKey = (definition == null) ? null : definition.getKey();
- if (this.mapping.isDefault() && Tools.valuesAreDifferent(this.mapping.getKey(), newDefaultKey)) {
- this.setMapping(this.buildMapping(definition)); // the default mapping has changed
- } else {
- this.mapping.update();
- }
- this.setDefaultMappingKey(newDefaultKey);
- }
-
- protected JavaAttributeMappingDefinition getDefaultMappingDefinition() {
- for (DefaultJavaAttributeMappingDefinition definition : this.getDefaultMappingDefinitions()) {
- if (definition.isDefault(this)) {
- return definition;
- }
- }
- return null;
- }
-
- protected Iterable<DefaultJavaAttributeMappingDefinition> getDefaultMappingDefinitions() {
- return this.getPlatform().getDefaultJavaAttributeMappingDefinitions();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.mapping.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getJavaResourceAttribute().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // validate that unsupported annotations are not present
- JavaAttributeMappingDefinition currentMappingDefinition = getCurrentMappingDefinition();
- Iterable<String> supportingAnnotationNames = currentMappingDefinition.getSupportingAnnotationNames();
-
- for (Annotation annotation : getJavaResourceAttribute().getAnnotations()) {
- if (Tools.valuesAreDifferent(currentMappingDefinition.getAnnotationName(), annotation.getAnnotationName())
- && ! CollectionTools.contains(supportingAnnotationNames, annotation.getAnnotationName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION,
- new String[] { annotation.getAnnotationName(), currentMappingDefinition.getAnnotationName() },
- this,
- annotation.getTextRange(astRoot)));
- }
- }
-
- this.getMapping().validate(messages, reporter, astRoot);
- }
-
- protected JavaAttributeMappingDefinition getCurrentMappingDefinition() {
- Iterable<? extends JavaAttributeMappingDefinition> mappingDefinitions =
- (this.mapping.isDefault()) ?
- getDefaultMappingDefinitions()
- : getSpecifiedMappingDefinitions();
-
- for (JavaAttributeMappingDefinition mappingDefinition : mappingDefinitions) {
- if (Tools.valuesAreEqual(mappingDefinition.getKey(), this.mapping.getKey())) {
- return mappingDefinition;
- }
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java
deleted file mode 100644
index 10a874665f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public class GenericJavaTypeXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaTypeXmlJavaTypeAdapter(JaxbType parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- public JaxbType getParent() {
- return (JaxbType) super.getParent();
- }
-
- // ********** type **********
- @Override
- protected String buildDefaultType() {
- return getParent().getJavaResourceType().getQualifiedName();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java
deleted file mode 100644
index b71db30e34..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-public class GenericJavaXmlAdapter
- extends AbstractJavaContextNode
- implements XmlAdapter {
-
- protected final JavaResourceType resourceType;
-
- protected String boundType;
-
- protected String valueType;
-
-
- public GenericJavaXmlAdapter(JavaContextNode parent, JavaResourceType resourceType) {
- super(parent);
- this.resourceType = resourceType;
- initBoundAndValueTypes();
- }
-
-
- public JavaResourceType getJavaResourceType() {
- return this.resourceType;
- }
-
-
- // ***** overrides *****
-
- @Override
- public IResource getResource() {
- return this.resourceType.getFile();
- }
-
-
- // ***** sync/update *****
-
- protected void initBoundAndValueTypes() {
- String[] types = findBoundAndValueTypes(getJavaResourceType());
- this.boundType = types[0];
- this.valueType = types[1];
- }
-
-
- @Override
- public void update() {
- super.update();
- // these are in update, since their values may depend on other classes
- updateBoundAndValueTypes();
- }
-
- protected void updateBoundAndValueTypes() {
- String[] types = findBoundAndValueTypes(getJavaResourceType());
- setBoundType_(types[0]);
- setValueType_(types[1]);
- }
-
- protected String[] findBoundAndValueTypes(JavaResourceType resourceType) {
- for (JavaResourceMethod resourceMethod : resourceType.getMethods()) {
- if (MARSHAL_METHOD_NAME.equals(resourceMethod.getName()) && resourceMethod.getParametersSize() == 1) {
- String valueType = resourceMethod.getTypeName();
- String boundType = resourceMethod.getParameterTypeName(0);
- return new String[] { boundType, valueType };
- }
- }
-
- String superResourceTypeName = resourceType.getSuperclassQualifiedName();
- if (! StringTools.stringIsEmpty(superResourceTypeName)) {
- JavaResourceType superResourceType
- = (JavaResourceType) getJaxbProject().getJavaResourceType(superResourceTypeName, JavaResourceAbstractType.Kind.TYPE);
- if (superResourceType != null) {
- return findBoundAndValueTypes(superResourceType);
- }
- }
-
- String objectTypeName = Object.class.getName();
- return new String[] { objectTypeName, objectTypeName };
- }
-
-
- // ***** bound type *****
-
- public String getBoundType() {
- return this.boundType;
- }
-
- protected void setBoundType_(String newType) {
- String oldType = this.boundType;
- this.boundType = newType;
- firePropertyChanged(BOUND_TYPE_PROPERTY, oldType, newType);
- }
-
-
- // ***** value type *****
-
- public String getValueType() {
- return this.valueType;
- }
-
- protected void setValueType_(String newType) {
- String oldType = this.valueType;
- this.valueType = newType;
- firePropertyChanged(VALUE_TYPE_PROPERTY, oldType, newType);
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJavaResourceType().getNameTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java
deleted file mode 100644
index 6b94b4273d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAnyAttributeMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlAnyAttributeAnnotation>
- implements XmlAnyAttributeMapping {
-
- public GenericJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlJavaTypeAdapter();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(Map.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__NON_MAP_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java
deleted file mode 100644
index 5c1837002f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAnyElementMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlAnyElementAnnotation>
- implements XmlAnyElementMapping {
-
- protected Boolean specifiedLax;
-
- protected String specifiedValue;
-
- protected final XmlElementRefs xmlElementRefs;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.specifiedLax = buildSpecifiedLax();
- this.specifiedValue = getResourceValueString();
- this.xmlElementRefs = buildXmlElementRefs();
- initializeXmlElementWrapper();
- this.initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedLax_(buildSpecifiedLax());
- setSpecifiedValue_(getResourceValueString());
- this.xmlElementRefs.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefs.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** lax *****
-
- public boolean isLax() {
- return (getSpecifiedLax() == null) ? isDefaultLax() : getSpecifiedLax().booleanValue();
- }
-
- public Boolean getSpecifiedLax() {
- return this.specifiedLax;
- }
-
- public void setSpecifiedLax(Boolean newSpecifiedLax) {
- getOrCreateAnnotation().setLax(newSpecifiedLax);
- setSpecifiedLax_(newSpecifiedLax);
- }
-
- protected void setSpecifiedLax_(Boolean newSpecifiedLax) {
- Boolean oldLax = this.specifiedLax;
- this.specifiedLax = newSpecifiedLax;
- firePropertyChanged(SPECIFIED_LAX_PROPERTY, oldLax, newSpecifiedLax);
- }
-
- protected Boolean buildSpecifiedLax() {
- return getAnnotation().getLax();
- }
-
- public boolean isDefaultLax() {
- return DEFAULT_LAX;
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return getSpecifiedValue() == null ? getDefaultValue() : getSpecifiedValue();
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String location) {
- getOrCreateAnnotation().setValue(location);
- setSpecifiedValue_(location);
- }
-
- protected void setSpecifiedValue_(String type) {
- String old = this.specifiedValue;
- this.specifiedValue = type;
- this.firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, type);
- }
-
- protected String getResourceValueString() {
- return getAnnotation().getValue();
- }
-
- public String getDefaultValue() {
- return DEFAULT_VALUE;
- }
-
-
- // ***** XmlElementRefs *****
-
- public XmlElementRefs getXmlElementRefs() {
- return this.xmlElementRefs;
- }
-
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- XmlElementWrapperAnnotation annotation =
- (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- this.setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- this.setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper(XmlElementWrapperAnnotation xmlElementWrapperAnnotation) {
- return new GenericJavaXmlElementWrapper(this, xmlElementWrapperAnnotation);
- }
-
- protected void initializeXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- this.xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- }
- }
-
- protected void syncXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().synchronizeWithResourceModel();
- }
- else {
- this.setXmlElementWrapper_(this.buildXmlElementWrapper(annotation));
- }
- }
- else {
- this.setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRefs.getReferencedXmlTypeNames();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRefs.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRefs.validate(messages, reporter, astRoot);
-
- if (getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REFS) != null) {
- XmlElementRefAnnotation xmlElementRefAnnotation =
- (XmlElementRefAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REF);
- if (xmlElementRefAnnotation != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION,
- new String[] { JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS },
- getPersistentAttribute(),
- xmlElementRefAnnotation.getTextRange(astRoot)));
- }
- }
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlMixed != null) {
- this.xmlMixed.validate(messages, reporter, astRoot);
- }
- }
-
- public class XmlElementRefsContext
- implements GenericJavaXmlElementRefs.Context {
-
- protected XmlElementRefsAnnotation getXmlElementRefsAnnotation() {
- return (XmlElementRefsAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected XmlElementRefsAnnotation addXmlElementRefsAnnotation() {
- return (XmlElementRefsAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected void removeXmlElementRefsAnnotation() {
- GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected XmlElementRefAnnotation getXmlElementRefAnnotation() {
- return (XmlElementRefAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- protected XmlElementRefAnnotation addXmlElementRefAnnotation() {
- return (XmlElementRefAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- protected void removeXmlElementRefAnnotation() {
- GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.getXmlElementRefs();
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- return new SingleElementListIterable(xmlElementRefAnnotation);
- }
-
- return EmptyListIterable.instance();
- }
-
- public XmlElementRefAnnotation addXmlElementRefAnnotation(int index) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.addXmlElementRef(index);
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- if (index > 1) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- xmlElementRefsAnnotation = addXmlElementRefsAnnotation();
- XmlElementRefAnnotation xmlElementRefAnnotationCopy = xmlElementRefsAnnotation.addXmlElementRef(0);
- xmlElementRefAnnotationCopy.setName(xmlElementRefAnnotation.getName());
- xmlElementRefAnnotationCopy.setNamespace(xmlElementRefAnnotation.getNamespace());
- xmlElementRefAnnotationCopy.setRequired(xmlElementRefAnnotation.getRequired());
- xmlElementRefAnnotationCopy.setType(xmlElementRefAnnotation.getType());
-
- removeXmlElementRefAnnotation();
-
- return xmlElementRefsAnnotation.addXmlElementRef(index);
- }
-
- if (index > 0) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- return addXmlElementRefAnnotation();
- }
-
- public void removeXmlElementRefAnnotation(int index) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- xmlElementRefsAnnotation.removeXmlElementRef(index);
- if (xmlElementRefsAnnotation.getXmlElementRefsSize() == 0) {
- removeXmlElementRefsAnnotation();
- }
- else if (xmlElementRefsAnnotation.getXmlElementRefsSize() == 1) {
- XmlElementRefAnnotation xmlElementRefAnnotation = CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 0);
- XmlElementRefAnnotation xmlElementRefAnnotationCopy = addXmlElementRefAnnotation();
- xmlElementRefAnnotationCopy.setName(xmlElementRefAnnotation.getName());
- xmlElementRefAnnotationCopy.setNamespace(xmlElementRefAnnotation.getNamespace());
- xmlElementRefAnnotationCopy.setRequired(xmlElementRefAnnotation.getRequired());
- xmlElementRefAnnotationCopy.setType(xmlElementRefAnnotation.getType());
- removeXmlElementRefsAnnotation();
- }
- return;
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- if (index != 0) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- removeXmlElementRefAnnotation();
- return;
- }
-
- throw new IllegalArgumentException(String.valueOf(index));
- }
-
- public void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex) {
- if (targetIndex == sourceIndex) {
- return;
- }
-
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation == null) {
- throw new IllegalArgumentException(String.valueOf(targetIndex) + ", " + String.valueOf(sourceIndex));
- }
- xmlElementRefsAnnotation.moveXmlElementRef(targetIndex, sourceIndex);
- }
-
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation));
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.getTextRange(astRoot);
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- return xmlElementRefAnnotation.getTextRange(astRoot);
- }
-
- return GenericJavaXmlAnyElementMapping.this.getValidationTextRange(astRoot);
- }
- }
-
-
- public class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- protected XmlElementRefAnnotation annotation;
-
- protected XmlElementRefContext(XmlElementRefAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlAnyElementMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlAnyElementMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java
deleted file mode 100644
index e7ca2fc909..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttachmentRef;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-public class GenericJavaXmlAttachmentRef
- extends AbstractJavaContextNode
- implements XmlAttachmentRef {
-
- protected final XmlAttachmentRefAnnotation resourceXmlAttachmentRef;
-
-
- public GenericJavaXmlAttachmentRef(JaxbAttributeMapping parent, XmlAttachmentRefAnnotation resource) {
- super(parent);
- this.resourceXmlAttachmentRef = resource;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlAttachmentRef.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java
deleted file mode 100644
index 9d39c5503e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdAttributeUse;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAttributeMapping
- extends GenericJavaBasicMapping<XmlAttributeAnnotation>
- implements XmlAttributeMapping {
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
-
- public GenericJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlAttributeQName(this);
- }
-
-
- // ***** XmlAttribute.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getOrCreateAnnotation().setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- XmlAttributeAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlIDREF *****
-
- @Override
- protected GenericJavaXmlIDREF.Context buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- public XsdFeature getXsdFeature() {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type != null) {
- XsdAttributeUse attributeUse = type.getAttribute(this.qName.getNamespace(), this.qName.getName());
- return (attributeUse == null) ? null : attributeUse.getAttributeDeclaration();
- }
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.qName.validate(messages, reporter, astRoot);
- }
-
-
- protected class XmlAttributeQName
- extends AbstractJavaQName {
-
- protected XmlAttributeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ATTRIBUTE_DESC;
- }
-
- @Override
- public String getDefaultName() {
- return GenericJavaXmlAttributeMapping.this.getPersistentAttribute().getJavaResourceAttribute().getName();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = GenericJavaXmlAttributeMapping.this.getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? EmptyIterable.instance() : xsdType.getAttributeNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getDefaultNamespace() {
- return (GenericJavaXmlAttributeMapping.this.getJaxbPackage().getAttributeFormDefault() == XmlNsForm.QUALIFIED) ?
- GenericJavaXmlAttributeMapping.this.getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = GenericJavaXmlAttributeMapping.this.getJaxbPackage().getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type != null) {
- if (type.getAttribute(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- if (createIfNull) {
- return GenericJavaXmlAttributeMapping.this.getOrCreateAnnotation();
- }
- else {
- return GenericJavaXmlAttributeMapping.this.getAnnotation();
- }
- }
- }
-
-
- protected class XmlIDREFContext
- extends GenericJavaBasicMapping.XmlIDREFContext {
-
- public Iterable<ValidatableReference> getReferences() {
-
- return new SingleElementIterable<ValidatableReference>(
-
- new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return GenericJavaXmlAttributeMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- // 1) if we're getting here, XmlIDREF will not be null
- // 2) use the @XmlIDREF text range, since there is no specific place where the type is specified
- return GenericJavaXmlAttributeMapping.this.getXmlIDREF().getValidationTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return GenericJavaXmlAttributeMapping.this.getXsdFeature();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return GenericJavaXmlAttributeMapping.this.getQName().getNameTextRange(astRoot);
- }
- });
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
deleted file mode 100644
index 3a894379ce..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElement
- extends AbstractJavaContextNode
- implements XmlElement {
-
- protected final Context context;
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedNillable;
-
- protected boolean defaultNillable;
-
- protected Boolean specifiedRequired;
-
- protected String defaultValue;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- public GenericJavaXmlElement(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedNillable = buildSpecifiedNillable();
- this.defaultNillable = buildDefaultNillable();
- this.specifiedRequired = buildSpecifiedRequired();
- this.defaultValue = buildDefaultValue();
- this.specifiedType = buildSpecifiedType();
- this.defaultType = buildDefaultType();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedNillable_(buildSpecifiedNillable());
- setDefaultNillable_(buildDefaultNillable());
- setSpecifiedRequired_(buildSpecifiedRequired());
- setDefaultValue_(buildDefaultValue());
- setSpecifiedType_(buildSpecifiedType());
- setDefaultType_(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- protected Context getContext() {
- return this.context;
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getContext().getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- return this.context.getAnnotation(createIfNull);
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlElementQName(this);
- }
-
-
- // ***** XmlElement.nillable *****
-
- public boolean isNillable() {
- return (this.specifiedNillable == null) ? isDefaultNillable() : getSpecifiedNillable().booleanValue();
- }
-
- public Boolean getSpecifiedNillable() {
- return this.specifiedNillable;
- }
-
- public void setSpecifiedNillable(Boolean newSpecifiedNillable) {
- getAnnotation(true).setNillable(newSpecifiedNillable);
- setSpecifiedNillable_(newSpecifiedNillable);
- }
-
- protected void setSpecifiedNillable_(Boolean newSpecifiedNillable) {
- Boolean oldNillable = this.specifiedNillable;
- this.specifiedNillable = newSpecifiedNillable;
- firePropertyChanged(SPECIFIED_NILLABLE_PROPERTY, oldNillable, newSpecifiedNillable);
- }
-
- protected Boolean buildSpecifiedNillable() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNillable();
- }
-
- public boolean isDefaultNillable() {
- return this.defaultNillable;
- }
-
- protected void setDefaultNillable_(boolean newNillable) {
- boolean oldNillable = this.defaultNillable;
- this.defaultNillable = newNillable;
- firePropertyChanged(DEFAULT_NILLABLE_PROPERTY, oldNillable, newNillable);
- }
-
- protected boolean buildDefaultNillable() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getPersistentAttribute().isJavaResourceAttributeCollectionType() : false;
- }
-
-
- // ***** XmlElement.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation(true).setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlElement.defaultValue *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- getAnnotation(true).setDefaultValue(defaultValue);
- setDefaultValue_(defaultValue);
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String oldDefaultValue = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, oldDefaultValue, defaultValue);
- }
-
- protected String buildDefaultValue() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getDefaultValue();
- }
-
-
- // ***** XmlElement.type *****
-
- public String getType() {
- return (this.specifiedType == null) ? getDefaultType() : this.specifiedType;
- }
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String newSpecifiedType) {
- getAnnotation(true).setType(newSpecifiedType);
- setSpecifiedType_(newSpecifiedType);
- }
-
- protected void setSpecifiedType_(String newSpecifiedType) {
- String oldType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldType, newSpecifiedType);
- }
-
- protected String buildSpecifiedType() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getType();
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(String newType) {
- String oldType = this.defaultType;
- this.defaultType = newType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldType, newType);
- }
-
- protected String buildDefaultType() {
- return this.context.getDefaultType();
- }
-
- public String getFullyQualifiedType() {
- return (this.specifiedType == null) ? getDefaultType() : getAnnotation(false).getFullyQualifiedTypeName();
- }
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- // only return the specified type - the default type should already be included
- return (this.specifiedType == null) ?
- EmptyIterable.<String>instance()
- : new SingleElementIterable(getFullyQualifiedType());
- }
-
- public XsdElementDeclaration getXsdElement() {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? null : xsdType.getElement(this.qName.getNamespace(), this.qName.getName());
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTextRange(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTypeTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.qName.validate(messages, reporter, astRoot);
- validateType(messages, reporter, astRoot);
- }
-
- protected void validateType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String fqType = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__UNSPECIFIED_TYPE,
- this,
- getTypeTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(this.specifiedType)
- // verify that type actually exists before validating
- && JDTTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
- String attributeBaseType = getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeBaseType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__ILLEGAL_TYPE,
- new String[] { attributeBaseType },
- this,
- getTypeTextRange(astRoot)));
-
- }
- }
- }
-
-
- protected class XmlElementQName
- extends AbstractJavaElementQName {
-
- protected XmlElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return GenericJavaXmlElement.this.getPersistentAttribute();
- }
-
- @Override
- protected XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElement.this.context.getElementWrapper();
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElement.this.getAnnotation(createIfNull);
- }
- }
-
-
- public interface Context {
-
- JaxbAttributeMapping getAttributeMapping();
-
- XmlElementAnnotation getAnnotation(boolean createIfNull);
-
- String getDefaultType();
-
- XmlElementWrapper getElementWrapper();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java
deleted file mode 100644
index d36c7898b3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlElementMapping
- extends GenericJavaBasicMapping<XmlElementAnnotation>
- implements XmlElementMapping {
-
- protected final XmlElement xmlElement;
-
- protected XmlElementWrapper xmlElementWrapper;
-
-
- public GenericJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElement = buildXmlElement();
- this.initializeXmlElementWrapper();
- }
-
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElement.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElement.update();
- updateXmlElementWrapper();
- }
-
-
- // ***** XmlElement *****
-
- public XmlElement getXmlElement() {
- return this.xmlElement;
- }
-
- protected XmlElement buildXmlElement() {
- return new GenericJavaXmlElement(this, new XmlElementContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected XmlElementWrapper buildXmlElementWrapper(XmlElementWrapperAnnotation xmlElementWrapperAnnotation) {
- return new GenericJavaXmlElementWrapper(this, xmlElementWrapperAnnotation);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- XmlElementWrapperAnnotation annotation =
- (XmlElementWrapperAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper(annotation);
- this.setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- this.setXmlElementWrapper_(null);
- }
-
- protected void initializeXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- this.xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- }
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected void syncXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().synchronizeWithResourceModel();
- }
- else {
- this.setXmlElementWrapper_(this.buildXmlElementWrapper(annotation));
- }
- }
- else {
- this.setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().update();
- }
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
-
- // ***** XmlIDREF *****
-
- @Override
- protected GenericJavaXmlIDREF.Context buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getReferencedXmlTypeNames(),
- this.xmlElement.getReferencedXmlTypeNames());
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
- public XsdFeature getXsdFeature() {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType != null) {
- XmlElementWrapper elementWrapper = this.xmlElementWrapper;
-
- if (elementWrapper == null) {
- return xsdType.getElement(this.xmlElement.getQName().getNamespace(), this.xmlElement.getQName().getName());
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement != null) {
- return xsdWrapperElement.getElement(this.xmlElement.getQName().getNamespace(), this.xmlElement.getQName().getName());
- }
- }
- }
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElement.validate(messages, reporter, astRoot);
-
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().validate(messages, reporter, astRoot);
- }
- }
-
-
- public class XmlElementContext
- implements GenericJavaXmlElement.Context {
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- return (createIfNull) ?
- GenericJavaXmlElementMapping.this.getOrCreateAnnotation()
- : GenericJavaXmlElementMapping.this.getAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementMapping.this;
- }
-
- public String getDefaultType() {
- return GenericJavaXmlElementMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementMapping.this.getXmlElementWrapper();
- }
- }
-
-
- protected class XmlIDREFContext
- extends GenericJavaBasicMapping.XmlIDREFContext {
-
- public Iterable<ValidatableReference> getReferences() {
-
- return new SingleElementIterable<ValidatableReference>(
-
- new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return GenericJavaXmlElementMapping.this.xmlElement.getType();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- // 1) if we're getting here, XmlIDREF will not be null
- // 2) if there is an @XmlElement annotation, use that, otherwise use the @XmlIDREF
- return (GenericJavaXmlElementMapping.this.getAnnotation() == null) ?
- GenericJavaXmlElementMapping.this.getXmlIDREF().getValidationTextRange(astRoot)
- : GenericJavaXmlElementMapping.this.xmlElement.getTypeTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return GenericJavaXmlElementMapping.this.getXsdFeature();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return GenericJavaXmlElementMapping.this.xmlElement.getQName().getNameTextRange(astRoot);
- }
- });
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
deleted file mode 100644
index 31760f8c12..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRef
- extends AbstractJavaContextNode
- implements XmlElementRef {
-
- protected final Context context;
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- public GenericJavaXmlElementRef(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- this.specifiedType = buildSpecifiedType();
- this.defaultType = buildDefaultType();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- setSpecifiedType_(buildSpecifiedType());
- setDefaultType_(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- protected Context getContext() {
- return this.context;
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getContext().getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.context.getAnnotation();
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlElementRefQName(this);
- }
-
-
- // ***** XmlElementRef.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation().setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- return getAnnotation().getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlElementRef.type *****
-
- public String getType() {
- return (this.specifiedType == null) ? getDefaultType() : this.specifiedType;
- }
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String newSpecifiedType) {
- getAnnotation().setType(newSpecifiedType);
- setSpecifiedType_(newSpecifiedType);
- }
-
- protected void setSpecifiedType_(String newSpecifiedType) {
- String oldType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldType, newSpecifiedType);
- }
-
- protected String buildSpecifiedType() {
- return getAnnotation().getType();
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(String newType) {
- String oldType = this.defaultType;
- this.defaultType = newType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldType, newType);
- }
-
- protected String buildDefaultType() {
- return this.context.getDefaultType();
- }
-
- public String getFullyQualifiedType() {
- return (this.specifiedType == null) ? getDefaultType() : getAnnotation().getFullyQualifiedTypeName();
- }
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- // only return the specified type - the default type should already be included
- if (this.specifiedType != null) {
- String fqType = getFullyQualifiedType();
- if (! JAXB.JAXB_ELEMENT.equals(fqType)) {
- return new SingleElementIterable(fqType);
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTypeTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.qName.validate(messages, reporter, astRoot);
- validateType(messages, reporter, astRoot);
- }
-
- protected void validateType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- String fqType = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__UNSPECIFIED_TYPE,
- this,
- getTypeTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(this.specifiedType)
- // verify that type actually exists before validating
- && JDTTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
- String attributeBaseType = getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeBaseType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__ILLEGAL_TYPE,
- new String[] { attributeBaseType },
- this,
- getTypeTextRange(astRoot)));
-
- }
-
- // if type is a persistent class, check that it or a subclass has a root element specified
- JaxbTypeMapping typeMapping = getJaxbProject().getContextRoot().getTypeMapping(fqType);
- if (typeMapping != null && ! typeMapping.hasRootElementInHierarchy()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_ROOT_ELEMENT,
- new String[] { attributeBaseType },
- this,
- getTypeTextRange(astRoot)));
- }
- }
- }
-
-
- protected class XmlElementRefQName
- extends AbstractJavaElementQName {
-
- protected XmlElementRefQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return GenericJavaXmlElementRef.this.getPersistentAttribute();
- }
-
- protected boolean isTypeJAXBElement() {
- return JAXB.JAXB_ELEMENT.equals(GenericJavaXmlElementRef.this.getFullyQualifiedType());
- }
-
- protected JaxbTypeMapping getReferencedTypeMapping() {
- String fqTypeName = GenericJavaXmlElementRef.this.getFullyQualifiedType();
- return getJaxbProject().getContextRoot().getTypeMapping(fqTypeName);
- }
-
- @Override
- protected XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRef.this.context.getElementWrapper();
- }
-
- @Override
- public String getDefaultName() {
- if (isTypeJAXBElement()) {
- return super.getDefaultName();
- }
-
- JaxbTypeMapping referencedTypeMapping = getReferencedTypeMapping();
- if (referencedTypeMapping != null) {
- XmlRootElement rootElement = referencedTypeMapping.getXmlRootElement();
- if (rootElement != null) {
- return rootElement.getQName().getName();
- }
- }
-
- return "";
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbTypeMapping referencedTypeMapping = getReferencedTypeMapping();
- if (referencedTypeMapping != null) {
- XmlRootElement rootElement = referencedTypeMapping.getXmlRootElement();
- if (rootElement != null) {
- return rootElement.getQName().getNamespace();
- }
- }
-
- return super.getDefaultNamespace();
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // only validate if type is JAXBElement
- if (isTypeJAXBElement()) {
- super.validateName(messages, reporter, astRoot);
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validateReference(messages, reporter, astRoot);
-
- // if type is JAXBElement, then name/namespace must also point at a valid XmlElementDecl
- if (! isTypeJAXBElement()) {
- return;
- }
-
- XmlRegistry registry = getJaxbPackage().getRegistry();
-
- if (registry == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_REGISTRY,
- this,
- getValidationTextRange(astRoot)));
- return;
- }
-
- for (JaxbElementFactoryMethod elementDecl : registry.getElementFactoryMethods()) {
- if (Tools.valuesAreEqual(getName(), elementDecl.getQName().getName())
- && Tools.valuesAreEqual(getNamespace(), elementDecl.getQName().getNamespace())) {
- return;
- }
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL,
- new String[] { getNamespace(), getName() },
- this,
- getValidationTextRange(astRoot)));
-
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElementRef.this.getAnnotation();
- }
- }
-
-
- public interface Context {
-
- JaxbAttributeMapping getAttributeMapping();
-
- XmlElementRefAnnotation getAnnotation();
-
- String getDefaultType();
-
- XmlElementWrapper getElementWrapper();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java
deleted file mode 100644
index d116239ec1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementRefAnnotation>
- implements XmlElementRefMapping {
-
- protected final XmlElementRef xmlElementRef;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementRef = buildXmlElementRef();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRef.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRef.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** XmlElementRef *****
-
- public XmlElementRef getXmlElementRef() {
- return this.xmlElementRef;
- }
-
- protected XmlElementRef buildXmlElementRef() {
- return new GenericJavaXmlElementRef(this, new XmlElementRefContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- XmlElementWrapperAnnotation annotation =
- (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- this.setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- this.setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper(XmlElementWrapperAnnotation xmlElementWrapperAnnotation) {
- return new GenericJavaXmlElementWrapper(this, xmlElementWrapperAnnotation);
- }
-
- protected void initializeXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- this.xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- }
- }
-
- protected void syncXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().synchronizeWithResourceModel();
- }
- else {
- this.setXmlElementWrapper_(this.buildXmlElementWrapper(annotation));
- }
- }
- else {
- this.setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRef.getReferencedXmlTypeNames();
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRef.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRef.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
- }
-
-
- public class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- public XmlElementRefAnnotation getAnnotation() {
- return GenericJavaXmlElementRefMapping.this.getAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementRefMapping.this;
- }
-
- public String getDefaultType() {
- return GenericJavaXmlElementRefMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRefMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
deleted file mode 100644
index c7e0f48e47..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefs
- extends AbstractJavaContextNode
- implements XmlElementRefs {
-
- protected final Context context;
-
- protected final ContextListContainer<XmlElementRef, XmlElementRefAnnotation> xmlElementRefContainer;
-
-
- public GenericJavaXmlElementRefs(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.xmlElementRefContainer = this.buildXmlElementRefContainer();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRefContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefContainer.update();
- }
-
-
- // ***** xml element refs *****
-
- public ListIterable<XmlElementRef> getXmlElementRefs() {
- return this.xmlElementRefContainer.getContextElements();
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefContainer.getContextElementsSize();
- }
-
- public XmlElementRef addXmlElementRef(int index) {
- XmlElementRefAnnotation annotation = this.context.addXmlElementRefAnnotation(index);
- return this.xmlElementRefContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlElementRef(int index) {
- this.context.removeXmlElementRefAnnotation(index);
- this.xmlElementRefContainer.removeContextElement(index);
- }
-
- public void removeXmlElementRef(XmlElementRef xmlElementRef) {
- removeXmlElementRef(this.xmlElementRefContainer.indexOfContextElement(xmlElementRef));
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- this.context.moveXmlElementRefAnnotation(targetIndex, sourceIndex);
- this.xmlElementRefContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlElementRef buildXmlElementRef(XmlElementRefAnnotation xmlElementRefAnnotation) {
- return this.context.buildXmlElementRef(this, xmlElementRefAnnotation);
- }
-
- protected ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- return this.context.getXmlElementRefAnnotations();
- }
-
- protected ContextListContainer<XmlElementRef, XmlElementRefAnnotation> buildXmlElementRefContainer() {
- XmlElementRefContainer container = new XmlElementRefContainer();
- container.initialize();
- return container;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (XmlElementRef elementRef : getXmlElementRefs()) {
- result = elementRef.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateDuplicateTypesAndQNames(messages, reporter, astRoot);
-
- for (XmlElementRef elementRef : getXmlElementRefs()) {
- elementRef.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- Bag<String> xmlElementRefTypes = new HashBag<String>();
- Bag<QName> xmlElementRefQnames = new HashBag<QName>();
-
- for (XmlElementRef xmlElementRef : getXmlElementRefs()) {
- String typeName = xmlElementRef.getFullyQualifiedType();
- boolean isJaxbElement = JAXB.JAXB_ELEMENT.equals(typeName);
- if (! isJaxbElement && ! StringTools.stringIsEmpty(typeName)) {
- xmlElementRefTypes.add(typeName);
- }
- String elementRefName = xmlElementRef.getQName().getName();
- if (isJaxbElement && ! StringTools.stringIsEmpty(elementRefName)) {
- xmlElementRefQnames.add(new QName(xmlElementRef.getQName().getNamespace(), elementRefName));
- }
- }
-
- for (XmlElementRef xmlElementRef : getXmlElementRefs()) {
- String typeName = xmlElementRef.getFullyQualifiedType();
- boolean isJaxbElement = JAXB.JAXB_ELEMENT.equals(typeName);
- if (! isJaxbElement && xmlElementRefTypes.count(typeName) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE,
- new String[] { typeName },
- xmlElementRef,
- xmlElementRef.getTypeTextRange(astRoot)));
- }
-
- String xmlElementNamespace = xmlElementRef.getQName().getNamespace();
- String xmlElementName = xmlElementRef.getQName().getName();
- if (isJaxbElement && xmlElementRefQnames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName },
- xmlElementRef,
- xmlElementRef.getQName().getNameTextRange(astRoot)));
- }
- }
- }
-
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- new TransformationIterable<XmlElementRef, Iterable<String>>(getXmlElementRefs()) {
- @Override
- protected Iterable<String> transform(XmlElementRef xmlElementRef) {
- return xmlElementRef.getReferencedXmlTypeNames();
- }
- });
- }
-
-
-
- protected class XmlElementRefContainer
- extends ContextListContainer<XmlElementRef, XmlElementRefAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlElementRefs.XML_ELEMENT_REFS_LIST;
- }
-
- @Override
- protected XmlElementRef buildContextElement(XmlElementRefAnnotation resourceElement) {
- return GenericJavaXmlElementRefs.this.buildXmlElementRef(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlElementRefAnnotation> getResourceElements() {
- return GenericJavaXmlElementRefs.this.getXmlElementRefAnnotations();
- }
-
- @Override
- protected XmlElementRefAnnotation getResourceElement(XmlElementRef contextElement) {
- // in this context, there will never be an XmlElementRef without an annotation
- return contextElement.getAnnotation();
- }
- }
-
-
- public interface Context {
-
- ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations();
-
- XmlElementRefAnnotation addXmlElementRefAnnotation(int index);
-
- void removeXmlElementRefAnnotation(int index);
-
- void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex);
-
- XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation);
-
- TextRange getValidationTextRange(CompilationUnit astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java
deleted file mode 100644
index 92f9ad8143..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefsMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementRefsAnnotation>
- implements XmlElementRefsMapping {
-
- protected final XmlElementRefs xmlElementRefs;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementRefs = buildXmlElementRefs();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRefs.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefs.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** XmlElementRefs *****
-
- public XmlElementRefs getXmlElementRefs() {
- return this.xmlElementRefs;
- }
-
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- XmlElementWrapperAnnotation annotation =
- (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- this.setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- this.setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper(XmlElementWrapperAnnotation xmlElementWrapperAnnotation) {
- return new GenericJavaXmlElementWrapper(this, xmlElementWrapperAnnotation);
- }
-
- protected void initializeXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- this.xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- }
- }
-
- protected void syncXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().synchronizeWithResourceModel();
- }
- else {
- this.setXmlElementWrapper_(this.buildXmlElementWrapper(annotation));
- }
- }
- else {
- this.setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRefs.getReferencedXmlTypeNames();
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRefs.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRefs.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlMixed != null) {
- this.xmlMixed.validate(messages, reporter, astRoot);
- }
- }
-
-
- public class XmlElementRefsContext
- implements GenericJavaXmlElementRefs.Context {
-
- protected XmlElementRefsAnnotation getXmlElementRefsAnnotation() {
- return GenericJavaXmlElementRefsMapping.this.getAnnotation();
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- return getXmlElementRefsAnnotation().getXmlElementRefs();
- }
-
- public XmlElementRefAnnotation addXmlElementRefAnnotation(int index) {
- return getXmlElementRefsAnnotation().addXmlElementRef(index);
- }
-
- public void removeXmlElementRefAnnotation(int index) {
- getXmlElementRefsAnnotation().removeXmlElementRef(index);
- }
-
- public void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex) {
- getXmlElementRefsAnnotation().moveXmlElementRef(targetIndex, sourceIndex);
- }
-
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation));
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlElementRefsAnnotation().getTextRange(astRoot);
- }
- }
-
-
- public class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- protected XmlElementRefAnnotation annotation;
-
- protected XmlElementRefContext(XmlElementRefAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementRefsMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRefsMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java
deleted file mode 100644
index f0df046484..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlElementWrapper
- extends AbstractJavaContextNode
- implements XmlElementWrapper {
-
- protected final XmlElementWrapperAnnotation annotation;
-
- protected JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
- protected Boolean specifiedNillable;
-
-
- public GenericJavaXmlElementWrapper(JaxbAttributeMapping parent, XmlElementWrapperAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- this.specifiedNillable = this.buildSpecifiedNillable();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlElementQName(this);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- this.setSpecifiedNillable_(this.buildSpecifiedNillable());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- //************ XmlElementWrapper.required ***************
-
- public boolean isRequired() {
- return (this.getSpecifiedRequired() == null) ? this.isDefaultRequired() : this.getSpecifiedRequired().booleanValue();
- }
-
- public boolean isDefaultRequired() {
- return DEFAULT_REQUIRED;
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- this.annotation.setRequired(newSpecifiedRequired);
- this.setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- return this.annotation.getRequired();
- }
-
-
- //************ XmlElementWrapper.nillable ***************
-
- public boolean isNillable() {
- return (this.getSpecifiedNillable() == null) ? this.isDefaultNillable() : this.getSpecifiedNillable().booleanValue();
- }
-
- public boolean isDefaultNillable() {
- return DEFAULT_NILLABLE;
- }
-
- public Boolean getSpecifiedNillable() {
- return this.specifiedNillable;
- }
-
- public void setSpecifiedNillable(Boolean newSpecifiedNillable) {
- this.annotation.setNillable(newSpecifiedNillable);
- this.setSpecifiedNillable_(newSpecifiedNillable);
- }
-
- protected void setSpecifiedNillable_(Boolean newSpecifiedNillable) {
- Boolean oldNillable = this.specifiedNillable;
- this.specifiedNillable = newSpecifiedNillable;
- firePropertyChanged(SPECIFIED_NILLABLE_PROPERTY, oldNillable, newSpecifiedNillable);
- }
-
- protected Boolean buildSpecifiedNillable() {
- return this.annotation.getNillable();
- }
-
-
- // **************** misc **************************************************
-
- public XsdElementDeclaration getXsdElementDeclaration() {
- XsdTypeDefinition xsdType = getPersistentAttribute().getClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? null : xsdType.getElement(this.qName.getNamespace(), this.qName.getName());
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
-
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
-
- protected class XmlElementQName
- extends AbstractJavaQName {
-
- protected XmlElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- public String getDefaultName() {
- return "";
- }
-
- @Override
- public String getDefaultNamespace() {
- return (GenericJavaXmlElementWrapper.this.getJaxbPackage().getElementFormDefault() == XmlNsForm.QUALIFIED) ?
- GenericJavaXmlElementWrapper.this.getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = GenericJavaXmlElementWrapper.this.getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? EmptyIterable.instance() : xsdType.getElementNameProposals(getNamespace(), filter);
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = GenericJavaXmlElementWrapper.this.getJaxbPackage().getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type == null) {
- return;
- }
-
- if (type.getElement(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElementWrapper.this.annotation;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java
deleted file mode 100644
index 04047dcebe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementsMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementsAnnotation>
- implements XmlElementsMapping {
-
- protected final ContextListContainer<XmlElement, XmlElementAnnotation> xmlElementContainer;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlIDREF xmlIDREF;
-
-
- public GenericJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementContainer = this.buildXmlElementContainer();
- initializeXmlElementWrapper();
- initializeXmlIDREF();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementContainer.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlIDREF();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementContainer.update();
- updateXmlElementWrapper();
- updateXmlIDREF();
- }
-
-
- // ***** xml elements *****
-
- public ListIterable<XmlElement> getXmlElements() {
- return this.xmlElementContainer.getContextElements();
- }
-
- public int getXmlElementsSize() {
- return this.xmlElementContainer.getContextElementsSize();
- }
-
- public XmlElement addXmlElement(int index) {
- XmlElementAnnotation annotation = getAnnotation().addXmlElement(index);
- return this.xmlElementContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlElement(int index) {
- getAnnotation().removeXmlElement(index);
- this.xmlElementContainer.removeContextElement(index);
- }
-
- public void removeXmlElement(XmlElement xmlElement) {
- removeXmlElement(this.xmlElementContainer.indexOfContextElement(xmlElement));
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- getAnnotation().moveXmlElement(targetIndex, sourceIndex);
- this.xmlElementContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlElement buildXmlElement(XmlElementAnnotation xmlElementAnnotation) {
- return new GenericJavaXmlElement(this, new XmlElementContext(xmlElementAnnotation));
- }
-
- protected ListIterable<XmlElementAnnotation> getXmlElementAnnotations() {
- return getAnnotation().getXmlElements();
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- XmlElementWrapperAnnotation annotation =
- (XmlElementWrapperAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper(annotation);
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper(XmlElementWrapperAnnotation xmlElementWrapperAnnotation) {
- return new GenericJavaXmlElementWrapper(this, xmlElementWrapperAnnotation);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected void initializeXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = getXmlElementWrapperAnnotation();
- if (annotation != null) {
- this.xmlElementWrapper = buildXmlElementWrapper(annotation);
- }
- }
-
- protected void syncXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = getXmlElementWrapperAnnotation();
- if (annotation != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper(annotation));
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
- protected ContextListContainer<XmlElement, XmlElementAnnotation> buildXmlElementContainer() {
- XmlElementContainer container = new XmlElementContainer();
- container.initialize();
- return container;
- }
-
-
- // ***** XmlIDREF *****
-
- public XmlIDREF getXmlIDREF() {
- return this.xmlIDREF;
- }
-
- protected void setXmlIDREF_(XmlIDREF xmlIDREF) {
- XmlIDREF oldXmlIDREF = this.xmlIDREF;
- this.xmlIDREF = xmlIDREF;
- firePropertyChanged(XML_IDREF_PROPERTY, oldXmlIDREF, xmlIDREF);
- }
-
- public XmlIDREF addXmlIDREF() {
- if (this.xmlIDREF != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_IDREF);
- XmlIDREF xmlIDREF = buildXmlIDREF();
- setXmlIDREF_(xmlIDREF);
- return xmlIDREF;
- }
-
- public void removeXmlIDREF() {
- if (this.xmlIDREF == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_IDREF);
- setXmlIDREF_(null);
- }
-
- protected void initializeXmlIDREF() {
- if (getXmlIDREFAnnotation() != null) {
- this.xmlIDREF = buildXmlIDREF();
- }
- }
-
- protected void syncXmlIDREF() {
- if (getXmlIDREFAnnotation() == null) {
- setXmlIDREF_(null);
- }
- else if (this.xmlIDREF == null) {
- setXmlIDREF_(buildXmlIDREF());
- }
- else {
- this.xmlIDREF.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlIDREF() {
- if (this.xmlIDREF != null) {
- this.xmlIDREF.update();
- }
- }
- protected XmlIDREFAnnotation getXmlIDREFAnnotation() {
- return (XmlIDREFAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_IDREF);
- }
-
- protected XmlIDREF buildXmlIDREF() {
- return new GenericJavaXmlIDREF(this, buildXmlIDREFContext());
- }
-
- protected XmlIDREFContext buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getReferencedXmlTypeNames(),
- new CompositeIterable<String>(
- new TransformationIterable<XmlElement, Iterable<String>>(getXmlElements()) {
- @Override
- protected Iterable<String> transform(XmlElement o) {
- return o.getReferencedXmlTypeNames();
- }
- }));
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (XmlElement xmlElement : getXmlElements()) {
- result = xmlElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateDuplicateTypesAndQNames(messages, reporter, astRoot);
-
- for (XmlElement xmlElement : getXmlElements()) {
- xmlElement.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlIDREF != null) {
- this.xmlIDREF.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- Bag<String> xmlElementTypes = new HashBag<String>();
- Bag<QName> xmlElementQnames = new HashBag<QName>();
-
- for (XmlElement xmlElement : getXmlElements()) {
- String typeName = xmlElement.getFullyQualifiedType();
- if (! StringTools.stringIsEmpty(typeName)) {
- xmlElementTypes.add(typeName);
- }
- String elementName = xmlElement.getQName().getName();
- if (! StringTools.stringIsEmpty(elementName)) {
- xmlElementQnames.add(new QName(xmlElement.getQName().getNamespace(), elementName));
- }
- }
-
- for (XmlElement xmlElement : getXmlElements()) {
- String xmlElementType = xmlElement.getFullyQualifiedType();
- if (xmlElementTypes.count(xmlElementType) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE,
- new String[] { xmlElementType },
- xmlElement,
- xmlElement.getTypeTextRange(astRoot)));
- }
-
- String xmlElementNamespace = xmlElement.getQName().getNamespace();
- String xmlElementName = xmlElement.getQName().getName();
- if (xmlElementQnames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName },
- xmlElement,
- xmlElement.getQName().getNameTextRange(astRoot)));
- }
- }
- }
-
-
- protected class XmlElementContainer
- extends ContextListContainer<XmlElement, XmlElementAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlElementsMapping.XML_ELEMENTS_LIST;
- }
-
- @Override
- protected XmlElement buildContextElement(XmlElementAnnotation resourceElement) {
- return GenericJavaXmlElementsMapping.this.buildXmlElement(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlElementAnnotation> getResourceElements() {
- return GenericJavaXmlElementsMapping.this.getXmlElementAnnotations();
- }
-
- @Override
- protected XmlElementAnnotation getResourceElement(XmlElement contextElement) {
- // in the context of this mapping, there will never be an XmlElement without an annotation
- return contextElement.getAnnotation(false);
- }
- }
-
-
- protected class XmlElementContext
- implements GenericJavaXmlElement.Context {
-
- protected XmlElementAnnotation annotation;
-
- protected XmlElementContext(XmlElementAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- // will never be null in this context
- return annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementsMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementsMapping.this.getXmlElementWrapper();
- }
- }
-
-
- protected class XmlIDREFContext
- implements GenericJavaXmlIDREF.Context {
-
- public XmlIDREFAnnotation getAnnotation() {
- return GenericJavaXmlElementsMapping.this.getXmlIDREFAnnotation();
- }
-
- public Iterable<ValidatableReference> getReferences() {
- return new TransformationIterable<XmlElement, ValidatableReference>(
- GenericJavaXmlElementsMapping.this.getXmlElements()) {
-
- @Override
- protected ValidatableReference transform(final XmlElement o) {
-
- return new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return o.getFullyQualifiedType();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return o.getTypeTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return o.getXsdElement();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return o.getQName().getNameTextRange(astRoot);
- }
- };
- }
- };
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java
deleted file mode 100644
index 365be91bbd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbBasicMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.util.XSDUtil;
-
-public class GenericJavaXmlID
- extends AbstractJavaContextNode
- implements XmlID
-{
-
- protected final XmlIDAnnotation resourceXmlID;
-
- public GenericJavaXmlID(JaxbBasicMapping parent, XmlIDAnnotation resource) {
- super(parent);
- this.resourceXmlID = resource;
- }
-
-
- public JaxbBasicMapping getMapping() {
- return (JaxbBasicMapping) getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getMapping().getPersistentAttribute();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(String.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__ATTRIBUTE_TYPE_NOT_STRING,
- this,
- getValidationTextRange(astRoot)));
- }
-
- XsdFeature xsdFeature = getMapping().getXsdFeature();
- if (xsdFeature != null) {
- XsdTypeDefinition xsdType = xsdFeature.getType();
- if (xsdType != null &&
- ! xsdType.matches(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, "ID")) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__SCHEMA_TYPE_NOT_ID,
- this,
- getValidationTextRange(astRoot)));
- }
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlID.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java
deleted file mode 100644
index 15b8238fd5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.util.XSDUtil;
-
-public class GenericJavaXmlIDREF
- extends AbstractJavaContextNode
- implements XmlIDREF {
-
- protected final Context context;
-
-
- public GenericJavaXmlIDREF(JaxbAttributeMapping parent, Context context) {
- super(parent);
- this.context = context;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- for (ValidatableReference ref : this.context.getReferences()) {
- String typeName = ref.getFullyQualifiedType();
-
- // Object may be used in some cases of a *single* type, but can't be validated
- if (! (Object.class.getName().equals(typeName) && CollectionTools.size(this.context.getReferences()) == 1)) {
-
- JaxbClassMapping classMapping = getContextRoot().getClassMapping(typeName);
- if (classMapping == null || classMapping.getXmlIdMapping() == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_IDREF__TYPE_DOES_NOT_CONTAIN_XML_ID,
- new String[] { typeName },
- this,
- ref.getTypeTextRange(astRoot)));
- }
- }
-
- XsdFeature xsdFeature = ref.getXsdFeature();
- XsdTypeDefinition xsdType = (xsdFeature == null) ? null : xsdFeature.getType();
- if (xsdType != null &&
- ! xsdType.matches(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, "IDREF")) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID_REF__SCHEMA_TYPE_NOT_IDREF,
- new String [] { xsdFeature.getName() },
- this,
- ref.getXsdFeatureTextRange(astRoot)));
- }
- }
- }
-
-
- public interface Context {
-
- XmlIDREFAnnotation getAnnotation();
-
- Iterable<ValidatableReference> getReferences();
- }
-
-
- public interface ValidatableReference {
-
- String getFullyQualifiedType();
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- XsdFeature getXsdFeature();
-
- TextRange getXsdFeatureTextRange(CompilationUnit astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java
deleted file mode 100644
index 543a8fd84c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbBasicMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlList;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.XSDVariety;
-
-public class GenericJavaXmlList
- extends AbstractJavaContextNode
- implements XmlList {
-
- protected final XmlListAnnotation resourceXmlList;
-
-
- public GenericJavaXmlList(JaxbBasicMapping parent, XmlListAnnotation resource) {
- super(parent);
- this.resourceXmlList = resource;
- }
-
-
- public JaxbBasicMapping getMapping() {
- return (JaxbBasicMapping) getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getMapping().getPersistentAttribute();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- else {
- String dataType = getMapping().getDataTypeName();
- boolean noTypeAssociated = false;
- XsdTypeDefinition itemXsdType = null;
-
- JaxbType jaxbType = getContextRoot().getType(dataType);
- if (jaxbType != null) {
- JaxbTypeMapping typeMapping = jaxbType.getMapping();
- if (typeMapping != null) {
- itemXsdType = typeMapping.getXsdTypeDefinition();
- }
- }
- else {
- String builtInType = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(dataType);
- if (builtInType != null) {
- XsdSchema xsdSchema = XsdUtil.getSchemaForSchema();
- itemXsdType = xsdSchema.getTypeDefinition(builtInType);
- }
- else {
- noTypeAssociated = true;
- }
- }
-
- if (noTypeAssociated
- || itemXsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE
- || ((XsdSimpleTypeDefinition) itemXsdType).getXSDComponent().getVariety() == XSDVariety.LIST_LITERAL) {
-
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE,
- new String[] { dataType },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlList.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java
deleted file mode 100644
index 4898ebd157..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-public class GenericJavaXmlMixed
- extends AbstractJavaContextNode
- implements XmlMixed {
-
- protected final XmlMixedAnnotation resourceXmlMixed;
-
-
- public GenericJavaXmlMixed(JaxbAttributeMapping parent, XmlMixedAnnotation resource) {
- super(parent);
- this.resourceXmlMixed = resource;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
-
- //************* validation ****************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlMixed.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
deleted file mode 100644
index 6535eeaec4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-public class GenericJavaXmlNs
- extends AbstractJaxbContextNode
- implements XmlNs
-{
-
- protected final XmlNsAnnotation resourceXmlNs;
-
- protected String namespaceURI;
-
- protected String prefix;
-
- public GenericJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
- super(parent);
- this.resourceXmlNs = xmlNsAnnotation;
- this.namespaceURI = this.getResourceNamespaceURI();
- this.prefix = this.getResourcePrefix();
- }
-
- public XmlNsAnnotation getResourceXmlNs() {
- return this.resourceXmlNs;
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setNamespaceURI_(this.getResourceNamespaceURI());
- this.setPrefix_(this.getResourcePrefix());
- }
-
-
- @Override
- public JaxbPackageInfo getParent() {
- return (JaxbPackageInfo) super.getParent();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getParent().getResourcePackage();
- }
-
-
- // ********** namespaceURI **********
-
- public String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- public void setNamespaceURI(String namespace) {
- this.resourceXmlNs.setNamespaceURI(namespace);
- this.setNamespaceURI_(namespace);
- }
-
- protected void setNamespaceURI_(String namespaceURI) {
- String old = this.namespaceURI;
- this.namespaceURI = namespaceURI;
- this.firePropertyChanged(NAMESPACE_URI_PROPERTY, old, namespaceURI);
- }
-
- protected String getResourceNamespaceURI() {
- return this.resourceXmlNs.getNamespaceURI();
- }
-
- // ********** prefix **********
-
- public String getPrefix() {
- return this.prefix;
- }
-
- public void setPrefix(String prefix) {
- this.resourceXmlNs.setPrefix(prefix);
- this.setPrefix_(prefix);
- }
-
- protected void setPrefix_(String prefix) {
- String old = this.prefix;
- this.prefix = prefix;
- this.firePropertyChanged(PREFIX_PROPERTY, old, prefix);
- }
-
- protected String getResourcePrefix() {
- return this.resourceXmlNs.getPrefix();
- }
-
-
- //****************** miscellaneous ********************
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.namespaceURI);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java
deleted file mode 100644
index 63b7b64d1d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlRegistry
- extends AbstractJavaContextNode
- implements XmlRegistry {
-
- protected final ElementFactoryMethodContainer elementFactoryMethodContainer;
-
-
- public GenericJavaXmlRegistry(JaxbClass parent) {
- super(parent);
- this.elementFactoryMethodContainer = new ElementFactoryMethodContainer();
-
- initElementFactoryMethods();
- }
-
-
- public JaxbClass getJaxbClass() {
- return (JaxbClass) getParent();
- }
-
- public JavaResourceType getJavaResourceType() {
- return getJaxbClass().getJavaResourceType();
- }
-
- protected XmlRegistryAnnotation getAnnotation() {
- return (XmlRegistryAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_REGISTRY);
- }
-
- public JaxbPackage getJaxbPackage() {
- return getJaxbClass().getJaxbPackage();
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncElementFactoryMethods();
- }
-
- @Override
- public void update() {
- super.update();
- updateElementFactoryMethods();
- }
-
-
- // ***** element factory methods *****
-
- public Iterable<JaxbElementFactoryMethod> getElementFactoryMethods() {
- return this.elementFactoryMethodContainer.getContextElements();
- }
-
- public int getElementFactoryMethodsSize() {
- return this.elementFactoryMethodContainer.getContextElementsSize();
- }
-
- protected void initElementFactoryMethods() {
- this.elementFactoryMethodContainer.initialize();
- }
-
- protected void syncElementFactoryMethods() {
- this.elementFactoryMethodContainer.synchronizeWithResourceModel();
- }
-
- protected void updateElementFactoryMethods() {
- this.elementFactoryMethodContainer.update();
- }
-
- private JaxbElementFactoryMethod buildElementFactoryMethod(JavaResourceMethod resourceMethod) {
- return getFactory().buildJavaElementFactoryMethod(this, resourceMethod);
- }
-
- private Iterable<JavaResourceMethod> getResourceElementFactoryMethods() {
- return new FilteringIterable<JavaResourceMethod>(getJavaResourceType().getMethods()) {
- @Override
- protected boolean accept(JavaResourceMethod method) {
- return methodIsElementFactoryMethod(method);
- }
- };
- }
-
- // Return methods with XmlElementDecl annotation
- protected static boolean methodIsElementFactoryMethod(JavaResourceMethod method) {
- return methodHasXmlElementDeclAnnotation(method);
- }
-
- protected static boolean methodHasXmlElementDeclAnnotation(JavaResourceMethod method) {
- return method.getAnnotation(JAXB.XML_ELEMENT_DECL) != null;
- }
-
- protected static boolean methodReturnTypeIsJAXBElement(JavaResourceMethod method) {
- return method.typeIsSubTypeOf(JAXB.XML_ELEMENT);
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (JaxbElementFactoryMethod efm : getElementFactoryMethods()) {
- result = efm.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.<String>instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : getJaxbClass().getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateDuplicateQNames(messages, reporter, astRoot);
-
- for (JaxbElementFactoryMethod efm : getElementFactoryMethods()) {
- efm.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- Map<String, Bag<QName>> xmlElementDeclQnames = new HashMap<String, Bag<QName>>();
-
- for (JaxbElementFactoryMethod xmlElementDecl : getElementFactoryMethods()) {
- String elementDeclName = xmlElementDecl.getQName().getName();
- if (! StringTools.stringIsEmpty(elementDeclName)) {
- String fqScope = xmlElementDecl.getFullyQualifiedScope();
- if (xmlElementDeclQnames.get(fqScope) == null) {
- xmlElementDeclQnames.put(fqScope, new HashBag<QName>());
- }
- xmlElementDeclQnames.get(fqScope).add(new QName(xmlElementDecl.getQName().getNamespace(), elementDeclName));
- }
- }
-
- for (JaxbElementFactoryMethod xmlElementDecl : getElementFactoryMethods()) {
- String fqScope = xmlElementDecl.getFullyQualifiedScope();
- String xmlElementNamespace = xmlElementDecl.getQName().getNamespace();
- String xmlElementName = xmlElementDecl.getQName().getName();
- if (xmlElementDeclQnames.get(fqScope).count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- String scopeDesc = "";
- if (! JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME.equals(fqScope)) {
- scopeDesc = NLS.bind(JptJaxbCoreMessages.XML_ELEMENT_DECL__SCOPE, fqScope);
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName, scopeDesc },
- xmlElementDecl,
- xmlElementDecl.getQName().getNameTextRange(astRoot)));
- }
- }
- }
-
-
- /**
- * element factory method container adapter
- */
- protected class ElementFactoryMethodContainer
- extends ContextCollectionContainer<JaxbElementFactoryMethod, JavaResourceMethod> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlRegistry.ELEMENT_FACTORY_METHODS_COLLECTION;
- }
-
- @Override
- protected JaxbElementFactoryMethod buildContextElement(JavaResourceMethod resourceElement) {
- return GenericJavaXmlRegistry.this.buildElementFactoryMethod(resourceElement);
- }
-
- @Override
- protected Iterable<JavaResourceMethod> getResourceElements() {
- return GenericJavaXmlRegistry.this.getResourceElementFactoryMethods();
- }
-
- @Override
- protected JavaResourceMethod getResourceElement(JaxbElementFactoryMethod contextElement) {
- return contextElement.getResourceMethod();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java
deleted file mode 100644
index 891c9ea630..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlRootElement
- extends AbstractJavaContextNode
- implements XmlRootElement {
-
- protected final XmlRootElementAnnotation annotation;
-
- protected JaxbQName qName;
-
-
- public GenericJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation resourceXmlRootElementAnnotation) {
- super(parent);
- this.annotation = resourceXmlRootElementAnnotation;
- this.qName = buildQName();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlRootElementQName(this);
- }
-
- public JaxbTypeMapping getTypeMapping() {
- return (JaxbTypeMapping) getParent();
- }
-
- protected JaxbType getJaxbType() {
- return getTypeMapping().getJaxbType();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbType().getJaxbPackage();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ***** schema element ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.qName.validate(messages, reporter, astRoot);
- }
-
-
- //****************** miscellaneous ********************
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.qName.toString());
- }
-
-
- protected class XmlRootElementQName
- extends AbstractJavaQName {
-
- protected XmlRootElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- public String getDefaultNamespace() {
- return GenericJavaXmlRootElement.this.getJaxbPackage().getNamespace();
- }
-
- @Override
- public String getDefaultName() {
- return Introspector.decapitalize(GenericJavaXmlRootElement.this.getJaxbType().getSimpleName());
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = GenericJavaXmlRootElement.this.getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = GenericJavaXmlRootElement.this.getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getElementNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String name = getName();
- String namespace = getNamespace();
- XsdSchema schema = GenericJavaXmlRootElement.this.getJaxbPackage().getXsdSchema();
-
- if (schema != null) {
- // element must resolve
- XsdElementDeclaration schemaElement = schema.getElementDeclaration(namespace, name);
- if (schemaElement == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- else {
- // element type must agree with parent's schema type
- XsdTypeDefinition schemaType = GenericJavaXmlRootElement.this.getTypeMapping().getXsdTypeDefinition();
- if (schemaType != null) {
- if (! schemaType.equals(schemaElement.getType())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE,
- new String[] {name, namespace},
- this,
- getValidationTextRange(astRoot)));
- }
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlRootElement.this.annotation;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
deleted file mode 100644
index 9499e65b49..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.XSDForm;
-
-public class GenericJavaXmlSchema
- extends AbstractJavaContextNode
- implements XmlSchema {
-
- protected String specifiedNamespace;
-
- protected String location;
-
- protected XmlNsForm specifiedAttributeFormDefault;
-
- protected XmlNsForm specifiedElementFormDefault;
-
- protected final ContextListContainer<XmlNs, XmlNsAnnotation> xmlNsPrefixContainer;
-
-
- public GenericJavaXmlSchema(JaxbPackageInfo parent) {
- super(parent);
- this.specifiedNamespace = this.getResourceNamespace();
- this.location = this.getResourceLocation();
- this.specifiedAttributeFormDefault = getResourceAttributeFormDefault();
- this.specifiedElementFormDefault = getResourceElementFormDefault();
- this.xmlNsPrefixContainer = this.buildXmlNsPrefixContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedNamespace_(this.getResourceNamespace());
- this.setLocation_(this.getResourceLocation());
- this.setSpecifiedAttributeFormDefault_(getResourceAttributeFormDefault());
- this.setSpecifiedElementFormDefault_(getResourceElementFormDefault());
- this.syncXmlNsPrefixes();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateXmlNsPrefixes();
- }
-
- @Override
- public JaxbPackageInfo getParent() {
- return (JaxbPackageInfo) super.getParent();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getParent().getJaxbPackage();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getParent().getResourcePackage();
- }
-
-
- // ********** xml schema annotation **********
-
- protected XmlSchemaAnnotation getXmlSchemaAnnotation() {
- return (XmlSchemaAnnotation) this.getResourcePackage().getNonNullAnnotation(JAXB.XML_SCHEMA);
- }
-
- // ********** namespace **********
-
- public String getNamespace() {
- return (this.specifiedNamespace == null) ? "" : this.specifiedNamespace; //$NON-NLS-1$
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String namespace) {
- this.getXmlSchemaAnnotation().setNamespace(namespace);
- this.setSpecifiedNamespace_(namespace);
- }
-
- protected void setSpecifiedNamespace_(String namespace) {
- String old = this.specifiedNamespace;
- this.specifiedNamespace = namespace;
- this.firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, old, namespace);
- }
-
- protected String getResourceNamespace() {
- return getXmlSchemaAnnotation().getNamespace();
- }
-
-
- // ********** location **********
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- this.getXmlSchemaAnnotation().setLocation(location);
- this.setLocation_(location);
- }
-
- protected void setLocation_(String location) {
- String old = this.location;
- this.location = location;
- this.firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- protected String getResourceLocation() {
- return getXmlSchemaAnnotation().getLocation();
- }
-
-
- // ********** attribute form default **********
-
- public XmlNsForm getAttributeFormDefault() {
- return (this.specifiedAttributeFormDefault == null) ? XmlNsForm.UNSET : this.specifiedAttributeFormDefault;
- }
-
- public XmlNsForm getSpecifiedAttributeFormDefault() {
- return this.specifiedAttributeFormDefault;
- }
-
- public void setSpecifiedAttributeFormDefault(XmlNsForm attributeFormDefault) {
- getXmlSchemaAnnotation().setAttributeFormDefault(XmlNsForm.toJavaResourceModel(attributeFormDefault));
- setSpecifiedAttributeFormDefault_(attributeFormDefault);
- }
-
- protected void setSpecifiedAttributeFormDefault_(XmlNsForm attributeFormDefault) {
- XmlNsForm old = this.specifiedAttributeFormDefault;
- this.specifiedAttributeFormDefault = attributeFormDefault;
- firePropertyChanged(SPECIFIED_ATTRIBUTE_FORM_DEFAULT_PROPERTY, old, attributeFormDefault);
- }
-
- protected XmlNsForm getResourceAttributeFormDefault() {
- return XmlNsForm.fromJavaResourceModel(getXmlSchemaAnnotation().getAttributeFormDefault());
- }
-
-
- // ********** element form default **********
-
- public XmlNsForm getElementFormDefault() {
- return (this.specifiedElementFormDefault == null) ? XmlNsForm.UNSET : this.specifiedElementFormDefault;
- }
-
- public XmlNsForm getSpecifiedElementFormDefault() {
- return this.specifiedElementFormDefault;
- }
-
- public void setSpecifiedElementFormDefault(XmlNsForm elementFormDefault) {
- getXmlSchemaAnnotation().setElementFormDefault(XmlNsForm.toJavaResourceModel(elementFormDefault));
- setSpecifiedElementFormDefault_(elementFormDefault);
- }
-
- protected void setSpecifiedElementFormDefault_(XmlNsForm elementFormDefault) {
- XmlNsForm old = this.specifiedElementFormDefault;
- this.specifiedElementFormDefault = elementFormDefault;
- firePropertyChanged(SPECIFIED_ELEMENT_FORM_DEFAULT_PROPERTY, old, elementFormDefault);
- }
-
- protected XmlNsForm getResourceElementFormDefault() {
- return XmlNsForm.fromJavaResourceModel(getXmlSchemaAnnotation().getElementFormDefault());
- }
-
-
- // ********** xml namespace prefixes **********
-
- public ListIterable<XmlNs> getXmlNsPrefixes() {
- return this.xmlNsPrefixContainer.getContextElements();
- }
-
- public int getXmlNsPrefixesSize() {
- return this.xmlNsPrefixContainer.getContextElementsSize();
- }
-
- public XmlNs addXmlNsPrefix(int index) {
- XmlNsAnnotation annotation = this.getXmlSchemaAnnotation().addXmlns(index);
- return this.xmlNsPrefixContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlNsPrefix(XmlNs xmlNsPrefix) {
- this.removeXmlNsPrefix(this.xmlNsPrefixContainer.indexOfContextElement(xmlNsPrefix));
- }
-
- public void removeXmlNsPrefix(int index) {
- this.getXmlSchemaAnnotation().removeXmlns(index);
- this.xmlNsPrefixContainer.removeContextElement(index);
- }
-
- public void moveXmlNsPrefix(int targetIndex, int sourceIndex) {
- this.getXmlSchemaAnnotation().moveXmlns(targetIndex, sourceIndex);
- this.xmlNsPrefixContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlNs buildXmlNs(XmlNsAnnotation xmlNsAnnotation) {
- return this.getFactory().buildJavaXmlNs(this, xmlNsAnnotation);
- }
-
- protected void syncXmlNsPrefixes() {
- this.xmlNsPrefixContainer.synchronizeWithResourceModel();
- }
-
- protected void updateXmlNsPrefixes() {
- this.xmlNsPrefixContainer.update();
- }
-
- protected ListIterable<XmlNsAnnotation> getXmlNsAnnotations() {
- return getXmlSchemaAnnotation().getXmlns();
- }
-
- protected ContextListContainer<XmlNs, XmlNsAnnotation> buildXmlNsPrefixContainer() {
- XmlNsPrefixContainer container = new XmlNsPrefixContainer();
- container.initialize();
- return container;
- }
-
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (namespaceTouches(pos, astRoot)) {
- return getNamespaceProposals(filter);
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().namespaceTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- getJaxbProject().getSchemaLibrary().getSchemaLocations().keySet(), filter));
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().getTextRange(astRoot);
- }
-
-
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // removing this validation message for now: see jaxb bug 823 (http://java.net/jira/browse/JAXB-823)
-// XsdSchema schema = getJaxbPackage().getXsdSchema();
-// if (schema != null) {
-// if (formConflicts(getAttributeFormDefault(), schema.getXSDComponent().getAttributeFormDefault())) {
-// messages.add(
-// DefaultValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// JaxbValidationMessages.XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT,
-// this,
-// getXmlSchemaAnnotation().getAttributeFormDefaultTextRange(astRoot)));
-// }
-//
-// if (formConflicts(getElementFormDefault(), schema.getXSDComponent().getElementFormDefault())) {
-// messages.add(
-// DefaultValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// JaxbValidationMessages.XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT,
-// this,
-// getXmlSchemaAnnotation().getElementFormDefaultTextRange(astRoot)));
-// }
-// }
- }
-
- protected boolean formConflicts(XmlNsForm form, XSDForm xsdForm) {
- return (form == XmlNsForm.QUALIFIED) ^ (xsdForm == XSDForm.QUALIFIED_LITERAL);
- }
-
-
- /**
- * xml ns prefix container adapter
- */
- protected class XmlNsPrefixContainer
- extends ContextListContainer<XmlNs, XmlNsAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XML_NS_PREFIXES_LIST;
- }
-
- @Override
- protected XmlNs buildContextElement(XmlNsAnnotation resourceElement) {
- return GenericJavaXmlSchema.this.buildXmlNs(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlNsAnnotation> getResourceElements() {
- return GenericJavaXmlSchema.this.getXmlNsAnnotations();
- }
-
- @Override
- protected XmlNsAnnotation getResourceElement(XmlNs contextElement) {
- return contextElement.getResourceXmlNs();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
deleted file mode 100644
index f32cc4db99..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class GenericJavaXmlSchemaType
- extends AbstractJavaContextNode
- implements XmlSchemaType {
-
- protected final XmlSchemaTypeAnnotation annotation;
-
- protected JaxbQName qName;
-
- protected String type;
-
-
- protected GenericJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.qName = buildQName();
- this.type = this.getResourceTypeString();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlSchemaTypeQName(this);
- }
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- public XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() {
- return this.annotation;
- }
-
- protected abstract JaxbPackage getJaxbPackage();
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- this.setType_(this.getResourceTypeString());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ********** type **********
-
- public String getType() {
- return this.type;
- }
-
- public void setType(String location) {
- this.annotation.setType(location);
- this.setType_(location);
- }
-
- protected void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- }
-
- protected String getResourceTypeString() {
- return this.annotation.getType();
- }
-
- public String getFullyQualifiedType() {
- return getXmlSchemaTypeAnnotation().getFullyQualifiedType();
- }
-
-
- // ***** misc *****
-
- protected XsdTypeDefinition getXsdTypeDefinition_() {
- XsdSchema xsdSchema = getJaxbPackage().getXsdSchema();
- if (xsdSchema == null) {
- return null;
- }
-
- if (! StringTools.stringIsEmpty(this.qName.getName())) {
- return xsdSchema.getTypeDefinition(this.qName.getNamespace(), this.qName.getName());
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.qName.validate(messages, reporter, astRoot);
-
- XsdTypeDefinition xsdType = getXsdTypeDefinition_();
- if (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__NON_SIMPLE_TYPE,
- new String[] { qName.getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- protected TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getXmlSchemaTypeAnnotation().getTypeTextRange(astRoot);
- }
-
-
- protected class XmlSchemaTypeQName
- extends AbstractJavaQName {
-
- protected XmlSchemaTypeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_TYPE_DESC;
- }
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- return XmlSchemaType.DEFAULT_NAMESPACE;
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = GenericJavaXmlSchemaType.this.getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = GenericJavaXmlSchemaType.this.getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getSimpleTypeNameProposals(getNamespace(), filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String name = getName();
- String namespace = getNamespace();
-
- if (! StringTools.stringIsEmpty(name)) {
- XsdSchema schema = GenericJavaXmlSchemaType.this.getJaxbPackage().getXsdSchema();
-
- if (schema != null) {
- XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name);
- if (schemaType == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlSchemaType.this.annotation;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java
deleted file mode 100644
index d4216aa54f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-public class GenericJavaXmlSeeAlso
- extends AbstractJavaContextNode
- implements XmlSeeAlso {
-
- protected final XmlSeeAlsoAnnotation annotation;
-
- protected final ListContainer<String, String> valueContainer;
-
-
- public GenericJavaXmlSeeAlso(JaxbTypeMapping parent, XmlSeeAlsoAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.valueContainer = this.buildValueContainer();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.valueContainer.synchronizeWithResourceModel();
- }
-
- public ListIterable<String> getClasses() {
- return this.valueContainer.getContextElements();
- }
-
- public int getClassesSize() {
- return this.valueContainer.getContextElementsSize();
- }
-
- public void addClass(int index, String clazz) {
- this.annotation.addClass(index, clazz);
- this.valueContainer.addContextElement(index, clazz);
- }
-
- public void removeClass(int index) {
- this.annotation.removeClass(index);
- this.valueContainer.removeContextElement(index);
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- this.annotation.moveClass(targetIndex, sourceIndex);
- this.valueContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.annotation.getFullyQualifiedClasses();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- protected ListContainer<String, String> buildValueContainer() {
- ValueContainer container = new ValueContainer();
- container.initialize();
- return container;
- }
-
-
- protected class ValueContainer
- extends ListContainer<String, String> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return CLASSES_LIST;
- }
-
- @Override
- protected String buildContextElement(String resourceElement) {
- return resourceElement;
- }
-
- @Override
- protected ListIterable<String> getResourceElements() {
- return GenericJavaXmlSeeAlso.this.annotation.getClasses();
- }
-
- @Override
- protected String getResourceElement(String contextElement) {
- return contextElement;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java
deleted file mode 100644
index ba23f4ee1c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-public class GenericJavaXmlTransientMapping
- extends AbstractJavaAttributeMapping<XmlTransientAnnotation> {
-
- public GenericJavaXmlTransientMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return EmptyIterable.instance();
- }
-
- @Override
- public boolean isTransient() {
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java
deleted file mode 100644
index 676ca69cf7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-public class GenericJavaXmlValueMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlValueAnnotation>
- implements XmlValueMapping {
-
- public GenericJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java
deleted file mode 100644
index 043df34f37..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAnyAttributeMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlAnyAttributeMappingDefinition INSTANCE =
- new JavaXmlAnyAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_JAVA_TYPE_ADAPTER };
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlAnyAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAnyAttributeMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java
deleted file mode 100644
index b020381b71..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAnyElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlAnyElementMappingDefinition INSTANCE =
- new JavaXmlAnyElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_ELEMENT_REF,
- JAXB.XML_ELEMENT_REFS,
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED };
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlAnyElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAnyElementMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java
deleted file mode 100644
index 13a7ee3d69..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAttributeMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlAttributeMappingDefinition INSTANCE =
- new JavaXmlAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_ATTACHMENT_REF,
- JAXB.XML_ID,
- JAXB.XML_IDREF,
- JAXB.XML_INLINE_BINARY_DATA,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_LIST,
- JAXB.XML_MIME_TYPE,
- JAXB.XML_SCHEMA_TYPE };
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAttributeMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java
deleted file mode 100644
index 061d49863d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
- implements DefaultJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlElementMappingDefinition INSTANCE =
- new JavaXmlElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- JAXB.XML_ID,
- JAXB.XML_IDREF,
- JAXB.XML_LIST,
- JAXB.XML_SCHEMA_TYPE,
- JAXB.XML_ATTACHMENT_REF,
- JAXB.XML_MIME_TYPE,
- JAXB.XML_INLINE_BINARY_DATA,
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER };
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementMapping(parent);
- }
-
- /**
- * From the JAXB spec section 8.12.5.1 Default Mapping:
- * <p>
- * A single valued property or field must be mapped by with the following default mapping annotation:<ul>
- * <li> @XmlElement
- * </ul>
- * <p>
- * A property or field with a collection type must be mapped by with the following default mapping annotation:<ul>
- * <li> if the property or field is annotated with @XmlList, then the default mapping annotation is:<ul>
- * <li> @XmlElement
- * </ul>
- * <li> otherwise the default mapping annotation is:<ul>
- * <li> @XmlElements({ @XmlElement(nillable=true)})
- * (NB: this actually means the same as
- * @XmlElement(nillable=true)
- * )
- * </ul>
- */
- public boolean isDefault(JaxbPersistentAttribute persistentAttribute) {
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java
deleted file mode 100644
index 17f8980158..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementRefMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaXmlElementRefMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlElementRefMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementRefMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java
deleted file mode 100644
index ebd6beba8d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementRefsMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaXmlElementRefsMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlElementRefsMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementRefsMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java
deleted file mode 100644
index e9556e627d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementsMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE
- = new JavaXmlElementsMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlElementsMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_IDREF,
- JAXB.XML_JAVA_TYPE_ADAPTER });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementsMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java
deleted file mode 100644
index 67e2c10523..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlTransientMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlTransientMappingDefinition INSTANCE =
- new JavaXmlTransientMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlTransientMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlTransientMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java
deleted file mode 100644
index 4fbc899a2a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlValueMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlValueMappingDefinition INSTANCE =
- new JavaXmlValueMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_LIST,
- JAXB.XML_JAVA_TYPE_ADAPTER };
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlValueMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlValueMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java
deleted file mode 100644
index 125950698e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-
-public class PropertyAccessor
- extends AbstractJavaContextNode
- implements Accessor {
-
-
- protected final JavaResourceMethod resourceGetter;
-
- protected final JavaResourceMethod resourceSetter;
-
- public PropertyAccessor(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- super(parent);
- this.resourceGetter = resourceGetter;
- this.resourceSetter = resourceSetter;
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.calculateResourceMethodToAnnotate();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return null in this case
- //rather than attempting to define the type from the setter's parameters
- return getterMethod == null ? null : AccessorTools.getBaseTypeName(getterMethod);
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return false in this case
- //rather than attempting to use the setter's parameters
- return getterMethod == null ? false : AccessorTools.isCollectionType(getterMethod);
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return false in this case
- //rather than attempting to use the setter's parameters
- return getterMethod == null ? false : getterMethod.typeIsSubTypeOf(typeName);
- }
-
- public JavaResourceMethod getResourceGetterMethod() {
- return this.resourceGetter;
- }
-
- public JavaResourceMethod getResourceSetterMethod() {
- return this.resourceSetter;
- }
-
- public boolean isFor(JavaResourceField resourceField) {
- return false;
- }
-
- public boolean isFor(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- return (this.resourceGetter == getterMethod) && (this.resourceSetter == setterMethod);
- }
-
- //since this is based on a preference as well as annotation location
- //we will just calculate it instead of handling it in sync and storing it.
- protected JavaResourceMethod calculateResourceMethodToAnnotate() {
- if (getterIsAnnotated()) {
- if (setterIsAnnotated()) {
- //use preference for which one to set the primary annotation on.
- return getAnnotateGetterPreference() ? this.resourceGetter : this.resourceSetter;
- }
- return this.resourceGetter;
- }
- else if (setterIsAnnotated()) {
- return this.resourceSetter;
- }
- else if (getAnnotateGetterPreference()&& this.resourceGetter != null) {
- return this.resourceGetter;
- }
- return this.resourceSetter;
- }
-
- protected boolean getterIsAnnotated() {
- return this.resourceGetter == null ? false : this.resourceGetter.isAnnotated();
- }
-
- protected boolean setterIsAnnotated() {
- return this.resourceSetter == null ? false : this.resourceSetter.isAnnotated();
- }
-
- //TODO bug 333483 - make this a preference for the user to select whether the getter or setter should be annotated.
- protected boolean getAnnotateGetterPreference() {
- return true;
- }
-
- //TODO validation - bug 333484
- //if (getterIsAnnotated() && setterIsAnnotated()) error to user
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java
deleted file mode 100644
index a9d2a5f736..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-
-public interface JaxbFacetDataModelProperties
- extends IDataModelProperties {
-
- static final String PREFIX_
- = JaxbFacetDataModelProperties.class.getSimpleName() + "."; //$NON-NLS-1$
-
- public static final String PLATFORM
- = PREFIX_ + "PLATFORM"; //$NON-NLS-1$
-
- public static final String LIBRARY_INSTALL_DELEGATE
- = PREFIX_ + "LIBRARY_INSTALL_DELEGATE"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
deleted file mode 100644
index c1a2b6b5bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-
-
-public abstract class JaxbFacetDataModelProvider
- extends FacetInstallDataModelProvider
- implements JaxbFacetDataModelProperties {
-
- protected static final DataModelPropertyDescriptor[] EMPTY_DMPD_ARRAY = new DataModelPropertyDescriptor[0];
-
-
- protected static final Comparator<DataModelPropertyDescriptor> DMPD_COMPARATOR =
- new Comparator<DataModelPropertyDescriptor>() {
- public int compare(DataModelPropertyDescriptor dmpd1, DataModelPropertyDescriptor dmpd2) {
- return dmpd1.getPropertyDescription().compareTo(dmpd2.getPropertyDescription());
- }
- };
-
-
-
- // listens to primary runtime changing
- private IFacetedProjectListener fprojListener;
-
- private LibraryInstallDelegate defaultLibraryInstallDelegate;
-
-
- protected JaxbFacetDataModelProvider() {
- super();
- this.fprojListener = buildFprojListener();
- }
-
-
- protected IFacetedProjectListener buildFprojListener() {
- return new IFacetedProjectListener() {
- public void handleEvent(IFacetedProjectEvent event) {
- getLibraryInstallDelegate().refresh();
- }
- };
- }
-
- @Override
- public Set getPropertyNames() {
- Set names = super.getPropertyNames();
- names.add(PLATFORM);
- names.add(LIBRARY_INSTALL_DELEGATE);
- return names;
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FACET_ID)) {
- return JaxbFacet.ID;
- }
- else if (propertyName.equals(PLATFORM)) {
- return getDefaultPlatform();
- }
- else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) {
- return getDefaultLibraryInstallDelegate();
- }
-
- return super.getDefaultProperty(propertyName);
- }
-
- protected JaxbPlatformDescription getDefaultPlatform() {
- return JptJaxbCorePlugin.getDefaultPlatform(getProjectFacetVersion());
- }
-
- protected LibraryInstallDelegate getDefaultLibraryInstallDelegate() {
- // delegate itself changes only when facet version changes
- if (this.defaultLibraryInstallDelegate == null) {
- this.defaultLibraryInstallDelegate = buildDefaultLibraryInstallDelegate();
- }
- else if (! this.defaultLibraryInstallDelegate.getProjectFacetVersion().equals(getProjectFacetVersion())) {
- this.defaultLibraryInstallDelegate.dispose();
- this.defaultLibraryInstallDelegate = buildDefaultLibraryInstallDelegate();
- }
- return defaultLibraryInstallDelegate;
- }
-
- protected LibraryInstallDelegate buildDefaultLibraryInstallDelegate() {
- IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
- IProjectFacetVersion pfv = getProjectFacetVersion();
- if (fpjwc == null || pfv == null) {
- return null;
- }
- LibraryInstallDelegate lid = new LibraryInstallDelegate(fpjwc, pfv);
- lid.addListener(buildLibraryInstallDelegateListener());
- return lid;
- }
-
- protected IPropertyChangeListener buildLibraryInstallDelegateListener() {
- return new IPropertyChangeListener() {
- public void propertyChanged(String property, Object oldValue, Object newValue ) {
- if (LibraryInstallDelegate.PROP_AVAILABLE_PROVIDERS.equals(property)) {
- adjustLibraryInstallDelegate();
- }
- getDataModel().notifyPropertyChange(LIBRARY_INSTALL_DELEGATE, IDataModel.VALUE_CHG);
- }
- };
- }
-
- protected void adjustLibraryInstallDelegate() {
- LibraryInstallDelegate lid = this.getLibraryInstallDelegate();
- if (lid != null) {
- List<JaxbLibraryProviderInstallOperationConfig> jaxbConfigs
- = new ArrayList<JaxbLibraryProviderInstallOperationConfig>();
- // add the currently selected one first
- JaxbLibraryProviderInstallOperationConfig currentJaxbConfig = null;
- LibraryProviderOperationConfig config = lid.getLibraryProviderOperationConfig();
- if (config instanceof JaxbLibraryProviderInstallOperationConfig) {
- currentJaxbConfig = (JaxbLibraryProviderInstallOperationConfig) config;
- jaxbConfigs.add(currentJaxbConfig);
- }
- for (ILibraryProvider lp : lid.getLibraryProviders()) {
- config = lid.getLibraryProviderOperationConfig(lp);
- if (config instanceof JaxbLibraryProviderInstallOperationConfig
- && ! config.equals(currentJaxbConfig)) {
- jaxbConfigs.add((JaxbLibraryProviderInstallOperationConfig) config);
- }
- }
- for (JaxbLibraryProviderInstallOperationConfig jaxbConfig : jaxbConfigs) {
- jaxbConfig.setJaxbPlatform(getPlatform());
- }
- }
- }
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(FACETED_PROJECT_WORKING_COPY)) {
- // should only be done once
- IFacetedProjectWorkingCopy fproj = (IFacetedProjectWorkingCopy) propertyValue;
- fproj.addListener(this.fprojListener, IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
- }
- else if (propertyName.equals(FACET_VERSION)) {
- adjustLibraryInstallDelegate();
- this.model.notifyPropertyChange(PLATFORM, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(LIBRARY_INSTALL_DELEGATE, IDataModel.DEFAULT_CHG);
- }
- else if (propertyName.equals(PLATFORM)) {
- adjustLibraryInstallDelegate();
- }
-
- return ok;
- }
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return this.buildValidPlatformDescriptors();
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- protected DataModelPropertyDescriptor[] buildValidPlatformDescriptors() {
- Iterable<JaxbPlatformDescription> validPlatformDescriptions = buildValidPlatformDescriptions();
- Iterable<DataModelPropertyDescriptor> validPlatformDescriptors =
- new TransformationIterable<JaxbPlatformDescription, DataModelPropertyDescriptor>(validPlatformDescriptions) {
- @Override
- protected DataModelPropertyDescriptor transform(JaxbPlatformDescription description) {
- return buildPlatformDescriptor(description);
- }
- };
- return ArrayTools.sort(ArrayTools.array(validPlatformDescriptors, EMPTY_DMPD_ARRAY), DMPD_COMPARATOR);
- }
-
- protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() {
- return new FilteringIterable<JaxbPlatformDescription>(
- JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatforms()) {
- @Override
- protected boolean accept(JaxbPlatformDescription o) {
- return o.supportsJaxbFacetVersion(getProjectFacetVersion());
- }
- };
- }
-
- @Override
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return buildPlatformDescriptor(getPlatform());
- }
-
- return super.getPropertyDescriptor(propertyName);
- }
-
- protected DataModelPropertyDescriptor buildPlatformDescriptor(JaxbPlatformDescription desc) {
- return new DataModelPropertyDescriptor(desc, desc.getLabel());
- }
-
- // ********** validation **********
-
- protected static IStatus OK_STATUS = Status.OK_STATUS;
-
- protected static IStatus buildErrorStatus(String message) {
- return buildStatus(IStatus.ERROR, message);
- }
-
- protected static IStatus buildStatus(int severity, String message) {
- return new Status(severity, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- @Override
- public IStatus validate(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return this.validatePlatform();
- }
- else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) {
- return getLibraryInstallDelegate().validate();
- }
-
- return super.validate(propertyName);
- }
-
- protected IStatus validatePlatform() {
- return (getPlatform() == null) ?
- buildErrorStatus(JptJaxbCoreMessages.JaxbFacetConfig_validatePlatformNotSpecified)
- : OK_STATUS;
- }
-
- protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
- return (IFacetedProjectWorkingCopy) getProperty(FACETED_PROJECT_WORKING_COPY);
- }
-
- protected IProjectFacetVersion getProjectFacetVersion() {
- return (IProjectFacetVersion) getProperty(FACET_VERSION);
- }
-
- protected JaxbPlatformDescription getPlatform() {
- return (JaxbPlatformDescription) getProperty(PLATFORM);
- }
-
- protected LibraryInstallDelegate getLibraryInstallDelegate() {
- return (LibraryInstallDelegate) getProperty(LIBRARY_INSTALL_DELEGATE);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- getFacetedProjectWorkingCopy().removeListener(this.fprojListener);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java
deleted file mode 100644
index 2a5a516cb1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public abstract class JaxbFacetDelegate
- implements IDelegate {
-
- public final void execute(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- this.execute_(project, fv, config, monitor);
- }
-
- protected void execute_(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- SubMonitor subMonitor = SubMonitor.convert(monitor, 7);
-
- IDataModel jaxbConfig = (IDataModel) config;
-
- // project settings
- JaxbPlatformDescription platform =
- (JaxbPlatformDescription) jaxbConfig.getProperty(JaxbFacetDataModelProperties.PLATFORM);
- JptJaxbCorePlugin.setJaxbPlatform(project, platform);
- subMonitor.worked(1);
-
- // defaults settings
- JptJaxbCorePlugin.setDefaultJaxbPlatform(fv, platform);
- subMonitor.worked(1);
-
- //Delegate to LibraryInstallDelegate to configure the project classpath
- LibraryInstallDelegate lid =
- (LibraryInstallDelegate) jaxbConfig.getProperty(JaxbFacetDataModelProperties.LIBRARY_INSTALL_DELEGATE);
- lid.execute(subMonitor.newChild(1));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java
deleted file mode 100644
index a1c426ccf2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public interface JaxbFacetInstallDataModelProperties
- extends JaxbFacetDataModelProperties {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java
deleted file mode 100644
index cf5d982cf8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public class JaxbFacetInstallDataModelProvider
- extends JaxbFacetDataModelProvider
- implements JaxbFacetInstallDataModelProperties {
-
- public JaxbFacetInstallDataModelProvider() {
- super();
- }
-
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(FACET_VERSION)) {
- if (! getPlatform().supportsJaxbFacetVersion(getProjectFacetVersion())) {
- getDataModel().setProperty(PLATFORM, null);
- }
- }
-
- return ok;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java
deleted file mode 100644
index 7724832546..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.validation.ValidationFramework;
-
-
-public class JaxbFacetInstallDelegate
- extends JaxbFacetDelegate {
-
- @Override
- protected void execute_(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- ValidationFramework.getDefault().addValidationBuilder(project);
- super.execute_(project, fv, config, monitor);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java
deleted file mode 100644
index 53e1d9a43c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbFacetUninstallDelegate
- implements IDelegate {
-
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java
deleted file mode 100644
index d9c5b2a932..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public interface JaxbFacetVersionChangeDataModelProperties
- extends JaxbFacetDataModelProperties {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java
deleted file mode 100644
index d5772b50e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class JaxbFacetVersionChangeDataModelProvider
- extends JaxbFacetDataModelProvider
- implements JaxbFacetVersionChangeDataModelProperties {
-
- public JaxbFacetVersionChangeDataModelProvider() {
- super();
- }
-
-
- @Override
- protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() {
- // add existing platform to list of choices
- Iterable<JaxbPlatformDescription> validPlatformDescs = super.buildValidPlatformDescriptions();
- if (! CollectionTools.contains(validPlatformDescs, getPlatform())) {
- validPlatformDescs = new CompositeIterable(getPlatform(), validPlatformDescs);
- }
- return validPlatformDescs;
- }
-
- @Override
- protected IStatus validatePlatform() {
- IStatus status = super.validatePlatform();
-
- if (status.isOK()) {
- if (! getPlatform().supportsJaxbFacetVersion(getProjectFacetVersion())) {
- status = buildErrorStatus(JptJaxbCoreMessages.JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion);
- }
- }
-
- return status;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
deleted file mode 100644
index 2c7a4bc95f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbFacetVersionChangeDelegate
- extends JaxbFacetDelegate {
-
- @Override
- protected void execute_(
- IProject project, IProjectFacetVersion fv, Object config,
- IProgressMonitor monitor) throws CoreException {
-
- SubMonitor sm = SubMonitor.convert(monitor, 2);
- super.execute_(project, fv, config, sm.newChild(1));
-
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(project);
- sm.worked(1);
- // nothing further to do here *just* yet
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java
deleted file mode 100644
index 535a0c7a36..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * ClassesGenerator
- */
-public class ClassesGenerator extends AbstractJptGenerator
-{
- public static final String LAUNCH_CONFIG_NAME = "JAXB Run Config"; //$NON-NLS-1$
- public static final String JAXB_GENERIC_GEN_CLASS = "com.sun.tools.xjc.XJCFacade"; //$NON-NLS-1$
- public static final String JAXB_GENERIC_GEN_JDK_CLASS = "com.sun.tools.internal.xjc.XJCFacade"; //$NON-NLS-1$
- public static final String JAXB_ECLIPSELINK_GEN_CLASS = "org.eclipse.persistence.jaxb.xjc.MOXyXJC"; //$NON-NLS-1$
-
- private final String schemaPathOrUri;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final String[] bindingsFileNames;
- private final ClassesGeneratorOptions generatorOptions;
- private final ClassesGeneratorExtensionOptions generatorExtensionOptions;
- private final String mainType;
- private String toolsJarPath;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String schemaPathOrUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions,
- IProgressMonitor monitor) {
-
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new ClassesGenerator(javaProject,
- schemaPathOrUri,
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions).generate(monitor);
- }
-
- /**
- * Test if the JDK Jaxb compiler is on the classpath.
- */
- public static boolean genericJaxbJdkIsOnClasspath(IJavaProject javaProject) {
- try {
- IType genClass = javaProject.findType(JAXB_GENERIC_GEN_JDK_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Test if the non-JDK Jaxb compiler is on the classpath.
- */
- public static boolean genericJaxbNonJdkIsOnClasspath(IJavaProject javaProject) {
- try {
- IType genClass = javaProject.findType(JAXB_GENERIC_GEN_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static IVMInstall getVMInstall(IJavaProject javaProject) throws CoreException {
- return JavaRuntime.getVMInstall(javaProject);
- }
-
- public static String getVMInstallLocation(IVMInstall vm) {
- return vm.getInstallLocation().getAbsolutePath();
- }
-
- public static String getVMInstallToolsJarAbsolutePath(IVMInstall vm) {
- String vmInstallLocation = getVMInstallLocation(vm);
- return vmInstallLocation + File.separator + "lib" + File.separator + "tools.jar"; //$NON-NLS-1$
- }
-
- public static String buildToolsJarPath(IJavaProject javaProject) {
- try {
- IVMInstall vm = getVMInstall(javaProject);
- return getVMInstallToolsJarAbsolutePath(vm);
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static String findToolsJarPath(IJavaProject javaProject) {
- String toolsAbsolutePath = buildToolsJarPath(javaProject);
- return ((new File(toolsAbsolutePath)).exists()) ? toolsAbsolutePath : null;
- }
-
- public static boolean toolsJarExists(IJavaProject javaProject) {
- return (findToolsJarPath(javaProject) != null);
- }
-
- // ********** constructors **********
-
- protected ClassesGenerator(
- IJavaProject javaProject,
- String schemaPathOrUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
- super(javaProject);
- this.schemaPathOrUri = schemaPathOrUri;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.bindingsFileNames = bindingsFileNames;
- this.generatorOptions = generatorOptions;
- this.generatorExtensionOptions = generatorExtensionOptions;
-
- this.mainType = this.buildMainType(javaProject, usesMoxyGenerator);
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected void specifyJRE() {
- // do nothing
- }
-
- // ********** behavior **********
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // nothing to do yet...
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- try {
- this.javaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** private methods **********
-
- protected String buildMainType(IJavaProject javaProject, boolean usesMoxyGenerator) {
- if(usesMoxyGenerator) {
- return JAXB_ECLIPSELINK_GEN_CLASS;
- }
- else if(genericJaxbNonJdkIsOnClasspath(javaProject)) {
- return JAXB_GENERIC_GEN_CLASS;
- }
- else if(genericJaxbJdkIsOnClasspath(javaProject)) {
- return JAXB_GENERIC_GEN_JDK_CLASS;
- }
- this.toolsJarPath = findToolsJarPath(javaProject);
- return JAXB_GENERIC_GEN_JDK_CLASS;
- }
-
- private IRuntimeClasspathEntry getToolsClasspathEntry() {
- return (StringTools.stringIsEmpty(this.toolsJarPath)) ?
- null :
- getArchiveClasspathEntry(new Path(this.toolsJarPath));
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- // Containers classpath
- for(IRuntimeClasspathEntry containerClasspathEntry: this.getContainersClasspathEntries()) {
- classpath.add(containerClasspathEntry.getMemento());
- }
- // Tools classpath
- IRuntimeClasspathEntry toolsClasspathEntry = this.getToolsClasspathEntry();
- if(toolsClasspathEntry != null) {
- classpath.add(toolsClasspathEntry.getMemento());
- }
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
- StringBuffer programArguments = new StringBuffer();
-
- programArguments.append("-d "); //$NON-NLS-1$
- if(StringTools.stringIsEmpty(this.outputDir)) {
- throw new RuntimeException("Output directory cannot be empty"); //$NON-NLS-1$
- }
- programArguments.append(StringTools.quote(this.outputDir));
- if( ! StringTools.stringIsEmpty(this.targetPackage)) {
- programArguments.append(" -p "); //$NON-NLS-1$
- programArguments.append(this.targetPackage);
- }
- if( ! StringTools.stringIsEmpty(this.catalog)) {
- programArguments.append(" -catalog "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.catalog));
- }
-
- // Options
- if( ! StringTools.stringIsEmpty(this.generatorOptions.getProxy())) {
- programArguments.append(" -httpproxy "); //$NON-NLS-1$
- programArguments.append(this.generatorOptions.getProxy());
- }
- if( ! StringTools.stringIsEmpty(this.generatorOptions.getProxyFile())) {
- programArguments.append(" -httpproxyfile "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.generatorOptions.getProxyFile()));
- }
-
- if( ! this.generatorOptions.usesStrictValidation()) {
- programArguments.append(" -nv"); //$NON-NLS-1$
- }
- if(this.generatorOptions.makesReadOnly()) {
- programArguments.append(" -readOnly"); //$NON-NLS-1$
- }
- if(this.generatorOptions.suppressesPackageInfoGen()) {
- programArguments.append(" -npa"); //$NON-NLS-1$
- }
- if(this.generatorOptions.suppressesHeaderGen()) {
- programArguments.append(" -no-header"); //$NON-NLS-1$
- }
- if(this.generatorOptions.isVerbose()) {
- programArguments.append(" -verbose"); //$NON-NLS-1$
- }
- if(this.generatorOptions.isQuiet()) {
- programArguments.append(" -quiet"); //$NON-NLS-1$
- }
-
- if(this.generatorOptions.treatsAsXmlSchema()) {
- programArguments.append(" -xmlschema"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsRelaxNg()) {
- programArguments.append(" -relaxng"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsRelaxNgCompact()) {
- programArguments.append(" -relaxng-compact"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsDtd()) {
- programArguments.append(" -dtd"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsWsdl()) {
- programArguments.append(" -wsdl"); //$NON-NLS-1$
- }
- if(this.generatorOptions.showsVersion()) {
- programArguments.append(" -version"); //$NON-NLS-1$
- }
- if(this.generatorOptions.showsHelp()) {
- programArguments.append(" -help"); //$NON-NLS-1$
- }
-
- // Extension Options
- if(this.generatorExtensionOptions.allowsExtensions()) {
- programArguments.append(" -extension"); //$NON-NLS-1$
- }
- if( ! StringTools.stringIsEmpty(this.generatorExtensionOptions.getClasspath())) {
- programArguments.append(" -classpath "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.generatorExtensionOptions.getClasspath()));
- }
- if( ! StringTools.stringIsEmpty(this.generatorExtensionOptions.getAdditionalArgs())) {
- programArguments.append(' ');
- programArguments.append(this.generatorExtensionOptions.getAdditionalArgs());
- }
-
- // schema
- programArguments.append(' ');
- if(StringTools.stringIsEmpty(this.schemaPathOrUri)) {
- throw new RuntimeException("Schema cannot be empty"); //$NON-NLS-1$
- }
- programArguments.append(StringTools.quote(this.schemaPathOrUri));
-
- // bindings
- if (this.bindingsFileNames.length > 0) {
- for (String bindingsFileName : this.bindingsFileNames) {
- programArguments.append(" -b "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(bindingsFileName));
- }
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
-
- // ********** Queries **********
-
- private List<IRuntimeClasspathEntry> getContainersClasspathEntries() throws CoreException {
- ArrayList<IRuntimeClasspathEntry> classpathEntries = new ArrayList<IRuntimeClasspathEntry>();
- for(IClasspathEntry classpathEntry: this.javaProject.getRawClasspath()) {
- if(classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), this.javaProject);
- if(container != null && container.getKind() == IClasspathContainer.K_SYSTEM) {
- classpathEntries.add(
- JavaRuntime.newRuntimeContainerClasspathEntry(
- container.getPath(),
- IRuntimeClasspathEntry.BOOTSTRAP_CLASSES,
- this.javaProject));
- }
- }
- }
- return classpathEntries;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java
deleted file mode 100644
index 476945fbe6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-/**
- * ClassesGeneratorExtensionOptions
- */
-public class ClassesGeneratorExtensionOptions
-{
- private String classpath;
- private boolean allowsExtensions;
-
- private String additionalArgs;
-
- // ********** constructor **********
-
- public ClassesGeneratorExtensionOptions() {
- super();
- }
-
- // ********** getters/setters *********
-
- public boolean allowsExtensions() {
- return this.allowsExtensions;
- }
-
- public void setAllowsExtensions(boolean allowsExtensions) {
- this.allowsExtensions = allowsExtensions;
- }
-
- public String getClasspath() {
- return this.classpath;
- }
-
- public void setClasspath(String classpath){
- this.classpath = classpath;
- }
-
- public String getAdditionalArgs() {
- return this.additionalArgs;
- }
-
- public void setAdditionalArgs(String additionalArgs){
- this.additionalArgs = additionalArgs;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java
deleted file mode 100644
index 1a2cf799d5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-
-/**
- * ClassesGeneratorOptions
- */
-public class ClassesGeneratorOptions
-{
- private String proxy;
- private String proxyFile;
-
- private boolean usesStrictValidation;
- private boolean makesReadOnly;
- private boolean suppressesPackageInfoGen;
- private boolean suppressesHeaderGen;
- private boolean isVerbose;
- private boolean isQuiet;
-
- private boolean treatsAsXmlSchema;
- private boolean treatsAsRelaxNg;
- private boolean treatsAsRelaxNgCompact;
- private boolean treatsAsDtd;
- private boolean treatsAsWsdl;
- private boolean showsVersion;
- private boolean showsHelp;
-
- // ********** constructor **********
-
- public ClassesGeneratorOptions() {
- super();
- }
-
- // ********** getters/setters *********
-
- public String getProxy() {
- return this.proxy;
- }
-
- public void setProxy(String proxy){
- this.proxy = proxy;
- }
-
- public String getProxyFile() {
- return this.proxyFile;
- }
-
- public void setProxyFile(String proxyFile){
- this.proxyFile = proxyFile;
- }
-
- public boolean suppressesPackageInfoGen() {
- return this.suppressesPackageInfoGen;
- }
-
- public void setSuppressesPackageInfoGen(boolean suppressesPackageInfoGen) {
- this.suppressesPackageInfoGen = suppressesPackageInfoGen;
- }
-
- public boolean usesStrictValidation() {
- return this.usesStrictValidation;
- }
-
- public void setUsesStrictValidation(boolean usesStrictValidation) {
- this.usesStrictValidation = usesStrictValidation;
- }
-
- public boolean makesReadOnly() {
- return this.makesReadOnly;
- }
-
- public void setMakesReadOnly(boolean makesReadOnly) {
- this.makesReadOnly = makesReadOnly;
- }
-
- public boolean suppressesHeaderGen() {
- return this.suppressesHeaderGen;
- }
-
- public void setSuppressesHeaderGen(boolean suppressesHeaderGen){
- this.suppressesHeaderGen = suppressesHeaderGen;
- }
-
- public boolean isVerbose() {
- return this.isVerbose;
- }
-
- public void setIsVerbose(boolean isVerbose){
- this.isVerbose = isVerbose;
- }
-
- public boolean isQuiet() {
- return this.isQuiet;
- }
-
- public void setIsQuiet(boolean isQuiet){
- this.isQuiet = isQuiet;
- }
-
- public boolean treatsAsXmlSchema() {
- return this.treatsAsXmlSchema;
- }
-
- public void setTreatsAsXmlSchema(boolean treatsAsXmlSchema){
- this.treatsAsXmlSchema = treatsAsXmlSchema;
- }
-
- public boolean treatsAsRelaxNg() {
- return this.treatsAsRelaxNg;
- }
-
- public void setTreatsAsRelaxNg(boolean treatsAsRelaxNg){
- this.treatsAsRelaxNg = treatsAsRelaxNg;
- }
-
- public boolean treatsAsRelaxNgCompact() {
- return this.treatsAsRelaxNgCompact;
- }
-
- public void setTreatsAsRelaxNgCompact(boolean treatsAsRelaxNgCompact){
- this.treatsAsRelaxNgCompact = treatsAsRelaxNgCompact;
- }
-
- public boolean treatsAsDtd() {
- return this.treatsAsDtd;
- }
-
- public void setTreatsAsDtd(boolean treatsAsDtd){
- this.treatsAsDtd = treatsAsDtd;
- }
-
- public boolean treatsAsWsdl() {
- return this.treatsAsWsdl;
- }
-
- public void setTreatsAsWsdl(boolean treatsAsWsdl){
- this.treatsAsWsdl = treatsAsWsdl;
- }
-
- public boolean showsVersion() {
- return this.showsVersion;
- }
-
- public void setShowsVersion(boolean showsVersion){
- this.showsVersion = showsVersion;
- }
-
- public boolean showsHelp() {
- return this.showsHelp;
- }
-
- public void setShowsHelp(boolean showsHelp){
- this.showsHelp = showsHelp;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java
deleted file mode 100644
index 0db2a9e337..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-
-/**
- * GenerateJaxbClassesJob
- */
-public class GenerateJaxbClassesJob extends WorkspaceJob {
- private final IJavaProject javaProject;
- private final String absoluteLocalXsdUri;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final boolean usesMoxyGenerator;
- private final String[] bindingsFileNames;
- private final ClassesGeneratorOptions generatorOptions;
- private final ClassesGeneratorExtensionOptions generatorExtensionOptions;
-
- // ********** constructors **********
-
- public GenerateJaxbClassesJob(
- IJavaProject javaProject,
- String absoluteLocalXsdUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
-
- super(JptJaxbCoreMessages.ClassesGenerator_generatingClasses);
- if (javaProject == null) {
- throw new RuntimeException("Project is null"); //$NON-NLS-1$
- }
- else if (StringTools.stringIsEmpty(absoluteLocalXsdUri)) {
- throw new RuntimeException("Schema cannot be empty"); //$NON-NLS-1$
- }
- else if(StringTools.stringIsEmpty(outputDir)) {
- throw new RuntimeException("Output directory cannot be empty"); //$NON-NLS-1$
- }
- this.javaProject = javaProject;
- this.absoluteLocalXsdUri = absoluteLocalXsdUri;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.usesMoxyGenerator = usesMoxyGenerator;
- this.bindingsFileNames = bindingsFileNames;
- this.generatorOptions = generatorOptions;
- this.generatorExtensionOptions = generatorExtensionOptions;
- this.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(this.javaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, JptJaxbCoreMessages.ClassesGenerator_generatingClassesTask, 1);
- try {
- this.classesGeneratorGenerate(this.javaProject,
- this.absoluteLocalXsdUri,
- this.outputDir,
- this.targetPackage,
- this.catalog,
- this.usesMoxyGenerator,
- this.bindingsFileNames,
- this.generatorOptions,
- this.generatorExtensionOptions,
- sm.newChild(1));
- }
- catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- // fall through and tell monitor we are done
- }
- catch (RuntimeException re) {
- throw new RuntimeException(re);
- }
- return Status.OK_STATUS;
-}
-
- private void classesGeneratorGenerate(IJavaProject javaProject,
- String absoluteLocalXsdUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions,
- IProgressMonitor monitor) {
-
- ClassesGenerator.generate(javaProject,
- absoluteLocalXsdUri,
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions,
- monitor);
- return;
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java
deleted file mode 100644
index 7f68cbe5e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-
-/**
- * SchemaGenerator
- */
-public class SchemaGenerator extends AbstractJptGenerator
-{
- static public String LAUNCH_CONFIG_NAME = "JAXB Schema Gen Run Config"; //$NON-NLS-1$
- static public String JAXB_SCHEMA_GEN_PACKAGE_NAME = "org.eclipse.jpt.jaxb.core.schemagen"; //$NON-NLS-1$
- static public String JAXB_SCHEMA_GEN_CLASS = JAXB_SCHEMA_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME = "org.eclipse.jpt.jaxb.eclipselink.core.schemagen"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_CLASS = ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
-
- static public String ECLIPSELINK_JAXB_CONTEXT_FACTORY = "org.eclipse.persistence.jaxb.JAXBContextFactory"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_PROPERTIES_FILE_CONTENTS = "javax.xml.bind.context.factory=" + ECLIPSELINK_JAXB_CONTEXT_FACTORY; //$NON-NLS-1$
- static public String JAXB_PROPERTIES_FILE_NAME = "jaxb.properties"; //$NON-NLS-1$
-
- static public String JAXB_SCHEMA_GEN_JAR_PREFIX = JAXB_SCHEMA_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_JAR_PREFIX = ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
-
- static public String JAXB_GENERIC_SCHEMA_GEN_CLASS = "javax.xml.bind.JAXBContext"; //$NON-NLS-1$
- static public String JAXB_ECLIPSELINK_SCHEMA_GEN_CLASS = "org.eclipse.persistence.jaxb.JAXBContext"; //$NON-NLS-1$
-
- private final String targetSchemaName;
- private final String[] sourceClassNames;
- private String mainType;
- private boolean useMoxy;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String targetSchemaName,
- String[] sourceClassNames,
- boolean useMoxy,
- IProgressMonitor monitor) {
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new SchemaGenerator(javaProject,
- targetSchemaName,
- sourceClassNames,
- useMoxy).generate(monitor);
- }
-
- // ********** constructors **********
-
- protected SchemaGenerator(
- IJavaProject javaProject,
- String targetSchemaName,
- String[] sourceClassNames,
- boolean useMoxy) {
- super(javaProject);
- this.targetSchemaName = targetSchemaName;
- this.sourceClassNames = sourceClassNames;
- this.useMoxy = useMoxy;
- this.mainType = (this.useMoxy) ?
- ECLIPSELINK_JAXB_SCHEMA_GEN_CLASS :
- JAXB_SCHEMA_GEN_CLASS;
- this.initialize();
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected String getBootstrapJarPrefix() {
- return (this.useMoxy) ?
- ECLIPSELINK_JAXB_SCHEMA_GEN_JAR_PREFIX :
- JAXB_SCHEMA_GEN_JAR_PREFIX;
- }
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // generate jaxb.properties file if necessary
- if (this.useMoxy){
- if (!isJaxbPropertiesFilePresent()){
- this.generateJaxbPropertiesFile(monitor);
- }
- else if (!isJaxbContextMoxy()){
- //properties file actually specifies a different implementation
- //override wizard setting and fall back to generic generation
- this.useMoxy = false;
- this.mainType = JAXB_SCHEMA_GEN_CLASS;
- }
- }
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- try {
- this.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // Schema_Gen jar
- classpath.add(this.getBootstrapJarClasspathEntry().getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
-
- StringBuffer programArguments = new StringBuffer();
- // sourceClassNames
- this.appendClassNameArguments(programArguments);
-
- // schema
- programArguments.append(" -s \""); //$NON-NLS-1$
- programArguments.append(this.targetSchemaName);
- programArguments.append('"');
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- // ********** private methods **********
-
- private void appendClassNameArguments(StringBuffer sb) {
- for (String className : this.sourceClassNames) {
- sb.append(" -c "); //$NON-NLS-1$
- sb.append(className);
- }
- }
-
- /**
- * Returns the first "jaxb.properties" file that is found in a valid source
- * folder in the project.
- *
- * Returns null if no "jaxb.properties" file is found.
- */
- private IFile getJaxbPropertiesFile() {
- return getJaxbPropertiesFileFromPackageRoots(JDTTools.getJavaSourceFolders(this.javaProject));
- }
-
- private IFile getJaxbPropertiesFileFromPackageRoots(Iterable<IPackageFragmentRoot> packageFragmentRoots){
- Object[] objects = null;
- IJavaElement[] javaElements;
- try {
- for (IPackageFragmentRoot pfr : packageFragmentRoots) {
- javaElements = pfr.getChildren();
- for (IJavaElement javaElement : javaElements) {
- objects = ((IPackageFragment) javaElement).getNonJavaResources();
- for (Object object : objects) {
- IResource resource = (IResource) object;
- if (resource.getName().equals(JAXB_PROPERTIES_FILE_NAME)) {
- // jaxb.properties has been found
- return (IFile)resource;
- }
- }
- }
- }
- } catch (JavaModelException jme) {
- throw new RuntimeException(jme);
- }
- return null;
- }
-
- private boolean isJaxbPropertiesFilePresent(){
- return getJaxbPropertiesFile()!= null;
- }
-
- private boolean isJaxbContextMoxy(){
-
- InputStream in = null;
- try {
- in = getJaxbPropertiesFile().getContents();
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- String line = reader.readLine();
- //jaxb.properties will only contain one property entry, the JAXBContextFactory
- String propertyValue = line.substring(line.indexOf("=") + 1); //$NON-NLS-1$
- if (propertyValue.equals(ECLIPSELINK_JAXB_CONTEXT_FACTORY)){
- return true;
- }
- } catch (CoreException ce){
- throw new RuntimeException(ce);
- } catch (IOException ioe){
- throw new RuntimeException(ioe);
- } finally {
- if (in != null){
- try{
- in.close();
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- }
- }
- }
- return false;
- }
-
- private void generateJaxbPropertiesFile(IProgressMonitor monitor) {
- SubMonitor sm = SubMonitor.convert(monitor, 1);
- sm.subTask(JptJaxbCoreMessages.SchemaGenerator_creatingJAXBPropertiesFileTask);
-
- IPackageFragment packageFragment = findPackageFragementForSourceClassName(this.sourceClassNames[0]);
-
- IFolder folder = (IFolder)packageFragment.getResource();
- IFile file = folder.getFile(JAXB_PROPERTIES_FILE_NAME);
-
- byte[] bytes;
- try {
- bytes = ECLIPSELINK_JAXB_PROPERTIES_FILE_CONTENTS.getBytes("UTF-8"); //$NON-NLS-1$
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
-
- InputStream contents = new ByteArrayInputStream(bytes);
-
- try {
- //the input stream will be closed as a result of calling create
- file.create(contents, IResource.NONE, sm.newChild(1));
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
- }
-
- private IPackageFragment findPackageFragementForSourceClassName(String sourceClassName) {
- String packageName = sourceClassName.substring(0, sourceClassName.lastIndexOf('.'));
-
- //Find the existing package fragment where we want to generate
- for (IPackageFragmentRoot pfr : JDTTools.getJavaSourceFolders(this.javaProject)) {
- //use the package of the first source class as the package for generation
- IPackageFragment packageFragment = pfr.getPackageFragment(packageName);
- if (packageFragment.exists()){
- return packageFragment;
- }
- }
- //the existing package fragment was not found
- throw new IllegalStateException("Java package must exist for source class"); //$NON-NLS-1$
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java
deleted file mode 100644
index b7594bd39c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbFactory;
-
-/**
- * Generic JAXB version 2.1
- */
-public class GenericJaxb_2_1_Factory
- extends AbstractJaxbFactory {
-
- // singleton
- private static final JaxbFactory INSTANCE = new GenericJaxb_2_1_Factory();
-
- /**
- * Return the singleton.
- */
- public static JaxbFactory instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private GenericJaxb_2_1_Factory() {
- super();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
deleted file mode 100644
index 72b0f4ab33..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.internal.JavaPackageInfoResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyElementMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementRefMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementRefsMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementsMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlTransientMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlValueMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorOrderAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAnyAttributeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAnyElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAttachmentRefAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAttributeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementDeclAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementRefAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementRefsAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementWrapperAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementsAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlEnumAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlEnumValueAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlIDAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlIDREFAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlInlineBinaryDataAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlJavaTypeAdapterAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlJavaTypeAdaptersAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlListAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlMimeTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlMixedAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlRegistryAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlRootElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaTypesAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSeeAlsoAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTransientAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlValueAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex.JaxbIndexResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops.JaxbPropertiesResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class GenericJaxb_2_1_PlatformDefinition
- extends AbstractJaxbPlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new GenericJaxb_2_1_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
- protected GenericJaxb_2_1_PlatformDefinition() {
- super();
- }
-
-
- public JaxbPlatformDescription getDescription() {
- return GenericJaxbPlatform.VERSION_2_1;
- }
-
- public JaxbFactory getFactory() {
- return GenericJaxb_2_1_Factory.instance();
- }
-
- @Override
- protected Map<String, String> buildJavaToSchemaTypes() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("boolean", "boolean");
- map.put("java.lang.Boolean", "boolean");
- map.put("byte", "byte");
- map.put("java.lang.Byte", "byte");
- map.put("short", "short");
- map.put("java.lang.Short", "short");
- map.put("int", "int");
- map.put("java.lang.Integer", "int");
- map.put("long", "long");
- map.put("java.lang.Long", "long");
- map.put("float", "float");
- map.put("java.lang.Float", "float");
- map.put("double", "double");
- map.put("java.lang.Double", "double");
- map.put("java.lang.String", "string");
- map.put("java.math.BigInteger", "integer");
- map.put("java.math.BigDecimal", "decimal");
- map.put("java.util.Calendar", "dateTime");
- map.put("java.util.Date", "dateTime");
- map.put("javax.xml.namespace.QName", "QName");
- map.put("java.net.URI", "string");
- map.put("javax.xml.datatype.XMLGregorianCalendar", "anySimpleType");
- map.put("javax.xml.datatype.Duration", "duration");
- map.put("java.lang.Object", "anyType");
- map.put("java.awt.Image", "base64Binary");
- map.put("javax.activation.DataHandler", "base64Binary");
- map.put("javax.xml.transform.Source", "base64Binary");
- map.put("java.util.UUID", "string");
- return map;
- }
-
- @Override
- protected JaxbResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JaxbResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JavaPackageInfoResourceModelProvider.instance(),
- JaxbIndexResourceModelProvider.instance(),
- JaxbPropertiesResourceModelProvider.instance()};
- }
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
- }
- throw new IllegalArgumentException(contentType.toString());
- }
-
- @Override
- protected AnnotationDefinition[] buildAnnotationDefinitions() {
- return new AnnotationDefinition[] {
- XmlAccessorOrderAnnotationDefinition.instance(),
- XmlAccessorTypeAnnotationDefinition.instance(),
- XmlAnyAttributeAnnotationDefinition.instance(),
- XmlAnyElementAnnotationDefinition.instance(),
- XmlAttachmentRefAnnotationDefinition.instance(),
- XmlAttributeAnnotationDefinition.instance(),
- XmlElementAnnotationDefinition.instance(),
- XmlElementDeclAnnotationDefinition.instance(),
- XmlElementRefAnnotationDefinition.instance(),
- XmlElementRefsAnnotationDefinition.instance(),
- XmlElementsAnnotationDefinition.instance(),
- XmlElementWrapperAnnotationDefinition.instance(),
- XmlEnumAnnotationDefinition.instance(),
- XmlEnumValueAnnotationDefinition.instance(),
- XmlIDAnnotationDefinition.instance(),
- XmlIDREFAnnotationDefinition.instance(),
- XmlInlineBinaryDataAnnotationDefinition.instance(),
- XmlJavaTypeAdaptersAnnotationDefinition.instance(),
- XmlListAnnotationDefinition.instance(),
- XmlMimeTypeAnnotationDefinition.instance(),
- XmlMixedAnnotationDefinition.instance(),
- XmlRegistryAnnotationDefinition.instance(),
- XmlRootElementAnnotationDefinition.instance(),
- XmlSchemaAnnotationDefinition.instance(),
- XmlSchemaTypesAnnotationDefinition.instance(),
- XmlSeeAlsoAnnotationDefinition.instance(),
- XmlTransientAnnotationDefinition.instance(),
- XmlTypeAnnotationDefinition.instance(),
- XmlValueAnnotationDefinition.instance()};
- }
-
- @Override
- protected NestableAnnotationDefinition[] buildNestableAnnotationDefinitions() {
- return new NestableAnnotationDefinition[] {
- XmlJavaTypeAdapterAnnotationDefinition.instance(),
- XmlSchemaTypeAnnotationDefinition.instance()
- };
- }
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- definitions.add(JavaXmlElementMappingDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- definitions.add(JavaXmlAnyAttributeMappingDefinition.instance());
- definitions.add(JavaXmlAnyElementMappingDefinition.instance());
- definitions.add(JavaXmlAttributeMappingDefinition.instance());
- definitions.add(JavaXmlElementMappingDefinition.instance());
- definitions.add(JavaXmlElementRefMappingDefinition.instance());
- definitions.add(JavaXmlElementRefsMappingDefinition.instance());
- definitions.add(JavaXmlElementsMappingDefinition.instance());
- definitions.add(JavaXmlTransientMappingDefinition.instance());
- definitions.add(JavaXmlValueMappingDefinition.instance());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java
deleted file mode 100644
index a8a235bdc8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class GenericJaxb_2_1_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return GenericJaxb_2_1_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java
deleted file mode 100644
index 50df9e2c93..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_Factory;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public class GenericJaxb_2_2_PlatformDefinition
- extends GenericJaxb_2_1_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new GenericJaxb_2_2_PlatformDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected GenericJaxb_2_2_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return GenericJaxbPlatform.VERSION_2_2;
- }
-
- @Override
- public JaxbFactory getFactory() {
- return GenericJaxb_2_1_Factory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java
deleted file mode 100644
index 14944e74e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class GenericJaxb_2_2_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return GenericJaxb_2_2_PlatformDefinition.instance();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 87d08f80ca..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderInstallOperationConfig;
-
-
-public class JaxbJreLibraryProviderInstallOperationConfig
- extends LibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbJreLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- if (old != jaxbPlatform) {
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
- }
-
- @Override
- public synchronized IStatus validate() {
- IStatus status = super.validate();
- if (! status.isOK()) {
- return status;
- }
-
- for (LibraryValidator libraryValidator : JptCommonCorePlugin.getLibraryValidators(this)) {
- status = libraryValidator.validate(this);
- if (! status.isOK()) {
- return status;
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 1b6769914d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.jpt.common.core.internal.libprov.JptOsgiBundlesLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public class JaxbOsgiBundlesLibraryProviderInstallOperationConfig
- extends JptOsgiBundlesLibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbOsgiBundlesLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 39349ca701..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.jpt.common.core.internal.libprov.JptUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class JaxbUserLibraryProviderInstallOperationConfig
- extends JptUserLibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbUserLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
deleted file mode 100644
index 4ec0fc3238..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-
-public class GenericEclipseLinkBundlesLibraryValidator
-// extends AbstractOsgiBundlesLibraryValidator
- {
-
-// public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-// JpaOsgiBundlesLibraryProviderInstallOperationConfig jpaConfig
-// = (JpaOsgiBundlesLibraryProviderInstallOperationConfig) config;
-// Map<String, VersionRange[]> bundleVersionRanges = new HashMap<String, VersionRange[]>();
-// String bundleName = "javax.persistence"; //$NON-NLS-1$
-// VersionRange[] versionRanges = new VersionRange[0];
-// if (config.getProjectFacetVersion().equals(JpaFacet.VERSION_1_0)) {
-// versionRanges = new VersionRange[] {new VersionRange("[1.0, 3.0)")}; //$NON-NLS-1$
-// }
-// else if (config.getProjectFacetVersion().equals(JpaFacet.VERSION_2_0)) {
-// versionRanges = new VersionRange[] {new VersionRange("[2.0, 3.0)")}; //$NON-NLS-1$
-// }
-// bundleVersionRanges.put(bundleName, versionRanges);
-// return validate(jpaConfig, bundleVersionRanges);
-// }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
deleted file mode 100644
index c4abe11d02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jpt.common.core.internal.libval.LibValUtil;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class GenericJaxbUserLibraryValidator
- implements LibraryValidator {
-
- public synchronized IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-
- JaxbUserLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbUserLibraryProviderInstallOperationConfig) config;
-
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
- IProjectFacetVersion javaVersion = JaxbLibValUtil.getJavaVersion(jaxbConfig);
- IProjectFacetVersion javaJaxbVersion = JaxbLibValUtil.findJavaJaxbVersion(jaxbConfig);
-
- Iterable<IPath> libraryPaths =
- new TransformationIterable<IClasspathEntry, IPath>(jaxbConfig.resolve()) {
- @Override
- protected IPath transform(IClasspathEntry o) {
- return o.getPath();
- }
- };
-
- // dev-time portion of validation - error if actual java library *conflicts with* jaxb facet
- // or if library does not provide supplemental classes
-
- IProjectFacetVersion jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
-
- // null here implies something prior to jaxb 2.1
- if (jreJaxbVersion != null) {
- if (jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
- }
- // if jre is enough for jaxb version, we don't look for classes in the library
- else {
- Set<String> classNames = new HashSet<String>();
-
- classNames.add("javax.xml.bind.annotation.XmlSeeAlso"); //$NON-NLS-1$
- if (jaxbVersion.compareTo(JaxbFacet.VERSION_2_2) >= 0) {
- classNames.add("javax.xml.bind.JAXBPermission"); //$NON-NLS-1$
- }
-
- IStatus status = LibValUtil.validate(libraryPaths, classNames);
-
- if (! status.isOK()) {
- return status;
- }
- }
-
- // runtime portion of validation - warn if java facet is insufficient to provide jaxb api.
- // user may override implementation manually, however
- // assume 1.6 runtime environs are latest (with jaxb 2.1, not 2.0)
-
- // null here implies something prior to jaxb 2.1
- if (javaJaxbVersion != null && javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
deleted file mode 100644
index 7701da3606..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbJreLibraryValidator
- implements LibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-
- JaxbLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbLibraryProviderInstallOperationConfig) config;
-
- if (! jaxbConfig.getJaxbPlatform().getGroup().equals(GenericJaxbPlatform.GROUP)) {
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, JptJaxbCoreMessages.JreLibraryValidator_invalidPlatform);
- }
-
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
- IProjectFacetVersion javaVersion = JaxbLibValUtil.getJavaVersion(jaxbConfig);
- IProjectFacetVersion javaJaxbVersion = JaxbLibValUtil.findJavaJaxbVersion(jaxbConfig);
-
- // dev-time portion of validation - error if actual java library does not support jaxb facet
-
- IProjectFacetVersion jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
-
- // null here implies something prior to jaxb 2.1
- if (jreJaxbVersion == null || jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- // runtime portion of validation - warn if java facet is insufficient to provide jaxb api.
- // user may override implementation manually, however
- // assume 1.6 runtime environs are latest (with jaxb 2.1, not 2.0)
-
- // null here implies something prior to jaxb 2.1
- if (javaJaxbVersion == null || javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- // TODO - check for xjc classes when we support jdk version of xjc
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java
deleted file mode 100644
index ce5d0ab6bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.zip.ZipFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.LibraryLocation;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.common.project.facet.core.StandardJreRuntimeComponent;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-
-
-public class JaxbLibValUtil {
-
- static IProjectFacetVersion getJavaVersion(JaxbLibraryProviderInstallOperationConfig config) {
- return config.getFacetedProject().getProjectFacetVersion(JavaFacet.FACET);
- }
-
- /**
- * Return jaxb version determined by java facet version.
- * Assume highest update of java (i.e. java 1.6 maps to jaxb 2.1)
- */
- static IProjectFacetVersion findJavaJaxbVersion(JaxbLibraryProviderInstallOperationConfig config) {
- IProjectFacetVersion javaVersion = getJavaVersion(config);
-
- if (javaVersion == JavaFacet.VERSION_1_6) {
- return JaxbFacet.VERSION_2_1;
- }
- else if (javaVersion == JavaFacet.VERSION_1_7) {
- return JaxbFacet.VERSION_2_2;
- }
-
- return null;
- }
-
- static IProjectFacetVersion findJreJaxbVersion(JaxbLibraryProviderInstallOperationConfig config) {
- IRuntime runtime = config.getFacetedProject().getPrimaryRuntime();
-
- if (runtime != null) {
- for (IRuntimeComponent rc : runtime.getRuntimeComponents()) {
- IVMInstall vm = findVMInstall(rc);
- if (vm != null) {
- return findJreJaxbVersion(vm);
- }
- }
- }
-
- IVMInstall vm = JavaRuntime.getDefaultVMInstall();
-
- IJavaProject javaProject = JavaCore.create(config.getFacetedProject().getProject());
- if (javaProject != null) {
- try {
- vm = JavaRuntime.getVMInstall(javaProject);
- }
- catch (CoreException ce) {
- // do nothing, just use the default install
- }
- }
-
- if (vm != null) {
- return findJreJaxbVersion(vm);
- }
-
- return null;
- }
-
- private static IVMInstall findVMInstall(IRuntimeComponent rc) {
- String vmInstallTypeId
- = rc.getProperty(StandardJreRuntimeComponent.PROP_VM_INSTALL_TYPE);
- String vmInstallId
- = rc.getProperty(StandardJreRuntimeComponent.PROP_VM_INSTALL_ID);
-
- if (vmInstallTypeId == null || vmInstallId == null) {
- return null;
- }
-
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(vmInstallTypeId);
-
- if( vmInstallType == null ) {
- return null;
- }
-
- return vmInstallType.findVMInstall(vmInstallId);
- }
-
- private static IProjectFacetVersion findJreJaxbVersion(IVMInstall vm) {
- if (vm instanceof IVMInstall2) {
- String javaVersion = ((IVMInstall2) vm).getJavaVersion();
- if (javaVersion != null) {
- // all other versions except 1.7 and 1.6 have no corresponding version (as of yet)
- if (javaVersion.startsWith(JavaCore.VERSION_1_7)) {
- return JaxbFacet.VERSION_2_2;
- }
- // 1.6 must be further analyzed
- if (! javaVersion.startsWith(JavaCore.VERSION_1_6)) {
- return null;
- }
- }
- }
-
- Iterable<IPath> vmLibPaths
- = new TransformationIterable<LibraryLocation, IPath>(
- new ArrayIterable<LibraryLocation>(JavaRuntime.getLibraryLocations(vm))) {
- @Override
- protected IPath transform(LibraryLocation o) {
- return o.getSystemLibraryPath();
- }
- };
-
- boolean foundXmlSeeAlso = false; // marker for jaxb 2.1 +
- boolean foundJAXBPermission = false; // marker for jaxb 2.2 +
-
- for (IPath vmLibPath : vmLibPaths) {
- File file = vmLibPath.toFile();
-
- if (file.exists()) {
- ZipFile zip = null;
-
- try {
- zip = new ZipFile(file);
-
- foundXmlSeeAlso |= zip.getEntry("javax/xml/bind/annotation/XmlSeeAlso.class") != null;
- foundJAXBPermission |= zip.getEntry("javax/xml/bind/JAXBPermission.class") != null;
-
- // short circuit for JAXB 2.2
- if (foundJAXBPermission) {
- return JaxbFacet.VERSION_2_2;
- }
- }
- catch (IOException e) {}
- finally {
- if (zip != null) {
- try {
- zip.close();
- }
- catch (IOException e) {}
- }
- }
- }
- }
-
- if (foundXmlSeeAlso) {
- return JaxbFacet.VERSION_2_1;
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java
deleted file mode 100644
index 745ba46411..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.operations;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.core.internal.operations.AbstractJptFileCreationDataModelProvider;
-
-/**
- * SchemaFileCreationDataModelProvider
- */
-public class SchemaFileCreationDataModelProvider extends AbstractJptFileCreationDataModelProvider
-{
-
- @Override
- protected String getDefaultFileName() {
- if(this.getProject() == null) {
- return null;
- }
- return this.getProject().getName();
- }
-
- /**
- * Return a best guess source location for the for the specified project
- */
- @Override
- protected IContainer getDefaultContainer() {
- IContainer defaultContainer = super.getDefaultContainer();
- if(defaultContainer != null) {
- IProject project = (IProject) this.model.getProperty(PROJECT);
- return defaultContainer.getFolder(project.getLocation());
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java
deleted file mode 100644
index 6ca6048f5b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.jpt.common.core.internal.utility.XPointTools;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class JaxbPlatformDescriptionImpl
- implements JaxbPlatformDescription {
-
- private String id;
- private String pluginId;
- private String label;
- private String factoryClassName;
- private IProjectFacetVersion jaxbFacetVersion;
- private boolean default_ = false;
- private JaxbPlatformGroupDescriptionImpl group;
-
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- void setLabel(String label) {
- this.label = label;
- }
-
- public String getFactoryClassName() {
- return this.factoryClassName;
- }
-
- void setFactoryClassName(String className) {
- this.factoryClassName = className;
- }
-
- public IProjectFacetVersion getJaxbFacetVersion() {
- return this.jaxbFacetVersion;
- }
-
- void setJaxbFacetVersion(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- this.jaxbFacetVersion = jaxbFacetVersion;
- }
-
- public boolean supportsJaxbFacetVersion(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- return (this.jaxbFacetVersion != null) ? this.jaxbFacetVersion.equals(jaxbFacetVersion) : true;
- }
-
- public boolean isDefault() {
- return this.default_;
- }
-
- void setDefault(boolean default_) {
- this.default_ = default_;
- }
-
- public JaxbPlatformGroupDescription getGroup() {
- return this.group;
- }
-
- void setGroup(JaxbPlatformGroupDescriptionImpl group) {
- this.group = group;
- }
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- JaxbPlatformDefinitionFactory factory = XPointTools.instantiate(
- this.pluginId, JaxbPlatformManagerImpl.QUALIFIED_EXTENSION_POINT_ID,
- this.factoryClassName, JaxbPlatformDefinitionFactory.class);
- return factory.buildJaxbPlatformDefinition();
- }
-
- @Override
- public String toString() {
- return this.label;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java
deleted file mode 100644
index e3e83ad95d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-
-public class JaxbPlatformGroupDescriptionImpl
- implements JaxbPlatformGroupDescription {
-
- private String id;
- private String pluginId;
- private String label;
- private Map<String, JaxbPlatformDescriptionImpl> platforms;
-
-
- JaxbPlatformGroupDescriptionImpl() {
- this.platforms = new HashMap<String, JaxbPlatformDescriptionImpl>();
- }
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- void setLabel(String label) {
- this.label = label;
- }
-
- void addPlatform(JaxbPlatformDescriptionImpl platform) {
- this.platforms.put(platform.getId(), platform);
- }
-
- public Iterable<JaxbPlatformDescription> getPlatforms() {
- return new SuperIterableWrapper<JaxbPlatformDescription>(CollectionTools.collection(this.platforms.values()));
- }
-
- @Override
- public String toString() {
- return this.label;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
deleted file mode 100644
index 978a21cb8f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.GenericAnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public final class JaxbPlatformImpl
- implements JaxbPlatform {
-
- private JaxbPlatformDefinition platformDefinition;
-
- private AnnotationProvider annotationProvider;
-
-
- public JaxbPlatformImpl(JaxbPlatformDefinition jaxbPlatformDefinition) {
- super();
- this.platformDefinition = jaxbPlatformDefinition;
- this.annotationProvider = new GenericAnnotationProvider(this.platformDefinition.getAnnotationDefinitions(), this.platformDefinition.getNestableAnnotationDefinitions());
- }
-
-
- public JaxbPlatformDescription getDescription() {
- return this.platformDefinition.getDescription();
- }
-
- public JaxbPlatformDefinition getDefinition() {
- return this.platformDefinition;
- }
-
- // ********** factory **********
-
- public JaxbFactory getFactory() {
- return this.platformDefinition.getFactory();
- }
-
-
- // ********** JAXB file/resource models **********
-
- public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
- return (contentType == null) ? null : this.buildJaxbFile(jaxbProject, file, contentType);
- }
-
- protected JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType) {
- JptResourceModel resourceModel = this.buildResourceModel(jaxbProject, file, contentType);
- return (resourceModel == null) ? null : getFactory().buildJaxbFile(jaxbProject, file, contentType, resourceModel);
- }
-
- protected JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file, IContentType contentType) {
- JaxbResourceModelProvider provider = this.getResourceModelProvider(contentType);
- return (provider == null) ? null : provider.buildResourceModel(jaxbProject, file);
- }
-
- /**
- * Return null if we don't have a provider for the specified content type
- * (since we don't have control over the possible content types).
- */
- protected JaxbResourceModelProvider getResourceModelProvider(IContentType contentType) {
- for (JaxbResourceModelProvider provider : getResourceModelProviders()) {
- if (contentType.equals(provider.getContentType())) {
- return provider;
- }
- }
- return null;
- }
-
- protected ListIterable<JaxbResourceModelProvider> getResourceModelProviders() {
- return this.platformDefinition.getResourceModelProviders();
- }
-
-
- // ********** Java annotations **********
-
- public AnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return DefaultAnnotationEditFormatter.instance();
- }
-
-
- // ********** Java attribute mappings **********
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(
- JaxbPersistentAttribute attribute) {
- for (JavaAttributeMappingDefinition definition : getSpecifiedJavaAttributeMappingDefinitions()) {
- if (definition.isSpecified(attribute)) {
- return definition;
- }
- }
- throw new IllegalStateException("There must be a mapping definition for all attributes"); //$NON-NLS-1$
- }
-
- public Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions() {
- return this.platformDefinition.getSpecifiedJavaAttributeMappingDefinitions();
- }
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(String mappingKey) {
- for (JavaAttributeMappingDefinition definition : getSpecifiedJavaAttributeMappingDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- public Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions() {
- return this.platformDefinition.getDefaultJavaAttributeMappingDefinitions();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
deleted file mode 100644
index e619fc47e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
-import org.eclipse.jpt.common.utility.internal.KeyedSet;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbPlatformManagerImpl
- implements JaxbPlatformManager {
-
- static final String EXTENSION_POINT_ID = "jaxbPlatforms"; //$NON-NLS-1$
- static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbCorePlugin.PLUGIN_ID_ + EXTENSION_POINT_ID;
- static final String PLATFORM_GROUP_ELEMENT = "jaxbPlatformGroup"; //$NON-NLS-1$
- static final String PLATFORM_ELEMENT = "jaxbPlatform"; //$NON-NLS-1$
- static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
- static final String LABEL_ATTRIBUTE = "label"; //$NON-NLS-1$
- static final String FACTORY_CLASS_ATTRIBUTE = "factoryClass"; //$NON-NLS-1$
- static final String JAXB_FACET_VERSION_ATTRIBUTE = "jaxbFacetVersion"; //$NON-NLS-1$
- static final String DEFAULT_ATTRIBUTE = "default"; //$NON-NLS-1$
- static final String GROUP_ELEMENT = "group"; //$NON-NLS-1$
-
-
- private static final JaxbPlatformManagerImpl INSTANCE = new JaxbPlatformManagerImpl();
-
-
- public static JaxbPlatformManagerImpl instance() {
- return INSTANCE;
- }
-
-
- private KeyedSet<String, JaxbPlatformGroupDescriptionImpl> platformGroupDescriptions;
- private KeyedSet<String, JaxbPlatformDescriptionImpl> platformDescriptions;
-
-
- // ********** constructor/initialization **********
-
- private JaxbPlatformManagerImpl() {
- super();
- this.platformGroupDescriptions = new KeyedSet<String, JaxbPlatformGroupDescriptionImpl>();
- this.platformDescriptions = new KeyedSet<String, JaxbPlatformDescriptionImpl>();
- readExtensions();
- }
-
-
- private void readExtensions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint xpoint
- = registry.getExtensionPoint(JptJaxbCorePlugin.PLUGIN_ID, EXTENSION_POINT_ID);
-
- if (xpoint == null) {
- throw new IllegalStateException();
- }
-
- List<IConfigurationElement> platformGroupConfigs = new ArrayList<IConfigurationElement>();
- List<IConfigurationElement> platformConfigs = new ArrayList<IConfigurationElement>();
-
- for (IExtension extension : xpoint.getExtensions()) {
- for (IConfigurationElement element : extension.getConfigurationElements()) {
- if (element.getName().equals(PLATFORM_GROUP_ELEMENT)) {
- platformGroupConfigs.add(element);
- }
- else if (element.getName().equals(PLATFORM_ELEMENT)) {
- platformConfigs.add(element);
- }
- }
- }
-
- for (IConfigurationElement element : platformGroupConfigs) {
- readPlatformGroupExtension(element);
- }
-
- for (IConfigurationElement element : platformConfigs) {
- readPlatformExtension(element);
- }
- }
-
- private void readPlatformGroupExtension(IConfigurationElement element) {
- try {
- final JaxbPlatformGroupDescriptionImpl desc = new JaxbPlatformGroupDescriptionImpl();
-
- // plug-in id
- desc.setPluginId(element.getContributor().getName());
-
- // id
- desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformGroupDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
- throw new XPointException();
- }
-
- // label
- desc.setLabel(findRequiredAttribute(element, LABEL_ATTRIBUTE));
-
- this.platformGroupDescriptions.addItem(desc.getId(), desc);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
- private void readPlatformExtension(IConfigurationElement element) {
- try {
- final JaxbPlatformDescriptionImpl desc = new JaxbPlatformDescriptionImpl();
-
- // plug-in id
- desc.setPluginId(element.getContributor().getName());
-
- // id
- desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
- throw new XPointException();
- }
-
- // label
- desc.setLabel(findRequiredAttribute(element, LABEL_ATTRIBUTE));
-
- // factory class
- desc.setFactoryClassName(findRequiredAttribute(element, FACTORY_CLASS_ATTRIBUTE));
-
- // JAXB facet version
- String jaxbFacetVersionString = element.getAttribute(JAXB_FACET_VERSION_ATTRIBUTE);
- if (jaxbFacetVersionString != null) {
- IProjectFacetVersion jpaFacetVersion = JaxbFacet.FACET.getVersion(jaxbFacetVersionString);
- if (jpaFacetVersion != null) {
- desc.setJaxbFacetVersion(jpaFacetVersion);
- }
- else {
- logInvalidValue(element, JAXB_FACET_VERSION_ATTRIBUTE, jaxbFacetVersionString);
- throw new XPointException();
- }
- }
-
- // default
- String defaultString = element.getAttribute(DEFAULT_ATTRIBUTE);
- if (defaultString != null) {
- if (defaultString.equals("true")) { //$NON-NLS-1$
- desc.setDefault(true);
- }
- else if (defaultString.equals("false")) { //$NON-NLS-1$
- desc.setDefault(false);
- }
- else {
- logInvalidValue(element, DEFAULT_ATTRIBUTE, defaultString);
- throw new XPointException();
- }
- }
-
- // group
- String groupId = element.getAttribute(GROUP_ELEMENT);
- if (groupId != null) {
- JaxbPlatformGroupDescriptionImpl group = this.platformGroupDescriptions.getItem(groupId);
- if (group != null) {
- desc.setGroup(group);
- group.addPlatform(desc);
- }
- else {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
- throw new XPointException();
- }
- }
- else {
- JaxbPlatformGroupDescriptionImpl group = new JaxbPlatformGroupDescriptionImpl();
- group.setPluginId(desc.getPluginId());
- group.setId(desc.getId());
- group.setLabel(desc.getLabel());
- group.addPlatform(desc);
-
- if (this.platformGroupDescriptions.containsKey(group.getId())) {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
- throw new XPointException();
- }
-
- this.platformGroupDescriptions.addItem(group.getId(), group);
- }
-
- this.platformDescriptions.addItem(desc.getId(), desc);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
-
- // ********** public methods **********
-
- public Iterable<JaxbPlatformGroupDescription> getJaxbPlatformGroups() {
- return new SuperIterableWrapper<JaxbPlatformGroupDescription>(this.platformGroupDescriptions.getItemSet());
- }
-
- public JaxbPlatformGroupDescription getJaxbPlatformGroup(String groupId) {
- return this.platformGroupDescriptions.getItem(groupId);
- }
-
- public Iterable<JaxbPlatformDescription> getJaxbPlatforms() {
- return new SuperIterableWrapper<JaxbPlatformDescription>(this.platformDescriptions.getItemSet());
- }
-
- public JaxbPlatformDescription getJaxbPlatform(String platformId) {
- return this.platformDescriptions.getItem(platformId);
- }
-
- public JaxbPlatformDescription getDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- for (JaxbPlatformDescription platform : getJaxbPlatforms()) {
- if (platform.isDefault() && platform.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return platform;
- }
- }
- return null;
- }
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition(IProject project) {
- String jaxbPlatformId = JptJaxbCorePlugin.getJaxbPlatformId(project);
- JaxbPlatformDescriptionImpl platformDesc = this.platformDescriptions.getItem(jaxbPlatformId);
- if (platformDesc == null) {
- throw new IllegalArgumentException("Project does not have a recognized JAXB platform."); //$NON-NLS-1$
- }
- return platformDesc.buildJaxbPlatformDefinition();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java
deleted file mode 100644
index 84d2402975..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class NullXmlAccessorOrderAnnotation
- extends NullAnnotation
- implements XmlAccessorOrderAnnotation
-{
- protected NullXmlAccessorOrderAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- @Override
- protected XmlAccessorOrderAnnotation addAnnotation() {
- return (XmlAccessorOrderAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlAccessorTOrderAnnotation implementation **********
-
- // ***** value
- public XmlAccessOrder getValue() {
- return null;
- }
-
- public void setValue(XmlAccessOrder value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 18248a0e9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class NullXmlAccessorTypeAnnotation
- extends NullAnnotation
- implements XmlAccessorTypeAnnotation
-{
- protected NullXmlAccessorTypeAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- @Override
- protected XmlAccessorTypeAnnotation addAnnotation() {
- return (XmlAccessorTypeAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlAccessorTypeAnnotation implementation **********
-
- // ***** value
- public XmlAccessType getValue() {
- return null;
- }
-
- public void setValue(XmlAccessType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
deleted file mode 100644
index 5f22fae013..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class NullXmlEnumAnnotation
- extends NullAnnotation
- implements XmlEnumAnnotation
-{
- protected NullXmlEnumAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- @Override
- protected XmlEnumAnnotation addAnnotation() {
- return (XmlEnumAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlEnumAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return null;
- }
-
- public String getFullyQualifiedValueClassName() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
deleted file mode 100644
index ba178b4fda..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class NullXmlEnumValueAnnotation
- extends NullAnnotation
- implements XmlEnumValueAnnotation
-{
- protected NullXmlEnumValueAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- @Override
- protected XmlEnumValueAnnotation addAnnotation() {
- return (XmlEnumValueAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java
deleted file mode 100644
index 7c2cc3bacf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSchema
- */
-public final class NullXmlSchemaAnnotation
- extends NullAnnotation
- implements XmlSchemaAnnotation
-{
- protected NullXmlSchemaAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- @Override
- protected XmlSchemaAnnotation addAnnotation() {
- return (XmlSchemaAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlSchemaAnnotation implementation **********
-
- // ***** namespace
-
- public String getNamespace() {
- return null;
- }
-
- public void setNamespace(String namespace) {
- if (namespace != null) {
- this.addAnnotation().setNamespace(namespace);
- }
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- // ***** location
-
- public String getLocation() {
- return null;
- }
-
- public void setLocation(String location) {
- if (location != null) {
- this.addAnnotation().setLocation(location);
- }
- }
-
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public XmlNsForm getAttributeFormDefault() {
- return null;
- }
-
- public void setAttributeFormDefault(XmlNsForm attributeFormDefault) {
- if (attributeFormDefault != null) {
- this.addAnnotation().setAttributeFormDefault(attributeFormDefault);
- }
- }
-
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public XmlNsForm getElementFormDefault() {
- return null;
- }
-
- public void setElementFormDefault(XmlNsForm elementFormDefault) {
- if (elementFormDefault != null) {
- this.addAnnotation().setElementFormDefault(elementFormDefault);
- }
- }
-
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public ListIterable<XmlNsAnnotation> getXmlns() {
- return EmptyListIterable.instance();
- }
-
- public int getXmlnsSize() {
- return 0;
- }
-
- public XmlNsAnnotation xmlnsAt(int index) {
- return null;
- }
-
- public XmlNsAnnotation addXmlns(int index) {
- return this.addAnnotation().addXmlns(index);
- }
-
- public void moveXmlns(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlns(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
deleted file mode 100644
index 848b54d55f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class NullXmlTypeAnnotation
- extends NullAnnotation
- implements XmlTypeAnnotation
-{
- protected NullXmlTypeAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- @Override
- protected XmlTypeAnnotation addAnnotation() {
- return (XmlTypeAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factory class
- public String getFactoryClass() {
- return null;
- }
-
- public String getFullyQualifiedFactoryClassName() {
- return null;
- }
-
- public void setFactoryClass(String factoryClass) {
- if (factoryClass != null) {
- this.addAnnotation().setFactoryClass(factoryClass);
- }
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** factory method
- public String getFactoryMethod() {
- return null;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- if (factoryMethod != null) {
- this.addAnnotation().setFactoryMethod(factoryMethod);
- }
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** name
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- this.addAnnotation().setName(name);
- }
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return null;
- }
-
- public void setNamespace(String namespace) {
- if (namespace != null) {
- this.addAnnotation().setNamespace(namespace);
- }
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- public ListIterable<String> getPropOrder() {
- return EmptyListIterable.instance();
- }
-
- public int getPropOrderSize() {
- return 0;
- }
-
- public void addProp(int index, String prop) {
- this.addAnnotation().addProp(index, prop);
- }
-
- public void addProp(String prop) {
- this.addAnnotation().addProp(prop);
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(String prop) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return null;
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
deleted file mode 100644
index e36e86637d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class XmlAccessorOrderAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAccessorOrderAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAccessorOrderAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAccessorOrderAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlAccessorOrderAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAccessorOrderAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
deleted file mode 100644
index ef3bea4831..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class XmlAccessorTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAccessorTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAccessorTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAccessorTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlAccessorTypeAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAccessorTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
deleted file mode 100644
index 2156137c02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class XmlAnyAttributeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAnyAttributeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAnyAttributeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyAttributeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyAttributeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
deleted file mode 100644
index 19fe6dfbb0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class XmlAnyElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAnyElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAnyElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyElementAnnotation(parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
deleted file mode 100644
index e457919225..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class XmlAttachmentRefAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAttachmentRefAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAttachmentRefAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttachmentRefAnnotation(parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttachmentRefAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
deleted file mode 100644
index 7b4020e09f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class XmlAttributeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAttributeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAttributeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttributeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttributeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
deleted file mode 100644
index 47928a5ec7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class XmlElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceXmlElementAnnotation.buildSourceXmlElementAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
deleted file mode 100644
index cfabd0c30f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class XmlElementDeclAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementDeclAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementDeclAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementDeclAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementDeclAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
deleted file mode 100644
index 742aa7d549..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class XmlElementRefAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementRefAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementRefAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceXmlElementRefAnnotation.buildSourceXmlElementRefAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
deleted file mode 100644
index c76018b384..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class XmlElementRefsAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementRefsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementRefsAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementRefsAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefsAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
deleted file mode 100644
index d36abe649d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class XmlElementWrapperAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementWrapperAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementWrapperAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementWrapperAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementWrapperAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
deleted file mode 100644
index 5b070a57cd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class XmlElementsAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementsAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementsAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementsAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
deleted file mode 100644
index ec80a4c62b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class XmlEnumAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlEnumAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlEnumAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
deleted file mode 100644
index 39a765fcec..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class XmlEnumValueAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlEnumValueAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlEnumValueAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumValueAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumValueAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumValueAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
deleted file mode 100644
index 4f7b595d89..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class XmlIDAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlIDAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlIDAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
deleted file mode 100644
index 99512ab4dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class XmlIDREFAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlIDREFAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlIDREFAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDREFAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDREFAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
deleted file mode 100644
index afcee0493a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryData
- */
-public final class XmlInlineBinaryDataAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlInlineBinaryDataAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlInlineBinaryDataAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlInlineBinaryDataAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlInlineBinaryDataAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
deleted file mode 100644
index 1e7751e87d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapterAnnotation
- */
-public final class XmlJavaTypeAdapterAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlJavaTypeAdapterAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlJavaTypeAdapterAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- public String getContainerAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS;
- }
-
- public String getElementName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlJavaTypeAdapterAnnotation.buildSourceXmlJavaTypeAdapterAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryXmlJavaTypeAdapterAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
deleted file mode 100644
index adef72670c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdaptersAnnotation
- */
-public final class XmlJavaTypeAdaptersAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlJavaTypeAdaptersAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private XmlJavaTypeAdaptersAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
deleted file mode 100644
index 38fdba5caa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class XmlListAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlListAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlListAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlListAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlListAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
deleted file mode 100644
index ec395f8a50..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class XmlMimeTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlMimeTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlMimeTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMimeTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMimeTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
deleted file mode 100644
index 3d5bd69be6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class XmlMixedAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlMixedAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlMixedAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMixedAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMixedAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
deleted file mode 100644
index d0b3fba4a3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRegistryAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRegistryAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class XmlRegistryAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlRegistryAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlRegistryAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRegistryAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRegistryAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
deleted file mode 100644
index 58370c5fe8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class XmlRootElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlRootElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlRootElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRootElementAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRootElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
deleted file mode 100644
index 9688c0dea1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlSchema
- */
-public class XmlSchemaAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSchemaAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSchemaAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSchemaAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlSchemaAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- // TODO
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
deleted file mode 100644
index 6fb9f98ae2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class XmlSchemaTypeAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlSchemaTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- private XmlSchemaTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return JAXB.XML_SCHEMA_TYPE;
- }
-
- public String getContainerAnnotationName() {
- return JAXB.XML_SCHEMA_TYPES;
- }
-
- public String getElementName() {
- return JAXB.XML_SCHEMA_TYPES__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlSchemaTypeAnnotation.buildSourceXmlSchemaTypeAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
deleted file mode 100644
index 86e59a162a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdaptersAnnotation
- */
-public final class XmlSchemaTypesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSchemaTypesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private XmlSchemaTypesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA_TYPES;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
deleted file mode 100644
index 65e9d6b490..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class XmlSeeAlsoAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSeeAlsoAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSeeAlsoAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSeeAlsoAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlSeeAlsoAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
deleted file mode 100644
index b273019abe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class XmlTransientAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTransientAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTransientAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTransientAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTransientAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
deleted file mode 100644
index db0e7b5cfe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class XmlTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlTypeAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
deleted file mode 100644
index 6339a90745..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class XmlValueAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlValueAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlValueAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlValueAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlValueAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java
deleted file mode 100644
index f686d90601..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class BinaryXmlAccessorOrderAnnotation
- extends BinaryAnnotation
- implements XmlAccessorOrderAnnotation
-{
- private XmlAccessOrder value;
-
-
- public BinaryXmlAccessorOrderAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- //*************** XmlAccessorOrderAnnotation implementation ****************
-
- // ***** value
- public XmlAccessOrder getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessOrder value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(XmlAccessOrder value) {
- XmlAccessOrder old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private XmlAccessOrder buildValue() {
- return XmlAccessOrder.fromJavaAnnotationValue(this.getJdtMemberValue(JAXB.XML_ACCESSOR_ORDER__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 363b4a4fad..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class BinaryXmlAccessorTypeAnnotation
- extends BinaryAnnotation
- implements XmlAccessorTypeAnnotation
-{
- private XmlAccessType value;
-
-
- public BinaryXmlAccessorTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- //*************** XmlAccessorTypeAnnotation implementation ****************
-
- // ***** value
- public XmlAccessType getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(XmlAccessType value) {
- XmlAccessType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private XmlAccessType buildValue() {
- return XmlAccessType.fromJavaAnnotationValue(this.getJdtMemberValue(JAXB.XML_ACCESSOR_TYPE__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java
deleted file mode 100644
index 06a7961529..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class BinaryXmlAnyAttributeAnnotation
- extends BinaryAnnotation
- implements XmlAnyAttributeAnnotation
-{
-
- public BinaryXmlAnyAttributeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java
deleted file mode 100644
index 0410afb97e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class BinaryXmlAnyElementAnnotation
- extends BinaryAnnotation
- implements XmlAnyElementAnnotation
-{
- private Boolean lax;
- private String value;
-
-
- public BinaryXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.lax = this.buildLax();
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setLax_(this.buildLax());
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlAnyElementAnnotation implementation **********
-
- // ***** lax
- public Boolean getLax() {
- return this.lax;
- }
-
- public void setLax(Boolean lax) {
- throw new UnsupportedOperationException();
- }
-
- private void setLax_(Boolean lax) {
- Boolean old = this.lax;
- this.lax = lax;
- this.firePropertyChanged(LAX_PROPERTY, old, lax);
- }
-
- private Boolean buildLax() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ANY_ELEMENT__LAX);
- }
-
- public TextRange getLaxTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ANY_ELEMENT__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.value;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java
deleted file mode 100644
index 610dce8c81..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class BinaryXmlAttachmentRefAnnotation
- extends BinaryAnnotation
- implements XmlAttachmentRefAnnotation
-{
-
- public BinaryXmlAttachmentRefAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
deleted file mode 100644
index 520efc7917..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class BinaryXmlAttributeAnnotation
- extends BinaryAnnotation
- implements XmlAttributeAnnotation
-{
- private String name;
- private String namespace;
- private Boolean required;
-
-
- public BinaryXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.required = this.buildRequired();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setRequired_(this.buildRequired());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlAttributeAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
deleted file mode 100644
index 72721b7d45..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class BinaryXmlElementAnnotation
- extends BinaryAnnotation
- implements XmlElementAnnotation
-{
- private String name;
- private String namespace;
- private String defaultValue;
- private Boolean nillable;
- private Boolean required;
- private String type;
-
-
- public BinaryXmlElementAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.defaultValue = this.buildDefaultValue();
- this.nillable = this.buildNillable();
- this.required = this.buildRequired();
- this.type = this.buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setDefaultValue_(this.buildDefaultValue());
- this.setNillable_(this.buildNillable());
- this.setRequired_(this.buildRequired());
- this.setType_(this.buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** default value
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- this.firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- private String buildDefaultValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__DEFAULT_VALUE);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNillable_(Boolean nillable) {
- Boolean old = this.nillable;
- this.nillable = nillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, nillable);
- }
-
- private Boolean buildNillable() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__NILLABLE);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.type;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
deleted file mode 100644
index bf1be28daf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class BinaryXmlElementDeclAnnotation
- extends BinaryAnnotation
- implements XmlElementDeclAnnotation {
-
- private String scope;
- private String namespace;
- private String name;
- private String substitutionHeadNamespace;
- private String substitutionHeadName;
- private String defaultValue;
-
-
- public BinaryXmlElementDeclAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.scope = buildScope();
- this.namespace = buildNamespace();
- this.name = buildName();
- this.substitutionHeadNamespace = buildSubstitutionHeadNamespace();
- this.substitutionHeadName = buildSubstitutionHeadName();
- this.defaultValue = buildDefaultValue();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- @Override
- public void update() {
- super.update();
- setScope_(buildScope());
- setNamespace_(buildNamespace());
- setName_(buildName());
- setSubstitutionHeadNamespace_(buildSubstitutionHeadNamespace());
- setSubstitutionHeadName_(buildSubstitutionHeadName());
- setDefaultValue_(buildDefaultValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- throw new UnsupportedOperationException();
- }
-
- private void setScope_(String scope) {
- String old = this.scope;
- this.scope = scope;
- firePropertyChanged(SCOPE_PROPERTY, old, scope);
- firePropertyChanged(FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY, old, scope);
- }
-
- private String buildScope() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SCOPE);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedScopeClassName() {
- return this.scope;
- }
-
-
- // ***** substitutionHeadNamespace *****
-
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setSubstitutionHeadNamespace_(String substitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, substitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** substitutionHeadName *****
-
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- throw new UnsupportedOperationException();
- }
-
- private void setSubstitutionHeadName_(String substitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = substitutionHeadName;
- firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, substitutionHeadName);
- }
-
- private String buildSubstitutionHeadName() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** default value *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- private String buildDefaultValue() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
deleted file mode 100644
index 2a07f8ce03..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class BinaryXmlElementRefAnnotation
- extends BinaryAnnotation
- implements XmlElementRefAnnotation
-{
- private String name;
- private String namespace;
- private Boolean required;
- private String type;
-
-
- public BinaryXmlElementRefAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.required = this.buildRequired();
- this.type = this.buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setRequired_(this.buildRequired());
- this.setType_(this.buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementRefAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.type;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java
deleted file mode 100644
index 7f6ab4b505..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-
-public class BinaryXmlElementRefsAnnotation
- extends BinaryAnnotation
- implements XmlElementRefsAnnotation {
-
- private final Vector<XmlElementRefAnnotation> xmlElementRefs;
-
-
- public BinaryXmlElementRefsAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.xmlElementRefs = this.buildXmlElementRefs();
- }
-
-
- private Vector<XmlElementRefAnnotation> buildXmlElementRefs() {
- Object[] jdtXmlElementRefs = this.getJdtMemberValues(JAXB.XML_ELEMENT_REFS__VALUE);
- Vector<XmlElementRefAnnotation> result = new Vector<XmlElementRefAnnotation>(jdtXmlElementRefs.length);
- for (Object jdtXmlElementRef : jdtXmlElementRefs) {
- result.add(new BinaryXmlElementRefAnnotation(this, (IAnnotation) jdtXmlElementRef));
- }
- return result;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefs() {
- return new LiveCloneListIterable<XmlElementRefAnnotation>(this.xmlElementRefs);
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefs.size();
- }
-
- public XmlElementRefAnnotation xmlElementRefAt(int index) {
- return this.xmlElementRefs.elementAt(index);
- }
-
- public XmlElementRefAnnotation addXmlElementRef(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlElementRef(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
deleted file mode 100644
index 344734465c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class BinaryXmlElementWrapperAnnotation
- extends BinaryAnnotation
- implements XmlElementWrapperAnnotation
-{
- private String name;
- private String namespace;
- private Boolean nillable;
- private Boolean required;
-
-
- public BinaryXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.nillable = this.buildNillable();
- this.required = this.buildRequired();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setNillable_(this.buildNillable());
- this.setRequired_(this.buildRequired());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementWrapperAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNillable_(Boolean nillable) {
- Boolean old = this.nillable;
- this.nillable = nillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, nillable);
- }
-
- private Boolean buildNillable() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NILLABLE);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java
deleted file mode 100644
index 47d6f1d24c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElements
- */
-public final class BinaryXmlElementsAnnotation
- extends BinaryAnnotation
- implements XmlElementsAnnotation
-{
- private final Vector<XmlElementAnnotation> xmlElements;
-
-
- public BinaryXmlElementsAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.xmlElements = this.buildXmlElements();
- }
-
- private Vector<XmlElementAnnotation> buildXmlElements() {
- Object[] jdtXmlElements = this.getJdtMemberValues(JAXB.XML_ELEMENTS__VALUE);
- Vector<XmlElementAnnotation> result = new Vector<XmlElementAnnotation>(jdtXmlElements.length);
- for (Object jdtXmlElement : jdtXmlElements) {
- result.add(new BinaryXmlElementAnnotation(this, (IAnnotation) jdtXmlElement));
- }
- return result;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public ListIterable<XmlElementAnnotation> getXmlElements() {
- return new LiveCloneListIterable<XmlElementAnnotation>(this.xmlElements);
- }
-
- public int getXmlElementsSize() {
- return this.xmlElements.size();
- }
-
- public XmlElementAnnotation xmlElementAt(int index) {
- return this.xmlElements.elementAt(index);
- }
-
- public XmlElementAnnotation addXmlElement(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlElement(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
deleted file mode 100644
index eaaff3cf5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class BinaryXmlEnumAnnotation
- extends BinaryAnnotation
- implements XmlEnumAnnotation
-{
- private String value;
-
-
- public BinaryXmlEnumAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnum implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ENUM__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.value;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
deleted file mode 100644
index 53cc480a86..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class BinaryXmlEnumValueAnnotation
- extends BinaryAnnotation
- implements XmlEnumValueAnnotation
-{
-
- private String value;
-
- public BinaryXmlEnumValueAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ENUM_VALUE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java
deleted file mode 100644
index e40dfa1388..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class BinaryXmlIDAnnotation
- extends BinaryAnnotation
- implements XmlIDAnnotation
-{
-
- public BinaryXmlIDAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java
deleted file mode 100644
index f98361154f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class BinaryXmlIDREFAnnotation
- extends BinaryAnnotation
- implements XmlIDREFAnnotation
-{
-
- public BinaryXmlIDREFAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index 02a5486214..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class BinaryXmlInlineBinaryDataAnnotation
- extends BinaryAnnotation
- implements XmlInlineBinaryDataAnnotation {
-
- public BinaryXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 70bdd6bec8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- */
-public final class BinaryXmlJavaTypeAdapterAnnotation
- extends BinaryAnnotation
- implements XmlJavaTypeAdapterAnnotation {
-
- private String value;
-
- private String type;
-
-
- public BinaryXmlJavaTypeAdapterAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = buildValue();
- this.type = buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- @Override
- public void update() {
- super.update();
- setValue_(buildValue());
- setType_(buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlJavaTypeAdapterAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedValue() {
- return this.value;
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedType() {
- return this.type;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java
deleted file mode 100644
index 1b3f952590..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class BinaryXmlListAnnotation
- extends BinaryAnnotation
- implements XmlListAnnotation {
-
- public BinaryXmlListAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java
deleted file mode 100644
index a925f2d5b6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class BinaryXmlMimeTypeAnnotation
- extends BinaryAnnotation
- implements XmlMimeTypeAnnotation
-{
-
- private String value;
-
- public BinaryXmlMimeTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** XmlMimeTypeAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_MIME_TYPE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java
deleted file mode 100644
index 618d56348b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class BinaryXmlMixedAnnotation
- extends BinaryAnnotation
- implements XmlMixedAnnotation {
-
- public BinaryXmlMixedAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java
deleted file mode 100644
index 30c963fa17..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class BinaryXmlRegistryAnnotation
- extends BinaryAnnotation
- implements XmlRegistryAnnotation
-{
-
- public BinaryXmlRegistryAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
deleted file mode 100644
index ac2e6159fd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class BinaryXmlRootElementAnnotation
- extends BinaryAnnotation
- implements XmlRootElementAnnotation
-{
- private String name;
- private String namespace;
-
-
- public BinaryXmlRootElementAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlRootElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java
deleted file mode 100644
index ce0b09154e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class BinaryXmlSeeAlsoAnnotation
- extends BinaryAnnotation
- implements XmlSeeAlsoAnnotation {
-
- private final Vector<String> classes;
-
-
- public BinaryXmlSeeAlsoAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.classes = this.buildClasses();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateClasses();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classes);
- }
-
-
- // ********** XmlSeeAlsoAnnotation implementation **********
-
- // ***** value
- public ListIterable<String> getClasses() {
- return new LiveCloneListIterable<String>(this.classes);
- }
-
- public int getClassesSize() {
- return this.classes.size();
- }
-
- private Vector<String> buildClasses() {
- Object[] jdtClasses = this.getJdtMemberValues(JAXB.XML_SEE_ALSO__VALUE);
- Vector<String> result = new Vector<String>(jdtClasses.length);
- for (Object jdtClass : jdtClasses) {
- result.add((String) jdtClass);
- }
- return result;
- }
-
- public void addClass(String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void addClass(int index, String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeClass(String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void removeClass(int index) {
- throw new UnsupportedOperationException();
- }
-
- public ListIterable<String> getFullyQualifiedClasses() {
- return getClasses();
- }
-
- // TODO
- private void updateClasses() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java
deleted file mode 100644
index 57371ddb14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class BinaryXmlTransientAnnotation
- extends BinaryAnnotation
- implements XmlTransientAnnotation
-{
-
- public BinaryXmlTransientAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
deleted file mode 100644
index a2d08f7f2c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class BinaryXmlTypeAnnotation
- extends BinaryAnnotation
- implements XmlTypeAnnotation
-{
- private String factoryClass;
- private String factoryMethod;
- private String name;
- private String namespace;
- private final Vector<String> propOrder;
-
-
- public BinaryXmlTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.factoryClass = this.buildFactoryClass();
- this.factoryMethod = this.buildFactoryMethod();
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.propOrder = this.buildPropOrder();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setFactoryClass_(this.buildFactoryClass());
- this.setFactoryMethod_(this.buildFactoryMethod());
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factoryClass
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setFactoryClass_(String factoryClass) {
- String old = this.factoryClass;
- this.factoryClass = factoryClass;
- this.firePropertyChanged(FACTORY_CLASS_PROPERTY, old, factoryClass);
- this.firePropertyChanged(FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY, old, factoryClass);
- }
-
- private String buildFactoryClass() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_CLASS);
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified factory class name
- public String getFullyQualifiedFactoryClassName() {
- return this.factoryClass;
- }
-
- // ***** factoryMethod
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- throw new UnsupportedOperationException();
- }
-
- private void setFactoryMethod_(String factoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = factoryMethod;
- this.firePropertyChanged(FACTORY_METHOD_PROPERTY, old, factoryMethod);
- }
-
- private String buildFactoryMethod() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_METHOD);
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** prop order
- public ListIterable<String> getPropOrder() {
- return new LiveCloneListIterable<String>(this.propOrder);
- }
-
- public int getPropOrderSize() {
- return this.propOrder.size();
- }
-
- private Vector<String> buildPropOrder() {
- Object[] jdtPropOrder = this.getJdtMemberValues(JAXB.XML_TYPE__PROP_ORDER);
- Vector<String> result = new Vector<String>(jdtPropOrder.length);
- for (Object jdtProp : jdtPropOrder) {
- result.add((String) jdtProp);
- }
- return result;
- }
-
- public void addProp(String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void addProp(int index, String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(int index) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java
deleted file mode 100644
index d619f38f2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class BinaryXmlValueAnnotation
- extends BinaryAnnotation
- implements XmlValueAnnotation
-{
-
- public BinaryXmlValueAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java
deleted file mode 100644
index 5ae3119058..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class SourceXmlAccessorOrderAnnotation
- extends SourceAnnotation
- implements XmlAccessorOrderAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_ORDER);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private XmlAccessOrder value;
-
-
- public SourceXmlAccessorOrderAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(annotatedElement, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- //*************** XmlAccessorOrderAnnotation implementation ****************
-
- // ***** value
- public XmlAccessOrder getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessOrder value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(XmlAccessOrder.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(XmlAccessOrder astValue) {
- XmlAccessOrder old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private XmlAccessOrder buildValue(CompilationUnit astRoot) {
- return XmlAccessOrder.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- //remove the XmlAccessorOrder annotation when the value element is removed.
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ACCESSOR_ORDER__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 1c3b0bbd08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class SourceXmlAccessorTypeAnnotation
- extends SourceAnnotation
- implements XmlAccessorTypeAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private XmlAccessType value;
-
-
- public SourceXmlAccessorTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(annotatedElement, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- //*************** XmlAccessorTypeAnnotation implementation ****************
-
- // ***** value
- public XmlAccessType getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(XmlAccessType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(XmlAccessType astValue) {
- XmlAccessType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private XmlAccessType buildValue(CompilationUnit astRoot) {
- return XmlAccessType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- //remove the XmlAccessorType annotation when the value element is removed.
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ACCESSOR_TYPE__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java
deleted file mode 100644
index 0a70fa9786..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class SourceXmlAnyAttributeAnnotation
- extends SourceAnnotation
- implements XmlAnyAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ATTRIBUTE);
-
- public SourceXmlAnyAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java
deleted file mode 100644
index 43e13bcd7d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class SourceXmlAnyElementAnnotation
- extends SourceAnnotation
- implements XmlAnyElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ELEMENT);
-
- private final DeclarationAnnotationElementAdapter<Boolean> laxDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> laxAdapter;
- private Boolean lax;
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private String fullyQualifiedValueClassName;
-
-
- // ********** constructors **********
- public SourceXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.laxDeclarationAdapter = this.buildLaxAdapter(daa);
- this.laxAdapter = this.buildShortCircuitBooleanElementAdapter(this.laxDeclarationAdapter);
- this.valueDeclarationAdapter = this.buildValueAdapter(daa);
- this.valueAdapter = this.buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildLaxAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ANY_ELEMENT__LAX);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_ANY_ELEMENT__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.lax = this.buildLax(astRoot);
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncLax(this.buildLax(astRoot));
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlAnyElementAnnotation implementation **********
-
- // ***** lax
- public Boolean getLax() {
- return this.lax;
- }
-
- public void setLax(Boolean lax) {
- if (this.attributeValueHasChanged(this.lax, lax)) {
- this.lax = lax;
- this.laxAdapter.setValue(lax);
- }
- }
-
- private void syncLax(Boolean astLax) {
- Boolean old = this.lax;
- this.lax = astLax;
- this.firePropertyChanged(LAX_PROPERTY, old, astLax);
- }
-
- private Boolean buildLax(CompilationUnit astRoot) {
- return this.laxAdapter.getValue(astRoot);
- }
-
- public TextRange getLaxTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.laxDeclarationAdapter, astRoot);
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.fullyQualifiedValueClassName;
- }
-
- private void syncFullyQualifiedValueClassName(String name) {
- String old = this.fullyQualifiedValueClassName;
- this.fullyQualifiedValueClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedValueClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java
deleted file mode 100644
index aeaddd91d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class SourceXmlAttachmentRefAnnotation
- extends SourceAnnotation
- implements XmlAttachmentRefAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTACHMENT_REF);
-
- public SourceXmlAttachmentRefAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
deleted file mode 100644
index 43d942ec92..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class SourceXmlAttributeAnnotation
- extends SourceAnnotation
- implements XmlAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTRIBUTE);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
-
- // ********** constructors **********
- public SourceXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ATTRIBUTE__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ATTRIBUTE__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ATTRIBUTE__REQUIRED);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.required = this.buildRequired(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlAttributeAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
deleted file mode 100644
index 5cb7f6007b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class SourceXmlElementAnnotation
- extends SourceAnnotation
- implements XmlElementAnnotation {
-
- private static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT);
-
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> nillableAdapter;
- private Boolean nillable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
- private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> defaultValueAdapter;
- private String defaultValue;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedTypeName;
-
-
- public static SourceXmlElementAnnotation buildSourceXmlElementAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement) {
-
- return new SourceXmlElementAnnotation(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceXmlElementAnnotation buildNestedSourceXmlElementAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceXmlElementAnnotation(parent, annotatedElement, idaa);
- }
-
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- }
-
- private SourceXmlElementAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa,
- AnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nillableDeclarationAdapter = this.buildNillableAdapter(daa);
- this.nillableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nillableDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- this.defaultValueDeclarationAdapter = this.buildDefaultValueAdapter(daa);
- this.defaultValueAdapter = this.buildAnnotationElementAdapter(this.defaultValueDeclarationAdapter);
- this.typeDeclarationAdapter = this.buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildNillableAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT__NILLABLE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT__REQUIRED);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDefaultValueAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__DEFAULT_VALUE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_ELEMENT__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.nillable = this.buildNillable(astRoot);
- this.required = this.buildRequired(astRoot);
- this.defaultValue = this.buildDefaultValue(astRoot);
- this.type = this.buildType(astRoot);
- this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncNillable(this.buildNillable(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- this.syncDefaultValue(this.buildDefaultValue(astRoot));
- this.syncType(this.buildType(astRoot));
- this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- if (this.attributeValueHasChanged(this.nillable, nillable)) {
- this.nillable = nillable;
- this.nillableAdapter.setValue(nillable);
- }
- }
-
- private void syncNillable(Boolean astNillable) {
- Boolean old = this.nillable;
- this.nillable = astNillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, astNillable);
- }
-
- private Boolean buildNillable(CompilationUnit astRoot) {
- return this.nillableAdapter.getValue(astRoot);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-
- // ***** defaultValue
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- if (this.attributeValueHasChanged(this.defaultValue, defaultValue)) {
- this.defaultValue = defaultValue;
- this.defaultValueAdapter.setValue(defaultValue);
- }
- }
-
- private void syncDefaultValue(String astDefaultValue) {
- String old = this.defaultValue;
- this.defaultValue = astDefaultValue;
- this.firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, astDefaultValue);
- }
-
- private String buildDefaultValue(CompilationUnit astRoot) {
- return this.defaultValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.fullyQualifiedTypeName;
- }
-
- private void syncFullyQualifiedTypeName(String name) {
- String old = this.fullyQualifiedTypeName;
- this.fullyQualifiedTypeName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTypeName(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
deleted file mode 100644
index 92745cb0f9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class SourceXmlElementDeclAnnotation
- extends SourceAnnotation
- implements XmlElementDeclAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_DECL);
-
- private final DeclarationAnnotationElementAdapter<String> scopeDeclarationAdapter;
- private final AnnotationElementAdapter<String> scopeAdapter;
- private String scope;
- private String fullyQualifiedScopeClassName;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> substitutionHeadNamespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> substitutionHeadNamespaceAdapter;
- private String substitutionHeadNamespace;
-
- private final DeclarationAnnotationElementAdapter<String> substitutionHeadNameDeclarationAdapter;
- private final AnnotationElementAdapter<String> substitutionHeadNameAdapter;
- private String substitutionHeadName;
-
- private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> defaultValueAdapter;
- private String defaultValue;
-
-
- // ********** constructors **********
-
- public SourceXmlElementDeclAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- this.scopeDeclarationAdapter = buildScopeDeclarationAdapter();
- this.scopeAdapter = buildAnnotationElementAdapter(this.scopeDeclarationAdapter);
- this.namespaceDeclarationAdapter = buildNamespaceDeclarationAdapter();
- this.namespaceAdapter = buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nameDeclarationAdapter = buildNameDeclarationAdapter();
- this.nameAdapter = buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.substitutionHeadNamespaceDeclarationAdapter = buildSubstitutionHeadNamespaceDeclarationAdapter();
- this.substitutionHeadNamespaceAdapter = buildAnnotationElementAdapter(this.substitutionHeadNamespaceDeclarationAdapter);
- this.substitutionHeadNameDeclarationAdapter = buildSubstitutionHeadNameDeclarationAdapter();
- this.substitutionHeadNameAdapter = buildAnnotationElementAdapter(this.substitutionHeadNameDeclarationAdapter);
- this.defaultValueDeclarationAdapter = buildDefaultValueDeclarationAdapter();
- this.defaultValueAdapter = buildAnnotationElementAdapter(this.defaultValueDeclarationAdapter);
- }
-
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildScopeDeclarationAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SCOPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDefaultValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.scope = buildScope(astRoot);
- this.fullyQualifiedScopeClassName = buildFullyQualifiedScopeClassName(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.name = buildName(astRoot);
- this.substitutionHeadNamespace = buildSubstitutionHeadNamespace(astRoot);
- this.substitutionHeadName = buildSubstitutionHeadName(astRoot);
- this.defaultValue = buildDefaultValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncScope(buildScope(astRoot));
- syncFullyQualifiedScopeClassName(buildFullyQualifiedScopeClassName(astRoot));
- syncNamespace(buildNamespace(astRoot));
- syncName(buildName(astRoot));
- syncSubstitutionHeadNamespace(buildSubstitutionHeadNamespace(astRoot));
- syncSubstitutionHeadName(buildSubstitutionHeadName(astRoot));
- syncDefaultValue(buildDefaultValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- if (attributeValueHasChanged(this.scope, scope)) {
- this.scope = scope;
- this.scopeAdapter.setValue(scope);
- }
- }
-
- private void syncScope(String astScope) {
- String old = this.scope;
- this.scope = astScope;
- firePropertyChanged(SCOPE_PROPERTY, old, astScope);
- }
-
- private String buildScope(CompilationUnit astRoot) {
- return this.scopeAdapter.getValue(astRoot);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.scopeDeclarationAdapter, astRoot);
- }
-
-
- // ***** fully-qualified scope class name *****
-
- public String getFullyQualifiedScopeClassName() {
- return this.fullyQualifiedScopeClassName;
- }
-
- private void syncFullyQualifiedScopeClassName(String name) {
- String old = this.fullyQualifiedScopeClassName;
- this.fullyQualifiedScopeClassName = name;
- firePropertyChanged(FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedScopeClassName(CompilationUnit astRoot) {
- return (this.scope == null) ? null : ASTTools.resolveFullyQualifiedName(this.scopeAdapter.getExpression(astRoot));
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** substitutionHeadNamespace *****
-
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- if (attributeValueHasChanged(this.substitutionHeadNamespace, substitutionHeadNamespace)) {
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- this.substitutionHeadNamespaceAdapter.setValue(substitutionHeadNamespace);
- }
- }
-
- private void syncSubstitutionHeadNamespace(String astSubstitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = astSubstitutionHeadNamespace;
- firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, astSubstitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace(CompilationUnit astRoot) {
- return this.substitutionHeadNamespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNamespaceDeclarationAdapter, astRoot);
- }
-
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNamespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** substitutionHeadName *****
-
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- if (attributeValueHasChanged(this.substitutionHeadName, substitutionHeadName)) {
- this.substitutionHeadName = substitutionHeadName;
- this.substitutionHeadNameAdapter.setValue(substitutionHeadName);
- }
- }
-
- private void syncSubstitutionHeadName(String astSubstitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = astSubstitutionHeadName;
- firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, astSubstitutionHeadName);
- }
-
- private String buildSubstitutionHeadName(CompilationUnit astRoot) {
- return this.substitutionHeadNameAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNameDeclarationAdapter, astRoot);
- }
-
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** defaultValue *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- if (attributeValueHasChanged(this.defaultValue, defaultValue)) {
- this.defaultValue = defaultValue;
- this.defaultValueAdapter.setValue(defaultValue);
- }
- }
-
- private void syncDefaultValue(String astDefaultValue) {
- String old = this.defaultValue;
- this.defaultValue = astDefaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, astDefaultValue);
- }
-
- private String buildDefaultValue(CompilationUnit astRoot) {
- return this.defaultValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
deleted file mode 100644
index ac108d4d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class SourceXmlElementRefAnnotation
- extends SourceAnnotation
- implements XmlElementRefAnnotation {
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REF);
-
-
- private String fullyQualifiedTypeName;
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
-
-
- public static SourceXmlElementRefAnnotation buildSourceXmlElementRefAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement) {
-
- return new SourceXmlElementRefAnnotation(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceXmlElementRefAnnotation buildNestedSourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceXmlElementRefAnnotation(parent, annotatedElement, idaa);
- }
-
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa) {
-
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- this(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- }
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa,
- AnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceDeclarationAdapter();
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- this.typeDeclarationAdapter = this.buildTypeDeclarationAdapter();
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JAXB.XML_ELEMENT_REF__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JAXB.XML_ELEMENT_REF__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_REF__REQUIRED);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeDeclarationAdapter() {
- return buildAnnotationElementAdapter(this.daa, JAXB.XML_ELEMENT_REF__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.required = this.buildRequired(astRoot);
- this.type = this.buildType(astRoot);
- this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- this.syncType(this.buildType(astRoot));
- this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementRefAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.fullyQualifiedTypeName;
- }
-
- private void syncFullyQualifiedTypeName(String name) {
- String old = this.fullyQualifiedTypeName;
- this.fullyQualifiedTypeName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTypeName(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java
deleted file mode 100644
index 7b92a4aa16..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRefs
- */
-public class SourceXmlElementRefsAnnotation
- extends SourceAnnotation
- implements XmlElementRefsAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REFS);
-
-
- private final XmlElementRefsAnnotationContainer xmlElementRefsContainer
- = new XmlElementRefsAnnotationContainer();
-
-
- public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlElementRefsContainer.initialize(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.xmlElementRefsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
-
- // **************** xml element refs **************************************
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefs() {
- return this.xmlElementRefsContainer.getNestedAnnotations();
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefsContainer.getNestedAnnotationsSize();
- }
-
- public XmlElementRefAnnotation xmlElementRefAt(int index) {
- return this.xmlElementRefsContainer.nestedAnnotationAt(index);
- }
-
- public XmlElementRefAnnotation addXmlElementRef(int index) {
- return this.xmlElementRefsContainer.addNestedAnnotation(index);
- }
-
- private XmlElementRefAnnotation buildXmlElementRef(int index) {
- return SourceXmlElementRefAnnotation.buildNestedSourceXmlElementRefAnnotation(
- this, this.annotatedElement, buildXmlElementRefIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlElementRefIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_ELEMENT_REFS__VALUE, index, JAXB.XML_ELEMENT_REF);
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- this.xmlElementRefsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlElementRef(int index) {
- this.xmlElementRefsContainer.removeNestedAnnotation(index);
- }
-
-
- class XmlElementRefsAnnotationContainer
- extends AnnotationContainer<XmlElementRefAnnotation> {
-
- @Override
- protected String getAnnotationsPropertyName() {
- return XML_ELEMENT_REFS_LIST;
- }
-
- @Override
- protected String getElementName() {
- return JAXB.XML_ELEMENT_REFS__VALUE;
- }
-
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- protected XmlElementRefAnnotation buildNestedAnnotation(int index) {
- return SourceXmlElementRefsAnnotation.this.buildXmlElementRef(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
deleted file mode 100644
index 8f02178031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class SourceXmlElementWrapperAnnotation
- extends SourceAnnotation
- implements XmlElementWrapperAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_WRAPPER);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> nillableAdapter;
- private Boolean nillable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
-
- // ********** constructors **********
- public SourceXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nillableDeclarationAdapter = this.buildNillableAdapter(daa);
- this.nillableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nillableDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_WRAPPER__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_WRAPPER__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildNillableAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_WRAPPER__NILLABLE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_WRAPPER__REQUIRED);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.nillable = this.buildNillable(astRoot);
- this.required = this.buildRequired(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncNillable(this.buildNillable(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementWrapperAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- if (this.attributeValueHasChanged(this.nillable, nillable)) {
- this.nillable = nillable;
- this.nillableAdapter.setValue(nillable);
- }
- }
-
- private void syncNillable(Boolean astNillable) {
- Boolean old = this.nillable;
- this.nillable = astNillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, astNillable);
- }
-
- private Boolean buildNillable(CompilationUnit astRoot) {
- return this.nillableAdapter.getValue(astRoot);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java
deleted file mode 100644
index 78773f5016..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElements
- */
-public class SourceXmlElementsAnnotation
- extends SourceAnnotation
- implements XmlElementsAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENTS);
-
-
- private final XmlElementsAnnotationContainer xmlElementsContainer = new XmlElementsAnnotationContainer();
-
- public SourceXmlElementsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlElementsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlElementsContainer.initialize(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.xmlElementsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
-
- // **************** xmlns *************************************************
-
- public ListIterable<XmlElementAnnotation> getXmlElements() {
- return this.xmlElementsContainer.getNestedAnnotations();
- }
-
- public int getXmlElementsSize() {
- return this.xmlElementsContainer.getNestedAnnotationsSize();
- }
-
- public XmlElementAnnotation xmlElementAt(int index) {
- return this.xmlElementsContainer.nestedAnnotationAt(index);
- }
-
- public XmlElementAnnotation addXmlElement(int index) {
- return this.xmlElementsContainer.addNestedAnnotation(index);
- }
-
- private XmlElementAnnotation buildXmlElement(int index) {
- return SourceXmlElementAnnotation.buildNestedSourceXmlElementAnnotation(this, this.annotatedElement, buildXmlElementIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlElementIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_ELEMENTS__VALUE, index, JAXB.XML_ELEMENT);
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- this.xmlElementsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlElement(int index) {
- this.xmlElementsContainer.removeNestedAnnotation(index);
- }
-
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class XmlElementsAnnotationContainer
- extends AnnotationContainer<XmlElementAnnotation>
- {
- @Override
- protected String getAnnotationsPropertyName() {
- return XML_ELEMENTS_LIST;
- }
- @Override
- protected String getElementName() {
- return JAXB.XML_ELEMENTS__VALUE;
- }
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
- @Override
- protected XmlElementAnnotation buildNestedAnnotation(int index) {
- return SourceXmlElementsAnnotation.this.buildXmlElement(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
deleted file mode 100644
index f2dcbaf5d5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class SourceXmlEnumAnnotation
- extends SourceAnnotation
- implements XmlEnumAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- private String fullyQualifiedValueClassName;
-
- public SourceXmlEnumAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnumAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.fullyQualifiedValueClassName;
- }
-
- private void syncFullyQualifiedValueClassName(String name) {
- String old = this.fullyQualifiedValueClassName;
- this.fullyQualifiedValueClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedValueClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ENUM__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
deleted file mode 100644
index f7b4421461..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class SourceXmlEnumValueAnnotation
- extends SourceAnnotation
- implements XmlEnumValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlEnumValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(VALUE_ADAPTER, pos, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ENUM_VALUE__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java
deleted file mode 100644
index dd54b7d5bc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class SourceXmlIDAnnotation
- extends SourceAnnotation
- implements XmlIDAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ID);
-
- public SourceXmlIDAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java
deleted file mode 100644
index e2632aab22..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class SourceXmlIDREFAnnotation
- extends SourceAnnotation
- implements XmlIDREFAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_IDREF);
-
- public SourceXmlIDREFAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index 0c9f6b99ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class SourceXmlInlineBinaryDataAnnotation
- extends SourceAnnotation
- implements XmlInlineBinaryDataAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_INLINE_BINARY_DATA);
-
-
- public SourceXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 8a723c6430..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- */
-public final class SourceXmlJavaTypeAdapterAnnotation
- extends SourceAnnotation
- implements XmlJavaTypeAdapterAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTER);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTERS);
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private String fullyQualifiedValue;
-
- /*
- * We want this event fired when the fq class changes by itself, not as a result
- * of the non-fq class changing.
- */
- private boolean suppressFQValueEventNotification = false;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedType;
-
- /*
- * We want this event fired when the fq class changes by itself, not as a result
- * of the non-fq class changing.
- */
- private boolean suppressFQTypeEventNotification = false;
-
-
- // ********** constructors **********
- public static SourceXmlJavaTypeAdapterAnnotation buildSourceXmlJavaTypeAdapterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildXmlJavaTypeAdapterDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlJavaTypeAdapterAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlJavaTypeAdapterAnnotation(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
- private SourceXmlJavaTypeAdapterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.valueDeclarationAdapter = buildValueAdapter(daa);
- this.valueAdapter = this.buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- this.typeDeclarationAdapter = buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = buildValue(astRoot);
- this.fullyQualifiedValue = buildFullyQualifiedValue(astRoot);
- this.type = buildType(astRoot);
- this.fullyQualifiedType = buildFullyQualifiedType(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncValue(buildValue(astRoot));
- syncType(buildType(astRoot));
- syncFullyQualifiedValue(buildFullyQualifiedValue(astRoot));
- syncFullyQualifiedType(buildFullyQualifiedType(astRoot));
-
- this.suppressFQValueEventNotification = false;
- this.suppressFQTypeEventNotification = false;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlJavaTypeAdapterAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.suppressFQValueEventNotification = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.suppressFQValueEventNotification |= StringTools.stringsAreEqual(old, astValue);
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedValue() {
- return this.fullyQualifiedValue;
- }
-
- private void syncFullyQualifiedValue(String name) {
- String old = this.fullyQualifiedValue;
- this.fullyQualifiedValue = name;
- if (! this.suppressFQValueEventNotification) {
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, name);
- }
- }
-
- private String buildFullyQualifiedValue(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.suppressFQTypeEventNotification = true;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.suppressFQTypeEventNotification |= StringTools.stringsAreEqual(old, astType);
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedType() {
- return this.fullyQualifiedType;
- }
-
- private void syncFullyQualifiedType(String name) {
- String old = this.fullyQualifiedType;
- this.fullyQualifiedType = name;
- if (! this.suppressFQTypeEventNotification) {
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, name);
- }
- }
-
- private String buildFullyQualifiedType(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlJavaTypeAdapterAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlJavaTypeAdapterDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- JAXB.XML_JAVA_TYPE_ADAPTER);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java
deleted file mode 100644
index db44733f1d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class SourceXmlListAnnotation
- extends SourceAnnotation
- implements XmlListAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_LIST);
-
- public SourceXmlListAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java
deleted file mode 100644
index 5bcdba75b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class SourceXmlMimeTypeAnnotation
- extends SourceAnnotation
- implements XmlMimeTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIME_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlMimeTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlMimeTypeAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_MIME_TYPE__VALUE);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java
deleted file mode 100644
index 9d469b2db2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class SourceXmlMixedAnnotation
- extends SourceAnnotation
- implements XmlMixedAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIXED);
-
- public SourceXmlMixedAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
deleted file mode 100644
index aec42f8b62..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-
-public class SourceXmlNsAnnotation
- extends SourceAnnotation
- implements XmlNsAnnotation {
-
- private final DeclarationAnnotationElementAdapter<String> namespaceURIDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceURIAdapter;
- private String namespaceURI;
-
- private final DeclarationAnnotationElementAdapter<String> prefixDeclarationAdapter;
- private final AnnotationElementAdapter<String> prefixAdapter;
- private String prefix;
-
-
- public SourceXmlNsAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- this.namespaceURIDeclarationAdapter = this.buildNamespaceURIDeclarationAdapter(idaa);
- this.namespaceURIAdapter = this.buildAdapter(this.namespaceURIDeclarationAdapter);
- this.prefixDeclarationAdapter = this.buildPrefixDeclarationAdapter(idaa);
- this.prefixAdapter = buildAdapter(this.prefixDeclarationAdapter);
- }
-
-
- protected DeclarationAnnotationElementAdapter<String> buildNamespaceURIDeclarationAdapter(
- DeclarationAnnotationAdapter daa) {
-
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_NS__NAMESPACE_URI);
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildPrefixDeclarationAdapter(
- DeclarationAnnotationAdapter daa) {
-
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_NS__PREFIX);
- }
-
- private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_NS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.namespaceURI = buildNamespaceURI(astRoot);
- this.prefix = buildPrefix(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncNamespaceURI(buildNamespaceURI(astRoot));
- syncPrefix(buildPrefix(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namespaceURI);
- }
-
-
- // **************** namespace *********************************************
-
- public String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- public void setNamespaceURI(String namespaceURI) {
- if (attributeValueHasChanged(this.namespaceURI, namespaceURI)) {
- this.namespaceURI = namespaceURI;
- this.namespaceURIAdapter.setValue(namespaceURI);
- }
- }
-
- private String buildNamespaceURI(CompilationUnit astRoot) {
- return this.namespaceURIAdapter.getValue(astRoot);
- }
-
- private void syncNamespaceURI(String namespaceURI) {
- String old = this.namespaceURI;
- this.namespaceURI = namespaceURI;
- firePropertyChanged(NAMESPACE_URI_PROPERTY, old, namespaceURI);
- }
-
- public TextRange getNamespaceURITextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceURIDeclarationAdapter, astRoot);
- }
-
-
- // **************** prefix ************************************************
-
- public String getPrefix() {
- return this.prefix;
- }
-
- public void setPrefix(String prefix) {
- if (attributeValueHasChanged(this.prefix, prefix)) {
- this.prefix = prefix;
- this.prefixAdapter.setValue(prefix);
- }
- }
-
- private String buildPrefix(CompilationUnit astRoot) {
- return this.prefixAdapter.getValue(astRoot);
- }
-
- private void syncPrefix(String prefix) {
- String old = this.prefix;
- this.prefix = prefix;
- firePropertyChanged(PREFIX_PROPERTY, old, prefix);
- }
-
- public TextRange getPrefixTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.prefixDeclarationAdapter, astRoot);
- }
-
-
- // **************** NestableAnnotation impl *******************************
-
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java
deleted file mode 100644
index a450bba3ec..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class SourceXmlRegistryAnnotation
- extends SourceAnnotation
- implements XmlRegistryAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_REGISTRY);
-
- public SourceXmlRegistryAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
deleted file mode 100644
index c6dd697b8c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class SourceXmlRootElementAnnotation
- extends SourceAnnotation
- implements XmlRootElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ROOT_ELEMENT);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- public SourceXmlRootElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlRootElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ROOT_ELEMENT__NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ROOT_ELEMENT__NAMESPACE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java
deleted file mode 100644
index d0293962ab..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-
-public class SourceXmlSchemaAnnotation
- extends SourceAnnotation
- implements XmlSchemaAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> ATTRIBUTE_FORM_DEFAULT_ADAPTER =
- buildAttributeFormDefaultAdapter();
- private final AnnotationElementAdapter<String> attributeFormDefaultAdapter;
- private XmlNsForm attributeFormDefault;
-
- private static final DeclarationAnnotationElementAdapter<String> ELEMENT_FORM_DEFAULT_ADAPTER =
- buildElementFormDefaultAdapter();
- private final AnnotationElementAdapter<String> elementFormDefaultAdapter;
- private XmlNsForm elementFormDefault;
-
- private static final DeclarationAnnotationElementAdapter<String> LOCATION_ADAPTER =
- buildLocationAdapter();
- private final AnnotationElementAdapter<String> locationAdapter;
- private String location;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER =
- buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final XmlnsAnnotationContainer xmlnsContainer = new XmlnsAnnotationContainer();
-
-
- private static DeclarationAnnotationElementAdapter<String> buildAttributeFormDefaultAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT); //remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildElementFormDefaultAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__ELEMENT_FORM_DEFAULT); // remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildLocationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__LOCATION); // remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__NAMESPACE); // remove annotation when empty
- }
-
-
- public SourceXmlSchemaAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlSchemaAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- this.attributeFormDefaultAdapter = buildAnnotationElementAdapter(ATTRIBUTE_FORM_DEFAULT_ADAPTER);
- this.elementFormDefaultAdapter = buildAnnotationElementAdapter(ELEMENT_FORM_DEFAULT_ADAPTER);
- this.locationAdapter = buildAnnotationElementAdapter(LOCATION_ADAPTER);
- this.namespaceAdapter = buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- }
-
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.attributeFormDefault = buildAttributeFormDefault(astRoot);
- this.elementFormDefault = buildElementFormDefault(astRoot);
- this.location = buildLocation(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.xmlnsContainer.initialize(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncAttributeFormDefault(buildAttributeFormDefault(astRoot));
- syncElementFormDefault(buildElementFormDefault(astRoot));
- syncLocation(buildLocation(astRoot));
- syncNamespace(buildNamespace(astRoot));
- this.xmlnsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namespace);
- }
-
-
- // **************** attribute form default ********************************
-
- public XmlNsForm getAttributeFormDefault() {
- return this.attributeFormDefault;
- }
-
- public void setAttributeFormDefault(XmlNsForm attributeFormDefault) {
- if (attributeValueHasChanged(this.attributeFormDefault, attributeFormDefault)) {
- this.attributeFormDefault = attributeFormDefault;
- this.attributeFormDefaultAdapter.setValue(XmlNsForm.toJavaAnnotationValue(attributeFormDefault));
- }
- }
-
- private XmlNsForm buildAttributeFormDefault(CompilationUnit astRoot) {
- return XmlNsForm.fromJavaAnnotationValue(this.attributeFormDefaultAdapter.getValue(astRoot));
- }
-
- private void syncAttributeFormDefault(XmlNsForm attributeFormDefault) {
- XmlNsForm old = this.attributeFormDefault;
- this.attributeFormDefault = attributeFormDefault;
- firePropertyChanged(ATTRIBUTE_FORM_DEFAULT_PROPERTY, old, attributeFormDefault);
- }
-
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ATTRIBUTE_FORM_DEFAULT_ADAPTER, astRoot);
- }
-
-
- // **************** element form default ********************************
-
- public XmlNsForm getElementFormDefault() {
- return this.elementFormDefault;
- }
-
- public void setElementFormDefault(XmlNsForm elementFormDefault) {
- if (attributeValueHasChanged(this.elementFormDefault, elementFormDefault)) {
- this.elementFormDefault = elementFormDefault;
- this.elementFormDefaultAdapter.setValue(XmlNsForm.toJavaAnnotationValue(elementFormDefault));
- }
- }
-
- private XmlNsForm buildElementFormDefault(CompilationUnit astRoot) {
- return XmlNsForm.fromJavaAnnotationValue(this.elementFormDefaultAdapter.getValue(astRoot));
- }
-
- private void syncElementFormDefault(XmlNsForm elementFormDefault) {
- XmlNsForm old = this.elementFormDefault;
- this.elementFormDefault = elementFormDefault;
- firePropertyChanged(ELEMENT_FORM_DEFAULT_PROPERTY, old, elementFormDefault);
- }
-
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ELEMENT_FORM_DEFAULT_ADAPTER, astRoot);
- }
-
-
- // **************** location **********************************************
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- if (attributeValueHasChanged(this.location, location)) {
- this.location = location;
- this.locationAdapter.setValue(location);
- }
- }
-
- private String buildLocation(CompilationUnit astRoot) {
- return this.locationAdapter.getValue(astRoot);
- }
-
- private void syncLocation(String location) {
- String old = this.location;
- this.location = location;
- firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(LOCATION_ADAPTER, astRoot);
- }
-
-
- // **************** namespace *********************************************
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- private void syncNamespace(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- // **************** xmlns *************************************************
-
- public ListIterable<XmlNsAnnotation> getXmlns() {
- return this.xmlnsContainer.getNestedAnnotations();
- }
-
- public int getXmlnsSize() {
- return this.xmlnsContainer.getNestedAnnotationsSize();
- }
-
- public XmlNsAnnotation xmlnsAt(int index) {
- return this.xmlnsContainer.nestedAnnotationAt(index);
- }
-
- public XmlNsAnnotation addXmlns(int index) {
- return this.xmlnsContainer.addNestedAnnotation(index);
- }
-
- private XmlNsAnnotation buildXmlns(int index) {
- return new SourceXmlNsAnnotation(
- this, this.annotatedElement, buildXmlnsIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlnsIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_SCHEMA__XMLNS, index, JAXB.XML_NS);
- }
-
- public void moveXmlns(int targetIndex, int sourceIndex) {
- this.xmlnsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlns(int index) {
- this.xmlnsContainer.removeNestedAnnotation(index);
- }
-
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class XmlnsAnnotationContainer
- extends AnnotationContainer<XmlNsAnnotation>
- {
- @Override
- protected String getAnnotationsPropertyName() {
- return XMLNS_LIST;
- }
- @Override
- protected String getElementName() {
- return JAXB.XML_SCHEMA__XMLNS;
- }
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_NS;
- }
- @Override
- protected XmlNsAnnotation buildNestedAnnotation(int index) {
- return SourceXmlSchemaAnnotation.this.buildXmlns(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
deleted file mode 100644
index 9ad6a7c39a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSchemaType
- */
-public class SourceXmlSchemaTypeAnnotation
- extends SourceAnnotation
- implements XmlSchemaTypeAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPE);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPES);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedType;
-
-
- // ********** constructors **********
-
- public static SourceXmlSchemaTypeAnnotation buildSourceXmlSchemaTypeAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- int index) {
-
- IndexedDeclarationAnnotationAdapter idaa = buildXmlSchemaTypeDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlSchemaTypeAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlSchemaTypeAnnotation(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
- private SourceXmlSchemaTypeAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.typeDeclarationAdapter = buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_SCHEMA_TYPE__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_SCHEMA_TYPE__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_SCHEMA_TYPE__TYPE,
- SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName,
- ExpressionConverter<String> converter) {
-
- return new ConversionDeclarationAnnotationElementAdapter<String>(
- annotationAdapter, elementName, converter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = buildName(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.type = buildType(astRoot);
- this.fullyQualifiedType = buildFullyQualifiedType(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncName(buildName(astRoot));
- syncNamespace(buildNamespace(astRoot));
- syncType(buildType(astRoot));
- syncFullyQualifiedType(buildFullyQualifiedType(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // **************** XmlSchemaTypeAnnotation impl **************************
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedType() {
- return this.fullyQualifiedType;
- }
-
- private void syncFullyQualifiedType(String name) {
- String old = this.fullyQualifiedType;
- this.fullyQualifiedType = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedType(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlSchemaTypeAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlSchemaTypeDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- JAXB.XML_SCHEMA_TYPE);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java
deleted file mode 100644
index 348e508f5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import java.util.Arrays;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class SourceXmlSeeAlsoAnnotation
- extends SourceAnnotation
- implements XmlSeeAlsoAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SEE_ALSO);
-
- private final DeclarationAnnotationElementAdapter<String[]> valueDeclarationAdapter;
-
- private final AnnotationElementAdapter<String[]> valueAdapter;
-
- private final Vector<String> classes;
-
- /*
- * We want this event fired when the fq classes change by themselves, not as a result
- * of the value changing.
- */
- private boolean suppressFQClassesEventNotification = false;
-
- private final Vector<String> fullyQualifiedClasses;
-
-
- public SourceXmlSeeAlsoAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueDeclarationAdapter = buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SEE_ALSO__VALUE);
- this.valueAdapter = this.buildArrayAnnotationElementAdapter(this.valueDeclarationAdapter);
- this.classes = new Vector<String>();
- this.fullyQualifiedClasses = new Vector<String>();
- }
-
-
- private AnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- public void initialize(CompilationUnit astRoot) {
- for (String astClass : this.valueAdapter.getValue(astRoot)) {
- this.classes.add(astClass);
- }
- CollectionTools.addAll(this.fullyQualifiedClasses, buildFullyQualifiedClasses(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- String[] astClasses = this.valueAdapter.getValue(astRoot);
- synchronizeList(Arrays.asList(astClasses), this.classes, CLASSES_LIST);
-
- if (this.suppressFQClassesEventNotification) {
- this.fullyQualifiedClasses.clear();
- CollectionTools.addAll(this.fullyQualifiedClasses, buildFullyQualifiedClasses(astRoot));
- this.suppressFQClassesEventNotification = false;
- }
- else {
- synchronizeList(buildFullyQualifiedClasses(astRoot), this.fullyQualifiedClasses, FULLY_QUALIFIED_CLASSES_LIST);
- }
- }
-
- protected Iterable<String> buildFullyQualifiedClasses(final CompilationUnit astRoot) {
- Expression expression = this.valueAdapter.getExpression(astRoot);
- if (expression == null) {
- return EmptyIterable.<String>instance();
- }
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- return new SingleElementIterable<String>(ASTTools.resolveFullyQualifiedName(expression));
- }
- else {
- return ASTTools.resolveFullyQualifiedNames(expression);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classes);
- }
-
-
- // ********** XmlSeeAlsoAnnotation implementation **********
-
- // ***** classes
- public ListIterable<String> getClasses() {
- return new LiveCloneListIterable<String>(this.classes);
- }
-
- public int getClassesSize() {
- return this.classes.size();
- }
-
- public void addClass(String clazz) {
- this.addClass(this.classes.size(), clazz);
- }
-
- public void addClass(int index, String clazz) {
- this.classes.add(index, clazz);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.classes, targetIndex, sourceIndex);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public void removeClass(int index) {
- this.classes.remove(index);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public ListIterable<String> getFullyQualifiedClasses() {
- return new LiveCloneListIterable<String>(this.fullyQualifiedClasses);
- }
-
- private void writeClasses() {
- this.valueAdapter.setValue(this.classes.toArray(new String[this.classes.size()]));
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forTypes());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, converter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java
deleted file mode 100644
index dc17b833e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class SourceXmlTransientAnnotation
- extends SourceAnnotation
- implements XmlTransientAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TRANSIENT);
-
- public SourceXmlTransientAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
deleted file mode 100644
index 0ae69baaf0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import java.util.Arrays;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.IndexedConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class SourceXmlTypeAnnotation
- extends SourceAnnotation
- implements XmlTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> FACTORY_CLASS_ADAPTER = buildFactoryClassAdapter();
- private final AnnotationElementAdapter<String> factoryClassAdapter;
- private String factoryClass;
-
- private String fullyQualifiedFactoryClassName;
-
- private static final DeclarationAnnotationElementAdapter<String> FACTORY_METHOD_ADAPTER = buildFactoryMethodAdapter();
- private final AnnotationElementAdapter<String> factoryMethodAdapter;
- private String factoryMethod;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final IndexedDeclarationAnnotationElementAdapter<String> propOrderDeclarationAdapter;
- private final AnnotationElementAdapter<String[]> propOrderAdapter;
- private final Vector<String> propOrder = new Vector<String>();
-
- public SourceXmlTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.factoryClassAdapter = this.buildAnnotationElementAdapter(FACTORY_CLASS_ADAPTER);
- this.factoryMethodAdapter = this.buildAnnotationElementAdapter(FACTORY_METHOD_ADAPTER);
- this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- this.propOrderDeclarationAdapter = buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__PROP_ORDER);
- this.propOrderAdapter = this.buildArrayAnnotationElementAdapter(this.propOrderDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private static IndexedDeclarationAnnotationElementAdapter<String> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- private static IndexedDeclarationAnnotationElementAdapter<String> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, IndexedExpressionConverter<String> converter) {
- return new IndexedConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.factoryClass = this.buildFactoryClass(astRoot);
- this.fullyQualifiedFactoryClassName = this.buildFullyQualifiedFactoryClassName(astRoot);
- this.factoryMethod = this.buildFactoryMethod(astRoot);
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.initializePropOrder(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncFactoryClass(this.buildFactoryClass(astRoot));
- this.syncFullyQualifiedFactoryClassName(this.buildFullyQualifiedFactoryClassName(astRoot));
- this.syncFactoryMethod(this.buildFactoryMethod(astRoot));
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncPropOrder(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factoryClass
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- if (this.attributeValueHasChanged(this.factoryClass, factoryClass)) {
- this.factoryClass = factoryClass;
- this.factoryClassAdapter.setValue(factoryClass);
- }
- }
-
- private void syncFactoryClass(String astFactoryClass) {
- String old = this.factoryClass;
- this.factoryClass = astFactoryClass;
- this.firePropertyChanged(FACTORY_CLASS_PROPERTY, old, astFactoryClass);
- }
-
- private String buildFactoryClass(CompilationUnit astRoot) {
- return this.factoryClassAdapter.getValue(astRoot);
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_CLASS_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified factory class name
- public String getFullyQualifiedFactoryClassName() {
- return this.fullyQualifiedFactoryClassName;
- }
-
- private void syncFullyQualifiedFactoryClassName(String name) {
- String old = this.fullyQualifiedFactoryClassName;
- this.fullyQualifiedFactoryClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedFactoryClassName(CompilationUnit astRoot) {
- return (this.factoryClass == null) ? null : ASTTools.resolveFullyQualifiedName(this.factoryClassAdapter.getExpression(astRoot));
- }
-
- // ***** factoryMethod
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- if (this.attributeValueHasChanged(this.factoryMethod, factoryMethod)) {
- this.factoryMethod = factoryMethod;
- this.factoryMethodAdapter.setValue(factoryMethod);
- }
- }
-
- private void syncFactoryMethod(String astFactoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = astFactoryMethod;
- this.firePropertyChanged(FACTORY_METHOD_PROPERTY, old, astFactoryMethod);
- }
-
- private String buildFactoryMethod(CompilationUnit astRoot) {
- return this.factoryMethodAdapter.getValue(astRoot);
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_METHOD_ADAPTER, astRoot);
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- // ***** prop order *****
-
- public ListIterable<String> getPropOrder() {
- return new LiveCloneListIterable<String>(this.propOrder);
- }
-
- public int getPropOrderSize() {
- return this.propOrder.size();
- }
-
- public void addProp(String prop) {
- this.addProp(this.propOrder.size(), prop);
- }
-
- public void addProp(int index, String prop) {
- this.propOrder.add(index, prop);
- this.writePropOrder();
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.propOrder, targetIndex, sourceIndex);
- this.writePropOrder();
- }
-
- public void removeProp(String prop) {
- this.propOrder.remove(prop);
- this.writePropOrder();
- }
-
- public void removeProp(int index) {
- this.propOrder.remove(index);
- this.writePropOrder();
- }
-
- private void writePropOrder() {
- this.propOrderAdapter.setValue(this.propOrder.toArray(new String[this.propOrder.size()]));
- }
-
- private void initializePropOrder(CompilationUnit astRoot) {
- String[] astPropOrder = this.propOrderAdapter.getValue(astRoot);
- for (int i = 0; i < astPropOrder.length; i++) {
- this.propOrder.add(astPropOrder[i]);
- }
- }
-
- private void syncPropOrder(CompilationUnit astRoot) {
- String[] astPropOrder = this.propOrderAdapter.getValue(astRoot);
- this.synchronizeList(Arrays.asList(astPropOrder), this.propOrder, PROP_ORDER_LIST);
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.propOrderDeclarationAdapter, astRoot);
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.propOrderDeclarationAdapter, pos, astRoot);
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getElementTextRange(getAnnotationElementSubvalueTextRange(this.propOrderDeclarationAdapter, index, astRoot), astRoot);
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- return textRangeTouches(getAnnotationElementSubvalueTextRange(this.propOrderDeclarationAdapter, index, astRoot), pos);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildFactoryClassAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__FACTORY_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFactoryMethodAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__FACTORY_METHOD);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__NAMESPACE);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java
deleted file mode 100644
index a6f5d45501..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class SourceXmlValueAnnotation
- extends SourceAnnotation
- implements XmlValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_VALUE);
-
- public SourceXmlValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
deleted file mode 100644
index a1d1335731..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-
-public class JaxbIndexResourceImpl
- implements JaxbIndexResource {
-
- protected final ListenerList<JptResourceModelListener> resourceModelListenerList =
- new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
-
-
- protected IFile file;
-
- protected String packageName;
-
- protected final List<String> classNames = new Vector<String>();
-
-
- public JaxbIndexResourceImpl(IFile file) {
- super();
- if (file == null) {
- throw new IllegalArgumentException("file cannot be null");
- }
- this.file = file;
- this.packageName = buildPackageName();
- buildClassNames();
- }
-
-
- protected String buildPackageName() {
- IJavaElement javaElement = JavaCore.create(this.file.getParent());
- if (javaElement != null && javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
- return ((IPackageFragment) javaElement).getElementName();
- }
- return null;
- }
-
- private void buildClassNames() {
- InputStream stream = null;
-
- try {
- stream = file.getContents();
- }
- catch (CoreException ce) {
- JptJaxbCorePlugin.log(ce);
- return;
- }
-
- if (stream != null) {
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
- try {
- String line = reader.readLine();
- while (line != null) {
- String className = line.trim();
- this.classNames.add(className);
- line = reader.readLine();
- }
- }
- catch (Exception ex) {
- JptJaxbCorePlugin.log(ex);
- }
- finally {
- try {
- reader.close();
- }
- catch (IOException ioe) {
- JptJaxbCorePlugin.log(ioe);
- }
- }
- }
- }
-
- public String getPackageName() {
- return this.packageName;
- }
-
- public Iterable<String> getFullyQualifiedClassNames() {
- String packageName = getPackageName();
- final String packagePrefix = StringTools.stringIsEmpty(packageName) ? "" : packageName + ".";
- return new TransformationIterable<String, String>(
- new SnapshotCloneIterable<String>(this.classNames)) {
- @Override
- protected String transform(String shortClassName) {
- return packagePrefix + shortClassName;
- }
- };
- }
-
- void update() {
- this.classNames.clear();
- buildClassNames();
- resourceModelChanged();
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_INDEX_RESOURCE_TYPE;
- }
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
- protected void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
deleted file mode 100644
index f1600741da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-
-public class JaxbIndexResourceModelProvider
- implements JaxbResourceModelProvider {
-
- // singleton
- private static final JaxbIndexResourceModelProvider INSTANCE = new JaxbIndexResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbIndexResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- private final Map<IFile, JaxbIndexResourceImpl> models = new HashMap<IFile, JaxbIndexResourceImpl>();
-
- private final IResourceChangeListener resourceChangeListener;
-
-
- /**
- * Enforce singleton usage
- */
- private JaxbIndexResourceModelProvider() {
- super();
- this.resourceChangeListener = buildResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- }
-
-
- protected IResourceChangeListener buildResourceChangeListener() {
- return new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
- handleResourceChangeEvent(event);
- }
- };
- }
-
- public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE;
- }
-
- public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return buildResourceModel(file);
- }
-
- public JaxbIndexResource buildResourceModel(IFile file) {
- JaxbIndexResourceImpl resource = this.models.get(file);
- if (resource != null) {
- return resource;
- }
- resource = new JaxbIndexResourceImpl(file);
- this.models.put(file, resource);
- return resource;
- }
-
- protected void handleResourceChangeEvent(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE :
- removeProjectResources((IProject) event.getResource());
- return;
-
- case IResourceChangeEvent.POST_CHANGE :
- updateResources(event.getDelta());
- }
- }
-
- protected void removeProjectResources(IProject removedProject) {
- for (IFile file : new SnapshotCloneIterable<IFile>(this.models.keySet())) {
- if (file.getProject().equals(removedProject)) {
- removeResource(file);
- }
- }
- }
-
- protected void updateResources(IResourceDelta delta) {
- try {
- delta.accept(new ResourceDeltaVisitor());
- }
- catch (CoreException ce) {
- // shouldn't happen
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- protected void removeResource(IFile file) {
- this.models.remove(file);
- }
-
- protected void updateResource(IFile file) {
- JaxbIndexResourceImpl resource = this.models.get(file);
- if (resource != null) {
- resource.update();
- }
- }
-
-
- protected class ResourceDeltaVisitor
- implements IResourceDeltaVisitor {
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (deltaKind == IResourceDelta.REMOVED) {
- JaxbIndexResourceModelProvider.this.removeResource(file);
- }
- else if (deltaKind == IResourceDelta.CHANGED) {
- JaxbIndexResourceModelProvider.this.updateResource(file);
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
deleted file mode 100644
index 67a308902b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-
-public class JaxbPropertiesResourceImpl
- implements JaxbPropertiesResource
-{
- protected final IFile file;
-
- protected final String packageName;
-
- protected final Properties properties = new Properties();
-
- protected final ListenerList<JptResourceModelListener> resourceModelListenerList =
- new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
-
-
- public JaxbPropertiesResourceImpl(IFile file) {
- super();
- if (file == null) {
- throw new NullPointerException();
- }
- this.file = file;
- this.packageName = this.buildPackageName();
- this.loadProperties();
- }
-
- protected String buildPackageName() {
- IJavaElement javaElement = JavaCore.create(this.file.getParent());
- if ((javaElement != null) && (javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT)) {
- return ((IPackageFragment) javaElement).getElementName();
- }
- return null;
- }
-
- protected void reloadProperties() {
- this.properties.clear();
- this.loadProperties();
- }
-
- protected void loadProperties() {
- InputStream stream = null;
- try {
- stream = this.file.getContents();
- if (stream != null) {
- this.properties.load(stream);
- }
- } catch (Exception ex) {
- JptJaxbCorePlugin.log(ex);
- } finally {
- this.closeStream(stream);
- }
- }
-
- protected void closeStream(InputStream stream) {
- try {
- if (stream != null) {
- stream.close();
- }
- } catch (IOException ex) {
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- void update() {
- this.reloadProperties();
- this.resourceModelChanged();
- }
-
- public String getPackageName() {
- return this.packageName;
- }
-
- public String getProperty(String propertyName) {
- return this.properties.getProperty(propertyName);
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_RESOURCE_TYPE;
- }
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
- protected void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
deleted file mode 100644
index d2b2e72c72..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-
-public class JaxbPropertiesResourceModelProvider
- implements JaxbResourceModelProvider {
-
- // singleton
- private static final JaxbPropertiesResourceModelProvider INSTANCE = new JaxbPropertiesResourceModelProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPropertiesResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- private final Map<IFile, JaxbPropertiesResourceImpl> models = new HashMap<IFile, JaxbPropertiesResourceImpl>();
-
- private final IResourceChangeListener resourceChangeListener;
-
-
- /**
- * Enforce singleton usage
- */
- private JaxbPropertiesResourceModelProvider() {
- super();
- this.resourceChangeListener = buildResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- }
-
-
- protected IResourceChangeListener buildResourceChangeListener() {
- return new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
- handleResourceChangeEvent(event);
- }
- };
- }
-
- public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE;
- }
-
- public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return buildResourceModel(file);
- }
-
- public JaxbPropertiesResource buildResourceModel(IFile file) {
- JaxbPropertiesResourceImpl resource = this.models.get(file);
- if (resource != null) {
- return resource;
- }
- resource = new JaxbPropertiesResourceImpl(file);
- this.models.put(file, resource);
- return resource;
- }
-
- protected void handleResourceChangeEvent(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE :
- removeProjectResources((IProject) event.getResource());
- return;
-
- case IResourceChangeEvent.POST_CHANGE :
- updateResources(event.getDelta());
- }
- }
-
- protected void removeProjectResources(IProject removedProject) {
- for (IFile file : new SnapshotCloneIterable<IFile>(this.models.keySet())) {
- if (file.getProject().equals(removedProject)) {
- removeResource(file);
- }
- }
- }
-
- protected void updateResources(IResourceDelta delta) {
- try {
- delta.accept(new ResourceDeltaVisitor());
- }
- catch (CoreException ce) {
- // shouldn't happen
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- protected void removeResource(IFile file) {
- this.models.remove(file);
- }
-
- protected void updateResource(IFile file) {
- JaxbPropertiesResourceImpl resource = this.models.get(file);
- if (resource != null) {
- resource.update();
- }
- }
-
-
- protected class ResourceDeltaVisitor
- implements IResourceDeltaVisitor {
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (deltaKind == IResourceDelta.REMOVED) {
- JaxbPropertiesResourceModelProvider.this.removeResource(file);
- }
- else if (deltaKind == IResourceDelta.CHANGED) {
- JaxbPropertiesResourceModelProvider.this.updateResource(file);
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
deleted file mode 100644
index b4c447f0a0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class DefaultValidationMessages {
-
- private static String[] DEFAULT_PARMS = new String[0];
- private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
-
-
- public static IMessage buildMessage(
- int defaultSeverity, String messageId, Object targetObject) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(
- int defaultSeverity, String messageId, String[] parms, Object targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(
- int defaultSeverity, String messageId, Object targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(
- int defaultSeverity, String messageId, String[] parms, Object targetObject, TextRange textRange) {
-
- //determine whether default severity should be overridden
- int severity = defaultSeverity;
-
- // TODO - user override of errors/warnings
-// int severityPreference = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
-// if (severityPreference != JpaValidationPreferences.NO_SEVERITY_PREFERENCE){
-// severity = severityPreference;
-// }
-
- IMessage message = new Message(JaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
-
- if (textRange == null) {
- //log an exception and then continue without setting location information
- //At least the user will still get the validation message and will
- //be able to see other validation messages with valid textRanges
- JptJaxbCorePlugin.log(new IllegalArgumentException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
- }
- else {
- message.setLineNo(textRange.getLineNumber());
- message.setOffset(textRange.getOffset());
- message.setLength(textRange.getLength());
- }
- return message;
- }
-
-
- private DefaultValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java
deleted file mode 100644
index b51d44116f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-@SuppressWarnings("nls")
-public interface JaxbValidationMessages {
-
- // bundle name
- String BUNDLE_NAME = "jaxb_validation";
-
- // validation on project
-
- String NO_JAXB_PROJECT = "NO_JAXB_PROJECT";
- String PROJECT_INVALID_LIBRARY_PROVIDER = "PROJECT_INVALID_LIBRARY_PROVIDER";
- String PROJECT_UNRESOLVED_SCHEMA = "PROJECT_UNRESOLVED_SCHEMA";
-
-
- // validation on package
-
- String PACKAGE_NO_SCHEMA_FOR_NAMESPACE = "PACKAGE_NO_SCHEMA_FOR_NAMESPACE";
- String PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED = "PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED";
-
- String XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT = "XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT";
- String XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT = "XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT";
-
-
- // validation on type
-
- String XML_ENUM__NON_SIMPLE_SCHEMA_TYPE = "XML_ENUM__NON_SIMPLE_SCHEMA_TYPE";
-
- String XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = "XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE";
- String XML_TYPE__DUPLICATE_PROP = "XML_TYPE__DUPLICATE_PROP";
- String XML_TYPE__MISSING_PROP = "XML_TYPE__MISSING_PROP";
- String XML_TYPE__NONEXISTENT_PROP = "XML_TYPE__NONEXISTENT_PROP";
- String XML_TYPE__TRANSIENT_PROP = "XML_TYPE__TRANSIENT_PROP";
- String XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM = "XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM";
- String XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM = "XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM";
- String XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM = "XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM";
-
- String XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE = "XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE";
-
-
- // validation on enum constant
-
- String XML_ENUM_VALUE__INVALID_LEXICAL_VALUE = "XML_ENUM_VALUE__INVALID_LEXICAL_VALUE";
-
-
- // validation on attribute
-
- String ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION = "ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION";
- String ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED = "ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED";
- String XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION = "XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION";
-
- String XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED = "XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED";
- String XML_ANY_ATTRIBUTE__NON_MAP_TYPE = "XML_ANY_ATTRIBUTE__NON_MAP_TYPE";
-
- String XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED = "XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED";
-
- String XML_ELEMENT__UNSPECIFIED_TYPE = "XML_ELEMENT__UNSPECIFIED_TYPE";
- String XML_ELEMENT__ILLEGAL_TYPE = "XML_ELEMENT__ILLEGAL_TYPE";
-
- String XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = "XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE";
- String XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM = "XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM";
- String XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME = "XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME";
- String XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL = "XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL";
-
- String XML_ELEMENT_REF__UNSPECIFIED_TYPE = "XML_ELEMENT_REF__UNSPECIFIED_TYPE";
- String XML_ELEMENT_REF__ILLEGAL_TYPE = "XML_ELEMENT_REF__ILLEGAL_TYPE";
- String XML_ELEMENT_REF__NO_ROOT_ELEMENT = "XML_ELEMENT_REF__NO_ROOT_ELEMENT";
- String XML_ELEMENT_REF__NO_REGISTRY = "XML_ELEMENT_REF__NO_REGISTRY";
- String XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL = "XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL";
-
- String XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE = "XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE";
- String XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME = "XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE = "XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE";
- String XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME = "XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_ID__MULTIPLE_MAPPINGS_DEFINED = "XML_ID__MULTIPLE_MAPPINGS_DEFINED";
- String XML_ID__ATTRIBUTE_TYPE_NOT_STRING = "XML_ID__ATTRIBUTE_TYPE_NOT_STRING";
- String XML_ID__SCHEMA_TYPE_NOT_ID = "XML_ID__SCHEMA_TYPE_NOT_ID";
-
- String XML_IDREF__TYPE_DOES_NOT_CONTAIN_XML_ID = "XML_IDREF__TYPE_DOES_NOT_CONTAIN_XML_ID";
- String XML_ID_REF__SCHEMA_TYPE_NOT_IDREF = "XML_ID_REF__SCHEMA_TYPE_NOT_IDREF";
-
- String XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE = "XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE";
- String XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE = "XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE";
-
- String XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME = "XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_VALUE__MULTIPLE_MAPPINGS_DEFINED = "XML_VALUE__MULTIPLE_MAPPINGS_DEFINED";
-
- String XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED = "XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED";
-
-
- // general validation
-
- String XML_SCHEMA_TYPE__NON_SIMPLE_TYPE = "XML_SCHEMA_TYPE__NON_SIMPLE_TYPE";
- String XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE = "XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE";
- String XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE = "XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE";
-
- String QNAME__MISSING_NAME = "QNAME__MISSING_NAME";
- String QNAME__UNRESOLVED_COMPONENT = "QNAME__UNRESOLVED_COMPONENT";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
deleted file mode 100644
index e743b5e569..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.common.core.IResourcePart;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IProjectValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-/**
- * This class is referenced in the JAXB extension for the
- * WTP validator extension point.
- */
-public class JaxbValidator
- extends AbstractValidator
- implements IValidator {
-
- public JaxbValidator() {
- super();
- }
-
-
- // ********** IValidator implementation **********
-
- public void validate(IValidationContext context, IReporter reporter) {
- validate(reporter, project(context));
- }
-
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
-
- // **************** AbstractValidator impl *********************************
-
- @Override
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- if (resource.getType() != IResource.FILE)
- return null;
- ValidationResult result = new ValidationResult();
- IReporter reporter = result.getReporter(monitor);
- IProject project = resource.getProject();
- this.clearMarkers(project);
- result.setSuspendValidation(project);
- this.validate(reporter, project);
- return result;
- }
-
-
- // **************** internal conv. *****************************************
- private void clearMarkers(IProject project) {
- try {
- clearMarkers_(project);
- }
- catch (CoreException ce) {
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- private void clearMarkers_(IProject project) throws CoreException {
- IMarker[] markers = project.findMarkers(JptJaxbCorePlugin.VALIDATION_MARKER_ID, true, IResource.DEPTH_INFINITE);
- for (IMarker marker : markers) {
- marker.delete();
- }
- }
-
- private void validate(IReporter reporter, IProject project) {
- for (IMessage message : this.getValidationMessages(reporter, project)) {
- // check to see if the message should be ignored based on preferences
- // TODO JAXB validation preferences
-// if (!JpaValidationPreferences.isProblemIgnored(project, message.getId())){
- reporter.addMessage(this, adjustMessage(message));
-// }
-
- }
- }
-
- private IProject project(IValidationContext context) {
- return ((IProjectValidationContext) context).getProject();
- }
-
- private Iterable<IMessage> getValidationMessages(IReporter reporter, IProject project) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
- if (jaxbProject != null) {
- return jaxbProject.getValidationMessages(reporter);
- }
- return new SingleElementIterable<IMessage>(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.NO_JAXB_PROJECT,
- project));
- }
-
- private IMessage adjustMessage(IMessage message) {
- IAdaptable targetObject = (IAdaptable) message.getTargetObject();
- IResource targetResource = ((IResourcePart) targetObject.getAdapter(IResourcePart.class)).getResource();
- message.setTargetObject(targetResource);
- if (message.getLineNumber() == IMessage.LINENO_UNSET) {
- message.setAttribute(IMarker.LOCATION, " ");
- }
- return message;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 0790fca4b1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.libprov;
-
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public interface JaxbLibraryProviderInstallOperationConfig
- extends JptLibraryProviderInstallOperationConfig {
-
- public static final String PROP_JAXB_PLATFORM = "JAXB_PLATFORM"; //$NON-NLS-1$
-
- JaxbPlatformDescription getJaxbPlatform();
-
- void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
deleted file mode 100644
index 0bd885ac84..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-/**
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatform {
-
- JaxbPlatformDescription getDescription();
-
- JaxbPlatformDefinition getDefinition();
-
-
- // ********** factory **********
-
- /**
- * Return a factory responsible for creating core (e.g. JaxbProject), resource
- * (e.g. PersistenceResource), and context (e.g. PersistenceUnit) model
- * objects
- */
- JaxbFactory getFactory();
-
-
- // ********** JAXB files **********
-
- /**
- * Return a JAXB file corresponding to the specified Eclipse file.
- * Return null if the file's content is unsupported.
- */
- JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file);
-
-
- // ********** Java annotations **********
-
- /**
- * Return an annotation provider responsible for determining what Java
- * annotations are supported and constructing java resource model objects.
- */
- AnnotationProvider getAnnotationProvider();
-
- /**
- * Return a formatter that can clean up the Java annotations added to source
- * code.
- */
- AnnotationEditFormatter getAnnotationEditFormatter();
-
-
- // ********** Java attribute mappings **********
-
- Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions();
-
- Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions();
-
- /**
- * Return a {@link JavaAttributeMappingDefinition} that describes the interpretation of the attribute
- * as it exists, complete with annotations. It is assumed that the attribute's default mapping
- * has already been determined.
- * This may not be null (@see {@link NullSpecifiedJavaAttributeMappingDefinition},) else
- * an {@link IllegalStateException} is thrown.
- *
- * @param attribute The persistent attribute to analyze
- * @return The mapping definition describing the annotated state of the attribute
- */
- JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(JaxbPersistentAttribute attribute);
-
- /**
- * Return a {@link JavaAttributeMappingDefinition} for the given mapping key.
- * Throw an {@link IllegalArgumentException} if the key is not supported by the platform.
- */
- JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(String mappingKey);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
deleted file mode 100644
index c1ae7dc1c0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-/**
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDefinition {
-
- JaxbPlatformDescription getDescription();
-
- // ***** platform-y questions *****
-
- /**
- * Return the built in schema type name mapped by the given (fully qualified) java type name
- */
- String getSchemaTypeMapping(String javaTypeName);
-
-
- JaxbFactory getFactory();
-
- AnnotationDefinition[] getAnnotationDefinitions();
-
- NestableAnnotationDefinition[] getNestableAnnotationDefinitions();
-
- /**
- * Return the resource model providers that apply to this platform.
- */
- ListIterable<JaxbResourceModelProvider> getResourceModelProviders();
-
- /**
- * Return the most recent resource type for the given content type supported by this platform
- */
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType);
-
-// /**
-// * Return the resource definitions supported by this platform.
-// */
-// ListIterator<ResourceDefinition> resourceDefinitions();
-
- /**
- * Return the mapping definitions to use for default java attribute mappings for this platform.
- */
- Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions();
-
- /**
- * Return the mapping definitions to use for specified java attribute mappings for this platform.
- */
- Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java
deleted file mode 100644
index c27161a036..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-/**
- * This interface is to be implemented by a JAXB vendor to build a
- * {@link JaxbPlatformDefinition}.
- * <p>
- * See the <code>org.eclipse.jpt.jaxb.core.jaxbPlatforms</code> extension point.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDefinitionFactory {
-
- JaxbPlatformDefinition buildJaxbPlatformDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java
deleted file mode 100644
index 93fc5e47c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Contains metadata that describes a JAXB platform. Not intended to be implemented by clients.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDescription {
-
- public String getId();
-
- public String getPluginId();
-
- public String getLabel();
-
- public String getFactoryClassName();
-
- public boolean supportsJaxbFacetVersion(IProjectFacetVersion jpaFacetVersion);
-
- public boolean isDefault();
-
- public JaxbPlatformGroupDescription getGroup();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java
deleted file mode 100644
index 607c120a51..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-/**
- * Contains metadata that describes a JAXB platform group. Not intended to be implemented by clients.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformGroupDescription {
-
- public String getId();
-
- public String getPluginId();
-
- public String getLabel();
-
- public Iterable<JaxbPlatformDescription> getPlatforms();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java
deleted file mode 100644
index 1dca3072c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Entry point to the "jaxbPlatforms" extension point
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformManager {
-
- Iterable<JaxbPlatformGroupDescription> getJaxbPlatformGroups();
-
- JaxbPlatformGroupDescription getJaxbPlatformGroup(String groupId);
-
- Iterable<JaxbPlatformDescription> getJaxbPlatforms();
-
- JaxbPlatformDescription getJaxbPlatform(String platformId);
-
- /**
- * Returns the first JAXB platform registered as a default platform and which supports the given
- * JAXB facet version.
- * Returns null if there are no such registered platforms.
- */
- JaxbPlatformDescription getDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion);
-
- JaxbPlatformDefinition buildJaxbPlatformDefinition(IProject project);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
deleted file mode 100644
index e3cce1bf73..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * JAXB Java-related stuff (annotations etc.)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-@SuppressWarnings("nls")
-public interface JAXB {
-
- // JAXB packages
-
- String JAXB_PACKAGE = "javax.xml.bind";
- String JAXB_PACKAGE_ = JAXB_PACKAGE + '.';
-
- String JAXB_ANNOTATION_PACKAGE = "javax.xml.bind.annotation";
- String JAXB_ANNOTATION_PACKAGE_ = JAXB_ANNOTATION_PACKAGE + '.';
-
- String JAXB_ADAPTERS_PACKAGE = JAXB_ANNOTATION_PACKAGE_ + "adapters";
- String JAXB_ADAPTERS_PACKAGE_ = JAXB_ADAPTERS_PACKAGE + '.';
-
-
- // JAXB annotations
-
- String XML_ATTACHMENT_REF = JAXB_ANNOTATION_PACKAGE_ + "XmlAttachmentRef";
-
- String XML_ACCESSOR_ORDER = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessorOrder";
- String XML_ACCESSOR_ORDER__VALUE = "value";
-
- String XML_ACCESSOR_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessorType";
- String XML_ACCESSOR_TYPE__VALUE = "value";
-
- String XML_ANY_ATTRIBUTE = JAXB_ANNOTATION_PACKAGE_ + "XmlAnyAttribute";
-
- String XML_ANY_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlAnyElement";
- String XML_ANY_ELEMENT__LAX = "lax";
- String XML_ANY_ELEMENT__VALUE = "value";
-
- String XML_ATTRIBUTE = JAXB_ANNOTATION_PACKAGE_ + "XmlAttribute";
- String XML_ATTRIBUTE__NAME = "name";
- String XML_ATTRIBUTE__NAMESPACE = "namespace";
- String XML_ATTRIBUTE__REQUIRED = "required";
-
- String XML_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlElement";
- String XML_ELEMENT__NAME = "name";
- String XML_ELEMENT__NAMESPACE = "namespace";
- String XML_ELEMENT__DEFAULT_VALUE = "defaultValue";
- String XML_ELEMENT__NILLABLE = "nillable";
- String XML_ELEMENT__REQUIRED = "required";
- String XML_ELEMENT__TYPE = "type";
-
- String XML_ELEMENT_DECL = JAXB_ANNOTATION_PACKAGE_ + "XmlElementDecl";
- String XML_ELEMENT_DECL__NAME = "name";
- String XML_ELEMENT_DECL__NAMESPACE = "namespace";
- String XML_ELEMENT_DECL__DEFAULT_VALUE = "defaultValue";
- String XML_ELEMENT_DECL__SCOPE = "scope";
- String XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME = "substitutionHeadName";
- String XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE = "substitutionHeadNamespace";
-
- String XML_ELEMENTS = JAXB_ANNOTATION_PACKAGE_ + "XmlElements";
- String XML_ELEMENTS__VALUE = "value";
-
- String XML_ELEMENT_REF = JAXB_ANNOTATION_PACKAGE_ + "XmlElementRef";
- String XML_ELEMENT_REF__NAME = "name";
- String XML_ELEMENT_REF__NAMESPACE = "namespace";
- String XML_ELEMENT_REF__REQUIRED = "required";
- String XML_ELEMENT_REF__TYPE = "type";
-
- String XML_ELEMENT_REFS = JAXB_ANNOTATION_PACKAGE_ + "XmlElementRefs";
- String XML_ELEMENT_REFS__VALUE = "value";
-
- String XML_ELEMENT_WRAPPER = JAXB_ANNOTATION_PACKAGE_ + "XmlElementWrapper";
- String XML_ELEMENT_WRAPPER__NAME = "name";
- String XML_ELEMENT_WRAPPER__NAMESPACE = "namespace";
- String XML_ELEMENT_WRAPPER__NILLABLE = "nillable";
- String XML_ELEMENT_WRAPPER__REQUIRED = "required";
-
- String XML_ENUM = JAXB_ANNOTATION_PACKAGE_ + "XmlEnum";
- String XML_ENUM__VALUE = "value";
-
- String XML_ENUM_VALUE = JAXB_ANNOTATION_PACKAGE_ + "XmlEnumValue";
- String XML_ENUM_VALUE__VALUE = "value";
-
- String XML_INLINE_BINARY_DATA = JAXB_ANNOTATION_PACKAGE_ + "XmlInlineBinaryData";
-
- String XML_ID = JAXB_ANNOTATION_PACKAGE_ + "XmlID";
-
- String XML_IDREF = JAXB_ANNOTATION_PACKAGE_ + "XmlIDREF";
-
- String XML_JAVA_TYPE_ADAPTER = JAXB_ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapter";
- String XML_JAVA_TYPE_ADAPTER__TYPE = "type";
- String XML_JAVA_TYPE_ADAPTER__VALUE = "value";
-
- String XML_JAVA_TYPE_ADAPTERS = JAXB_ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapters";
- String XML_JAVA_TYPE_ADAPTERS__VALUE = "value";
-
- String XML_LIST = JAXB_ANNOTATION_PACKAGE_ + "XmlList";
-
- String XML_MIME_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlMimeType";
- String XML_MIME_TYPE__VALUE = "value";
-
- String XML_MIXED = JAXB_ANNOTATION_PACKAGE_ + "XmlMixed";
-
- String XML_NS = JAXB_ANNOTATION_PACKAGE_ + "XmlNs";
- String XML_NS__NAMESPACE_URI = "namespaceURI";
- String XML_NS__PREFIX = "prefix";
-
- String XML_REGISTRY = JAXB_ANNOTATION_PACKAGE_ + "XmlRegistry";
-
- String XML_ROOT_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlRootElement";
- String XML_ROOT_ELEMENT__NAME = "name";
- String XML_ROOT_ELEMENT__NAMESPACE = "namespace";
-
- String XML_SCHEMA = JAXB_ANNOTATION_PACKAGE_ + "XmlSchema";
- String XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault";
- String XML_SCHEMA__ELEMENT_FORM_DEFAULT = "elementFormDefault";
- String XML_SCHEMA__LOCATION = "location";
- String XML_SCHEMA__NAMESPACE = "namespace";
- String XML_SCHEMA__XMLNS = "xmlns";
-
- String XML_SCHEMA_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlSchemaType";
- String XML_SCHEMA_TYPE__NAME = "name";
- String XML_SCHEMA_TYPE__NAMESPACE = "namespace";
- String XML_SCHEMA_TYPE__TYPE = "type";
-
- String XML_SCHEMA_TYPES = JAXB_ANNOTATION_PACKAGE_ + "XmlSchemaTypes";
- String XML_SCHEMA_TYPES__VALUE = "value";
-
- String XML_SEE_ALSO = JAXB_ANNOTATION_PACKAGE_ + "XmlSeeAlso";
- String XML_SEE_ALSO__VALUE = "value";
-
- String XML_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlType";
- String XML_TYPE__FACTORY_CLASS = "factoryClass";
- String XML_TYPE__FACTORY_METHOD = "factoryMethod";
- String XML_TYPE__NAME = "name";
- String XML_TYPE__NAMESPACE = "namespace";
- String XML_TYPE__PROP_ORDER = "propOrder";
-
- String XML_TRANSIENT = JAXB_ANNOTATION_PACKAGE_ + "XmlTransient";
-
- String XML_VALUE = JAXB_ANNOTATION_PACKAGE_ + "XmlValue";
-
-
- // JAXB enums
-
- String XML_ACCESS_ORDER = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessOrder";
- String XML_ACCESS_ORDER_ = XML_ACCESS_ORDER + '.';
- String XML_ACCESS_ORDER__ALPHABETICAL = XML_ACCESS_ORDER_ + "ALPHABETICAL";
- String XML_ACCESS_ORDER__UNDEFINED = XML_ACCESS_ORDER_ + "UNDEFINED";
-
- String XML_ACCESS_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessType";
- String XML_ACCESS_TYPE_ = XML_ACCESS_TYPE + '.';
- String XML_ACCESS_TYPE__FIELD = XML_ACCESS_TYPE_ + "FIELD";
- String XML_ACCESS_TYPE__NONE = XML_ACCESS_TYPE_ + "NONE";
- String XML_ACCESS_TYPE__PROPERTY = XML_ACCESS_TYPE_ + "PROPERTY";
- String XML_ACCESS_TYPE__PUBLIC_MEMBER = XML_ACCESS_TYPE_ + "PUBLIC_MEMBER";
-
- String XML_NS_FORM = JAXB_ANNOTATION_PACKAGE_ + "XmlNsForm";
- String XML_NS_FORM_ = XML_NS_FORM + ".";
- String XML_NS_FORM__QUALIFIED = XML_NS_FORM_ + "QUALIFIED";
- String XML_NS_FORM__UNQUALIFIED = XML_NS_FORM_ + "UNQUALIFIED";
- String XML_NS_FORM__UNSET = XML_NS_FORM_ + "UNSET";
-
-
- // Other JAXB types
-
- String JAXB_ELEMENT = JAXB_PACKAGE_ + "JAXBElement";
-
- String XML_ADAPTER = JAXB_ADAPTERS_PACKAGE_ + "XmlAdapter";
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
deleted file mode 100644
index 5dd3b0d7de..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Super-interface for {@link XmlAttributeAnnotation} and {@link XmlElementAnnotation}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbBasicSchemaComponentAnnotation
- extends QNameAnnotation {
-
- /**
- * Corresponds to the 'required' element of the XmlAttribute annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of the XmlAttribute annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the XmlAttribute annotation.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
deleted file mode 100644
index d87da74fbe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to JAXB annotations with namespace and name fields
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.?
- */
-public interface QNameAnnotation
- extends Annotation {
-
- /**
- * Constant associated with changes to the 'namespace' property
- */
- String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespace' element of the annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespace();
-
- /**
- * Corresponds to the 'namespace' element of the annotation.
- * Set to null to remove the element.
- */
- void setNamespace(String namespace);
-
- /**
- * Return the {@link TextRange} for the 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespace' element.
- * Return false if the element does not exist.
- */
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Constant associated with changes to the 'name' property
- */
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
-
- /**
- * Corresponds to the 'name' element of the annotation.
- * Set to null to remove the element.
- */
- void setName(String name);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'name' element.
- * Return false if the element does not exist.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java
deleted file mode 100644
index a7cbac73b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlAccessOrder
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessOrder {
-
- ALPHABETICAL(JAXB.XML_ACCESS_ORDER__ALPHABETICAL),
- UNDEFINED (JAXB.XML_ACCESS_ORDER__UNDEFINED);
-
-
- private String javaAnnotationValue;
-
- XmlAccessOrder(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessOrder fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlAccessOrder fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlAccessOrder accessType : XmlAccessOrder.values()) {
- if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return accessType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlAccessOrder accessType) {
- return (accessType == null) ? null : accessType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java
deleted file mode 100644
index c3b3bd0967..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlAccessType
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessType {
-
- FIELD(JAXB.XML_ACCESS_TYPE__FIELD),
- NONE(JAXB.XML_ACCESS_TYPE__NONE),
- PROPERTY(JAXB.XML_ACCESS_TYPE__PROPERTY),
- PUBLIC_MEMBER(JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
-
-
- private String javaAnnotationValue;
-
- XmlAccessType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlAccessType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlAccessType accessType : XmlAccessType.values()) {
- if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return accessType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlAccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java
deleted file mode 100644
index 5eb213ca01..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAccessorOrder
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessorOrderAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorOrder annotation.
- * Return null if the element does not exist in Java.
- */
- XmlAccessOrder getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorOrder annotation.
- * Set to null to remove the element.
- */
- void setValue(XmlAccessOrder value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAccessorOrder annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java
deleted file mode 100644
index b10dbac4b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAccessorType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessorTypeAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorType annotation.
- * Return null if the element does not exist in Java.
- */
- XmlAccessType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorType annotation.
- * Set to null to remove the element.
- */
- void setValue(XmlAccessType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAccessorType annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java
deleted file mode 100644
index 627356b2dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAnyAttribute
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyAttributeAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java
deleted file mode 100644
index caf679c903..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAnyElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyElementAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'lax' element of the XmlAnyElement annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getLax();
- String LAX_PROPERTY = "lax"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'lax' element of the XmlAnyElement annotation.
- * Set to null to remove the element.
- */
- void setLax(Boolean lax);
-
- /**
- * Return the {@link TextRange} for the 'lax' element. If the element
- * does not exist return the {@link TextRange} for the XmlAnyElement annotation.
- */
- TextRange getLaxTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'value' element of the XmlAnyElement annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlAnyElement(value=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAnyElement annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAnyElement annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified value class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlAnyElement(value=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedValueClassName();
- String FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY = "fullyQualifiedValueClassName"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java
deleted file mode 100644
index 356c771be3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAttachmentRef
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttachmentRefAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java
deleted file mode 100644
index 5fd86552fb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010,2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAttribute
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttributeAnnotation
- extends JaxbBasicSchemaComponentAnnotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
deleted file mode 100644
index c57b458d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementAnnotation
- extends JaxbBasicSchemaComponentAnnotation, NestableAnnotation {
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultValue();
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setDefaultValue(String defaultValue);
-
- /**
- * Return the {@link TextRange} for the 'defaultValue' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'nillable' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNillable();
- String NILLABLE_PROPERTY = "nillable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nillable' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setNillable(Boolean nillable);
-
- /**
- * Return the {@link TextRange} for the 'nillable' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getNillableTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'type' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElement(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElement(type=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedTypeName();
- String FULLY_QUALIFIED_TYPE_NAME_PROPERTY = "fullyQualifiedTypeName"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
deleted file mode 100644
index 9b3a83eaea..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementDecl
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementDeclAnnotation
- extends QNameAnnotation {
-
- // ***** scope *****
-
- /**
- * String associated with "scope" property changes.
- */
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'scope' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElementDecl(type=XmlElementDecl.GLOBAL.class)
- * </pre>
- * will return "XmlElementDecl.GLOBAL"
- */
- String getScope();
-
- /**
- * Corresponds to the 'scope' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setScope(String scope);
-
- /**
- * Return the {@link TextRange} for the 'scope' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getScopeTextRange(CompilationUnit astRoot);
-
- /**
- * String associated with "fullyQualifiedScopeClassName" property changes.
- */
- String FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY = "fullyQualifiedScopeClassName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified scope class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElementDecl(type=XmlElementDecl.GLOBAL.class)
- * </pre>
- * will return "javax.xml.bind.annotation.XmlElementDecl.GLOBAL"
- */
- String getFullyQualifiedScopeClassName();
-
-
- // ***** substitution head namespace *****
-
- /**
- * String associated with "substitutionHeadNamespace" property changes.
- */
- String SUBSTITUTION_HEAD_NAMESPACE_PROPERTY = "substitutionHeadNamespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'substitutionHeadNamespace' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadNamespace();
-
- /**
- * Corresponds to the 'substitutionHeadNamespace' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setSubstitutionHeadNamespace(String substitutionHeadNamespace);
-
- /**
- * Return the {@link TextRange} for the 'substitutionHeadNamespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'substitutionHeadNamespace' element.
- * Return false if the element does not exist.
- */
- boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot);
-
-
- // ***** substitution head name *****
-
- /**
- * String associated with "substitutionHeadName" property changes.
- */
- String SUBSTITUTION_HEAD_NAME_PROPERTY = "substitutionHeadName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'substitutionHeadName' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadName();
-
- /**
- * Corresponds to the 'substitutionHeadName' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setSubstitutionHeadName(String substitutionHeadName);
-
- /**
- * Return the {@link TextRange} for the 'substitutionHeadName' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'substitutionHeadName' element.
- * Return false if the element does not exist.
- */
- boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot);
-
-
- // ***** default value *****
-
- /**
- * String associated with "defaultValue" property changes.
- */
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultValue();
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setDefaultValue(String defaultValue);
-
- /**
- * Return the {@link TextRange} for the 'defaultValue' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
deleted file mode 100644
index 6b6d9b873c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementRef
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementRefAnnotation
- extends QNameAnnotation, NestableAnnotation {
-
- // ***** required *****
-
- /**
- * String associated with changes to the 'required' property of this annotation.
- */
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of this annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
-
- /**
- * Corresponds to the 'required' element of this annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-
-
- // ***** type *****
-
- /**
- * String associated with changes to the 'type' property of this annotation.
- */
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of this annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElementRef(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
-
- /**
- * Corresponds to the 'type' element of this annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * String associated with changes to the 'fullyQualifiedName' property of this annotation.
- */
- String FULLY_QUALIFIED_TYPE_NAME_PROPERTY = "fullyQualifiedTypeName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElementRef(type=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedTypeName();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java
deleted file mode 100644
index 3b10f27f39..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementRefs
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementRefsAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlElementRefAnnotation> getXmlElementRefs();
- String XML_ELEMENT_REFS_LIST = "xmlElementRefs"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- int getXmlElementRefsSize();
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- XmlElementRefAnnotation xmlElementRefAt(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- XmlElementRefAnnotation addXmlElementRef(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- void moveXmlElementRef(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- void removeXmlElementRef(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
deleted file mode 100644
index aaacd081a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementWrapper
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementWrapperAnnotation
- extends QNameAnnotation {
-
- /**
- * Corresponds to the 'nillable' element of the XmlElementWrapper annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNillable();
- String NILLABLE_PROPERTY = "nillable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nillable' element of the XmlElementWrapper annotation.
- * Set to null to remove the element.
- */
- void setNillable(Boolean nillable);
-
- /**
- * Return the {@link TextRange} for the 'nillable' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
- */
- TextRange getNillableTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'required' element of the XmlElementWrapper annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of the XmlElementWrapper annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java
deleted file mode 100644
index 016d1806b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementsAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlElementAnnotation> getXmlElements();
- String XML_ELEMENTS_LIST = "xmlElements"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- int getXmlElementsSize();
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- XmlElementAnnotation xmlElementAt(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- XmlElementAnnotation addXmlElement(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- void moveXmlElement(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- void removeXmlElement(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
deleted file mode 100644
index 1afc8ca88e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlEnum
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlEnumAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlEnum annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlEnum(value=EnumClass.class)
- * </pre>
- * will return "EnumClass"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlEnum annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlEnum annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified value class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlEnum(value=EnumClass.class)
- * </pre>
- * will return "model.EnumClass" if there is an import for model.EnumClass.
- * @return
- */
- String getFullyQualifiedValueClassName();
- String FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY = "fullyQualifiedValueClassName"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
deleted file mode 100644
index 6d70a2843c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlEnumValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlEnumValueAnnotation
- extends Annotation {
-
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlEnumValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
-
- /**
- * Corresponds to the 'value' element of the XmlEnumValue annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlEnumValue annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the given position touches the 'value' element value.
- */
- boolean valueTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java
deleted file mode 100644
index e783bd107a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlID
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java
deleted file mode 100644
index c6cfad2def..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlIDREF
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDREFAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index c299919dbf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlInlineBinaryData
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlInlineBinaryDataAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 3abc2cdead..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlJavaTypeAdapterAnnotation
- extends NestableAnnotation {
-
- /**
- * Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlJavaTypeAdapter(value=FooAdapter.class)
- * </pre>
- * will return "FooAdapter"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the value's fully-qualified class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlJavaTypeAdapter(FooAdapter.class)
- * </pre>
- * will return "example.FooAdapter" if there is an import for example.FooAdapter.
- */
- String getFullyQualifiedValue();
- String FULLY_QUALIFIED_VALUE_PROPERTY = "fullyQualifiedValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlJavaTypeAdapter annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlJavaTypeAdapter(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlJavaTypeAdapter annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the type's fully-qualified class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlJavaTypeAdapter(type=Foo.class)
- * </pre>
- * will return "example.Foo" if there is an import for example.Foo.
- */
- String getFullyQualifiedType();
- String FULLY_QUALIFIED_TYPE_PROPERTY = "fullyQualifiedType"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java
deleted file mode 100644
index 5446e4681f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlList
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlListAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java
deleted file mode 100644
index 773ade4495..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlMimeType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMimeTypeAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlMimeType annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlMimeType annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlMimeType annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java
deleted file mode 100644
index a792c4215f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlMixed
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMixedAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
deleted file mode 100644
index dffd0ffe49..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlNs
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlNsAnnotation
- extends NestableAnnotation {
-
- /**
- * Corresponds to the 'namespaceURI' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespaceURI();
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespaceURI' element of the XmlNs annotation.
- * Set to null to remove the element.
- */
- void setNamespaceURI(String namespaceURI);
-
- /**
- * Return the {@link TextRange} for the 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlNs annotation.
- */
- TextRange getNamespaceURITextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'prefix' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getPrefix();
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'prefix' element of the XmlNs annotation.
- * Set to null to remove the element.
- */
- void setPrefix(String prefix);
-
- /**
- * Return the {@link TextRange} for the 'prefix' element. If the element
- * does not exist return the {@link TextRange} for the XmlNs annotation.
- */
- TextRange getPrefixTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
deleted file mode 100644
index 4d73541c8f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlNsForm
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlNsForm {
-
- QUALIFIED(JAXB.XML_NS_FORM__QUALIFIED),
- UNQUALIFIED(JAXB.XML_NS_FORM__UNQUALIFIED),
- UNSET(JAXB.XML_NS_FORM__UNSET);
-
-
- private String javaAnnotationValue;
-
- XmlNsForm(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlNsForm fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlNsForm fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlNsForm nsForm : XmlNsForm.values()) {
- if (nsForm.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return nsForm;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlNsForm nsForm) {
- return (nsForm == null) ? null : nsForm.getJavaAnnotationValue();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java
deleted file mode 100644
index 07e6aef4d2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlRegistry
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRegistryAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java
deleted file mode 100644
index e18fc961e2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlRootElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRootElementAnnotation
- extends QNameAnnotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
deleted file mode 100644
index 0908506c0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSchema
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchemaAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- XmlNsForm getAttributeFormDefault();
- String ATTRIBUTE_FORM_DEFAULT_PROPERTY = "attributeFormDefault"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setAttributeFormDefault(XmlNsForm attributeFormDefault);
-
- /**
- * Return the {@link TextRange} for the 'attributeFormDefault' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- XmlNsForm getElementFormDefault();
- String ELEMENT_FORM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setElementFormDefault(XmlNsForm elementFormDefault);
-
- /**
- * Return the {@link TextRange} for the 'elementFormDefault' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getElementFormDefaultTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'location' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- String getLocation();
- String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'location' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setLocation(String location);
-
- /**
- * Return the {@link TextRange} for the 'location' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getLocationTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'namespace' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespace();
- String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespace' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setNamespace(String namespace);
-
- /**
- * Return the {@link TextRange} for the 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespace' element.
- * Return false if the element does not exist.
- */
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlNsAnnotation> getXmlns();
- String XMLNS_LIST = "xmlns"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- int getXmlnsSize();
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annnotation.
- */
- XmlNsAnnotation xmlnsAt(int index);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- XmlNsAnnotation addXmlns(int index);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- void moveXmlns(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- void removeXmlns(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
deleted file mode 100644
index f6a255e72c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSchemaType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchemaTypeAnnotation
- extends QNameAnnotation, NestableAnnotation {
-
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlSchemaType annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
- * </pre>
- * will return "XMLGregorianCalendar"
- */
- String getType();
-
- /**
- * Corresponds to the 'type' element of the XmlSchemaType annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchemaType annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- String FULLY_QUALIFIED_TYPE_PROPERTY = "fullyQualifiedType"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
- * </pre>
- * will return "javax.xml.datatype.XMLGregorianCalendar" if there is an import for
- * javax.xml.datatype.XMLGregorianCalendar.
- * @return
- */
- String getFullyQualifiedType();
-
- /**
- * The default type when none is specified
- */
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java
deleted file mode 100644
index 102f86401e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSeeAlso
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSeeAlsoAnnotation
- extends Annotation {
-
- /**
- * Change notification constant associated with the value element
- */
- String CLASSES_LIST = "classes"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- * Return an empty iterator if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlSeeAlso({Foo.class, Bar.class})
- * </pre>
- * will return and iterable containing: "Foo", "Bar"
- */
- ListIterable<String> getClasses();
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- int getClassesSize();
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void addClass(String clazz);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void addClass(int index, String clazz);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void moveClass(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void removeClass(int index);
-
- /**
- * Change notification constant associated with the fully qualified classes.
- * Changes should occur whenever changes occur to the "classes" list, but
- * may also occur with changes to the classes resolution state (import changes, e.g.)
- */
- String FULLY_QUALIFIED_CLASSES_LIST = "fullyQualifiedClasses"; //$NON-NLS-1$
-
- /**
- * Return the value elements resolved to fully qualified class names
- */
- ListIterable<String> getFullyQualifiedClasses();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java
deleted file mode 100644
index f2d67206d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlTransient
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlTransientAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
deleted file mode 100644
index fab1f81581..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.0
- */
-public interface XmlTypeAnnotation
- extends QNameAnnotation {
-
- /**
- * Corresponds to the 'factoryClass' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class)
- * </pre>
- * will return "USAddressFactory"
- */
- String getFactoryClass();
- String FACTORY_CLASS_PROPERTY = "factoryClass"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'factoryClass' element of the XmlType annotation.
- * Set to null to remove the element.
- */
- void setFactoryClass(String factoryClass);
-
- /**
- * Return the {@link TextRange} for the 'factoryClass' element. If the element
- * does not exist return the {@link TextRange} for the XmlType annotation.
- */
- TextRange getFactoryClassTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified factory class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class)
- * </pre>
- * will return "model.USAddressFactory" if there is an import for model.USAddressFactory.
- * @return
- */
- String getFullyQualifiedFactoryClassName();
- String FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY = "fullyQualifiedFactoryClassName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'factoryMethod' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- */
- String getFactoryMethod();
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'factoryMethod' element of the XmlType annotation.
- * Set to null to remove the element.
- */
- void setFactoryMethod(String factoryMethod);
-
- /**
- * Return the {@link TextRange} for the 'factoryMethod' element. If the element
- * does not exist return the {@link TextRange} for the XmlType annotation.
- */
- TextRange getFactoryMethodTextRange(CompilationUnit astRoot);
-
-
- // ***** prop order *****
-
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- /**
- * A single element empty string array should be interpreted as unspecified
- */
- String[] DEFAULT_PROP_ORDER = new String[] { "" };
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<String> getPropOrder();
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- int getPropOrderSize();
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void addProp(String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void addProp(int index, String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void moveProp(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void removeProp(String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void removeProp(int index);
-
- /**
- * Return the text range of the 'propOrder' element of the XmlType annotation.
- */
- TextRange getPropOrderTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'propOrder' element.
- * Return false if the element does not exist.
- */
- boolean propOrderTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the text range of the prop at the specified index
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- TextRange getPropTextRange(int index, CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the prop at the specified index.
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- boolean propTouches(int index, int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java
deleted file mode 100644
index b1936550e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlValueAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
deleted file mode 100644
index 22275336cd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.jaxbindex;
-
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-
-public interface JaxbIndexResource
- extends JptResourceModel {
-
- String getPackageName();
-
- Iterable<String> getFullyQualifiedClassNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
deleted file mode 100644
index 8d0931ae4e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.jaxbprops;
-
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-
-public interface JaxbPropertiesResource
- extends JptResourceModel {
-
- String getPackageName();
-
- String getProperty(String propertyName);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java
deleted file mode 100644
index 81c7a42a80..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.util.Stack;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-public class XSDNodeVisitor {
-
- private Stack<XSDComponent> visitedNodeStack = new Stack<XSDComponent>();
-
- protected boolean visitChildren = true;
-
- protected boolean visitChildren() {
- return this.visitChildren;
- }
-
- public void visitNode(XSDComponent node) {
- if (node != null && ! visitedNodeStack.contains(node)) {
- visitedNodeStack.push(node);
- XSDSwitch xsdSwitch = new XSDSwitch() {
- @Override
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object) {
- visitXSDAttributeDeclaration(object);
- return null;
- }
-
- @Override
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object) {
- visitXSDAttributeGroupDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDAttributeUse(XSDAttributeUse object) {
- visitXSDAttributeUse(object);
- return null;
- }
-
- @Override
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
- visitXSDComplexTypeDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
- visitXSDElementDeclaration(object);
- return null;
- }
-
- @Override
- public Object caseXSDModelGroup(XSDModelGroup object) {
- visitXSDModelGroup(object);
- return null;
- }
-
- @Override
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object) {
- visitXSDModelGroupDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDParticle(XSDParticle object) {
- visitXSDParticle(object);
- return null;
- }
-
- @Override
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
- visitXSDSimpleTypeDefinition(object);
- return null;
- }
- };
- xsdSwitch.doSwitch(node);
- visitedNodeStack.pop();
- }
- }
-
- public void visitXSDAttributeDeclaration(XSDAttributeDeclaration node) {}
-
- public void visitXSDAttributeGroupDefinition(XSDAttributeGroupDefinition node) {
- if (visitChildren()) {
- for (XSDAttributeUse attrUse : node.getAttributeUses()) {
- visitNode(attrUse);
- }
- }
- }
-
- public void visitXSDAttributeUse(XSDAttributeUse node) {}
-
- public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition node) {
- if (node.getBaseType() != null) {
- visitNode(node.getBaseType());
- }
-
- if (visitChildren()) {
- for (XSDAttributeUse attrUse : node.getAttributeUses()) {
- visitNode(attrUse);
- }
-
- if (node.getContent() != null) {
- visitNode(node.getContent());
- }
- }
- }
-
- public void visitXSDElementDeclaration(XSDElementDeclaration node) {
- for (XSDElementDeclaration element : node.getSubstitutionGroup()) {
- visitNode(element);
- }
-
- if (visitChildren()) {
- if (node.getTypeDefinition() != null) {
- visitNode(node.getTypeDefinition());
- }
- }
- }
-
- public void visitXSDModelGroup(XSDModelGroup node) {
- if (visitChildren()) {
- for (XSDParticle particle : node.getParticles()) {
- visitNode(particle);
- }
- }
- }
-
- public void visitXSDModelGroupDefinition(XSDModelGroupDefinition node) {
- if (node.getModelGroup() != null) {
- visitNode(node.getModelGroup());
- }
- }
-
- public void visitXSDParticle(XSDParticle node) {
- if (node.getTerm() != null) {
- visitNode(node.getTerm());
- }
- }
-
- public void visitXSDSimpleTypeDefinition(XSDSimpleTypeDefinition node) {
- if (node.getBaseType() != null) {
- visitNode(node.getBaseType());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java
deleted file mode 100644
index 63bf60b93a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XsdAttributeDeclaration
- extends XsdFeature<XSDAttributeDeclaration> {
-
- XsdAttributeDeclaration(XSDAttributeDeclaration xsdAttributeDeclaration) {
- super(xsdAttributeDeclaration);
- }
-
-
- @Override
- public XsdTypeDefinition getType() {
- XSDTypeDefinition xsdType = getXSDComponent().getType();
- return (xsdType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdType);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java
deleted file mode 100644
index 3feb1b3778..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-
-
-public class XsdAttributeGroupDefinition
- extends XsdComponent<XSDAttributeGroupDefinition> {
-
- XsdAttributeGroupDefinition(XSDAttributeGroupDefinition xsdAttributeGroupDefinition) {
- super(xsdAttributeGroupDefinition);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java
deleted file mode 100644
index 059cfd3654..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-
-
-public class XsdAttributeUse
- extends XsdComponent<XSDAttributeUse> {
-
-
- XsdAttributeUse(XSDAttributeUse xsdAttributeUse) {
- super(xsdAttributeUse);
- }
-
-
- public XsdAttributeDeclaration getAttributeDeclaration() {
- XSDAttributeDeclaration xsdAttribute = getXSDComponent().getAttributeDeclaration();
- return (xsdAttribute == null) ? null : (XsdAttributeDeclaration) XsdUtil.getAdapter(xsdAttribute);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java
deleted file mode 100644
index eb615067b6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-
-public class XsdComplexTypeDefinition
- extends XsdTypeDefinition<XSDComplexTypeDefinition> {
-
- XsdComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition) {
- super(xsdComplexTypeDefinition);
- }
-
-
- @Override
- public org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition.Kind getKind() {
- return Kind.COMPLEX;
- }
-
- @Override
- public XsdAttributeUse getAttribute(String namespace, String name) {
- for (XsdAttributeUse attrUse : getAttributeUses(namespace)) {
- if (attrUse.getXSDComponent().getAttributeDeclaration().getName().equals(name)) {
- return attrUse;
- }
- }
- return null;
- }
-
- @Override
- public Iterable<String> getAttributeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdAttributeUse, String>(getAttributeUses(namespace)) {
- @Override
- protected String transform(XsdAttributeUse attrUse) {
- return attrUse.getXSDComponent().getAttributeDeclaration().getName();
- }
- },
- filter));
- }
-
- protected Iterable<XsdAttributeUse> getAttributeUses(final String namespace) {
- return new TransformationIterable<XSDAttributeUse, XsdAttributeUse>(
- new FilteringIterable<XSDAttributeUse>(getXSDComponent().getAttributeUses()) {
- @Override
- protected boolean accept(XSDAttributeUse attrUse) {
- return XsdUtil.namespaceEquals(attrUse.getAttributeDeclaration(), namespace);
- }
- }) {
- @Override
- protected XsdAttributeUse transform(XSDAttributeUse attrUse) {
- return (XsdAttributeUse) XsdUtil.getAdapter(attrUse);
- }
- };
- }
-
- @Override
- public XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren) {
- for (XsdElementDeclaration element : getElementDeclarations(namespace, recurseChildren)) {
- if (element.getXSDComponent().getName().equals(name)) {
- return element;
- }
- }
- return null;
- }
-
- @Override
- public Iterable getElementNameProposals(String namespace, Filter<String> filter, boolean recurseChildren) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdElementDeclaration, String>(getElementDeclarations(namespace, recurseChildren)) {
- @Override
- protected String transform(XsdElementDeclaration element) {
- return element.getXSDComponent().getName();
- }
- },
- filter));
- }
-
- protected Iterable<XsdElementDeclaration> getElementDeclarations(final String namespace, boolean recurseChildren) {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(
- new FilteringIterable<XSDElementDeclaration>(getXSDElementDeclarations(recurseChildren)) {
- @Override
- protected boolean accept(XSDElementDeclaration element) {
- return XsdUtil.namespaceEquals(element, namespace);
- }
- }) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration element) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(element);
- }
- };
- }
-
- protected Iterable<XSDElementDeclaration> getXSDElementDeclarations(boolean recurseChildren) {
- ElementFinder elementFinder = new ElementFinder(recurseChildren);
- elementFinder.visitNode(getXSDComponent());
- return elementFinder.getElements();
- }
-
-
- private class ElementFinder
- extends XSDNodeVisitor {
-
- private boolean recurseChildren;
-
- private List<XSDElementDeclaration> elements = new ArrayList<XSDElementDeclaration>();
-
-
- private ElementFinder(boolean recurseChildren) {
- this.recurseChildren = recurseChildren;
- }
-
-
- @Override
- protected boolean visitChildren() {
- return super.visitChildren() || this.recurseChildren;
- }
-
- @Override
- public void visitXSDElementDeclaration(XSDElementDeclaration node) {
- boolean cachedVisitChildren = this.visitChildren;
- this.visitChildren = false;
- super.visitXSDElementDeclaration(node);
- if (! this.elements.contains(node)) {
- elements.add(node);
- }
- this.visitChildren = cachedVisitChildren;
- }
-
- public Iterable<XSDElementDeclaration> getElements() {
- return this.elements;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java
deleted file mode 100644
index fb7fec486b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-public class XsdComponent<A extends XSDConcreteComponent>
- extends AdapterImpl {
-
- protected final A xsdComponent;
-
-
- protected XsdComponent(A xsdComponent) {
- super();
- this.xsdComponent = xsdComponent;
- }
-
-
- public A getXSDComponent() {
- return this.xsdComponent;
- }
-
- @Override
- public boolean isAdapterForType(Object type) {
- return type == XsdUtil.adapterFactory;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java
deleted file mode 100644
index 0ee4afd691..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XsdElementDeclaration
- extends XsdFeature<XSDElementDeclaration> {
-
- XsdElementDeclaration(XSDElementDeclaration xsdElementDeclaration) {
- super(xsdElementDeclaration);
- }
-
-
- public XSDElementDeclaration getXSDElementDeclaration() {
- return getXSDFeature();
- }
-
- @Override
- public XsdTypeDefinition getType() {
- XSDTypeDefinition xsdType = getXSDElementDeclaration().getTypeDefinition();
- return (xsdType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdType);
- }
-
- public XsdElementDeclaration getElement(String namespace, String name) {
- XsdTypeDefinition type = getType();
- return (type == null) ? null : type.getElement(namespace, name);
- }
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return getType().getElementNameProposals(namespace, filter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java
deleted file mode 100644
index cb543bd760..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDFeature;
-
-
-public abstract class XsdFeature<A extends XSDFeature>
- extends XsdComponent<A> {
-
- protected XsdFeature(A xsdFeature) {
- super(xsdFeature);
- }
-
-
- public A getXSDFeature() {
- return getXSDComponent();
- }
-
- public String getName() {
- return getXSDFeature().getName();
- }
-
- public abstract XsdTypeDefinition getType();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java
deleted file mode 100644
index ecda07b617..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDModelGroup;
-
-
-public class XsdModelGroup
- extends XsdComponent<XSDModelGroup> {
-
- XsdModelGroup(XSDModelGroup xsdModelGroup) {
- super(xsdModelGroup);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java
deleted file mode 100644
index 7e9c2a7385..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-
-public class XsdModelGroupDefinition
- extends XsdComponent<XSDModelGroupDefinition> {
-
- XsdModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition) {
- super(xsdModelGroupDefinition);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java
deleted file mode 100644
index 23bbf9c99e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDParticle;
-
-
-public class XsdParticle
- extends XsdComponent<XSDParticle> {
-
- XsdParticle(XSDParticle xsdParticle) {
- super(xsdParticle);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java
deleted file mode 100644
index 8fc31d0473..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDUtil;
-
-public class XsdSchema
- extends XsdComponent<XSDSchema> {
-
- XsdSchema(XSDSchema xsdSchema) {
- super(xsdSchema);
- }
-
-
- public XSDSchema getXSDSchema() {
- return getXSDComponent();
- }
-
- public Iterable<String> getNamespaces() {
- Iterable<String> result = new SnapshotCloneIterable(getXSDSchema().getQNamePrefixToNamespaceMap().values());
- if (StringTools.stringIsEmpty(getXSDSchema().getTargetNamespace())) {
- result = new CompositeIterable<String>("", result);
- }
- return result;
- }
-
- public Iterable<XsdTypeDefinition> getAllTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getAllXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getDeclaredTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getDeclaredXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getBuiltInTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getBuiltInXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getTypeDefinitions(final String namespace) {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getXSDTypeDefinitions(namespace)) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdSimpleTypeDefinition> getSimpleTypeDefinitions(final String namespace) {
- return new TransformationIterable<XSDSimpleTypeDefinition, XsdSimpleTypeDefinition>(
- getXSDSimpleTypeDefinitions(namespace)) {
- @Override
- protected XsdSimpleTypeDefinition transform(XSDSimpleTypeDefinition o) {
- return (XsdSimpleTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- /**
- * by default, return a type with the given name and the schema's target namespace
- */
- public XsdTypeDefinition getTypeDefinition(String name) {
- return getTypeDefinition(getXSDComponent().getTargetNamespace(), name);
- }
-
- public XsdTypeDefinition getTypeDefinition(String namespace, String name) {
- for (XSDTypeDefinition typeDefinition : getXSDTypeDefinitions(namespace)) {
- if (XsdUtil.namespaceEquals(typeDefinition, namespace) && typeDefinition.getName().equals(name)) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(typeDefinition);
- }
- }
- return null;
- }
-
- protected Iterable<XSDTypeDefinition> getAllXSDTypeDefinitions() {
- return new CompositeIterable<XSDTypeDefinition>(
- getDeclaredXSDTypeDefinitions(), getBuiltInXSDTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getDeclaredXSDTypeDefinitions() {
- return new SnapshotCloneIterable(getXSDSchema().getTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getBuiltInXSDTypeDefinitions() {
- return new SnapshotCloneIterable(getXSDSchema().getSchemaForSchema().getTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getXSDTypeDefinitions(final String namespace) {
- if (XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace)) {
- return getBuiltInXSDTypeDefinitions();
- }
- return new FilteringIterable<XSDTypeDefinition>(getDeclaredXSDTypeDefinitions()) {
- @Override
- protected boolean accept(XSDTypeDefinition o) {
- return XsdUtil.namespaceEquals(o, namespace);
- }
- };
- }
-
- protected Iterable<XSDSimpleTypeDefinition> getXSDSimpleTypeDefinitions(String namespace) {
- return new TransformationIterable<XSDTypeDefinition, XSDSimpleTypeDefinition>(
- new FilteringIterable<XSDTypeDefinition>(getXSDTypeDefinitions(namespace)) {
- @Override
- protected boolean accept(XSDTypeDefinition o) {
- return o instanceof XSDSimpleTypeDefinition;
- }
- }) {
- @Override
- protected XSDSimpleTypeDefinition transform(XSDTypeDefinition o) {
- return (XSDSimpleTypeDefinition) o;
- }
- };
- }
-
- public Iterable<XsdElementDeclaration> getElementDeclarations() {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(getXSDElementDeclarations()) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration o) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdElementDeclaration> getElementDeclarations(final String namespace) {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(
- new FilteringIterable<XSDElementDeclaration>(getXSDElementDeclarations()) {
- @Override
- protected boolean accept(XSDElementDeclaration o) {
- return XsdUtil.namespaceEquals(o, namespace);
- }
- }) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration o) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public XsdElementDeclaration getElementDeclaration(String namespace, String name) {
- for (XSDElementDeclaration elementDeclaration : getXSDElementDeclarations()) {
- if (XsdUtil.namespaceEquals(elementDeclaration, namespace) && elementDeclaration.getName().equals(name)) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(elementDeclaration);
- }
- }
- return null;
- }
-
- protected Iterable<XSDElementDeclaration> getXSDElementDeclarations() {
- return new SnapshotCloneIterable(getXSDSchema().getElementDeclarations());
- }
-
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(getNamespaces(), filter));
- }
-
- public Iterable<String> getTypeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdTypeDefinition, String>(this.getTypeDefinitions(namespace)) {
- @Override
- protected String transform(XsdTypeDefinition o) {
- return o.getName();
- }
- },
- filter));
- }
-
- public Iterable<String> getSimpleTypeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdSimpleTypeDefinition, String>(this.getSimpleTypeDefinitions(namespace)) {
- @Override
- protected String transform(XsdSimpleTypeDefinition o) {
- return o.getName();
- }
- },
- filter));
- }
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdElementDeclaration, String>(this.getElementDeclarations(namespace)) {
- @Override
- protected String transform(XsdElementDeclaration o) {
- return o.getName();
- }
- },
- filter));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java
deleted file mode 100644
index c6e5adc684..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-
-public class XsdSimpleTypeDefinition
- extends XsdTypeDefinition<XSDSimpleTypeDefinition> {
-
- XsdSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
- super(xsdSimpleTypeDefinition);
- }
-
-
- @Override
- public org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition.Kind getKind() {
- return Kind.SIMPLE;
- }
-
- @Override
- public XsdAttributeUse getAttribute(String namespace, String name) {
- // simple types have no attributes
- return null;
- }
-
- @Override
- public Iterable<String> getAttributeNameProposals(String namespace, Filter<String> filter) {
- // simple types have no attributes
- return EmptyIterable.instance();
- }
-
- @Override
- public XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren) {
- // simple types have no elements
- return null;
- }
-
- @Override
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter, boolean recurseChildren) {
- // simple types have no elements
- return EmptyIterable.instance();
- }
-
- public Iterable<String> getEnumValueProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XSDEnumerationFacet, String>(getXSDComponent().getEnumerationFacets()) {
- @Override
- protected String transform(XSDEnumerationFacet enumFacet) {
- return enumFacet.getLexicalValue();
- }
- },
- filter));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java
deleted file mode 100644
index b317be88f2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public abstract class XsdTypeDefinition<A extends XSDTypeDefinition>
- extends XsdComponent<A> {
-
- protected XsdTypeDefinition(A xsdTypeDefinition) {
- super(xsdTypeDefinition);
- }
-
-
- public abstract Kind getKind();
-
- public String getName() {
- return getXSDComponent().getName();
- }
-
- public boolean matches(String namespace, String name) {
- return XsdUtil.namespaceEquals(getXSDComponent(), namespace) && StringTools.stringsAreEqual(getName(), name);
- }
-
- public abstract XsdAttributeUse getAttribute(String namespace, String name);
-
- public abstract Iterable<String> getAttributeNameProposals(String namespace, Filter<String> filter);
-
- public XsdElementDeclaration getElement(String namespace, String name) {
- return getElement(namespace, name, false);
- }
-
- public abstract XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren);
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return getElementNameProposals(namespace, filter, false);
- }
-
- public abstract Iterable getElementNameProposals(String namespace, Filter<String> filter, boolean recurseChildren);
-
-
- public enum Kind {
-
- /**
- * An {@link XsdTypeDefinition} of SIMPLE {@link Kind} may safely be cast to an {@link XsdSimpleTypeDefinition}
- */
- SIMPLE,
-
- /**
- * An {@link XsdTypeDefinition} of COMPLEX {@link Kind} may safely be cast to an {@link XsdComplexTypeDefinition}
- */
- COMPLEX;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
deleted file mode 100644
index cf7d59ca88..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * (copied mainly from org.eclipse.wst.xsd.contentmodel.internal.XSDImpl)
- * Oracle - extensions and modifications
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xsd.contentmodel.internal.util.XSDSchemaLocatorAdapterFactory;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.util.XSDSwitch;
-
-/**
- * Utility class for building XSD model and its extensions for JAXB
- */
-public class XsdUtil {
-
- static final XsdAdapterFactoryImpl adapterFactory = new XsdAdapterFactoryImpl();
-
-
- public static boolean namespaceEquals(XSDNamedComponent comp, String namespace) {
- String xsdNamespace = comp.getTargetNamespace();
- return (xsdNamespace == null) ? StringTools.stringIsEmpty(namespace) : xsdNamespace.equals(namespace);
- }
-
- public static String getResolvedUri(String namespace, String location) {
- String resolvedUri = null;
-
- ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-
- if (! StringTools.stringIsEmpty(location)) {
- try {
- resolvedUri = catalog.resolveSystem(location);
- if (resolvedUri == null) {
- resolvedUri = catalog.resolveURI(location);
- }
- }
- catch (MalformedURLException me) {
- JptJaxbCorePlugin.log(me);
- resolvedUri = null;
- }
- catch (IOException ie) {
- JptJaxbCorePlugin.log(ie);
- resolvedUri = null;
- }
- }
-
- if (resolvedUri == null && namespace != null) {
- if ( ! (location != null && location.endsWith(".xsd"))) { //$NON-NLS-1$
- try {
- resolvedUri = catalog.resolvePublic(namespace, location);
- if (resolvedUri == null) {
- resolvedUri = catalog.resolveURI(namespace);
- }
- }
- catch (MalformedURLException me) {
- JptJaxbCorePlugin.log(me);
- resolvedUri = null;
- }
- catch (IOException ie) {
- JptJaxbCorePlugin.log(ie);
- resolvedUri = null;
- }
- }
- }
-
- // if resolvedUri is null, assume the location is resolved
- return (resolvedUri != null) ? resolvedUri : location;
- }
-
-
- public static XsdSchema getSchema(XSDSchema xsdSchema) {
- return (xsdSchema == null) ? null : (XsdSchema) XsdUtil.getAdapter(xsdSchema);
- }
-
- public static XsdSchema getSchemaForSchema() {
- return getSchema(XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001));
- }
-
- /**
- * Given uri for an XML Schema document, parse the document and build
- * corresponding EMF object.
- */
- public static XSDSchema buildXSDModel(String uriString) {
- XSDSchema xsdSchema = null;
-
- // if XML Schema for Schema is requested, get it through schema model
- if (uriString.endsWith("2001/XMLSchema.xsd")) {
- xsdSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- }
- else {
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
-
- URI uri = URI.createURI(uriString);
-
- // CS : bug 113537 ensure we perform physical resolution before opening a stream for the resource
- String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation("", "", uriString);
- XSDResourceImpl resource = null;
- try {
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
- resource = (XSDResourceImpl) resourceSet.createResource(URI.createURI("*.xsd"));
- resource.setURI(uri);
- resource.load(inputStream, null);
- }
- catch (IOException e) {
- // schema does not exist or cannot be read
- // swallow the exception, and return null
- // there will be project validation to capture this error
- return null;
- }
- xsdSchema = resource.getSchema();
- }
- handleImports(xsdSchema);
- return xsdSchema;
- }
-
- private static void handleImports(XSDSchema xsdSchema) {
- if (xsdSchema != null) {
- for (XSDSchemaContent content : xsdSchema.getContents()) {
- if (content instanceof XSDImportImpl) {
- XSDImportImpl anImport = (XSDImportImpl) content;
- try {
- if (anImport.getSchemaLocation() != null) {
- anImport.importSchema();
- }
- }
- catch (Exception e) {
- JptJaxbCorePlugin.log(e);
- }
- }
- }
- }
- }
-
- public static Object getAdapter(Notifier notifier) {
- return adapterFactory.adapt(notifier);
- }
-
-
- /**
- * The Factory for the XSD adapter model. It provides a create method for each
- * non-abstract class of the model.
- */
- public static class XsdAdapterFactoryImpl
- extends AdapterFactoryImpl {
-
- @Override
- public Adapter createAdapter(Notifier target) {
- XSDSwitch xsdSwitch = new XSDSwitch() {
- @Override
- public Object caseXSDSchema(XSDSchema object) {
- return new XsdSchema(object);
- }
-
- @Override
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object) {
- return new XsdAttributeDeclaration(object);
- }
-
- @Override
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object) {
- return new XsdAttributeGroupDefinition(object);
- }
-
- @Override
- public Object caseXSDAttributeUse(XSDAttributeUse object) {
- return new XsdAttributeUse(object);
- }
-
- @Override
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
- return new XsdComplexTypeDefinition(object);
- }
-
- @Override
- public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
- return new XsdElementDeclaration(object);
- }
-
- @Override
- public Object caseXSDModelGroup(XSDModelGroup object) {
- return new XsdModelGroup(object);
- }
-
- @Override
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object) {
- return new XsdModelGroupDefinition(object);
- }
-
- @Override
- public Object caseXSDParticle(XSDParticle object) {
- return new XsdParticle(object);
- }
-
- @Override
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
- return new XsdSimpleTypeDefinition(object);
- }
- };
-
- Object o = xsdSwitch.doSwitch((EObject) target);
- Adapter result = null;
- if (o instanceof Adapter) {
- result = (Adapter) o;
- }
- return result;
- }
-
- public Adapter adapt(Notifier target) {
- return adapt(target, this);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project
deleted file mode 100644
index d123fb8513..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 0eb6ebdab2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties
deleted file mode 100644
index f38c7c0a88..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - EclipseLink JAXB Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties
deleted file mode 100644
index d6bd03a94b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml
deleted file mode 100644
index a2db2d1b9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.eclipselink.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jaxb.eclipselink.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.eclipselink.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.png b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties
deleted file mode 100644
index d3fad8a20b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink MOXy (JAXB) Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project
deleted file mode 100644
index a482c34f48..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.core.schemagen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4204445996..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:53 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF
deleted file mode 100644
index 6094e17a01..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core.schemagen;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.xml.bind,
- org.eclipse.persistence.jaxb
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.core.schemagen,
- org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H2>About This Content</H2>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties
deleted file mode 100644
index d535c6112b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties
deleted file mode 100644
index c05741163a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - EclipseLink JAXB Support - Schema Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java
deleted file mode 100644
index 0ae05f139f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.schemagen;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal.JptEclipseLinkJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal.Tools;
-import org.eclipse.persistence.jaxb.JAXBContext;
-import org.eclipse.persistence.jaxb.JAXBContextFactory;
-
-/**
- * Generate a EclipseLink JAXB Schema
- *
- * Current command-line arguments:
- * [-s schema.xsd] - specifies the target schema
- * [-c className] - specifies the fully qualified class name
- */
-public class Main
-{
- private String[] sourceClassNames;
- private String targetSchemaName;
- @SuppressWarnings("unused")
- private boolean isDebugMode;
-
- static public String NO_FACTORY_CLASS = "doesnt contain ObjectFactory.class"; //$NON-NLS-1$
- static public String CANNOT_BE_CAST_TO_JAXBCONTEXT = "cannot be cast to org.eclipse.persistence.jaxb.JAXBContext"; //$NON-NLS-1$
-
- // ********** static methods **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- // ********** constructors **********
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
-
- this.initializeWith(args);
-
- this.generate();
- }
-
- // ********** internal methods **********
-
- private void initializeWith(String[] args) {
- this.sourceClassNames = this.getSourceClassNames(args);
- this.targetSchemaName = this.getTargetSchemaName(args);
-
- this.isDebugMode = this.getDebugMode(args);
- }
-
- private void generate() {
- // Create the JAXBContext
- JAXBContext jaxbContext = this.buildJaxbContext();
-
- // Generate an XML Schema
- if(jaxbContext != null) {
- this.generateSchema(jaxbContext);
- }
- else {
- Tools.bind(JptEclipseLinkJaxbCoreMessages.SCHEMA_NOT_CREATED, this.targetSchemaName);
- }
- }
-
- private JAXBContext buildJaxbContext() {
- System.out.println(Tools.getString(JptEclipseLinkJaxbCoreMessages.LOADING_CLASSES));
- JAXBContext jaxbContext = null;
- try {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- Class[] sourceClasses = this.buildSourceClasses(this.sourceClassNames, loader);
-
- //call MOXy JAXBContextFactory directly. This eliminates the need to have the JAXB properties file in place
- //in time for the generation.
- jaxbContext = (JAXBContext)JAXBContextFactory.createContext(sourceClasses, Collections.<String,Object>emptyMap());
- }
- catch (JAXBException ex) {
- this.handleJaxbException(ex);
- }
- catch (ClassCastException ex) {
- this.handleClassCastException(ex);
- }
- return jaxbContext;
- }
-
- private void generateSchema(JAXBContext jaxbContext) {
- System.out.println(Tools.getString(JptEclipseLinkJaxbCoreMessages.GENERATING_SCHEMA));
- System.out.flush();
-
- SchemaOutputResolver schemaOutputResolver =
- new JptSchemaOutputResolver(this.targetSchemaName);
-
- try {
- jaxbContext.generateSchema(schemaOutputResolver);
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- }
-
- private Class[] buildSourceClasses(String[] classNames, ClassLoader loader) {
-
- ArrayList<Class> sourceClasses = new ArrayList<Class>(classNames.length);
- for(String className: classNames) {
- try {
- sourceClasses.add(loader.loadClass(className));
- System.out.println(className);
- }
- catch (ClassNotFoundException e) {
- System.err.println(Tools.bind(JptEclipseLinkJaxbCoreMessages.NOT_FOUND, className));
- }
- }
- System.out.flush();
- return sourceClasses.toArray(new Class[0]);
- }
-
- private void handleJaxbException(JAXBException ex) {
- String message = ex.getMessage();
- Throwable linkedEx = ex.getLinkedException();
- if(message != null && message.indexOf(NO_FACTORY_CLASS) > -1) {
- System.err.println(message);
- }
- else if(linkedEx != null && linkedEx instanceof ClassNotFoundException) {
- String errorMessage = Tools.bind(
- JptEclipseLinkJaxbCoreMessages.CONTEXT_FACTORY_NOT_FOUND, linkedEx.getMessage());
- System.err.println(errorMessage);
- }
- else {
- ex.printStackTrace();
- }
- }
-
- private void handleClassCastException(ClassCastException ex) {
- String message = ex.getMessage();
- if(message != null && message.indexOf(CANNOT_BE_CAST_TO_JAXBCONTEXT) > -1) {
- System.err.println(Tools.getString(JptEclipseLinkJaxbCoreMessages.PROPERTIES_FILE_NOT_FOUND));
- }
- else {
- ex.printStackTrace();
- }
- }
-
- // ********** argument queries **********
-
- private String[] getSourceClassNames(String[] args) {
-
- return this.getAllArgumentValues("-c", args); //$NON-NLS-1$
- }
-
- private String getTargetSchemaName(String[] args) {
-
- return this.getArgumentValue("-s", args); //$NON-NLS-1$
- }
-
- private boolean getDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- // ********** private methods **********
-
- private String getArgumentValue(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private String[] getAllArgumentValues(String argName, String[] args) {
- List<String> argValues = new ArrayList<String>();
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- argValues.add(args[j]);
- i++;
- }
- }
- }
- return argValues.toArray(new String[0]);
- }
-
- private boolean argumentExists(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- return true;
- }
- }
- return false;
- }
-
-}
-
-// ********** inner class **********
-
-class JptSchemaOutputResolver extends SchemaOutputResolver {
-
- private String defaultSchemaName;
-
- // ********** constructor **********
-
- protected JptSchemaOutputResolver(String defaultSchemaName) {
- this.defaultSchemaName = defaultSchemaName;
- }
-
- // ********** overrides **********
-
- @Override
- public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException {
-
- String filePath = (Tools.stringIsEmpty(namespaceURI)) ?
- this.buildFileNameFrom(this.defaultSchemaName, suggestedFileName) :
- this.modifyFileName(namespaceURI);
-
- File file = new File(filePath);
- StreamResult result = new StreamResult(file);
- result.setSystemId(file.toURI().toURL().toString());
-
- System.out.print(Tools.bind(JptEclipseLinkJaxbCoreMessages.SCHEMA_GENERATED, file));
- return result;
- }
-
- // ********** private methods **********
-
- private String buildFileNameFrom(String fileName, String suggestedFileName) {
-
- fileName = Tools.stripExtension(fileName);
-
- if(Tools.stringIsEmpty(fileName)) {
- return suggestedFileName;
- }
- String number = Tools.extractFileNumber(suggestedFileName);
-
- fileName = this.buildFileName(fileName, number);
- return Tools.appendXsdExtension(fileName);
- }
-
- private String buildFileName(String fileName, String number) {
-
- if(Tools.stringIsEmpty(number)) {
- return fileName;
- }
- return (number.equals("0")) ? fileName : fileName + number; //$NON-NLS-1$
- }
-
- private String modifyFileName(String namespaceURI) throws IOException {
-
- String dir = Tools.extractDirectory(this.defaultSchemaName);
-
- String fileName = Tools.stripProtocol(namespaceURI);
- fileName = fileName.replaceAll("/", "_"); //$NON-NLS-1$
- fileName = Tools.appendXsdExtension(fileName);
-
- String result = (Tools.stringIsEmpty(dir)) ? fileName : dir + File.separator + fileName;
-
- return result;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java
deleted file mode 100644
index 65a9e2eee8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Localized messages used by Dali EclipseLink JAXB core.
- */
-public class JptEclipseLinkJaxbCoreMessages
-{
- public static final String LOADING_CLASSES = "LOADING_CLASSES";
- public static final String GENERATING_SCHEMA = "GENERATING_SCHEMA";
- public static final String SCHEMA_GENERATED = "SCHEMA_GENERATED";
- public static final String SCHEMA_NOT_CREATED = "SCHEMA_NOT_CREATED";
- public static final String NOT_FOUND = "NOT_FOUND";
- public static final String CONTEXT_FACTORY_NOT_FOUND = "CONTEXT_FACTORY_NOT_FOUND";
- public static final String PROPERTIES_FILE_NOT_FOUND = "PROPERTIES_FILE_NOT_FOUND";
-
-
- private static final String BUNDLE_NAME = "org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal.jpt_eclipselink_jaxb_core"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private JptEclipseLinkJaxbCoreMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.java
deleted file mode 100644
index 5a32e4c09c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-/**
- * Tools
- */
-public final class Tools
-{
- /** default file name used by the schemagen */
- static public String GEN_DEFAULT_NAME = "schema"; //$NON-NLS-1$
-
- /** empty string */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- // ********** queries **********
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(String string) {
- if (string == null) {
- return true;
- }
- int len = string.length();
- if (len == 0) {
- return true;
- }
- return stringIsEmpty_(string.toCharArray(), len);
- }
-
- private static boolean stringIsEmpty_(char[] s, int len) {
- for (int i = len; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- // ********** short name manipulation **********
-
- /**
- * Strip the extension from the specified file name
- * and return the result. If the file name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return fileName;
- }
- return fileName.substring(0, index);
- }
-
- public static String stripProtocol(String uri) {
-
- return uri.replaceFirst("http://", EMPTY_STRING);
- }
-
-
- public static String appendXsdExtension(String name) {
-
- return name + ".xsd"; //$NON-NLS-1$
- }
-
- public static String extractFileNumber(String fileName) {
-
- String result = stripExtension(fileName);
- if(Tools.stringIsEmpty(result)) {
- return EMPTY_STRING;
- }
- return result.replaceFirst(GEN_DEFAULT_NAME, EMPTY_STRING);
- }
-
- public static String extractDirectory(String path) {
- if( ! path.contains(File.separator)) {
- return EMPTY_STRING;
- }
- return path.substring(0, path.lastIndexOf(File.separator));
- }
-
- // ********** NLS utilities **********
-
- public static String getString(String key) {
- return JptEclipseLinkJaxbCoreMessages.getString(key);
- }
-
- public static String bind(String key, Object argument) {
- return MessageFormat.format(getString(key), argument);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
deleted file mode 100644
index a9f76617fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-################################################################################
-# Copyright (c) 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-LOADING_CLASSES = loading...
-GENERATING_SCHEMA = \nMOXy generating schema...
-SCHEMA_GENERATED = \nSchema {0} generated
-SCHEMA_NOT_CREATED = \nSchema {0} not created
-NOT_FOUND = \n\tNot found: {0}
-PROPERTIES_FILE_NOT_FOUND = \nEclipseLink JAXBContextFactory must be specified in the jaxb.properties file to use EclipseLink MOXy for schema generation.\n\
-javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
-CONTEXT_FACTORY_NOT_FOUND = \nThe JAXBContextFactory {0} \n\
-specified in the jaxb.properties file could not be located on the project classpath. \n\
-The JAXB provider that defines this factory should be added to the project classpath, \n\
-or the jaxb.properties file should be removed to use the default provider.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath
deleted file mode 100644
index 0232fe5ec9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project
deleted file mode 100644
index d899a36e49..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 30eb0fcac5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:45 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
deleted file mode 100644
index b34828cc73..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.JptJaxbEclipseLinkCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.7.100,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jaxb.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.500,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.300,2.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.core,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.context,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.validation,
- org.eclipse.jpt.jaxb.eclipselink.core.resource.java
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/build.properties
deleted file mode 100644
index b7fe1216e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.properties
deleted file mode 100644
index 98d631a019..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - EclipseLink JAXB Support - Core
-providerName = Eclipse Web Tools Platform
-
-ECLIPSELINK_PLATFORM_GROUP_LABEL = EclipseLink
-ECLIPSELINK_2_1_PLATFORM_LABEL = EclipseLink 2.1.x
-ECLIPSELINK_2_2_PLATFORM_LABEL = EclipseLink 2.2.x
-ECLIPSELINK_2_3_PLATFORM_LABEL = EclipseLink 2.3.x
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml
deleted file mode 100644
index 43993445b9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- Copyright (c) 2011 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.jpt.jaxb.core.jaxbPlatforms">
-
- <jaxbPlatformGroup
- id="eclipselink"
- label="%ECLIPSELINK_PLATFORM_GROUP_LABEL"/>
-
- <jaxbPlatform
- id="eclipselink_2_1"
- label="%ECLIPSELINK_2_1_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_PlatformDefinitionFactory"
- group="eclipselink"
- jaxbFacetVersion="2.1"
- default="false"/>
-
- <jaxbPlatform
- id="eclipselink_2_2"
- label="%ECLIPSELINK_2_2_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinitionFactory"
- group="eclipselink"
- jaxbFacetVersion="2.2"
- default="false"/>
-
- <jaxbPlatform
- id="eclipselink_2_3"
- label="%ECLIPSELINK_2_3_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3.ELJaxb_2_3_PlatformDefinitionFactory"
- group="eclipselink"
- jaxbFacetVersion="2.2"
- default="false"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.common.core.libraryValidators">
-
- <libraryValidator
- id="eclipselinkUserLibraryValidator"
- class="org.eclipse.jpt.jaxb.eclipselink.core.internal.libval.ELJaxbUserLibraryValidator">
- <enablement>
- <and>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId" value="jaxb-user-library-provider"/>
- </with>
- <with variable="config">
- <test property="org.eclipse.jpt.jaxb.core.jaxbPlatformGroup" value="eclipselink"/>
- </with>
- </and>
- </enablement>
- </libraryValidator>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties
deleted file mode 100644
index cd71550835..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY = Project is missing a jaxb.properties file specifying the EclipseLink JAXB context factory \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.java
deleted file mode 100644
index d42f183721..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface ELJaxbMappingKeys {
-
- String XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY = "xml-inverse-reference";
- String XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY = "xml-transformation";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.java
deleted file mode 100644
index b37ded3cc6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core;
-
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-
-public class ELJaxbPlatform {
-
- public static final JaxbPlatformGroupDescription GROUP
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup("eclipselink"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_1
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("eclipselink_2_1"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_2
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("eclipselink_2_2"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_3
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("eclipselink_2_3"); //$NON-NLS-1$
-
-
- /**
- * Not for instantiation
- */
- private ELJaxbPlatform() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java
deleted file mode 100644
index e69681806f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-public class JptJaxbEclipseLinkCorePlugin
- extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.eclipselink.core"; //$NON-NLS-1$
-
-
- // ********** singleton **********
- private static JptJaxbEclipseLinkCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPT EclipseLink plug-in.
- */
- public static JptJaxbEclipseLinkCorePlugin instance() {
- return INSTANCE;
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbEclipseLinkCorePlugin() {
- super();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- INSTANCE = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.java
deleted file mode 100644
index 5e4365cd41..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-
-public abstract class AbstractELJaxbPlatformDefinition
- extends AbstractJaxbPlatformDefinition {
-
- protected AbstractELJaxbPlatformDefinition() {
- super();
- }
-
-
- protected abstract JaxbPlatformDefinition getGenericJaxbPlatformDefinition();
-
-
- @Override
- public String getSchemaTypeMapping(String javaTypeName) {
- String mapping = getGenericJaxbPlatformDefinition().getSchemaTypeMapping(javaTypeName);
- return (mapping != null) ? mapping : super.getSchemaTypeMapping(javaTypeName);
- }
-
- @Override
- protected Map<String, String> buildJavaToSchemaTypes() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("java.sql.Date", "date");
- map.put("java.sql.Time", "time");
- map.put("java.sql.Timestamp", "dateTime");
- return map;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.java
deleted file mode 100644
index b162386a60..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJaxbContextRoot
- extends AbstractJaxbContextRoot {
-
-
- public ELJaxbContextRoot(JaxbProject jaxbProject) {
- super(jaxbProject);
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- validateJaxbProperties(messages, reporter);
- }
-
- protected void validateJaxbProperties(List<IMessage> messages, IReporter reporter) {
- String factoryProp = "javax.xml.bind.context.factory";
- String factoryPropValue = "org.eclipse.persistence.jaxb.JAXBContextFactory";
-
- for (JaxbPackage jp : getPackages()) {
- String pn = jp.getName();
- JaxbPropertiesResource jpr = getJaxbProject().getJaxbPropertiesResource(pn);
- if (jpr != null && StringTools.stringsAreEqual(jpr.getProperty(factoryProp), factoryPropValue)) {
- return;
- }
- }
-
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY,
- getJaxbProject()));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java
deleted file mode 100644
index 3683391644..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-
-
-public class ELJavaXmlInverseReferenceMapping
- extends AbstractJavaAttributeMapping<XmlInverseReferenceAnnotation> {
-
- public ELJavaXmlInverseReferenceMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java
deleted file mode 100644
index a62e305ea0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlInverseReferenceMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new ELJavaXmlInverseReferenceMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private ELJavaXmlInverseReferenceMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- // TODO: move to factory once API opens up again
- return new ELJavaXmlInverseReferenceMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.java
deleted file mode 100644
index 036908cb6c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class ELJavaXmlTransformationMapping
- extends AbstractJavaAttributeMapping<XmlTransformationAnnotation> {
-
- public ELJavaXmlTransformationMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.java
deleted file mode 100644
index 852c0810d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlTransformationMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new ELJavaXmlTransformationMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private ELJavaXmlTransformationMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- // TODO: move to factory once API opens up again
- return new ELJavaXmlTransformationMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java
deleted file mode 100644
index a927430df8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.libval;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jpt.common.core.internal.libval.LibValUtil;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.eclipselink.core.internal.JptCommonEclipseLinkCoreMessages;
-import org.eclipse.jpt.common.eclipselink.core.internal.libval.EclipseLinkLibValUtil;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.osgi.service.resolver.VersionRange;
-
-
-/**
- * Library validator for EclipseLink JAXB user libraries.
- *
- * In order to validate that the correct eclipselink.jar is present in the user library, the version
- * class which appears in standard EclipseLink libraries will be examined and compared against the
- * union of calculated version ranges, depending on the platform specified in the config.
- */
-public class ELJaxbUserLibraryValidator
- implements LibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
- JaxbUserLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbUserLibraryProviderInstallOperationConfig) config;
- JaxbPlatformDescription platform = jaxbConfig.getJaxbPlatform();
- Set<VersionRange> versionRanges = new HashSet<VersionRange>();
-
- if (ELJaxbPlatform.VERSION_2_1.equals(platform)) {
- versionRanges.add(new VersionRange("[2.1, 3.0)")); //$NON-NLS-1$
- }
- else if (ELJaxbPlatform.VERSION_2_2.equals(platform)) {
- versionRanges.add(new VersionRange("[2.2, 3.0)")); //$NON-NLS-1$
- }
- else if (ELJaxbPlatform.VERSION_2_3.equals(platform)) {
- versionRanges.add(new VersionRange("[2.3, 3.0)")); //$NON-NLS-1$
- }
-
- IStatus status = EclipseLinkLibValUtil.validate(jaxbConfig.resolve(), versionRanges);
-
- if (! status.isOK()) {
- return status;
- }
-
- // finally look for xjc classes
-
- Set<String> classNames = new HashSet<String>();
-
- classNames.add("com.sun.tools.xjc.XJCFacade"); //$NON-NLS-1$
- classNames.add("com.sun.xml.bind.Util"); //$NON-NLS-1$
-
- Iterable<IPath> libraryPaths =
- new TransformationIterable<IClasspathEntry, IPath>(jaxbConfig.resolve()) {
- @Override
- protected IPath transform(IClasspathEntry o) {
- return o.getPath();
- }
- };
-
- status = LibValUtil.validate(libraryPaths, classNames);
-
- if (! status.isOK()) {
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, JptCommonEclipseLinkCoreMessages.ELJaxbUserLibraryValidator_noXjcClasses);
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.java
deleted file mode 100644
index 305d19ea16..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlInverseReferenceAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlInverseReferenceAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlInverseReferenceAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlInverseReferenceAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlInverseReferenceAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlInverseReferenceAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlInverseReferenceAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.java
deleted file mode 100644
index a8e219f317..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlTransformationAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlTransformationAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlTransformationAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTransformationAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTransformationAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTransformationAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTransformationAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java
deleted file mode 100644
index b92cc05254..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-
-
-public class BinaryXmlInverseReferenceAnnotation
- extends BinaryAnnotation
- implements XmlInverseReferenceAnnotation {
-
- private String mappedBy;
-
-
- public BinaryXmlInverseReferenceAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.mappedBy = buildMappedBy();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- @Override
- public void update() {
- super.update();
- setMappedBy_(buildMappedBy());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.mappedBy);
- }
-
-
- // ***** mappedBy
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- throw new UnsupportedOperationException();
- }
-
- private void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- private String buildMappedBy() {
- return (String) this.getJdtMemberValue(ELJaxb.XML_INVERSE_REFERENCE__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java
deleted file mode 100644
index 7b9d0e60f4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class BinaryXmlTransformationAnnotation
- extends BinaryAnnotation
- implements XmlTransformationAnnotation {
-
- private Boolean optional;
-
-
- public BinaryXmlTransformationAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = buildOptional();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- @Override
- public void update() {
- super.update();
- setOptional_(buildOptional());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.optional);
- }
-
-
- // ***** optional
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- throw new UnsupportedOperationException();
- }
-
- private void setOptional_(Boolean optional) {
- Boolean old = this.optional;
- this.optional = optional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional);
- }
-
- private Boolean buildOptional() {
- return (Boolean) this.getJdtMemberValue(ELJaxb.XML_TRANSFORMATION__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java
deleted file mode 100644
index 35f34eaacb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-
-
-public class SourceXmlInverseReferenceAnnotation
- extends SourceAnnotation
- implements XmlInverseReferenceAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_INVERSE_REFERENCE);
-
- private final DeclarationAnnotationElementAdapter<String> mappedByDeclarationAdapter;
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
-
- public SourceXmlInverseReferenceAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlInverseReferenceAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.mappedByDeclarationAdapter = buildMappedByDeclarationAdapter(daa);
- this.mappedByAdapter = buildMappedByAdapter(this.mappedByDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildMappedByDeclarationAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(daa, ELJaxb.XML_INVERSE_REFERENCE__MAPPED_BY, StringExpressionConverter.instance());
- }
-
- private AnnotationElementAdapter<String> buildMappedByAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.mappedBy = buildMappedBy(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncMappedBy(buildMappedBy(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.mappedBy);
- }
-
-
- // ********** mappedBy
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (attributeValueHasChanged(this.mappedBy, mappedBy)) {
- this.mappedBy = mappedBy;
- this.mappedByAdapter.setValue(mappedBy);
- }
- }
-
- private void syncMappedBy(String astMappedBy) {
- String old = this.mappedBy;
- this.mappedBy = astMappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, this.mappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.mappedByDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java
deleted file mode 100644
index 3cdb791d02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class SourceXmlTransformationAnnotation
- extends SourceAnnotation
- implements XmlTransformationAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_TRANSFORMATION);
-
- private final DeclarationAnnotationElementAdapter<Boolean> optionalDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
-
- public SourceXmlTransformationAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlTransformationAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.optionalDeclarationAdapter = buildOptionalDeclarationAdapter(daa);
- this.optionalAdapter = buildShortCircuitBooleanElementAdapter(this.optionalDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<Boolean> buildOptionalDeclarationAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, ELJaxb.XML_TRANSFORMATION__OPTIONAL);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = buildOptional(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncOptional(buildOptional(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.optional);
- }
-
-
- // ********** optional
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- if (attributeValueHasChanged(this.optional, optional)) {
- this.optional = optional;
- this.optionalAdapter.setValue(optional);
- }
- }
-
- private void syncOptional(Boolean astOptional) {
- Boolean old = this.optional;
- this.optional = astOptional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, this.optional);
- }
-
- private Boolean buildOptional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.optionalDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java
deleted file mode 100644
index ec3de10173..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbFactory;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.ELJaxbContextRoot;
-
-
-public class ELJaxb_2_1_Factory
- extends AbstractJaxbFactory {
-
- // singleton
- private static final JaxbFactory INSTANCE = new ELJaxb_2_1_Factory();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbFactory instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private ELJaxb_2_1_Factory() {
- super();
- }
-
-
- @Override
- public JaxbContextRoot buildContextRoot(JaxbProject parent) {
- return new ELJaxbContextRoot(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java
deleted file mode 100644
index e0edbf94ba..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.AbstractELJaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlInverseReferenceMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlInverseReferenceAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlTransformationAnnotationDefinition;
-
-
-public class ELJaxb_2_1_PlatformDefinition
- extends AbstractELJaxbPlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new ELJaxb_2_1_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected ELJaxb_2_1_PlatformDefinition() {
- super();
- }
-
-
- @Override
- protected JaxbPlatformDefinition getGenericJaxbPlatformDefinition() {
- return GenericJaxb_2_1_PlatformDefinition.instance();
- }
-
- public JaxbPlatformDescription getDescription() {
- return ELJaxbPlatform.VERSION_2_1;
- }
-
- public JaxbFactory getFactory() {
- return ELJaxb_2_1_Factory.instance();
- }
-
- @Override
- protected JaxbResourceModelProvider[] buildResourceModelProviders() {
- return ArrayTools.array(
- getGenericJaxbPlatformDefinition().getResourceModelProviders(),
- new JaxbResourceModelProvider[0]);
-
- }
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- return getGenericJaxbPlatformDefinition().getMostRecentSupportedResourceType(contentType);
- }
-
- @Override
- protected AnnotationDefinition[] buildAnnotationDefinitions() {
- return ArrayTools.addAll(
- getGenericJaxbPlatformDefinition().getAnnotationDefinitions(),
- XmlInverseReferenceAnnotationDefinition.instance(),
- XmlTransformationAnnotationDefinition.instance());
- }
-
- @Override
- protected NestableAnnotationDefinition[] buildNestableAnnotationDefinitions() {
- return getGenericJaxbPlatformDefinition().getNestableAnnotationDefinitions();
- }
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(
- ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, getGenericJaxbPlatformDefinition().getDefaultJavaAttributeMappingDefinitions());
- }
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(
- ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, getGenericJaxbPlatformDefinition().getSpecifiedJavaAttributeMappingDefinitions());
- CollectionTools.addAll(definitions, ELJavaXmlInverseReferenceMappingDefinition.instance());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java
deleted file mode 100644
index 61bc504659..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class ELJaxb_2_1_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return ELJaxb_2_1_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java
deleted file mode 100644
index 16d15f20fc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlTransformationMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_Factory;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_PlatformDefinition;
-
-
-public class ELJaxb_2_2_PlatformDefinition
- extends ELJaxb_2_1_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new ELJaxb_2_2_PlatformDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected ELJaxb_2_2_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- @Override
- public JaxbFactory getFactory() {
- return ELJaxb_2_1_Factory.instance();
- }
-
- @Override
- protected JaxbPlatformDefinition getGenericJaxbPlatformDefinition() {
- return GenericJaxb_2_2_PlatformDefinition.instance();
- }
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(
- ArrayList<JavaAttributeMappingDefinition> definitions) {
- super.addSpecifiedJavaAttributeMappingDefinitionsTo(definitions);
- CollectionTools.addAll(definitions, ELJavaXmlTransformationMappingDefinition.instance());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java
deleted file mode 100644
index d1844d766b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class ELJaxb_2_2_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return ELJaxb_2_2_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java
deleted file mode 100644
index 1a9faca9c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_Factory;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-
-
-public class ELJaxb_2_3_PlatformDefinition
- extends ELJaxb_2_2_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new ELJaxb_2_3_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected ELJaxb_2_3_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return ELJaxbPlatform.VERSION_2_3;
- }
-
- @Override
- public JaxbFactory getFactory() {
- return ELJaxb_2_1_Factory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java
deleted file mode 100644
index 9dfc64c4e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class ELJaxb_2_3_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return ELJaxb_2_3_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java
deleted file mode 100644
index 839c0fb38b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.validation;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.eclipselink.core.JptJaxbEclipseLinkCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class ELJaxbValidationMessageBuilder {
-
- private static String[] DEFAULT_PARMS = new String[0];
- private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
-
- public static IMessage buildMessage(
- int severity, String messageId, Object targetObject) {
- return buildMessage(severity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, String[] parms, Object targetObject) {
- return buildMessage(severity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, Object targetObject, TextRange textRange) {
- return buildMessage(severity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, String[] parms, Object targetObject, TextRange textRange) {
- IMessage message = new ELJaxbValidationMessage(ELJaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID); //TODO do we need an 'EclipseLink' problem marker?
- if (textRange == null) {
- //log an exception and then continue without setting location information
- //At least the user will still get the validation message and will
- //be able to see other validation messages with valid textRanges
- JptJaxbEclipseLinkCorePlugin.log(new IllegalArgumentException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
- }
- else {
- message.setLineNo(textRange.getLineNumber());
- message.setOffset(textRange.getOffset());
- message.setLength(textRange.getLength());
- }
- return message;
- }
-
-
- private ELJaxbValidationMessageBuilder() {
- super();
- throw new UnsupportedOperationException();
- }
-
- /**
- * Used so that we can find the resource bundle using this classLoader.
- * Otherwise the wst validation message attempts to use the ClassLoader
- * of the generic jaxb validator which is in the org.eclipse.jpt.jaxb.core plugin.
- */
- private static class ELJaxbValidationMessage
- extends Message {
-
- public ELJaxbValidationMessage(String aBundleName, int aSeverity, String anId, String[] aParams, Object aTargetObject) {
- super(aBundleName, aSeverity, anId, aParams, aTargetObject);
- }
-
- @Override
- public ResourceBundle getBundle(Locale locale, ClassLoader classLoader) {
- ResourceBundle bundle = null;
- try {
- bundle = ResourceBundle.getBundle(getBundleName(), locale, getClass().getClassLoader());
- } catch (MissingResourceException e) {
- return super.getBundle(locale, classLoader);
- }
- return bundle;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java
deleted file mode 100644
index 51a0d4addc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.validation;
-
-@SuppressWarnings("nls")
-public interface ELJaxbValidationMessages {
-
- // bundle name
- String BUNDLE_NAME = "el_jaxb_validation";
-
-
- // validation on project
- String PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY = "PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.java
deleted file mode 100644
index 74b85352aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-/**
- * EclipseLink JAXB Java-related stuff (annotations etc.)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-@SuppressWarnings("nls")
-public interface ELJaxb {
-
- // EclipseLink annotations package
-
- String PACKAGE = "org.eclipse.persistence.oxm.annotations";
- String PACKAGE_ = PACKAGE + '.';
-
-
- // Annotations
-
- String XML_INVERSE_REFERENCE = PACKAGE_ + "XmlInverseReference";
- String XML_INVERSE_REFERENCE__MAPPED_BY = "mappedBy";
-
- String XML_TRANSFORMATION = PACKAGE_ + "XmlTransformation";
- String XML_TRANSFORMATION__OPTIONAL = "optional";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java
deleted file mode 100644
index a53de2e2cb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-
-public interface XmlInverseReferenceAnnotation
- extends Annotation {
-
- /**
- * String associated with change events to the 'mappedBy' property
- */
- String MAPPED_BY_PROPERTY = "mappedBy"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'mappedBy' element of the XmlInverseReference annotation.
- * Return null if the element does not exist in Java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the 'mappedBy' element of the XmlInverseReference annotation.
- * Set to null to remove the element.
- */
- void setMappedBy(String mappedBy);
-
- /**
- * Return the text range associated with the 'mappedBy' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getMappedByTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java
deleted file mode 100644
index df7071765e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlTransformation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlTransformationAnnotation
- extends Annotation {
-
- /**
- * String associated with change events to the 'optional' property
- */
- String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'optional' element of the XmlTransformation annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the 'optional' element of the XmlTransformation annotation.
- * Set to null to remove the element.
- */
- void setOptional(Boolean optional);
-
- /**
- * Return the text range associated with the 'optional' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getOptionalTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath
deleted file mode 100644
index 783ee1e9ed..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project
deleted file mode 100644
index d5a24d6f79..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ca38fa9a1c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:04 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 37a68afd9f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.ui;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jaxb.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.swt;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.ui.workbench;bundle-version="[3.7.0,4.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.ui,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties
deleted file mode 100644
index 08bc038360..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- icons/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif
deleted file mode 100644
index ce55b84284..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif
deleted file mode 100644
index fecf9e54c3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties
deleted file mode 100644
index 0720b7bd33..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - EclipseLink MOXy Support - UI
-providerName=Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml
deleted file mode 100644
index e833f512f0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.jpt.jaxb.ui.jaxbPlatformUis">
-
- <jaxbPlatformUi
- id="eclipselink_2_1.ui"
- jaxbPlatform="eclipselink_2_1"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1.ELJaxb_2_1_PlatformUi"/>
-
- <jaxbPlatformUi
- id="eclipselink_2_2.ui"
- jaxbPlatform="eclipselink_2_2"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2.ELJaxb_2_2_PlatformUi"/>
-
- <jaxbPlatformUi
- id="eclipselink_2_3.ui"
- jaxbPlatform="eclipselink_2_3"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3.ELJaxb_2_3_PlatformUi"/>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java
deleted file mode 100644
index 39e81583dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.ui;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- private static BundleContext context;
-
- static BundleContext getContext() {
- return context;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java
deleted file mode 100644
index 23b5d76ee8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptJaxbEclipseLinkUiPlugin
- extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.eclipselink.ui";
-
-
- // ********** singleton **********
-
- private static JptJaxbEclipseLinkUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptJaxbEclipseLinkUiPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** error logging **********
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** Image API **********
-
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- // ********** constructors **********
-
- public JptJaxbEclipseLinkUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
deleted file mode 100644
index 91fa343855..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-
-public class ELJaxbMappingImageHelper {
-
- public static Image imageForAttributeMapping(String mappingKey) {
- String iconKey = iconKeyForAttributeMapping(mappingKey);
- return (iconKey == null) ?
- JaxbMappingImageHelper.imageForAttributeMapping(mappingKey)
- : JptJaxbEclipseLinkUiPlugin.getImage(iconKey);
- }
-
- public static String iconKeyForAttributeMapping(String mappingKey) {
- if (ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbEclipseLinkUiIcons.XML_INVERSE_REFERENCE;
- }
- else if (ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbEclipseLinkUiIcons.XML_TRANSFORMATION;
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java
deleted file mode 100644
index 547c390161..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorItemLabelProviderFactory;
-
-
-public class ELJaxbNavigatorItemLabelProviderFactory
- extends GenericJaxb_2_1_NavigatorItemLabelProviderFactory {
-
- private static ELJaxbNavigatorItemLabelProviderFactory INSTANCE = new ELJaxbNavigatorItemLabelProviderFactory();
-
-
- public static GenericJaxb_2_1_NavigatorItemLabelProviderFactory instance() {
- return INSTANCE;
- }
-
-
- private ELJaxbNavigatorItemLabelProviderFactory() {
- super();
- }
-
-
- @Override
- public ItemLabelProvider buildItemLabelProvider(
- Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider) {
-
- if (item instanceof JaxbPersistentAttribute) {
- return new ELJaxbPersistentAttributeItemLabelProvider((JaxbPersistentAttribute) item, contentAndLabelProvider);
- }
-
- return super.buildItemLabelProvider(item, contentAndLabelProvider);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java
deleted file mode 100644
index e8a1573b48..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorUi;
-
-
-public class ELJaxbNavigatorUi
- extends GenericJaxb_2_1_NavigatorUi {
-
- private static ELJaxbNavigatorUi INSTANCE = new ELJaxbNavigatorUi();
-
-
- public static ELJaxbNavigatorUi instance() {
- return INSTANCE;
- }
-
-
- private ELJaxbNavigatorUi() {
- super();
- }
-
-
- @Override
- public ItemLabelProviderFactory getItemLabelProviderFactory() {
- return ELJaxbNavigatorItemLabelProviderFactory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java
deleted file mode 100644
index 00999326b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.JaxbPersistentAttributeItemLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-
-public class ELJaxbPersistentAttributeItemLabelProvider
- extends JaxbPersistentAttributeItemLabelProvider {
-
- public ELJaxbPersistentAttributeItemLabelProvider(
- JaxbPersistentAttribute attribute, DelegatingContentAndLabelProvider labelProvider) {
- super(attribute, labelProvider);
- }
-
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
-
- return new PropertyAspectAdapter<JaxbPersistentAttribute, Image>(
- new String[] {JaxbPersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY, JaxbPersistentAttribute.MAPPING_PROPERTY},
- getModel()) {
-
- @Override
- protected Image buildValue_() {
- return ELJaxbMappingImageHelper.imageForAttributeMapping(this.subject.getMappingKey());
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java
deleted file mode 100644
index 148333842e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-
-public class JptJaxbEclipseLinkUiIcons {
-
- public static final String XML_INVERSE_REFERENCE = "full/obj16/xml-inverse-reference";
- public static final String XML_TRANSFORMATION = "full/obj16/xml-transformation";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java
deleted file mode 100644
index cdaa30c23f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1;
-
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class ELJaxb_2_1_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return GenericJaxb_2_1_NavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java
deleted file mode 100644
index 2737982fd4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2;
-
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class ELJaxb_2_2_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return ELJaxbNavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java
deleted file mode 100644
index dbc9c4f31e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3;
-
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class ELJaxb_2_3_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return ELJaxbNavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath
deleted file mode 100644
index 934fb38085..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project
deleted file mode 100644
index 67371280df..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 38cf57c08a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:10 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index bc7feec391..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,51 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.ui;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jaxb.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.jst.common.project.facet.ui;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.2.100,2.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.500,2.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
- org.eclipse.wst.web.ui;bundle-version="[1.1.400,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,2.0.0)",
- org.eclipse.wst.xsd.core;bundle-version="[1.1.600,2.0.0)",
- org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.jaxb.ui.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.actions;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.filters;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.jaxb21;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.jaxb22;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.navigator;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.platform;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.properties;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.facet;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.proj;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.proj.model;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.navigator,
- org.eclipse.jpt.jaxb.ui.platform
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
deleted file mode 100644
index 0a95eca8b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- icons/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = schema/
- \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml
deleted file mode 100644
index 04957fe9b2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jaxb.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif
deleted file mode 100644
index b6efdd3d86..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif
deleted file mode 100644
index e75a17c2d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif
deleted file mode 100644
index b547717598..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif
deleted file mode 100644
index a1c6545cd6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif
deleted file mode 100644
index cc0eeb7196..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif
deleted file mode 100644
index 3c0acadd2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif
deleted file mode 100644
index d4cb4254d9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gif
deleted file mode 100644
index baac236770..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif
deleted file mode 100644
index e75a17c2d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif
deleted file mode 100644
index c73ed28e70..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif
deleted file mode 100644
index 719e6057b3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif
deleted file mode 100644
index 066461be61..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico
deleted file mode 100644
index 126f3e5c81..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif
deleted file mode 100644
index b634fb535f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico
deleted file mode 100644
index 6c3cceb0c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif
deleted file mode 100644
index 70a9c23541..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif
deleted file mode 100644
index 6989b8df73..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif
deleted file mode 100644
index d4cb4254d9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif
deleted file mode 100644
index 7d24707ee8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif
deleted file mode 100644
index a5d9fb0dd6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif
deleted file mode 100644
index f73d02bf43..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif
deleted file mode 100644
index 851ee72391..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif
deleted file mode 100644
index 3220052c41..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif
deleted file mode 100644
index 77e4d6a8bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif
deleted file mode 100644
index 8c953dc928..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gif
deleted file mode 100644
index cb6aad6b16..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif
deleted file mode 100644
index 3fd90cf828..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif
deleted file mode 100644
index 7145d6de8e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif
deleted file mode 100644
index 390f48216a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif
deleted file mode 100644
index d1873a1a51..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif
deleted file mode 100644
index 0ac0ee8635..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties
deleted file mode 100644
index 704b484070..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties
+++ /dev/null
@@ -1,45 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - JAXB UI
-providerName=Eclipse Web Tools Platform
-
-jaxbPlatformUi = JAXB Platform UI
-
-jaxbWizardCategoryName = JAXB
-
-generateSchemaFromClassesName = Schema from JAXB Classes
-generateSchemaFromClassesDesc = Generate a Schema from JAXB classes
-
-generateClassesFromSchemaName = JAXB Classes from Schema
-generateClassesFromSchemaDesc = Generate JAXB Classes from a Schema
-
-newJaxbProjectWizardName = JAXB Project
-newJaxbProjectWizardDesc = Create a JAXB project
-
-jaxbCompletionProposals = JAXB Proposals
-jaxbCompletionProposalComputer = JAXB Proposal Computer
-
-jaxbNavigatorContent=JAXB Content
-generateJaxbClasses = JAXB Classes...
-
-jaxbNode = JAXB
-jaxbSchemas = Schemas
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
deleted file mode 100644
index 65970846fd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
+++ /dev/null
@@ -1,301 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?> <!--
- Copyright (c) 2010, 2011 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension-point
- id="jaxbPlatformUis"
- name="%jaxbPlatformUi"
- schema="schema/jaxbPlatformUis.exsd"/>
-
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.jaxb"
- name="%jaxbWizardCategoryName"/>
-
- <wizard
- id="org.eclipse.jpt.jaxb.ui.wizard.generateSchemaFromClasses"
- name="%generateSchemaFromClassesName"
- category="org.eclipse.jpt.jaxb"
- class="org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen.SchemaGeneratorWizard"
- icon="icons/full/etool16/NewXSD.gif">
- <description>%generateSchemaFromClassesDesc</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
-
- <wizard
- id="org.eclipse.jpt.jaxb.ui.wizard.generateJAXBClasses"
- name="%generateClassesFromSchemaName"
- category="org.eclipse.jpt.jaxb"
- class="org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard"
- icon="icons/full/etool16/newclass_wiz.gif">
- <description>%generateClassesFromSchemaDesc</description>
- </wizard>
-
- <!-- will need to specify a final perspective once we have a jaxb perspective -->
- <wizard
- id="org.eclipse.jpt.jaxb.ui.wizard.newJaxbProject"
- name="%newJaxbProjectWizardName"
- icon="icons/full/etool16/new_jaxb_project_wiz.gif"
- category="org.eclipse.jpt.jaxb"
- project="true">
- <description>%newJaxbProjectWizardDesc</description>
- <class class="org.eclipse.jpt.jaxb.ui.internal.wizards.proj.JaxbProjectWizard">
- <parameter name="menuIndex" value="35"/>
- </class>
- </wizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="jaxbCompletionProposals"
- name="%jaxbCompletionProposals">
-
- <proposalCategory icon="icons/full/etool16/jaxb_facet.gif"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="jaxbCompletionProposalComputer"
- name="%jaxbCompletionProposalComputer">
-
- <javaCompletionProposalComputer
- class="org.eclipse.jpt.jaxb.ui.internal.JaxbJavaCompletionProposalComputer"
- categoryId="org.eclipse.jpt.jaxb.ui.jaxbCompletionProposals"
- activate="true">
- <partition type="__dftl_partition_content_type"/>
- <partition type="__java_string"/>
- </javaCompletionProposalComputer>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.jaxb.ui.jaxbPlatformUis">
-
- <jaxbPlatformUi
- id="generic_2_1.ui"
- jaxbPlatform="generic_2_1"
- class="org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_PlatformUi"/>
-
- <jaxbPlatformUi
- id="generic_2_2.ui"
- jaxbPlatform="generic_2_2"
- class="org.eclipse.jpt.jaxb.ui.internal.jaxb22.GenericJaxb_2_2_PlatformUi"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.ui.libraryProviderActionPanels">
-
- <panel
- provider="jaxb-jre-library-provider"
- class="org.eclipse.jst.common.project.facet.ui.libprov.SimpleMessageLibraryProviderInstallPanel"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
-
- <navigatorContent
- id="org.eclipse.jpt.jaxb.ui.jaxbNavigatorContent"
- name="%jaxbNavigatorContent"
- priority="higher"
- appearsBefore="org.eclipse.jst.servlet.ui.EnhancedJavaRendering"
- icon="icons/full/obj16/jaxb_content.gif"
- activeByDefault="true"
- contentProvider="org.eclipse.jpt.jaxb.ui.internal.navigator.JaxbNavigatorContentProvider"
- labelProvider="org.eclipse.jpt.jaxb.ui.internal.navigator.JaxbNavigatorLabelProvider">
-
- <triggerPoints>
- <or>
- <instanceof
- value="org.eclipse.jpt.jaxb.core.context.JaxbContextNode"/>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" />
- </adapt>
- </and>
- </or>
- </triggerPoints>x
-
- <possibleChildren>
- <instanceof
- value="org.eclipse.jpt.jaxb.core.context.JaxbContextNode"/>
- </possibleChildren>
-
- <actionProvider
- class="org.eclipse.jpt.jaxb.ui.internal.navigator.JaxbNavigatorActionProvider"
- id="org.eclipse.jpt.jaxb.ui.jaxbActionProvider">
- <enablement>
- <and>
- <instanceof
- value="org.eclipse.jpt.jaxb.core.context.JaxbContextNode"/>
- </and>
- </enablement>
- </actionProvider>
-
- <!--
- <commonSorter
- id="org.eclipse.jst.j2ee.navigator.internal.J2EEViewerSorter"
- class="org.eclipse.jst.j2ee.navigator.internal.J2EEViewerSorter" />
- -->
-
- </navigatorContent>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.viewer">
-
- <viewerContentBinding
- viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension pattern="org.eclipse.jpt.jaxb.ui.*"/>
- </includes>
- </viewerContentBinding>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <!-- contributions to the "Generate" submenu -->
- <objectContribution
- id="org.eclipse.jpt.jpa.ui.xsdFileActions"
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xsd">
- <filter
- name="projectNature"
- value="org.eclipse.jdt.core.javanature">
- </filter>
- <action
- id="org.eclipse.jpt.jaxb.ui.generateJaxbClasses"
- label="%generateJaxbClasses"
- menubarPath="generateMenuId/GenerateXML"
- class="org.eclipse.jpt.jaxb.ui.internal.actions.GenerateClassesAction">
- </action>
- </objectContribution>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.preferencePages">
-
- <!-- no actual preferences yet
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbPreferences"
- category="org.eclipse.jpt.jpa.ui.preferences"
- class="org.eclipse.jpt.jaxb.ui.internal.preferences.JaxbPreferencesPage"
- name="%jaxbNode"/>
- -->
-
- <!--
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbProblemSeveritiesPreferences"
- category="org.eclipse.jpt.jaxb.ui.jaxbPreferences"
- class="org.eclipse.jpt.jaxb.ui.internal.preferences.JaxbProblemSeveritiesPage"
- name="%jaxbProblemSeveritiesNode">
- </page>
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.propertyPages">
-
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbProjectProperties"
- name="%jaxbNode"
- class="org.eclipse.jpt.jaxb.ui.internal.properties.JaxbProjectPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"/>
- </adapt>
- </enabledWhen>
- </page>
-
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbSchemasProperties"
- name="%jaxbSchemas"
- category="org.eclipse.jpt.jaxb.ui.jaxbProjectProperties"
- class="org.eclipse.jpt.jaxb.ui.internal.properties.JaxbSchemasPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"/>
- </adapt>
- </enabledWhen>
- </page>
-
- <!--
- <page
- id="org.eclipse.jpt.jpa.ui.jaxbProblemSeveritiesProperties"
- name="%jaxbProblemSeveritiesNode"
- category="org.eclipse.jpt.jaxb.ui.jaxbProjectProperties"
- class="org.eclipse.jpt.jaxb.ui.internal.preferences.JaxbProblemSeveritiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"/>
- </adapt>
- </enabledWhen>
- </page>
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.images">
-
- <image facet="jpt.jaxb" path="icons/full/etool16/jaxb_facet.gif"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.wizardPages">
-
- <wizard-pages action="jpt.jaxb.install">
- <page class="org.eclipse.jpt.jaxb.ui.internal.wizards.facet.JaxbFacetInstallPage"/>
- </wizard-pages>
-
- <wizard-pages action="jpt.jaxb.version-change">
- <page class="org.eclipse.jpt.jaxb.ui.internal.wizards.facet.JaxbFacetVersionChangePage"/>
- </wizard-pages>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties
deleted file mode 100644
index 4f9963daf7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties
+++ /dev/null
@@ -1,173 +0,0 @@
-################################################################################
-# Copyright (c) 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-JavaProjectWizardPage_project = Project:
-JavaProjectWizardPage_destinationProject = Select destination project:
-
-# ClassesGenerator
-ClassesGeneratorProjectWizardPage_title = Java Project
-ClassesGeneratorProjectWizardPage_desc = Specify project for the new classes.
-
-ClassesGeneratorWizard_title = New JAXB Classes from schema
-
-ClassesGeneratorWizard_errorDialogTitle = Generate Classes Failed
-ClassesGeneratorWizard_couldNotCreate = Could not create {0}
-
-Error_openingEditor=Error Opening Editor
-
-JaxbContent_label=JAXB Content
-
-SchemasPage_description = Configure JAXB schemas used for validation and content assist
-SchemasPage_revert = &Revert
-SchemasPage_schemas = &Schema namespaces and locations:
-SchemasPage_namespaceColumnLabel = Namespace
-SchemasPage_locationColumnLabel = Location
-SchemasPage_addButtonLabel = &Add ...
-SchemasPage_editButtonLabel = &Edit ...
-SchemasPage_removeButtonLabel = Re&move
-SchemasPage_addSchemaMessage = Enter a new schema namespace and the location where it can be found.
-SchemasPage_editSchemaMessage = Edit an existing schema namespace and the location where it can be found.
-SchemasPage_addSchemaDialogTitle = Add Schema Location
-SchemasPage_editSchemaDialogTitle = Edit Schema Location
-SchemasPage_addSchemaTitle = Add a new schema location
-SchemasPage_editSchemaTitle = Edit an existing schema location
-SchemasPage_locationLabel = &Location:
-SchemasPage_browseButtonLabel = &Browse ...
-SchemasPage_namespaceLabel = &Namespace:
-SchemasPage_noNamespaceText = <no namespace>
-SchemasPage_schemaUnresolvedMessage = Could not resolve chosen schema location.
-SchemasPage_duplicateNamespaceMessage = That namespace is already in use.
-SchemasPage_noLocationMessage = You must specify a location.
-SchemasPage_chooseLocationTitle = Select Schema Location
-
-SchemaWizardPage_title = Select Schema
-SchemaWizardPage_desc = Specify schema to generate the classes from
-
-SchemaWizardPage_xmlCatalogTableTitle = XML Catalog
-SchemaWizardPage_xmlCatalogKeyColumn = Key
-SchemaWizardPage_xmlCatalogUriColumn = URI
-
-SchemaWizardPage_errorUriCannotBeLocated = The selected catalog entry specifies a URI that can not be located.
-
-SelectFileOrXMLCatalogIdPanel_fileFromWorkspace = Select file from Work&space
-SelectFileOrXMLCatalogIdPanel_xmlCatalogEntry = Select XML Catalo&g entry
-SelectFileOrXMLCatalogIdPanel_importButton = &Import Files...
-
-ClassesGeneratorWizardPage_title = Generate Classes from Schema: {0}
-ClassesGeneratorWizardPage_desc = Configure JAXB class generation.
-
-ClassesGeneratorWizardPage_usesMoxyImplementation = Use EclipseLink MO&Xy as the JAXB implementation
-
-ClassesGeneratorWizardPage_catalog = Catalo&g:
-ClassesGeneratorWizardPage_bindingsFiles = B&indings files:
-ClassesGeneratorWizardPage_browseButton = Brow&se...
-ClassesGeneratorWizardPage_addButton = &Add...
-ClassesGeneratorWizardPage_removeButton = Re&move
-ClassesGeneratorWizardPage_chooseABindingsFile = External Bindings File Selection
-ClassesGeneratorWizardPage_chooseACatalog = Catalog File Selection
-
-ClassesGeneratorWizardPage_sourceFolderSelectionDialog_title = Source Folder Selection
-ClassesGeneratorWizardPage_chooseSourceFolderDialog_desc = &Choose a source folder:
-
-ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with class generation.\
- \nPlease insure that a JAXB implementation is available on the classpath.
-
-ClassesGeneratorWizardPage_moxyLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with class generation.\
- \nPlease insure that EclipseLink MOXy is available on the classpath.
-
-ClassesGeneratorOptionsWizardPage_title = Classes Generator Options
-ClassesGeneratorOptionsWizardPage_desc = Configure JAXB compiler options.
-
-ClassesGeneratorOptionsWizardPage_proxyGroup = Proxy
-ClassesGeneratorOptionsWizardPage_noProxy = N&o proxy
-ClassesGeneratorOptionsWizardPage_proxy = &Proxy:
-ClassesGeneratorOptionsWizardPage_proxyFile = Prox&y file:
-ClassesGeneratorOptionsWizardPage_chooseAProxyFile = Proxy File Selection
-
-ClassesGeneratorOptionsWizardPage_useStrictValidation = Use strict v&alidation
-ClassesGeneratorOptionsWizardPage_makeReadOnly = Generate &read-only files
-ClassesGeneratorOptionsWizardPage_suppressPackageInfoGen = Suppress pac&kage-info generation
-ClassesGeneratorOptionsWizardPage_suppressesHeaderGen = Suppress generation of file &header
-ClassesGeneratorOptionsWizardPage_target = Target X&JC 2.0
-ClassesGeneratorOptionsWizardPage_verbose = &Verbose
-ClassesGeneratorOptionsWizardPage_quiet = Suppress compiler outp&ut
-
-ClassesGeneratorOptionsWizardPage_treatsAsXmlSchema = Treat input as &XML schema
-ClassesGeneratorOptionsWizardPage_treatsAsRelaxNg = Treat input as RELAX N&G
-ClassesGeneratorOptionsWizardPage_treatsAsRelaxNgCompact = Treat input as RELAX NG &compact syntax
-ClassesGeneratorOptionsWizardPage_treatsAsDtd = Treat input as XML D&TD
-ClassesGeneratorOptionsWizardPage_treatsAsWsdl = Treat input as WS&DL and compile schema inside it
-ClassesGeneratorOptionsWizardPage_showsVersion = Show vers&ion
-ClassesGeneratorOptionsWizardPage_showsHelp = Show h&elp
-
-ClassesGeneratorExtensionOptionsWizardPage_title = Classes Generator Extension Configuration
-ClassesGeneratorExtensionOptionsWizardPage_desc = Configure JAXB compiler vendor extensions.
-
-ClassesGeneratorExtensionOptionsWizardPage_allowExtensions = Allow vendor &extensions
-ClassesGeneratorExtensionOptionsWizardPage_classpath = Class&path:
-ClassesGeneratorExtensionOptionsWizardPage_additionalArguments = Additional ar&guments:
-
-ClassesGeneratorUi_generatingEntities = Generating JAXB Classes from Schema
-ClassesGeneratorUi_generatingEntitiesTask = Generating classes
-
-ClassesGeneratorUi_generatingClassesWarningTitle = Generating JAXB Classes
-ClassesGeneratorUi_generatingClassesWarningMessage = \
- Warning: Generating classes will overwrite existing files in your project.\
- \nAre you sure you want to continue?
-
-# SchemaGenerator
-SchemaGeneratorWizard_title = New JAXB Schema File
-
-SchemaGeneratorWizard_generatingSchema = Generating JAXB Schema
-
-SchemaGeneratorProjectWizardPage_title = JAXB schema file
-SchemaGeneratorProjectWizardPage_desc = Specify default file name and location
-
-SchemaGeneratorWizardPage_title = Generate Schema from Classes
-SchemaGeneratorWizardPage_desc = Select classes to include.
-
-SchemaGeneratorWizardPage_shemaLocation = Schema file:
-SchemaGeneratorWizardPage_shema = Schema name:
-SchemaGeneratorWizardPage_packages = Select classes to include in schema:
-SchemaGeneratorWizardPage_browse = Browse...
-
-SchemaGeneratorWizardPage_chooseSchemaDialogTitle = Select Schema File
-
-SchemaGeneratorWizardPage_errorNoSchema = Schema name cannot be empty
-SchemaGeneratorWizardPage_errorNoPackage = No classes included
-
-SchemaGeneratorWizardPage_jaxbLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with schema generation.\
- \nPlease insure that a JAXB implementation is available on the classpath.
-
-SchemaGeneratorWizardPage_moxyLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with schema generation.\
- \nPlease insure that EclipseLink MOXy is available on the classpath.
-
-SchemaGeneratorWizard_generateSchemaTask = Generating schema {0}
-
-#NewSchemaFileWizardPage
-
-NewSchemaFileWizardPage_errorNotJavaProject = Not a Java project
-NewSchemaFileWizardPage_overwriteExistingSchemas = Schema generation may overwrite existing schemas in the specified directory.
-
-
-JaxbProjectWizard_title = New JAXB Project
-
-JaxbProjectWizard_firstPage_title = JAXB Project
-JaxbProjectWizard_firstPage_desc = Configure JAXB project settings.
-
-JaxbFacetWizardPage_title = JAXB Facet
-JaxbFacetWizardPage_desc = Configure JAXB settings.
-JaxbFacetWizardPage_platformLabel = &Platform
-JaxbFacetWizardPage_facetsPageLink = <a>Change JAXB version ...</a>
-JaxbFacetWizardPage_jaxbImplementationLabel = JAXB implementation
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd
deleted file mode 100644
index dc152bc93b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.jaxb.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.jaxb.ui" id="jpaPlatforms" name="JAXB Platform UIs"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="jaxbPlatformUi" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jaxbPlatformUi">
- <annotation>
- <documentation>
- Extenders of the org.eclipse.jpt.jaxb.core.jaxbPlatforms extension point may also use this point to insert UI into the workbench for that platform. The jaxbPlatform must match the id of a jaxbPlatform extension.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jaxbPlatform" type="string" use="required">
- <annotation>
- <documentation>
- The jaxbPlatform must match a corresponding org.eclipse.jpt.jaxb.core.jaxbPlatform extension id.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The instantiable class that implements &lt;samp&gt;org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- Provisional API: This interface is part of an interim API that is still
-under development and expected to change significantly before reaching
-stability. It is available at this early stage to solicit feedback from
-pioneering adopters on the understanding that any code that uses this API
-will almost certainly be broken (repeatedly) as the API evolves.
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2010 Oracle. All rights reserved.
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0, which accompanies this distribution
-and is available at http://www.eclipse.org/legal/epl-v10.html.
-
-Contributors:
-Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java
deleted file mode 100644
index 824a4d7507..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jpt.jaxb.ui.internal.platform.JaxbPlatformUiManagerImpl;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUiManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptJaxbUiPlugin extends AbstractUIPlugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.ui";
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- public static final String USER_CATALOG_ID = XMLCorePlugin.USER_CATALOG_ID; //$NON-NLS-1$
- public static final String DEFAULT_CATALOG_ID = XMLCorePlugin.DEFAULT_CATALOG_ID; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_ID = XMLCorePlugin.SYSTEM_CATALOG_ID; //$NON-NLS-1$
-
- // ********** singleton **********
- private static JptJaxbUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptJaxbUiPlugin instance() {
- return INSTANCE;
- }
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
- // ********** Image API **********
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- public static JaxbPlatformUiManager getJaxbPlatformUiManager() {
- return JaxbPlatformUiManagerImpl.instance();
- }
-
-
- // ********** XMLCorePlugin API **********
-
- public ICatalog getDefaultXMLCatalog() {
- return XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- }
-
- // ********** constructors **********
- public JptJaxbUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
deleted file mode 100644
index dea60c6798..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.ui.internal.dialogs.OptionalMessageDialog;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorExtensionOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.GenerateJaxbClassesJob;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * ClassesGeneratorUi
- */
-public class ClassesGeneratorUi {
-
- private final IJavaProject javaProject;
- private final IFile xsdFile;
-
- // ********** static methods **********
-
- public static void generate(IFile xsdFile) {
- IJavaProject javaProject = JavaCore.create(xsdFile.getProject());
- if (javaProject == null) {
- throw new NullPointerException();
- }
-
- new ClassesGeneratorUi(javaProject, xsdFile).generate();
- }
-
- // ********** constructors **********
- private ClassesGeneratorUi(IJavaProject javaProject, IFile xsdFile) {
- super();
- if (javaProject == null) {
- throw new NullPointerException();
- }
- this.javaProject = javaProject;
- this.xsdFile = xsdFile;
- }
-
- // ********** generate **********
- /**
- * prompt the user with a wizard
- */
- protected void generate() {
- ClassesGeneratorWizard wizard = new ClassesGeneratorWizard(this.javaProject, this.xsdFile);
- wizard.setWindowTitle(JptJaxbUiMessages.ClassesGeneratorWizard_title);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode != Window.OK) {
- return;
- }
-
- if(this.displayOverwritingClassesWarning(wizard.getGeneratorOptions())) {
- this.generateJaxbClasses(
- wizard.getLocalSchemaUri(),
- wizard.getDestinationFolder(),
- wizard.getTargetPackage(),
- wizard.getCatalog(),
- wizard.usesMoxy(),
- wizard.getBindingsFileNames(),
- wizard.getGeneratorOptions(),
- wizard.getGeneratorExtensionOptions());
- addSchemaToLibrary(wizard.getSchemaLocation());
- }
- }
-
- // ********** internal methods **********
-
- private void generateJaxbClasses(
- URI schemaUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
-
- try {
- WorkspaceJob job = new GenerateJaxbClassesJob(
- this.javaProject,
- schemaUri.toString(),
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions);
- job.schedule();
- }
- catch(RuntimeException re) {
- JptJaxbUiPlugin.log(re);
-
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
- this.logError(message);
- }
- }
-
- private void addSchemaToLibrary(String schemaLocation) {
- JaxbProject jaxbProject = getJaxbProject();
-
- if (jaxbProject == null) {
- return;
- }
-
- String resolvedUri = XsdUtil.getResolvedUri(null, schemaLocation);
- XSDSchema schema = XSDImpl.buildXSDModel(resolvedUri);
- if (schema != null) {
- String schemaNamespace =
- ((schema.getTargetNamespace()) == null ?
- ""
- : schema.getTargetNamespace());
-
- SchemaLibrary schemaLib = jaxbProject.getSchemaLibrary();
- Map<String, String> schemas = new HashMap<String, String>(schemaLib.getSchemaLocations());
- schemas.put(schemaNamespace, schemaLocation);
- schemaLib.setSchemaLocations(schemas);
- }
- }
-
- private void logError(String message) {
- this.displayError(message);
- }
-
- private void displayError(String message) {
- MessageDialog.openError(
- this.getShell(),
- JptJaxbUiMessages.ClassesGeneratorWizard_errorDialogTitle,
- message
- );
- }
-
- private Shell getShell() {
- Display display = Display.getCurrent();
- Shell shell = (display == null) ? null : display.getActiveShell();
- if(shell == null && display != null) {
- Shell[] shells = display.getShells();
- if(shells.length > 0)
- shell = shells[0];
- }
- return shell;
- }
-
- /* may be null */
- private JaxbProject getJaxbProject() {
- return JptJaxbCorePlugin.getJaxbProject(this.javaProject.getProject());
- }
-
- private boolean isOverwritingClasses(ClassesGeneratorOptions generatorOptions) {
- if(generatorOptions == null) {
- throw new NullPointerException();
- }
- if(generatorOptions.showsVersion() || generatorOptions.showsHelp()) {
- return false;
- }
- return true;
- }
-
- private boolean displayOverwritingClassesWarning(ClassesGeneratorOptions generatorOptions) {
-
- if( ! this.isOverwritingClasses(generatorOptions)
- || !OptionalMessageDialog.isDialogEnabled(OverwriteConfirmerDialog.ID)) {
- return true;
- }else {
- OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.getShell());
- return dialog.open() == IDialogConstants.YES_ID;
- }
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- // ********** overwrite dialog **********
-
- static class OverwriteConfirmerDialog extends OptionalMessageDialog {
-
- private static final String ID= "dontShowOverwriteJaxbClassesFromSchemas.warning"; //$NON-NLS-1$
-
- OverwriteConfirmerDialog(Shell parent) {
- super(ID, parent,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningTitle,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningMessage,
- MessageDialog.WARNING,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 1);
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- }
-
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
deleted file mode 100644
index 9a8fb04f8e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.CompletionContext;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
-import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-
-
-public class JaxbJavaCompletionProposalComputer
- implements IJavaCompletionProposalComputer {
-
- public JaxbJavaCompletionProposalComputer() {
- super();
- }
-
-
- public void sessionStarted() {
- // do nothing
- }
-
- @SuppressWarnings("unchecked")
- public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return (context instanceof JavaContentAssistInvocationContext) ?
- computeCompletionProposals((JavaContentAssistInvocationContext) context)
- : Collections.emptyList();
- }
-
- /**
- * We fail silently here because (it seems) <em>expected</em> exceptions occur
- * more frequently than intermittent <em>unexpected</em> exceptions that might
- * merit investigation (and a logged stacktrace might be the only hint as
- * to what happened).
- * <p>
- * We will get an <em>expected</em> exception (typically a {@link NullPointerException NPE})
- * here if the user:<ol>
- * <li>modifies the Java source file in a way that puts it drastically out
- * of sync with the Dali context model (e.g. deleting a field or
- * annotation)
- * <li>immediately invokes Content Assist (typically <code>Ctrl+Space</code>)
- * </ol>
- * The AST we build here will be based on the just-modified Java source; but,
- * since the user moved quickly and we will not have yet received any Java
- * change notification (since we only get a Java change notification when
- * the user has paused typing for at least 0.5 seconds), the context model
- * will still be based on the unmodified Java source. As the new AST is
- * passed down through the context model to the resource model all the code
- * expects to find the AST in sync with the model. When this is not the
- * case (e.g. a field in the resource model is no longer present in the AST
- * because the user has deleted it or modified the code in such a way that
- * the parser can no longer detect the field) the model will probably choke
- * when it cannot find the corresponding AST node.
- * <p>
- * It seems reasonable, in these situations, to simply return no completion
- * proposals. If the user simply waits a moment and tries again, we will be
- * able to successfully calculate some proposals.
- * <p>
- * ~bjv
- */
- private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context) {
- try {
- return computeCompletionProposals_(context);
- }
- catch (Exception ex) {
- // JptJaxbCorePlugin.log(ex); // don't log "expected" exceptions (?)
- return Collections.emptyList();
- }
- }
-
- private List<ICompletionProposal> computeCompletionProposals_(JavaContentAssistInvocationContext context) {
- ICompilationUnit cu = context.getCompilationUnit();
- IFile file = (cu != null) ? getCorrespondingResource(cu) : null;
- IContentType contentType = (file != null) ? PlatformTools.getContentType(file) : null;
-
- if (contentType == null || ! contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return Collections.emptyList();
- }
-
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(file.getProject());
- if (jaxbProject == null) {
- return Collections.emptyList();
- }
-
- Iterable<? extends JavaContextNode> javaNodes = jaxbProject.getPrimaryJavaNodes(cu);
- if (CollectionTools.isEmpty(javaNodes)) {
- return Collections.emptyList();
- }
-
- CompletionContext cc = context.getCoreContext();
-
- // the context's "token" is really a sort of "prefix" - it does NOT
- // correspond to the "start" and "end" we get below...
- char[] prefix = cc.getToken();
- Filter<String> filter = ((prefix == null) ? Filter.Null.<String>instance() : new IgnoreCasePrefixFilter(prefix));
- // the token "start" is the offset of the token's first character
- int tokenStart = cc.getTokenStart();
- // the token "end" is the offset of the token's last character (yuk)
- int tokenEnd = cc.getTokenEnd();
- if (tokenStart == -1) { // not sure why this happens - see bug 242286
- return Collections.emptyList();
- }
-
-// System.out.println("prefix: " + ((prefix == null) ? "[null]" : new String(prefix)));
-// System.out.println("token start: " + tokenStart);
-// System.out.println("token end: " + tokenEnd);
-// String source = cu.getSource();
-// String token = source.substring(Math.max(0, tokenStart), Math.min(source.length(), tokenEnd + 1));
-// System.out.println("token: =>" + token + "<=");
-// String snippet = source.substring(Math.max(0, tokenStart - 20), Math.min(source.length(), tokenEnd + 21));
-// System.out.println("surrounding snippet: =>" + snippet + "<=");
-
- // TODO move this parser call into the model...
- CompilationUnit astRoot = ASTTools.buildASTRoot(cu);
- List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
- for (JavaContextNode javaNode : javaNodes) {
- for (String proposal : javaNode.getJavaCompletionProposals(context.getInvocationOffset(), filter, astRoot)) {
- proposals.add(new CompletionProposal(proposal, tokenStart, tokenEnd - tokenStart + 1, proposal.length()));
- }
- }
- return proposals;
- }
-
- private IFile getCorrespondingResource(ICompilationUnit cu) {
- try {
- return (IFile) cu.getCorrespondingResource();
- } catch (JavaModelException ex) {
- JptJaxbUiPlugin.log(ex);
- return null;
- }
- }
-
- @SuppressWarnings("unchecked")
- public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return Collections.emptyList();
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- public void sessionEnded() {
- // do nothing
- }
-
- private static class IgnoreCasePrefixFilter implements Filter<String> {
- private final char[] prefix;
- IgnoreCasePrefixFilter(char[] prefix) {
- super();
- this.prefix = prefix;
- }
- public boolean accept(String s) {
- return StringTools.stringStartsWithIgnoreCase(s.toCharArray(), this.prefix);
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
deleted file mode 100644
index 4c0ddd7a7b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal;
-
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.swt.graphics.Image;
-
-public class JaxbMappingImageHelper
-{
-//
-// public static Image imageForTypeMapping(String mappingKey) {
-// return JptUiPlugin.getImage(iconKeyForTypeMapping(mappingKey));
-// }
-//
-// public static String iconKeyForTypeMapping(String mappingKey) {
-// if (MappingKeys.NULL_TYPE_MAPPING_KEY == mappingKey) {
-// return JptUiIcons.NULL_TYPE_MAPPING;
-// }
-// else if (MappingKeys.ENTITY_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.ENTITY;
-// }
-// else if (MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.EMBEDDABLE;
-// }
-// else if (MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.MAPPED_SUPERCLASS;
-// }
-// return null;
-// }
-
- public static Image imageForAttributeMapping(String mappingKey) {
- return JptJaxbUiPlugin.getImage(iconKeyForAttributeMapping(mappingKey));
- }
-
- public static String iconKeyForAttributeMapping(String mappingKey) {
- if (MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbUiIcons.NULL_ATTRIBUTE_MAPPING;
- }
- else if (MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ANY_ATTRIBUTE;
- }
- else if (MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ANY_ELEMENT;
- }
- else if (MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ATTRIBUTE;
- }
- else if (MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT;
- }
- else if (MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT_REF;
- }
- else if (MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT_REFS;
- }
- else if (MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENTS;
- }
- else if (MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_TRANSIENT;
- }
- else if (MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_VALUE;
- }
-
- //return the JAXB_CONTENT icon instead of null, might as well have an icon if one is not defined
- return JptJaxbUiIcons.JAXB_CONTENT;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
deleted file mode 100644
index 693c3ec187..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal;
-
-@SuppressWarnings("nls")
-public class JptJaxbUiIcons {
-
- // **************** General icons **************************************
-
- public static final String JAXB_CONTENT = "full/obj16/jaxb_content";
- public static final String PACKAGE = "full/obj16/package";
-
- public static final String JAXB_CLASS = "full/obj16/jaxb_class";
- public static final String JAXB_ENUM = "full/obj16/jaxb_enum";
- public static final String JAXB_TRANSIENT_CLASS = "full/obj16/jaxb_transient_class";
- public static final String JAXB_TRANSIENT_ENUM = "full/obj16/jaxb_transient_enum";
- public static final String JAXB_REGISTRY = "full/obj16/jaxb_registry";
-
- public static final String XML_ANY_ATTRIBUTE = "full/obj16/xml-any-attribute";
- public static final String XML_ANY_ELEMENT = "full/obj16/xml-any-element";
- public static final String XML_ATTRIBUTE = "full/obj16/xml-attribute";
- public static final String XML_ELEMENT = "full/obj16/xml-element";
- public static final String XML_ELEMENT_REF = "full/obj16/xml-element-ref";
- public static final String XML_ELEMENT_REFS = "full/obj16/xml-element-refs";
- public static final String XML_ELEMENTS = "full/obj16/xml-elements";
-
- public static final String XML_TRANSIENT = "full/obj16/xml-transient";
- public static final String XML_VALUE = "full/obj16/xml-value";
- public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
-
- public static final String PERSISTENT_FIELD = "full/obj16/persistent_field";
- public static final String PERSISTENT_PROPERTY = "full/obj16/persistent_property";
- public static final String ENUM_CONSTANT = "full/obj16/enum_constant";
-
-
- // **************** Wizard icons *******************************************
-
- public static final String SCHEMA_GEN = "full/wizban/NewXSD";
-
- public static final String SCHEMA_GEN_WIZ_BANNER = "full/wizban/NewXSD";
- public static final String CLASSES_GEN_WIZ_BANNER = "full/wizban/newclass_wiz";
- public static final String JAXB_WIZ_BANNER = "full/wizban/new_jaxb_prj_wiz";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java
deleted file mode 100644
index a71c8df345..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali JAXB UI.
- *
- * @version 2.3
- */
-public class JptJaxbUiMessages {
-
- public static String JavaProjectWizardPage_project;
- public static String JavaProjectWizardPage_destinationProject;
-
- // ClassesGenerator
- public static String ClassesGeneratorProjectWizardPage_title;
- public static String ClassesGeneratorProjectWizardPage_desc;
-
- public static String ClassesGeneratorWizard_title;
- public static String ClassesGeneratorWizard_errorDialogTitle;
- public static String ClassesGeneratorWizard_couldNotCreate;
-
- public static String Error_openingEditor;
-
- public static String JaxbContent_label;
-
- public static String SchemasPage_description;
- public static String SchemasPage_revert;
- public static String SchemasPage_schemas;
- public static String SchemasPage_namespaceColumnLabel;
- public static String SchemasPage_locationColumnLabel;
- public static String SchemasPage_addButtonLabel;
- public static String SchemasPage_editButtonLabel;
- public static String SchemasPage_removeButtonLabel;
- public static String SchemasPage_addSchemaMessage;
- public static String SchemasPage_editSchemaMessage;
- public static String SchemasPage_addSchemaDialogTitle;
- public static String SchemasPage_editSchemaDialogTitle;
- public static String SchemasPage_addSchemaTitle;
- public static String SchemasPage_editSchemaTitle;
- public static String SchemasPage_locationLabel;
- public static String SchemasPage_browseButtonLabel;
- public static String SchemasPage_namespaceLabel;
- public static String SchemasPage_noNamespaceText;
- public static String SchemasPage_schemaUnresolvedMessage;
- public static String SchemasPage_duplicateNamespaceMessage;
- public static String SchemasPage_noLocationMessage;
- public static String SchemasPage_chooseLocationTitle;
-
- public static String SchemaWizardPage_title;
- public static String SchemaWizardPage_desc;
-
- public static String SchemaWizardPage_xmlCatalogTableTitle;
- public static String SchemaWizardPage_xmlCatalogKeyColumn;
- public static String SchemaWizardPage_xmlCatalogUriColumn;
-
- public static String SchemaWizardPage_errorUriCannotBeLocated;
-
- public static String SelectFileOrXMLCatalogIdPanel_fileFromWorkspace;
- public static String SelectFileOrXMLCatalogIdPanel_xmlCatalogEntry;
- public static String SelectFileOrXMLCatalogIdPanel_importButton;
-
- public static String ClassesGeneratorWizardPage_title;
- public static String ClassesGeneratorWizardPage_desc;
-
- public static String ClassesGeneratorWizardPage_usesMoxyImplementation;
-
- public static String ClassesGeneratorWizardPage_catalog;
- public static String ClassesGeneratorWizardPage_bindingsFiles;
- public static String ClassesGeneratorWizardPage_browseButton;
- public static String ClassesGeneratorWizardPage_addButton;
- public static String ClassesGeneratorWizardPage_removeButton;
- public static String ClassesGeneratorWizardPage_chooseABindingsFile;
- public static String ClassesGeneratorWizardPage_chooseACatalog;
-
- public static String ClassesGeneratorWizardPage_sourceFolderSelectionDialog_title;
- public static String ClassesGeneratorWizardPage_chooseSourceFolderDialog_desc;
-
- public static String ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable;
- public static String ClassesGeneratorWizardPage_moxyLibrariesNotAvailable;
-
- public static String ClassesGeneratorOptionsWizardPage_title;
- public static String ClassesGeneratorOptionsWizardPage_desc;
-
- public static String ClassesGeneratorOptionsWizardPage_proxyGroup;
- public static String ClassesGeneratorOptionsWizardPage_noProxy;
- public static String ClassesGeneratorOptionsWizardPage_proxy;
- public static String ClassesGeneratorOptionsWizardPage_proxyFile;
- public static String ClassesGeneratorOptionsWizardPage_chooseAProxyFile;
-
- public static String ClassesGeneratorOptionsWizardPage_useStrictValidation;
- public static String ClassesGeneratorOptionsWizardPage_makeReadOnly;
- public static String ClassesGeneratorOptionsWizardPage_suppressPackageInfoGen;
- public static String ClassesGeneratorOptionsWizardPage_suppressesHeaderGen;
- public static String ClassesGeneratorOptionsWizardPage_target;
- public static String ClassesGeneratorOptionsWizardPage_verbose;
- public static String ClassesGeneratorOptionsWizardPage_quiet;
-
- public static String ClassesGeneratorOptionsWizardPage_treatsAsXmlSchema;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsRelaxNg;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsRelaxNgCompact;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsDtd;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsWsdl;
- public static String ClassesGeneratorOptionsWizardPage_showsVersion;
- public static String ClassesGeneratorOptionsWizardPage_showsHelp;
-
- public static String ClassesGeneratorExtensionOptionsWizardPage_title;
- public static String ClassesGeneratorExtensionOptionsWizardPage_desc;
-
- public static String ClassesGeneratorExtensionOptionsWizardPage_allowExtensions;
- public static String ClassesGeneratorExtensionOptionsWizardPage_classpath;
- public static String ClassesGeneratorExtensionOptionsWizardPage_additionalArguments;
-
- public static String ClassesGeneratorUi_generatingEntities;
- public static String ClassesGeneratorUi_generatingEntitiesTask;
-
- public static String ClassesGeneratorUi_generatingClassesWarningTitle;
- public static String ClassesGeneratorUi_generatingClassesWarningMessage;
-
- // SchemaGenerator
- public static String SchemaGeneratorWizard_title;
- public static String SchemaGeneratorWizard_generatingSchema;
-
- public static String SchemaGeneratorProjectWizardPage_title;
- public static String SchemaGeneratorProjectWizardPage_desc;
-
- public static String SchemaGeneratorWizardPage_title;
- public static String SchemaGeneratorWizardPage_desc;
-
- public static String SchemaGeneratorWizardPage_shemaLocation;
- public static String SchemaGeneratorWizardPage_shema;
- public static String SchemaGeneratorWizardPage_packages;
- public static String SchemaGeneratorWizardPage_browse;
-
- public static String SchemaGeneratorWizardPage_chooseSchemaDialogTitle;
-
- public static String SchemaGeneratorWizardPage_errorNoSchema;
- public static String SchemaGeneratorWizardPage_errorNoPackage;
-
- public static String SchemaGeneratorWizardPage_jaxbLibrariesNotAvailable;
-
- public static String SchemaGeneratorWizardPage_moxyLibrariesNotAvailable;
-
- public static String SchemaGeneratorWizard_generateSchemaTask;
-
- public static String NewSchemaFileWizardPage_errorNotJavaProject;
- public static String NewSchemaFileWizardPage_overwriteExistingSchemas;
-
-
- // new project wizard
-
- public static String JaxbProjectWizard_title;
-
- public static String JaxbProjectWizard_firstPage_title;
- public static String JaxbProjectWizard_firstPage_desc;
-
-
- // facet page
-
- public static String JaxbFacetWizardPage_title;
- public static String JaxbFacetWizardPage_desc;
- public static String JaxbFacetWizardPage_platformLabel;
- public static String JaxbFacetWizardPage_facetsPageLink;
- public static String JaxbFacetWizardPage_jaxbImplementationLabel;
-
-
- private static final String BUNDLE_NAME = "jpt_jaxb_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptJaxbUiMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptJaxbUiMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java
deleted file mode 100644
index 526fd69580..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.jaxb.ui.internal.ClassesGeneratorUi;
-
-/**
- * GenerateClassesAction
- */
-public class GenerateClassesAction extends ObjectAction
-{
-
- @Override
- protected void execute(IFile xsdFile) {
-
- ClassesGeneratorUi.generate(xsdFile);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java
deleted file mode 100644
index 652d75ac58..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * GenerateEntitiesAction
- */
-public abstract class ObjectAction extends ActionDelegate implements IObjectActionDelegate
-{
- private ISelection currentSelection;
-
- public ObjectAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- @Override
- public void run(IAction action) {
- if (this.currentSelection instanceof ITreeSelection) {
- for (Iterator<?> stream = ((ITreeSelection) this.currentSelection).iterator(); stream.hasNext(); ) {
- this.execute(stream.next());
- }
- }
- }
-
- protected void execute(Object selection) {
-
- if(selection instanceof IFile) {
- this.execute((IFile)selection);
- }
- }
-
- @SuppressWarnings("unused")
- protected void execute(IFile file) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/OpenJaxbResourceAction.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/OpenJaxbResourceAction.java
deleted file mode 100644
index c852e481cb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/OpenJaxbResourceAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.BaseSelectionListenerAction;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
-
-
-public class OpenJaxbResourceAction
- extends BaseSelectionListenerAction {
-
- private JaxbContextNode selectedNode;
-
-
- public OpenJaxbResourceAction() {
- super("Open"); //$NON-NLS-1$
- }
-
-
- @Override
- public boolean updateSelection(IStructuredSelection s) {
- this.selectedNode = null;
-
- if (! super.updateSelection(s)) {
- return false;
- }
-
- if (s.size() != 1) {
- return false;
- }
-
- if (s.getFirstElement() instanceof JaxbContextRoot) {
- return false;
- }
-
- selectedNode = (JaxbContextNode) s.getFirstElement();
-
- return true;
- }
-
- @Override
- public void run() {
- if (! isEnabled()) {
- return;
- }
-
- IResource resource = this.selectedNode.getResource();
-
- if (resource != null && resource.exists() && resource.getType() == IResource.FILE) {
- openEditor((IFile) resource);
- }
- }
-
- protected void openEditor(IFile file) {
- IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
- IContentType contentType = IDE.getContentType(file);
- IEditorDescriptor editorDescriptor = registry.getDefaultEditor(file.getName(), contentType);
- if (editorDescriptor == null) {
- return; // no editor associated...
- }
-
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- try {
- page.openEditor(new FileEditorInput(file), editorDescriptor.getId());
- }
- catch (Exception e) {
- MessageDialog.openError(page.getWorkbenchWindow().getShell(), JptJaxbUiMessages.Error_openingEditor, e.getMessage());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java
deleted file mode 100644
index 5572e0b5fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * Filters out all containers i.e. all packages and folders
- */
-public class ContainerFilter extends ViewerFilter {
-
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean isContainer = element instanceof IContainer;
-
- if( ! isContainer && element instanceof IJavaElement) {
- int type= ((IJavaElement)element).getElementType();
- isContainer = (type == IJavaElement.JAVA_MODEL
- || type == IJavaElement.JAVA_PROJECT
- || type == IJavaElement.PACKAGE_FRAGMENT
- || type ==IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
- return ! isContainer;
- }
-
- @Override
- public String toString() {
- return "Filter out Containers"; //$NON-NLS-1$
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java
deleted file mode 100644
index e89609ec7a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.jdt.internal.ui.filters
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-
-
-/**
- * Filters empty non-leaf package fragments
- */
-public class EmptyInnerPackageFilter extends ViewerFilter {
-
- /*
- * @see ViewerFilter
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IPackageFragment) {
- IPackageFragment pkg= (IPackageFragment)element;
- try {
- if (pkg.isDefaultPackage())
- return pkg.hasChildren();
- return !pkg.hasSubpackages() || pkg.hasChildren() || (pkg.getNonJavaResources().length > 0);
- } catch (JavaModelException e) {
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java
deleted file mode 100644
index 9ae95f8b9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*
-* Code originate from XXXX
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * NonArchiveOrExternalElementFilter
- */
-public class NonArchiveOrExternalElementFilter extends ViewerFilter {
-
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- if(element instanceof IPackageFragmentRoot) {
- IPackageFragmentRoot root= (IPackageFragmentRoot) element;
- return !root.isArchive() && !root.isExternal();
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "Filter out: Non-Archive and Non-External"; //$NON-NLS-1$
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java
deleted file mode 100644
index 8fd6e6ac82..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * Filters out all non Container and all JavaProject
- * with name not equals to the given projectName.
- */
-public class NonContainerFilter extends ViewerFilter
-{
- final private String projectName;
-
- public NonContainerFilter(String projectName) {
- this.projectName = projectName;
- }
-
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean isContainer = element instanceof IContainer;
- int type;
- if( ! isContainer && element instanceof IJavaElement) {
- type = ((IJavaElement)element).getElementType();
- isContainer = (type == IJavaElement.JAVA_MODEL
- || type == IJavaElement.JAVA_PROJECT
- || type == IJavaElement.PACKAGE_FRAGMENT
- || type ==IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
- if(isContainer && (element instanceof IJavaElement)) {
- type = ((IJavaElement)element).getElementType();
- if(type == IJavaElement.JAVA_PROJECT) {
- String projectName = ((IJavaProject)element).getElementName();
- return projectName.equals(this.projectName);
- }
- }
- return isContainer;
- }
-
- @Override
- public String toString() {
- return "Filter out Non-Containers"; //$NON-NLS-1$
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
deleted file mode 100644
index 0c1a6949bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.jdt.internal.ui.filters
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IStorage;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-import org.eclipse.jdt.core.IJavaElement;
-
-
-/**
- * Filters out all non-Java elements, and elements named package-info
- */
-public class NonJavaElementFilter extends ViewerFilter {
-
- static public String FILE_TO_EXCLUDE = "package-info.java"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IJavaElement) {
- return(FILE_TO_EXCLUDE.equals(((IJavaElement)element).getElementName())) ?
- false : true;
- }
-
- if (element instanceof IResource) {
- IProject project= ((IResource)element).getProject();
- return project == null || !project.isOpen();
- }
-
- // Exclude all IStorage elements which are neither Java elements nor resources
- if (element instanceof IStorage)
- return false;
-
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
deleted file mode 100644
index 7e6c6bb8a3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
- implements ItemLabelProviderFactory {
-
- private static GenericJaxb_2_1_NavigatorItemLabelProviderFactory INSTANCE;
-
-
- public static GenericJaxb_2_1_NavigatorItemLabelProviderFactory instance() {
- if (INSTANCE == null) {
- INSTANCE = new GenericJaxb_2_1_NavigatorItemLabelProviderFactory();
- }
- return INSTANCE;
- }
-
-
- protected GenericJaxb_2_1_NavigatorItemLabelProviderFactory() {
- super();
- }
-
-
- public ItemLabelProvider buildItemLabelProvider(
- Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider) {
-
- if (item instanceof JaxbContextRoot) {
- return new JaxbContextRootItemLabelProvider((JaxbContextRoot) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbPackage) {
- return new JaxbPackageItemLabelProvider((JaxbPackage) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbClass) {
- return new JaxbClassItemLabelProvider((JaxbClass) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbEnum) {
- return new JaxbEnumItemLabelProvider((JaxbEnum) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbPersistentAttribute) {
- return new JaxbPersistentAttributeItemLabelProvider((JaxbPersistentAttribute) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbEnumConstant) {
- return new JaxbEnumConstantItemLabelProvider((JaxbEnumConstant) item, contentAndLabelProvider);
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java
deleted file mode 100644
index 57a6265e1a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-
-public class GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory {
-
- private static GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory INSTANCE;
-
-
- public static GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory instance() {
- if (INSTANCE == null) {
- INSTANCE = new GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory();
- }
- return INSTANCE;
- }
-
-
- private GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory() {
- super();
- }
-
-
- public TreeItemContentProvider buildItemContentProvider(
- Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider) {
-
- DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider =
- (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider;
-
- if (item instanceof JaxbContextRoot) {
- return new JaxbContextRootItemContentProvider((JaxbContextRoot) item, treeContentAndLabelProvider);
- }
- else if (item instanceof JaxbPackage) {
- return new JaxbPackageItemContentProvider((JaxbPackage) item, treeContentAndLabelProvider);
- }
- else if (item instanceof JaxbClass) {
- return new JaxbClassItemContentProvider((JaxbClass) item, treeContentAndLabelProvider);
- }
- else if (item instanceof JaxbEnum) {
- return new JaxbEnumItemContentProvider((JaxbEnum) item, treeContentAndLabelProvider);
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.java
deleted file mode 100644
index 175f5e6d0d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-
-
-public class GenericJaxb_2_1_NavigatorUi
- implements JaxbNavigatorUi {
-
- private static GenericJaxb_2_1_NavigatorUi INSTANCE;
-
-
- public static GenericJaxb_2_1_NavigatorUi instance() {
- if (INSTANCE == null) {
- INSTANCE = new GenericJaxb_2_1_NavigatorUi();
- }
- return INSTANCE;
- }
-
-
- protected GenericJaxb_2_1_NavigatorUi() {
- super();
- }
-
-
- public TreeItemContentProviderFactory getTreeItemContentProviderFactory() {
- return GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.instance();
- }
-
- public ItemLabelProviderFactory getItemLabelProviderFactory() {
- return GenericJaxb_2_1_NavigatorItemLabelProviderFactory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.java
deleted file mode 100644
index 9336abc359..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class GenericJaxb_2_1_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return GenericJaxb_2_1_NavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemContentProvider.java
deleted file mode 100644
index 28e2566077..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemContentProvider.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-public class JaxbClassItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbPersistentAttribute> {
-
- public JaxbClassItemContentProvider(
- JaxbClass jaxbClass, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(jaxbClass, contentProvider);
- }
-
-
- @Override
- public JaxbClass getModel() {
- return (JaxbClass) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
- @Override
- protected CollectionValueModel<JaxbPersistentAttribute> buildChildrenModel() {
- PropertyValueModel<JaxbClassMapping> mappingModel = buildMappingModel();
- return new CompositeCollectionValueModel<CollectionValueModel<JaxbPersistentAttribute>, JaxbPersistentAttribute>(
- buildAttributesModel(mappingModel),
- buildIncludedAttributesModel(mappingModel));
- }
-
- protected PropertyValueModel<JaxbClassMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbClass, JaxbClassMapping>(JaxbClass.MAPPING_PROPERTY, getModel()) {
- @Override
- protected JaxbClassMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- protected CollectionValueModel<JaxbPersistentAttribute> buildAttributesModel(
- PropertyValueModel<JaxbClassMapping> mappingModel) {
- return new CollectionAspectAdapter<JaxbClassMapping, JaxbPersistentAttribute>(
- mappingModel, JaxbClassMapping.ATTRIBUTES_COLLECTION) {
- @Override
- protected Iterable<JaxbPersistentAttribute> getIterable() {
- return this.subject.getAttributes();
- }
- };
- }
-
- protected CollectionValueModel<JaxbPersistentAttribute> buildIncludedAttributesModel(
- PropertyValueModel<JaxbClassMapping> mappingModel) {
- return new CollectionAspectAdapter<JaxbClassMapping, JaxbPersistentAttribute>(
- mappingModel, JaxbClassMapping.INCLUDED_ATTRIBUTES_COLLECTION) {
- @Override
- protected Iterable<JaxbPersistentAttribute> getIterable() {
- return this.subject.getIncludedAttributes();
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
deleted file mode 100644
index bfb87c8d68..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbClassItemLabelProvider
- extends JaxbTypeItemLabelProvider {
-
- public JaxbClassItemLabelProvider(
- JaxbClass jaxbPersistentClass, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbPersistentClass, labelProvider);
- }
-
-
- @Override
- public JaxbClass getModel() {
- return (JaxbClass) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new JaxbClassImageModel(getModel());
- }
-
-
- protected class JaxbClassImageModel
- extends AspectPropertyValueModelAdapter<JaxbClass, Image> {
-
- protected final PropertyValueModel<Boolean> isXmlRegistryModel;
-
- protected final PropertyValueModel<JaxbClassMapping> mappingModel;
-
- protected final PropertyValueModel<Boolean> isXmlTransientModel;
-
- protected final PropertyChangeListener propertyChangeListener;
-
-
- public JaxbClassImageModel(JaxbClass subject) {
- super(new StaticPropertyValueModel(subject));
- this.isXmlRegistryModel = buildIsXmlRegistryModel();
- this.mappingModel = buildMappingModel();
- this.isXmlTransientModel = buildIsXmlTransientModel();
- this.propertyChangeListener = buildPropertyChangeListener();
- }
-
-
- protected PropertyValueModel<Boolean> buildIsXmlRegistryModel() {
- return new PropertyAspectAdapter<JaxbClass, Boolean>(JaxbClass.XML_REGISTRY_PROPERTY, JaxbClassItemLabelProvider.this.getModel()) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getXmlRegistry() != null;
- }
- };
- }
-
- protected PropertyValueModel<JaxbClassMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbClass, JaxbClassMapping> (JaxbClass.MAPPING_PROPERTY, JaxbClassItemLabelProvider.this.getModel()) {
- @Override
- protected JaxbClassMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildIsXmlTransientModel() {
- return new PropertyAspectAdapter<JaxbClassMapping, Boolean>(this.mappingModel, JaxbClassMapping.XML_TRANSIENT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isXmlTransient();
- }
- };
- }
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- // transform the subject's property change events into VALUE property change events
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- JaxbClassImageModel.this.propertyChanged();
- }
- };
- }
-
- @Override
- protected Image buildValue_() {
- if (this.mappingModel.getValue() != null) {
- if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_TRANSIENT_CLASS);
- }
- }
- else if (this.isXmlRegistryModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_REGISTRY);
- }
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_CLASS);
- }
-
- @Override
- protected void engageSubject_() {
- this.isXmlRegistryModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- this.mappingModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.isXmlRegistryModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- this.mappingModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java
deleted file mode 100644
index 4f6a013de8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-
-public class JaxbContextRootItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbPackage> {
-
- public JaxbContextRootItemContentProvider(
- JaxbContextRoot rootContext, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(rootContext, contentProvider);
- }
-
-
- @Override
- public JaxbContextRoot getModel() {
- return (JaxbContextRoot) super.getModel();
- }
-
- @Override
- public IProject getParent() {
- return getModel().getJaxbProject().getProject();
- }
-
- @Override
- protected CollectionValueModel<JaxbPackage> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbContextRoot, JaxbPackage>(
- JaxbContextRoot.PACKAGES_COLLECTION,
- getModel()) {
-
- @Override
- protected Iterable<JaxbPackage> getIterable() {
- return this.subject.getPackages();
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.java
deleted file mode 100644
index 1fa5c4e31d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbContextRootItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbContextRootItemLabelProvider(
- JaxbContextRoot rootContextNode, DelegatingContentAndLabelProvider labelProvider) {
-
- super(rootContextNode, labelProvider);
- }
-
-
- @Override
- public JaxbContextRoot getModel() {
- return (JaxbContextRoot) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_CONTENT));
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(JptJaxbUiMessages.JaxbContent_label);
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- StringBuilder sb = new StringBuilder();
- sb.append(JptJaxbUiMessages.JaxbContent_label);
- sb.append(" - "); //$NON-NLS-1$
- sb.append(getModel().getResource().getFullPath().makeRelative());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java
deleted file mode 100644
index 0a839f0d08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbEnumConstantItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbEnumConstantItemLabelProvider(
- JaxbEnumConstant jaxbEnumConstant, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbEnumConstant, labelProvider);
- }
-
-
- @Override
- public JaxbEnumConstant getModel() {
- return (JaxbEnumConstant) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.ENUM_CONSTANT));
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemContentProvider.java
deleted file mode 100644
index 8ada32297a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemContentProvider.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-
-
-public class JaxbEnumItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbEnumConstant> {
-
- public JaxbEnumItemContentProvider(
- JaxbEnum jaxbEnum, DelegatingTreeContentAndLabelProvider contentProvider) {
-
- super(jaxbEnum, contentProvider);
- }
-
-
- @Override
- public JaxbEnum getModel() {
- return (JaxbEnum) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
- protected PropertyValueModel<JaxbEnumMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbEnum, JaxbEnumMapping>(JaxbEnum.MAPPING_PROPERTY, getModel()) {
- @Override
- protected JaxbEnumMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- @Override
- protected CollectionValueModel<JaxbEnumConstant> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbEnumMapping, JaxbEnumConstant>(
- buildMappingModel(), JaxbEnumMapping.ENUM_CONSTANTS_COLLECTION) {
- @Override
- protected Iterable<JaxbEnumConstant> getIterable() {
- return this.subject.getEnumConstants();
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
deleted file mode 100644
index 8dbdacd834..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbEnumItemLabelProvider
- extends JaxbTypeItemLabelProvider {
-
- public JaxbEnumItemLabelProvider(
- JaxbEnum jaxbEnum, DelegatingContentAndLabelProvider labelProvider) {
- super(jaxbEnum, labelProvider);
- }
-
-
- @Override
- public JaxbEnum getModel() {
- return (JaxbEnum) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new JaxbEnumImageModel(getModel());
- }
-
-
- protected class JaxbEnumImageModel
- extends AspectPropertyValueModelAdapter<JaxbEnum, Image> {
-
- protected final PropertyValueModel<JaxbEnumMapping> mappingModel;
-
- protected final PropertyValueModel<Boolean> isXmlTransientModel;
-
- protected final PropertyChangeListener propertyChangeListener;
-
-
- public JaxbEnumImageModel(JaxbEnum subject) {
- super(new StaticPropertyValueModel(subject));
- this.mappingModel = buildMappingModel();
- this.isXmlTransientModel = buildIsXmlTransientModel();
- this.propertyChangeListener = buildPropertyChangeListener();
- }
-
-
- protected PropertyValueModel<JaxbEnumMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbEnum, JaxbEnumMapping> (JaxbEnum.MAPPING_PROPERTY, JaxbEnumItemLabelProvider.this.getModel()) {
- @Override
- protected JaxbEnumMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildIsXmlTransientModel() {
- return new PropertyAspectAdapter<JaxbEnumMapping, Boolean>(this.mappingModel, JaxbEnumMapping.XML_TRANSIENT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isXmlTransient();
- }
- };
- }
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- // transform the subject's property change events into VALUE property change events
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- JaxbEnumImageModel.this.propertyChanged();
- }
- };
- }
-
- @Override
- protected Image buildValue_() {
- if (this.mappingModel.getValue() != null) {
- if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_TRANSIENT_ENUM);
- }
- }
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_ENUM);
- }
-
- @Override
- protected void engageSubject_() {
- this.mappingModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.mappingModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java
deleted file mode 100644
index 620c6e783e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-
-
-public class JaxbPackageItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbType> {
-
- public JaxbPackageItemContentProvider(
- JaxbPackage jaxbPackage, DelegatingTreeContentAndLabelProvider contentProvider) {
-
- super(jaxbPackage, contentProvider);
- }
-
-
- @Override
- public JaxbPackage getModel() {
- return (JaxbPackage) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
- @Override
- protected CollectionValueModel<JaxbType> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbContextRoot, JaxbType>(
- JaxbContextRoot.TYPES_COLLECTION, getParent()) {
- @Override
- protected Iterable<JaxbType> getIterable() {
- return this.subject.getTypes(getModel());
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.java
deleted file mode 100644
index a275cb7634..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbPackageItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbPackageItemLabelProvider(
- JaxbPackage jaxbPackage, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbPackage, labelProvider);
- }
-
- @Override
- public JaxbPackage getModel() {
- return (JaxbPackage) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PACKAGE));
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- StringBuilder sb = new StringBuilder();
- sb.append(getModel().getName());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(getModel().getResource().getFullPath().makeRelative());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java
deleted file mode 100644
index d314f2dd87..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbPersistentAttributeItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbPersistentAttributeItemLabelProvider(
- JaxbPersistentAttribute attribute, DelegatingContentAndLabelProvider labelProvider) {
-
- super(attribute, labelProvider);
- }
-
-
- @Override
- public JaxbPersistentAttribute getModel() {
- return (JaxbPersistentAttribute) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<JaxbPersistentAttribute, Image>(
- new String[] {JaxbPersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY, JaxbPersistentAttribute.MAPPING_PROPERTY},
- getModel()) {
- @Override
- protected Image buildValue_() {
- return JaxbMappingImageHelper.imageForAttributeMapping(this.subject.getMappingKey());
- }
- };
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- StringBuffer sb = new StringBuffer();
- if (getModel().isInherited()) {
- sb.append(getModel().getDeclaringJavaResourceType().getName());
- sb.append('.');
- }
- sb.append(getModel().getName());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java
deleted file mode 100644
index 846e5b97e2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-
-
-public class JaxbRegistryItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbElementFactoryMethod> {
-
- public JaxbRegistryItemContentProvider(
- XmlRegistry jaxbRegistry, DelegatingTreeContentAndLabelProvider contentProvider) {
-
- super(jaxbRegistry, contentProvider);
- }
-
-
- @Override
- public XmlRegistry getModel() {
- return (XmlRegistry) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
deleted file mode 100644
index c97eb44550..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-
-
-public abstract class JaxbTypeItemLabelProvider
- extends AbstractItemLabelProvider {
-
- protected JaxbTypeItemLabelProvider(
- JaxbType jaxbType, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbType, labelProvider);
- }
-
- @Override
- public JaxbType getModel() {
- return (JaxbType) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(getModel().getTypeQualifiedName());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- StringBuilder sb = new StringBuilder();
- sb.append(getModel().getFullyQualifiedName());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(getModel().getResource().getFullPath().makeRelative());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.java
deleted file mode 100644
index 3e2ad5efd9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class GenericJaxb_2_2_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return GenericJaxb_2_1_NavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorActionProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorActionProvider.java
deleted file mode 100644
index b38d0d85a0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorActionProvider.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jaxb.ui.internal.actions.OpenJaxbResourceAction;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionConstants;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonMenuConstants;
-
-
-public class JaxbNavigatorActionProvider
- extends CommonActionProvider {
-
- private OpenJaxbResourceAction openAction;
-
-
- public JaxbNavigatorActionProvider() {
- super();
- }
-
-
- @Override
- public void init(ICommonActionExtensionSite aConfig) {
- this.openAction = new OpenJaxbResourceAction();
- }
-
- @Override
- public void setContext(ActionContext aContext) {
- if (aContext != null && aContext.getSelection() instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) aContext.getSelection();
- this.openAction.selectionChanged(selection);
- }
-
- super.setContext(aContext);
- }
-
- @Override
- public void fillActionBars(IActionBars theActionBars) {
- if (this.openAction.isEnabled()) {
- theActionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, this.openAction);
- }
- }
-
- @Override
- public void fillContextMenu(IMenuManager aMenu) {
- if (getContext() == null || getContext().getSelection().isEmpty()) {
- return;
- }
-
- if (this.openAction.isEnabled()) {
- aMenu.insertAfter(ICommonMenuConstants.GROUP_OPEN, this.openAction);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java
deleted file mode 100644
index c4844b218a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-
-
-public class JaxbNavigatorContentAndLabelProvider
- extends DelegatingTreeContentAndLabelProvider {
-
- public JaxbNavigatorContentAndLabelProvider() {
- super(new JaxbNavigatorTreeItemContentProviderFactory(), new JaxbNavigatorItemLabelProviderFactory());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
deleted file mode 100644
index e23922e219..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-/**
- * This extension of navigator content provider delegates to the platform UI
- * (see the org.eclipse.jpt.jaxb.ui.jaxbPlatformUis extension point) for navigator content.
- *
- * If there is a platform UI for the given project, this content provider will
- * provide a root "JAXB Content" node (child of the project), otherwise there
- * will be no content. For children of the "JAXB Content" node (or for any other
- * sub-node), this provider will delegate to the content provider returned by the
- * platform UI implementation.
- */
-public class JaxbNavigatorContentProvider
- implements ICommonContentProvider {
-
- private JaxbNavigatorContentAndLabelProvider delegate;
-
- private final CollectionChangeListener jaxbProjectListener;
-
- private StructuredViewer viewer;
-
-
- public JaxbNavigatorContentProvider() {
- super();
- this.jaxbProjectListener = this.buildJaxbProjectListener();
- JptJaxbCorePlugin.getProjectManager().addCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
- }
-
- protected CollectionChangeListener buildJaxbProjectListener() {
- return new JaxbProjectListener();
- }
-
- public JaxbNavigatorContentAndLabelProvider getDelegate() {
- return this.delegate;
- }
-
-
- // **************** IContentProvider implementation ************************
-
- public void dispose() {
- JptJaxbCorePlugin.getProjectManager().removeCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
- if (this.delegate != null) {
- this.delegate.dispose();
- }
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (this.delegate != null) {
- this.delegate.inputChanged(viewer, oldInput, newInput);
- }
- this.viewer = (StructuredViewer) viewer;
- }
-
-
- // **************** IStructuredContentProvider implementation **************
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
-
- // **************** ITreeContentProvider implementation ********************
-
- public Object getParent(Object element) {
- if (this.delegate != null) {
- return this.delegate.getParent(element);
- }
-
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof IAdaptable) {
- IProject project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
-
- if (project != null) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
- if (jaxbProject != null) {
- JaxbPlatformDescription desc = jaxbProject.getPlatform().getDescription();
- JaxbPlatformUi platformUi =
- JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(desc);
-
- return platformUi != null;
- }
- }
- }
-
- if (this.delegate != null) {
- return this.delegate.hasChildren(element);
- }
-
- return false;
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof IAdaptable) {
- IProject project = (IProject) ((IAdaptable) parentElement).getAdapter(IProject.class);
-
- if (project != null) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
- if (jaxbProject != null) {
- JaxbPlatformDescription desc = jaxbProject.getPlatform().getDescription();
- JaxbPlatformUi platformUi =
- JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(desc);
-
- if (platformUi != null) {
- return new Object[] {jaxbProject.getContextRoot()};
- }
- }
- }
- }
-
- if (this.delegate != null) {
- return this.delegate.getChildren(parentElement);
- }
-
- return new Object[0];
- }
-
-
- // **************** IMementoAware implementation ***************************
-
- public void saveState(IMemento memento) {
- // no op
- }
-
- public void restoreState(IMemento memento) {
- // no op
- }
-
-
- // **************** ICommonContentProvider implementation ******************
-
- public void init(ICommonContentExtensionSite config) {
- if (this.delegate == null) {
- JaxbNavigatorLabelProvider labelProvider = (JaxbNavigatorLabelProvider) config.getExtension().getLabelProvider();
- if (labelProvider != null && labelProvider.getDelegate() != null) {
- this.delegate = labelProvider.getDelegate();
- }
- else {
- this.delegate = new JaxbNavigatorContentAndLabelProvider();
- }
- }
- }
-
-
- // **************** member classes *****************************************
-
- private class JaxbProjectListener
- implements CollectionChangeListener
- {
- public void collectionChanged(CollectionChangeEvent event) {
- this.refreshViewer(null);
- }
- public void collectionCleared(CollectionClearEvent event) {
- this.refreshViewer(null);
- }
- public void itemsAdded(CollectionAddEvent event) {
- for (Object item : event.getItems()) {
- this.refreshViewer(((JaxbProject) item).getProject());
- }
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- for (Object item : event.getItems()) {
- this.refreshViewer(((JaxbProject) item).getProject());
- }
- }
-
- private void refreshViewer(final IProject project) {
- if (viewer != null
- && viewer.getControl() != null
- && !viewer.getControl().isDisposed()) {
- // Using job here so that project model update (which also uses
- // a job) will complete first
- Job refreshJob = new Job("Refresh viewer") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- // Using runnable here so that refresh will go on correct thread
- viewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (project != null) {
- viewer.refresh(project);
- }
- else {
- viewer.refresh();
- }
- }
- });
- return Status.OK_STATUS;
- }
- };
- if (project != null) {
- refreshJob.setRule(project);
- }
- refreshJob.schedule();
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
deleted file mode 100644
index ee3b2cbeb3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-public class JaxbNavigatorItemLabelProviderFactory
- implements ItemLabelProviderFactory {
-
- /**
- * Exactly *one* of these factories is created for each view that utilizes it.
- * Therefore, as we delegate to the platform UI for each project, we should
- * maintain the same multiplicity. That is, if there is a delegate for each
- * platform UI, we should maintain *one* delegate for each view.
- *
- * Key: platform description, Value: delegate content provider factory
- */
- private final Map<JaxbPlatformDescription, ItemLabelProviderFactory> delegates;
-
-
- public JaxbNavigatorItemLabelProviderFactory() {
- super();
- this.delegates = new HashMap<JaxbPlatformDescription, ItemLabelProviderFactory>();
- }
-
- public ItemLabelProvider buildItemLabelProvider(Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- ItemLabelProviderFactory delegate = getDelegate(item);
- if (delegate != null) {
- return delegate.buildItemLabelProvider(item, contentAndLabelProvider);
- }
- return null;
- }
-
-
- private ItemLabelProviderFactory getDelegate(Object element) {
- if (! (element instanceof IAdaptable)) {
- return null;
- }
-
- JaxbContextNode contextNode = (JaxbContextNode) ((IAdaptable) element).getAdapter(JaxbContextNode.class);
-
- if (contextNode == null) {
- return null;
- }
-
- JaxbPlatformDescription platformDesc = contextNode.getJaxbProject().getPlatform().getDescription();
- if (delegates.containsKey(platformDesc)) {
- return delegates.get(platformDesc);
- }
- JaxbPlatformUi platformUi = JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(platformDesc);
- ItemLabelProviderFactory delegate =
- (platformUi == null) ? null : platformUi.getNavigatorUi().getItemLabelProviderFactory();
- delegates.put(platformDesc, delegate);
- return delegate;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java
deleted file mode 100644
index 615a7bac26..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * This extension of navigator label provider delegates to the platform UI
- * (see the org.eclipse.jpt.ui.jpaPlatform extension point) for navigator labels.
- *
- * This label provider provides a label for the root "JPA Content" node provided
- * by the content provider (see {@link JaxbNavigatorContentProvider}) and delegates
- * to the label provider returned by the platform UI implementation for labels
- * for children of the "JPA Content" node (or for any other sub-node).
- */
-public class JaxbNavigatorLabelProvider
- extends LabelProvider
- implements ICommonLabelProvider {
-
- private JaxbNavigatorContentAndLabelProvider delegate;
-
-
- public JaxbNavigatorLabelProvider() {
- super();
- }
-
-
- public JaxbNavigatorContentAndLabelProvider getDelegate() {
- return delegate;
- }
-
-
- // **************** IBaseLabelProvider implementation **********************
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- if (delegate != null) {
- delegate.addListener(listener);
- }
- super.addListener(listener);
- }
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- super.removeListener(listener);
- if (delegate != null) {
- delegate.removeListener(listener);
- }
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- if (delegate != null) {
- return delegate.isLabelProperty(element, property);
- }
-
- return super.isLabelProperty(element, property);
- }
-
- @Override
- public void dispose() {
- if (delegate != null) {
- delegate.dispose();
- }
- super.dispose();
- }
-
-
- // **************** ILabelProvider implementation **************************
-
- @Override
- public Image getImage(Object element) {
- if (delegate != null) {
- return delegate.getImage(element);
- }
-
- return super.getImage(element);
- }
-
- @Override
- public String getText(Object element) {
- if (delegate != null) {
- return delegate.getText(element);
- }
-
- return super.getText(element);
- }
-
-
- // **************** IDescriptionProvider implementation ********************
-
- public String getDescription(Object element) {
- if (delegate != null) {
- return delegate.getDescription(element);
- }
-
- return super.getText(element);
- }
-
-
- // **************** IMementoAware implementation ***************************
-
- public void saveState(IMemento memento) {
- // no op
- }
-
- public void restoreState(IMemento memento) {
- // no op
- }
-
-
- // **************** ICommonLabelProvider implementation ********************
-
- public void init(ICommonContentExtensionSite config) {
- if (delegate == null) {
- JaxbNavigatorContentProvider contentProvider = (JaxbNavigatorContentProvider) config.getExtension().getContentProvider();
- if (contentProvider != null && contentProvider.getDelegate() != null) {
- delegate = contentProvider.getDelegate();
- }
- else {
- delegate = new JaxbNavigatorContentAndLabelProvider();
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
deleted file mode 100644
index 567fbb04f1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-public class JaxbNavigatorTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory {
-
- /**
- * Exactly *one* of these factories is created for each view that utilizes it.
- * Therefore, as we delegate to the platform UI for each project, we should
- * maintain the same multiplicity. That is, if there is a delegate for each
- * platform UI, we should maintain *one* delegate for each view.
- *
- * Key: platform id, Value: delegate content provider factory
- */
- private Map<JaxbPlatformDescription, TreeItemContentProviderFactory> delegates;
-
-
- public JaxbNavigatorTreeItemContentProviderFactory() {
- super();
- this.delegates = new HashMap<JaxbPlatformDescription, TreeItemContentProviderFactory>();
- }
-
- public TreeItemContentProvider buildItemContentProvider(Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- TreeItemContentProviderFactory delegate = getDelegate(item);
- if (delegate != null) {
- return delegate.buildItemContentProvider(item, contentAndLabelProvider);
- }
- return null;
- }
-
-
- private TreeItemContentProviderFactory getDelegate(Object element) {
- if (! (element instanceof IAdaptable)) {
- return null;
- }
-
- JaxbContextNode contextNode = (JaxbContextNode) ((IAdaptable) element).getAdapter(JaxbContextNode.class);
-
- if (contextNode == null) {
- return null;
- }
-
- JaxbPlatformDescription platformDesc = contextNode.getJaxbProject().getPlatform().getDescription();
- if (delegates.containsKey(platformDesc)) {
- return delegates.get(platformDesc);
- }
- JaxbPlatformUi platformUi = JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(platformDesc);
- TreeItemContentProviderFactory delegate =
- (platformUi == null) ? null : platformUi.getNavigatorUi().getTreeItemContentProviderFactory();
- delegates.put(platformDesc, delegate);
- return delegate;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java
deleted file mode 100644
index b9d905d198..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.platform;
-
-import org.eclipse.jpt.common.core.internal.utility.XPointTools;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-public class JaxbPlatformUiConfig {
-
- private String id;
- private String pluginId;
- private JaxbPlatformDescription jaxbPlatform;
- private String className;
- private JaxbPlatformUi platformUi;
-
-
- JaxbPlatformUiConfig() {
- super();
- }
-
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- this.jaxbPlatform = jaxbPlatform;
- }
-
- public String getClassName() {
- return this.className;
- }
-
- void setClassName(String className) {
- this.className = className;
- }
-
- public JaxbPlatformUi getPlatformUi() {
- if (this.platformUi == null) {
- this.platformUi = XPointTools.instantiate(
- this.pluginId, JaxbPlatformUiManagerImpl.QUALIFIED_EXTENSION_POINT_ID,
- this.className, JaxbPlatformUi.class);
- }
- return this.platformUi;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java
deleted file mode 100644
index 9a82bc98d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.platform;
-
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
-import org.eclipse.jpt.common.utility.internal.KeyedSet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUiManager;
-
-public class JaxbPlatformUiManagerImpl
- implements JaxbPlatformUiManager {
-
- static final String EXTENSION_POINT_ID = "jaxbPlatformUis"; //$NON-NLS-1$
- static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbUiPlugin.PLUGIN_ID_ + EXTENSION_POINT_ID; //$NON-NLS-1$
- static final String PLATFORM_UI_ELEMENT = "jaxbPlatformUi"; //$NON-NLS-1$
- static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
- static final String PLATFORM_ATTRIBUTE = "jaxbPlatform"; //$NON-NLS-1$
- static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
-
-
- private static final JaxbPlatformUiManagerImpl INSTANCE = new JaxbPlatformUiManagerImpl();
-
-
- public static JaxbPlatformUiManagerImpl instance() {
- return INSTANCE;
- }
-
-
- private KeyedSet<String, JaxbPlatformUiConfig> platformUiConfigs;
- private KeyedSet<JaxbPlatformDescription, JaxbPlatformUiConfig> platformToUiConfigs;
-
-
- // ********** constructor/initialization **********
-
- private JaxbPlatformUiManagerImpl() {
- super();
- this.platformUiConfigs = new KeyedSet<String, JaxbPlatformUiConfig>();
- this.platformToUiConfigs = new KeyedSet<JaxbPlatformDescription, JaxbPlatformUiConfig>();
- readExtensions();
- }
-
-
- private void readExtensions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint xpoint
- = registry.getExtensionPoint(JptJaxbUiPlugin.PLUGIN_ID, EXTENSION_POINT_ID);
-
- if (xpoint == null) {
- throw new IllegalStateException();
- }
-
- List<IConfigurationElement> platformUiConfigs = new ArrayList<IConfigurationElement>();
-
- for (IExtension extension : xpoint.getExtensions()) {
- for (IConfigurationElement configElement : extension.getConfigurationElements()) {
- if (configElement.getName().equals(PLATFORM_UI_ELEMENT)) {
- platformUiConfigs.add(configElement);
- }
- }
- }
-
- for (IConfigurationElement configElement: platformUiConfigs) {
- readPlatformUiExtension(configElement);
- }
- }
-
- private void readPlatformUiExtension(IConfigurationElement element) {
- try {
- JaxbPlatformUiConfig platformUiConfig = new JaxbPlatformUiConfig();
-
- // plug-in id
- platformUiConfig.setPluginId(element.getContributor().getName());
-
- // id
- platformUiConfig.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformUiConfigs.containsKey(platformUiConfig.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, platformUiConfig.getId());
- throw new XPointException();
- }
-
- // jaxb platform id
- String jaxbPlatformId = findRequiredAttribute(element, PLATFORM_ATTRIBUTE);
- JaxbPlatformDescription jaxbPlatform =
- JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform(jaxbPlatformId);
-
- if (jaxbPlatform == null) {
- logInvalidValue(element, PLATFORM_ATTRIBUTE, jaxbPlatformId);
- }
-
- if (this.platformToUiConfigs.containsKey(jaxbPlatform)) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, PLATFORM_ATTRIBUTE, jaxbPlatformId);
- throw new XPointException();
- }
-
- platformUiConfig.setJaxbPlatform(jaxbPlatform);
-
- // class
- platformUiConfig.setClassName(findRequiredAttribute(element, CLASS_ATTRIBUTE));
-
- this.platformUiConfigs.addItem(platformUiConfig.getId(), platformUiConfig);
- this.platformToUiConfigs.addItem(jaxbPlatform, platformUiConfig);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
- public JaxbPlatformUi getJaxbPlatformUi(JaxbPlatformDescription platformDesc) {
- JaxbPlatformUiConfig config = this.platformToUiConfigs.getItem(platformDesc);
- return (config == null) ? null : config.getPlatformUi();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
deleted file mode 100644
index 96fb670b28..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.eclipse.jpt.jaxb.ui.internal.properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-
-/**
- * Treat the JAXB project as an "aspect" of the Eclipse project (IProject);
- * but the JAXB project is stored in the JAXB model, not the Eclipse project
- * itself....
- * We also need to listen for the JAXB project to be rebuilt if the user
- * changes the Eclipse project's JAXB platform (which is stored in the
- * Eclipse project's preferences).
- */
-class JaxbProjectModel
- extends AspectPropertyValueModelAdapter<IProject, JaxbProject> {
-
- /**
- * The JAXB project may also change via another page (notably, the project facets page).
- * In that case, the preference change occurs before we actually have another project,
- * so we must listen to the projects manager
- */
- private final CollectionChangeListener projectManagerListener;
-
-
- JaxbProjectModel(PropertyValueModel<IProject> projectModel) {
- super(projectModel);
- this.projectManagerListener = buildProjectManagerListener();
- }
-
- private CollectionChangeListener buildProjectManagerListener() {
- return new CollectionChangeAdapter() {
- // we are only looking for the project rebuild *add* event here so we can
- // determine if the platform has changed.
- // the other events are unimportant in this case
- @Override
- public void itemsAdded(CollectionAddEvent event) {
- platformChanged();
- }
- };
- }
-
- void platformChanged() {
- this.propertyChanged();
- }
-
- @Override
- protected void engageSubject_() {
- JptJaxbCorePlugin.getProjectManager().addCollectionChangeListener(
- JaxbProjectManager.JAXB_PROJECTS_COLLECTION,
- this.projectManagerListener);
- }
-
- @Override
- protected void disengageSubject_() {
- JptJaxbCorePlugin.getProjectManager().removeCollectionChangeListener(
- JaxbProjectManager.JAXB_PROJECTS_COLLECTION,
- this.projectManagerListener);
- }
-
- @Override
- protected JaxbProject buildValue_() {
- return JptJaxbCorePlugin.getJaxbProject(this.subject);
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
deleted file mode 100644
index b9eadb8d96..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.properties;
-
-import static org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi.createInstallLibraryPanel;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.core.internal.utility.ICUStringCollator;
-import org.eclipse.jpt.common.ui.internal.properties.JptProjectPropertiesPage;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Way more complicated UI than you would think....
- */
-public class JaxbProjectPropertiesPage
- extends JptProjectPropertiesPage {
-
- public static final String PROP_ID = "org.eclipse.jpt.jaxb.ui.jaxbProjectPropertiesPage"; //$NON-NLS-1$
-
- private PropertyValueModel<JaxbProject> jaxbProjectModel;
-
- private BufferedWritablePropertyValueModel<JaxbPlatformDescription> platformModel;
- private PropertyChangeListener platformListener;
-
- /* private */ static final Comparator<String> STRING_COMPARATOR = new ICUStringCollator();
-
- // ************ construction ************
-
- public JaxbProjectPropertiesPage() {
- super();
- }
-
-
- @Override
- protected void buildModels() {
- this.jaxbProjectModel = new JaxbProjectModel(this.projectModel);
-
- this.platformModel = this.buildPlatformModel();
- this.platformListener = this.buildPlatformListener();
- }
-
-
- // ***** platform ID model
-
- private BufferedWritablePropertyValueModel<JaxbPlatformDescription> buildPlatformModel() {
- return new BufferedWritablePropertyValueModel<JaxbPlatformDescription>(
- new PlatformModel(this.jaxbProjectModel), this.trigger);
- }
-
- private PropertyChangeListener buildPlatformListener(){
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- JaxbProjectPropertiesPage.this.platformChanged((JaxbPlatformDescription) event.getNewValue());
- }
- };
- }
-
- void platformChanged(JaxbPlatformDescription newPlatform) {
- if ( ! this.getControl().isDisposed()) {
- // handle null, in the case the jpa facet is changed via the facets page,
- // the library install delegate is temporarily null
- adjustLibraryProviders();
- }
- }
-
-
- // ********** LibraryFacetPropertyPage implementation **********
-
- @Override
- public IProjectFacetVersion getProjectFacetVersion() {
- return this.getFacetedProject().getInstalledVersion(JaxbFacet.FACET);
- }
-
- @Override
- protected LibraryInstallDelegate createLibraryInstallDelegate(IFacetedProject project, IProjectFacetVersion fv) {
- LibraryInstallDelegate lid = new LibraryInstallDelegate(project, fv);
- lid.addListener(buildLibraryProviderListener());
- return lid;
- }
-
- @Override
- protected void adjustLibraryProviders() {
- LibraryInstallDelegate lid = this.getLibraryInstallDelegate();
- if (lid != null) {
- List<JaxbLibraryProviderInstallOperationConfig> jaxbConfigs
- = new ArrayList<JaxbLibraryProviderInstallOperationConfig>();
- // add the currently selected one first
- JaxbLibraryProviderInstallOperationConfig currentJaxbConfig = null;
- LibraryProviderOperationConfig config = lid.getLibraryProviderOperationConfig();
- if (config instanceof JaxbLibraryProviderInstallOperationConfig) {
- currentJaxbConfig = (JaxbLibraryProviderInstallOperationConfig) config;
- jaxbConfigs.add(currentJaxbConfig);
- }
- for (ILibraryProvider lp : lid.getLibraryProviders()) {
- config = lid.getLibraryProviderOperationConfig(lp);
- if (config instanceof JaxbLibraryProviderInstallOperationConfig
- && ! config.equals(currentJaxbConfig)) {
- jaxbConfigs.add((JaxbLibraryProviderInstallOperationConfig) config);
- }
- }
- for (JaxbLibraryProviderInstallOperationConfig jaxbConfig : jaxbConfigs) {
- jaxbConfig.setJaxbPlatform(this.platformModel.getValue());
- }
- }
- }
-
-
- // ********** page **********
-
- @Override
- protected void createWidgets(Composite parent) {
- buildPlatformGroup(parent);
-
- Control libraryProviderComposite = createInstallLibraryPanel(
- parent,
- getLibraryInstallDelegate(),
- JptJaxbUiMessages.JaxbFacetWizardPage_jaxbImplementationLabel);
-
- libraryProviderComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, JaxbHelpContextIds.PROPERTIES_JAVA_PERSISTENCE);
- }
-
- @Override
- protected void engageListeners() {
- super.engageListeners();
- this.platformModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.platformListener);
- }
-
- @Override
- public void disengageListeners() {
- this.platformModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.platformListener);
- super.disengageListeners();
- }
-
-
- // ********** platform group **********
-
- private void buildPlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptJaxbUiMessages.JaxbFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Combo platformDropDown = this.buildDropDown(group);
- SWTTools.bind(
- buildPlatformChoicesModel(),
- this.platformModel,
- platformDropDown,
- JAXB_PLATFORM_LABEL_CONVERTER);
-
- buildFacetsPageLink(group, JptJaxbUiMessages.JaxbFacetWizardPage_facetsPageLink);
- }
-
- /**
- * Add the project's JAXB platform if it is not on the list of valid
- * platforms.
- * <p>
- * This is probably only useful if the project is corrupted
- * and has a platform that exists in the registry but is not on the
- * list of valid platforms for the project's JAXB facet version.
- * Because, if the project's JAXB platform is completely invalid, there
- * would be no JAXB project!
- */
- @SuppressWarnings("unchecked")
- private ListValueModel<JaxbPlatformDescription> buildPlatformChoicesModel() {
- return new SortedListValueModelAdapter<JaxbPlatformDescription>(
- new SetCollectionValueModel<JaxbPlatformDescription>(
- new CompositeCollectionValueModel<CollectionValueModel<JaxbPlatformDescription>, JaxbPlatformDescription>(
- new PropertyCollectionValueModelAdapter<JaxbPlatformDescription>(this.platformModel),
- buildRegistryPlatformsModel())),
- JAXB_PLATFORM_COMPARATOR);
- }
-
- private CollectionValueModel<JaxbPlatformDescription> buildRegistryPlatformsModel() {
- Iterable<JaxbPlatformDescription> enabledPlatforms =
- new FilteringIterable<JaxbPlatformDescription>(
- JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatforms()) {
- @Override
- protected boolean accept(JaxbPlatformDescription o) {
- return o.supportsJaxbFacetVersion(getProjectFacetVersion());
- }
- };
- return new StaticCollectionValueModel<JaxbPlatformDescription>(enabledPlatforms);
- }
-
- private static final Comparator<JaxbPlatformDescription> JAXB_PLATFORM_COMPARATOR =
- new Comparator<JaxbPlatformDescription>() {
- public int compare(JaxbPlatformDescription desc1, JaxbPlatformDescription desc2) {
- return STRING_COMPARATOR.compare(desc1.getLabel(), desc2.getLabel());
- }
- };
-
- private static final StringConverter<JaxbPlatformDescription> JAXB_PLATFORM_LABEL_CONVERTER =
- new StringConverter<JaxbPlatformDescription>() {
- public String convertToString(JaxbPlatformDescription desc) {
- return desc.getLabel();
- }
- };
-
-
- // ********** OK/Revert/Apply behavior **********
-
- @Override
- protected boolean projectRebuildRequired() {
- return this.platformModel.isBuffering();
- }
-
- @Override
- protected void rebuildProject() {
- // if the JAXB platform is changed, we need to completely rebuild the JAXB project
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(getProject());
- }
-
- @Override
- protected BufferedWritablePropertyValueModel<?>[] buildBufferedModels() {
- return new BufferedWritablePropertyValueModel[] {
- this.platformModel
- };
- }
-
-
- // ********** validation **********
-
- @Override
- protected Model[] buildValidationModels() {
- return new Model[] {
- platformModel
- };
- }
-
- @Override
- protected void performValidation(Map<Integer, ArrayList<IStatus>> statuses) {
- /* platform */
- // user is unable to unset the platform, so no validation necessary
-
- /* library provider */
- super.performValidation(statuses);
- }
-
-
- // ********** UI model adapters **********
-
- /**
- * Treat the JAXB platform as an "aspect" of the JAXB project.
- * The platform ID is stored in the project preferences.
- * The platform ID does not change for a JAXB project - if the user wants a
- * different platform, we build an entirely new JAXB project.
- */
- static class PlatformModel
- extends AspectPropertyValueModelAdapter<JaxbProject, JaxbPlatformDescription> {
-
- PlatformModel(PropertyValueModel<JaxbProject> jaxbProjectModel) {
- super(jaxbProjectModel);
- }
-
- @Override
- protected JaxbPlatformDescription buildValue_() {
- return this.subject.getPlatform().getDescription();
- }
-
- @Override
- public void setValue_(JaxbPlatformDescription newPlatform) {
- JptJaxbCorePlugin.setJaxbPlatform(this.subject.getProject(), newPlatform);
- }
-
- @Override
- protected void engageSubject_() {
- // the platform ID does not change
- }
-
- @Override
- protected void disengageSubject_() {
- // the platform ID does not change
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
deleted file mode 100644
index 5667c41aa4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
+++ /dev/null
@@ -1,962 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.properties;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.layout.TableColumnLayout;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.ToolTip;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.SelectFileOrXMLCatalogIdPanel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * Shows the schemas associated with a JAXB project
- */
-public class JaxbSchemasPropertiesPage
- extends PropertyPage {
-
- private static final int SIZING_SELECTION_PANE_WIDTH = 450;
-
-
- protected final WritablePropertyValueModel<IProject> projectModel;
-
- private final PropertyValueModel<JaxbProject> jaxbProjectModel;
-
- protected final BufferedWritablePropertyValueModel.Trigger trigger;
-
- private final SchemasModel schemasModel;
-
- private final WritableCollectionValueModel<Schema> schemasSelectionModel;
-
-
- public JaxbSchemasPropertiesPage() {
- super();
- this.projectModel = new SimplePropertyValueModel<IProject>();
- this.jaxbProjectModel = new JaxbProjectModel(this.projectModel);
- this.trigger = new BufferedWritablePropertyValueModel.Trigger();
- this.schemasModel = new SchemasModel(this.jaxbProjectModel, this.trigger);
- this.schemasSelectionModel = new SimpleCollectionValueModel<Schema>();
- setDescription(JptJaxbUiMessages.SchemasPage_description);
- }
-
-
- protected IProject getProject() {
- return this.projectModel.getValue();
- }
-
- @Override
- public final void createControl(Composite parent ) {
- super.createControl( parent );
-
- Button revertButton = getDefaultsButton();
-
- revertButton.setText(JptJaxbUiMessages.SchemasPage_revert);
-
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- Point minButtonSize = revertButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- gd.widthHint = Math.max(convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH), minButtonSize.x);
- revertButton.setLayoutData(gd);
-
- updateButtons();
-
- getShell().layout(true, true);
- }
-
- @Override
- protected final Control createContents(Composite parent) {
- IAdaptable element = getElement();
-
- IProject project = null;
- if (element instanceof IProject) {
- project = (IProject) element;
- }
- else {
- project = (IProject) Platform.getAdapterManager().loadAdapter(element, IProject.class.getName());
- }
-
- this.projectModel.setValue(project);
-
- Composite pageComponent = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- pageComponent.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = SIZING_SELECTION_PANE_WIDTH;
- pageComponent.setLayoutData(data);
-
- Label schemasLabel = new Label(pageComponent, SWT.LEFT);
- schemasLabel.setText(JptJaxbUiMessages.SchemasPage_schemas);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- schemasLabel.setLayoutData(data);
-
- // create the table composite
- Composite tableComposite = new Composite(pageComponent, SWT.NONE);
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.widthHint = SIZING_SELECTION_PANE_WIDTH;
- tableComposite.setLayoutData(data);
-
- // create the table
- TableViewer schemasTable = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
- TableModelAdapter.adapt(
- new SortedListValueModelAdapter<Schema>(this.schemasModel),
- this.schemasSelectionModel,
- schemasTable.getTable(),
- new SchemaColumnAdapter(),
- new SchemaTableLabelProvider());
- ColumnViewerToolTipSupport.enableFor(schemasTable, ToolTip.NO_RECREATE);
- schemasTable.getTable().setHeaderVisible(true);
- schemasTable.getTable().setToolTipText(null);
-
- // set the table composite layout (after the table, so that column information is available)
- TableColumnLayout tableLayout = new TableColumnLayout();
- tableLayout.setColumnData(schemasTable.getTable().getColumn(0), new ColumnWeightData(15));
- tableLayout.setColumnData(schemasTable.getTable().getColumn(1), new ColumnWeightData(25));
- tableComposite.setLayout(tableLayout);
-
- // set the table layout data
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = schemasTable.getTable().getItemHeight() * 7;
- data.widthHint = 200;
- schemasTable.getTable().setLayoutData(data);
-
- createButtonGroup(pageComponent);
-
- Dialog.applyDialogFont(parent);
-
- return pageComponent;
- }
-
- protected void createButtonGroup(Composite parent) {
- Composite groupComponent = new Composite(parent, SWT.NULL);
- GridLayout groupLayout = new GridLayout();
- groupLayout.marginWidth = 0;
- groupLayout.marginHeight = 0;
- groupComponent.setLayout(groupLayout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- groupComponent.setLayoutData(data);
-
- Button addButton = new Button(groupComponent, SWT.PUSH);
- addButton.setText(JptJaxbUiMessages.SchemasPage_addButtonLabel);
- addButton.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- addSchema();
- }
- });
- setButtonLayoutData(addButton);
-
- Button editButton = new Button(groupComponent, SWT.PUSH);
- editButton.setText(JptJaxbUiMessages.SchemasPage_editButtonLabel);
- editButton.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- editSelectedSchema();
- }
- });
- SWTTools.controlEnabledState(buildEditEnabledModel(), editButton);
- setButtonLayoutData(editButton);
-
- Button removeButton = new Button(groupComponent, SWT.PUSH);
- removeButton.setText(JptJaxbUiMessages.SchemasPage_removeButtonLabel);
- removeButton.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- removeSelectedSchemas();
- }
- });
- SWTTools.controlEnabledState(buildRemoveEnabledModel(), removeButton);
- setButtonLayoutData(removeButton);
- }
-
-
- private void addSchema() {
- // constructs a dialog for editing the new schema namespace and location
- AddEditSchemaDialog dialog =
- new AddEditSchemaDialog(
- getShell(),
- null,
- this.schemasModel.getValue());
-
- // opens the dialog - just returns if the user cancels it
- if (dialog.open() == Window.CANCEL) {
- return;
- }
-
- // otherwise, adds the new schema
- Schema schema = this.schemasModel.addSchema(dialog.getNamespace(), dialog.getLocation());
-
- // select the new schema
- this.schemasSelectionModel.setValues(new SingleElementIterable<Schema>(schema));
- }
-
- private PropertyValueModel<Boolean> buildEditEnabledModel() {
- return new CollectionPropertyValueModelAdapter<Boolean>(this.schemasSelectionModel) {
- @Override
- protected Boolean buildValue() {
- return this.collectionModel.size() == 1;
- }
- };
- }
-
- private void editSelectedSchema() {
- // constructs a dialog for editing the new schema namespace and location
- final Schema schema = this.schemasSelectionModel.iterator().next();
- AddEditSchemaDialog dialog =
- new AddEditSchemaDialog(
- getShell(),
- schema,
- this.schemasModel.getValue());
-
- // opens the dialog - just returns if the user cancels it
- if (dialog.open() == Window.CANCEL) {
- return;
- }
-
- // otherwise, changes the new schema
- schema.setNamespace(dialog.getNamespace());
- schema.setLocation(dialog.getLocation());
- }
-
- private PropertyValueModel<Boolean> buildRemoveEnabledModel() {
- return new CollectionPropertyValueModelAdapter<Boolean>(this.schemasSelectionModel) {
- @Override
- protected Boolean buildValue() {
- return this.collectionModel.size() >= 1;
- }
- };
- }
-
- private void removeSelectedSchemas() {
- this.schemasModel.removeSchemas(CollectionTools.iterable(this.schemasSelectionModel.iterator()));
- }
-
- private void updateButtons() {
- boolean enableApply = isValid();
- boolean enableRevert = true;
-
- Button applyButton = getApplyButton();
-
- if (applyButton != null) {
- applyButton.setEnabled(enableApply);
- }
-
- Button revertButton = getDefaultsButton();
-
- if (revertButton != null) {
- revertButton.setEnabled(enableRevert);
- }
- }
-
-
- // ********** OK/Revert/Apply behavior **********
-
- @Override
- public boolean performOk() {
- try {
- // true=fork; false=uncancellable
- this.buildOkProgressMonitorDialog().run(true, false, this.buildOkRunnableWithProgress());
- }
- catch (InterruptedException ex) {
- return false;
- }
- catch (InvocationTargetException ex) {
- throw new RuntimeException(ex.getTargetException());
- }
-
- return true;
- }
-
- private IRunnableContext buildOkProgressMonitorDialog() {
- return new ProgressMonitorDialog(this.getShell());
- }
-
- private IRunnableWithProgress buildOkRunnableWithProgress() {
- return new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- try {
- // the build we execute in #performOk_() locks the workspace root,
- // so we need to use the workspace root as our scheduling rule here
- ws.run(
- buildOkWorkspaceRunnable(),
- ws.getRoot(),
- IWorkspace.AVOID_UPDATE,
- monitor);
- }
- catch (CoreException ex) {
- throw new InvocationTargetException(ex);
- }
- }
- };
- }
-
- /* private */ IWorkspaceRunnable buildOkWorkspaceRunnable() {
- return new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- performOk_(monitor);
- }
- };
- }
-
- void performOk_(IProgressMonitor monitor) throws CoreException {
- if (this.schemasModel.hasChanges()) {
- this.trigger.accept();
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(getProject());
- getProject().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- }
- }
-
- @Override
- protected void performDefaults() {
- this.trigger.reset();
- }
-
- @Override
- public void dispose() {
-
- super.dispose();
- }
-
-
- static class SchemasModel
- extends AspectAdapter<JaxbProject>
- implements CollectionValueModel<Schema> {
-
- /**
- * The collection of schemas
- */
- protected final Collection<Schema> schemas;
-
- /**
- * This is the trigger that indicates whether the buffered value
- * should be accepted or reset.
- */
- protected final PropertyValueModel<Boolean> triggerHolder;
-
- /** This listens to the trigger holder. */
- protected final PropertyChangeListener triggerChangeListener;
-
-
- SchemasModel(PropertyValueModel<JaxbProject> subjectHolder, PropertyValueModel<Boolean> triggerHolder) {
- super(subjectHolder);
- this.schemas = new ArrayList<Schema>();
- this.triggerHolder = triggerHolder;
- this.triggerChangeListener = buildTriggerChangeListener();
- }
-
-
- protected PropertyChangeListener buildTriggerChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- triggerChanged(event);
- }
- };
- }
-
- protected Collection<Schema> buildSchemas_() {
- ArrayList<Schema> schemas = new ArrayList<Schema>();
- for (Map.Entry<String, String> entry : this.subject.getSchemaLibrary().getSchemaLocations().entrySet()) {
- schemas.add(new Schema(entry.getKey(), entry.getValue()));
- }
- return schemas;
- }
-
- public boolean hasChanges() {
- return (this.subject == null) ? false : ! this.schemas.equals(buildSchemas_());
- }
-
- protected void triggerChanged(PropertyChangeEvent event) {
- if (hasChanges()) {
- if (this.subject != null && ((Boolean) event.getNewValue()).booleanValue()) {
- this.accept();
- } else {
- this.reset();
- }
- }
- }
-
- public void accept() {
- Map<String, String> schemaLocations = new HashMap<String, String>();
- for (Schema schema : this.schemas) {
- schemaLocations.put(schema.getNamespace(), schema.getLocation());
- }
- this.subject.getSchemaLibrary().setSchemaLocations(schemaLocations);
- }
-
- public void reset() {
- this.schemas.clear();
- if (this.subject != null) {
- this.schemas.addAll(buildSchemas_());
- }
- fireCollectionChanged(VALUES, getValue());
- }
-
- public Schema addSchema(String namespace, String location) {
- Schema schema = new Schema(namespace, location);
- addItemToCollection(schema, this.schemas, VALUES);
- return schema;
- }
-
- public void removeSchemas(Iterable<Schema> schemas) {
- removeItemsFromCollection(schemas, this.schemas, VALUES);
- }
-
-
- // ************ AspectAdapter impl ************************************
-
- @Override
- protected String getListenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected boolean hasListeners() {
- return hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- fireCollectionChanged(VALUES, getValue());
- }
-
- @Override
- protected void engageSubject_() {
- this.schemas.addAll(buildSchemas_());
- }
-
- @Override
- protected void disengageSubject_() {
- this.schemas.clear();
- }
-
- @Override
- protected void engageModels() {
- super.engageModels();
- this.triggerHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.triggerChangeListener);
- }
-
- @Override
- protected void disengageModels() {
- this.triggerHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.triggerChangeListener);
- super.disengageModels();
- }
-
- @Override
- protected Collection<Schema> getValue() {
- return CollectionTools.collection(iterator());
- }
-
-
- // ************ CollectionValueModel impl *****************************
-
- public Iterator<Schema> iterator() {
- return this.schemas.iterator();
- }
-
- public int size() {
- return this.schemas.size();
- }
- }
-
-
- static class Schema
- extends AbstractModel
- implements Comparable<Schema> {
-
- static String locationDisplayString(String location) {
- if (location == null) {
- return "";
- }
-
- URI uri = URI.createURI(location);
- if (uri.isPlatformResource()) {
- return uri.toPlatformString(false);
- }
-
- return location;
- }
-
- static String namespaceDisplayString(String namespace) {
- if ("".equals(namespace)) {
- return JptJaxbUiMessages.SchemasPage_noNamespaceText;
- }
- else if (null == namespace) {
- return "";
- }
-
- return namespace;
- }
-
- Schema(String namespace, String location) {
- super();
- this.namespace = namespace;
- this.location = location;
- }
-
-
- private String namespace;
- final static String NAMESPACE_PROPERTY = "namespace";
-
- private String location;
- final static String LOCATION_PROPERTY = "location";
-
-
- String getNamespace() {
- return this.namespace;
- }
-
- void setNamespace(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- String namespaceDisplayString() {
- return namespaceDisplayString(this.namespace);
- }
-
- String getLocation() {
- return this.location;
- }
-
- String locationDisplayString() {
- return locationDisplayString(getLocation());
- }
-
- void setLocation(String location) {
- String old = this.location;
- this.location = location;
- firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- public int compareTo(Schema o) {
- return this.namespace.compareTo(o.namespace);
- }
- }
-
-
- static class SchemaColumnAdapter
- implements ColumnAdapter<Schema> {
-
- static final int COLUMN_COUNT = 2;
- static final int NAMESPACE_COLUMN = 0;
- static final int LOCATION_COLUMN = 1;
-
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
- switch (columnIndex) {
- case NAMESPACE_COLUMN :
- return JptJaxbUiMessages.SchemasPage_namespaceColumnLabel;
- case LOCATION_COLUMN :
- return JptJaxbUiMessages.SchemasPage_locationColumnLabel;
- default :
- return null;
- }
- }
-
- public WritablePropertyValueModel<?>[] cellModels(Schema subject) {
- WritablePropertyValueModel<?>[] cellModels = new WritablePropertyValueModel<?>[COLUMN_COUNT];
- cellModels[NAMESPACE_COLUMN] = buildNamespaceCellModel(subject);
- cellModels[LOCATION_COLUMN] = buildLocationCellModel(subject);
- return cellModels;
- }
-
- private WritablePropertyValueModel<String> buildNamespaceCellModel(Schema subject) {
- return new PropertyAspectAdapter<Schema, String>(Schema.NAMESPACE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getNamespace();
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildLocationCellModel(Schema subject) {
- return new PropertyAspectAdapter<Schema, String>(Schema.LOCATION_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getLocation();
- }
- };
- }
- }
-
-
- static class SchemaTableLabelProvider
- extends LabelProvider
- implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- switch (columnIndex) {
- case SchemaColumnAdapter.NAMESPACE_COLUMN :
- return ((Schema) element).namespaceDisplayString();
- case SchemaColumnAdapter.LOCATION_COLUMN :
- return ((Schema) element).locationDisplayString();
- default :
- return null;
- }
- }
- }
-
-
- static class AddEditSchemaDialog
- extends TitleAreaDialog {
-
- private Schema currentSchema;
-
- private String defaultMessage;
-
- private final WritablePropertyValueModel<String> location;
-
- private final WritablePropertyValueModel<String> namespace;
-
- private XSDSchema resolvedSchema;
-
- private final Mode mode;
-
- private Iterable<Schema> allSchemas;
-
-
- public AddEditSchemaDialog(Shell shell, Schema currentSchema, Iterable<Schema> allSchemas) {
- super(shell);
- this.currentSchema = currentSchema;
- this.allSchemas = allSchemas;
- this.location = new SimplePropertyValueModel<String>();
- this.namespace = new SimplePropertyValueModel<String>();
-
- this.mode = (this.currentSchema == null) ? Mode.ADD : Mode.EDIT;
- if (this.mode == Mode.ADD) {
- this.defaultMessage = JptJaxbUiMessages.SchemasPage_addSchemaMessage;
- this.location.setValue(null);
- this.namespace.setValue(null);
- }
- else {
- this.defaultMessage = JptJaxbUiMessages.SchemasPage_editSchemaMessage;
- this.location.setValue(currentSchema.getLocation());
- this.namespace.setValue(currentSchema.getNamespace());
- }
- }
-
-
- @Override
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- if (this.mode == Mode.ADD) {
- newShell.setText(JptJaxbUiMessages.SchemasPage_addSchemaDialogTitle);
- }
- else {
- newShell.setText(JptJaxbUiMessages.SchemasPage_editSchemaDialogTitle);
- }
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- setMessage(this.defaultMessage);
- if (this.mode == Mode.ADD) {
- setTitle(JptJaxbUiMessages.SchemasPage_addSchemaTitle);
- }
- else {
- setTitle(JptJaxbUiMessages.SchemasPage_editSchemaTitle);
- }
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- composite.setLayout(new GridLayout(3, false));
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label locationLabel = new Label(composite, SWT.NULL);
- locationLabel.setText(JptJaxbUiMessages.SchemasPage_locationLabel);
- locationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
- final Text locationText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- locationText.setText(locationDisplayString());
- locationText.setEditable(false);
- locationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- this.location.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- locationText.setText(locationDisplayString());
- }
- });
-
- Button browseButton = new Button(composite, SWT.PUSH);
- browseButton.setText(JptJaxbUiMessages.SchemasPage_browseButtonLabel);
- browseButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, true, 1, 1));
- browseButton.addSelectionListener(
- new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- browseForSchemaLocation();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Label namespaceLabel = new Label(composite, SWT.NULL);
- namespaceLabel.setText(JptJaxbUiMessages.SchemasPage_namespaceLabel);
- namespaceLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
- final Text namespaceText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- namespaceText.setText(namespaceDisplayString());
- namespaceText.setEditable(false);
- namespaceText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- this.namespace.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- namespaceText.setText(namespaceDisplayString());
- }
- });
-
- Dialog.applyDialogFont(dialogArea);
-
- return dialogArea;
- }
-
- @Override
- public void create() {
- super.create();
-
- // disable ok button until user does something and then validation takes over
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
-
- @Override
- protected boolean isResizable() {
- return true;
- }
-
- private void browseForSchemaLocation() {
- SchemaLocationDialog dialog = new SchemaLocationDialog(getShell());
-
- // opens the dialog - just returns if the user cancels it
- if (dialog.open() == Window.CANCEL) {
- return;
- }
-
- String location = dialog.getLocation();
- this.location.setValue(location);
-
- String resolvedUri = XsdUtil.getResolvedUri(null, location);
-
- XSDSchema schema = XSDImpl.buildXSDModel(resolvedUri);
- String newNamespace =
- (schema == null) ?
- null
- : ((schema.getTargetNamespace()) == null ?
- ""
- : schema.getTargetNamespace());
- this.namespace.setValue(newNamespace);
- this.resolvedSchema = schema;
-
- validate();
- }
-
- public String getNamespace() {
- return this.namespace.getValue();
- }
-
- protected String namespaceDisplayString() {
- return Schema.namespaceDisplayString(getNamespace());
- }
-
- public String getLocation() {
- return this.location.getValue();
- }
-
- protected String locationDisplayString() {
- return Schema.locationDisplayString(getLocation());
- }
-
- private void validate() {
- if (this.resolvedSchema == null) {
- setErrorMessage(JptJaxbUiMessages.SchemasPage_schemaUnresolvedMessage);
- }
- else if (isDuplicateNamespace()) {
- setErrorMessage(JptJaxbUiMessages.SchemasPage_duplicateNamespaceMessage);
- }
- else if (StringTools.stringIsEmpty(this.location.getValue())) {
- setErrorMessage(JptJaxbUiMessages.SchemasPage_noLocationMessage);
- }
- else {
- setErrorMessage(null);
- setMessage(this.defaultMessage);
- }
- getButton(IDialogConstants.OK_ID).setEnabled(getErrorMessage() == null);
- }
-
- private boolean isDuplicateNamespace() {
- for (Schema schema : this.allSchemas) {
- if ((this.currentSchema != schema) && getNamespace().equals(schema.getNamespace())) {
- return true;
- }
- }
- return false;
- }
-
-
- private enum Mode {
- ADD,
- EDIT
- }
- }
-
-
- static class SchemaLocationDialog
- extends TrayDialog {
-
- private SelectFileOrXMLCatalogIdPanel locationPanel;
-
- private String location;
-
-
- public SchemaLocationDialog(Shell shell) {
- super(shell);
- }
-
-
- @Override
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(JptJaxbUiMessages.SchemasPage_chooseLocationTitle);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- this.locationPanel = new SelectFileOrXMLCatalogIdPanel(composite, StructuredSelection.EMPTY);
- this.locationPanel.setFilterExtensions(new String[] {".xsd"});
- this.locationPanel.update();
- this.locationPanel.setVisibleHelper(true);
-
- return composite;
- }
-
- @Override
- protected boolean isResizable() {
- return true;
- }
-
- @Override
- protected void okPressed() {
- IFile file = this.locationPanel.getFile();
- if (file != null) {
- this.location = URI.createPlatformResourceURI(file.getFullPath().toString(), false).toString();
- }
- else {
- this.location = this.locationPanel.getXMLCatalogId();
- }
-
- super.okPressed();
- }
-
- public String getLocation() {
- return this.location;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java
deleted file mode 100644
index 89c3c8ca3e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * ProjectWizardPage
- */
-public class ProjectWizardPage extends WizardPage
-{
- private IJavaProject javaProject;
- private ProjectGroup projectGroup;
-
- // ********** static methods **********
-
- public static IJavaProject getJavaProjectFromSelection(IStructuredSelection selection) {
- if(selection == null) {
- return null;
- }
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IJavaProject) {
- return (IJavaProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- IProject project = ((IResource) firstElement).getProject();
- return getJavaProjectFrom(project);
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject();
- }
- return null;
- }
-
- public static IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-
- // ********** constructor **********
-
- public ProjectWizardPage() {
- super("Java Project"); //$NON-NLS-1$
-
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorProjectWizardPage_desc);
- }
-
- public ProjectWizardPage(IJavaProject javaProject) {
- this();
-
- this.javaProject = javaProject;
- }
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- return this.javaProject;
- }
-
- // ********** internal methods **********
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new FillLayout());
- this.projectGroup = new ProjectGroup(composite);
- Dialog.applyDialogFont(parent);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
- return composite;
- }
-
- private void setJavaProject(IJavaProject project) {
- this.javaProject = project;
- }
-
- private void projectChanged() {
- this.setPageComplete(false);
- String projectName = this.projectGroup.getProjectName();
- if( ! StringTools.stringIsEmpty(projectName)) {
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- this.setJavaProject(JavaCore.create(project));
- this.setPageComplete(true);
- }
- }
-
- // ********** project group **********
-
- class ProjectGroup {
-
- private Combo projectCombo;
-
-
- // ********** constructor **********
-
- private ProjectGroup(Composite parent) {
- super();
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(2, false));
-
- // Project
- this.buildLabel(composite, JptJaxbUiMessages.JavaProjectWizardPage_project);
- this.projectCombo = this.buildProjectCombo(composite, this.buildProjectComboSelectionListener());
- this.updateProjectCombo();
-
- setPageComplete( ! StringTools.stringIsEmpty(this.getProjectName()));
- }
-
- // ********** listeners **********
-
- private SelectionListener buildProjectComboSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // nothing special for "default" (double-click?)
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- ProjectGroup.this.selectedProjectChanged();
- }
- @Override
- public String toString() {
- return "JavaProjectWizardPage project combo-box selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- // ********** listener callbacks **********
-
- void selectedProjectChanged() {
- projectChanged();
- }
-
- // ********** intra-wizard methods **********
-
- protected String getProjectName() {
- return this.projectCombo.getText();
- }
-
- // ********** internal methods **********
-
- protected void updateProjectCombo() {
-
- this.projectCombo.removeAll();
-
- for (String name : this.getSortedJavaProjectsNames()) {
- this.projectCombo.add(name);
- }
- if(javaProject != null) {
- this.projectCombo.select(this.projectCombo.indexOf(javaProject.getProject().getName()));
- }
- }
-
- private String[] getSortedJavaProjectsNames() {
- return ArrayTools.sort(this.getJavaProjectsNames());
- }
-
- private String[] getJavaProjectsNames() {
- return ArrayTools.array(
- new TransformationIterable<IProject, String>(this.getJavaProjects()) {
- @Override
- protected String transform(IProject project) {
- return project.getName();
- }
- },
- new String[0]);
- }
-
- private Iterable<IProject> getJavaProjects() {
- return new FilteringIterable<IProject>(CollectionTools.collection(this.getProjects())) {
- @Override
- protected boolean accept(IProject next) {
- try {
- return next.hasNature(JavaCore.NATURE_ID);
- }
- catch (CoreException e) {
- return false;
- }
- }
- };
- }
-
- private Iterator<IProject> getProjects() {
- return new ArrayIterator<IProject>(ResourcesPlugin.getWorkspace().getRoot().getProjects());
- }
-
- // ********** UI components **********
-
- private Label buildLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setLayoutData(new GridData());
- label.setText(text);
- return label;
- }
-
- private Combo buildProjectCombo(Composite parent, SelectionListener listener) {
- Combo projectCombo = new Combo(parent, SWT.READ_ONLY);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- projectCombo.setLayoutData(gridData);
- projectCombo.addSelectionListener(listener);
- return projectCombo;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
deleted file mode 100644
index 7a98424b23..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * ClassesGeneratorExtensionOptionsWizardPage
- */
-public class ClassesGeneratorExtensionOptionsWizardPage extends WizardPage
-{
- public static final String TARGET_OPTION = "-target "; //$NON-NLS-1$
-
- private ExtensionOptionsComposite additionalArgsComposite;
-
- // ********** constructor **********
-
- protected ClassesGeneratorExtensionOptionsWizardPage() {
- super("Classes Generator Extension Options"); //$NON-NLS-1$
-
- this.initialize();
- }
-
- protected void initialize() {
- this.setTitle(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_title);
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_desc);
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.additionalArgsComposite = new ExtensionOptionsComposite(composite);
-
- return composite;
- }
-
- // ********** intra-wizard methods **********
-
- protected boolean allowsExtensions() {
- return this.additionalArgsComposite.allowsExtensions();
- }
-
- protected String getClasspath() {
- return this.additionalArgsComposite.getClasspath();
- }
-
- protected String getAdditionalArgs() {
- return this.additionalArgsComposite.getAdditionalArgs();
- }
-
- // ********** private methods **********
-
- private String getFacetVersion() {
- IProjectFacetVersion projectFacetVersion = this.getProjectFacetVersion();
- return (projectFacetVersion == null) ? null : projectFacetVersion.getVersionString();
- }
-
- private IProjectFacetVersion getProjectFacetVersion() {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(this.getProject());
- }
- catch(CoreException e) {
- JptJaxbUiPlugin.log(e);
- return null;
- }
- return (facetedProject == null) ? null : facetedProject.getProjectFacetVersion(JaxbFacet.FACET);
- }
-
- private IProject getProject() {
- return ((ClassesGeneratorWizard)this.getWizard()).getJavaProject().getProject();
- }
-
- // ********** ExtensionOptionsComposite **********
-
- class ExtensionOptionsComposite {
-
- private boolean allowsExtensions;
- private final Text classpathText;
- private final Button allowsExtensionsCheckBox;
-
- private final Text additionalArgsText;
-
- // ********** constructor **********
-
- private ExtensionOptionsComposite(Composite parent) {
- super();
- this.allowsExtensions = false;
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, HELP_CONTEXT_ID);
-
- this.allowsExtensionsCheckBox = this.buildAllowsExtensionsCheckBox(composite, this.buildAllowsExtensionsSelectionListener());
-
- // Classpath
- Label classpathLabel = new Label(composite, SWT.NONE);
- classpathLabel.setText(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_classpath);
- GridData gridData = new GridData();
- gridData.verticalIndent = 5;
- classpathLabel.setLayoutData(gridData);
- this.classpathText = this.buildClasspathText(composite);
-
- Label additionalArgsLabel = new Label(composite, SWT.NONE);
- additionalArgsLabel.setText(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_additionalArguments);
- gridData = new GridData();
- gridData.verticalIndent = 5;
- additionalArgsLabel.setLayoutData(gridData);
- this.additionalArgsText = this.buildAdditionalArgsText(composite);
- if( ! StringTools.stringIsEmpty(getFacetVersion())) {
- this.additionalArgsText.setText(TARGET_OPTION + getFacetVersion());
- }
- }
-
- // ********** UI components **********
-
- private Button buildAllowsExtensionsCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.verticalIndent = 5;
- checkBox.setLayoutData(gridData);
- checkBox.setText(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_allowExtensions);
- checkBox.setSelection(this.allowsExtensions());
- checkBox.addSelectionListener(listener);
- return checkBox;
- }
-
- private Text buildClasspathText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
- gridData.verticalIndent = 1;
- gridData.heightHint = text.getLineHeight() * 3;
- gridData.grabExcessHorizontalSpace = true;
- text.setLayoutData(gridData);
- return text;
- }
-
- private Text buildAdditionalArgsText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
- gridData.verticalIndent = 1;
- gridData.heightHint = text.getLineHeight() * 10;
- gridData.grabExcessHorizontalSpace = true;
- text.setLayoutData(gridData);
- return text;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildAllowsExtensionsSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- ExtensionOptionsComposite.this.setAllowsExtensions(
- ExtensionOptionsComposite.this.allowsExtensionsCheckBox.getSelection());
- }
- };
- }
-
- // ********** intra-wizard methods **********
-
- protected boolean allowsExtensions() {
- return this.allowsExtensions;
- }
-
- protected void setAllowsExtensions(boolean allowsExtensions){
- this.allowsExtensions = allowsExtensions;
- }
-
- protected String getClasspath() {
- return this.classpathText.getText();
- }
-
- protected String getAdditionalArgs() {
- return this.additionalArgsText.getText();
- }
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java
deleted file mode 100644
index c6931e1985..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java
+++ /dev/null
@@ -1,770 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * ClassesGeneratorOptionsWizardPage
- */
-public class ClassesGeneratorOptionsWizardPage extends WizardPage
-{
- private ProxyOptionsComposite proxyOptionsComposite;
- private Options1Composite options1Composite;
- private Options2Composite options2Composite;
-
- // ********** constructor **********
-
- protected ClassesGeneratorOptionsWizardPage() {
- super("Classes Generator Options"); //$NON-NLS-1$
-
- this.initialize();
- }
-
- protected void initialize() {
- this.setTitle(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_title);
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_desc);
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.proxyOptionsComposite = new ProxyOptionsComposite(composite);
-
- this.buildOptionsComposites(composite);
-
- return composite;
- }
-
- private void buildOptionsComposites(Composite parent) {
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(2, true));
-
- this.options1Composite = new Options1Composite(composite);
-
- this.options2Composite = new Options2Composite(composite);
- }
-
- // ********** intra-wizard methods **********
-
- protected String getProxy() {
- return this.proxyOptionsComposite.getProxy();
- }
-
- protected String getProxyFile() {
- return this.proxyOptionsComposite.getProxyFile();
- }
-
- protected boolean usesStrictValidation() {
- return this.options1Composite.usesStrictValidation();
- }
-
- protected boolean makesReadOnly() {
- return this.options1Composite.makesReadOnly();
- }
-
- protected boolean suppressesPackageInfoGen() {
- return this.options1Composite.suppressesPackageInfoGen();
- }
-
- protected boolean suppressesHeaderGen() {
- return this.options1Composite.suppressesHeaderGen();
- }
-
- protected boolean isVerbose() {
- return this.options1Composite.isVerbose();
- }
-
- protected boolean isQuiet() {
- return this.options1Composite.isQuiet();
- }
-
- protected boolean treatsAsXmlSchema() {
- return this.options2Composite.treatsAsXmlSchema();
- }
-
- protected boolean treatsAsRelaxNg() {
- return this.options2Composite.treatsAsRelaxNg();
- }
-
- protected boolean treatsAsRelaxNgCompact() {
- return this.options2Composite.treatsAsRelaxNgCompact();
- }
-
- protected boolean treatsAsDtd() {
- return this.options2Composite.treatsAsDtd();
- }
-
- protected boolean treatsAsWsdl() {
- return this.options2Composite.treatsAsWsdl();
- }
-
- protected boolean showsVersion() {
- return this.options2Composite.showsVersion();
- }
-
- protected boolean showsHelp() {
- return this.options2Composite.showsHelp();
- }
-
- // ********** UI controls **********
-
- protected Button buildCheckBox(Composite parent, String text, SelectionListener listener, int verticalIndent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.verticalIndent= verticalIndent;
- checkBox.setLayoutData(gridData);
- checkBox.setText(text);
- checkBox.addSelectionListener(listener);
- return checkBox;
- }
-
- protected Button buildRadioButton(Composite parent, String text, SelectionListener listener, int horizontalSpan) {
- Button radioButton = new Button(parent, SWT.RADIO);
- GridData gridData = new GridData();
- gridData.horizontalSpan = horizontalSpan;
- radioButton.setLayoutData(gridData);
- radioButton.setText(text);
- radioButton.addSelectionListener(listener);
- return radioButton;
- }
-
- protected Text buildText(Composite parent, int horizontalSpan) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- gridData.horizontalSpan = horizontalSpan;
- text.setLayoutData(gridData);
- return text;
- }
-
- protected void disableText(Text text) {
- text.setEnabled(false);
- text.setText(""); //$NON-NLS-1$
- }
-
- // ********** internal methods **********
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(this.getProject().getLocation());
- return relativePath.toOSString();
- }
-
- private IProject getProject() {
- return ((ClassesGeneratorWizard)this.getWizard()).getJavaProject().getProject();
- }
-
- // ********** ProxyOptionsComposite **********
-
- class ProxyOptionsComposite {
-
- private final Button noProxyRadioButton;
-
- private final Button proxyRadioButton;
- private final Text proxyText;
-
- private final Button proxyFileRadioButton;
- private final Text proxyFileText;
- private Button browseButton;
-
- // ********** constructor **********
-
- private ProxyOptionsComposite(Composite parent) {
- super();
- Group proxyGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- proxyGroup.setLayout(layout);
- proxyGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- proxyGroup.setText(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_proxyGroup);
-
- SelectionListener proxyButtonListener = this.buildProxyRadioButtonListener();
-
- this.noProxyRadioButton = buildRadioButton(proxyGroup,
- JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_noProxy, proxyButtonListener, 3);
-
- this.proxyRadioButton = buildRadioButton(proxyGroup,
- JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_proxy, proxyButtonListener, 1);
- this.proxyText = buildText(proxyGroup, 1);
- new Label(proxyGroup, SWT.WRAP); //empty label for spacing
-
- this.proxyFileRadioButton = buildRadioButton(proxyGroup,
- JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_proxyFile, proxyButtonListener, 1);
- this.proxyFileText = buildText(proxyGroup, 1);
- this.browseButton = this.buildBrowseButton(proxyGroup);
-
- this.noProxyRadioButton.setSelection(true);
- this.proxyButtonChanged();
- }
-
- private Button buildBrowseButton(Composite parent) {
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
-
- // Browse buttons
- Button browseButton = new Button(buttonComposite, SWT.PUSH);
- browseButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_browseButton);
- gridData = new GridData();
- gridData.horizontalAlignment= GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- browseButton.setLayoutData(gridData);
-
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String filePath = promptProxyFile();
- if ( ! StringTools.stringIsEmpty(filePath)) {
- ProxyOptionsComposite.this.proxyFileText.setText(makeRelativeToProjectPath(filePath));
- }
- }
- });
- return browseButton;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildProxyRadioButtonListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- proxyButtonChanged();
- }
- };
- }
-
- private void proxyButtonChanged() {
- boolean usesProxy = ! this.noProxyRadioButton.getSelection();
- if (usesProxy) {
- if (this.proxyRadioButton.getSelection()) {
- this.proxyText.setEnabled(true);
- disableText(this.proxyFileText);
- this.browseButton.setEnabled(false);
- }
- else if (this.proxyFileRadioButton.getSelection()) {
- this.proxyFileText.setEnabled(true);
- this.browseButton.setEnabled(true);
- disableText(this.proxyText);
- }
- }
- else {
- disableText(this.proxyText);
- disableText(this.proxyFileText);
- this.browseButton.setEnabled(false);
- }
- }
-
- // ********** internal methods **********
- /**
- * The Add button was clicked, its action invokes this action which should
- * prompt the user to select a file and return it.
- */
- private String promptProxyFile() {
- IWizard wizard = ClassesGeneratorOptionsWizardPage.this.getWizard();
- String projectPath = ((ClassesGeneratorWizard)wizard).getJavaProject().getProject().getLocation().toString();
-
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_chooseAProxyFile);
- dialog.setFilterPath(projectPath);
-
- return dialog.open();
- }
-
- // ********** intra-wizard methods **********
-
- protected String getProxy() {
- return this.proxyText.getText();
- }
-
- protected String getProxyFile() {
- return this.proxyFileText.getText();
- }
- }
-
-
- // ********** Options1Composite **********
-
- class Options1Composite {
-
- private boolean usesStrictValidation;
- private final Button usesStrictValidationCheckBox;
-
- private boolean makesReadOnly;
- private final Button makesReadOnlyCheckBox;
-
- private boolean suppressesPackageInfoGen;
- private final Button suppressesPackageInfoGenCheckBox;
-
- private boolean suppressesHeaderGen;
- private final Button suppressesHeaderGenCheckBox;
-
- private boolean isVerbose;
- private final Button isVerboseCheckBox;
-
- private boolean isQuiet;
- private final Button isQuietCheckBox;
-
- // ********** constructor **********
-
- Options1Composite(Composite parent) {
- super();
- this.usesStrictValidation = true;
- this.makesReadOnly = false;
- this.suppressesPackageInfoGen = false;
- this.suppressesHeaderGen = false;
- this.isVerbose = false;
- this.isQuiet = false;
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.usesStrictValidationCheckBox = this.buildUsesStrictValidationCheckBox(composite, this.buildUsesStrictValidationSelectionListener());
- this.makesReadOnlyCheckBox = this.buildMakesReadOnlyCheckBox(composite, this.buildMakesReadOnlySelectionListener());
- this.suppressesPackageInfoGenCheckBox = this.buildSuppressesPackageInfoGenCheckBox(composite, this.buildSuppressesPackageInfoGenSelectionListener());
- this.suppressesHeaderGenCheckBox = this.buildSuppressesHeaderGenCheckBox(composite, this.buildSuppressesHeaderGenSelectionListener());
- this.isVerboseCheckBox = this.buildIsVerboseCheckBox(composite, this.buildIsVerboseSelectionListener());
- this.isQuietCheckBox = this.buildIsQuietCheckBox(composite, this.buildIsQuietSelectionListener());
- }
-
- // ********** UI components **********
-
- private Button buildUsesStrictValidationCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_useStrictValidation, listener, 5);
- checkBox.setSelection(this.usesStrictValidation());
- return checkBox;
- }
-
- private Button buildMakesReadOnlyCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_makeReadOnly, listener, 5);
- checkBox.setSelection(this.makesReadOnly());
- return checkBox;
- }
-
- private Button buildSuppressesPackageInfoGenCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_suppressPackageInfoGen, listener, 5);
- checkBox.setSelection(this.suppressesPackageInfoGen());
- return checkBox;
- }
-
- private Button buildSuppressesHeaderGenCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_suppressesHeaderGen, listener, 5);
- checkBox.setSelection(this.suppressesHeaderGen());
- return checkBox;
- }
-
- private Button buildIsVerboseCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_verbose, listener, 5);
- checkBox.setSelection(this.isVerbose());
- return checkBox;
- }
-
- private Button buildIsQuietCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_quiet, listener, 5);
- checkBox.setSelection(this.isQuiet());
- return checkBox;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildUsesStrictValidationSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setUsesStrictValidation(
- Options1Composite.this.usesStrictValidationCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildMakesReadOnlySelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setMakesReadOnly(
- Options1Composite.this.makesReadOnlyCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildSuppressesPackageInfoGenSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setSuppressesPackageInfoGen(
- Options1Composite.this.suppressesPackageInfoGenCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildSuppressesHeaderGenSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setSuppressesHeaderGen(
- Options1Composite.this.suppressesHeaderGenCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildIsVerboseSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setIsVerbose(
- Options1Composite.this.isVerboseCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildIsQuietSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setIsQuiet(
- Options1Composite.this.isQuietCheckBox.getSelection());
- }
- };
- }
-
- // ********** getters/setters *********
-
- protected boolean usesStrictValidation() {
- return this.usesStrictValidation;
- }
-
- protected void setUsesStrictValidation(boolean usesStrictValidation){
- this.usesStrictValidation = usesStrictValidation;
- }
-
- protected boolean makesReadOnly() {
- return this.makesReadOnly;
- }
-
- protected void setMakesReadOnly(boolean makesReadOnly){
- this.makesReadOnly = makesReadOnly;
- }
-
- protected boolean suppressesPackageInfoGen() {
- return this.suppressesPackageInfoGen;
- }
-
- protected void setSuppressesPackageInfoGen(boolean suppressesPackageInfoGen){
- this.suppressesPackageInfoGen = suppressesPackageInfoGen;
- }
-
- protected boolean suppressesHeaderGen() {
- return this.suppressesHeaderGen;
- }
-
- protected void setSuppressesHeaderGen(boolean suppressesHeaderGen){
- this.suppressesHeaderGen = suppressesHeaderGen;
- }
-
- protected boolean isVerbose() {
- return this.isVerbose;
- }
-
- protected void setIsVerbose(boolean isVerbose){
- this.isVerbose = isVerbose;
- }
-
- protected boolean isQuiet() {
- return this.isQuiet;
- }
-
- protected void setIsQuiet(boolean isQuiet){
- this.isQuiet = isQuiet;
- }
-
- }
-
- // ********** Options2Composite **********
-
- class Options2Composite {
-
- private boolean treatsAsXmlSchema;
- private final Button treatsAsXmlSchemaCheckBox;
-
- private boolean treatsAsRelaxNg;
- private final Button treatsAsRelaxNgCheckBox;
-
- private boolean treatsAsRelaxNgCompact;
- private final Button treatsAsRelaxNgCompactCheckBox;
-
- private boolean treatsAsDtd;
- private final Button treatsAsDtdCheckBox;
-
- private boolean treatsAsWsdl;
- private final Button treatsAsWsdlCheckBox;
-
- private boolean showsVersion;
- private final Button showsVersionCheckBox;
-
- private boolean showsHelp;
- private final Button showsHelpCheckBox;
-
- // ********** constructor **********
-
- Options2Composite(Composite parent) {
- super();
- this.treatsAsXmlSchema = false;
- this.treatsAsRelaxNg = false;
- this.treatsAsRelaxNgCompact = false;
- this.treatsAsDtd = false;
- this.treatsAsWsdl = false;
- this.showsVersion = false;
- this.showsHelp = false;
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.treatsAsXmlSchemaCheckBox = this.buildTreatsAsXmlSchemaCheckBox(composite, this.buildTreatsAsXmlSchemaSelectionListener());
- this.treatsAsRelaxNgCheckBox = this.buildTreatsAsRelaxNgCheckBox(composite, this.buildTreatsAsRelaxNgSelectionListener());
- this.treatsAsRelaxNgCompactCheckBox = this.buildTreatsAsRelaxNgCompactCheckBox(composite, this.buildTreatsAsRelaxNgCompactSelectionListener());
- this.treatsAsDtdCheckBox = this.buildTreatsAsDtdCheckBox(composite, this.buildTreatsAsDtdSelectionListener());
- this.treatsAsWsdlCheckBox = this.buildTreatsAsWsdlCheckBox(composite, this.buildTreatsAsWsdlSelectionListener());
- this.showsVersionCheckBox = this.buildVersionCheckBox(composite, this.buildVersionSelectionListener());
- this.showsHelpCheckBox = this.buildHelpCheckBox(composite, this.buildHelpSelectionListener());
- }
-
- // ********** UI components **********
-
- private Button buildTreatsAsXmlSchemaCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsXmlSchema, listener, 5);
- checkBox.setSelection(this.treatsAsXmlSchema());
- return checkBox;
- }
-
- private Button buildTreatsAsRelaxNgCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsRelaxNg, listener, 5);
- checkBox.setSelection(this.treatsAsRelaxNg());
- return checkBox;
- }
- private Button buildTreatsAsRelaxNgCompactCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsRelaxNgCompact, listener, 5);
- checkBox.setSelection(this.treatsAsRelaxNgCompact());
- return checkBox;
- }
-
- private Button buildTreatsAsDtdCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsDtd, listener, 5);
- checkBox.setSelection(this.treatsAsDtd());
- return checkBox;
- }
-
- private Button buildTreatsAsWsdlCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsWsdl, listener, 5);
- checkBox.setSelection(this.treatsAsWsdl());
- return checkBox;
- }
-
- private Button buildVersionCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_showsVersion, listener, 5);
- checkBox.setSelection(this.showsVersion());
- return checkBox;
- }
-
- private Button buildHelpCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_showsHelp, listener, 5);
- checkBox.setSelection(this.showsHelp());
- return checkBox;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildTreatsAsXmlSchemaSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsXmlSchema(
- Options2Composite.this.treatsAsXmlSchemaCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsRelaxNgSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsRelaxNg(
- Options2Composite.this.treatsAsRelaxNgCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsRelaxNgCompactSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsRelaxNgCompact(
- Options2Composite.this.treatsAsRelaxNgCompactCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsDtdSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsDtd(
- Options2Composite.this.treatsAsDtdCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsWsdlSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsWsdl(
- Options2Composite.this.treatsAsWsdlCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildVersionSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setShowsVersion(
- Options2Composite.this.showsVersionCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildHelpSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setShowsHelp(
- Options2Composite.this.showsHelpCheckBox.getSelection());
- }
- };
- }
-
- // ********** getter/setter *********
-
- protected boolean treatsAsXmlSchema() {
- return this.treatsAsXmlSchema;
- }
-
- protected void setTreatsAsXmlSchema(boolean treatsAsXmlSchema){
- this.treatsAsXmlSchema = treatsAsXmlSchema;
- }
-
- protected boolean treatsAsRelaxNg() {
- return this.treatsAsRelaxNg;
- }
-
- protected void setTreatsAsRelaxNg(boolean treatsAsRelaxNg){
- this.treatsAsRelaxNg = treatsAsRelaxNg;
- }
-
- protected boolean treatsAsRelaxNgCompact() {
- return this.treatsAsRelaxNgCompact;
- }
-
- protected void setTreatsAsRelaxNgCompact(boolean treatsAsRelaxNgCompact){
- this.treatsAsRelaxNgCompact = treatsAsRelaxNgCompact;
- }
-
- protected boolean treatsAsDtd() {
- return this.treatsAsDtd;
- }
-
- protected void setTreatsAsDtd(boolean treatsAsDtd){
- this.treatsAsDtd = treatsAsDtd;
- }
-
- protected boolean treatsAsWsdl() {
- return this.treatsAsWsdl;
- }
-
- protected void setTreatsAsWsdl(boolean treatsAsWsdl){
- this.treatsAsWsdl = treatsAsWsdl;
- }
-
- protected boolean showsVersion() {
- return this.showsVersion;
- }
-
- protected void setShowsVersion(boolean showsVersion){
- this.showsVersion = showsVersion;
- }
-
- protected boolean showsHelp() {
- return this.showsHelp;
- }
-
- protected void setShowsHelp(boolean showsHelp){
- this.showsHelp = showsHelp;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
deleted file mode 100644
index 51b07c3796..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.dialogs.OptionalMessageDialog;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorExtensionOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.GenerateJaxbClassesJob;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * ClassesGeneratorWizard
- */
-public class ClassesGeneratorWizard
- extends Wizard
- implements IWorkbenchWizard {
-
- private IJavaProject javaProject;
- private IFile preselectedXsdFile;
- protected IStructuredSelection selection;
-
- private String destinationFolder;
- private String targetPackage;
- private String catalog;
- private boolean usesMoxy;
- private String[] bindingsFileNames;
-
- private ClassesGeneratorOptions generatorOptions;
- private ClassesGeneratorExtensionOptions generatorExtensionOptions;
-
- private JavaProjectWizardPage projectWizardPage;
- private SchemaWizardPage schemaWizardPage;
-
- private ClassesGeneratorWizardPage settingsPage;
- private ClassesGeneratorOptionsWizardPage optionsPage;
- private ClassesGeneratorExtensionOptionsWizardPage extensionOptionsPage;
- private boolean performsGeneration;
-
-
- // ********** constructor **********
-
- public ClassesGeneratorWizard() {
- super();
- this.performsGeneration = true;
- }
-
- public ClassesGeneratorWizard(IJavaProject javaProject, IFile xsdFile) {
- super();
- this.javaProject = javaProject;
- this.preselectedXsdFile = xsdFile;
- this.performsGeneration = false;
- }
-
-
- // ********** IWorkbenchWizard implementation **********
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
-
- this.setWindowTitle(JptJaxbUiMessages.ClassesGeneratorWizard_title);
- this.setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.CLASSES_GEN_WIZ_BANNER));
- this.setNeedsProgressMonitor(true);
- }
-
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
-
- if (this.selection != null) {
- this.javaProject = this.getJavaProjectFromSelection(this.selection);
-
- this.projectWizardPage = new JavaProjectWizardPage(this.javaProject);
- this.projectWizardPage.setTitle(JptJaxbUiMessages.ClassesGeneratorProjectWizardPage_title);
- this.projectWizardPage.setDescription(JptJaxbUiMessages.ClassesGeneratorProjectWizardPage_desc);
- this.projectWizardPage.setDestinationLabel(JptJaxbUiMessages.JavaProjectWizardPage_destinationProject);
- this.addPage(this.projectWizardPage);
-
- // SchemaWizardPage
- if (this.preselectedXsdFile == null) {
- this.preselectedXsdFile = SchemaWizardPage.getSourceSchemaFromSelection(this.selection);
- }
-
- if (this.preselectedXsdFile == null) {
- this.schemaWizardPage = new SchemaWizardPage(this.selection);
- this.addPage(this.schemaWizardPage);
- }
- }
-
- this.settingsPage = this.buildClassesGeneratorPage();
- this.optionsPage = this.buildClassesGeneratorOptionsPage();
- this.extensionOptionsPage = this.buildExtensionOptionsPage();
-
- this.addPage(this.settingsPage);
- this.addPage(this.optionsPage);
- this.addPage(this.extensionOptionsPage);
- }
-
- @Override
- public boolean canFinish() {
- return this.settingsPage.isPageComplete()
- && this.optionsPage.isPageComplete()
- && this.extensionOptionsPage.isPageComplete();
- }
-
- @Override
- public boolean performFinish() {
-
- WizardPage currentPage = (WizardPage)getContainer().getCurrentPage();
- if (currentPage != null) {
- if (! currentPage.isPageComplete()) {
- return false;
- }
- this.retrieveGeneratorSettings();
- this.retrieveGeneratorOptions();
- this.retrieveGeneratorExtensionOptions();
-
- IFolder folder = this.getJavaProject().getProject().getFolder(this.destinationFolder);
- this.createFolderIfNotExist(folder);
- }
-
- if (this.performsGeneration) {
- if (displayOverwritingClassesWarning(this.generatorOptions)) {
- generateJaxbClasses();
- addSchemaToLibrary();
- }
- }
-
- return true;
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- if(this.projectWizardPage != null) {
- this.javaProject = this.projectWizardPage.getJavaProject();
- }
- return this.javaProject;
- }
-
- /* may be null */
- private JaxbProject getJaxbProject() {
- return JptJaxbCorePlugin.getJaxbProject(getJavaProject().getProject());
- }
-
- /* return the physical location of the schema */
- public URI getLocalSchemaUri() {
- if (this.preselectedXsdFile != null) {
- return URI.createFileURI(this.preselectedXsdFile.getLocation().toString());
- }
- else if (this.schemaWizardPage != null) {
- return this.schemaWizardPage.getLocalSchemaURI();
- }
- return null;
- }
-
- /* return the uri or file platform resource uri used for schema resolution */
- public String getSchemaLocation() {
- if (this.preselectedXsdFile != null) {
- return URI.createPlatformResourceURI(this.preselectedXsdFile.getFullPath().toString(), false).toString();
- }
- else if (this.schemaWizardPage != null) {
- return this.schemaWizardPage.getSchemaLocation();
- }
- return null;
- }
-
-
- // ********** public methods **********
-
- public String getDestinationFolder() {
- return this.destinationFolder;
- }
-
- public String getTargetPackage() {
- return this.targetPackage;
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public boolean usesMoxy() {
- return this.usesMoxy;
- }
-
- public String[] getBindingsFileNames() {
- return this.bindingsFileNames;
- }
-
- public ClassesGeneratorOptions getGeneratorOptions() {
- return this.generatorOptions;
- }
-
- public ClassesGeneratorExtensionOptions getGeneratorExtensionOptions() {
- return this.generatorExtensionOptions;
- }
-
- // ********** internal methods **********
-
- public IJavaProject getJavaProjectFromSelection(IStructuredSelection selection) {
- if(selection == null) {
- return null;
- }
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IJavaProject) {
- return (IJavaProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- IProject project = ((IResource) firstElement).getProject();
- return getJavaProjectFrom(project);
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject();
- }
- return null;
- }
-
- private ClassesGeneratorWizardPage buildClassesGeneratorPage() {
- return new ClassesGeneratorWizardPage();
- }
-
- private ClassesGeneratorOptionsWizardPage buildClassesGeneratorOptionsPage() {
- return new ClassesGeneratorOptionsWizardPage();
- }
-
- private ClassesGeneratorExtensionOptionsWizardPage buildExtensionOptionsPage() {
- return new ClassesGeneratorExtensionOptionsWizardPage();
- }
-
- public IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-
- private boolean displayOverwritingClassesWarning(ClassesGeneratorOptions generatorOptions) {
-
- if( ! this.isOverridingClasses(generatorOptions)
- || !OptionalMessageDialog.isDialogEnabled(OverwriteConfirmerDialog.ID)) {
- return true;
- } else {
- OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.getShell());
- return dialog.open() == IDialogConstants.YES_ID;
- }
- }
-
- private boolean isOverridingClasses(ClassesGeneratorOptions generatorOptions) {
- if(generatorOptions == null) {
- throw new NullPointerException();
- }
- if(generatorOptions.showsVersion() || generatorOptions.showsHelp()) {
- return false;
- }
- return true;
- }
-
- private void retrieveGeneratorSettings() {
- this.destinationFolder = this.settingsPage.getTargetFolder();
- this.targetPackage = this.settingsPage.getTargetPackage();
- this.catalog = this.settingsPage.getCatalog();
- this.usesMoxy = this.settingsPage.usesMoxy();
- this.bindingsFileNames = this.settingsPage.getBindingsFileNames();
- }
-
- private void retrieveGeneratorOptions() {
- this.generatorOptions = new ClassesGeneratorOptions();
-
- this.generatorOptions.setProxy(this.optionsPage.getProxy());
- this.generatorOptions.setProxyFile(this.optionsPage.getProxyFile());
-
- this.generatorOptions.setUsesStrictValidation(this.optionsPage.usesStrictValidation());
- this.generatorOptions.setMakesReadOnly(this.optionsPage.makesReadOnly());
- this.generatorOptions.setSuppressesPackageInfoGen(this.optionsPage.suppressesPackageInfoGen());
- this.generatorOptions.setSuppressesHeaderGen(this.optionsPage.suppressesHeaderGen());
- this.generatorOptions.setIsVerbose(this.optionsPage.isVerbose());
- this.generatorOptions.setIsQuiet(this.optionsPage.isQuiet());
-
- this.generatorOptions.setTreatsAsXmlSchema(this.optionsPage.treatsAsXmlSchema());
- this.generatorOptions.setTreatsAsRelaxNg(this.optionsPage.treatsAsRelaxNg());
- this.generatorOptions.setTreatsAsRelaxNgCompact(this.optionsPage.treatsAsRelaxNgCompact());
- this.generatorOptions.setTreatsAsDtd(this.optionsPage.treatsAsDtd());
- this.generatorOptions.setTreatsAsWsdl(this.optionsPage.treatsAsWsdl());
- this.generatorOptions.setShowsVersion(this.optionsPage.showsVersion());
- this.generatorOptions.setShowsHelp(this.optionsPage.showsHelp());
- }
-
- private void retrieveGeneratorExtensionOptions() {
-
- this.generatorExtensionOptions = new ClassesGeneratorExtensionOptions();
-
- this.generatorExtensionOptions.setAllowsExtensions(this.extensionOptionsPage.allowsExtensions());
- this.generatorExtensionOptions.setClasspath(this.extensionOptionsPage.getClasspath());
- this.generatorExtensionOptions.setAdditionalArgs(this.extensionOptionsPage.getAdditionalArgs());
- }
-
- private void createFolderIfNotExist(IFolder folder) {
- if( folder.exists()) {
- return;
- }
- try {
- folder.create(true, true, null);
- }
- catch (CoreException e) {
- JptJaxbUiPlugin.log(e);
-
- this.logError(NLS.bind(
- JptJaxbUiMessages.ClassesGeneratorWizard_couldNotCreate,
- folder.getProjectRelativePath().toOSString()));
- }
- }
-
- private void generateJaxbClasses() {
- try {
- WorkspaceJob job =
- new GenerateJaxbClassesJob(
- this.getJavaProject(),
- this.getLocalSchemaUri().toString(),
- this.destinationFolder,
- this.targetPackage,
- this.catalog,
- this.usesMoxy,
- this.bindingsFileNames,
- this.generatorOptions,
- this.generatorExtensionOptions);
- job.schedule();
- }
- catch(RuntimeException re) {
- JptJaxbUiPlugin.log(re);
-
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
- this.logError(message);
- }
- }
-
- private void addSchemaToLibrary() {
- JaxbProject jaxbProject = getJaxbProject();
-
- if (jaxbProject == null) {
- return;
- }
-
- String schemaLocation = getSchemaLocation();
- String resolvedUri = XsdUtil.getResolvedUri(null, schemaLocation);
- XSDSchema schema = XSDImpl.buildXSDModel(resolvedUri);
- if (schema != null) {
- String schemaNamespace =
- ((schema.getTargetNamespace()) == null ?
- ""
- : schema.getTargetNamespace());
-
- SchemaLibrary schemaLib = jaxbProject.getSchemaLibrary();
- Map<String, String> schemas = new HashMap<String, String>(schemaLib.getSchemaLocations());
- schemas.put(schemaNamespace, schemaLocation);
- schemaLib.setSchemaLocations(schemas);
- }
- }
-
- protected void logError(String message) {
- this.displayError(message);
- }
-
- private void displayError(String message) {
- MessageDialog.openError(
- this.getShell(),
- JptJaxbUiMessages.ClassesGeneratorWizard_errorDialogTitle,
- message
- );
- }
-
- static class OverwriteConfirmerDialog extends OptionalMessageDialog {
-
- private static final String ID= "dontShowOverwriteJaxbClassesFromSchemas.warning"; //$NON-NLS-1$
-
- OverwriteConfirmerDialog(Shell parent) {
- super(ID, parent,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningTitle,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningMessage,
- MessageDialog.WARNING,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 1);
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- }
-
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
deleted file mode 100644
index 762aea5275..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
+++ /dev/null
@@ -1,779 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator;
-import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.ui.JavaElementComparator;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
-import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGenerator;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.osgi.framework.Bundle;
-
-/**
- * ClassesGeneratorWizardPage
- */
-public class ClassesGeneratorWizardPage extends NewTypeWizardPage {
- static public final String JPT_ECLIPSELINK_UI_PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.ui"; //$NON-NLS-1$
- static public final String XML_FILTER = "*.xml"; //$NON-NLS-1$
- static public final String[] bindingdFilesFilterExtensions = {".xjb",".xml",".xbd"}; //$NON-NLS-1$
- static public final JaxbPlatformGroupDescription ECLIPSELINK_PLATFORM_GROUP
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup("eclipselink"); //$NON-NLS-1$
-
- public static final String HELP_CONTEXT_ID = "org.eclipse.jpt.ui.configure_jaxb_class_generation_dialog"; //$NON-NLS-1$
-
- private SettingsGroup settingsGroup;
-
- private String targetFolder;
- private String targetPackage;
-
- private Button usesMoxyCheckBox;
- private boolean usesMoxy;
-
- // ********** constructor **********
-
- public ClassesGeneratorWizardPage() {
- super(true, "Classes Generator"); //$NON-NLS-1$
-
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorWizardPage_desc);
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- // ********** intra-wizard methods **********
-
- protected String getTargetFolder() {
- return this.targetFolder;
- }
-
- protected String getTargetPackage() {
- return this.targetPackage;
- }
-
- protected String getCatalog() {
- return this.settingsGroup.getCatalog();
- }
-
- protected String[] getBindingsFileNames() {
- return this.settingsGroup.getBindingsFileNames();
- }
-
- protected boolean usesMoxy() {
- return this.usesMoxy;
- }
-
- private void setUsesMoxy(boolean usesMoxy){
- this.usesMoxy = usesMoxy;
- }
-
- // ********** overrides **********
-
- @Override
- protected IStatus packageChanged() {
- IStatus status = super.packageChanged();
- IPackageFragment packageFragment = getPackageFragment();
- if(!status.matches(IStatus.ERROR)) {
- this.targetPackage = packageFragment.getElementName();
- }
- return status;
- }
-
- @Override
- protected IStatus containerChanged() {
- IStatus status = super.containerChanged();
- String srcFolder = getPackageFragmentRootText();
- if( !status.matches(IStatus.ERROR) ){
- this.targetFolder = srcFolder.substring(srcFolder.indexOf("/") + 1);
- }
- return status;
- }
-
- @Override
- protected void handleFieldChanged(String fieldName) {
- super.handleFieldChanged(fieldName);
- if(this.fContainerStatus.matches(IStatus.ERROR)) {
- this.updateStatus(fContainerStatus);
- }
- else if( ! this.fPackageStatus.matches(IStatus.OK) ) {
- this.updateStatus(fPackageStatus);
- }
- else {
- this.updateStatus(Status.OK_STATUS);
- }
- this.validateProjectClasspath();
- }
-
- /**
- * Override setVisible to insure that our more important warning
- * message about classpath problems is displayed to the user first.
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible) {
- this.initContainerPage(((ClassesGeneratorWizard)this.getWizard()).getJavaProject());
-
- if(this.projectPlatformIsJaxb()) {
- this.setUsesMoxy(this.projectJaxbPlatformIsEclipseLink());
- this.usesMoxyCheckBox.setVisible(false);
- }
- else {
- // default usesMoxy to true only when JPT EclipseLink bundle exists and MOXy is on the classpath
- this.setUsesMoxy((this.jptEclipseLinkBundleExists() && this.moxyIsOnClasspath()));
-
- // checkbox is visible only if jpt.eclipselink.ui plugin is available
- // and EclipseLink MOXy is not on the classpath
- this.usesMoxyCheckBox.setVisible(this.jptEclipseLinkBundleExists() && ! this.moxyIsOnClasspath());
- }
- this.validateProjectClasspath();
-
- String schemaName = ((ClassesGeneratorWizard) getWizard()).getLocalSchemaUri().lastSegment();
- this.setTitle(NLS.bind(JptJaxbUiMessages.ClassesGeneratorWizardPage_title, schemaName));
- }
- }
-
- /**
- * Override to allow selection of source folder in current project only
- * @see org.eclipse.jdt.ui.wizards.NewContainerWizardPage#chooseContainer()
- * Only 1 line in this code is different from the parent
- */
- @Override
- protected IPackageFragmentRoot chooseContainer() {
- Class<?>[] acceptedClasses = new Class[] { IPackageFragmentRoot.class, IJavaProject.class };
- TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false) {
- @Override
- public boolean isSelectedValid(Object element) {
- try {
- if(element instanceof IJavaProject) {
- IJavaProject jproject= (IJavaProject)element;
- IPath path= jproject.getProject().getFullPath();
- return (jproject.findPackageFragmentRoot(path) != null);
- }
- else if(element instanceof IPackageFragmentRoot) {
- return (((IPackageFragmentRoot)element).getKind() == IPackageFragmentRoot.K_SOURCE);
- }
- return true;
- }
- catch (JavaModelException e) {
- JptJaxbUiPlugin.log(e); // just log, no UI in validation
- }
- return false;
- }
- };
-
- acceptedClasses= new Class[] { IJavaModel.class, IPackageFragmentRoot.class, IJavaProject.class };
- ViewerFilter filter= new TypedViewerFilter(acceptedClasses) {
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- if(element instanceof IPackageFragmentRoot) {
- try {
- return (((IPackageFragmentRoot)element).getKind() == IPackageFragmentRoot.K_SOURCE);
- }
- catch (JavaModelException e) {
- JptJaxbUiPlugin.log(e.getStatus()); // just log, no UI in validation
- return false;
- }
- }
- return super.select(viewer, parent, element);
- }
- };
-
- StandardJavaElementContentProvider provider= new StandardJavaElementContentProvider();
- ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
- ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), labelProvider, provider);
- dialog.setValidator(validator);
- dialog.setComparator(new JavaElementComparator());
- dialog.setTitle(JptJaxbUiMessages.ClassesGeneratorWizardPage_sourceFolderSelectionDialog_title);
- dialog.setMessage(JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseSourceFolderDialog_desc);
- dialog.addFilter(filter);
- //set the java project as the input instead of the workspace like the NewContainerWizardPage was doing
- //******************************************************//
- dialog.setInput(this.getJavaProject()); //
- //******************************************************//
- dialog.setInitialSelection(getPackageFragmentRoot());
- dialog.setHelpAvailable(false);
-
- if(dialog.open() == Window.OK) {
- Object element= dialog.getFirstResult();
- if(element instanceof IJavaProject) {
- IJavaProject jproject= (IJavaProject)element;
- return jproject.getPackageFragmentRoot(jproject.getProject());
- }
- else if(element instanceof IPackageFragmentRoot) {
- return (IPackageFragmentRoot)element;
- }
- return null;
- }
- return null;
- }
-
- // ********** internal methods **********
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
-
- this.settingsGroup = new SettingsGroup(composite);
-
- this.usesMoxyCheckBox = this.buildUsesMoxyCheckBox(composite);
-
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- private Button buildUsesMoxyCheckBox(Composite parent) {
-
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.horizontalIndent = 5;
- gridData.verticalIndent = 5;
- checkBox.setLayoutData(gridData);
- checkBox.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_usesMoxyImplementation);
- checkBox.setSelection(this.usesMoxy());
- checkBox.addSelectionListener(this.buildUsesMoxySelectionListener());
-
- return checkBox;
- }
-
- private SelectionListener buildUsesMoxySelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
-
- public void widgetSelected(SelectionEvent event) {
- setUsesMoxy(usesMoxyCheckBox.getSelection());
- validateProjectClasspath();
- }
- };
- }
-
- private boolean jptEclipseLinkBundleExists() {
- return (this.getJptEclipseLinkBundle() != null);
- }
-
- private Bundle getJptEclipseLinkBundle() {
- return Platform.getBundle(JPT_ECLIPSELINK_UI_PLUGIN_ID); // Cannot reference directly EL plugin.
- }
-
- private void validateProjectClasspath() {
- //this line will suppress the "default package" warning (which doesn't really apply here
- //as the JAXB gen uses an org.example.schemaName package by default) and will clear the classpath warnings when necessary
- setMessage(null);
-
- if( ! this.genericJaxbIsOnClasspath()) {
- this.displayWarning(JptJaxbUiMessages.ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable);
- }
- else if(this.usesMoxy() && ! this.eclipseLinkMoxyIsOnClasspath()) {
- //this message is being truncated by the wizard width in some cases
- this.displayWarning(JptJaxbUiMessages.ClassesGeneratorWizardPage_moxyLibrariesNotAvailable);
- }
-
- //this code will intelligently remove our classpath warnings when they are present but no longer apply (as an alternative
- //to setting the message to null continuously as is currently done)
-// else if( this.getMessage() != null){
-// if (this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable) ||
-// this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_moxyLibrariesNotAvailable)) {
-// setMessage(null);
-// }
-// }
- }
-
- /**
- * Test if the Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbIsOnClasspath() {
- if(this.genericJaxbNonJdkIsOnClasspath()) {
- return true;
- }
- else {
- if(this.projectJre15OrLower()) {
- return false;
- }
- else if(this.genericJaxbJdkIsOnClasspath()) {
- return true;
- }
- else {
- return this.toolsJarExists();
- }
- }
- }
-
- private boolean projectJre15OrLower() {
- try {
- IVMInstall vm = this.getVMInstall();
- if(vm == null) {
- return false;
- }
- if (vm instanceof IVMInstall2) {
- String javaVersion = ((IVMInstall2) vm).getJavaVersion();
- if(javaVersion != null) {
- String versionString = javaVersion.substring(0, javaVersion.lastIndexOf('.'));
- Float javaVersionNumber = Float.valueOf(versionString);
- if( javaVersionNumber <= 1.5) {
- return true;
- }
- }
- }
- return false;
- }
- catch (CoreException e) {
- return false;
- }
- }
-
- /**
- * Test if the JDK Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbJdkIsOnClasspath() {
- return ClassesGenerator.genericJaxbJdkIsOnClasspath(this.getJavaProject());
- }
-
- /**
- * Test if the non-JDK Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbNonJdkIsOnClasspath() {
- return ClassesGenerator.genericJaxbNonJdkIsOnClasspath(this.getJavaProject());
- }
-
- private boolean toolsJarExists() {
- return ClassesGenerator.toolsJarExists(this.getJavaProject());
- }
-
- private IVMInstall getVMInstall() throws CoreException {
- return ClassesGenerator.getVMInstall(this.getJavaProject());
- }
-
- /**
- * Test if the EclipseLink Jaxb compiler is on the classpath.
- */
- private boolean moxyIsOnClasspath() {
- try {
- IType genClass = this.getJavaProject().findType(ClassesGenerator.JAXB_ECLIPSELINK_GEN_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- private boolean eclipseLinkMoxyIsOnClasspath() {
- return (this.moxyIsOnClasspath() && this.genericJaxbNonJdkIsOnClasspath());
- }
-
- private boolean projectPlatformIsJaxb() {
- return JptJaxbCorePlugin.getJaxbProject(this.getJavaProject().getProject()) != null;
- }
-
- private boolean projectJaxbPlatformIsEclipseLink() {
- JaxbPlatformDescription jaxbPlatform = JptJaxbCorePlugin.getJaxbPlatformDescription(this.getJavaProject().getProject());
- JaxbPlatformGroupDescription jaxbPlatformGroup = (jaxbPlatform == null) ? null : jaxbPlatform.getGroup();
- return jaxbPlatformGroup == ECLIPSELINK_PLATFORM_GROUP;
- }
-
- private void displayWarning(String message) {
- this.setMessage(message, WARNING);
- }
-
- // ********** inner class **********
-
- // ********** SettingsGroup class **********
-
- private class SettingsGroup {
-
- private final Text catalogText;
-
- private final ArrayList<String> bindingsFileNames;
-
- // ********** constructor **********
-
- private SettingsGroup(Composite parent) {
- super();
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(4, false); //must be 4 for the package controls
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, HELP_CONTEXT_ID);
-
- // Source folder
- createContainerControls(composite, 4);
-
- // Package
- createPackageControls(composite, 4);
-
- Label label = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false, 4, 1);
- gridData.verticalIndent = 5;
- label.setLayoutData(gridData);
-
- // Catalog
- Label catalogLabel = new Label(composite, SWT.NONE);
- catalogLabel.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_catalog);
- gridData = new GridData();
- gridData.verticalIndent = 5;
- catalogLabel.setLayoutData(gridData);
- this.catalogText = this.buildCatalogText(composite);
- this.buildBrowseButton(composite);
-
- // Bindings files
- this.bindingsFileNames = new ArrayList<String>();
- Label bindingsFileLabel = new Label(composite, SWT.NONE);
- bindingsFileLabel.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_bindingsFiles);
- bindingsFileLabel.setLayoutData(new GridData());
- this.buildBindingsFileTable(composite);
- }
-
- // ********** intra-wizard methods **********
-
- protected String getCatalog() {
- return this.catalogText.getText();
- }
-
- protected String[] getBindingsFileNames() {
- return ArrayTools.array(this.bindingsFileNames.iterator(), new String[0]);
- }
-
- // ********** UI components **********
-
- private Text buildCatalogText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 2;
- gridData.verticalIndent = 5;
- text.setLayoutData(gridData);
- return text;
- }
-
- private void buildBrowseButton(Composite parent) {
-
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
-
- // Browse buttons
- Button browseButton = new Button(buttonComposite, SWT.PUSH);
- browseButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_browseButton);
- gridData = new GridData();
- gridData.horizontalAlignment= GridData.FILL;
- gridData.verticalIndent = 5;
- gridData.grabExcessHorizontalSpace= true;
- browseButton.setLayoutData(gridData);
-
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String filePath = promptXmlFile();
- if( ! StringTools.stringIsEmpty(filePath)) {
-
- catalogText.setText(makeRelativeToProjectPath(filePath));
- }
- }
- });
- }
-
- private TableViewer buildBindingsFileTable(Composite parent) {
-
- TableViewer tableViewer = this.buildTableViewer(parent, this.bindingsFileNames);
-
- this.buildAddRemoveButtons(parent, tableViewer, this.bindingsFileNames);
- return tableViewer;
- }
-
- private TableViewer buildTableViewer(Composite parent, ArrayList<String> tableDataModel) {
-
- TableLayoutComposite tableLayout = new TableLayoutComposite(parent, SWT.NONE);
- this.addColumnsData(tableLayout);
-
- final Table table = new Table(tableLayout, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
- table.setLinesVisible(false);
-
- TableColumn column = new TableColumn(table, SWT.NONE, 0);
- column.setResizable(true);
-
- GridData gridData= new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 2;
- gridData.heightHint= SWTUtil.getTableHeightHint(table, 3);
- tableLayout.setLayoutData(gridData);
-
- TableViewer tableViewer = new TableViewer(table);
- tableViewer.setUseHashlookup(true);
- tableViewer.setLabelProvider(this.buildLabelProvider());
- tableViewer.setContentProvider(this.buildContentProvider());
-
- tableViewer.setInput(tableDataModel);
- return tableViewer;
- }
-
- private void buildAddRemoveButtons(Composite parent, final TableViewer tableViewer, final ArrayList<String> tableDataModel) {
-
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
- // Add button
- Button addButton = new Button(buttonComposite, SWT.PUSH);
- addButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_addButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- addButton.setLayoutData(gridData);
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- String filePath = addBindingsFileDialog();
- if( ! StringTools.stringIsEmpty(filePath)) {
- addBindingsFile(filePath, tableDataModel);
- tableViewer.refresh();
- }
- }
- });
- // Remove button
- Button removeButton = new Button(buttonComposite, SWT.PUSH);
- removeButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_removeButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- removeButton.setLayoutData(gridData);
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- StructuredSelection selection = (StructuredSelection)tableViewer.getSelection();
- if(selection.isEmpty()) {
- return;
- }
- String bindingsFileName = (String)selection.getFirstElement();
- removeBindingsFile(bindingsFileName);
-
- tableViewer.refresh();
- }
- });
- addButton.setFocus();
- }
-
- // ********** internal methods **********
-
- private String addBindingsFileDialog() {
- PromptBindingsFilesDialog dialog = new PromptBindingsFilesDialog(getShell());
-
- // opens the dialog - just returns if the user cancels it
- if(dialog.open() == Window.CANCEL) {
- return null;
- }
-
- String location = dialog.getLocation();
- return location;
- }
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(getJavaProject().getProject().getLocation());
- return relativePath.toOSString();
- }
-
- private void addBindingsFile(String relativePath, final ArrayList<String> tableDataModel) {
- if( ! tableDataModel.contains(relativePath)) {
- tableDataModel.add(relativePath);
- }
- }
-
- private void removeBindingsFile(String bindingsName) {
- this.bindingsFileNames.remove(bindingsName);
- }
-
- private IBaseLabelProvider buildLabelProvider() {
- return new TableLabelProvider();
- }
-
- private IContentProvider buildContentProvider() {
- return new TableContentProvider();
- }
-
- /**
- * The Add button was clicked, its action invokes this action which should
- * prompt the user to select a file and return it.
- */
- private String promptXmlFile() {
- String projectPath= getJavaProject().getProject().getLocation().toString();
-
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseACatalog);
- dialog.setFilterPath(projectPath);
- dialog.setFilterExtensions(new String[] {XML_FILTER});
-
- return dialog.open();
- }
-
- private void addColumnsData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- }
-
- // ********** TableLabelProvider **********
-
- private class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- return (String)element;
- }
- }
-
- // ********** TableContentProvider **********
-
- private class TableContentProvider implements IStructuredContentProvider {
-
- // ********** constructor **********
- TableContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return ((Collection<?>) inputElement).toArray();
- }
- }
-
- // ********** PromptBindingsFilesDialog **********
-
- private class PromptBindingsFilesDialog extends TrayDialog {
-
- private SelectFileOrXMLCatalogIdPanel locationPanel;
-
- private String location;
-
- // ********** constructor **********
- public PromptBindingsFilesDialog(Shell shell) {
- super(shell);
- }
-
- @Override
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseABindingsFile);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- this.locationPanel = new SelectFileOrXMLCatalogIdPanel(composite, StructuredSelection.EMPTY);
- this.locationPanel.setFilterExtensions(bindingdFilesFilterExtensions);
- this.locationPanel.update();
- this.locationPanel.setVisibleHelper(true);
-
- return composite;
- }
-
- @Override
- protected boolean isResizable() {
- return true;
- }
-
- @Override
- protected void okPressed() {
- IFile file = this.locationPanel.getFile();
- if (file != null) {
- this.location = file.getProjectRelativePath().toOSString();
- }
- super.okPressed();
- }
-
- public String getLocation() {
- return this.location;
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java
deleted file mode 100644
index cb1a1d6c0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.emf.common.CommonPlugin;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-
-/**
- * SchemaWizardPage
- */
-public class SchemaWizardPage
- extends WizardPage {
-
- protected static final String[] browseXSDFilterExtensions = {".xsd"}; //$NON-NLS-1$
-
- private final IStructuredSelection initialSelection;
- private IProject targetProject;
-
- protected SelectFileOrXMLCatalogIdPanel selectSourcePanel;
-
-
- // ********** static method **********
-
- public static IFile getSourceSchemaFromSelection(IStructuredSelection selection) {
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IFile) {
- String elementExtension = ((IFile)firstElement).getFileExtension();
- if(elementExtension != null) {
- if(browseXSDFilterExtensions[0].endsWith(elementExtension)) {
- return ((IFile)firstElement);
- }
- }
- }
- return null;
- }
-
-
- // ********** constructor **********
-
- SchemaWizardPage(IStructuredSelection selection) {
- super("SchemaWizardPage"); //$NON-NLS-1$
-
- this.initialSelection = selection;
- }
-
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- this.setControl(composite);
-
- this.selectSourcePanel = new SelectFileOrXMLCatalogIdPanel(composite, this.initialSelection);
- this.selectSourcePanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- SelectFileOrXMLCatalogIdPanel.PanelListener listener = new SelectFileOrXMLCatalogIdPanel.PanelListener() {
- public void completionStateChanged() {
- selectFileOrXMLCatalogIdPanelChanged();
- }
- };
- this.selectSourcePanel.setListener(listener);
-
- Dialog.applyDialogFont(parent);
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible) {
-
- if(this.getSchemaFile() != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.getSchemaFile()));
- }
- else {
- this.updateTargetProject();
- IFile schema = getSourceSchemaFromSelection(this.initialSelection);
- if(schema != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(schema));
- }
- else {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.targetProject));
- }
- }
- this.selectSourcePanel.update();
-
- this.setTitle(JptJaxbUiMessages.SchemaWizardPage_title);
- this.setDescription(JptJaxbUiMessages.SchemaWizardPage_desc);
- this.selectSourcePanel.setFilterExtensions(browseXSDFilterExtensions);
- }
- this.selectSourcePanel.setVisibleHelper(visible);
- }
-
-
- // ********** IWizardPage implementation **********
-
- @Override
- public boolean isPageComplete() {
-
- return this.fileOrXmlCatalogEntrySelected() && (this.getErrorMessage() == null);
- }
-
-
- // ********** intra-wizard methods **********
-
- /* return the file, if a file is selected */
- public IFile getSchemaFile() {
- return this.selectSourcePanel.getFile();
- }
-
- /* return xml catalog id, if a catalog entry is selected */
- public String getXMLCatalogId() {
- return this.selectSourcePanel.getXMLCatalogId();
- }
-
- /* return identifier of schema location, whether using file or xml catalog */
- public String getSchemaLocation() {
- IFile file = this.selectSourcePanel.getFile();
- if (file != null) {
- return URI.createPlatformResourceURI(file.getFullPath().toString(), false).toString();
- }
- return this.selectSourcePanel.getXMLCatalogId();
- }
-
- /* return local uri of schema, whether using file or xml catalog */
- public URI getLocalSchemaURI() {
- IFile file = this.selectSourcePanel.getFile();
- if (file != null) {
- return URI.createFileURI(file.getLocation().toString());
- }
-
- String uri = this.selectSourcePanel.getXMLCatalogURI();
- if (uri != null) {
- return CommonPlugin.asLocalURI(URI.createURI(uri));
- }
-
- return null;
- }
-
-
- // ********** internal methods **********
-
- private void updateTargetProject() {
- IWizardPage previousPage = this.getPreviousPage();
-
- if(previousPage instanceof JavaProjectWizardPage) {
- // get project from previousPage
- this.targetProject = (((JavaProjectWizardPage)previousPage).getJavaProject()).getProject();
- }
- else if(initialSelection != null && ! this.initialSelection.isEmpty()) {
- // no previousPage - get project from initialSelection
- this.targetProject = this.getProjectFromInitialSelection();
- }
- }
-
- private IProject getProjectFromInitialSelection() {
- Object firstElement = initialSelection.getFirstElement();
- if(firstElement instanceof IProject) {
- return (IProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- return ((IResource) firstElement).getProject();
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject().getProject();
- }
- return null;
- }
-
- private boolean fileOrXmlCatalogEntrySelected() {
- return this.getSchemaFile() != null || this.getXMLCatalogId() != null;
- }
-
- private String computeErrorMessage() {
- String errorMessage = null;
- URI uri = this.getLocalSchemaURI();
- if (uri != null) {
- if (! URIHelper.isReadableURI(uri.toString(), false)) {
- errorMessage = JptJaxbUiMessages.SchemaWizardPage_errorUriCannotBeLocated;
- }
- }
- return errorMessage;
- }
-
- private void selectFileOrXMLCatalogIdPanelChanged() {
- String errorMessage = this.computeErrorMessage();
- this.setErrorMessage(errorMessage);
- this.setPageComplete(this.isPageComplete());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
deleted file mode 100644
index da4cdc8c87..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-
-public class SelectFileOrXMLCatalogIdPanel extends Composite implements SelectionListener {
-
- public interface PanelListener {
- void completionStateChanged();
- }
-
- protected PanelListener listener;
- protected PageBook pageBook;
-
- protected Button[] radioButton;
- protected SelectFilePanel selectFilePanel;
- protected SelectXMLCatalogIdPanel selectXMLCatalogIdPanel;
-
- // ********** constructor **********
-
- public SelectFileOrXMLCatalogIdPanel(Composite parent, IStructuredSelection selection) {
- super(parent, SWT.NONE);
-
- // container group
- setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 400;
- gd.widthHint = 400;
- setLayoutData(gd);
-
- radioButton = new Button[2];
- radioButton[0] = new Button(this, SWT.RADIO);
- radioButton[0].setText(JptJaxbUiMessages.SelectFileOrXMLCatalogIdPanel_fileFromWorkspace);
- radioButton[0].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[0].setSelection(true);
- radioButton[0].addSelectionListener(this);
-
- radioButton[1] = new Button(this, SWT.RADIO);
- radioButton[1].setText(JptJaxbUiMessages.SelectFileOrXMLCatalogIdPanel_xmlCatalogEntry);
- radioButton[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[1].addSelectionListener(this);
-
- pageBook = new PageBook(this, SWT.NONE);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- selectFilePanel = new SelectFilePanel(pageBook, selection);
- this.setSingleFileViewDefaultSelection(selection);
-
- // Catalog
- ICatalog xmlCatalog = JptJaxbUiPlugin.instance().getDefaultXMLCatalog();
- selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
- selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateCompletionStateChange();
- }
- });
- Dialog.applyDialogFont(parent);
- pageBook.showPage(selectFilePanel.getControl());
- }
-
- public void setSingleFileViewDefaultSelection(ISelection selection) {
- this.selectFilePanel.setDefaultSelection(selection);
- }
-
- public IFile getFile() {
- IFile result = null;
- if (radioButton[0].getSelection()) {
- result = selectFilePanel.getFile();
- }
- return result;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getXMLCatalogEntry();
- }
- return result;
- }
-
- public String getXMLCatalogId() {
- String result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getId();
- }
- return result;
- }
-
- public String getXMLCatalogURI() {
- String result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getURI();
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- selectXMLCatalogIdPanel.setCatalogEntryType(catalogEntryType);
- }
-
- public void setFilterExtensions(String[] filterExtensions) {
- selectFilePanel.resetFilters();
- selectFilePanel.addFilterExtensions(filterExtensions);
-
- selectXMLCatalogIdPanel.getTableViewer().setFilterExtensions(filterExtensions);
- }
-
- public void setListener(PanelListener listener) {
- this.listener = listener;
- }
-
- public void setVisibleHelper(boolean isVisible) {
- selectFilePanel.setVisibleHelper(isVisible);
- }
-
- public void updateCompletionStateChange() {
- if (listener != null) {
- listener.completionStateChanged();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == radioButton[0]) {
- pageBook.showPage(selectFilePanel.getControl());
- }
- else {
- pageBook.showPage(selectXMLCatalogIdPanel);
- }
- updateCompletionStateChange();
- }
-
- // ********** inner class **********
-
- protected class SelectFilePanel extends SelectSingleFileViewFacade implements SelectSingleFileViewFacade.Listener {
- protected Control control;
-
- public SelectFilePanel(Composite parent, IStructuredSelection selection) {
- super(selection, true);
- // String[] ext = {".dtd"};
- // addFilterExtensions(ext);
- this.control = this.createControl(parent);
- this.overrideImportButtonText();
-
- this.control.setLayoutData(new GridData(GridData.FILL_BOTH));
- SelectFilePanel.this.setListener(this);
- }
-
- public Control getControl() {
- return this.control;
- }
-
- public void setControlComplete(boolean isComplete) {
- updateCompletionStateChange();
- }
-
- private void overrideImportButtonText() {
- this.importButton.setText(JptJaxbUiMessages.SelectFileOrXMLCatalogIdPanel_importButton);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.java
deleted file mode 100644
index 888095e447..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SelectSingleFileView
- *
- * Façade class to change accessibility of SelectSingleFileView.
- */
-public class SelectSingleFileViewFacade extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView {
-
- public static interface Listener extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView.Listener
- {}
-
- public SelectSingleFileViewFacade(IStructuredSelection selection, boolean isFileMandatory) {
- super(selection, isFileMandatory);
- }
-
- public void addFilterExtensions(String[] filterExtensions) {
- super.addFilterExtensions(filterExtensions);
- }
-
- public Composite createControl(Composite parent) {
- return super.createControl(parent);
- }
-
- public IFile getFile() {
- return super.getFile();
- }
-
- public void resetFilters() {
- super.resetFilters();
- }
-
- public void setVisibleHelper(boolean isVisible) {
- super.setVisibleHelper(isVisible);
- }
-
- public void setDefaultSelection(ISelection selection) {
- super.setDefaultSelection(selection);
- }
-
- public void setListener(Listener listener) {
- super.setListener(listener);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
deleted file mode 100644
index 111684b49b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-
-public class SelectXMLCatalogIdPanel extends Composite {
- protected int catalogEntryType;
- protected boolean doTableSizeHack = false;
-
- protected XMLCatalogTableViewer tableViewer;
- protected ICatalog fXmlCatalog;
-
- public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog) {
- super(parent, SWT.NONE);
- this.fXmlCatalog = xmlCatalog;
-
- GridLayout gridLayout = new GridLayout();
- this.setLayout(gridLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
- gd.widthHint = 700;
- this.setLayoutData(gd);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(JptJaxbUiMessages.SchemaWizardPage_xmlCatalogTableTitle);
-
- tableViewer = createTableViewer(this);
- tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- tableViewer.setInput("dummy"); //$NON-NLS-1$
- }
-
- protected XMLCatalogTableViewer createTableViewer(Composite parent) {
- String headings[] = new String[2];
- headings[0] = JptJaxbUiMessages.SchemaWizardPage_xmlCatalogKeyColumn;
- headings[1] = JptJaxbUiMessages.SchemaWizardPage_xmlCatalogUriColumn;
-
- XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings) {
-
- protected void addXMLCatalogEntries(List list, ICatalogEntry[] entries) {
- for (int i = 0; i < entries.length; i++) {
- ICatalogEntry entry = entries[i];
- if (catalogEntryType == 0) {
- list.add(entry);
- }
- else if (catalogEntryType == entry.getEntryType()) {
- list.add(entry);
- }
- }
- }
-
- public Collection getXMLCatalogEntries() {
- List result = null;
-
- if ((fXmlCatalog == null) || doTableSizeHack) {
- // this lets us create a table with an initial height of
- // 10 rows
- // otherwise we get stuck with 0 row heigh table... that's
- // too small
- doTableSizeHack = false;
- result = new Vector();
- for (int i = 0; i < 6; i++) {
- result.add(""); //$NON-NLS-1$
- }
- }
- else {
- result = new Vector();
- INextCatalog[] nextCatalogs = fXmlCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (JptJaxbUiPlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog systemCatalog = referencedCatalog;
- addXMLCatalogEntries(result, systemCatalog.getCatalogEntries());
-
- }
- else if (JptJaxbUiPlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog userCatalog = referencedCatalog;
- addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
-
- }
- }
- }
- }
- return result;
- }
- };
- return theTableViewer;
- }
-
-
- public String getId() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getKey() : null;
- }
-
- public XMLCatalogTableViewer getTableViewer() {
- return tableViewer;
- }
-
- public String getURI() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getURI() : null;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof ICatalogEntry) {
- result = (ICatalogEntry) selectedObject;
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- this.catalogEntryType = catalogEntryType;
- tableViewer.refresh();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java
deleted file mode 100644
index 4a24f1c36b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-import com.ibm.icu.text.Collator;
-
-public class XMLCatalogTableViewer extends TableViewer {
-
- protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
-
- protected static Image dtdFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/dtdfile.gif"); //$NON-NLS-1$
- protected static Image unknownFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/text.gif"); //$NON-NLS-1$
- protected static Image xsdFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/XSDFile.gif"); //$NON-NLS-1$
- protected static Image errorImage = JptJaxbUiPlugin.getImage("icons/full/ovr16/error_ovr.gif"); //$NON-NLS-1$
-
- // ********** constructor **********
-
- public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
- super(parent, SWT.FULL_SELECTION);
-
- Table table = getTable();
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- for (int i = 0; i < columnProperties.length; i++) {
- TableColumn column = new TableColumn(table, i);
- column.setText(columnProperties[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(50, true));
- }
- table.setLayout(layout);
- table.setLinesVisible(false);
-
- setColumnProperties(columnProperties);
-
- setContentProvider(new CatalogEntryContentProvider());
- setLabelProvider(new CatalogEntryLabelProvider());
- }
-
- public Collection getXMLCatalogEntries() {
- return null;
- }
-
- public void menuAboutToShow(IMenuManager menuManager) {
- Action action = new Action("hello") { //$NON-NLS-1$
- public void run() {
- System.out.println("run!"); //$NON-NLS-1$
- }
- };
- menuManager.add(action);
- }
-
- public void setFilterExtensions(String[] extensions) {
- resetFilters();
- addFilter(new XMLCatalogTableViewerFilter(extensions));
- }
-
- // ********** inner class **********
-
- public class CatalogEntryContentProvider implements IStructuredContentProvider {
-
- public void dispose() {
- }
-
- public Object[] getElements(Object element) {
- Object[] array = getXMLCatalogEntries().toArray();
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- int result = 0;
- if ((o1 instanceof ICatalogEntry) && (o2 instanceof ICatalogEntry)) {
- ICatalogEntry mappingInfo1 = (ICatalogEntry) o1;
- ICatalogEntry mappingInfo2 = (ICatalogEntry) o2;
- result = Collator.getInstance().compare(mappingInfo1.getKey(), mappingInfo2.getKey());
- }
- return result;
- }
- };
- Arrays.sort(array, comparator);
- return array;
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
- public class CatalogEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object object, int columnIndex) {
- Image result = null;
- if (columnIndex == 0) {
- Image base = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- String uri = catalogEntry.getURI();
- if (uri.endsWith("dtd")) { //$NON-NLS-1$
- base = dtdFileImage;
- }
- else if (uri.endsWith("xsd")) { //$NON-NLS-1$
- base = xsdFileImage;
- }
- else {
- base = unknownFileImage;
- }
-
- if (base != null) {
- if (URIHelper.isReadableURI(uri, false)) {
- result = base;
- }
- else {
- // TODO... SSE port
- result = base;// imageFactory.createCompositeImage(base,
- // errorImage,
- // ImageFactory.BOTTOM_LEFT);
- }
- }
- }
- }
- return result;
- }
-
- public String getColumnText(Object object, int columnIndex) {
- String result = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- result = columnIndex == 0 ? catalogEntry.getKey() : catalogEntry.getURI();
- result = URIHelper.removePlatformResourceProtocol(result);
- }
- return result != null ? result : ""; //$NON-NLS-1$
- }
- }
-
- class XMLCatalogTableViewerFilter extends ViewerFilter {
- protected String[] extensions;
-
- public XMLCatalogTableViewerFilter(String[] extensions) {
- this.extensions = extensions;
- }
-
- public boolean isFilterProperty(Object element, Object property) {
- return false;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean result = false;
- if (element instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) element;
- for (int i = 0; i < extensions.length; i++) {
- if (catalogEntry.getURI().endsWith(extensions[i])) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java
deleted file mode 100644
index 23526b7272..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.facet;
-
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProperties;
-
-public class JaxbFacetInstallPage
- extends JaxbFacetPage
- implements JaxbFacetInstallDataModelProperties {
-
- public JaxbFacetInstallPage() {
- super("jpt.jaxb.facet.install.page");
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
deleted file mode 100644
index d2897cd77d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.facet;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetDataModelProperties;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
-
-
-public abstract class JaxbFacetPage
- extends DataModelFacetInstallPage
- implements JaxbFacetDataModelProperties {
-
- protected JaxbFacetPage(String pageName) {
- super(pageName);
- setTitle(JptJaxbUiMessages.JaxbFacetWizardPage_title);
- setDescription(JptJaxbUiMessages.JaxbFacetWizardPage_desc);
- setImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER));
- }
-
-
- @Override
- public void setConfig(Object config) {
- if (! (config instanceof IDataModel)) {
- config = Platform.getAdapterManager().loadAdapter(config, IDataModel.class.getName());
- }
- super.setConfig(config);
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- addSubComposites(composite);
-
- Dialog.applyDialogFont(parent);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, JpaHelpContextIds.DIALOG_JPA_FACET);
-
- return composite;
- }
-
- protected void addSubComposites(Composite composite) {
- new PlatformGroup(composite);
- new ClasspathConfigGroup(composite);
- }
-
- protected Button createButton(Composite container, int span, String text, int style) {
- Button button = new Button(container, SWT.NONE | style);
- button.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- button.setLayoutData(gd);
- return button;
- }
-
- protected Combo createCombo(Composite container, int span, boolean fillHorizontal) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd;
- if (fillHorizontal) {
- gd = new GridData(GridData.FILL_HORIZONTAL);
- }
- else {
- gd = new GridData();
- }
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- PLATFORM,
- LIBRARY_INSTALL_DELEGATE
- };
- }
-
- @Override
- public boolean isPageComplete() {
- if (! super.isPageComplete()) {
- return false;
- }
- else {
- IStatus status = this.model.validate();
- if (status.getSeverity() == IStatus.ERROR) {
- setErrorMessage(status.getMessage());
- return false;
- };
- setErrorMessage(null);
- return true;
- }
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- setErrorMessage();
- }
- }
-
- @Override
- public void transferStateToConfig() {
- // This method is called when "finish" is being performed.
- // We remove "this" as a listener so that it will stop responding to data model changes.
- // "This" listens only for validation purposes, and we are done with validation at this
- // point. Furthermore, any validation at this point runs into the danger of deadlocking
- // the wizard.
- this.model.removeListener(this);
- this.synchHelper.dispose();
- super.transferStateToConfig();
- }
-
- @Override
- protected void validatePage() {
- // done to prevent "orphan" pages from validating
- if (getWizard() == null) {
- return;
- }
-
- super.validatePage();
- }
-
- @Override
- protected void validatePage(boolean showMessage) {
- // done to prevent "orphan" pages from validating
- if (getWizard() == null) {
- return;
- }
-
- super.validatePage(showMessage);
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
-
- protected final class PlatformGroup
- {
- private final Combo platformCombo;
-
-
- public PlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptJaxbUiMessages.JaxbFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.DIALOG_JPA_PLATFORM);
-
- this.platformCombo = createCombo(group, 1, true);
- JaxbFacetPage.this.synchHelper.synchCombo(platformCombo, PLATFORM, null);
- }
- }
-
-
- protected final class ClasspathConfigGroup {
-
- public ClasspathConfigGroup(Composite composite) {
-
- LibraryInstallDelegate librariesInstallDelegate
- = (LibraryInstallDelegate) getDataModel().getProperty(LIBRARY_INSTALL_DELEGATE);
-
- Composite librariesComposite
- = (Composite) LibraryProviderFrameworkUi.createInstallLibraryPanel(
- composite, librariesInstallDelegate,
- JptJaxbUiMessages.JaxbFacetWizardPage_jaxbImplementationLabel);
- librariesComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(librariesComposite, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java
deleted file mode 100644
index 26e1e43b0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.facet;
-
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDataModelProperties;
-
-public class JaxbFacetVersionChangePage
- extends JaxbFacetPage
- implements JaxbFacetVersionChangeDataModelProperties {
-
- public JaxbFacetVersionChangePage() {
- super("jpt.jaxb.facet.versionChange.page");
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java
deleted file mode 100644
index 696d4cee32..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.proj;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.proj.model.JaxbProjectCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
-
-
-public class JaxbProjectWizard
- extends NewProjectDataModelFacetWizard {
-
- public JaxbProjectWizard() {
- super();
- setWindowTitle(JptJaxbUiMessages.JaxbProjectWizard_title);
- }
-
- public JaxbProjectWizard(IDataModel dataModel) {
- super(dataModel);
- setWindowTitle(JptJaxbUiMessages.JaxbProjectWizard_title);
- }
-
-
- @Override
- protected ImageDescriptor getDefaultPageImageDescriptor() {
- return JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER);
- }
-
- @Override
- protected IWizardPage createFirstPage() {
- return new JaxbProjectWizardFirstPage(model, "first.page"); //$NON-NLS-1$
- }
-
- @Override
- protected IDataModel createDataModel() {
- return DataModelFactory.createDataModel(new JaxbProjectCreationDataModelProvider());
- }
-
- @Override
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("jpt.jaxb.template");
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java
deleted file mode 100644
index 1a1ec07af8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.proj;
-
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage;
-
-
-public class JaxbProjectWizardFirstPage
- extends DataModelFacetCreationWizardPage {
-
- public JaxbProjectWizardFirstPage(IDataModel dataModel, String pageName) {
- super(dataModel, pageName);
- setTitle(JptJaxbUiMessages.JaxbProjectWizard_firstPage_title);
- setDescription(JptJaxbUiMessages.JaxbProjectWizard_firstPage_desc);
- //setInfopopID(JpaJaxbHelpContextIds.NEW_JAXB_PROJECT);
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- final Composite top = super.createTopLevelComposite(parent);
- createWorkingSetGroupPanel(top, new String[] { RESOURCE_WORKING_SET, JAVA_WORKING_SET });
- return top;
- }
-
-// @Override
-// public boolean internalLaunchNewRuntimeWizard(Shell shell, IDataModel model) {
-// IFacetedProjectWorkingCopy fpwc = (IFacetedProjectWorkingCopy) model.getProperty(FACETED_PROJECT_WORKING_COPY);
-// IProjectFacetVersion moduleFacet = FacetTools.getModuleFacet(fpwc);
-// if (moduleFacet != null) {
-// return launchNewRuntimeWizard(shell, model, moduleFacet.getProjectFacet().getId());
-// }
-// else {
-// return launchNewRuntimeWizard(shell, model);
-// }
-// }
-
- @Override
- protected String getModuleTypeID() {
- return JaxbFacet.ID;
- }
-
- @Override
- public void storeDefaultSettings() {
- super.storeDefaultSettings();
- // TODO
-// IDialogSettings settings = getDialogSettings();
-// if (settings != null) {
-// FacetDataModelMap map = (FacetDataModelMap)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
-// String facetID = getModuleFacetID();
-// IDataModel j2eeModel = map.getFacetDataModel(facetID);
-// if(j2eeModel.getBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR)){
-// String lastEARName = j2eeModel.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
-// settings.put(STORE_LABEL, lastEARName);
-// }
-// }
- }
-
- @Override
- public void restoreDefaultSettings() {
- super.restoreDefaultSettings();
- // TODO
-// IDialogSettings settings = getDialogSettings();
-// if (settings != null) {
-// String lastEARName = settings.get(STORE_LABEL);
-// if (lastEARName != null){
-// FacetDataModelMap map = (FacetDataModelMap)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
-// String facetID = getModuleFacetID();
-// IDataModel j2eeModel = map.getFacetDataModel(facetID);
-// j2eeModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.LAST_EAR_NAME, lastEARName);
-// }
-// }
- }
-
-// @Override
-// protected IDialogSettings getDialogSettings() {
-// return J2EEUIPlugin.getDefault().getDialogSettings();
-// }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java
deleted file mode 100644
index 76747b04ab..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.proj.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-
-
-public class JaxbProjectCreationDataModelProvider
- extends FacetProjectCreationDataModelProvider
- implements IFacetProjectCreationDataModelProperties {
-
- public JaxbProjectCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public void init() {
- super.init();
-
- Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>();
- requiredFacets.add(JavaFacet.FACET);
- requiredFacets.add(JaxbFacet.FACET);
- setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java
deleted file mode 100644
index b703e1c3bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
-
-import org.eclipse.jdt.ui.jarpackager.JarPackageData;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Façade class to change accessibility of AbstractJarDestinationWizardPage.
- */
-@SuppressWarnings("restriction")
-public abstract class AbstractJarDestinationWizardPage extends org.eclipse.jdt.internal.ui.jarpackager.AbstractJarDestinationWizardPage
-{
-
- public AbstractJarDestinationWizardPage(String pageName, IStructuredSelection selection, JarPackageData jarPackage) {
- super(pageName, selection, jarPackage);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java
deleted file mode 100644
index e551a5e32f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java
+++ /dev/null
@@ -1,856 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Code originate from org.eclipse.jdt.internal.ui.jarpackager
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * Combines a CheckboxTreeViewer and CheckboxListViewer.
- * All viewer selection-driven interactions are handled within this viewer
- */
-public class CheckboxTreeAndListGroup implements ICheckStateListener, ISelectionChangedListener, ITreeViewerListener {
-
- private Object fRoot;
- private Object fCurrentTreeSelection;
- private List fExpandedTreeNodes= new ArrayList();
- private Map fCheckedStateStore= this.buildCheckedStateStore();
- private List fWhiteCheckedTreeItems= new ArrayList();
- private List fListeners= new ArrayList();
-
- private ITreeContentProvider fTreeContentProvider;
- private IStructuredContentProvider fListContentProvider;
- private ILabelProvider fTreeLabelProvider;
- private ILabelProvider fListLabelProvider;
-
- // widgets
- private CheckboxTreeViewer fTreeViewer;
- private CheckboxTableViewer fListViewer;
-
- /**
- * Creates an instance of this class. Use this constructor if you wish to specify
- * the width and/or height of the combined widget (to only hardcode one of the
- * sizing dimensions, specify the other dimension's value as -1)
- * @param parent parent composite
- * @param rootObject
- * @param treeContentProvider
- * @param treeLabelProvider
- * @param listContentProvider
- * @param listLabelProvider
- * @param style
- * @param width the width
- * @param height the height
- */
- public CheckboxTreeAndListGroup(
- Composite parent,
- Object rootObject,
- ITreeContentProvider treeContentProvider,
- ILabelProvider treeLabelProvider,
- IStructuredContentProvider listContentProvider,
- ILabelProvider listLabelProvider,
- int style,
- int width,
- int height) {
- fRoot= rootObject;
- fTreeContentProvider= treeContentProvider;
- fListContentProvider= listContentProvider;
- fTreeLabelProvider= treeLabelProvider;
- fListLabelProvider= listLabelProvider;
- createContents(parent, width, height, style);
- }
- /**
- * This method must be called just before this window becomes visible.
- */
- public void aboutToOpen() {
- determineWhiteCheckedDescendents(fRoot);
- checkNewTreeElements(getTreeChildren(fRoot));
- fCurrentTreeSelection= null;
-
- //select the first element in the list
- Object[] elements= getTreeChildren(fRoot);
- Object primary= elements.length > 0 ? elements[0] : null;
- if (primary != null) {
- fTreeViewer.setSelection(new StructuredSelection(primary));
- }
- fTreeViewer.getControl().setFocus();
- }
- /**
- * Adds the passed listener to self's collection of clients
- * that listen for changes to element checked states
- *
- * @param listener ICheckStateListener
- */
- public void addCheckStateListener(ICheckStateListener listener) {
- fListeners.add(listener);
- }
- /**
- * Adds the receiver and all of it's ancestors to the checkedStateStore if they
- * are not already there.
- * @param treeElement
- */
- private void addToHierarchyToCheckedStore(Object treeElement) {
-
- // if this tree element is already gray then its ancestors all are as well
- if (!fCheckedStateStore.containsKey(treeElement))
- fCheckedStateStore.put(treeElement, new ArrayList());
-
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null)
- addToHierarchyToCheckedStore(parent);
- }
- /**
- * Returns a boolean indicating whether all children of the passed tree element
- * are currently white-checked
- *
- * @return boolean
- * @param treeElement java.lang.Object
- */
- protected boolean areAllChildrenWhiteChecked(Object treeElement) {
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i) {
- if (!fWhiteCheckedTreeItems.contains(children[i]))
- return false;
- }
-
- return true;
- }
- /**
- * Returns a boolean indicating whether all list elements associated with
- * the passed tree element are currently checked
- *
- * @return boolean
- * @param treeElement java.lang.Object
- */
- protected boolean areAllElementsChecked(Object treeElement) {
- List checkedElements= (List)fCheckedStateStore.get(treeElement);
- if (checkedElements == null) // ie.- tree item not even gray-checked
- return false;
-
- return getListItemsSize(treeElement) == checkedElements.size();
- }
- /**
- * Iterates through the passed elements which are being realized for the first
- * time and check each one in the tree viewer as appropriate
- * @param elements
- */
- protected void checkNewTreeElements(Object[] elements) {
- for (int i= 0; i < elements.length; ++i) {
- Object currentElement= elements[i];
- boolean checked= fCheckedStateStore.containsKey(currentElement);
- fTreeViewer.setChecked(currentElement, checked);
- fTreeViewer.setGrayed(
- currentElement,
- checked && !fWhiteCheckedTreeItems.contains(currentElement));
- }
- }
- /**
- * An item was checked in one of self's two views. Determine which
- * view this occurred in and delegate appropriately
- *
- * @param event CheckStateChangedEvent
- */
- public void checkStateChanged(final CheckStateChangedEvent event) {
-
- //Potentially long operation - show a busy cursor
- BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- if (event.getCheckable().equals(fTreeViewer))
- treeItemChecked(event.getElement(), event.getChecked());
- else
- listItemChecked(event.getElement(), event.getChecked(), true);
-
- notifyCheckStateChangeListeners(event);
- }
- });
- }
- /**
- * Lay out and initialize self's visual components.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @param width int
- * @param height int
- * @param style
- */
- protected void createContents(
- Composite parent,
- int width,
- int height,
- int style) {
- // group pane
- Composite composite= new Composite(parent, style);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- layout.makeColumnsEqualWidth= true;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- createTreeViewer(composite, width / 2, height);
- createListViewer(composite, width / 2, height);
-
- initialize();
- }
- /**
- * Creates this group's list viewer.
- * @param parent the parent composite
- * @param width the width
- * @param height the height
- */
- protected void createListViewer(Composite parent, int width, int height) {
- fListViewer= CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
- fListViewer.setUseHashlookup(true);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.widthHint= width;
- data.heightHint= height;
- fListViewer.getTable().setLayoutData(data);
- fListViewer.setContentProvider(fListContentProvider);
- fListViewer.setLabelProvider(fListLabelProvider);
- fListViewer.addCheckStateListener(this);
- }
- /**
- * Creates this group's tree viewer.
- * @param parent parent composite
- * @param width the width
- * @param height the height
- */
- protected void createTreeViewer(Composite parent, int width, int height) {
- Tree tree= new Tree(parent, SWT.CHECK | SWT.BORDER);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.widthHint= width;
- data.heightHint= height;
- tree.setLayoutData(data);
-
- fTreeViewer= new CheckboxTreeViewer(tree);
- fTreeViewer.setUseHashlookup(true);
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fTreeViewer.setLabelProvider(fTreeLabelProvider);
- fTreeViewer.addTreeListener(this);
- fTreeViewer.addCheckStateListener(this);
- fTreeViewer.addSelectionChangedListener(this);
- }
- /**
- * Returns a boolean indicating whether the passed tree element should be
- * at LEAST gray-checked. Note that this method does not consider whether
- * it should be white-checked, so a specified tree item which should be
- * white-checked will result in a <code>true</code> answer from this method.
- * To determine whether a tree item should be white-checked use method
- * #determineShouldBeWhiteChecked(Object).
- *
- * @param treeElement java.lang.Object
- * @return boolean
- * @see #determineShouldBeWhiteChecked(java.lang.Object)
- */
- protected boolean determineShouldBeAtLeastGrayChecked(Object treeElement) {
- // if any list items associated with treeElement are checked then it
- // retains its gray-checked status regardless of its children
- List checked= (List) fCheckedStateStore.get(treeElement);
- if (checked != null && (!checked.isEmpty()))
- return true;
-
- // if any children of treeElement are still gray-checked then treeElement
- // must remain gray-checked as well
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i) {
- if (fCheckedStateStore.containsKey(children[i]))
- return true;
- }
-
- return false;
- }
- /**
- * Returns a boolean indicating whether the passed tree item should be
- * white-checked.
- *
- * @return boolean
- * @param treeElement java.lang.Object
- */
- protected boolean determineShouldBeWhiteChecked(Object treeElement) {
- return areAllChildrenWhiteChecked(treeElement)
- && areAllElementsChecked(treeElement);
- }
- /**
- * Recursively adds appropriate tree elements to the collection of
- * known white-checked tree elements.
- *
- * @param treeElement java.lang.Object
- */
- protected void determineWhiteCheckedDescendents(Object treeElement) {
- // always go through all children first since their white-checked
- // statuses will be needed to determine the white-checked status for
- // this tree element
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i)
- determineWhiteCheckedDescendents(children[i]);
-
- // now determine the white-checked status for this tree element
- if (determineShouldBeWhiteChecked(treeElement))
- setWhiteChecked(treeElement, true);
- }
- /**
- * Causes the tree viewer to expand all its items
- */
- public void expandAll() {
- fTreeViewer.expandAll();
- }
- /**
- * Answers a flat collection of all of the checked elements in the
- * list portion of self
- *
- * @return java.util.Vector
- */
- public Iterator getAllCheckedListItems() {
- Set result= new HashSet();
- Iterator listCollectionsEnum= this.fCheckedStateStore.values().iterator();
- while (listCollectionsEnum.hasNext())
- result.addAll((List)listCollectionsEnum.next());
- return result.iterator();
- }
- /**
- * Answer a collection of all of the checked elements in the tree portion
- * of self
- *
- * @return java.util.Vector
- */
- public Set getAllCheckedTreeItems() {
- return new HashSet(fCheckedStateStore.keySet());
- }
- /**
- * Answers the number of elements that have been checked by the
- * user.
- *
- * @return int
- */
- public int getCheckedElementCount() {
- return fCheckedStateStore.size();
- }
- /**
- * Returns a count of the number of list items associated with a
- * given tree item.
- *
- * @return int
- * @param treeElement java.lang.Object
- */
- protected int getListItemsSize(Object treeElement) {
- Object[] elements= getListElements(treeElement);
- return elements.length;
- }
- /**
- * Gets the table that displays the folder content
- *
- * @return the table used to show the list
- */
- public Table getTable() {
- return fListViewer.getTable();
- }
- /**
- * Gets the tree that displays the list for a folder
- *
- * @return the tree used to show the folders
- */
- public Tree getTree() {
- return fTreeViewer.getTree();
- }
- /**
- * Adds the given filter to the tree viewer and
- * triggers refiltering and resorting of the elements.
- *
- * @param filter a viewer filter
- */
- public void addTreeFilter(ViewerFilter filter) {
- fTreeViewer.addFilter(filter);
- }
-
- public void removeTreeFilter(ViewerFilter filter) {
- fTreeViewer.removeFilter(filter);
- }
-
- /**
- * Adds the given filter to the list viewer and
- * triggers refiltering and resorting of the elements.
- *
- * @param filter a viewer filter
- */
- public void addListFilter(ViewerFilter filter) {
- fListViewer.addFilter(filter);
- }
-
- /**
- * Logically gray-check all ancestors of treeItem by ensuring that they
- * appear in the checked table
- * @param treeElement
- */
- protected void grayCheckHierarchy(Object treeElement) {
-
- // if this tree element is already gray then its ancestors all are as well
- if (fCheckedStateStore.containsKey(treeElement))
- return; // no need to proceed upwards from here
-
- fCheckedStateStore.put(treeElement, new ArrayList());
- if (determineShouldBeWhiteChecked(treeElement)) {
- setWhiteChecked(treeElement, true);
- }
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null)
- grayCheckHierarchy(parent);
- }
- /**
- * Sets the initial checked state of the passed list element to true.
- * @param element
- */
- public void initialCheckListItem(Object element) {
- Object parent= fTreeContentProvider.getParent(element);
- fCurrentTreeSelection= parent;
- //As this is not done from the UI then set the box for updating from the selection to false
- listItemChecked(element, true, false);
- updateHierarchy(parent);
- }
- /**
- * Sets the initial checked state of the passed element to true,
- * as well as to all of its children and associated list elements
- * @param element
- */
- public void initialCheckTreeItem(Object element) {
- treeItemChecked(element, true);
- }
- /**
- * Initializes this group's viewers after they have been laid out.
- */
- protected void initialize() {
- fTreeViewer.setInput(fRoot);
- }
- /**
- * Callback that's invoked when the checked status of an item in the list
- * is changed by the user. Do not try and update the hierarchy if we are building the
- * initial list.
- * @param listElement
- * @param state
- * @param updatingFromSelection
- */
- protected void listItemChecked(
- Object listElement,
- boolean state,
- boolean updatingFromSelection) {
- List checkedListItems= (List) fCheckedStateStore.get(fCurrentTreeSelection);
-
- if (state) {
- if (checkedListItems == null) {
- // since the associated tree item has gone from 0 -> 1 checked
- // list items, tree checking may need to be updated
- grayCheckHierarchy(fCurrentTreeSelection);
- checkedListItems= (List) fCheckedStateStore.get(fCurrentTreeSelection);
- }
- checkedListItems.add(listElement);
- } else {
- checkedListItems.remove(listElement);
- if (checkedListItems.isEmpty()) {
- // since the associated tree item has gone from 1 -> 0 checked
- // list items, tree checking may need to be updated
- ungrayCheckHierarchy(fCurrentTreeSelection);
- }
- }
-
- if (updatingFromSelection)
- updateHierarchy(fCurrentTreeSelection);
- }
- /**
- * Notifies all checked state listeners that the passed element has had
- * its checked state changed to the passed state
- * @param event
- */
- protected void notifyCheckStateChangeListeners(CheckStateChangedEvent event) {
- Iterator listenersEnum= fListeners.iterator();
- while (listenersEnum.hasNext())
- ((ICheckStateListener) listenersEnum.next()).checkStateChanged(event);
- }
- /**
- *Sets the contents of the list viewer based upon the specified selected
- *tree element. This also includes checking the appropriate list items.
- *
- *@param treeElement java.lang.Object
- */
- public void populateListViewer(final Object treeElement) {
- if (treeElement == fCurrentTreeSelection)
- return;
- fCurrentTreeSelection= treeElement;
- fListViewer.setInput(treeElement);
- List listItemsToCheck= (List) fCheckedStateStore.get(treeElement);
-
- if (listItemsToCheck != null) {
- Iterator listItemsEnum= listItemsToCheck.iterator();
- while (listItemsEnum.hasNext())
- fListViewer.setChecked(listItemsEnum.next(), true);
- }
- }
- /**
- * Removes the passed listener from self's collection of clients
- * that listen for changes to element checked states
- *
- * @param listener ICheckStateListener
- */
- public void removeCheckStateListener(ICheckStateListener listener) {
- fListeners.remove(listener);
- }
- /**
- * Handles the selection of an item in the tree viewer
- *
- * @param event ISelection
- */
- public void selectionChanged(final SelectionChangedEvent event) {
- BusyIndicator.showWhile(getTable().getShell().getDisplay(), new Runnable() {
- public void run() {
- IStructuredSelection selection= (IStructuredSelection) event.getSelection();
- Object selectedElement= selection.getFirstElement();
- if (selectedElement == null) {
- fCurrentTreeSelection= null;
- fListViewer.setInput(fCurrentTreeSelection);
- return;
- }
- populateListViewer(selectedElement);
- }
- });
- }
-
- /**
- * Selects or deselect all of the elements in the tree depending on the value of the selection
- * boolean. Be sure to update the displayed files as well.
- * @param selection
- */
- public void setAllSelections(final boolean selection) {
-
- //Potentially long operation - show a busy cursor
- BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- setTreeChecked(fRoot, selection);
- fListViewer.setAllChecked(selection);
- }
- });
- }
-
- /**
- * Sets the list viewer's providers to those passed
- *
- * @param contentProvider ITreeContentProvider
- * @param labelProvider ILabelProvider
- */
- public void setListProviders(
- IStructuredContentProvider contentProvider,
- ILabelProvider labelProvider) {
- fListViewer.setContentProvider(contentProvider);
- fListViewer.setLabelProvider(labelProvider);
- }
- /**
- * Sets the sorter that is to be applied to self's list viewer
- * @param comparator
- */
- public void setListComparator(ViewerComparator comparator) {
- fListViewer.setComparator(comparator);
- }
- /**
- * Sets the root of the widget to be new Root. Regenerate all of the tables and lists from this
- * value.
- *
- * @param newRoot
- */
- public void setRoot(Object newRoot) {
- this.fRoot= newRoot;
- initialize();
- }
- /**
- * Sets the checked state of the passed tree element appropriately, and
- * do so recursively to all of its child tree elements as well
- * @param treeElement
- * @param state
- */
- protected void setTreeChecked(Object treeElement, boolean state) {
-
- if (treeElement.equals(fCurrentTreeSelection)) {
- fListViewer.setAllChecked(state);
- }
-
- if (state) {
- Object[] listItems= getListElements(treeElement);
- List listItemsChecked= new ArrayList();
- for (int i= 0; i < listItems.length; ++i)
- listItemsChecked.add(listItems[i]);
-
- fCheckedStateStore.put(treeElement, listItemsChecked);
- } else
- fCheckedStateStore.remove(treeElement);
-
- setWhiteChecked(treeElement, state);
- fTreeViewer.setChecked(treeElement, state);
- fTreeViewer.setGrayed(treeElement, false);
-
- // now logically check/uncheck all children as well
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i) {
- setTreeChecked(children[i], state);
- }
- }
- /**
- * Sets the tree viewer's providers to those passed
- *
- * @param contentProvider ITreeContentProvider
- * @param labelProvider ILabelProvider
- */
- public void setTreeProviders(
- ITreeContentProvider contentProvider,
- ILabelProvider labelProvider) {
- fTreeViewer.setContentProvider(contentProvider);
- fTreeViewer.setLabelProvider(labelProvider);
- }
- /**
- * Sets the sorter that is to be applied to self's tree viewer
- * @param sorter
- */
- public void setTreeComparator(ViewerComparator sorter) {
- fTreeViewer.setComparator(sorter);
- }
- /**
- * Adjusts the collection of references to white-checked tree elements appropriately.
- *
- * @param treeElement java.lang.Object
- * @param isWhiteChecked boolean
- */
- protected void setWhiteChecked(Object treeElement, boolean isWhiteChecked) {
- if (isWhiteChecked) {
- if (!fWhiteCheckedTreeItems.contains(treeElement))
- fWhiteCheckedTreeItems.add(treeElement);
- } else
- fWhiteCheckedTreeItems.remove(treeElement);
- }
- /**
- * Handle the collapsing of an element in a tree viewer
- * @param event
- */
- public void treeCollapsed(TreeExpansionEvent event) {
- // We don't need to do anything with this
- }
-
- /**
- * Handles the expansionsion of an element in a tree viewer
- * @param event
- */
- public void treeExpanded(TreeExpansionEvent event) {
-
- Object item= event.getElement();
-
- // First see if the children need to be given their checked state at all. If they've
- // already been realized then this won't be necessary
- if (!fExpandedTreeNodes.contains(item)) {
- fExpandedTreeNodes.add(item);
- checkNewTreeElements(getTreeChildren(item));
- }
- }
-
- /**
- * Callback that's invoked when the checked status of an item in the tree
- * is changed by the user.
- * @param treeElement
- * @param state
- */
- protected void treeItemChecked(Object treeElement, boolean state) {
-
- // recursively adjust all child tree elements appropriately
- setTreeChecked(treeElement, state);
-
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent == null)
- return;
-
- // now update upwards in the tree hierarchy
- if (state)
- grayCheckHierarchy(parent);
- else
- ungrayCheckHierarchy(parent);
-
- updateHierarchy(treeElement);
- }
- /**
- * Logically un-gray-check all ancestors of treeItem iff appropriate.
- * @param treeElement
- */
- protected void ungrayCheckHierarchy(Object treeElement) {
- if (!determineShouldBeAtLeastGrayChecked(treeElement))
- fCheckedStateStore.remove(treeElement);
-
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null)
- ungrayCheckHierarchy(parent);
- }
- /**
- * Sets the checked state of self and all ancestors appropriately
- * @param treeElement
- */
- protected void updateHierarchy(Object treeElement) {
-
- boolean whiteChecked= determineShouldBeWhiteChecked(treeElement);
- boolean shouldBeAtLeastGray= determineShouldBeAtLeastGrayChecked(treeElement);
-
- fTreeViewer.setChecked(treeElement, whiteChecked || shouldBeAtLeastGray);
- setWhiteChecked(treeElement, whiteChecked);
- if (whiteChecked)
- fTreeViewer.setGrayed(treeElement, false);
- else
- fTreeViewer.setGrayed(treeElement, shouldBeAtLeastGray);
-
- // proceed up the tree element hierarchy
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null) {
- updateHierarchy(parent);
- }
- }
- /**
- * Update the selections of the tree elements in items to reflect the new
- * selections provided.
- *
- * @param items with keys of Object (the tree element) and values of List (the selected
- * list elements).
- */
- public void updateSelections(final Map items) {
-
- //Potentially long operation - show a busy cursor
- BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- handleUpdateSelection(items);
- }
- });
- }
- /**
- * Returns the result of running the given elements through the filters.
- * @param filters
- *
- * @param elements the elements to filter
- * @return only the elements which all filters accept
- */
- protected Object[] filter(ViewerFilter[] filters, Object[] elements) {
- if (filters != null) {
- ArrayList filtered = new ArrayList(elements.length);
- for (int i = 0; i < elements.length; i++) {
- boolean add = true;
- for (int j = 0; j < filters.length; j++) {
- add = filters[j].select(null, null, elements[i]);
- if (!add)
- break;
- }
- if (add)
- filtered.add(elements[i]);
- }
- return filtered.toArray();
- }
- return elements;
- }
-
- private Object[] getTreeChildren(Object element) {
- return filter(fTreeViewer.getFilters(), fTreeContentProvider.getChildren(element));
- }
-
- private Object[] getListElements(Object element) {
- return filter(fListViewer.getFilters(), fListContentProvider.getElements(element));
- }
-
- public Set getWhiteCheckedTreeItems() {
- return new HashSet(fWhiteCheckedTreeItems);
- }
-
- private HashMap buildCheckedStateStore() {
- return new HashMap(9);
- }
-
- private void handleUpdateSelection(Map items) {
- Iterator keyIterator= items.keySet().iterator();
-
- //Update the store before the hierarchy to prevent updating parents before all of the children are done
- while (keyIterator.hasNext()) {
- Object key= keyIterator.next();
- //Replace the items in the checked state store with those from the supplied items
- List selections= (List) items.get(key);
- if (selections.size() == 0)
- //If it is empty remove it from the list
- fCheckedStateStore.remove(key);
- else {
- fCheckedStateStore.put(key, selections);
- // proceed up the tree element hierarchy
- Object parent= fTreeContentProvider.getParent(key);
- if (parent != null) {
- addToHierarchyToCheckedStore(parent);
- }
- }
- }
-
- //Now update hierarchies
- keyIterator= items.keySet().iterator();
-
- while (keyIterator.hasNext()) {
- Object key= keyIterator.next();
- updateHierarchy(key);
- if (fCurrentTreeSelection != null && fCurrentTreeSelection.equals(key)) {
- fListViewer.setAllChecked(false);
- fListViewer.setCheckedElements(((List) items.get(key)).toArray());
- }
- }
- }
-
- /**
- * Checks if an element is grey checked.
- * @param object
- * @return if an element is grey checked.
- */
- public boolean isTreeItemGreyChecked(Object object) {
- return fTreeViewer.getGrayed(object);
- }
-
- /**
- * For a given element, expand its chidren to a level.
- * @param object
- * @param level
- */
- public void expandTreeToLevel(Object object, int level) {
- fTreeViewer.expandToLevel(object, level);
- }
- /**
- * @param selection
- */
- public void setTreeSelection(ISelection selection) {
- fTreeViewer.setSelection(selection);
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java
deleted file mode 100644
index d6fcb911bf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
-
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.CONTAINER_PATH;
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.FILE_NAME;
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.PROJECT;
-import static org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen.SchemaGeneratorWizard.XSD_EXTENSION;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.utility.internal.FileTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * NewSchemaFileWizardPage
- */
-public class NewSchemaFileWizardPage extends WizardNewFileCreationPage {
-
- protected IDataModel dataModel;
-
- private IStructuredSelection initialSelection;
-
- static public String DEFAULT_SCHEMA_NAME = "NewXMLSchema" + XSD_EXTENSION; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public NewSchemaFileWizardPage(String pageName, IStructuredSelection selection, IDataModel dataModel,
- String title, String description) {
-
- super(pageName, selection);
- this.initialSelection = selection;
-
- this.init(dataModel);
- this.setTitle(title);
- this.setDescription(description);
- }
-
- protected void init(IDataModel dataModel) {
- this.dataModel = dataModel;
-
- IProject project = this.getProjectFromInitialSelection();
- this.dataModel.setProperty(PROJECT, project);
-
- IPath containerPath = (IPath) this.dataModel.getProperty(CONTAINER_PATH);
- if (containerPath != null) {
- this.setContainerFullPath(containerPath);
- }
- }
-
- // ********** IDialogPage implementation **********
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
-
- this.setAllowExistingResources(true);
- this.setFileName(DEFAULT_SCHEMA_NAME);
- }
-
- // ********** intra-wizard methods **********
-
- public IProject getProject() {
- return (IProject) this.dataModel.getProperty(PROJECT);
- }
-
- /**
- * @return the path of the schema file relative to the project
- */
- public IPath getFileRelativePath() {
- IPath filePath = this.getContainerFullPath();
- String projectName = filePath.segment(0);
-
- if(this.getProject().getName().equals(projectName)) {
- filePath = filePath.removeFirstSegments(1);
- }
- return filePath;
- }
-
- // ********** validation **********
-
- @Override
- protected boolean validatePage() {
- this.dataModel.setProperty(PROJECT, this.getProjectNamed(this.getContainerName()));
- this.dataModel.setProperty(CONTAINER_PATH, this.getContainerFullPath());
- this.dataModel.setProperty(FILE_NAME, this.getFileName());
-
- boolean valid = super.validatePage();
- if( ! valid) {
- return valid;
- }
- this.overrideFileExistsWarning();
-
- //TODO move this validation to the dataModel - see MappingFileNewFileWizardPage
- // Validate Project
- valid = this.projectIsJavaProject(this.getProject());
- if( ! valid) {
- this.setErrorMessage(JptJaxbUiMessages.NewSchemaFileWizardPage_errorNotJavaProject);
- return valid;
- }
- // Validate XSD file not exists.
- valid = this.xsdFileNotExists();
- if( ! valid) {
- this.setMessage(JptJaxbUiMessages.NewSchemaFileWizardPage_overwriteExistingSchemas, IMessageProvider.WARNING);
- return true;
- }
- this.setErrorMessage(null);
-
- return valid;
- }
-
- // ********** internal methods **********
-
- private boolean projectIsJavaProject(IProject project) {
- try {
- return (project != null) && (project.hasNature(JavaCore.NATURE_ID));
- }
- catch (CoreException e) {
- return false;
- }
- }
-
- private IProject getProjectFromInitialSelection() {
- Object firstElement = initialSelection.getFirstElement();
- if(firstElement instanceof IProject) {
- return (IProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- return ((IResource) firstElement).getProject();
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject().getProject();
- }
- return null;
- }
-
- private IProject getProjectNamed(String projectName) {
- if(StringTools.stringIsEmpty(projectName)) {
- return null;
- }
- return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- }
-
- private String getContainerName() {
- IPath containerPath = this.getContainerFullPath();
- if(containerPath == null) {
- return null;
- }
- String containerName = containerPath.segment(0);
- return containerName;
- }
-
- private void overrideFileExistsWarning() {
- String existsString= IDEWorkbenchMessages.ResourceGroup_nameExists;
- existsString.toString();
-
- existsString = existsString.substring("''{0}''".length(), existsString.length()); //$NON-NLS-1$
- String message = this.getMessage();
- if(message != null && message.endsWith(existsString)) {
- this.setMessage(null);
- }
- }
-
- private boolean xsdFileNotExists() {
-
- return ! this.xsdFileExists(this.getContainerAbsolutePath().toFile());
- }
-
- private boolean xsdFileExists(File directory) {
-
- if(directory.listFiles() == null) {
- throw new RuntimeException("Could not find directory: " + directory); //$NON-NLS-1$
- }
- for(File file : directory.listFiles()) {
- if (file.isDirectory()) {
- continue;
- }
- else if(XSD_EXTENSION.equalsIgnoreCase(FileTools.extension(file))) {
- return true;
- }
- }
- return false;
- }
-
- private IPath getContainerAbsolutePath() {
- IPath projectRelativePath = this.getContainerFullPath().makeRelativeTo(this.getProject().getFullPath());
- IResource directory = (projectRelativePath.isEmpty()) ?
- this.getProject() :
- this.getProject().getFile(projectRelativePath);
- return directory.getLocation();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
deleted file mode 100644
index 7b1dc1c747..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.FileTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.gen.SchemaGenerator;
-import org.eclipse.jpt.jaxb.core.internal.operations.SchemaFileCreationDataModelProvider;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * SchemaGeneratorWizard
- */
-public class SchemaGeneratorWizard extends Wizard implements INewWizard
-{
- protected IStructuredSelection initialSelection;
- private IJavaProject targetProject;
-
- protected IDataModel dataModel;
-
- private NewSchemaFileWizardPage newSchemaFileWizardPage;
-
- private SchemaGeneratorWizardPage schemaGenWizardPage;
-
- public static final String XSD_EXTENSION = ".xsd"; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public SchemaGeneratorWizard() {
- super();
- setWindowTitle(JptJaxbUiMessages.SchemaGeneratorWizard_title);
- setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.SCHEMA_GEN_WIZ_BANNER));
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.initialSelection = selection;
-
- if (selection == null || selection.isEmpty()) {
- return;
- }
- this.targetProject = this.getProjectFromInitialSelection();
- this.dataModel = null;
- }
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
-
- this.newSchemaFileWizardPage = this.buildNewSchemaFileWizardPage(this.initialSelection);
- this.addPage(this.newSchemaFileWizardPage);
-
- this.schemaGenWizardPage = this.buildSchemaGeneratorWizardPage(this.buildSelection(this.getProject()));
- this.addPage(this.schemaGenWizardPage);
- }
-
- @Override
- public boolean performFinish() {
-
- this.targetProject = this.getJavaProject();
-
- String[] sourceClassNames = this.buildSourceClassNames(this.getAllCheckedItems());
-
- WorkspaceJob genSchemaJob = new GenerateSchemaJob(
- this.targetProject,
- sourceClassNames,
- this.getTargetSchema(),
- this.usesMoxy());
- genSchemaJob.schedule();
-
- return true;
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- return this.getJavaProjectFrom(this.getProject());
- }
-
- // ********** internal methods **********
-
- private IProject getProject() {
- return this.newSchemaFileWizardPage.getProject();
- }
-
- private IJavaProject getProjectFromInitialSelection() {
- IJavaProject project = null;
-
- Object firstElement = this.initialSelection.getFirstElement();
- if(firstElement instanceof IJavaElement) {
- IJavaElement javaElement = (IJavaElement)firstElement;
- int type = javaElement.getElementType();
- if(type == IJavaElement.JAVA_PROJECT) {
- project = (IJavaProject)javaElement;
- }
- else if(type == IJavaElement.PACKAGE_FRAGMENT) {
- project = ((IPackageFragment)javaElement).getJavaProject();
- }
- }
- return project;
- }
-
- private IJavaProject getJavaProjectFrom(IProject project) {
- IJavaProject javaProject = (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- if(javaProject == null) {
- throw new RuntimeException("Not a Java Project"); //$NON-NLS-1$
- }
- return javaProject;
- }
-
- private String getTargetSchema() {
-
- IPath filePath = this.newSchemaFileWizardPage.getFileRelativePath();
- String fileName = this.newSchemaFileWizardPage.getFileName();
- String targetSchema = (filePath.isEmpty()) ?
- fileName :
- filePath.toOSString() + File.separator + fileName;
-
- return this.addXsdExtension(targetSchema);
- }
-
- private String addXsdExtension(String fileName) {
-
- return (FileTools.extension(fileName).equalsIgnoreCase(XSD_EXTENSION)) ?
- fileName :
- fileName + XSD_EXTENSION;
- }
-
- private Object[] getAllCheckedItems() {
- return this.schemaGenWizardPage.getAllCheckedItems();
- }
-
- private String[] buildSourceClassNames(Object[] checkedElements) {
-
- ArrayList<String> classNames = new ArrayList<String>();
-
- for(Object element: checkedElements) {
- IJavaElement javaElement = (IJavaElement)element;
- String packageName = javaElement.getParent().getElementName();
- String elementName = javaElement.getElementName();
- String className = FileTools.stripExtension(elementName);
- if(StringTools.stringIsEmpty(packageName)) {
- classNames.add(className);
- }
- else {
- classNames.add(packageName + '.' + className);
- }
- }
-
- return ArrayTools.array(classNames, new String[0]);
- }
-
- private boolean usesMoxy() {
- return this.schemaGenWizardPage.usesMoxy();
- }
-
- protected NewSchemaFileWizardPage buildNewSchemaFileWizardPage(IStructuredSelection selection) {
- return new NewSchemaFileWizardPage(
- "Page_1", selection, this.getDataModel(), //$NON-NLS-1$
- JptJaxbUiMessages.SchemaGeneratorProjectWizardPage_title,
- JptJaxbUiMessages.SchemaGeneratorProjectWizardPage_desc);
- }
-
- protected SchemaGeneratorWizardPage buildSchemaGeneratorWizardPage(IStructuredSelection selection) {
- return new SchemaGeneratorWizardPage(selection);
- }
-
- private IStructuredSelection buildSelection(IProject project) {
-
- List<IAdaptable> selectedElements = new ArrayList<IAdaptable>(1);
- this.addProjectTo(selectedElements, project);
- return new StructuredSelection(selectedElements);
- }
-
- private void addProjectTo(List<IAdaptable> selectedElements, IProject project) {
- try {
- if(project != null && project.hasNature(JavaCore.NATURE_ID))
- selectedElements.add(JavaCore.create(project));
- }
- catch(CoreException ex) {
- // ignore selected element
- }
- }
-
- protected IDataModel getDataModel() {
- if (this.dataModel == null) {
- this.dataModel = DataModelFactory.createDataModel(getDefaultProvider());
- }
- return this.dataModel;
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new SchemaFileCreationDataModelProvider();
- }
-
- // ********** generate schema job **********
-
- static class GenerateSchemaJob extends WorkspaceJob {
- private final IJavaProject javaProject;
- private final String[] sourceClassNames;
- private final String targetSchema;
- private final boolean useMoxy;
-
- GenerateSchemaJob(IJavaProject project, String[] sourceClassNames, String targetSchema, boolean useMoxy) {
- super(JptJaxbUiMessages.SchemaGeneratorWizard_generatingSchema);
-
- this.javaProject = project ;
- this.sourceClassNames = sourceClassNames;
- this.targetSchema = targetSchema;
- this.useMoxy = useMoxy;
-
- this.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(this.javaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, NLS.bind(JptJaxbUiMessages.SchemaGeneratorWizard_generateSchemaTask, this.targetSchema), 1);
- try {
- SchemaGenerator.generate(this.javaProject, this.targetSchema, this.sourceClassNames, this.useMoxy, sm.newChild(1));
- }
- catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- }
- return Status.OK_STATUS;
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java
deleted file mode 100644
index 70aa054611..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.ui.JavaElementComparator;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.ProblemsLabelDecorator;
-import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jaxb.core.internal.gen.SchemaGenerator;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.jaxb.ui.internal.filters.ContainerFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.EmptyInnerPackageFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.NonArchiveOrExternalElementFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.NonContainerFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.NonJavaElementFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.osgi.framework.Bundle;
-
-/**
- * SchemaGeneratorWizardPage
- */
-public class SchemaGeneratorWizardPage extends AbstractJarDestinationWizardPage {
-
- private IJavaProject targetProject;
-
- // widgets
- private SettingsGroup settingsGroup;
- private NonContainerFilter projectFilter;
-
- private Button usesMoxyCheckBox;
- private boolean usesMoxy;
-
- static public String JPT_ECLIPSELINK_UI_PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.ui"; //$NON-NLS-1$
-
- // other constants
- private static final int SIZING_SELECTION_WIDGET_WIDTH = 480;
- private static final int SIZING_SELECTION_WIDGET_HEIGHT = 150;
-
- public static final String HELP_CONTEXT_ID = "org.eclipse.jpt.ui.wizard_jaxbschema_classes"; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public SchemaGeneratorWizardPage(IStructuredSelection selection) {
- super("JAXB Schema Generator", selection, null); //$NON-NLS-1$
-
- this.setUsesMoxy(false);
- this.setTitle(JptJaxbUiMessages.SchemaGeneratorWizardPage_title);
- this.setDescription(JptJaxbUiMessages.SchemaGeneratorWizardPage_desc);
- }
-
- // ********** IDialogPage implementation **********
- @Override
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- if(visible) {
- this.updateTargetProject();
- this.updateInputGroupTreeFilter();
-
- // default usesMoxy to true only when JPT EclipseLink bundle exists and MOXy is on the classpath
- this.updateUsesMoxy(this.jptEclipseLinkBundleExists() && this.moxyIsOnClasspath());
-
- // checkbox visible only if jpt.eclipselink.ui plugin is available
- // and EclipseLink MOXy is not on the classpath
- this.usesMoxyCheckBox.setVisible(this.jptEclipseLinkBundleExists() && ! this.moxyIsOnClasspath());
-
- this.validateProjectClasspath();
- }
- }
-
- // ********** IWizardPage implementation **********
-
- @Override
- public boolean isPageComplete() {
- boolean complete = this.validateSourceGroup();
- if(complete) {
- this.validateProjectClasspath();
- }
- return complete;
- }
-
- @Override
- public void setPreviousPage(IWizardPage page) {
- super.setPreviousPage(page);
- if(this.getControl() != null)
- this.updatePageCompletion();
- }
-
- // ********** intra-wizard methods **********
-
- protected Object[] getAllCheckedItems() {
- return ArrayTools.array(this.getInputGroup().getAllCheckedListItems());
- }
-
- protected boolean usesMoxy() {
- return this.usesMoxy;
- }
-
- // ********** validation **********
-
- @Override
- @SuppressWarnings("restriction")
- protected void updatePageCompletion() {
- super.updatePageCompletion();
- }
-
- @Override
- protected boolean validateDestinationGroup() {
- // do nothing
- return true;
- }
-
- @Override
- protected boolean validateSourceGroup() {
- if(this.getAllCheckedItems().length == 0) {
- if(this.getErrorMessage() == null) {
- this.setErrorMessage(JptJaxbUiMessages.SchemaGeneratorWizardPage_errorNoPackage);
- }
- return false;
- }
- this.setErrorMessage(null);
- return true;
- }
-
- private void validateProjectClasspath() {
- if(this.targetProject == null) { // project selected available yet
- return;
- }
- //this line will suppress the "default package" warning (which doesn't really apply here
- //as the JAXB gen uses an org.example.schemaName package by default) and will clear the classpath warnings when necessary
- setMessage(null);
-
- if( ! this.genericJaxbIsOnClasspath()) {
- this.displayWarning(JptJaxbUiMessages.SchemaGeneratorWizardPage_jaxbLibrariesNotAvailable);
- }
- else if(this.usesMoxy() && ! this.moxyIsOnClasspath()) {
- //this message is being truncated by the wizard width in some cases
- this.displayWarning(JptJaxbUiMessages.SchemaGeneratorWizardPage_moxyLibrariesNotAvailable);
- }
-
- //this code will intelligently remove our classpath warnings when they are present but no longer apply (as an alternative
- //to setting the message to null continuously as is currently done)
-// else if( this.getMessage() != null){
-// if (this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable) ||
-// this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_moxyLibrariesNotAvailable)) {
-// setMessage(null);
-// }
-// }
- }
-
- /**
- * Test if the Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbIsOnClasspath() {
- try {
- String className = SchemaGenerator.JAXB_GENERIC_SCHEMA_GEN_CLASS;
- IType genClass = this.targetProject.findType(className);
- return (genClass != null);
- }
- catch(JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** internal methods **********
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
-
- this.settingsGroup = new SettingsGroup(composite);
-
- this.usesMoxyCheckBox = this.buildUsesMoxyCheckBox(composite);
-
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- private void updateTargetProject() {
-
- this.targetProject = ((SchemaGeneratorWizard)this.getWizard()).getJavaProject();
- }
-
- private void updateInputGroupTreeFilter() {
- this.getInputGroup().setAllSelections(false);
-
- if(this.projectFilter != null) {
- this.getInputGroup().removeTreeFilter(this.projectFilter);
- }
- this.projectFilter = new NonContainerFilter(this.targetProject.getProject().getName());
- this.getInputGroup().addTreeFilter(this.projectFilter);
- }
-
- private boolean jptEclipseLinkBundleExists() {
- return (this.getJptEclipseLinkBundle() != null);
- }
-
- private Bundle getJptEclipseLinkBundle() {
- return Platform.getBundle(JPT_ECLIPSELINK_UI_PLUGIN_ID); // Cannot reference directly EL plugin.
- }
-
- private void setUsesMoxy(boolean usesMoxy){
- this.usesMoxy = usesMoxy;
- }
-
- private void updateUsesMoxy(boolean usesMoxy){
- this.setUsesMoxy(usesMoxy);
- this.usesMoxyCheckBox.setSelection(this.usesMoxy());
- this.validateProjectClasspath();
- }
-
- /**
- * Test if the EclipseLink Jaxb compiler is on the classpath.
- */
- private boolean moxyIsOnClasspath() {
- try {
- String className = SchemaGenerator.JAXB_ECLIPSELINK_SCHEMA_GEN_CLASS;
- IType genClass = this.targetProject.findType(className);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void displayWarning(String message) {
- this.setMessage(message, WARNING);
- }
-
- private CheckboxTreeAndListGroup getInputGroup() {
- return this.settingsGroup.inputGroup;
- }
-
- // ********** overrides **********
- /**
- * Returns an iterator over this page's collection of currently-specified
- * elements to be exported. This is the primary element selection facility
- * accessor for subclasses.
- *
- * @return an iterator over the collection of elements currently selected for export
- */
- @Override
- protected Iterator<?> getSelectedResourcesIterator() {
- return this.getInputGroup().getAllCheckedListItems();
- }
-
- @Override
- protected void update() {
- this.updatePageCompletion();
- }
-
- @Override
- public final void saveWidgetValues() {
- // do nothing
- }
-
- @Override
- protected void internalSaveWidgetValues() {
- // do nothing
- }
-
- @Override
- protected void restoreWidgetValues() {
- // do nothing
- }
-
-
- @Override
- protected void initializeJarPackage() {
- // do nothing
- }
-
- @Override
- protected void giveFocusToDestination() {
- // do nothing
- }
-
- // ********** UI components **********
-
- private Button buildUsesMoxyCheckBox(Composite parent) {
-
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.verticalIndent = 10;
- checkBox.setLayoutData(gridData);
- checkBox.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_usesMoxyImplementation);
- checkBox.setSelection(this.usesMoxy());
- checkBox.addSelectionListener(this.buildUsesMoxySelectionListener());
-
- return checkBox;
- }
-
- private SelectionListener buildUsesMoxySelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
-
- public void widgetSelected(SelectionEvent event) {
- updateUsesMoxy(usesMoxyCheckBox.getSelection());
- validateProjectClasspath();
- }
- };
- }
-
- // ********** SettingsGroup class **********
-
- private class SettingsGroup {
-
- private CheckboxTreeAndListGroup inputGroup;
-
- // ********** constructor **********
-
- private SettingsGroup(Composite parent) {
- super();
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- buildSchemaComposite(composite);
-
- // Input Tree
- createPlainLabel(composite, JptJaxbUiMessages.SchemaGeneratorWizardPage_packages);
- this.inputGroup = this.createInputGroup(composite);
-
- }
-
- protected void buildSchemaComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout(3, false); // false = do not make columns equal width
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginBottom = 10;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- }
-
- // ********** UI components **********
-
- /**
- * Creates the checkbox tree and list for selecting resources.
- *
- * @param parent the parent control
- */
- protected CheckboxTreeAndListGroup createInputGroup(Composite parent) {
- CheckboxTreeAndListGroup checkboxTreeGroup;
-
- int labelFlags = JavaElementLabelProvider.SHOW_BASICS
- | JavaElementLabelProvider.SHOW_OVERLAY_ICONS
- | JavaElementLabelProvider.SHOW_SMALL_ICONS;
- ITreeContentProvider treeContentProvider=
- new StandardJavaElementContentProvider() {
- @Override
- public boolean hasChildren(Object element) {
- // prevent the + from being shown in front of packages
- return !(element instanceof IPackageFragment) && super.hasChildren(element);
- }
- };
- final DecoratingLabelProvider provider = new DecoratingLabelProvider(new JavaElementLabelProvider(labelFlags), new ProblemsLabelDecorator(null));
- checkboxTreeGroup = new CheckboxTreeAndListGroup(
- parent,
- JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()),
- treeContentProvider,
- provider,
- new StandardJavaElementContentProvider(),
- provider,
- SWT.NONE,
- SIZING_SELECTION_WIDGET_WIDTH,
- SIZING_SELECTION_WIDGET_HEIGHT);
- checkboxTreeGroup.addTreeFilter(new EmptyInnerPackageFilter());
- checkboxTreeGroup.setTreeComparator(new JavaElementComparator());
- checkboxTreeGroup.setListComparator(new JavaElementComparator());
-
- checkboxTreeGroup.addTreeFilter(new NonJavaElementFilter());
- checkboxTreeGroup.addTreeFilter(new NonArchiveOrExternalElementFilter());
-
- checkboxTreeGroup.addListFilter(new ContainerFilter());
- checkboxTreeGroup.addListFilter(new NonJavaElementFilter());
-
- checkboxTreeGroup.getTree().addListener(SWT.MouseUp, SchemaGeneratorWizardPage.this);
- checkboxTreeGroup.getTable().addListener(SWT.MouseUp, SchemaGeneratorWizardPage.this);
-
- ICheckStateListener listener = new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- update();
- }
- };
-
- checkboxTreeGroup.addCheckStateListener(listener);
- return checkboxTreeGroup;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java
deleted file mode 100644
index 2db5a2e7aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.navigator;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-
-/**
- * Defines content and label provider factories for Project Navigator view for a given JAXB project.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbNavigatorUi {
-
- /**
- * Return the factory to create {@link TreeItemContentProvider}s
- */
- TreeItemContentProviderFactory getTreeItemContentProviderFactory();
-
- /**
- * Return the factory to create {@link ItemLabelProvider}s
- */
- ItemLabelProviderFactory getItemLabelProviderFactory();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java
deleted file mode 100644
index e50e9ee980..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.platform;
-
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-
-/**
- * This interface is to be implemented by a JAXB implementation vendor to provide extensions
- * to JAXB UI functionality.
- * <p>
- * Any implementation should be <i>stateless</i> in nature.
- * <p>
- * See the extension point: org.eclipse.jpt.jaxb.ui.jaxbPlatforms
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformUi {
-
- // ********** navigator UI **********
-
- /**
- * Return the {@link JaxbNavigatorUi} for this platform,
- * which determines Project Explorer content
- */
- JaxbNavigatorUi getNavigatorUi();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java
deleted file mode 100644
index 1f04ed438d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.platform;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-
-/**
- * Repository for {@link JaxbPlatformUi}s
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- * @see JptJaxbUiPlugin#getJaxbPlatformUiManager()
- */
-public interface JaxbPlatformUiManager {
-
- /**
- * Return the platform UI responsible for providing UI elements for the given
- * JAXB platform description
- */
- public JaxbPlatformUi getJaxbPlatformUi(JaxbPlatformDescription platformDesc);
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath
deleted file mode 100644
index 76131ca132..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project
deleted file mode 100644
index bcbed7f5b7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 1284b5c67d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:36 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 116050e330..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.core.tests;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Localization: plugin
-Dali-Comment: jdk 1.6 has the javax.xml.bind annotations
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Activator: org.eclipse.jpt.jaxb.core.tests.JptJaxbCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.2.100,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.jaxb.core.tests;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.projects;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.resource.java;x-internal:=true
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/about.html b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/build.properties b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/build.properties
deleted file mode 100644
index 9cd29bcb38..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.properties b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.properties
deleted file mode 100644
index 01a0b633cd..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - JAXB Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java
deleted file mode 100644
index 6ce4ff10a5..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * configure the core to handle events synchronously when we are
- * running tests
- */
-@SuppressWarnings("nls")
-public class JptJaxbCoreTestsPlugin extends Plugin {
-
- private static JptJaxbCoreTestsPlugin INSTANCE;
-
- public static JptJaxbCoreTestsPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbCoreTestsPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- JaxbProjectManager jaxbProjectManager = JptJaxbCorePlugin.getProjectManager();
- ReflectionTools.executeMethod(jaxbProjectManager, "handleEventsSynchronously");
- ReflectionTools.executeStaticMethod(JptJaxbCorePlugin.class, "doNotFlushPreferences");
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java
deleted file mode 100644
index a018d17d59..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbCoreContextModelTests;
-import org.eclipse.jpt.jaxb.core.tests.internal.resource.JaxbCoreResourceModelTests;
-
-public class JaxbCoreTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreTests.class.getPackage().getName());
- suite.addTestSuite(SchemaLibraryTests.class);
- suite.addTest(JaxbCoreResourceModelTests.suite());
- suite.addTest(JaxbCoreContextModelTests.suite());
- return suite;
- }
-
- private JaxbCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java
deleted file mode 100644
index a32117f964..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetDataModelProperties;
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProvider;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbTestCase
- extends AnnotationTestCase {
-
- protected static final String BASE_PROJECT_NAME = "JaxbTestProject";
-
- protected JaxbTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return buildJaxbProject(BASE_PROJECT_NAME, autoBuild, buildJaxbFacetInstallConfig());
- }
-
- protected TestJaxbProject buildJaxbProject(
- String projectName, boolean autoBuild, IDataModel jaxbConfig)
- throws Exception {
- return TestJaxbProject.buildJaxbProject(projectName, autoBuild, jaxbConfig);
- }
-
- protected IDataModel buildJaxbFacetInstallConfig() {
- IDataModel config = DataModelFactory.createDataModel(new JaxbFacetInstallDataModelProvider());
- config.setProperty(IFacetDataModelProperties.FACET_VERSION, getProjectFacetVersion());
- config.setProperty(JaxbFacetDataModelProperties.PLATFORM, getPlatform());
- return config;
- }
-
- protected JaxbPlatformDescription getPlatform() {
- return JptJaxbCorePlugin.getDefaultPlatform(getProjectFacetVersion());
- }
-
- protected IProjectFacetVersion getProjectFacetVersion() {
- return JaxbFacet.VERSION_2_1;
- }
-
- @Override
- protected TestJaxbProject getJavaProject() {
- return (TestJaxbProject) super.getJavaProject();
- }
-
- protected JaxbProject getJaxbProject() {
- return this.getJavaProject().getJaxbProject();
- }
-
- protected JavaResourceAttribute getFieldNamed(JavaResourceType resourceType, String attributeName) {
- for (JavaResourceAttribute attribute : resourceType.getFields()) {
- if (attribute.getName().equals(attributeName)) {
- return attribute;
- }
- }
- return null;
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java
deleted file mode 100644
index 992165d848..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal;
-
-import java.io.ByteArrayInputStream;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-
-
-public class SchemaLibraryTests
- extends JaxbTestCase {
-
- public SchemaLibraryTests(String name) {
- super(name);
- }
-
- // tests schema for namespace that is set in catalog, but not in project properties
- public void testUnsetNamespace() {
- String namespace = "http://www.eclipse.org/eclipselink/xsds/persistence/orm";
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-
- // tests schema for registered uri that is set in project properties (namespace not registered in catalog)
- public void testSetRegisteredUriUnregisteredNamespace() {
- String namespace = "http://java.sun.com/xml/ns/persistence/orm";
-
- // set namespace in project properties\
- Map<String, String> schemaLocations = new HashMap<String, String>();
- schemaLocations.put(namespace, "http://java.sun.com/xml/ns/persistence/orm_2_0.xsd");
- getJaxbProject().getSchemaLibrary().setSchemaLocations(schemaLocations);
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-
- // tests schema for registerd uri that is set in project properties (namespace already registered in catalog)
- public void testSetRegisteredUriRegisteredNamespace() {
- String namespace = "http://www.eclipse.org/eclipselink/xsds/persistence/orm";
-
- // set namespace in project properties\
- Map<String, String> schemaLocations = new HashMap<String, String>();
- schemaLocations.put(namespace, "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd");
- getJaxbProject().getSchemaLibrary().setSchemaLocations(schemaLocations);
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-
- // tests schema for unregistered uri that is set in project properties (local file)
- public void testSetUnregisterdUri() throws Exception {
- IFile schemaFile = getJaxbProject().getProject().getFile(new Path("customer.xsd"));
- String contents =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- + "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
- + " targetNamespace=\"http://www.example.org/customer-example\">"
- + "</xs:schema>";
- schemaFile.create(new ByteArrayInputStream(contents.getBytes()), true, null);
-
- String namespace = "http://www.example.org/customer-example";
-
- // set namespace in project properties\
- Map<String, String> schemaLocations = new HashMap<String, String>();
- schemaLocations.put(namespace, "platform:/resource/" + BASE_PROJECT_NAME + "/customer.xsd");
- getJaxbProject().getSchemaLibrary().setSchemaLocations(schemaLocations);
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java
deleted file mode 100644
index 855a5ef20c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java
+++ /dev/null
@@ -1,517 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-@SuppressWarnings("nls")
-public class GenericContextRootTests
- extends JaxbContextModelTestCase {
-
- public GenericContextRootTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorOrder() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)",
- JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
-
- private ICompilationUnit createClassWithXmlTypeAndSuperclassNamed(final String superclassName) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + superclassName);
- }
- });
- }
-
- private ICompilationUnit createClassWithXmlTypeAndAttribute(
- final String attributeName, final String typeName) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("public " + typeName + " " + attributeName + ";" + CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createClassWithXmlTypeAndListAttribute(
- final String attributeName, final String typeName) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.List", JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("public List<" + typeName + "> " + attributeName + ";" + CR);
- sb.append(CR);
- }
- });
- }
-
- public void testGetPackages() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- Iterator<JaxbPackage> packages = this.getContextRoot().getPackages().iterator();
- assertEquals(1, this.getContextRoot().getPackagesSize());
- assertEquals(PACKAGE_NAME, packages.next().getName());
- assertFalse(packages.hasNext());
-
- //add an unannotated package-info.java and make sure it's not added to the root context node
- this.createUnannotatedPackageInfo("foo");
- packages = this.getContextRoot().getPackages().iterator();
- assertEquals(1, this.getContextRoot().getPackagesSize());
- assertEquals(PACKAGE_NAME, packages.next().getName());
- assertFalse(packages.hasNext());
-
- //annotate the package-info.java and test it's added to the root context node
- JavaResourcePackage fooResourcePackage = getJaxbProject().getJavaResourcePackage("foo");
- AnnotatedElement annotatedElement = this.annotatedElement(fooResourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericContextRootTests.this.addXmlAccessorTypeAnnotation(declaration, JAXB.XML_ACCESS_TYPE__PROPERTY);
- }
- });
-
- Iterable<String> packageNames = new TransformationIterable<JaxbPackage, String>(this.getContextRoot().getPackages()) {
- @Override
- protected String transform(JaxbPackage o) {
- return o.getName();
- }
- };
- assertEquals(2, this.getContextRoot().getPackagesSize());
- assertTrue(CollectionTools.contains(packageNames, PACKAGE_NAME));
- assertTrue(CollectionTools.contains(packageNames, "foo"));
-
- //remove the annotation from the package-info.java and test it's removed from the root context node
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericContextRootTests.this.removeXmlAccessorTypeAnnotation(declaration);
- }
- });
-
- packages = this.getContextRoot().getPackages().iterator();
- assertEquals(1, this.getContextRoot().getPackagesSize());
- assertEquals(PACKAGE_NAME, packages.next().getName());
- assertFalse(packages.hasNext());
- }
-
- protected void addXmlAccessorTypeAnnotation(ModifiedDeclaration declaration, String accessType) {
- NormalAnnotation annotation = this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_TYPE);
- addEnumMemberValuePair(annotation, JAXB.XML_ACCESSOR_TYPE__VALUE, accessType);
- }
-
- protected void removeXmlAccessorTypeAnnotation(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE);
- }
-
- protected void addXmlSeeAlsoAnnotation(final ModifiedDeclaration declaration, String... typeNames) {
- Annotation annotation = declaration.getAnnotationNamed(JAXB.XML_SEE_ALSO);
- NormalAnnotation normalAnnotation = null;
- if (annotation == null) {
- normalAnnotation = addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_SEE_ALSO);
- }
- else if (annotation.isMarkerAnnotation()) {
- normalAnnotation = replaceMarkerAnnotation((MarkerAnnotation) annotation);
- }
- else {
- normalAnnotation = (NormalAnnotation) annotation;
- }
-
- Expression arrayInitializer = newArrayInitializer(
- declaration.getAst(),
- ArrayTools.array(
- new TransformationIterable<String, TypeLiteral>(new ArrayIterable<String>(typeNames)) {
- @Override
- protected TypeLiteral transform(String o) {
- return newTypeLiteral(declaration.getAst(), o);
- }
- },
- new Expression[0]));
- addMemberValuePair(normalAnnotation, JAXB.XML_SEE_ALSO__VALUE, arrayInitializer);
- }
-
- public void testGetRegistries() throws Exception {
- createClassWithXmlRegistry();
- Iterable<JaxbType> types = getContextRoot().getTypes();
- assertEquals(1, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
-
- //add an unannotated class and make sure it's not added to the context root
- createUnannotatedClassNamed("Foo");
- types = getContextRoot().getTypes();
- assertEquals(1, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
-
- //annotate the class with @XmlRegistry and test it's added to the root context node
- JavaResourceAbstractType fooResourceType = getJaxbProject().getJavaResourceType("test.Foo");
- AnnotatedElement annotatedElement = annotatedElement(fooResourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_REGISTRY);
- }
- });
-
- types = getContextRoot().getTypes();
- assertEquals(2, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType("test.Foo")).getXmlRegistry());
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
-
- //remove the annotation from the class and test it's removed from the context root
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_REGISTRY);
- }
- });
-
- types = getContextRoot().getTypes();
- assertEquals(1, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
- }
-
- public void testGetTypes() throws Exception {
- createClassWithXmlType();
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
-
- //add an unannotated class and make sure it's not added to the context root
- createUnannotatedClassNamed("Foo");
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
-
- //annotate the class with @XmlType and test it's added to the context root
- JavaResourceAbstractType fooResourceType = getJaxbProject().getJavaResourceType("test.Foo");
- AnnotatedElement annotatedElement = annotatedElement(fooResourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNotNull(((JaxbClass) getContextRoot().getType("test.Foo")));
-
- //remove the annotation from the class and test it's removed from the root context node
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_TYPE);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbClass) getContextRoot().getType("test.Foo")));
- }
-
- public void testGetTypes2() throws Exception {
- createEnumWithXmlType();
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
-
- //add an unannotated class and make sure it's not added to the context root
- createUnannotatedEnumNamed("Foo");
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbEnum) getContextRoot().getType("test.Foo")));
-
- //annotate the class with @XmlEnum and test it's added to the context root
- JavaResourceEnum fooResourceType = (JavaResourceEnum) getJaxbProject().getJavaResourceType("test.Foo", JavaResourceAbstractType.Kind.ENUM);
- AnnotatedElement annotatedElement = annotatedElement(fooResourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNotNull(((JaxbEnum) getContextRoot().getType("test.Foo")));
-
- //remove the annotation from the class and test it's removed from the root context node
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_TYPE);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbEnum) getContextRoot().getType("test.Foo")));
- }
-
- public void testDirectReferencedSuperclass() throws Exception {
- String superclassName = "Super" + TYPE_NAME;
- String fqSuperclassName = PACKAGE_NAME_ + superclassName;
- createUnannotatedClassNamed(superclassName);
-
- // make sure unannotated superclass is not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlTypeAndSuperclassNamed(superclassName);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNotNull(((JaxbClass) getContextRoot().getType(fqSuperclassName)));
-
- // remove annotated class - both classes removed from context
- IFile file = (IFile) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME).getResource();
- file.delete(true, null);
-
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
- assertNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbClass) getContextRoot().getType(fqSuperclassName)));
- }
-
- public void testDirectReferencedAttribute() throws Exception {
- String otherClassName = "Other" + TYPE_NAME;
- String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- String attributeName = "other";
- createUnannotatedClassNamed(otherClassName);
-
- // make sure unannotated other class is not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlTypeAndAttribute(attributeName, otherClassName);
- JavaResourceType thisType = (JavaResourceType) getJaxbProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceAttribute attribute = getFieldNamed(thisType, attributeName);
- AnnotatedElement annotatedAttribute = annotatedElement(attribute);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // add an @XmlElement
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to @XmlTransient
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_ELEMENT);
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TRANSIENT);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNull(getContextRoot().getType(fqOtherClassName));
- }
-
- public void testDirectReferencedListAttribute() throws Exception {
- String otherClassName = "Other" + TYPE_NAME;
- String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- String attributeName = "other";
- createUnannotatedClassNamed(otherClassName);
-
- // make sure unannotated other class is not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlTypeAndListAttribute(attributeName, otherClassName);
- JavaResourceType thisType = (JavaResourceType) getJaxbProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceAttribute attribute = getFieldNamed(thisType, attributeName);
- AnnotatedElement annotatedAttribute = annotatedElement(attribute);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // add an @XmlElement
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to @XmlTransient
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_ELEMENT);
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TRANSIENT);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNull(getContextRoot().getType(fqOtherClassName));
- }
-
- public void testDirectReferencedSeeAlso() throws Exception {
- final String otherClassName = "Other" + TYPE_NAME;
- final String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- final String otherClassName2 = "Other" + TYPE_NAME + "2";
- final String fqOtherClassName2 = PACKAGE_NAME_ + otherClassName2;
- createUnannotatedClassNamed(otherClassName);
- createUnannotatedClassNamed(otherClassName2);
-
- // make sure unannotated other classes are not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlType();
- JavaResourceType thisType = (JavaResourceType) getJaxbProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- AnnotatedElement annotatedType = annotatedElement(thisType);
-
- // make sure unannotated other classes are not in context
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
-
- // add an @XmlSeeAlso with one class
- annotatedType.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addXmlSeeAlsoAnnotation(declaration, otherClassName);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to @XmlSeeAlso with two classes
- annotatedType.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_SEE_ALSO);
- addXmlSeeAlsoAnnotation(declaration, otherClassName, otherClassName2);
- }
- });
-
- assertEquals(3, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
- assertNotNull(getContextRoot().getType(fqOtherClassName2));
-
- // remove the @XmlSeeAlso annotation
- annotatedType.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_SEE_ALSO);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- }
-
- public void testJaxbIndex() throws Exception {
- final String otherClassName = "Other" + TYPE_NAME;
- final String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- final String otherClassName2 = "Other" + TYPE_NAME + "2";
- final String fqOtherClassName2 = PACKAGE_NAME_ + otherClassName2;
- createUnannotatedClassNamed(otherClassName);
- createUnannotatedClassNamed(otherClassName2);
-
- // make sure unannotated other classes are not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlType();
-
- // make sure unannotated other classes are not in context
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
-
- // add a jaxb.index with one class
- IFile jaxbIndex = getJavaProject().getProject().getFile(new Path("src/test/jaxb.index"));
- InputStream stream = new ByteArrayInputStream(otherClassName.getBytes());
- jaxbIndex.create(stream, true, null);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to jaxb.index with two classes
- jaxbIndex.setContents(new ByteArrayInputStream((otherClassName + CR + otherClassName2).getBytes()), true, false, null);
-
- assertEquals(3, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
- assertNotNull(getContextRoot().getType(fqOtherClassName2));
-
- // clear the jaxb.index
- jaxbIndex.setContents(new ByteArrayInputStream(new byte[0]), true, false, null);
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java
deleted file mode 100644
index 9eeb39279b..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.JaxbTestCase;
-
-@SuppressWarnings("nls")
-public abstract class JaxbContextModelTestCase
- extends JaxbTestCase {
-
- protected static final String BASE_PROJECT_NAME = "JaxbContextModelTestProject";
-
-
- protected JaxbContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return buildJaxbProject(BASE_PROJECT_NAME, autoBuild, buildJaxbFacetInstallConfig());
- }
-
- protected JaxbContextRoot getContextRoot() {
- return this.getJaxbProject().getContextRoot();
- }
-
- protected AnnotatedElement annotatedElement(JavaResourceAnnotatedElement resource) {
- return (AnnotatedElement) ReflectionTools.getFieldValue(resource, "annotatedElement");
- }
-
- protected ICompilationUnit createUnannotatedPackageInfo(String packageName) throws CoreException {
- return createTestPackageInfo(packageName);
- }
-
- protected ICompilationUnit createClassWithXmlType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- protected ICompilationUnit createClassWithXmlRegistry() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
- });
- }
-
- protected ICompilationUnit createUnannotatedClassNamed(String typeName) throws Exception {
- return this.createTestType(PACKAGE_NAME, typeName + ".java", typeName, new DefaultAnnotationWriter());
- }
-
- protected ICompilationUnit createEnumWithXmlType() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- protected ICompilationUnit createUnannotatedEnumNamed(String enumName) throws Exception {
- return this.createTestEnum(PACKAGE_NAME, enumName + ".java", enumName, new DefaultEnumAnnotationWriter());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java
deleted file mode 100644
index 7ecde92d62..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.java.JaxbCoreJavaContextModelTests;
-
-public class JaxbCoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreContextModelTests.class.getName());
-
- suite.addTestSuite(GenericContextRootTests.class);
- suite.addTest(JaxbCoreJavaContextModelTests.suite());
- return suite;
- }
-
- private JaxbCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java
deleted file mode 100644
index 3d2a980510..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaAttributeXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaAttributeXmlJavaTypeAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ATTRIBUTE, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute").append(CR);
- sb.append("@XmlJavaTypeAdapter");
- }
- });
- }
-
- public void testModifyValue() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- contextXmlJavaTypeAdapter.setValue("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getValue());
- assertEquals("foo", contextXmlJavaTypeAdapter.getValue());
-
- //verify the xml schema type annotation is not removed when the value is set to null
- contextXmlJavaTypeAdapter.setValue(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getValue());
- assertNull(contextXmlJavaTypeAdapter.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- //add a value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- }
-
- public void testModifyType() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertEquals("int", contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getType());
- assertEquals("foo", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getType());
- assertEquals("int", contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
- }
-
- public void testUpdateType() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertEquals("int", contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("String", contextXmlJavaTypeAdapter.getType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- }
-
- protected void addXmlJavaTypeAdapterTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlJavaTypeAdapterMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration), name, value);
- }
-
- protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java
deleted file mode 100644
index 660856ced4..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java
+++ /dev/null
@@ -1,2138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.internal.context.java.PropertyAccessor;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaClassMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaClassMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createXmlTypeWithAccessorType() throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlAccessorType(value = XmlAccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createXmlTypeWithAccessorOrder() throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)");
- }
- });
- }
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- private void createTestXmlTypeWithFieldAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public int foo;").append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertyAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public int getFoo() {").append(CR);
- sb.append(" return 1;").append(CR).append(" }").append(CR);
- sb.append(" public void setFoo(int foo) {}").append(CR).append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertyGetterAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public int getFoo() {").append(CR);
- sb.append(" return 1;").append(CR).append(" }").append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertyGetterListAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public List<?> getFoo() {").append(CR);
- sb.append(" return 1;").append(CR).append(" }").append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertySetterAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public void setFoo(int foo) {}").append(CR).append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- public void testModifyFactoryClass() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getFactoryClass());
-
- classMapping.setFactoryClass("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryClass());
- assertEquals("foo", classMapping.getFactoryClass());
-
- classMapping.setFactoryClass(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryClass());
- assertNull(classMapping.getFactoryClass());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set factoryClass again, this time starting with no XmlType annotation
- classMapping.setFactoryClass("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryClass());
- assertEquals("foo", classMapping.getFactoryClass());
- }
-
- public void testUpdateFactoryClass() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getFactoryClass());
-
- //add a factoryClass member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeTypeMemberValuePair(declaration, JAXB.XML_TYPE__FACTORY_CLASS, "Foo");
- }
- });
- assertEquals("Foo", classMapping.getFactoryClass());
-
- //remove the factoryClass member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getFactoryClass());
- }
-
- public void testModifyFactoryMethod() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getFactoryMethod());
-
- classMapping.setFactoryMethod("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryMethod());
- assertEquals("foo", classMapping.getFactoryMethod());
-
- classMapping.setFactoryMethod(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryMethod());
- assertNull(classMapping.getFactoryMethod());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set factoryMethod again, this time starting with no XmlType annotation
- classMapping.setFactoryMethod("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryMethod());
- assertEquals("foo", classMapping.getFactoryMethod());
- }
-
- public void testUpdateFactoryMethod() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getFactoryMethod());
-
- //add a factoryMethod member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__FACTORY_METHOD, "foo");
- }
- });
- assertEquals("foo", classMapping.getFactoryMethod());
-
- //remove the factoryMethod member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getFactoryMethod());
- }
-
- public void testModifySchemaTypeName() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
-
- classMapping.getQName().setSpecifiedName("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", classMapping.getQName().getSpecifiedName());
- assertEquals("foo", classMapping.getQName().getName());
-
- classMapping.getQName().setSpecifiedName(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getName());
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set name again, this time starting with no XmlType annotation
- classMapping.getQName().setSpecifiedName("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", classMapping.getQName().getSpecifiedName());
- assertEquals("foo", classMapping.getQName().getName());
- }
-
- public void testUpdateSchemaTypeName() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAME, "foo");
- }
- });
- assertEquals("foo", classMapping.getQName().getSpecifiedName());
- assertEquals("foo", classMapping.getQName().getName());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
- }
-
- public void testModifyNamespace() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getDefaultNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
-
- classMapping.getQName().setSpecifiedNamespace("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", classMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", classMapping.getQName().getNamespace());
-
- classMapping.getQName().setSpecifiedNamespace(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getNamespace());
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set namespace again, this time starting with no XmlType annotation
- classMapping.getQName().setSpecifiedNamespace("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", classMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", classMapping.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getDefaultNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", classMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", classMapping.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
- }
-
- public void testModifyAccessType() throws Exception {
- createXmlTypeWithAccessorType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessType.PROPERTY, classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.FIELD, classMapping.getAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.NONE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.NONE, classMapping.getAccessType());
-
- classMapping.setSpecifiedAccessType(null);
- accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertNull(accessorTypeAnnotation.getValue());
- assertNull(classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
- }
-
- public void testUpdateAccessType() throws Exception {
- createXmlTypeWithAccessorType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessType.PROPERTY, classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
-
- //set the accesser type value to FIELD
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__FIELD);
- }
- });
- assertEquals(XmlAccessType.FIELD, classMapping.getAccessType());
-
- //set the accesser type value to PUBLIC_MEMBER
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- }
- });
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
-
- //set the accesser type value to NONE
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__NONE);
- }
- });
- assertEquals(XmlAccessType.NONE, classMapping.getAccessType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE);
- }
- });
- assertNull(classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
- }
-
- /**
- * If there is a @XmlAccessorType on a class, then it is used.
- * Otherwise, if a @XmlAccessorType exists on one of its super classes, then it is inherited.
- * Otherwise, the @XmlAccessorType on a package is inherited.
- */
- public void testGetDefaultAccessType() throws Exception {
- createClassWithXmlType();
- createTestSubType();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbClass childJaxbClass = (JaxbClass) getContextRoot().getType("test.AnnotationTestTypeChild");
- JaxbClassMapping childClassMapping = childJaxbClass.getMapping();
-
- assertEquals(XmlAccessType.PUBLIC_MEMBER, childClassMapping.getDefaultAccessType());
-
- this.createPackageInfoWithAccessorType();
- assertEquals(XmlAccessType.PROPERTY, childClassMapping.getDefaultAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- assertEquals(XmlAccessType.FIELD, childClassMapping.getDefaultAccessType());
-
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- classMapping.setSpecifiedAccessType(null);
- assertEquals(XmlAccessType.PROPERTY, childClassMapping.getDefaultAccessType());
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- assertEquals(XmlAccessType.FIELD, childClassMapping.getDefaultAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.NONE);
- assertEquals(XmlAccessType.NONE, childClassMapping.getDefaultAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(null);
- assertEquals(XmlAccessType.PUBLIC_MEMBER, childClassMapping.getDefaultAccessType());
- }
-
- public void testGetSuperPersistentClass() throws Exception {
- createClassWithXmlType();
- createTestSubType();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbClass childJaxbClass = (JaxbClass) getContextRoot().getType("test.AnnotationTestTypeChild");
- JaxbClassMapping childClassMapping = childJaxbClass.getMapping();
-
- assertEquals(classMapping, childClassMapping.getSuperclass());
-
- //test that the superClass is not null even when it is unannotated
- AnnotatedElement annotatedElement = this.annotatedElement(jaxbClass.getJavaResourceType());
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_TYPE);
- }
- });
- assertEquals(classMapping, childClassMapping.getSuperclass());
- }
-
- public void testModifyAccessOrder() throws Exception {
- createXmlTypeWithAccessorOrder();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
-
- classMapping.setSpecifiedAccessOrder(XmlAccessOrder.UNDEFINED);
- XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED, accessorOrderAnnotation.getValue());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
-
- classMapping.setSpecifiedAccessOrder(null);
- accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNull(accessorOrderAnnotation.getValue());
- assertNull(classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
- }
-
- public void testUpdateAccessOrder() throws Exception {
- createXmlTypeWithAccessorOrder();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
-
- //set the access order value to UNDEFINED
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER__UNDEFINED);
- }
- });
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_ORDER);
- }
- });
- assertNull(classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
- }
-
- public void testGetPropOrder() throws Exception {
- this.createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- ListIterator<String> props = classMapping.getPropOrder().iterator();
- assertFalse(props.hasNext());
-
- //add 2 prop orders
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addProp(declaration, 0, "bar");
- GenericJavaClassMappingTests.this.addProp(declaration, 1, "foo");
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertEquals("bar", props.next());
- assertEquals("foo", props.next());
- assertFalse(props.hasNext());
- }
-
- protected void addProp(ModifiedDeclaration declaration, int index, String prop) {
- this.addArrayElement(declaration, JAXB.XML_TYPE, index, JAXB.XML_TYPE__PROP_ORDER, this.newStringLiteral(declaration.getAst(), prop));
- }
-
- public void testGetPropOrderSize() throws Exception {
- this.createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(0, classMapping.getPropOrderSize());
-
- //add 2 prop orders
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addProp(declaration, 0, "bar");
- GenericJavaClassMappingTests.this.addProp(declaration, 1, "foo");
- }
- });
- assertEquals(2, classMapping.getPropOrderSize());
- }
-
- public void testAddProp() throws Exception {
- this.createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(0, "foo");
- classMapping.addProp(0, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- ListIterator<String> props = xmlTypeAnnotation.getPropOrder().iterator();
-
- assertEquals("baz", props.next());
- assertEquals("foo", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
- }
-
- public void testAddProp2() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(1, "foo");
- classMapping.addProp(0, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- ListIterator<String> props = xmlTypeAnnotation.getPropOrder().iterator();
-
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertEquals("foo", props.next());
- assertFalse(props.hasNext());
- }
-
- public void testRemoveProp() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(1, "foo");
- classMapping.addProp(2, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
-
- classMapping.removeProp(1);
-
- ListIterator<String> resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("bar", resourceProps.next());
- assertEquals("baz", resourceProps.next());
- assertFalse(resourceProps.hasNext());
-
- classMapping.removeProp(1);
- resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("bar", resourceProps.next());
- assertFalse(resourceProps.hasNext());
-
- classMapping.removeProp(0);
- resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertFalse(resourceProps.hasNext());
- }
-
- public void testMoveProp() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(1, "foo");
- classMapping.addProp(2, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
-
- assertEquals(3, xmlTypeAnnotation.getPropOrderSize());
-
- classMapping.moveProp(2, 0);
- ListIterator<String> props = classMapping.getPropOrder().iterator();
- assertEquals("foo", props.next());
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
- ListIterator<String> resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("foo", resourceProps.next());
- assertEquals("baz", resourceProps.next());
- assertEquals("bar", resourceProps.next());
-
- classMapping.moveProp(0, 1);
- props = classMapping.getPropOrder().iterator();
- assertEquals("baz", props.next());
- assertEquals("foo", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
- resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("baz", resourceProps.next());
- assertEquals("foo", resourceProps.next());
- assertEquals("bar", resourceProps.next());
- }
-
- public void testSyncProps() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- ListIterator<String> props = classMapping.getPropOrder().iterator();
- assertFalse(props.hasNext());
-
- //add 3 prop orders
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addProp(declaration, 0, "bar");
- GenericJavaClassMappingTests.this.addProp(declaration, 1, "foo");
- GenericJavaClassMappingTests.this.addProp(declaration, 2, "baz");
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("bar", props.next());
- assertEquals("foo", props.next());
- assertEquals("baz", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.moveProp(declaration, 2, 0);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("foo", props.next());
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.moveProp(declaration, 0, 1);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("baz", props.next());
- assertEquals("foo", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeProp(declaration, 1);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeProp(declaration, 1);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("baz", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeProp(declaration, 0);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertFalse(props.hasNext());
- }
-
- protected void addXmlTypeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlTypeAnnotation(declaration), name, value);
- }
-
- protected void addXmlTypeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlTypeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlTypeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_TYPE);
- }
-
- protected void moveProp(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) getXmlTypeAnnotation(declaration), JAXB.XML_TYPE__PROP_ORDER, targetIndex, sourceIndex);
- }
-
- protected void removeProp(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) getXmlTypeAnnotation(declaration), JAXB.XML_TYPE__PROP_ORDER, index);
- }
-
- public void testModifyXmlRootElement() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getXmlRootElement());
-
- classMapping.addXmlRootElement().getQName().setSpecifiedName("foo");
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", xmlRootElementAnnotation.getName());
- assertEquals("foo", classMapping.getXmlRootElement().getQName().getName());
-
- classMapping.removeXmlRootElement();
- xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation);
- assertNull(classMapping.getXmlRootElement());
- }
-
- public void testUpdateXmlRootElement() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getXmlRootElement());
-
- //add a XmlRootElement annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation annotation = GenericJavaClassMappingTests.this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ROOT_ELEMENT);
- GenericJavaClassMappingTests.this.addMemberValuePair(annotation, JAXB.XML_ROOT_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", classMapping.getXmlRootElement().getQName().getName());
-
- //remove the XmlRootElement annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(classMapping.getXmlRootElement());
- }
-
- public void testUpdateFieldAttributes() throws Exception {
- this.createTestXmlTypeWithFieldAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public int foo;
- publicFieldTest(classMapping);
-
- //public transient int foo;
- publicTransientFieldTest(classMapping);
-
- //public static int foo;
- publicStaticFieldTest(classMapping);
-
- //public final int foo;
- publicFinalFieldTest(classMapping);
-
- //public static final int foo;
- publicStaticFinalFieldTest(classMapping);
-
- //private int foo;
- privateFieldTest(classMapping);
-
- // private transient int foo;
- privateTransientFieldTest(classMapping);
-
- // @XmlAttribute
- // private static int foo; //persistent
- privateStaticFieldTest(classMapping);
-
- // @XmlAttribute
- // private static final int foo; //persistent
- privateStaticFinalFieldTest(classMapping);
- }
-
- protected void publicFieldTest(JaxbClassMapping classMapping) {
- //public int foo; PUBLIC_MEMBER access - persistent
- assertEquals(1, classMapping.getAttributesSize());
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int foo; //PROPERTY access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int foo; //FIELD access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int foo; //NONE access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int foo; PUBLIC_MEMBER access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //add @XmlTransient annotation and test each access type
- JavaResourceField resourceField = (JavaResourceField) classMapping.getAttributes().iterator().next().getJavaResourceAttribute();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TRANSIENT);
- }
- });
- //@XmlTransient
- //public int foo; //PROPERTY access - not "persistent", but comes in to our context model because it is "mapped"
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlTransient
- //public int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlTransient
- //public int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlTransient
- //public int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_TRANSIENT);
- }
- });
- }
-
- protected void publicTransientFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public transient int foo; PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceField, ModifierKeyword.TRANSIENT_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- this.removeModifiers(resourceField, ModifierKeyword.TRANSIENT_KEYWORD);
- }
-
- protected void publicStaticFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public static int foo; PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- this.removeModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD);
- }
-
- protected void publicFinalFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public final int foo; PUBLIC_MEMBER access - persistent
- this.addModifiers(resourceField, ModifierKeyword.FINAL_KEYWORD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public final int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public final int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public final int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public final int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- this.removeModifiers(resourceField, ModifierKeyword.FINAL_KEYWORD);
- }
-
- protected void publicStaticFinalFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public static final int foo; PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD, ModifierKeyword.FINAL_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- this.removeModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD, ModifierKeyword.FINAL_KEYWORD);
- }
-
- protected void privateFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD);
-
- //private int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //private int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- protected void privateTransientFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.TRANSIENT_KEYWORD);
-
- //private transient int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private transient int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private transient int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private transient int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private transient int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.TRANSIENT_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- protected void privateStaticFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.STATIC_KEYWORD);
-
- //private static int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private static int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.STATIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- protected void privateStaticFinalFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.STATIC_KEYWORD, ModifierKeyword.FINAL_KEYWORD);
-
- //private static final int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private static final int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static final int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static final int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static final int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- public void testUpdatePropertyAttributes() throws Exception {
- createTestXmlTypeWithPropertyAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public int getFoo();, public void setFoo(int);
- publicGetterSetterTest(classMapping);
-
- //public static int getFoo();, public static void setFoo(int);
- publicStaticGetterSetterTest(classMapping);
-
- //private int getFoo();, private void setFoo(int);
- privateGetterSetterTest(classMapping);
- }
-
- public void testUpdateGetterPropertyAttributes() throws Exception {
- createTestXmlTypeWithPropertyGetterAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public int getFoo(); PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); PROPERTY access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); FIELD access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); NONE access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); PUBLIC_MEMBER access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = classMapping.getJaxbType().getJavaResourceType().getMethods().iterator().next();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public int getFoo(); PROPERTY access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo(); FIELD access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo(); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo(); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- public void testUpdateSetterPropertyAttributes() throws Exception {
- createTestXmlTypeWithPropertySetterAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public void setFoo(int foo); PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); PROPERTY access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); FIELD access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); NONE access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); PUBLIC_MEMBER access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = classMapping.getJaxbType().getJavaResourceType().getMethods().iterator().next();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public void setFoo(int foo);; PROPERTY access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public void setFoo(int foo); FIELD access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public void setFoo(int foo); NONE access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public void setFoo(int foo); PUBLIC_MEMBER access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- public void testUpdateGetterListPropertyAttributes() throws Exception {
- this.createTestXmlTypeWithPropertyGetterListAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public List<?> getFoo(); PUBLIC_MEMBER access - persistent
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public List<?> getFoo(); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public List<?> getFoo(); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public List<?> getFoo(); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public List<?> getFoo(); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = classMapping.getJaxbType().getJavaResourceType().getMethods().iterator().next();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public List<?> getFoo(); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public List<?> getFoo(); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public List<?> getFoo(); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public List<?> getFoo(); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- protected void publicGetterSetterTest(JaxbClassMapping classMapping) {
- //public int getFoo();, public void setFoo(int); PUBLIC_MEMBER access - persistent
- assertEquals(1, classMapping.getAttributesSize());
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int getFoo();, public void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int getFoo();, public void setFoo(int); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo();, public void setFoo(int); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo();, public void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = (JavaResourceMethod) classMapping.getAttributes().iterator().next().getJavaResourceAttribute();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- protected void publicStaticGetterSetterTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- PropertyAccessor propertyAccessor = (PropertyAccessor) ReflectionTools.getFieldValue(attributes.next(), "accessor");
- JavaResourceMethod resourceGetter = propertyAccessor.getResourceGetterMethod();
- JavaResourceMethod resourceSetter = propertyAccessor.getResourceSetterMethod();
-
- //public static int getFoo();, public static void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceGetter, ModifierKeyword.STATIC_KEYWORD);
- this.addModifiers(resourceSetter, ModifierKeyword.STATIC_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //public static int getFoo();, public static void setFoo(int); PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int getFoo();, public static void setFoo(int); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int getFoo();, public static void setFoo(int); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int getFoo();, public static void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceGetter);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- this.removeModifiers(resourceGetter, ModifierKeyword.STATIC_KEYWORD);
- this.removeModifiers(resourceSetter, ModifierKeyword.STATIC_KEYWORD);
- }
-
- protected void privateGetterSetterTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- PropertyAccessor propertyAccessor = (PropertyAccessor) ReflectionTools.getFieldValue(attributes.next(), "accessor");
- JavaResourceMethod resourceGetter = propertyAccessor.getResourceGetterMethod();
- JavaResourceMethod resourceSetter = propertyAccessor.getResourceSetterMethod();
-
- //private int getFoo();, private void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.removeModifiers(resourceGetter, ModifierKeyword.PUBLIC_KEYWORD);
- this.removeModifiers(resourceSetter, ModifierKeyword.PUBLIC_KEYWORD);
- this.addModifiers(resourceGetter, ModifierKeyword.PRIVATE_KEYWORD);
- this.addModifiers(resourceSetter, ModifierKeyword.PRIVATE_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //private int getFoo();, private void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //private int getFoo();, private void setFoo(int); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int getFoo();, private void setFoo(int); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int getFoo();, private void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceGetter);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- this.removeModifiers(resourceGetter, ModifierKeyword.PRIVATE_KEYWORD);
- this.removeModifiers(resourceSetter, ModifierKeyword.PRIVATE_KEYWORD);
- this.addModifiers(resourceGetter, ModifierKeyword.PUBLIC_KEYWORD);
- this.addModifiers(resourceSetter, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- public void testModifyXmlSeeAlso() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlSeeAlsoAnnotation annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
-
- classMapping.addXmlSeeAlso();
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNotNull(classMapping.getXmlSeeAlso());
- assertNotNull(annotation);
-
- classMapping.removeXmlSeeAlso();
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
- }
-
- public void testUpdateXmlSeeAlso() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlSeeAlsoAnnotation annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SEE_ALSO);
- }
- });
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNotNull(classMapping.getXmlSeeAlso());
- assertNotNull(annotation);
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(
- ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_SEE_ALSO);
- }
- });
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
- }
-
- protected void addModifiers(JavaResourceMember resourceMember, final ModifierKeyword... modifiers) {
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMember);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addModifiers((BodyDeclaration) declaration.getDeclaration(), modifiers);
- }
- });
- }
-
- protected void removeModifiers(JavaResourceMember resourceMember, final ModifierKeyword... modifiers) {
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMember);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeModifiers((BodyDeclaration) declaration.getDeclaration(), modifiers);
- }
- });
- }
-
- protected void addModifiers(BodyDeclaration bodyDeclaration, ModifierKeyword... modifiers) {
- for (ModifierKeyword modifier : modifiers) {
- this.modifiers(bodyDeclaration).add(bodyDeclaration.getAST().newModifier(modifier));
- }
- }
-
- protected void removeModifiers(BodyDeclaration bodyDeclaration, ModifierKeyword... modifierKeywords) {
- for (ModifierKeyword modifierKeyWord : modifierKeywords) {
- for (Iterator<IExtendedModifier> stream = this.modifiers(bodyDeclaration).iterator(); stream.hasNext();) {
- IExtendedModifier modifier = stream.next();
- if (modifier.isModifier()) {
- if (((Modifier) modifier).getKeyword() == modifierKeyWord) {
- stream.remove();
- break;
- }
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- protected List<IExtendedModifier> modifiers(BodyDeclaration bodyDeclaration) {
- return bodyDeclaration.modifiers();
- }
-
- protected void setAccessTypeInJavaSource(JaxbClassMapping classMapping, final String accessType) {
- JavaResourceType resourceClass = classMapping.getJaxbType().getJavaResourceType();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceClass);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, accessType);
- }
- });
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java
deleted file mode 100644
index e6e8f7640b..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaElementFactoryMethodTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaElementFactoryMethodTests(String name) {
- super(name);
- }
-
- protected ICompilationUnit createClassWithXmlRegistryAndCreateMethods() throws Exception {
- return this.createTestType(PACKAGE_NAME, "ObjectFactory.java", "ObjectFactory", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY, JAXB.XML_ELEMENT_DECL, "javax.xml.bind.JAXBElement");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
-
- @Override
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl").append(CR);
- sb.append(" JAXBElement<AnnotationTestType> createFoo(AnnotationTestType value) {return null}").append(CR);
- sb.append(CR);
- sb.append(" @XmlElementDecl(name=\"bar\")").append(CR);
- sb.append(" JAXBElement createBar(Object value) {return null}").append(CR);
- sb.append(CR);
- }
- });
- }
-
- public void testModifyElementName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getQName().getName());
-
- elementFactoryMethod.getQName().setSpecifiedName("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getQName().setSpecifiedName(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getName());
- assertNull(elementFactoryMethod.getQName().getName());
- }
-
- public void testUpdateElementName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getQName().getName());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__NAME, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifyDefaultValue() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getDefaultValue());
-
- elementFactoryMethod.setDefaultValue("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getDefaultValue());
- assertEquals("bar", elementFactoryMethod.getDefaultValue());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.setDefaultValue(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getDefaultValue());
- assertNull(elementFactoryMethod.getDefaultValue());
- }
-
- public void testUpdateDefaultValue() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getDefaultValue());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getDefaultValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifyScope() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getScope());
- assertTrue(elementFactoryMethod.isGlobalScope());
-
- elementFactoryMethod.setScope("Bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("Bar", elementDeclAnnotation.getScope());
- assertEquals("Bar", elementFactoryMethod.getScope());
- assertFalse(elementFactoryMethod.isGlobalScope());
-
- elementFactoryMethod.setScope(JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals(JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME, elementDeclAnnotation.getScope());
- assertEquals(JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME, elementFactoryMethod.getScope());
- assertTrue(elementFactoryMethod.isGlobalScope());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.setScope(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getScope());
- assertNull(elementFactoryMethod.getScope());
- }
-
- public void testUpdateScope() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getScope());
- assertTrue(elementFactoryMethod.isGlobalScope());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclTypeMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__SCOPE, "Foo");
- }
- });
- assertEquals("Foo", elementFactoryMethod.getScope());
- assertFalse(elementFactoryMethod.isGlobalScope());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifySubstitutionHeadName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedName("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getSubstitutionHeadName());
- assertEquals("bar", elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedName(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getSubstitutionHeadName());
- assertNull(elementFactoryMethod.getSubstitutionHeadQName().getName());
- }
-
- public void testUpdateSubstitutionHeadName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifySubstitutionHeadNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedNamespace("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getSubstitutionHeadNamespace());
- assertEquals("bar", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedNamespace(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getSubstitutionHeadNamespace());
- assertEquals("", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
- }
-
- public void testUpdateSubstitutionHeadNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifyNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getQName().getNamespace());
-
- elementFactoryMethod.getQName().setSpecifiedNamespace("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getNamespace());
- assertEquals("bar", elementFactoryMethod.getQName().getNamespace());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getQName().setSpecifiedNamespace(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getNamespace());
- assertEquals("", elementFactoryMethod.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getQName().getNamespace());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- protected void addXmlElementDeclMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementDeclAnnotation(declaration), name, value);
- }
-
- protected Annotation getXmlElementDeclAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_DECL);
- }
-
- protected void removeXmlElementDeclAnnotation(ModifiedDeclaration declaration) {
- this.removeAnnotation(declaration, JAXB.XML_ELEMENT_DECL);
- }
-
- protected void addXmlElementDeclTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlElementDeclAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java
deleted file mode 100644
index 59b975eeec..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaEnumConstantTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaEnumConstantTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createEnumWithXmlEnum() throws Exception {
- return createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- createEnumWithXmlEnum();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JaxbEnumConstant contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertEquals("MONDAY", contextEnumConstant.getName());
-
-
- //add a factoryClass member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumConstantTests.this.changeEnumConstantName((EnumDeclaration) declaration.getDeclaration(), "MONDAY", "MONDAY2");
- }
- });
- contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- assertEquals(2, enumMapping.getEnumConstantsSize());
- assertEquals("MONDAY2", contextEnumConstant.getName());
- }
-
- public void testModifyValue() throws Exception {
- createEnumWithXmlEnum();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JaxbEnumConstant contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- JavaResourceEnumConstant resourceEnumConstant = contextEnumConstant.getResourceEnumConstant();
-
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
-
- contextEnumConstant.setSpecifiedValue("foo");
- XmlEnumValueAnnotation enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertEquals("foo", enumValueAnnotation.getValue());
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("foo", contextEnumConstant.getValue());
- assertEquals("foo", contextEnumConstant.getSpecifiedValue());
-
- contextEnumConstant.setSpecifiedValue(null);
- enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertNull(enumValueAnnotation.getValue());
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
- }
-
- public void testUpdateValue() throws Exception {
- createEnumWithXmlEnum();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JaxbEnumConstant contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- JavaResourceEnumConstant resourceEnumConstant = contextEnumConstant.getResourceEnumConstant();
-
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
-
- //add an XmlEnumValue annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnumConstant);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation enumValueAnnotation = GenericJavaEnumConstantTests.this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ENUM_VALUE);
- GenericJavaEnumConstantTests.this.addMemberValuePair(enumValueAnnotation, JAXB.XML_ENUM_VALUE__VALUE, "foo");
- }
- });
-
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("foo", contextEnumConstant.getValue());
- assertEquals("foo", contextEnumConstant.getSpecifiedValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumConstantTests.this.removeAnnotation(declaration, JAXB.XML_ENUM_VALUE);
- }
- });
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java
deleted file mode 100644
index 9b39ca4e72..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaEnumMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaEnumMappingTests(String name) {
- super(name);
- }
-
-
- protected void addXmlTypeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlTypeAnnotation(declaration), name, value);
- }
-
- protected void addXmlTypeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlTypeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlEnumTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlEnumAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlTypeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_TYPE);
- }
-
- protected Annotation getXmlEnumAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ENUM);
- }
-
- public void testModifySchemaTypeName() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
-
- enumMapping.getQName().setSpecifiedName("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", enumMapping.getQName().getSpecifiedName());
- assertEquals("foo", enumMapping.getQName().getName());
-
- enumMapping.getQName().setSpecifiedName(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getName());
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
-
- resourceEnum.removeAnnotation(JAXB.XML_TYPE);
-
- //set name again, this time starting with no XmlType annotation
- enumMapping.getQName().setSpecifiedName("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", enumMapping.getQName().getSpecifiedName());
- assertEquals("foo", enumMapping.getQName().getName());
- }
-
- public void testUpdateSchemaTypeName() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- GenericJavaEnumMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAME, "foo");
- }
- });
- assertEquals("foo", enumMapping.getQName().getSpecifiedName());
- assertEquals("foo", enumMapping.getQName().getName());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaEnumMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaEnumMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
- }
-
- public void testModifyNamespace() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getDefaultNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
-
- enumMapping.getQName().setSpecifiedNamespace("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", enumMapping.getQName().getNamespace());
-
- enumMapping.getQName().setSpecifiedNamespace(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getNamespace());
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
-
- resourceEnum.removeAnnotation(JAXB.XML_TYPE);
-
- //set namespace again, this time starting with no XmlType annotation
- enumMapping.getQName().setSpecifiedNamespace("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", enumMapping.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getDefaultNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- GenericJavaEnumMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", enumMapping.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaEnumMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaEnumMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
- }
-
- public void testModifyXmlRootElement() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getXmlRootElement());
-
- enumMapping.addXmlRootElement().getQName().setSpecifiedName("foo");
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", xmlRootElementAnnotation.getName());
- assertEquals("foo", enumMapping.getXmlRootElement().getQName().getName());
-
- enumMapping.removeXmlRootElement();
- xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation);
- assertNull(enumMapping.getXmlRootElement());
- }
-
- public void testUpdateXmlRootElement() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getXmlRootElement());
-
- //add a XmlRootElement annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation annotation = GenericJavaEnumMappingTests.this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ROOT_ELEMENT);
- GenericJavaEnumMappingTests.this.addMemberValuePair(annotation, JAXB.XML_ROOT_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", enumMapping.getXmlRootElement().getQName().getName());
-
- //remove the XmlRootElement annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(enumMapping.getXmlRootElement());
- }
-
- public void testModifyXmlEnumValue() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
-
- enumMapping.setSpecifiedXmlEnumValue("Integer");
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertEquals("Integer", xmlEnumAnnotation.getValue());
- assertEquals("Integer", enumMapping.getSpecifiedXmlEnumValue());
- assertEquals("Integer", enumMapping.getXmlEnumValue());
-
- enumMapping.setSpecifiedXmlEnumValue(null);
- xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
-
- resourceEnum.addAnnotation(JAXB.XML_TYPE);
- resourceEnum.removeAnnotation(JAXB.XML_ENUM);
- enumMapping = ((JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
- }
-
- public void testUpdateXmlEnumValue() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ENUM);
- GenericJavaEnumMappingTests.this.addXmlEnumTypeMemberValuePair(declaration, JAXB.XML_ENUM__VALUE, "String");
- }
- });
- assertEquals("String", enumMapping.getSpecifiedXmlEnumValue());
- assertEquals("String", enumMapping.getXmlEnumValue());
-
- //remove the factoryClass member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlEnumAnnotation = (NormalAnnotation) GenericJavaEnumMappingTests.this.getXmlEnumAnnotation(declaration);
- GenericJavaEnumMappingTests.this.values(xmlEnumAnnotation).remove(0);
- }
- });
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
- }
-
- public void testUpdateEnumConstants() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertEquals(2, enumMapping.getEnumConstantsSize());
- Iterator<JaxbEnumConstant> enumConstants = enumMapping.getEnumConstants().iterator();
- JaxbEnumConstant enumConstant = enumConstants.next();
- assertEquals("SUNDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("MONDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addEnumConstant((EnumDeclaration) declaration.getDeclaration(), "TUESDAY");
- GenericJavaEnumMappingTests.this.addEnumConstant((EnumDeclaration) declaration.getDeclaration(), "WEDNESDAY");
- }
- });
- assertEquals(4, enumMapping.getEnumConstantsSize());
- enumConstants = enumMapping.getEnumConstants().iterator();
- enumConstant = enumConstants.next();
- assertEquals("SUNDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("MONDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("TUESDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("WEDNESDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "SUNDAY");
- }
- });
- assertEquals(3, enumMapping.getEnumConstantsSize());
- enumConstants = enumMapping.getEnumConstants().iterator();
- enumConstant = enumConstants.next();
- assertEquals("MONDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("TUESDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("WEDNESDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "TUESDAY");
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "MONDAY");
- }
- });
- assertEquals(1, enumMapping.getEnumConstantsSize());
- enumConstants = enumMapping.getEnumConstants().iterator();
- enumConstant = enumConstants.next();
- assertEquals("WEDNESDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "WEDNESDAY");
- }
- });
- assertEquals(0, enumMapping.getEnumConstantsSize());
- assertFalse(enumMapping.getEnumConstants().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java
deleted file mode 100644
index 410125c98f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java
+++ /dev/null
@@ -1,793 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaPackageInfoTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorOrder() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)",
- JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
-
- public void testModifyAccessType() throws Exception {
- createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.FIELD, contextPackageInfo.getAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.NONE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.NONE, contextPackageInfo.getAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(null);
- accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertNull(accessorTypeAnnotation.getValue());
- assertNull(contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
- }
-
- public void testUpdateAccessType() throws Exception {
- createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
-
- //set the accesser type value to FIELD
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__FIELD);
- }
- });
- assertEquals(XmlAccessType.FIELD, contextPackageInfo.getAccessType());
-
- //set the accesser type value to PUBLIC_MEMBER
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- }
- });
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
-
- //set the accesser type value to NONE
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__NONE);
- }
- });
- assertEquals(XmlAccessType.NONE, contextPackageInfo.getAccessType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlAccessorTypeAnnotation(declaration);
- }
- });
- assertNull(contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
- }
-
- public void testModifyAccessOrder() throws Exception {
- createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
-
- contextPackageInfo.setSpecifiedAccessOrder(XmlAccessOrder.UNDEFINED);
- XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED, accessorOrderAnnotation.getValue());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
-
- contextPackageInfo.setSpecifiedAccessOrder(null);
- accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNull(accessorOrderAnnotation.getValue());
- assertNull(contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
- }
-
- public void testUpdateAccessOrder() throws Exception {
- createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
-
- //set the access order value to UNDEFINED
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER__UNDEFINED);
- }
- });
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlAccessorOrderAnnotation(declaration);
- }
- });
- assertNull(contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlAccessorType annotation. Only "annotated" packages are added to the context model
- protected void removeXmlAccessorTypeAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA);
- this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlAccessorOrder annotation. Only "annotated" packages are added to the context model
- protected void removeXmlAccessorOrderAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA);
- this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_ORDER);
- }
-
- public void testGetXmlSchemaTypes() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlSchemaType> xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- assertFalse(xmlSchemaTypes.iterator().hasNext());
-
- //add 2 XmlSchemaTypes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
- }
-
- protected void addXmlSchemaType(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = this.newXmlSchemaTypeAnnotation(declaration.getAst(), name);
- this.addArrayElement(declaration, JAXB.XML_SCHEMA_TYPES, index, JAXB.XML_SCHEMA_TYPES__VALUE, arrayElement);
- }
-
- protected NormalAnnotation newXmlSchemaTypeAnnotation(AST ast, String name) {
- NormalAnnotation annotation = this.newNormalAnnotation(ast, JAXB.XML_SCHEMA_TYPE);
- this.addMemberValuePair(annotation, JAXB.XML_SCHEMA_TYPE__NAME, name);
- return annotation;
- }
-
- public void testGetXmlSchemaTypesSize() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(0, contextPackageInfo.getXmlSchemaTypesSize());
-
- //add 2 XmlSchemaTypes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- }
- });
- assertEquals(2, contextPackageInfo.getXmlSchemaTypesSize());
- }
-
- public void testAddXmlSchemaType() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
-
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- protected Iterator<XmlSchemaTypeAnnotation> getSchemaTypeAnnotations(JavaResourcePackage resourcePackage) {
- return new SubListIterableWrapper<NestableAnnotation, XmlSchemaTypeAnnotation>(resourcePackage.getAnnotations(JAXB.XML_SCHEMA_TYPE)).iterator();
- }
-
- public void testAddXmlSchemaType2() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
-
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- public void testRemoveXmlSchemaType() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(2).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.removeXmlSchemaType(1);
-
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.removeXmlSchemaType(1);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.removeXmlSchemaType(0);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- public void testMoveXmlSchemaType() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(2).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.moveXmlSchemaType(2, 0);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.moveXmlSchemaType(0, 1);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- public void testSyncXmlSchemaTypes() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlSchemaType> xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- assertFalse(xmlSchemaTypes.iterator().hasNext());
-
- //add 3 XmlSchemaTypes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 2, "baz");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlSchemaType(declaration, 2, 0);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlSchemaType(declaration, 0, 1);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlSchemaType(declaration, 1);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlSchemaType(declaration, 1);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlSchemaType(declaration, 0);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertFalse(xmlSchemaTypesIterator.hasNext());
- }
-
- public void testSyncAddXmlSchemaTypes() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlSchemaType> xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- assertFalse(xmlSchemaTypes.iterator().hasNext());
-
- //add 1 XmlSchemaType when none exist
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- //add 1 XmlSchemaType when 1 standalone exists
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
- //add 1 XmlSchemaType when a container annotations exists
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 2, "baz");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
- //add 1 XmlSchemaType to beginning of list when a container annotations exists
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "foobaz");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("foobaz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
- }
-
- protected void moveXmlSchemaType(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_SCHEMA_TYPES), JAXB.XML_SCHEMA_TYPES__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlSchemaType(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_SCHEMA_TYPES), JAXB.XML_SCHEMA_TYPES__VALUE, index);
- }
-
-
- public void testGetXmlJavaTypeAdapters() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlJavaTypeAdapter> xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- assertFalse(xmlJavaTypeAdapters.iterator().hasNext());
-
- //add 2 XmlJavaTypeAdapters
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 0, "String");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 1, "Integer");
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- ListIterator<XmlJavaTypeAdapter> xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("String", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("Integer", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
- }
-
- protected void addXmlJavaTypeAdapter(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = this.newXmlJavaTypeAdapterAnnotation(declaration.getAst(), name);
- this.addArrayElement(declaration, JAXB.XML_JAVA_TYPE_ADAPTERS, index, JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE, arrayElement);
- }
-
- protected NormalAnnotation newXmlJavaTypeAdapterAnnotation(AST ast, String valueTypeName) {
- NormalAnnotation annotation = this.newNormalAnnotation(ast, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.addMemberValuePair(
- annotation,
- JAXB.XML_JAVA_TYPE_ADAPTER__VALUE,
- this.newTypeLiteral(ast, valueTypeName));
- return annotation;
- }
-
- public void testGetXmlJavaTypeAdaptersSize() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(0, contextPackageInfo.getXmlJavaTypeAdaptersSize());
-
- //add 2 XmlJavaTypeAdapters
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 0, "String");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 1, "Integer");
- }
- });
- assertEquals(2, contextPackageInfo.getXmlJavaTypeAdaptersSize());
- }
-
- public void testAddXmlJavaTypeAdapter() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("bar");
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
-
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- protected Iterator<XmlJavaTypeAdapterAnnotation> getXmlJavaTypeAdapterAnnotations(JavaResourcePackage resourcePackage) {
- return new SubListIterableWrapper<NestableAnnotation, XmlJavaTypeAdapterAnnotation>(resourcePackage.getAnnotations(JAXB.XML_JAVA_TYPE_ADAPTER)).iterator();
- }
-
- public void testAddXmlJavaTypeAdapter2() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("bar");
- contextPackageInfo.addXmlJavaTypeAdapter(1).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
-
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- public void testRemoveXmlJavaTypeAdapter() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("String");
- contextPackageInfo.addXmlJavaTypeAdapter(1).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(2).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- XmlJavaTypeAdapterAnnotation adapterAnnotation = xmlJavaTypeAdapters.next();
- assertEquals("String", adapterAnnotation.getValue());
- assertEquals("java.lang.String", adapterAnnotation.getFullyQualifiedValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.removeXmlJavaTypeAdapter(1);
-
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- adapterAnnotation = xmlJavaTypeAdapters.next();
- assertEquals("String", adapterAnnotation.getValue());
- assertEquals("java.lang.String", adapterAnnotation.getFullyQualifiedValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.removeXmlJavaTypeAdapter(1);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- adapterAnnotation = xmlJavaTypeAdapters.next();
- assertEquals("String", adapterAnnotation.getValue());
- assertEquals("java.lang.String", adapterAnnotation.getFullyQualifiedValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.removeXmlJavaTypeAdapter(0);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- public void testMoveXmlJavaTypeAdapter() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("bar");
- contextPackageInfo.addXmlJavaTypeAdapter(1).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(2).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.moveXmlJavaTypeAdapter(2, 0);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.moveXmlJavaTypeAdapter(0, 1);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- public void testSyncXmlJavaTypeAdapters() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlJavaTypeAdapter> xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- assertFalse(xmlJavaTypeAdapters.iterator().hasNext());
-
- //add 3 XmlJavaTypeAdapters
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 1, "foo");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 2, "baz");
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- ListIterator<XmlJavaTypeAdapter> xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("foo", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlJavaTypeAdapter(declaration, 2, 0);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("foo", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlJavaTypeAdapter(declaration, 0, 1);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("foo", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlJavaTypeAdapter(declaration, 1);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlJavaTypeAdapter(declaration, 1);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlJavaTypeAdapter(declaration, 0);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
- }
-
-
- protected void moveXmlJavaTypeAdapter(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTERS), JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlJavaTypeAdapter(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTERS), JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE, index);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java
deleted file mode 100644
index 0d45116955..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaPackageXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaPackageXmlJavaTypeAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithXmlJavaTypeAdapter() throws CoreException {
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter",
- JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
-
- public void testModifyValue() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- contextXmlJavaTypeAdapter.setValue("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getValue());
- assertEquals("foo", contextXmlJavaTypeAdapter.getValue());
-
- //verify the xml schema type annotation is not removed when the value is set to null
- contextXmlJavaTypeAdapter.setValue(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getValue());
- assertNull(contextXmlJavaTypeAdapter.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- //add a value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlJavaTypeAdapters().iterator().hasNext());
- }
-
- public void testModifyType() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertNull(contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getType());
- assertEquals("foo", contextXmlJavaTypeAdapter.getType());
-
- //verify the xml schema type annotation is not removed when the type is set to null
- contextXmlJavaTypeAdapter.setSpecifiedType(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getType());
- assertNull(contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertNull(contextXmlJavaTypeAdapter.getDefaultType());
- }
-
- public void testUpdateType() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertNull(contextXmlJavaTypeAdapter.getDefaultType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlJavaTypeAdapters().iterator().hasNext());
- }
-
- protected void addXmlJavaTypeAdapterTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlJavaTypeAdapterMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlJavaTypeAdapter annotation. Only "annotated" packages are added to the context model
- protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java
deleted file mode 100644
index 13bf4b00f7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaPersistentAttributeTests
- extends JaxbContextModelTestCase {
-
- private static String TEST_CLASS_NAME = "TestClass";
-
- public GenericJavaPersistentAttributeTests(String name) {
- super(name);
- }
-
-
- private void createXmlTypeWithVariousAttributes() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JAXB.XML_TYPE).append(";").append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append(CR);
- sb.append("@XmlType").append(CR);
- sb.append("public class ").append(TEST_CLASS_NAME).append("<T extends Number> ").append("{").append(CR);
- sb.append(" public String string;").append(CR);
- sb.append(" public List<String> stringList;").append(CR);
- sb.append(" public String[] stringArray;").append(CR);
- sb.append(" public String[][] stringDoubleArray;").append(CR);
- sb.append(" public T generic;").append(CR);
- sb.append(" public List<T> genericList;").append(CR);
- sb.append(" public T[] genericArray;").append(CR);
- sb.append(" public List<?> wildcardList;").append(CR);
- sb.append(" public byte[] byteArray;").append(CR);
- sb.append(" public List list;").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TEST_CLASS_NAME + ".java", sourceWriter);
- }
-
-
- public void testJavaResourceType() throws Exception {
- createXmlTypeWithVariousAttributes();
- JaxbClassMapping classMapping = ((JaxbClass) getContextRoot().getType(PACKAGE_NAME_ + TEST_CLASS_NAME)).getMapping();
-
- // String string
- JaxbPersistentAttribute att = CollectionTools.get(classMapping.getAttributes(), 0);
- assertEquals("java.lang.String", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // List<String> stringList
- att = CollectionTools.get(classMapping.getAttributes(), 1);
- assertEquals("java.lang.String", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // String[] stringArray
- att = CollectionTools.get(classMapping.getAttributes(), 2);
- assertEquals("java.lang.String", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // String[][] stringDoubleArray
- att = CollectionTools.get(classMapping.getAttributes(), 3);
- assertEquals("java.lang.String[][]", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // T generic
- att = CollectionTools.get(classMapping.getAttributes(), 4);
- assertEquals("java.lang.Number", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // List<T> genericList
- att = CollectionTools.get(classMapping.getAttributes(), 5);
- assertEquals("java.lang.Number", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // T[] genericArray
- att = CollectionTools.get(classMapping.getAttributes(), 6);
- assertEquals("java.lang.Number", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // List<?> wildcardList
- att = CollectionTools.get(classMapping.getAttributes(), 7);
- assertEquals("java.lang.Object", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // byte[] byteArray
- att = CollectionTools.get(classMapping.getAttributes(), 8);
- assertEquals("byte[]", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // List list
- att = CollectionTools.get(classMapping.getAttributes(), 9);
- assertEquals("java.lang.Object", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java
deleted file mode 100644
index b01ba097ef..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Block;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaRegistryTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaRegistryTests(String name) {
- super(name);
- }
-
- protected ICompilationUnit createClassWithXmlRegistryAndCreateMethods() throws Exception {
- return this.createTestType(PACKAGE_NAME, "ObjectFactory.java", "ObjectFactory", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY, JAXB.XML_ELEMENT_DECL, "javax.xml.bind.JAXBElement");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
-
- @Override
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl(name=\"foo\")").append(CR);
- sb.append(" JAXBElement<AnnotationTestType> createFoo(AnnotationTestType value) {return null}").append(CR);
- sb.append(CR);
- sb.append(" @XmlElementDecl(name=\"bar\")").append(CR);
- sb.append(" JAXBElement createBar(Object value) {return null}").append(CR);
- sb.append(CR);
- }
- });
- }
-
-
- protected void addElementFactoryMethod(TypeDeclaration typeDeclaration, String methodName) {
- AST ast = typeDeclaration.getAST();
- MethodDeclaration methodDeclaration = this.newMethodDeclaration(ast, methodName);
- Block body = ast.newBlock();
- methodDeclaration.setBody(body);
- methodDeclaration.setReturnType2(ast.newSimpleType(ast.newName("JAXBElement")));
- SingleVariableDeclaration parameter = ast.newSingleVariableDeclaration();
- parameter.setName(ast.newSimpleName("value"));
- parameter.setType(ast.newSimpleType(ast.newName("Object")));
- parameters(methodDeclaration).add(parameter);
- NormalAnnotation elementDeclAnnotation = this.newNormalAnnotation(ast, "XmlElementDecl");
- modifiers(methodDeclaration).add(elementDeclAnnotation);
- this.bodyDeclarations(typeDeclaration).add(methodDeclaration);
- }
-
- protected MethodDeclaration newMethodDeclaration(AST ast, String methodName) {
- MethodDeclaration methodDeclaration = ast.newMethodDeclaration();
- methodDeclaration.setName(ast.newSimpleName(methodName));
- return methodDeclaration;
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected List<BodyDeclaration> bodyDeclarations(TypeDeclaration td) {
- return td.bodyDeclarations();
- }
-
- @SuppressWarnings("unchecked")
- protected List<SingleVariableDeclaration> parameters(MethodDeclaration md) {
- return md.parameters();
- }
-
- @SuppressWarnings("unchecked")
- protected List<IExtendedModifier> modifiers(MethodDeclaration md) {
- return md.modifiers();
- }
-
- protected void removeMethodDeclaration(TypeDeclaration typeDeclaration, String methodName) {
- for (MethodDeclaration md : typeDeclaration.getMethods()) {
- if (md.getName().getFullyQualifiedName().equals(methodName)) {
- this.bodyDeclarations(typeDeclaration).remove(md);
- break;
- }
- }
- }
-
- public void testUpdateElementFactoryMethods() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry contextRegistry = jaxbClass.getXmlRegistry();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(2, contextRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo", elementFactoryMethod.getName());
- assertEquals("foo", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.addElementFactoryMethod((TypeDeclaration) declaration.getDeclaration(), "createFoo2");
- GenericJavaRegistryTests.this.addElementFactoryMethod((TypeDeclaration) declaration.getDeclaration(), "createBar2");
- }
- });
- assertEquals(4, contextRegistry.getElementFactoryMethodsSize());
- elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo", elementFactoryMethod.getName());
- assertEquals("foo", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createFoo");
- }
- });
- assertEquals(3, contextRegistry.getElementFactoryMethodsSize());
- elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createFoo2");
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createBar2");
- }
- });
- assertEquals(1, contextRegistry.getElementFactoryMethodsSize());
- elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createBar");
- }
- });
- assertEquals(0, contextRegistry.getElementFactoryMethodsSize());
- assertFalse(contextRegistry.getElementFactoryMethods().iterator().hasNext());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java
deleted file mode 100644
index 6df5f7d855..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaTypeXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaTypeXmlJavaTypeAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlJavaTypeAdapter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJavaTypeAdapter");
- }
- });
- }
-
- public void testModifyValue() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- contextXmlJavaTypeAdapter.setValue("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getValue());
- assertEquals("foo", contextXmlJavaTypeAdapter.getValue());
-
- //verify the xml schema type annotation is not removed when the value is set to null
- contextXmlJavaTypeAdapter.setValue(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getValue());
- assertNull(contextXmlJavaTypeAdapter.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- //add a value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(jaxbClass.getXmlJavaTypeAdapter());
- }
-
- public void testModifyType() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getType());
- assertEquals("foo", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
- }
-
- public void testUpdateType() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("String", contextXmlJavaTypeAdapter.getType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(jaxbClass.getXmlJavaTypeAdapter());
- }
-
- protected void addXmlJavaTypeAdapterTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlJavaTypeAdapterMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlJavaTypeAdapter annotation. Only "annotated" packages are added to the context model
- protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.java
deleted file mode 100644
index 8e79e10763..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlAdapterTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createXmlType() throws Exception {
- return this.createTestType(
- new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- private void createObjObjXmlAdapter() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import " + JAXB.XML_ADAPTER + ";").append(CR);
- sb.append(CR);
- sb.append("public class ObjObjAdapter extends XmlAdapter<Object, Object> {").append(CR);
- sb.append(" public Object marshal(Object obj) { return null; }").append(CR);
- sb.append(" public Object unmarshal(Object obj) { return null; }").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ObjObjAdapter.java", sourceWriter);
- }
-
- private void createMapCalendarXmlAdapter() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import " + JAXB.XML_ADAPTER + ";").append(CR);
- sb.append("import java.util.Map;").append(CR);
- sb.append("import java.util.GregorianCalendar;").append(CR);
- sb.append(CR);
- sb.append("public class MapCalendarAdapter extends XmlAdapter<GregorianCalendar, Map<String, String>> {").append(CR);
- sb.append(" public GregorianCalendar marshal(Map<String, String> obj) { return null; }").append(CR);
- sb.append(" public GregorianCalendar marshal(Object obj) { return null; }").append(CR);
- sb.append(" public Map<String, String> unmarshal(Gregorian Calendar obj) { return null; }").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "MapCalendarAdapter.java", sourceWriter);
- }
-
-
- public void testBoundAndValueTypes() throws Exception {
- createXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping attributeMapping = (XmlElementMapping) persistentAttribute.getMapping();
-
- XmlJavaTypeAdapter xmlJavaTypeAdapter = attributeMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapter.setValue("test.ObjObjAdapter");
-
- assertEquals("test.ObjObjAdapter", xmlJavaTypeAdapter.getValue());
- assertEquals("test.ObjObjAdapter", xmlJavaTypeAdapter.getFullyQualifiedValue());
- assertNull(xmlJavaTypeAdapter.getXmlAdapter());
-
- createObjObjXmlAdapter();
- XmlAdapter xmlAdapter = xmlJavaTypeAdapter.getXmlAdapter();
- assertNotNull(xmlAdapter);
- assertEquals("java.lang.Object", xmlAdapter.getBoundType());
- assertEquals("java.lang.Object", xmlAdapter.getValueType());
-
- createMapCalendarXmlAdapter();
- xmlJavaTypeAdapter.setValue("test.MapCalendarAdapter");
- xmlAdapter = xmlJavaTypeAdapter.getXmlAdapter();
- assertNotNull(xmlAdapter);
- assertEquals("java.util.Map", xmlAdapter.getBoundType());
- assertEquals("java.util.GregorianCalendar", xmlAdapter.getValueType());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java
deleted file mode 100644
index e82e700eb3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlAnyAttributeMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlAnyAttributeMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlAnyAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ANY_ATTRIBUTE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyAttribute");
- }
- });
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyAttributeMapping attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyAttributeMapping attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- attributeMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- attributeMapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyAttributeMapping attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java
deleted file mode 100644
index 392f95d821..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlAnyElementMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlAnyElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement");
- }
- });
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- attributeMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- attributeMapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testModifyLax() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
-
- attributeMapping.setSpecifiedLax(Boolean.TRUE);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertEquals(Boolean.TRUE, xmlAnyElementAnnotation.getLax());
- assertEquals(Boolean.TRUE, attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(true, attributeMapping.isLax());
-
- attributeMapping.setSpecifiedLax(null);
- xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
- }
-
- public void testUpdateLax() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
-
-
- //add a nillable member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addXmlAnyElementMemberValuePair(declaration, JAXB.XML_ANY_ELEMENT__LAX, true);
- }
- });
- assertEquals(Boolean.TRUE, attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(true, attributeMapping.isLax());
-
- //remove the lax member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlAnyElementMappingTests.this.getXmlAnyElementAnnotation(declaration);
- GenericJavaXmlAnyElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
- }
-
- public void testModifyValue() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedValue());
-
- attributeMapping.setSpecifiedValue("Foo");
- XmlAnyElementAnnotation xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertEquals("Foo", attributeMapping.getSpecifiedValue());
- assertEquals("Foo", attributeMapping.getValue());
-
- attributeMapping.setSpecifiedValue(null);
- xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertNull(xmlElementAnnotation.getValue());
- assertNull(attributeMapping.getSpecifiedValue());
- }
-
- public void testUpdateValue() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedValue());
-
-
- //add a Value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addXmlAnyElementTypeMemberValuePair(declaration, JAXB.XML_ANY_ELEMENT__VALUE, "Foo");
- }
- });
- assertEquals("Foo", attributeMapping.getValue());
-
- //remove the Value member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlAnyElementMappingTests.this.getXmlAnyElementAnnotation(declaration);
- GenericJavaXmlAnyElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(attributeMapping.getSpecifiedValue());
- }
-
- protected Annotation getXmlAnyElementAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ANY_ELEMENT);
- }
-
- protected void addXmlAnyElementMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlAnyElementAnnotation(declaration), name, value);
- }
-
- protected void addXmlAnyElementTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlAnyElementAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
-
- // ***** XmlElementRefs *****
-
- public void testSyncXmlElementRefs() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<XmlElementRef> xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
- assertTrue(CollectionTools.isEmpty(xmlElementRefs));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
-
- //add XmlElementRef annotation
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMemberValuePair(
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_REF),
- JAXB.XML_ELEMENT_REF__NAME, "foo");
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
-
- // add XmlElementRefs annotation with nested annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), JAXB.XML_ELEMENT_REFS);
- NormalAnnotation annotation =
- GenericJavaXmlAnyElementMappingTests.this.newNormalAnnotation(declaration.getAst(), JAXB.XML_ELEMENT_REF);
- GenericJavaXmlAnyElementMappingTests.this.addMemberValuePair(
- annotation, JAXB.XML_ELEMENT_REF__NAME, "bar");
- GenericJavaXmlAnyElementMappingTests.this.addArrayElement(
- declaration, JAXB.XML_ELEMENT_REFS, 0, JAXB.XML_ELEMENT_REFS__VALUE, annotation);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
-
- // add second nested XmlElementRef annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation annotation =
- GenericJavaXmlAnyElementMappingTests.this.newNormalAnnotation(declaration.getAst(), JAXB.XML_ELEMENT_REF);
- GenericJavaXmlAnyElementMappingTests.this.addMemberValuePair(
- annotation, JAXB.XML_ELEMENT_REF__NAME, "baz");
- GenericJavaXmlAnyElementMappingTests.this.addArrayElement(
- declaration, JAXB.XML_ELEMENT_REFS, 1, JAXB.XML_ELEMENT_REFS__VALUE, annotation);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("baz", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // switch nested XmlElementRef annotations
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.moveArrayElement(
- (NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS),
- JAXB.XML_ELEMENT_REFS__VALUE, 0, 1);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("baz", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // remove XmlElementRefs annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeArrayElement(
- (NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS),
- JAXB.XML_ELEMENT_REFS__VALUE, 1);
- GenericJavaXmlAnyElementMappingTests.this.removeArrayElement(
- (NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS),
- JAXB.XML_ELEMENT_REFS__VALUE, 0);
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(
- declaration, JAXB.XML_ELEMENT_REFS);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
-
- // remove XmlElementRef annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(
- declaration, JAXB.XML_ELEMENT_REF);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertTrue(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testModifyXmlElementRefs() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlElementRefsAnnotation xmlElementRefsAnnotation;
- XmlElementRefAnnotation xmlElementRefAnnotation;
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
-
- attributeMapping.getXmlElementRefs().addXmlElementRef(0).getQName().setSpecifiedName("foo");
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefsAnnotation);
- assertNotNull(xmlElementRefAnnotation);
- assertEquals("foo", xmlElementRefAnnotation.getName());
-
- attributeMapping.getXmlElementRefs().addXmlElementRef(1).getQName().setSpecifiedName("bar");
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNotNull(xmlElementRefsAnnotation);
- assertNull(xmlElementRefAnnotation);
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 0).getName());
- assertEquals("bar", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 1).getName());
-
- attributeMapping.getXmlElementRefs().moveXmlElementRef(0, 1);
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNotNull(xmlElementRefsAnnotation);
- assertNull(xmlElementRefAnnotation);
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 0).getName());
- assertEquals("foo", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 1).getName());
-
- attributeMapping.getXmlElementRefs().removeXmlElementRef(0);
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefsAnnotation);
- assertNotNull(xmlElementRefAnnotation);
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", xmlElementRefAnnotation.getName());
-
- attributeMapping.getXmlElementRefs().removeXmlElementRef(0);
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testModifyXmlMixed() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(xmlListAnnotation);
-
- attributeMapping.addXmlMixed();
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(xmlListAnnotation);
-
- attributeMapping.removeXmlMixed();
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- }
-
- public void testUpdateXmlMixed() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(xmlListAnnotation);
-
-
- //add an XmlMixed annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_MIXED);
- }
- });
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(xmlListAnnotation);
-
- //remove the XmlMixed annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_MIXED);
- }
- });
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(xmlListAnnotation);
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java
deleted file mode 100644
index 2353eeb1f9..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java
+++ /dev/null
@@ -1,632 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlAttributeMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute");
- }
- });
- }
-
- public void testModifyName() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
- assertEquals("id", xmlAttributeMapping.getQName().getDefaultName());
- assertEquals("id", xmlAttributeMapping.getQName().getName());
-
- xmlAttributeMapping.getQName().setSpecifiedName("foo");
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertEquals("foo", xmlAttributeAnnotation.getName());
- assertEquals("foo", xmlAttributeMapping.getQName().getSpecifiedName());
- assertEquals("id", xmlAttributeMapping.getQName().getDefaultName());
- assertEquals("foo", xmlAttributeMapping.getQName().getName());
-
- xmlAttributeMapping.getQName().setSpecifiedName(null);
- xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getName());
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
-
-
- //add a Name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__NAME, "foo");
- }
- });
- assertEquals("foo", xmlAttributeMapping.getQName().getName());
-
- //remove the Name member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlAttributeAnnotation = (NormalAnnotation) GenericJavaXmlAttributeMappingTests.this.getXmlAttributeAnnotation(declaration);
- GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0);
- }
- });
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
- }
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
-
- xmlAttributeMapping.getQName().setSpecifiedNamespace("foo");
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertEquals("foo", xmlAttributeAnnotation.getNamespace());
- assertEquals("foo", xmlAttributeMapping.getQName().getNamespace());
-
- xmlAttributeMapping.getQName().setSpecifiedNamespace(null);
- xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getNamespace());
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
-
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", xmlAttributeMapping.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlAttributeAnnotation = (NormalAnnotation) GenericJavaXmlAttributeMappingTests.this.getXmlAttributeAnnotation(declaration);
- GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0);
- }
- });
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
- }
-
- public void testModifyRequired() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
-
- xmlAttributeMapping.setSpecifiedRequired(Boolean.TRUE);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertEquals(Boolean.TRUE, xmlAttributeAnnotation.getRequired());
- assertEquals(Boolean.TRUE, xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(true, xmlAttributeMapping.isRequired());
-
- xmlAttributeMapping.setSpecifiedRequired(null);
- xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getName());
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
- }
-
- public void testUpdateRequired() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
-
-
- //add a required member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__REQUIRED, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(true, xmlAttributeMapping.isRequired());
-
- //remove the required member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlAttributeAnnotation = (NormalAnnotation) GenericJavaXmlAttributeMappingTests.this.getXmlAttributeAnnotation(declaration);
- GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0);
- }
- });
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlAttributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- xmlAttributeMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- xmlAttributeMapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testModifyXmlSchemaType() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(xmlAttributeMapping.getXmlSchemaType());
- assertNull(xmlSchemaTypeAnnotation);
-
- xmlAttributeMapping.addXmlSchemaType();
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNotNull(xmlAttributeMapping.getXmlSchemaType());
- assertNotNull(xmlSchemaTypeAnnotation);
-
- xmlAttributeMapping.removeXmlSchemaType();
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- }
-
- public void testUpdateXmlSchemaType() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(xmlAttributeMapping.getXmlSchemaType());
- assertNull(xmlSchemaTypeAnnotation);
-
-
- //add an XmlSchemaType annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA_TYPE);
- }
- });
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNotNull(xmlAttributeMapping.getXmlSchemaType());
- assertNotNull(xmlSchemaTypeAnnotation);
-
- //remove the XmlSchemaType annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE);
- }
- });
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(xmlAttributeMapping.getXmlSchemaType());
- assertNull(xmlSchemaTypeAnnotation);
- }
-
- protected void addXmlAttributeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlAttributeAnnotation(declaration), name, value);
- }
-
- protected void addXmlAttributeMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlAttributeAnnotation(declaration), name, value);
- }
-
- protected void addXmlAttributeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlAttributeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlAttributeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ATTRIBUTE);
- }
-
- public void testModifyXmlList() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNull(xmlAttributeMapping.getXmlList());
- assertNull(xmlListAnnotation);
-
- xmlAttributeMapping.addXmlList();
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNotNull(xmlAttributeMapping.getXmlList());
- assertNotNull(xmlListAnnotation);
-
- xmlAttributeMapping.removeXmlList();
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- }
-
- public void testUpdateXmlList() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNull(xmlAttributeMapping.getXmlList());
- assertNull(xmlListAnnotation);
-
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNotNull(xmlAttributeMapping.getXmlList());
- assertNotNull(xmlListAnnotation);
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNull(xmlAttributeMapping.getXmlList());
- assertNull(xmlListAnnotation);
- }
-
- public void testModifyXmlID() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlAttributeMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
- xmlAttributeMapping.addXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlAttributeMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- xmlAttributeMapping.removeXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- }
-
- public void testUpdateXmlID() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlAttributeMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
-
- //add an XmlID annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlAttributeMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- //remove the XmlID annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlAttributeMapping.getXmlID());
- assertNull(xmlIDAnnotation);
- }
-
- public void testModifyXmlIDREF() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlAttributeMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- xmlAttributeMapping.addXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlAttributeMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- xmlAttributeMapping.removeXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- }
-
- public void testUpdateXmlIDREF() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlAttributeMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
-
- //add an XmlIDREF annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlAttributeMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- //remove the XmlIDREF annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlAttributeMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testModifyXmlAttachmentRef() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
- xmlAttributeMapping.addXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- xmlAttributeMapping.removeXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- }
-
- public void testUpdateXmlAttachmentRef() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
-
- //add an XmlAttachmentRef annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- //remove the XmlAttachmentRef annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java
deleted file mode 100644
index 66ae943122..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java
+++ /dev/null
@@ -1,958 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlElementMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement");
- }
- });
- }
-
- private void createXmlTypeWithVariousAttributes() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JAXB.XML_TYPE).append(";").append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append(CR);
- sb.append("@XmlType").append(CR);
- sb.append("public class ").append(TYPE_NAME).append("{").append(CR);
- sb.append(" public String string;").append(CR);
- sb.append(" public List<String> stringList;").append(CR);
- sb.append(" public String[] stringArray;").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TYPE_NAME + ".java", sourceWriter);
- }
-
- public void testModifyName() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedName());
- assertEquals("id", xmlElement.getQName().getDefaultName());
- assertEquals("id", xmlElement.getQName().getName());
-
- xmlElement.getQName().setSpecifiedName("foo");
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals("foo", xmlElementAnnotation.getName());
- assertEquals("foo", xmlElement.getQName().getSpecifiedName());
- assertEquals("id", xmlElement.getQName().getDefaultName());
- assertEquals("foo", xmlElement.getQName().getName());
-
- xmlElement.getQName().setSpecifiedName(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElement.getQName().getSpecifiedName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedName());
-
-
- //add a Name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", xmlElement.getQName().getName());
-
- //remove the Name member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getQName().getSpecifiedName());
- }
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
-
- xmlElement.getQName().setSpecifiedNamespace("foo");
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals("foo", xmlElementAnnotation.getNamespace());
- assertEquals("foo", xmlElement.getQName().getNamespace());
-
- xmlElement.getQName().setSpecifiedNamespace(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getNamespace());
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
-
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", xmlElement.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
- }
-
- public void testModifyRequired() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
-
- xmlElement.setSpecifiedRequired(Boolean.TRUE);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired());
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(true, xmlElement.isRequired());
-
- xmlElement.setSpecifiedRequired(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
- }
-
- public void testUpdateRequired() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
-
-
- //add a required member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__REQUIRED, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(true, xmlElement.isRequired());
-
- //remove the required member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
- }
-
- public void testModifyNillable() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
-
- xmlElement.setSpecifiedNillable(Boolean.TRUE);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable());
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(true, xmlElement.isNillable());
-
- xmlElement.setSpecifiedNillable(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
- }
-
- public void testUpdateNillable() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
-
-
- //add a nillable member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NILLABLE, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(true, xmlElement.isNillable());
-
- //remove the nillable member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
- }
-
- public void testDefaultNillable() throws Exception {
- createXmlTypeWithVariousAttributes();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- // string
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = persistentAttribute.getJavaResourceAttribute();
-
- assertEquals(false, xmlElement.isDefaultNillable());
-
- annotatedElement(resourceAttribute).edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(false, xmlElement.isDefaultNillable());
-
- // string list
- persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 1);
- xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- xmlElement = xmlElementMapping.getXmlElement();
- resourceAttribute = persistentAttribute.getJavaResourceAttribute();
-
- assertEquals(true, xmlElement.isDefaultNillable());
-
- annotatedElement(resourceAttribute).edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(false, xmlElement.isDefaultNillable());
-
- // string array
- persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 2);
- xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- xmlElement = xmlElementMapping.getXmlElement();
- resourceAttribute = persistentAttribute.getJavaResourceAttribute();
-
- assertEquals(true, xmlElement.isDefaultNillable());
-
- annotatedElement(resourceAttribute).edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(false, xmlElement.isDefaultNillable());
- }
-
- public void testModifyDefaultValue() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getDefaultValue());
-
- xmlElement.setDefaultValue("foo");
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals("foo", xmlElementAnnotation.getDefaultValue());
- assertEquals("foo", xmlElement.getDefaultValue());
-
- xmlElement.setDefaultValue(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertNull(xmlElement.getDefaultValue());
- }
-
- public void testUpdateDefaultValue() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getDefaultValue());
-
-
- //add a DefaultValue member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__DEFAULT_VALUE, "foo");
- }
- });
- assertEquals("foo", xmlElement.getDefaultValue());
-
- //remove the DefaultValue member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getDefaultValue());
- }
-
- public void testModifyType() throws Exception {
- createTypeWithXmlElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
-
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getType());
- assertEquals("int", xmlElement.getDefaultType());
-
- xmlElement.setSpecifiedType("Foo");
- assertEquals("Foo", xmlElement.getSpecifiedType());
- assertEquals("Foo", xmlElement.getType());
-
- xmlElement.setSpecifiedType(null);
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getType());
- }
-
- public void testUpdateType() throws Exception {
- createTypeWithXmlElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getDefaultType());
- assertEquals("int", xmlElement.getType());
-
- //add a Type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementTypeMemberValuePair(declaration, JAXB.XML_ELEMENT__TYPE, "Foo");
- }
- });
- assertEquals("Foo", xmlElement.getSpecifiedType());
- assertEquals("Foo", xmlElement.getType());
-
- //remove the Type member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getType());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlElementMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- xmlElementMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- xmlElementMapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testModifyXmlSchemaType() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(xmlElementMapping.getXmlSchemaType());
- assertNull(xmlSchemaTypeAnnotation);
-
- xmlElementMapping.addXmlSchemaType();
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNotNull(xmlElementMapping.getXmlSchemaType());
- assertNotNull(xmlSchemaTypeAnnotation);
-
- xmlElementMapping.removeXmlSchemaType();
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- }
-
- public void testUpdateXmlSchemaType() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(xmlElementMapping.getXmlSchemaType());
- assertNull(xmlSchemaTypeAnnotation);
-
-
- //add an XmlSchemaType annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA_TYPE);
- }
- });
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNotNull(xmlElementMapping.getXmlSchemaType());
- assertNotNull(xmlSchemaTypeAnnotation);
-
- //remove the XmlSchemaType annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE);
- }
- });
- xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(xmlElementMapping.getXmlSchemaType());
- assertNull(xmlSchemaTypeAnnotation);
- }
-
- protected void addXmlElementMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlElementAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlElementAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT);
- }
-
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- xmlElementMapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- xmlElementMapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- public void testUpdateXmlElementWrapper() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
-
- //add an XmlElementWrapper annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- //remove the XmlElementWrapper annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlList() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNull(xmlElementMapping.getXmlList());
- assertNull(xmlListAnnotation);
-
- xmlElementMapping.addXmlList();
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNotNull(xmlElementMapping.getXmlList());
- assertNotNull(xmlListAnnotation);
-
- xmlElementMapping.removeXmlList();
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- }
-
- public void testUpdateXmlList() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNull(xmlElementMapping.getXmlList());
- assertNull(xmlListAnnotation);
-
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNotNull(xmlElementMapping.getXmlList());
- assertNotNull(xmlListAnnotation);
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
- xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertNull(xmlElementMapping.getXmlList());
- assertNull(xmlListAnnotation);
- }
-
- public void testModifyXmlID() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlElementMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
- xmlElementMapping.addXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlElementMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- xmlElementMapping.removeXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- }
-
- public void testUpdateXmlID() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlElementMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
-
- //add an XmlID annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlElementMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- //remove the XmlID annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlElementMapping.getXmlID());
- assertNull(xmlIDAnnotation);
- }
-
- public void testModifyXmlIDREF() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- xmlElementMapping.addXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlElementMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- xmlElementMapping.removeXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testUpdateXmlIDREF() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
-
- //add an XmlIDREF annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlElementMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- //remove the XmlIDREF annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testModifyXmlAttachmentRef() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlElementMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
- xmlElementMapping.addXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlElementMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- xmlElementMapping.removeXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- }
-
- public void testUpdateXmlAttachmentRef() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlElementMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
-
- //add an XmlAttachmentRef annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlElementMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- //remove the XmlAttachmentRef annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlElementMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java
deleted file mode 100644
index 96a910d5de..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlElementRefMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlElementRefMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlElementRef() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef");
- }
- });
- }
-
- private ICompilationUnit createTypeWithJAXBElementXmlElementRef() throws Exception {
- return this.createTestType(TYPE_NAME + "2", new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REF, JAXB.JAXB_ELEMENT);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef").append(CR);
- sb.append("private JAXBElement foo;").append(CR).append(CR);
- }
- });
- }
-
- private ICompilationUnit createTypeWithRootElementXmlElementRef() throws Exception {
- return this.createTestType(TYPE_NAME + "3", new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REF, JAXB.XML_ROOT_ELEMENT);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlRootElement(name=\"foo\")");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef").append(CR);
- sb.append("private " + TYPE_NAME + "3 foo;").append(CR).append(CR);
- }
- });
- }
-
-
- public void testDefaultName() throws Exception {
- createTypeWithXmlElementRef();
- createTypeWithJAXBElementXmlElementRef(); // FULLY_QUALIFIED_TYPE_NAME + "2"
- createTypeWithRootElementXmlElementRef(); // FULLY_QUALIFIED_TYPE_NAME + "3"
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- // XmlElementRef type is java.lang.String -> no default name or namespace
- assertEquals("", xmlElementRef.getQName().getName());
- assertEquals("", xmlElementRef.getQName().getNamespace());
-
- classMapping = ((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME + "2")).getMapping();
- xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- // XmlElementRef type is JAXBElement -> default name is name of attribute
- assertEquals("foo", xmlElementRef.getQName().getName());
- assertEquals("", xmlElementRef.getQName().getNamespace());
-
- classMapping = ((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME + "3")).getMapping();
- xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- // XmlElementRef type is type with root element -> default name is root element name
- assertEquals("foo", xmlElementRef.getQName().getName());
- assertEquals("", xmlElementRef.getQName().getNamespace());
- }
-
- public void testModifyName() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedName());
- assertEquals("", xmlElementRef.getQName().getDefaultName());
- assertEquals("", xmlElementRef.getQName().getName());
-
- xmlElementRef.getQName().setSpecifiedName("foo");
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertEquals("foo", xmlElementRefAnnotation.getName());
- assertEquals("foo", xmlElementRef.getQName().getSpecifiedName());
- assertEquals("foo", xmlElementRef.getQName().getName());
-
- xmlElementRef.getQName().setSpecifiedName(null);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRef.getQName().getSpecifiedName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedName());
-
-
- //add a Name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__NAME, "foo");
- }
- });
- assertEquals("foo", xmlElementRef.getQName().getName());
-
- //remove the Name member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getQName().getSpecifiedName());
- }
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
-
- xmlElementRef.getQName().setSpecifiedNamespace("foo");
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertEquals("foo", xmlElementRefAnnotation.getNamespace());
- assertEquals("foo", xmlElementRef.getQName().getNamespace());
-
- xmlElementRef.getQName().setSpecifiedNamespace(null);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
-
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", xmlElementRef.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
- }
-
- public void testModifyRequired() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
-
- xmlElementRef.setSpecifiedRequired(Boolean.TRUE);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertEquals(Boolean.TRUE, xmlElementRefAnnotation.getRequired());
- assertEquals(Boolean.TRUE, xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(true, xmlElementRef.isRequired());
-
- xmlElementRef.setSpecifiedRequired(null);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
- }
-
- public void testUpdateRequired() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
-
-
- //add a required member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__REQUIRED, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(true, xmlElementRef.isRequired());
-
- //remove the required member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
- }
-
- public void testModifyType() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getType());
- assertEquals("int", xmlElementRef.getDefaultType());
-
- xmlElementRef.setSpecifiedType("Foo");
- assertEquals("Foo", xmlElementRef.getSpecifiedType());
- assertEquals("Foo", xmlElementRef.getType());
-
- xmlElementRef.setSpecifiedType(null);
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getType());
- }
-
- public void testUpdateType() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getDefaultType());
- assertEquals("int", xmlElementRef.getType());
-
- //add a Type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefTypeMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__TYPE, "Foo");
- }
- });
- assertEquals("Foo", xmlElementRef.getSpecifiedType());
- assertEquals("Foo", xmlElementRef.getType());
-
- //remove the Type member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getType());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlElementRefMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY);
- xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementRefMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- xmlElementRefMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- xmlElementRefMapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- protected void addXmlElementRefMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementRefAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementRefAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlElementRefAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlElementRefAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REF);
- }
-
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- xmlElementRefMapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- xmlElementRefMapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- public void testUpdateXmlElementRefWrapper() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- //add an XmlElementWrapper annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- //remove the XmlElementWrapper annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlMixed() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping attributeMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
-
- attributeMapping.addXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(annotation);
-
- attributeMapping.removeXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
- }
-
- public void testUpdateXmlMixed() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping attributeMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
-
- //add an XmlMixed annotation
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(annotation);
-
- //remove the XmlMixed annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java
deleted file mode 100644
index 2d74ff09a3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlElementRefsMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlElementRefsMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlElementRefs() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs");
- }
- });
- }
-
- protected Annotation getXmlElementRefsAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS);
- }
-
- protected void addXmlElementRefsMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- addMemberValuePair((MarkerAnnotation) this.getXmlElementRefsAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefsMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- addMemberValuePair((MarkerAnnotation) getXmlElementRefsAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefsTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- addMemberValuePair(
- (MarkerAnnotation) getXmlElementRefsAnnotation(declaration),
- name,
- newTypeLiteral(declaration.getAst(), typeName));
- }
-
-
- // ***** XmlElementRefs *****
-
- protected NormalAnnotation newXmlElementRefAnnotation(AST ast, String name) {
- NormalAnnotation annotation = newNormalAnnotation(ast, JAXB.XML_ELEMENT_REF);
- addMemberValuePair(annotation, JAXB.XML_ELEMENT_REF__NAME, name);
- return annotation;
- }
-
- protected void addXmlElementRef(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = newXmlElementRefAnnotation(declaration.getAst(), name);
- addArrayElement(declaration, JAXB.XML_ELEMENT_REFS, index, JAXB.XML_ELEMENT_REFS__VALUE, arrayElement);
- }
-
- protected void moveXmlElementRef(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS), JAXB.XML_ELEMENT_REFS__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlElementRef(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS), JAXB.XML_ELEMENT_REFS__VALUE, index);
- }
-
- public void testSyncXmlElementRefs() throws Exception {
- createTypeWithXmlElementRefs();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<XmlElementRef> xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
- assertTrue(CollectionTools.isEmpty(xmlElementRefs));
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
-
- //add 2 XmlElementRef annotations
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addXmlElementRef(declaration, 0, "foo");
- GenericJavaXmlElementRefsMappingTests.this.addXmlElementRef(declaration, 1, "bar");
- }
- });
-
- xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // switch XmlElementRef annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.moveXmlElementRef(declaration, 0, 1);
- }
- });
-
- xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // remove XmlElementRef annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeXmlElementRef(declaration, 1);
- GenericJavaXmlElementRefsMappingTests.this.removeXmlElementRef(declaration, 0);
- }
- });
-
- xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
-
- assertTrue(CollectionTools.isEmpty(xmlElementRefs));
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testModifyXmlElementRefs() throws Exception {
- createTypeWithXmlElementRefs();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlElementRefsAnnotation annotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
-
- Iterable<XmlElementRefAnnotation> annotations = annotation.getXmlElementRefs();
-
- assertEquals(0, annotation.getXmlElementRefsSize());
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
-
- mapping.getXmlElementRefs().addXmlElementRef(0).getQName().setSpecifiedName("foo");
- mapping.getXmlElementRefs().addXmlElementRef(1).getQName().setSpecifiedName("baz");
- mapping.getXmlElementRefs().addXmlElementRef(1).getQName().setSpecifiedName("bar");
-
- annotations = annotation.getXmlElementRefs();
-
- assertEquals(3, annotation.getXmlElementRefsSize());
- assertEquals(3, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(annotations, 0).getName());
- assertEquals("bar", CollectionTools.get(annotations, 1).getName());
- assertEquals("baz", CollectionTools.get(annotations, 2).getName());
-
- mapping.getXmlElementRefs().moveXmlElementRef(1, 2);
-
- annotations = annotation.getXmlElementRefs();
-
- assertEquals(3, annotation.getXmlElementRefsSize());
- assertEquals(3, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(annotations, 0).getName());
- assertEquals("baz", CollectionTools.get(annotations, 1).getName());
- assertEquals("bar", CollectionTools.get(annotations, 2).getName());
-
- mapping.getXmlElementRefs().removeXmlElementRef(2);
- mapping.getXmlElementRefs().removeXmlElementRef(0);
- mapping.getXmlElementRefs().removeXmlElementRef(0);
-
- assertEquals(0, annotation.getXmlElementRefsSize());
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(mapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY);
- mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- assertNotNull(mapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- mapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- mapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- mapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- mapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- public void testUpdateXmlElementWrapper() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- //add an XmlElementWrapper annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- //remove the XmlElementWrapper annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlMixed() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
-
- mapping.addXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(mapping.getXmlMixed());
- assertNotNull(annotation);
-
- mapping.removeXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
- }
-
- public void testUpdateXmlMixed() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
-
- //add an XmlMixed annotation
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(mapping.getXmlMixed());
- assertNotNull(annotation);
-
- //remove the XmlMixed annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeAnnotation(declaration, JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java
deleted file mode 100644
index 8b5d73cb67..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlElementsMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlElementsMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlElements() throws Exception {
- return this.createTestType(
- new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENTS);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements");
- }
- });
- }
-
-
- // ***** XmlElements *****
-
- protected NormalAnnotation newXmlElementAnnotation(AST ast, String name) {
- NormalAnnotation annotation = newNormalAnnotation(ast, JAXB.XML_ELEMENT);
- addMemberValuePair(annotation, JAXB.XML_ELEMENT__NAME, name);
- return annotation;
- }
-
- protected void addXmlElement(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = newXmlElementAnnotation(declaration.getAst(), name);
- addArrayElement(declaration, JAXB.XML_ELEMENTS, index, JAXB.XML_ELEMENTS__VALUE, arrayElement);
- }
-
- protected void moveXmlElement(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENTS), JAXB.XML_ELEMENTS__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlElement(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENTS), JAXB.XML_ELEMENTS__VALUE, index);
- }
-
- public void testSyncXmlElements() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<XmlElement> xmlElements = mapping.getXmlElements();
- assertTrue(CollectionTools.isEmpty(xmlElements));
- assertEquals(0, mapping.getXmlElementsSize());
-
- //add 2 XmlElement annotations
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addXmlElement(declaration, 0, "foo");
- GenericJavaXmlElementsMappingTests.this.addXmlElement(declaration, 1, "bar");
- }
- });
-
- xmlElements = mapping.getXmlElements();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElements()));
- assertEquals(2, mapping.getXmlElementsSize());
- assertEquals("foo", CollectionTools.get(xmlElements, 0).getQName().getName());
- assertEquals("bar", CollectionTools.get(xmlElements, 1).getQName().getName());
-
- // switch XmlElement annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.moveXmlElement(declaration, 0, 1);
- }
- });
-
- xmlElements = mapping.getXmlElements();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElements()));
- assertEquals(2, mapping.getXmlElementsSize());
- assertEquals("bar", CollectionTools.get(xmlElements, 0).getQName().getName());
- assertEquals("foo", CollectionTools.get(xmlElements, 1).getQName().getName());
-
- // remove XmlElement annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeXmlElement(declaration, 1);
- GenericJavaXmlElementsMappingTests.this.removeXmlElement(declaration, 0);
- }
- });
-
- xmlElements = mapping.getXmlElements();
-
- assertTrue(CollectionTools.isEmpty(xmlElements));
- assertEquals(0, mapping.getXmlElementsSize());
- }
-
- public void testModifyXmlElements() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlElementsAnnotation xmlElementsAnnotation = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
-
- Iterable<XmlElementAnnotation> xmlElementAnnotations = xmlElementsAnnotation.getXmlElements();
-
- assertEquals(0, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(0, mapping.getXmlElementsSize());
-
- mapping.addXmlElement(0).getQName().setSpecifiedName("foo");
- mapping.addXmlElement(1).getQName().setSpecifiedName("baz");
- mapping.addXmlElement(1).getQName().setSpecifiedName("bar");
-
- xmlElementAnnotations = xmlElementsAnnotation.getXmlElements();
-
- assertEquals(3, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(3, mapping.getXmlElementsSize());
- assertEquals("foo", CollectionTools.get(xmlElementAnnotations, 0).getName());
- assertEquals("bar", CollectionTools.get(xmlElementAnnotations, 1).getName());
- assertEquals("baz", CollectionTools.get(xmlElementAnnotations, 2).getName());
-
- mapping.moveXmlElement(1, 2);
-
- xmlElementAnnotations = xmlElementsAnnotation.getXmlElements();
-
- assertEquals(3, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(3, mapping.getXmlElementsSize());
- assertEquals("foo", CollectionTools.get(xmlElementAnnotations, 0).getName());
- assertEquals("baz", CollectionTools.get(xmlElementAnnotations, 1).getName());
- assertEquals("bar", CollectionTools.get(xmlElementAnnotations, 2).getName());
-
- mapping.removeXmlElement(2);
- mapping.removeXmlElement(0);
- mapping.removeXmlElement(0);
-
- assertEquals(0, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(0, mapping.getXmlElementsSize());
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- mapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- mapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- mapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- mapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testUpdateXmlElementWrapper() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(
- ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlIDREF() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- mapping.addXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNotNull(mapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- mapping.removeXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testUpdateXmlIDREF() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNotNull(mapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java
deleted file mode 100644
index c4382408a0..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlRootElementTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlRootElementTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlTypeWithXmlRootElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlRootElement").append(CR);
- }
- });
- }
-
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("", contextRootElement.getQName().getDefaultNamespace());
- assertEquals("", contextRootElement.getQName().getNamespace());
-
- contextRootElement.getQName().setSpecifiedNamespace("foo");
- XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", rootElementAnnotation.getNamespace());
- assertEquals("foo", contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextRootElement.getQName().getNamespace());
-
- contextRootElement.getQName().setSpecifiedNamespace(null);
- rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(rootElementAnnotation.getNamespace());
- assertNull(contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("", contextRootElement.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("", contextRootElement.getQName().getDefaultNamespace());
- assertEquals("", contextRootElement.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.addXmlRootElementMemberValuePair(declaration, JAXB.XML_ROOT_ELEMENT__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextRootElement.getQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(classMapping.getXmlRootElement());
- }
-
- public void testModifyName() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(contextRootElement.getQName().getSpecifiedName());
- assertEquals(defaultName, contextRootElement.getQName().getDefaultName());
- assertEquals(defaultName, contextRootElement.getQName().getName());
-
- contextRootElement.getQName().setSpecifiedName("foo");
- XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", rootElementAnnotation.getName());
- assertEquals("foo", contextRootElement.getQName().getSpecifiedName());
- assertEquals("foo", contextRootElement.getQName().getName());
-
- contextRootElement.getQName().setSpecifiedName(null);
- rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(rootElementAnnotation.getName());
- assertNull(contextRootElement.getQName().getSpecifiedName());
- assertEquals(defaultName, contextRootElement.getQName().getName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(contextRootElement.getQName().getSpecifiedName());
- assertEquals(defaultName, contextRootElement.getQName().getDefaultName());
- assertEquals(defaultName, contextRootElement.getQName().getName());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.addXmlRootElementMemberValuePair(declaration, JAXB.XML_ROOT_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", contextRootElement.getQName().getSpecifiedName());
- assertEquals("foo", contextRootElement.getQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(classMapping.getXmlRootElement());
- }
-
- protected void addXmlRootElementMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlRootElementAnnotation(declaration), name, value);
- }
-
- protected Annotation getXmlRootElementAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ROOT_ELEMENT);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java
deleted file mode 100644
index 05f0a4c3a3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java
+++ /dev/null
@@ -1,669 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlSchemaTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithXmlSchema() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema",
- JAXB.XML_SCHEMA);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- public void testModifyNamespace() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
-
- contextXmlSchema.setSpecifiedNamespace("foo");
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getNamespace());
- assertEquals("foo", contextXmlSchema.getNamespace());
- assertEquals("foo", contextXmlSchema.getSpecifiedNamespace());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedNamespace(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getNamespace());
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
-
- //set namespace again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedNamespace("foo");
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getNamespace());
- assertEquals("foo", contextXmlSchema.getSpecifiedNamespace());
- assertEquals("foo", contextXmlSchema.getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaMemberValuePair(declaration, JAXB.XML_SCHEMA__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", contextXmlSchema.getNamespace());
- assertEquals("foo", contextXmlSchema.getSpecifiedNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
- }
-
- public void testModifyLocation() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getLocation());
-
- contextXmlSchema.setLocation("foo");
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getLocation());
- assertEquals("foo", contextXmlSchema.getLocation());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setLocation(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getLocation());
- assertNull(contextXmlSchema.getLocation());
-
- //set location again, this time starting with no XmlSchema annotation
- contextXmlSchema.setLocation("foo");
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getLocation());
- assertEquals("foo", contextXmlSchema.getLocation());
- }
-
- public void testUpdateLocation() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getLocation());
-
- //add a location member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaMemberValuePair(declaration, JAXB.XML_SCHEMA__LOCATION, "foo");
- }
- });
-
- assertEquals("foo", contextXmlSchema.getLocation());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertNull(contextXmlSchema.getLocation());
- }
-
- public void testModifyAttributeFormDefault() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
-
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED);
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedAttributeFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getAttributeFormDefault());
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
-
- //set attribute form default again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
- }
-
- public void testUpdateAttributeFormDefault() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
-
- //set the attribute form default value to QUALIFIED
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT,
- JAXB.XML_NS_FORM__QUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- //set the attribute form default value to UNQUALIFIED
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.setXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT,
- JAXB.XML_NS_FORM__UNQUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
-
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
- }
-
- public void testModifyElementFormDefault() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
-
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED);
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
-
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getElementFormDefault());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedElementFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getElementFormDefault());
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
-
- //set element form default again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
- }
-
- public void testUpdateElementFormDefault() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
-
- //set the element form default value to QUALIFIED
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ELEMENT_FORM_DEFAULT,
- JAXB.XML_NS_FORM__QUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
-
- //set the element form default value to UNQUALIFIED
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.setXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ELEMENT_FORM_DEFAULT,
- JAXB.XML_NS_FORM__UNQUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getElementFormDefault());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
-
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
- }
-
- public void testGetXmlNsPrefixes() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlNs> xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- assertFalse(xmlNsPrefixes.iterator().hasNext());
-
- //add 2 XmlNs prefixes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 0, "bar", "barPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 1, "foo", "fooPrefix");
- }
- });
-
- xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- ListIterator<XmlNs> xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- XmlNs xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
- }
-
- protected void addXmlNs(ModifiedDeclaration declaration, int index, String namespaceURI, String prefix) {
- NormalAnnotation arrayElement = this.newXmlNsAnnotation(declaration.getAst(), namespaceURI, prefix);
- this.addArrayElement(declaration, JAXB.XML_SCHEMA, index, JAXB.XML_SCHEMA__XMLNS, arrayElement);
- }
-
- protected NormalAnnotation newXmlNsAnnotation(AST ast, String namespaceURI, String prefix) {
- NormalAnnotation annotation = this.newNormalAnnotation(ast, JAXB.XML_NS);
- this.addMemberValuePair(annotation, JAXB.XML_NS__NAMESPACE_URI, namespaceURI);
- this.addMemberValuePair(annotation, JAXB.XML_NS__PREFIX, prefix);
- return annotation;
- }
-
- public void testGetXmlNsPrexiesSize() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(0, contextXmlSchema.getXmlNsPrefixesSize());
-
- //add 2 XmlNs prefixes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 0, "bar", "barPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 1, "foo", "fooPrefix");
- }
- });
- assertEquals(2, contextXmlSchema.getXmlNsPrefixesSize());
- }
-
- public void testAddXmlNsPrefix() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- XmlNs xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("bar");
- xmlNsPrefix.setPrefix("barPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("foo");
- xmlNsPrefix.setPrefix("fooPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("baz");
- xmlNsPrefix.setPrefix("bazPrefix");
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- ListIterator<XmlNsAnnotation> xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
-
- XmlNsAnnotation xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("baz", xmlNsAnnotation.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("foo", xmlNsAnnotation.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("bar", xmlNsAnnotation.getNamespaceURI());
- assertEquals("barPrefix", xmlNsAnnotation.getPrefix());
- assertFalse(xmlNsPrefixes.hasNext());
- }
-
- public void testAddXmlNsPrefix2() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- XmlNs xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("bar");
- xmlNsPrefix.setPrefix("barPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(1);
- xmlNsPrefix.setNamespaceURI("foo");
- xmlNsPrefix.setPrefix("fooPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("baz");
- xmlNsPrefix.setPrefix("bazPrefix");
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- ListIterator<XmlNsAnnotation> xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
-
- XmlNsAnnotation xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("baz", xmlNsAnnotation.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("bar", xmlNsAnnotation.getNamespaceURI());
- assertEquals("barPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("foo", xmlNsAnnotation.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsAnnotation.getPrefix());
- assertFalse(xmlNsPrefixes.hasNext());
- }
-
- public void testRemoveXmlNsPrefix() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextXmlSchema.addXmlNsPrefix(0).setNamespaceURI("bar");
- contextXmlSchema.addXmlNsPrefix(1).setNamespaceURI("foo");
- contextXmlSchema.addXmlNsPrefix(2).setNamespaceURI("baz");
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(3, schemaAnnotation.getXmlnsSize());
-
- contextXmlSchema.removeXmlNsPrefix(1);
-
- ListIterator<XmlNsAnnotation> xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("baz", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- contextXmlSchema.removeXmlNsPrefix(1);
- xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- contextXmlSchema.removeXmlNsPrefix(0);
- xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
- assertFalse(xmlNsPrefixes.hasNext());
- }
-
- public void testMoveXmlNsPrefix() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextXmlSchema.addXmlNsPrefix(0).setNamespaceURI("bar");
- contextXmlSchema.addXmlNsPrefix(1).setNamespaceURI("foo");
- contextXmlSchema.addXmlNsPrefix(2).setNamespaceURI("baz");
-
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
-
- assertEquals(3, schemaAnnotation.getXmlnsSize());
-
- contextXmlSchema.moveXmlNsPrefix(2, 0);
- ListIterator<XmlNs> xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes().iterator();
- assertEquals("foo", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("baz", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- ListIterator<XmlNsAnnotation> xmlNsAnnotations = schemaAnnotation.getXmlns().iterator();
- assertEquals("foo", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("baz", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("bar", xmlNsAnnotations.next().getNamespaceURI());
-
-
- contextXmlSchema.moveXmlNsPrefix(0, 1);
- xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes().iterator();
- assertEquals("baz", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("foo", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- xmlNsAnnotations = schemaAnnotation.getXmlns().iterator();
- assertEquals("baz", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("foo", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("bar", xmlNsAnnotations.next().getNamespaceURI());
- }
-
- public void testSyncXmlNsPrefixes() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlNs> xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- assertFalse(xmlNsPrefixes.iterator().hasNext());
-
- //add 3 XmlNs prefixes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 0, "bar", "barPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 1, "foo", "fooPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 2, "baz", "bazPrefix");
- }
- });
-
- xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- ListIterator<XmlNs> xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- XmlNs xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.moveXmlNsPrefix(declaration, 2, 0);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.moveXmlNsPrefix(declaration, 0, 1);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlNsPrefix(declaration, 1);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlNsPrefix(declaration, 1);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlNsPrefix(declaration, 0);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertFalse(xmlNsPrefixesIterator.hasNext());
- }
-
- protected void addXmlSchemaEnumMemberValuePair(ModifiedDeclaration declaration, String elementName, String value) {
- this.addEnumMemberValuePair((MarkerAnnotation) this.getXmlSchemaAnnotation(declaration), elementName, value);
- }
-
- protected void setXmlSchemaEnumMemberValuePair(ModifiedDeclaration declaration, String elementName, String enumValue) {
- this.setEnumMemberValuePair((NormalAnnotation) this.getXmlSchemaAnnotation(declaration), elementName, enumValue);
- }
-
- protected void addXmlSchemaMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlSchemaAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlSchema annotation. Only "annotated" packages are added to the context model
- protected void removeXmlSchemaAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_SCHEMA);
- }
-
- protected Annotation getXmlSchemaAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_SCHEMA);
- }
-
- protected void moveXmlNsPrefix(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) getXmlSchemaAnnotation(declaration), JAXB.XML_SCHEMA__XMLNS, targetIndex, sourceIndex);
- }
-
- protected void removeXmlNsPrefix(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) getXmlSchemaAnnotation(declaration), JAXB.XML_SCHEMA__XMLNS, index);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java
deleted file mode 100644
index 412482cabb..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-import org.eclipse.xsd.util.XSDUtil;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlSchemaTypeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithXmlSchemaType() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- public void testModifyName() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getName());
-
- contextXmlSchemaType.getQName().setSpecifiedName("foo");
- XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertEquals("foo", schemaTypeAnnotation.getName());
- assertEquals("foo", contextXmlSchemaType.getQName().getName());
-
- //verify the xml schema type annotation is not removed when the name is set to null
- contextXmlSchemaType.getQName().setSpecifiedName(null);
- schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(schemaTypeAnnotation.getName());
- assertNull(contextXmlSchemaType.getQName().getName());
- }
-
- public void testUpdateName() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getName());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__NAME, "foo");
- }
- });
- assertEquals("foo", contextXmlSchemaType.getQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.removeXmlSchemaTypeAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlSchemaTypes().iterator().hasNext());
- }
-
- public void testModifyNamespace() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getDefaultNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace());
-
- contextXmlSchemaType.getQName().setSpecifiedNamespace("foo");
- XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertEquals("foo", schemaTypeAnnotation.getNamespace());
- assertEquals("foo", contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextXmlSchemaType.getQName().getNamespace());
-
- //verify the xml schema type annotation is not removed when the namespace is set to null
- contextXmlSchemaType.getQName().setSpecifiedNamespace(null);
- schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(schemaTypeAnnotation.getNamespace());
- assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getDefaultNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextXmlSchemaType.getQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.removeXmlSchemaTypeAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlSchemaTypes().iterator().hasNext());
- }
-
- public void testModifyType() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getType());
-
- contextXmlSchemaType.setType("foo");
- XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertEquals("foo", schemaTypeAnnotation.getType());
- assertEquals("foo", contextXmlSchemaType.getType());
-
- //verify the xml schema type annotation is not removed when the type is set to null
- contextXmlSchemaType.setType(null);
- schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(schemaTypeAnnotation.getType());
- assertNull(contextXmlSchemaType.getType());
- }
-
- public void testUpdateType() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlSchemaType.getType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.removeXmlSchemaTypeAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlSchemaTypes().iterator().hasNext());
- }
-
- protected void addXmlSchemaTypeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlSchemaTypeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlSchemaTypeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlSchemaTypeAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlSchemaType annotation. Only "annotated" packages are added to the context model
- protected void removeXmlSchemaTypeAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE);
- }
-
- protected Annotation getXmlSchemaTypeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_SCHEMA_TYPE);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java
deleted file mode 100644
index 0ede8a964d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlSeeAlsoTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlSeeAlsoTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createAnnotatedPersistentClassWithXmlSeeAlso() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_SEE_ALSO);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType" + CR);
- sb.append("@XmlSeeAlso");
- }
- });
- }
-
- public void testModifyClasses() throws Exception {
- createAnnotatedPersistentClassWithXmlSeeAlso();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlSeeAlso contextXmlSeeAlso = classMapping.getXmlSeeAlso();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(0, contextXmlSeeAlso.getClassesSize());
-
- // add a class
- contextXmlSeeAlso.addClass(0, "foo");
- XmlSeeAlsoAnnotation annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(1, annotation.getClassesSize());
- assertTrue(CollectionTools.contains(annotation.getClasses(), "foo"));
- assertFalse(CollectionTools.contains(annotation.getClasses(), "bar"));
-
- // add another
- contextXmlSeeAlso.addClass(0, "bar");
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(2, annotation.getClassesSize());
- assertTrue(CollectionTools.contains(annotation.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(annotation.getClasses(), "bar"));
-
- // remove one
- contextXmlSeeAlso.removeClass(1);
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(1, annotation.getClassesSize());
- assertFalse(CollectionTools.contains(annotation.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(annotation.getClasses(), "bar"));
-
- // remove the other
- contextXmlSeeAlso.removeClass(0);
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(0, annotation.getClassesSize());
- assertFalse(CollectionTools.contains(annotation.getClasses(), "bar"));
- assertFalse(CollectionTools.contains(annotation.getClasses(), "foo"));
- }
-
- public void testUpdateClasses() throws Exception {
- createAnnotatedPersistentClassWithXmlSeeAlso();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlSeeAlso contextXmlSeeAlso = classMapping.getXmlSeeAlso();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
- AnnotatedElement annotatedElement = annotatedElement(resourceType);
-
- assertEquals(0, contextXmlSeeAlso.getClassesSize());
-
- // add a class
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.addClass(declaration, 0, "foo");
- }
- });
- assertEquals(1, contextXmlSeeAlso.getClassesSize());
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
-
- // add another
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.addClass(declaration, 0, "bar");
- }
- });
- assertEquals(2, contextXmlSeeAlso.getClassesSize());
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
-
- // remove one
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.removeClass(declaration, 1);
- }
- });
- assertEquals(1, contextXmlSeeAlso.getClassesSize());
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
-
- // remove the other
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.removeClass(declaration, 0);
- }
- });
- assertEquals(0, contextXmlSeeAlso.getClassesSize());
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- }
-
- protected void addClass(ModifiedDeclaration declaration, int index, String clazz) {
- addArrayElement(declaration, JAXB.XML_SEE_ALSO, index, JAXB.XML_SEE_ALSO__VALUE, newTypeLiteral(declaration.getAst(), clazz));
- }
-
- protected void removeClass(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) getXmlSeeAlsoAnnotation(declaration), JAXB.XML_SEE_ALSO__VALUE, index);
- }
-
- protected Annotation getXmlSeeAlsoAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_SEE_ALSO);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java
deleted file mode 100644
index 222f7c39cc..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlValueMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlValueMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlValue");
- }
- });
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClassMapping classMapping = ((JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlValueMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY);
- xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- assertNotNull(xmlValueMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY);
- xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- assertNotNull(xmlValueMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClassMapping classMapping = ((JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
- xmlValueMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- xmlValueMapping.removeXmlJavaTypeAdapter();
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClassMapping classMapping = ((JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
-
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNotNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertNotNull(xmlJavaTypeAdapterAnnotation);
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
- xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertNull(xmlJavaTypeAdapterAnnotation);
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java
deleted file mode 100644
index 5ff192e9f1..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JaxbCoreJavaContextModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreJavaContextModelTests.class.getName());
- suite.addTestSuite(GenericJavaElementFactoryMethodTests.class);
- suite.addTestSuite(GenericJavaEnumConstantTests.class);
- suite.addTestSuite(GenericJavaPackageInfoTests.class);
- suite.addTestSuite(GenericJavaPersistentAttributeTests.class);
- suite.addTestSuite(GenericJavaClassMappingTests.class);
- suite.addTestSuite(GenericJavaEnumMappingTests.class);
- suite.addTestSuite(GenericJavaRegistryTests.class);
- suite.addTestSuite(GenericJavaXmlAdapterTests.class);
- suite.addTestSuite(GenericJavaXmlAnyAttributeMappingTests.class);
- suite.addTestSuite(GenericJavaXmlAnyElementMappingTests.class);
- suite.addTestSuite(GenericJavaXmlAttributeMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementRefMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementRefsMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementsMappingTests.class);
- suite.addTestSuite(GenericJavaPackageXmlJavaTypeAdapterTests.class);
- suite.addTestSuite(GenericJavaTypeXmlJavaTypeAdapterTests.class);
- suite.addTestSuite(GenericJavaAttributeXmlJavaTypeAdapterTests.class);
- suite.addTestSuite(GenericJavaXmlRootElementTests.class);
- suite.addTestSuite(GenericJavaXmlSchemaTests.class);
- suite.addTestSuite(GenericJavaXmlSchemaTypeTests.class);
- suite.addTestSuite(GenericJavaXmlSeeAlsoTests.class);
- suite.addTestSuite(GenericJavaXmlValueMappingTests.class);
- return suite;
- }
-
-
- private JaxbCoreJavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java
deleted file mode 100644
index f40d96cb14..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.synchronizers.CallbackSynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.internal.synchronizers.SynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * This builds and holds a "JAXB" project.
- * Support for adding packages and types.
- *
- * The JPA project's settings (platform, database connection, etc.) can be
- * controlled by building a data model and passing it into the constructor.
- */
-public class TestJaxbProject
- extends TestJavaProject {
-
- private final JaxbProject jaxbProject;
-
-
- // ********** builders **********
-
- public static TestJaxbProject buildJaxbProject(
- String baseProjectName, boolean autoBuild, IDataModel config)
- throws CoreException {
- return new TestJaxbProject(baseProjectName, autoBuild, config);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestJaxbProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJaxbProject(String projectName, boolean autoBuild) throws CoreException {
- this(projectName, autoBuild, null);
- }
-
- public TestJaxbProject(String projectName, boolean autoBuild, IDataModel config) throws CoreException {
- super(projectName, autoBuild);
- String jaxbFacetVersion =
- ((IProjectFacetVersion) config.getProperty(IFacetDataModelProperties.FACET_VERSION)).getVersionString();
- this.installFacet(JaxbFacet.ID, jaxbFacetVersion, config);
- this.jaxbProject = JptJaxbCorePlugin.getJaxbProject(this.getProject());
- this.jaxbProject.setContextModelSynchronizer(this.buildSynchronousContextModelSynchronizer());
- this.jaxbProject.setUpdateSynchronizer(this.buildSynchronousUpdateSynchronizer());
- }
-
- protected Synchronizer buildSynchronousContextModelSynchronizer() {
- return new SynchronousSynchronizer(this.buildSynchronousContextModelSynchronizerCommand());
- }
-
- protected Command buildSynchronousContextModelSynchronizerCommand() {
- return new SynchronousContextModelSynchronizerCommand();
- }
-
- protected class SynchronousContextModelSynchronizerCommand implements Command {
- public void execute() {
- TestJaxbProject.this.jaxbProject.synchronizeContextModel(new NullProgressMonitor());
- }
- }
-
- protected CallbackSynchronizer buildSynchronousUpdateSynchronizer() {
- return new CallbackSynchronousSynchronizer(this.buildSynchronousUpdateSynchronizerCommand());
- }
-
- protected Command buildSynchronousUpdateSynchronizerCommand() {
- return new SynchronousUpdateSynchronizerCommand();
- }
-
- protected class SynchronousUpdateSynchronizerCommand implements Command {
- public void execute() {
- TestJaxbProject.this.jaxbProject.update(new NullProgressMonitor());
- }
- }
-
-
- // ********** public methods **********
-
- public JaxbProject getJaxbProject() {
- return this.jaxbProject;
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
deleted file mode 100644
index 123ed57146..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.core.tests.internal.resource.java.JaxbJavaResourceModelTests;
-
-
-public class JaxbCoreResourceModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreResourceModelTests.class.getName());
-
- suite.addTestSuite(JaxbIndexResourceTests.class);
- suite.addTestSuite(JaxbPropertiesResourceTests.class);
- suite.addTest(JaxbJavaResourceModelTests.suite());
- return suite;
- }
-
- private JaxbCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java
deleted file mode 100644
index e066113983..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex.JaxbIndexResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-
-public class JaxbIndexResourceTests
- extends AnnotationTestCase {
-
- private static String JAXB_INDEX = "jaxb.index";
-
-
- public JaxbIndexResourceTests(String name) {
- super(name);
- }
-
-
- private IFile createJaxbIndex(IPath projectRelativePath, String... classNames) throws Exception {
- IFolder folder = getJavaProject().getProject().getFolder(projectRelativePath);
- if (! folder.exists()) {
- folder.create(true, false, null);
- }
- IFile jaxbIndex = getJavaProject().getProject().getFile(projectRelativePath.append(new Path(JAXB_INDEX)));
- InputStream stream = inputStream(classNames);
- jaxbIndex.create(stream, true, null);
- return jaxbIndex;
- }
-
- private void setClassNames(IFile jaxbIndex, String... classNames) throws Exception {
- jaxbIndex.setContents(inputStream(classNames), true, false, null);
- }
-
- private InputStream inputStream(String... classNames) {
- StringBuffer sb = new StringBuffer();
- for (String className : classNames) {
- sb.append(className + CR);
- }
- return new ByteArrayInputStream(sb.toString().getBytes());
- }
-
- public void testUpdateClasses() throws Exception {
- IFile jaxbIndex = createJaxbIndex(new Path("src/test"), "foo", "bar");
- JaxbIndexResource resource = JaxbIndexResourceModelProvider.instance().buildResourceModel(jaxbIndex);
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"test.foo", "test.bar"})));
-
- setClassNames(jaxbIndex, "foo", "bar", "baz");
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"test.foo", "test.bar", "test.baz"})));
-
- setClassNames(jaxbIndex);
-
- assertTrue(CollectionTools.isEmpty(resource.getFullyQualifiedClassNames()));
-
- jaxbIndex = createJaxbIndex(new Path("src"), "foo", "bar");
- resource = JaxbIndexResourceModelProvider.instance().buildResourceModel(jaxbIndex);
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"foo", "bar"})));
-
- setClassNames(jaxbIndex, "foo", "bar", "baz");
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"foo", "bar", "baz"})));
-
- setClassNames(jaxbIndex);
-
- assertTrue(CollectionTools.isEmpty(resource.getFullyQualifiedClassNames()));
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java
deleted file mode 100644
index bc0684fc7a..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops.JaxbPropertiesResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-
-public class JaxbPropertiesResourceTests
- extends AnnotationTestCase {
-
- private static String JAXB_PROPERTIES = "jaxb.properties";
-
-
- public JaxbPropertiesResourceTests(String name) {
- super(name);
- }
-
-
- private IFile createJaxbProperties(IPath projectRelativePath, String[] ... propertyValuePairs) throws Exception {
- IFolder folder = getJavaProject().getProject().getFolder(projectRelativePath);
- if (! folder.exists()) {
- folder.create(true, false, null);
- }
- IFile jaxbProperties = getJavaProject().getProject().getFile(projectRelativePath.append(new Path(JAXB_PROPERTIES)));
- InputStream stream = inputStream(propertyValuePairs);
- jaxbProperties.create(stream, true, null);
- return jaxbProperties;
- }
-
- private void setProperties(IFile jaxbProperties, String[] ... propertyValuePairs) throws Exception {
- jaxbProperties.setContents(inputStream(propertyValuePairs), true, false, null);
- }
-
- private InputStream inputStream(String[] ... propertyValuePairs) {
- StringBuffer sb = new StringBuffer();
- for (String[] propertyValuePair : propertyValuePairs) {
- sb.append(propertyValuePair[0] + "=" + propertyValuePair[1] + CR);
- }
- return new ByteArrayInputStream(sb.toString().getBytes());
- }
-
- public void testUpdateProperties() throws Exception {
- IFile jaxbProperties = createJaxbProperties(new Path("src/test"), new String[] {"foo", "fooProp"}, new String[] {"bar", "barProp"});
- JaxbPropertiesResource resource = JaxbPropertiesResourceModelProvider.instance().buildResourceModel(jaxbProperties);
-
- assertEquals(resource.getProperty("foo"), "fooProp");
- assertEquals(resource.getProperty("bar"), "barProp");
-
- setProperties(jaxbProperties, new String[] {"foo", "fooProp2"}, new String[] {"baz", "bazProp"});
-
- assertEquals(resource.getProperty("foo"), "fooProp2");
- assertNull(resource.getProperty("bar"));
- assertEquals(resource.getProperty("baz"), "bazProp");
-
- setProperties(jaxbProperties);
-
- assertNull(resource.getProperty("foo"));
- assertNull(resource.getProperty("bar"));
- assertNull(resource.getProperty("baz"));
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java
deleted file mode 100644
index b75e22c6e5..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.tests.internal.resource.java.JavaResourceModelTestCase;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinition;
-
-public class JaxbJavaResourceModelTestCase
- extends JavaResourceModelTestCase {
-
- public JaxbJavaResourceModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return GenericJaxb_2_1_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return GenericJaxb_2_1_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java
deleted file mode 100644
index e3864f284e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JaxbJavaResourceModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbJavaResourceModelTests.class.getName());
- suite.addTestSuite(XmlAccessorOrderPackageAnnotationTests.class);
- suite.addTestSuite(XmlAccessorOrderTypeAnnotationTests.class);
- suite.addTestSuite(XmlAccessorTypePackageAnnotationTests.class);
- suite.addTestSuite(XmlAccessorTypeTypeAnnotationTests.class);
- suite.addTestSuite(XmlAnyAttributeAnnotationTests.class);
- suite.addTestSuite(XmlAnyElementAnnotationTests.class);
- suite.addTestSuite(XmlAttachmentRefAnnotationTests.class);
- suite.addTestSuite(XmlAttributeAnnotationTests.class);
- suite.addTestSuite(XmlElementAnnotationTests.class);
- suite.addTestSuite(XmlElementDeclAnnotationTests.class);
- suite.addTestSuite(XmlElementRefAnnotationTests.class);
- suite.addTestSuite(XmlElementRefsAnnotationTests.class);
- suite.addTestSuite(XmlElementsAnnotationTests.class);
- suite.addTestSuite(XmlElementWrapperAnnotationTests.class);
- suite.addTestSuite(XmlEnumAnnotationTests.class);
- suite.addTestSuite(XmlEnumValueAnnotationTests.class);
- suite.addTestSuite(XmlIDAnnotationTests.class);
- suite.addTestSuite(XmlIDREFAnnotationTests.class);
- suite.addTestSuite(XmlInlineBinaryDataAttributeAnnotationTests.class);
- suite.addTestSuite(XmlInlineBinaryDataTypeAnnotationTests.class);
- suite.addTestSuite(XmlJavaTypeAdapterPackageAnnotationTests.class);
- suite.addTestSuite(XmlJavaTypeAdapterTypeAnnotationTests.class);
- suite.addTestSuite(XmlListAnnotationTests.class);
- suite.addTestSuite(XmlMimeTypeAnnotationTests.class);
- suite.addTestSuite(XmlMixedAnnotationTests.class);
- suite.addTestSuite(XmlRegistryAnnotationTests.class);
- suite.addTestSuite(XmlRootElementAnnotationTests.class);
- suite.addTestSuite(XmlSchemaAnnotationTests.class);
- suite.addTestSuite(XmlSchemaTypeAttributeAnnotationTests.class);
- suite.addTestSuite(XmlSchemaTypePackageAnnotationTests.class);
- suite.addTestSuite(XmlSeeAlsoAnnotationTests.class);
- suite.addTestSuite(XmlTransientAttributeAnnotationTests.class);
- suite.addTestSuite(XmlTransientTypeAnnotationTests.class);
- suite.addTestSuite(XmlTypeAnnotationTests.class);
- suite.addTestSuite(XmlValueAnnotationTests.class);
-
- return suite;
- }
-
- private JaxbJavaResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java
deleted file mode 100644
index 32cb73c062..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorOrderPackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorOrderPackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithAccessorOrder() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorOrder(XmlAccessOrder.UNDEFINED)",
- JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
-
- public void testValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithAccessorOrder();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlAccessorOrderAnnotation annotation =
- (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNotNull(annotation);
- assertEquals(XmlAccessOrder.UNDEFINED, annotation.getValue());
-
- annotation.setValue(XmlAccessOrder.ALPHABETICAL);
- assertEquals(XmlAccessOrder.ALPHABETICAL, annotation.getValue());
- assertSourceContains("@XmlAccessorOrder(ALPHABETICAL)", cu);
-
- annotation.setValue(null);
- annotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNull(annotation.getValue());
- assertSourceDoesNotContain("@XmlAccessorOrder(", cu);
-
-// TODO uncomment when bug 328400 is addressed
-// annotation = (XmlAccessorOrderAnnotation) packageResource.addAnnotation(JAXB.XML_ACCESSOR_ORDER);
-// annotation.setValue(XmlAccessOrder.UNDEFINED);
-// assertEquals(XmlAccessOrder.UNDEFINED, annotation.getValue());
-// assertSourceContains("@XmlAccessorOrder(UNDEFINED)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java
deleted file mode 100644
index 1518c916ef..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorOrderTypeAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorOrderTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAccessorOrder() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_ORDER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorOrder");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAccessorOrderWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertTrue(xmlAccessorOrderAnnotation != null);
- assertNull(xmlAccessorOrderAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrderWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(XmlAccessOrder.ALPHABETICAL, xmlAccessorOrderAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(null, xmlAccessorOrderAnnotation.getValue());
-
- xmlAccessorOrderAnnotation.setValue(XmlAccessOrder.UNDEFINED);
- assertEquals(XmlAccessOrder.UNDEFINED, xmlAccessorOrderAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorOrder(UNDEFINED)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrderWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(XmlAccessOrder.ALPHABETICAL, xmlAccessorOrderAnnotation.getValue());
-
- xmlAccessorOrderAnnotation.setValue(null);
- assertNull(xmlAccessorOrderAnnotation.getValue());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java
deleted file mode 100644
index fc3e737548..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorTypePackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorTypePackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- public void testValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithAccessorType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlAccessorTypeAnnotation annotation =
- (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertTrue(annotation != null);
- assertEquals(XmlAccessType.PROPERTY, annotation.getValue());
-
- annotation.setValue(XmlAccessType.FIELD);
- assertEquals(XmlAccessType.FIELD, annotation.getValue());
- assertSourceContains("@XmlAccessorType(value = FIELD)", cu);
-
- annotation.setValue(XmlAccessType.NONE);
- assertEquals(XmlAccessType.NONE, annotation.getValue());
- assertSourceContains("@XmlAccessorType(value = NONE)", cu);
-
- annotation.setValue(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(XmlAccessType.PUBLIC_MEMBER, annotation.getValue());
- assertSourceContains("@XmlAccessorType(value = PUBLIC_MEMBER)", cu);
-
- annotation.setValue(null);
- assertSourceDoesNotContain("@XmlAccessorType(", cu);
-
-// TODO uncomment when bug 328400 is addressed
-// annotation = (XmlAccessorTypeAnnotation) packageResource.addAnnotation(JAXB.XML_ACCESSOR_TYPE);
-// annotation.setValue(XmlAccessType.PROPERTY);
-// assertEquals(XmlAccessType.PROPERTY, annotation.getValue());
-// assertSourceContains("@XmlAccessorType(PROPERTY)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java
deleted file mode 100644
index 4c7c4f32b7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorTypeTypeAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorTypeTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAccessorType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorType");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAccessorTypeWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorType(value = XmlAccessType.FIELD)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertTrue(xmlAccessorTypeAnnotation != null);
- assertNull(xmlAccessorTypeAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorTypeWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(XmlAccessType.FIELD, xmlAccessorTypeAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(null, xmlAccessorTypeAnnotation.getValue());
-
- xmlAccessorTypeAnnotation.setValue(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(XmlAccessType.PUBLIC_MEMBER, xmlAccessorTypeAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorType(PUBLIC_MEMBER)", cu);
-
- xmlAccessorTypeAnnotation.setValue(XmlAccessType.PROPERTY);
- assertEquals(XmlAccessType.PROPERTY, xmlAccessorTypeAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorType(PROPERTY)", cu);
-
- xmlAccessorTypeAnnotation.setValue(XmlAccessType.NONE);
- assertEquals(XmlAccessType.NONE, xmlAccessorTypeAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorType(NONE)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorTypeWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(XmlAccessType.FIELD, xmlAccessorTypeAnnotation.getValue());
-
- xmlAccessorTypeAnnotation.setValue(null);
- assertNull(xmlAccessorTypeAnnotation.getValue());
-
- assertSourceDoesNotContain("@XmlAccessorType(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java
deleted file mode 100644
index 1758e19fb9..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAnyAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlAnyAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAnyAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyAttribute");
- }
- });
- }
-
- public void testGetXmlAnyAttribute() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyAttributeAnnotation xmlAnyAttributeAnnotation = (XmlAnyAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE);
- assertTrue(xmlAnyAttributeAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_ANY_ATTRIBUTE);
- assertSourceDoesNotContain("@XmlAnyAttribute", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java
deleted file mode 100644
index 3ae8713f60..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAnyElementAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ANY_ELEMENT_VALUE = "String";
-
- public XmlAnyElementAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAnyElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAnyElementWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAnyElementWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement(value = " + XML_ANY_ELEMENT_VALUE + ".class)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertTrue(xmlAnyElementAnnotation != null);
- assertNull(xmlAnyElementAnnotation.getLax());
- assertNull(xmlAnyElementAnnotation.getValue());
- }
-
- public void testGetLax() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElementWithBooleanElement("lax");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
-
- assertEquals(Boolean.TRUE, xmlAnyElementAnnotation.getLax());
- }
-
- public void testSetLax() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
-
- assertNotNull(xmlAnyElementAnnotation);
- assertNull(xmlAnyElementAnnotation.getLax());
-
- xmlAnyElementAnnotation.setLax(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlAnyElementAnnotation.getLax());
-
- assertSourceContains("@XmlAnyElement(lax = false)", cu);
-
- xmlAnyElementAnnotation.setLax(null);
- assertSourceContains("@XmlAnyElement", cu);
- assertSourceDoesNotContain("lax", cu);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElementWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertTrue(xmlAnyElementAnnotation != null);
- assertEquals(XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getValue());
- assertEquals("java.lang." + XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getFullyQualifiedValueClassName());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertNull(xmlAnyElementAnnotation.getValue());
- xmlAnyElementAnnotation.setValue(XML_ANY_ELEMENT_VALUE);
- assertEquals(XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getValue());
-
- assertSourceContains("@XmlAnyElement(" + XML_ANY_ELEMENT_VALUE + ".class)", cu);
-
- xmlAnyElementAnnotation.setValue(null);
- assertNull(xmlAnyElementAnnotation.getValue());
-
- assertSourceContains("@XmlAnyElement", cu);
- assertSourceDoesNotContain("@XmlAnyElement(value = " + XML_ANY_ELEMENT_VALUE + ".class)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java
deleted file mode 100644
index 9f10d0714c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAttachmentRefAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlAttachmentRefAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAttachmentRef() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTACHMENT_REF);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttachmentRef");
- }
- });
- }
-
- public void testGetXmlAttachmentRef() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttachmentRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertTrue(xmlAttachmentRefAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertSourceDoesNotContain("@XmlAttachmentRef", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java
deleted file mode 100644
index d2527290f6..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ATTRIBUTE_NAME = "elementName";
- private static final String XML_ATTRIBUTE_NAMESPACE = "XmlAttributeNamespace";
-
- public XmlAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithName() throws Exception {
- return this.createTestXmlAttributeWithStringElement("name", XML_ATTRIBUTE_NAME);
- }
-
- private ICompilationUnit createTestXmlAttributeWithNamespace() throws Exception {
- return this.createTestXmlAttributeWithStringElement("namespace", XML_ATTRIBUTE_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlAttributeWithStringElement(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertTrue(xmlAttributeAnnotation != null);
- assertEquals(XML_ATTRIBUTE_NAME, xmlAttributeAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertTrue(xmlAttributeAnnotation != null);
- assertNull(xmlAttributeAnnotation.getName());
- assertNull(xmlAttributeAnnotation.getNamespace());
- assertNull(xmlAttributeAnnotation.getRequired());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getName());
- xmlAttributeAnnotation.setName(XML_ATTRIBUTE_NAME);
- assertEquals(XML_ATTRIBUTE_NAME, xmlAttributeAnnotation.getName());
-
- assertSourceContains("@XmlAttribute(name = \"" + XML_ATTRIBUTE_NAME + "\")", cu);
-
- xmlAttributeAnnotation.setName(null);
- assertNull(xmlAttributeAnnotation.getName());
-
- assertSourceContains("@XmlAttribute", cu);
- assertSourceDoesNotContain("@XmlAttribute(name = \"" + XML_ATTRIBUTE_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertTrue(xmlAttributeAnnotation != null);
- assertEquals(XML_ATTRIBUTE_NAMESPACE, xmlAttributeAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getNamespace());
- xmlAttributeAnnotation.setNamespace(XML_ATTRIBUTE_NAMESPACE);
- assertEquals(XML_ATTRIBUTE_NAMESPACE, xmlAttributeAnnotation.getNamespace());
-
- assertSourceContains("@XmlAttribute(namespace = \"" + XML_ATTRIBUTE_NAMESPACE + "\")", cu);
-
- xmlAttributeAnnotation.setNamespace(null);
- assertNull(xmlAttributeAnnotation.getNamespace());
-
- assertSourceContains("@XmlAttribute", cu);
- assertSourceDoesNotContain("@XmlAttribute(namespace = \"" + XML_ATTRIBUTE_NAMESPACE + "\")", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
-
- assertEquals(Boolean.TRUE, xmlAttributeAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
-
- assertNotNull(xmlAttributeAnnotation);
- assertNull(xmlAttributeAnnotation.getRequired());
-
- xmlAttributeAnnotation.setRequired(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlAttributeAnnotation.getRequired());
-
- assertSourceContains("@XmlAttribute(required = false)", cu);
-
- xmlAttributeAnnotation.setRequired(null);
- assertSourceContains("@XmlAttribute", cu);
- assertSourceDoesNotContain("required", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java
deleted file mode 100644
index 12589383e8..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_NAME = "elementName";
- private static final String XML_ELEMENT_NAMESPACE = "XmlElementNamespace";
- private static final String XML_ELEMENT_DEFAULT_VALUE = "myDefaultValue";
- private static final String XML_ELEMENT_TYPE = "String";
-
-
- public XmlElementAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElement() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithName() throws Exception {
- return this.createTestXmlElementWithStringElement("name", XML_ELEMENT_NAME);
- }
-
- private ICompilationUnit createTestXmlElementWithNamespace() throws Exception {
- return this.createTestXmlElementWithStringElement("namespace", XML_ELEMENT_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementWithDefaultValue() throws Exception {
- return this.createTestXmlElementWithStringElement("defaultValue", XML_ELEMENT_DEFAULT_VALUE);
- }
-
- private ICompilationUnit createTestXmlElementWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithBooleanElement(final String booleanElement) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class)");
- }
- });
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElementAnnotation.getNamespace());
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertNull(xmlElementAnnotation.getNillable());
- assertNull(xmlElementAnnotation.getRequired());
- assertNull(xmlElementAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getName());
-
- xmlElementAnnotation.setName(XML_ELEMENT_NAME);
-
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
-
- xmlElementAnnotation.setName(null);
-
- assertNull(xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getNamespace());
-
- xmlElementAnnotation.setNamespace(XML_ELEMENT_NAMESPACE);
-
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
-
- xmlElementAnnotation.setNamespace(null);
-
- assertNull(xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
- }
-
- public void testGetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithDefaultValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- }
-
- public void testSetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
-
- xmlElementAnnotation.setDefaultValue(XML_ELEMENT_DEFAULT_VALUE);
-
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
-
- xmlElementAnnotation.setDefaultValue(null);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
- }
-
- public void testGetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("nillable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable());
- }
-
- public void testSetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getNillable());
-
- xmlElementAnnotation.setNillable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getNillable());
- assertSourceContains("@XmlElement(nillable = false)", cu);
-
- xmlElementAnnotation.setNillable(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("nillable", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getRequired());
-
- xmlElementAnnotation.setRequired(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getRequired());
- assertSourceContains("@XmlElement(required = false)", cu);
-
- xmlElementAnnotation.setRequired(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("required", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_TYPE, xmlElementAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getType());
-
- xmlElementAnnotation.setType(XML_ELEMENT_TYPE);
-
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
-
- xmlElementAnnotation.setType(null);
-
- assertNull(xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java
deleted file mode 100644
index a782a0b072..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_DECL_NAME = "elementName";
- private static final String XML_ELEMENT_DECL_NAMESPACE = "XmlElementDeclNamespace";
- private static final String XML_ELEMENT_DECL_DEFAULT_VALUE = "myDefaultValue";
- private static final String XML_ELEMENT_DECL_SCOPE = "XmlElementDecl.GLOBAL";
-
- public XmlElementDeclAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlElementDecl() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_DECL);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementDeclWithName() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("name", XML_ELEMENT_DECL_NAME);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithNamespace() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("namespace", XML_ELEMENT_DECL_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithDefaultValue() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("defaultValue", XML_ELEMENT_DECL_DEFAULT_VALUE);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithSubstitutionHeadName() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("substitutionHeadName", XML_ELEMENT_DECL_NAME);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithSubstitutionHeadNamespace() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("substitutionHeadNamespace", XML_ELEMENT_DECL_NAME);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithStringElementDecl(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_DECL);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementDeclWithScope() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_DECL);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl(scope = " + XML_ELEMENT_DECL_SCOPE + ".class)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertNull(xmlElementDeclAnnotation.getName());
- assertNull(xmlElementDeclAnnotation.getNamespace());
- assertNull(xmlElementDeclAnnotation.getDefaultValue());
- assertNull(xmlElementDeclAnnotation.getScope());
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadName());
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getName());
- xmlElementDeclAnnotation.setName(XML_ELEMENT_DECL_NAME);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getName());
-
- assertSourceContains("@XmlElementDecl(name = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
-
- xmlElementDeclAnnotation.setName(null);
- assertNull(xmlElementDeclAnnotation.getName());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(name = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAMESPACE, xmlElementDeclAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getNamespace());
- xmlElementDeclAnnotation.setNamespace(XML_ELEMENT_DECL_NAMESPACE);
- assertEquals(XML_ELEMENT_DECL_NAMESPACE, xmlElementDeclAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementDecl(namespace = \"" + XML_ELEMENT_DECL_NAMESPACE + "\")", cu);
-
- xmlElementDeclAnnotation.setNamespace(null);
- assertNull(xmlElementDeclAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(namespace = \"" + XML_ELEMENT_DECL_NAMESPACE + "\")", cu);
- }
-
- public void testGetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithDefaultValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_DEFAULT_VALUE, xmlElementDeclAnnotation.getDefaultValue());
- }
-
- public void testSetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getDefaultValue());
- xmlElementDeclAnnotation.setDefaultValue(XML_ELEMENT_DECL_DEFAULT_VALUE);
- assertEquals(XML_ELEMENT_DECL_DEFAULT_VALUE, xmlElementDeclAnnotation.getDefaultValue());
-
- assertSourceContains("@XmlElementDecl(defaultValue = \"" + XML_ELEMENT_DECL_DEFAULT_VALUE + "\")", cu);
-
- xmlElementDeclAnnotation.setDefaultValue(null);
- assertNull(xmlElementDeclAnnotation.getDefaultValue());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(defaultValue = \"" + XML_ELEMENT_DECL_DEFAULT_VALUE + "\")", cu);
- }
-
- public void testGetScope() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithScope();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getScope());
- assertEquals("javax.xml.bind.annotation." + XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getFullyQualifiedScopeClassName());
- }
-
- public void testSetScope() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getScope());
- xmlElementDeclAnnotation.setScope(XML_ELEMENT_DECL_SCOPE);
- assertEquals(XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getScope());
-
- assertSourceContains("@XmlElementDecl(scope = " + XML_ELEMENT_DECL_SCOPE + ".class", cu);
-
- xmlElementDeclAnnotation.setScope(null);
- assertNull(xmlElementDeclAnnotation.getScope());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(scope = " + XML_ELEMENT_DECL_SCOPE + ".class", cu);
- }
-
- public void testGetSubstitutionHeadName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithSubstitutionHeadName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadName());
- }
-
- public void testSetSubstitutionHeadName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadName());
- xmlElementDeclAnnotation.setSubstitutionHeadName(XML_ELEMENT_DECL_NAME);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadName());
-
- assertSourceContains("@XmlElementDecl(substitutionHeadName = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
-
- xmlElementDeclAnnotation.setSubstitutionHeadName(null);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadName());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(substitutionHeadName = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
- }
-
- public void testGetSubstitutionHeadNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithSubstitutionHeadNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
- }
-
- public void testSetSubstitutionHeadNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
- xmlElementDeclAnnotation.setSubstitutionHeadNamespace(XML_ELEMENT_DECL_NAME);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
-
- assertSourceContains("@XmlElementDecl(substitutionHeadNamespace = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
-
- xmlElementDeclAnnotation.setSubstitutionHeadNamespace(null);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(substitutionHeadNamespace = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java
deleted file mode 100644
index 18eb4da02f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementRefAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_REF_NAME = "elementName";
- private static final String XML_ELEMENT_REF_NAMESPACE = "XmlElementRefNamespace";
- private static final String XML_ELEMENT_REF_TYPE = "String";
-
-
- public XmlElementRefAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElementRef() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithName() throws Exception {
- return this.createTestXmlElementRefWithStringElement("name", XML_ELEMENT_REF_NAME);
- }
-
- private ICompilationUnit createTestXmlElementRefWithNamespace() throws Exception {
- return this.createTestXmlElementRefWithStringElement("namespace", XML_ELEMENT_REF_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementRefWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithBooleanElement(final String booleanElement) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertNull(xmlElementRefAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefAnnotation.getName());
-
- xmlElementRefAnnotation.setName(XML_ELEMENT_REF_NAME);
-
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
- assertSourceContains("@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\")", cu);
-
- xmlElementRefAnnotation.setName(null);
-
- assertNull(xmlElementRefAnnotation.getName());
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
-
- xmlElementRefAnnotation.setNamespace(XML_ELEMENT_REF_NAMESPACE);
-
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRef(namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\")", cu);
-
- xmlElementRefAnnotation.setNamespace(null);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("@XmlElementRef(namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\")", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertEquals(Boolean.TRUE, xmlElementRefAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNotNull(xmlElementRefAnnotation);
- assertNull(xmlElementRefAnnotation.getRequired());
-
- xmlElementRefAnnotation.setRequired(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementRefAnnotation.getRequired());
- assertSourceContains("@XmlElementRef(required = false)", cu);
-
- xmlElementRefAnnotation.setRequired(null);
-
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("required", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefAnnotation.getType());
-
- xmlElementRefAnnotation.setType(XML_ELEMENT_REF_TYPE);
-
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class", cu);
-
- xmlElementRefAnnotation.setType(null);
-
- assertNull(xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java
deleted file mode 100644
index 835c30641e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-
-public class XmlElementRefsAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_REF_NAME = "elementName";
- private static final String XML_ELEMENT_REF_NAMESPACE = "XmlElementRefNamespace";
- private static final String XML_ELEMENT_REF_TYPE = "String";
-
-
- public XmlElementRefsAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElementRef() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithName() throws Exception {
- return this.createTestXmlElementRefWithStringElement("name", XML_ELEMENT_REF_NAME);
- }
-
- private ICompilationUnit createTestXmlElementRefWithNamespace() throws Exception {
- return this.createTestXmlElementRefWithStringElement("namespace", XML_ELEMENT_REF_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementRefWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef(" + element + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithAll() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\", type = " + XML_ELEMENT_REF_TYPE + ".class))");
- }
- });
- }
-
-
- private XmlElementRefAnnotation getXmlElementRefAnnotation(JavaResourceAttribute resourceAttribute) {
- XmlElementRefsAnnotation refsAnnotation
- = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- return refsAnnotation.xmlElementRefAt(0);
- }
-
- private XmlElementRefAnnotation addXmlElementRefAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementRefsAnnotation refsAnnotation
- = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- return refsAnnotation.addXmlElementRef(index);
- }
-
- private void removeXmlElementRefAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementRefsAnnotation refsAnnotation
- = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- refsAnnotation.removeXmlElementRef(index);
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertNull(xmlElementRefAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertNull(xmlElementRefAnnotation.getName());
-
- xmlElementRefAnnotation.setName(XML_ELEMENT_REF_NAME);
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
-
- assertSourceContains("@XmlElementRefs(@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\"))", cu);
-
- xmlElementRefAnnotation.setName(null);
- assertNull(xmlElementRefAnnotation.getName());
-
- assertSourceContains("@XmlElementRefs(@XmlElementRef)", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
-
- xmlElementRefAnnotation.setNamespace(XML_ELEMENT_REF_NAMESPACE);
-
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRefs(@XmlElementRef(namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\"))", cu);
-
- xmlElementRefAnnotation.setNamespace(null);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRefs(@XmlElementRef)", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertNull(xmlElementRefAnnotation.getType());
-
- xmlElementRefAnnotation.setType(XML_ELEMENT_REF_TYPE);
-
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRefs(@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class))", cu);
-
- xmlElementRefAnnotation.setType(null);
-
- assertNull(xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRefs(@XmlElementRef)", cu);
- }
-
- public void testAddXmlElementRef() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithAll();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementRefAnnotation(1, resourceAttribute);
- XmlElementRefsAnnotation refsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class),@XmlElementRef})", cu);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNotNull(refsAnnotation);
- assertEquals(2, refsAnnotation.getXmlElementRefsSize());
- }
-
- public void testAddXmlElementRefToBeginningOfList() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithAll();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementRefAnnotation(1, resourceAttribute);
- XmlElementRefsAnnotation refsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class),@XmlElementRef})", cu);
-
- addXmlElementRefAnnotation(0, resourceAttribute);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef,@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class), @XmlElementRef})", cu);
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNotNull(refsAnnotation);
- assertEquals(3, refsAnnotation.getXmlElementRefsSize());
- }
-
- public void testRemoveXmlElementRef() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithAll();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementRefAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class),@XmlElementRef})", cu);
-
- removeXmlElementRefAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class)", cu);
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java
deleted file mode 100644
index 638c375733..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementWrapperAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_WRAPPER_NAME = "elementName";
- private static final String XML_ELEMENT_WRAPPER_NAMESPACE = "XmlElementWrapperNamespace";
-
- public XmlElementWrapperAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlElementWrapper() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_WRAPPER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementWrapper");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithName() throws Exception {
- return this.createTestXmlElementWrapperWithStringElement("name", XML_ELEMENT_WRAPPER_NAME);
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithNamespace() throws Exception {
- return this.createTestXmlElementWrapperWithStringElement("namespace", XML_ELEMENT_WRAPPER_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithStringElement(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_WRAPPER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementWrapper(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_WRAPPER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementWrapper(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertTrue(xmlElementWrapperAnnotation != null);
- assertEquals(XML_ELEMENT_WRAPPER_NAME, xmlElementWrapperAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertTrue(xmlElementWrapperAnnotation != null);
- assertNull(xmlElementWrapperAnnotation.getName());
- assertNull(xmlElementWrapperAnnotation.getNamespace());
- assertNull(xmlElementWrapperAnnotation.getNillable());
- assertNull(xmlElementWrapperAnnotation.getRequired());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementWrapperAnnotation.getName());
- xmlElementWrapperAnnotation.setName(XML_ELEMENT_WRAPPER_NAME);
- assertEquals(XML_ELEMENT_WRAPPER_NAME, xmlElementWrapperAnnotation.getName());
-
- assertSourceContains("@XmlElementWrapper(name = \"" + XML_ELEMENT_WRAPPER_NAME + "\")", cu);
-
- xmlElementWrapperAnnotation.setName(null);
- assertNull(xmlElementWrapperAnnotation.getName());
-
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("@XmlElementWrapper(name = \"" + XML_ELEMENT_WRAPPER_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertTrue(xmlElementWrapperAnnotation != null);
- assertEquals(XML_ELEMENT_WRAPPER_NAMESPACE, xmlElementWrapperAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementWrapperAnnotation.getNamespace());
- xmlElementWrapperAnnotation.setNamespace(XML_ELEMENT_WRAPPER_NAMESPACE);
- assertEquals(XML_ELEMENT_WRAPPER_NAMESPACE, xmlElementWrapperAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementWrapper(namespace = \"" + XML_ELEMENT_WRAPPER_NAMESPACE + "\")", cu);
-
- xmlElementWrapperAnnotation.setNamespace(null);
- assertNull(xmlElementWrapperAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("@XmlElementWrapper(namespace = \"" + XML_ELEMENT_WRAPPER_NAMESPACE + "\")", cu);
- }
-
- public void testGetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithBooleanElement("nillable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertEquals(Boolean.TRUE, xmlElementWrapperAnnotation.getNillable());
- }
-
- public void testSetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(xmlElementWrapperAnnotation);
- assertNull(xmlElementWrapperAnnotation.getNillable());
-
- xmlElementWrapperAnnotation.setNillable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlElementWrapperAnnotation.getNillable());
-
- assertSourceContains("@XmlElementWrapper(nillable = false)", cu);
-
- xmlElementWrapperAnnotation.setNillable(null);
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("nillable", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertEquals(Boolean.TRUE, xmlElementWrapperAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(xmlElementWrapperAnnotation);
- assertNull(xmlElementWrapperAnnotation.getRequired());
-
- xmlElementWrapperAnnotation.setRequired(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlElementWrapperAnnotation.getRequired());
-
- assertSourceContains("@XmlElementWrapper(required = false)", cu);
-
- xmlElementWrapperAnnotation.setRequired(null);
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("required", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java
deleted file mode 100644
index db85a0cf63..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-
-public class XmlElementsAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_NAME = "elementName";
- private static final String XML_ELEMENT_NAMESPACE = "XmlElementNamespace";
- private static final String XML_ELEMENT_DEFAULT_VALUE = "myDefaultValue";
- private static final String XML_ELEMENT_TYPE = "String";
-
-
- public XmlElementsAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElement() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithName() throws Exception {
- return this.createTestXmlElementWithStringElement("name", XML_ELEMENT_NAME);
- }
-
- private ICompilationUnit createTestXmlElementWithNamespace() throws Exception {
- return this.createTestXmlElementWithStringElement("namespace", XML_ELEMENT_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementWithDefaultValue() throws Exception {
- return this.createTestXmlElementWithStringElement("defaultValue", XML_ELEMENT_DEFAULT_VALUE);
- }
-
- private ICompilationUnit createTestXmlElementWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement(" + element + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithBooleanElement(final String booleanElement) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement(" + booleanElement + " = true))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement(type = " + XML_ELEMENT_TYPE + ".class))");
- }
- });
- }
-
-
- private XmlElementAnnotation getXmlElementAnnotation(JavaResourceAttribute resourceAttribute) {
- XmlElementsAnnotation annotation
- = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
- return annotation.xmlElementAt(0);
- }
-
- private XmlElementAnnotation addXmlElementAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementsAnnotation annotation
- = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
- return annotation.addXmlElement(index);
- }
-
- private void removeXmlElementAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementsAnnotation annotation
- = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
- annotation.removeXmlElement(index);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElementAnnotation.getNamespace());
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertNull(xmlElementAnnotation.getNillable());
- assertNull(xmlElementAnnotation.getRequired());
- assertNull(xmlElementAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getName());
-
- xmlElementAnnotation.setName(XML_ELEMENT_NAME);
-
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
-
- xmlElementAnnotation.setName(null);
-
- assertNull(xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getNamespace());
-
- xmlElementAnnotation.setNamespace(XML_ELEMENT_NAMESPACE);
-
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
-
- xmlElementAnnotation.setNamespace(null);
-
- assertNull(xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
- }
-
- public void testGetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithDefaultValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- }
-
- public void testSetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
-
- xmlElementAnnotation.setDefaultValue(XML_ELEMENT_DEFAULT_VALUE);
-
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
-
- xmlElementAnnotation.setDefaultValue(null);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
- }
-
- public void testGetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("nillable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable());
- }
-
- public void testSetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getNillable());
-
- xmlElementAnnotation.setNillable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getNillable());
- assertSourceContains("@XmlElement(nillable = false)", cu);
-
- xmlElementAnnotation.setNillable(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("nillable", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getRequired());
-
- xmlElementAnnotation.setRequired(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getRequired());
- assertSourceContains("@XmlElement(required = false)", cu);
-
- xmlElementAnnotation.setRequired(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("required", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_TYPE, xmlElementAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getType());
-
- xmlElementAnnotation.setType(XML_ELEMENT_TYPE);
-
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
-
- xmlElementAnnotation.setType(null);
-
- assertNull(xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
- }
-
- public void testAddXmlElement() throws Exception {
- ICompilationUnit cu = createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementAnnotation(1, resourceAttribute);
- XmlElementsAnnotation annotation = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
-
- assertSourceContains(
- "@XmlElements({@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"),@XmlElement})",
- cu);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNotNull(annotation);
- assertEquals(2, annotation.getXmlElementsSize());
- }
-
- public void testAddXmlElementToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementAnnotation(1, resourceAttribute);
- XmlElementsAnnotation annotation = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
-
- assertSourceContains(
- "@XmlElements({@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"),@XmlElement})",
- cu);
-
- addXmlElementAnnotation(0, resourceAttribute);
-
- assertSourceContains(
- "@XmlElements({@XmlElement,@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"), @XmlElement})",
- cu);
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNotNull(annotation);
- assertEquals(3, annotation.getXmlElementsSize());
- }
-
- public void testRemoveXmlElement() throws Exception {
- ICompilationUnit cu = createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElements({@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"),@XmlElement})",
- cu);
-
- removeXmlElementAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")",
- cu);
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java
deleted file mode 100644
index 02d0d62311..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlEnumAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ENUM_JAVA_TYPE = "String";
-
- public XmlEnumAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlEnum() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnum");
- }
- });
- }
-
- private ICompilationUnit createTestXmlEnumWithValue() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnum(value = " + XML_ENUM_JAVA_TYPE + ".class)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnum();
- JavaResourceEnum resourceEnum = this.buildJavaResourceEnum(cu);
-
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertTrue(xmlEnumAnnotation != null);
- assertNull(xmlEnumAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumWithValue();
- JavaResourceEnum resourceEnum = this.buildJavaResourceEnum(cu);
-
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertTrue(xmlEnumAnnotation != null);
- assertEquals(XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getValue());
- assertEquals("java.lang." + XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getFullyQualifiedValueClassName());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnum();
- JavaResourceEnum resourceEnum = this.buildJavaResourceEnum(cu);
-
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertNull(xmlEnumAnnotation.getValue());
- xmlEnumAnnotation.setValue(XML_ENUM_JAVA_TYPE);
- assertEquals(XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getValue());
-
- assertSourceContains("@XmlEnum(" + XML_ENUM_JAVA_TYPE + ".class)", cu);
-
- xmlEnumAnnotation.setValue(null);
- assertNull(xmlEnumAnnotation.getValue());
-
- assertSourceContains("@XmlEnum", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java
deleted file mode 100644
index 4629e37f00..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlEnumValueAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ENUM_VALUE_VALUE = "myEnumValue";
-
- public XmlEnumValueAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlEnumValue() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM_VALUE);
- }
- @Override
- public void appendSundayEnumConstantAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnumValue");
- }
- });
- }
-
- private ICompilationUnit createTestXmlEnumValueWithValue() throws Exception {
- return this.createTestXmlEnumValueWithStringElement("value", XML_ENUM_VALUE_VALUE);
- }
-
- private ICompilationUnit createTestXmlEnumValueWithStringElement(final String element, final String value) throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM_VALUE);
- }
- @Override
- public void appendSundayEnumConstantAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnumValue(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- public void testGetXmlEnumValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertTrue(xmlEnumValueAnnotation != null);
-
- enumConstant.removeAnnotation(JAXB.XML_ENUM_VALUE);
- assertSourceDoesNotContain("@XmlEnumValue", cu);
- }
-
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValueWithValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertTrue(xmlEnumValueAnnotation != null);
- assertEquals(XML_ENUM_VALUE_VALUE, xmlEnumValueAnnotation.getValue());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertTrue(xmlEnumValueAnnotation != null);
- assertNull(xmlEnumValueAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertNull(xmlEnumValueAnnotation.getValue());
- xmlEnumValueAnnotation.setValue(XML_ENUM_VALUE_VALUE);
- assertEquals(XML_ENUM_VALUE_VALUE, xmlEnumValueAnnotation.getValue());
-
- assertSourceContains("@XmlEnumValue(\"" + XML_ENUM_VALUE_VALUE + "\")", cu);
-
- xmlEnumValueAnnotation.setValue(null);
- assertNull(xmlEnumValueAnnotation.getValue());
-
- assertSourceDoesNotContain("@XmlEnumValue(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java
deleted file mode 100644
index 3c13c6e554..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlIDAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlIDAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlID() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlID");
- }
- });
- }
-
- public void testGetXmlID() throws Exception {
- ICompilationUnit cu = this.createTestXmlID();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertTrue(xmlIDAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_ID);
- assertSourceDoesNotContain("@XmlID", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java
deleted file mode 100644
index 48aacb46ce..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlIDREFAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlIDREFAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlIDREF() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_IDREF);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlIDREF");
- }
- });
- }
-
- public void testGetXmlIDREF() throws Exception {
- ICompilationUnit cu = this.createTestXmlIDREF();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertTrue(xmlIDREFAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_IDREF);
- assertSourceDoesNotContain("@XmlIDREF", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.java
deleted file mode 100644
index 47ad282afd..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlInlineBinaryDataAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlInlineBinaryDataAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlInlineBinaryData() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_INLINE_BINARY_DATA);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInlineBinaryData");
- }
- });
- }
-
- public void testGetXmlInlineBinaryData() throws Exception {
- ICompilationUnit cu = this.createTestXmlInlineBinaryData();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = this.getMethod(resourceType, 0);
-
- XmlInlineBinaryDataAnnotation xmlInlineBinaryDataAnnotation = (XmlInlineBinaryDataAnnotation) resourceMethod.getAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertTrue(xmlInlineBinaryDataAnnotation != null);
-
- resourceMethod.removeAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertSourceDoesNotContain("@XmlInlineBinaryData", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java
deleted file mode 100644
index 1ed94cbb14..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlInlineBinaryDataTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlInlineBinaryDataTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlInlineBinaryData() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_INLINE_BINARY_DATA);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInlineBinaryData");
- }
- });
- }
-
- public void testGetXmlInlineBinaryData() throws Exception {
- ICompilationUnit cu = this.createTestXmlInlineBinaryData();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlInlineBinaryDataAnnotation xmlInlineBinaryDataAnnotation = (XmlInlineBinaryDataAnnotation) resourceType.getAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertTrue(xmlInlineBinaryDataAnnotation != null);
-
- resourceType.removeAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertSourceDoesNotContain("@XmlInlineBinaryData", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java
deleted file mode 100644
index adeab40f26..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlJavaTypeAdapterPackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_CLASS = "TestClass";
- private static final String TEST_CLASS_2 = "TestClass2";
- private static final String FQ_TEST_CLASS = PACKAGE_NAME + "." + TEST_CLASS;
- private static final String FQ_TEST_CLASS_2 = PACKAGE_NAME + "." + TEST_CLASS_2;
-
-
- public XmlJavaTypeAdapterPackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private void createTestClass() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(TEST_CLASS).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TEST_CLASS + ".java", sourceWriter);
- }
-
- private void createTestClass2() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(TEST_CLASS_2).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TEST_CLASS_2 + ".java", sourceWriter);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapter() throws CoreException {
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter",
- JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapterAndValue() throws CoreException {
- createTestClass();
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)",
- JAXB.XML_JAVA_TYPE_ADAPTER, FQ_TEST_CLASS);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapterAndType() throws CoreException {
- createTestClass();
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)",
- JAXB.XML_JAVA_TYPE_ADAPTER, FQ_TEST_CLASS);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapters() throws CoreException {
- return createTestPackageInfo(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter})",
- JAXB.XML_JAVA_TYPE_ADAPTERS, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- public void testValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndValue();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass2();
-
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
-
- annotation.setValue(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getValue());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setValue(null);
- assertEquals(null, annotation.getValue());
- assertEquals(null, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter", cu);
-
- annotation.setValue(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
- }
-
- public void testType()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass2();
-
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(null, annotation.getType());
- assertEquals(null, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter", cu);
-
- annotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)", cu);
- }
-
- public void testTypeWithValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndValue();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass2();
-
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(value = " + TEST_CLASS + ".class, type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setValue(null);
- assertEquals(null, annotation.getValue());
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setValue(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS_2 + ".class, value = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(null, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
- }
-
- public void testContainedWithValue()
- throws Exception {
- // test contained annotation value setting/updating
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapters();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass();
-
- XmlJavaTypeAdapterAnnotation adapterAnnotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- adapterAnnotation.setValue(TEST_CLASS);
- assertEquals(TEST_CLASS, adapterAnnotation.getValue());
- assertEquals(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedValue());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(" + TEST_CLASS + ".class),@XmlJavaTypeAdapter})", cu);
-
- adapterAnnotation.setValue(null);
- assertNull(adapterAnnotation.getValue());
- assertNull(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedValue());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter})", cu);
- }
-
- public void testContainedWithType()
- throws Exception {
- // test contained annotation type setting/updating
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapters();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass();
-
- XmlJavaTypeAdapterAnnotation adapterAnnotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- adapterAnnotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, adapterAnnotation.getType());
- assertEquals(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)})", cu);
-
- resourcePackage.moveAnnotation(0, 1, JAXB.XML_JAVA_TYPE_ADAPTER);
- adapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(TEST_CLASS, adapterAnnotation.getType());
- assertEquals(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class),@XmlJavaTypeAdapter})", cu);
-
- adapterAnnotation.setType(null);
- assertNull(adapterAnnotation.getType());
- assertNull(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter})", cu);
- }
-
- public void testContained()
- throws Exception {
- // test adding/removing/moving
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapter();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass();
- createTestClass2();
-
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- resourcePackage.addAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(2, resourcePackage.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- assertSourceContains("@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter, @XmlJavaTypeAdapter })", cu);
-
- XmlJavaTypeAdapterAnnotation adapterAnnotation1 = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- adapterAnnotation1.setValue(TEST_CLASS);
- XmlJavaTypeAdapterAnnotation adapterAnnotation2 = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER);
- adapterAnnotation2.setValue(TEST_CLASS_2);
- assertSourceContains(
- "@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(" + TEST_CLASS
- + ".class), @XmlJavaTypeAdapter(" + TEST_CLASS_2
- + ".class) })", cu);
-
- resourcePackage.moveAnnotation(0, 1, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertSourceContains(
- "@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(" + TEST_CLASS_2
- + ".class), @XmlJavaTypeAdapter(" + TEST_CLASS
- + ".class) })", cu);
-
- resourcePackage.removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- assertSourceContains(
- "@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
- assertSourceDoesNotContain("@XmlJavaTypeAdapters", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java
deleted file mode 100644
index 760feb054c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlJavaTypeAdapterTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_JAVA_TYPE_ADAPTER_CLASS = "MyAdapterClass";
-
- public XmlJavaTypeAdapterTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlJavaTypeAdapter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJavaTypeAdapter");
- }
- });
- }
-
- private ICompilationUnit createTestXmlJavaTypeAdapterWithValue() throws Exception {
- this.createTestAdapterClass();
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJavaTypeAdapter(value = " + XML_JAVA_TYPE_ADAPTER_CLASS + ".class)");
- }
- });
- }
-
- private void createTestAdapterClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(XML_JAVA_TYPE_ADAPTER_CLASS).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "MyAdapterClass.java", sourceWriter);
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(xmlJavaTypeAdapterAnnotation != null);
- assertNull(xmlJavaTypeAdapterAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(xmlJavaTypeAdapterAnnotation != null);
- assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
- assertEquals("test." + XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getFullyQualifiedValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlJavaTypeAdapterAnnotation.getValue());
- xmlJavaTypeAdapterAnnotation.setValue(XML_JAVA_TYPE_ADAPTER_CLASS);
- assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
-
- assertSourceContains("@XmlJavaTypeAdapter(" + XML_JAVA_TYPE_ADAPTER_CLASS + ".class)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
-
- xmlJavaTypeAdapterAnnotation.setValue(null);
- assertNull(xmlJavaTypeAdapterAnnotation.getValue());
-
- assertSourceContains("@XmlJavaTypeAdapter", cu);
- assertSourceDoesNotContain("@XmlJavaTypeAdapter(" + XML_JAVA_TYPE_ADAPTER_CLASS + ".class)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java
deleted file mode 100644
index c21a90420d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlListAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlListAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlList() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_LIST);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlList");
- }
- });
- }
-
- public void testGetXmlList() throws Exception {
- ICompilationUnit cu = this.createTestXmlList();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertTrue(xmlListAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_LIST);
- assertSourceDoesNotContain("@XmlList", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java
deleted file mode 100644
index 510878c149..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlMimeTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_MIME_TYPE_VALUE = "myMimeType";
-
- public XmlMimeTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlMimeType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_MIME_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlMimeType");
- }
- });
- }
-
- private ICompilationUnit createTestXmlMimeTypeWithValue() throws Exception {
- return this.createTestXmlMimeTypeWithStringElement("value", XML_MIME_TYPE_VALUE);
- }
-
- private ICompilationUnit createTestXmlMimeTypeWithStringElement(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_MIME_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlMimeType(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- public void testGetXmlMimeType() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertTrue(xmlMimeTypeAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_MIME_TYPE);
- assertSourceDoesNotContain("@XmlMimeType", cu);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeTypeWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertTrue(xmlMimeTypeAnnotation != null);
- assertEquals(XML_MIME_TYPE_VALUE, xmlMimeTypeAnnotation.getValue());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertTrue(xmlMimeTypeAnnotation != null);
- assertNull(xmlMimeTypeAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertNull(xmlMimeTypeAnnotation.getValue());
- xmlMimeTypeAnnotation.setValue(XML_MIME_TYPE_VALUE);
- assertEquals(XML_MIME_TYPE_VALUE, xmlMimeTypeAnnotation.getValue());
-
- assertSourceContains("@XmlMimeType(\"" + XML_MIME_TYPE_VALUE + "\")", cu);
-
- xmlMimeTypeAnnotation.setValue(null);
- assertNull(xmlMimeTypeAnnotation.getValue());
-
- assertSourceDoesNotContain("@XmlMimeType(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java
deleted file mode 100644
index fe9e868763..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlMixedAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlMixedAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlMixed() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_MIXED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlMixed");
- }
- });
- }
-
- public void testGetXmlMixed() throws Exception {
- ICompilationUnit cu = this.createTestXmlMixed();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMixedAnnotation xmlMixedAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertTrue(xmlMixedAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_MIXED);
- assertSourceDoesNotContain("@XmlMixed", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java
deleted file mode 100644
index 2e7b36bb2e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlRegistryAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlRegistryAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlRegistry() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
- });
- }
-
- public void testGetXmlRegistry() throws Exception {
- ICompilationUnit cu = this.createTestXmlRegistry();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRegistryAnnotation xmlRegistryAnnotation = (XmlRegistryAnnotation) resourceType.getAnnotation(JAXB.XML_REGISTRY);
- assertTrue(xmlRegistryAnnotation != null);
-
- resourceType.removeAnnotation(JAXB.XML_REGISTRY);
- assertSourceDoesNotContain("@XmlRegistry", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java
deleted file mode 100644
index adb6360444..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlRootElementAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ROOT_ELEMENT_NAME = "XmlRootElementName";
- private static final String XML_ROOT_ELEMENT_NAMESPACE = "XmlRootElementNamespace";
-
- public XmlRootElementAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlRootElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRootElement");
- }
- });
- }
-
- private ICompilationUnit createTestXmlRootElementWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRootElement(name = \"" + XML_ROOT_ELEMENT_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlRootElementWithNamespace() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRootElement(namespace = \"" + XML_ROOT_ELEMENT_NAMESPACE + "\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertTrue(xmlRootElementAnnotation != null);
- assertEquals(XML_ROOT_ELEMENT_NAME, xmlRootElementAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertTrue(xmlRootElementAnnotation != null);
- assertNull(xmlRootElementAnnotation.getName());
- assertNull(xmlRootElementAnnotation.getNamespace());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation.getName());
- xmlRootElementAnnotation.setName(XML_ROOT_ELEMENT_NAME);
- assertEquals(XML_ROOT_ELEMENT_NAME, xmlRootElementAnnotation.getName());
-
- assertSourceContains("@XmlRootElement(name = \"" + XML_ROOT_ELEMENT_NAME + "\")", cu);
-
- xmlRootElementAnnotation.setName(null);
- assertNull(xmlRootElementAnnotation.getName());
-
- assertSourceContains("@XmlRootElement", cu);
- assertSourceDoesNotContain("@XmlRootElement(name = \"" + XML_ROOT_ELEMENT_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElementWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertTrue(xmlRootElementAnnotation != null);
- assertEquals(XML_ROOT_ELEMENT_NAMESPACE, xmlRootElementAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation.getNamespace());
- xmlRootElementAnnotation.setNamespace(XML_ROOT_ELEMENT_NAMESPACE);
- assertEquals(XML_ROOT_ELEMENT_NAMESPACE, xmlRootElementAnnotation.getNamespace());
-
- assertSourceContains("@XmlRootElement(namespace = \"" + XML_ROOT_ELEMENT_NAMESPACE + "\")", cu);
-
- xmlRootElementAnnotation.setNamespace(null);
- assertNull(xmlRootElementAnnotation.getNamespace());
-
- assertSourceContains("@XmlRootElement", cu);
- assertSourceDoesNotContain("@XmlRootElement(namespace = \"" + XML_ROOT_ELEMENT_NAMESPACE + "\")", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java
deleted file mode 100644
index 9a4bbd2ab3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSchemaAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_LOCATION = "http://www.eclipse.org/test/schema.xsd";
-
- private static final String TEST_NAMESPACE = "http://www.eclipse.org/test/schema";
-
- private static final String TEST_PREFIX = "ts";
-
- private static final String TEST_NAMESPACE_2 = "http://www.eclipse.org/test/schema2";
-
- private static final String TEST_PREFIX_2 = "ts2";
-
-
- public XmlSchemaAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithSchemaAndAttributeFormDefault() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(attributeFormDefault = XmlNsForm.QUALIFIED)",
- JAXB.XML_SCHEMA, JAXB.XML_NS_FORM);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndElementFormDefault() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED)",
- JAXB.XML_SCHEMA, JAXB.XML_NS_FORM);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndLocation() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(location = \"" + TEST_LOCATION + "\")",
- JAXB.XML_SCHEMA);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndNamespace() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(namespace = \"" + TEST_NAMESPACE + "\")",
- JAXB.XML_SCHEMA);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndXmlns() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(xmlns = @XmlNs)",
- JAXB.XML_SCHEMA, JAXB.XML_NS);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndXmlnsWithNamespace() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(xmlns = @XmlNs(namespaceURI = \"" + TEST_NAMESPACE + "\"))",
- JAXB.XML_SCHEMA, JAXB.XML_NS);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndXmlnsWithPrefix() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(xmlns = @XmlNs(prefix = \"" + TEST_PREFIX + "\"))",
- JAXB.XML_SCHEMA, JAXB.XML_NS);
- }
-
- public void testAttributeFormDefault()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndAttributeFormDefault();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertTrue(schemaAnnotation != null);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = XmlNsForm.QUALIFIED)", cu);
-
- schemaAnnotation.setAttributeFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(XmlNsForm.UNQUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = UNQUALIFIED)", cu);
-
- schemaAnnotation.setAttributeFormDefault(XmlNsForm.UNSET);
- assertEquals(XmlNsForm.UNSET, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = UNSET)", cu);
-
- schemaAnnotation.setAttributeFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getAttributeFormDefault());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setAttributeFormDefault(XmlNsForm.QUALIFIED);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = QUALIFIED)", cu);
- }
-
- public void testElementFormDefault()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndElementFormDefault();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertTrue(schemaAnnotation != null);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED)", cu);
-
- schemaAnnotation.setElementFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(XmlNsForm.UNQUALIFIED, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = UNQUALIFIED)", cu);
-
- schemaAnnotation.setElementFormDefault(XmlNsForm.UNSET);
- assertEquals(XmlNsForm.UNSET, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = UNSET)", cu);
-
- schemaAnnotation.setElementFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getElementFormDefault());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setElementFormDefault(XmlNsForm.QUALIFIED);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = QUALIFIED)", cu);
- }
-
- public void testLocation()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndLocation();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNotNull(schemaAnnotation.getLocation());
-
- schemaAnnotation.setLocation(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getLocation());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setLocation(TEST_LOCATION);
- assertEquals(TEST_LOCATION, schemaAnnotation.getLocation());
- assertSourceContains("@XmlSchema(location = \"" + TEST_LOCATION + "\")", cu);
- }
-
- public void testNamespace()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndNamespace();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNotNull(schemaAnnotation.getNamespace());
-
- schemaAnnotation.setNamespace(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getNamespace());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, schemaAnnotation.getNamespace());
- assertSourceContains("@XmlSchema(namespace = \"" + TEST_NAMESPACE + "\")", cu);
- }
-
- public void testXmlnsNamespace()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndXmlnsWithNamespace();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- XmlNsAnnotation xmlnsAnnotation = schemaAnnotation.xmlnsAt(0);
- assertNotNull(xmlnsAnnotation.getNamespaceURI());
-
- xmlnsAnnotation.setNamespaceURI(null);
- assertNull(xmlnsAnnotation.getNamespaceURI());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs)", cu);
-
- xmlnsAnnotation.setNamespaceURI(TEST_NAMESPACE_2);
- assertEquals(TEST_NAMESPACE_2, xmlnsAnnotation.getNamespaceURI());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2 + "\"))", cu);
- }
-
- public void testXmlnsPrefix()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndXmlnsWithPrefix();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- XmlNsAnnotation xmlnsAnnotation = schemaAnnotation.xmlnsAt(0);
- assertNotNull(xmlnsAnnotation.getPrefix());
-
- xmlnsAnnotation.setPrefix(null);
- assertNull(xmlnsAnnotation.getPrefix());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs)", cu);
-
- xmlnsAnnotation.setPrefix(TEST_PREFIX_2);
- assertEquals(TEST_PREFIX_2, xmlnsAnnotation.getPrefix());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs(prefix = \"" + TEST_PREFIX_2 + "\"))", cu);
- }
-
- public void testXmlns()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndXmlns();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertFalse(CollectionTools.isEmpty(schemaAnnotation.getXmlns()));
- assertEquals(1, schemaAnnotation.getXmlnsSize());
-
- schemaAnnotation.addXmlns(1);
- assertEquals(2, schemaAnnotation.getXmlnsSize());
- assertSourceContains("@XmlSchema(xmlns = {@XmlNs,@XmlNs})", cu);
-
- XmlNsAnnotation xmlnsAnnotation1 = schemaAnnotation.xmlnsAt(0);
- xmlnsAnnotation1.setNamespaceURI(TEST_NAMESPACE);
- xmlnsAnnotation1.setPrefix(TEST_PREFIX);
- XmlNsAnnotation xmlnsAnnotation2 = schemaAnnotation.xmlnsAt(1);
- xmlnsAnnotation2.setNamespaceURI(TEST_NAMESPACE_2);
- xmlnsAnnotation2.setPrefix(TEST_PREFIX_2);
- assertSourceContains(
- "@XmlSchema(xmlns = {@XmlNs(namespaceURI = \"" + TEST_NAMESPACE
- + "\", prefix = \"" + TEST_PREFIX
- + "\"),@XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2
- + "\", prefix = \"" + TEST_PREFIX_2
- + "\")})", cu);
-
- schemaAnnotation.moveXmlns(0, 1);
- assertSourceContains(
- "@XmlSchema(xmlns = {@XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2
- + "\", prefix = \"" + TEST_PREFIX_2
- + "\"),@XmlNs(namespaceURI = \"" + TEST_NAMESPACE
- + "\", prefix = \"" + TEST_PREFIX
- + "\")})", cu);
-
- schemaAnnotation.removeXmlns(1);
- assertEquals(1, schemaAnnotation.getXmlnsSize());
- assertSourceContains(
- "@XmlSchema(xmlns = @XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2
- + "\", prefix = \"" + TEST_PREFIX_2
- + "\"))", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java
deleted file mode 100644
index adebaa97b8..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSchemaTypeAttributeAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_NAME = "foo";
- private static final String TEST_NAME_2 = "bar";
-
- private static final String TEST_NAMESPACE = "http://www.eclipse.org/test/schema";
- private static final String TEST_NAMESPACE_2 = "http://www.eclipse.org/test/schema2";
-
- private static final String TEST_CLASS = GregorianCalendar.class.getSimpleName();
- private static final String TEST_CLASS_2 = Date.class.getSimpleName();
- private static final String FQ_TEST_CLASS = GregorianCalendar.class.getName();
- private static final String FQ_TEST_CLASS_2 = Date.class.getName();
-
-
- public XmlSchemaTypeAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAttributeWithSchemaTypeAndName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SCHEMA_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSchemaType(name = \"" + TEST_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithSchemaTypeAndNamespace() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SCHEMA_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithSchemaTypeAndType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SCHEMA_TYPE, FQ_TEST_CLASS, FQ_TEST_CLASS_2);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSchemaType(type = " + TEST_CLASS + ".class)");
- }
- });
- }
-
- public void testName() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithSchemaTypeAndName();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = this.getField(resourceType, 0);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
-
- annotation.setName(TEST_NAME_2);
- assertEquals(TEST_NAME_2, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME_2 + "\")", cu);
-
- annotation.setName(null);
- assertEquals(null, annotation.getName());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setName(TEST_NAME);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
- }
-
- public void testNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithSchemaTypeAndNamespace();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = this.getField(resourceType, 0);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
-
- annotation.setNamespace(TEST_NAMESPACE_2);
- assertEquals(TEST_NAMESPACE_2, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE_2 + "\")", cu);
-
- annotation.setNamespace(null);
- assertEquals(null, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
- }
-
- public void testType() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithSchemaTypeAndType();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = this.getField(resourceType, 0);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(null, annotation.getType());
- assertEquals(null, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java
deleted file mode 100644
index 5e358517c3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Date;
-import java.util.GregorianCalendar;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSchemaTypePackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_NAME = "foo";
- private static final String TEST_NAME_2 = "bar";
-
- private static final String TEST_NAMESPACE = "http://www.eclipse.org/test/schema";
- private static final String TEST_NAMESPACE_2 = "http://www.eclipse.org/test/schema2";
-
- private static final String TEST_CLASS = GregorianCalendar.class.getSimpleName();
- private static final String TEST_CLASS_2 = Date.class.getSimpleName();
- private static final String FQ_TEST_CLASS = GregorianCalendar.class.getName();
- private static final String FQ_TEST_CLASS_2 = Date.class.getName();
-
-
- public XmlSchemaTypePackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithSchemaType() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypeAndName() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType(name = \"" + TEST_NAME + "\")",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypeAndNamespace() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypeAndType() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType(type = " + TEST_CLASS + ".class)",
- JAXB.XML_SCHEMA_TYPE, FQ_TEST_CLASS, FQ_TEST_CLASS_2);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypes() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})",
- JAXB.XML_SCHEMA_TYPES, JAXB.XML_SCHEMA_TYPE, FQ_TEST_CLASS, FQ_TEST_CLASS_2);
- }
-
- public void testName() throws Exception {
- ICompilationUnit cu = createPackageInfoWithSchemaTypeAndName();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
-
- annotation.setName(TEST_NAME_2);
- assertEquals(TEST_NAME_2, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME_2 + "\")", cu);
-
- annotation.setName(null);
- assertEquals(null, annotation.getName());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setName(TEST_NAME);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
- }
-
- public void testNamespace() throws Exception {
- ICompilationUnit cu = createPackageInfoWithSchemaTypeAndNamespace();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
-
- annotation.setNamespace(TEST_NAMESPACE_2);
- assertEquals(TEST_NAMESPACE_2, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE_2 + "\")", cu);
-
- annotation.setNamespace(null);
- assertEquals(null, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
- }
-
- public void testType() throws Exception {
- ICompilationUnit cu = createPackageInfoWithSchemaTypeAndType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(null, annotation.getType());
- assertEquals(null, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
- }
-
- public void testContainedWithName() throws Exception {
- // test contained annotation value setting/updating
-
- ICompilationUnit cu = createPackageInfoWithSchemaTypes();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation containedAnnotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
-
- containedAnnotation.setName(TEST_NAME);
- assertEquals(TEST_NAME, containedAnnotation.getName());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType(name = \"" + TEST_NAME + "\"),@XmlSchemaType})", cu);
-
- containedAnnotation.setName(null);
- assertNull(containedAnnotation.getName());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})", cu);
- }
-
- public void testContainedWithNamespace() throws Exception {
- // test contained annotation value setting/updating
-
- ICompilationUnit cu = createPackageInfoWithSchemaTypes();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation containedAnnotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
-
- containedAnnotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, containedAnnotation.getNamespace());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\"),@XmlSchemaType})", cu);
-
- containedAnnotation.setNamespace(null);
- assertNull(containedAnnotation.getNamespace());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})", cu);
- }
-
- public void testContainedWithType()throws Exception {
- // test contained annotation type setting/updating
-
- ICompilationUnit cu = createPackageInfoWithSchemaTypes();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation containedAnnotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_SCHEMA_TYPE);
-
- containedAnnotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, containedAnnotation.getType());
- assertEquals(FQ_TEST_CLASS, containedAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType(type = " + TEST_CLASS + ".class)})", cu);
-
- containedAnnotation.setType(null);
- assertNull(containedAnnotation.getType());
- assertNull(FQ_TEST_CLASS, containedAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})", cu);
- }
-
- public void testContained() throws Exception {
- // test adding/removing/moving
-
- ICompilationUnit cu = createPackageInfoWithSchemaType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
-
- resourcePackage.addAnnotation(1, JAXB.XML_SCHEMA_TYPE);
-
- assertEquals(2, resourcePackage.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- assertSourceContains("@XmlSchemaTypes({ @XmlSchemaType, @XmlSchemaType })", cu);
-
- XmlSchemaTypeAnnotation containedAnnotation1 = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- containedAnnotation1.setName(TEST_NAME);
- XmlSchemaTypeAnnotation containedAnnotation2 = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_SCHEMA_TYPE);
- containedAnnotation2.setName(TEST_NAME_2);
- assertSourceContains(
- "@XmlSchemaTypes({ @XmlSchemaType(name = \"" + TEST_NAME
- + "\"), @XmlSchemaType(name = \"" + TEST_NAME_2
- + "\") })", cu);
-
- resourcePackage.moveAnnotation(0, 1, JAXB.XML_SCHEMA_TYPE);
- assertSourceContains(
- "@XmlSchemaTypes({ @XmlSchemaType(name = \"" + TEST_NAME_2
- + "\"), @XmlSchemaType(name = \"" + TEST_NAME
- + "\") })", cu);
-
- resourcePackage.removeAnnotation(1, JAXB.XML_SCHEMA_TYPE);
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- assertSourceContains(
- "@XmlSchemaType(name = \"" + TEST_NAME_2 + "\")", cu);
- assertSourceDoesNotContain("@XmlSchemaTypes", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java
deleted file mode 100644
index a00b7b6718..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSeeAlsoAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlSeeAlsoAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlSeeAlso() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SEE_ALSO);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSeeAlso");
- }
- });
- }
-
- private ICompilationUnit createTestXmlSeeAlsoWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SEE_ALSO);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSeeAlso(value = {Foo.class, Bar.class})");
- }
- });
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
- assertEquals(0, xmlSeeAlsoAnnotation.getClassesSize());
- }
-
- public void testGetClasses() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
- ListIterator<String> classes = xmlSeeAlsoAnnotation.getClasses().iterator();
- assertEquals("Foo", classes.next());
- assertEquals("Bar", classes.next());
- }
-
- public void testGetClassesSize() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
- assertEquals(2, xmlSeeAlsoAnnotation.getClassesSize());
- }
-
- public void testAddClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.addClass("Fooo");
- xmlSeeAlsoAnnotation.addClass("Barrr");
-
- assertSourceContains("@XmlSeeAlso({ Fooo.class, Barrr.class })", cu);
- }
-
- public void testAddClassIndex() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.addClass(0, "Fooo");
- xmlSeeAlsoAnnotation.addClass(0, "Barr");
- xmlSeeAlsoAnnotation.addClass(1, "Blah");
-
- assertSourceContains("@XmlSeeAlso({ Barr.class, Blah.class, Fooo.class })", cu);
- }
-
- public void testRemoveClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.removeClass(0);
- assertSourceContains("@XmlSeeAlso(value = Bar.class)", cu);
-
- xmlSeeAlsoAnnotation.removeClass(0);
- assertSourceContains("@XmlSeeAlso", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
- public void testMoveClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.addClass("Fooo");
- xmlSeeAlsoAnnotation.addClass("Barr");
- xmlSeeAlsoAnnotation.addClass("Blah");
- assertSourceContains("@XmlSeeAlso({ Fooo.class, Barr.class, Blah.class })", cu);
-
- xmlSeeAlsoAnnotation.moveClass(0, 1);
- assertSourceContains("@XmlSeeAlso({ Barr.class, Fooo.class, Blah.class })", cu);
-
- xmlSeeAlsoAnnotation.moveClass(2, 1);
- assertSourceContains("@XmlSeeAlso({ Barr.class, Blah.class, Fooo.class })", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.java
deleted file mode 100644
index 656a5947ed..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlTransientAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlTransientAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlTransient() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TRANSIENT);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransient");
- }
- });
- }
-
- public void testGetXmlTransient() throws Exception {
- ICompilationUnit cu = this.createTestXmlTransient();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = this.getMethod(resourceType, 0);
-
- XmlTransientAnnotation xmlTransientAnnotation = (XmlTransientAnnotation) resourceMethod.getAnnotation(JAXB.XML_TRANSIENT);
- assertTrue(xmlTransientAnnotation != null);
-
- resourceMethod.removeAnnotation(JAXB.XML_TRANSIENT);
- assertSourceDoesNotContain("@XmlTransient", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java
deleted file mode 100644
index 6a768654ed..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlTransientTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlTransientTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlTransient() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransient");
- }
- });
- }
-
- public void testGetXmlTransient() throws Exception {
- ICompilationUnit cu = this.createTestXmlTransient();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTransientAnnotation xmlTransientAnnotation = (XmlTransientAnnotation) resourceType.getAnnotation(JAXB.XML_TRANSIENT);
- assertTrue(xmlTransientAnnotation != null);
-
- resourceType.removeAnnotation(JAXB.XML_TRANSIENT);
- assertSourceDoesNotContain("@XmlTransient", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java
deleted file mode 100644
index 6995ed4d5c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_TYPE_NAME = "XmlTypeName";
- private static final String XML_TYPE_NAMESPACE = "XmlTypeNamespace";
- private static final String XML_TYPE_FACTORY_METHOD = "myFactoryMethod";
- private static final String XML_TYPE_FACTORY_CLASS = "MyFactoryClass";
-
- public XmlTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(name = \"" + XML_TYPE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithNamespace() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(namespace = \"" + XML_TYPE_NAMESPACE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithFactoryMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(factoryMethod = \"" + XML_TYPE_FACTORY_METHOD + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithFactoryClass() throws Exception {
- this.createTestFactoryClass();
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(factoryClass = " + XML_TYPE_FACTORY_CLASS + ".class)");
- }
- });
- }
-
- private void createTestFactoryClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(XML_TYPE_FACTORY_CLASS).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "MyFactoryClass.java", sourceWriter);
- }
-
- private ICompilationUnit createTestXmlTypeWithPropOrder() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(propOrder = {\"foo\", \"bar\"})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_NAME, xmlTypeAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertNull(xmlTypeAnnotation.getName());
- assertNull(xmlTypeAnnotation.getNamespace());
- assertNull(xmlTypeAnnotation.getFactoryClass());
- assertNull(xmlTypeAnnotation.getFullyQualifiedFactoryClassName());
- assertNull(xmlTypeAnnotation.getFactoryMethod());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getName());
- xmlTypeAnnotation.setName(XML_TYPE_NAME);
- assertEquals(XML_TYPE_NAME, xmlTypeAnnotation.getName());
-
- assertSourceContains("@XmlType(name = \"" + XML_TYPE_NAME + "\")", cu);
-
- xmlTypeAnnotation.setName(null);
- assertNull(xmlTypeAnnotation.getName());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(name = \"" + XML_TYPE_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_NAMESPACE, xmlTypeAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getNamespace());
- xmlTypeAnnotation.setNamespace(XML_TYPE_NAMESPACE);
- assertEquals(XML_TYPE_NAMESPACE, xmlTypeAnnotation.getNamespace());
-
- assertSourceContains("@XmlType(namespace = \"" + XML_TYPE_NAMESPACE + "\")", cu);
-
- xmlTypeAnnotation.setNamespace(null);
- assertNull(xmlTypeAnnotation.getNamespace());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(namespace = \"" + XML_TYPE_NAMESPACE + "\")", cu);
- }
-
- public void testGetFactoryMethod() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithFactoryMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_FACTORY_METHOD, xmlTypeAnnotation.getFactoryMethod());
- }
-
- public void testSetFactoryMethod() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryMethod());
- xmlTypeAnnotation.setFactoryMethod(XML_TYPE_FACTORY_METHOD);
- assertEquals(XML_TYPE_FACTORY_METHOD, xmlTypeAnnotation.getFactoryMethod());
-
- assertSourceContains("@XmlType(factoryMethod = \"" + XML_TYPE_FACTORY_METHOD + "\")", cu);
-
- xmlTypeAnnotation.setFactoryMethod(null);
- assertNull(xmlTypeAnnotation.getFactoryMethod());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(factoryMethod = \"" + XML_TYPE_FACTORY_METHOD + "\")", cu);
- }
-
- public void testGetFactoryClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithFactoryClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFactoryClass());
- assertEquals("test." + XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFullyQualifiedFactoryClassName());
- }
-
- public void testSetFactoryClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryClass());
- xmlTypeAnnotation.setFactoryClass(XML_TYPE_FACTORY_CLASS);
- assertEquals(XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFactoryClass());
-
- assertSourceContains("@XmlType(factoryClass = " + XML_TYPE_FACTORY_CLASS + ".class", cu);
-
- xmlTypeAnnotation.setFactoryClass(null);
- assertNull(xmlTypeAnnotation.getFactoryClass());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(factoryClass = " + XML_TYPE_FACTORY_CLASS + ".class", cu);
- }
-
- public void testGetPropOrder() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- ListIterator<String> propOrder = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("foo", propOrder.next());
- assertEquals("bar", propOrder.next());
- }
-
- public void testGetPropOrderSize() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(2, xmlTypeAnnotation.getPropOrderSize());
- }
-
- public void testAddProp() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.addProp("fooo");
- xmlTypeAnnotation.addProp("barr");
-
- assertSourceContains("@XmlType(propOrder = { \"fooo\", \"barr\" })", cu);
- }
-
- public void testAddPropIndex() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.addProp(0, "fooo");
- xmlTypeAnnotation.addProp(0, "barr");
- xmlTypeAnnotation.addProp(1, "blah");
-
- assertSourceContains("@XmlType(propOrder = { \"barr\", \"blah\", \"fooo\" })", cu);
- }
-
- public void testRemoveProp() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.removeProp("foo");
- assertSourceContains("@XmlType(propOrder = \"bar\")", cu);
-
- xmlTypeAnnotation.removeProp("bar");
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("propOrder", cu);
- }
-
- public void testRemovePropIndex() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.removeProp(0);
- assertSourceContains("@XmlType(propOrder = \"bar\")", cu);
-
- xmlTypeAnnotation.removeProp(0);
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("propOrder", cu);
- }
-
- public void testMoveProp() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.addProp("fooo");
- xmlTypeAnnotation.addProp("barr");
- xmlTypeAnnotation.addProp("blah");
- assertSourceContains("@XmlType(propOrder = { \"fooo\", \"barr\", \"blah\" })", cu);
-
- xmlTypeAnnotation.moveProp(0, 1);
- assertSourceContains("@XmlType(propOrder = { \"barr\", \"fooo\", \"blah\" })", cu);
-
- xmlTypeAnnotation.moveProp(2, 1);
- assertSourceContains("@XmlType(propOrder = { \"barr\", \"blah\", \"fooo\" })", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java
deleted file mode 100644
index eb635a316f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlValueAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlValueAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_VALUE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlValue");
- }
- });
- }
-
- public void testGetXmlValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlValueAnnotation xmlValueAnnotation = (XmlValueAnnotation) resourceAttribute.getAnnotation(JAXB.XML_VALUE);
- assertTrue(xmlValueAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_VALUE);
- assertSourceDoesNotContain("@XmlValue", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml
deleted file mode 100644
index 06df99e774..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?> <!--
- Copyright (c) 2010 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jaxb.core.tests"/> <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.resource.JaxbCoreResourceModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> </ant> </target>
- <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbCoreContextModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> </ant> </target> <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath
deleted file mode 100644
index f8b7c93a43..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/eclipselink/core/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project
deleted file mode 100644
index 71513f6b6e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ee129ed60e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Thu May 05 17:25:11 EDT 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index e8ceb8908e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core.tests;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Dali-Comment: jdk 1.6 has the javax.xml.bind annotations
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.tests.JptJaxbEclipseLinkCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jaxb.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.core.tests,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/about.html b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties
deleted file mode 100644
index 38c93513e7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties
deleted file mode 100644
index 583cd43a66..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - JAXB EclipseLink Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java
deleted file mode 100644
index 2d7824687e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * configure the core to handle events synchronously when we are
- * running tests
- */
-@SuppressWarnings("nls")
-public class JptJaxbEclipseLinkCoreTestsPlugin
- extends Plugin {
-
- private static JptJaxbEclipseLinkCoreTestsPlugin INSTANCE;
-
- public static final String ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.eclipselink.jar";
-
-
- public static JptJaxbEclipseLinkCoreTestsPlugin instance() {
- return INSTANCE;
- }
-
- public static String eclipseLinkJarName() {
- return getSystemProperty(ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbEclipseLinkCoreTestsPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- JaxbProjectManager jaxbProjectManager = JptJaxbCorePlugin.getProjectManager();
- ReflectionTools.executeMethod(jaxbProjectManager, "handleEventsSynchronously");
- ReflectionTools.executeStaticMethod(JptJaxbCorePlugin.class, "doNotFlushPreferences");
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/JaxbEclipseLinkCoreTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/JaxbEclipseLinkCoreTests.java
deleted file mode 100644
index 403948f9b6..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/JaxbEclipseLinkCoreTests.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.JaxbEclipseLinkCoreResourceModelTests;
-
-
-public class JaxbEclipseLinkCoreTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbEclipseLinkCoreTests.class.getPackage().getName());
- suite.addTest(JaxbEclipseLinkCoreResourceModelTests.suite());
- return suite;
- }
-
-
- private JaxbEclipseLinkCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/JaxbEclipseLinkCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/JaxbEclipseLinkCoreResourceModelTests.java
deleted file mode 100644
index 09d8199946..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/JaxbEclipseLinkCoreResourceModelTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java.ELJaxbJavaResourceModelTests;
-
-
-public class JaxbEclipseLinkCoreResourceModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbEclipseLinkCoreResourceModelTests.class.getName());
-
- suite.addTest(ELJaxbJavaResourceModelTests.suite());
- return suite;
- }
-
-
- private JaxbEclipseLinkCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java
deleted file mode 100644
index 2ab7e242b7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.tests.internal.resource.java.JavaResourceModelTestCase;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_PlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.JptJaxbEclipseLinkCoreTestsPlugin;
-
-
-public class ELJaxbJavaResourceModelTestCase
- extends JavaResourceModelTestCase {
-
- public ELJaxbJavaResourceModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject.addJar(JptJaxbEclipseLinkCoreTestsPlugin.eclipseLinkJarName());
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- // nothing as of yet
- }
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_1_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_1_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java
deleted file mode 100644
index 30f9ffe04f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-
-public class ELJaxbJavaResourceModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(ELJaxbJavaResourceModelTests.class.getName());
- suite.addTestSuite(XmlInverseReferenceAnnotationTests.class);
- suite.addTestSuite(XmlTransformationAnnotationTests.class);
-
- return suite;
- }
-
-
- private ELJaxbJavaResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.java
deleted file mode 100644
index 1a404f911c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-
-
-public class XmlInverseReferenceAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlInverseReferenceAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlInverseReference()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_INVERSE_REFERENCE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInverseReference");
- }
- });
- }
-
- private ICompilationUnit createTestXmlInverseReferenceWithMappedBy()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_INVERSE_REFERENCE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInverseReference(mappedBy = \"foo\")");
- }
- });
- }
-
- private XmlInverseReferenceAnnotation getXmlInverseReferenceAnnotation(JavaResourceAttribute resourceAttribute) {
- return (XmlInverseReferenceAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_INVERSE_REFERENCE);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = createTestXmlInverseReference();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlInverseReferenceAnnotation annotation = getXmlInverseReferenceAnnotation(resourceAttribute);
-
- assertTrue(annotation != null);
- assertNull(annotation.getMappedBy());
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = createTestXmlInverseReferenceWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlInverseReferenceAnnotation annotation = getXmlInverseReferenceAnnotation(resourceAttribute);
-
- assertEquals("foo", annotation.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = createTestXmlInverseReference();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlInverseReferenceAnnotation annotation = getXmlInverseReferenceAnnotation(resourceAttribute);
-
- assertNull(annotation.getMappedBy());
-
- annotation.setMappedBy("bar");
-
- assertEquals("bar", annotation.getMappedBy());
- assertSourceContains("@XmlInverseReference(mappedBy = \"bar\")", cu);
-
- annotation.setMappedBy("");
-
- assertEquals("", annotation.getMappedBy());
- assertSourceContains("@XmlInverseReference(mappedBy = \"\")", cu);
-
- annotation.setMappedBy(null);
-
- assertNull(annotation.getMappedBy());
- assertSourceContains("@XmlInverseReference", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java
deleted file mode 100644
index 0d8d34907e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class XmlTransformationAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlTransformationAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlTransformation()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_TRANSFORMATION);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransformation");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTransformationWithOptional()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_TRANSFORMATION);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransformation(optional = true)");
- }
- });
- }
-
- private XmlTransformationAnnotation getXmlTransformationAnnotation(JavaResourceAttribute resourceAttribute) {
- return (XmlTransformationAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_TRANSFORMATION);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = createTestXmlTransformation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlTransformationAnnotation annotation = getXmlTransformationAnnotation(resourceAttribute);
-
- assertTrue(annotation != null);
- assertNull(annotation.getOptional());
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = createTestXmlTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlTransformationAnnotation annotation = getXmlTransformationAnnotation(resourceAttribute);
-
- assertEquals(Boolean.TRUE, annotation.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = createTestXmlTransformation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlTransformationAnnotation annotation = getXmlTransformationAnnotation(resourceAttribute);
-
- assertNull(annotation.getOptional());
-
- annotation.setOptional(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, annotation.getOptional());
- assertSourceContains("@XmlTransformation(optional = false)", cu);
-
- annotation.setOptional(null);
-
- assertNull(annotation.getOptional());
- assertSourceContains("@XmlTransformation", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-}
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/.project b/jpa/features/org.eclipse.jpt.eclipselink.feature/.project
deleted file mode 100644
index f2123ce740..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
deleted file mode 100644
index d8a03f0b6e..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink_sdk.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink_sdk.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.feature/.project b/jpa/features/org.eclipse.jpt.feature/.project
deleted file mode 100644
index b83e9de317..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project
deleted file mode 100644
index 82b5c31c8d..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:47 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties
deleted file mode 100644
index 93ccfad587..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties
deleted file mode 100644
index fb9f31ea74..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JPA Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - EclipseLink JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml
deleted file mode 100644
index 75b03beccd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.eclipselink.feature"
- label="%featureName"
- version="3.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jpa.eclipselink.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.jpa.feature" version="3.0.0"/>
- <import feature="org.eclipse.jpt.common.eclipselink.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="javax.persistence"
- download-size="0"
- install-size="0"
- version="2.0.3.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.antlr"
- download-size="0"
- install-size="0"
- version="2.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.asm"
- download-size="0"
- install-size="0"
- version="2.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.core"
- download-size="0"
- install-size="0"
- version="2.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.jpa"
- download-size="0"
- install-size="0"
- version="2.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.core.ddlgen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index cb59e5f914..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 262082f5ee..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index d71318f213..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index cb59e5f914..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 262082f5ee..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project
deleted file mode 100644
index 5bc700173c..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:17 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties
deleted file mode 100644
index 147cc747be..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JPA Core JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools EclipseLink JPA Core JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml
deleted file mode 100644
index ae955cbd47..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.eclipselink.tests.feature"
- label="%featureName"
- version="3.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.tests.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 6365d3dc51..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-feature.temp.folder
-build.xml
-org.eclipse.jpt_sdk.feature_1.0.1.*
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project
deleted file mode 100644
index f5f4862fc6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:09:59 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index 191698f8c6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jpa.eclipselink.feature.source=org.eclipse.jpt.jpa.eclipselink.feature
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index 30feaf668b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JPA Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - EclipseLink JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index e615fbc8ee..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.eclipselink_sdk.feature"
- label="%featureName"
- version="3.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jpa.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/.project b/jpa/features/org.eclipse.jpt.jpa.feature/.project
deleted file mode 100644
index e1d95d7c7f..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:47 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/build.properties
deleted file mode 100644
index 93ccfad587..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.feature/feature.properties
deleted file mode 100644
index 9558aa952b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml
deleted file mode 100644
index 24932c2e7a..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.feature"
- label="%featureName"
- version="3.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jpa.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.feature" version="1.0.0"/>
- <import feature="org.eclipse.datatools.enablement.feature" version="1.8.0"/>
- <import feature="org.eclipse.datatools.sqldevtools.feature" version="1.8.0"/>
- <import feature="org.eclipse.datatools.connectivity.feature" version="1.8.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpa.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.db"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.db.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.jpa.jpql"
- download-size="0"
- install-size="0"
- version="1.0.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.jpa.jpql.source"
- download-size="0"
- install-size="0"
- version="1.0.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.collections"
- download-size="0"
- install-size="0"
- version="3.2.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.lang"
- download-size="0"
- install-size="0"
- version="2.1.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.velocity"
- download-size="0"
- install-size="0"
- version="1.5.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.oro"
- download-size="0"
- install-size="0"
- version="2.0.8.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.jdom"
- download-size="0"
- install-size="0"
- version="1.0.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 20288ae9d9..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index c07594d901..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index fba3ef0266..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index f47ad4ff08..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 021634dd5c..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008, 2010. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index c07594d901..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.project b/jpa/features/org.eclipse.jpt.jpa.tests.feature/.project
deleted file mode 100644
index 5466fa5d4b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:17 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties
deleted file mode 100644
index 7f06e1199c..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - Common and JPA JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools Common and JPA JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml
deleted file mode 100644
index f384addebd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.tests.feature"
- label="%featureName"
- version="3.1.100.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.tests.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpa.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.core.tests.extension.resource"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore
deleted file mode 100644
index 087aebe7cd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-feature.temp.folder
-build.xml
-org.eclipse.jpt.jpa_sdk.feature_1.0.1.*
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project
deleted file mode 100644
index f933b5eefa..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:09:59 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties
deleted file mode 100644
index a0610c3956..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jpa.feature.source=org.eclipse.jpt.jpa.feature
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties
deleted file mode 100644
index 6dbfeca679..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence Tools - JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml
deleted file mode 100644
index 068f419233..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa_sdk.feature"
- label="%featureName"
- version="3.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jpa.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.feature.source"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.doc.isv"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.project b/jpa/features/org.eclipse.jpt.tests.feature/.project
deleted file mode 100644
index 5ee70fa0ef..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.tests.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.project b/jpa/features/org.eclipse.jpt_sdk.feature/.project
deleted file mode 100644
index 4d523cea52..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt_sdk.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa_sdk.feature</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.branding/.project b/jpa/plugins/org.eclipse.jpt.branding/.project
deleted file mode 100644
index 0b315e62ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.branding/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.branding</name>
- <comment>renamed to org.eclipse.jpt.jpa.branding</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/.project b/jpa/plugins/org.eclipse.jpt.core/.project
deleted file mode 100644
index fff56584ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core</name>
- <comment>renamed to org.eclipse.jpt.jpa.core</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.project b/jpa/plugins/org.eclipse.jpt.db.ui/.project
deleted file mode 100644
index 64a5574ce5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.ui</name>
- <comment>renamed to org.eclipse.jpt.jpa.db.ui</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/.project b/jpa/plugins/org.eclipse.jpt.db/.project
deleted file mode 100644
index 604cfcb4a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db</name>
- <comment>renamed to org.eclipse.jpt.jpa.db</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/.project b/jpa/plugins/org.eclipse.jpt.doc.user/.project
deleted file mode 100644
index 61670ff4fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 105574155c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,9 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.doc.user;singleton:=true
-Bundle-Version: 1.4.1.qualifier
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.help;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.ui.cheatsheets;bundle-version="[3.3.100,4.0.0)"
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm b/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
deleted file mode 100644
index 29a91352c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>About this content</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref295" name="sthref295"></a>
-<h1>About this content</h1>
-<p>November, 2009</p>
-<a id="sthref296" name="sthref296"></a>
-<p class="subhead2">License</p>
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code>. For purposes of the EPL, "Program" will mean the Content.</p>
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <code><a href="http://www.eclipse.org">http://www.eclipse.org</a></code>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.html b/jpa/plugins/org.eclipse.jpt.doc.user/about.html
deleted file mode 100644
index 54a84efdaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>About this content</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1 Build 004" />
-<meta name="date" content="2009-11-16T9:56:23Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 3.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref290" name="sthref290"></a>
-<h1>About this content</h1>
-<p>November, 2009</p>
-<a id="sthref291" name="sthref291"></a>
-<p class="subhead2">License</p>
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code>. For purposes of the EPL, "Program" will mean the Content.</p>
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <code><a href="http://www.eclipse.org">http://www.eclipse.org</a></code>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2009,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties b/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
deleted file mode 100644
index 2b421082db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
+++ /dev/null
@@ -1,136 +0,0 @@
-bin.includes = cheatsheets/,\
- dcommon/,\
- img/,\
- META-INF/,\
- about.html,\
- build.properties,\
- concept_mapping.htm,\
- concept_persistence.htm,\
- concepts.htm,\
- concepts001.htm,\
- concepts002.htm,\
- concepts003.htm,\
- contexts.xml,\
- getting_started.htm,\
- getting_started001.htm,\
- getting_started002.htm,\
- getting_started003.htm,\
- getting_started004.htm,\
- index.xml,\
- legal.htm,\
- plugin.properties,\
- plugin.xml,\
- ref_details_orm.htm,\
- ref_jpa_facet.htm,\
- ref_mapping_general.htm,\
- ref_new_jpa_project.htm,\
- ref_new_jpa_project_wizard.htm,\
- ref_persistence_map_view.htm,\
- ref_persistence_outline.htm,\
- ref_persistence_perspective.htm,\
- ref_persistence_prop_view.htm,\
- ref_primary_key.htm,\
- ref_project_properties.htm,\
- reference.htm,\
- reference001.htm,\
- reference002.htm,\
- reference003.htm,\
- reference004.htm,\
- reference005.htm,\
- reference006.htm,\
- reference007.htm,\
- reference008.htm,\
- reference009.htm,\
- reference010.htm,\
- reference011.htm,\
- reference012.htm,\
- reference013.htm,\
- reference014.htm,\
- reference015.htm,\
- reference016.htm,\
- reference017.htm,\
- reference018.htm,\
- task_add_persistence.htm,\
- task_additonal_tables.htm,\
- task_create_new_project.htm,\
- task_inheritance.htm,\
- task_manage_orm.htm,\
- task_manage_persistence.htm,\
- task_mapping.htm,\
- tasks.htm,\
- tasks001.htm,\
- tasks002.htm,\
- tasks003.htm,\
- tasks004.htm,\
- tasks005.htm,\
- tasks006.htm,\
- tasks007.htm,\
- tasks008.htm,\
- tasks009.htm,\
- tasks010.htm,\
- tasks011.htm,\
- tasks012.htm,\
- tasks013.htm,\
- tasks014.htm,\
- tasks015.htm,\
- tasks016.htm,\
- tasks017.htm,\
- tasks018.htm,\
- tasks019.htm,\
- tasks020.htm,\
- tasks021.htm,\
- tasks022.htm,\
- tips_and_tricks.htm,\
- toc.xml,\
- whats_new.htm,\
- whats_new001.htm,\
- whats_new002.htm,\
- whats_new003.htm,\
- about.htm,\
- reference019.htm,\
- reference020.htm,\
- reference021.htm,\
- reference022.htm,\
- reference023.htm,\
- reference024.htm,\
- reference025.htm,\
- reference026.htm,\
- reference027.htm,\
- reference028.htm,\
- reference030.htm,\
- reference029.htm,\
- reference031.htm,\
- reference032.htm,\
- tasks023.htm,\
- tasks024.htm,\
- whats_new004.htm,\
- whats_new005.htm,\
- ref_persistence_xmll_editor.htm,\
- ref_EntityClassPage.htm,\
- ref_EntityPropertiesPage.htm,\
- ref_add_converter.htm,\
- ref_association_cardinality.htm,\
- ref_association_table.htm,\
- ref_create_custom_entities_wizard.htm,\
- ref_create_jpa_entity_wizard.htm,\
- ref_create_new_association_wizard.htm,\
- ref_customizIndividualEntities.htm,\
- ref_customizeDefaultEntityGeneration.htm,\
- ref_eclipselink_mapping_file.htm,\
- ref_java_page.htm,\
- ref_join_columns.htm,\
- ref_persistence_general.htm,\
- ref_selectTables.htm,\
- ref_select_cascade_dialog.htm,\
- ref_tableAssociations.htm,\
- task_create_jpa_entity.htm,\
- ref_configure_jaxb_class_generation_dialog.htm,\
- ref_jaxb_schema_wizard.htm,\
- ref_schema_from_classes_page.htm,\
- reference033.htm,\
- task_generate_classes_from_schema.htm,\
- task_generating_schema_from_classes.htm,\
- tasks025.htm,\
- tasks026.htm,\
- whats_new006.htm
-generateSourceBundle=false
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
deleted file mode 100644
index 6dbeedbeca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a JPA Project">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to create a JPA project.
-
-To learn more about using cheat sheets, or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="false" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-On the first page of the wizard, enter a project name and location, select your target runtime, and select a predefined project configuration.
-
-Click <b>Next</b> to display the next page of the wizard.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Select Project Facet" dialog="false" skip="false" href="/org.eclipse.jst.j2ee.doc.user/topics/ph-projects.html">
- <description>
- Use the Project Facet page to select a predefined project configuration or specific specific facets to include in the project.
-
-Click &quot;Next&quot; to display the next page of the wizard.
- </description>
- </item>
- <item title="Specify the JPA Facet" dialog="false" skip="false" href="/org.eclipse.jdt.doc.user/ref_jpa_facet.htm">
- <description>
- Use the JPA Facet page to specify the the vendor-specific JPA platform, the database connection to use, and the specific JPA implementation library.
-
-You can also specify if Dali should create an orm.xml file.
-
-If you do not have an active database connection, click <b>Add Connections</b> to create one.
-
-If you do not have a defined JPA implementation library, click <b>Configure default JPA implementation library</b> or <b>Configure user libraries</b> to define one.
-
-Click <b>Finish</b> to complete the wizard and open the open the project.
- </description>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully created a JPA project. Complete the additional cheat sheets to add Java persistent entities and map those entities to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
deleted file mode 100644
index b64e8afdee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
-This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to add a Java persistent entity to your Java project.
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the <b>Click to Begin</b> button below.
-Let's get started!
- </description>
- </intro>
- <item title="Create a JPA Project" skip="true">
- <description>
-To create a Persistent entity, you must create a JPA project. If you already have a JPA project, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>File->New->Project...</b> and choose <b>JPA->JPA Project</b> in the list. Complete each page of the Create JPA Project wizard to create a new JPA project.
- </description>
- </item>
- <item title="Open the JPA Development Perspective" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <action pluginId="org.eclipse.ui.cheatsheets" class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" param1="org.eclipse.jpt.ui.PersistencePerspective"/>
- <description>
-When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>Window->Open Perspective->Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the "Click to Perform" button to have the "Persistence" perspective opened automatically.
- </description>
- </item>
- <item title="Create a Java Class">
- <description>
-The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity">
- <description>
-Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the "Map As" field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Finish">
- <description>
-Congratulations! You have successfully added a JPA entity to your JPA project. Complete the additional cheat sheets to map the entity's fields to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
deleted file mode 100644
index 63307f226e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Map a Java Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to map the fields of a JPA entity entity to your database.
-
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-If you already have (and are connected to) a database connection, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-Complete each page of the wizard to create a new JPA project.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
-
-If you already have a JPA project, you may skip this step by clicking the &quot;Click to Skip&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Open the JPA Development Perspective" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <description>
- When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-If not, select <b>Window-&gt;Open Perspective-&gt;Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the &quot;Click to Perform&quot; button to have the &quot;Persistence&quot; perspective opened automatically.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.jpt.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create a Java Class" dialog="false" skip="false">
- <description>
- The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity" dialog="false" skip="false">
- <description>
- Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the &quot;Map As&quot; field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Add Fields to the Class" dialog="false" skip="true">
- <description>
- Now you will add some fields to the entity to map to rows in the database table.
-
-If your persistent entity already has fields to map, you may skip this step by clicking the &quot;Click to Skip&quot; button. If not, use the Java editor to add fields to the entity.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create the Mapping" dialog="false" skip="false" href="/org.eclipse.dali.doc.user/ref_entity_page.htm">
- <description>
- Now you are ready to map the entity fields to columns in the database table. In the Package Explorer, select the Java class.
-
-In the JPA Structure view, expand the persistent entity to display the fields. Select a field.
-
-The JPA Details view displays the information for the field. Use the Map As field to select the Basic mapping. Use the Column field to select a column from the database table.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully mapped the fields from a Java persistent entity to a column in a database table.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
deleted file mode 100644
index 59f7d97bfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Understanding OR mappings</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding OR mappings" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBDJFI" name="BABBDJFI"></a></p>
-<div class="sect1">
-<h1>Understanding OR mappings</h1>
-<p><a id="sthref21" name="sthref21"></a><a id="sthref22" name="sthref22"></a>The Dali OR (object-relational) Mapping Tool allows you to describe how your entity objects <span class="italic">map</span> to the data source (or other objects). This approach isolates persistence information from the object model&ndash;developers are free to design their ideal object model, and DBAs are free to design their ideal schema.</p>
-<p>These mappings transform an object data member type to a corresponding relational database data source representation. These OR mappings can also transform object data members that reference other domain objects stored in other tables in the database and are related through foreign keys.</p>
-<p>You can use these mappings to map simple data types including primitives (such as <code>int</code>), JDK classes (such as <code>String</code>), and large object (LOB) values. You can also use them to transform object data members that reference other domain objects by way of association where data source representations require object identity maintenance (such as sequencing and back references) and possess various types of multiplicity and navigability. The appropriate mapping class is chosen primarily by the cardinality of the relationship.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
deleted file mode 100644
index 3c7f80bf06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Understanding Java persistence</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding Java persistence" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABCAHIC" name="BABCAHIC"></a></p>
-<div class="sect1">
-<h1>Understanding Java persistence</h1>
-<p><a id="sthref19" name="sthref19"></a><span class="italic">Persistence</span> refers to the ability to store objects in a database and use those objects with transactional integrity. In a J2EE application, data is typically stored and persisted in the data tier, in a relational database.</p>
-<p><a id="sthref20" name="sthref20"></a><span class="italic">Entity beans</span> are enterprise beans that contain persistent data and that can be saved in various persistent data stores. The entity beans represent data from a database; each entity bean carries its own identity. Entity beans can be deployed using <span class="italic">application-managed persistence</span> or <span class="italic">container-managed persistence</span>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
deleted file mode 100644
index 7a140b7e90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Concepts</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Concepts" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref18" name="sthref18"></a></p>
-<h1>Concepts</h1>
-<p>This section contains an overview of concepts you should be familiar with when using Dali to create mappings for Java persistent entities.</p>
-<ul>
-<li>
-<p><a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></p>
-</li>
-<li>
-<p><a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a></p>
-</li>
-<li>
-<p><a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></p>
-</li>
-</ul>
-<p>In addition to these sections, you should review the following resources for additional information:</p>
-<ul>
-<li>
-<p>Eclipse Dali project: <code><a href="http://www.eclipse.org/webtools/dali">http://www.eclipse.org/webtools/dali</a></code></p>
-</li>
-<li>
-<p>Eclipse Web Tools Platform project: <code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code></p>
-</li>
-<li>
-<p>JSR 220 EJB 3.0 specification: <code><a href="http://www.jcp.org/en/jsr/detail?id=220">http://www.jcp.org/en/jsr/detail?id=220</a></code></p>
-</li>
-<li>
-<p>EclipseLink project: <code><a href="http://www.eclipse.org/eclipselink">http://www.eclipse.org/eclipselink</a></code></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
deleted file mode 100644
index 5104da12ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Understanding EJB 3.0 Java Persistence API</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding EJB 3.0 Java Persistence API" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBGFJG" name="BABBGFJG"></a></p>
-<div class="sect1">
-<h1>Understanding EJB 3.0 Java Persistence API</h1>
-<p>The Java 2 Enterprise Edition(J2EE) Enterprise JavaBeans (EJB) are a component architecture that you use to develop and deploy object-oriented, distributed, enterprise-scale applications. An application written according to the Enterprise JavaBeans architecture is scalable, transactional, and secure.</p>
-<p>The EJB 3.0 Java Persistence API (JPA) improves the EJB architecture by reducing its complexity through the use of metadata (annotations) and specifying programmatic defaults of that metadata.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
deleted file mode 100644
index 99f1e4397b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>The persistence.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The persistence.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDHAGIH" name="CHDHAGIH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref23" name="sthref23"></a>The persistence.xml file</h1>
-<p>The JPA specification requires the use of a <code>persistence.xml</code> file for deployment. This file defines the database and entity manager options, and may contain more than one persistence unit. To enable you to easily edit this information, Dali provides the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>. Alternatively, you can use the Eclipse XML Editor to create and maintain this information. See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-To work with multiple persistence units, comment out all but one persistence unit in <code>persistence.xml</code>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
deleted file mode 100644
index 9c887a7984..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>The orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDBIJAC" name="CHDBIJAC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref24" name="sthref24"></a>The orm.xml file</h1>
-<p>Although the JPA specification emphasizes the use of annotations to specify persistence, you can also use the <code>orm.xml</code> file to store this metadata. Dali enables you to create a stub <code>orm.xml</code> file for a JPA project using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>. See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The metadata must match the XSD specification of your selected JPA implementation.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>Dali provides comprehensive support for configuring XML mapping files through the <a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a> that is nearly identical to the annotation-based configuration in the Java source. Alternatively, you can also use the Eclipse XML Editor to create and maintain the metadata information in <code>orm.xml</code>.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a><br />
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml b/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
deleted file mode 100644
index a7a661aa44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
+++ /dev/null
@@ -1,646 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.contexts"?>
-<contexts>
- <context id="entity_accessType">
- <description>Specify how the variable is accessed: Property (default) or Field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_name">
- <description>The name of this entity. By default, the class name is used as the entity name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_table">
- <description>The database table assigned to this entity. By default, the class name is used as the database table name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverrides">
- <description>Specify a property or field to be overridden (from the default mappings).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesName">
- <description>Name of the database column.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesColumn">
- <description>The database column that overrides a property or field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="mapping_mapAs">
- <description>Specify how this attribute maps to the database.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_column">
- <description>The database column that contains the value for the attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnTable">
- <description>Name of the database table that contains the selected column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_fetchType">
- <description>Defines how data is loaded from the database: Eager (default) or Lazy</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_optional">
- <description>Specifies if this field is can be null.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueStrategy">
- <description>Determines how the primary key is generated: Auto (default), Sequence, Identity, or Table.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueGeneratorName">
- <description>Unique name of the generator.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_targetEntity">
- <description>The entity to which this attribute is mapped. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_cascadeType">
- <description>Specify which operations are propagated throughout the entity: All, Persist, Merge, or Move.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_mappedBy">
- <description>The field in the database table that owns the relationship.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinColumnName">
- <description>The name of the database column that contains the foreign key reference for the entity association.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinReferencedColumn">
- <description>Name of the join table that contains the foreign key column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverrides">
- <description>Specify to override the default mapping of an entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverridesColumn">
- <description>The database column that is being mapped to the entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="entity_mapAs">
- <description>Specify the type of persistent domain object for the Java class: Persistent, Embedded, or Mapped Superclass.</description>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_inheritanceStrategy">
- <description>Specify how an entity may inherit properties from other entities: Single table, One table per class, or Joined tables.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorColumn">
- <description>Use to specify the name of the discriminator column when using a Single or Joined inheritance strategy.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorType">
- <description>Use this field to set the discriminator type to CHAR or INTEGER (instead of its default: String). The discriminator value must conform to this type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorValue">
- <description>Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified discriminator type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="mapping_orderBy">
- <description>Specify the default order for objects returned from a query.
-orderby_list::= orderby_item [,orderby_item]
-orderby_item::= [property_or_field_name] [ASC | DESC]
-For example: "lastName ASC ,salary DESC" </description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an Entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableName">
- <description>Specify the name of the database table that defines the foreign key for a many-to-many or a unidirectional one-to-many association. You can configure the join table with a specific catalog or schema, configure one or more join table columns with a unique constraint, and use multiple join columns per entity.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableJoinColumns">
- <description>Specify two or more join columns (that is, a composite primary key).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableInverseJoinColumns">
- <description>Specify the join column on the owned (or inverse side) of the association: the owned entity's primary key column. </description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="properties_javaPersistence">
- <description>Use the Java Persistence options on the Properties page to select the database connection to use with the project.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceConnection">
- <description>The database connection used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceSchema">
- <description>The database schema used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="dialog_addPersistence">
- <description>Use the Add Persistence dialog to define the database connection use to store the persistence entities.</description>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="persistenceOutline">
- <description>The JPA Structure view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor.</description>
- <topic label="JPA Structure view" href="ref_persistence_outline.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_generateEntities">
- <description>Use the Generate Entities dialog to create Java persistent entities based on your database tables.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm.htm" />
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_generateEntities_source">
- <description>The project folder name in which to generate the Java persistent entities. Click Browse to select an existing folder.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_package">
- <description>The package in which to generate the Java persistent entities, or click Browse to select an existing package.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_tables">
- <description>Select the tables from which to create Java persistent entities.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_addJavaPersistence">
- <description>Use this dialog to define the database connection used to store the persistence entities and to create the persistence.xml file.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="dialog_newJPAProject">
- <description>Use this dialog to define the new JPA project name, its location, target runtime, and other configuration settings.</description>
- <topic label="New JPA Project page" href="ref_new_jpa_project.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_addJavaPersistence_database">
- <description>Use these fields to define the database connection used to store the persistent entities.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_classpath">
- <description>Use this option to add libraries or JARs that contain the Java Persistence API (JPA) and entities to the project’s Java Build Path.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_packaging">
- <description>Use these fields to create the persistence.xml file. Select the persistence version, the name of the JPA provider, and a unique name to identify the persistence unit.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="wizard_generateDDL_options ">
- <description>Use this page to select which script options will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Options page " href="ref_options.htm" />
- </context>
- <context id="wizard_generateDDL_objects ">
- <description>Use this page to select which elements will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Objects page " href="ref_objects.htm" />
- </context>
- <context id="wizard_generateDDL_save ">
- <description>Use this page to select the filename and location of the generated script. You can also preview the script and specify to run or continue editing the script after generation.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Save and Run DDL page " href="ref_save_and_run.htm" />
- </context>
- <context id="wizard_generateDDL_summary ">
- <description>This page shows the settings that you selected for the generated DDL. To change any option click "Back" or click "Finish" to continue.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- </context>
- <context id="mapping_tableGeneratorName">
- <description>The name of the table sequence generator. This name is global to to the persistence unit (across all generator types).</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorTable">
- <description>The database table that stores the generated ID values. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumn">
- <description>The database column of the generator table that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorValueColumn">
- <description>The name for the column that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumnValue">
- <description>The database column of the generator table that defines the primary key value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_databaseAuthorization">
- <description>Use to connect (log in) to a database connection to use with your Java persistent entities.
- You must have a defined database connection (and be connected) to add persistence. </description>
- <topic label="Add persistence to a Java project" href="task_add_persistence_project.htm"/>
- </context>
- <context id="mapping_temporal">
- <description>Specify if the mapped field contains a Date (java.sql.Date), Time (java.sql.Time), or Timestamp (java.sql.Timestamp) value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_primaryKeyGeneration">
- <description>Define how the primary key is generated</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGenerator">
- <description>Specify to use a specific database table for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGenerator">
- <description>Specify to use a specific sequence for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorName">
- <description>Name of the sequence.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorSequence">
- <description> </description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_lob">
- <description>Specify if the field is mapped to java.sql.Clob or java.sql.Blob.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_enumerated">
- <description>Specify how to persist enumerated constraints if the String value suits your application requirements or to match an existing database schema.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_editInverseJoinColumn">
- <description>.</description>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="entity_catalog">
- <description>The database catalog that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_schema">
- <description>The database schema that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="orm_package">
- <description>The Java package that contains the persistent entities to which the orm.xml file applies.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_schema">
- <description>The database schema to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_catalog">
- <description>The database catalog to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_access">
- <description>The default access method for variables in this project: Property or Field.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_cascade">
- <description>Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_xml">
- <description>Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="dialog_JPAPlatform">
- <description>Specify the vendor-specific JPA implementation.Default is Generic..</description>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
- <context id="dialog_createORM">
- <description>Create an initial orm.xml file. Use this file to specify project and persistence unit defaults.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
-
- <context id="caching_defaultType">
- <description>Select the default caching strategy for the project. The default is Weak with Soft Subcache.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="caching_defaultSize">
- <description>Select the default size of the cache. The default is 100 items.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="caching_defaultShared">
- <description>Specify if cached instances should be in the shared cache or in a client isolated cache.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_level">
- <description>Specifies the amount and detail of log output by selecting the log level. Default is Info level.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_timeStamp">
- <description>Control whether the timestamp is logged in each log entry. Default is True.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_thread">
- <description>Control whether a thread identifier is logged in each log entry. Default is True.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_session">
- <description>Control whether an EclipseLink session identifier is logged in each log entry. Default is True.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_exceptions">
- <description>Control whether the exceptions thrown from within the code are logged prior to returning the exception to the calling application. Ensures that all exceptions are logged and not masked by the application code.. Default is False.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_sessionName">
- <description>Specify the name by which the EclipseLink session is stored in the static session manager.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_sessionsXml">
- <description>Specify persistence information loaded from the EclipseLink session configuration file. You can use this option as an alternative to annotations and deployment XML.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_targetDatabase">
- <description></description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_targetServer">
- <description> </description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="dialog_newJPAProjectJava">
- <description>Use this dialog to include existing Java source files in this project.</description>
- <topic label="Java page" href="ref_java_page.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_newJPAProjectFacet">
- <description>Use this dialog to specify your vender-specific platform, JPA implementation library, and database connection.</description>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_entityClassPage">
- <description>Use this dialog to specify package, class name, and inheritance properties of the entity to create.</description>
- <topic label="Entity Class page" href="ref_EntityClassPage.htm" />
- <topic label="New JPA Entity wizard" href="ref_create_jpa_entity_wizard.htm" />
- <topic label="Creating a new JPA entity" href="task_create_jpa_entity.htm" />
- </context>
- <context id="dialog_entityPropertiesPage">
- <description>Use this dialog to specify the entity name, associated table, and mapped fields.</description>
- <topic label="Entity Properties page" href="ref_EntityPropertiesPage.htm" />
- <topic label="New JPA Entity wizard" href="ref_create_jpa_entity_wizard.htm" />
- <topic label="Creating a new JPA entity" href="task_create_jpa_entity.htm" />
- </context>
- <context id="dialog_selectTablesPage">
- <description>Use this dialog to specify the database tables from which to generate entities.</description>
- <topic label="Select Tables page" href="ref_selectTables.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
- <context id="dialog_tableAssociationsPage">
- <description>Use this dialog to create or edit the association between the database table and entity.</description>
- <topic label="Table Associations page" href="ref_tableAssociations.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
- <context id="dialog_customizeDefaultEntityGeneration">
- <description>Use this dialog to specify the table mapping and domain class information for the generated entity.</description>
- <topic label="Customize Default Entity Generation page" href="ref_customizeDefaultEntityGeneration.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
- <context id="dialog_customizeIndividualEntities">
- <description>Use this dialog to specify the table mapping and domain class information for the generated entity.</description>
- <topic label="Customize Individual Entities page" href="ref_customizIndividualEntities.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
-
- <context id="dialog_associationTablesPage">
- <description>Use this dialog to specify the association tables for an entity.</description>
- <topic label="Association Tables page" href="ref_association_tables.htm" />
- <topic label="Create New Association wizard" href="ref_create_new_association_wizard.htm" />
- </context>
- <context id="dialog_joinColumnsPage">
- <description>Use this dialog to specify the join columns of an association table.</description>
- <topic label="Join Columns page" href="ref_join_columns.htm" />
- <topic label="Create New Association wizard" href="ref_create_new_association_wizard.htm" />
- </context>
- <context id="dialog_associationCardinalityPage">
- <description>Use this dialog to specify cardinality of an association table.</description>
- <topic label="Association Cardinality page" href="ref_association_cardinality.htm" />
- <topic label="Create New Association wizard" href="ref_create_new_association_wizard.htm" />
- </context>
- <context id="dialog_selectCascade">
- <description>Specify which operations are propagated throughout the association: All, Persist, Merge, Remove, or Refresh.</description>
- <topic label="Select Cascade page" href="ref_select_cascade_dialog.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="persistence_general">
- <description>Specify the general persistence options.</description>
- <topic label="General page" href="ref_persistence_general" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_connection">
- <description>Specify the data source or JDBC connection properties.</description>
- <topic label="Connection page" href="ref_persistence_connection" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_customization">
- <description>Specify the default or entity specific EclipseLink customization and validation properties.</description>
- <topic label="Customization page" href="ref_persistence_connection" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_caching">
- <description>Configure the session or entity specific EclipseLink caching properties.</description>
- <topic label="Caching page" href="ref_persistence_caching" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_logging">
- <description>Configure the EclipseLink logging properties.</description>
- <topic label="Logging page" href="ref_persistence_logging" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_options">
- <description>Configure the EclipseLink session and miscellanous options.</description>
- <topic label="Options page" href="ref_persistence_options" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_schemaGeneration">
- <description>Configure the schema generation properties.</description>
- <topic label="Schema Generation page" href="ref_persistence_schemaGeneration" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_properties">
- <description>Configure the properties defined for the persistence unit.</description>
- <topic label="Properties page" href="ref_persistence_properties" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_source">
- <description>Configure the properties defined for the persistence unit.</description>
- <topic label="Properties page" href="ref_persistence_properties" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="dialog_eclipselink_mapping_file">
- <description>Configure the properties defined for the persistence unit.</description>
- <topic label="New EclipseLink Mapping File page" href="ref_eclipselink_mapping_file" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the orm.xml file" href="task_manage_orm" />
- </context>
- <context id="dialog_create_new_converters">
- <description>Use this dialog to create a new EclipseLink conveter.</description>
- <topic label="Add Converter dialog" href="ref_add_converter" />
- <topic label="Managing the orm.xml file" href="task_manage_orm" />
- </context>
-
-<!-- Added for 2.3 -->
- <context id="properties_canonicalMetamodel">
- <description>Specifies if the project model uses the Canonical Metamodel. </description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_cacheable">
- <description>Specify if the entity uses the @Cachable annotation. Default is @Cachable(false).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_primaryKeyClass">
- <description>Click Browse and select the primary key for the entity. Clicking the field name, which is represented as a hyperlink, allows you to create a new class.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- </context>
- <context id="wizard_jaxbschema_classes">
- <description>Select the project, package, or classes from which to generate the XML schema. Click Finish to generate the schema</description>
- <topic label="Generate Schema from JAXB Classes wizard" href="ref_jaxb_schema_wizard.htm"/>
- <topic label="Generating schema from classes" href="task_generating_schema_from_classes.htm"/>
- </context>
- <context id="configure_jaxb_class_generation_dialog">
- <description>Enter the JAXB class generation settings and click Finish to generate classes. All fields are optional except for the source folder.</description>
- <topic label="Configure JAXB Class Generation dialog" href="ref_configure_jaxb_class_generation_dialog.htm"/>
- <topic label="Generating JAXB Classes from a Schema" href="task_generate_classes_from_schema.htm"/>
- </context>
-
-
-
-
-
-</contexts>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
deleted file mode 100644
index baf6127928..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
+++ /dev/null
@@ -1,21 +0,0 @@
-@import "../../../PRODUCT_PLUGIN/book.css";
-
-span.control, span.gui-object-action, p.subhead2, span.bold, p.notep1 {
- font-weight: bold;
-}
-
-span.name, p.titleinfigure, span.italic {
- font-style: italic;
-}
-
-p.titleinfigure, p.subhead2 {
- padding-top: 10px;
-}
-
-span.code {
- font-family: monospace;
-}
-
-span.copyrightlogo {font-size: 0.8em}
-
-.footer {margin-top: 2em;border-top:1px solid #cccccc;padding-top:1em;} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
deleted file mode 100644
index 382ec67619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
-<!-- <meta http-equiv="refresh" content="0;url=../../legal.htm"> -->
-</head>
-<body>
-<p><a href="../../legal.htm">License Information</a></p>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
deleted file mode 100644
index c993ad7ac6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Getting started</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Getting started" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref2" name="sthref2"></a></p>
-<h1>Getting started</h1>
-<p>This section provides information on getting started with the Java Persistence Tools.</p>
-<ul>
-<li>
-<p><a href="getting_started001.htm#BABEFHCD">Requirements and installation</a></p>
-</li>
-<li>
-<p><a href="getting_started002.htm#BABIGCJA">Dali quick start</a></p>
-</li>
-</ul>
-<p>For additional information, please visit the Dali home page at:</p>
-<p><code><a href="http://www.eclipse.org/webtools/dali">http://www.eclipse.org/webtools/dali</a></code>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
deleted file mode 100644
index 21cf961743..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Requirements and installation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Requirements and installation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEFHCD" name="BABEFHCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Requirements and installation<a id="sthref3" name="sthref3"></a><a id="sthref4" name="sthref4"></a></h1>
-<p>Before installing Dali, ensure that your environment meets the following <span class="italic">minimum</span> requirements:</p>
-<ul>
-<li>
-<p>Eclipse 3.6 (<code><a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a></code>)</p>
-</li>
-<li>
-<p>Java Runtime Environment (JRE) 1.5 (<code><a href="http://java.com">http://java.com</a></code>)</p>
-</li>
-<li>
-<p>Eclipse Web Tools Platform (WTP) 3.2 (<code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code>)</p>
-</li>
-<li>
-<p>Java Persistence API (JPA) for Java EE 5. For example, the EclipseLink implementation for JPA can be obtained from: <code><a href="http://www.eclipse.org/eclipselink/">http://www.eclipse.org/eclipselink/</a></code></p>
-</li>
-</ul>
-<p>Refer to <code><a href="http://www.eclipse.org/webtools/dali/gettingstarted_main.html">http://www.eclipse.org/webtools/dali/gettingstarted_main.html</a></code> for additional installation information.</p>
-<p><a id="sthref5" name="sthref5"></a>Dali is included as part of WTP 3.2. No additional installation or configuration is required.</p>
-<a id="sthref6" name="sthref6"></a>
-<p class="subhead2">Accessibility Features</p>
-<p>Dali supports the standard accessibility features in Eclipse, including the following:</p>
-<ul>
-<li>
-<p>Navigating the user interface using the keyboard.</p>
-</li>
-<li>
-<p>Specifying general accessibility preferences for the editor.</p>
-</li>
-</ul>
-<p>See <a href="../org.eclipse.platform.doc.user/concepts/accessibility/accessmain.htm">Accessibility Features in Eclipse</a> in the <span class="italic">Workbench User Guide</span> for details.</p>
-<a id="sthref7" name="sthref7"></a>
-<p class="subhead2">Help Accessibility</p>
-<p>The documentation and help contains markup to facilitate access by the disabled community. See <a href="../org.eclipse.platform.doc.user/tasks/help_accessibility.htm">Help Accessibility</a> in the <span class="italic">Workbench User Guide</span> for details.</p>
-<p>When using the help, be aware of the following:</p>
-<ul>
-<li>
-<p>Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.</p>
-</li>
-<li>
-<p>This documentation may contain links to Web sites of other companies or organizations that we do not control. We neither evaluate nor make any representations regarding the accessibility of these Web sites.</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
deleted file mode 100644
index 3285315b65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Dali quick start</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali quick start" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIGCJA" name="BABIGCJA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dali quick start</h1>
-<p><a id="sthref8" name="sthref8"></a>This section includes information to help you quickly start using Dali to create relational mappings between Java persistent entities and database tables.</p>
-<ul>
-<li>
-<p><a href="getting_started003.htm#BABDFHDA">Creating a new JPA project</a></p>
-</li>
-<li>
-<p><a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity with persistent fields</a></p>
-</li>
-</ul>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="tips_and_tricks.htm#CHDHGHBF">Tips and tricks</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
deleted file mode 100644
index 2cbac78532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a new JPA project</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDFHDA" name="BABDFHDA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a new JPA project</h1>
-<p><a id="sthref9" name="sthref9"></a>This quick start shows how to create a new JPA project.</p>
-<ol>
-<li>
-<p><span class="bold">Select File &gt; New &gt; Project</span>. The Select a Wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also select the JPA perspective and then select <span class="bold">File &gt; New &gt; JPA Project</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-<li>
-<p>Select <span class="bold">JPA Project</span> and then click <span class="bold">Next</span>. The <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> appears.</p>
-</li>
-<li>
-<p>Enter a <span class="gui-object-action">Project name</span> (such as <code>QuickStart</code>).</p>
-</li>
-<li>
-<p>If needed, select the <span class="bold">Target Runtime</span> (such as <code>Apache Tomcat</code>) and configuration, such as <span class="bold">Utility JPA Project with Java 5.0</span> and then click <span class="bold">Next</span>. The Java source page appears.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Target Runtime is not required for Java SE development.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>If you have existing Java source files, add them to your classpath and then click <span class="bold">Next</span>. The <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-</li>
-<li>
-<p>On the JPA Facet dialog, select your vendor-specific JPA platform (or select <span class="bold">Generic</span>), database connection (or create a new connection), JPA implementation library (such as EclipseLink), define how Dali should manage persistent classes, and then click <span class="bold">Finish</span>.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-Select <span class="bold">Override the Default Schema for Connection</span> if you require a schema other than the one that Dali derives from the connection information, which may be incorrect in some cases. Using this option, you can select a development time schema for defaults and validation.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-</ol>
-<p>Eclipse adds the project to the workbench and opens the JPA perspective.</p>
-<div class="figure"><a id="sthref10" name="sthref10"></a>
-<p class="titleinfigure">JPA Project in Project Explorer</p>
-<img src="img/quickstart_project.png" alt="Package Explorer showing the JPA project." title="Package Explorer showing the JPA project." /><br /></div>
-<!-- class="figure" -->
-<p>Now that you have created a project with persistence, you can continue with <a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity with persistent fields</a>.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
deleted file mode 100644
index 249ea76a96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
+++ /dev/null
@@ -1,204 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a Java persistent entity with persistent fields</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a Java persistent entity with persistent fields" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFGDDG" name="BABFGDDG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a Java persistent entity with persistent fields</h1>
-<p><a id="sthref11" name="sthref11"></a>This quick start shows how to create a new persistent Java entity. We will create an entity to associate with a database table. You will also need to add the ADDRESS table to your database.</p>
-<ol>
-<li>
-<p>Select the JPA project in the Navigator or Project Explorer and then click <span class="bold">New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-</li>
-<li>
-<p>Select <span class="bold">JPA &gt; Entity</span> and then click <span class="bold">Next</span>. The <a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a> appears.</p>
-</li>
-<li>
-<p>Enter the package name (such as <code>quickstart.demo.model</code>), the class name (such as <code>Address</code>) and then click <span class="bold">Next</span>. The <a href="ref_EntityPropertiesPage.htm#CIADECIA">Entity Properties page</a> appears, which enables you to define the persistence fields, which you will map to the columns of a database table.</p>
-</li>
-<li>
-<p><a id="sthref12" name="sthref12"></a><a id="sthref13" name="sthref13"></a>Use the Entity Fields dialog (invoked by clicking <span class="bold">Add</span>) to add persistence fields to the Address class:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-private Long id;
-private String city;
-private String country;
-private String stateOrProvince;
-private String postalCode;
-private String street;
-</pre>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-You will also need to add the following columns to the ADDRESS database table:
-<pre xml:space="preserve" class="oac_no_warn">
-NUMBER(10,0) ADDRESS_ID (primary key)
-VARCHAR2(80) PROVINCE
-VARCHAR2(80) COUNTRY
-VARCHAR2(20) P_CODE
-VARCHAR2(80) STREET
-VARCHAR2(80) CITY
-</pre>
-<pre xml:space="preserve" class="oac_no_warn">
-</pre></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. With the Create JPA Entity completed, Eclipse displays the <span class="bold">Address</span> entity in the JPA Structure view.</p>
-<p>Address.java includes the <code>@Entity</code> annotation, the persistence fields, as well as <code>getter</code> and <code>setter</code> methods for each of the fields.</p>
-</li>
-</ol>
-<div class="figure"><a id="sthref14" name="sthref14"></a>
-<p class="titleinfigure">Address Entity in Address.java</p>
-<img src="img/java_editor_address.png" alt="Java editor with the Address entity." title="Java editor with the Address entity." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse also displays the <span class="bold">Address</span> entity in the JPA Structure view:</p>
-<div class="figure"><a id="sthref15" name="sthref15"></a>
-<p class="titleinfigure">Address Entity in the JPA Structure View</p>
-<img src="img/address_java_JPA_structure_quickstart.png" alt="Address.java in the JPA Structure View." title="Address.java in the JPA Structure View." /><br /></div>
-<!-- class="figure" -->
-<ol>
-<li>
-<p>Select the <span class="gui-object-action">Address</span> class in the Project Explorer view.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, notice that Dali has automatically associated the ADDRESS database table with the entity because they are named identically.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Depending on your database connection type, you may need to specify the <span class="bold">Schema</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="figure"><a id="sthref16" name="sthref16"></a>
-<p class="titleinfigure">JPA Details View for Address Entity</p>
-<img src="img/address.java_jpa_details.png" alt="Address.java in the JPA Details view." title="Address.java in the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-After associating the entity with the database table, you should update the <code>persistence.xml</code> file to include this JPA entity.
-<p>Right-click the <code>persistence.xml</code> file in the Project Explorer and select <span class="bold">JPA Tools &gt; Synchronize Class List</span>. Dali adds the following to the <code>persistence.xml</code> file:</p>
-<p><code>&lt;class&gt;quickstart.demo.model.Address&lt;/class&gt;</code></p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<p>Now we are ready to map each fields in the Address class to a column in the database table.</p>
-<ol>
-<li>
-<p>Select the <span class="gui-object-action">id</span> field in the JPA Details view.</p>
-</li>
-<li>
-<p>Right click id and then select <span class="bold">Map As &gt; id</span>.</p>
-</li>
-<li>
-<p>In the JPA Details view, select <span class="bold">ADDRESS_ID</span> in the Name field:</p>
-<div class="figure"><a id="sthref17" name="sthref17"></a>
-<p class="titleinfigure">JPA Details View for the addressId Field</p>
-<img src="img/address_id_details_quickstart.png" alt="The JPA Details view for the Address entity&rsquo;s id attribute." title="The JPA Details view for the Address entity&rsquo;s id attribute." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse adds the following annotations to the Address entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="ADDRESS_ID")
-</pre></li>
-<li>
-<p>Map each of the following fields (as <span class="bold">Basic</span> mappings) to the appropriate database column:</p>
-<div class="inftblhruleinformal">
-<table class="HRuleInformal" title="This table describes the mappings for each of the fields in the Address entity." summary="This table describes the mappings for each of the fields in the Address entity." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="*" />
-<col width="33%" />
-<col width="33%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Field</th>
-<th align="left" valign="bottom" id="r1c2-t8">Map As</th>
-<th align="left" valign="bottom" id="r1c3-t8">Database Column</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">city</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r2c1-t8 r1c3-t8">CITY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">country</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r3c1-t8 r1c3-t8">COUNTRY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">postalCode</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r4c1-t8 r1c3-t8">P_CODE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8">provinceOrState</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r5c1-t8 r1c3-t8">PROVINCE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t8" headers="r1c1-t8">street</td>
-<td align="left" headers="r6c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r6c1-t8 r1c3-t8">STREET</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformal" --></li>
-</ol>
-<p>Dali automatically maps some fields to the correct database column (such as the city field to the City column) if the names are identical.</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png
deleted file mode 100644
index bdcf00838f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png
deleted file mode 100644
index 7ef40cf6c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png
deleted file mode 100644
index 1af51a9f9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png
deleted file mode 100644
index 0360e0a86c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png
deleted file mode 100644
index 69797a803c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.png
deleted file mode 100644
index 9567616b7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.png
deleted file mode 100644
index 237bdee290..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
deleted file mode 100644
index d66300e421..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
deleted file mode 100644
index 3a4964632c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.png
deleted file mode 100644
index b911d0280b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
deleted file mode 100644
index 4daa25c7c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.png
deleted file mode 100644
index 86eef3abe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png
deleted file mode 100644
index b193753e98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
deleted file mode 100644
index 22b6875f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
deleted file mode 100644
index 3146482609..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
deleted file mode 100644
index b76dd9faf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
deleted file mode 100644
index 47428906e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.png
deleted file mode 100644
index c9b222e8cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png
deleted file mode 100644
index 30550ea033..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png
deleted file mode 100644
index 2b616033dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png
deleted file mode 100644
index 3355741af7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png
deleted file mode 100644
index 086ea6e9eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png
deleted file mode 100644
index 2604fd9284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png
deleted file mode 100644
index e28e8fa168..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.png
deleted file mode 100644
index f4c7968a69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png
deleted file mode 100644
index 1b0b7ff4bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png
deleted file mode 100644
index 48294edaf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png
deleted file mode 100644
index abe9dc8d20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png
deleted file mode 100644
index 44d52b8bc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png
deleted file mode 100644
index fdefb5d781..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png
deleted file mode 100644
index eb8022e16c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png
deleted file mode 100644
index ccacc19f1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png
deleted file mode 100644
index 398ea2c11f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png
deleted file mode 100644
index fc97ceb1fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png
deleted file mode 100644
index 5ddc989dfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png
deleted file mode 100644
index 74d9bbd66c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png
deleted file mode 100644
index 750488f49d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png
deleted file mode 100644
index a87371215b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png
deleted file mode 100644
index 7607808317..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png
deleted file mode 100644
index 07425ad08a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png
deleted file mode 100644
index ab079c2484..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
deleted file mode 100644
index 88381a5a80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
deleted file mode 100644
index 4bbc744806..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
deleted file mode 100644
index 60af21f5ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
deleted file mode 100644
index 769aa825e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png
deleted file mode 100644
index 97557ee963..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
deleted file mode 100644
index 48ca05099b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
deleted file mode 100644
index a41f9f53ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png
deleted file mode 100644
index 2cebe90add..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png
deleted file mode 100644
index 182350246d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png
deleted file mode 100644
index 049c9d15b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.png
deleted file mode 100644
index 587e61c9c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.png
deleted file mode 100644
index a57c9314c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
deleted file mode 100644
index a359f64651..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.png
deleted file mode 100644
index b5b40be797..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
deleted file mode 100644
index 1aa1dbe059..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png
deleted file mode 100644
index e8beaceb79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.png
deleted file mode 100644
index 96fa4d27c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml b/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
deleted file mode 100644
index acf9beb953..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
+++ /dev/null
@@ -1,668 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<index version="1.0">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref116" /></entry>
- </entry>
- <entry keyword="@Column">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref245" /></entry>
- </entry>
- <entry keyword="@DiscriminatorColumn">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref96" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref239" /></entry>
- </entry>
- <entry keyword="@DiscriminatorValue">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref98" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref237" /></entry>
- </entry>
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref81" /></entry>
- </entry>
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref120" /></entry>
- </entry>
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref124" /></entry>
- </entry>
- <entry keyword="@Entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref74" /></entry>
- </entry>
- <entry keyword="@Enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref255" /></entry>
- </entry>
- <entry keyword="@GeneratedValue">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref265" /></entry>
- </entry>
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref128" /></entry>
- </entry>
- <entry keyword="@Inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref94" /></entry>
- </entry>
- <entry keyword="@JoinColumn">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref139" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref149" /></entry>
- <entry keyword="Join Table Information"><topic href="reference011.htm#sthref261" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference012.htm#sthref264" /></entry>
- </entry>
- <entry keyword="@Lob">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref250" /></entry>
- </entry>
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref132" /></entry>
- </entry>
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref137" /></entry>
- </entry>
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref88" /></entry>
- </entry>
- <entry keyword="@NamedQuery">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref108" /></entry>
- </entry>
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref142" /></entry>
- </entry>
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref146" /></entry>
- </entry>
- <entry keyword="@OrderBy">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref259" /></entry>
- </entry>
- <entry keyword="@SequenceGenerator">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref267" /></entry>
- </entry>
- <entry keyword="@Temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref252" /></entry>
- </entry>
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref152" /></entry>
- </entry>
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref156" /></entry>
- </entry>
- <entry keyword="architecture of Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference033.htm#sthref303" /></entry>
- </entry>
- <entry keyword="association tables">
- <entry keyword="Create New Association"><topic href="ref_create_new_association_wizard.htm#sthref221" /></entry>
- </entry>
- <entry keyword="attribute overrides">
- <entry keyword="Attribute overrides"><topic href="reference007.htm#sthref228" /></entry>
- </entry>
- <entry keyword="Attribute Overrides - in Java Details view">
- <entry keyword="Attribute overrides"><topic href="reference007.htm#sthref230" /></entry>
- </entry>
- <entry keyword="attributes">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref244" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref21" /></entry>
- </entry>
- </entry>
- <entry keyword="basic mapping">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref117" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref115" /></entry>
- </entry>
- <entry keyword="(See also mappings)"></entry>
- </entry>
- <entry keyword="caching">
- <entry keyword="Caching"><topic href="reference020.htm#sthref278" /></entry>
- </entry>
- <entry keyword="canonical metamodel">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref298" /></entry>
- </entry>
- <entry keyword="cardinality - association tables">
- <entry keyword="Association Cardinality"><topic href="ref_association_cardinality.htm#sthref224" /></entry>
- </entry>
- <entry keyword="classes">
- <entry keyword="adding persistence to">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref69" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref80" /></entry>
- </entry>
- <entry keyword="entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref72" /></entry>
- </entry>
- <entry keyword="generating schema from">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref190" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref198" /></entry>
- </entry>
- <entry keyword="managed">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref50" /></entry>
- </entry>
- <entry keyword="managing persistent classes">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref207" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref86" /></entry>
- </entry>
- <entry keyword="synchronizing">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref52" /></entry>
- </entry>
- </entry>
- <entry keyword="columns">
- <entry keyword="discriminator">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref97" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref240" /></entry>
- </entry>
- <entry keyword="join">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref138" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref148" /></entry>
- <entry keyword="Join Table Information"><topic href="reference011.htm#sthref260" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference012.htm#sthref263" /></entry>
- </entry>
- <entry keyword="mapping to">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref246" /></entry>
- </entry>
- <entry keyword="value">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref99" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref238" /></entry>
- </entry>
- </entry>
- <entry keyword="connection pool">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref51" /></entry>
- </entry>
- <entry keyword="converting Java project to JPA">
- <entry keyword="Converting a Java Project to a JPA Project"><topic href="tasks001.htm#sthref37" /></entry>
- </entry>
- <entry keyword="Create a JPA Project Wizard">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref29" /></entry>
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref194" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref202" /></entry>
- </entry>
- <entry keyword="Create New JPA Project wizard">
- <entry keyword="Create New JPA Project wizard"><topic href="ref_new_jpa_project_wizard.htm#sthref204" /></entry>
- </entry>
- <entry keyword="database tables">
- <entry keyword="generating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref161" /></entry>
- </entry>
- </entry>
- <entry keyword="database - persistence">
- <entry keyword="connection">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref293" /></entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref295" /></entry>
- </entry>
- </entry>
- <entry keyword="derived ID">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref257" /></entry>
- </entry>
- <entry keyword="developer documentation - Dali">
- <entry keyword="Dali Developer Documentation"><topic href="reference033.htm#sthref302" /></entry>
- </entry>
- <entry keyword="eager fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref248" /></entry>
- </entry>
- <entry keyword="embeddable class">
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref82" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref79" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded ID mapping">
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref125" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref123" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded mapping">
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref121" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref119" /></entry>
- </entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="@Entity annotation">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref75" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref20" /></entry>
- </entry>
- <entry keyword="creating">
- <entry keyword="Creating a JPA Entity"><topic href="task_create_jpa_entity.htm#sthref40" /></entry>
- </entry>
- <entry keyword="customizing">
- <entry keyword="Customize Individual Entities"><topic href="ref_customizIndividualEntities.htm#sthref220" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref83" /></entry>
- </entry>
- <entry keyword="from tables">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref158" /></entry>
- <entry keyword="Select Tables"><topic href="ref_selectTables.htm#sthref216" /></entry>
- </entry>
- <entry keyword="generating">
- <entry keyword="Customize Default Entity Generation"><topic href="ref_customizeDefaultEntityGeneration.htm#sthref219" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref227" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref89" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref13" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref11" /></entry>
- </entry>
- <entry keyword="persistent">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref70" /></entry>
- <entry keyword="Entity"><topic href="tasks006.htm#sthref76" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref233" /></entry>
- </entry>
- </entry>
- <entry keyword="Entity Class page">
- <entry keyword="Selecting the Create a JPA Entity Wizard"><topic href="task_create_jpa_entity.htm#sthref43" /></entry>
- </entry>
- <entry keyword="Entity Properties page">
- <entry keyword="&lt;a id=&quot;sthref43&quot; name=&quot;sthref43&quot;&gt;&lt;/a&gt;The Entity Class Page"><topic href="task_create_jpa_entity.htm#sthref45" /></entry>
- </entry>
- <entry keyword="enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref254" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref256" /></entry>
- </entry>
- <entry keyword="error messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref167" /></entry>
- <entry keyword="Error messages"><topic href="tasks024.htm#sthref172" /></entry>
- </entry>
- <entry keyword="extension points - Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference033.htm#sthref304" /></entry>
- </entry>
- <entry keyword="fetch type">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref247" /></entry>
- </entry>
- <entry keyword="Generate Entities from Tables dialog">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref160" /></entry>
- <entry keyword="Select Tables"><topic href="ref_selectTables.htm#sthref215" /></entry>
- </entry>
- <entry keyword="Generate Schema from Classes wizard">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref192" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref200" /></entry>
- </entry>
- <entry keyword="generated values">
- <entry keyword="ID mappings">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref266" /></entry>
- </entry>
- <entry keyword="sequence">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref268" /></entry>
- </entry>
- </entry>
- <entry keyword="hints - query">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref110" /></entry>
- </entry>
- <entry keyword="ID mapping">
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref129" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref127" /></entry>
- </entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="entity">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref93" /></entry>
- <entry keyword="Entity Class page"><topic href="ref_EntityClassPage.htm#sthref209" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref236" /></entry>
- </entry>
- <entry keyword="joined tables">
- <entry keyword="Single Table Inheritance"><topic href="task_inheritance.htm#sthref105" /></entry>
- </entry>
- <entry keyword="single table">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref100" /></entry>
- </entry>
- </entry>
- <entry keyword="Inheritance - in Java Details view">
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref235" /></entry>
- </entry>
- <entry keyword="installation - Dali">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref3" /></entry>
- </entry>
- <entry keyword="Java project - converting to JPA">
- <entry keyword="Converting a Java Project to a JPA Project"><topic href="tasks001.htm#sthref35" /></entry>
- </entry>
- <entry keyword="JAXB">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref191" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref199" /></entry>
- </entry>
- <entry keyword="join columns">
- <entry keyword="Join Columns"><topic href="ref_join_columns.htm#sthref223" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference012.htm#sthref262" /></entry>
- </entry>
- <entry keyword="joined tables - inheritance">
- <entry keyword="Single Table Inheritance"><topic href="task_inheritance.htm#sthref106" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="attributes">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref242" /></entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref225" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Development perspective">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref300" /></entry>
- </entry>
- <entry keyword="JPA Facet page">
- <entry keyword="The Java Source Page"><topic href="task_create_new_project.htm#sthref34" /></entry>
- </entry>
- <entry keyword="JPA project">
- <entry keyword="converting from Java">
- <entry keyword="Converting a Java Project to a JPA Project"><topic href="tasks001.htm#sthref36" /></entry>
- </entry>
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref27" /></entry>
- </entry>
- <entry keyword="implementation">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref205" /></entry>
- </entry>
- <entry keyword="page">
- <entry keyword="&lt;a id=&quot;sthref29&quot; name=&quot;sthref29&quot;&gt;&lt;/a&gt;Selecting the Create a JPA Project wizard"><topic href="task_create_new_project.htm#sthref31" /></entry>
- <entry keyword="&lt;a id=&quot;sthref194&quot; name=&quot;sthref194&quot;&gt;&lt;/a&gt;Selecting the Schema from JAXB Classes wizard"><topic href="task_generating_schema_from_classes.htm#sthref196" /></entry>
- </entry>
- <entry keyword="platform">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref292" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref270" /></entry>
- </entry>
- <entry keyword="lazy fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref249" /></entry>
- </entry>
- <entry keyword="library - JPA">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref206" /></entry>
- </entry>
- <entry keyword="many-to-many mapping">
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref133" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref131" /></entry>
- </entry>
- </entry>
- <entry keyword="many-to-one mapping">
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref136" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref135" /></entry>
- </entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref87" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref85" /></entry>
- </entry>
- </entry>
- <entry keyword="mapping entities">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref12" /></entry>
- </entry>
- <entry keyword="mapping file">
- <entry keyword="&lt;a id=&quot;sthref58&quot; name=&quot;sthref58&quot;&gt;&lt;/a&gt;Managing the orm.xml file"><topic href="tasks004.htm#sthref61" /></entry>
- <entry keyword="Entity Class page"><topic href="ref_EntityClassPage.htm#sthref210" /></entry>
- </entry>
- <entry keyword="mappings">
- <entry keyword="about">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref22" /></entry>
- </entry>
- <entry keyword="basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref114" /></entry>
- </entry>
- <entry keyword="embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref118" /></entry>
- </entry>
- <entry keyword="embedded ID">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref122" /></entry>
- </entry>
- <entry keyword="ID">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref126" /></entry>
- </entry>
- <entry keyword="many-to-many">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref130" /></entry>
- </entry>
- <entry keyword="many-to-one">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref134" /></entry>
- </entry>
- <entry keyword="one-to-many">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref140" /></entry>
- </entry>
- <entry keyword="one-to-one">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref144" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref170" /></entry>
- </entry>
- <entry keyword="transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref150" /></entry>
- </entry>
- <entry keyword="version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref154" /></entry>
- </entry>
- </entry>
- <entry keyword="metamodel - canonical">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref299" /></entry>
- </entry>
- <entry keyword="named queries">
- <entry keyword="entity">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref107" /></entry>
- </entry>
- <entry keyword="hints">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref111" /></entry>
- </entry>
- </entry>
- <entry keyword="native queries">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref112" /></entry>
- </entry>
- <entry keyword="nonpersistent">
- <entry keyword="classes">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref68" /></entry>
- </entry>
- <entry keyword="fields. See transient"></entry>
- </entry>
- <entry keyword="one-to-many mapping">
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref143" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref141" /></entry>
- </entry>
- </entry>
- <entry keyword="one-to-one mapping">
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref147" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref145" /></entry>
- </entry>
- </entry>
- <entry keyword="ordering">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref258" /></entry>
- </entry>
- <entry keyword="orm.xml file">
- <entry keyword="about">
- <entry keyword="The orm.xml file"><topic href="concepts003.htm#sthref24" /></entry>
- </entry>
- <entry keyword="creating">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref208" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref58" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref59" /></entry>
- </entry>
- </entry>
- <entry keyword="overrides - JPA attributes">
- <entry keyword="Attribute overrides"><topic href="reference007.htm#sthref229" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref19" /></entry>
- </entry>
- <entry keyword="database connection">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref294" /></entry>
- </entry>
- <entry keyword="database schema">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref297" /></entry>
- </entry>
- <entry keyword="entity class">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref67" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - Java Persistence Options"><topic href="ref_project_properties.htm#sthref287" /></entry>
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref289" /></entry>
- </entry>
- <entry keyword="provider">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref49" /></entry>
- </entry>
- </entry>
- <entry keyword="persistence.xml file">
- <entry keyword="about">
- <entry keyword="The persistence.xml file"><topic href="concepts002.htm#sthref23" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref47" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref65" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref48" /></entry>
- </entry>
- <entry keyword="synchronizing with classes">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref53" /></entry>
- </entry>
- </entry>
- <entry keyword="persistent entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref71" /></entry>
- </entry>
- <entry keyword="perspective - JPA Development">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref301" /></entry>
- </entry>
- <entry keyword="platform - JPA">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref291" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref169" /></entry>
- </entry>
- <entry keyword="projects - JPA">
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="getting_started003.htm#sthref9" /></entry>
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref26" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref290" /></entry>
- </entry>
- <entry keyword="validation preferences">
- <entry keyword="Project Properties page - Java Persistence Options"><topic href="ref_project_properties.htm#sthref288" /></entry>
- </entry>
- </entry>
- <entry keyword="query hints">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref109" /></entry>
- </entry>
- <entry keyword="quick start - Dali">
- <entry keyword="Dali quick start"><topic href="getting_started002.htm#sthref8" /></entry>
- </entry>
- <entry keyword="requirements">
- <entry keyword="Dali Java Persistence Tools">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref4" /></entry>
- </entry>
- <entry keyword="persistent entities">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref73" /></entry>
- </entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="from classes">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref189" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref197" /></entry>
- </entry>
- </entry>
- <entry keyword="schema - database">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref296" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref231" /></entry>
- </entry>
- <entry keyword="Secondary Tables - in Java Details view">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref234" /></entry>
- </entry>
- <entry keyword="single table inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref101" /></entry>
- </entry>
- <entry keyword="superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref90" /></entry>
- </entry>
- <entry keyword="synchronizing classes with persistence.xml file">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref54" /></entry>
- </entry>
- <entry keyword="tables">
- <entry keyword="associations">
- <entry keyword="Table Associations"><topic href="ref_tableAssociations.htm#sthref218" /></entry>
- <entry keyword="Create New Association"><topic href="ref_create_new_association_wizard.htm#sthref222" /></entry>
- </entry>
- <entry keyword="creating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref159" /></entry>
- <entry keyword="Select Tables"><topic href="ref_selectTables.htm#sthref217" /></entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref102" /></entry>
- </entry>
- <entry keyword="secondary">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref232" /></entry>
- </entry>
- </entry>
- <entry keyword="temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref251" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref253" /></entry>
- </entry>
- <entry keyword="transient mapping">
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref153" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref151" /></entry>
- </entry>
- </entry>
- <entry keyword="version mapping">
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref157" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref155" /></entry>
- </entry>
- </entry>
- <entry keyword="views">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref226" /></entry>
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref243" /></entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref269" /></entry>
- </entry>
- </entry>
- <entry keyword="warning messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref168" /></entry>
- </entry>
- <entry keyword="Web Tools Platform (WTP)">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref5" /></entry>
- </entry>
- <entry keyword="XML editor">
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref64" /></entry>
- </entry>
-</index>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm b/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
deleted file mode 100644
index dfa0007f53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Legal</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Legal" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref294" name="sthref294"></a></p>
-<h1>Legal</h1>
-<p>Copyright &copy; 2006, 2010, Oracle. All rights reserved.</p>
-<p>This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at:</p>
-<p><code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code></p>
-<p><a href="about.htm">Terms and conditions regarding the use of this guide.</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
deleted file mode 100644
index 0aea0c736c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Documentation
-providerName = Eclipse Web Tools Platform
-
-jpaDevelopment=JPA Development
-createAJpaProject=Create a JPA project
-createAJpaProjectDescription=This cheat sheet helps you create a JPA project.
-createAPersistentEntity=Create a persistent entity
-createAPersistentEntityDescription=This cheat sheet helps you create a Java persistent entity.
-MapAPersistentEntity=Map a persistent entity
-MapAPersistentEntityDescription=This cheat sheet helps you map the a Java persistent entity to a database table.
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
deleted file mode 100644
index c405262e39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <!-- =========== -->
- <!-- Define TOC -->
- <!-- =========== -->
- <extension point="org.eclipse.help.toc">
- <toc file="toc.xml" primary="true"/>
- </extension>
- <!-- =========== -->
- <!-- Define F1 -->
- <!-- =========== -->
- <extension point="org.eclipse.help.contexts">
- <contexts file="contexts.xml" plugin="org.eclipse.jpt.jpa.ui"/>
- </extension>
- <!-- ==================== -->
- <!-- Define Keyword Index -->
- <!-- ==================== -->
- <extension point="org.eclipse.help.index">
- <index file="index.xml"/>
- </extension>
- <!-- =========== -->
- <!-- Cheatsheets -->
- <!-- =========== -->
- <extension point="org.eclipse.ui.cheatsheets.cheatSheetContent">
- <category name="%jpaDevelopment" id="com.jpa.category"/>
- <cheatsheet name="%createAJpaProject" category="com.jpa.category" contentFile="$nl$/cheatsheets/add_persistence.xml" id="org.eclipse.jpa.cheatsheet.createproject1">
- <description>%createAJpaProjectDescription</description>
- </cheatsheet>
- <cheatsheet name="%createAPersistentEntity" category="com.jpa.category" contentFile="$nl$/cheatsheets/create_entity.xml" id="org.eclipse.jpa.cheatsheet.addentity">
- <description>%createAPersistentEntityDescription</description>
- </cheatsheet>
- <cheatsheet name="%MapAPersistentEntity" category="com.jpa.category" contentFile="$nl$/cheatsheets/map_entity.xml" id="org.eclipse.jpa.cheatsheet.mapentity">
- <description>%MapAPersistentEntityDescription</description>
- </cheatsheet>
- </extension>
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm
deleted file mode 100644
index f4578f1bd3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Entity Class page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Class page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFEIGF" name="CIAFEIGF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Entity Class page</h1>
-<p>This table lists the properties of the Entity Class page of the <a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" summary="This table lists the properties of the Entity Class page of the Create JPA Entity wizard." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="22%" />
-<col width="*" />
-<col width="17%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t5">Property</th>
-<th align="left" valign="bottom" id="r1c2-t5">Description</th>
-<th align="left" valign="bottom" id="r1c3-t5">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t5" headers="r1c1-t5">Project</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">The name of the JPA project.</td>
-<td align="left" headers="r2c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r1c1-t5">Source Folder</td>
-<td align="left" headers="r3c1-t5 r1c2-t5">The location of the JPA project's src folder.</td>
-<td align="left" headers="r3c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t5" headers="r1c1-t5">Java Package</td>
-<td align="left" headers="r4c1-t5 r1c2-t5">The name of the class package.</td>
-<td align="left" headers="r4c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t5" headers="r1c1-t5">Class name</td>
-<td align="left" headers="r5c1-t5 r1c2-t5">The name of the Java class.</td>
-<td align="left" headers="r5c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t5" headers="r1c1-t5">Superclass</td>
-<td align="left" headers="r6c1-t5 r1c2-t5">Select the superclass.</td>
-<td align="left" headers="r6c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t5" headers="r1c1-t5"><a id="sthref195" name="sthref195"></a>Inheritance</td>
-<td align="left" headers="r7c1-t5 r1c2-t5">Because the wizard creates a Java class with an <code>@Entity</code> notation, the <span class="bold">Entity</span> option is selected by default.
-<p>Select <span class="bold">Mapped Superclass</span> if you defined a superclass.</p>
-<p>To add an <code>@Inheritance</code> notation to the entity, select <span class="bold">Inheritance</span> and then select one of the inheritance mapping strategies (described in JSR 220):</p>
-<ul>
-<li>
-<p>SINGLE_TABLE -- All classes in a hierarchy as mapped to a single table. This annotation is without an attribute for the inheritance strategy.</p>
-</li>
-<li>
-<p>TABLE_PER_CLASS -- Each class is mapped to a separate table.</p>
-</li>
-<li>
-<p>JOINED -- The root of the class hierarchy is represented by a single table. Each subclass is represented by a separate table that contains those fields that are specific to the subclass (not inherited from its superclass), as well as the column(s) that represent its primary key. The primary key column(s) of the subclass table serves as a foreign key to the primary key of the superclass table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t5 r1c3-t5">Entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t5" headers="r1c1-t5"><a id="sthref196" name="sthref196"></a>XML Entity Mappings</td>
-<td align="left" headers="r8c1-t5 r1c2-t5">Select <span class="bold">Add to entity mappings in XML</span> to create XML mappings in <code>orm.xml</code>, rather than annotations.
-<p>Use the <span class="bold">Mapping file</span> field to specify the file to use. By default, mappings are stored in the <code>META-INF/orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r8c1-t5 r1c3-t5"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm
deleted file mode 100644
index 8914f86c92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Entity Properties page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Properties page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIADECIA" name="CIADECIA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Entity Properties page</h1>
-<p>This table lists the properties of the Entity Properties page of the <a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="tblformal"><a id="sthref197" name="sthref197"></a><a id="sthref198" name="sthref198"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table to be converted to informal." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t6">Property</th>
-<th align="left" valign="bottom" id="r1c2-t6">Description</th>
-<th align="left" valign="bottom" id="r1c3-t6">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t6" headers="r1c1-t6">
-<p>Entity Name</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">
-<p>The name of the entity. By default, this value is the same as the one entered as the class name. If the entity name differs from the class name, then the entity name is added as an attribute. For example: <code>@Entity(name="EntityName")</code>.</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c3-t6">
-<p>Determined by server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t6" headers="r1c1-t6">
-<p>Table Name</p>
-</td>
-<td align="left" headers="r3c1-t6 r1c2-t6">
-<p>Select <span class="bold">Use default</span> to match the name of the mapped table name to the entity name. Otherwise, clear the <span class="bold">Use default</span> option and enter the name in the <span class="italic">Table Name</span> field. These options result in the addition of the <code>@Table</code> option to the Java class file.</p>
-</td>
-<td align="left" headers="r3c1-t6 r1c3-t6">
-<p>Use default.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t6" headers="r1c1-t6">
-<p>Entity Fields</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c2-t6">
-<p>Click the <span class="bold">Add</span> button to add persistence fields using the Entity Fields dialog. This dialog enable you to build a field by entering a field name and selecting among persistence types. The <span class="bold">Key</span> option enables you to mark a field as a primary key. The dialog's <span class="bold">Browse</span> function enables you to add other persistence types described in the JPA specification. The <span class="bold">Edit</span> button enables you to change the name or type set for a persistent field.</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c3-t6"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t6" headers="r1c1-t6">
-<p>Access Type</p>
-</td>
-<td align="left" headers="r5c1-t6 r1c2-t6">
-<p>Select whether the entity's access to instance variables is field-based or property-based, as defined in the JPA specification.</p>
-<ul>
-<li>
-<p><span class="bold">Field</span> &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-<li>
-<p><span class="bold">Property</span> &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t6 r1c3-t6">
-<p>Field</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm
deleted file mode 100644
index f992258622..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Add Converter dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Add Converter dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGCGIJ" name="CIAGCGIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Add Converter dialog</h1>
-<p>Use this dialog to create a new EclipseLink converter.</p>
-<div class="inftblhruleinformalmax">
-<table class="HRuleInformalMax" summary="This table lists the options on the New EclipseLink Mapping File dialog." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t40">Property</th>
-<th align="left" valign="bottom" id="r1c2-t40">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t40" headers="r1c1-t40">Name</td>
-<td align="left" headers="r2c1-t40 r1c2-t40">Enter the name for this converter</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t40" headers="r1c1-t40">Type</td>
-<td align="left" headers="r3c1-t40 r1c2-t40">Select the converter type:
-<ul>
-<li>
-<p>Custom</p>
-</li>
-<li>
-<p>Object type</p>
-</li>
-<li>
-<p>Struct</p>
-</li>
-<li>
-<p>Type</p>
-</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformalmax" --></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm
deleted file mode 100644
index 17b8e5d990..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Association Cardinality</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Association Cardinality" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFIIFH" name="CIAFIIFH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Association Cardinality</h1>
-<p><a id="sthref210" name="sthref210"></a>Use this dialog to specify cardinality of an association table. Depending on the <span class="bold">Association Kind</span> and <span class="bold">Join Columns</span> that you selected previously, some associations may not be available.</p>
-<ul>
-<li>
-<p>Many to one</p>
-</li>
-<li>
-<p>One to many</p>
-</li>
-<li>
-<p>One to one</p>
-</li>
-<li>
-<p>Many to many</p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm
deleted file mode 100644
index 78197f6367..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Association Tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Association Tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGJHDC" name="CIAGJHDC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Association Tables</h1>
-<p>Use this page to specify the association tables for an entity.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Association Tables dialog." summary="This table describes the options on the Association Tables dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t12">Property</th>
-<th align="left" valign="bottom" id="r1c2-t12">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t12" headers="r1c1-t12">Association kind</td>
-<td align="left" headers="r2c1-t12 r1c2-t12">Specify if the association is <span class="bold">Simple</span> (1:M) or <span class="bold">Many to Many</span> (M:M).</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t12" headers="r1c1-t12">Association tables</td>
-<td align="left" headers="r3c1-t12 r1c2-t12">Click <span class="bold">Table Selection</span>, then select the two tables to associate.
-<p>When creating a <span class="bold">Many to Many</span> association, you can select a <span class="bold">Join Table</span> for the association.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm
deleted file mode 100644
index 7efc7a4ffa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Configure JAXB Class Generation dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:33:7Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Configure JAXB Class Generation dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACHHHJA" name="CACHHHJA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Configure JAXB Class Generation dialog</h1>
-<p>Use this dialog to generate JAXB classes from a schema.</p>
-<div class="inftblhruleinformalmax">
-<table class="HRuleInformalMax" summary="This table lists the options on the New EclipseLink Mapping File dialog." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t41">Property</th>
-<th align="left" valign="bottom" id="r1c2-t41">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t41" headers="r1c1-t41">Source folder</td>
-<td align="left" headers="r2c1-t41 r1c2-t41">Location in which to generate the classes. Click <span class="bold">Browse</span> to select a location.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t41" headers="r1c1-t41">Package</td>
-<td align="left" headers="r3c1-t41 r1c2-t41">Name of the package. Click <span class="bold">Browse</span> to select an existing package.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t41" headers="r1c1-t41">Catalog</td>
-<td align="left" headers="r4c1-t41 r1c2-t41">Name of the catalog file to use to resolve external entity references.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t41" headers="r1c1-t41">Bindings files</td>
-<td align="left" headers="r5c1-t41 r1c2-t41">Click <span class="bold">Add</span> to select the external bindings files</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformalmax" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_generate_classes_from_schema.htm#CIHCBHJD">Generating JAXB Classes from a Schema</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm
deleted file mode 100644
index 6b5694a7a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Entities from Tables Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Entities from Tables Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGBFJE" name="CIAGBFJE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Entities from Tables Wizard</h1>
-<p>Use the Generate Custom Entities Wizard to create entities from your database tables.</p>
-<p>The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_selectTables.htm#CIAHCGEE">Select Tables</a></p>
-</li>
-<li>
-<p><a href="ref_tableAssociations.htm#CIACDICB">Table Associations</a></p>
-</li>
-<li>
-<p><a href="ref_customizeDefaultEntityGeneration.htm#CIAEJDBE">Customize Default Entity Generation</a></p>
-</li>
-<li>
-<p><a href="ref_customizIndividualEntities.htm#CIACIGEE">Customize Individual Entities</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm
deleted file mode 100644
index 12da7476c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Create JPA Entity wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create JPA Entity wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGGGDF" name="CIAGGGDF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create JPA Entity wizard</h1>
-<p>The Create JPA wizard enables you to quickly add an entity and also add persistence fields to that entity. In addition, this wizard adds the accessor methods (<code>getter</code> and <code>setter</code>) in the class file. The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a></p>
-</li>
-<li>
-<p><a href="ref_EntityPropertiesPage.htm#CIADECIA">Entity Properties page</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm
deleted file mode 100644
index b74aa5a71a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Create New Association</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create New Association" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFGHIF" name="CIAFGHIF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create New Association</h1>
-<p><a id="sthref207" name="sthref207"></a><a id="sthref208" name="sthref208"></a>Use the Create New Association wizard to specify association tables when generating an entity.</p>
-<p>The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_association_table.htm#CIAGJHDC">Association Tables</a></p>
-</li>
-<li>
-<p><a href="ref_join_columns.htm#CIAEGEEG">Join Columns</a></p>
-</li>
-<li>
-<p><a href="ref_association_cardinality.htm#CIAFIIFH">Association Cardinality</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm
deleted file mode 100644
index e847da34fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Customize Individual Entities</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customize Individual Entities" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACIGEE" name="CIACIGEE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Customize Individual Entities</h1>
-<p><a id="sthref206" name="sthref206"></a>Use this page to customize each generated entity. Select an item in the Table and columns area, then complete the following fields for each item.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Individual Entities dialog." summary="This table describes the options on the Individual Entities dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t11">Property</th>
-<th align="left" valign="bottom" id="r1c2-t11">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t11" headers="r1c1-t11">Table Mapping</td>
-<td align="left" headers="r2c1-t11 r1c2-t11">Use these options to define the table mapping information for the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t11" headers="r1c1-t11">&nbsp;&nbsp;Key&nbsp;generator</td>
-<td align="left" headers="r3c1-t11 r1c2-t11">Select the generator used for this mapping.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t11" headers="r1c1-t11">&nbsp;&nbsp;Sequence&nbsp;name</td>
-<td align="left" headers="r4c1-t11 r1c2-t11">Enter a name for the sequence.
-<p>You can use <span class="bold">$table</span> and <span class="bold">$pk</span> as variables in the name. These will be replaced by the table name and primary key column name (respectively) when Dali generates a table mapping.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t11" headers="r1c1-t11">&nbsp;&nbsp;Entity&nbsp;access</td>
-<td align="left" headers="r5c1-t11 r1c2-t11">Specify the default entity access method: <span class="bold">Field</span> (default) or <span class="bold">Property</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t11" headers="r1c1-t11">Domain Java Class</td>
-<td align="left" headers="r6c1-t11 r1c2-t11">Use these options to define the class information (<span class="bold">Superclass</span> and <span class="bold">Interfaces</span>) for the entity.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm
deleted file mode 100644
index 578801a58e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Customize Default Entity Generation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customize Default Entity Generation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAEJDBE" name="CIAEJDBE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Customize Default Entity Generation</h1>
-<p><a id="sthref205" name="sthref205"></a>Use this page to specify the default information Dali will use when generating the entities from the database tables. You will be able to override this information for specific entities.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Custom Default Entity Generation dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t10">Property</th>
-<th align="left" valign="bottom" id="r1c2-t10">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t10" headers="r1c1-t10">Table Mapping</td>
-<td align="left" headers="r2c1-t10 r1c2-t10">Use these options to define the table mapping information for the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Key&nbsp;generator</td>
-<td align="left" headers="r3c1-t10 r1c2-t10">Select the generator used for this mapping.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Sequence&nbsp;name</td>
-<td align="left" headers="r4c1-t10 r1c2-t10">Enter a name for the sequence.
-<p>You can use <span class="bold">$table</span> and <span class="bold">$pk</span> as variables in the name. These will be replaced by the table name and primary key column name (respectively) when Dali generates a table mapping.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Entity&nbsp;access</td>
-<td align="left" headers="r5c1-t10 r1c2-t10">Specify the default entity access method: <span class="bold">Field</span> (default) or <span class="bold">Property</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Associations&nbsp;fetch</td>
-<td align="left" headers="r6c1-t10 r1c2-t10">Specify the default fetch mode for associations: <span class="bold">Default</span>, as defined by the application (default), or <span class="bold">Lazy</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Collection&nbsp;type</td>
-<td align="left" headers="r7c1-t10 r1c2-t10">Specify if the collection properties are a <span class="bold">Set</span> or <span class="bold">List</span>.
-<p>Enable the <span class="bold">Always generate optional JPA annotations and DDL parameters</span> option to have Dali include this information in the entity.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t10" headers="r1c1-t10">Domain Java Class</td>
-<td align="left" headers="r8c1-t10 r1c2-t10">Use these options to define the class information (<span class="bold">Package</span>, <span class="bold">Superclass</span>, and <span class="bold">Interfaces</span>) for the entity.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
deleted file mode 100644
index 018594b103..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Details view (for orm.xml)</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for orm.xml)" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGDGHC" name="CACGDGHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for orm.xml)</h1>
-<p>The <span class="gui-object-title">JPA Details</span> view displays the default mapping and persistence information for the project and contains the following areas:</p>
-<ul>
-<li>
-<p><a href="reference013.htm#CACCACGH">General information</a></p>
-</li>
-<li>
-<p><a href="reference014.htm#CACEAGBG">Persistence Unit information</a></p>
-</li>
-<li>
-<p><a href="reference015.htm#CIAFGAIJ">Generators</a></p>
-</li>
-<li>
-<p><a href="reference016.htm#CIAIBAAJ">Queries</a></p>
-</li>
-<li>
-<p><a href="reference017.htm#CIADGCID">Converters</a> (when using EclipseLink)</p>
-</li>
-</ul>
-<p>These defaults can be overridden by the settings on a specific entity or mapping.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm
deleted file mode 100644
index 18a6305077..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>New EclipseLink Mapping File dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New EclipseLink Mapping File dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAEDEJF" name="CIAEDEJF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>New EclipseLink Mapping File dialog</h1>
-<p>Specify the location and properties of the EclipseLink mapping file (<code>eclispelink-orm.xml</code>).</p>
-<div class="inftblhruleinformalmax">
-<table class="HRuleInformalMax" summary="This table lists the options on the New EclipseLink Mapping File dialog." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t39">Property</th>
-<th align="left" valign="bottom" id="r1c2-t39">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t39" headers="r1c1-t39">Project</td>
-<td align="left" headers="r2c1-t39 r1c2-t39">Select the project in which to add the mapping file.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t39" headers="r1c1-t39">Source folder</td>
-<td align="left" headers="r3c1-t39 r1c2-t39">Click <span class="bold">Browse</span> and select the source file in which to add the mapping file. The default is <code>../</code><code><span class="codeinlineitalic">&lt;PROJECT&gt;</span></code><code>/src</code>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t39" headers="r1c1-t39">File path</td>
-<td align="left" headers="r4c1-t39 r1c2-t39">Enter the filename and path of the mapping file. The default is <code>META-INF/eclipselink-orm.xml</code>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t39" headers="r1c1-t39">Default access</td>
-<td align="left" headers="r5c1-t39 r1c2-t39">Select whether the entity's access to instance variables is <span class="bold">field</span>-based or <span class="bold">property</span>-based, as defined in the JPA specification.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t39" headers="r1c1-t39">Add to persistence unit</td>
-<td align="left" headers="r6c1-t39 r1c2-t39">Specify if this mapping file should be added to the persistence unit (<code>persistence.xml</code>).</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t39" headers="r1c1-t39">&nbsp;&nbsp;Persistence&nbsp;Unit</td>
-<td align="left" headers="r7c1-t39 r1c2-t39">Select the persistence unit in which to add the mapping file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformalmax" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference003.htm#CIAJEIDJ">Mapping File</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm
deleted file mode 100644
index ffbf3fdaff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Java Page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Java Page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGEBAA" name="CIAGEBAA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Java Page</h1>
-<p>This table lists the properties available on the Java page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t3">Property</th>
-<th align="left" valign="bottom" id="r1c2-t3">Description</th>
-<th align="left" valign="bottom" id="r1c3-t3">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t3" headers="r1c1-t3">Source folders on build path</td>
-<td align="left" headers="r2c1-t3 r1c2-t3">Click <span class="bold">Add Folder</span> to select an existing Java source folder to add to this project.</td>
-<td align="left" headers="r2c1-t3 r1c3-t3">EclipseLink</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t3" headers="r1c1-t3">Default output folder</td>
-<td align="left" headers="r3c1-t3 r1c2-t3">Specify the location of the&nbsp;<code>.class</code> files.</td>
-<td align="left" headers="r3c1-t3 r1c3-t3">build\classes</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm
deleted file mode 100644
index e2eb5bf134..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Schema from JAXB Classes Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T16:18:13Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Schema from JAXB Classes Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGADFH" name="CACGADFH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Schema from JAXB Classes Wizard</h1>
-<p>Use the Generate Schema from JAXB Classes wizard create an XML schema (&nbsp;.xsd) for a set of JAXB mapped classes.</p>
-<p>The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_schema_from_classes_page.htm#CACHBEGJ">Generate Schema from Classes</a></p>
-</li>
-</ul>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_generating_schema_from_classes.htm#CIHHBJCJ">Generating Schema from Classes</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="#CACGADFH">Generate Schema from JAXB Classes Wizard</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm
deleted file mode 100644
index 8632cbfec4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Join Columns</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Columns" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAEGEEG" name="CIAEGEEG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Columns</h1>
-<p><a id="sthref209" name="sthref209"></a>Use this dialog to specify the join columns of an association table.</p>
-<p>Click Add to specify the join columns between the two tables.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
deleted file mode 100644
index 89e4ff8a71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Facet page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Facet page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACIFDIF" name="CACIFDIF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Facet page</h1>
-<p>This table lists the properties available on the JPA Facet page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t4">Property</th>
-<th align="left" valign="bottom" id="r1c2-t4">Description</th>
-<th align="left" valign="bottom" id="r1c3-t4">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t4" headers="r1c1-t4">Platform</td>
-<td align="left" headers="r2c1-t4 r1c2-t4">Vendor-specific JPA implementation.</td>
-<td align="left" headers="r2c1-t4 r1c3-t4">EclipseLink</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t4" headers="r1c1-t4"><a id="sthref191" name="sthref191"></a><a id="sthref192" name="sthref192"></a>JPA Implementation</td>
-<td align="left" headers="r3c1-t4 r1c2-t4">Select a specific JPA library configuration.
-<p>Click <span class="bold">Manage libraries</span> to create or update a user library.</p>
-<p>Click <span class="bold">Download libraries</span> to download a specific library configuration.</p>
-</td>
-<td align="left" headers="r3c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Type</td>
-<td align="left" headers="r4c1-t4 r1c2-t4">Select <span class="bold">User Library</span> to select from the available user-defined or downloaded libraries.
-<p>If you select Disable, you must manually include the JPA implementation library on the project classpath.</p>
-</td>
-<td align="left" headers="r4c1-t4 r1c3-t4">User Library</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Include libraries with this application</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">Specify if the selected libraries are included when deploying the application.</td>
-<td align="left" headers="r5c1-t4 r1c3-t4">Selected</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t4" headers="r1c1-t4">Connection</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">Select the database connection to use with the project. Dali requires an active database connection to use and validate the persistent entities and mappings.
-<p>Click <span class="bold">Add connection</span> to create a new database connection.</p>
-</td>
-<td align="left" headers="r6c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Override&nbsp;default schema from connection</td>
-<td align="left" headers="r7c1-t4 r1c2-t4">Select a schema other than the default one that is derived from the connection information. Use this option if the default schema cannot be used. For example, use this option when the deployment login differs from the design-time login.</td>
-<td align="left" headers="r7c1-t4 r1c3-t4">The value calculated by Dali.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t4" headers="r1c1-t4">JPA Implementation</td>
-<td align="left" headers="r8c1-t4 r1c2-t4">Select to use the <span class="bold">JPA implementation provided by the server at runtime</span>, or select a specific <span class="bold">implementation library</span> that contain the Java Persistence API (JPA) and entities to be added to the project's Java Build Path.
-<p>Click <span class="bold">Configure default JPA implementation library</span> to create a default library for the project or click <span class="bold">Configure user libraries</span> to define additional libraries.</p>
-<p>Depending on your JPA implementation (for example, Generic or EclipseLink), different options may be available when working with JPA projects.</p>
-</td>
-<td align="left" headers="r8c1-t4 r1c3-t4">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t4" headers="r1c1-t4"><a id="sthref193" name="sthref193"></a>Persistent class management</td>
-<td align="left" headers="r9c1-t4 r1c2-t4">Specify if Dali will <span class="bold">discover annotated classes automatically</span>, or if the <span class="bold">annotated classes must be listed in the persistence.xml</span> file.
-<p><span class="bold">Note</span>: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.</p>
-</td>
-<td align="left" headers="r9c1-t4 r1c3-t4">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t4" headers="r1c1-t4"><a id="sthref194" name="sthref194"></a>Create <code>orm.xml</code></td>
-<td align="left" headers="r10c1-t4 r1c2-t4">Specify if Dali should create a default <code>orm.xml</code> file for your entity mappings and persistence unit defaults.</td>
-<td align="left" headers="r10c1-t4 r1c3-t4">Selected</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
deleted file mode 100644
index 7b02bb68fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
+++ /dev/null
@@ -1,272 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBHFIJ" name="CACBHFIJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General properties available in the <span class="gui-object-title">Java Details view</span> for each mapping type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view." summary="This table describes the options on the Persistence Properties view." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<col width="27%" />
-<col width="21%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Property</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-<th align="left" valign="bottom" id="r1c3-t16">Default</th>
-<th align="left" valign="bottom" id="r1c4-t16">Available for Mapping Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">Clicking the name of the mapping type, which is represented as a hyperlink, invokes the Mapping Type Selection dialog. Use this dialog to specify the type of attribute.</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">Basic</td>
-<td align="left" headers="r2c1-t16 r1c4-t16">All mapping types</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t16" headers="r1c1-t16"><a id="CACGCBHB" name="CACGCBHB"></a>Column</td>
-<td align="left" headers="r3c1-t16 r1c2-t16"><a id="sthref231" name="sthref231"></a><a id="sthref232" name="sthref232"></a>The database column that contains the value for the attribute. This field corresponds to the <code>@Column</code> annotation.</td>
-<td align="left" headers="r3c1-t16 r1c3-t16">By default, the Column is assumed to be named identically to the attribute.</td>
-<td align="left" headers="r3c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a>, <a href="tasks019.htm#BABHIBII">Version mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t16 r1c2-t16">Name of the database column.
-<p>This field corresponds to the <code>@Column</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r4c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r5c1-t16 r1c2-t16">Name of the database table that contains the selected column.</td>
-<td align="left" headers="r5c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r5c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Insertable</td>
-<td align="left" headers="r6c1-t16 r1c2-t16">Specifies if the column is always included in <code>SQL INSERT</code> statements.</td>
-<td align="left" headers="r6c1-t16 r1c3-t16">True</td>
-<td align="left" headers="r6c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Updatable</td>
-<td align="left" headers="r7c1-t16 r1c2-t16">Specifies if this column is always included in <code>SQL UPDATE</code> statements.</td>
-<td align="left" headers="r7c1-t16 r1c3-t16">True</td>
-<td align="left" headers="r7c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Unique</td>
-<td align="left" headers="r8c1-t16 r1c2-t16">Sets the <code>UNIQUE</code> constraint for the column.</td>
-<td align="left" headers="r8c1-t16 r1c3-t16">False</td>
-<td align="left" headers="r8c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Nullable</td>
-<td align="left" headers="r9c1-t16 r1c2-t16">Specifies if the column allows null values.</td>
-<td align="left" headers="r9c1-t16 r1c3-t16">True</td>
-<td align="left" headers="r9c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Length</td>
-<td align="left" headers="r10c1-t16 r1c2-t16">Sets the column length.</td>
-<td align="left" headers="r10c1-t16 r1c3-t16">255</td>
-<td align="left" headers="r10c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Precision</td>
-<td align="left" headers="r11c1-t16 r1c2-t16">Sets the precision for the column values.</td>
-<td align="left" headers="r11c1-t16 r1c3-t16">0</td>
-<td align="left" headers="r11c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Scale</td>
-<td align="left" headers="r12c1-t16 r1c2-t16">Sets the number of digits that appear to the right of the decimal point.</td>
-<td align="left" headers="r12c1-t16 r1c3-t16">0</td>
-<td align="left" headers="r12c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Column Definition</td>
-<td align="left" headers="r13c1-t16 r1c2-t16">Define the DDL for a column. This is used when a table is being generated.</td>
-<td align="left" headers="r13c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r13c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t16" headers="r1c1-t16"><a id="CACGGGHB" name="CACGGGHB"></a><a id="sthref233" name="sthref233"></a><a id="sthref234" name="sthref234"></a><a id="sthref235" name="sthref235"></a>Fetch Type</td>
-<td align="left" headers="r14c1-t16 r1c2-t16">Defines how data is loaded from the database:
-<ul>
-<li>
-<p>Eager &ndash; Data is loaded in before it is actually needed.</p>
-</li>
-<li>
-<p>Lazy &ndash; Data is loaded only when required by the transaction.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r14c1-t16 r1c3-t16">Eager</td>
-<td align="left" headers="r14c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t16" headers="r1c1-t16">Optional</td>
-<td align="left" headers="r15c1-t16 r1c2-t16">Specifies if this field is can be null.</td>
-<td align="left" headers="r15c1-t16 r1c3-t16">Yes</td>
-<td align="left" headers="r15c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r16c1-t16" headers="r1c1-t16"><a id="CACBBIBI" name="CACBBIBI"></a><a id="sthref236" name="sthref236"></a>Lob</td>
-<td align="left" headers="r16c1-t16 r1c2-t16">Specify if the field is mapped to <code>java.sql.Clob</code> or <code>java.sql.Blob</code>.
-<p>This field corresponds to the <code>@Lob</code> annotation.</p>
-</td>
-<td align="left" headers="r16c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r16c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r17c1-t16" headers="r1c1-t16"><a id="CACEAJGD" name="CACEAJGD"></a><a id="sthref237" name="sthref237"></a><a id="sthref238" name="sthref238"></a><a id="sthref239" name="sthref239"></a>Temporal</td>
-<td align="left" headers="r17c1-t16 r1c2-t16">Specifies if this field is one of the following:
-<ul>
-<li>
-<p>Date &ndash; <code>java.sql.Date</code></p>
-</li>
-<li>
-<p>Time &ndash; <code>java.sql.Time</code></p>
-</li>
-<li>
-<p>Timestamp &ndash; <code>java.sql.Timestamp</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Temporal</code> annotation.</p>
-</td>
-<td align="left" headers="r17c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r17c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r18c1-t16" headers="r1c1-t16"><a id="sthref240" name="sthref240"></a><a id="sthref241" name="sthref241"></a><a id="sthref242" name="sthref242"></a>Enumerated</td>
-<td align="left" headers="r18c1-t16 r1c2-t16">Specify how to persist enumerated constraints if the <code>String</code> value suits your application requirements or to match an existing database schema.
-<ul>
-<li>
-<p>ordinal</p>
-</li>
-<li>
-<p><code>String</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Enumerated</code> annotation.</p>
-</td>
-<td align="left" headers="r18c1-t16 r1c3-t16">Ordinal</td>
-<td align="left" headers="r18c1-t16 r1c4-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r19c1-t16" headers="r1c1-t16">Target Entity</td>
-<td align="left" headers="r19c1-t16 r1c2-t16">The persistent entity to which the attribute is mapped.</td>
-<td align="left" headers="r19c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r19c1-t16 r1c4-t16"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a> <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r20c1-t16" headers="r1c1-t16"><a id="sthref243" name="sthref243"></a>ID</td>
-<td align="left" headers="r20c1-t16 r1c2-t16">Specify if the entity's ID is derived from the identity of another entity.</td>
-<td align="left" headers="r20c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r20c1-t16 r1c4-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r21c1-t16" headers="r1c1-t16"><a id="CACJAIHB" name="CACJAIHB"></a>Cascade Type</td>
-<td align="left" headers="r21c1-t16 r1c2-t16">Specify which operations are propagated throughout the entity.
-<ul>
-<li>
-<p>All &ndash; All operations</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Move</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-<li>
-<p>Refresh</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r21c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r21c1-t16 r1c4-t16"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a>, <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r22c1-t16" headers="r1c1-t16"><a id="CACJDJJA" name="CACJDJJA"></a>Mapped By</td>
-<td align="left" headers="r22c1-t16 r1c2-t16">The field in the database table that "owns" the relationship. This field is required only on the non-owning side of the relationship.</td>
-<td align="left" headers="r22c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r22c1-t16 r1c4-t16"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r23c1-t16" headers="r1c1-t16"><a id="CACDADIH" name="CACDADIH"></a><a id="sthref244" name="sthref244"></a><a id="sthref245" name="sthref245"></a>Order By</td>
-<td align="left" headers="r23c1-t16 r1c2-t16">Specify the default order for objects returned from a query:
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom ordering</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@OrderBy</code> annotation.</p>
-</td>
-<td align="left" headers="r23c1-t16 r1c3-t16">Primary key</td>
-<td align="left" headers="r23c1-t16 r1c4-t16"><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a>. <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r24c1-t16" headers="r1c1-t16">Attribute Overrides</td>
-<td align="left" headers="r24c1-t16 r1c2-t16">Overrides <span class="bold">Basic</span> mappings of a mapped superclass (for example, if the inherited column name is incompatible with a pre-existing data model, or invalid as a column name in your database).</td>
-<td align="left" headers="r24c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r24c1-t16 r1c4-t16"><a href="tasks011.htm#BABCBHDF">Embedded mapping</a>
-<p><a href="tasks011.htm#BABCBHDF">Embedded mapping</a></p>
-<br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
deleted file mode 100644
index 2a576e6eba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>New JPA Project page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New JPA Project page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBJAGC" name="CACBJAGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>New JPA Project page</h1>
-<p>This table lists the properties available on the New JPA Project page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Property</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-<th align="left" valign="bottom" id="r1c3-t2">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2">Project name</td>
-<td align="left" headers="r2c1-t2 r1c2-t2">Name of the Eclipse JPA project.</td>
-<td align="left" headers="r2c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2">Project contents</td>
-<td align="left" headers="r3c1-t2 r1c2-t2">Location of the workspace in which to save the project.
-<p>Unselect The <span class="bold">Use Default</span> option and click <span class="bold">Browse</span> to select a new location.</p>
-</td>
-<td align="left" headers="r3c1-t2 r1c3-t2">Current workspace</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t2" headers="r1c1-t2">Target runtime</td>
-<td align="left" headers="r4c1-t2 r1c2-t2">Select a pre-defined target for the project.
-<p>Click <span class="bold">New</span> to create a new environment with the New Server Runtime wizard.</p>
-</td>
-<td align="left" headers="r4c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t2" headers="r1c1-t2">Configurations</td>
-<td align="left" headers="r5c1-t2 r1c2-t2">Select a project configuration with pre-defined facets.
-<p>Select <span class="bold">&lt;custom&gt;</span> to manually select the facets for this project.</p>
-</td>
-<td align="left" headers="r5c1-t2 r1c3-t2">Utility JPA project with Java 5.0</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t2" headers="r1c1-t2">EAR membership</td>
-<td align="left" headers="r6c1-t2 r1c2-t2">Specify if this project should be included in an EAR file for deployment.
-<p>Select the <span class="bold">EAR Project Name</span>, or click <span class="bold">New</span> to create a new EAR project.</p>
-</td>
-<td align="left" headers="r6c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t2" headers="r1c1-t2">Working sets</td>
-<td align="left" headers="r7c1-t2 r1c2-t2">Specify if this project should be included in an existing working set. The drop down field shows a list of previous selected working sets.
-<p>Select <span class="bold">Add project to working sets</span>, then select a working set in which to add this project.</p>
-</td>
-<td align="left" headers="r7c1-t2 r1c3-t2"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
deleted file mode 100644
index b59320be77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Create New JPA Project wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create New JPA Project wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBJGBG" name="CACBJGBG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create New JPA Project wizard</h1>
-<p><a id="sthref190" name="sthref190"></a>The Create New JPA Project wizard allows you to create a new Java project using JPA. The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a></p>
-</li>
-<li>
-<p><a href="ref_java_page.htm#CIAGEBAA">Java Page</a></p>
-</li>
-<li>
-<p><a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm
deleted file mode 100644
index ea6f099cfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm
+++ /dev/null
@@ -1,126 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACIFGJ" name="CIACIFGJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General</h1>
-<p>The following table lists properties available in the General page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref258" name="sthref258"></a><a id="sthref259" name="sthref259"></a>
-<p class="titleintable">Properties of the General Page</p>
-<table class="Formal" title="Properties of the General Page" summary="This table describes the properties of the persistence.xml&rsquo;s General page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t24">Property</th>
-<th align="left" valign="bottom" id="r1c2-t24">Description</th>
-<th align="left" valign="bottom" id="r1c3-t24">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t24" headers="r1c1-t24">
-<p>Name</p>
-</td>
-<td align="left" headers="r2c1-t24 r1c2-t24">
-<p>Enter the name of the persistence unit.</p>
-</td>
-<td align="left" headers="r2c1-t24 r1c3-t24">
-<p>The project name.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t24" headers="r1c1-t24">
-<p>Persistence Provider</p>
-</td>
-<td align="left" headers="r3c1-t24 r1c2-t24">
-<p>Enter the name of the persistence provider.</p>
-</td>
-<td align="left" headers="r3c1-t24 r1c3-t24">
-<p>Determined by the server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t24" headers="r1c1-t24">
-<p>Description</p>
-</td>
-<td align="left" headers="r4c1-t24 r1c2-t24">
-<p>Enter a description for this persistence unit. This is an optional property.</p>
-</td>
-<td align="left" headers="r4c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t24" headers="r1c1-t24">
-<p>Managed Classes</p>
-</td>
-<td align="left" headers="r5c1-t24 r1c2-t24">
-<p>Add or remove the classes managed through the persistence unit.</p>
-</td>
-<td align="left" headers="r5c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t24" headers="r1c1-t24">
-<p>Exclude Unlisted Classes</p>
-</td>
-<td align="left" headers="r6c1-t24 r1c2-t24">
-<p>Select to include all annotated entity classes in the root of the persistence unit.</p>
-</td>
-<td align="left" headers="r6c1-t24 r1c3-t24">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t24" headers="r1c1-t24">
-<p>XML Mapping Files</p>
-</td>
-<td align="left" headers="r7c1-t24 r1c2-t24">
-<p>Add or remove the object/relational mapping XML files that define the classes to be managed by the persistence unit.</p>
-</td>
-<td align="left" headers="r7c1-t24 r1c3-t24">
-<p>Meta-INF\orm.xml</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t24" headers="r1c1-t24">
-<p>JAR Files</p>
-</td>
-<td align="left" headers="r8c1-t24 r1c2-t24"><br /></td>
-<td align="left" headers="r8c1-t24 r1c3-t24"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
deleted file mode 100644
index 40d2673812..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Details view (for attributes)</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for attributes)" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIFBAF" name="BABIFBAF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for attributes)</h1>
-<p><a id="sthref228" name="sthref228"></a><a id="sthref229" name="sthref229"></a><a id="sthref230" name="sthref230"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected mapped attribute and contains the following areas:</p>
-<ul>
-<li>
-<p><a href="ref_mapping_general.htm#CACBHFIJ">General information</a></p>
-</li>
-<li>
-<p><a href="reference011.htm#CACBAEBC">Join Table Information</a></p>
-</li>
-<li>
-<p><a href="reference012.htm#CACFCEJC">Join Columns Information</a></p>
-</li>
-<li>
-<p><a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
deleted file mode 100644
index abdafce3b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Structure view</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Structure view" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEGGFE" name="BABEGGFE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Structure view</h1>
-<p><a id="sthref255" name="sthref255"></a><a id="sthref256" name="sthref256"></a>The <span class="gui-object-title">JPA Structure</span> view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor. The structural elements shown in the outline are the entity and its fields.</p>
-<div class="figure"><a id="sthref257" name="sthref257"></a>
-<p class="titleinfigure">Sample JPA Structure View</p>
-<img src="img/persistence_outline_view.png" alt="Sample JPA Structure view for an entity." title="Sample JPA Structure view for an entity." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
deleted file mode 100644
index 0be8caf0d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Development perspective</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Development perspective" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIFBDB" name="BABIFBDB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Development perspective</h1>
-<p><a id="sthref286" name="sthref286"></a><a id="sthref287" name="sthref287"></a>The <span class="bold">JPA Development perspective</span> defines the initial set and layout of views in the Workbench window when using Dali. By default, the <span class="gui-object-title">JPA Development perspective</span> includes the following views:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-</ul>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/concepts-4.htm">Perspectives</a></p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
deleted file mode 100644
index 408e016a11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Details view (for entities)</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for entities)" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFAEBB" name="BABFAEBB"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for entities)</h1>
-<p><a id="sthref211" name="sthref211"></a><a id="sthref212" name="sthref212"></a><a id="sthref213" name="sthref213"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected entity and contains the following tabs:</p>
-<ul>
-<li>
-<p><a href="reference006.htm#CACCAGGC">General information</a></p>
-</li>
-<li>
-<p><a href="reference007.htm#CACIJBGH">Attribute overrides</a></p>
-</li>
-<li>
-<p><a href="reference008.htm#CACBHIDA">Secondary table information</a></p>
-</li>
-<li>
-<p><a href="reference009.htm#CACFHGHE">Inheritance information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm
deleted file mode 100644
index 027900047f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>persistence.xml Editor</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="persistence.xml Editor" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACCHID" name="CIACCHID"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>persistence.xml Editor</h1>
-<p>The persistence.xml Editor provides an interface that enables you to update the persistence.xml file. For projects using the EclipseLink platform, the perisistence.xml Editor consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_general.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference018.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference019.htm#CIAJAFEG">Customization</a></p>
-</li>
-<li>
-<p><a href="reference020.htm#CIABEDCH">Caching</a></p>
-</li>
-<li>
-<p><a href="reference021.htm#CIABGHHI">Logging</a></p>
-</li>
-<li>
-<p><a href="reference022.htm#CIAFJCHE">Options</a></p>
-</li>
-<li>
-<p><a href="reference023.htm#CIACCFCB">Schema Generation</a></p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference025.htm#CIAHCJAH">Source</a></p>
-</li>
-</ul>
-<p>For projects using the Generic platform, the following subset of these pages is available:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_general.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference018.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference025.htm#CIAHCJAH">Source</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
deleted file mode 100644
index 78ae018537..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
+++ /dev/null
@@ -1,142 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Primary Key Generation information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Primary Key Generation information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFCCAB" name="CACFCCAB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Primary Key Generation information</h1>
-<p>This table lists the fields available in the <span class="gui-object-title">Primary Key Generation</span> area in JPA Details view for <a href="tasks013.htm#BABGCBHG">ID mapping</a> types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="26%" />
-<col width="*" />
-<col width="34%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t19">Property</th>
-<th align="left" valign="bottom" id="r1c2-t19">Description</th>
-<th align="left" valign="bottom" id="r1c3-t19">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t19" headers="r1c1-t19"><a id="CACBAJBC" name="CACBAJBC"></a>Primary Key Generation</td>
-<td align="left" headers="r2c1-t19 r1c2-t19"><a id="sthref251" name="sthref251"></a><a id="sthref252" name="sthref252"></a>These fields define how the primary key is generated. These fields correspond to the <code>@GeneratedValue</code> annotation.</td>
-<td align="left" headers="r2c1-t19 r1c3-t19">Generated Value</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t19" headers="r1c1-t19"><a id="CACJEEEC" name="CACJEEEC"></a>&nbsp;&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t19 r1c2-t19">
-<ul>
-<li>Auto</li>
-<li>
-<p>Identity &ndash; Values are assigned by the database's <span class="bold">Identity</span> column.</p>
-</li>
-<li>
-<p>Sequence &ndash; Values are assigned by a sequence table (see <a href="#CACFFHEH">Sequence&nbsp;Generator</a>).</p>
-</li>
-<li>
-<p>Table &ndash; Values are assigned by a database table (see <a href="#CACGFEAH">Table Generator</a>).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t19 r1c3-t19">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t19" headers="r1c1-t19"><a id="BABEEAHJ" name="BABEEAHJ"></a>&nbsp;&nbsp;Generator Name</td>
-<td align="left" headers="r4c1-t19 r1c2-t19">Unique name of the generated value.</td>
-<td align="left" headers="r4c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t19" headers="r1c1-t19"><a id="CACGFEAH" name="CACGFEAH"></a>Table Generator</td>
-<td align="left" headers="r5c1-t19 r1c2-t19">These fields define the database table used for generating the primary key and correspond to the <code>@TableGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span>&nbsp;=&nbsp;<span class="bold">Table</span>.</p>
-</td>
-<td align="left" headers="r5c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r6c1-t19 r1c2-t19">Unique name of the generator.</td>
-<td align="left" headers="r6c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r7c1-t19 r1c2-t19">Database table that stores the generated ID values.</td>
-<td align="left" headers="r7c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Primary Key Column</td>
-<td align="left" headers="r8c1-t19 r1c2-t19">The column in the table generator's <span class="bold">Table</span> that contains the primary key.</td>
-<td align="left" headers="r8c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Value Column</td>
-<td align="left" headers="r9c1-t19 r1c2-t19">The column that stores the generated ID values.</td>
-<td align="left" headers="r9c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Primary Key Column Value</td>
-<td align="left" headers="r10c1-t19 r1c2-t19">The value for the <span class="bold">Primary Key Column</span> in the generator table.</td>
-<td align="left" headers="r10c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t19" headers="r1c1-t19"><a id="CACFFHEH" name="CACFFHEH"></a>Sequence&nbsp;Generator</td>
-<td align="left" headers="r11c1-t19 r1c2-t19"><a id="sthref253" name="sthref253"></a><a id="sthref254" name="sthref254"></a>These fields define the specific sequence used for generating the primary key and correspond to the <code>@SequenceGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span> = <span class="bold">Sequence</span>.</p>
-</td>
-<td align="left" headers="r11c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r12c1-t19 r1c2-t19">Name of the sequence table to use for defining primary key values.</td>
-<td align="left" headers="r12c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Sequence</td>
-<td align="left" headers="r13c1-t19 r1c2-t19">Unique name of the sequence.</td>
-<td align="left" headers="r13c1-t19 r1c3-t19"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks013.htm#BABGCBHG">ID mapping</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
deleted file mode 100644
index 7a6aa85241..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Project Properties page &ndash; Java Persistence Options</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Project Properties page &ndash; Java Persistence Options" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABJHBCI" name="BABJHBCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Project Properties page &ndash; Java Persistence Options</h1>
-<p><a id="sthref273" name="sthref273"></a><a id="sthref274" name="sthref274"></a>Use the <span class="gui-object-title">Errors/Warnings</span> options on the <span class="gui-object-title">Properties</span> page to specify the validation options to use with the project.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties page." summary="This table describes the options on the Persistence Properties page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t36">Property</th>
-<th align="left" valign="bottom" id="r1c2-t36">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t36" headers="r1c1-t36">Enable project specific settings</td>
-<td align="left" headers="r2c1-t36 r1c2-t36">Select the to override the general settings for this project.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Project level</td>
-<td align="left" headers="r3c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Persistent unit level</td>
-<td align="left" headers="r4c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Type level</td>
-<td align="left" headers="r5c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Attribute level</td>
-<td align="left" headers="r6c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Schema mapping</td>
-<td align="left" headers="r7c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Implied&nbsp;attributes</td>
-<td align="left" headers="r8c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Implied&nbsp;associations</td>
-<td align="left" headers="r9c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Inheritance</td>
-<td align="left" headers="r10c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Queries&nbsp;and&nbsp;generators</td>
-<td align="left" headers="r11c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks026.htm#BABDBCBI">Modifying persistent project properties</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm
deleted file mode 100644
index 46ff81ed85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Schema from Classes</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T16:18:13Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Schema from Classes" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACHBEGJ" name="CACHBEGJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Schema from Classes</h1>
-<p>Use this dialog to select the classes from which to generate a schema. You can select an entire project, a package, or specific classes.</p>
-</div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm
deleted file mode 100644
index ea7d3c1a7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Select Tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Select Tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHCGEE" name="CIAHCGEE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Select Tables</h1>
-<p><a id="sthref201" name="sthref201"></a><a id="sthref202" name="sthref202"></a><a id="sthref203" name="sthref203"></a>Use the <span class="gui-object-title">Select Tables</span> dialog to specify the database connection and tables from which to create entities.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Generate Entities dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Connection</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Select a database connection or click <span class="bold">Add Connection</span> to create a new connection.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">Schema</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Select the database schema from which to select tables.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">Tables</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Select the tables from which to create Java persistent entities. The tables shown are determined by the database connection and schema selections.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8">Synchronize Classes listed in persistence.xml</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Specify if Dali should update the <code>persistence.xml</code> file to include the generated classes.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm
deleted file mode 100644
index 317bf1e1f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Select Cascade dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Select Cascade dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFDGIJ" name="CIAFDGIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Select Cascade dialog</h1>
-<p>Specify which operations are propagated throughout the association: All, Persist, Merge, Remove, or Refresh.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm
deleted file mode 100644
index 507ef3adaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Table Associations</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Table Associations" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACDICB" name="CIACDICB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Table Associations</h1>
-<p><a id="sthref204" name="sthref204"></a>Use this page to create or edit the association between the database table and entity.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Table Associations dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t9">Property</th>
-<th align="left" valign="bottom" id="r1c2-t9">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t9" headers="r1c1-t9">Table associations</td>
-<td align="left" headers="r2c1-t9 r1c2-t9">Select an association to modify or click to create a new table association with the <a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a> wizard.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t9" headers="r1c1-t9">Generate this association</td>
-<td align="left" headers="r3c1-t9 r1c2-t9">Specify if Dali should create the selected association. If enabled, you can specify the Cardinality and Join table for the table association.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t9" headers="r1c1-t9">Generate a reference to <span class="italic">&lt;ROW&gt;</span> in <span class="italic">&lt;TABLE&gt;</span></td>
-<td align="left" headers="r4c1-t9 r1c2-t9">Specify if the entity should contain a reference to the specified table.
-<p>If enabled, you can also enter the <span class="bold">Property</span> name and select the <span class="bold">Cascade</span> method (all, persist, merge, remove, or refresh) for the reference.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
deleted file mode 100644
index edb027d6f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Reference</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Reference" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref189" name="sthref189"></a></p>
-<h1>Reference</h1>
-<p>This section includes detailed help information for each of the following elements in the Dali OR Mapping Tool:</p>
-<ul>
-<li>
-<p><a href="reference001.htm#CACJJJJH">Wizards</a></p>
-</li>
-<li>
-<p><a href="reference005.htm#CACDJIIG">Property pages</a></p>
-</li>
-<li>
-<p><a href="reference026.htm#CACDEIEE">Preferences</a></p>
-</li>
-<li>
-<p><a href="reference028.htm#CACGEJDA">Dialogs</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a></p>
-</li>
-<li>
-<p><a href="reference030.htm#CACDHCIA">Icons and buttons</a></p>
-</li>
-<li>
-<p><a href="reference033.htm#CACBBDIB">Dali Developer Documentation</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
deleted file mode 100644
index be40229799..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Wizards</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:33:3Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Wizards" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACJJJJH" name="CACJJJJH"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Wizards</h1>
-<p>This section includes information on the following wizards:</p>
-<ul>
-<li>
-<p><a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></p>
-</li>
-<li>
-<p><a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a></p>
-</li>
-<li>
-<p><a href="reference004.htm#CIAGHCGA">Generate Tables from Entities Wizard</a></p>
-</li>
-<li>
-<p><a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></p>
-</li>
-<li>
-<p><a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a></p>
-</li>
-<li>
-<p><a href="ref_jaxb_schema_wizard.htm#CACGADFH">Generate Schema from JAXB Classes Wizard</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
deleted file mode 100644
index a636406aa6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapping File Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAIJCCE" name="CIAIJCCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Mapping File Wizard</h1>
-<p>The Mapping File wizard enables you to add an <code>orm.xml</code> file to a JPA project if no object map exists at the location specified. For example, if you cleared the <span class="bold">Create orm.xml</span> option on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a>, you can later add the <code>orm.xml</code> file to the src file of the project using this wizard.</p>
-<p>The <a href="#CIAIJCCE">Mapping File Wizard</a> consists of the Mapping File page.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
deleted file mode 100644
index 80773ce3bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapping File</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAJEIDJ" name="CIAJEIDJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Mapping File</h1>
-<p>This table lists the properties of the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<div class="tblformal"><a id="sthref199" name="sthref199"></a><a id="sthref200" name="sthref200"></a>
-<p class="titleintable">Mapping File Wizard Properties</p>
-<table class="Formal" title="Mapping File Wizard Properties" summary="This table lists the properties of the Mapping File Wizard." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t7">Property</th>
-<th align="left" valign="bottom" id="r1c2-t7">Description</th>
-<th align="left" valign="bottom" id="r1c3-t7">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t7" headers="r1c1-t7">
-<p>Project</p>
-</td>
-<td align="left" headers="r2c1-t7 r1c2-t7">
-<p>The name of the JPA project.</p>
-</td>
-<td align="left" headers="r2c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t7" headers="r1c1-t7">
-<p>Source folder</p>
-</td>
-<td align="left" headers="r3c1-t7 r1c2-t7">
-<p>The location of the project's src folder. If needed, click <span class="bold">Browse</span> to point the wizard to the src file's location.</p>
-</td>
-<td align="left" headers="r3c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t7" headers="r1c1-t7">
-<p>File Path</p>
-</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">
-<p>The location for the new <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t7" headers="r1c1-t7">
-<p>Default Access</p>
-</td>
-<td align="left" headers="r5c1-t7 r1c2-t7">
-<p>Select whether the access to the entity is field-based or property-based, as defined in JPA specification.</p>
-<ul>
-<li>
-<p>None &ndash; No access type specified.</p>
-</li>
-<li>
-<p><span class="bold">Property-based</span> &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-<li>
-<p><span class="bold">Field-based</span> &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t7 r1c3-t7">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t7" headers="r1c1-t7">
-<p>Add to persistence unit</p>
-</td>
-<td align="left" headers="r6c1-t7 r1c2-t7">
-<p>Designates the persistence unit for this object map file.</p>
-</td>
-<td align="left" headers="r6c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a><br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a><br /></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
deleted file mode 100644
index 8a00cd0882..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Tables from Entities Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Tables from Entities Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGHCGA" name="CIAGHCGA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Tables from Entities Wizard</h1>
-<p>Use the Generate DDL from Entities Wizard to quickly create DDL scripts from your persistent entities. Dali automatically creates the necessary primary and foreign keys, based on the entity mappings.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
deleted file mode 100644
index a11400d263..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Property pages</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Property pages" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDJIIG" name="CACDJIIG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Property pages</h1>
-<p>This section includes information on the following:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
deleted file mode 100644
index 31bc24dbb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCAGGC" name="CACCAGGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="16%" />
-<col width="*" />
-<col width="17%" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t13">Property</th>
-<th align="left" valign="bottom" id="r1c2-t13">Description</th>
-<th align="left" valign="bottom" id="r1c3-t13">Default</th>
-<th align="left" valign="bottom" id="r1c4-t13">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t13" headers="r1c1-t13">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t13 r1c2-t13">Clicking the name of the mapping type, which is represented as a hyperlink, invokes the Mapping Type Selection dialog. Use this dialog to specify the type of entity: Mapped Superclass, Embeddable or the default mapping type.</td>
-<td align="left" headers="r2c1-t13 r1c3-t13">Entity</td>
-<td align="left" headers="r2c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a>, <a href="tasks007.htm#BABFEICE">Embeddable</a>, and <a href="tasks008.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13">Table</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">The default database table information for this entity. These fields can be overridden by the information in the <a href="reference007.htm#CACIJBGH">Attribute overrides</a> area.</td>
-<td align="left" headers="r3c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r3c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">The name of the primary database table associated with the entity.</td>
-<td align="left" headers="r4c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r4c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Catalog</td>
-<td align="left" headers="r5c1-t13 r1c2-t13">The database catalog that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r5c1-t13 r1c3-t13">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r5c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Schema</td>
-<td align="left" headers="r6c1-t13 r1c2-t13">The database schema that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r6c1-t13 r1c3-t13">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r6c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t13" headers="r1c1-t13">Name</td>
-<td align="left" headers="r7c1-t13 r1c2-t13">The name of this entity. By default, the class name is used as the entity name.</td>
-<td align="left" headers="r7c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r7c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t13" headers="r1c1-t13">Access</td>
-<td align="left" headers="r8c1-t13 r1c2-t13">The access method for this entity.</td>
-<td align="left" headers="r8c1-t13 r1c3-t13">Field</td>
-<td align="left" headers="r8c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t13" headers="r1c1-t13">Primary&nbsp;key&nbsp;class</td>
-<td align="left" headers="r9c1-t13 r1c2-t13">Click <span class="bold">Browse</span> and select the primary key for the entity. Clicking the field name, which is represented as a hyperlink, allows you to create a new class.</td>
-<td align="left" headers="r9c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r9c1-t13 r1c4-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t13" headers="r1c1-t13">Cachable</td>
-<td align="left" headers="r10c1-t13 r1c2-t13">Specifies if the entity is cachable.
-<p>This field corresponds to the <code>@Cachable</code> annotation.</p>
-</td>
-<td align="left" headers="r10c1-t13 r1c3-t13">@Cachable(false)</td>
-<td align="left" headers="r10c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
deleted file mode 100644
index 3100acd390..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Attribute overrides</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Attribute overrides" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACIJBGH" name="CACIJBGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Attribute overrides</h1>
-<p><a id="sthref214" name="sthref214"></a><a id="sthref215" name="sthref215"></a><a id="sthref216" name="sthref216"></a>Use the <span class="gui-object-title">Attribute Overrides</span> area in the <span class="gui-object-title">JPA Details</span> view to override the default settings specified in the <a href="reference006.htm#CACCAGGC">General information</a> area of an attribute. Attribute overrides generally override/configure attributes that are inherited or embedded.</p>
-<p>This table lists the Attribute override fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="16%" />
-<col width="*" />
-<col width="17%" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-<th align="left" valign="bottom" id="r1c3-t14">Default</th>
-<th align="left" valign="bottom" id="r1c4-t14">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14">Attribute Overrides</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">Specify a property or field to be overridden (from the default mappings). Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r2c1-t14 r1c3-t14"><br /></td>
-<td align="left" headers="r2c1-t14 r1c4-t14"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Join Columns</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">Specify the joining strategy. Select <span class="bold">Override Default</span> to add a different joining strategy.</td>
-<td align="left" headers="r3c1-t14 r1c3-t14">Join columns</td>
-<td align="left" headers="r3c1-t14 r1c4-t14"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference006.htm#CACCAGGC">General information</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
deleted file mode 100644
index edd0f9f932..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Secondary table information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Secondary table information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBHIDA" name="CACBHIDA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Secondary table information</h1>
-<p><a id="sthref217" name="sthref217"></a><a id="sthref218" name="sthref218"></a><a id="sthref219" name="sthref219"></a><a id="sthref220" name="sthref220"></a>Use the <span class="gui-object-title">Secondary Tables</span> area in the <span class="gui-object-title">JPA Details</span> view to associate additional tables with an entity. Use this area if the data associated with an entity is spread across multiple tables.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
deleted file mode 100644
index b905385cad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Inheritance information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFHGHE" name="CACFHGHE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Inheritance information</h1>
-<p><a id="sthref221" name="sthref221"></a><a id="sthref222" name="sthref222"></a>This table lists the fields available on the <span class="gui-object-title">Inheritance</span> area in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="23%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Property</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-<th align="left" valign="bottom" id="r1c3-t15">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15">Strategy</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Specify the strategy to use when mapping a class or class hierarchy:
-<ul>
-<li>
-<p>Single table &ndash; All classes in the hierarchy are mapped to a single table.</p>
-</li>
-<li>
-<p>Joined &ndash; The root of the hierarchy is mapped to a single table; each child maps to its own table.</p>
-</li>
-<li>
-<p>Table per class &ndash; Each class is mapped to a separate table.</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Inheritance</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t15 r1c3-t15">Single table</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15"><a id="sthref223" name="sthref223"></a><a id="sthref224" name="sthref224"></a>Discriminator Value</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.</td>
-<td align="left" headers="r3c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t15" headers="r1c1-t15"><a id="sthref225" name="sthref225"></a><a id="sthref226" name="sthref226"></a>Discriminator Column</td>
-<td align="left" headers="r4c1-t15 r1c2-t15">These fields are available when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.
-<p>This field corresponds to the <code>@DiscriminatorColumn</code> annotation.</p>
-<p>Use the <span class="bold">Details</span> area to define the <span class="bold">Length</span> and <span class="bold">Column definition</span> of this Discriminator Column.</p>
-</td>
-<td align="left" headers="r4c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t15" headers="r1c1-t15">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r5c1-t15 r1c2-t15">Name of the discriminator column</td>
-<td align="left" headers="r5c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t15" headers="r1c1-t15">&nbsp;&nbsp;Type</td>
-<td align="left" headers="r6c1-t15 r1c2-t15">Set this field to set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r6c1-t15 r1c3-t15">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t15" headers="r1c1-t15">Primary Key Join Columns</td>
-<td align="left" headers="r7c1-t15 r1c2-t15">Use to override the default primary key join columns. Select <span class="bold">Override Default</span>, then click <span class="bold">Add</span> to select new Join Column.
-<p>This field corresponds with @PrimaryKeyJoinColumn annotation.</p>
-</td>
-<td align="left" headers="r7c1-t15 r1c3-t15"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
deleted file mode 100644
index f4b3e9ab36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Queries</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Queries" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref227" name="sthref227"></a>
-<h1>Queries</h1>
-<p>Use the queries area of the JPA Details view to create named queries and named native queries. Refer to <a href="tasks009.htm#BABIGBGG">"Creating Named Queries"</a> for additional information.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks009.htm#BABIGBGG">Creating Named Queries</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
deleted file mode 100644
index 25cdce9134..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Join Table Information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Table Information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBAEBC" name="CACBAEBC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Table Information</h1>
-<p>Use area to specify a mapped column for joining an entity association. By default, the mapping is assumed to have a single join.</p>
-<p>This table lists the fields available on the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">the JPA Details</span> view for <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a> and <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Table tab." summary="This table describes the options on the Join Table tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="26%" />
-<col width="*" />
-<col width="34%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t17">Property</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-<th align="left" valign="bottom" id="r1c3-t17">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17">Name</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t17 r1c3-t17">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t17" headers="r1c1-t17"><a id="CACBBDFG" name="CACBBDFG"></a>Join Columns</td>
-<td align="left" headers="r3c1-t17 r1c2-t17"><a id="sthref246" name="sthref246"></a><a id="sthref247" name="sthref247"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r3c1-t17 r1c3-t17">By default, the mapping is assumed to have a single join.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t17" headers="r1c1-t17">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t17 r1c2-t17">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t17 r1c3-t17"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference029.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
deleted file mode 100644
index 619907782d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Join Columns Information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Columns Information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFCEJC" name="CACFCEJC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Columns Information</h1>
-<p><a id="sthref248" name="sthref248"></a>This table lists the fields available in the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">JPA Details</span> view for <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a> and <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="26%" />
-<col width="*" />
-<col width="34%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t18">Property</th>
-<th align="left" valign="bottom" id="r1c2-t18">Description</th>
-<th align="left" valign="bottom" id="r1c3-t18">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t18" headers="r1c1-t18">Join Column</td>
-<td align="left" headers="r2c1-t18 r1c2-t18"><a id="sthref249" name="sthref249"></a><a id="sthref250" name="sthref250"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t18 r1c3-t18">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference029.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
deleted file mode 100644
index 0b08922f60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCACGH" name="CACCACGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<col width="22%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t20">Property</th>
-<th align="left" valign="bottom" id="r1c2-t20">Description</th>
-<th align="left" valign="bottom" id="r1c3-t20">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t20" headers="r1c1-t20">Package</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">The Java package that contains the persistent entities. Click <span class="bold">Browse</span> and select the package</td>
-<td align="left" headers="r2c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">Schema</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r3c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t20" headers="r1c1-t20">Catalog</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t20" headers="r1c1-t20">Access</td>
-<td align="left" headers="r5c1-t20 r1c2-t20">Specify the default access method for the variables in the project:
-<ul>
-<li>
-<p>Property</p>
-</li>
-<li>
-<p>Field</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>&lt;access&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r5c1-t20 r1c3-t20"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
deleted file mode 100644
index e824d3fab2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Persistence Unit information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Persistence Unit information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACEAGBG" name="CACEAGBG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Persistence Unit information</h1>
-<p>This table lists the Persistence Unit information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type. These fields are contained in the <code>&lt;persistence-unit-metadata&gt;</code> element in the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<col width="22%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t21">Property</th>
-<th align="left" valign="bottom" id="r1c2-t21">Description</th>
-<th align="left" valign="bottom" id="r1c3-t21">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t21" headers="r1c1-t21">XML Mapping Data Complete</td>
-<td align="left" headers="r2c1-t21 r1c2-t21">Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.
-<p>This field corresponds to the <code>&lt;xml-mapping-metadata-complete&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r2c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t21" headers="r1c1-t21">Cascade Persist</td>
-<td align="left" headers="r3c1-t21 r1c2-t21">Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.
-<p>This field corresponds to the <code>&lt;cascade-persist&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r3c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t21" headers="r1c1-t21">Schema</td>
-<td align="left" headers="r4c1-t21 r1c2-t21">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t21" headers="r1c1-t21">Catalog</td>
-<td align="left" headers="r5c1-t21 r1c2-t21">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r5c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t21" headers="r1c1-t21">Access</td>
-<td align="left" headers="r6c1-t21 r1c2-t21">Specify how the entity its access instance variables.
-<ul>
-<li>
-<p>Property &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-<li>
-<p>Field &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r6c1-t21 r1c3-t21">Property</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
deleted file mode 100644
index dd0c88a4e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generators</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generators" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFGAIJ" name="CIAFGAIJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Generators</h1>
-<p>This table lists the Generator information fields available in the <span class="gui-object-title">JPA Details</span> view for the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t22">Property</th>
-<th align="left" valign="bottom" id="r1c2-t22">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t22" headers="r1c1-t22">Generator</td>
-<td align="left" headers="r2c1-t22 r1c2-t22">Displays the existing Sequence and Table generators.
-<p>Click <span class="bold">Add Sequence</span> or <span class="bold">Add Table</span> to add a new generator.</p>
-<p>For sequence generators, you must complete the following fields:</p>
-<ul>
-<li>
-<p>Name</p>
-</li>
-<li>
-<p>Sequence</p>
-</li>
-<li>
-<p>Schema</p>
-</li>
-<li>
-<p>Catalog</p>
-</li>
-<li>
-<p>Allocation size</p>
-</li>
-<li>
-<p>Initial value</p>
-</li>
-</ul>
-<p>For table generators, you must complete the following fields:</p>
-<ul>
-<li>
-<p>Name</p>
-</li>
-<li>
-<p>Table</p>
-</li>
-<li>
-<p>Schema</p>
-</li>
-<li>
-<p>Catalog</p>
-</li>
-<li>
-<p>Primary key column</p>
-</li>
-<li>
-<p>Value column</p>
-</li>
-<li>
-<p>Primary key column value</p>
-</li>
-<li>
-<p>Allocation size</p>
-</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
deleted file mode 100644
index 227a2b3ec2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Queries</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Queries" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAIBAAJ" name="CIAIBAAJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Queries</h1>
-<p>This table lists the Query information fields available in the <span class="gui-object-title">JPA Details</span> view for the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t23">Property</th>
-<th align="left" valign="bottom" id="r1c2-t23">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t23" headers="r1c1-t23">Queries</td>
-<td align="left" headers="r2c1-t23 r1c2-t23">Displays the existing Named and Native queries.
-<p>Click <span class="bold">Add</span> to add a named query, or <span class="bold">Add Native</span> for a native query.</p>
-<p>For named queries, enter the query in the Query field.</p>
-<p>For native queries, select a result class, then enter the query in the Query field.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t23" headers="r1c1-t23">Query Hints</td>
-<td align="left" headers="r3c1-t23 r1c2-t23">Displays the existing query hints (Name and Value).
-<p>Click <span class="bold">Add</span> to add a new query hint.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks009.htm#BABIGBGG">Creating Named Queries</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
deleted file mode 100644
index a9a21aad29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Converters</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Converters" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIADGCID" name="CIADGCID"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Converters</h1>
-<p>The Converters information in the JPA Details view applies only when using EclipseLink</p>
-<p>Click <span class="bold">Add</span> to create a new converter, using the <a href="ref_add_converter.htm#CIAGCGIJ">Add Converter dialog</a>.</p>
-<p>&nbsp;</p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm
deleted file mode 100644
index 8f35b73150..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Connection</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Connection" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFFJIE" name="CIAFFJIE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Connection</h1>
-<p>The following table lists the properties available in the Connection page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref260" name="sthref260"></a><a id="sthref261" name="sthref261"></a>
-<p class="titleintable">Properties of the Connection Page</p>
-<table class="Formal" title="Properties of the Connection Page" summary="This table lists the properties for the persistence.xml editor&rsquo;s connection page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t25">Property</th>
-<th align="left" valign="bottom" id="r1c2-t25">Description</th>
-<th align="left" valign="bottom" id="r1c3-t25">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t25" headers="r1c1-t25">
-<p>Transaction Type</p>
-</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">
-<p>Specify if the connection for this persistence unit uses one of the following transaction types:</p>
-<ul>
-<li>
-<p><span class="bold">Default</span> -- Select to use the container used by the container.</p>
-</li>
-<li>
-<p><span class="bold">JTA</span> (Java Transaction API) -- Transactions of the Java EE server.</p>
-</li>
-<li>
-<p><span class="bold">Resource Local</span> -- Native actions of a JDBC driver that are referenced by a persistence unit.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t25" headers="r1c1-t25">
-<p>Batch Writing</p>
-</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">
-<p>Specify the use of batch writing to optimize transactions with multiple write operations.</p>
-<p>Set the value of this property into the session at deployment time.</p>
-<p>Note: This property applies when used both in a Java SE and Java EE environment.</p>
-<p>The following are the valid values for oracle.toplink.config.BatchWriting:</p>
-<ul>
-<li>
-<p><span class="bold">JDBC</span>&ndash;Use JDBC batch writing.</p>
-</li>
-<li>
-<p><span class="bold">Buffered</span>&ndash;Do not use either JDBC batch writing nor native platform batch writing.</p>
-</li>
-<li>
-<p><span class="bold">OracleJDBC</span>&ndash;Use both JDBC batch writing and Oracle native platform batch writing.</p>
-</li>
-<li>
-<p><span class="bold">None</span>&ndash;Do not use batch writing (turn it off).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t25 r1c3-t25">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">
-<p>Statement caching</p>
-</td>
-<td align="left" headers="r4c1-t25 r1c2-t25"><br /></td>
-<td align="left" headers="r4c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t25" headers="r1c1-t25">
-<p>Native SQL</p>
-</td>
-<td align="left" headers="r5c1-t25 r1c2-t25"><br /></td>
-<td align="left" headers="r5c1-t25 r1c3-t25">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t25" headers="r1c1-t25">
-<p>JTA Data Source Name</p>
-</td>
-<td align="left" headers="r6c1-t25 r1c2-t25">
-<p>If you selected <span class="bold">JTA</span> as the transaction type, then enter the name of the default JTA data source for the persistence unit.</p>
-</td>
-<td align="left" headers="r6c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t25" headers="r1c1-t25">
-<p>Non-JTA Data Source Name</p>
-</td>
-<td align="left" headers="r7c1-t25 r1c2-t25">
-<p>If you selected <span class="bold">Resource Local</span> as the transaction type, then enter the name of the non-JTA data source.</p>
-<p>This property is not available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r7c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t25" headers="r1c1-t25">
-<p>&nbsp;&nbsp;Bind&nbsp;Parameters</p>
-</td>
-<td align="left" headers="r8c1-t25 r1c2-t25">
-<p>Control whether or not the query uses parameter binding.</p>
-<p>Note: This property applies when used in a Java SE environment.</p>
-<p>This property is not available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r8c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t25" headers="r1c1-t25">
-<p>EclipseLink Connection Pool</p>
-</td>
-<td align="left" headers="r9c1-t25 r1c2-t25">
-<p>Define the connection pool driver, URL, user name and password.</p>
-<p>These properties are note available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r9c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t25" headers="r1c1-t25">
-<p>&nbsp;&nbsp;Read&nbsp;Connection</p>
-</td>
-<td align="left" headers="r10c1-t25 r1c2-t25">
-<p>The maximum and minimum number of connections allowed in the JDBC read connection pool.</p>
-<p>Note: These property apply when used in a Java SE environment.</p>
-<p>These properties are not available for projects using the Generic platform</p>
-</td>
-<td align="left" headers="r10c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t25" headers="r1c1-t25">
-<p>&nbsp;&nbsp;Write&nbsp;Connection</p>
-</td>
-<td align="left" headers="r11c1-t25 r1c2-t25">
-<p>The maximum and minimum number of connections allowed in the JDBC read connection pool.</p>
-<p>Note: These property apply when used in a Java SE environment.</p>
-<p>These properties are not available for projects using the Generic platform</p>
-</td>
-<td align="left" headers="r11c1-t25 r1c3-t25"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm
deleted file mode 100644
index 2a13dba748..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm
+++ /dev/null
@@ -1,221 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Customization</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customization" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAJAFEG" name="CIAJAFEG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Customization</h1>
-<p>The following table lists the properties available in the Customization page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref262" name="sthref262"></a><a id="sthref263" name="sthref263"></a>
-<p class="titleintable">Properties of the Customization Page</p>
-<table class="Formal" title="Properties of the Customization Page" summary="This table lists the properties of the persistence.xml Editor&rsquo;s Customization page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="23%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t26">Property</th>
-<th align="left" valign="bottom" id="r1c2-t26">Description</th>
-<th align="left" valign="bottom" id="r1c3-t26">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t26" headers="r1c1-t26">
-<p>Weaving</p>
-</td>
-<td align="left" headers="r2c1-t26 r1c2-t26">
-<p>Specifies if weaving of the entity classes is performed. The EclipseLink JPA persistence provider uses weaving to enhance JPA entities for such properties as lazy loading, change tracking, fetch groups, and internal optimizations. Select from the following options:</p>
-<ul>
-<li>
-<p><span class="bold">No Weaving</span></p>
-</li>
-<li>
-<p><span class="bold">Weave Dynamically</span></p>
-</li>
-<li>
-<p><span class="bold">Weave Statically</span> -- Use this option if you plan to execute your application outside of a Java EE 5 container in an environment that does not permit the use of <code>-javaagent:eclipselink.jar</code> on the JVM command line. This assumes that classes have already been statically woven. Run the static weaver on the classes before deploying them.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t26 r1c3-t26">
-<p>Weave Dynamically</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Weaving&nbsp;Lazy</p>
-</td>
-<td align="left" headers="r3c1-t26 r1c2-t26">
-<p>Select this option to enable lazy weaving.</p>
-</td>
-<td align="left" headers="r3c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Weaving&nbsp;Fetch&nbsp;Groups</p>
-</td>
-<td align="left" headers="r4c1-t26 r1c2-t26">
-<p>Select this option to enable fetch groups through weaving. Set this option to false if:</p>
-<ul>
-<li>
-<p>There is no weaving.</p>
-</li>
-<li>
-<p>Classes should not be changed during weaving (for example, when debugging).</p>
-</li>
-</ul>
-<p>Set this property to false for platforms where it is not supported.</p>
-</td>
-<td align="left" headers="r4c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t26" headers="r1c1-t26">
-<p>Weaving&nbsp;internal</p>
-</td>
-<td align="left" headers="r5c1-t26 r1c2-t26"><br /></td>
-<td align="left" headers="r5c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t26" headers="r1c1-t26">
-<p>Weaving&nbsp;eager</p>
-</td>
-<td align="left" headers="r6c1-t26 r1c2-t26"><br /></td>
-<td align="left" headers="r6c1-t26 r1c3-t26">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Weaving&nbsp;Change&nbsp;Tracking</p>
-</td>
-<td align="left" headers="r7c1-t26 r1c2-t26">
-<p>Select this option to use weaving to detect which fields or properties of the object change.</p>
-</td>
-<td align="left" headers="r7c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Throw&nbsp;Exceptions</p>
-</td>
-<td align="left" headers="r8c1-t26 r1c2-t26">
-<p>Select this option to set EclipseLink to throw an exception or log a warning when it encounters a problem with any of the files listed in a <span class="bold">persistence.xml</span> file <code>&lt;mapping-file&gt;</code> element.</p>
-</td>
-<td align="left" headers="r8c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t26" headers="r1c1-t26">
-<p>Exception handler</p>
-</td>
-<td align="left" headers="r9c1-t26 r1c2-t26">
-<p>Select (or create) a Java class to handle exceptions.</p>
-</td>
-<td align="left" headers="r9c1-t26 r1c3-t26"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t26" headers="r1c1-t26">
-<p>Session Customizer</p>
-</td>
-<td align="left" headers="r10c1-t26 r1c2-t26">
-<p>Select a session customizer class: a Java class that implements the <code>eclipselink.tools.sessionconfiguration.SessionCustomizer</code> interface and provides a default (zero-argument) constructor. Use this class' <code>customize</code> method, which takes an <code>eclipselink.sessions.Session</code>, to programmatically access advanced EclipseLink session API.</p>
-</td>
-<td align="left" headers="r10c1-t26 r1c3-t26"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t26" headers="r1c1-t26">
-<p>Descriptor Customizer</p>
-</td>
-<td align="left" headers="r11c1-t26 r1c2-t26">
-<p>Select an EclipseLink descriptor customizer class&ndash;a Java class that implements the <code>eclipselink.tools.sessionconfiguration.DescriptorCustomizer</code> interface and provides a default (zero-argument) constructor. Use this class's <code>customize</code> method, which takes an <code>eclipselink.descriptors.ClassDescriptor</code>, to programmatically access advanced EclipseLink descriptor and mapping API for the descriptor associated with the JPA entity named <code>&lt;ENTITY&gt;</code>.</p>
-</td>
-<td align="left" headers="r11c1-t26 r1c3-t26"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t26" headers="r1c1-t26">
-<p>Validation only</p>
-</td>
-<td align="left" headers="r12c1-t26 r1c2-t26"><br /></td>
-<td align="left" headers="r12c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t26" headers="r1c1-t26">
-<p>Profiler</p>
-</td>
-<td align="left" headers="r13c1-t26 r1c2-t26">
-<ul>
-<li>
-<p>No Profiler</p>
-</li>
-<li>
-<p>Performance Profiler</p>
-</li>
-<li>
-<p>Query Monitor</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r13c1-t26 r1c3-t26">
-<p>NoProfiler</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm
deleted file mode 100644
index 769e6de077..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm
+++ /dev/null
@@ -1,185 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Caching</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Caching" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIABEDCH" name="CIABEDCH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref264" name="sthref264"></a>Caching</h1>
-<p>This table lists the properties of the Caching page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref265" name="sthref265"></a><a id="sthref266" name="sthref266"></a>
-<p class="titleintable">Properties of the Caching Page</p>
-<table class="Formal" title="Properties of the Caching Page" summary="This table lists the properties of the persistence.xml&rsquo;s Caching page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t28">Property</th>
-<th align="left" valign="bottom" id="r1c2-t28">Description</th>
-<th align="left" valign="bottom" id="r1c3-t28">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t28" headers="r1c1-t28">
-<p>Default Cache Type</p>
-</td>
-<td align="left" headers="r2c1-t28 r1c2-t28">
-<p>Select one of the following as the Default Cache Type:</p>
-<ul>
-<li>
-<p><span class="bold">Soft with Weak Subcache</span>&ndash;This option is similar to <span class="bold">Weak with Hard Subcache</span> except that it maintains a most frequently used subcache that uses soft references. The size of the subcache is proportional to the size of the identity map. The subcache uses soft references to ensure that these objects are garbage-collected only if the system is low on memory.</p>
-<p>Use this identity map in most circumstances as a means to control memory used by the cache.</p>
-</li>
-<li>
-<p><span class="bold">Week with Hard Subcache</span>&ndash;This option is similar to <span class="bold">Soft with Weak</span> subcache except that it maintains a most frequently used subcache that uses hard references. Use this identity map if soft references are not suitable for your platform.</p>
-</li>
-<li>
-<p><span class="bold">Weak</span>&ndash;This option is similar to <span class="bold">Full</span>, except that objects are referenced using weak references. This option uses less memory than <span class="bold">Full</span>, allows complete garbage collection and provides full caching and guaranteed identity.</p>
-<p>Use this identity map for transactions that, once started, stay on the server side.</p>
-</li>
-<li>
-<p><span class="bold">Soft</span>&ndash;This option is similar to <span class="bold">Weak</span> except that the map holds the objects using soft references. This identity map enables full garbage collection when memory is low. It provides full caching and guaranteed identity.</p>
-</li>
-<li>
-<p><span class="bold">Full</span>&ndash;This option provides full caching and guaranteed identity: all objects are cached and not removed.</p>
-<p>Note: This process may be memory-intensive when many objects are read.</p>
-</li>
-<li>
-<p><span class="bold">None</span>&ndash;This option does not preserve object identity and does not cache objects.This option is not recommended.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t28 r1c3-t28">
-<p>Weak with soft subcache</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t28" headers="r1c1-t28">
-<p>Default Cache Size</p>
-</td>
-<td align="left" headers="r3c1-t28 r1c2-t28">
-<p>Set the size (maximum number of objects) of the cache.</p>
-</td>
-<td align="left" headers="r3c1-t28 r1c3-t28">
-<p>100</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t28" headers="r1c1-t28">
-<p>Default Shared Cache</p>
-</td>
-<td align="left" headers="r4c1-t28 r1c2-t28">
-<p>Specifies if cached instances should be in the shared cache or in a client isolated cache.</p>
-</td>
-<td align="left" headers="r4c1-t28 r1c3-t28">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t28" headers="r1c1-t28">
-<p>Entity Caching</p>
-</td>
-<td align="left" headers="r5c1-t28 r1c2-t28">
-<p>Specify the entity-specific caching information.</p>
-</td>
-<td align="left" headers="r5c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t28" headers="r1c1-t28">
-<p>&nbsp;&nbsp;Cache&nbsp;Type</p>
-</td>
-<td align="left" headers="r6c1-t28 r1c2-t28">
-<p>See <span class="italic">Default Cache Type.</span></p>
-</td>
-<td align="left" headers="r6c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t28" headers="r1c1-t28">
-<p>&nbsp;&nbsp;Cache&nbsp;Size</p>
-</td>
-<td align="left" headers="r7c1-t28 r1c2-t28">
-<p>See <span class="italic">Default Cache Size.</span></p>
-</td>
-<td align="left" headers="r7c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t28" headers="r1c1-t28">
-<p>&nbsp;&nbsp;Shared&nbsp;Cache</p>
-</td>
-<td align="left" headers="r8c1-t28 r1c2-t28">
-<p>See <span class="italic">Default Shared Cache</span>.</p>
-</td>
-<td align="left" headers="r8c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t28" headers="r1c1-t28">
-<p>Flush clear cache</p>
-</td>
-<td align="left" headers="r9c1-t28 r1c2-t28">
-<p>Select one of the following as the Default Cache Type:</p>
-<ul>
-<li>
-<p><span class="bold">Drop</span> &ndash; This mode is the fastest and uses the least memory. However, after commit the shared cache might potentially contain stale data.</p>
-</li>
-<li>
-<p><span class="bold">Drop Invalidate</span> &ndash; Classes that have at least one object updated or deleted are invalidated in the shared cache at commit time. This mode is slower than <span class="bold">Drop</span>, but as efficient memory usage-wise, and prevents stale data.</p>
-</li>
-<li>
-<p><span class="bold">Merge</span> &ndash; Drop classes from the EntityManager's cache of objects that have not been flushed. This mode leaves the shared cache in a perfect state after commit. However, it is the least memory-efficient mode; the memory might even run out in a very large transaction.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r9c1-t28 r1c3-t28">
-<p>Drop Invalidate</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm
deleted file mode 100644
index c92c362700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm
+++ /dev/null
@@ -1,241 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Logging</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Logging" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIABGHHI" name="CIABGHHI"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Logging</h1>
-<p>This table lists the properties of the Logging page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref267" name="sthref267"></a><a id="sthref268" name="sthref268"></a>
-<p class="titleintable">Properties of the Logging Page</p>
-<table class="Formal" title="Properties of the Logging Page" summary="This table lists the properties of the Logging page of the persistence.xml Editor." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t31">Property</th>
-<th align="left" valign="bottom" id="r1c2-t31">Description</th>
-<th align="left" valign="bottom" id="r1c3-t31">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t31" headers="r1c1-t31">
-<p>Logging Level</p>
-</td>
-<td align="left" headers="r2c1-t31 r1c2-t31">
-<p>Specifies the amount and detail of log output by selecting the log level (in ascending order of information):</p>
-<p>The following are the valid values for the <code>java.util.logging.Level</code>:</p>
-<ul>
-<li>
-<p><span class="bold">OFF</span>&ndash;disables logging</p>
-</li>
-<li>
-<p><span class="bold">SEVERE</span>&ndash;logs exceptions indicating TopLink cannot continue, as well as any exceptions generated during login. This includes a stack trace.</p>
-</li>
-<li>
-<p><span class="bold">WARNING</span>&ndash;logs exceptions that do not force TopLink to stop, including all exceptions not logged with severe level. This does not include a stack trace.</p>
-</li>
-<li>
-<p><span class="bold">INFO</span>&ndash;logs the login/logout per sever session, including the user name. After acquiring the session, detailed information is logged.</p>
-</li>
-<li>
-<p><span class="bold">CONFIG</span>&ndash;logs only login, JDBC connection, and database information.</p>
-</li>
-<li>
-<p><span class="bold">FINE</span>&ndash;logs SQL.</p>
-</li>
-<li>
-<p><span class="bold">FINER</span>&ndash;similar to warning. Includes stack trace.</p>
-</li>
-<li>
-<p><span class="bold">FINEST</span>&ndash;includes additional low level information.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.level" value="INFO"/&gt;
-</pre></td>
-<td align="left" headers="r2c1-t31 r1c3-t31">
-<p>Info</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Timestamp</p>
-</td>
-<td align="left" headers="r3c1-t31 r1c2-t31">
-<p>Control whether the timestamp is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a timestamp.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a timestamp.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.timestamp" value="false"/&gt;
-</pre></td>
-<td align="left" headers="r3c1-t31 r1c3-t31">
-<p>true</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Thread</p>
-</td>
-<td align="left" headers="r4c1-t31 r1c2-t31">
-<p>Control whether a thread identifier is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a thread identifier.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a thread identifier.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t31 r1c3-t31">
-<p>true</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Session</p>
-</td>
-<td align="left" headers="r5c1-t31 r1c2-t31">
-<p>Control whether an EclipseLink session identifier is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a EclipseLink session identifier.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a EclipseLink session identifier.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.session" value="false"/&gt;
-</pre></td>
-<td align="left" headers="r5c1-t31 r1c3-t31">
-<p>true</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Exceptions</p>
-</td>
-<td align="left" headers="r6c1-t31 r1c2-t31">
-<p>Control whether the exceptions thrown from within the EclipseLink code are logged prior to returning the exception to the calling application. Ensures that all exceptions are logged and not masked by the application code.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log all exceptions.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log exceptions.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.exceptions" value="true"/&gt;
-</pre></td>
-<td align="left" headers="r6c1-t31 r1c3-t31">
-<p>false</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t31" headers="r1c1-t31">
-<p>Log file</p>
-</td>
-<td align="left" headers="r7c1-t31 r1c2-t31">
-<p>Specify a file location for the log output (instead of the standard out).</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.file" value="C:\myout\" /&gt;
-</pre></td>
-<td align="left" headers="r7c1-t31 r1c3-t31"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t31" headers="r1c1-t31">
-<p>Logger</p>
-</td>
-<td align="left" headers="r8c1-t31 r1c2-t31">
-<p>Select the type of logger to use:</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">DefaultLogger</span>&ndash;the EclipseLink native logger <code>eclipselink.logging.DefaultSessionLog</code>.</p>
-</li>
-<li>
-<p><span class="bold">JavaLogger</span>&ndash;the <code>java.util.logging</code> logger <code>eclipselink.logging.JavaLog</code>.</p>
-</li>
-<li>
-<p><span class="bold">ServerLogger</span>&ndash;the <code>java.util.logging</code> logger <code>eclipselink.platform.server.ServerLog</code>. Integrates with the application server's logging as define in the <code>eclipselink.platform.server.ServerPlatform.</code></p>
-</li>
-<li>
-<p>Fully qualified class name of a custom logger. The custom logger must implement the <code>eclipselink.logging.SessionLog</code> interface.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.logger" value="acme.loggers.MyCustomLogger" /&gt;
-</pre></td>
-<td align="left" headers="r8c1-t31 r1c3-t31">
-<p>DefaultLogger</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm
deleted file mode 100644
index 111b7cbf21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm
+++ /dev/null
@@ -1,170 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Options</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Options" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFJCHE" name="CIAFJCHE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Options</h1>
-<p>This table lists the properties of the Options page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref269" name="sthref269"></a><a id="sthref270" name="sthref270"></a>
-<p class="titleintable">Properties of the Options Page</p>
-<table class="Formal" title="Properties of the Options Page" summary="Properties of the Options Page" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t33">Property</th>
-<th align="left" valign="bottom" id="r1c2-t33">Description</th>
-<th align="left" valign="bottom" id="r1c3-t33">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t33" headers="r1c1-t33">
-<p>Session Name</p>
-</td>
-<td align="left" headers="r2c1-t33 r1c2-t33">
-<p>Specify the name by which the EclipseLink session is stored in the static session manager. Use this option if you need to access the EclipseLink shared session outside of the context of the JPA or to use a pre-existing EclipseLink session configured through a EclipseLink <code>sessions.xml</code> file</p>
-<p>Valid values: a valid EclipseLink session name that is unique in a server deployment.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.session-name" value="MySession"/&gt;
-</pre></td>
-<td align="left" headers="r2c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t33" headers="r1c1-t33">
-<p>Sessions XML</p>
-</td>
-<td align="left" headers="r3c1-t33 r1c2-t33">
-<p>Specify persistence information loaded from the EclipseLink session configuration file (<code>sessions.xml</code>).</p>
-<p>You can use this option as an alternative to annotations and deployment XML. If you specify this property, EclipseLink will override all class annotation and the object relational mapping from the <code>persistence.xml</code>, as well as <code>ORM.xml</code> and other mapping files, if present.</p>
-<p>Indicate the session by setting the <code>eclipselink.session-name</code> property.</p>
-<p>Note: If you do not specify the value for this property, <code>sessions.xml</code> file will not be used.</p>
-<p>Valid values: the resource name of the sessions XML file.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="toplink.session-xml" value="mysession.xml"/&gt;
-</pre></td>
-<td align="left" headers="r3c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t33" headers="r1c1-t33">
-<p>Target Database</p>
-</td>
-<td align="left" headers="r4c1-t33 r1c2-t33">
-<p>Select the target database. You can also set the value to the fully qualified class name of a subclass of the <code>org.eclipse.persistence.platform.DatabasePlatform class</code>.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.target-database" value="Oracle"/&gt;
-</pre></td>
-<td align="left" headers="r4c1-t33 r1c3-t33">
-<p>Auto</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t33" headers="r1c1-t33">
-<p>Target Server</p>
-</td>
-<td align="left" headers="r5c1-t33 r1c2-t33">
-<p>Select the target server for your JPA application.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.target-server" value="OC4J_10_1_3"/&gt;
-</pre></td>
-<td align="left" headers="r5c1-t33 r1c3-t33">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t33" headers="r1c1-t33">
-<p>Event Listener</p>
-</td>
-<td align="left" headers="r6c1-t33 r1c2-t33">
-<p>Specify a descriptor event listener to be added during bootstrapping.</p>
-<p>Valid values: qualified class name for a class that implements the <code>eclipselink.sessions.SessionEventListener</code> interface.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.session-event-listener" value="mypackage.MyClass.class"/&gt;
-</pre></td>
-<td align="left" headers="r6c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t33" headers="r1c1-t33">
-<p>Include Descriptor Queries</p>
-</td>
-<td align="left" headers="r7c1-t33 r1c2-t33">
-<p>Enable or disable the default copying of all named queries from the descriptors to the session. These queries include the ones defined using EclipseLink API, descriptor amendment methods, and so on.</p>
-</td>
-<td align="left" headers="r7c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t33" headers="r1c1-t33">
-<p>Miscellaneous Options</p>
-</td>
-<td align="left" headers="r8c1-t33 r1c2-t33"><br /></td>
-<td align="left" headers="r8c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t33" headers="r1c1-t33">
-<p>&nbsp;&nbsp;Temporal mutable</p>
-</td>
-<td align="left" headers="r9c1-t33 r1c2-t33">
-<p>Specify if all <code>Date</code> and <code>Calendar</code> persistent fields should be handled as mutable objects.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.temporal.mutable" value="true"/&gt;
-</pre></td>
-<td align="left" headers="r9c1-t33 r1c3-t33">
-<p>False</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm
deleted file mode 100644
index 52ec40416d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm
+++ /dev/null
@@ -1,143 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Schema Generation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Schema Generation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACCFCB" name="CIACCFCB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Schema Generation</h1>
-<p>This table lists the properties of the Schema Generation page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref271" name="sthref271"></a><a id="sthref272" name="sthref272"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table lists the properties of the persistence.xml Editor&rsquo;s Schema Generation page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t35">Property</th>
-<th align="left" valign="bottom" id="r1c2-t35">Description</th>
-<th align="left" valign="bottom" id="r1c3-t35">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t35" headers="r1c1-t35">
-<p>DDL Generation Type</p>
-</td>
-<td align="left" headers="r2c1-t35 r1c2-t35">
-<p>Select the type of DDL generation:</p>
-<ul>
-<li>
-<p><span class="bold">None</span> -- Do not generate DDL; no schema is generated.</p>
-</li>
-<li>
-<p><span class="bold">Create Tables</span> -- Create DDL for non-existent tables; leave existing tables unchanged.</p>
-</li>
-<li>
-<p><span class="bold">Drop and Create Tables</span> -- Create DDL for all tables; drop all existing tables.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t35 r1c3-t35">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t35" headers="r1c1-t35">
-<p>Output Mode</p>
-</td>
-<td align="left" headers="r3c1-t35 r1c2-t35">
-<p>Select the DDL generation target:</p>
-<ul>
-<li>
-<p><span class="bold">Both</span> -- Generate SQL files and execute them on the database.</p>
-</li>
-<li>
-<p><span class="bold">Database</span> -- Execute SQL on the database only (do not generate SQL files).</p>
-</li>
-<li>
-<p><span class="bold">SQL Script</span> -- Generate SQL files only (do not execute them on the database).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t35 r1c3-t35"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t35" headers="r1c1-t35">
-<p>DDL Generation Location</p>
-</td>
-<td align="left" headers="r4c1-t35 r1c2-t35">
-<p>Specify where EclipseLink writes DDL output. Specify a file specification to a directory in which you have write access. The file specification may be relative to your current working directory or absolute. If it does not end in a file separator, then EclipseLink appends one that is valid for your operating system.</p>
-</td>
-<td align="left" headers="r4c1-t35 r1c3-t35"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t35" headers="r1c1-t35">
-<p>Create DDL File Name</p>
-</td>
-<td align="left" headers="r5c1-t35 r1c2-t35">
-<p>Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for creating tables for JPA entities. Specify a file name valid for your operating system.</p>
-</td>
-<td align="left" headers="r5c1-t35 r1c3-t35">
-<p>createDDL.jdbc</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t35" headers="r1c1-t35">
-<p>Drop DDL File Name</p>
-</td>
-<td align="left" headers="r6c1-t35 r1c2-t35">
-<p>Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for dropping tables for JPA entities.</p>
-</td>
-<td align="left" headers="r6c1-t35 r1c3-t35">
-<p>dropDDL.jdbc</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm
deleted file mode 100644
index 1830f01b1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Properties</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Properties" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHJDFF" name="CIAHJDFF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Properties</h1>
-<p>This page enables you to add or remove the vendor-specific <code>&lt;properties&gt;</code> elements of <code>persistence.xml</code>.</p>
-<p>To add a property, click <span class="bold">Add</span> then enter the property <span class="bold">Name</span> and <span class="bold">Value</span>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm
deleted file mode 100644
index 47b984b01f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Source</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Source" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHCJAH" name="CIAHCJAH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Source</h1>
-<p>Using this page, you can manually edit the <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for additional information.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm
deleted file mode 100644
index 235ba80757..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Preferences</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Preferences" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDEIEE" name="CACDEIEE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Preferences</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<p><a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a></p>
-</li>
-<li>
-<p><a href="reference027.htm#CACFBAEH">Project Properties page &ndash; Validation Preferences</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm
deleted file mode 100644
index f48d45b158..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm
+++ /dev/null
@@ -1,108 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Project Properties page &ndash; Validation Preferences</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Project Properties page &ndash; Validation Preferences" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFBAEH" name="CACFBAEH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Project Properties page &ndash; Validation Preferences</h1>
-<p><a id="sthref275" name="sthref275"></a><a id="sthref276" name="sthref276"></a>Use the <span class="gui-object-title">Java Persistence</span> options on the <span class="gui-object-title">Properties</span> page to select the database connection to use with the project.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">JPA Details page</span>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties page." summary="This table describes the options on the Persistence Properties page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t37">Property</th>
-<th align="left" valign="bottom" id="r1c2-t37">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t37" headers="r1c1-t37"><a id="sthref277" name="sthref277"></a><a id="sthref278" name="sthref278"></a><a id="sthref279" name="sthref279"></a><a id="sthref280" name="sthref280"></a>Platform</td>
-<td align="left" headers="r2c1-t37 r1c2-t37">Select the vendor-specific platform.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t37" headers="r1c1-t37">Library</td>
-<td align="left" headers="r3c1-t37 r1c2-t37">Select a specific JPA library configuration.
-<p>Click <span class="bold">Manage libraries</span> to create or update a user library.</p>
-<p>Click <span class="bold">Download libraries</span> to download a specific library configuration.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Type</td>
-<td align="left" headers="r4c1-t37 r1c2-t37">Select <span class="bold">User Library</span> to select from the available user-defined or downloaded libraries.
-<p>If you select Disable, you must manually include the JPA implementation library on the project classpath.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Include&nbsp;libraries&nbsp;with&nbsp;this&nbsp;application</td>
-<td align="left" headers="r5c1-t37 r1c2-t37">Specify if the selected libraries are included when deploying the application.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t37" headers="r1c1-t37"><a id="sthref281" name="sthref281"></a><a id="sthref282" name="sthref282"></a><a id="sthref283" name="sthref283"></a>Connection</td>
-<td align="left" headers="r6c1-t37 r1c2-t37">The database connection used to map the persistent entities.
-<ul>
-<li>
-<p>To create a new connection, click <span class="bold">Add Connections</span>.</p>
-</li>
-<li>
-<p>To reconnect to an existing connection, click <span class="bold">Reconnect</span>.</p>
-</li>
-</ul>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Override&nbsp;default&nbsp;catalog&nbsp;from&nbsp;connection</td>
-<td align="left" headers="r7c1-t37 r1c2-t37">Select a catalog other than the default one derived from the connection information. Use this option if the default catalog is incorrect or cannot be used.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Override&nbsp;default&nbsp;schema&nbsp;from&nbsp;connection</td>
-<td align="left" headers="r8c1-t37 r1c2-t37">Select a schema other than the default one derived from the connection information. Use this option if the default schema is incorrect or cannot be used. For example, use this option when the deployment login differs from the design-time login.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t37" headers="r1c1-t37">Persistent Class Management</td>
-<td align="left" headers="r9c1-t37 r1c2-t37">Specify if Dali will <span class="bold">discover annotated classes automatically</span>, or if the <span class="bold">annotated classes must be listed in the persistence.xml</span> file.
-<p><span class="bold">Note</span>: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t37" headers="r1c1-t37"><a id="sthref284" name="sthref284"></a><a id="sthref285" name="sthref285"></a>Canonical Metamodel</td>
-<td align="left" headers="r10c1-t37 r1c2-t37"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm
deleted file mode 100644
index 7371b2503f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Dialogs</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dialogs" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGEJDA" name="CACGEJDA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dialogs</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<p><a href="reference029.htm#CACCGEHC">Edit Join Columns Dialog</a></p>
-</li>
-<li>
-<p><a href="ref_select_cascade_dialog.htm#CIAFDGIJ">Select Cascade dialog</a></p>
-</li>
-<li>
-<p><a href="ref_eclipselink_mapping_file.htm#CIAEDEJF">New EclipseLink Mapping File dialog</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm
deleted file mode 100644
index 9f66678703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Edit Join Columns Dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Edit Join Columns Dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCGEHC" name="CACCGEHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Edit Join Columns Dialog</h1>
-<p>Use the <span class="gui-object-title">Join Columns</span> dialog to create or modify the join tables and columns in relationship mappings.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Join Columns</span> dialog.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Join Columns dialog." summary="This table describes the options on the Join Columns dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t38">Property</th>
-<th align="left" valign="bottom" id="r1c2-t38">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t38" headers="r1c1-t38">Name</td>
-<td align="left" headers="r2c1-t38 r1c2-t38">Name of the joint table column that contains the foreign key column.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t38" headers="r1c1-t38">Referenced Column Name</td>
-<td align="left" headers="r3c1-t38 r1c2-t38">Name of the database column that contains the foreign key reference for the entity relationship.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference011.htm#CACBAEBC">Join Table Information</a><br />
-<a href="reference012.htm#CACFCEJC">Join Columns Information</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm
deleted file mode 100644
index 70279780ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Icons and buttons</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons and buttons" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDHCIA" name="CACDHCIA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Icons and buttons</h1>
-<p>This section includes information on each of the icons and buttons used in the Dali OR Mapping Tool.</p>
-<ul>
-<li>
-<p><a href="reference031.htm#CACGEACG">Icons</a></p>
-</li>
-<li>
-<p><a href="reference032.htm#CACDJCEI">Buttons</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm
deleted file mode 100644
index 35760eef4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm
+++ /dev/null
@@ -1,125 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Icons</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGEACG" name="CACGEACG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Icons</h1>
-<p>The following icons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the icons used in the Dali plug-in." summary="This table describes the icons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="23%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t41">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t41">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t41" headers="r1c1-t41"><img src="img/new_icon_mappedentity.png" alt="" title="" /><br /></td>
-<td align="left" headers="r2c1-t41 r1c2-t41"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t41" headers="r1c1-t41"><img src="img/new_icon_embeddableentitymapping.png" alt="Embeddable entity icon" title="Embeddable entity icon" /><br /></td>
-<td align="left" headers="r3c1-t41 r1c2-t41"><a href="tasks007.htm#BABFEICE">Embeddable</a> entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t41" headers="r1c1-t41"><img src="img/new_icon_mappedsuperclass.png" alt="Mapped superclass icon" title="Mapped superclass icon" /><br /></td>
-<td align="left" headers="r4c1-t41 r1c2-t41"><a href="tasks008.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t41" headers="r1c1-t41"><img src="img/new_icon_basicmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r5c1-t41 r1c2-t41"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r6c1-t41 r1c2-t41">Basic collection mapping</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapping.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r7c1-t41 r1c2-t41">Basic map mapping</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t41" headers="r1c1-t41"><img src="img/new_icon_embeddedidmapping.png" alt="Embedded mapping icon" title="Embedded mapping icon" /><br /></td>
-<td align="left" headers="r8c1-t41 r1c2-t41"><a href="tasks011.htm#BABCBHDF">Embedded mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t41" headers="r1c1-t41"><img src="img/new_icon_embeddedmapping.png" alt="Embedded ID mapping icon" title="Embedded ID mapping icon" /><br /></td>
-<td align="left" headers="r9c1-t41 r1c2-t41"><a href="tasks012.htm#CIHDIAEE">Embedded ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t41" headers="r1c1-t41"><img src="img/new_icon_idmapping.png" alt="ID mapping icon" title="ID mapping icon" /><br /></td>
-<td align="left" headers="r10c1-t41 r1c2-t41"><a href="tasks013.htm#BABGCBHG">ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t41" headers="r1c1-t41"><img src="img/new_icon_manytomanymapping.png" alt="Many-to-many mapping icon" title="Many-to-many mapping icon" /><br /></td>
-<td align="left" headers="r11c1-t41 r1c2-t41"><a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t41" headers="r1c1-t41"><img src="img/new_icon_manytoonemapping.png" alt="Many-to-one mapping icon." title="Many-to-one mapping icon." /><br /></td>
-<td align="left" headers="r12c1-t41 r1c2-t41"><a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t41" headers="r1c1-t41"><img src="img/new_icon_onetomanymapping.png" alt="One-to-many mapping icon" title="One-to-many mapping icon" /><br /></td>
-<td align="left" headers="r13c1-t41 r1c2-t41"><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t41" headers="r1c1-t41"><img src="img/new_icon_onetoonemapping.png" alt="One-to-one mapping icon." title="One-to-one mapping icon." /><br /></td>
-<td align="left" headers="r14c1-t41 r1c2-t41"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r15c1-t41 r1c2-t41">Transformation mappings</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r16c1-t41" headers="r1c1-t41"><img src="img/new_icon_transientmapping.png" alt="Transient mapping icon." title="Transient mapping icon." /><br /></td>
-<td align="left" headers="r16c1-t41 r1c2-t41"><a href="tasks018.htm#BABHFHEI">Transient mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r17c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r17c1-t41 r1c2-t41">Variable one-to-one mappings</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r18c1-t41" headers="r1c1-t41"><img src="img/new_icon_versionmapping.png" alt="Version mapping icon." title="Version mapping icon." /><br /></td>
-<td align="left" headers="r18c1-t41 r1c2-t41"><a href="tasks019.htm#BABHIBII">Version mapping</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference030.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm
deleted file mode 100644
index 36db5405f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Buttons</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Buttons" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDJCEI" name="CACDJCEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Buttons</h1>
-<p>The following buttons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the buttons used in the Dali plug-in." summary="This table describes the buttons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="27%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t42">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t42">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t42" headers="r1c1-t42"><img src="img/new_jpa_perspective_button.png" alt="The JPA Perspective icon" title="The JPA Perspective icon" /><br /></td>
-<td align="left" headers="r2c1-t42 r1c2-t42">JPA Development perspective</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference030.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm
deleted file mode 100644
index 9a706b9f2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Dali Developer Documentation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali Developer Documentation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBBDIB" name="CACBBDIB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dali Developer Documentation</h1>
-<p><a id="sthref288" name="sthref288"></a><a id="sthref289" name="sthref289"></a><a id="sthref290" name="sthref290"></a>Additional Dali documentation is available online at:</p>
-<p><code><a href="http://wiki.eclipse.org/index.php/Dali_Developer_Documentation">http://wiki.eclipse.org/index.php/Dali_Developer_Documentation</a></code></p>
-<p>This developer documentation includes information about:</p>
-<ul>
-<li>
-<p>Dali architecture</p>
-</li>
-<li>
-<p>Plugins that comprise the Dali JPA Eclipse feature</p>
-</li>
-<li>
-<p>Extension points</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
deleted file mode 100644
index 4c9842ee03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Adding persistence to a class</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Adding persistence to a class" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHICAI" name="BABHICAI"></a></p>
-<div class="sect1">
-<h1>Adding persistence to a class</h1>
-<p><a id="sthref67" name="sthref67"></a><a id="sthref68" name="sthref68"></a><a id="sthref69" name="sthref69"></a>You can make a Java class into one of the following persistent types:</p>
-<ul>
-<li>
-<p><a href="tasks006.htm#BABGBIEE">Entity</a></p>
-</li>
-<li>
-<p><a href="tasks007.htm#BABFEICE">Embeddable</a></p>
-</li>
-<li>
-<p><a href="tasks008.htm#BABDAGCI">Mapped superclass</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
deleted file mode 100644
index 77d584cd6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Specifying additional tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying additional tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHGBIEI" name="CIHGBIEI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Specifying additional tables</h1>
-<p>Add a secondary table annotation to an entity if its data is split across more than one table.</p>
-<p>To add a secondary table to the entity,</p>
-<ol>
-<li>
-<p>Select the entity in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Secondary Tables</span> information.</p>
-<div class="figure"><a id="sthref92" name="sthref92"></a>
-<p class="titleinfigure">Specifying Secondary Tables</p>
-<img src="img/secondary_tables.png" alt="Secondary Tables area on the JPA Details view." title="Secondary Tables area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Click <span class="bold">Add</span> to associate an additional table with the entity. The Edit Secondary Table dialog appears</p>
-</li>
-<li>
-<p>Select the <span class="bold">Name</span>, <span class="bold">Catalog</span>, and <span class="bold">Schema</span> of the additional table to associate with the entity.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations the entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA")
-
-</pre>
-<p>To override the default primary key:</p>
-<ol>
-<li>
-<p>Enable the <span class="bold">Overwrite default</span> option, then click <span class="bold">Add</span> to specify a new primary key join column. The Create New Primary Key Join Column appears.</p>
-</li>
-<li>
-<p>Select the <span class="bold">Name</span>, <span class="bold">Referenced column name</span>, <span class="bold">Table</span>, and <span class="bold">Column definition</span> of the primary key for the entity.</p>
-<p>Eclipse adds the following annotations the entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA", pkJoinColumns = {@PrimaryKeyJoinColumn(name="id", referencedColumnName = "id"),@PrimaryKeyJoinColumn(name="NAME", referencedColumnName = "REFERENCED COLUMN NAME", columnDefinition = "COLUMN DEFINITION")})
-
-</pre></li>
-</ol>
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm
deleted file mode 100644
index a83f787ffc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a JPA Entity</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a JPA Entity" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFBJBG" name="BABFBJBG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref40" name="sthref40"></a>Creating a JPA Entity</h1>
-<p>Use this procedure to create a JPA entity:</p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select the JPA project and then <span class="bold">File &gt; New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-<div class="figure"><a id="sthref41" name="sthref41"></a>
-<p class="titleinfigure">Selecting the Create a JPA Entity Wizard</p>
-<img src="img/select_a_wizard_entity.png" alt="The Select a Wizard dialog with Entity selected." title="The Select a Wizard dialog with Entity selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">JPA &gt; Entity</span> and then click <span class="bold">Next</span>. The <a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a> appears.</p>
-<div class="figure"><a id="sthref42" name="sthref42"></a>
-<p class="titleinfigure"><a id="sthref43" name="sthref43"></a>The Entity Class Page</p>
-<img src="img/create_jpa_entity_wizard.png" alt="The Entity Class page of the Create a JPA Entity wizard." title="The Entity Class page of the Create a JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<p>Complete this page as follows:</p>
-<ul>
-<li>
-<p>Select the JPA project in the <span class="bold">Project</span> field.</p>
-</li>
-<li>
-<p>In the <span class="bold">Source Folder</span> field, select, or enter, the location of the JPA project's <code>src</code> folder.</p>
-</li>
-<li>
-<p>Select, or enter, the name of the class package for this entity in the <span class="bold">Java Package</span> field.</p>
-</li>
-<li>
-<p>Enter the name of the Java class in the <span class="bold">Class name</span> field.</p>
-</li>
-<li>
-<p>If needed, enter, or select a superclass.</p>
-</li>
-<li>
-<p>If needed, complete the Inheritance section as follows (these properties are optional):</p>
-<ul>
-<li>
-<p>Accept the <span class="bold">Entity</span> option (the default) to create a Java class with the <code>@Entity</code> option.</p>
-</li>
-<li>
-<p>Alternatively, select <a href="tasks008.htm#BABDAGCI">Mapped superclass</a> (if you defined a super class).</p>
-</li>
-<li>
-<p>Select <span class="bold">Inheritance</span> and then select one of the JSR 220 inheritance mapping strategies (SINGLE_TABLE, TABLE_PER_CLASS, JOINED).</p>
-</li>
-<li>
-<p>Select <span class="bold">Add to entity mappings in XML</span> to create XML mappings in <code>orm.xml</code>, rather than annotations.</p>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-<li>
-<p>Click <span class="bold">Next</span> to proceed to the <a href="ref_EntityPropertiesPage.htm#CIADECIA">Entity Properties page</a> where you define the persistent fields for the entity.</p>
-<div class="figure"><a id="sthref44" name="sthref44"></a>
-<p class="titleinfigure"><a id="sthref45" name="sthref45"></a>The Entity Properties Page</p>
-<img src="img/create_jpa_fields.png" alt="The Entity Properties page of the Create JPA Entity wizard." title="The Entity Properties page of the Create JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<p>Alternatively, click <span class="bold">Finish</span> to complete the entity.</p>
-</li>
-<li>
-<p>Complete the page as follows:</p>
-<ol>
-<li>
-<p>If needed, enter a new name for the entity. Doing so results in adding a <code>name</code> attribute to the <code>@Entity</code> notation (<code>@Entity(name="EntityName")</code>).</p>
-</li>
-<li>
-<p>Accept <span class="bold">Use default</span> (the default setting) to use the default value for the name of the mapped table. Entering a different name results in adding the <code>@Table</code> notation with its <code>name</code> attribute defined as the new table (<code>@Table(name="TableName")</code>).</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Entity Name-related options are not available if you selected <a href="tasks008.htm#BABDAGCI">Mapped superclass</a> on the <a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Add persistence fields to the entity by clicking <span class="bold">Add</span>. The Entity Fields dialog appears.</p>
-<div class="figure"><a id="sthref46" name="sthref46"></a>
-<p class="titleinfigure">The Entity Fields Dialog</p>
-<img src="img/jpa_wizard_create_fields.png" alt="The Entity Fields dialog." title="The Entity Fields dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select a persistence type from the Type list. You can retrieve additional types using the <span class="bold">Browse</span> function.</p>
-</li>
-<li>
-<p>Enter the field name and then click <span class="bold">OK</span>. Repeat this procedure for each field.</p>
-</li>
-<li>
-<p>If needed, select <span class="bold">Key</span> to designate the field as a primary key.</p>
-</li>
-<li>
-<p>Select either the <span class="bold">Field-based</span> access type (the default) or <span class="bold">Property-based</span> access type.</p>
-</li>
-</ol>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. Eclipse adds the entity to your project.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a><br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
deleted file mode 100644
index ee7e1ede8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a new JPA project</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHHEJCJ" name="CIHHEJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a new JPA project</h1>
-<p><a id="sthref26" name="sthref26"></a><a id="sthref27" name="sthref27"></a>Use this procedure to create a new JPA project.</p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select <span class="bold">File &gt; New &gt; Project</span>. The Select a wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also select the JPA perspective and then select <span class="bold">File &gt; New &gt; JPA Project</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="figure"><a id="sthref28" name="sthref28"></a>
-<p class="titleinfigure"><a id="sthref29" name="sthref29"></a>Selecting the Create a JPA Project wizard</p>
-<img src="img/select_a_wizard_jpa_project.png" alt="The Select a Wizard dialog with JPA project selected." title="The Select a Wizard dialog with JPA project selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">JPA Project</span> and then click <span class="bold">Next</span>. The <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> appears.</p>
-<div class="figure"><a id="sthref30" name="sthref30"></a>
-<p class="titleinfigure"><a id="sthref31" name="sthref31"></a>The JPA Project Page</p>
-<img src="img/new_jpa_project_task.png" alt="The JPA Project page of the Create a JPA Project wizard." title="The JPA Project page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> to specify the project name and location, target runtime, and pre-defined configuration.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Target Runtime is not required for Java SE development.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. The Java source page appears.</p>
-<div class="figure"><a id="sthref32" name="sthref32"></a>
-<p class="titleinfigure">The Java Source Page</p>
-<img src="img/java_editor_address.png" alt="The JPA Facet page of the Create a JPA Project wizard." title="The JPA Facet page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Click <span class="bold">Add Folder</span> to add existing Java source files to the project.</p>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-<div class="figure"><a id="sthref33" name="sthref33"></a>
-<p class="titleinfigure"><a id="sthref34" name="sthref34"></a>The JPA Facet Page</p>
-<img src="img/new_jpa_facet_task.png" alt="The JPA Facet page of the Create a JPA Project wizard." title="The JPA Facet page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> to specify your vender-specific platform, JPA implementation library, and database connection.</p>
-<p>Click <span class="bold">Manage libraries</span> to create or update your JPA user libraries. Click <span class="bold">Download libraries</span> to obtain additional JPA implementation libraries.</p>
-<p>If Dali derives the incorrect schema, select <span class="bold">Override the Default Schema for Connection</span>. Using this option, you can select a development time schema for defaults and validation.</p>
-<p>If you clear the <span class="bold">Create orm.xml</span> option (which is selected by default), you can later add a mapping file to the project using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-If the server runtime does not provide a JPA implementation, you must explicitly select a JPA implementation library.
-<p>To insure the portability of your application, you must explicitly list the managed persistence classes that are included in the persistence unit. If the server supports EJB 3.0, the persistent classes will be discovered automatically.</p>
-<p>Depending on your JPA implementation (for example, Generic or EclipseLink), different options may be available when creating JPA projects.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. You should now open the <a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a><br />
-<a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="tasks001.htm#BEIBADHH">Converting a Java Project to a JPA Project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm
deleted file mode 100644
index 429ee81d23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating JAXB Classes from a Schema</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:33:3Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating JAXB Classes from a Schema" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHCBHJD" name="CIHCBHJD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating JAXB Classes from a Schema</h1>
-<p><a id="sthref197" name="sthref197"></a><a id="sthref198" name="sthref198"></a><a id="sthref199" name="sthref199"></a>Use the Generate Classes from XSD dialog to generate JAXB classes from an XML schema (&nbsp;.xsd).<a id="sthref200" name="sthref200"></a></p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, right-click a schema (&nbsp;.xsd file) and select <span class="bold">Generate &gt; JAXB Classes</span>. The Generate Classes from Schema dialog appears.</p>
-<div class="figure"><a id="sthref201" name="sthref201"></a>
-<p class="titleinfigure"><a id="sthref202" name="sthref202"></a>Configure JAXB Class Generation dialog</p>
-<img src="img/generate_classes_from_schema.png" alt="Generate classes from schema dialog." title="Generate classes from schema dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Enter the JAXB settings information and click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_configure_jaxb_class_generation_dialog.htm#CACHHHJA">Configure JAXB Class Generation dialog</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm
deleted file mode 100644
index 6e7cf1cca2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating Schema from Classes</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T16:18:12Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating Schema from Classes" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHHBJCJ" name="CIHHBJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating Schema from Classes</h1>
-<p><a id="sthref189" name="sthref189"></a><a id="sthref190" name="sthref190"></a><a id="sthref191" name="sthref191"></a>Use the Generate Schema from JAXB Classes wizard create an XML schema (&nbsp;.xsd) for a set of JAXB mapped classes.<a id="sthref192" name="sthref192"></a></p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select <span class="bold">File &gt; New &gt; Other</span>. The Select a wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also access the Generate Schema from JAXB Classes wizard from a specific project or package.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="figure"><a id="sthref193" name="sthref193"></a>
-<p class="titleinfigure"><a id="sthref194" name="sthref194"></a>Selecting the Schema From JAXB Classes wizard</p>
-<img src="img/select_jaxb_schema_wizard.png" alt="The Select a Wizard dialog with Schema From JAXB Classes selected." title="The Select a Wizard dialog with Schema From JAXB Classes selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">JAXB &gt; Schema from JAXB Classes</span> and then click <span class="bold">Next</span>. The <a href="ref_schema_from_classes_page.htm#CACHBEGJ">Generate Schema from Classes</a> page of the <a href="ref_jaxb_schema_wizard.htm#CACGADFH">Generate Schema from JAXB Classes Wizard</a> appears.</p>
-<div class="figure"><a id="sthref195" name="sthref195"></a>
-<p class="titleinfigure"><a id="sthref196" name="sthref196"></a>The Generate Schema from Classes Page</p>
-<img src="img/jaxb_schmea_generation_dialog.png" alt="The JPA Project page of the Create a JPA Project wizard." title="The JPA Project page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select the project, package, or classes from which to generate the schema and click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_jaxb_schema_wizard.htm#CACGADFH">Generate Schema from JAXB Classes Wizard</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
deleted file mode 100644
index 15a4d073d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
+++ /dev/null
@@ -1,138 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Specifying entity inheritance</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying entity inheritance" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHCCCJD" name="CIHCCCJD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Specifying entity inheritance</h1>
-<p><a id="sthref93" name="sthref93"></a><a id="sthref94" name="sthref94"></a>An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.</p>
-<p>Use this procedure to specify inheritance (<code>@Inheritance)</code> for an existing entity (<code>@Entity</code>):</p>
-<ol>
-<li>
-<p>Select the entity in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Inheritance</span> information.</p>
-<div class="figure"><a id="sthref95" name="sthref95"></a>
-<p class="titleinfigure">Specifying Inheritance</p>
-<img src="img/inheritance_tab.png" alt="Selecting the Inheritance area on the JPA Details view." title="Selecting the Inheritance area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>In the <span class="bold">Strategy</span> list, select one of the following the inheritance strategies:</p>
-<ul>
-<li>
-<p>A single table (default)</p>
-</li>
-<li>
-<p>Joined table</p>
-</li>
-<li>
-<p>One table per class</p>
-</li>
-</ul>
-</li>
-<li>
-<p>Use the following table to complete the remaining fields on the tab. See <a href="reference009.htm#CACFHGHE">"Inheritance information"</a> for additional details.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="23%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t13">Property</th>
-<th align="left" valign="bottom" id="r1c2-t13">Description</th>
-<th align="left" valign="bottom" id="r1c3-t13">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t13" headers="r1c1-t13"><a id="sthref96" name="sthref96"></a><a id="sthref97" name="sthref97"></a>Discriminator Column</td>
-<td align="left" headers="r2c1-t13 r1c2-t13">Name of the discriminator column when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.
-<p>This field corresponds to the <code>@DiscriminatorColumn</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13">Discriminator Type</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">Set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r3c1-t13 r1c3-t13">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13"><a id="sthref98" name="sthref98"></a><a id="sthref99" name="sthref99"></a>Discriminator Value</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.
-<p>This field corresponds to the <code>@DiscriminatorValue</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t13" headers="r1c1-t13">Override Default</td>
-<td align="left" headers="r5c1-t13 r1c2-t13">Use this field to specify custom primary key join columns.
-<p>This field corresponds to the <code>@PrimaryKeyJoinClumn</code> annotation.</p>
-</td>
-<td align="left" headers="r5c1-t13 r1c3-t13"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations the entity field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Inheritance(strategy=InheritanceType.<span class="italic">&lt;INHERITANCE_STRATEGY&gt;</span>)
-@DiscriminatorColumn(name="<span class="italic">&lt;DISCRIMINATOR_COLUMN&gt;</span>",
- discriminatorType=<span class="italic">&lt;DISCRIMINATOR_TYPE&gt;</span>)
-@DiscriminatorValue(value-"<span class="italic">&lt;DISCRIMINATOR_VALUE&gt;</span>")
-@PrimaryKeyJoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName = "<span class="italic">&lt;REFERENCED_COLUMN_NAME&gt;</span>")
-
-</pre>
-<p><a id="sthref100" name="sthref100"></a><a id="sthref101" name="sthref101"></a><a id="sthref102" name="sthref102"></a>The following figures illustrates the different inheritance strategies.</p>
-<div class="figure"><a id="sthref103" name="sthref103"></a>
-<p class="titleinfigure">Single Table Inheritance</p>
-<img src="img/inheritance_single.png" alt="This figure illustrates entity inheritance in a single table." title="This figure illustrates entity inheritance in a single table." /><br /></div>
-<!-- class="figure" -->
-<div class="figure"><a id="sthref104" name="sthref104"></a>
-<p class="titleinfigure"><a id="sthref105" name="sthref105"></a><a id="sthref106" name="sthref106"></a>Joined Table Inheritance</p>
-<img src="img/inheritance_join.png" alt="This figure illustrates a joined subclass inheritance strategy." title="This figure illustrates a joined subclass inheritance strategy." /><br /></div>
-<!-- class="figure" -->
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
deleted file mode 100644
index 8968739b98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Managing the orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDGDCD" name="CIHDGDCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref58" name="sthref58"></a>Managing the orm.xml file</h1>
-<p>When creating a JPA project, (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>) you can also create the <code>orm.xml</code> file that defines the mapping metadata and defaults.</p>
-<p><a id="sthref59" name="sthref59"></a>Eclipse creates the <code>META-INF\orm.xml</code> file in your project's directory:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;persistence version="<span class="italic">&lt;PERSISTENCE_VERSION&gt;</span>"
- xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
- &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>"&gt;
- &lt;provider="<span class="italic">&lt;PERSISTENCE_PROVIDER&gt;</span>" /&gt;
- &lt;/persistence-unit&gt;
-&lt;/persistence&gt;
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_eclipselink_mapping_file.htm#CIAEDEJF">New EclipseLink Mapping File dialog</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks005.htm#CIHBCDCE">Working with orm.xml file</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
deleted file mode 100644
index 92f618b401..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
+++ /dev/null
@@ -1,222 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Managing the persistence.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the persistence.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDAJID" name="CIHDAJID"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref47" name="sthref47"></a>Managing the persistence.xml file</h1>
-<p><a id="sthref48" name="sthref48"></a>When you create a project, Eclipse creates the <code>META-INF\persistence.xml</code> file in the project's directory.</p>
-<p>You can create a stub <code>persistence.xml</code> file in the META-INF directory when you create a JPA project (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>). You can manage this file either through the XML editor (see ) or through the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Depending on your JPA implementation (for example, EclipseLink), the following additional pages may be available in the persistence.xml Editor:
-<ul>
-<li>
-<p><a href="reference019.htm#CIAJAFEG">Customization</a></p>
-<p>Use this page to define change-tracking and session customizer-related properties.</p>
-</li>
-<li>
-<p><a href="reference020.htm#CIABEDCH">Caching</a></p>
-<p>Use this page to define caching properties.</p>
-</li>
-<li>
-<p><a href="reference021.htm#CIABGHHI">Logging</a></p>
-<p>Use this page to define logging properties.</p>
-</li>
-<li>
-<p><a href="reference022.htm#CIAFJCHE">Options</a></p>
-<p>Use this page to define session and target database properties.</p>
-</li>
-<li>
-<p><a href="reference023.htm#CIACCFCB">Schema Generation</a></p>
-<p>Use this page to define DDL-related properties.</p>
-</li>
-</ul>
-<p>For projects using the EclipseLink JPA implementation, the Connections page also includes JDBC connection pool properties.</p>
-<p>If the project uses the Generic platform, then only the <a href="ref_persistence_general.htm#CIACIFGJ">General</a>, <a href="reference018.htm#CIAFFJIE">Connection</a>, <a href="reference024.htm#CIAHJDFF">Properties</a> and <a href="reference025.htm#CIAHCJAH">Source</a> pages are available.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>To use the <code>persistence.xml</code> Editor:</p>
-<ol>
-<li>
-<p>Open the <code>peristence.xml</code> file. The <a href="ref_persistence_general.htm#CIACIFGJ">General</a> page of the editor appears.</p>
-</li>
-<li>
-<p>Use the <span class="bold">General</span> page to define the <code>persistence.xml</code> files <code>&lt;persistent-unit&gt;</code>-related attributes as well as the <code>&lt;provider&gt;</code>, and <code>&lt;class&gt;</code> elements (described in the following table).</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-The persistence.xml Editor's Source page enables you to view and edit the raw XML file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="inftblinformal">
-<table class="Informal" summary="This table lists the properties of the persistence.xml editor." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="29%" />
-<col width="29%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-<th align="left" valign="bottom" id="r1c3-t8">Element Defined</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Name</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Enter the name of the persistence unit.</td>
-<td align="left" headers="r2c1-t8 r1c3-t8"><code>&lt;persistence-unit name = "&lt;Name&gt;"&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8"><a id="sthref49" name="sthref49"></a>Persistence Provider</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Enter the name of the persistence provider.</td>
-<td align="left" headers="r3c1-t8 r1c3-t8"><code>&lt;provider&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">Description</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Enter a description for this persistence unit. This is an optional property.</td>
-<td align="left" headers="r4c1-t8 r1c3-t8"><code>&lt;description&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8"><a id="sthref50" name="sthref50"></a>Managed Classes</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Add or remove the classes managed through the persistence unit.</td>
-<td align="left" headers="r5c1-t8 r1c3-t8"><code>&lt;class&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t8" headers="r1c1-t8">&nbsp;&nbsp;Exclude&nbsp;Unlisted&nbsp;Classes</td>
-<td align="left" headers="r6c1-t8 r1c2-t8">Select to include all annotated entity classes in the root of the persistence unit.</td>
-<td align="left" headers="r6c1-t8 r1c3-t8"><code>&lt;exclude-unlisted-classes&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t8" headers="r1c1-t8">XML&nbsp;Mapping&nbsp;Files</td>
-<td align="left" headers="r7c1-t8 r1c2-t8">Add or remove the object/relational mapping XML files define the classes managed through the persistence unit.</td>
-<td align="left" headers="r7c1-t8 r1c3-t8"><code>&lt;mapping-file&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t8" headers="r1c1-t8">JAR&nbsp;Files</td>
-<td align="left" headers="r8c1-t8 r1c2-t8">Add or remove additional JAR files and libraries</td>
-<td align="left" headers="r8c1-t8 r1c3-t8"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></li>
-<li>
-<p>Use the <a href="reference018.htm#CIAFFJIE">Connection</a> page to define the <code>&lt;jta-data-source&gt;</code> and <code>&lt;non-jta-data-source&gt;</code> elements as follows:</p>
-<p>To configure the JTA (Java Transaction API) source used by the persistence provider:</p>
-<ol>
-<li>
-<p>Select <span class="bold">JTA</span> from the Transaction Type list.</p>
-</li>
-<li>
-<p>Enter the global JNDI name of the data source.</p>
-</li>
-</ol>
-<p>To configure a non-JTA data source:</p>
-<ol>
-<li>
-<p>Select <span class="bold">Resource Local</span> from the Transaction Type list.</p>
-</li>
-<li>
-<p>Enter the global JNDI name of the data source.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Select <span class="bold">Default()</span> to use the data source provided by the container.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-<p><a id="sthref51" name="sthref51"></a>For projects using the Generic platform, you can also define the EclipseLink connection pool driver, connection pool driver, URL, user name and password.</p>
-</li>
-<li>
-<p>Use the table in the Properties page to set the vendor-specific <code>&lt;properties&gt;</code> element.</p>
-<p>To add <code>&lt;property&gt;</code> elements:</p>
-<ol>
-<li>
-<p>Click <span class="bold">Add</span>.</p>
-</li>
-<li>
-<p>Enter the <code>&lt;name&gt;</code> and <code>&lt;value&gt;</code> attributes for the <code>&lt;property&gt;</code> element using the table's Name and Value fields.</p>
-</li>
-</ol>
-<p>To remove a <code>&lt;property&gt;</code> element, select a defined property in the table and then click <span class="bold">Remove</span>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-If the project uses the EclipseLink platform, the connection page also includes parameters for JDBC connection pooling.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks002.htm#CIHFEBAI">Synchronizing classes</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
deleted file mode 100644
index be8d8f1f48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapping an entity</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDGBIJ" name="BABDGBIJ"></a></p>
-<div class="sect1">
-<h1>Mapping an entity</h1>
-<p>Dali supports the following mapping types for Java persistent entities:</p>
-<ul>
-<li>
-<p><a href="tasks010.htm#BABBABCE">Basic mapping</a></p>
-</li>
-<li>
-<p><a href="tasks011.htm#BABCBHDF">Embedded mapping</a></p>
-</li>
-<li>
-<p><a href="tasks012.htm#CIHDIAEE">Embedded ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks013.htm#BABGCBHG">ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks018.htm#BABHFHEI">Transient mapping</a></p>
-</li>
-<li>
-<p><a href="tasks019.htm#BABHIBII">Version mapping</a></p>
-</li>
-<li>
-<p><a href="tasks020.htm#CIHBDEAJ">Element Collection mapping</a></p>
-</li>
-</ul>
-<p>Additional mapping types (such as Basic Collection mappings) may be available when using Dali with EclipseLink.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
deleted file mode 100644
index 00e2189526..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Tasks</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:32:58Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tasks" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref25" name="sthref25"></a></p>
-<h1>Tasks</h1>
-<p>This section includes detailed step-by-step procedures for accessing the Dali OR mapping tool functionality.</p>
-<ul>
-<li>
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-</li>
-<li>
-<p><a href="tasks001.htm#BEIBADHH">Converting a Java Project to a JPA Project</a></p>
-</li>
-<li>
-<p><a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a></p>
-</li>
-<li>
-<p><a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></p>
-</li>
-<li>
-<p><a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a></p>
-</li>
-<li>
-<p><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></p>
-</li>
-<li>
-<p><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></p>
-</li>
-<li>
-<p><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></p>
-</li>
-<li>
-<p><a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></p>
-</li>
-<li>
-<p><a href="tasks021.htm#BABBAGFI">Generating entities from tables</a></p>
-</li>
-<li>
-<p><a href="tasks023.htm#BABFAIBA">Validating mappings and reporting problems</a></p>
-</li>
-<li>
-<p><a href="tasks026.htm#BABDBCBI">Modifying persistent project properties</a></p>
-</li>
-<li>
-<p><a href="task_generating_schema_from_classes.htm#CIHHBJCJ">Generating Schema from Classes</a></p>
-</li>
-<li>
-<p><a href="task_generate_classes_from_schema.htm#CIHCBHJD">Generating JAXB Classes from a Schema</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
deleted file mode 100644
index 0960434330..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Converting a Java Project to a JPA Project</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Converting a Java Project to a JPA Project" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BEIBADHH" name="BEIBADHH"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Converting a Java Project to a JPA Project</h1>
-<p><a id="sthref35" name="sthref35"></a><a id="sthref36" name="sthref36"></a><a id="sthref37" name="sthref37"></a>Use this procedure to convert an existing Java project to a JPA project.</p>
-<ol>
-<li>
-<p>From the Navigator or Project explorer, right-click the Java project and then select <span class="bold">Configure &gt; Convert to JPA Project.</span> The Project Facets page of the Modify Faceted Project wizard appears.</p>
-<div class="figure"><a id="sthref38" name="sthref38"></a>
-<p class="titleinfigure">Modify Faceted Project Page</p>
-<img src="img/modify_faceted_project.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Change the <span class="bold">Configuration</span> to <span class="bold">Default JPA Configuration</span>.</p>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-<div class="figure"><a id="sthref39" name="sthref39"></a>
-<p class="titleinfigure">JPA Facet Page</p>
-<img src="img/new_jpa_facet_task.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> to specify your vender-specific platform, JPA implementation library, and database connection.</p>
-<p>Click <span class="bold">Manage libraries</span> to create or update your JPA user libraries. Click <span class="bold">Download libraries</span> to obtain additional JPA implementation libraries.</p>
-<p>If Dali derives the incorrect schema, select <span class="bold">Override the Default Schema for Connection</span>. Using this option, you can select a development time schema for defaults and validation.</p>
-<p>If you clear the <span class="bold">Create orm.xml</span> option (which is selected by default), you can later add a mapping file to the project using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<p>The Dali OR Mapping Tool adds the JPA implementation libraries to your project and creates the necessary <code>orm.xml</code> and <code>perisistence.xml</code> files.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a><br />
-<a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
deleted file mode 100644
index 96f9bb0090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Synchronizing classes</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Synchronizing classes" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHFEBAI" name="CIHFEBAI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Synchronizing classes</h1>
-<p>As you work with the classes in your Java project, you will need to update the <code>persistence.xml</code> file to reflect the changes. <a id="sthref52" name="sthref52"></a><a id="sthref53" name="sthref53"></a><a id="sthref54" name="sthref54"></a></p>
-<p>Use this procedure to synchronize the <code>persistence.xml</code> file:</p>
-<ol>
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Synchronize Class List</span>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Use this function if you selected <span class="bold">Annotated classes must be listed in the persistence.xml option</span> in the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a>. In general, you do not have to use this function within the container.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="figure"><a id="sthref55" name="sthref55"></a>
-<p class="titleinfigure">Synchronizing the persistence.xml File</p>
-<img src="img/synchornize_classes.png" alt="This figure shows the JPA Tools &gt; Synchronize Classes option." title="This figure shows the JPA Tools &gt; Synchronize Classes option." /><br /></div>
-<!-- class="figure" -->
-<p>Dali adds the necessary <code>&lt;class&gt;</code> elements to the <code>persistence.xml</code> file.</p>
-</li>
-<li>
-<p>Use the <span class="gui-object-title">Persistence XML Editor</span> to continue editing the <code>persistence.xml</code> file.</p>
-</li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
deleted file mode 100644
index 818f14603c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Upgrading document version</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Upgrading document version" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref56" name="sthref56"></a>
-<h1>Upgrading document version</h1>
-<p>Use this procedure to migrate your project from JPA 1.0 to JPA 2.0. You must complete this upgrade to use the current JPA 2.0 features in Dali.</p>
-<div class="figure"><a id="sthref57" name="sthref57"></a>
-<p class="titleinfigure">Upgrading the persistence.xml File</p>
-<img src="img/upgrade_persistence_jpa_version.png" alt="This figure shows the JPA Tools &gt; Synchronize Classes option." title="This figure shows the JPA Tools &gt; Synchronize Classes option." /><br /></div>
-<!-- class="figure" --></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
deleted file mode 100644
index 90441ad325..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating an orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating an orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref60" name="sthref60"></a>
-<h1>Creating an orm.xml file</h1>
-<p><a id="sthref61" name="sthref61"></a>If you opt not to create an <code>orm.xml</code> file when you create a JPA project, you can create one using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<p>Use this procedure to create an <code>orm.xml</code> file:</p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select <span class="bold">File &gt; New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-<div class="figure"><a id="sthref62" name="sthref62"></a>
-<p class="titleinfigure">The Select a Wizard Dialog</p>
-<img src="img/select_a_wizard_mapping.png" alt="The Select a Wizard dialog with Mapping file selected." title="The Select a Wizard dialog with Mapping file selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">Mapping File</span> and then click <span class="bold">Next</span>. The Mapping File page appears.</p>
-<p>If you are using EclipseLink, you can select <span class="bold">EclipseLink &gt; EclipseLink Mapping File</span>.</p>
-<div class="figure"><a id="sthref63" name="sthref63"></a>
-<p class="titleinfigure">The Mapping File Page</p>
-<img src="img/mapping_file_new.png" alt="The Mapping File page." title="The Mapping File page." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Define the properties in the page and click <span class="bold">Finish</span>. The <code>orm.xml</code> file appears in the src directory of the selected JPA project. You can manage the orm.xml file using the JPA Details view or through the XML Editor. See also <a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a>.</p>
-</li>
-</ol>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
deleted file mode 100644
index 1f960838f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Working with orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Working with orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHBCDCE" name="CIHBCDCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Working with orm.xml file</h1>
-<p><a id="sthref64" name="sthref64"></a><a id="sthref65" name="sthref65"></a>You can work with the <code>orm.xml</code> by using the JPA Details view.</p>
-<p>Use this procedure to work with the <code>orm.xml</code> file:</p>
-<ol>
-<li>
-<p>Right-click the <code>orm.xml</code> file in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">Open</span>.</p>
-</li>
-<li>
-<p>In the JPA Structure view, select <span class="bold">EntityMappings</span>.</p>
-</li>
-<li>
-<p>Use the JPA Details view to configure the entity mapping and persistence unit defaults.</p>
-<div class="figure"><a id="sthref66" name="sthref66"></a>
-<p class="titleinfigure">JPA Details view for EntityMappings (orm.xml)</p>
-<img src="img/details_entitymappings.png" alt="JPA Details view for orm.xml file." title="JPA Details view for orm.xml file." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a><br />
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="#CIHBCDCE">Working with orm.xml file</a><br />
-<a href="../org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html">Working with XML Files</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
deleted file mode 100644
index eca0d7006b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Entity</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABGBIEE" name="BABGBIEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Entity</h1>
-<p><a id="sthref70" name="sthref70"></a><a id="sthref71" name="sthref71"></a><a id="sthref72" name="sthref72"></a><a id="sthref73" name="sthref73"></a>An <span class="bold">Entity</span> is a persistent domain object.</p>
-<p>An entity <span class="italic">can be</span>:</p>
-<ul>
-<li>
-<p>Abstract or concrete classes. Entities may also extend non-entity classes as well as entity classes, and non-entity classes may extend entity classes.</p>
-</li>
-</ul>
-<p>An entity <span class="italic">must have</span>:</p>
-<ul>
-<li>
-<p>A no-arg constructor (public or protected); the entity class may have other constructors as well.</p>
-</li>
-</ul>
-<p><a id="sthref74" name="sthref74"></a><a id="sthref75" name="sthref75"></a><a id="sthref76" name="sthref76"></a>Each persistent entity must be mapped to a database table and contain a primary key. Persistent entities are identified by the <code>@Entity</code> annotation.</p>
-<p>Use this procedure to add persistence to an existing entity:</p>
-<ol>
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Project Explorer.</span></p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the JPA Details view, click the mapping type hyperlink to access the Mapping Type Selection dialog. In the following figure, clicking <span class="italic">entity</span> invokes the dialog from the JPA Details View.</p>
-<div class="figure"><a id="sthref77" name="sthref77"></a>
-<p class="titleinfigure">The Mapping Type Hyperlink</p>
-<img src="img/mapped_entity_type_link.png" alt="The JPA Details view for an entity showing the mapping type hyperlink." title="The JPA Details view for an entity showing the mapping type hyperlink." /><br /></div>
-<!-- class="figure" -->
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also change (or add) persistence for an entity by right-clicking the class in the JPA Structure View and then clicking <span class="bold">Map As &gt; Entity</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-<li>
-<p>Select <span class="bold">Entity</span> from the Mapping Type Selection dialog and then click <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref78" name="sthref78"></a>
-<p class="titleinfigure">The Mapping Type Selection Dialog</p>
-<img src="img/mapping_type_selection_entity.png" alt="The Mapping Type selection dialog with Enity selected." title="The Mapping Type selection dialog with Enity selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
deleted file mode 100644
index 004a1691dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Embeddable</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embeddable" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFEICE" name="BABFEICE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embeddable</h1>
-<p><a id="sthref79" name="sthref79"></a><a id="sthref80" name="sthref80"></a>An <span class="bold">Embedded</span> class is a class whose instances are stored as part of an owning entity; it shares the identity of the owning entity. Each field of the embedded class is mapped to the database table associated with the owning entity.</p>
-<p>To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref81" name="sthref81"></a><a id="sthref82" name="sthref82"></a><a id="sthref83" name="sthref83"></a>An embeddable entity is identified by the <code>@Embeddable</code> annotation.</p>
-<p>Use this procedure to add embeddable persistence to an existing entity:</p>
-<ol>
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>Click the mapping type hyperlink to open the Mapping Type Selection dialog.</p>
-</li>
-<li>
-<p>Select <span class="bold">Embeddable</span> and then click <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref84" name="sthref84"></a>
-<p class="titleinfigure">Mapping Type Selection Dialog (Embeddable)</p>
-<img src="img/mapping_type_selection_embed.png" alt="The Mapping Type Selection dialog with Embeddable selected." title="The Mapping Type Selection dialog with Embeddable selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<dl>
-<dd><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></dd>
-<dd><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></dd>
-<dd><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></dd>
-</dl>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
deleted file mode 100644
index 1b5054e055..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapped superclass</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapped superclass" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDAGCI" name="BABDAGCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Mapped superclass</h1>
-<p><a id="sthref85" name="sthref85"></a><a id="sthref86" name="sthref86"></a>An entity that extends a <span class="bold">Mapped Superclass</span> class inherits the persistent state and mapping information from a superclass. You should use a mapped superclass to define mapping information that is common to multiple entity classes.</p>
-<p>A mapped superclass <span class="italic">can be</span>:</p>
-<ul>
-<li>
-<p>Abstract or concrete classes</p>
-</li>
-</ul>
-<p>A mapped superclass <span class="italic">cannot be</span>:</p>
-<ul>
-<li>
-<p>Be queried or passed as an argument to Entity-Manager or Query operations</p>
-</li>
-<li>
-<p>Be the target of a persistent relationship</p>
-</li>
-</ul>
-<p>A mapped superclass does not have a defined database table. Instead, its mapping information is derived from its superclass. To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref87" name="sthref87"></a><a id="sthref88" name="sthref88"></a><a id="sthref89" name="sthref89"></a><a id="sthref90" name="sthref90"></a>A mapped superclass is identified by the <code>@MappedSuperclass</code> annotation.</p>
-<p>Use this procedure to add Mapped Superclass persistence to an existing entity:</p>
-<ol>
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the JPA Details view, click the mapping type hyperlink to open the Mapping Type Selection dialog.</p>
-</li>
-<li>
-<p>Select <span class="bold">Mapped Superclass</span> and then <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref91" name="sthref91"></a>
-<p class="titleinfigure">Mapping Type Selection Dialog (Mapped Superclass)</p>
-<img src="img/mapping_type_selection_superclass.png" alt="The Mapping Type Selection dialog with Mapped Superclass selected." title="The Mapping Type Selection dialog with Mapped Superclass selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
deleted file mode 100644
index 82e8697c54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating Named Queries</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating Named Queries" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIGBGG" name="BABIGBGG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Creating Named Queries</h1>
-<p><a id="sthref107" name="sthref107"></a><a id="sthref108" name="sthref108"></a>Named queries improve application performance because they are prepared once and they (and all of their associated supporting objects) can be efficiently reused thereafter, making them well suited for complex and frequently executed operations. Named queries use the JPA query language for portable execution on any underlying database; named native queries use the SQL language native to the underlying database.</p>
-<p>Use this procedure to add <code>@NamedQuery</code> and <code>@NamedNativeQuery</code> annotations to the entity.</p>
-<p>To create a named query:</p>
-<ol>
-<li>
-<p>Select the entity in the Project Explorer.</p>
-</li>
-<li>
-<p>In the JPA Details view, expand Queries.</p>
-</li>
-<li>
-<p>Click <span class="bold">Add</span> for a named query, or <span class="bold">Add Native</span> for a native query.</p>
-</li>
-<li>
-<p>In the dialog that appears, enter the name of the query in the Name field and then click OK.</p>
-</li>
-<li>
-<p>Enter the query in the Query field.</p>
-</li>
-<li>
-<p><a id="sthref109" name="sthref109"></a><a id="sthref110" name="sthref110"></a><a id="sthref111" name="sthref111"></a><a id="sthref112" name="sthref112"></a>To add a Query hint, click <span class="bold">Add</span>.</p>
-<div class="figure"><a id="sthref113" name="sthref113"></a>
-<p class="titleinfigure">Entering a Named Query</p>
-<img src="img/task_entering_query.png" alt="The Queries section of the JPA Details view." title="The Queries section of the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
deleted file mode 100644
index f4022d9d10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Basic mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Basic mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBABCE" name="BABBABCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Basic mapping</h1>
-<p><a id="sthref114" name="sthref114"></a><a id="sthref115" name="sthref115"></a><a id="sthref116" name="sthref116"></a><a id="sthref117" name="sthref117"></a>Use a <span class="bold">Basic Mapping</span> to map an attribute directly to a database column. Basic mappings may be used only with the following attribute types:</p>
-<ul>
-<li>
-<p>Java primitive types and wrappers of the primitive types</p>
-</li>
-<li>
-<p><code>java.lang.String, java.math.BigInteger</code></p>
-</li>
-<li>
-<p><code>java.math.BigDecimal</code></p>
-</li>
-<li>
-<p><code>java.util.Date</code></p>
-</li>
-<li>
-<p><code>java.util.Calendar, java.sql.Date</code></p>
-</li>
-<li>
-<p><code>java.sql.Time</code></p>
-</li>
-<li>
-<p><code>java.sql.Timestamp</code></p>
-</li>
-<li>
-<p><code>byte[]</code></p>
-</li>
-<li>
-<p><code>Byte[]</code></p>
-</li>
-<li>
-<p><code>char[]</code></p>
-</li>
-<li>
-<p><code>Character[]</code></p>
-</li>
-<li>
-<p>enums</p>
-</li>
-<li>
-<p>any other type that implements <code>Serializable</code></p>
-</li>
-</ul>
-<p>To create a basic mapping:</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, right-click the field to map. Select <span class="bold">Map As &gt; Basic</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-<th align="left" valign="bottom" id="r1c3-t14">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14">Entity Map Hyperlink</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">Defines this mapping as a <span class="bold">Basic Mapping</span>.
-<p>This corresponds to the <code>@Basic</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t14 r1c3-t14">Basic</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Column</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t14 r1c3-t14">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t14" headers="r1c1-t14">Table</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">Name of the database table.</td>
-<td align="left" headers="r4c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t14" headers="r1c1-t14">Fetch</td>
-<td align="left" headers="r5c1-t14 r1c2-t14">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t14 r1c3-t14">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t14" headers="r1c1-t14">Optional</td>
-<td align="left" headers="r6c1-t14 r1c2-t14">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t14 r1c3-t14">Yes</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t14" headers="r1c1-t14">Type</td>
-<td align="left" headers="r7c1-t14 r1c2-t14">Specifies the type of data:
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>LOB &ndash; Specifies if this is a large objects (BLOB or CLOB). See <a href="ref_mapping_general.htm#CACBBIBI">"Lob"</a> for details.</p>
-</li>
-<li>
-<p>Temporal &ndash; Specify if this is a Date, Time, or Timestamp object. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.</p>
-</li>
-<li>
-<p>Enumerated &ndash; Specify how to persist enumerated constraints as ordinal or string, in order to match an existing database schema.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t14 r1c3-t14"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>",
- insertable=<span class="italic">&lt;INSERTABLE&gt;</span>, updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Basic(fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, optional = <span class="italic">&lt;OPTIONAL&gt;</span>)
-@Temporal(TemporalType.<span class="italic">&lt;TEMPORAL&gt;</span>)
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
deleted file mode 100644
index 5634d786c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Embedded mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABCBHDF" name="BABCBHDF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embedded mapping</h1>
-<p><a id="sthref118" name="sthref118"></a><a id="sthref119" name="sthref119"></a><a id="sthref120" name="sthref120"></a><a id="sthref121" name="sthref121"></a>Use an <span class="bold">Embedded Mapping</span> to specify a persistent field or property of an entity whose value is an instance of an embeddable class.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, right-click the field to map.</p>
-</li>
-<li>
-<p>Select <span class="bold">Map as &gt; Embedded</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Property</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-<th align="left" valign="bottom" id="r1c3-t15">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Defines this mapping as a <span class="bold">Embedded</span>.
-<p>This corresponds to the <code>@Embedded</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t15 r1c3-t15">Embedded</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Attribute Overrides</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">Specify to override the default mapping of an entity's attribute. Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r3c1-t15 r1c3-t15"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Embedded
-@AttributeOverride(column=@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name = "<span class="italic">&lt;COLUMN_NAME&gt;</span>"))
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
deleted file mode 100644
index 425fb6498c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Embedded ID mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded ID mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDIAEE" name="CIHDIAEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embedded ID mapping</h1>
-<p><a id="sthref122" name="sthref122"></a><a id="sthref123" name="sthref123"></a><a id="sthref124" name="sthref124"></a><a id="sthref125" name="sthref125"></a>Use an <span class="bold">Embedded ID Mapping</span> to specify the primary key of an embedded ID. These mappings may be used with a <a href="tasks007.htm#BABFEICE">Embeddable</a> entities.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Embedded Id</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Property</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-<th align="left" valign="bottom" id="r1c3-t16">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">Defines this mapping as a <span class="bold">Embedded Id</span>.
-<p>This corresponds to the <code>@EmbeddedId</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">Embedded Id</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@EmbeddedId
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
deleted file mode 100644
index 8aadf81887..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
+++ /dev/null
@@ -1,176 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>ID mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="ID mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABGCBHG" name="BABGCBHG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>ID mapping</h1>
-<p><a id="sthref126" name="sthref126"></a><a id="sthref127" name="sthref127"></a><a id="sthref128" name="sthref128"></a><a id="sthref129" name="sthref129"></a>Use an <span class="bold">ID Mapping</span> to specify the primary key of an entity. ID mappings may be used with a <a href="tasks006.htm#BABGBIEE">Entity</a> or <a href="tasks008.htm#BABDAGCI">Mapped superclass</a>. Each <a href="tasks006.htm#BABGBIEE">Entity</a> must have an ID mapping.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right click the filed and then select <span class="bold">Map as &gt; ID</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="22%" />
-<col width="*" />
-<col width="35%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t17">Property</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-<th align="left" valign="bottom" id="r1c3-t17">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">Defines this mapping as an <span class="bold">ID Mapping</span>.
-<p>This field corresponds to the <code>@Id</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t17 r1c3-t17">ID</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t17" headers="r1c1-t17">Column</td>
-<td align="left" headers="r3c1-t17 r1c2-t17">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t17 r1c3-t17">By default, the Column is assumed to be named identically to the attribute.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t17" headers="r1c1-t17">Table</td>
-<td align="left" headers="r4c1-t17 r1c2-t17">The database table mapped to the entity attribute.</td>
-<td align="left" headers="r4c1-t17 r1c3-t17">By default, the Table is assumed to be identical to the table associated with the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t17" headers="r1c1-t17">Temporal</td>
-<td align="left" headers="r5c1-t17 r1c2-t17">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t17 r1c3-t17"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the PK Generation tab." summary="This table lists the fields in the PK Generation tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="22%" />
-<col width="*" />
-<col width="35%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t18">Property</th>
-<th align="left" valign="bottom" id="r1c2-t18">Description</th>
-<th align="left" valign="bottom" id="r1c3-t18">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t18" headers="r1c1-t18">Primary Key Generation</td>
-<td align="left" headers="r2c1-t18 r1c2-t18">These fields define how the primary key is generated.</td>
-<td align="left" headers="r2c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t18" headers="r1c1-t18">&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t18 r1c2-t18">See <a href="ref_primary_key.htm#CACBAJBC">"Primary Key Generation"</a> for details.
-<ul>
-<li>
-<p>Auto</p>
-</li>
-<li>
-<p>Sequence</p>
-</li>
-<li>
-<p>Identity</p>
-</li>
-<li>
-<p>Table</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t18 r1c3-t18">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t18" headers="r1c1-t18">&nbsp;&nbsp;Generator&nbsp;Name</td>
-<td align="left" headers="r4c1-t18 r1c2-t18">Name of the primary key generator specified in the <span class="bold">Strategy</span></td>
-<td align="left" headers="r4c1-t18 r1c3-t18"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Additional fields will appear in the <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area, depending on the selected Strategy. See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for additional information.</p>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;TABLE_NAME&gt;</span>", insertable=<span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Temporal(<span class="italic">&lt;TEMPORAL&gt;</span>)
-@GeneratedValue(strategy=GeneratorType.<span class="italic">&lt;STRATEGY&gt;</span>, generator="<span class="italic">&lt;GENERATOR_NAME&gt;</span>")@TableGenerator(name="<span class="italic">&lt;TABLE_GENERATOR_NAME&gt;</span>", table = "<span class="italic">&lt;TABLE_GENERATOR_TABLE&gt;</span>",
- pkColumnName = "<span class="italic">&lt;TABLE_GENERATOR_PK&gt;</span>",
- valueColumnName = "<span class="italic">&lt;TABLE_GENERATOR_VALUE_COLUMN&gt;</span>",
- pkColumnValue = "<span class="italic">&lt;TABLE_GENERATOR_PK_COLUMN_VALUE&gt;</span>")@SequenceGenerator(name="<span class="italic">&lt;SEQUENCE_GENERATOR_NAME&gt;</span>",
- sequenceName="<span class="italic">&lt;SEQUENCE_GENERATOR_SEQUENCE&gt;</span>")
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
deleted file mode 100644
index d158190edb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
+++ /dev/null
@@ -1,179 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Many-to-many mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-many mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEIEGD" name="BABEIEGD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Many-to-many mapping</h1>
-<p><a id="sthref130" name="sthref130"></a><a id="sthref131" name="sthref131"></a><a id="sthref132" name="sthref132"></a><a id="sthref133" name="sthref133"></a>Use a <span class="bold">Many-to-Many Mapping</span> to define a many-valued association with many-to-many multiplicity. A many-to-many mapping has two sides: the <span class="italic">owning side</span> and <span class="italic">non-owning side</span>. You must specify the join table on the owning side. For bidirectional mappings, either side may be the owning side.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Many-to-Many</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields of the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t19">Property</th>
-<th align="left" valign="bottom" id="r1c2-t19">Description</th>
-<th align="left" valign="bottom" id="r1c3-t19">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t19" headers="r1c1-t19">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t19 r1c2-t19">Defines this mapping as a <span class="bold">Many to Many Mapping</span>.
-<p>This field corresponds to the <code>@ManyToMany</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t19 r1c3-t19">Many to Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t19" headers="r1c1-t19">Target Entity</td>
-<td align="left" headers="r3c1-t19 r1c2-t19">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t19 r1c3-t19">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t19" headers="r1c1-t19">Fetch</td>
-<td align="left" headers="r4c1-t19 r1c2-t19">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t19 r1c3-t19">Lazy</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t19" headers="r1c1-t19">Mapped By</td>
-<td align="left" headers="r5c1-t19 r1c2-t19">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t19" headers="r1c1-t19">Order By</td>
-<td align="left" headers="r6c1-t19 r1c2-t19">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r6c1-t19 r1c3-t19">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in the <a href="reference011.htm#CACBAEBC">Join Table Information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t20">Property</th>
-<th align="left" valign="bottom" id="r1c2-t20">Description</th>
-<th align="left" valign="bottom" id="r1c3-t20">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t20" headers="r1c1-t20">Name</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t20 r1c3-t20">You must specify the join table on the owning side.
-<p>By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">Join Columns</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r3c1-t20 r1c3-t20">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t20" headers="r1c1-t20">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t20 r1c3-t20">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>To add a new Join or Inverse Join Column, click <span class="gui-object-action">Add</span>.</p>
-<p>To edit an existing Join or Inverse Join Column, select the field to and click <span class="gui-object-action">Edit</span>.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToMany(cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>, fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
deleted file mode 100644
index 05eba6a8dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
+++ /dev/null
@@ -1,167 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Many-to-one mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-one mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHFAFJ" name="BABHFAFJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Many-to-one mapping</h1>
-<p><a id="sthref134" name="sthref134"></a><a id="sthref135" name="sthref135"></a><a id="sthref136" name="sthref136"></a><a id="sthref137" name="sthref137"></a>Use a <span class="bold">Many-to-One</span> mapping to defines a single-valued association to another entity class that has many-to-one multiplicity.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right click the field and then select <span class="bold">Map As &gt; Many-to-One</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields ion the General tab for this mapping." summary="This table lists the fields ion the General tab for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t21">Property</th>
-<th align="left" valign="bottom" id="r1c2-t21">Description</th>
-<th align="left" valign="bottom" id="r1c3-t21">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t21" headers="r1c1-t21">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t21 r1c2-t21">Defines mapping as <span class="bold">Many-to-One</span>. This corresponds to the <code>@ManyToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t21 r1c3-t21">Many-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t21" headers="r1c1-t21">Target Entity</td>
-<td align="left" headers="r3c1-t21 r1c2-t21">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t21 r1c3-t21">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t21" headers="r1c1-t21">Fetch</td>
-<td align="left" headers="r4c1-t21 r1c2-t21">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t21 r1c3-t21">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t21" headers="r1c1-t21">Cascade</td>
-<td align="left" headers="r5c1-t21 r1c2-t21">See <a href="ref_mapping_general.htm#CACJAIHB">"Cascade Type"</a> for details.
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>All</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t21 r1c3-t21">Default</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t21" headers="r1c1-t21">Optional</td>
-<td align="left" headers="r6c1-t21 r1c2-t21">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t21 r1c3-t21">Yes</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields on the <a href="reference012.htm#CACFCEJC">Join Columns Information</a> tab in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t22">Property</th>
-<th align="left" valign="bottom" id="r1c2-t22">Description</th>
-<th align="left" valign="bottom" id="r1c3-t22">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t22" headers="r1c1-t22">Join Column</td>
-<td align="left" headers="r2c1-t22 r1c2-t22"><a id="sthref138" name="sthref138"></a><a id="sthref139" name="sthref139"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t22 r1c3-t22">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, fetch=<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- cascade=<span class="italic">&lt;CASCADE_TYPE&gt;</span>)
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
deleted file mode 100644
index 417c743805..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
+++ /dev/null
@@ -1,197 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>One-to-many mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-many mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHGEBD" name="BABHGEBD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>One-to-many mapping</h1>
-<p><a id="sthref140" name="sthref140"></a><a id="sthref141" name="sthref141"></a><a id="sthref142" name="sthref142"></a><a id="sthref143" name="sthref143"></a>Use a <span class="bold">One-to-Many Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; One-to-many</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the General tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the General tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t23">Property</th>
-<th align="left" valign="bottom" id="r1c2-t23">Description</th>
-<th align="left" valign="bottom" id="r1c3-t23">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t23" headers="r1c1-t23">Mapping Entity Type Hyperlink</td>
-<td align="left" headers="r2c1-t23 r1c2-t23">Defines mapping as <span class="bold">One-to-Many</span>. This corresponds to the <code>@OneToMany</code> annotation.</td>
-<td align="left" headers="r2c1-t23 r1c3-t23">One-to-Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t23" headers="r1c1-t23">Target Entity</td>
-<td align="left" headers="r3c1-t23 r1c2-t23">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t23" headers="r1c1-t23">Cascade</td>
-<td align="left" headers="r4c1-t23 r1c2-t23">See <a href="ref_mapping_general.htm#CACJAIHB">"Cascade Type"</a> for details.
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>All</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t23" headers="r1c1-t23">Fetch</td>
-<td align="left" headers="r5c1-t23 r1c2-t23">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t23 r1c3-t23">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t23" headers="r1c1-t23">Mapped By</td>
-<td align="left" headers="r6c1-t23 r1c2-t23">The database field that owns the relationship.</td>
-<td align="left" headers="r6c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t23" headers="r1c1-t23">Order By</td>
-<td align="left" headers="r7c1-t23 r1c2-t23">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t23 r1c3-t23">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference011.htm#CACBAEBC">Join Table Information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t24">Property</th>
-<th align="left" valign="bottom" id="r1c2-t24">Description</th>
-<th align="left" valign="bottom" id="r1c3-t24">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t24" headers="r1c1-t24">Name</td>
-<td align="left" headers="r2c1-t24 r1c2-t24">Name of the join table</td>
-<td align="left" headers="r2c1-t24 r1c3-t24">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t24" headers="r1c1-t24">Join Columns</td>
-<td align="left" headers="r3c1-t24 r1c2-t24">Specify two or more join columns (that is, a primary key).</td>
-<td align="left" headers="r3c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t24" headers="r1c1-t24">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t24 r1c2-t24">The join column on the owned (or inverse) side of the association: the owned entity's primary key column.</td>
-<td align="left" headers="r4c1-t24 r1c3-t24"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>)
-@Column(name="<span class="italic">&lt;COLUMN&gt;</span>")
-
-
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>.class, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-@JoinTable(name="<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>", joinColumns=@JoinColumn(name=
- "<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName="<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"),
- inverseJoinColumns=@JoinColumn(name="<span class="italic">&lt;INVERSE_JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName="<span class="italic">&lt;INVERSE_JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"))
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
deleted file mode 100644
index 9c58f8a42b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
+++ /dev/null
@@ -1,146 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>One-to-one mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-one mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFHBCJ" name="BABFHBCJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>One-to-one mapping</h1>
-<p><a id="sthref144" name="sthref144"></a><a id="sthref145" name="sthref145"></a><a id="sthref146" name="sthref146"></a><a id="sthref147" name="sthref147"></a>Use a <span class="bold">One-to-One Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; One-to-One</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t25">Property</th>
-<th align="left" valign="bottom" id="r1c2-t25">Description</th>
-<th align="left" valign="bottom" id="r1c3-t25">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t25" headers="r1c1-t25">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">Defines mapping as <span class="bold">One-to-One</span>. This corresponds to the <code>@OneToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t25 r1c3-t25">One-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t25" headers="r1c1-t25">Target Entity</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t25 r1c3-t25">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">Fetch Type</td>
-<td align="left" headers="r4c1-t25 r1c2-t25">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t25 r1c3-t25">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t25" headers="r1c1-t25">Mapped By</td>
-<td align="left" headers="r5c1-t25 r1c2-t25">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t25 r1c3-t25"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference012.htm#CACFCEJC">Join Columns Information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t26">Property</th>
-<th align="left" valign="bottom" id="r1c2-t26">Description</th>
-<th align="left" valign="bottom" id="r1c3-t26">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t26" headers="r1c1-t26">Join Column</td>
-<td align="left" headers="r2c1-t26 r1c2-t26"><a id="sthref148" name="sthref148"></a><a id="sthref149" name="sthref149"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t26 r1c3-t26">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName=
- "<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>", insertable = <span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable = <span class="italic">&lt;UPDATABLE&gt;</span>)
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
deleted file mode 100644
index b04bdb3c0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Transient mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Transient mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHFHEI" name="BABHFHEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Transient mapping</h1>
-<p><a id="sthref150" name="sthref150"></a><a id="sthref151" name="sthref151"></a><a id="sthref152" name="sthref152"></a><a id="sthref153" name="sthref153"></a>Use the Transient Mapping to specify a field of the entity class that <span class="italic">is not</span> persistent.</p>
-<p>To create a transient mapping:</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As Transient</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotation to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Transient
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
deleted file mode 100644
index f9f3209292..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
+++ /dev/null
@@ -1,136 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Version mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Version mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHIBII" name="BABHIBII"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Version mapping</h1>
-<p><a id="sthref154" name="sthref154"></a><a id="sthref155" name="sthref155"></a><a id="sthref156" name="sthref156"></a><a id="sthref157" name="sthref157"></a>Use a <span class="bold">Version Mapping</span> to specify the field used for optimistic locking. If the entity is associated with multiple tables, you should use a version mapping only with the primary table. You should have only a single version mapping per persistent entity. Version mappings may be used only with the following attribute types:</p>
-<ul>
-<li>
-<p><code>int</code></p>
-</li>
-<li>
-<p><code>Integer</code></p>
-</li>
-<li>
-<p><code>short, Short</code></p>
-</li>
-<li>
-<p><code>long, Long</code></p>
-</li>
-<li>
-<p><code>Timestamp</code></p>
-</li>
-</ul>
-<p>To create a version mapping:</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Version</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t27">Property</th>
-<th align="left" valign="bottom" id="r1c2-t27">Description</th>
-<th align="left" valign="bottom" id="r1c3-t27">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t27" headers="r1c1-t27">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t27 r1c2-t27">Defines the mapping as Version. This corresponds to the <code>@Version</code> annotation.</td>
-<td align="left" headers="r2c1-t27 r1c3-t27">Version</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t27" headers="r1c1-t27">Column</td>
-<td align="left" headers="r3c1-t27 r1c2-t27">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t27 r1c3-t27">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t27" headers="r1c1-t27">Table</td>
-<td align="left" headers="r4c1-t27 r1c2-t27">Name of the database table. This must be the primary table associated with the attribute's entity.</td>
-<td align="left" headers="r4c1-t27 r1c3-t27"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t27" headers="r1c1-t27">Temporal</td>
-<td align="left" headers="r5c1-t27 r1c2-t27">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t27 r1c3-t27"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Version
-@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name="&lt;<span class="italic">COLUMN_NAME</span>&gt;")
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
deleted file mode 100644
index c785cd4dc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Element Collection mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Element Collection mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHBDEAJ" name="CIHBDEAJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Element Collection mapping</h1>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
deleted file mode 100644
index 358ebb8f33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
+++ /dev/null
@@ -1,95 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating entities from tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating entities from tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBAGFI" name="BABBAGFI"></a></p>
-<div class="sect1">
-<h1>Generating entities from tables</h1>
-<p><a id="sthref158" name="sthref158"></a><a id="sthref159" name="sthref159"></a>Use this procedure to generate Java persistent entities from database tables. You must create a JPA project and establish a database connection <span class="italic">before</span> generating persistent entities. See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.<a id="sthref160" name="sthref160"></a><a id="sthref161" name="sthref161"></a></p>
-<ol>
-<li>
-<p>Right-click the JPA project in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate Entities from Tables</span>.</p>
-<div class="figure"><a id="sthref162" name="sthref162"></a>
-<p class="titleinfigure">Generating Entities</p>
-<img src="img/generate_entities.png" alt="Using the JPA Tools &gt; Generate Entities menu option." title="Using the JPA Tools &gt; Generate Entities menu option." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>On the <a href="ref_selectTables.htm#CIAHCGEE">Select Tables</a> page, select your database connection and schema.</p>
-<p>To create a new database connection, click <span class="bold">Add connection</span>.</p>
-<p>If you are not currently connected to the database, the Database Connection page appears. Select your database connection and schema, and click <span class="bold">Reconnect</span>.</p>
-<div class="figure"><a id="sthref163" name="sthref163"></a>
-<p class="titleinfigure">Select Tables</p>
-<img src="img/select_tables.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>After selecting a schema, select the tables from which to generate Java persistent entities and click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p>On the <a href="ref_tableAssociations.htm#CIACDICB">Table Associations</a> page, select the associations to generate. You can specify to generate specific references for each association.</p>
-<p>To create a new association, click <span class="bold">Add Association</span>. Use the <a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a> wizard to define the association.</p>
-<div class="figure"><a id="sthref164" name="sthref164"></a>
-<p class="titleinfigure">Table Associations</p>
-<img src="img/table_associations.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>After editing the table associations, click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p>On the <a href="ref_customizeDefaultEntityGeneration.htm#CIAEJDBE">Customize Default Entity Generation</a> page, customize the mapping and class information for each generated entity.</p>
-<div class="figure"><a id="sthref165" name="sthref165"></a>
-<p class="titleinfigure">Customize Default Entity Generation</p>
-<img src="img/customize_default_entity_generation.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>After customizing the mappings, click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p>On the <a href="ref_customizIndividualEntities.htm#CIACIGEE">Customize Individual Entities</a> page, review the mapping and class information for each entity that will be generated, then click <span class="bold">Finish</span>.</p>
-<div class="figure"><a id="sthref166" name="sthref166"></a>
-<p class="titleinfigure">Customize Individual Entities</p>
-<img src="img/customize_individual_entities.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>Eclipse creates a Java persistent entity for each database table. Each entity contains fields based on the table's columns. Eclipse will also generate entity relationships (such as one-to-one) based on the table constraints. <a href="#CIHJIJJC">Figure: Generating Entities from Tables</a> illustrates how Eclipse generates entities from tables.</p>
-<div class="figure"><a id="CIHJIJJC" name="CIHJIJJC"></a>
-<p class="titleinfigure">Generating Entities from Tables</p>
-<img src="img/table_entity.png" alt="This figure shows the EMPLOYEE and ADDRESS entities generated from database tables." title="This figure shows the EMPLOYEE and ADDRESS entities generated from database tables." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
deleted file mode 100644
index 6341e8970b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating tables from entities</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating tables from entities" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHJIGBE" name="CIHJIGBE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating tables from entities</h1>
-<p>When using a vendor-specific platform, you can create a DDL script from your persistent entities.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The DDL script with DROP existing tables on the database and CREATE new tables, based on the entities in your project.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>To generate a DDL script:</p>
-<p>Right-click the JPA project in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate Tables from Entities</span>.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a></p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm
deleted file mode 100644
index a1870e4d58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Validating mappings and reporting problems</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Validating mappings and reporting problems" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFAIBA" name="BABFAIBA"></a></p>
-<div class="sect1">
-<h1>Validating mappings and reporting problems</h1>
-<p><a id="sthref167" name="sthref167"></a><a id="sthref168" name="sthref168"></a><a id="sthref169" name="sthref169"></a><a id="sthref170" name="sthref170"></a>Errors and warnings on persistent entities and mappings are indicated with a red error or yellow warning next to the resource with the error, as well as the parent containers up to the project.</p>
-<div class="figure"><a id="sthref171" name="sthref171"></a>
-<p class="titleinfigure">Sample Errors and Warnings</p>
-<img src="img/error_sample.png" alt="This figure shows sample error and warning icons in the Explorer view." title="This figure shows sample error and warning icons in the Explorer view." /><br /></div>
-<!-- class="figure" -->
-<p>This section contains information on the following:</p>
-<ul>
-<li>
-<p><a href="tasks024.htm#CIHFEDEI">Error messages</a></p>
-</li>
-<li>
-<p><a href="tasks025.htm#CIHGEAIJ">Warning messages</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm
deleted file mode 100644
index b3fee1f68d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Error messages</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Error messages" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHFEDEI" name="CIHFEDEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Error messages<a id="sthref172" name="sthref172"></a></h1>
-<p>This section contains information on error messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref173" name="sthref173"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE__NAME&gt;</span>" has invalid mapping type in this context</p>
-<p>The mapped attribute is invalid. Either change the mapping type or change the entity type.</p>
-<p>See <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a> for more information.</p>
-<a id="sthref174" name="sthref174"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE_NAME&gt;</span>" cannot be resolved.</p>
-<p>Dali cannot map the attribute to a database table and column. Verify that you database connection information is correct.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.</p>
-<a id="sthref175" name="sthref175"></a>
-<p class="subhead2">Class "<span class="italic">&lt;CLASS_NAME&gt;</span>" is not annotated as a persistent class.</p>
-<p>The class has not been identified as a persistent class. Configure the class as an Entity, Mapped Superclass, or Embeddable persistent entity.</p>
-<p>See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<a id="sthref176" name="sthref176"></a>
-<p class="subhead2">Column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>You mapped an entity's field to an incorrect or invalid column in the database table. By default, Dali will attempt to map each field in the entity with an identically named row in the database table. If the field's name differs from the row's name, you must explicitly create the mapping.</p>
-<p>Map the field to a valid row in the database table as shown in <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a>.</p>
-<a id="sthref177" name="sthref177"></a>
-<p class="subhead2">Duplicate class "<span class="italic">&lt;CLASS_NAME&gt;</span>".</p>
-<p>You created to persistence classes with the same name. Each Java class must have a unique name. See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a> for more information.</p>
-<a id="sthref178" name="sthref178"></a>
-<p class="subhead2">Entity does not have an Id or Embedded Id.</p>
-<p>You created a persistent entity without identifying its primary key. A persistent entity must have a primary key field designated with an <code>@Id</code> or <code>@EmbeddedId</code> annotation.</p>
-<p>Add an ID mapping to the entity as shown in <a href="tasks013.htm#BABGCBHG">"ID mapping"</a> or <a href="tasks012.htm#CIHDIAEE">"Embedded ID mapping"</a>.</p>
-<a id="sthref179" name="sthref179"></a>
-<p class="subhead2">Multiple persistence.xml files in project.</p>
-<p>You created a JPA project with more than one <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref180" name="sthref180"></a>
-<p class="subhead2">No persistence unit defined.</p>
-<p>There is no persistence unit defined in the <code>persistence.xml</code> file. Use the &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>" tag to define the persistent unit.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref181" name="sthref181"></a>
-<p class="subhead2">No persistence.xml file in project.</p>
-<p>You created a JPA project without a <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref182" name="sthref182"></a>
-<p class="subhead2">Referenced column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" in join column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>The column that you selected to join a relationship mapping does not exist on the database table. Either select a different column on the <a href="reference011.htm#CACBAEBC">Join Table Information</a> or create the necessary column on the database table.</p>
-<p>See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for more information.</p>
-<a id="sthref183" name="sthref183"></a>
-<p class="subhead2">Schema "&lt;<span class="italic">SCHEMA_NAME</span>&gt;" cannot be resolved for table/join table "&lt;<span class="italic">TABLE_NAME</span>&gt;".</p>
-<p>Define the default database schema information in the persistence unit.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref184" name="sthref184"></a>
-<p class="subhead2">Table "<span class="italic">&lt;TABLE_NAME&gt;</span>" cannot be resolved.</p>
-<p>You associated a persistent entity to an incorrect or invalid database table. By default, Dali will attempt to associate each persistent entity with an identically named database table. If the entity's name differs from the table's name, you must explicitly create the association.</p>
-<p>Associate the entity with a valid database table as shown in <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<a id="sthref185" name="sthref185"></a>
-<p class="subhead2">Unresolved generator "<span class="italic">&lt;GENERATOR_NAME&gt;</span>" is defined in persistence unit.</p>
-<p>You created a persistence entity that uses sequencing or a table generator, but did not define the generator in the persistence unit. Either define the generator by using an annotation or including it in the XML mapping file.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm
deleted file mode 100644
index f6bbacb426..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Warning messages</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Warning messages" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHGEAIJ" name="CIHGEAIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Warning messages</h1>
-<p>This section contains information on warning messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref186" name="sthref186"></a>
-<p class="subhead2">Connection "<span class="italic">&lt;CONNECTION_NAME&gt;</span>" is not active. No validation will be done against the data source.</p>
-<p>The database connection you specified to use with the JPA project is not active. The JPA project requires an active connection.</p>
-<a id="sthref187" name="sthref187"></a>
-<p class="subhead2">No connection specified for the project. No data-specific validation will be performed.</p>
-<p>You created a JPA project without specifying a database connection. The JPA project requires an active connection.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> or <a href="tasks026.htm#BABDBCBI">"Modifying persistent project properties"</a> for information on specifying a database connection.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm
deleted file mode 100644
index 295a03a8bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Modifying persistent project properties</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Modifying persistent project properties" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDBCBI" name="BABDBCBI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Modifying persistent project properties</h1>
-<p>Each persistent project must be associated with a database connection. To create a new database connection, click <span class="gui-object-action">Database Connection</span> use the New Connection wizard.</p>
-<p>Use this procedure to modify the vender-specific platform and database connection associated with your JPA project.</p>
-<ol>
-<li>
-<p>Right-click the project in the <span class="gui-object-title">Explorer</span> view and select <span class="gui-object-action">Properties</span>. The Properties page appears.</p>
-<div class="figure"><a id="sthref188" name="sthref188"></a>
-<p class="titleinfigure">The Properties Page</p>
-<img src="img/project_properties_tasks.png" alt="The Persistence page." title="The Persistence page." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete each field on the <a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a> click <span class="bold">OK</span>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
deleted file mode 100644
index a47917f7e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Tips and tricks</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tips and tricks" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDHGHBF" name="CHDHGHBF"></a></p>
-<h1>Tips and tricks</h1>
-<p>The following tips and tricks give some helpful ideas for increasing your productivity.</p>
-<ul>
-<li>
-<p><a href="#BABFIIHA"><span class="bold">Database Connections</span></a></p>
-</li>
-<li>
-<p><a href="#BABCHAHF"><span class="bold">Schema-based persistence.xml</span></a></p>
-</li>
-</ul>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the tips and tricks in this category." summary="This table lists the tips and tricks in this category." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="27%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Tip</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2"><a id="BABFIIHA" name="BABFIIHA"></a><span class="bold">Database Connections</span></td>
-<td align="left" headers="r2c1-t2 r1c2-t2">When starting a new workbench session, be sure to <a href="../org.eclipse.datatools.connectivity.doc.user/doc/html/asc1229700343352.html">reconnect to your database</a> (if you are working online). This allows Dali to provide database-related mapping assistance and validation.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2"><a id="BABCHAHF" name="BABCHAHF"></a><span class="bold">Schema-based persistence.xml</span></td>
-<td align="left" headers="r3c1-t2 r1c2-t2">If you are behind a firewall, you may need to configure your Eclipse workspace proxy in the <a href="../org.eclipse.platform.doc.user/reference/ref-72.htm">Preferences dialog</a> (<span class="gui-object-action">Preferences &gt; Internet &gt; Proxy Settings</span>) to properly validate a schema-based <code>persistence.xml</code> file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml b/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
deleted file mode 100644
index 976debe599..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- User Guide -->
- <toc label="Dali Java Persistence Tools User Guide">
- <topic href="getting_started.htm" label="Getting started">
- <topic href="getting_started001.htm#BABEFHCD" label="Requirements and installation" />
- <topic href="getting_started002.htm#BABIGCJA" label="Dali quick start">
- <topic href="getting_started003.htm#BABDFHDA" label="Creating a new JPA project" />
- <topic href="getting_started004.htm#BABFGDDG" label="Creating a Java persistent entity with persistent fields" />
- </topic>
- </topic>
- <topic href="concepts.htm" label=" Concepts">
- <topic href="concept_persistence.htm#BABCAHIC" label="Understanding Java persistence" />
- <topic href="concept_mapping.htm#BABBDJFI" label="Understanding OR mappings" />
- <topic href="concepts001.htm#BABBGFJG" label="Understanding EJB 3.0 Java Persistence API">
- <topic href="concepts002.htm#CHDHAGIH" label="The persistence.xml file" />
- <topic href="concepts003.htm#CHDBIJAC" label="The orm.xml file" />
- </topic>
- </topic>
- <topic href="tasks.htm" label=" Tasks">
- <topic href="task_create_new_project.htm#CIHHEJCJ" label="Creating a new JPA project" />
- <topic href="tasks001.htm#BEIBADHH" label="Converting a Java Project to a JPA Project" />
- <topic href="task_create_jpa_entity.htm#BABFBJBG" label="Creating a JPA Entity" />
- <topic href="task_manage_persistence.htm#CIHDAJID" label="Managing the persistence.xml file">
- <topic href="tasks002.htm#CIHFEBAI" label="Synchronizing classes" />
- <topic href="tasks003.htm#sthref56" label="Upgrading document version" />
- </topic>
- <topic href="task_manage_orm.htm#CIHDGDCD" label="Managing the orm.xml file">
- <topic href="tasks004.htm#sthref60" label="Creating an orm.xml file" />
- <topic href="tasks005.htm#CIHBCDCE" label="Working with orm.xml file" />
- </topic>
- <topic href="task_add_persistence.htm#BABHICAI" label="Adding persistence to a class">
- <topic href="tasks006.htm#BABGBIEE" label="Entity" />
- <topic href="tasks007.htm#BABFEICE" label="Embeddable" />
- <topic href="tasks008.htm#BABDAGCI" label="Mapped superclass" />
- </topic>
- <topic href="task_additonal_tables.htm#CIHGBIEI" label="Specifying additional tables" />
- <topic href="task_inheritance.htm#CIHCCCJD" label="Specifying entity inheritance" />
- <topic href="tasks009.htm#BABIGBGG" label="Creating Named Queries" />
- <topic href="task_mapping.htm#BABDGBIJ" label="Mapping an entity">
- <topic href="tasks010.htm#BABBABCE" label="Basic mapping" />
- <topic href="tasks011.htm#BABCBHDF" label="Embedded mapping" />
- <topic href="tasks012.htm#CIHDIAEE" label="Embedded ID mapping" />
- <topic href="tasks013.htm#BABGCBHG" label="ID mapping" />
- <topic href="tasks014.htm#BABEIEGD" label="Many-to-many mapping" />
- <topic href="tasks015.htm#BABHFAFJ" label="Many-to-one mapping" />
- <topic href="tasks016.htm#BABHGEBD" label="One-to-many mapping" />
- <topic href="tasks017.htm#BABFHBCJ" label="One-to-one mapping" />
- <topic href="tasks018.htm#BABHFHEI" label="Transient mapping" />
- <topic href="tasks019.htm#BABHIBII" label="Version mapping" />
- <topic href="tasks020.htm#CIHBDEAJ" label="Element Collection mapping" />
- </topic>
- <topic href="tasks021.htm#BABBAGFI" label="Generating entities from tables" />
- <topic href="tasks022.htm#CIHJIGBE" label="Generating tables from entities" />
- <topic href="tasks023.htm#BABFAIBA" label="Validating mappings and reporting problems">
- <topic href="tasks024.htm#CIHFEDEI" label="Error messages" />
- <topic href="tasks025.htm#CIHGEAIJ" label="Warning messages" />
- </topic>
- <topic href="tasks026.htm#BABDBCBI" label="Modifying persistent project properties" />
- <topic href="task_generating_schema_from_classes.htm#CIHHBJCJ" label="Generating Schema from Classes" />
- <topic href="task_generate_classes_from_schema.htm#CIHCBHJD" label="Generating JAXB Classes from a Schema" />
- </topic>
- <topic label=" Reference">
- <topic label="Wizards">
- <topic href="ref_new_jpa_project_wizard.htm#CACBJGBG" label="Create New JPA Project wizard">
- <topic href="ref_new_jpa_project.htm#CACBJAGC" label="New JPA Project page" />
- <topic href="ref_java_page.htm#CIAGEBAA" label="Java Page" />
- <topic href="ref_jpa_facet.htm#CACIFDIF" label="JPA Facet page" />
- </topic>
- <topic href="ref_create_jpa_entity_wizard.htm#CIAGGGDF" label="Create JPA Entity wizard">
- <topic href="ref_EntityClassPage.htm#CIAFEIGF" label="Entity Class page" />
- <topic href="ref_EntityPropertiesPage.htm#CIADECIA" label="Entity Properties page" />
- </topic>
- <topic href="reference002.htm#CIAIJCCE" label="Mapping File Wizard">
- <topic href="reference003.htm#CIAJEIDJ" label="Mapping File" />
- </topic>
- <topic href="reference004.htm#CIAGHCGA" label="Generate Tables from Entities Wizard" />
- <topic href="ref_create_custom_entities_wizard.htm#CIAGBFJE" label="Generate Entities from Tables Wizard">
- <topic href="ref_selectTables.htm#CIAHCGEE" label="Select Tables" />
- <topic href="ref_tableAssociations.htm#CIACDICB" label="Table Associations" />
- <topic href="ref_customizeDefaultEntityGeneration.htm#CIAEJDBE" label="Customize Default Entity Generation" />
- <topic href="ref_customizIndividualEntities.htm#CIACIGEE" label="Customize Individual Entities" />
- </topic>
- <topic href="ref_create_new_association_wizard.htm#CIAFGHIF" label="Create New Association">
- <topic href="ref_association_table.htm#CIAGJHDC" label="Association Tables" />
- <topic href="ref_join_columns.htm#CIAEGEEG" label="Join Columns" />
- <topic href="ref_association_cardinality.htm#CIAFIIFH" label="Association Cardinality" />
- </topic>
- <topic href="ref_jaxb_schema_wizard.htm#CACGADFH" label="Generate Schema from JAXB Classes Wizard">
- <topic href="ref_schema_from_classes_page.htm#CACHBEGJ" label="Generate Schema from Classes" />
- </topic>
- </topic>
- <topic label="Property pages">
- <topic href="ref_persistence_prop_view.htm#BABFAEBB" label="JPA Details view (for entities)">
- <topic href="reference006.htm#CACCAGGC" label="General information" />
- <topic href="reference007.htm#CACIJBGH" label="Attribute overrides" />
- <topic href="reference008.htm#CACBHIDA" label="Secondary table information" />
- <topic href="reference009.htm#CACFHGHE" label="Inheritance information" />
- <topic href="reference010.htm#sthref241" label="Queries" />
- </topic>
- <topic href="ref_persistence_map_view.htm#BABIFBAF" label="JPA Details view (for attributes)">
- <topic href="ref_mapping_general.htm#CACBHFIJ" label="General information" />
- <topic href="reference011.htm#CACBAEBC" label="Join Table Information" />
- <topic href="reference012.htm#CACFCEJC" label="Join Columns Information" />
- <topic href="ref_primary_key.htm#CACFCCAB" label="Primary Key Generation information" />
- </topic>
- <topic href="ref_details_orm.htm#CACGDGHC" label="JPA Details view (for orm.xml)">
- <topic href="reference013.htm#CACCACGH" label="General information" />
- <topic href="reference014.htm#CACEAGBG" label="Persistence Unit information" />
- <topic href="reference015.htm#CIAFGAIJ" label="Generators" />
- <topic href="reference016.htm#CIAIBAAJ" label="Queries" />
- <topic href="reference017.htm#CIADGCID" label="Converters" />
- </topic>
- <topic href="ref_persistence_outline.htm#BABEGGFE" label="JPA Structure view" />
- <topic href="ref_persistence_xmll_editor.htm#CIACCHID" label="persistence.xml Editor">
- <topic href="ref_persistence_general.htm#CIACIFGJ" label="General" />
- <topic href="reference018.htm#CIAFFJIE" label="Connection" />
- <topic href="reference019.htm#CIAJAFEG" label="Customization" />
- <topic href="reference020.htm#CIABEDCH" label="Caching" />
- <topic href="reference021.htm#CIABGHHI" label="Logging" />
- <topic href="reference022.htm#CIAFJCHE" label="Options" />
- <topic href="reference023.htm#CIACCFCB" label="Schema Generation" />
- <topic href="reference024.htm#CIAHJDFF" label="Properties" />
- <topic href="reference025.htm#CIAHCJAH" label="Source" />
- </topic>
- </topic>
- <topic label="Preferences">
- <topic href="ref_project_properties.htm#BABJHBCI" label="Project Properties page - Java Persistence Options" />
- <topic href="reference027.htm#CACFBAEH" label="Project Properties page - Validation Preferences" />
- </topic>
- <topic label="Dialogs">
- <topic href="reference029.htm#CACCGEHC" label="Edit Join Columns Dialog" />
- <topic href="ref_select_cascade_dialog.htm#CIAFDGIJ" label="Select Cascade dialog" />
- <topic href="ref_eclipselink_mapping_file.htm#CIAEDEJF" label="New EclipseLink Mapping File dialog" />
- <topic href="ref_add_converter.htm#CIAGCGIJ" label="Add Converter dialog" />
- <topic href="ref_configure_jaxb_class_generation_dialog.htm#CACHHHJA" label="Configure JAXB Class Generation dialog" />
- </topic>
- <topic href="ref_persistence_perspective.htm#BABIFBDB" label="JPA Development perspective" />
- <topic label="Icons and buttons">
- <topic href="reference031.htm#CACGEACG" label="Icons" />
- <topic href="reference032.htm#CACDJCEI" label="Buttons" />
- </topic>
- <topic href="reference033.htm#CACBBDIB" label="Dali Developer Documentation" />
- </topic>
- <topic href="tips_and_tricks.htm" label="Tips and tricks">
- <topic href="whats_new001.htm#sthref306" label="Improved Internationalization and Localization" />
- <topic href="whats_new002.htm#CJACEDDE" label="Multiple Improvements to the Dali Perspective" />
- <topic href="whats_new003.htm#CJADIFHJ" label="Support for JPA 2.0 and EclipseLink" />
- <topic href="whats_new004.htm#CJABIJEC" label="Conversion of Java Projects to JPA Projects" />
- <topic href="whats_new005.htm#CJACJBDA" label="EclipseLink 2.x Support" />
- <topic href="whats_new006.htm#sthref307" label="Table-per-Concrete-Class Inheritance" />
- </topic>
- <topic href="legal.htm" label=" Legal">
- <topic href="about.htm#sthref309" label="About this content" />
- </topic>
-</toc>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
deleted file mode 100644
index 95294a3e2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>What's new</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" What's new" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref291" name="sthref291"></a> What's new</p>
-<p>This section contains descriptions of the following new features and significant changes made to the Dali OR Mapping Tool for Release 2.3:</p>
-<ul>
-<li>
-<p><a href="whats_new002.htm#CJACEDDE">Multiple Improvements to the Dali Perspective</a></p>
-</li>
-<li>
-<p><a href="whats_new003.htm#CJADIFHJ">Support for JPA 2.0 and EclipseLink</a></p>
-</li>
-<li>
-<p><a href="whats_new004.htm#CJABIJEC">Conversion of Java Projects to JPA Projects</a></p>
-</li>
-<li>
-<p><a href="whats_new005.htm#CJACJBDA">EclipseLink 2.x Support</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
deleted file mode 100644
index 70ca442b7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Improved Internationalization and Localization</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Improved Internationalization and Localization" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref292" name="sthref292"></a>
-<h1>Improved Internationalization and Localization</h1>
-<p>This release of the Dali OR Mapping Tool provides improved internationalization (i18n) and localization support. Dali projects can support different locales and processing of international data (such as dates and strings).</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
deleted file mode 100644
index 46b15e5afc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Multiple Improvements to the Dali Perspective</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Multiple Improvements to the Dali Perspective" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJACEDDE" name="CJACEDDE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Multiple Improvements to the Dali Perspective</h1>
-<p>There have been multiple improvements to the Dali perspectives to improve its ease-of-use:</p>
-<ul>
-<li>
-<p>The <a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a> now accepts short names as attribute types.</p>
-</li>
-<li>
-<p>Dali will perform validation after refreshing database information.</p>
-</li>
-<li>
-<p>Dali allows project-level customization for validation (error and warning reports)</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
deleted file mode 100644
index 5061cc4f3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Support for JPA 2.0 and EclipseLink</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Support for JPA 2.0 and EclipseLink" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJADIFHJ" name="CJADIFHJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Support for JPA 2.0 and EclipseLink</h1>
-<p>This release of the Dali OR Mapping Tool supports generic JPA 2.0 as well as specific items for EclispeLink 1.2.</p>
-<ul>
-<li>
-<p>Derived IDs</p>
-</li>
-<li>
-<p>Caching (Shared Cache and Cachable)</p>
-</li>
-<li>
-<p>Canonical metamodel generation</p>
-</li>
-<li>
-<p>Order Column configuration</p>
-</li>
-<li>
-<p>ElementCollection mapping type</p>
-</li>
-<li>
-<p>Cascade detach</p>
-</li>
-<li>
-<p>Dali will upgrade your <code>persistence.xml</code> from JPA 1.0 to 2.0.</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm
deleted file mode 100644
index 7ad545bfb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Conversion of Java Projects to JPA Projects</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Conversion of Java Projects to JPA Projects" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJABIJEC" name="CJABIJEC"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Conversion of Java Projects to JPA Projects</h1>
-<p>The Dali OR Mapping Tool now uses the Eclipse <span class="bold">Configure</span> menu to convert existing Java projects to JPA projects.</p>
-<p>See <a href="tasks001.htm#BEIBADHH">"Converting a Java Project to a JPA Project"</a> for more information.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm
deleted file mode 100644
index 431f99807f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>EclipseLink 2.x Support</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="EclipseLink 2.x Support" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJACJBDA" name="CJACJBDA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>EclipseLink 2.x Support</h1>
-<p>Release 2.3 provides support for EclipseLink 2.x features.</p>
-<p>EclipseLink (the Eclipse Persistence Services Project) is a complete persistence frame work. Refer to <code><a href="http://www.eclipse.org/eclipselink/">http://www.eclipse.org/eclipselink/</a></code> for more information.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm
deleted file mode 100644
index 712867a5cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Table-per-Concrete-Class Inheritance</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Table-per-Concrete-Class Inheritance" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref293" name="sthref293"></a>
-<h1>Table-per-Concrete-Class Inheritance</h1>
-<p>The Dali OR Mapping Tool now supports the JPA 1.0-optional table-per-concrete-class inheritance option. This functionality may be required in JPA 2.0.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project
deleted file mode 100644
index 56cc5af912..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.branding</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.branding</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project
deleted file mode 100644
index 1d5359a334..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.core.ddlgen</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.core.ddlgen</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.core/.project
deleted file mode 100644
index bd14595c75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.core</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.core</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project
deleted file mode 100644
index 868e21be70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.jaxb.core.schemagen</name>
- <comment>renamed to org.eclipse.jpt.jaxb.eclipselink.core.schemagen and moved to jaxb component</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project
deleted file mode 100644
index 7a6587657e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.ui</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.ui</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.project b/jpa/plugins/org.eclipse.jpt.gen/.project
deleted file mode 100644
index 688225a0c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.gen</name>
- <comment>renamed to org.eclipse.jpt.jpa.gen</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
deleted file mode 100644
index 3d552f89dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core.schemagen</name>
- <comment>moved to jaxb component</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.project b/jpa/plugins/org.eclipse.jpt.jaxb.ui/.project
deleted file mode 100644
index 8dc3015b6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.ui</name>
- <comment>moved to jaxb component</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore
deleted file mode 100644
index c9401a2c83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.* \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/.project b/jpa/plugins/org.eclipse.jpt.jpa.branding/.project
deleted file mode 100644
index fe9634f7fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:09 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 16da32f50a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.branding;singleton:=true
-Bundle-Version: 2.4.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.html b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties
deleted file mode 100644
index e4f170f396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - JPA Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties
deleted file mode 100644
index 4e089bbd76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties,\
- component.xml
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml
deleted file mode 100644
index 6e51135f57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jpa.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.db" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.db.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.gen" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.png b/jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties
deleted file mode 100644
index 48126670cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JPA Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project
deleted file mode 100644
index af3dab3f36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.db.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b6cef902e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:55 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index b3885ff7cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.db.ui
-Bundle-Version: 2.0.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.datatools.connectivity.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.datatools.sqltools.editor.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.datatools.connectivity.db.generic.ui;bundle-version="[1.0.1,2.0.0)"
-Export-Package: org.eclipse.jpt.jpa.db.ui.internal;x-friends:="org.eclipse.jpt.jpa.ui"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties
deleted file mode 100644
index 41837ebdd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml
deleted file mode 100644
index db3c94b7b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.db.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpa.db.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties
deleted file mode 100644
index 951e96ded1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JPA DB UI
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java
deleted file mode 100644
index 11873fbd1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.db.ui.internal;
-
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.db.generic.ui.wizard.NewJDBCFilteredCPWizard;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * DTP UI tools
- */
-public class DTPUiTools {
-
- /**
- * Launch the DTP New Connection Profile wizard to create a new database connection profile.
- *
- * Returns the name of the added profile, or null if the wizard was cancelled.
- * The name can be used to build a Dali connection profile from
- * JptJpaDbPlugin.getConnectionProfileFactory().buildConnectionProfile(String).
- */
- public static String createNewConnectionProfile() {
- // Filter datasource category
- NewJDBCFilteredCPWizard wizard = new NewJDBCFilteredCPWizard();
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.setBlockOnOpen(true);
-
- LocalProfileListener listener = new LocalProfileListener();
- ProfileManager.getInstance().addProfileListener(listener);
-
- String newCPName = null;
- if (wizardDialog.open() == Window.OK) {
- // assume the last added profile is the one we want
- newCPName = listener.addedProfile.getName();
- }
- ProfileManager.getInstance().removeProfileListener(listener);
-
- return newCPName;
- }
-
-
- // ********** DTP profile listener **********
-
- /**
- * This listener simply holds on to the most recently added connection
- * profile.
- */
- static class LocalProfileListener implements IProfileListener {
- IConnectionProfile addedProfile;
-
- public void profileAdded(IConnectionProfile profile) {
- this.addedProfile = profile;
- }
-
- public void profileChanged(IConnectionProfile profile) {
- // do nothing
- }
-
- public void profileDeleted(IConnectionProfile profile) {
- // do nothing
- }
- }
-
-
-// // ********** viewer filter **********
-//
-// static class LocalViewerFilter extends ViewerFilter {
-//
-// private static final String DATABASE_CATEGORY_ID = "org.eclipse.datatools.connectivity.db.category"; //$NON-NLS-1$
-//
-// LocalViewerFilter() {
-// super();
-// }
-//
-// @Override
-// public boolean select(Viewer viewer, Object parentElement, Object element) {
-// CPWizardNode wizardNode = (CPWizardNode) element;
-// IProfileWizardProvider wizardProvider = wizardNode.getProvider();
-// if (wizardProvider instanceof IWizardCategoryProvider) {
-// return false;
-// }
-// ICategory category = ConnectionProfileManager.getInstance().getProvider(
-// ((ProfileWizardProvider) wizardProvider).getProfile()).getCategory();
-//
-// // Only display wizards belong to database category
-// while (category != null) {
-// if (category.getId().equals(DATABASE_CATEGORY_ID)) {
-// return true;
-// }
-// category = category.getParent();
-// }
-// return false;
-// }
-// }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.db/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.project b/jpa/plugins/org.eclipse.jpt.jpa.db/.project
deleted file mode 100644
index 3cb8e9f83a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.db</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d6b660508f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:40 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF
deleted file mode 100644
index b17463ec74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.db
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.db.JptJpaDbPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.datatools.enablement.jdt.classpath;bundle-version="[1.0.1,2.0.0)",
- org.eclipse.datatools.sqltools.editor.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jpa.db,
- org.eclipse.jpt.jpa.db.internal;x-internal:=true,
- org.eclipse.jpt.jpa.db.internal.driver;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/about.html b/jpa/plugins/org.eclipse.jpt.jpa.db/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.db/build.properties
deleted file mode 100644
index f6a257843e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.db/component.xml
deleted file mode 100644
index e52b4eea61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.db"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpa.db" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties
deleted file mode 100644
index c428887e38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JPA DB
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java
deleted file mode 100644
index b976d3f1c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database catalog
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Catalog
- extends SchemaContainer
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java
deleted file mode 100644
index 3f24d3d3ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import org.eclipse.jpt.common.utility.JavaType;
-
-/**
- * Database column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Column
- extends DatabaseObject
-{
- /**
- * Return the column's table.
- */
- Table getTable();
-
-
- // ********** constraints **********
-
- /**
- * Return whether the column is part of its table's primary key.
- */
- boolean isPartOfPrimaryKey();
-
- /**
- * Return whether the column is part of one of its table's foreign keys.
- */
- boolean isPartOfForeignKey();
-
- /**
- * Return whether the column is part of a unique constraint defined for its
- * table.
- */
- boolean isPartOfUniqueConstraint();
-
- /**
- * Return whether the column is nullable.
- */
- boolean isNullable();
-
-
- // ********** data type **********
-
- /**
- * Return the name of the column's datatype.
- */
- String getDataTypeName();
-
- /**
- * Return whether the column's type is numeric.
- */
- boolean isNumeric();
-
- /**
- * Return the column's precision if it is a NumericalDataType;
- * otherwise, return -1.
- */
- public int getPrecision();
-
- /**
- * Return the column's scale if it is an ExactNumericDataType;
- * otherwise, return -1.
- */
- public int getScale();
-
- /**
- * If the column is a CharacterStringDataType, return its length;
- * otherwise, return -1.
- */
- public int getLength();
-
- /**
- * Return whether the column's datatype is a LOB type
- * (i.e. BLOB, CLOB, or NCLOB).
- */
- boolean isLOB();
-
-
- // ********** Java type **********
-
- /**
- * Return a Java type declaration that is reasonably
- * similar to the column's data type.
- */
- String getJavaTypeDeclaration();
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type.
- */
- JavaType getJavaType();
-
- /**
- * Return a Java type declaration that is reasonably
- * similar to the column's data type and suitable for use as a
- * primary key field.
- */
- String getPrimaryKeyJavaTypeDeclaration();
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type and suitable for use as a
- * primary key field.
- */
- JavaType getPrimaryKeyJavaType();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java
deleted file mode 100644
index 15cae4fad8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * An empty implementation of {@link ConnectionListener}.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ConnectionAdapter
- implements ConnectionListener
-{
- public void aboutToClose(ConnectionProfile profile) {
- // do nothing
- }
-
- public void closed(ConnectionProfile profile) {
- // do nothing
- }
-
- public void databaseChanged(ConnectionProfile profile, Database database) {
- // do nothing
- }
-
- public void modified(ConnectionProfile profile) {
- // do nothing
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- return true;
- }
-
- public void opened(ConnectionProfile profile) {
- // do nothing
- }
-
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- // do nothing
- }
-
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- // do nothing
- }
-
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- // do nothing
- }
-
- public void tableChanged(ConnectionProfile profile, Table table) {
- // do nothing
- }
-
- public void columnChanged(ConnectionProfile profile, Column column) {
- // do nothing
- }
-
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java
deleted file mode 100644
index 5cb9129aa4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.EventListener;
-
-/**
- * A <code>ConnectionListener</code> is notified of any changes to a connection.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @see org.eclipse.datatools.connectivity.IManagedConnectionListener
- */
-public interface ConnectionListener
- extends EventListener
-{
- public void opened(ConnectionProfile profile);
- public void modified(ConnectionProfile profile);
- public boolean okToClose(ConnectionProfile profile);
- public void aboutToClose(ConnectionProfile profile);
- public void closed(ConnectionProfile profile);
-
- public void databaseChanged(ConnectionProfile profile, Database database);
- public void catalogChanged(ConnectionProfile profile, Catalog catalog);
- public void schemaChanged(ConnectionProfile profile, Schema schema);
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence);
- public void tableChanged(ConnectionProfile profile, Table table);
- public void columnChanged(ConnectionProfile profile, Column column);
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java
deleted file mode 100644
index a8815874ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.sql.Connection;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-
-/**
- * Database connection profile
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionProfile
- extends DatabaseObject
-{
- // ********** properties **********
-
- /**
- * Return the connection profile's database.
- * Return <code>null</code> if the connection profile is inactive.
- */
- Database getDatabase();
-
- /**
- * Return ID of the provider managing the DTP profile.
- */
- String getProviderID();
-
- /**
- * Return the connection profile's static ID.
- */
- String getInstanceID();
-
- /**
- * Return the default database name.
- */
- String getDatabaseName();
-
- /**
- * Return the database product name.
- */
- String getDatabaseProduct();
-
- /**
- * Return the database vendor.
- */
- String getDatabaseVendor();
-
- /**
- * Return the database version.
- */
- String getDatabaseVersion();
-
- /**
- * Return the driver class name.
- */
- String getDriverClassName();
-
- /**
- * Return the default connection URL.
- */
- String getURL();
-
- /**
- * Return the default user name.
- */
- String getUserName();
-
- /**
- * Return the default user password.
- */
- String getUserPassword();
-
- /**
- * Return the ID of the associated Driver definition.
- */
- String getDriverDefinitionID();
-
- /**
- * Return the jar list for the associated Driver as a
- * comma-delimited string.
- */
- String getDriverJarList();
-
- /**
- * Return the name of the associated Driver definition.
- */
- String getDriverName();
-
-
- // ********** identifiers **********
-
- /**
- * Return whether all identifiers are to be treated as though they were
- * delimited. This is determined by the client-supplied database
- * identifier adapter.
- */
- boolean treatIdentifiersAsDelimited();
-
-
- // ********** connection **********
-
- /**
- * Return whether the profile is either connected to a live database
- * session or working off-line (i.e. it has access to meta-data).
- * @see #isConnected()
- * @see #isWorkingOffline()
- */
- boolean isActive();
-
- /**
- * Return whether the profile is neither connected to a live database
- * session nor working off-line (i.e. it has access to meta-data).
- * @see #isActive()
- */
- boolean isInactive();
-
- /**
- * Return whether the profile is connected to a live database session
- * (i.e. the meta-data comes from the database), as opposed to working
- * off-line.
- * @see #isActive()
- */
- boolean isConnected();
-
- /**
- * Return whether the profile is not connected to a live database session
- * (i.e. the meta-data comes from the database), as opposed to working
- * off-line.
- * @see #isConnected()
- */
- boolean isDisconnected();
-
- /**
- * Connect to the database.
- * @see #disconnect()
- */
- void connect();
-
- /**
- * Disconnect from the database.
- * @see #connect()
- */
- void disconnect();
-
- /**
- * Return the JDBC connection.
- */
- Connection getJDBCConnection();
-
-
- // ********** off-line support **********
-
- /**
- * Return whether the profile is working off-line (i.e. the meta-data
- * comes from a local cache), as opposed to connected to a live
- * database session.
- * @see #isActive()
- */
- boolean isWorkingOffline();
-
- /**
- * Return whether the connection factories associated with the
- * connection profile's provider support working offline.
- */
- boolean supportsWorkOfflineMode();
-
- /**
- * Save the state of the connection profile for working in an offline mode.
- * If the connection profile does not support working in an offline mode, no
- * exception is thrown and the method will return immediately.
- */
- IStatus saveWorkOfflineData();
-
- /**
- * Return whether the connection profile supports working offline and data
- * has been saved for working offline.
- */
- boolean canWorkOffline();
-
- /**
- * Begin working off-line.
- */
- IStatus workOffline();
-
-
- // ********** listeners **********
-
- /**
- * Add the specified connection listener to the connection profile.
- */
- void addConnectionListener(ConnectionListener listener);
-
- /**
- * Remove the specified connection listener from the connection profile.
- */
- void removeConnectionListener(ConnectionListener listener);
-
-
- // ********** constants **********
-
- String CONNECTION_PROFILE_TYPE = "org.eclipse.datatools.connectivity.db.generic.connectionProfile"; //$NON-NLS-1$
- String DRIVER_DEFINITION_PROP_ID = "org.eclipse.datatools.connectivity.driverDefinitionID"; //$NON-NLS-1$
- String DRIVER_DEFINITION_TYPE_PROP_ID = "org.eclipse.datatools.connectivity.drivers.defnType"; //$NON-NLS-1$
- String DRIVER_JAR_LIST_PROP_ID = "jarList"; //$NON-NLS-1$
- String DATABASE_SAVE_PWD_PROP_ID = IJDBCDriverDefinitionConstants.PROP_PREFIX + "savePWD"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java
deleted file mode 100644
index ecf4a98e1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * An empty implementation of {@link ConnectionProfileListener}.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ConnectionProfileAdapter
- implements ConnectionProfileListener
-{
- public void connectionProfileAdded(String name) {
- // do nothing
- }
-
- public void connectionProfileRemoved(String name) {
- // do nothing
- }
-
- public void connectionProfileRenamed(String oldName, String newName) {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java
deleted file mode 100644
index e31521820c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database connection profile factory
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionProfileFactory {
-
- /**
- * Return the names of the DTP connection profiles the factory can wrap with
- * new connection profiles.
- */
- Iterable<String> getConnectionProfileNames();
-
- /**
- * Build and return a connection profile that wraps the DTP connection
- * profile with the specified name.
- * Return <code>null</code> if there is no DTP connection profile with the
- * specified name.
- * Use the specified database identifier adapter to allow clients to control how
- * database identifiers are handled.
- */
- ConnectionProfile buildConnectionProfile(String name, DatabaseIdentifierAdapter adapter);
-
- /**
- * Build and return a connection profile that wraps the DTP connection
- * profile with the specified name.
- * Return <code>null</code> if there is no DTP connection profile with the
- * specified name.
- * <p>
- * Clients should use this method when a JPA platform is unavailable
- * (e.g. during project creation). The returned connection profile will
- * use the default database identifier adapter.
- */
- ConnectionProfile buildConnectionProfile(String name);
-
- /**
- * Add a listener that will be notified of changes to the DTP
- * connection profiles.
- */
- void addConnectionProfileListener(ConnectionProfileListener listener);
-
- /**
- * Remove the specified listener.
- */
- void removeConnectionProfileListener(ConnectionProfileListener listener);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java
deleted file mode 100644
index c7eb1e5236..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.EventListener;
-
-/**
- * A <code>ProfileListener</code> is notified of any changes to the DTP connection profiles.
- * <p>
- * @see org.eclipse.datatools.connectivity.IProfileListener
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionProfileListener
- extends EventListener
-{
- /**
- * The specified profile has been added.
- */
- public void connectionProfileAdded(String name);
-
- /**
- * The specified profile has been removed.
- */
- public void connectionProfileRemoved(String name);
-
- /**
- * The specified profile has been renamed.
- */
- public void connectionProfileRenamed(String oldName, String newName);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java
deleted file mode 100644
index 11c486fbf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Database
- extends SchemaContainer
-{
- /**
- * Return the database's DTP database.
- */
- org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase();
-
-
- // ********** properties **********
-
- /**
- * Return the name of the database's vendor.
- */
- String getVendorName();
-
- /**
- * Return the database's version.
- */
- String getVersion();
-
-
- // ********** catalogs **********
-
- /**
- * Return whether the database supports catalogs. If it does, all database
- * objects are contained by the database's catalogs; otherwise all database
- * objects are contained by the database's schemata.
- * <br>
- * Practically speaking:<ul>
- * <li>If {@link #supportsCatalogs()} returns <code>true</code><ul>
- * <li>{@link #getCatalogs()} returns catalogs that contain the database's schemata
- * <li>{@link #getSchemata()} returns an empty iterable
- * </ul>
- * <li>else<ul>
- * <li>{@link #getCatalogs()} returns an empty iterable
- * <li>{@link #getSchemata()} returns the database's schemata
- * </ul>
- * </ul>
- * This is complicated by the presence of a "default" catalog that clients can
- * use to allow the specification of a catalog to be optional; but clients
- * must manage this explicitly.
- * @see #getCatalogs()
- * @see #getSchemata()
- */
- boolean supportsCatalogs();
-
- /**
- * Return the database's catalogs.
- * Return an empty iterable if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- Iterable<Catalog> getCatalogs();
-
- /**
- * Return the number of catalogs the database contains.
- * Return zero if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- int getCatalogsSize();
-
- /**
- * Return the database's catalog names, sorted.
- * Return an empty iterable if the database does not support catalogs.
- * This is useful when the user is selecting a catalog from a read-only
- * combo-box (e.g. in a wizard).
- * @see #getSortedCatalogIdentifiers()
- * @see #getCatalogNamed(String)
- */
- Iterable<String> getSortedCatalogNames();
-
- /**
- * Return the catalog with the specified name. The name must be an exact match
- * of the catalog's name.
- * Return <code>null</code> if the database does not support catalogs.
- * @see #supportsCatalogs()
- * @see #getSortedCatalogNames()
- * @see #getCatalogForIdentifier(String)
- */
- Catalog getCatalogNamed(String name);
-
- /**
- * Return the database's catalog identifiers, sorted by name.
- * Return an empty iterable if the database does not support catalogs.
- * This is useful when the user is selecting an identifier that will be
- * placed in a text file (e.g. in a Java annotation).
- * @see #getSortedCatalogNames()
- * @see #getCatalogForIdentifier(String)
- */
- Iterable<String> getSortedCatalogIdentifiers();
-
- /**
- * Return the catalog for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * Return <code>null</code> if the database does not support catalogs.
- * @see #supportsCatalogs()
- * @see #getSortedCatalogIdentifiers()
- * @see #getCatalogNamed(String)
- */
- Catalog getCatalogForIdentifier(String identifier);
-
- /**
- * Return the database's default catalog, as defined by the database vendor.
- * In most cases the default catalog's name will match the user name.
- * Return <code>null</code> if the database does not support catalogs or
- * if the default catalog does not exist (e.g. the database has no catalog
- * whose name matches the user name).
- * @see #supportsCatalogs()
- * @see #getDefaultCatalogIdentifier()
- */
- Catalog getDefaultCatalog();
-
- /**
- * Return the database's default catalog identifier.
- * The database may or may not have a catalog with a matching name.
- * @see #supportsCatalogs()
- * @see #getDefaultCatalog()
- */
- String getDefaultCatalogIdentifier();
-
-
- // ********** utility methods **********
-
- /**
- * Select and return from the specified list of tables the
- * table identified by the specified identifier.
- * The identifier should be an SQL identifier (i.e. delimited as
- * appropriate).
- */
- Table selectTableForIdentifier(Iterable<Table> tables, String identifier);
-
- /**
- * Convert the specified name to a database-appropriate SQL identifier
- * (i.e. delimit the name as appropriate).
- */
- // it seems we don't need database object-specific conversions here;
- // i.e. separate methods for tables, columns, etc.
- String convertNameToIdentifier(String name);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java
deleted file mode 100644
index eb75e2559a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * This interface allows clients of the Dali db package to control whether
- * database identifiers are to be treated as though they are delimited, which,
- * most significantly, usually means the identifiers are case-sensitive.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DatabaseIdentifierAdapter {
-
- /**
- * Return whether identifiers are to be treated as though they were
- * delimited.
- */
- boolean treatIdentifiersAsDelimited();
-
-
- /**
- * This adapter simply returns <code>false</code>, which is compatible
- * with JPA 1.0.
- */
- final class Default implements DatabaseIdentifierAdapter {
- public static final DatabaseIdentifierAdapter INSTANCE = new Default();
- public static DatabaseIdentifierAdapter instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public boolean treatIdentifiersAsDelimited() {
- return false; // JPA 1.0
- }
- @Override
- public String toString() {
- return this.getClass().getDeclaringClass().getSimpleName() + '.' + this.getClass().getSimpleName();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java
deleted file mode 100644
index e20a54084b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.Comparator;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import com.ibm.icu.text.Collator;
-
-/**
- * Behavior common to all database objects.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DatabaseObject {
-
- /**
- * Return the database object's name.
- */
- String getName();
-
- /**
- * Return the database object's <em>identifier</em>, which is the object's name
- * modified so it can be used in an SQL statement (e.g. if the name contains
- * special characters or is mixed case, it will be delimited, typically by
- * double-quotes).
- */
- String getIdentifier();
-
- /**
- * Return the database object's <em>identifier</em>, which is the object's name
- * modified so it can be used in an SQL statement (e.g. if the name contains
- * special characters or is mixed case, it will be delimited, typically by
- * double-quotes).
- * Return <code>null</code> if the database object's identifier matches the
- * specified default name.
- * <p>
- * This is used by the Dali entity generation code to determine whether
- * a generated annotation must explicitly identify a database object
- * (e.g. a table) or the default (as specified here) adequately identifies
- * the database object (taking into consideration case-sensitivity,
- * special characters, etc.).
- */
- String getIdentifier(String defaultName);
-
- /**
- * Return the database object's database.
- */
- Database getDatabase();
-
- /**
- * Return the database object's connection profile.
- */
- ConnectionProfile getConnectionProfile();
-
-
- /**
- * Sort by name.
- */
- Comparator<DatabaseObject> DEFAULT_COMPARATOR =
- new Comparator<DatabaseObject>() {
- public int compare(DatabaseObject dbObject1, DatabaseObject dbObject2) {
- return Collator.getInstance().compare(dbObject1.getName(), dbObject2.getName());
- }
- @Override
- public String toString() {
- return this.getClass().getEnclosingClass().getSimpleName() + ".DEFAULT_COMPARATOR"; //$NON-NLS-1$
- }
- };
-
- Transformer<DatabaseObject, String> NAME_TRANSFORMER =
- new Transformer<DatabaseObject, String>() {
- public String transform(DatabaseObject dbObject) {
- return dbObject.getName();
- }
- @Override
- public String toString() {
- return this.getClass().getEnclosingClass().getSimpleName() + ".NAME_TRANSFORMER"; //$NON-NLS-1$
- }
- };
-
- Transformer<DatabaseObject, String> IDENTIFIER_TRANSFORMER =
- new Transformer<DatabaseObject, String>() {
- public String transform(DatabaseObject dbObject) {
- return dbObject.getIdentifier();
- }
- @Override
- public String toString() {
- return this.getClass().getEnclosingClass().getSimpleName() + ".IDENTIFIER_TRANSFORMER"; //$NON-NLS-1$
- }
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java
deleted file mode 100644
index 47c0abcda3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.Comparator;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * Database foreign key
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ForeignKey
- extends DatabaseObject
-{
- // ********** tables **********
-
- /**
- * Return the foreign key's <em>base</em> table.
- */
- Table getBaseTable();
-
- /**
- * Return the foreign key's <em>referenced</em> table.
- */
- Table getReferencedTable();
-
-
- // ********** column pairs **********
-
- /**
- * Return the foreign key's column pairs.
- */
- Iterable<ColumnPair> getColumnPairs();
-
- /**
- * Return the size of the foreign key's column pairs.
- */
- int getColumnPairsSize();
-
- /**
- * Return the foreign key's single column pair. Throw an
- * {@link IllegalStateException} if the foreign key has more than one column pair.
- */
- ColumnPair getColumnPair();
-
- /**
- * Return the foreign key's <em>base</em> columns.
- */
- Iterable<Column> getBaseColumns();
-
- /**
- * Return the foreign key's <em>base</em> columns that are not part of the base
- * table's primary key. (The non-primary key base columns are not used to
- * generate basic attributes during entity generation.)
- */
- Iterable<Column> getNonPrimaryKeyBaseColumns();
-
- /**
- * Return the foreign key's <em>referenced</em> columns.
- */
- Iterable<Column> getReferencedColumns();
-
- /**
- * Return whether the foreign key references the primary key of the
- * <em>referenced</em> table and that primary key has only a single column.
- * This can be used when determining JPA defaults.
- */
- boolean referencesSingleColumnPrimaryKey();
-
-
- // ********** JPA support **********
-
- /**
- * Return an appropriate name for an attribute that holds the entity
- * mapped to the foreign key's <em>referenced</em> table.
- */
- String getAttributeName();
-
- /**
- * If the name of the <em>base</em> column adheres to the JPA spec for a
- * default mapping (i.e. it ends with an underscore followed by the name
- * of the <em>referenced</em> column, and the <em>referenced</em> column is the single
- * primary key column of the <em>referenced</em> table), return the corresponding
- * default attribute name:<pre>
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * </pre>
- * Return <code>null</code> if it does not adhere to the JPA spec:<pre>
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.CUBICLE_ID) => null
- * ForeignKey(EMP.CUBICLE => CUBICLE.ID) => null
- * </pre>
- */
- String getDefaultAttributeName();
-
- /**
- * Given the name of an attribute (field or property) that is mapped to the
- * foreign key, build and return a string to be used as the value for the
- * attribute's <code>@javax.persistence.JoinColumn</code> annotation's
- * <code>name</code> element. Return <code>null</code> if the attribute
- * maps to the join column by default.
- * <p>
- * Precondition: The foreign key consists of a single column pair whose
- * referenced column is the single-column primary key of the foreign
- * key's referenced table.
- * <p>
- * This is used by the entity generation code to determine whether
- * a generated annotation must explicitly identify the join column
- * or the calculated default adequately identifies the join column
- * (taking into consideration case-sensitivity, special characters, etc.).
- */
- String getJoinColumnAnnotationIdentifier(String attributeName);
-
-
- // ********** column pair interface **********
-
- /**
- * Pair up the foreign key's column pairs, matching each <em>base</em> column with
- * the appropriate <em>referenced</em> column.
- * @see #getColumnPairs()
- */
- interface ColumnPair {
-
- /**
- * Return the column pair's <em>base</em> column.
- */
- Column getBaseColumn();
-
- /**
- * Return the column pair's <em>referenced</em> column.
- */
- Column getReferencedColumn();
-
- Comparator<ColumnPair> BASE_COLUMN_COMPARATOR =
- new Comparator<ColumnPair>() {
- public int compare(ColumnPair cp1, ColumnPair cp2) {
- return Collator.getInstance().compare(cp1.getBaseColumn().getName(), cp2.getBaseColumn().getName());
- }
- @Override
- public String toString() {
- return "ForeignKey.ColumnPair.BASE_COLUMN_COMPARATOR"; //$NON-NLS-1$
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java
deleted file mode 100644
index 473ab86097..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.datatools.enablement.jdt.classpath.DriverClasspathContainer;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jpt.jpa.db.internal.DTPConnectionProfileFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * The Dali JPA DB plug-in lifecycle implementation.
- * Globally available connection profile factory.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class JptJpaDbPlugin
- extends Plugin
-{
- // lazy-initialized
- private DTPConnectionProfileFactory connectionProfileFactory;
-
- private static JptJpaDbPlugin INSTANCE; // sorta-final
-
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.db"; //$NON-NLS-1$
-
- /**
- * Return the singleton JPT DB plug-in.
- */
- public static JptJpaDbPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- public static ConnectionProfileFactory getConnectionProfileFactory() {
- return INSTANCE.getConnectionProfileFactory_();
- }
-
-
- // ********** logging **********
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void log(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
-
- // ********** plug-in implementation **********
-
- /**
- * The constructor
- */
- public JptJpaDbPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // the connection profile factory is lazy-initialized...
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- if (this.connectionProfileFactory != null) {
- this.connectionProfileFactory.stop();
- this.connectionProfileFactory = null;
- }
- INSTANCE = null;
- super.stop(context);
- }
-
- private synchronized ConnectionProfileFactory getConnectionProfileFactory_() {
- if (this.connectionProfileFactory == null) {
- this.connectionProfileFactory = this.buildConnectionProfileFactory();
- this.connectionProfileFactory.start();
- }
- return this.connectionProfileFactory;
- }
-
- private DTPConnectionProfileFactory buildConnectionProfileFactory() {
- return DTPConnectionProfileFactory.instance();
- }
-
- /**
- * Creates a jar list container for the given DTP driver.
- */
- public IClasspathContainer buildDriverClasspathContainerFor(String driverName) {
- return new DriverClasspathContainer(driverName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java
deleted file mode 100644
index 9ae336fe27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database schema
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Schema
- extends DatabaseObject
-{
- /**
- * Return the schema's container; either a catalog or a database.
- */
- SchemaContainer getContainer();
-
-
- // ********** tables **********
-
- /**
- * Return the schema's tables.
- */
- Iterable<Table> getTables();
-
- /**
- * Return the number of tables the schema contains.
- */
- int getTablesSize();
-
- /**
- * Return the table with the specified name. The name must be an exact match
- * of the table's name.
- * @see #getTableForIdentifier(String)
- */
- Table getTableNamed(String name);
-
- /**
- * Return the schema's table identifiers, sorted by name.
- * @see #getTableForIdentifier(String)
- */
- Iterable<String> getSortedTableIdentifiers();
-
- /**
- * Return the table for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getTableNamed(String)
- * @see #getSortedTableIdentifiers()
- */
- Table getTableForIdentifier(String identifier);
-
-
- // ********** sequences **********
-
- /**
- * Return the schema's sequences.
- */
- Iterable<Sequence> getSequences();
-
- /**
- * Return the number of sequences the schema contains.
- */
- int getSequencesSize();
-
- /**
- * Return the sequence with the specified name. The name must be an exact match
- * of the sequence's name.
- * @see #getSequenceForIdentifier(String)
- */
- Sequence getSequenceNamed(String name);
-
- /**
- * Return the schema's sequence identifers, sorted by name.
- * @see #getSequenceForIdentifier(String)
- */
- Iterable<String> getSortedSequenceIdentifiers();
-
- /**
- * Return the sequence for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getSequenceNamed(String)
- * @see #getSortedSequenceIdentifiers()
- */
- Sequence getSequenceForIdentifier(String identifier);
-
- // ********** sequences **********
-
- void refresh();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java
deleted file mode 100644
index 9f3fad1acb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Schema container (i.e. Database or Catalog)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SchemaContainer
- extends DatabaseObject
-{
- /**
- * Return the container's schemata.
- */
- Iterable<Schema> getSchemata();
-
- /**
- * Return the number of schemata in the container.
- */
- int getSchemataSize();
-
- /**
- * Return the container's schema names, sorted.
- * This is useful when the user is selecting a schema from a read-only
- * combo-box (e.g. in a wizard).
- * @see #getSchemaNamed(String)
- * @see #getSortedSchemaIdentifiers()
- */
- Iterable<String> getSortedSchemaNames();
-
- /**
- * Return the schema with the specified name. The name must be an exact match
- * of the schema's name.
- * @see #getSortedSchemaNames()
- * @see #getSchemaForIdentifier(String)
- */
- Schema getSchemaNamed(String name);
-
- /**
- * Return the container's schema identifiers, sorted by name.
- * This is useful when the user is selecting an identifier that will be
- * placed in a text file (e.g. in a Java annotation).
- * @see #getSchemaForIdentifier(String)
- * @see #getSortedSchemaNames()
- */
- Iterable<String> getSortedSchemaIdentifiers();
-
- /**
- * Return the schema for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getSortedSchemaIdentifiers()
- * @see #getSchemaNamed(String)
- */
- Schema getSchemaForIdentifier(String identifier);
-
- /**
- * Return the container's default schema, as defined by the database vendor.
- * In most cases the default schema's name will match the user name.
- * Return <code>null</code> if the default schema does not exist (e.g. the
- * container has no schema whose name matches the user name).
- * @see #getDefaultSchemaIdentifier()
- */
- Schema getDefaultSchema();
-
- /**
- * Return the container's default schema identifier.
- * The container may or may not have a schema with a matching name.
- * @see #getDefaultSchema()
- */
- String getDefaultSchemaIdentifier();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java
deleted file mode 100644
index 886c728fc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database sequence
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Sequence
- extends DatabaseObject
-{
- /**
- * Return the sequence's schema.
- */
- Schema getSchema();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java
deleted file mode 100644
index aa2258ab75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database table
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Table
- extends DatabaseObject
-{
- /**
- * Return the table's schema.
- */
- Schema getSchema();
-
-
- // ********** columns **********
-
- /**
- * Return the table's columns.
- */
- Iterable<Column> getColumns();
-
- /**
- * Return the number of columns the table contains.
- */
- int getColumnsSize();
-
- /**
- * Return the column with the specified name. The name must be an exact match
- * of the column's name.
- * @see #getColumnForIdentifier(String)
- */
- Column getColumnNamed(String name);
-
- /**
- * Return the table's column identifers, sorted by name.
- * @see #getColumnForIdentifier(String)
- */
- Iterable<String> getSortedColumnIdentifiers();
-
- /**
- * Return the column for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getColumnNamed(String)
- * @see #getSortedColumnIdentifiers()
- */
- Column getColumnForIdentifier(String identifier);
-
-
- // ********** primary key columns **********
-
- /**
- * Return the table's primary key columns.
- */
- Iterable<Column> getPrimaryKeyColumns();
-
- /**
- * Return the number of primary key columns the table contains.
- */
- int getPrimaryKeyColumnsSize();
-
- /**
- * Return the table's single primary key column. Throw an
- * {@link IllegalStateException} if the table has more than one primary key column.
- */
- Column getPrimaryKeyColumn();
-
-
- // ********** foreign keys **********
-
- /**
- * Return the table's foreign keys.
- */
- Iterable<ForeignKey> getForeignKeys();
-
- /**
- * Return the number of foreign keys the table contains.
- */
- int getForeignKeysSize();
-
-
- // ********** join table support **********
-
- /**
- * Return whether the table is possibly a <em>join</em> table
- * (i.e. it contains only 2 foreign keys). Whether the table <em>actually</em> is
- * a <em>join</em> table is determined by the semantics of the database design.
- */
- boolean isPossibleJoinTable();
-
- /**
- * Assuming the table is a <em>join</em> table, return the foreign key to the
- * <em>owning</em> table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableOwningForeignKey();
-
- /**
- * Assuming the table is a <em>join</em> table, return the foreign key to the
- * <em>non-owning</em> table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableNonOwningForeignKey();
-
- /**
- * Assuming the table is a <em>join</em> table, return whether its name matches
- * the JPA default (i.e. <code>"OWNINGTABLE_NONOWNINGTABLE"</code>).
- * @see #isPossibleJoinTable()
- */
- boolean joinTableNameIsDefault();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java
deleted file mode 100644
index 8773036640..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Catalog;
-
-/**
- * Wrap a DTP Catalog
- */
-final class DTPCatalogWrapper
- extends DTPSchemaContainerWrapper<DTPDatabaseWrapper>
- implements Catalog
-{
- /** the wrapped DTP catalog */
- private final org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog;
-
-
- // ********** constructor **********
-
- DTPCatalogWrapper(DTPDatabaseWrapper database, org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- super(database);
- this.dtpCatalog = dtpCatalog;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpCatalog;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().catalogChanged(this);
- }
-
-
- // ********** DTPSchemaContainerWrapper implementation **********
-
- @Override
- @SuppressWarnings("unchecked")
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas() {
- return this.dtpCatalog.getSchemas();
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- // try to short-circuit the search
- return this.wraps(dtpSchema.getCatalog()) ?
- this.getSchema_(dtpSchema) :
- this.getDatabase().getSchemaFromCatalogs(dtpSchema);
- }
-
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- // try to short-circuit the search
- return this.wraps(dtpTable.getSchema().getCatalog()) ?
- this.getTable_(dtpTable) :
- this.getDatabase().getTableFromCatalogs(dtpTable);
- }
-
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- // try to short-circuit the search
- return this.wraps(dtpColumn.getTable().getSchema().getCatalog()) ?
- this.getColumn_(dtpColumn) :
- this.getDatabase().getColumnFromCatalogs(dtpColumn);
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpCatalog.getName();
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Catalog catalog) {
- return this.dtpCatalog == catalog;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java
deleted file mode 100644
index 4613cab63f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.modelbase.dbdefinition.PredefinedDataTypeDefinition;
-import org.eclipse.datatools.modelbase.sql.datatypes.CharacterStringDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.DataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.ExactNumericDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.NumericalDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PrimitiveType;
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.SimpleJavaType;
-import org.eclipse.jpt.jpa.db.Column;
-
-/**
- * Wrap a DTP Column
- */
-final class DTPColumnWrapper
- extends DTPDatabaseObjectWrapper<DTPTableWrapper>
- implements Column
-{
- /** the wrapped DTP column */
- private final org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn;
-
-
- // ********** constructor **********
-
- DTPColumnWrapper(DTPTableWrapper table, org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- super(table);
- this.dtpColumn = dtpColumn;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpColumn;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().columnChanged(this);
- }
-
-
- // ********** Column implementation **********
-
- public String getName() {
- return this.dtpColumn.getName();
- }
-
- public DTPTableWrapper getTable() {
- return this.parent;
- }
-
- public boolean isPartOfPrimaryKey() {
- return this.getTable().primaryKeyColumnsContains(this);
- }
-
- public boolean isPartOfForeignKey() {
- return this.getTable().foreignKeyBaseColumnsContains(this);
- }
-
- public boolean isPartOfUniqueConstraint() {
- return this.dtpColumn.isPartOfUniqueConstraint();
- }
-
- public boolean isNullable() {
- return this.dtpColumn.isNullable();
- }
-
- public String getDataTypeName() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType == null) ? null : dataType.getName();
- }
-
- public boolean isNumeric() {
- return this.dtpColumn.getDataType() instanceof NumericalDataType;
- }
-
- public int getPrecision() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof NumericalDataType) ?
- ((NumericalDataType) dataType).getPrecision() :
- -1;
- }
-
- public int getScale(){
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof ExactNumericDataType) ?
- ((ExactNumericDataType) dataType).getScale() :
- -1;
- }
-
- public int getLength() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof CharacterStringDataType) ?
- ((CharacterStringDataType) dataType).getLength() :
- -1;
- }
-
- public boolean isLOB() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- primitiveTypeIsLob(((PredefinedDataType) dataType).getPrimitiveType()) :
- false;
- }
-
- public String getJavaTypeDeclaration() {
- return this.getJavaType().declaration();
- }
-
- public JavaType getJavaType() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- convertToJPAJavaType(this.getJavaType((PredefinedDataType) dataType)) :
- DEFAULT_JAVA_TYPE;
- }
-
- public String getPrimaryKeyJavaTypeDeclaration() {
- return this.getPrimaryKeyJavaType().declaration();
- }
-
- public JavaType getPrimaryKeyJavaType() {
- return convertToJPAPrimaryKeyJavaType(this.getJavaType());
- }
-
- private JavaType getJavaType(PredefinedDataType dataType) {
- // this is just a bit hacky: moving from a type declaration to a class name to a type declaration...
- String dtpJavaClassName = this.resolveDefinition(dataType).getJavaClassName();
- return new SimpleJavaType(ReflectionTools.getClassNameForTypeDeclaration(dtpJavaClassName));
- }
-
- private PredefinedDataTypeDefinition resolveDefinition(PredefinedDataType dataType) {
- return this.getDatabase().getDTPDefinition().getPredefinedDataTypeDefinition(dataType.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Column column) {
- return this.dtpColumn == column;
- }
-
- @Override
- void clear() {
- // no state to clear
- }
-
-
- // ********** static methods **********
-
- /**
- * The JDBC spec says JDBC drivers should be able to map BLOBs and CLOBs
- * directly, but the JPA spec does not allow them.
- */
- private static JavaType convertToJPAJavaType(JavaType javaType) {
- if (javaType.equals(BLOB_JAVA_TYPE)) {
- return BYTE_ARRAY_JAVA_TYPE;
- }
- if (javaType.equals(CLOB_JAVA_TYPE)) {
- return STRING_JAVA_TYPE;
- }
- return javaType;
- }
-
- /**
- * The JPA spec [2.1.4] says only the following types are allowed in
- * primary key fields:<ul>
- * <li>[variable] primitives
- * <li>[variable] primitive wrappers
- * <li>{@link java.lang.String}
- * <li>{@link java.util.Date}
- * <li>{@link java.sql.Date}
- * </ul>
- */
- private static JavaType convertToJPAPrimaryKeyJavaType(JavaType javaType) {
- if (javaType.isVariablePrimitive()
- || javaType.isVariablePrimitiveWrapper()
- || javaType.equals(STRING_JAVA_TYPE)
- || javaType.equals(UTIL_DATE_JAVA_TYPE)
- || javaType.equals(SQL_DATE_JAVA_TYPE)) {
- return javaType;
- }
- if (javaType.equals(BIG_DECIMAL_JAVA_TYPE)) {
- return LONG_JAVA_TYPE; // ??
- }
- if (javaType.equals(SQL_TIME_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- if (javaType.equals(SQL_TIMESTAMP_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- // all the other typical types are pretty much un-mappable - return String(?)
- return STRING_JAVA_TYPE;
- }
-
- private static boolean primitiveTypeIsLob(PrimitiveType primitiveType) {
- return (primitiveType == PrimitiveType.BINARY_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.CHARACTER_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.NATIONAL_CHARACTER_LARGE_OBJECT_LITERAL);
- }
-
-
- // ***** some constants used when converting the column to a Java attribute
- // TODO Object is the default?
- private static final JavaType DEFAULT_JAVA_TYPE = new SimpleJavaType(java.lang.Object.class);
-
- private static final JavaType BLOB_JAVA_TYPE = new SimpleJavaType(java.sql.Blob.class);
- private static final JavaType BYTE_ARRAY_JAVA_TYPE = new SimpleJavaType(byte[].class);
-
- private static final JavaType CLOB_JAVA_TYPE = new SimpleJavaType(java.sql.Clob.class);
- private static final JavaType STRING_JAVA_TYPE = new SimpleJavaType(java.lang.String.class);
-
- private static final JavaType UTIL_DATE_JAVA_TYPE = new SimpleJavaType(java.util.Date.class);
- private static final JavaType SQL_DATE_JAVA_TYPE = new SimpleJavaType(java.sql.Date.class);
- private static final JavaType SQL_TIME_JAVA_TYPE = new SimpleJavaType(java.sql.Time.class);
- private static final JavaType SQL_TIMESTAMP_JAVA_TYPE = new SimpleJavaType(java.sql.Timestamp.class);
-
- private static final JavaType BIG_DECIMAL_JAVA_TYPE = new SimpleJavaType(java.math.BigDecimal.class);
- private static final JavaType LONG_JAVA_TYPE = new SimpleJavaType(long.class);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java
deleted file mode 100644
index b64b8f068e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener1;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ConnectionProfileFactory;
-import org.eclipse.jpt.jpa.db.ConnectionProfileListener;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-
-/**
- * Wrap the DTP {@link ProfileManager} in yet another singleton.
- */
-public final class DTPConnectionProfileFactory
- implements ConnectionProfileFactory
-{
- private ProfileManager dtpProfileManager;
-
- private LocalProfileListener profileListener;
-
-
- // ********** singleton **********
-
- private static final DTPConnectionProfileFactory INSTANCE = new DTPConnectionProfileFactory();
-
- public static DTPConnectionProfileFactory instance() {
- return INSTANCE;
- }
-
- /**
- * Access is <code>private</code> to ensure singleton
- */
- private DTPConnectionProfileFactory() {
- super();
- }
-
-
- // ********** lifecycle **********
-
- /**
- * called by plug-in
- */
- public synchronized void start() {
- this.dtpProfileManager = ProfileManager.getInstance();
- this.profileListener = new LocalProfileListener();
- this.dtpProfileManager.addProfileListener(this.profileListener);
- }
-
- /**
- * called by plug-in
- */
- public synchronized void stop() {
- this.dtpProfileManager.removeProfileListener(this.profileListener);
- this.profileListener = null;
- this.dtpProfileManager = null;
- }
-
-
- // ********** connection profiles **********
-
- public synchronized ConnectionProfile buildConnectionProfile(String name, DatabaseIdentifierAdapter adapter) {
- for (IConnectionProfile dtpProfile : this.dtpProfileManager.getProfiles()) {
- if (dtpProfile.getName().equals(name)) {
- return this.buildConnectionProfile(dtpProfile, adapter);
- }
- }
- return null;
- }
-
- private ConnectionProfile buildConnectionProfile(IConnectionProfile dtpProfile, DatabaseIdentifierAdapter adapter) {
- return new DTPConnectionProfileWrapper(dtpProfile, adapter);
- }
-
- public ConnectionProfile buildConnectionProfile(String name) {
- return this.buildConnectionProfile(name, DatabaseIdentifierAdapter.Default.instance());
- }
-
- public Iterable<String> getConnectionProfileNames() {
- return new TransformationIterable<IConnectionProfile, String>(this.getDTPConnectionProfiles()) {
- @Override
- protected String transform(IConnectionProfile dtpProfile) {
- return dtpProfile.getName();
- }
- };
- }
-
- private synchronized Iterable<IConnectionProfile> getDTPConnectionProfiles() {
- return new ArrayIterable<IConnectionProfile>(this.dtpProfileManager.getProfiles());
- }
-
-
- // ********** listeners **********
-
- public void addConnectionProfileListener(ConnectionProfileListener listener) {
- this.profileListener.addConnectionProfileListener(listener);
- }
-
- public void removeConnectionProfileListener(ConnectionProfileListener listener) {
- this.profileListener.removeConnectionProfileListener(listener);
- }
-
-
- // ********** listener **********
-
- /**
- * Forward events to the factory's listeners.
- */
- private static class LocalProfileListener
- implements IProfileListener1
- {
- private final ListenerList<ConnectionProfileListener> listenerList = new ListenerList<ConnectionProfileListener>(ConnectionProfileListener.class);
-
- LocalProfileListener() {
- super();
- }
-
- void addConnectionProfileListener(ConnectionProfileListener listener) {
- this.listenerList.add(listener);
- }
-
- void removeConnectionProfileListener(ConnectionProfileListener listener) {
- this.listenerList.remove(listener);
- }
-
-
- // ********** IProfileListener implementation **********
-
- public void profileAdded(IConnectionProfile dtpProfile) {
- String name = dtpProfile.getName();
- for (ConnectionProfileListener listener : this.listenerList.getListeners()) {
- listener.connectionProfileAdded(name);
- }
- }
-
- public void profileChanged(IConnectionProfile dtpProfile, String oldName, String oldDescription, Boolean oldAutoConnect) {
- String newName = dtpProfile.getName();
- if ( ! newName.equals(oldName)) {
- for (ConnectionProfileListener listener : this.listenerList.getListeners()) {
- listener.connectionProfileRenamed(oldName, newName);
- }
- }
- }
-
- public void profileChanged(IConnectionProfile dtpProfile) {
- // this method shouldn't be called on IProfileListener1
- throw new UnsupportedOperationException();
- }
-
- public void profileDeleted(IConnectionProfile dtpProfile) {
- String name = dtpProfile.getName();
- for (ConnectionProfileListener listener : this.listenerList.getListeners()) {
- listener.connectionProfileRemoved(name);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java
deleted file mode 100644
index 045b4782bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java
+++ /dev/null
@@ -1,535 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.sql.Connection;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.ConnectEvent;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IManagedConnection;
-import org.eclipse.datatools.connectivity.IManagedConnectionOfflineListener;
-import org.eclipse.datatools.connectivity.drivers.DriverManager;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.sqm.core.connection.ConnectionInfo;
-import org.eclipse.datatools.sqltools.core.DatabaseIdentifier;
-import org.eclipse.datatools.sqltools.core.profile.ProfileUtil;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-
-/**
- * Wrap a DTP {@link IConnectionProfile}
- */
-final class DTPConnectionProfileWrapper
- implements DTPDatabaseObject, ConnectionProfile
-{
- /** the wrapped DTP connection profile */
- private final IConnectionProfile dtpConnectionProfile;
-
- /** adapter supplied by the client (determines identifier delimiters) */
- private final DatabaseIdentifierAdapter identifierAdapter;
-
- /** the DTP managed connection we listen to */
- private final IManagedConnection dtpManagedConnection;
-
- /**
- * forward events from the DTP managed connection above;
- * we listen and propagate events iff we have listeners ourselves
- */
- private final LocalConnectionListener connectionListener;
-
- /** lazy-initialized, and deleted at disconnect */
- private DTPDatabaseWrapper database;
-
-
- // ********** constants **********
-
- private static final String LIVE_DTP_CONNECTION_TYPE = java.sql.Connection.class.getName();
-
- private static final String OFFLINE_DTP_CONNECTION_TYPE = ConnectionInfo.class.getName();
-
- private static final String DATABASE_PRODUCT_PROP_ID = "org.eclipse.datatools.connectivity.server.version"; //$NON-NLS-1$
-
-
- // ********** constructor **********
-
- DTPConnectionProfileWrapper(IConnectionProfile dtpConnectionProfile, DatabaseIdentifierAdapter identifierAdapter) {
- super();
- this.dtpConnectionProfile = dtpConnectionProfile;
- this.identifierAdapter = identifierAdapter;
- this.dtpManagedConnection = this.buildDTPManagedConnection();
- this.connectionListener = new LocalConnectionListener();
- // don't listen to the managed connection yet
- }
-
- private IManagedConnection buildDTPManagedConnection() {
- return this.dtpConnectionProfile.getManagedConnection(this.getDTPConnectionType());
- }
-
- private String getDTPConnectionType() {
- return this.dtpConnectionProfile.supportsWorkOfflineMode() ?
- OFFLINE_DTP_CONNECTION_TYPE :
- LIVE_DTP_CONNECTION_TYPE;
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpConnectionProfile.getName();
- }
-
- public String getIdentifier(String javaIdentifier) {
- // connection profiles do not have "identifiers"
- throw new UnsupportedOperationException();
- }
-
- public String getIdentifier() {
- // connection profiles do not have "identifiers"
- throw new UnsupportedOperationException();
- }
-
-
- // ********** DTPDatabaseObject implementation **********
-
- public DTPConnectionProfileWrapper getConnectionProfile() {
- return this;
- }
-
- public synchronized DTPDatabaseWrapper getDatabase() {
- if (this.database == null) {
- this.database = this.buildDatabase();
- }
- return this.database;
- }
-
-
- // ********** ConnectionProfile implementation **********
-
- // ***** properties
- public String getProviderID() {
- return this.dtpConnectionProfile.getProviderId();
- }
-
- public String getInstanceID() {
- return this.dtpConnectionProfile.getInstanceID();
- }
-
- public String getDatabaseName() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID);
- }
-
- public String getDatabaseProduct() {
- return this.getProperty(DATABASE_PRODUCT_PROP_ID);
- }
-
- public String getDatabaseVendor() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID);
- }
-
- public String getDatabaseVersion() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID);
- }
-
- public String getDriverClassName() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID);
- }
-
- public String getURL() {
- return this.getProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID);
- }
-
- public String getUserName() {
- String userName = this.getProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID);
- return this.extractUserName(userName.trim());
- }
-
- private String extractUserName(String userName) {
- String[] strings = userName.split("\\s+"); //$NON-NLS-1$
- // bug 208946 handle username like "sys as sysdba" on Oracle
- if ((strings.length == 3) && strings[1].equalsIgnoreCase("as")) { //$NON-NLS-1$
- return strings[0];
- }
- return userName;
- }
-
- public String getUserPassword() {
- return this.getProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID);
- }
-
- public String getDriverDefinitionID() {
- return this.getProperty(DRIVER_DEFINITION_PROP_ID);
- }
-
- public String getDriverJarList() {
- return DriverManager.getInstance().getDriverInstanceByID(this.getDriverDefinitionID()).getJarList();
- }
-
- public String getDriverName() {
- return DriverManager.getInstance().getDriverInstanceByID(this.getDriverDefinitionID()).getName();
- }
-
- // ***** connection
- public boolean isActive() {
- return this.isConnected() || this.isWorkingOffline();
- }
-
- public boolean isInactive() {
- return ! this.isActive();
- }
-
- public boolean isConnected() {
- return this.dtpManagedConnection.isConnected()
- && ! this.dtpManagedConnection.isWorkingOffline();
- }
-
- public boolean isDisconnected() {
- return ! this.isConnected();
- }
-
- public void connect() {
- if (this.isDisconnected()) {
- this.checkStatus(this.dtpConnectionProfile.connect());
- }
- }
-
- public void disconnect() {
- this.checkStatus(this.dtpConnectionProfile.disconnect());
- }
-
- public Connection getJDBCConnection() {
- return this.getConnectionInfo().getSharedConnection();
- }
-
- // ***** off-line support
- public boolean isWorkingOffline() {
- return this.dtpManagedConnection.isWorkingOffline();
- }
-
- public boolean supportsWorkOfflineMode() {
- return this.dtpConnectionProfile.supportsWorkOfflineMode();
- }
-
- public IStatus saveWorkOfflineData() {
- return this.dtpConnectionProfile.saveWorkOfflineData();
- }
-
- public boolean canWorkOffline() {
- return this.dtpConnectionProfile.canWorkOffline();
- }
-
- public IStatus workOffline() {
- return this.dtpConnectionProfile.workOffline();
- }
-
- // ***** listeners
- public synchronized void addConnectionListener(ConnectionListener listener) {
- if (this.hasNoListeners()) { // first listener added
- this.startListening();
- }
- this.connectionListener.addConnectionListener(listener);
- }
-
- private void startListening() {
- this.dtpManagedConnection.addConnectionListener(this.connectionListener);
- if (this.database != null) { // don't trigger database creation
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.startListening();
- }
- }
- }
-
- public synchronized void removeConnectionListener(ConnectionListener listener) {
- this.connectionListener.removeConnectionListener(listener);
- if (this.hasNoListeners()) { // last listener removed
- this.stopListening();
- }
- }
-
- private void stopListening() {
- if (this.database != null) { // don't trigger database creation
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.stopListening();
- }
- }
- this.dtpManagedConnection.removeConnectionListener(this.connectionListener);
- }
-
- boolean hasNoListeners() {
- return this.connectionListener.hasNoListeners();
- }
-
- boolean hasAnyListeners() {
- return this.connectionListener.hasAnyListeners();
- }
-
-
- // ********** internal methods **********
-
- private void checkStatus(IStatus status) {
- if (status.isOK()) {
- return;
- }
- if (status.isMultiStatus()) {
- for (IStatus child : status.getChildren()) {
- this.checkStatus(child); // recurse, looking for the first error
- }
- }
- throw new RuntimeException(status.getMessage(), status.getException());
- }
-
- private DTPDatabaseWrapper buildDatabase() {
- return this.isInactive() ? null : new DTPDatabaseWrapper(this, this.buildDTPDatabase());
- }
-
- private org.eclipse.datatools.modelbase.sql.schema.Database buildDTPDatabase() {
- return this.isWorkingOffline() ?
- this.buildOfflineDTPDatabase() :
- this.buildLiveDTPDatabase();
- }
-
- private org.eclipse.datatools.modelbase.sql.schema.Database buildOfflineDTPDatabase() {
- return this.getConnectionInfo().getSharedDatabase();
- }
-
- private ConnectionInfo getConnectionInfo() {
- return (ConnectionInfo) this.dtpManagedConnection.getConnection().getRawConnection();
- }
-
- private org.eclipse.datatools.modelbase.sql.schema.Database buildLiveDTPDatabase() {
- // TODO see DTP bug 202306
- // pass connect=true in to ProfileUtil.getDatabase()
- // there is a bug mentioned in a comment:
- // "during the profile connected event notification,
- // IManagedConnection is connected while IConnectionProfile is not"
- // so, some hackery here to handle hackery there
- return ProfileUtil.getDatabase(new DatabaseIdentifier(this.getName(), this.getDatabaseName()), true);
- }
-
- synchronized void clearDatabase() {
- if (this.database != null) {
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.stopListening();
- }
- this.database = null;
- }
- }
-
- public boolean treatIdentifiersAsDelimited() {
- return this.identifierAdapter.treatIdentifiersAsDelimited();
- }
-
- void databaseChanged(DTPDatabaseWrapper db) {
- this.connectionListener.databaseChanged(db);
- }
-
- void catalogChanged(DTPCatalogWrapper catalog) {
- this.connectionListener.catalogChanged(catalog);
- }
-
- void schemaChanged(DTPSchemaWrapper schema) {
- this.connectionListener.schemaChanged(schema);
- }
-
- void sequenceChanged(DTPSequenceWrapper sequence) {
- this.connectionListener.sequenceChanged(sequence);
- }
-
- void tableChanged(DTPTableWrapper table) {
- this.connectionListener.tableChanged(table);
- }
-
- void columnChanged(DTPColumnWrapper column) {
- this.connectionListener.columnChanged(column);
- }
-
- void foreignKeyChanged(DTPForeignKeyWrapper foreignKey) {
- this.connectionListener.foreignKeyChanged(foreignKey);
- }
-
- private String getProperty(String propertyName) {
- return this.dtpConnectionProfile.getBaseProperties().getProperty(propertyName);
- }
-
-
- // ********** overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-
-
- // ********** DTP connection listener **********
-
- /**
- * This listener translates and forwards
- * {@link org.eclipse.datatools.connectivity.IManagedConnectionListener} and
- * {@link IManagedConnectionOfflineListener} events to
- * {@link ConnectionListener}s. Also, the connection profile delegates to
- * this listener when notifying {@link ConnectionListener}s of changes to
- * the database objects (catalogs, schemata, tables, etc.).
- */
- private class LocalConnectionListener
- implements IManagedConnectionOfflineListener
- {
- private ListenerList<ConnectionListener> listenerList = new ListenerList<ConnectionListener>(ConnectionListener.class);
-
- LocalConnectionListener() {
- super();
- }
-
- void addConnectionListener(ConnectionListener listener) {
- this.listenerList.add(listener);
- }
-
- void removeConnectionListener(ConnectionListener listener) {
- this.listenerList.remove(listener);
- }
-
- boolean hasNoListeners() {
- return this.listenerList.isEmpty();
- }
-
- boolean hasAnyListeners() {
- return ! this.listenerList.isEmpty();
- }
-
-
- // ********** IManagedConnectionListener implementation **********
-
- // off-line or inactive => live
- public void opened(ConnectEvent event) {
- // do not build the database here - it is built on-demand
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.opened(DTPConnectionProfileWrapper.this);
- }
- }
-
- /**
- * This method is never called from the base DTP code.
- * Perhaps DTP extenders call it....
- * See {@link org.eclipse.datatools.connectivity.internal.ManagedConnection#fireModifiedEvent(Object)},
- * which is never called...
- */
- public void modified(ConnectEvent event) {
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.modified(DTPConnectionProfileWrapper.this);
- }
- }
-
- public boolean okToClose(ConnectEvent event) {
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- if ( ! listener.okToClose(DTPConnectionProfileWrapper.this)) {
- return false;
- }
- }
- return true;
- }
-
- public void aboutToClose(ConnectEvent event) {
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.aboutToClose(DTPConnectionProfileWrapper.this);
- }
- }
-
- // live or off-line => inactive
- public void closed(ConnectEvent event) {
- // clear the database
- DTPConnectionProfileWrapper.this.clearDatabase();
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.closed(DTPConnectionProfileWrapper.this);
- }
- }
-
-
- // ********** IManagedConnectionOfflineListener implementation **********
-
- // live => off-line
- public boolean okToDetach(ConnectEvent event) {
- // convert the event to an "ok to close" event;
- // we are "closing" the live connection
- return this.okToClose(event);
- }
-
- // live => off-line
- public void aboutToDetach(ConnectEvent event) {
- // convert the event to a "close" event;
- // we are "closing" the live connection
- this.closed(event);
- }
-
- // inactive or live => off-line
- public void workingOffline(ConnectEvent event) {
- // convert the event to an "open" event;
- // we are "opening" the off-line connection
- this.opened(event);
- }
-
- // off-line => live
- public void aboutToAttach(ConnectEvent event) {
- // convert the event to an "close" event;
- // we are "closing" the off-line connection
- this.closed(event);
- }
-
-
- // ********** internal methods **********
-
- void databaseChanged(DTPDatabaseWrapper db) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.databaseChanged(DTPConnectionProfileWrapper.this, db);
- }
- }
-
- void catalogChanged(DTPCatalogWrapper catalog) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.catalogChanged(DTPConnectionProfileWrapper.this, catalog);
- }
- }
-
- void schemaChanged(DTPSchemaWrapper schema) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.schemaChanged(DTPConnectionProfileWrapper.this, schema);
- }
- }
-
- void sequenceChanged(DTPSequenceWrapper sequence) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.sequenceChanged(DTPConnectionProfileWrapper.this, sequence);
- }
- }
-
- void tableChanged(DTPTableWrapper table) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.tableChanged(DTPConnectionProfileWrapper.this, table);
- }
- }
-
- void columnChanged(DTPColumnWrapper column) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.columnChanged(DTPConnectionProfileWrapper.this, column);
- }
- }
-
- void foreignKeyChanged(DTPForeignKeyWrapper foreignKey) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.foreignKeyChanged(DTPConnectionProfileWrapper.this, foreignKey);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java
deleted file mode 100644
index 57caa3ec82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-
-/**
- * Internal interface: DTP database object.
- */
-interface DTPDatabaseObject
- extends DatabaseObject
-{
- /**
- * covariant override
- */
- DTPConnectionProfileWrapper getConnectionProfile();
-
- /**
- * covariant override
- */
- public DTPDatabaseWrapper getDatabase();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java
deleted file mode 100644
index d498e152f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.datatools.connectivity.sqm.core.rte.RefreshManager;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.internal.driver.DTPDriverAdapter;
-
-/**
- * DTP Object Wrapper base class
- */
-abstract class DTPDatabaseObjectWrapper<P extends DTPDatabaseObject>
- implements DTPDatabaseObject
-{
- /** we need a way to get to the connection profile */
- final P parent;
-
- /** listen for the "catalog object" being refreshed */
- private final ICatalogObjectListener catalogObjectListener;
-
-
- // ********** constructor **********
-
- DTPDatabaseObjectWrapper(P parent) {
- super();
- this.parent = parent;
- if (this.getConnectionProfile().isConnected()) {
- // we only listen to "live" connections (as opposed to "off-line" connections);
- // and the model is rebuilt when the connection connects or disconnects
- this.catalogObjectListener = this.buildCatalogObjectListener();
- if (this.getConnectionProfile().hasAnyListeners()) {
- this.startListening();
- }
- } else {
- this.catalogObjectListener = null;
- }
- }
-
-
- // ********** names vs. identifiers **********
-
- /**
- * Examples:<ul>
- * <li>Oracle etc.<ul><code>
- * <li>Table(FOO) vs. "Foo" => null
- * <li>Table(BAR) vs. "Foo" => "BAR"
- * <li>Table(Foo) vs. "Foo" => "\"Foo\""
- * <li>Table(Bar) vs. "Foo" => "\"Bar\""
- * </code></ul>
- * <li>PostgreSQL etc.<ul><code>
- * <li>Table(foo) vs. "Foo" => null
- * <li>Table(bar) vs. "Foo" => "bar"
- * <li>Table(Foo) vs. "Foo" => "\"Foo\""
- * <li>Table(Bar) vs. "Foo" => "\"Bar\""
- * </code></ul>
- * <li>SQL Server etc.<ul><code>
- * <li>Table(Foo) vs. "Foo" => null
- * <li>Table(foo) vs. "Foo" => "foo"
- * <li>Table(bar) vs. "Foo" => "bar"
- * <li>Table(Bar) vs. "Foo" => "Bar"
- * </code></ul>
- * </ul>
- */
- public String getIdentifier(String defaultName) {
- return this.getDTPDriverAdapter().convertNameToIdentifier(this.getName(), defaultName);
- }
-
- /**
- * Examples:<ul>
- * <li>Oracle etc.<ul><code>
- * <li>Table(FOO) => "FOO"
- * <li>Table(Foo) => "\"Foo\""
- * <li>Table(foo) => "\"foo\""
- * <li>Table(foo++) => "\"foo++\""
- * <li>Table(f"o) => "\"f\"\"o\"" (i.e. "f""o")
- * </code></ul>
- * <li>PostgreSQL etc.<ul><code>
- * <li>Table(FOO) => "\"FOO\""
- * <li>Table(Foo) => "\"Foo\""
- * <li>Table(foo) => "foo"
- * <li>Table(foo++) => "\"foo++\""
- * <li>Table(f"o) => "\"f\"\"o\"" (i.e. "f""o")
- * </code></ul>
- * <li>SQL Server etc.<ul><code>
- * <li>Table(FOO) => "FOO"
- * <li>Table(Foo) => "Foo"
- * <li>Table(foo) => "foo"
- * <li>Table(foo++) => "\"foo++\""
- * <li>Table(f"o) => "\"f\"\"o\"" (i.e. "f""o")
- * </code></ul>
- * <li>MySQL<ul><code>
- * <li>Table(FOO) => "FOO"
- * <li>Table(Foo) => "Foo"
- * <li>Table(foo) => "foo"
- * <li>Table(foo++) => "`foo++`"
- * <li>Table(f"o) => "`f\"o`" (i.e. `f"o`)
- * </code></ul>
- * </ul>
- */
- public String getIdentifier() {
- return this.convertNameToIdentifier(this.getName());
- }
-
- String convertNameToIdentifier(String name) {
- return this.getDTPDriverAdapter().convertNameToIdentifier(name);
- }
-
-
- // ********** DTP database object listener **********
-
- private ICatalogObjectListener buildCatalogObjectListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged(ICatalogObject dmElement, int eventType) {
- if (dmElement == DTPDatabaseObjectWrapper.this.getCatalogObject()) {
- // 'eventType' doesn't seem to be very useful, so drop it
- DTPDatabaseObjectWrapper.this.catalogObjectChanged();
- }
- }
- };
- }
-
- /**
- * Typically, return the wrapped DTP database object.
- */
- abstract ICatalogObject getCatalogObject();
-
- /**
- * Typically, a subclass will override this method to
- * call <code>super.catalogObjectChanged()</code> and
- * notify the connection profile something has changed
- */
- void catalogObjectChanged() {
- this.clear();
- }
-
- /**
- * The DTP object has changed, clear the wrapper's state so it will be
- * synchronized on-demand.
- */
- abstract void clear();
-
- // this should only be called when the connection profile is "live" and has listeners
- void startListening() {
- this.checkListener();
- RefreshManager.getInstance().AddListener(this.getCatalogObject(), this.catalogObjectListener);
- }
-
- // this should only be called when the connection profile is "live" and has no listeners
- void stopListening() {
- this.checkListener();
- RefreshManager.getInstance().removeListener(this.getCatalogObject(), this.catalogObjectListener);
- }
-
- /**
- * We only build {@link #catalogObjectListener} when the connection
- * profile is "live". If we get here and it is <code>null</code>,
- * something is wrong.
- */
- private void checkListener() {
- if (this.catalogObjectListener == null) {
- throw new IllegalStateException("the catalog listener is null"); //$NON-NLS-1$
- }
- }
-
-
- // ********** misc **********
-
- public DTPConnectionProfileWrapper getConnectionProfile() {
- return this.parent.getConnectionProfile();
- }
-
- public DTPDatabaseWrapper getDatabase() {
- return this.parent.getDatabase();
- }
-
- DTPDriverAdapter getDTPDriverAdapter() {
- return this.getDatabase().getDTPDriverAdapter();
- }
-
- /**
- * Convenience method.
- */
- <T extends DatabaseObject> T selectDatabaseObjectNamed(Iterable<T> databaseObjects, String name) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equals(name)) {
- return databaseObject;
- }
- }
- return null;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java
deleted file mode 100644
index ed7d51577a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.internal.core.RDBCorePlugin;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.db.internal.driver.DTPDriverAdapter;
-import org.eclipse.jpt.jpa.db.internal.driver.DTPDriverAdapterManager;
-
-/**
- * Wrap a DTP Database.
- * <p>
- * Catalogs vs. Schemata:<br>
- * Typically, if a DTP database does not support <em>catalogs</em>,
- * o.e.datatools.modelbase.sql.schema.Database#getCatalogs() will return a
- * single catalog without a name (actually, it's an empty string). This catalog
- * will contain all the database's schemata. We try to ignore this catalog and
- * return the schemata from the database directly.
- * <p>
- * Catalog Note 1:<br>
- * As of Jan 2009, the DTP MySQL driver is not consistent with this pattern.
- * A DTP MySQL database has <em>no</em> catalogs; it holds a single schema
- * directly, and that schema has the same name as the database. See bug 249013.
- * <p>
- * Catalog Note 2:<br>
- * As of Jan 2009, the PostgreSQL JDBC driver complicates this pattern a bit.
- * Even though PostgreSQL does not support <em>catalogs</em>, its JDBC driver
- * returns a single catalog that has the same name as the database specified
- * in the JDBC connection URL. The DTP PostgreSQL driver simply replicates this
- * behavior. Unfortunately, this catalog can be unnamed; i.e. its name is an
- * empty string....
- * <p>
- * (Yet Another) Note:<br>
- * We use <em>name</em> when dealing with the unmodified name of a database object
- * as supplied by the database itself (i.e. it is not delimited and it is always
- * case-sensitive).
- * We use <em>identifier</em> when dealing with a string representation of a database
- * object name (i.e. it may be delimited and, depending on the vendor, it may
- * be case-insensitive).
- */
-final class DTPDatabaseWrapper
- extends DTPSchemaContainerWrapper<DTPConnectionProfileWrapper>
- implements Database
-{
- /** the wrapped DTP database */
- private final org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase;
-
- /** database-specific behavior */
- private final DTPDriverAdapter dtpDriverAdapter;
-
- /** lazy-initialized, sorted */
- private DTPCatalogWrapper[] catalogs;
-
-
- // ********** constructor **********
-
- DTPDatabaseWrapper(DTPConnectionProfileWrapper connectionProfile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) {
- super(connectionProfile);
- this.dtpDatabase = dtpDatabase;
- this.dtpDriverAdapter = DTPDriverAdapterManager.instance().buildAdapter(this.getVendorName(), this);
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpDatabase;
- }
-
- /* TODO
- * We might want to listen to the "virtual" catalog; but that's probably
- * not necessary since there is no easy way for the user to refresh it
- * (i.e. it is not displayed in the DTP UI).
- */
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().databaseChanged(this);
- }
-
- @Override
- public DTPDatabaseWrapper getDatabase() {
- return this;
- }
-
-
- // ********** DTPSchemaContainerWrapper implementation **********
-
- @Override
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas() {
- return this.dtpDriverAdapter.getDTPSchemas();
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.getSchema_(dtpSchema);
- }
-
- /**
- * This is only called from a catalog, so we know we have catalogs;
- * i.e. the search has to descend through catalogs, then to schemata.
- */
- DTPSchemaWrapper getSchemaFromCatalogs(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.getCatalog(dtpSchema.getCatalog()).getSchema_(dtpSchema);
- }
-
- /**
- * This is only called from a schema when the database is the schema
- * container, so we know we don't have any catalogs.
- */
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getTable_(dtpTable);
- }
-
- /**
- * This is only called from a catalog, so we know we have catalogs;
- * i.e. the search has to descend through catalogs, then to schemata.
- */
- DTPTableWrapper getTableFromCatalogs(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getCatalog(dtpTable.getSchema().getCatalog()).getTable_(dtpTable);
- }
-
- /**
- * This is only called from a schema when the database is the schema
- * container, so we know we don't have any catalogs.
- */
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getColumn_(dtpColumn);
- }
-
- /**
- * This is only called from a catalog, so we know we have catalogs;
- * i.e. the search has to descend through catalogs, then to schemata.
- */
- DTPColumnWrapper getColumnFromCatalogs(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getCatalog(dtpColumn.getTable().getSchema().getCatalog()).getColumn_(dtpColumn);
- }
-
-
- // ********** catalogs **********
-
- public boolean supportsCatalogs() {
- return this.dtpDriverAdapter.supportsCatalogs();
- }
-
- public Iterable<Catalog> getCatalogs() {
- return new ArrayIterable<Catalog>(this.getCatalogArray());
- }
-
- private Iterable<DTPCatalogWrapper> getCatalogWrappers() {
- return new ArrayIterable<DTPCatalogWrapper>(this.getCatalogArray());
- }
-
- private synchronized DTPCatalogWrapper[] getCatalogArray() {
- if (this.catalogs == null) {
- this.catalogs = this.buildCatalogArray();
- }
- return this.catalogs;
- }
-
- private DTPCatalogWrapper[] buildCatalogArray() {
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.getDTPCatalogs();
- DTPCatalogWrapper[] result = new DTPCatalogWrapper[dtpCatalogs.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPCatalogWrapper(this, dtpCatalogs.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- private List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.dtpDriverAdapter.getDTPCatalogs();
- }
-
- public int getCatalogsSize() {
- return this.getCatalogArray().length;
- }
-
- /**
- * Return the catalog for the specified DTP catalog.
- */
- DTPCatalogWrapper getCatalog(org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- for (DTPCatalogWrapper catalog : this.getCatalogArray()) {
- if (catalog.wraps(dtpCatalog)) {
- return catalog;
- }
- }
- throw new IllegalArgumentException("invalid DTP catalog: " + dtpCatalog); //$NON-NLS-1$
- }
-
- public Iterable<String> getSortedCatalogNames() {
- // the catalogs are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getCatalogWrappers(), NAME_TRANSFORMER);
- }
-
- public DTPCatalogWrapper getCatalogNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getCatalogWrappers(), name);
- }
-
- public Iterable<String> getSortedCatalogIdentifiers() {
- // the catalogs are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getCatalogWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Catalog getCatalogForIdentifier(String identifier) {
- return this.dtpDriverAdapter.selectCatalogForIdentifier(this.getCatalogs(), identifier);
- }
-
- public synchronized DTPCatalogWrapper getDefaultCatalog() {
- return this.getCatalogForNames(this.getDefaultCatalogNames());
- }
-
- private Iterable<String> getDefaultCatalogNames() {
- return this.dtpDriverAdapter.getDefaultCatalogNames();
- }
-
- /**
- * Return the first catalog found.
- */
- private DTPCatalogWrapper getCatalogForNames(Iterable<String> names) {
- for (String name : names) {
- DTPCatalogWrapper catalog = this.getCatalogNamed(name);
- if (catalog != null) {
- return catalog;
- }
- }
- return null;
- }
-
- /**
- * If we find a default catalog, return its identifier;
- * otherwise, return the last name on the list of default names.
- * (Some databases have multiple possible default names.)
- * Return null if the database does not support catalogs.
- */
- public synchronized String getDefaultCatalogIdentifier() {
- Iterable<String> names = this.getDefaultCatalogNames();
- DTPCatalogWrapper catalog = this.getCatalogForNames(names);
- if (catalog != null) {
- return catalog.getIdentifier();
- }
- Iterator<String> stream = names.iterator();
- return stream.hasNext() ? this.convertNameToIdentifier(CollectionTools.last(stream)) : null;
- }
-
-
- // ********** names vs. identifiers **********
-
- // override to make method public since it's in the Database interface
- @Override
- public String convertNameToIdentifier(String name) {
- return super.convertNameToIdentifier(name);
- }
-
-
- // ********** misc **********
-
- public org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase() {
- return this.dtpDatabase;
- }
-
- public String getName() {
- return this.dtpDatabase.getName();
- }
-
- public String getVendorName() {
- return this.dtpDatabase.getVendor();
- }
-
- public String getVersion() {
- return this.dtpDatabase.getVersion();
- }
-
- @Override
- DTPDriverAdapter getDTPDriverAdapter() {
- return this.dtpDriverAdapter;
- }
-
- public Table selectTableForIdentifier(Iterable<Table> tables, String identifier) {
- return this.dtpDriverAdapter.selectTableForIdentifier(tables, identifier);
- }
-
- // TODO add to interface? (so it can be used by AbstractDTPDriverAdapter)
- DatabaseDefinition getDTPDefinition() {
- return RDBCorePlugin.getDefault().getDatabaseDefinitionRegistry().getDefinition(this.dtpDatabase);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.catalogs != null) {
- this.startCatalogs();
- }
- super.startListening();
- }
-
- private void startCatalogs() {
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.catalogs != null) {
- this.stopCatalogs();
- }
- super.stopListening();
- }
-
- private void stopCatalogs() {
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.catalogs != null) {
- this.clearCatalogs();
- }
- super.clear();
- }
-
- private void clearCatalogs() {
- this.stopCatalogs();
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.clear();
- }
- this.catalogs = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java
deleted file mode 100644
index 3a341c636f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-
-/**
- * Wrap a DTP ForeignKey
- */
-final class DTPForeignKeyWrapper
- extends DTPDatabaseObjectWrapper<DTPTableWrapper>
- implements ForeignKey
-{
- /** the wrapped DTP foreign key */
- private final org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey;
-
- /** lazy-initialized */
- private DTPTableWrapper referencedTable;
-
- /** lazy-initialized */
- private LocalColumnPair[] columnPairs;
-
- /** lazy-initialized - but it can be 'null' so we use a flag */
- private String defaultAttributeName;
- private boolean defaultAttributeNameCalculated = false;
-
-
- // ********** constructor **********
-
- DTPForeignKeyWrapper(DTPTableWrapper baseTable, org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey) {
- super(baseTable);
- this.dtpForeignKey = dtpForeignKey;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpForeignKey;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().foreignKeyChanged(this);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName() + ": " + Arrays.asList(this.getColumnPairArray())); //$NON-NLS-1$
- }
-
-
- // ********** ForeignKey implementation **********
-
- public String getName() {
- return this.dtpForeignKey.getName();
- }
-
- public DTPTableWrapper getBaseTable() {
- return this.parent;
- }
-
- public synchronized DTPTableWrapper getReferencedTable() {
- if (this.referencedTable == null) {
- this.referencedTable = this.getBaseTable().getTable(this.dtpForeignKey.getUniqueConstraint().getBaseTable());
- }
- return this.referencedTable;
- }
-
- public boolean referencesSingleColumnPrimaryKey() {
- if (this.getColumnPairsSize() != 1) {
- return false;
- }
- if (this.getReferencedTable().getPrimaryKeyColumnsSize() != 1) {
- return false;
- }
- return this.getColumnPair().getReferencedColumn() == this.getReferencedTable().getPrimaryKeyColumn();
- }
-
- // ***** column pairs
-
- public Iterable<ColumnPair> getColumnPairs() {
- return new ArrayIterable<ColumnPair>(this.getColumnPairArray());
- }
-
- public LocalColumnPair getColumnPair() {
- LocalColumnPair[] pairs = this.getColumnPairArray();
- if (pairs.length != 1) {
- throw new IllegalStateException("multiple column pairs: " + pairs.length); //$NON-NLS-1$
- }
- return pairs[0];
- }
-
- private Iterable<LocalColumnPair> getLocalColumnPairs() {
- return new ArrayIterable<LocalColumnPair>(this.getColumnPairArray());
- }
-
- private synchronized LocalColumnPair[] getColumnPairArray() {
- if (this.columnPairs == null) {
- this.columnPairs = this.buildColumnPairArray();
- }
- return this.columnPairs;
- }
-
- private LocalColumnPair[] buildColumnPairArray() {
- List<org.eclipse.datatools.modelbase.sql.tables.Column> baseColumns = this.getDTPBaseColumns();
- int size = baseColumns.size();
- List<org.eclipse.datatools.modelbase.sql.tables.Column> refColumns = this.getDTPReferenceColumns();
- if (refColumns.size() != size) {
- throw new IllegalStateException(this.getBaseTable().getName() + '.' + this.getName() +
- " - mismatched sizes: " + size + " vs. " + refColumns.size()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- LocalColumnPair[] result = new LocalColumnPair[baseColumns.size()];
- for (int i = baseColumns.size(); i-- > 0; ) {
- result[i] = new LocalColumnPair(
- this.getBaseTable().getColumn(baseColumns.get(i)),
- this.getBaseTable().getColumn(refColumns.get(i))
- );
- }
- return ArrayTools.sort(result, ColumnPair.BASE_COLUMN_COMPARATOR);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPBaseColumns() {
- return this.dtpForeignKey.getMembers();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPReferenceColumns() {
- return this.dtpForeignKey.getUniqueConstraint().getMembers();
- }
-
- public int getColumnPairsSize() {
- return this.getColumnPairArray().length;
- }
-
- public Iterable<Column> getBaseColumns() {
- return new TransformationIterable<LocalColumnPair, Column>(this.getLocalColumnPairs()) {
- @Override
- protected Column transform(LocalColumnPair pair) {
- return pair.getBaseColumn();
- }
- };
- }
-
- boolean baseColumnsContains(Column column) {
- return CollectionTools.contains(this.getBaseColumns(), column);
- }
-
- public Iterable<Column> getNonPrimaryKeyBaseColumns() {
- return new FilteringIterable<Column>(this.getBaseColumns()) {
- @Override
- protected boolean accept(Column column) {
- return ! column.isPartOfPrimaryKey();
- }
- };
- }
-
- public Iterable<Column> getReferencedColumns() {
- return new TransformationIterable<LocalColumnPair, Column>(this.getLocalColumnPairs()) {
- @Override
- protected Column transform(LocalColumnPair columnPair) {
- return columnPair.getReferencedColumn();
- }
- };
- }
-
- // ***** attribute name
-
- public String getAttributeName() {
- String defaultName = this.getDefaultAttributeName();
- return (defaultName != null) ? defaultName : this.getNonDefaultAttributeName();
- }
-
- public synchronized String getDefaultAttributeName() {
- if ( ! this.defaultAttributeNameCalculated) {
- this.defaultAttributeNameCalculated = true;
- this.defaultAttributeName = this.buildDefaultAttributeName();
- }
- return this.defaultAttributeName;
- }
-
- private String buildDefaultAttributeName() {
- if ( ! this.referencesSingleColumnPrimaryKey()) {
- return null;
- }
- LocalColumnPair columnPair = this.getColumnPair();
- String baseColName = columnPair.getBaseColumn().getName();
- String refColName = columnPair.getReferencedColumn().getName();
- if (baseColName.length() <= (refColName.length() + 1)) {
- return null;
- }
- if ( ! baseColName.endsWith(refColName)) {
- return null;
- }
- int _index = baseColName.length() - refColName.length() - 1;
- if (baseColName.charAt(_index) != '_') {
- return null;
- }
- return baseColName.substring(0, _index);
- }
-
- /**
- * If this is a simple (single-column) foreign key, use the name of the
- * single base column to build a name. If this is a compound foreign key,
- * return the name of the referenced table.
- */
- // TODO if there is only one FK to a given table, use the table's name instead of the column's name?
- private String getNonDefaultAttributeName() {
- return (this.getColumnPairsSize() == 1) ?
- this.getNonDefaultAttributeNameFromBaseColumn() :
- this.getReferencedTable().getName();
- }
-
- /**
- * The underscore check is helpful when the referenced column is <em>not</em> the
- * primary key of the referenced table (i.e. it has only a <em>unique</em> constraint).
- * <pre>
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLEID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLE_PK => CUBICLE.ID) => "CUBICLE_PK"
- * </pre>
- */
- private String getNonDefaultAttributeNameFromBaseColumn() {
- LocalColumnPair columnPair = this.getColumnPair();
- String baseColName = columnPair.getBaseColumn().getName();
- String refColName = columnPair.getReferencedColumn().getName();
- int len = baseColName.length();
- int refLen = refColName.length();
- if ((len > refLen) && baseColName.endsWith(refColName)) {
- len = len - refLen;
- if ((len > 1) && baseColName.charAt(len - 1) == '_') {
- len = len - 1;
- }
- }
- return baseColName.substring(0, len);
- }
-
- /**
- * Examples:<ul>
- * <li>Oracle etc.<ul><code>
- * <li>ForeignKey(FOO_ID => ID) vs. "foo" => null
- * <li>ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * <li>ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * <li>ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- * </code></ul>
- * <li>PostgreSQL etc.<ul><code>
- * <li>ForeignKey(foo_id => id) vs. "foo" => null
- * <li>ForeignKey(foo_id => foo_id) vs. "foo" => "foo_id"
- * <li>ForeignKey(foo => id) vs. "foo" => "foo"
- * <li>ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- * </code></ul>
- * <li>SQL Server etc.<ul><code>
- * <li>ForeignKey(foo_ID => ID) vs. "foo" => null
- * <li>ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * <li>ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * <li>ForeignKey(Foo_ID => ID) vs. "foo" => "Foo_ID"
- * </code></ul>
- * </ul>
- */
- public String getJoinColumnAnnotationIdentifier(String attributeName) {
- String baseColumnName = this.getColumnPair().getBaseColumn().getName();
- String defaultBaseColumnName = attributeName + '_' + this.getReferencedTable().getPrimaryKeyColumn().getName();
- return this.getDTPDriverAdapter().convertNameToIdentifier(baseColumnName, defaultBaseColumnName);
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.constraints.ForeignKey foreignKey) {
- return this.dtpForeignKey == foreignKey;
- }
-
- @Override
- synchronized void clear() {
- // the foreign key does not "contain" any other objects,
- // so we don't need to forward the #clear()
- this.defaultAttributeNameCalculated = false;
- this.defaultAttributeName = null;
- this.columnPairs = null;
- this.referencedTable = null;
- }
-
-
- // ********** column pair implementation **********
-
- static class LocalColumnPair implements ColumnPair {
- private final DTPColumnWrapper baseColumn;
- private final DTPColumnWrapper referencedColumn;
-
- LocalColumnPair(DTPColumnWrapper baseColumn, DTPColumnWrapper referencedColumn) {
- super();
- if ((baseColumn == null) || (referencedColumn == null)) {
- throw new NullPointerException();
- }
- this.baseColumn = baseColumn;
- this.referencedColumn = referencedColumn;
- }
-
- public DTPColumnWrapper getBaseColumn() {
- return this.baseColumn;
- }
-
- public DTPColumnWrapper getReferencedColumn() {
- return this.referencedColumn;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.baseColumn.getName() + "=>" + this.referencedColumn.getName()); //$NON-NLS-1$
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java
deleted file mode 100644
index 46d0f6a4c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-
-/**
- * Coalesce behavior for a schema container (i.e. database or catalog).
- */
-abstract class DTPSchemaContainerWrapper<P extends DTPDatabaseObject>
- extends DTPDatabaseObjectWrapper<P>
- implements SchemaContainer
-{
- /** lazy-initialized */
- private DTPSchemaWrapper[] schemata;
-
-
- // ********** constructor **********
-
- DTPSchemaContainerWrapper(P parent) {
- super(parent);
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- }
-
-
- // ********** abstract methods **********
-
- /**
- * Return the schema container's DTP schemas.
- */
- abstract List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas();
-
- /**
- * Return the schema for the specified DTP schema.
- */
- abstract DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema);
-
- /**
- * Pre-condition: The schema container (database or catalog) contains
- * the specified schema.
- */
- DTPSchemaWrapper getSchema_(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- for (DTPSchemaWrapper schema : this.getSchemaArray()) {
- if (schema.wraps(dtpSchema)) {
- return schema;
- }
- }
- throw new IllegalArgumentException("invalid DTP schema: " + dtpSchema); //$NON-NLS-1$
- }
-
- /**
- * Return the table for the specified DTP table.
- * This is only called from a schema (to its container).
- */
- abstract DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable);
-
- /**
- * Pre-condition: The schema container contains the specified table.
- */
- DTPTableWrapper getTable_(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getSchema_(dtpTable.getSchema()).getTable_(dtpTable);
- }
-
- /**
- * Return the column for the specified DTP column.
- * This is only called from a schema (to its container).
- */
- abstract DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn);
-
- /**
- * Pre-condition: The schema container contains the specified column.
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getTable_(dtpColumn.getTable()).getColumn_(dtpColumn);
- }
-
-
- // ********** schemata **********
-
- public Iterable<Schema> getSchemata() {
- return new ArrayIterable<Schema>(this.getSchemaArray());
- }
-
- Iterable<DTPSchemaWrapper> getSchemaWrappers() {
- return new ArrayIterable<DTPSchemaWrapper>(this.getSchemaArray());
- }
-
- synchronized DTPSchemaWrapper[] getSchemaArray() {
- if (this.schemata == null) {
- this.schemata = this.buildSchemaArray();
- }
- return this.schemata;
- }
-
- private DTPSchemaWrapper[] buildSchemaArray() {
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata = this.getDTPSchemas();
- DTPSchemaWrapper[] result = new DTPSchemaWrapper[dtpSchemata.size()];
- for (int i = result.length; i-- > 0; ) {
- result[i] = new DTPSchemaWrapper(this, dtpSchemata.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- public int getSchemataSize() {
- return this.getSchemaArray().length;
- }
-
- public Iterable<String> getSortedSchemaNames() {
- // the schemata are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getSchemaWrappers(), NAME_TRANSFORMER);
- }
-
- public DTPSchemaWrapper getSchemaNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSchemaWrappers(), name);
- }
-
- public Iterable<String> getSortedSchemaIdentifiers() {
- // the schemata are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getSchemaWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Schema getSchemaForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectSchemaForIdentifier(this.getSchemata(), identifier);
- }
-
- public DTPSchemaWrapper getDefaultSchema() {
- return this.getSchemaForNames(this.getDTPDriverAdapter().getDefaultSchemaNames());
- }
-
- /**
- * Return the first schema found.
- */
- DTPSchemaWrapper getSchemaForNames(Iterable<String> names) {
- for (String name : names) {
- DTPSchemaWrapper schema = this.getSchemaNamed(name);
- if (schema != null) {
- return schema;
- }
- }
- return null;
- }
-
- /**
- * If we find a default schema, return its identifier;
- * otherwise, return the last name on the list of default names.
- * (Some containers have multiple possible default names.)
- */
- public synchronized String getDefaultSchemaIdentifier() {
- Iterable<String> names = this.getDTPDriverAdapter().getDefaultSchemaNames();
- DTPSchemaWrapper schema = this.getSchemaForNames(names);
- // assume 'names' is non-empty (!)
- return (schema != null) ?
- schema.getIdentifier() :
- this.convertNameToIdentifier(CollectionTools.last(names));
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.schemata != null) {
- this.startSchemata();
- }
- super.startListening();
- }
-
- private void startSchemata() {
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.schemata != null) {
- this.stopSchemata();
- }
- super.stopListening();
- }
-
- private void stopSchemata() {
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.schemata != null) {
- this.clearSchemata();
- }
- }
-
- private void clearSchemata() {
- this.stopSchemata();
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.clear();
- }
- this.schemata = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java
deleted file mode 100644
index ddc7040902..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.modelbase.sql.tables.SQLTablesPackage;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Wrap a DTP Schema
- */
-final class DTPSchemaWrapper
- extends DTPDatabaseObjectWrapper<DTPSchemaContainerWrapper<?>>
- implements Schema
-{
- /** the wrapped DTP schema */
- private final org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema;
-
- /** lazy-initialized */
- private DTPTableWrapper[] tables;
-
- /** lazy-initialized */
- private DTPSequenceWrapper[] sequences;
-
-
- // ********** constants **********
-
- /** used for adopter product customization */
- private static final String PERSISTENT_AND_VIEW_TABLES_ONLY = "supportPersistentAndViewTablesOnly"; //$NON-NLS-1$
-
-
- // ********** constructor **********
-
- DTPSchemaWrapper(DTPSchemaContainerWrapper<?> container, org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- super(container);
- this.dtpSchema = dtpSchema;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpSchema;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().schemaChanged(this);
- }
-
-
- // ********** Schema implementation **********
-
- public String getName() {
- return this.dtpSchema.getName();
- }
-
- public DTPSchemaContainerWrapper<?> getContainer() {
- return this.parent;
- }
-
- // ***** tables
-
- public Iterable<Table> getTables() {
- return new ArrayIterable<Table>(this.getTableArray());
- }
-
- private Iterable<DTPTableWrapper> getTableWrappers() {
- return new ArrayIterable<DTPTableWrapper>(this.getTableArray());
- }
-
- private synchronized DTPTableWrapper[] getTableArray() {
- if (this.tables == null) {
- this.tables = this.buildTableArray();
- }
- return this.tables;
- }
-
- private DTPTableWrapper[] buildTableArray() {
- List<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables = this.getDTPTables();
- DTPTableWrapper[] result = new DTPTableWrapper[dtpTables.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPTableWrapper(this, dtpTables.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> getDTPTables() {
- List<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables = this.getDTPTables_();
- return this.hack() ? this.hack(dtpTables) : dtpTables;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> getDTPTables_() {
- return this.dtpSchema.getTables();
- }
-
- private boolean hack() {
- // the product is null during junit testing
- IProduct product = Platform.getProduct();
- String hack = (product == null) ? null : product.getProperty(PERSISTENT_AND_VIEW_TABLES_ONLY);
- return (hack != null) && hack.equals("true"); //$NON-NLS-1$
- }
-
- // provides a mechanism for DTP extenders that support synonyms but don't want to have them appear
- // in Dali to filter out these table types from Dali
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> hack(List<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables) {
- List<org.eclipse.datatools.modelbase.sql.tables.Table> result = new ArrayList<org.eclipse.datatools.modelbase.sql.tables.Table>();
- for (org.eclipse.datatools.modelbase.sql.tables.Table dtpTable : dtpTables) {
- if (this.hack(dtpTable)) {
- result.add(dtpTable);
- }
- }
- return result;
- }
-
- private boolean hack(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return SQLTablesPackage.eINSTANCE.getPersistentTable().isSuperTypeOf(dtpTable.eClass()) ||
- SQLTablesPackage.eINSTANCE.getViewTable().isSuperTypeOf(dtpTable.eClass());
- }
-
- public int getTablesSize() {
- return this.getTableArray().length;
- }
-
- /**
- * return the table for the specified DTP table
- */
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- // try to short-circuit the search
- return this.wraps(dtpTable.getSchema()) ?
- this.getTable_(dtpTable) :
- this.getContainer().getTable(dtpTable);
- }
-
- /**
- * assume the schema contains the specified table
- */
- DTPTableWrapper getTable_(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- for (DTPTableWrapper table : this.getTableArray()) {
- if (table.wraps(dtpTable)) {
- return table;
- }
- }
- throw new IllegalArgumentException("invalid DTP table: " + dtpTable); //$NON-NLS-1$
- }
-
- public DTPTableWrapper getTableNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getTableWrappers(), name);
- }
-
- public Iterable<String> getSortedTableIdentifiers() {
- // the tables are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getTableWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Table getTableForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectTableForIdentifier(this.getTables(), identifier);
- }
-
- // ***** sequences
-
- public Iterable<Sequence> getSequences() {
- return new ArrayIterable<Sequence>(this.getSequenceArray());
- }
-
- private Iterable<DTPSequenceWrapper> getSequenceWrappers() {
- return new ArrayIterable<DTPSequenceWrapper>(this.getSequenceArray());
- }
-
- private synchronized DTPSequenceWrapper[] getSequenceArray() {
- if (this.sequences == null) {
- this.sequences = this.buildSequenceArray();
- }
- return this.sequences;
- }
-
- private DTPSequenceWrapper[] buildSequenceArray() {
- List<org.eclipse.datatools.modelbase.sql.schema.Sequence> dtpSequences = this.getDTPSequences();
- DTPSequenceWrapper[] result = new DTPSequenceWrapper[dtpSequences.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPSequenceWrapper(this, dtpSequences.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.schema.Sequence> getDTPSequences() {
- return this.dtpSchema.getSequences();
- }
-
- public int getSequencesSize() {
- return this.getSequenceArray().length;
- }
-
- public DTPSequenceWrapper getSequenceNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSequenceWrappers(), name);
- }
-
- public Iterable<String> getSortedSequenceIdentifiers() {
- // the sequences are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getSequenceWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Sequence getSequenceForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectSequenceForIdentifier(this.getSequences(), identifier);
- }
-
- // ***** refresh
-
- public void refresh() {
-
- this.getCatalogObject().refresh();
- }
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Schema schema) {
- return this.dtpSchema == schema;
- }
-
- /**
- * Return the column for the specified DTP column.
- */
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- // try to short-circuit the search
- return this.wraps(dtpColumn.getTable().getSchema()) ?
- this.getColumn_(dtpColumn) :
- this.getContainer().getColumn(dtpColumn);
- }
-
- /**
- * Assume the schema contains the specified column.
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getTable_(dtpColumn.getTable()).getColumn_(dtpColumn);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.sequences != null) {
- this.startSequences();
- }
- if (this.tables != null) {
- this.startTables();
- }
- super.startListening();
- }
-
- private void startSequences() {
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.startListening();
- }
- }
-
- private void startTables() {
- for (DTPTableWrapper table : this.tables) {
- table.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.sequences != null) {
- this.stopSequences();
- }
- if (this.tables != null) {
- this.stopTables();
- }
- super.stopListening();
- }
-
- private void stopSequences() {
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.stopListening();
- }
- }
-
- private void stopTables() {
- for (DTPTableWrapper table : this.tables) {
- table.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.sequences != null) {
- this.clearSequences();
- }
- if (this.tables != null) {
- this.clearTables();
- }
- }
-
- private void clearSequences() {
- this.stopSequences();
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.clear();
- }
- this.sequences = null;
- }
-
- private void clearTables() {
- this.stopTables();
- for (DTPTableWrapper table : this.tables) {
- table.clear();
- }
- this.tables = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java
deleted file mode 100644
index 49114e051d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Sequence;
-
-/**
- * Wrap a DTP Sequence
- */
-final class DTPSequenceWrapper
- extends DTPDatabaseObjectWrapper<DTPSchemaWrapper>
- implements Sequence
-{
- /** the wrapped DTP sequence */
- private final org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence;
-
-
- // ********** constructor **********
-
- DTPSequenceWrapper(DTPSchemaWrapper schema, org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence) {
- super(schema);
- this.dtpSequence = dtpSequence;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpSequence;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().sequenceChanged(this);
- }
-
-
- // ********** Sequence implementation **********
-
- public String getName() {
- return this.dtpSequence.getName();
- }
-
- public DTPSchemaWrapper getSchema() {
- return this.parent;
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Sequence sequence) {
- return this.dtpSequence == sequence;
- }
-
- @Override
- void clear() {
- // no state to clear
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java
deleted file mode 100644
index a7a58c595f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.modelbase.sql.constraints.PrimaryKey;
-import org.eclipse.datatools.modelbase.sql.tables.BaseTable;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Wrap a DTP Table
- */
-final class DTPTableWrapper
- extends DTPDatabaseObjectWrapper<DTPSchemaWrapper>
- implements Table
-{
- /** the wrapped DTP table */
- private final org.eclipse.datatools.modelbase.sql.tables.Table dtpTable;
-
- /** lazy-initialized */
- private DTPColumnWrapper[] columns;
-
- /** lazy-initialized */
- private DTPColumnWrapper[] primaryKeyColumns;
-
- /** lazy-initialized */
- private DTPForeignKeyWrapper[] foreignKeys;
-
-
- private static final DTPColumnWrapper[] EMPTY_COLUMNS = new DTPColumnWrapper[0];
- private static final DTPForeignKeyWrapper[] EMPTY_FOREIGN_KEYS = new DTPForeignKeyWrapper[0];
-
-
- // ********** constructor **********
-
- DTPTableWrapper(DTPSchemaWrapper schema, org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- super(schema);
- this.dtpTable = dtpTable;
- }
-
-
- // ********** columns **********
-
- public Iterable<Column> getColumns() {
- return new ArrayIterable<Column>(this.getColumnArray());
- }
-
- private Iterable<DTPColumnWrapper> getColumnWrappers() {
- return new ArrayIterable<DTPColumnWrapper>(this.getColumnArray());
- }
-
- private synchronized DTPColumnWrapper[] getColumnArray() {
- if (this.columns == null) {
- this.columns = this.buildColumnArray();
- }
- return this.columns;
- }
-
- private DTPColumnWrapper[] buildColumnArray() {
- List<org.eclipse.datatools.modelbase.sql.tables.Column> dtpColumns = this.getDTPColumns();
- DTPColumnWrapper[] result = new DTPColumnWrapper[dtpColumns.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPColumnWrapper(this, dtpColumns.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPColumns() {
- return this.dtpTable.getColumns();
- }
-
- public int getColumnsSize() {
- return this.getColumnArray().length;
- }
-
- public DTPColumnWrapper getColumnNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getColumnWrappers(), name);
- }
-
- /**
- * Return the column for the specified DTP column.
- */
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- // try to short-circuit the search
- return this.wraps(dtpColumn.getTable()) ?
- this.getColumn_(dtpColumn) :
- this.getSchema().getColumn(dtpColumn);
- }
-
- /**
- * Pre-condition: The table contains the specified column.
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- for (DTPColumnWrapper column : this.getColumnArray()) {
- if (column.wraps(dtpColumn)) {
- return column;
- }
- }
- throw new IllegalArgumentException("invalid DTP column: " + dtpColumn); //$NON-NLS-1$
- }
-
- public Iterable<String> getSortedColumnIdentifiers() {
- // the columns are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getColumnWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Column getColumnForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectColumnForIdentifier(this.getColumns(), identifier);
- }
-
-
- // ********** primary key columns **********
-
- public Iterable<Column> getPrimaryKeyColumns() {
- return new ArrayIterable<Column>(this.getPrimaryKeyColumnArray());
- }
-
- public DTPColumnWrapper getPrimaryKeyColumn() {
- DTPColumnWrapper[] pkColumns = this.getPrimaryKeyColumnArray();
- if (pkColumns.length != 1) {
- throw new IllegalStateException("multiple primary key columns: " + pkColumns.length); //$NON-NLS-1$
- }
- return pkColumns[0];
- }
-
- private synchronized DTPColumnWrapper[] getPrimaryKeyColumnArray() {
- if (this.primaryKeyColumns == null) {
- this.primaryKeyColumns = this.buildPrimaryKeyColumnArray();
- }
- return this.primaryKeyColumns;
- }
-
- private DTPColumnWrapper[] buildPrimaryKeyColumnArray() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return EMPTY_COLUMNS;
- }
- PrimaryKey pk = ((BaseTable) this.dtpTable).getPrimaryKey();
- if (pk == null) {
- // no PK was defined
- return EMPTY_COLUMNS;
- }
- List<org.eclipse.datatools.modelbase.sql.tables.Column> pkColumns = this.getColumns(pk);
- DTPColumnWrapper[] result = new DTPColumnWrapper[pkColumns.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = this.getColumn(pkColumns.get(i));
- }
- return result;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getColumns(PrimaryKey pk) {
- return pk.getMembers();
- }
-
- public int getPrimaryKeyColumnsSize() {
- return this.getPrimaryKeyColumnArray().length;
- }
-
- boolean primaryKeyColumnsContains(Column column) {
- return ArrayTools.contains(this.getPrimaryKeyColumnArray(), column);
- }
-
-
- // ********** foreign keys **********
-
- public Iterable<ForeignKey> getForeignKeys() {
- return new ArrayIterable<ForeignKey>(this.getForeignKeyArray());
- }
-
- private synchronized DTPForeignKeyWrapper[] getForeignKeyArray() {
- if (this.foreignKeys == null) {
- this.foreignKeys = this.buildForeignKeyArray();
- }
- return this.foreignKeys;
- }
-
- private DTPForeignKeyWrapper[] buildForeignKeyArray() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return EMPTY_FOREIGN_KEYS;
- }
- List<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> dtpForeignKeys = this.getDTPForeignKeys();
- DTPForeignKeyWrapper[] result = new DTPForeignKeyWrapper[dtpForeignKeys.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPForeignKeyWrapper(this, dtpForeignKeys.get(i));
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> getDTPForeignKeys() {
- return ((BaseTable) this.dtpTable).getForeignKeys();
- }
-
- public int getForeignKeysSize() {
- return this.getForeignKeyArray().length;
- }
-
- /**
- * return whether the specified column is a base column for at least one
- * of the the table's foreign keys
- */
- boolean foreignKeyBaseColumnsContains(Column column) {
- for (DTPForeignKeyWrapper fkWrapper : this.getForeignKeyArray()) {
- if (fkWrapper.baseColumnsContains(column)) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** join table **********
-
- public boolean isPossibleJoinTable() {
- if (this.getForeignKeyArray().length != 2) {
- return false; // the table must have exactly 2 foreign keys
- }
- for (Column column : this.getColumns()) {
- if ( ! this.foreignKeyBaseColumnsContains(column)) {
- return false; // all the table's columns must belong to one (or both) of the 2 foreign keys
- }
- }
- return true;
- }
-
- /**
- * If the table name is <code>FOO_BAR</code>
- * and it joins tables <code>FOO</code> and <code>BAR</code>,
- * return the foreign key to <code>FOO</code>;
- * if the table name is <code>BAR_FOO</code>
- * and it joins tables <code>FOO</code> and <code>BAR</code>,
- * return the foreign key to <code>BAR</code>;
- * otherwise simply return the first foreign key in the array.
- */
- public ForeignKey getJoinTableOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeyArray()[0];
- String name0 = fk0.getReferencedTable().getName();
-
- ForeignKey fk1 = this.getForeignKeyArray()[1];
- String name1 = fk1.getReferencedTable().getName();
-
- return this.getName().equals(name1 + '_' + name0) ? fk1 : fk0;
- }
-
- public ForeignKey getJoinTableNonOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeyArray()[0];
- ForeignKey fk1 = this.getForeignKeyArray()[1];
- ForeignKey ofk = this.getJoinTableOwningForeignKey();
- return (ofk == fk0) ? fk1 : fk0;
- }
-
- /**
- * Hmmm....
- * We might want to go to the platform to allow a vendor-specific
- * comparison here;
- * but, since all the names are coming directly from the database
- * (i.e. there are no conversions to Java identifiers etc.), it seems
- * like we can just compare them directly and ignore case-sensitivity
- * issues.... ~bjv
- */
- public boolean joinTableNameIsDefault() {
- return this.getName().equals(this.buildDefaultJoinTableName());
- }
-
- private String buildDefaultJoinTableName() {
- return this.getJoinTableOwningTable().getName()
- + '_'
- + this.getJoinTableNonOwningTable().getName();
- }
-
- private Table getJoinTableOwningTable() {
- return this.getJoinTableOwningForeignKey().getReferencedTable();
- }
-
- private Table getJoinTableNonOwningTable() {
- return this.getJoinTableNonOwningForeignKey().getReferencedTable();
- }
-
-
- // ********** misc **********
-
- public DTPSchemaWrapper getSchema() {
- return this.parent;
- }
-
- public String getName() {
- return this.dtpTable.getName();
- }
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpTable;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().tableChanged(this);
- }
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- return this.dtpTable == table;
- }
-
- /**
- * Return the table for the specified DTP table.
- */
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- // try to short-circuit the search
- return this.wraps(table) ? this : this.getSchema().getTable(table);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.foreignKeys != null) {
- this.startForeignKeys();
- }
- if (this.columns != null) {
- this.startColumns();
- }
- super.startListening();
- }
-
- private void startForeignKeys() {
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.startListening();
- }
- }
-
- private void startColumns() {
- for (DTPColumnWrapper column : this.columns) {
- column.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.foreignKeys != null) {
- this.stopForeignKeys();
- }
- if (this.columns != null) {
- this.stopColumns();
- }
- super.stopListening();
- }
-
- private void stopForeignKeys() {
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.stopListening();
- }
- }
-
- private void stopColumns() {
- for (DTPColumnWrapper column : this.columns) {
- column.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.foreignKeys != null) {
- this.clearForeignKeys();
- }
-
- // the table does not "contain" the pk columns, so no need to forward #clear()
- this.primaryKeyColumns = null;
-
- if (this.columns != null) {
- this.clearColumns();
- }
- }
-
- private void clearForeignKeys() {
- this.stopForeignKeys();
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.clear();
- }
- this.foreignKeys = null;
- }
-
- private void clearColumns() {
- this.stopColumns();
- for (DTPColumnWrapper column : this.columns) {
- column.clear();
- }
- this.columns = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java
deleted file mode 100644
index 6a3e845164..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
-import org.eclipse.datatools.connectivity.sqm.internal.core.RDBCorePlugin;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ResultSetIterator;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Consolidate the behavior common to the typical DTP drivers.
- *
- * @see Unknown
- */
-abstract class AbstractDTPDriverAdapter
- implements DTPDriverAdapter
-{
- /**
- * The Dali database that wraps the corresponding DTP database.
- */
- final Database database;
-
- /**
- * DTP drivers return catalogs and schemata in a variety of ways....
- */
- final CatalogStrategy catalogStrategy;
-
- /**
- * The SQL spec says a <em>regular</em> (non-delimited) identifier should be
- * folded to uppercase; but some databases do otherwise (e.g. Sybase).
- */
- final FoldingStrategy foldingStrategy;
-
-
- AbstractDTPDriverAdapter(Database database) {
- super();
- this.database = database;
- this.catalogStrategy = this.buildCatalogStrategy();
- this.foldingStrategy = this.buildFoldingStrategy();
- }
-
- abstract CatalogStrategy buildCatalogStrategy();
-
- abstract FoldingStrategy buildFoldingStrategy();
-
-
- // ********** catalogs **********
-
- public boolean supportsCatalogs() {
- return this.catalogStrategy.supportsCatalogs();
- }
-
- public List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.catalogStrategy.getCatalogs();
- }
-
- /**
- * Typically, the name of the default catalog is the user name.
- */
- public final Iterable<String> getDefaultCatalogNames() {
- return this.supportsCatalogs() ? this.getDefaultCatalogNames_() : Collections.<String>emptyList();
- }
-
- final Iterable<String> getDefaultCatalogNames_() {
- ArrayList<String> names = new ArrayList<String>();
- this.addDefaultCatalogNamesTo(names);
- return names;
- }
-
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.getUserName());
- }
-
-
- // ********** schemas **********
-
- public List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas() {
- try {
- return this.catalogStrategy.getSchemas();
- } catch (Exception ex) {
- throw new RuntimeException("driver adapter: " + this, ex); //$NON-NLS-1$
- }
- }
-
- /**
- * Typically, the name of the default schema is the user name.
- */
- public final Iterable<String> getDefaultSchemaNames() {
- ArrayList<String> names = new ArrayList<String>();
- this.addDefaultSchemaNamesTo(names);
- return names;
- }
-
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(this.getUserName());
- }
-
-
- // ********** name -> identifier **********
-
- public String convertNameToIdentifier(String name) {
- if (this.treatIdentifiersAsDelimited()) {
- return name; // no delimiters necessary
- }
- if (this.nameRequiresDelimiters(name)) {
- return this.delimitName(name);
- }
- return name;
- }
-
- // TODO break into converting table and column names so MySQL works better
- public String convertNameToIdentifier(String name, String defaultName) {
- if (( ! this.treatIdentifiersAsDelimited()) && this.nameRequiresDelimiters(name)) {
- // no match possible
- return this.delimitName(name);
- }
- if (this.regularNamesMatch(name, defaultName)) {
- return null;
- }
- return name;
- }
-
- /**
- * Return whether the specified database object name must be delimited
- * when used in an SQL statement.
- * If the name has any <em>special</em> characters (as opposed to letters,
- * digits, and other allowed characters [e.g. underscores]), it requires
- * delimiters.
- * If the name is mixed case and the database folds undelimited names
- * (to either uppercase or lowercase), it requires delimiters.
- */
- boolean nameRequiresDelimiters(String name) {
- return (name.length() == 0) // an empty string must be delimited(?)
- || this.nameIsReservedWord(name)
- || this.nameContainsAnySpecialCharacters(name)
- || this.nameIsNotFolded(name);
- }
-
- boolean nameIsReservedWord(String name) {
- return this.getDTPDefinition().isSQLKeyword(name);
- }
-
- // TODO make Database.getDTPDefinition() public?
- DatabaseDefinition getDTPDefinition() {
- return RDBCorePlugin.getDefault().getDatabaseDefinitionRegistry().getDefinition(this.database.getDTPDatabase());
- }
-
- /**
- * Return whether the specified name contains any <em>special</em>
- * characters that require the name to be delimited.
- * <br>
- * Pre-condition: the specified name is not empty
- */
- boolean nameContainsAnySpecialCharacters(String name) {
- char[] string = name.toCharArray();
- if (this.characterIsNonRegularNameStart(string[0])) {
- return true;
- }
- for (int i = string.length; i-- > 1; ) { // note: stop at 1
- if (this.characterIsNonRegularNamePart(string[i])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified character is non-<em>regular</em> for the first
- * character of a name.
- * Typically, databases are more restrictive about what characters can
- * be used to <em>start</em> an identifier (as opposed to the characters
- * allowed for the remainder of the identifier).
- */
- boolean characterIsNonRegularNameStart(char c) {
- return ! this.characterIsRegularNameStart(c);
- }
-
- /**
- * Return whether the specified character is <em>regular</em> for the first
- * character of a name.
- * The first character of an identifier can be:<ul>
- * <li>a letter
- * <li>any of the extended, database-specific, <em>regular</em> start characters
- * </ul>
- */
- boolean characterIsRegularNameStart(char c) {
- // all databases allow a letter
- return Character.isLetter(c)
- || this.characterIsExtendedRegularNameStart(c);
- }
-
- boolean characterIsExtendedRegularNameStart(char c) {
- return this.arrayContains(this.getExtendedRegularNameStartCharacters(), c);
- }
-
- /**
- * Return the <em>regular</em> characters, beyond letters, for the
- * first character of a name.
- * Return <code>null</code> if there are no "extended" characters.
- */
- char[] getExtendedRegularNameStartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified character is non-<em>regular</em> for the
- * second and subsequent characters of a name.
- */
- boolean characterIsNonRegularNamePart(char c) {
- return ! this.characterIsRegularNamePart(c);
- }
-
- /**
- * Return whether the specified character is <em>regular</em> for the second and
- * subsequent characters of a name.
- * The second and subsequent characters of a <em>regular</em> name can be:<ul>
- * <li>a letter
- * <li>a digit
- * <li>an underscore
- * <li>any of the extended, database-specific, <em>regular</em> start characters
- * <li>any of the extended, database-specific, <em>regular</em> part characters
- * </ul>
- */
- boolean characterIsRegularNamePart(char c) {
- // all databases allow a letter or digit
- return Character.isLetterOrDigit(c) ||
- (c == '_') ||
- this.characterIsExtendedRegularNameStart(c) ||
- this.characterIsExtendedRegularNamePart(c);
- }
-
- boolean characterIsExtendedRegularNamePart(char c) {
- return this.arrayContains(this.getExtendedRegularNamePartCharacters(), c);
- }
-
- /**
- * Return the <em>regular</em> characters, beyond letters and digits and the
- * <em>regular</em> first characters, for the second and subsequent characters
- * of an identifier. Return <code>null</code> if there are no additional characters.
- */
- char[] getExtendedRegularNamePartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified name is not folded to the database's
- * case, requiring it to be delimited.
- */
- boolean nameIsNotFolded(String name) {
- return ! this.foldingStrategy.nameIsFolded(name);
- }
-
- /**
- * Return whether the specified <em>regular</em> names match.
- * Typically, <em>regular</em> identifiers are case-insensitive.
- */
- boolean regularNamesMatch(String name1, String name2) {
- return name1.equalsIgnoreCase(name2);
- }
-
- /**
- * Wrap the specified name in delimiters (typically double-quotes),
- * converting it to an identifier.
- */
- String delimitName(String name) {
- return StringTools.quote(name);
- }
-
-
- // ********** identifier -> name **********
-
- // not sure how to handle an empty string:
- // both "" and "\"\"" are converted to "" ...
- // convert "" to 'null' since empty strings must be delimited?
- public String convertIdentifierToName(String identifier) {
- if (identifier == null) {
- return null;
- }
- if (this.treatIdentifiersAsDelimited()) {
- return identifier; // automatically delimited
- }
- if (this.identifierIsDelimited(identifier)) {
- return StringTools.undelimit(identifier);
- }
- return this.foldingStrategy.fold(identifier);
- }
-
- /**
- * Return whether the specified identifier is <em>delimited</em>.
- * The SQL-92 spec says identifiers should be delimited by
- * double-quotes; but some databases allow otherwise (e.g. Sybase).
- */
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsQuoted(identifier);
- }
-
-
- // ********** selecting database objects **********
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Catalog selectCatalogForIdentifier(Iterable<Catalog> catalogs, String identifier) {
- return this.selectDatabaseObjectForIdentifier(catalogs, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Schema selectSchemaForIdentifier(Iterable<Schema> schemata, String identifier) {
- return this.selectDatabaseObjectForIdentifier(schemata, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Table selectTableForIdentifier(Iterable<Table> tables, String identifier) {
- return this.selectDatabaseObjectForIdentifier(tables, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Sequence selectSequenceForIdentifier(Iterable<Sequence> sequences, String identifier) {
- return this.selectDatabaseObjectForIdentifier(sequences, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Column selectColumnForIdentifier(Iterable<Column> columns, String identifier) {
- return this.selectDatabaseObjectForIdentifier(columns, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(Iterable<T> databaseObjects, String identifier) {
- return this.selectDatabaseObjectNamed(databaseObjects, this.convertIdentifierToName(identifier));
- }
-
- /**
- * We can tanslate identifiers on most databasee into a name we can treat as
- * case-sensitive.
- */
- <T extends DatabaseObject> T selectDatabaseObjectNamed(Iterable<T> databaseObjects, String name) {
- return this.selectDatabaseObjectNamedRespectCase(databaseObjects, name);
- }
-
- <T extends DatabaseObject> T selectDatabaseObjectNamedRespectCase(Iterable<T> databaseObjects, String name) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equals(name)) {
- return databaseObject;
- }
- }
- return null;
- }
-
- <T extends DatabaseObject> T selectDatabaseObjectNamedIgnoreCase(Iterable<T> databaseObjects, String name) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equalsIgnoreCase(name)) {
- return databaseObject;
- }
- }
- return null;
- }
-
-
- // ********** database queries **********
-
- List<Map<String, Object>> execute(String sql) {
- try {
- return this.execute_(sql);
- } catch (SQLException ex) {
- JptJpaDbPlugin.log("SQL: " + sql, ex); //$NON-NLS-1$
- return Collections.emptyList();
- }
- }
-
- List<Map<String, Object>> execute_(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- List<Map<String, Object>> rows = Collections.emptyList();
- try {
- jdbcStatement.execute(sql);
- rows = this.buildRows(jdbcStatement.getResultSet());
- } finally {
- jdbcStatement.close();
- }
- return rows;
- }
-
- Statement createJDBCStatement() throws SQLException {
- return this.getConnectionProfile().getJDBCConnection().createStatement();
- }
-
- List<Map<String, Object>> buildRows(ResultSet resultSet) throws SQLException {
- List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
- CollectionTools.addAll(rows, this.buildResultSetIterator(resultSet));
- return rows;
- }
-
- Iterator<Map<String, Object>> buildResultSetIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<Map<String, Object>>(resultSet, new ListResultSetIteratorAdapter(resultSet.getMetaData()));
- }
-
- /**
- * Convert each row in the result set into a map whose key is the column
- * name and value is the column value.
- */
- static class ListResultSetIteratorAdapter
- implements ResultSetIterator.Adapter<Map<String, Object>>
- {
- private final int columnCount;
- private final String[] columnNames;
-
- ListResultSetIteratorAdapter(ResultSetMetaData rsMetaData) throws SQLException {
- super();
- this.columnCount = rsMetaData.getColumnCount();
- this.columnNames = new String[this.columnCount + 1]; // leave the zero slot empty
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- this.columnNames[i] = rsMetaData.getColumnName(i);
- }
- }
-
- public Map<String, Object> buildNext(ResultSet rs) throws SQLException {
- HashMap<String, Object> row = new HashMap<String, Object>(this.columnCount);
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- row.put(this.columnNames[i], rs.getObject(i));
- }
- return row;
- }
- }
-
-
- // ********** misc **********
-
- String getUserName() {
- return this.convertIdentifierToName(this.getConnectionProfile().getUserName());
- }
-
- boolean treatIdentifiersAsDelimited() {
- return this.getConnectionProfile().treatIdentifiersAsDelimited();
- }
-
- ConnectionProfile getConnectionProfile() {
- return this.database.getConnectionProfile();
- }
-
- /**
- * Convenience method: Add <code>null</code> check.
- */
- boolean arrayContains(char[] array, char c) {
- return (array != null) && ArrayTools.contains(array, c);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.database);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java
deleted file mode 100644
index 1fa345a172..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.List;
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Adapt the variety of catalog (and schema) configurations generated by
- * DTP-supplied drivers.
- */
-interface CatalogStrategy {
-
- /**
- * Return whether the DTP database has "real" catalogs (i.e. catalogs that
- * can be specified by the user).
- */
- boolean supportsCatalogs();
-
- /**
- * Return the DTP database's catalogs. This will be empty if the database
- * does <em>not</em> support catalogs.
- * @see #supportsCatalogs()
- */
- List<Catalog> getCatalogs();
-
- /**
- * Return the DTP database's schemas. This will be empty if the database
- * supports catalogs.
- * @see #supportsCatalogs()
- */
- List<Schema> getSchemas();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java
deleted file mode 100644
index 771ff68874..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class DB2
- extends AbstractDTPDriverAdapter
-{
- DB2(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "DB2 UDB", //$NON-NLS-1$
- "DB2 UDB iSeries", //$NON-NLS-1$
- "DB2 UDB zSeries" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new DB2(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java
deleted file mode 100644
index e94380b533..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Delegate DTP driver-specific behavior to implementations of this
- * interface:<ul>
- * <li>catalogs/schemas
- * <li>names/identifiers
- * <li>database object selection
- * </ul>
- * <strong>NB:</strong><br>
- * We use <em>name</em> when dealing with the unmodified name of a database
- * object as supplied by the database itself (i.e. it is not delimited and it is
- * always case-sensitive).
- * <br>
- * We use <em>identifier</em> when dealing with a string representation of a
- * database object name (i.e. it may be delimited and, depending on the database,
- * it may be case-insensitive).
- */
-public interface DTPDriverAdapter {
-
- // ********** catalogs **********
-
- /**
- * Return whether the DTP driver supports "real" catalogs (e.g. Sybase).
- * If it does, use {@link #getDTPCatalogs()} to retrieve them;
- * otherwise, use {@link #getDTPSchemas()} to retrieve the schemas directly.
- */
- boolean supportsCatalogs();
-
- /**
- * Return the DTP database's catalogs.
- * This will be empty if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs();
-
- /**
- * Return the DTP database's default catalog names.
- * The first name in the list that identifies an existing catalog
- * is <em>the</em> default.
- * This will be empty if the database does not support catalogs.
- */
- Iterable<String> getDefaultCatalogNames();
-
-
- // ********** schemas **********
-
- /**
- * Return the DTP database's schemas.
- * This will be empty if the database supports catalogs.
- * @see #supportsCatalogs()
- */
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas();
-
- /**
- * Return the DTP database's default schema names.
- * The first name in the list that identifies an existing schema
- * is <em>the</em> default.
- */
- Iterable<String> getDefaultSchemaNames();
-
-
- // ********** names/identifiers **********
-
- /**
- * Convert the specified database object name to a database-specific
- * identifier (i.e. delimit the name as appropriate).
- */
- String convertNameToIdentifier(String name);
-
- /**
- * Convert the specified database object name to a database-specific
- * identifier (i.e. delimit the name as appropriate).
- * Return <code>null</code> if the resulting identifier matches the
- * specified default name.
- * <p>
- * This is used by entity generation code to determine whether
- * a generated annotation must explicitly identify a database object
- * (e.g. a table) or the specified default adequately identifies the
- * specified database object (taking into consideration case-sensitivity,
- * special characters, etc.).
- */
- String convertNameToIdentifier(String name, String defaultName);
-
- /**
- * Convert the specified database object identifier to a database-specific
- * name (i.e. stripping delimiters from and folding the identifier as
- * appropriate).
- */
- String convertIdentifierToName(String identifier);
-
-
- // ********** selecting database objects **********
-
- /**
- * Select from the specified collection the catalog for the specified
- * identifier.
- */
- Catalog selectCatalogForIdentifier(Iterable<Catalog> catalogs, String identifier);
-
- /**
- * Select from the specified collection the schema for the specified
- * identifier.
- */
- Schema selectSchemaForIdentifier(Iterable<Schema> schemata, String identifier);
-
- /**
- * Select from the specified collection the table for the specified
- * identifier.
- */
- Table selectTableForIdentifier(Iterable<Table> tables, String identifier);
-
- /**
- * Select from the specified collection the sequence for the specified
- * identifier.
- */
- Sequence selectSequenceForIdentifier(Iterable<Sequence> sequences, String identifier);
-
- /**
- * Select from the specified collection the column for the specified
- * identifier.
- */
- Column selectColumnForIdentifier(Iterable<Column> columns, String identifier);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java
deleted file mode 100644
index 61319fd784..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-/**
- * Factory interface.
- */
-interface DTPDriverAdapterFactory {
- /**
- * Return the vendors supported by the factory's adapter.
- */
- String[] getSupportedVendors();
-
- /**
- * Build a new DTP driver adapter for the specified Dali database.
- */
- DTPDriverAdapter buildAdapter(Database database);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java
deleted file mode 100644
index 0651326152..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.HashMap;
-import org.eclipse.jpt.jpa.db.Database;
-
-public class DTPDriverAdapterManager {
- private final HashMap<String, DTPDriverAdapterFactory> adapterFactories;
-
- // singleton
- private static final DTPDriverAdapterManager INSTANCE = new DTPDriverAdapterManager();
-
- /**
- * Return the singleton.
- */
- public static DTPDriverAdapterManager instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DTPDriverAdapterManager() {
- super();
- this.adapterFactories = this.buildAdapterFactories();
- }
-
- private HashMap<String, DTPDriverAdapterFactory> buildAdapterFactories() {
- HashMap<String, DTPDriverAdapterFactory> factories = new HashMap<String, DTPDriverAdapterFactory>();
- this.addAdapterFactoriesTo(factories);
- return factories;
- }
-
- private void addAdapterFactoriesTo(HashMap<String, DTPDriverAdapterFactory> factories) {
- this.addAdapterFactoryTo(new DB2.Factory(), factories);
- this.addAdapterFactoryTo(new Derby.Factory(), factories);
- this.addAdapterFactoryTo(new HSQLDB.Factory(), factories);
- this.addAdapterFactoryTo(new Informix.Factory(), factories);
- this.addAdapterFactoryTo(new MaxDB.Factory(), factories);
- this.addAdapterFactoryTo(new MySQL.Factory(), factories);
- this.addAdapterFactoryTo(new Oracle.Factory(), factories);
- this.addAdapterFactoryTo(new PostgreSQL.Factory(), factories);
- this.addAdapterFactoryTo(new SQLServer.Factory(), factories);
- this.addAdapterFactoryTo(new Sybase.Factory(), factories);
- }
-
- /**
- * @see org.eclipse.datatools.modelbase.sql.schema.Database#getVendor()
- */
- private void addAdapterFactoryTo(DTPDriverAdapterFactory factory, HashMap<String, DTPDriverAdapterFactory> factories) {
- for (String name : factory.getSupportedVendors()) {
- this.addAdapterFactoryTo(name, factory, factories);
- }
- }
-
- private void addAdapterFactoryTo(String name, DTPDriverAdapterFactory factory, HashMap<String, DTPDriverAdapterFactory> factories) {
- if (factories.put(name, factory) != null) {
- throw new IllegalArgumentException("Duplicate adapter factory: " + name); //$NON-NLS-1$
- }
- }
-
- public DTPDriverAdapter buildAdapter(String dtpVendorName, Database database) {
- return this.getAdapterFactory(dtpVendorName).buildAdapter(database);
- }
-
- private DTPDriverAdapterFactory getAdapterFactory(String dtpVendorName) {
- DTPDriverAdapterFactory factory = this.adapterFactories.get(dtpVendorName);
- return (factory != null) ? factory : UNRECOGNIZED_ADAPTER_FACTORY;
- }
- private static final DTPDriverAdapterFactory UNRECOGNIZED_ADAPTER_FACTORY = new Unknown.Factory();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java
deleted file mode 100644
index e990660927..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.jpa.db.Database;
-
-class Derby
- extends AbstractDTPDriverAdapter
-{
- Derby(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new FauxCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(this.getDefaultSchemaName());
- }
-
- /**
- * The default user name on Derby is <code>"APP"</code> when the user
- * connects without a user name.
- */
- private String getDefaultSchemaName() {
- String userName = this.getUserName();
- return ((userName != null) && (userName.length() != 0)) ?
- userName :
- DEFAULT_USER_NAME;
- }
- private static final String DEFAULT_USER_NAME = "APP"; //$NON-NLS-1$
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Derby" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Derby(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java
deleted file mode 100644
index 507d5cb573..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for DTP database drivers that build a "virtual" catalog
- * (that has no name) because the underlying JDBC driver does not return any
- * catalogs (e.g. Oracle). This catalog cannot be specified by the user in
- * annotations etc.
- *
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class FauxCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- FauxCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- public boolean supportsCatalogs() {
- return false;
- }
-
- public List<Catalog> getCatalogs() {
- return Collections.emptyList();
- }
-
- public List<Schema> getSchemas() {
- Catalog fauxCatalog = this.getFauxCatalog();
- @SuppressWarnings("unchecked")
- List<Schema> schemas = fauxCatalog.getSchemas();
- return schemas;
- }
-
- private Catalog getFauxCatalog() {
- List<Catalog> catalogs = this.getCatalogs_();
- if (catalogs == null) {
- throw new IllegalStateException("catalogs list is null"); //$NON-NLS-1$
- }
- if (catalogs.size() != 1) {
- throw new IllegalStateException("not a single catalog: " + catalogs); //$NON-NLS-1$
- }
-
- Catalog catalog = catalogs.get(0);
- if (catalog.getName().length() != 0) {
- throw new IllegalStateException("illegal name: " + catalog.getName()); //$NON-NLS-1$
- }
- return catalog;
- }
-
- @SuppressWarnings("unchecked")
- private List<Catalog> getCatalogs_() {
- return this.database.getCatalogs();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java
deleted file mode 100644
index 523bb7a486..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-/**
- * Adapt database-specific identifier-folding etc.
- */
-interface FoldingStrategy {
-
- /**
- * Fold the specified identifier.
- */
- String fold(String identifier);
-
- /**
- * Return whether the specified database object name is already folded,
- * meaning, typically, if it has no special characters, it requires no
- * delimiters.
- */
- boolean nameIsFolded(String name);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java
deleted file mode 100644
index 6876c2cf66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.jpa.db.Database;
-
-class HSQLDB
- extends AbstractDTPDriverAdapter
-{
- HSQLDB(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(PUBLIC_SCHEMA_NAME);
- }
- private static final String PUBLIC_SCHEMA_NAME = "PUBLIC"; //$NON-NLS-1$
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "HSQLDB" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new HSQLDB(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java
deleted file mode 100644
index 8ff84a3390..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class Informix
- extends AbstractDTPDriverAdapter
-{
- Informix(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return LowerCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Informix" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Informix(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java
deleted file mode 100644
index 903ad0b9d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Fold <em>regular</em> identifiers to lower case.
- */
-class LowerCaseFoldingStrategy
- implements FoldingStrategy
-{
- // singleton
- private static final FoldingStrategy INSTANCE = new LowerCaseFoldingStrategy();
-
- /**
- * Return the singleton.
- */
- static FoldingStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private LowerCaseFoldingStrategy() {
- super();
- }
-
- public String fold(String identifier) {
- return identifier.toLowerCase();
- }
-
- public boolean nameIsFolded(String name) {
- return StringTools.stringIsLowercase(name);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java
deleted file mode 100644
index 9a3d08fce7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class MaxDB
- extends AbstractDTPDriverAdapter
-{
- MaxDB(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '#', '@', '$' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "MaxDB" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new MaxDB(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java
deleted file mode 100644
index 8d76aaf498..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * MySQL is a bit unusual in that it does <em>not</em> fold <em>regular</em>
- * identifiers and its identifiers are <em>not</em> case-sensitive
- * (except in special cases, described below). Even <em>delimited</em> identifiers
- * are case-<em>in</em>sensitive. (Delimiters are only needed for identifiers
- * that contain special characters or are reserved words.)
- * <p>
- * MySQL handles the case-sensitivity of databases and tables according to the
- * value of the system variable <code>lower_case_table_names</code>:<ul>
- * <li>0 (Unix/Linux default): database and table names are <em>not</em> folded
- * and they are case-sensitive
- * <li>1 (Windows default): database and table names are folded to lowercase
- * and they are <em>not</em> case-sensitive
- * <li>2 (Mac OS X default): database and table names are <em>not</em> folded
- * and they are <em>not</em> case-sensitive
- * </ul>
- * These values will not work perfectly on all platforms because databases are
- * stored as directories and tables are stored as files in the underlying
- * O/S; and the actual case-sensitivity of the names will ulimately be
- * determined by the behavior of filenames on the O/S.
- * <p>
- * See <a href=http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html>
- * Identifier Case Sensitivity</a>.
- */
-class MySQL
- extends AbstractDTPDriverAdapter
-{
- /** lazy-initialized; value comes from the database server */
- private int lower_case_table_names = -1;
-
- /** lazy-initialized; value comes from the database server */
- private Boolean ANSI_QUOTES = null;
-
-
- MySQL(Database database) {
- super(database);
- }
-
- /**
- * The DTP model for MySQL has a database that contains no catalogs;
- * but, instead, directly holds a single schema with the same name as
- * the database. (This is hard-coded in
- * {@link org.eclipse.datatools.enablement.mysql.catalog.MySqlCatalogDatabase#getSchemas()}.)
- * Although you can qualify identifiers with a database name
- * in MySQL, only the database specified at login seems to be available
- * in the DTP model....
- * <p>
- * <strong>NB:</strong> In MySQL DDL, <code>SCHEMA</code> is a synonym
- * for <code>DATABASE</code>; but the JDBC
- * method {@link java.sql.DatabaseMetaData#getSchemas()} returns an empty list,
- * while {@link java.sql.DatabaseMetaData#getCatalogs()} returns a list of the
- * available databases.
- * You can also use the JDBC method {@link java.sql.Connection#setCatalog(String)}
- * to set the default database.
- */
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new NoCatalogStrategy(this.database.getDTPDatabase());
- }
-
- /**
- * There are some cases where MySQL folds identifiers, but using the
- * non-folding strategy should work:<ul>
- * <li>We only fold identifiers when
- * converting them to names; but MySQL is case-<em>in</em>sensitive
- * when it is folding database and table names
- * (<code>lower_case_table_names</code>=1), so lookups will work
- * fine without any folding anyways.
- * <li>We only test whether a name is already folded when determining
- * whether it must be delimited; and MySQL ignores delimiters
- * when it comes to case-sensitivity, so we can leave any <em>regular</em>
- * mixed-case names undelimited. (MySQL only requires delimiters for
- * special characters and reserved words.)
- * </ul>
- */
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(this.database.getName());
- }
-
-
- // ********** identifiers/names **********
-
- /**
- * MySQL is the only vendor that allows a digit.
- * Although, the name cannnot be <em>all</em> digits
- * (unless delimited).
- */
- @Override
- boolean characterIsRegularNameStart(char c) {
- return Character.isDigit(c) || super.characterIsRegularNameStart(c);
- }
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_', '$' };
-
- @Override
- String delimitName(String name) {
- return StringTools.delimit(name, BACKTICK);
- }
-
- /**
- * By default, MySQL delimits identifiers with backticks (<code>`</code>);
- * but it can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsDelimited(identifier, BACKTICK)
- || (StringTools.stringIsQuoted(identifier) && this.doubleQuoteIsIdentifierDelimiter());
- }
- private static final char BACKTICK = '`';
-
- /**
- * This method should only affect whether entity
- * generation will generate a specified table or column identifier when the
- * default identifier is not a match. Worst case: Entity generation will
- * generate explicit identifiers unnecessarily for columns when tables are
- * case-sensitive. The generated annotation will be valid but the column
- * name will be redundant.
- */
- @Override
- boolean regularNamesMatch(String name1, String name2) {
- return this.tableNamesAreCaseSensitive() ?
- name1.equals(name2) :
- name1.equalsIgnoreCase(name2);
- }
-
-
- // ********** selecting database objects **********
-
- /**
- * DTP schemata are MySQL databases(?). Of course, we only have one per
- * connection....
- */
- @Override
- public Schema selectSchemaForIdentifier(Iterable<Schema> schemata, String identifier) {
- return this.tableNamesAreCaseSensitive() ?
- this.selectDatabaseObjectForIdentifierRespectCase(schemata, identifier) :
- super.selectSchemaForIdentifier(schemata, identifier);
- }
-
- @Override
- public Table selectTableForIdentifier(Iterable<Table> tables, String identifier) {
- return this.tableNamesAreCaseSensitive() ?
- this.selectDatabaseObjectForIdentifierRespectCase(tables, identifier) :
- super.selectTableForIdentifier(tables, identifier);
- }
-
- private <T extends DatabaseObject> T selectDatabaseObjectForIdentifierRespectCase(Iterable<T> databaseObjects, String identifier) {
- return this.selectDatabaseObjectNamedRespectCase(databaseObjects, this.convertIdentifierToName(identifier));
- }
-
- /**
- * MySQL database object names are usually case-insensitive;
- * the exception being databases (schemata) and tables when the system
- * variable <code>lower_case_table_names</code> is 0 (the default on
- * UNIX/Linux). (For some odd reason, trigger names are also
- * case-sensitive.... Fortunately, we don't care yet.)
- */
- @Override
- <T extends DatabaseObject> T selectDatabaseObjectNamed(Iterable<T> databaseObjects, String name) {
- return this.selectDatabaseObjectNamedIgnoreCase(databaseObjects, name);
- }
-
-
- // ********** lower_case_table_names **********
-
- private boolean tableNamesAreCaseSensitive() {
- return this.getLowerCaseTableNames() == 0;
- }
-
- private int getLowerCaseTableNames() {
- if (this.lower_case_table_names == -1) {
- this.lower_case_table_names = this.buildLowerCaseTableNames();
- }
- return this.lower_case_table_names;
- }
-
- /**
- * If we don't have a live connection (i.e. we are working off-line),
- * use the current O/S default setting(?).
- */
- private int buildLowerCaseTableNames() {
- int dbValue = this.getLowerCaseTableNamesFromDatabase();
- return (dbValue != -1) ? dbValue : this.getLowerCaseTableNamesFromOS();
- }
-
- /**
- * See <a href=http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html>
- * Identifier Case Sensitivity</a>.
- */
- private int getLowerCaseTableNamesFromDatabase() {
- if (this.getConnectionProfile().isDisconnected()) {
- return -1;
- }
- // the underscore is a wild character on MySQL, so we need to escape it
- List<Map<String, Object>> rows = this.execute("SHOW VARIABLES LIKE 'lower\\_case\\_table\\_names'"); //$NON-NLS-1$
- if (rows.isEmpty()) {
- return -1;
- }
- Map<String, Object> row = rows.get(0);
- if (Tools.valuesAreEqual(row.get("Variable_name"), "lower_case_table_names")) { //$NON-NLS-1$ //$NON-NLS-2$
- return Integer.valueOf((String) row.get("Value")).intValue(); //$NON-NLS-1$
- }
- return -1;
- }
-
- /**
- * Make a best guess at what the setting might be:
- * Return the default value for the current O/S (unfortunately this is the
- * client O/S, not the MySQL Server O/S...).
- */
- private int getLowerCaseTableNamesFromOS() {
- if (Tools.osIsMac()) {
- return 2;
- }
- if (Tools.osIsWindows()) {
- return 1;
- }
- return 0; // Linux etc.
- }
-
-
- // ********** ANSI_QUOTES **********
-
- private boolean doubleQuoteIsIdentifierDelimiter() {
- return this.getANSIQuotes().booleanValue();
- }
-
- private Boolean getANSIQuotes() {
- if (this.ANSI_QUOTES == null) {
- this.ANSI_QUOTES = this.buildANSIQuotes();
- }
- return this.ANSI_QUOTES;
- }
-
- /**
- * If we don't have a live connection (i.e. we are working off-line),
- * return <code>FALSE</code> (the default setting).
- */
- private Boolean buildANSIQuotes() {
- Boolean dbValue = this.getANSIQuotesFromDatabase();
- return (dbValue != null) ? dbValue : Boolean.FALSE;
- }
-
- /**
- * See <a href=http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_ansi_quotes>
- * ANSI_QUOTES</a>.
- */
- private Boolean getANSIQuotesFromDatabase() {
- if (this.getConnectionProfile().isDisconnected()) {
- return null;
- }
- List<Map<String, Object>> rows = this.execute("SELECT @@SESSION.sql_mode"); //$NON-NLS-1$
- if (rows.isEmpty()) {
- return null;
- }
- Map<String, Object> row = rows.get(0);
- String sql_mode = (String) row.get("@@SESSION.sql_mode"); //$NON-NLS-1$
- if (sql_mode == null) {
- return null;
- }
- String[] modes = sql_mode.split(","); //$NON-NLS-1$
- return Boolean.valueOf(ArrayTools.contains(modes, "ANSI_QUOTES")); //$NON-NLS-1$
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "MySql" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new MySQL(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java
deleted file mode 100644
index 348bd59869..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for DTP database drivers that do not have catalogs
- * (e.g. MySQL; see bug 249013).
- */
-class NoCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- NoCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- public boolean supportsCatalogs() {
- return false;
- }
-
- public List<Catalog> getCatalogs() {
- return Collections.emptyList();
- }
-
- @SuppressWarnings("unchecked")
- public List<Schema> getSchemas() {
- return this.database.getSchemas();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java
deleted file mode 100644
index 045367776b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-/**
- * Do not fold <em>regular</em> identifiers.
- */
-class NonFoldingStrategy
- implements FoldingStrategy
-{
- // singleton
- private static final FoldingStrategy INSTANCE = new NonFoldingStrategy();
-
- /**
- * Return the singleton.
- */
- static FoldingStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NonFoldingStrategy() {
- super();
- }
-
- /**
- * Since identifiers are not folded to upper- or lower-case, the name is
- * already <em>folded</em>.
- */
- public String fold(String identifier) {
- return identifier;
- }
-
- /**
- * Since identifiers are not folded to upper- or lower-case, the name is
- * already <em>folded</em>.
- * (Non-folding databases do not require delimiters around mixed-case
- * <em>regular</em> identifiers.)
- */
- public boolean nameIsFolded(String name) {
- return true;
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java
deleted file mode 100644
index 48fc149991..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class Oracle
- extends AbstractDTPDriverAdapter
-{
- Oracle(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new FauxCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$', '#' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Oracle" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Oracle(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java
deleted file mode 100644
index 93598f1a54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.jpt.jpa.db.Database;
-
-class PostgreSQL
- extends AbstractDTPDriverAdapter
-{
- PostgreSQL(Database database) {
- super(database);
- }
-
- /**
- * The PostgreSQL JDBC driver returns a single catalog from the call to
- * {@link java.sql.DatabaseMetaData#getCatalogs()} that has the same name as the
- * database initially specified by the connection (in the JDBC URL).
- * DTP uses this configuration unmodified. Unfortunately, the DTP
- * database's name is not the same as the PostgreSQL database's
- * name.
- */
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new SimpleCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return LowerCaseFoldingStrategy.instance();
- }
-
- /**
- * The PostgreSQL database holds a single catalog that has the same name as
- * the database.
- */
- @Override
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.buildDefaultCatalogName());
- }
-
- private String buildDefaultCatalogName() {
- return ((Catalog) this.database.getDTPDatabase().getCatalogs().get(0)).getName();
- }
-
- /**
- * PostgreSQL has a "schema search path". The default is:<br><code>
- * "$user",public
- * </code><br>
- * If the <code>"$user"</code> schema is not found, use the
- * <code>"public"</code> schema.
- */
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- super.addDefaultSchemaNamesTo(names);
- names.add(PUBLIC_SCHEMA_NAME);
- }
- private static final String PUBLIC_SCHEMA_NAME = "public"; //$NON-NLS-1$
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "postgres" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new PostgreSQL(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java
deleted file mode 100644
index d9aefb05a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.Database;
-
-/**
- * Microsoft SQL Server
- */
-class SQLServer
- extends AbstractDTPDriverAdapter
-{
- SQLServer(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new SimpleCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- /**
- * By default, SQL Server identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- //TODO query database for collation setting
- @Override
- boolean regularNamesMatch(String name1, String name2) {
- return name1.equals(name2);
- }
-
- /**
- * SQL Server will use the user-requested database; if that database is not
- * found, it will default to <code>master</code>.
- */
- @Override
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.database.getName());
- names.add(MASTER_CATALOG_IDENTIFIER);
- }
- private static final String MASTER_CATALOG_IDENTIFIER = "master"; //$NON-NLS-1$
-
- /**
- * The default schema on SQL Server for any database (catalog) is
- * <code>dbo</code>.
- */
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(DEFAULT_SCHEMA_NAME);
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_', '@', '#' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$' };
-
- //TODO query database for delimiter setting
- @Override
- String delimitName(String name) {
- return '[' + name + ']';
- }
-
- /**
- * By default, SQL Server delimits identifiers with brackets
- * (<code>[]</code>); but it
- * can also be configured to use double-quotes.
- */
- //TODO query database for delimiter setting
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "SQL Server" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new SQLServer(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java
deleted file mode 100644
index 8d42d07226..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for DTP database drivers that simply model the catalogs
- * returned by the underlying JDBC driver (e.g. Sybase).
- *
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class SimpleCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- SimpleCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- public boolean supportsCatalogs() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- public List<Catalog> getCatalogs() {
- return this.database.getCatalogs();
- }
-
- public List<Schema> getSchemas() {
- return Collections.emptyList();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java
deleted file mode 100644
index 0847a0c2db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.Database;
-
-class Sybase
- extends AbstractDTPDriverAdapter
-{
- Sybase(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new SimpleCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- /**
- * By default, Sybase identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- //TODO query database for collation setting
- @Override
- boolean regularNamesMatch(String name1, String name2) {
- return name1.equals(name2);
- }
-
- /**
- * Sybase will use the user-requested database; if that database is not
- * found, it will default to <code>master</code>.
- */
- @Override
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.database.getName());
- names.add(MASTER_CATALOG_NAME);
- }
- private static final String MASTER_CATALOG_NAME = "master"; //$NON-NLS-1$
-
- /**
- * The typical default schema on Sybase for any database (catalog) is
- * <code>dbo</code>.
- * <br>
- * Actually, the default schema is more like a search path:
- * The server looks for a schema object (e.g. a table) first in the user's
- * schema, then it looks for the schema object in the database owner's
- * schema (<code>dbo</code>). As a result, it's really not possible to specify
- * the "default" schema without knowing the schema object we are
- * looking for.
- * <br>
- * (Note: the current 'user' is not the same thing as the current
- * 'login' - see sp_adduser and sp_addlogin; so we probably can't
- * use {@link org.eclipse.jpt.jpa.db.ConnectionProfile#getUserName()}.)
- */
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(DEFAULT_SCHEMA_NAME);
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_', '@' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$', '¥', '£', '#' };
-
- //TODO query database for delimiter setting
- @Override
- String delimitName(String name) {
- return '[' + name + ']';
- }
-
- /**
- * By default, Sybase delimits identifiers with brackets
- * (<code>[]</code>); but it
- * can also be configured to use double-quotes.
- */
- //TODO query database for delimiter setting
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Sybase_ASA", //$NON-NLS-1$
- "Sybase_ASE" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Sybase(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java
deleted file mode 100644
index a417250363..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class Unknown
- extends AbstractDTPDriverAdapter
-{
- Unknown(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // infer from existing catalogs and schemas
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- // SQL standard
- return UpperCaseFoldingStrategy.instance();
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- public String[] getSupportedVendors() {
- throw new UnsupportedOperationException();
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Unknown(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java
deleted file mode 100644
index ca7722c5bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for unknown DTP database drivers.
- * Infer the strategy from the returned catalogs and schemas.
- *
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class UnknownCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- UnknownCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- /**
- * Return <code>true</code> if the database returns a list of catalogs and
- * that list does not contain only a "faux" catalog.
- */
- public boolean supportsCatalogs() {
- return ! this.getCatalogs().isEmpty();
- }
-
- public List<Catalog> getCatalogs() {
- List<Catalog> catalogs = this.getCatalogs_();
- // if there are no catalogs, the database must hold the schemata directly
- if ((catalogs == null) || catalogs.isEmpty()) {
- return Collections.emptyList();
- }
-
- Catalog fauxCatalog = this.selectFauxCatalog(catalogs);
- // if we don't have a "faux" catalog, we must have "real" catalogs
- return (fauxCatalog == null) ? catalogs : Collections.<Catalog>emptyList();
- }
-
- public List<Schema> getSchemas() {
- List<Catalog> catalogs = this.getCatalogs_();
- // if there are no catalogs, the database must hold the schemata directly
- if ((catalogs == null) || catalogs.isEmpty()) {
- return this.getSchemas_();
- }
-
- Catalog fauxCatalog = this.selectFauxCatalog(catalogs);
- return (fauxCatalog != null) ? this.getSchemas(fauxCatalog) : Collections.<Schema>emptyList();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<Schema> getSchemas(Catalog catalog) {
- return catalog.getSchemas();
- }
-
- /**
- * If the specified list of catalogs contains a "faux" catalog (i.e. a
- * single catalog with an empty string for a name), return it; otherwise
- * return <code>null</code>.
- */
- private Catalog selectFauxCatalog(List<Catalog> catalogs) {
- if (catalogs.size() == 1) {
- Catalog catalog = catalogs.get(0);
- if (catalog.getName().equals("")) { //$NON-NLS-1$
- return catalog;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private List<Catalog> getCatalogs_() {
- return this.database.getCatalogs();
- }
-
- @SuppressWarnings("unchecked")
- private List<Schema> getSchemas_() {
- return this.database.getSchemas();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java
deleted file mode 100644
index 00afecc306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Fold <em>regular</em> identifiers to upper case.
- */
-class UpperCaseFoldingStrategy
- implements FoldingStrategy
-{
- // singleton
- private static final FoldingStrategy INSTANCE = new UpperCaseFoldingStrategy();
-
- /**
- * Return the singleton.
- */
- static FoldingStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private UpperCaseFoldingStrategy() {
- super();
- }
-
- public String fold(String identifier) {
- return identifier.toUpperCase();
- }
-
- public boolean nameIsFolded(String name) {
- return StringTools.stringIsUppercase(name);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project
deleted file mode 100644
index 1cd07b0642..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:09 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 0d1a75f3d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.branding;singleton:=true
-Bundle-Version: 2.4.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties
deleted file mode 100644
index c6dd28d19b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - EclipseLink JPA Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties
deleted file mode 100644
index 4e089bbd76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties,\
- component.xml
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml
deleted file mode 100644
index 5ab146d23a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.eclipselink.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jpa.eclipselink.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.eclipselink.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.png b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties
deleted file mode 100644
index 3201735fbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink JPA Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project
deleted file mode 100644
index 084aa66d47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.core.ddlgen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f6a20c3394..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:07 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF
deleted file mode 100644
index c1ce439fe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.core.ddlgen;singleton:=true
-Bundle-Version: 2.0.100.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.jpt.jpa.eclipselink.core;bundle-version="[2.0.0,3.0.0)"
-Import-Package: javax.persistence
-Export-Package: org.eclipse.jpt.jpa.eclipselink.core.ddlgen
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H2>About This Content</H2>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties
deleted file mode 100644
index f6a257843e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties
deleted file mode 100644
index a2f8480048..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Jpa EclipseLink Support - DDL Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java
deleted file mode 100644
index d43c50a6cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.ddlgen;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Map.Entry;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * This class creates a EclipseLink <code>EntityManagerFactory</code>,
- * and executes the DDL generator with the command set in the properties:
- * <code>eclipselink.ddl-generation.output-mode</code>
- * <code>eclipselink.application-location</code>
- *
- * Current command-line arguments:
- * [-pu puName] - persistence unit name
- * [-p propertiesFilePath] - properties for EclipseLink EntityManager
- *
- * Example of a properties file:
- * eclipselink.jdbc.bind-parameters=false
- * eclipselink.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
- * eclipselink.jdbc.url=jdbc\:derby\:c\:/derbydb/testdb;create\=true
- * eclipselink.jdbc.user=tran
- * eclipselink.jdbc.password=
- * eclipselink.logging.level=FINEST
- * eclipselink.logging.timestamp=false
- * eclipselink.logging.thread=false
- * eclipselink.logging.session=false
- * eclipselink.logging.exceptions=true
- * eclipselink.orm.throw.exceptions=true
- * eclipselink.ddl-generation.output-mode=database
- * eclipselink.ddl-generation=drop-and-create-tables
- * eclipselink.application-location=c\:/_Projects_/ExampleDDL
- */
-public class Main
-{
- protected EntityManagerFactory emf;
- private Map<String, String> eclipseLinkProperties;
- private String createDDLFileName;
- private String dropDDLFileName;
- private String appLocation;
- private String eclipseLinkPropertiesPath;
- private boolean isDebugMode;
-
- // ********** constructors **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
- this.initializeWith(args);
-
- this.emf = Persistence.createEntityManagerFactory(this.getPUName(args), this.eclipseLinkProperties);
- this.perform();
- this.closeEntityManagerFactory();
-
- this.dispose();
- return;
- }
-
- protected void perform() {
- // create an EM to generate schema.
- this.emf.createEntityManager().close();
- }
-
- protected void closeEntityManagerFactory() {
- this.emf.close();
- }
-
- private void initializeWith(String[] args) {
-
- this.eclipseLinkPropertiesPath = this.getEclipseLinkPropertiesPath(args);
- this.eclipseLinkProperties = this.getProperties(this.eclipseLinkPropertiesPath);
-
- this.createDDLFileName = this.getConfigPropertyAsString(
- SchemaGeneration.ECLIPSELINK_CREATE_FILE_NAME,
- this.eclipseLinkProperties,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME);
-
- this.dropDDLFileName = this.getConfigPropertyAsString(
- SchemaGeneration.ECLIPSELINK_DROP_FILE_NAME,
- this.eclipseLinkProperties,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME);
-
- this.appLocation = this.eclipseLinkProperties.get(
- SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION);
-
- this.isDebugMode = this.getDebugMode(args);
- }
-
- private void dispose() {
-
- if( ! this.isDebugMode) {
- new File(this.appLocation + "/" + this.createDDLFileName).delete(); //$NON-NLS-1$
- new File(this.appLocation + "/" + this.dropDDLFileName).delete(); //$NON-NLS-1$
- new File(this.eclipseLinkPropertiesPath).delete();
- }
- }
-
- private Map<String, String> getProperties(String eclipseLinkPropertiesPath) {
-
- Set<Entry<Object, Object>> propertiesSet = null;
- try {
- propertiesSet = this.loadEclipseLinkProperties(eclipseLinkPropertiesPath);
- }
- catch (IOException e) {
- throw new RuntimeException("Missing: " + eclipseLinkPropertiesPath, e); //$NON-NLS-1$
- }
-
- Map<String, String> properties = new HashMap<String, String>();
- for(Entry<Object, Object> property : propertiesSet) {
- properties.put((String)property.getKey(), (String)property.getValue());
- }
- return properties;
- }
-
- private Set<Entry<Object, Object>> loadEclipseLinkProperties(String eclipseLinkPropertiesPath) throws IOException {
-
- FileInputStream stream = new FileInputStream(eclipseLinkPropertiesPath);
-
- Properties properties = new Properties();
- properties.load(stream);
-
- return properties.entrySet();
- }
-
- // ********** argument queries **********
-
- private String getPUName(String[] args) {
-
- return this.getArgumentValue("-pu", args); //$NON-NLS-1$
- }
-
- private String getEclipseLinkPropertiesPath(String[] args) {
-
- return this.getArgumentValue("-p", args); //$NON-NLS-1$
- }
-
- private boolean getDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- private String getArgumentValue(String argument, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argument)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private boolean argumentExists(String argument, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argument)) {
- return true;
- }
- }
- return false;
- }
-
- // ****** utility methods *******
-
- /**
- * Check the provided map for an object with the given key. If that object is not available, check the
- * System properties. If it is not available from either location, return the default value.
- * @param propertyKey
- * @param map
- * @param defaultValue
- * @return
- */
- protected String getConfigPropertyAsString(String propertyKey, Map<String, String> overrides, String defaultValue){
- String value = this.getConfigPropertyAsString(propertyKey, overrides);
- if(value == null) {
- value = defaultValue;
- }
- return value;
- }
-
- protected String getConfigPropertyAsString(String propertyKey, Map<String, String> overrides){
- String value = null;
- if(overrides != null) {
- value = overrides.get(propertyKey);
- }
- if(value == null) {
- value = System.getProperty(propertyKey);
- }
- return value;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath
deleted file mode 100644
index 90eb4c9f25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project
deleted file mode 100644
index 800c2b384e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0b22921e94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:01 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 526bc557f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,61 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.core;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.commands;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.402,2.0.0)",
- org.eclipse.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.100,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,2.0.0)"
-Export-Package: org.eclipse.jpt.jpa.eclipselink.core,
- org.eclipse.jpt.jpa.eclipselink.core.context,
- org.eclipse.jpt.jpa.eclipselink.core.context.java,
- org.eclipse.jpt.jpa.eclipselink.core.context.orm,
- org.eclipse.jpt.jpa.eclipselink.core.context.persistence,
- org.eclipse.jpt.jpa.eclipselink.core.internal;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.operations;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.platform,
- org.eclipse.jpt.jpa.eclipselink.core.resource.java,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties
deleted file mode 100644
index ee4c0e5e61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = model/
-src.includes = model/
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel
deleted file mode 100644
index 39518feb98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel
+++ /dev/null
@@ -1,652 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jpt.jpa.eclipselink.core/src"
- creationCommands="false" creationIcons="false" editDirectory="" editorDirectory=""
- modelPluginID="org.eclipse.jpt.jpa.eclipselink.core" modelName="EclipseLinkCore"
- editPluginClass="" editorPluginClass="" updateClasspath="false" rootExtendsInterface="org.eclipse.jpt.jpa.core.resource.xml.JpaEObject"
- rootExtendsClass="org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject" suppressInterfaces="true"
- testsDirectory="" testSuiteClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" copyrightFields="false" usedGenPackages="../../org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel#//orm ../../org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel#//xml">
- <foreignModel>eclipselink_orm.ecore</foreignModel>
- <genPackages prefix="EclipseLinkOrm" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="eclipselink_orm.ecore#/">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//CacheCoordinationType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/SEND_OBJECT_CHANGES"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/INVALIDATE_CHANGED_OBJECTS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/NONE"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//CacheType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/FULL"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/WEAK"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/SOFT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/SOFT_WEAK"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/HARD_WEAK"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/CACHE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/NONE"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlChangeTrackingType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/ATTRIBUTE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/OBJECT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/DEFERRED"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/AUTO"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlDirection">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/IN"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/OUT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/IN_OUT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/OUT_CURSOR"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//ExistenceType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/CHECK_CACHE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/CHECK_DATABASE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/ASSUME_EXISTENCE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/ASSUME_NON_EXISTENCE"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlJoinFetchType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlJoinFetchType/INNER"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlJoinFetchType/OUTER"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlOptimisticLockingType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/ALL_COLUMNS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/CHANGED_COLUMNS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/SELECTED_COLUMNS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/VERSION_COLUMN"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlAccessMethods">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlAccessMethods/getMethod"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlAccessMethods/setMethod"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlAccessMethodsHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlAccessMethodsHolder/accessMethods"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlAdditionalCriteria"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlArray"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlAttributeMapping"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//Attributes">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/basicCollections"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/basicMaps"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/transformations"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/variableOneToOnes"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasic"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicCollection"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicMap"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBatchFetch"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBatchFetchHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlBatchFetchHolder/batchFetch"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCache">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/expiry"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/size"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/shared"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/alwaysRefresh"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/refreshOnlyIfNewer"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/disableHits"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/coordinationType"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlCache/expiryTimeOfDay"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlCacheHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlCacheHolder/cache"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCacheHolder/existenceChecking"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCacheIndex"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlChangeTracking">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlChangeTracking/type"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlChangeTrackingHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlChangeTrackingHolder/changeTracking"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCloneCopyPolicy">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCloneCopyPolicy/method"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCloneCopyPolicy/workingCopyMethod"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCollectionTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlConversionValue">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConversionValue/dataValue"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConversionValue/objectValue"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConverter/className"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlConverterHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterHolder/converter"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterHolder/typeConverter"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterHolder/objectTypeConverter"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterHolder/structConverter"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlConvertersHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConvertersHolder/converters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConvertersHolder/typeConverters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConvertersHolder/objectTypeConverters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConvertersHolder/structConverters"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlConvertibleMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConvertibleMapping/convert"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCopyPolicy">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCopyPolicy/class"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlCustomizer">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCustomizer/customizerClassName"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlCustomizerHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlCustomizerHolder/customizer"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlElementCollection"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlEmbeddable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEmbeddable/copyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEmbeddable/instantiationCopyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEmbeddable/cloneCopyPolicy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlEmbeddable/excludeDefaultMappings"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlEmbedded"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlEmbeddedId"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlEntity">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/optimisticLocking"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/copyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/instantiationCopyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/cloneCopyPolicy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlEntity/excludeDefaultMappings"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlEntityMappings"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlFetchAttribute"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlFetchGroup"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlHashPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlId"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlIndex"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlInstantiationCopyPolicy"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlJoinFetch">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlJoinFetch/joinFetch"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlJoinTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToMany"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlMappedSuperclass">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/optimisticLocking"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/copyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/instantiationCopyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/cloneCopyPolicy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlMappedSuperclass/excludeDefaultMappings"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlMultitenant"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlMultitenantHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMultitenantHolder/multitenant"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlMutable">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlMutable/mutable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlNamedConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedConverter/name"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedPlsqlStoredFunctionQuery"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedPlsqlStoredProcedureQuery"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedStoredFunctionQuery"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/resultClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/resultSetMapping"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/procedureName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/returnsResultSet"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/hints"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/parameters"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlObjectTypeConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlObjectTypeConverter/dataType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlObjectTypeConverter/objectType"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlObjectTypeConverter/conversionValues"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlObjectTypeConverter/defaultObjectValue"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOneToMany"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOneToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOptimisticLocking">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlOptimisticLocking/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlOptimisticLocking/cascade"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlOptimisticLocking/selectedColumns"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOrderColumn"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPersistenceUnitDefaults"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPersistenceUnitMetadata">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlPersistenceUnitMetadata/excludeDefaultMappings"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPinnedPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPlsqlRecord"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPlsqlTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPrimaryKey"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlPrivateOwned">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlPrivateOwned/privateOwned"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlProperty">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlProperty/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlProperty/value"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlProperty/valueType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlPropertyContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlPropertyContainer/properties"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlQueryContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlQueryContainer/namedStoredProcedureQueries"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlQueryRedirectors"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlRangePartitioning"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlReadOnly">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlReadOnly/readOnly"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlReplicationPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlReturnInsert"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlRoundRobinPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlSecondaryTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStoredProcedureParameter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/direction"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/queryParameter"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/jdbcType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/jdbcTypeName"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStruct"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStructConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStructConverter/converter"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStructure"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTableGenerator"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTenantDiscriminatorColumn"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTimeOfDay">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/hour"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/minute"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/second"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/millisecond"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlTransformation"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTransient"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTypeConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTypeConverter/dataType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTypeConverter/objectType"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlUnionPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlValuePartitioning"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlVariableOneToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlVersion"/>
- <nestedGenPackages prefix="EclipseLinkOrmV1_1" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="eclipselink_orm.ecore#//v1_1">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1/NULL"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1/ZERO"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1/NONE"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlBasic_1_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlBasic_1_1/generatedValue"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlEntity_1_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlEntity_1_1/primaryKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlMappedSuperclass_1_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlMappedSuperclass_1_1/primaryKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlPrimaryKey_1_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v1_1/XmlPrimaryKey_1_1/validation"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlPrimaryKey_1_1/columns"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_0" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="eclipselink_orm.ecore#//v2_0">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0/READ"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0/READ_WRITE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0/EXCEPTION"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlCollectionMapping_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlCollectionMapping_2_0/mapKeyConvert"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlElementCollection_2_0"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlEntity_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlEntity_2_0/cacheInterceptor"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlEntity_2_0/queryRedirectors"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlManyToMany_2_0"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlMapKeyAssociationOverrideContainer_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlMapKeyAssociationOverrideContainer_2_0/mapKeyAssociationOverrides"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlMappedSuperclass_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlMappedSuperclass_2_0/cacheInterceptor"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlOneToMany_2_0"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlOrderColumn_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlOrderColumn_2_0/correctionType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/allQueries"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/readAll"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/readObject"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/report"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/update"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/insert"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/delete"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_1" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="eclipselinkormv2_1"
- ecorePackage="eclipselink_orm.ecore#//v2_1">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1/ID_VALUE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1/CACHE_KEY"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1/AUTO"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1/JOIN"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1/EXISTS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1/IN"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlBasic_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/returnInsert"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/returnUpdate"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1/size"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1/batchFetchType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlElementCollection_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlElementCollection_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEmbeddable_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEmbedded_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlEmbedded_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEmbeddedId_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlEmbeddedId_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEntity_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlEntity_2_1/classExtractor"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlEntity_2_1/parentClass"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEntityMappings_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlFetchAttribute_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlFetchAttribute_2_1/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1/load"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1/attributes"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//v2_1/XmlFetchGroupContainer_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlFetchGroupContainer_2_1/fetchGroups"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlId_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlId_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlManyToMany_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlManyToMany_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlManyToOne_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1/sqlResultSetMappings"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1/queryRedirectors"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1/parentClass"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlOneToMany_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlOneToMany_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlOneToOne_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlPersistenceUnitDefaults_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlPrimaryKey_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlPrimaryKey_2_1/cacheKeyType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlReturnInsert_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlReturnInsert_2_1/returnOnly"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlTransformation_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlTransformation_2_1/attributeType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlVersion_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlVersion_2_1/attributeType"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_2" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipseLinkOrmV2_2"
- ecorePackage="eclipselink_orm.ecore#//v2_2">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_2/CacheIsolationType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_2/CacheIsolationType/SHARED"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_2/CacheIsolationType/PROTECTED"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_2/CacheIsolationType/ISOLATED"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlAdditionalCriteria_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlAdditionalCriteria_2_2/criteria"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlBasic_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlBasic_2_2/index"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlBasicCollection_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlBasicCollection_2_2/cascadeOnDelete"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlBasicMap_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlBasicMap_2_2/cascadeOnDelete"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlCache_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlCache_2_2/isolation"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlCollectionTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlCollectionTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlElementCollection_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlElementCollection_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlElementCollection_2_2/noncacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlEmbeddable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlEmbeddable_2_2/parentClass"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlEntity_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntity_2_2/additionalCriteria"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlEntity_2_2/cascadeOnDelete"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntity_2_2/index"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/partitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/replicationPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/roundRobinPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/pinnedPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/rangePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/valuePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/hashPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/unionPartitioning"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlHashPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlHashPartitioning_2_2/name"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//v2_2/XmlId_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlId_2_2/index"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlIndex_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/unique"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/columnNames"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlJoinTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlJoinTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlManyToMany_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlManyToMany_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlManyToMany_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlManyToOne_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlManyToOne_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlMappedSuperclass_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlMappedSuperclass_2_2/additionalCriteria"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlOneToOne_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToOne_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToOne_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlOneToMany_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToMany_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToMany_2_2/noncacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/partitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/replicationPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/roundRobinPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/pinnedPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/rangePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/valuePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/hashPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/unionPartitioning"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/partitioned"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlPinnedPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlPinnedPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlRangePartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlRangePartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlReplicationPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlReplicationPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlRoundRobinPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlRoundRobinPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlSecondaryTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlSecondaryTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlTableGenerator_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlTableGenerator_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlUnionPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlUnionPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlValuePartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlValuePartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlVariableOneToOne_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlVariableOneToOne_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlVersion_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlVersion_2_2/index"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_3" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipselinkOrmV2_3"
- ecorePackage="eclipselink_orm.ecore#//v2_3">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_3/MultitenantType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_3/MultitenantType/SINGLE_TABLE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_3/MultitenantType/TABLE_PER_TENANT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_3/MultitenantType/VPD"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlArray_2_3"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3/structures"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3/arrays"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlElementCollection_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlElementCollection_2_3/compositeMember"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3/plsqlTables"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3/struct"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlEntity_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/namedStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/namedPlsqlStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/namedPlsqlStoredProcedureQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/plsqlTables"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/struct"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/tenantDiscriminatorColumns"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/namedStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/namedPlsqlStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/namedPlsqlStoredProcedureQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/plsqlTables"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/namedStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/namedPlsqlStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/namedPlsqlStoredProcedureQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/plsqlTables"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3/type"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3/tenantDiscriminatorColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlNamedStoredFunctionQuery_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlNamedStoredFunctionQuery_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlPersistenceUnitDefaults_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlPersistenceUnitDefaults_2_3/tenantDiscriminatorColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlPlsqlRecord_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlPlsqlRecord_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlPlsqlTable_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlPlsqlTable_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlStruct_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlStruct_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/contextProperty"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/primaryKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlStructure_2_3"/>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_4" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipselinkOrmV2_4"
- ecorePackage="eclipselink_orm.ecore#//v2_4">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_4/DatabaseChangeNotificationType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_4/DatabaseChangeNotificationType/NONE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_4/DatabaseChangeNotificationType/INVALIDATION"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlBasic_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlBasic_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlCache_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlCache_2_4/databaseChangeNotificationType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlCacheIndex_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlCacheIndex_2_4/columnNames"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlElementCollection_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlElementCollection_2_4/deleteAll"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlEntity_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlEntity_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlId_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlId_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlMappedSuperclass_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlMappedSuperclass_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlMultitenant_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlMultitenant_2_4/includeCriteria"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlOneToMany_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlOneToMany_2_4/deleteAll"/>
- </genClasses>
- </nestedGenPackages>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore
deleted file mode 100644
index 7d2a418d42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore
+++ /dev/null
@@ -1,833 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="orm"
- nsURI="jpt.eclipselink.orm.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm">
- <eClassifiers xsi:type="ecore:EClass" name="XmlAccessMethods">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="getMethod" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="setMethod" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAccessMethodsHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="accessMethods" eType="#//XmlAccessMethods"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAdditionalCriteria" eSuperTypes="#//v2_2/XmlAdditionalCriteria_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlArray" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_3/XmlArray_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeMapping" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAttributeMapping #//XmlAccessMethodsHolder #//XmlPropertyContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="Attributes" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//Attributes #//v2_3/XmlAttributes_2_3">
- <eStructuralFeatures xsi:type="ecore:EReference" name="basicCollections" upperBound="-1"
- eType="#//XmlBasicCollection" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="basicMaps" upperBound="-1"
- eType="#//XmlBasicMap" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="transformations" upperBound="-1"
- eType="#//XmlTransformation" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="variableOneToOnes" upperBound="-1"
- eType="#//XmlVariableOneToOne" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlBasic #//v1_1/XmlBasic_1_1 #//v2_1/XmlBasic_2_1 #//v2_2/XmlBasic_2_2 #//v2_4/XmlBasic_2_4 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollection" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_2/XmlBasicCollection_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMap" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_2/XmlBasicMap_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBatchFetch" eSuperTypes="#//v2_1/XmlBatchFetch_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBatchFetchHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="batchFetch" eType="#//XmlBatchFetch"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCache" eSuperTypes="#//v2_2/XmlCache_2_2 #//v2_4/XmlCache_2_4">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="expiry" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="shared" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//CacheType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="alwaysRefresh" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="refreshOnlyIfNewer" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="disableHits" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="coordinationType" eType="#//CacheCoordinationType"
- defaultValueLiteral=""/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="expiryTimeOfDay" eType="#//XmlTimeOfDay"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCacheHolder" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cache" eType="#//XmlCache"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="existenceChecking" eType="#//ExistenceType"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCacheIndex" eSuperTypes="#//v2_4/XmlCacheIndex_2_4"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlChangeTracking">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//XmlChangeTrackingType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlChangeTrackingHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="changeTracking" eType="#//XmlChangeTracking"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCloneCopyPolicy">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="method" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="workingCopyMethod" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlCollectionTable #//v2_2/XmlCollectionTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConversionValue">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConverterHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="converter" eType="#//XmlConverter"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="typeConverter" eType="#//XmlTypeConverter"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="objectTypeConverter" eType="#//XmlObjectTypeConverter"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="structConverter" eType="#//XmlStructConverter"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConvertersHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="converters" upperBound="-1"
- eType="#//XmlConverter" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="typeConverters" upperBound="-1"
- eType="#//XmlTypeConverter" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="objectTypeConverters" upperBound="-1"
- eType="#//XmlObjectTypeConverter" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="structConverters" upperBound="-1"
- eType="#//XmlStructConverter" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConvertibleMapping" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlConvertibleMapping #//XmlConverterHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="convert" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCopyPolicy">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="class" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCustomizer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="customizerClassName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCustomizerHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="customizer" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlElementCollection #//v2_0/XmlElementCollection_2_0 #//v2_1/XmlElementCollection_2_1 #//v2_2/XmlElementCollection_2_2 #//v2_3/XmlElementCollection_2_3 #//v2_4/XmlElementCollection_2_4"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbeddable #//v2_1/XmlEmbeddable_2_1 #//v2_2/XmlEmbeddable_2_2 #//v2_3/XmlEmbeddable_2_3 #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlConvertersHolder #//XmlPropertyContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="copyPolicy" eType="#//XmlCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="instantiationCopyPolicy"
- eType="#//XmlInstantiationCopyPolicy" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cloneCopyPolicy" eType="#//XmlCloneCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbedded #//v2_1/XmlEmbedded_2_1 #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbeddedId #//v2_1/XmlEmbeddedId_2_1 #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEntity #//v1_1/XmlEntity_1_1 #//v2_0/XmlEntity_2_0 #//v2_1/XmlEntity_2_1 #//v2_2/XmlEntity_2_2 #//v2_3/XmlEntity_2_3 #//v2_4/XmlEntity_2_4 #//XmlReadOnly #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlCacheHolder #//XmlConvertersHolder #//XmlQueryContainer #//XmlPropertyContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="optimisticLocking" eType="#//XmlOptimisticLocking"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="copyPolicy" eType="#//XmlCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="instantiationCopyPolicy"
- eType="#//XmlInstantiationCopyPolicy" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cloneCopyPolicy" eType="#//XmlCloneCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEntityMappings #//v2_1/XmlEntityMappings_2_1 #//v2_2/XmlEntityMappings_2_2 #//v2_3/XmlEntityMappings_2_3 #//XmlConvertersHolder #//XmlQueryContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchAttribute" eSuperTypes="#//v2_1/XmlFetchAttribute_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchGroup" eSuperTypes="#//v2_1/XmlFetchGroup_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlHashPartitioning" eSuperTypes="#//v2_2/XmlHashPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlId #//v2_1/XmlId_2_1 #//v2_2/XmlId_2_2 #//v2_4/XmlId_2_4 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIndex" eSuperTypes="#//v2_2/XmlIndex_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlInstantiationCopyPolicy"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinFetch" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="joinFetch" eType="#//XmlJoinFetchType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlJoinTable #//v2_2/XmlJoinTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlManyToMany #//v2_0/XmlManyToMany_2_0 #//v2_1/XmlManyToMany_2_1 #//v2_2/XmlManyToMany_2_2 #//XmlAttributeMapping #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlManyToOne #//v2_1/XmlManyToOne_2_1 #//v2_2/XmlManyToOne_2_2 #//XmlAttributeMapping #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlMappedSuperclass #//v1_1/XmlMappedSuperclass_1_1 #//v2_0/XmlMappedSuperclass_2_0 #//v2_1/XmlMappedSuperclass_2_1 #//v2_2/XmlMappedSuperclass_2_2 #//v2_3/XmlMappedSuperclass_2_3 #//v2_4/XmlMappedSuperclass_2_4 #//XmlReadOnly #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlCacheHolder #//XmlConvertersHolder #//XmlPropertyContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="optimisticLocking" eType="#//XmlOptimisticLocking"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="copyPolicy" eType="#//XmlCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="instantiationCopyPolicy"
- eType="#//XmlInstantiationCopyPolicy" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cloneCopyPolicy" eType="#//XmlCloneCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenant" eSuperTypes="#//v2_3/XmlMultitenant_2_3 #//v2_4/XmlMultitenant_2_4"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenantHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="multitenant" eType="#//XmlMultitenant"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMutable" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mutable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredFunctionQuery" eSuperTypes="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredProcedureQuery" eSuperTypes="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedStoredFunctionQuery" eSuperTypes="#//v2_3/XmlNamedStoredFunctionQuery_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedStoredProcedureQuery">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="resultClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="resultSetMapping" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="procedureName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnsResultSet" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hints" upperBound="-1"
- eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlQueryHint"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1"
- eType="#//XmlStoredProcedureParameter" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlObjectTypeConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="conversionValues" upperBound="-1"
- eType="#//XmlConversionValue" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultObjectValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlOneToMany #//v2_0/XmlOneToMany_2_0 #//v2_1/XmlOneToMany_2_1 #//v2_2/XmlOneToMany_2_2 #//v2_4/XmlOneToMany_2_4 #//XmlAttributeMapping #//XmlPrivateOwned #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlOneToOne #//v2_1/XmlOneToOne_2_1 #//v2_2/XmlOneToOne_2_2 #//XmlAttributeMapping #//XmlPrivateOwned #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOptimisticLocking">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//XmlOptimisticLockingType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascade" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="selectedColumns" upperBound="-1"
- eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderColumn" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlOrderColumn #//v2_0/XmlOrderColumn_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPartitioning" eSuperTypes="#//v2_2/XmlPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlPersistenceUnitDefaults #//v2_1/XmlPersistenceUnitDefaults_2_1 #//v2_3/XmlPersistenceUnitDefaults_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitMetadata" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlPersistenceUnitMetadata">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPinnedPartitioning" eSuperTypes="#//v2_2/XmlPinnedPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlRecord" eSuperTypes="#//v2_3/XmlPlsqlRecord_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlTable" eSuperTypes="#//v2_3/XmlPlsqlTable_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKey" eSuperTypes="#//v1_1/XmlPrimaryKey_1_1 #//v2_1/XmlPrimaryKey_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrivateOwned" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="privateOwned" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlProperty">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPropertyContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
- eType="#//XmlProperty" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryContainer" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredProcedureQueries"
- upperBound="-1" eType="#//XmlNamedStoredProcedureQuery" containment="true"
- resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryRedirectors" eSuperTypes="#//v2_0/XmlQueryRedirectors_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRangePartitioning" eSuperTypes="#//v2_2/XmlRangePartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReadOnly" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readOnly" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReplicationPartitioning" eSuperTypes="#//v2_2/XmlReplicationPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReturnInsert" eSuperTypes="#//v2_1/XmlReturnInsert_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRoundRobinPartitioning" eSuperTypes="#//v2_2/XmlRoundRobinPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlSecondaryTable #//v2_2/XmlSecondaryTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStoredProcedureParameter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="direction" eType="#//XmlDirection"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="queryParameter" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jdbcType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jdbcTypeName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStruct" eSuperTypes="#//v2_3/XmlStruct_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStructConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="converter" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStructure" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_3/XmlStructure_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTable #//v2_2/XmlTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTableGenerator" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTableGenerator #//v2_2/XmlTableGenerator_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTenantDiscriminatorColumn" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlBaseDiscriminatorColumn #//v2_3/XmlTenantDiscriminatorColumn_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTimeOfDay">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="hour" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="minute" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="second" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="millisecond" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//v2_1/XmlTransformation_2_1 #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransient" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTransient #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTypeConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlUnionPartitioning" eSuperTypes="#//v2_2/XmlUnionPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlValuePartitioning" eSuperTypes="#//v2_2/XmlValuePartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVariableOneToOne" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_2/XmlVariableOneToOne_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlVersion #//v2_1/XmlVersion_2_1 #//v2_2/XmlVersion_2_2 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheCoordinationType">
- <eLiterals name="SEND_OBJECT_CHANGES"/>
- <eLiterals name="INVALIDATE_CHANGED_OBJECTS" value="1"/>
- <eLiterals name="SEND_NEW_OBJECTS_WITH_CHANGES" value="2"/>
- <eLiterals name="NONE" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheType">
- <eLiterals name="FULL"/>
- <eLiterals name="WEAK" value="1"/>
- <eLiterals name="SOFT" value="2"/>
- <eLiterals name="SOFT_WEAK" value="3"/>
- <eLiterals name="HARD_WEAK" value="4"/>
- <eLiterals name="CACHE" value="5"/>
- <eLiterals name="NONE" value="6"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlChangeTrackingType">
- <eLiterals name="ATTRIBUTE" literal="ATTRIBUTE"/>
- <eLiterals name="OBJECT" value="1"/>
- <eLiterals name="DEFERRED" value="2"/>
- <eLiterals name="AUTO" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlDirection">
- <eLiterals name="IN"/>
- <eLiterals name="OUT" value="1" literal="OUT"/>
- <eLiterals name="IN_OUT" value="2" literal="IN_OUT"/>
- <eLiterals name="OUT_CURSOR" value="3" literal="OUT_CURSOR"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="ExistenceType">
- <eLiterals name="CHECK_CACHE"/>
- <eLiterals name="CHECK_DATABASE" value="1"/>
- <eLiterals name="ASSUME_EXISTENCE" value="2"/>
- <eLiterals name="ASSUME_NON_EXISTENCE" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlJoinFetchType">
- <eLiterals name="INNER"/>
- <eLiterals name="OUTER" value="1" literal="OUTER"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlOptimisticLockingType">
- <eLiterals name="ALL_COLUMNS"/>
- <eLiterals name="CHANGED_COLUMNS" value="1" literal="CHANGED_COLUMNS"/>
- <eLiterals name="SELECTED_COLUMNS" value="2" literal="SELECTED_COLUMNS"/>
- <eLiterals name="VERSION_COLUMN" value="3" literal="VERSION_COLUMN"/>
- </eClassifiers>
- <eSubpackages name="v1_1" nsURI="jpt.eclipselink.orm.v1_1.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_1_1" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlGeneratorContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="generatedValue" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlGeneratedValue"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_1_1" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKey" eType="#//XmlPrimaryKey"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_1_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKey" eType="#//XmlPrimaryKey"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKey_1_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="validation" eType="#//v1_1/IdValidationType_1_1"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="columns" upperBound="-1"
- eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="IdValidationType_1_1">
- <eLiterals name="NULL"/>
- <eLiterals name="ZERO" value="2"/>
- <eLiterals name="NONE" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_0" nsURI="jpt.eclipselink.orm.v2_0.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0">
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionMapping_2_0" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlMapKeyAssociationOverrideContainer_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapKeyConvert" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_0" abstract="true"
- interface="true" eSuperTypes="#//XmlAttributeMapping #//XmlConvertibleMapping #//XmlConvertersHolder #//v2_0/XmlCollectionMapping_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_0" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheInterceptor" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="queryRedirectors" eType="#//XmlQueryRedirectors"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_0" abstract="true"
- interface="true" eSuperTypes="#//XmlConverterHolder #//v2_0/XmlCollectionMapping_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMapKeyAssociationOverrideContainer_2_0"
- abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyAssociationOverrides"
- upperBound="-1" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAssociationOverride"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_0" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//v2_0/XmlCacheable_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheInterceptor" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_0" abstract="true"
- interface="true" eSuperTypes="#//XmlConverterHolder #//v2_0/XmlCollectionMapping_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderColumn_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="correctionType" eType="#//v2_0/OrderCorrectionType_2_0"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryRedirectors_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="allQueries" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readObject" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="report" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="update" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="insert" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="delete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="OrderCorrectionType_2_0">
- <eLiterals name="READ"/>
- <eLiterals name="READ_WRITE" value="1"/>
- <eLiterals name="EXCEPTION" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_1" nsURI="jpt.eclipselink.orm.v2_1.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_2_1" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="returnInsert" eType="#//XmlReturnInsert"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnUpdate" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBatchFetch_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="batchFetchType" eType="#//v2_1/BatchFetchType_2_1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlJoinFetch #//XmlBatchFetchHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlAccessMethodsHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded_2_1" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_1" abstract="true" interface="true"
- eSuperTypes="#//XmlAccessMethodsHolder #//v2_1/XmlFetchGroupContainer_2_1">
- <eStructuralFeatures xsi:type="ecore:EReference" name="classExtractor" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="parentClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlAccessMethodsHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchAttribute_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchGroup_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="load" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
- eType="#//XmlFetchAttribute" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchGroupContainer_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="fetchGroups" upperBound="-1"
- eType="#//XmlFetchGroup" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId_2_1" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlBatchFetchHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlBatchFetchHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_1" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAssociationOverrideContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAttributeOverrideContainer #//v2_1/XmlFetchGroupContainer_2_1 ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlGeneratorContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlQueryContainer #//XmlQueryContainer #//XmlAccessMethodsHolder">
- <eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings"
- upperBound="-1" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//SqlResultSetMapping"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="queryRedirectors" eType="#//XmlQueryRedirectors"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="parentClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlBatchFetchHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne_2_1" abstract="true" interface="true"
- eSuperTypes="#//XmlBatchFetchHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlAccessMethodsHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKey_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cacheKeyType" eType="#//v2_1/CacheKeyType_2_1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReturnInsert_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnOnly" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion_2_1" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheKeyType_2_1">
- <eLiterals name="ID_VALUE" literal="ID_VALUE"/>
- <eLiterals name="CACHE_KEY" value="1"/>
- <eLiterals name="AUTO" value="2"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="BatchFetchType_2_1">
- <eLiterals name="JOIN"/>
- <eLiterals name="EXISTS" value="1"/>
- <eLiterals name="IN" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_2" nsURI="jpt.eclipselink.orm.v2_2.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2">
- <eClassifiers xsi:type="ecore:EClass" name="XmlAdditionalCriteria_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="criteria" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollection_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMap_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCache_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="isolation" eType="#//v2_2/CacheIsolationType"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionTable_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="noncacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable_2_2" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAttributeOverrideContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAssociationOverrideContainer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="parentClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_2" abstract="true" interface="true"
- eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EReference" name="additionalCriteria" eType="#//v2_2/XmlAdditionalCriteria_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="partitioning" upperBound="-1"
- eType="#//v2_2/XmlPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="replicationPartitioning"
- upperBound="-1" eType="#//v2_2/XmlReplicationPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="roundRobinPartitioning"
- upperBound="-1" eType="#//v2_2/XmlRoundRobinPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="pinnedPartitioning" upperBound="-1"
- eType="#//v2_2/XmlPinnedPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="rangePartitioning" upperBound="-1"
- eType="#//v2_2/XmlRangePartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="valuePartitioning" upperBound="-1"
- eType="#//v2_2/XmlValuePartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hashPartitioning" upperBound="-1"
- eType="#//v2_2/XmlHashPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="unionPartitioning" upperBound="-1"
- eType="#//v2_2/XmlUnionPartitioning_2_2" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlHashPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIndex_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="schema" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="catalog" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="unique" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnNames" unique="false"
- upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTable_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EReference" name="additionalCriteria" eType="#//v2_2/XmlAdditionalCriteria_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne_2_2" abstract="true" interface="true"
- eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="noncacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPartitioningGroup_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="partitioning" eType="#//v2_2/XmlPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="replicationPartitioning"
- eType="#//v2_2/XmlReplicationPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="roundRobinPartitioning"
- eType="#//v2_2/XmlRoundRobinPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="pinnedPartitioning" eType="#//v2_2/XmlPinnedPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="rangePartitioning" eType="#//v2_2/XmlRangePartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="valuePartitioning" eType="#//v2_2/XmlValuePartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hashPartitioning" eType="#//v2_2/XmlHashPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="unionPartitioning" eType="#//v2_2/XmlUnionPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="partitioned" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPinnedPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRangePartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReplicationPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRoundRobinPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTable_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTable_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTableGenerator_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlUnionPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlValuePartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVariableOneToOne_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheIsolationType">
- <eLiterals name="SHARED"/>
- <eLiterals name="PROTECTED" value="1" literal="PROTECTED"/>
- <eLiterals name="ISOLATED" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_3" nsURI="jpt.eclipselink.orm.v2_3.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3">
- <eClassifiers xsi:type="ecore:EClass" name="XmlArray_2_3" abstract="true" interface="true"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributes_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="structures" upperBound="-1"
- eType="#//v2_3/XmlStructure_2_3" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="arrays" upperBound="-1"
- eType="#//v2_3/XmlArray_2_3" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="compositeMember" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="struct" eType="#//v2_3/XmlStruct_2_3"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_3" abstract="true" interface="true"
- eSuperTypes="#//XmlMultitenantHolder">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredProcedureQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="struct" eType="#//v2_3/XmlStruct_2_3"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="tenantDiscriminatorColumns"
- upperBound="-1" eType="#//v2_3/XmlTenantDiscriminatorColumn_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredProcedureQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_3" abstract="true"
- interface="true" eSuperTypes="#//XmlMultitenantHolder">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredProcedureQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenant_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//v2_3/MultitenantType"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tenantDiscriminatorColumns"
- upperBound="-1" eType="#//v2_3/XmlTenantDiscriminatorColumn_2_3" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredFunctionQuery_2_3"
- abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredProcedureQuery_2_3"
- abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedStoredFunctionQuery_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="tenantDiscriminatorColumns"
- upperBound="-1" eType="#//v2_3/XmlTenantDiscriminatorColumn_2_3" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlRecord_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlTable_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStruct_2_3" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTenantDiscriminatorColumn_2_3"
- abstract="true" interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlBaseDiscriminatorColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="contextProperty" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="primaryKey" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStructure_2_3" abstract="true"
- interface="true"/>
- <eClassifiers xsi:type="ecore:EEnum" name="MultitenantType">
- <eLiterals name="SINGLE_TABLE"/>
- <eLiterals name="TABLE_PER_TENANT" value="1" literal="TABLE_PER_TENANT"/>
- <eLiterals name="VPD" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_4" nsURI="jpt.eclipselink.orm.v2_4.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCache_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="databaseChangeNotificationType"
- eType="#//v2_4/DatabaseChangeNotificationType" defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCacheIndex_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnNames" unique="false"
- upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenant_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="includeCriteria" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="DatabaseChangeNotificationType">
- <eLiterals name="NONE"/>
- <eLiterals name="INVALIDATION" value="1" literal="INVALIDATION"/>
- </eClassifiers>
- </eSubpackages>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties
deleted file mode 100644
index 8f024ac36d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JPA EclipseLink Support - Core
-providerName = Eclipse Web Tools Platform
-
-ECLIPSELINK_ORM_XML_CONTENT = EclipseLink XML mapping files
-
-ECLIPSELINK_PLATFORM_GROUP_LABEL=EclipseLink
-ECLIPSELINK1_0_x_PLATFORM = EclipseLink 1.0.x
-ECLIPSELINK1_1_x_PLATFORM = EclipseLink 1.1.x
-ECLIPSELINK1_2_x_PLATFORM = EclipseLink 1.2.x
-ECLIPSELINK2_0_x_PLATFORM = EclipseLink 2.0.x
-ECLIPSELINK2_1_x_PLATFORM = EclipseLink 2.1.x
-ECLIPSELINK2_2_x_PLATFORM = EclipseLink 2.2.x
-ECLIPSELINK2_3_x_PLATFORM = EclipseLink 2.3.x
-ECLIPSELINK2_4_x_PLATFORM = EclipseLink 2.4.x
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
deleted file mode 100644
index 1bfdf32619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- Copyright (c) 2008, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
-
- <content-type
- id="org.eclipse.jpt.jpa.eclipselink.core.content.orm"
- name="%ECLIPSELINK_ORM_XML_CONTENT"
- base-type="org.eclipse.jpt.jpa.core.content.mappingFile">
- <describer
- class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber2">
- <parameter
- name="element"
- value="{http://www.eclipse.org/eclipselink/xsds/persistence/orm}entity-mappings"/>
- </describer>
- </content-type>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.jpa.core.jpaPlatforms">
-
- <jpaPlatformGroup
- id="eclipselink"
- label="%ECLIPSELINK_PLATFORM_GROUP_LABEL"/>
-
- <jpaPlatform
- id="org.eclipse.eclipselink.platform"
- label="%ECLIPSELINK1_0_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="1.0"/>
-
- <jpaPlatform
- id="eclipselink1_1"
- label="%ECLIPSELINK1_1_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink1_1JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="1.0"/>
-
- <jpaPlatform
- id="eclipselink1_2"
- label="%ECLIPSELINK1_2_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink1_2JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="1.0"/>
-
- <jpaPlatform
- id="eclipselink2_0"
- label="%ECLIPSELINK2_0_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-
- <jpaPlatform
- id="eclipselink2_1"
- label="%ECLIPSELINK2_1_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_1JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-
- <jpaPlatform
- id="eclipselink2_2"
- label="%ECLIPSELINK2_2_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_2JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-
- <jpaPlatform
- id="eclipselink2_3"
- label="%ECLIPSELINK2_3_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-<!-- post dali 3.1
- <jpaPlatform
- id="eclipselink2_4"
- label="%ECLIPSELINK2_4_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_4JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
--->
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.common.core.libraryValidators">
-
- <libraryValidator
- id="eclipselinkLibraryValidator"
- class="org.eclipse.jpt.jpa.eclipselink.core.internal.libval.EclipseLinkUserLibraryValidator">
- <enablement>
- <and>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId" value="jpa-user-library-provider"/>
- </with>
- <with variable="config">
- <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup" value="eclipselink"/>
- </with>
- </and>
- </enablement>
- </libraryValidator>
-
- <libraryValidator
- id="eclipselinkEclipselinkBundlesLibraryValidator"
- class="org.eclipse.jpt.jpa.eclipselink.core.internal.libval.EclipseLinkEclipseLinkBundlesLibraryValidator">
- <enablement>
- <and>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId" value="eclipselink-bundles-library-provider"/>
- </with>
- <with variable="config">
- <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup" value="eclipselink"/>
- </with>
- </and>
- </enablement>
- </libraryValidator>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider
- id="jpa-eclipselink1_0-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="jpa-eclipselink1_1-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="jpa-eclipselink1_2-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="eclipselink2_0-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="jpa-eclipselink2_1-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- </extension>
-
-
- <!-- ***** WTP extensions ***** -->
-
- <extension
- point="org.eclipse.wst.common.modulecore.resourceFactories">
-
- <resourceFactory
- class="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmXmlResourceFactory"
- isDefault="true">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.jpa.eclipselink.core.content.orm">
- </contentTypeBinding>
- </resourceFactory>
-
- </extension>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties
deleted file mode 100644
index a0f6a1d228..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties
+++ /dev/null
@@ -1,61 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED=The @Cache annotation on entity \"{0}\" has both expiry() and expiryTimeOfDay() specified. Only one of the two may be specified
-CONVERTER_CLASS_EXISTS=The converter class \"{0}\" does not exist on the project classpath
-CONVERTER_CLASS_DEFINED=The converter class must be defined.
-CONVERTER_CLASS_IMPLEMENTS_CONVERTER=The converter class \"{0}\" does not implement the org.eclipse.persistence.mappings.converters.Converter interface
-STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER=The struct converter class \"{0}\" does not implement the org.eclipse.persistence.platform.database.converters.StructConverter interface
-CONVERTER_DUPLICATE_NAME=Multiple converters named \"{0}\" defined in this persistence unit
-CONVERTER_NAME_UNDEFINED=Converter is unnamed. All converters require a name.
-RESERVED_CONVERTER_NAME=Converter name must not be a reserved converter name.
-DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED=An entity customizer class should be specified
-DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST=The entity customizer class \"{0}\" does not exist on the project classpath
-DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID=The entity customizer class \"{0}\" must have a public, zero-argument constructor
-DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER=The entity customizer class \"{0}\" does not implement the org.eclipse.persistence.config.DescriptorCustomizer interface
-EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED=An exception handler class should be specified
-EXCEPTION_HANDLER_CLASS_NOT_EXIST=The exception handler class \"{0}\" does not exist on the project classpath
-EXCEPTION_HANDLER_CLASS_NOT_VALID=The exception handler class \"{0}\" must have a public, zero-argument constructor
-EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER=The exception handler class \"{0}\" does not implement the org.eclipse.persistence.exceptions.ExceptionHandler interface
-GENERATOR_DUPLICATE_NAME=Multiple generators named \"{0}\" defined in this persistence unit
-GENERATOR_IDENTICAL=Identical generator \"{0}\" defined in this persistence unit, which may not be portable
-ID_MAPPING_UNRESOLVED_CONVERTER_NAME=The specified converter \"{0}\" for mapping \"{1}\" cannot be resolved
-MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE=Multiple object values are specified for the data value \"{0}\"
-PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE=The persistent field or property for a Version mapping must be of type int, Integer, short, Short, long, Long, or Timestamp
-PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER=\"{0}\" is a legacy descriptor customizer property. Consider migration to the EclipseLink customizer settings via annotation or XML mapping file
-PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING=\"{0}\" is a legacy entity caching property. Consider migration to JPA 2.0 and EclipseLink cache settings via annotation or XML mapping file
-PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED=Property \"{0}\" will be ignored as shared-cache-mode is set to NONE
-QUERY_DUPLICATE_NAME=Multiple queries named \"{0}\" defined in this persistence unit
-QUERY_IDENTICAL=Identical query \"{0}\" defined in this persistence unit, which may not be portable
-SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED=A session customizer class should be specified
-SESSION_CUSTOMIZER_CLASS_NOT_EXIST=The session customizer class \"{0}\" does not exist on the project classpath
-SESSION_CUSTOMIZER_CLASS_NOT_VALID=The session customizer class \"{0}\" must have a public, zero-argument constructor
-SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER=The session customizer class \"{0}\" does not implement the org.eclipse.persistence.config.SessionCustomizer interface
-SESSION_LOGGER_CLASS_NOT_SPECIFIED=A session logger class should be specified
-SESSION_LOGGER_CLASS_NOT_EXIST=The session logger class \"{0}\" does not exist on the project classpath
-SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG=The session logger class \"{0}\" does not implement the org.eclipse.persistence.logging.SessionLog interface
-SESSION_PROFILER_CLASS_NOT_SPECIFIED=A session profiler class should be specified
-SESSION_PROFILER_CLASS_NOT_EXIST=The session profiler class \"{0}\" does not exist on the project classpath
-SESSION_PROFILER_CLASS_NOT_VALID=The session profiler class \"{0}\" must have a public, zero-argument constructor
-SESSION_PROFILER_CLASS_IMPLEMENTS_SESSION_PROFILER=The session profiler class \"{0}\" does not implement the org.eclipse.persistence.sessions.SessionProfiler interface
-BASIC_COLLECTION_MAPPING_DEPRECATED=The type basic-collection is deprecated
-BASIC_MAP_MAPPING_DEPRECATED=The type basic-map is deprecated
-TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC=The java class for mapped type \"{0}\" is a non-static member class
-TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=Tenant discriminator column \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=In default tenant discriminator column, name \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", tenant discriminator column \"{1}\" cannot be resolved on table \"{2}\"
-TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID=Table \"{0}\" for tenant discriminator column \"{1}\" {2}
-VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID=In default tenant discriminator column \"{1}\", table \"{0}\" {2}
-VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", table \"{1}\" for tenant discriminator column \"{2}\" {3}
-MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS=Tenant discriminator columns cannot be specified without the Multitenant annotation
-MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY=Multitenant metadata cannot be specified on non-root entities in a SINGLE_TABLE or JOINED inheritance hierarchy
-MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED=EclipseLink does not support MultitenantType.TABLE_PER_TENANT
-MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED=Target database is not specified in the persistence.xml, multitenancy with Oracle VPD might not be supported
-MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM=Target database is \"{0}\", multitenancy with Oracle VPD is only supported on Oracle platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java
deleted file mode 100644
index 4bbe6840ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-
-/**
- * EclipseLink JPA project.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJpaProject
- extends JpaProject
-{
-
- /**
- * Return the resource model object that corresponds to the file
- * <code>META-INF/eclipselink-orm.xml</code> if that file has the
- * EclipseLink content type.
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin#DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH
- * @see org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin#ECLIPSELINK_ORM_XML_CONTENT_TYPE
- */
- JpaXmlResource getDefaultEclipseLinkOrmXmlResource();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java
deleted file mode 100644
index 5a9c2b398e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public interface EclipseLinkMappingKeys {
-
- String BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY = "basicCollection";
- String BASIC_MAP_ATTRIBUTE_MAPPING_KEY = "basicMap";
- String TRANSFORMATION_ATTRIBUTE_MAPPING_KEY = "transformation";
- String VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY = "variableOneToOne";
-
- //EclipseLink 2.3 mapping keys
- String STRUCTURE_ATTRIBUTE_MAPPING_KEY = "structure";
- String ARRAY_ATTRIBUTE_MAPPING_KEY = "array";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java
deleted file mode 100644
index be4a1bf6bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class JptJpaEclipseLinkCorePlugin extends Plugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.core"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 1.0
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_1_0 = "1.0"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 1.1
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_1_1 = "1.1"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 1.2
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_1_2 = "1.2"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.0
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_0 = "2.0"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.1
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_1 = "2.1"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.2
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_2 = "2.2"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.3
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_3 = "2.3"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.4
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_4 = "2.4"; //$NON-NLS-1$
-
- /**
- * Value of the content-type for eclipselink-orm.xml mappings files. Use this
- * value to retrieve the ORM xml content type from the content type manager
- * and to add new eclipselink-orm.xml-like extensions to this content type.
- *
- * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String)
- */
- public static final IContentType ECLIPSELINK_ORM_XML_CONTENT_TYPE =
- Platform.getContentTypeManager().getContentType(PLUGIN_ID + ".content.orm"); //$NON-NLS-1$
-
- /**
- * The resource type for eclipselink-orm.xml version 1.0 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 1.1 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink1_1.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 1.1 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink1_2.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.0 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_0.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.1 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_1.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.2 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_2.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.3 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_3.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.4 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_4.SCHEMA_VERSION);
-
- public static final IPath DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH = new Path("META-INF/eclipselink-orm.xml"); //$NON-NLS-1$
-
-
- // ********** singleton **********
- private static JptJpaEclipseLinkCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPT EclipseLink plug-in.
- */
- public static JptJpaEclipseLinkCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- public static boolean nodeIsEclipseLink2_3Compatible(JpaNode jpaNode) {
- return ((EclipseLinkVersion) jpaNode.getJpaProject().getJpaPlatform().getJpaVersion()).isCompatibleWithVersion(ECLIPSELINK_PLATFORM_VERSION_2_3);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void log(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJpaEclipseLinkCorePlugin() {
- super();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- INSTANCE = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index dba2c1bfac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink basic collection mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicCollectionMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java
deleted file mode 100644
index d39716b6d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink basic map mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicMapMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java
deleted file mode 100644
index 97a2af28bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-
-/**
- * EclipseLink basic mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicMapping
- extends BasicMapping
-{
- EclipseLinkMutable getMutable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java
deleted file mode 100644
index ea8581e80d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkCacheCoordinationType {
-
- SEND_OBJECT_CHANGES,
- INVALIDATE_CHANGED_OBJECTS,
- SEND_NEW_OBJECTS_WITH_CHANGES,
- NONE;
-
-
- public static EclipseLinkCacheCoordinationType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType javaCacheCoordinationType) {
- if (javaCacheCoordinationType == null) {
- return null;
- }
- switch (javaCacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + javaCacheCoordinationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType toJavaResourceModel(EclipseLinkCacheCoordinationType cacheCoordinationType) {
- if (cacheCoordinationType == null) {
- return null;
- }
- switch (cacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + cacheCoordinationType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkCacheCoordinationType fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType ormCacheCoordinationType) {
- if (ormCacheCoordinationType == null) {
- return null;
- }
- switch (ormCacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + ormCacheCoordinationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType toOrmResourceModel(EclipseLinkCacheCoordinationType cacheCoordinationType) {
- if (cacheCoordinationType == null) {
- return null;
- }
- switch (cacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + cacheCoordinationType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java
deleted file mode 100644
index c01e3c2000..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- * corresponds to EclipseLink org.eclipse.persistence.config.CacheIsolationType
- * which was added in EclipseLink 2.2
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum EclipseLinkCacheIsolationType2_2 {
-
- SHARED,
- PROTECTED,
- ISOLATED;
-
-
- public static EclipseLinkCacheIsolationType2_2 fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2 javaCacheIsolationType) {
- if (javaCacheIsolationType == null) {
- return null;
- }
- switch (javaCacheIsolationType) {
- case SHARED:
- return SHARED;
- case PROTECTED:
- return PROTECTED;
- case ISOLATED:
- return ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + javaCacheIsolationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2 toJavaResourceModel(EclipseLinkCacheIsolationType2_2 cacheIsolationType) {
- if (cacheIsolationType == null) {
- return null;
- }
- switch (cacheIsolationType) {
- case SHARED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.SHARED;
- case PROTECTED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED;
- case ISOLATED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + cacheIsolationType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkCacheIsolationType2_2 fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType ormCacheIsolationType) {
- if (ormCacheIsolationType == null) {
- return null;
- }
- switch (ormCacheIsolationType) {
- case SHARED:
- return SHARED;
- case PROTECTED:
- return PROTECTED;
- case ISOLATED:
- return ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + ormCacheIsolationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType toOrmResourceModel(EclipseLinkCacheIsolationType2_2 cacheIsolationType) {
- if (cacheIsolationType == null) {
- return null;
- }
- switch (cacheIsolationType) {
- case SHARED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType.SHARED;
- case PROTECTED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType.PROTECTED;
- case ISOLATED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType.ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + cacheIsolationType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java
deleted file mode 100644
index 921db50bdd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkCacheType {
-
- SOFT_WEAK,
- HARD_WEAK,
- WEAK,
- SOFT,
- FULL,
- CACHE,
- NONE;
-
-
- public static EclipseLinkCacheType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType javaCacheType) {
- if (javaCacheType == null) {
- return null;
- }
- switch (javaCacheType) {
- case FULL:
- return FULL;
- case WEAK:
- return WEAK;
- case SOFT:
- return SOFT;
- case SOFT_WEAK:
- return SOFT_WEAK;
- case HARD_WEAK:
- return HARD_WEAK;
- case CACHE:
- return CACHE;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + javaCacheType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType toJavaResourceModel(EclipseLinkCacheType cacheType) {
- if (cacheType == null) {
- return null;
- }
- switch (cacheType) {
- case FULL:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.FULL;
- case WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.WEAK;
- case SOFT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.SOFT;
- case SOFT_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.SOFT_WEAK;
- case HARD_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK;
- case CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.CACHE;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + cacheType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkCacheType fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType ormCacheType) {
- if (ormCacheType == null) {
- return null;
- }
- switch (ormCacheType) {
- case FULL:
- return FULL;
- case WEAK:
- return WEAK;
- case SOFT:
- return SOFT;
- case SOFT_WEAK:
- return SOFT_WEAK;
- case HARD_WEAK:
- return HARD_WEAK;
- case CACHE:
- return CACHE;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + ormCacheType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType toOrmResourceModel(EclipseLinkCacheType cacheType) {
- if (cacheType == null) {
- return null;
- }
- switch (cacheType) {
- case FULL:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL;
- case WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.WEAK;
- case SOFT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.SOFT;
- case SOFT_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.SOFT_WEAK;
- case HARD_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK;
- case CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.CACHE;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + cacheType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java
deleted file mode 100644
index a1e9a42cec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink caching
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 2.1
- */
-// TODO bjv EclipseLinkCachingPolicy
-public interface EclipseLinkCaching
- extends JpaContextNode
-{
- // ********** type **********
-
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- EclipseLinkCacheType getType();
-
- EclipseLinkCacheType getSpecifiedType();
- void setSpecifiedType(EclipseLinkCacheType type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- EclipseLinkCacheType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkCacheType DEFAULT_TYPE = EclipseLinkCacheType.SOFT_WEAK;
-
-
- // ********** size **********
-
- /**
- * This is the combination of defaultSize and specifiedSize.
- * If getSpecifiedSize() returns null, then return getDefaultSize()
- */
- int getSize();
-
- Integer getSpecifiedSize();
- void setSpecifiedSize(Integer size);
- String SPECIFIED_SIZE_PROPERTY = "specifiedSize"; //$NON-NLS-1$
-
- int getDefaultSize();
- String DEFAULT_SIZE_PROPERTY = "defaultSize"; //$NON-NLS-1$
- int DEFAULT_SIZE = 100;
-
-
- // ********** shared **********
-
- /**
- * This is the combination of defaultShared and specifiedShared.
- * If getSpecifiedShared() returns null, then return isDefaultShared()
- */
- boolean isShared();
-
- Boolean getSpecifiedShared();
-
- /**
- * Specifying <em>shared</em> <code>false</code> will return the following
- * caching settings to their defaults:<ul>
- * <li>type
- * <li>size
- * <li>always refresh
- * <li>refresh only if newer
- * <li>disable hits
- * <li>coordination type
- * </ul>
- * Additionally, the following settings will be cleared:<ul>
- * <li>expiry
- * <li>expiry time of day
- * </ul>
- * These settings do not apply to an unchared cache.
- */
- void setSpecifiedShared(Boolean shared);
- String SPECIFIED_SHARED_PROPERTY = "specifiedShared"; //$NON-NLS-1$
-
- boolean isDefaultShared();
- String DEFAULT_SHARED_PROPERTY = "defaultShared"; //$NON-NLS-1$
- boolean DEFAULT_SHARED = true;
-
-
- // ********** always refresh **********
-
- /**
- * This is the combination of defaultAlwaysRefresh and specifiedAlwaysRefresh.
- * If getSpecifiedAlwaysRefresh() returns null, then return isDefaultAlwaysRefresh()
- */
- boolean isAlwaysRefresh();
-
- Boolean getSpecifiedAlwaysRefresh();
- void setSpecifiedAlwaysRefresh(Boolean alwaysRefresh);
- String SPECIFIED_ALWAYS_REFRESH_PROPERTY = "specifiedAlwaysRefresh"; //$NON-NLS-1$
-
- boolean isDefaultAlwaysRefresh();
- String DEFAULT_ALWAYS_REFRESH_PROPERTY = "defaultAlwaysRefresh"; //$NON-NLS-1$
- boolean DEFAULT_ALWAYS_REFRESH = false;
-
-
- // ********** refresh only if newer **********
-
- /**
- * This is the combination of defaultRefreshOnlyIfNewer and specifiedRefreshOnlyIfNewer.
- * If getSpecifiedRefreshOnlyIfNewer() returns null, then return isDefaultRefreshOnlyIfNewer()
- */
- boolean isRefreshOnlyIfNewer();
-
- Boolean getSpecifiedRefreshOnlyIfNewer();
- void setSpecifiedRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer);
- String SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY = "specifiedRefreshOnlyIfNewer"; //$NON-NLS-1$
-
- boolean isDefaultRefreshOnlyIfNewer();
- String DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY = "defaultRefreshOnlyIfNewer"; //$NON-NLS-1$
- boolean DEFAULT_REFRESH_ONLY_IF_NEWER = false;
-
-
- // ********** disable hits **********
-
- /**
- * This is the combination of defaultDisableHits and specifiedDisableHits.
- * If getSpecifiedDisableHits() returns null, then return getDefaultDisableHits()
- */
- boolean isDisableHits();
-
- Boolean getSpecifiedDisableHits();
- void setSpecifiedDisableHits(Boolean disableHits);
- String SPECIFIED_DISABLE_HITS_PROPERTY = "specifiedDisableHits"; //$NON-NLS-1$
-
- boolean isDefaultDisableHits();
- String DEFAULT_DISABLE_HITS_PROPERTY = "defaultDisableHits"; //$NON-NLS-1$
- boolean DEFAULT_DISABLE_HITS = false;
-
-
- // ********** coordination type **********
-
- /**
- * This is the combination of defaultCoordinationType and specifiedCoordinationType.
- * If getSpecifiedCoordinationType() returns null, then return getDefaultCoordinationType()
- */
- EclipseLinkCacheCoordinationType getCoordinationType();
-
- EclipseLinkCacheCoordinationType getSpecifiedCoordinationType();
- void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType coordinationType);
- String SPECIFIED_COORDINATION_TYPE_PROPERTY = "specifiedCoordinationType"; //$NON-NLS-1$
-
- EclipseLinkCacheCoordinationType getDefaultCoordinationType();
- String DEFAULT_COORDINATION_TYPE_PROPERTY = "defaultCoordinationType"; //$NON-NLS-1$
- EclipseLinkCacheCoordinationType DEFAULT_COORDINATION_TYPE = EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES;
-
-
- // ********** expiry **********
-
- /**
- * corresponds to the Cache expiry element. If this returns
- * a non-null value then getExpiryTimeOfDay will return null.
- * It is not valid to specify both
- */
- Integer getExpiry();
-
- /**
- * Setting this to a non-null value will set timeOfDayExpiry to null
- */
- void setExpiry(Integer expiry);
- String EXPIRY_PROPERTY = "expiry"; //$NON-NLS-1$
-
-
- // ********** expiry time of day **********
-
- /**
- * corresponds to the Cache expiryTimeOfDay annotation or xml element.
- * If this returns a non-null value then getExpiry will return null.
- * It is not valid to specify both.
- */
- EclipseLinkTimeOfDay getExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDay"; //$NON-NLS-1$
-
- /**
- * Add Cache expiryTimeOfDay annotation or xml element, this will set
- * Expiry to null as it is not valid to set both expiry and timeOfDayExpiry
- */
- EclipseLinkTimeOfDay addExpiryTimeOfDay();
-
- /**
- * Removes the Cache expiryTimeOfDay annotation/xml element
- */
- void removeExpiryTimeOfDay();
-
-
- // ********** existence type **********
- // TODO bjv rename existenceCheckingPolicy
- /**
- * This is the combination of defaultExistenceType and specifiedExistenceType.
- * If getSpecifiedExistenceType() returns null, then return getDefaultExistenceType()
- */
- EclipseLinkExistenceType getExistenceType();
-
- EclipseLinkExistenceType getSpecifiedExistenceType();
- void setSpecifiedExistenceType(EclipseLinkExistenceType type);
- String SPECIFIED_EXISTENCE_TYPE_PROPERTY = "specifiedExistenceType"; //$NON-NLS-1$
-
- EclipseLinkExistenceType getDefaultExistenceType();
- String DEFAULT_EXISTENCE_TYPE_PROPERTY = "defaultExistenceType"; //$NON-NLS-1$
- EclipseLinkExistenceType DEFAULT_EXISTENCE_TYPE = EclipseLinkExistenceType.CHECK_DATABASE;
-
-
- // ********** isolation added in EclipseLink 2.2 **********
-
- /**
- * This is the combination of defaultIsolation and specifiedIsolation.
- * If getSpecifiedIsolation() returns null, then return getDefaultIsolation()
- */
- EclipseLinkCacheIsolationType2_2 getIsolation();
-
- EclipseLinkCacheIsolationType2_2 getSpecifiedIsolation();
- void setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2 isolation);
- String SPECIFIED_ISOLATION_PROPERTY = "specifiedIsolation"; //$NON-NLS-1$
-
- EclipseLinkCacheIsolationType2_2 getDefaultIsolation();
- String DEFAULT_ISOLATION_PROPERTY = "defaultIsolation"; //$NON-NLS-1$
- EclipseLinkCacheIsolationType2_2 DEFAULT_ISOLATION = EclipseLinkCacheIsolationType2_2.SHARED;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java
deleted file mode 100644
index bf4afe83cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink change tracking
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkChangeTracking
- extends JpaContextNode
-{
- /**
- * Return the specified type if it is present, otherwise return the default
- * type.
- */
- EclipseLinkChangeTrackingType getType();
-
- EclipseLinkChangeTrackingType getSpecifiedType();
- void setSpecifiedType(EclipseLinkChangeTrackingType type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- EclipseLinkChangeTrackingType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkChangeTrackingType DEFAULT_TYPE = EclipseLinkChangeTrackingType.AUTO;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java
deleted file mode 100644
index 114d5a75f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkChangeTrackingType {
-
- ATTRIBUTE,
- OBJECT,
- DEFERRED,
- AUTO;
-
-
- public static EclipseLinkChangeTrackingType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType javaChangeTrackingType) {
- if (javaChangeTrackingType == null) {
- return null;
- }
- switch (javaChangeTrackingType) {
- case ATTRIBUTE:
- return ATTRIBUTE;
- case OBJECT:
- return OBJECT;
- case DEFERRED:
- return DEFERRED;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + javaChangeTrackingType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType toJavaResourceModel(EclipseLinkChangeTrackingType changeTrackingType) {
- if (changeTrackingType == null) {
- return null;
- }
- switch (changeTrackingType) {
- case ATTRIBUTE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE;
- case OBJECT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT;
- case DEFERRED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED;
- case AUTO:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + changeTrackingType); //$NON-NLS-1$
- }
- }
-
- public static EclipseLinkChangeTrackingType fromOrmResourceModel(XmlChangeTrackingType ormChangeTrackingType) {
- if (ormChangeTrackingType == null) {
- return null;
- }
- switch (ormChangeTrackingType) {
- case ATTRIBUTE:
- return ATTRIBUTE;
- case OBJECT:
- return OBJECT;
- case DEFERRED:
- return DEFERRED;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + ormChangeTrackingType); //$NON-NLS-1$
- }
- }
-
- public static XmlChangeTrackingType toOrmResourceModel(EclipseLinkChangeTrackingType changeTrackingType) {
- if (changeTrackingType == null) {
- return null;
- }
- switch (changeTrackingType) {
- case ATTRIBUTE:
- return XmlChangeTrackingType.ATTRIBUTE;
- case OBJECT:
- return XmlChangeTrackingType.OBJECT;
- case DEFERRED:
- return XmlChangeTrackingType.DEFERRED;
- case AUTO:
- return XmlChangeTrackingType.AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + changeTrackingType); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java
deleted file mode 100644
index 3234114a92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Corresponds to a ConversionValue resource model object
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConversionValue
- extends JpaContextNode
-{
- EclipseLinkObjectTypeConverter getParent();
-
- String getDataValue();
- void setDataValue(String dataValue);
- String DATA_VALUE_PROPERTY = "dataValue"; //$NON-NLS-1$
-
- String getObjectValue();
- void setObjectValue(String objectValue);
- String OBJECT_VALUE_PROPERTY = "objectValue"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java
deleted file mode 100644
index 2d004387a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-
-/**
- * EclipseLink convert (not to be confused with EclipseLink converter)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 2.1
- */
-public interface EclipseLinkConvert
- extends Converter
-{
-
- EclipseLinkPersistenceUnit getPersistenceUnit();
-
- String getConverterName();
-
- String getSpecifiedConverterName();
- void setSpecifiedConverterName(String converterName);
- String SPECIFIED_CONVERTER_NAME_PROPERTY = "specifiedConverterName"; //$NON-NLS-1$
-
- String getDefaultConverterName();
- String DEFAULT_CONVERTER_NAME_PROPERTY = "defaultConverterName"; //$NON-NLS-1$
-
- /**
- * Reserved name for specifying a serialized object converter.
- * In this case a corresponding @CustomConverter is unnecessary.
- */
- String SERIALIZED_CONVERTER = "serialized"; //$NON-NLS-1$
-
- /**
- * Reserved name for specifying a class instance converter.
- * Will use a ClassInstanceConverter
- * on the associated mapping. When using a ClassInstanceConverter the database representation is a
- * String representing the Class name and the object-model representation is an instance
- * of that class built with the zero-argument constructor.
- * In this case a corresponding @CustomConverter is unnecessary.
- */
- String CLASS_INSTANCE_CONVERTER = "class-instance"; //$NON-NLS-1$
-
- /**
- * Reserved name for specifying no converter.
- * This can be used to override a situation where either
- * another converter is defaulted or another converter is set.
- * In this case a corresponding @CustomConverter is unnecessary.
- */
- String NO_CONVERTER = "none"; //$NON-NLS-1$
-
- String[] RESERVED_CONVERTER_NAMES = {NO_CONVERTER, CLASS_INSTANCE_CONVERTER, SERIALIZED_CONVERTER};
-
- String DEFAULT_CONVERTER_NAME = NO_CONVERTER;
-
- /**
- * Return the mapping's converter.
- */
- EclipseLinkConverter getConverter();
- String CONVERTER_PROPERTY = "converter"; //$NON-NLS-1$
-
- /**
- * Possible values for the converter type are:<ul>
- * <li>{@link EclipseLinkCustomConverter}
- * <li>{@link EclipseLinkTypeConverter}
- * <li>{@link EclipseLinkObjectTypeConverter}
- * <li>{@link EclipseLinkStructConverter}
- * <li><code>null</code>
- * </ul>
- */
- void setConverter(Class<? extends EclipseLinkConverter> converterType);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java
deleted file mode 100644
index 694de37772..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-
-/**
- * EclipseLink converter:<ul>
- * <li>Type ({@link EclipseLinkTypeConverter})
- * <li>Object Type ({@link EclipseLinkObjectTypeConverter})
- * <li>Struct ({@link EclipseLinkStructConverter})
- * <li>Custom ({@link EclipseLinkCustomConverter})
- * </ul>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConverter
- extends JpaNamedContextNode
-{
- /**
- * Return the converter's type.
- */
- Class<? extends EclipseLinkConverter> getType();
- @SuppressWarnings("unchecked")
- Iterable<Class<? extends EclipseLinkConverter>> TYPES = new ArrayIterable<Class<? extends EclipseLinkConverter>>(
- EclipseLinkCustomConverter.class,
- EclipseLinkObjectTypeConverter.class,
- EclipseLinkStructConverter.class,
- EclipseLinkTypeConverter.class
- );
-
-
- /**
- * Return the character to be used for browsing or creating the converter
- * class {@link org.eclipse.jdt.core.IType IType}.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getEnclosingTypeSeparator();
-
- /**
- * Return true if this converter is identical with the given converter
- */
- boolean isIdentical(EclipseLinkConverter eclipseLinkConverter);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java
deleted file mode 100644
index f257947605..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * Corresponds to a *ConverterClassConverter resource model object
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.4
- * @since 2.4
- */
-
-public interface EclipseLinkConverterClassConverter
- extends EclipseLinkConverter
-{
- String getConverterClass();
- String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
- void setConverterClass(String converterClass);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java
deleted file mode 100644
index ed43b5cacc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * EclipseLink custom converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkCustomConverter
- extends EclipseLinkConverterClassConverter
-{
- String ECLIPSELINK_CONVERTER_CLASS_NAME = "org.eclipse.persistence.mappings.converters.Converter"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java
deleted file mode 100644
index e174e1d23a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Corresponds to a Customizer resource model object
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkCustomizer
- extends JpaContextNode
-{
- String getCustomizerClass();
-
- String getSpecifiedCustomizerClass();
- void setSpecifiedCustomizerClass(String customizerClass);
- String SPECIFIED_CUSTOMIZER_CLASS_PROPERTY = "specifiedCustomizerClass"; //$NON-NLS-1$
- String ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME = "org.eclipse.persistence.config.DescriptorCustomizer"; //$NON-NLS-1$
-
- String getDefaultCustomizerClass();
- String DEFAULT_CUSTOMIZER_CLASS_PROPERTY = "defaultCustomizerClass"; //$NON-NLS-1$
-
- /**
- * Return the char to be used for browsing or creating the customizer class IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getCustomizerClassEnclosingTypeSeparator();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java
deleted file mode 100644
index 4d070ce147..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-
-/**
- * EclipseLink element collection mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface EclipseLinkElementCollectionMapping2_0
- extends ElementCollectionMapping2_0, EclipseLinkJoinFetchMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java
deleted file mode 100644
index cb838dc67c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkEmbeddable
- extends Embeddable, EclipseLinkTypeMapping
-{
- // combine various interfaces
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java
deleted file mode 100644
index 034e32126c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.Entity;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkEntity
- extends Entity, EclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java
deleted file mode 100644
index 8d5698ee5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-// TODO bjv rename to EclipseLinkExistenceCheckingPolicy
-public enum EclipseLinkExistenceType {
-
- CHECK_CACHE,
- CHECK_DATABASE,
- ASSUME_EXISTENCE,
- ASSUME_NON_EXISTENCE;
-
-
- public static EclipseLinkExistenceType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType javaExistenceType) {
- if (javaExistenceType == null) {
- return null;
- }
- switch (javaExistenceType) {
- case CHECK_CACHE:
- return CHECK_CACHE;
- case CHECK_DATABASE:
- return CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + javaExistenceType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType toJavaResourceModel(EclipseLinkExistenceType existenceType) {
- if (existenceType == null) {
- return null;
- }
- switch (existenceType) {
- case CHECK_CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.CHECK_CACHE;
- case CHECK_DATABASE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + existenceType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkExistenceType fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType ormExistenceType) {
- if (ormExistenceType == null) {
- return null;
- }
- switch (ormExistenceType) {
- case CHECK_CACHE:
- return CHECK_CACHE;
- case CHECK_DATABASE:
- return CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + ormExistenceType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType toOrmResourceModel(EclipseLinkExistenceType existenceType) {
- if (existenceType == null) {
- return null;
- }
- switch (existenceType) {
- case CHECK_CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.CHECK_CACHE;
- case CHECK_DATABASE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + existenceType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java
deleted file mode 100644
index 6fb10b2554..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-
-/**
- * EclipseLink ID mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkIdMapping
- extends IdMapping
-{
- EclipseLinkMutable getMutable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java
deleted file mode 100644
index 44fa1cf3f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkJoinFetch
- extends JpaContextNode
-{
- EclipseLinkJoinFetchType getValue();
- void setValue(EclipseLinkJoinFetchType value);
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
- EclipseLinkJoinFetchType DEFAULT_VALUE = EclipseLinkJoinFetchType.INNER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java
deleted file mode 100644
index 77966f4d37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink join-fetch mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJoinFetchMapping
- extends AttributeMapping
-{
- EclipseLinkJoinFetch getJoinFetch();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java
deleted file mode 100644
index b61a2c825b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkJoinFetchType {
-
- INNER,
- OUTER;
-
-
- public static EclipseLinkJoinFetchType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType javaJoinFetchType) {
- if (javaJoinFetchType == null) {
- return null;
- }
- switch (javaJoinFetchType) {
- case INNER:
- return INNER;
- case OUTER:
- return OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + javaJoinFetchType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType toJavaResourceModel(EclipseLinkJoinFetchType joinFetchType) {
- if (joinFetchType == null) {
- return null;
- }
- switch (joinFetchType) {
- case INNER:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER;
- case OUTER:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + joinFetchType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkJoinFetchType fromOrmResourceModel(XmlJoinFetchType ormJoinFetchType) {
- if (ormJoinFetchType == null) {
- return null;
- }
- switch (ormJoinFetchType) {
- case INNER:
- return INNER;
- case OUTER:
- return OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + ormJoinFetchType); //$NON-NLS-1$
- }
- }
-
- public static XmlJoinFetchType toOrmResourceModel(EclipseLinkJoinFetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case INNER:
- return XmlJoinFetchType.INNER;
- case OUTER:
- return XmlJoinFetchType.OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + fetchType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java
deleted file mode 100644
index c417475cc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkMappedSuperclass
- extends MappedSuperclass, EclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java
deleted file mode 100644
index e85b27812e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink multitenancy
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkMultitenancy2_3
- extends JpaContextNode
-{
-
- boolean isMultitenant();
- boolean isDefaultMultitenant();
- String DEFAULT_MULTITENANT_PROPERTY = "defaultMultitenant"; //$NON-NLS-1$
- boolean isSpecifiedMultitenant();
- void setSpecifiedMultitenant(boolean isMultitenant);
- String SPECIFIED_MULTITENANT_PROPERTY = "specifiedMultitenant"; //$NON-NLS-1$
-
- // ********** type **********
-
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- EclipseLinkMultitenantType2_3 getType();
-
- EclipseLinkMultitenantType2_3 getSpecifiedType();
- void setSpecifiedType(EclipseLinkMultitenantType2_3 type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- EclipseLinkMultitenantType2_3 getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkMultitenantType2_3 DEFAULT_TYPE = EclipseLinkMultitenantType2_3.SINGLE_TABLE;
-
-
-// // ********** include criteria (EclipseLink 2.4+) **********
-//
-// /**
-// * This is the combination of defaultIncludeCriteria and specifiedIncludeCriteria.
-// * If getSpecifiedIncludeCriteria() returns null, then return isDefaultIncludeCriteria()
-// */
-// boolean isIncludeCriteria();
-//
-// Boolean getSpecifiedIncludeCriteria();
-// void setSpecifiedIncludeCriteria(Boolean includeCriteria);
-// String SPECIFIED_INCLUDE_CRITERIA_PROPERTY = "specifiedIncludeCriteria"; //$NON-NLS-1$
-//
-// boolean isDefaultIncludeCriteria();
-// String DEFAULT_INCLUDE_CRITERIA_PROPERTY = "defaultIncludeCriteria"; //$NON-NLS-1$
-// boolean DEFAULT_INCLUDE_CRITERIA = true;
-
-
- // ********** tenant discriminator columns **********
-
- /**
- * Return the tenant discriminator columns whether specified or default.
- */
- ListIterable<? extends ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- /**
- * Return the number of tenant discriminator columns, whether specified and default.
- */
- int getTenantDiscriminatorColumnsSize();
-
-
- // ********** specified tenant discriminator columns **********
-
- /**
- * Return a list iterable of the specified tenant discriminator columns.
- * This will not be null.
- */
- ListIterable<? extends TenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- String SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST = "specifiedTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of specified tenant discriminator columns.
- */
- int getSpecifiedTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether there are any specified tenant discriminator columns.
- */
- boolean hasSpecifiedTenantDiscriminatorColumns();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- TenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- TenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Remove the specified tenant discriminator column.
- */
- void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn);
-
- /**
- * Remove the specified tenant discriminator column at the index.
- */
- void removeSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Move the specified tenant discriminator column from the source index to the target index.
- */
- void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex);
-
-
- // ********** default tenant discriminator columns **********
-
- /**
- * Return a list iterable of the default tenant discriminator columns.
- * This will not be null. If there are specified tenant discriminator columns
- * then there will be no default tenant discriminator columns.
- */
- ListIterable<? extends VirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
- String DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST = "defaultTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of default tenant discriminator columns.
- */
- int getDefaultTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether a TenantDiscriminatorColumn is allowed for this type mapping.
- * It is allowed if it is a mapped-superclass, the root entity in the inheritance hierarchy,
- * or the inheritance strategy is table-per-class
- */
- boolean specifiedTenantDiscriminatorColumnsAllowed();
- String SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_ALLOWED_PROPERTY = "specifiedTenantDiscriminatorColumnsAllowed"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java
deleted file mode 100644
index 5704e4aaa3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum EclipseLinkMultitenantType2_3 {
-
- SINGLE_TABLE,
- TABLE_PER_TENANT,
- VPD;
-
-
- public static EclipseLinkMultitenantType2_3 fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3 javaMultitenantType) {
- if (javaMultitenantType == null) {
- return null;
- }
- switch (javaMultitenantType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return TABLE_PER_TENANT;
- case VPD:
- return VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + javaMultitenantType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3 toJavaResourceModel(EclipseLinkMultitenantType2_3 multitenantType) {
- if (multitenantType == null) {
- return null;
- }
- switch (multitenantType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3.SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3.TABLE_PER_TENANT;
- case VPD:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3.VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + multitenantType); //$NON-NLS-1$
- }
- }
-
- public static EclipseLinkMultitenantType2_3 fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType ormMultitenantType) {
- if (ormMultitenantType == null) {
- return null;
- }
- switch (ormMultitenantType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return TABLE_PER_TENANT;
- case VPD:
- return VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + ormMultitenantType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType toOrmResourceModel(EclipseLinkMultitenantType2_3 multitenantType) {
- if (multitenantType == null) {
- return null;
- }
- switch (multitenantType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType.SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType.TABLE_PER_TENANT;
- case VPD:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType.VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + multitenantType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java
deleted file mode 100644
index 1611e608be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkMutable
- extends JpaContextNode
-{
- boolean isMutable();
-
- Boolean getSpecifiedMutable();
- void setSpecifiedMutable(Boolean mutable);
- String SPECIFIED_MUTABLE_PROPERTY = "specifiedMutable"; //$NON-NLS-1$
-
- boolean isDefaultMutable();
- String DEFAULT_MUTABLE_PROPERTY = "defaultMutable"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java
deleted file mode 100644
index 710f10a5d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- * EclipseLink non-embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkNonEmbeddableTypeMapping
- extends EclipseLinkTypeMapping
-{
- EclipseLinkCaching getCaching();
-
- EclipseLinkReadOnly getReadOnly();
-
- EclipseLinkMultitenancy2_3 getMultitenancy();
-
- /**
- * Used for validating whether tenant discriminator columns may be specified
- */
- boolean isMultitenantMetadataAllowed();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java
deleted file mode 100644
index bad5521ebe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * EclipseLink object type converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkObjectTypeConverter
- extends EclipseLinkConverter
-{
- // ********** data type **********
-
- String getDataType();
- void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
-
-
- // ********** object type **********
-
- String getObjectType();
- void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
-
-
- // ********** conversion values **********
-
- /**
- * Return the converter's conversion values.
- */
- ListIterable<? extends EclipseLinkConversionValue> getConversionValues();
- String CONVERSION_VALUES_LIST = "conversionValues"; //$NON-NLS-1$
-
- /**
- * Return the number of conversion values.
- */
- int getConversionValuesSize();
-
- /**
- * Add a conversion value to the converter at the specified index
- * and return it.
- */
- EclipseLinkConversionValue addConversionValue(int index);
-
- /**
- * Add a conversion value to the converter and return it.
- */
- EclipseLinkConversionValue addConversionValue();
-
- /**
- * Remove the conversion value at the specified index.
- */
- void removeConversionValue(int index);
-
- /**
- * Remove the specified conversion value.
- */
- void removeConversionValue(EclipseLinkConversionValue conversionValue);
-
- /**
- * Move the conversion value from the specified source index to the
- * specified target index.
- */
- void moveConversionValue(int targetIndex, int sourceIndex);
-
-
- // ********** data values **********
-
- /**
- * Return the converter's data values.
- */
- Iterable<String> getDataValues();
-
- /**
- * Return the number of data values.
- */
- int getDataValuesSize();
-
-
- // ********** default object value **********
-
- String getDefaultObjectValue();
- void setDefaultObjectValue(String value);
- String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValue"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java
deleted file mode 100644
index a58b71be8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-
-/**
- * EclipseLink 1:m mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkOneToManyMapping
- extends OneToManyMapping, EclipseLinkRelationshipMapping
-{
- EclipseLinkOneToManyRelationship getRelationship();
-
- EclipseLinkPrivateOwned getPrivateOwned();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java
deleted file mode 100644
index 4015ca77ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-
-/**
- * EclipseLink 1:m mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface EclipseLinkOneToManyMapping2_0
- extends EclipseLinkOneToManyMapping, OneToManyMapping2_0
-{
- EclipseLinkOneToManyRelationship2_0 getRelationship();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java
deleted file mode 100644
index 214b6128cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-
-/**
- * EclipseLink 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface EclipseLinkOneToManyRelationship
- extends OneToManyRelationship,
- JoinColumnRelationship
-{
- // add join column support to JPA 1.0 1:m
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java
deleted file mode 100644
index ed0c9e06ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-
-/**
- * EclipseLink 2.0 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface EclipseLinkOneToManyRelationship2_0
- extends EclipseLinkOneToManyRelationship,
- OneToManyRelationship2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java
deleted file mode 100644
index 846192a66e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-
-/**
- * EclipseLink 1:1 mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkOneToOneMapping
- extends OneToOneMapping, EclipseLinkRelationshipMapping
-{
- OneToOneRelationship getRelationship();
-
- EclipseLinkPrivateOwned getPrivateOwned();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java
deleted file mode 100644
index fe265ae45d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-
-/**
- * EclipseLink 1:1 mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface EclipseLinkOneToOneMapping2_0
- extends EclipseLinkOneToOneMapping, OneToOneMapping2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java
deleted file mode 100644
index 4a3b7f924c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkPrivateOwned
- extends JpaContextNode
-{
- boolean isPrivateOwned();
- void setPrivateOwned(boolean privateOwned);
- String PRIVATE_OWNED_PROPERTY = "privateOwned"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java
deleted file mode 100644
index 28d212495a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink read-only
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkReadOnly
- extends JpaContextNode
-{
- boolean isReadOnly();
-
- boolean isDefaultReadOnly();
- String DEFAULT_READ_ONLY_PROPERTY = "defaultReadOnly"; //$NON-NLS-1$
- boolean DEFAULT_READ_ONLY = false;
-
- Boolean getSpecifiedReadOnly();
- void setSpecifiedReadOnly(Boolean newSpecifiedReadOnly);
- String SPECIFIED_READ_ONLY_PROPERTY = "specifiedReadOnly"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java
deleted file mode 100644
index 9f349118f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-
-/**
- * EclipseLink relationship (1:1, 1:m, m:1, m:m) mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkRelationshipMapping
- extends RelationshipMapping, EclipseLinkJoinFetchMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java
deleted file mode 100644
index b9c13484c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * EclipseLink struct converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkStructConverter extends EclipseLinkConverterClassConverter
-{
- String ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME = "org.eclipse.persistence.platform.database.converters.StructConverter"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java
deleted file mode 100644
index 12b7a15e56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink caching expiry time of day
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTimeOfDay
- extends JpaContextNode
-{
- Integer getHour();
- void setHour(Integer hour);
- String HOUR_PROPERTY = "hour"; //$NON-NLS-1$
-
- Integer getMinute();
- void setMinute(Integer minute);
- String MINUTE_PROPERTY = "minute"; //$NON-NLS-1$
-
- Integer getSecond();
- void setSecond(Integer second);
- String SECOND_PROPERTY = "second"; //$NON-NLS-1$
-
- Integer getMillisecond();
- void setMillisecond(Integer millisecond);
- String MILLISECOND_PROPERTY = "millisecond"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java
deleted file mode 100644
index 972fdebb9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink transformation mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTransformationMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java
deleted file mode 100644
index e215cdea53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * EclipseLink type converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTypeConverter
- extends EclipseLinkConverter
-{
- String getDataType();
- void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
-
- String getObjectType();
- void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java
deleted file mode 100644
index 7c4c016beb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface EclipseLinkTypeMapping
- extends TypeMapping
-{
- EclipseLinkCustomizer getCustomizer();
-
- EclipseLinkChangeTracking getChangeTracking();
-
- /**
- * Return whether this type mapping specifies primary key columns rather than using
- * JPA-style attributes
- * (Uses the @PrimaryKey annotation for java, or the primary-key element for xml)
- *
- * Note: there is no context-level or UI support for this feature as of yet.
- * Note: this is a 1.1 feature, but this check has been implemented for all versions
- */
- boolean usesPrimaryKeyColumns();
-
- Iterable<EclipseLinkConverter> getConverters();
-
- Transformer<AttributeMapping, EclipseLinkConverter> ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER =
- new Transformer<AttributeMapping, EclipseLinkConverter>() {
- public EclipseLinkConverter transform(AttributeMapping attributeMapping) {
- if (attributeMapping instanceof ConvertibleMapping) {
- Converter converter = ((ConvertibleMapping) attributeMapping).getConverter();
- if ((converter != null) && (converter.getType() == EclipseLinkConvert.class)) {
- return ((EclipseLinkConvert) converter).getConverter();
- }
- }
- return null;
- }
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index 311a212512..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink variable 1:1 mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface EclipseLinkVariableOneToOneMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java
deleted file mode 100644
index 549fc78bad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-
-/**
- * EclipseLink version mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkVersionMapping
- extends VersionMapping
-{
- EclipseLinkMutable getMutable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index eb93c44a08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTableColumn;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface ReadOnlyTenantDiscriminatorColumn2_3
- extends ReadOnlyNamedDiscriminatorColumn, ReadOnlyTableColumn
-{
- String DEFAULT_NAME = "TENANT_ID"; //$NON-NLS-1$
-
- boolean isVirtual();
-
-
- // ********** context property **********
-
- /**
- * Return the specified context property if present, otherwise return
- * the default context property.
- */
- String getContextProperty();
- String getSpecifiedContextProperty();
- String SPECIFIED_CONTEXT_PROPERTY_PROPERTY = "specifiedContextProperty"; //$NON-NLS-1$
- String getDefaultContextProperty();
- String DEFAULT_CONTEXT_PROPERTY_PROPERTY = "defaultContextProperty"; //$NON-NLS-1$
- String DEFAULT_CONTEXT_PROPERTY = "eclipselink.tenant-id"; //$NON-NLS-1$
-
-
- // ********** primaryKey **********
-
- /**
- * Return the specified primaryKey setting if present, otherwise return the
- * default primaryKey setting.
- */
- boolean isPrimaryKey();
- Boolean getSpecifiedPrimaryKey();
- String SPECIFIED_PRIMARY_KEY_PROPERTY = "specifiedPrimaryKey"; //$NON-NLS-1$
- boolean isDefaultPrimaryKey();
- String DEFAULT_PRIMARY_KEY_PROPERTY = "defaultPrimaryKey"; //$NON-NLS-1$
- boolean DEFAULT_PRIMARY_KEY = false;
-
-
- // ********** owner **********
-
- /**
- * interface allowing tenant discriminator columns to be used in multiple places
- */
- interface Owner
- extends ReadOnlyNamedDiscriminatorColumn.Owner, ReadOnlyTableColumn.Owner
- {
- /**
- * Return the default context property name
- */
- String getDefaultContextPropertyName();
-
- /**
- * Return the default primary key setting
- */
- boolean getDefaultPrimaryKey();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java
deleted file mode 100644
index aab012ac37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.NamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.TableColumn;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface TenantDiscriminatorColumn2_3
- extends NamedDiscriminatorColumn, ReadOnlyTenantDiscriminatorColumn2_3, TableColumn
-{
-
- void setSpecifiedContextProperty(String contextProperty);
- void setSpecifiedPrimaryKey(Boolean primaryKey);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index e7eeb921e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.VirtualNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.VirtualTableColumn;
-
-/**
- * Virtual tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface VirtualTenantDiscriminatorColumn2_3
- extends VirtualNamedDiscriminatorColumn, VirtualTableColumn, ReadOnlyTenantDiscriminatorColumn2_3
-{
- ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn();
-
- // ********** owner **********
-
- /**
- * Interface allowing the virtual column to be get the column it overrides.
- */
- interface Owner
- extends ReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
- /**
- * Return the column overridden by the virtual column.
- */
- ReadOnlyTenantDiscriminatorColumn2_3 resolveOverriddenColumn();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java
deleted file mode 100644
index 09b8a1b8a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-
-/**
- * EclipseLink Java 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJavaOneToManyRelationship
- extends EclipseLinkOneToManyRelationship,
- JavaOneToManyRelationship,
- JavaJoinColumnRelationship
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java
deleted file mode 100644
index b723b3eef2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-
-/**
- * EclipseLink 2.0 Java 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJavaOneToManyRelationship2_0
- extends EclipseLinkOneToManyRelationship2_0,
- EclipseLinkJavaOneToManyRelationship,
- JavaOneToManyRelationship2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java
deleted file mode 100644
index d7aa51e560..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-
-/**
- * EclipseLink Java type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJavaTypeMapping
- extends JavaTypeMapping, EclipseLinkTypeMapping
-{
- // this is pretty different from the orm container (so, no common super-interface)
- JavaEclipseLinkConverterContainer getConverterContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java
deleted file mode 100644
index be17d91a59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-
-/**
- * EclipseLink Java caching
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface JavaEclipseLinkCaching
- extends EclipseLinkCaching, JavaJpaContextNode
-{
- /**
- * Return true if the existence-checking model object exists.
- * Have to have a separate flag for this since the default existence
- * type is different depending on whether hasExistenceChecking() returns
- * true or false.
- */
- boolean isExistenceChecking();
- void setExistenceChecking(boolean existenceChecking);
- String EXISTENCE_CHECKING_PROPERTY = "existenceChecking"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java
deleted file mode 100644
index 66e9ff7002..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkTypeConverter;
-
-/**
- * EclipseLink Java converter container
- * <p>
- * <strong>NB:</strong> This is only mildly-related to
- * {@link org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer};
- * thus the lack of common super-interface.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.2
- */
-public interface JavaEclipseLinkConverterContainer
- extends JavaJpaContextNode
-{
- Iterable<EclipseLinkConverter> getConverters();
-
- JavaEclipseLinkCustomConverter getCustomConverter();
- JavaEclipseLinkCustomConverter addCustomConverter();
- void removeCustomConverter();
- String CUSTOM_CONVERTER_PROPERTY = "customConverter"; //$NON-NLS-1$
-
- JavaEclipseLinkObjectTypeConverter getObjectTypeConverter();
- JavaEclipseLinkObjectTypeConverter addObjectTypeConverter();
- void removeObjectTypeConverter();
- String OBJECT_TYPE_CONVERTER_PROPERTY = "objectTypeConverter"; //$NON-NLS-1$
-
- JavaEclipseLinkStructConverter getStructConverter();
- JavaEclipseLinkStructConverter addStructConverter();
- void removeStructConverter();
- String STRUCT_CONVERTER_PROPERTY = "structConverter"; //$NON-NLS-1$
-
- JavaEclipseLinkTypeConverter getTypeConverter();
- JavaEclipseLinkTypeConverter addTypeConverter();
- void removeTypeConverter();
- String TYPE_CONVERTER_PROPERTY = "typeConverter"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java
deleted file mode 100644
index 80c3e43510..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEmbeddable;
-
-/**
- * EclipseLink
- * Java embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface JavaEclipseLinkEmbeddable
- extends JavaEmbeddable, EclipseLinkEmbeddable, EclipseLinkJavaTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java
deleted file mode 100644
index 32a78c5646..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-
-/**
- * EclipseLink
- * Java entity
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface JavaEclipseLinkEntity
- extends JavaEntity, EclipseLinkEntity, JavaEclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java
deleted file mode 100644
index c5541c4fc7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-
-/**
- * EclipseLink
- * Java mapped superclass
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 2.1
- */
-public interface JavaEclipseLinkMappedSuperclass
- extends JavaMappedSuperclass, EclipseLinkMappedSuperclass, JavaEclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index c1897750a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenancy2_3;
-
-public interface JavaEclipseLinkMultitenancy2_3
- extends EclipseLinkMultitenancy2_3, JavaJpaContextNode
-{
-
- ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- ListIterable<JavaTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
- JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- ListIterable<JavaVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java
deleted file mode 100644
index 4d89e38aab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkNonEmbeddableTypeMapping;
-
-/**
- * EclipseLink Java non-embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaEclipseLinkNonEmbeddableTypeMapping
- extends EclipseLinkNonEmbeddableTypeMapping, EclipseLinkJavaTypeMapping
-{
- JavaEclipseLinkCaching getCaching();
-
- JavaEclipseLinkMultitenancy2_3 getMultitenancy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 0169a52e23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JavaReadOnlyTenantDiscriminatorColumn2_3
- extends JavaReadOnlyNamedDiscriminatorColumn, ReadOnlyTenantDiscriminatorColumn2_3, JavaReadOnlyTableColumn
-{
-
- // ********** owner **********
-
- /**
- * interface allowing tenant discriminator columns to be used in multiple places
- */
- interface Owner
- extends ReadOnlyTenantDiscriminatorColumn2_3.Owner, JavaReadOnlyNamedDiscriminatorColumn.Owner
- {
- //combining interfaces
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 085104ff78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JavaTenantDiscriminatorColumn2_3
- extends TenantDiscriminatorColumn2_3, JavaReadOnlyTenantDiscriminatorColumn2_3
-{
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 getColumnAnnotation();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index c5430a0a6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.VirtualTenantDiscriminatorColumn2_3;
-
-/**
- * Java virtual tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaVirtualTenantDiscriminatorColumn2_3
- extends VirtualTenantDiscriminatorColumn2_3, JavaReadOnlyTenantDiscriminatorColumn2_3, JavaReadOnlyTableColumn
-{
- /**
- * The overridden column can be either a Java tenant discriminator column or an
- * <code>orm.xml</code> tenant discriminator column; so we don't change the return type
- * here.
- */
- ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java
deleted file mode 100644
index 2c19a1b843..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-
-public interface EclipseLinkEntityMappings
- extends EntityMappings
-{
- /**
- * Return all the converters defined in both the entity mappings and its
- * entities (but <em>not</em> in any associated Java annotations).
- */
- Iterable<EclipseLinkConverter> getMappingFileConverters();
-
- OrmEclipseLinkConverterContainer getConverterContainer();
-
-
- // ********** tenant discriminator columns **********
-
- /**
- * Return the tenant discriminator columns whether specified or default.
- */
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- /**
- * Return the number of tenant discriminator columns, whether specified and default.
- */
- int getTenantDiscriminatorColumnsSize();
-
-
- // ********** specified tenant discriminator columns **********
-
- /**
- * Return a list iterable of the specified tenant discriminator columns.
- * This will not be null.
- */
- ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- String SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST = "specifiedTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of specified tenant discriminator columns.
- */
- int getSpecifiedTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether there are any specified tenant discriminator columns.
- */
- boolean hasSpecifiedTenantDiscriminatorColumns();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Remove the specified tenant discriminator column.
- */
- void removeSpecifiedTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn);
-
- /**
- * Remove the specified tenant discriminator column at the index.
- */
- void removeSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Move the specified tenant discriminator column from the source index to the target index.
- */
- void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex);
-
-
- // ********** default tenant discriminator columns **********
-
- /**
- * Return a list iterable of the default tenant discriminator columns.
- * This will not be null. If there are specified tenant discriminator columns
- * then there will be no default tenant discriminator columns.
- */
- ListIterable<? extends ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
- String DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST = "defaultTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of default tenant discriminator columns.
- */
- int getDefaultTenantDiscriminatorColumnsSize();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java
deleted file mode 100644
index c56fee5fe2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-
-/**
- * EclipseLink <code>orm.xml</code> 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkOrmOneToManyRelationship
- extends EclipseLinkOneToManyRelationship,
- OrmOneToManyRelationship,
- OrmJoinColumnRelationship
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java
deleted file mode 100644
index a5ba92c14d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-
-/**
- * EclipseLink 2.0 <code>orm.xml</code> 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkOrmOneToManyRelationship2_0
- extends EclipseLinkOneToManyRelationship2_0,
- EclipseLinkOrmOneToManyRelationship,
- OrmOneToManyRelationship2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java
deleted file mode 100644
index 5c54c1fcf8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-
-/**
- * EclipseLink type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkOrmTypeMapping
- extends OrmTypeMapping, EclipseLinkTypeMapping
-{
- // this is pretty different from the Java container (so, no common super-interface)
- OrmEclipseLinkConverterContainer getConverterContainer();
-
- EclipseLinkJavaTypeMapping getJavaTypeMapping();
-
- EclipseLinkJavaTypeMapping getJavaTypeMappingForDefaults();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java
deleted file mode 100644
index 3f8a4c548a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmPersistenceUnitDefaults2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-
-/**
- * EclipseLink <code>orm.xml</code> file
- * <br>
- * <code>persistence-unit-defaults</code> element
- */
-public interface EclipseLinkPersistenceUnitDefaults
- extends OrmPersistenceUnitDefaults2_0
-{
-
- // ********** tenant discriminator columns **********
-
- /**
- * Return a list iterable of the tenant discriminator columns.
- * This will not be null.
- */
- ListIterable<OrmTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
- String TENANT_DISCRIMINATOR_COLUMNS_LIST = "tenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of tenant discriminator columns.
- */
- int getTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether there are any tenant discriminator columns.
- */
- boolean hasTenantDiscriminatorColumns();
-
- /**
- * Add a tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn();
-
- /**
- * Add a tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn(int index);
-
- /**
- * Remove the tenant discriminator column.
- */
- void removeTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn);
-
- /**
- * Remove the tenant discriminator column at the index.
- */
- void removeTenantDiscriminatorColumn(int index);
-
- /**
- * Move the tenant discriminator column from the source index to the target index.
- */
- void moveTenantDiscriminatorColumn(int targetIndex, int sourceIndex);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java
deleted file mode 100644
index d8acb7e6ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-
-/**
- * EclipseLink <code>orm.xml</code> caching
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkCaching
- extends EclipseLinkCaching, XmlContextNode
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java
deleted file mode 100644
index 5cde9a486a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLink <code>orm.xml</code> converter container
- * <p>
- * <strong>NB:</strong> This is only mildly-related to
- * {@link org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer};
- * thus the lack of common super-interface.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.2
- */
-public interface OrmEclipseLinkConverterContainer
- extends XmlContextNode
-{
- Iterable<EclipseLinkConverter> getConverters();
-
-
- //************ customConverters *********************
-
- /**
- * Return a list iterator of the custom converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkCustomConverter> getCustomConverters();
-
- /**
- * Return the number of custom converters.
- */
- int getCustomConvertersSize();
-
- /**
- * Add a custom converter to the converter holder, return the object representing it.
- */
- EclipseLinkCustomConverter addCustomConverter(int index);
-
- /**
- * Remove the custom converter at the index from the converter holder.
- */
- void removeCustomConverter(int index);
-
- /**
- * Remove the custom converter at from the converter holder.
- */
- void removeCustomConverter(EclipseLinkCustomConverter converter);
-
- /**
- * Move the custom converter from the source index to the target index.
- */
- void moveCustomConverter(int targetIndex, int sourceIndex);
-
- String CUSTOM_CONVERTERS_LIST = "customConverters"; //$NON-NLS-1$
-
-
- //************ object type converters *********************
-
- /**
- * Return a list iterator of the object type converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkObjectTypeConverter> getObjectTypeConverters();
-
- /**
- * Return the number of object type converters.
- */
- int getObjectTypeConvertersSize();
-
- /**
- * Add a object type converter to the converter holder, return the object representing it.
- */
- EclipseLinkObjectTypeConverter addObjectTypeConverter(int index);
-
- /**
- * Remove the object type converter at the index from the converter holder.
- */
- void removeObjectTypeConverter(int index);
-
- /**
- * Remove the object type converter at from the converter holder.
- */
- void removeObjectTypeConverter(EclipseLinkObjectTypeConverter converter);
-
- /**
- * Move the object type converter from the source index to the target index.
- */
- void moveObjectTypeConverter(int targetIndex, int sourceIndex);
-
- String OBJECT_TYPE_CONVERTERS_LIST = "objectTypeConverters"; //$NON-NLS-1$
-
-
- //************ struct converters *********************
-
- /**
- * Return a list iterator of the struct converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkStructConverter> getStructConverters();
-
- /**
- * Return the number of struct converters.
- */
- int getStructConvertersSize();
-
- /**
- * Add a struct converter to the converter holder, return the object representing it.
- */
- EclipseLinkStructConverter addStructConverter(int index);
-
- /**
- * Remove the struct converter at the index from the converter holder.
- */
- void removeStructConverter(int index);
-
- /**
- * Remove the struct converter at from the converter holder.
- */
- void removeStructConverter(EclipseLinkStructConverter converter);
-
- /**
- * Move the struct converter from the source index to the target index.
- */
- void moveStructConverter(int targetIndex, int sourceIndex);
-
- String STRUCT_CONVERTERS_LIST = "structConverters"; //$NON-NLS-1$
-
-
- //************ type converters *********************
-
- /**
- * Return a list iterator of the type converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkTypeConverter> getTypeConverters();
-
- /**
- * Return the number of type converters.
- */
- int getTypeConvertersSize();
-
- /**
- * Add a type converter to the converter holder, return the object representing it.
- */
- EclipseLinkTypeConverter addTypeConverter(int index);
-
- /**
- * Remove the type converter at the index from the converter holder.
- */
- void removeTypeConverter(int index);
-
- /**
- * Remove the type converter at from the converter holder.
- */
- void removeTypeConverter(EclipseLinkTypeConverter converter);
-
- /**
- * Move the type converter from the source index to the target index.
- */
- void moveTypeConverter(int targetIndex, int sourceIndex);
-
- String TYPE_CONVERTERS_LIST = "typeConverters"; //$NON-NLS-1$
-
- // ********** refactoring **********
-
- Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName);
- Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage);
- Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java
deleted file mode 100644
index b401ae71a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-
-/**
- * EclipseLink <code>orm.xml</code> embeddable
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkEmbeddable
- extends OrmEmbeddable, EclipseLinkEmbeddable, EclipseLinkOrmTypeMapping
-{
- XmlEmbeddable getXmlTypeMapping();
-
- JavaEclipseLinkEmbeddable getJavaTypeMapping();
-
- JavaEclipseLinkEmbeddable getJavaTypeMappingForDefaults();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java
deleted file mode 100644
index 52b3b9472f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-
-/**
- * EclipseLink <code>orm.xml</code> entity
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkEntity
- extends OrmEntity, EclipseLinkEntity, OrmEclipseLinkNonEmbeddableTypeMapping
-{
- XmlEntity getXmlTypeMapping();
-
- JavaEclipseLinkEntity getJavaTypeMapping();
-
- JavaEclipseLinkEntity getJavaTypeMappingForDefaults();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java
deleted file mode 100644
index 37a0c7e46b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> mapped superclass
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkMappedSuperclass
- extends OrmMappedSuperclass, EclipseLinkMappedSuperclass, OrmEclipseLinkNonEmbeddableTypeMapping
-{
- XmlMappedSuperclass getXmlTypeMapping();
-
- JavaEclipseLinkMappedSuperclass getJavaTypeMapping();
-
- JavaEclipseLinkMappedSuperclass getJavaTypeMappingForDefaults();
-
- OrmQueryContainer getQueryContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index dad9f450e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenancy2_3;
-
-public interface OrmEclipseLinkMultitenancy2_3
- extends EclipseLinkMultitenancy2_3, XmlContextNode
-{
- ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java
deleted file mode 100644
index 70cec9cebc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-
-/**
- * EclipseLink <code>orm.xml</code> non-embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmEclipseLinkNonEmbeddableTypeMapping
- extends EclipseLinkNonEmbeddableTypeMapping, EclipseLinkOrmTypeMapping
-{
- OrmEclipseLinkCaching getCaching();
-
- JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMapping();
-
- JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults();
-
- OrmEclipseLinkMultitenancy2_3 getMultitenancy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 8879430be2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface OrmReadOnlyTenantDiscriminatorColumn2_3
- extends OrmReadOnlyNamedDiscriminatorColumn, ReadOnlyTenantDiscriminatorColumn2_3, OrmReadOnlyTableColumn
-{
-
- // ********** owner **********
-
- /**
- * interface allowing discriminator columns to be used in multiple places
- */
- interface Owner
- extends ReadOnlyTenantDiscriminatorColumn2_3.Owner, OrmReadOnlyNamedDiscriminatorColumn.Owner
- {
- //combining interfaces
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index aee1206caf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-
-/**
- * orm tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface OrmTenantDiscriminatorColumn2_3
- extends TenantDiscriminatorColumn2_3, OrmReadOnlyTenantDiscriminatorColumn2_3
-{
- XmlTenantDiscriminatorColumn_2_3 getXmlColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index d39ddfbecf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.VirtualTenantDiscriminatorColumn2_3;
-
-/**
- * <code>orm.xml</code> virtual tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmVirtualTenantDiscriminatorColumn2_3
- extends VirtualTenantDiscriminatorColumn2_3, OrmReadOnlyTenantDiscriminatorColumn2_3, OrmReadOnlyTableColumn
-{
- /**
- * The overridden column can be either a Java tenant discriminator column or an
- * <code>orm.xml</code> tenant discriminator column; so we don't change the return type
- * here.
- */
- ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java
deleted file mode 100644
index 0ffefee89c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * BatchWriting
- */
-public enum BatchWriting {
- none,
- jdbc,
- buffered,
- oracle_jdbc;
-
- // EclipseLink value string
- static final String NONE = "None";
- static final String JDBC = "JDBC";
- static final String BUFFERED = "Buffered";
- static final String ORACLE_JDBC = "Oracle-JDBC";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java
deleted file mode 100644
index 0e8f0db7f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * CacheType
- */
-public enum CacheType {
- soft_weak,
- hard_weak,
- weak,
- soft,
- full,
- none;
-
- // EclipseLink value string
- public static final String FULL = "Full";
- public static final String HARD_WEAK = "HardWeak";
- public static final String NONE = "NONE";
- public static final String SOFT = "Soft";
- public static final String SOFT_WEAK = "SoftWeak";
- public static final String WEAK = "Weak";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java
deleted file mode 100644
index f285fcf9d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Caching
- */
-public interface Caching extends PersistenceUnitProperties
-{
- CacheType getDefaultCacheTypeDefault();
- CacheType getCacheTypeDefault();
- void setCacheTypeDefault(CacheType cacheTypeDefault);
- static final String CACHE_TYPE_DEFAULT_PROPERTY = "cacheTypeDefault"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE_DEFAULT = "eclipselink.cache.type.default"; //$NON-NLS-1$
- static final CacheType DEFAULT_CACHE_TYPE_DEFAULT = CacheType.soft_weak;
-
- Integer getDefaultCacheSizeDefault();
- Integer getCacheSizeDefault();
- void setCacheSizeDefault(Integer cacheSizeDefault);
- static final String CACHE_SIZE_DEFAULT_PROPERTY = "cacheSizeDefault"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE_DEFAULT = "eclipselink.cache.size.default"; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_SIZE_DEFAULT = Integer.valueOf(100);
-
- Boolean getDefaultSharedCacheDefault();
- Boolean getSharedCacheDefault();
- void setSharedCacheDefault(Boolean sharedCacheDefault);
- static final String SHARED_CACHE_DEFAULT_PROPERTY = "sharedCacheDefault"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SHARED_DEFAULT = "eclipselink.cache.shared.default"; //$NON-NLS-1$
- static final Boolean DEFAULT_SHARED_CACHE_DEFAULT = Boolean.TRUE;
-
-
- CacheType getDefaultCacheType();
- CacheType getCacheTypeOf(String entityName);
- void setCacheTypeOf(String entityName, CacheType cacheType);
- static final String CACHE_TYPE_PROPERTY = "cacheType"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE = "eclipselink.cache.type."; //$NON-NLS-1$
- static final CacheType DEFAULT_CACHE_TYPE = CacheType.soft_weak;
-
- Integer getDefaultCacheSize();
- Integer getCacheSizeOf(String entityName);
- void setCacheSizeOf(String entityName, Integer cacheSize);
- static final String CACHE_SIZE_PROPERTY = "cacheSize"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE = "eclipselink.cache.size."; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_SIZE = Integer.valueOf(100);
-
- Boolean getDefaultSharedCache();
- Boolean getSharedCacheOf(String entityName);
- void setSharedCacheOf(String entityName, Boolean sharedCache);
- static final String SHARED_CACHE_PROPERTY = "sharedCache"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SHARED_CACHE = "eclipselink.cache.shared."; //$NON-NLS-1$
- static final Boolean DEFAULT_SHARED_CACHE = Boolean.TRUE;
-
- FlushClearCache getDefaultFlushClearCache();
- FlushClearCache getFlushClearCache();
- void setFlushClearCache(FlushClearCache newFlushClearCache);
- static final String FLUSH_CLEAR_CACHE_PROPERTY = "flushClearCache"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_FLUSH_CLEAR_CACHE = "eclipselink.flush-clear.cache"; //$NON-NLS-1$
- static final FlushClearCache DEFAULT_FLUSH_CLEAR_CACHE = FlushClearCache.drop_invalidate;
-
- void removeDefaultCachingProperties();
-
- ListIterable<CachingEntity> getEntities();
- Iterable<String> getEntityNames();
- int getEntitiesSize();
- boolean entityExists(String entity);
- CachingEntity addEntity(String entity);
- void removeEntity(String entity);
- String ENTITIES_LIST = "entities"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java
deleted file mode 100644
index cf80dcd8ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-
-/**
- * Entity
- */
-public class CachingEntity extends AbstractModel implements Cloneable, Serializable
-{
- private String name;
- private Caching parent;
-
- public static final String CACHE_TYPE_PROPERTY = Caching.CACHE_TYPE_PROPERTY;
- public static final String CACHE_SIZE_PROPERTY = Caching.CACHE_SIZE_PROPERTY;
- public static final String SHARED_CACHE_PROPERTY = Caching.SHARED_CACHE_PROPERTY;
-
- // ********** EclipseLink properties **********
- private CacheType cacheType;
- private Integer cacheSize;
- private Boolean cacheIsShared;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public CachingEntity(Caching parent, String name) {
- this(parent);
- this.initialize(name);
- }
-
- private CachingEntity(Caching parent) {
- this.parent = parent;
- }
-
- private void initialize(String name) {
- if(StringTools.stringIsEmpty(name)) {
- throw new IllegalArgumentException();
- }
- this.name = name;
- }
-
- // ********** behaviors **********
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof CachingEntity)) {
- return false;
- }
- CachingEntity other = (CachingEntity) o;
- return (
- (this.cacheType == null ?
- other.cacheType == null : this.cacheType.equals(other.cacheType)) &&
- (this.cacheIsShared == null ?
- other.cacheIsShared == null : this.cacheIsShared.equals(other.cacheIsShared)) &&
- (this.cacheSize == null ?
- other.cacheSize == null : this.cacheSize.equals(other.cacheSize)));
- }
-
- @Override
- public int hashCode() {
- return (this.cacheType == null) ? 0 : this.cacheType.hashCode();
- }
-
- @Override
- public CachingEntity clone() {
- try {
- return (CachingEntity)super.clone();
- }
- catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean isEmpty() {
- return (this.cacheType == null) &&
- (this.cacheSize == null) &&
- (this.cacheIsShared == null);
- }
-
- public boolean entityNameIsValid() {
- return ! StringTools.stringIsEmpty(this.name);
- }
-
- public Caching getParent() {
- return this.parent;
- }
-
- // ********** name **********
- public String getName() {
- return this.name;
- }
-
- // ********** cacheType **********
- public CacheType getCacheType() {
- return this.cacheType;
- }
-
- public void setCacheType(CacheType cacheType) {
- CacheType old = this.cacheType;
- this.cacheType = cacheType;
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, cacheType);
- }
-
- // ********** cacheSize **********
- public Integer getCacheSize() {
- return this.cacheSize;
- }
-
- public void setCacheSize(Integer cacheSize) {
- Integer old = this.cacheSize;
- this.cacheSize = cacheSize;
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, cacheSize);
- }
-
- // ********** cacheIsShared **********
- public Boolean cacheIsShared() {
- return this.cacheIsShared;
- }
-
- public void setSharedCache(Boolean isShared) {
- Boolean old = this.cacheIsShared;
- this.cacheIsShared = isShared;
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, isShared);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append("name: "); //$NON-NLS-1$
- sb.append(this.name);
- sb.append(", cacheType: "); //$NON-NLS-1$
- sb.append(this.cacheType);
- sb.append(", cacheSize: "); //$NON-NLS-1$
- sb.append(this.cacheSize);
- sb.append(", cacheIsShared: "); //$NON-NLS-1$
- sb.append(this.cacheIsShared);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java
deleted file mode 100644
index 3266bab553..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Connection
- */
-public interface Connection extends PersistenceUnitProperties
-{
- Boolean getDefaultNativeSql();
- Boolean getNativeSql();
- void setNativeSql(Boolean newNativeSql);
- static final String NATIVE_SQL_PROPERTY = "nativeSql"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_NATIVE_SQL = "eclipselink.jdbc.native-sql"; //$NON-NLS-1$
- static final Boolean DEFAULT_NATIVE_SQL = Boolean.FALSE;
-
- BatchWriting getDefaultBatchWriting();
- BatchWriting getBatchWriting();
- void setBatchWriting(BatchWriting newBatchWriting);
- static final String BATCH_WRITING_PROPERTY = "batchWriting"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_BATCH_WRITING = "eclipselink.jdbc.batch-writing"; //$NON-NLS-1$
- static final BatchWriting DEFAULT_BATCH_WRITING = BatchWriting.none;
-
- Boolean getDefaultCacheStatements();
- Boolean getCacheStatements();
- void setCacheStatements(Boolean newCacheStatements);
- static final String CACHE_STATEMENTS_PROPERTY = "cacheStatements"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_STATEMENTS = "eclipselink.jdbc.cache-statements"; //$NON-NLS-1$
- static final Boolean DEFAULT_CACHE_STATEMENTS = Boolean.FALSE;
-
- Integer getDefaultCacheStatementsSize();
- Integer getCacheStatementsSize();
- void setCacheStatementsSize(Integer newCacheStatementsSize);
- static final String CACHE_STATEMENTS_SIZE_PROPERTY = "cacheStatementsSize"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_STATEMENTS_SIZE = "eclipselink.jdbc.cache-statements.size"; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_STATEMENTS_SIZE = Integer.valueOf(50);
-
- String getDefaultDriver();
- String getDriver();
- void setDriver(String newDriver);
- static final String DRIVER_PROPERTY = "driver"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DRIVER = "eclipselink.jdbc.driver"; //$NON-NLS-1$
- static final String DEFAULT_DRIVER = ""; //$NON-NLS-1$
-
- String getDefaultUrl();
- String getUrl();
- void setUrl(String newUrl);
- static final String URL_PROPERTY = "url"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_URL = "eclipselink.jdbc.url"; //$NON-NLS-1$
- static final String DEFAULT_URL = ""; //$NON-NLS-1$
-
- String getDefaultUser();
- String getUser();
- void setUser(String newUser);
- static final String USER_PROPERTY = "user"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_USER = "eclipselink.jdbc.user"; //$NON-NLS-1$
- static final String DEFAULT_USER = ""; //$NON-NLS-1$
-
- String getDefaultPassword();
- String getPassword();
- void setPassword(String newPassword);
- static final String PASSWORD_PROPERTY = "password"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_PASSWORD = "eclipselink.jdbc.password"; //$NON-NLS-1$
- static final String DEFAULT_PASSWORD = ""; //$NON-NLS-1$
-
- Boolean getDefaultBindParameters();
- Boolean getBindParameters();
- void setBindParameters(Boolean newBindParameters);
- static final String BIND_PARAMETERS_PROPERTY = "bindParameters"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_BIND_PARAMETERS = "eclipselink.jdbc.bind-parameters"; //$NON-NLS-1$
- static final Boolean DEFAULT_BIND_PARAMETERS = Boolean.TRUE;
-
- Boolean getDefaultReadConnectionsShared();
- Boolean getReadConnectionsShared();
- void setReadConnectionsShared(Boolean newReadConnectionsShared);
- static final String READ_CONNECTIONS_SHARED_PROPERTY = "readConnectionsShared"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_SHARED = "eclipselink.jdbc.read-connections.shared"; //$NON-NLS-1$
- static final Boolean DEFAULT_READ_CONNECTIONS_SHARED = Boolean.FALSE;
-
- Integer getDefaultReadConnectionsMin();
- Integer getReadConnectionsMin();
- void setReadConnectionsMin(Integer newReadConnectionsMin);
- static final String READ_CONNECTIONS_MIN_PROPERTY = "readConnectionsMin"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_MIN = "eclipselink.jdbc.read-connections.min"; //$NON-NLS-1$
- static final Integer DEFAULT_READ_CONNECTIONS_MIN = Integer.valueOf(2);
-
- Integer getDefaultReadConnectionsMax();
- Integer getReadConnectionsMax();
- void setReadConnectionsMax(Integer newReadConnectionsMax);
- static final String READ_CONNECTIONS_MAX_PROPERTY = "readConnectionsMax"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_MAX = "eclipselink.jdbc.read-connections.max"; //$NON-NLS-1$
- static final Integer DEFAULT_READ_CONNECTIONS_MAX = Integer.valueOf(2);
-
- Integer getDefaultWriteConnectionsMin();
- Integer getWriteConnectionsMin();
- void setWriteConnectionsMin(Integer newWriteConnectionsMin);
- static final String WRITE_CONNECTIONS_MIN_PROPERTY = "writeConnectionsMin"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WRITE_CONNECTIONS_MIN = "eclipselink.jdbc.write-connections.min"; //$NON-NLS-1$
- static final Integer DEFAULT_WRITE_CONNECTIONS_MIN = Integer.valueOf(5);
-
- Integer getDefaultWriteConnectionsMax();
- Integer getWriteConnectionsMax();
- void setWriteConnectionsMax(Integer newWriteConnectionsMax);
- static final String WRITE_CONNECTIONS_MAX_PROPERTY = "writeConnectionsMax"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WRITE_CONNECTIONS_MAX = "eclipselink.jdbc.write-connections.max"; //$NON-NLS-1$
- static final Integer DEFAULT_WRITE_CONNECTIONS_MAX = Integer.valueOf(10);
-
- ExclusiveConnectionMode getDefaultExclusiveConnectionMode();
- ExclusiveConnectionMode getExclusiveConnectionMode();
- void setExclusiveConnectionMode(ExclusiveConnectionMode newExclusiveConnectionMode);
- static final String EXCLUSIVE_CONNECTION_MODE_PROPERTY = "exclusiveConnectionMode"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE = "eclipselink.jdbc.exclusive-connection.mode"; //$NON-NLS-1$
- static final ExclusiveConnectionMode DEFAULT_EXCLUSIVE_CONNECTION_MODE = ExclusiveConnectionMode.transactional;
-
- Boolean getDefaultLazyConnection();
- Boolean getLazyConnection();
- void setLazyConnection(Boolean newLazyConnection);
- static final String LAZY_CONNECTION_PROPERTY = "lazyConnection"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LAZY_CONNECTION = "eclipselink.jdbc.exclusive-connection.is-lazy"; //$NON-NLS-1$
- static final Boolean DEFAULT_LAZY_CONNECTION = Boolean.TRUE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java
deleted file mode 100644
index 593779eb74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-
-/**
- * Connection2_0
- */
-public interface Connection2_0 extends Connection, JpaConnection2_0
-{
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java
deleted file mode 100644
index 3aac33b97d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-
-/**
- * Customization
- */
-public interface Customization extends PersistenceUnitProperties
-{
- Boolean getDefaultThrowExceptions();
- Boolean getThrowExceptions();
- void setThrowExceptions(Boolean newThrowExceptions);
- static final String THROW_EXCEPTIONS_PROPERTY = "throwExceptions"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_THROW_EXCEPTIONS = "eclipselink.orm.throw.exceptions"; //$NON-NLS-1$
- static final Boolean DEFAULT_THROW_EXCEPTIONS = Boolean.TRUE;
-
- Weaving getDefaultWeaving();
- Weaving getWeaving();
- void setWeaving(Weaving newWeaving);
- static final String WEAVING_PROPERTY = "weaving"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING = "eclipselink.weaving"; //$NON-NLS-1$
- static final Weaving DEFAULT_WEAVING = Weaving.true_;
-
- Boolean getDefaultWeavingLazy();
- Boolean getWeavingLazy();
- void setWeavingLazy(Boolean newWeavingLazy);
- static final String WEAVING_LAZY_PROPERTY = "weavingLazy"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_LAZY = "eclipselink.weaving.lazy"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_LAZY = Boolean.TRUE;
-
- Boolean getDefaultWeavingChangeTracking();
- Boolean getWeavingChangeTracking();
- void setWeavingChangeTracking(Boolean newWeavingChangeTracking);
- static final String WEAVING_CHANGE_TRACKING_PROPERTY = "weavingChangeTracking"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_CHANGE_TRACKING = "eclipselink.weaving.changetracking"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_CHANGE_TRACKING = Boolean.TRUE;
-
- Boolean getDefaultWeavingFetchGroups();
- Boolean getWeavingFetchGroups();
- void setWeavingFetchGroups(Boolean newWeavingFetchGroups);
- static final String WEAVING_FETCH_GROUPS_PROPERTY = "weavingFetchGroups"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_FETCH_GROUPS = "eclipselink.weaving.fetchgroups"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_FETCH_GROUPS = Boolean.TRUE;
-
- Boolean getDefaultWeavingInternal();
- Boolean getWeavingInternal();
- void setWeavingInternal(Boolean newWeavingInternal);
- static final String WEAVING_INTERNAL_PROPERTY = "weavingInternal"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_INTERNAL = "eclipselink.weaving.internal"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_INTERNAL = Boolean.TRUE;
-
- Boolean getDefaultWeavingEager();
- Boolean getWeavingEager();
- void setWeavingEager(Boolean newWeavingEager);
- static final String WEAVING_EAGER_PROPERTY = "weavingEager"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_EAGER = "eclipselink.weaving.eager"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_EAGER = Boolean.FALSE;
-
- String getDefaultDescriptorCustomizer();
- String getDescriptorCustomizerOf(String entityName);
- void setDescriptorCustomizerOf(String entityName, String newDescriptorCustomizer);
- static final String DESCRIPTOR_CUSTOMIZER_PROPERTY = "descriptorCustomizer"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DESCRIPTOR_CUSTOMIZER = "eclipselink.descriptor.customizer."; //$NON-NLS-1$
- static final String DEFAULT_DESCRIPTOR_CUSTOMIZER = null; // no default
-
- ListIterable<String> getSessionCustomizers();
- int getSessionCustomizersSize();
- boolean sessionCustomizerExists(String sessionCustomizerClassName);
- String addSessionCustomizer(String newSessionCustomizerClassName);
- void removeSessionCustomizer(String sessionCustomizerClassName);
- static final String SESSION_CUSTOMIZER_LIST = "sessionCustomizers"; //$NON-NLS-1$
- static final String SESSION_CUSTOMIZER_PROPERTY = "sessionCustomizer"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_CUSTOMIZER = "eclipselink.session.customizer"; //$NON-NLS-1$
- String ECLIPSELINK_SESSION_CUSTOMIZER_CLASS_NAME = "org.eclipse.persistence.config.SessionCustomizer"; //$NON-NLS-1$
-
- ListIterable<CustomizationEntity> getEntities();
- Iterable<String> getEntityNames();
- int getEntitiesSize();
- boolean entityExists(String entity);
- CustomizationEntity addEntity(String entity);
- void removeEntity(String entity);
- static final String ENTITIES_LIST = "entities"; //$NON-NLS-1$
-
- String getDefaultProfiler();
- String getProfiler();
- void setProfiler(String newProfiler);
- void setProfiler(Profiler newProfiler);
- static final String PROFILER_PROPERTY = "profiler"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_PROFILER = "eclipselink.profiler"; //$NON-NLS-1$
- static final String DEFAULT_PROFILER =
- AbstractPersistenceUnitProperties.getPropertyStringValueOf(Profiler.no_profiler);
- static final String[] RESERVED_PROFILER_NAMES = {Profiler.NO_PROFILER, Profiler.PERFORMANCE_PROFILER, Profiler.QUERY_MONITOR};
- String ECLIPSELINK_SESSION_PROFILER_CLASS_NAME = "org.eclipse.persistence.sessions.SessionProfiler"; //$NON-NLS-1$
-
- Boolean getDefaultValidationOnly();
- Boolean getValidationOnly();
- void setValidationOnly(Boolean newValidationOnly);
- static final String VALIDATION_ONLY_PROPERTY = "validationOnly"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_VALIDATION_ONLY = "eclipselink.validation-only"; //$NON-NLS-1$
- static final Boolean DEFAULT_VALIDATION_ONLY = Boolean.TRUE;
-
- String getDefaultExceptionHandler();
- String getExceptionHandler();
- void setExceptionHandler(String newExceptionHandler);
- static final String EXCEPTION_HANDLER_PROPERTY = "exceptionHandler"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCEPTION_HANDLER = "eclipselink.exception-handler"; //$NON-NLS-1$
- static final String DEFAULT_EXCEPTION_HANDLER = null; // no default
- String ECLIPSELINK_EXCEPTION_HANDLER_CLASS_NAME = "org.eclipse.persistence.exceptions.ExceptionHandler"; //$NON-NLS-1$
-
- Boolean getDefaultValidateSchema();
- Boolean getValidateSchema();
- void setValidateSchema(Boolean newValidateSchema);
- static final String VALIDATE_SCHEMA_PROPERTY = "validateSchema"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_VALIDATE_SCHEMA = "eclipselink.orm.validate.schema"; //$NON-NLS-1$
- static final Boolean DEFAULT_VALIDATE_SCHEMA = Boolean.FALSE;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java
deleted file mode 100644
index b57a6e8c8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import java.io.Serializable;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-
-/**
- * Entity
- */
-public class CustomizationEntity extends AbstractModel implements Cloneable, Serializable
-{
- private String name;
- private Customization parent;
-
- public static final String DESCRIPTOR_CUSTOMIZER_PROPERTY = Customization.DESCRIPTOR_CUSTOMIZER_PROPERTY;
-
- // ********** EclipseLink properties **********
- private String descriptorCustomizer;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public CustomizationEntity(Customization parent, String name) {
- this(parent);
- this.initialize(name);
- }
-
- private CustomizationEntity(Customization parent) {
- this.parent = parent;
- }
-
- private void initialize(String name) {
- if(StringTools.stringIsEmpty(name)) {
- throw new IllegalArgumentException();
- }
- this.name = name;
- }
-
- // ********** behaviors **********
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof CustomizationEntity)) {
- return false;
- }
- CustomizationEntity customizer = (CustomizationEntity) o;
- return (
- (this.descriptorCustomizer == null ?
- customizer.descriptorCustomizer == null :
- this.descriptorCustomizer.equals(customizer.descriptorCustomizer)));
- }
-
- @Override
- public int hashCode() {
- return (this.descriptorCustomizer == null) ? 0 : this.descriptorCustomizer.hashCode();
- }
-
- @Override
- public CustomizationEntity clone() {
- try {
- return (CustomizationEntity)super.clone();
- }
- catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean isEmpty() {
- return this.descriptorCustomizer == null;
- }
-
- public boolean entityNameIsValid() {
- return ! StringTools.stringIsEmpty(this.name);
- }
-
- public Customization getParent() {
- return this.parent;
- }
-
- // ********** getter/setter **********
- public String getName() {
- return this.name;
- }
-
- public String getDescriptorCustomizer() {
- return this.descriptorCustomizer;
- }
-
- public void setDescriptorCustomizer(String descriptorCustomizer) {
- String old = this.descriptorCustomizer;
- this.descriptorCustomizer = descriptorCustomizer;
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, descriptorCustomizer);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append("name: "); //$NON-NLS-1$
- sb.append(this.name);
- sb.append(", descriptorCustomizer: "); //$NON-NLS-1$
- sb.append(this.descriptorCustomizer);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java
deleted file mode 100644
index 7887b15b99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * DdlGenerationType
- */
-public enum DdlGenerationType {
- none,
- create_tables,
- drop_and_create_tables;
-
- // EclipseLink value string
- public static final String NONE = "none";
- public static final String CREATE_TABLES = "create-tables";
- public static final String DROP_AND_CREATE_TABLES = "drop-and-create-tables";
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java
deleted file mode 100644
index d707ccf2cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java
+++ /dev/null
@@ -1,1136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.NonEmptyStringFilter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.MappingFile;
-import org.eclipse.jpt.jpa.core.context.MappingFilePersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.context.MappingFileRoot;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.ImpliedMappingFileRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkCustomization;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkGeneralProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkSchemaGeneration;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink persistence unit
- */
-public class EclipseLinkPersistenceUnit
- extends AbstractPersistenceUnit
-{
- protected MappingFileRef impliedEclipseLinkMappingFileRef;
- /**
- * String constant associated with changes to the implied eclipselink mapping file ref
- */
- public static final String IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY = "impliedEclipseLinkMappingFileRef"; //$NON-NLS-1$
-
-
- private/*final*/ GeneralProperties generalProperties;
- private Customization customization;
- private Caching caching;
- private Logging logging;
- private SchemaGeneration schemaGeneration;
-
- /* global converter definitions, defined elsewhere in model */
- protected final Vector<EclipseLinkConverter> converters = new Vector<EclipseLinkConverter>();
-
- protected final Vector<ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumns = new Vector<ReadOnlyTenantDiscriminatorColumn2_3>();
-
- public EclipseLinkPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- super(parent, xmlPersistenceUnit);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
- this.setConverters(this.buildConverters());
-
- OrmEclipseLinkPersistenceUnitMetadata metadata = this.getEclipseLinkMetadata();
-
- EclipseLinkPersistenceUnitDefaults defaults = (metadata == null) ? null : metadata.getPersistenceUnitDefaults();
- this.setDefaultTenantDiscriminatorColumns(this.buildDefaultTenantDiscriminatorColumns(defaults));
- }
-
- protected OrmEclipseLinkPersistenceUnitMetadata getEclipseLinkMetadata() {
- MappingFilePersistenceUnitMetadata metadata = super.getMetadata();
- if (metadata instanceof OrmEclipseLinkPersistenceUnitMetadata) {
- return (OrmEclipseLinkPersistenceUnitMetadata) metadata;
- }
- return null;
- }
-
- // ********** properties **********
-
- public GeneralProperties getGeneralProperties() {
- return this.generalProperties;
- }
-
- @Override
- public Connection getConnection() {
- return (Connection) super.getConnection();
- }
-
- public Customization getCustomization() {
- return this.customization;
- }
-
- public Caching getCaching() {
- return this.caching;
- }
-
- public String getDefaultCacheTypePropertyValue() {
- Property cacheTypeDefaultProperty = getCacheTypeDefaultProperty();
- return cacheTypeDefaultProperty != null ? cacheTypeDefaultProperty.getValue() : null;
- }
-
- public String getDefaultCacheSizePropertyValue() {
- Property cacheSizeDefaultProperty = getCacheSizeDefaultProperty();
- return cacheSizeDefaultProperty != null ? cacheSizeDefaultProperty.getValue() : null;
- }
-
- public String getDefaultCacheSharedPropertyValue() {
- Property cacheSharedDefaultProperty = getCacheSharedDefaultProperty();
- return cacheSharedDefaultProperty != null ? cacheSharedDefaultProperty.getValue() : null;
- }
-
- public Logging getLogging() {
- return this.logging;
- }
-
- @Override
- public Options getOptions() {
- return (Options) super.getOptions();
- }
-
- public SchemaGeneration getSchemaGeneration() {
- return this.schemaGeneration;
- }
-
- protected GeneralProperties buildEclipseLinkGeneralProperties() {
- return new EclipseLinkGeneralProperties(this);
- }
-
- protected Connection buildEclipseLinkConnection() {
- return (Connection) this.getContextNodeFactory().buildConnection(this);
- }
-
- protected Customization buildEclipseLinkCustomization() {
- return new EclipseLinkCustomization(this);
- }
-
- protected Caching buildEclipseLinkCaching() {
- return new EclipseLinkCaching(this);
- }
-
- protected Logging buildEclipseLinkLogging() {
- return (Logging) this.getContextNodeFactory().buildLogging(this);
- }
-
- protected Options buildEclipseLinkOptions() {
- return (Options) this.getContextNodeFactory().buildOptions(this);
- }
-
- protected SchemaGeneration buildEclipseLinkSchemaGeneration() {
- return new EclipseLinkSchemaGeneration(this);
- }
-
- @Override
- protected void initializeProperties() {
- super.initializeProperties();
- this.generalProperties = this.buildEclipseLinkGeneralProperties();
- this.customization = this.buildEclipseLinkCustomization();
- this.caching = this.buildEclipseLinkCaching();
- this.logging = this.buildEclipseLinkLogging();
- this.schemaGeneration = this.buildEclipseLinkSchemaGeneration();
- }
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
- this.generalProperties.propertyValueChanged(propertyName, newValue);
- this.customization.propertyValueChanged(propertyName, newValue);
- this.caching.propertyValueChanged(propertyName, newValue);
- this.logging.propertyValueChanged(propertyName, newValue);
- this.schemaGeneration.propertyValueChanged(propertyName, newValue);
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
- this.generalProperties.propertyRemoved(propertyName);
- this.customization.propertyRemoved(propertyName);
- this.caching.propertyRemoved(propertyName);
- this.logging.propertyRemoved(propertyName);
- this.schemaGeneration.propertyRemoved(propertyName);
- }
-
-
- // ********** mapping file refs **********
-
- @Override
- public ListIterable<MappingFileRef> getMappingFileRefs() {
- return (this.impliedEclipseLinkMappingFileRef == null) ?
- super.getMappingFileRefs() :
- new CompositeListIterable<MappingFileRef>(super.getMappingFileRefs(), this.impliedEclipseLinkMappingFileRef);
- }
-
- @Override
- public int getMappingFileRefsSize() {
- return (this.impliedEclipseLinkMappingFileRef == null) ?
- super.getMappingFileRefsSize() :
- super.getMappingFileRefsSize() + 1;
- }
-
-
- // ********** implied eclipselink mapping file ref **********
-
- public MappingFileRef getImpliedEclipseLinkMappingFileRef() {
- return this.impliedEclipseLinkMappingFileRef;
- }
-
- protected MappingFileRef addImpliedEclipseLinkMappingFileRef() {
- if (this.impliedEclipseLinkMappingFileRef != null) {
- throw new IllegalStateException("The implied EclipseLink mapping file ref is already present: " + this.impliedEclipseLinkMappingFileRef); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = this.buildEclipseLinkImpliedMappingFileRef();
- this.impliedEclipseLinkMappingFileRef = mappingFileRef;
- this.firePropertyChanged(IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, null, mappingFileRef);
- return mappingFileRef;
- }
-
- private ImpliedMappingFileRef buildEclipseLinkImpliedMappingFileRef() {
- return new ImpliedMappingFileRef(this, JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- }
-
- protected void removeImpliedEclipseLinkMappingFileRef() {
- if (this.impliedEclipseLinkMappingFileRef == null) {
- throw new IllegalStateException("The implied EclipseLink mapping file ref is null."); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = this.impliedEclipseLinkMappingFileRef;
- this.impliedEclipseLinkMappingFileRef.dispose();
- this.impliedEclipseLinkMappingFileRef = null;
- this.firePropertyChanged(IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, mappingFileRef, null);
- }
-
- @Override
- protected void syncImpliedMappingFileRef() {
- super.syncImpliedMappingFileRef();
- if (this.impliedEclipseLinkMappingFileRef != null) {
- this.impliedEclipseLinkMappingFileRef.synchronizeWithResourceModel();
- }
- }
-
- @Override
- protected void updateImpliedMappingFileRef() {
- super.updateImpliedMappingFileRef();
-
- if (this.buildsImpliedEclipseLinkMappingFile()) {
- if (this.impliedEclipseLinkMappingFileRef == null) {
- this.addImpliedEclipseLinkMappingFileRef();
- } else {
- this.impliedEclipseLinkMappingFileRef.update();
- }
- } else {
- if (this.impliedEclipseLinkMappingFileRef != null) {
- this.removeImpliedEclipseLinkMappingFileRef();
- }
- }
- }
-
- /**
- * Build a virtual EclipseLink mapping file if all the following are true:<ul>
- * <li>the properties do not explicitly exclude it
- * <li>it is not specified explicitly in the persistence unit
- * <li>the file actually exists
- * </ul>
- */
- private boolean buildsImpliedEclipseLinkMappingFile() {
- return this.impliedEclipseLinkMappingFileIsNotExcluded() &&
- this.impliedEclipseLinkMappingFileIsNotSpecified() &&
- this.impliedEclipseLinkMappingFileExists();
- }
-
- protected boolean impliedEclipseLinkMappingFileIsNotExcluded() {
- return ! this.impliedEclipseLinkMappingFileIsExcluded();
- }
-
- protected boolean impliedEclipseLinkMappingFileIsExcluded() {
- return this.getGeneralProperties().getExcludeEclipselinkOrm() == Boolean.TRUE;
- }
-
- protected boolean impliedEclipseLinkMappingFileIsNotSpecified() {
- return ! this.impliedEclipseLinkMappingFileIsSpecified();
- }
-
- protected boolean impliedEclipseLinkMappingFileIsSpecified() {
- return this.mappingFileIsSpecified(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- }
-
- protected boolean impliedEclipseLinkMappingFileExists() {
- return this.getJpaProject().getDefaultEclipseLinkOrmXmlResource() != null;
- }
-
-
- // ********** default tenant discriminator columns **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * list of default tenant discriminator Columns
- */
- public static final String DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST = "defaultTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return new LiveCloneListIterable<ReadOnlyTenantDiscriminatorColumn2_3>(this.defaultTenantDiscriminatorColumns);
- }
-
- protected void setDefaultTenantDiscriminatorColumns(Iterable<ReadOnlyTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns) {
- this.synchronizeList(tenantDiscriminatorColumns, this.defaultTenantDiscriminatorColumns, DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST);
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> buildDefaultTenantDiscriminatorColumns(EclipseLinkPersistenceUnitDefaults defaults) {
- return (defaults == null) ? EmptyListIterable.<ReadOnlyTenantDiscriminatorColumn2_3> instance() : new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(defaults.getTenantDiscriminatorColumns());
- }
-
-
- // ********** converters **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * collection of "global" converters.
- */
- public static final String CONVERTERS_COLLECTION = "converters"; //$NON-NLS-1$
-
- /**
- * Return the "active" converters defined within the persistence unit's scope,
- * including converters with duplicate names. "Active" converters are:<ul>
- * <li>any converter defined in mapping files
- * <li>any converter defined via Java annotations that is not "overridden"
- * by a mapping file converter with the same name
- * </ul>
- * <strong>NB:</strong> A Java converter defined on a class or attribute
- * that is overridden in a mapping file is <em>not</em>, as a result,
- * itself overridden. A Java converter can only be overridden by a mapping
- * file converter with the same name.
- * <p>
- * <strong>NB:</strong> A Java converter defined on a class or attribute
- * whose corresponding mapping file mapping (or mapping file) is marked
- * "metadata complete" is ignored.
- */
- // TODO bjv change to getConverterNames() etc.
- public Iterable<EclipseLinkConverter> getAllConverters() {
- return this.getConverters();
- }
-
- public Iterable<EclipseLinkConverter> getConverters() {
- return new LiveCloneIterable<EclipseLinkConverter>(this.converters);
- }
-
- public int getConvertersSize() {
- return this.converters.size();
- }
-
- /**
- * Return the names of the "active" converters defined in the persistence
- * unit's scope, with duplicates removed.
- */
- public Iterable<String> getUniqueConverterNames() {
- return CollectionTools.set(this.getNonEmptyConverterNames(), this.getConvertersSize());
- }
-
- protected Iterable<String> getNonEmptyConverterNames() {
- return new FilteringIterable<String>(this.getConverterNames(), NonEmptyStringFilter.instance());
- }
-
- protected Iterable<String> getConverterNames() {
- return new TransformationIterable<EclipseLinkConverter, String>(this.getConverters(), JpaNamedContextNode.NameTransformer.<EclipseLinkConverter>instance());
- }
-
- protected void setConverters(Iterable<EclipseLinkConverter> converters) {
- this.synchronizeCollection(converters, this.converters, CONVERTERS_COLLECTION);
- }
-
- /**
- * Converters are much like queries.
- * @see #buildQueries()
- */
- protected Iterable<EclipseLinkConverter> buildConverters() {
- ArrayList<EclipseLinkConverter> result = CollectionTools.list(this.getMappingFileConverters());
-
- HashSet<String> mappingFileConverterNames = this.convertToNames(result);
- HashMap<String, ArrayList<EclipseLinkConverter>> javaConverters = this.mapByName(this.getAllJavaConverters());
- for (Map.Entry<String, ArrayList<EclipseLinkConverter>> entry : javaConverters.entrySet()) {
- if ( ! mappingFileConverterNames.contains(entry.getKey())) {
- result.addAll(entry.getValue());
- }
- }
-
- return result;
- }
-
- protected Iterable<EclipseLinkConverter> getMappingFileConverters() {
- return new CompositeIterable<EclipseLinkConverter>(this.getMappingFileConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getMappingFileConverterLists() {
- return new TransformationIterable<MappingFile, Iterable<EclipseLinkConverter>>(this.getMappingFiles()) {
- @Override
- protected Iterable<EclipseLinkConverter> transform(MappingFile mappingFile) {
- MappingFileRoot root = mappingFile.getRoot();
- return (root instanceof EclipseLinkEntityMappings) ?
- ((EclipseLinkEntityMappings) root).getMappingFileConverters() :
- EmptyIterable.<EclipseLinkConverter>instance();
- }
- };
- }
-
- /**
- * Include "overridden" Java converters.
- */
- public Iterable<EclipseLinkConverter> getAllJavaConverters() {
- return new CompositeIterable<EclipseLinkConverter>(this.getAllJavaTypeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getAllJavaTypeMappingConverterLists() {
- return new TransformationIterable<TypeMapping, Iterable<EclipseLinkConverter>>(this.getAllJavaTypeMappingsUnique()) {
- @Override
- protected Iterable<EclipseLinkConverter> transform(TypeMapping typeMapping) {
- // Java "null" type mappings are not EclipseLink mappings
- return (typeMapping instanceof EclipseLinkTypeMapping) ?
- ((EclipseLinkTypeMapping) typeMapping).getConverters() :
- EmptyIterable.<EclipseLinkConverter>instance();
- }
- };
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- @Override
- public EclipseLinkPersistenceXmlContextNodeFactory getContextNodeFactory() {
- return (EclipseLinkPersistenceXmlContextNodeFactory) super.getContextNodeFactory();
- }
-
- @Override
- public void setSpecifiedSharedCacheMode(SharedCacheMode specifiedSharedCacheMode) {
- super.setSpecifiedSharedCacheMode(specifiedSharedCacheMode);
-
- if(specifiedSharedCacheMode == SharedCacheMode.NONE) {
- this.caching.removeDefaultCachingProperties();
- }
- }
-
- @Override
- protected SharedCacheMode buildDefaultSharedCacheMode() {
- return SharedCacheMode.DISABLE_SELECTIVE;
- }
-
- @Override
- public boolean calculateDefaultCacheable() {
- SharedCacheMode sharedCacheMode = this.getSharedCacheMode();
- if (sharedCacheMode == null) {
- return true;
- }
- switch (sharedCacheMode) {
- case NONE:
- case ENABLE_SELECTIVE:
- return false;
- case ALL:
- case DISABLE_SELECTIVE:
- case UNSPECIFIED:
- return true;
- }
- return true;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateConverters(messages, reporter);
- }
-
- @Override
- protected void validateProperties(List<IMessage> messages, IReporter reporter) {
-
- if(this.isJpa2_0Compatible()) {
- for(Property property: this.getLegacyEntityCachingProperties()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING,
- new String[] {property.getName()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- }
- for(Property property: this.getLegacyDescriptorCustomizerProperties()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER,
- new String[] {property.getName()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- }
- this.validateDefaultCachingProperty(this.getCacheTypeDefaultProperty(), messages);
- this.validateDefaultCachingProperty(this.getCacheSizeDefaultProperty(), messages);
- this.validateDefaultCachingProperty(this.getFlushClearCacheProperty(), messages);
- this.validateLoggerProperty(this.getLoggerProperty(), messages);
- this.validateExceptionHandlerProperty(this.getExceptionHandlerProperty(), messages);
- this.validatePerformanceProfilerProperty(this.getPerformanceProfilerProperty(), messages);
- this.validateSessionCustomizerProperty(this.getSessionCustomizerProperties(), messages);
- }
- }
-
- protected void validateDefaultCachingProperty(Property cachingProperty, List<IMessage> messages) {
-
- if(this.getSharedCacheMode() == SharedCacheMode.NONE) {
- if(cachingProperty != null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED,
- new String[] {cachingProperty.getName()},
- this.getPersistenceUnit(),
- cachingProperty.getValidationTextRange()
- )
- );
- }
- }
- }
-
- protected void validateLoggerProperty(Property loggerProperty, List<IMessage> messages) {
- if ((loggerProperty == null) || (loggerProperty.getValue() == null) ) {
- return;
- }
-
- if (ArrayTools.contains(Logging.RESERVED_LOGGER_NAMES, loggerProperty.getValue())) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(loggerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_LOGGER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- loggerProperty.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, loggerProperty.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_LOGGER_CLASS_NOT_EXIST,
- new String[] {loggerProperty.getValue()},
- this.getPersistenceUnit(),
- loggerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, loggerProperty.getValue(), Logging.ECLIPSELINK_LOGGER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG,
- new String[] {loggerProperty.getValue()},
- this.getPersistenceUnit(),
- loggerProperty.getValidationTextRange()
- )
- );
- }
- }
-
- private void validateExceptionHandlerProperty(Property handlerProperty, List<IMessage> messages) {
- if ((handlerProperty == null) || (handlerProperty.getValue() == null) ) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(handlerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, handlerProperty.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_NOT_EXIST,
- new String[] {handlerProperty.getValue()},
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, handlerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_NOT_VALID,
- new String[] {handlerProperty.getValue()},
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, handlerProperty.getValue(), Customization.ECLIPSELINK_EXCEPTION_HANDLER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER,
- new String[] {handlerProperty.getValue()},
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- }
- }
-
- private void validatePerformanceProfilerProperty(Property profilerProperty, List<IMessage> messages) {
-
- if ((profilerProperty == null) || (profilerProperty.getValue() == null) ) {
- return;
- }
-
- if (ArrayTools.contains(Customization.RESERVED_PROFILER_NAMES, profilerProperty.getValue())) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(profilerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, profilerProperty.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_NOT_EXIST,
- new String[] {profilerProperty.getValue()},
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, profilerProperty.getValue())){
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_NOT_VALID,
- new String[] {profilerProperty.getValue()},
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, profilerProperty.getValue(), Customization.ECLIPSELINK_SESSION_PROFILER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_IMPLEMENTS_SESSIONP_ROFILER,
- new String[] {profilerProperty.getValue()},
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- }
- }
-
- private void validateSessionCustomizerProperty( Iterable<Property> properties, List<IMessage> messages) {
- for (Property property : properties) {
- if (property.getValue() == null) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(property.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, property.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_NOT_EXIST,
- new String[] {property.getValue()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- } else if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, property.getValue())){
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_NOT_VALID,
- new String[] {property.getValue()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, property.getValue(), Customization.ECLIPSELINK_SESSION_CUSTOMIZER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER,
- new String[] {property.getValue()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- }
- }
- }
-
-
- protected ArrayList<Property> getLegacyDescriptorCustomizerProperties() {
- ArrayList<Property> result = new ArrayList<Property>();
- CollectionTools.addAll(result, this.getDescriptorCustomizerProperties());
- return result;
- }
-
- protected ArrayList<Property> getLegacyEntityCachingProperties() {
- ArrayList<Property> result = new ArrayList<Property>();
- CollectionTools.addAll(result, this.getSharedCacheProperties());
- CollectionTools.addAll(result, this.getEntityCacheTypeProperties());
- CollectionTools.addAll(result, this.getEntityCacheSizeProperties());
- return result;
- }
-
- private Property getCacheTypeDefaultProperty() {
- return this.getProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT);
- }
-
- private Property getCacheSizeDefaultProperty() {
- return this.getProperty(Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT);
- }
-
- private Property getCacheSharedDefaultProperty() {
- return this.getProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT);
- }
-
- private Property getFlushClearCacheProperty() {
- return this.getProperty(Caching.ECLIPSELINK_FLUSH_CLEAR_CACHE);
- }
-
- /**
- * Returns all Shared Cache Properties, including Entity and default.
- */
- private Iterable<Property> getSharedCacheProperties() {
- return this.getPropertiesWithNamePrefix(Caching.ECLIPSELINK_SHARED_CACHE);
- }
-
- /**
- * Returns Entity Cache Size Properties, excluding default.
- */
- private Iterable<Property> getEntityCacheSizeProperties() {
- return this.getEntityPropertiesWithPrefix(Caching.ECLIPSELINK_CACHE_SIZE);
- }
-
- /**
- * Returns Entity Cache Type Properties, excluding default.
- */
- private Iterable<Property> getEntityCacheTypeProperties() {
- return this.getEntityPropertiesWithPrefix(Caching.ECLIPSELINK_CACHE_TYPE);
- }
-
- /**
- * Returns Descriptor Customizer Properties.
- */
- private Iterable<Property> getDescriptorCustomizerProperties() {
- return this.getEntityPropertiesWithPrefix(Customization.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER);
- }
-
- /**
- * Returns Entity Properties with the given prefix,
- * excluding Entity which name equals "default".
- */
- private Iterable<Property> getEntityPropertiesWithPrefix(String prefix) {
- return new FilteringIterable<Property>(this.getPropertiesWithNamePrefix(prefix)) {
- @Override
- protected boolean accept(Property next) {
- return ! next.getName().endsWith("default"); //$NON-NLS-1$
- }
- };
- }
-
- private Property getLoggerProperty() {
- return this.getProperty(Logging.ECLIPSELINK_LOGGER);
- }
-
- private Property getExceptionHandlerProperty() {
- return this.getProperty(Customization.ECLIPSELINK_EXCEPTION_HANDLER);
- }
-
- private Property getPerformanceProfilerProperty() {
- return this.getProperty(Customization.ECLIPSELINK_PROFILER);
- }
-
- /**
- * Returns all Session Customizer Properties.
- */
- private Iterable<Property> getSessionCustomizerProperties() {
- return this.getPropertiesWithNamePrefix(Customization.ECLIPSELINK_SESSION_CUSTOMIZER);
- }
-
- /**
- * <strong>NB:</strong> We validate converters here.
- * @see #validateGenerators(List, IReporter)
- */
- protected void validateConverters(List<IMessage> messages, IReporter reporter) {
- this.checkForDuplicateConverters(messages);
- for (EclipseLinkConverter converter : this.getConverters()) {
- this.validate(converter, messages, reporter);
- }
- }
-
- protected void checkForDuplicateConverters(List<IMessage> messages) {
- HashMap<String, ArrayList<EclipseLinkConverter>> convertersByName = this.mapByName(this.getConverters());
- for (Map.Entry<String, ArrayList<EclipseLinkConverter>> entry : convertersByName.entrySet()) {
- String converterName = entry.getKey();
- if (StringTools.stringIsNotEmpty(converterName)) { // ignore empty names
- ArrayList<EclipseLinkConverter> dups = entry.getValue();
- if (dups.size() > 1) {
- // if duplicate name exists, check the types of the converters with the duplicate name
- HashMap<Class<? extends JpaNamedContextNode>, ArrayList<EclipseLinkConverter>> convertersByType = this.mapByType(dups);
- // if more than one types of converters have the same name,
- // report duplicate error on every converter in the list;
- if (convertersByType.size() > 1) {
- String[] parms = new String[] {converterName};
- for (EclipseLinkConverter dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_DUPLICATE_NAME,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- } else {
- // otherwise if all the converters are with the same type, check every converter
- // to see if its definition is not identical with any one of the converters in the list;
- // if yes, report duplicate error on it; if not, doing nothing
- for (EclipseLinkConverter dup : dups) {
- String[] parms = new String[] {dup.getName()};
- if (hasDuplicateConverter(dup, dups)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_DUPLICATE_NAME,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- }
- }
- }
- }
- }
- }
-
- private boolean hasDuplicateConverter(EclipseLinkConverter converter, ArrayList<EclipseLinkConverter> converters) {
- boolean isDuplicate = false;
- for (int i=0; i<converters.size(); i++) {
- if (converter != converters.get(i) && !converter.isIdentical(converters.get(i))) {
- isDuplicate = true;
- }
- }
- return isDuplicate;
- }
-
- // TODO bjv isn't it obvious?
- protected TextRange extractNameTextRange(EclipseLinkConverter converter) {
- return (converter instanceof OrmEclipseLinkConverter<?>) ?
- ((OrmEclipseLinkConverter<?>) converter).getNameTextRange() :
- ((JavaEclipseLinkConverter<?>) converter).getNameTextRange(null);
- }
-
- // TODO bjv isn't it obvious?
- protected void validate(EclipseLinkConverter converter, List<IMessage> messages, IReporter reporter) {
- if (converter instanceof OrmEclipseLinkConverter<?>) {
- ((OrmEclipseLinkConverter<?>) converter).validate(messages, reporter);
- } else {
- ((JavaEclipseLinkConverter<?>) converter).validate(messages, reporter, null);
- }
- }
-
- @Override
- protected void checkForDuplicateGenerators(List<IMessage> messages) {
- HashMap<String, ArrayList<Generator>> generatorsByName = this.mapByName(this.getGenerators());
- for (Map.Entry<String, ArrayList<Generator>> entry : generatorsByName.entrySet()) {
- String generatorName = entry.getKey();
- if (StringTools.stringIsNotEmpty(generatorName)) { // ignore empty names
- ArrayList<Generator> dups = entry.getValue();
- if (dups.size() > 1) {
- // if duplicate name exists, check the types of the generators with the duplicate name
- HashMap<Class<? extends JpaNamedContextNode>, ArrayList<Generator>> generatorsByType = this.mapByType(dups);
- // if more than one types of generators have the same name,
- // report duplicate error on every generator in the list;
- if (generatorsByType.size() > 1) {
- String[] parms = new String[] {generatorName};
- for (Generator dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.GENERATOR_DUPLICATE_NAME,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- } else {
- // otherwise if all the generators are with the same type, check every generator
- // to see if its definition is not identical with any one of the generators in the list;
- // if yes, report duplicate error on it;
- for (Generator dup : dups) {
- String[] parms = new String[] {dup.getName()};
- if (hasDuplicateGenerator(dup, dups)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.GENERATOR_DUPLICATE_NAME,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- } else {
- // if not, report identical warning on it
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.GENERATOR_IDENTICAL,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- }
- }
- }
- }
- }
- }
-
- private boolean hasDuplicateGenerator(Generator generator, ArrayList<Generator> generators) {
- boolean isDuplicate = false;
- for (int i=0; i<generators.size(); i++) {
- if (generator != generators.get(i) && !generator.isIdentical(generators.get(i))) {
- isDuplicate = true;
- }
- }
- return isDuplicate;
- }
-
- @Override
- protected void checkForDuplicateQueries(List<IMessage> messages) {
- HashMap<String, ArrayList<Query>> queriesByName = this.mapByName(this.getQueries());
- for (Map.Entry<String, ArrayList<Query>> entry : queriesByName.entrySet()) {
- String queryName = entry.getKey();
- if (StringTools.stringIsNotEmpty(queryName)) { // ignore empty names
- ArrayList<Query> dups = entry.getValue();
- if (dups.size() > 1) {
- // if duplicate name exists, check the types of the queries with the duplicate name
- HashMap<Class<? extends JpaNamedContextNode>, ArrayList<Query>> querisByType = this.mapByType(dups);
- // if more than one types of queries have the same name,
- // report duplicate error on every query in the list;
- if (querisByType.size() > 1) {
- String[] parms = new String[] {queryName};
- for (Query dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.QUERY_DUPLICATE_NAME,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- } else {
- // otherwise if all the queries are with the same type, check every query
- // to see if its definition is not identical with any one of the queries in the list;
- // if yes, report duplicate error on it;
- for (Query dup : dups) {
- String[] parms = new String[] {dup.getName()};
- if (hasDuplicateQuery(dup, dups)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.QUERY_DUPLICATE_NAME,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- } else {
- // if not, report identical warning on it
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.QUERY_IDENTICAL,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- }
- }
- }
- }
- }
- }
-
- private boolean hasDuplicateQuery(Query query, ArrayList<Query> queries) {
- boolean isDuplicate = false;
- for (int i=0; i<queries.size(); i++) {
- if (query != queries.get(i) && !query.isIdentical(queries.get(i))) {
- isDuplicate = true;
- }
- }
- return isDuplicate;
- }
-
- private <N extends JpaNamedContextNode> HashMap<Class<? extends JpaNamedContextNode>, ArrayList<N>> mapByType(Iterable<N> nodes) {
- HashMap<Class<? extends JpaNamedContextNode>, ArrayList<N>> map =
- new HashMap<Class<? extends JpaNamedContextNode>, ArrayList<N>>();
- for (N node : nodes) {
- Class<? extends JpaNamedContextNode> type = node.getType();
- ArrayList<N> list = map.get(type);
- if (list == null) {
- list = new ArrayList<N>();
- map.put(type, list);
- }
- list.add(node);
- }
- return map;
- }
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- protected Iterable<ReplaceEdit> createPersistenceUnitPropertiesRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createPersistenceUnitPropertiesRenameTypeEdits(originalType, newName),
- this.customization.createRenameTypeEdits(originalType, newName),
- this.logging.createRenameTypeEdits(originalType, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected Iterable<ReplaceEdit> createPersistenceUnitPropertiesMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createPersistenceUnitPropertiesMoveTypeEdits(originalType, newPackage),
- this.customization.createMoveTypeEdits(originalType, newPackage),
- this.logging.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected Iterable<ReplaceEdit> createPersistenceUnitPropertiesRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createPersistenceUnitPropertiesRenamePackageEdits(originalPackage, newName),
- this.customization.createRenamePackageEdits(originalPackage, newName),
- this.logging.createRenamePackageEdits(originalPackage, newName)
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 8a21402ae9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextNodeFactory;
-
-public interface EclipseLinkPersistenceXmlContextNodeFactory extends PersistenceXmlContextNodeFactory
-{
-
- PersistenceUnitProperties buildLogging(PersistenceUnit parent);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java
deleted file mode 100644
index 8b60277fbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * ExclusiveConnectionMode
- */
-public enum ExclusiveConnectionMode {
- always,
- isolated,
- transactional;
-
- // EclipseLink value string
- static final String ALWAYS = "Always";
- static final String ISOLATED = "Isolated";
- static final String TRANSACTIONAL = "Transactional";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java
deleted file mode 100644
index b715ea701a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * FlushClearCache
- */
-public enum FlushClearCache {
- drop,
- drop_invalidate,
- merge;
-
- // EclipseLink value string
- public static final String DROP = "Drop";
- public static final String DROP_INVALIDATE = "DropInvalidate";
- public static final String MERGE = "Merge";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java
deleted file mode 100644
index c1516a7e99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * GeneralProperties
- */
-public interface GeneralProperties extends PersistenceUnitProperties
-{
-
- Boolean getDefaultExcludeEclipselinkOrm();
- Boolean getExcludeEclipselinkOrm();
- void setExcludeEclipselinkOrm(Boolean newExcludeEclipselinkOrm);
- static final String EXCLUDE_ECLIPSELINK_ORM_PROPERTY = "excludeEclipselinkOrm"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM = "eclipselink.exclude-eclipselink-orm"; //$NON-NLS-1$
- static final Boolean DEFAULT_EXCLUDE_ECLIPSELINK_ORM = Boolean.FALSE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java
deleted file mode 100644
index 75bc8f1c32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * Logger
- */
-public enum Logger {
- default_logger,
- java_logger,
- server_logger;
-
- // EclipseLink value string
- public static final String DEFAULT_LOGGER = "DefaultLogger"; //$NON-NLS-1$
- public static final String JAVA_LOGGER = "JavaLogger"; //$NON-NLS-1$
- public static final String SERVER_LOGGER = "ServerLogger"; //$NON-NLS-1$
-
- // EclipseLink logger class names
- public static final String DEFAULT_LOGGER_CLASS_NAME = "org.eclipse.persistence.logging.DefaultSessionLog"; //$NON-NLS-1$
- public static final String JAVA_LOGGER_CLASS_NAME = "org.eclipse.persistence.logging.JavaLog"; //$NON-NLS-1$
- public static final String SERVER_LOGGER_CLASS_NAME = "org.eclipse.persistence.platform.server.ServerLog"; //$NON-NLS-1$
-
- /**
- * Return the Logger value corresponding to the given literal.
- */
- public static Logger getLoggerFor(String literal) {
-
- for( Logger logger : Logger.values()) {
- if(logger.toString().equals(literal)) {
- return logger;
- }
- }
- return null;
- }
-
- public static String getLoggerClassName(String loggerValue) {
- if (loggerValue == DEFAULT_LOGGER) {
- return DEFAULT_LOGGER_CLASS_NAME;
- }
- if (loggerValue == JAVA_LOGGER) {
- return JAVA_LOGGER_CLASS_NAME;
- }
- if (loggerValue == SERVER_LOGGER) {
- return SERVER_LOGGER_CLASS_NAME;
- }
- return loggerValue;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java
deleted file mode 100644
index 237593b4b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-
-/**
- * Logging
- */
-public interface Logging extends PersistenceUnitProperties
-{
- LoggingLevel getDefaultLevel();
- LoggingLevel getLevel();
- void setLevel(LoggingLevel level);
- static final String LEVEL_PROPERTY = "level"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LEVEL = "eclipselink.logging.level"; //$NON-NLS-1$
- static final LoggingLevel DEFAULT_LEVEL = LoggingLevel.info;
-
- Boolean getDefaultTimestamp();
- Boolean getTimestamp();
- void setTimestamp(Boolean timestamp);
- static final String TIMESTAMP_PROPERTY = "timestamp"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TIMESTAMP = "eclipselink.logging.timestamp"; //$NON-NLS-1$
- static final Boolean DEFAULT_TIMESTAMP = Boolean.TRUE;
-
- Boolean getDefaultThread();
- Boolean getThread();
- void setThread(Boolean thread);
- static final String THREAD_PROPERTY = "thread"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_THREAD = "eclipselink.logging.thread"; //$NON-NLS-1$
- static final Boolean DEFAULT_THREAD = Boolean.TRUE;
-
- Boolean getDefaultSession();
- Boolean getSession();
- void setSession(Boolean session);
- static final String SESSION_PROPERTY = "session"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION = "eclipselink.logging.session"; //$NON-NLS-1$
- static final Boolean DEFAULT_SESSION = Boolean.TRUE;
-
- Boolean getDefaultExceptions();
- Boolean getExceptions();
- void setExceptions(Boolean exceptions);
- static final String EXCEPTIONS_PROPERTY = "exceptions"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCEPTIONS = "eclipselink.logging.exceptions"; //$NON-NLS-1$
- static final Boolean DEFAULT_EXCEPTIONS = Boolean.FALSE;
-
- String getDefaultLogFileLocation();
- String getLogFileLocation();
- void setLogFileLocation(String newLogFileLocation);
- static final String LOG_FILE_LOCATION_PROPERTY = "logFileLocation"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LOG_FILE_LOCATION = "eclipselink.logging.file"; //$NON-NLS-1$
- static final String DEFAULT_LOG_FILE_LOCATION = null; // No Default
-
- String getDefaultLogger();
- String getLogger();
- void setLogger(String newLogger);
- void setLogger(Logger newLogger);
- static final String LOGGER_PROPERTY = "logger"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LOGGER = "eclipselink.logging.logger"; //$NON-NLS-1$
- static final String DEFAULT_LOGGER =
- AbstractPersistenceUnitProperties.getPropertyStringValueOf(Logger.default_logger);
- static final String[] RESERVED_LOGGER_NAMES = {Logger.DEFAULT_LOGGER, Logger.JAVA_LOGGER, Logger.SERVER_LOGGER};
- String ECLIPSELINK_LOGGER_CLASS_NAME = "org.eclipse.persistence.logging.SessionLog"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java
deleted file mode 100644
index e273a09f9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * Logging2_0
- */
-public interface Logging2_0 extends Logging
-{
- public static final String CATEGORY_PREFIX_ = "eclipselink.logging.level."; //$NON-NLS-1$
-
- Boolean getDefaultConnection();
- Boolean getConnection();
- void setConnection(Boolean connection);
- static final String CONNECTION_PROPERTY = "connection"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CONNECTION = "eclipselink.logging.connection"; //$NON-NLS-1$
- static final Boolean DEFAULT_CONNECTION = Boolean.TRUE;
-
- LoggingLevel getCategoriesDefaultLevel();
- LoggingLevel getLevel(String category);
- void setLevel(String category, LoggingLevel level);
- void setDefaultLevel(LoggingLevel level);
- static final String CATEGORIES_DEFAULT_LOGGING_PROPERTY = "categoriesDefaultLoggingLevel"; //$NON-NLS-1$
-
- static final String SQL_CATEGORY_LOGGING_PROPERTY = "sqlLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "sql"; //$NON-NLS-1$
-
- static final String TRANSACTION_CATEGORY_LOGGING_PROPERTY = "transactionLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "transaction"; //$NON-NLS-1$
-
- static final String EVENT_CATEGORY_LOGGING_PROPERTY = "eventLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "event"; //$NON-NLS-1$
-
- static final String CONNECTION_CATEGORY_LOGGING_PROPERTY = "connectionLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "connection"; //$NON-NLS-1$
-
- static final String QUERY_CATEGORY_LOGGING_PROPERTY = "queryLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "query"; //$NON-NLS-1$
-
- static final String CACHE_CATEGORY_LOGGING_PROPERTY = "cacheLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "cache"; //$NON-NLS-1$
-
- static final String PROPAGATION_CATEGORY_LOGGING_PROPERTY = "propagationLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "propagation"; //$NON-NLS-1$
-
- static final String SEQUENCING_CATEGORY_LOGGING_PROPERTY = "sequencingLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "sequencing"; //$NON-NLS-1$
-
- static final String EJB_CATEGORY_LOGGING_PROPERTY = "ejbLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "ejb"; //$NON-NLS-1$
-
- static final String DMS_CATEGORY_LOGGING_PROPERTY = "dmsLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "dms"; //$NON-NLS-1$
-
- static final String EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY = "ejb_or_metadataLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "ejb_or_metadata"; //$NON-NLS-1$
-
- static final String METAMODEL_CATEGORY_LOGGING_PROPERTY = "jpa_metamodelLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "jpa_metamodel"; //$NON-NLS-1$
-
- static final String WEAVER_CATEGORY_LOGGING_PROPERTY = "weaverLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "weaver"; //$NON-NLS-1$
-
- static final String PROPERTIES_CATEGORY_LOGGING_PROPERTY = "propertiesLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "properties"; //$NON-NLS-1$
-
- static final String SERVER_CATEGORY_LOGGING_PROPERTY = "serverLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "server"; //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java
deleted file mode 100644
index 8ee1daf4e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * LoggingLevel
- */
-public enum LoggingLevel {
- off,
- severe,
- warning,
- info,
- config,
- fine,
- finer,
- finest,
- all;
-
- // EclipseLink value string
- public static final String OFF = "OFF";
- public static final String SEVERE = "SEVERE";
- public static final String WARNING = "WARNING";
- public static final String INFO = "INFO";
- public static final String CONFIG = "CONFIG";
- public static final String FINE = "FINE";
- public static final String FINER = "FINER";
- public static final String FINEST = "FINEST";
- public static final String ALL = "ALL";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java
deleted file mode 100644
index b7e1ca6309..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-
-/**
- * Session Options
- */
-public interface Options extends PersistenceUnitProperties
-{
- String getDefaultSessionName();
- String getSessionName();
- void setSessionName(String newSessionName);
- static final String SESSION_NAME_PROPERTY = "sessionName"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_NAME = "eclipselink.session-name"; //$NON-NLS-1$
- static final String DEFAULT_SESSION_NAME = ""; // no default //$NON-NLS-1$
-
- String getDefaultSessionsXml();
- String getSessionsXml();
- void setSessionsXml(String newSessionsXml);
- static final String SESSIONS_XML_PROPERTY = "sessionsXml"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSIONS_XML = "eclipselink.sessions-xml"; //$NON-NLS-1$
- static final String DEFAULT_SESSIONS_XML = ""; // no default //$NON-NLS-1$
-
- Boolean getDefaultIncludeDescriptorQueries();
- Boolean getIncludeDescriptorQueries();
- void setIncludeDescriptorQueries(Boolean newIncludeDescriptorQueries);
- static final String SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY = "includeDescriptorQueriesy"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES = "eclipselink.session.include.descriptor.queries"; //$NON-NLS-1$
- static final Boolean DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES = Boolean.TRUE;
-
- String getDefaultTargetDatabase();
- String getTargetDatabase();
- void setTargetDatabase(String newTargetDatabase);
- void setTargetDatabase(TargetDatabase newTargetDatabase);
- static final String TARGET_DATABASE_PROPERTY = "targetDatabase"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TARGET_DATABASE = "eclipselink.target-database"; //$NON-NLS-1$
- static final String DEFAULT_TARGET_DATABASE =
- AbstractPersistenceUnitProperties.getPropertyStringValueOf(TargetDatabase.auto);
-
- String getDefaultTargetServer();
- String getTargetServer();
- void setTargetServer(String newTargetServer);
- void setTargetServer(TargetServer newTargetServer);
- static final String TARGET_SERVER_PROPERTY = "targetServer"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TARGET_SERVER = "eclipselink.target-server"; //$NON-NLS-1$
- static final String DEFAULT_TARGET_SERVER =
- AbstractPersistenceUnitProperties.getPropertyStringValueOf(TargetServer.none);
-
- String getDefaultEventListener();
- String getEventListener();
- void setEventListener(String newEventListener);
- static final String SESSION_EVENT_LISTENER_PROPERTY = "eventListener"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_EVENT_LISTENER = "eclipselink.session-event-listener"; //$NON-NLS-1$
- static final String DEFAULT_SESSION_EVENT_LISTENER = null; // no default
- String ECLIPSELINK_EVENT_LISTENER_CLASS_NAME = "org.eclipse.persistence.sessions.SessionEventListener"; //$NON-NLS-1$
-
- Boolean getDefaultTemporalMutable();
- Boolean getTemporalMutable();
- void setTemporalMutable(Boolean temporalMutable);
- static final String TEMPORAL_MUTABLE_PROPERTY = "temporalMutable"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TEMPORAL_MUTABLE = "eclipselink.temporal.mutable"; //$NON-NLS-1$
- static final Boolean DEFAULT_TEMPORAL_MUTABLE = Boolean.FALSE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java
deleted file mode 100644
index 62fd2abb1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-
-/**
- * Options2_0
- */
-public interface Options2_0 extends Options, JpaOptions2_0
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java
deleted file mode 100644
index 804aa362ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * OutputMode
- */
-public enum OutputMode {
- both,
- sql_script,
- database;
-
- // EclipseLink value string
- public static final String BOTH = "both";
- public static final String DATABASE = "database";
- public static final String SQL_SCRIPT = "sql-script";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java
deleted file mode 100644
index 0536867286..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * Profiler
- */
-public enum Profiler {
- performance_profiler,
- query_monitor,
- no_profiler;
-
- // EclipseLink value string
- public static final String PERFORMANCE_PROFILER = "PerformanceProfiler"; //$NON-NLS-1$
- public static final String QUERY_MONITOR = "QueryMonitor"; //$NON-NLS-1$
- public static final String NO_PROFILER = "NoProfiler"; //$NON-NLS-1$
-
- // EclipseLink profiler class names
- public static final String PERFORMANCE_PROFILER_CLASS_NAME = "org.eclipse.persistence.tools.profiler.PerformanceProfiler"; //$NON-NLS-1$
- public static final String QUERY_MONITOR_CLASS_NAME = "org.eclipse.persistence.tools.profiler.QueryMonitor"; //$NON-NLS-1$
-
- /**
- * Return the Profiler value corresponding to the given literal.
- */
- public static Profiler getProfilerFor(String literal) {
-
- for( Profiler profiler : Profiler.values()) {
- if(profiler.toString().equals(literal)) {
- return profiler;
- }
- }
- return null;
- }
-
-
- public static String getProfilerClassName(String profilerValue) {
- if (profilerValue == PERFORMANCE_PROFILER) {
- return PERFORMANCE_PROFILER_CLASS_NAME;
- }
- if (profilerValue == QUERY_MONITOR) {
- return QUERY_MONITOR_CLASS_NAME;
- }
- return profilerValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java
deleted file mode 100644
index 5c26a32986..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * SchemaGeneration
- */
-public interface SchemaGeneration extends PersistenceUnitProperties
-{
- DdlGenerationType getDefaultDdlGenerationType();
- DdlGenerationType getDdlGenerationType();
- void setDdlGenerationType(DdlGenerationType ddlGenerationType);
- static final String DDL_GENERATION_TYPE_PROPERTY = "ddlGenerationType"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_TYPE = "eclipselink.ddl-generation"; //$NON-NLS-1$
- static final DdlGenerationType DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE = DdlGenerationType.none;
-
- OutputMode getDefaultOutputMode();
- OutputMode getOutputMode();
- void setOutputMode(OutputMode outputMode); // put
- static final String OUTPUT_MODE_PROPERTY = "outputMode"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE = "eclipselink.ddl-generation.output-mode"; //$NON-NLS-1$
- static final OutputMode DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE = null; // No Default
-
- String getDefaultCreateFileName();
- String getCreateFileName();
- void setCreateFileName(String createFileName);
- static final String CREATE_FILE_NAME_PROPERTY = "createFileName"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CREATE_FILE_NAME = "eclipselink.create-ddl-jdbc-file-name"; //$NON-NLS-1$
- static final String DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME = "createDDL.sql"; //$NON-NLS-1$
-
- String getDefaultDropFileName();
- String getDropFileName();
- void setDropFileName(String dropFileName);
- static final String DROP_FILE_NAME_PROPERTY = "dropFileName"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DROP_FILE_NAME = "eclipselink.drop-ddl-jdbc-file-name"; //$NON-NLS-1$
- static final String DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME = "dropDDL.sql"; //$NON-NLS-1$
-
- String getDefaultApplicationLocation();
- String getApplicationLocation();
- void setApplicationLocation(String applicationLocation);
- static final String APPLICATION_LOCATION_PROPERTY = "applicationLocation"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_APPLICATION_LOCATION = "eclipselink.application-location"; //$NON-NLS-1$
- static final String DEFAULT_SCHEMA_GENERATION_APPLICATION_LOCATION = null; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java
deleted file mode 100644
index 494be03fac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * TargetDatabase
- */
-public enum TargetDatabase {
- attunity,
- auto,
- cloudscape,
- database,
- db2,
- db2mainframe,
- dbase,
- derby,
- hsql,
- informix,
- javadb,
- maxdb,
- mysql,
- oracle,
- oracle11,
- oracle10,
- oracle9,
- oracle8,
- pointbase,
- postgresql,
- sqlanywhere,
- sqlserver,
- sybase,
- symfoware,
- timesten;
-
- // EclipseLink value string
- static final String ATTUNITY = "Attunity";
- static final String AUTO = "Auto";
- static final String CLOUDSCAPE = "Cloudscape";
- static final String DATABASE = "Database";
- static final String DB2 = "DB2";
- static final String DB2MAINFRAME = "DB2Mainframe";
- static final String DBASE = "DBase";
- static final String DERBY = "Derby";
- static final String HSQL = "HSQL";
- static final String INFORMIX = "Informix";
- static final String JAVADB = "JavaDB";
- static final String MAXDB = "MaxDB";
- static final String MYSQL = "MySQL";
- static final String ORACLE = "Oracle";
- static final String ORACLE11 = "Oracle11";
- static final String ORACLE10 = "Oracle10g";
- static final String ORACLE9 = "Oracle9i";
- static final String ORACLE8 = "Oracle8i";
- static final String POINTBASE = "PointBase";
- static final String POSTGRESQL = "PostgreSQL";
- static final String SQLANYWHERE = "SQLAnywhere";
- static final String SQLSERVER = "SQLServer";
- static final String SYBASE = "Sybase";
- static final String SYMFOWARE = "Symfoware";
- static final String TIMESTEN = "TimesTen";
-
- /**
- * Return the TargetDatabase value corresponding to the given literal.
- */
- public static TargetDatabase getTargetDatabaseFor(String literal) {
-
- for( TargetDatabase targetDatabase : TargetDatabase.values()) {
- if(targetDatabase.toString().equals(literal)) {
- return targetDatabase;
- }
- }
- return null;
- }
-
- public static boolean isOracleDatabase(String literal) {
- return literal.contains("Oracle");
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java
deleted file mode 100644
index bc933dc288..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * TargetServer
- */
-public enum TargetServer {
- none,
- oc4j,
- sunas9,
- websphere,
- websphere_6_1,
- websphere_7,
- weblogic,
- weblogic_9,
- weblogic_10,
- jboss,
- netweaver_7_1;
-
- // EclipseLink value string
- static final String NONE = "None";
- static final String OC4J = "OC4J";
- static final String SUNAS9 = "SunAS9";
- static final String WEBSPHERE = "WebSphere";
- static final String WEBSPHERE_6_1 = "WebSphere_6_1";
- static final String WEBSPHERE_7 = "WebSphere_7";
- static final String WEBLOGIC = "WebLogic";
- static final String WEBLOGIC_9 = "WebLogic_9";
- static final String WEBLOGIC_10 = "WebLogic_10";
- static final String JBOSS = "JBoss";
- static final String SAPNETWEAVER_7_1 = "NetWeaver_7_1";
-
- /**
- * Return the TargetServer value corresponding to the given literal.
- */
- public static TargetServer getTargetServerFor(String literal) {
-
- for( TargetServer targetServer : TargetServer.values()) {
- if(targetServer.toString().equals(literal)) {
- return targetServer;
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java
deleted file mode 100644
index 3019e5b543..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * Weaving
- */
-public enum Weaving {
- true_,
- false_,
- static_;
-
- // EclipseLink value string
- public static final String TRUE_ = "true";
- public static final String FALSE_ = "false";
- public static final String STATIC_ = "static";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java
deleted file mode 100644
index 7f05a02b57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedIdMappingDefinition2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedMappingDefinition2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaElementCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLink2_0PersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink 2.0 platform config
- */
-public abstract class AbstractEclipseLink2_0JpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- protected AbstractEclipseLink2_0JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_2_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition2_0.instance(),
- EclipseLinkJavaEmbeddableDefinition2_0.instance(),
- EclipseLinkJavaMappedSuperclassDefinition2_0.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.2 to 2.0
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMappingDefinition2_0.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMapMappingDefinition2_0.instance(),
- EclipseLinkJavaElementCollectionMappingDefinition2_0.instance(),
- EclipseLinkJavaIdMappingDefinition2_0.instance(),
- EclipseLinkJavaVersionMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMappingDefinition2_0.instance(),
- JavaEmbeddedMappingDefinition2_0.instance(),
- JavaEmbeddedIdMappingDefinition2_0.instance(),
- EclipseLinkJavaTransformationMappingDefinition2_0.instance(),
- EclipseLinkJavaManyToManyMappingDefinition2_0.instance(),
- EclipseLinkJavaManyToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- EclipseLink2_0PersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- GenericOrmXml2_0Definition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance(),
- EclipseLinkOrmXml1_2Definition.instance(),
- EclipseLinkOrmXml2_0Definition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java
deleted file mode 100644
index 2403108791..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class DefaultEclipseLinkJpaValidationMessages {
-
- private static String[] DEFAULT_PARMS = new String[0];
- private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
-
- public static IMessage buildMessage(
- int severity, String messageId, Object targetObject) {
- return buildMessage(severity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, String[] parms, Object targetObject) {
- return buildMessage(severity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, Object targetObject, TextRange textRange) {
- return buildMessage(severity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, String[] parms, Object targetObject, TextRange textRange) {
- IMessage message = new EclipseLinkMessage(EclipseLinkJpaValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- message.setMarkerId(JptJpaCorePlugin.VALIDATION_MARKER_ID); //TODO do we need an 'EclipseLink JPA' problem marker?
- if (textRange == null) {
- //log an exception and then continue without setting location information
- //At least the user will still get the validation message and will
- //be able to see other validation messages with valid textRanges
- JptJpaCorePlugin.log(new IllegalArgumentException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
- }
- else {
- message.setLineNo(textRange.getLineNumber());
- message.setOffset(textRange.getOffset());
- message.setLength(textRange.getLength());
- }
- return message;
- }
-
-
- private DefaultEclipseLinkJpaValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-
- /**
- * Used so that we can find the resource bundle using this classLoader.
- * Otherwise the wst validation message attempts to use the ClassLoader
- * of JpaValidator which is in the org.eclipse.jpt.jpa.core plugin.
- *
- * Another way we could potentially solve this is to have a separate
- * EclispeLinkJpaValidator and set up the extension points so that
- * it only runs against jpaProjects with the EclispeLinkPlatform
- * while JpaValidator runs against jpaProjects with the GenericPlatform.
- * I am unsure if this is possible
- */
- private static class EclipseLinkMessage extends Message {
- public EclipseLinkMessage(String aBundleName, int aSeverity, String anId, String[] aParams, Object aTargetObject) {
- super(aBundleName, aSeverity, anId, aParams, aTargetObject);
- }
-
- @Override
- public ResourceBundle getBundle(Locale locale, ClassLoader classLoader) {
- ResourceBundle bundle = null;
- try {
- bundle = ResourceBundle.getBundle(getBundleName(), locale, getClass().getClassLoader());
- } catch (MissingResourceException e) {
- return super.getBundle(locale, classLoader);
- }
- return bundle;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java
deleted file mode 100644
index 452c6b9bfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLink1_1JpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink1_1JpaPlatformFactory() {
- super();
- }
-
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLinkJpaFactory(),
- buildAnnotationProvider(),
- EclipseLink1_1JpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- };
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_1,
- JpaFacet.VERSION_1_0.getVersionString());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java
deleted file mode 100644
index fb4d28faed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLink1_1JpaPlatformProvider
- extends AbstractJpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink1_1JpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink1_1JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition.instance(),
- EclipseLinkJavaEmbeddableDefinition.instance(),
- EclipseLinkJavaMappedSuperclassDefinition.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.0 to 1.1
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.0 to 1.1
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition.instance(),
- EclipseLinkJavaBasicMapMappingDefinition.instance(),
- EclipseLinkJavaIdMappingDefinition.instance(),
- EclipseLinkJavaVersionMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- EclipseLinkJavaTransformationMappingDefinition.instance(),
- EclipseLinkJavaManyToManyMappingDefinition.instance(),
- EclipseLinkJavaManyToOneMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index f0776d8918..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.Access2_0AnnotationDefinition;
-
-/**
- * Provides annotations for 1.2 EclipseLink platform
- */
-public class EclipseLink1_2JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink1_2JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink1_2JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- definitions.add(Access2_0AnnotationDefinition.instance());
- }
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- // nothing new for EclipseLink 1.2
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java
deleted file mode 100644
index ceaf168d89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLink1_2JpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink1_2JpaPlatformFactory() {
- super();
- }
-
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLinkJpaFactory(),
- buildAnnotationProvider(),
- EclipseLink1_2JpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance(),
- EclipseLink1_2JpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- };
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_2,
- JpaFacet.VERSION_1_0.getVersionString());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java
deleted file mode 100644
index 1b31d88dbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLink1_2JpaPlatformProvider
- extends AbstractJpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink1_2JpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink1_2JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition.instance(),
- EclipseLinkJavaEmbeddableDefinition.instance(),
- EclipseLinkJavaMappedSuperclassDefinition.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.1 to 1.2
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.1 to 1.2
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition.instance(),
- EclipseLinkJavaBasicMapMappingDefinition.instance(),
- EclipseLinkJavaIdMappingDefinition.instance(),
- EclipseLinkJavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- EclipseLinkJavaTransformationMappingDefinition.instance(),
- EclipseLinkJavaManyToManyMappingDefinition.instance(),
- EclipseLinkJavaManyToOneMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance(),
- EclipseLinkOrmXml1_2Definition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index 95c6d0a071..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMapKeyConvert2_0AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 2.0 EclipseLink platform
- */
-public class EclipseLink2_0JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_0JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_0JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMapKeyConvert2_0AnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- // nothing new for EclipseLink 2.0
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java
deleted file mode 100644
index dce756d63c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.JpaDataSource;
-import org.eclipse.jpt.jpa.core.JpaProject.Config;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaOrderable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaColumn;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaOrderable;
-import org.eclipse.jpt.jpa.core.internal.jpa2.GenericJpaDatabaseIdentifierAdapter;
-import org.eclipse.jpt.jpa.core.internal.jpa2.GenericMetamodelSynchronizer;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaNamedQuery2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaOrphanRemoval2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaPersistentType2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaSequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0.Owner;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.NamedQuery2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkElementCollectionMapping2_0;
-
-/**
- * EclipseLink 2.0 factory
- */
-public class EclipseLink2_0JpaFactory
- extends EclipseLinkJpaFactory
- implements JpaFactory2_0
-{
- public EclipseLink2_0JpaFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- @Override
- public EclipseLinkJpaProject buildJpaProject(Config config) {
- if ( ! (config instanceof JpaProject2_0.Config)) {
- throw new IllegalArgumentException("config must be 2.0-compatible: " + config); //$NON-NLS-1$
- }
- return super.buildJpaProject(config);
- }
-
- public MetamodelSourceType.Synchronizer buildMetamodelSynchronizer(MetamodelSourceType sourceType) {
- return new GenericMetamodelSynchronizer(sourceType);
- }
-
- public DatabaseIdentifierAdapter buildDatabaseIdentifierAdapter(JpaDataSource dataSource) {
- return new GenericJpaDatabaseIdentifierAdapter(dataSource);
- }
-
-
- // ********** Java Context Model **********
-
- @Override
- public JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner, JavaResourceType jrt) {
- return new GenericJavaPersistentType2_0(owner, jrt);
- }
-
- @Override
- public JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent, SequenceGeneratorAnnotation annotation) {
- return new GenericJavaSequenceGenerator2_0(parent, (SequenceGenerator2_0Annotation) annotation);
- }
-
- //The 2.0 JPA spec supports association overrides on an embedded mapping while the 1.0 spec did not
- public JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaEmbeddedMapping2_0 parent, JavaAssociationOverrideContainer.Owner owner) {
- return new GenericJavaAssociationOverrideContainer(parent, owner);
- }
-
- public JavaDerivedIdentity2_0 buildJavaDerivedIdentity(JavaSingleRelationshipMapping2_0 parent) {
- return new GenericJavaDerivedIdentity2_0(parent);
- }
-
- public JavaElementCollectionMapping2_0 buildJavaElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkElementCollectionMapping2_0(parent);
- }
-
- public JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent) {
- return new GenericJavaCacheable2_0(parent);
- }
-
- public JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent) {
- return new GenericJavaOrphanRemoval2_0(parent);
- }
-
- @Override
- public JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent, NamedQueryAnnotation annotation) {
- return new GenericJavaNamedQuery2_0(parent, (NamedQuery2_0Annotation) annotation);
- }
-
- public JavaCollectionTable2_0 buildJavaCollectionTable(JavaElementCollectionMapping2_0 parent, Table.Owner owner) {
- return new GenericJavaCollectionTable2_0(parent, owner);
- }
-
- public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaReadOnlyNamedColumn.Owner owner) {
- return new GenericJavaOrderColumn2_0(parent, owner);
- }
-
- public JavaColumn buildJavaMapKeyColumn(JavaJpaContextNode parent, JavaColumn.Owner owner) {
- return new GenericJavaColumn(parent, owner);
- }
-
- public JavaOrderable2_0 buildJavaOrderable(JavaAttributeMapping parent, Owner owner) {
- return new GenericJavaOrderable(parent, owner);
- }
-
- @Override
- public JavaOrderable buildJavaOrderable(JavaAttributeMapping parent) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java
deleted file mode 100644
index 412486fc13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLink2_0JpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink2_0JpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- this.buildAnnotationProvider(),
- EclipseLink2_0JpaPlatformProvider.instance(),
- this.buildJpaVariation());
- }
-
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_0,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_0JpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return true;
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java
deleted file mode 100644
index 0cfa335424..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-
-/**
- * EclipseLink 2.0 platform config
- */
-public class EclipseLink2_0JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider
-{
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_0JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected EclipseLink2_0JpaPlatformProvider() {
- super();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index e02845ef1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkClassExtractor2_1AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 2.1 EclipseLink platform
- */
-public class EclipseLink2_1JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_1JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_1JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkClassExtractor2_1AnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- // nothing new for EclipseLink 2.1
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java
deleted file mode 100644
index fcd0abf99f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-
-public class EclipseLink2_1JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink2_1JpaPlatformFactory() {
- super();
- }
-
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- this.buildAnnotationProvider(),
- EclipseLink2_1JpaPlatformProvider.instance(),
- this.buildJpaVariation());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_1,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_1JpaAnnotationDefinitionProvider.instance());
- }
-
-// @Override
-// protected JpaPlatformVariation buildJpaVariation() {
-// return new JpaPlatformVariation() {
-// public Supported getTablePerConcreteClassInheritanceIsSupported() {
-// return Supported.YES;
-// }
-//
-// public boolean isJoinTableOverridable() {
-// return true;
-// }
-// };
-// }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java
deleted file mode 100644
index 9a5ed3063c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-
-/**
- * EclipseLink 2.1 platform config
- */
-public class EclipseLink2_1JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider
-{
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_1JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_1JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- definitions.add(EclipseLinkOrmXml2_1Definition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java
deleted file mode 100644
index d5ae541501..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-
-public class EclipseLink2_2JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink2_2JpaPlatformFactory() {
- super();
- }
-
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- this.buildAnnotationProvider(),
- EclipseLink2_2JpaPlatformProvider.instance(),
- this.buildJpaVariation());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_2,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_1JpaAnnotationDefinitionProvider.instance());
- }
-
-// @Override
-// protected JpaPlatformVariation buildJpaVariation() {
-// return new JpaPlatformVariation() {
-// public Supported getTablePerConcreteClassInheritanceIsSupported() {
-// return Supported.YES;
-// }
-//
-// public boolean isJoinTableOverridable() {
-// return true;
-// }
-// };
-// }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java
deleted file mode 100644
index 800abf8724..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_2Definition;
-
-public class EclipseLink2_2JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider
-{
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_2JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_2JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkOrmXml2_1Definition.instance(),
- EclipseLinkOrmXml2_2Definition.instance(),
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index 3b6b8832da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkClassExtractor2_1AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMultitenant2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 2.3 EclipseLink platform
- */
-public class EclipseLink2_3JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_3JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_3JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkClassExtractor2_1AnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMultitenant2_3AnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
- }
-
- protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
- EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.instance()
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java
deleted file mode 100644
index 3ef604182f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-
-
-public class EclipseLink2_3JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory {
-
- /**
- * zero-argument constructor
- */
- public EclipseLink2_3JpaPlatformFactory() {
- super();
- }
-
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- buildAnnotationProvider(),
- EclipseLink2_3JpaPlatformProvider.instance(),
- buildJpaVariation());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_3,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_3JpaAnnotationDefinitionProvider.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java
deleted file mode 100644
index 1f1cb80908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_3Definition;
-
-
-public class EclipseLink2_3JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_3JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_3JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkOrmXml2_1Definition.instance(),
- EclipseLinkOrmXml2_2Definition.instance(),
- EclipseLinkOrmXml2_3Definition.instance()
- };
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition2_3.instance(),
- EclipseLinkJavaEmbeddableDefinition2_0.instance(),
- EclipseLinkJavaMappedSuperclassDefinition2_3.instance()
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java
deleted file mode 100644
index 76f8db01cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-
-
-public class EclipseLink2_4JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory {
-
- /**
- * zero-argument constructor
- */
- public EclipseLink2_4JpaPlatformFactory() {
- super();
- }
-
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- buildAnnotationProvider(),
- EclipseLink2_4JpaPlatformProvider.instance(),
- buildJpaVariation());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_4,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_3JpaAnnotationDefinitionProvider.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java
deleted file mode 100644
index 2e83a921fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_3Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_4Definition;
-
-
-public class EclipseLink2_4JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_4JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_4JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkOrmXml2_1Definition.instance(),
- EclipseLinkOrmXml2_2Definition.instance(),
- EclipseLinkOrmXml2_3Definition.instance(),
- EclipseLinkOrmXml2_4Definition.instance()
- };
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition2_3.instance(),
- EclipseLinkJavaEmbeddableDefinition2_0.instance(),
- EclipseLinkJavaMappedSuperclassDefinition2_3.instance()
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java
deleted file mode 100644
index 1b0bb221d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 1.0 EclipseLink platform
- */
-public class EclipseLinkJpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLinkJpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- // nothing new for EclipseLink
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java
deleted file mode 100644
index 739a8dd196..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.Accessor;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaFactory;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkEmbeddableImpl;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkEntityImpl;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkMappedSuperclassImpl;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkVersionMapping;
-
-public class EclipseLinkJpaFactory
- extends AbstractJpaFactory
-{
- public EclipseLinkJpaFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- @Override
- public EclipseLinkJpaProject buildJpaProject(JpaProject.Config config) {
- return new EclipseLinkJpaProjectImpl(config);
- }
-
-
- // ********** Java Context Model overrides **********
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentAttribute(PersistentType parent, Accessor accessor) {
- return new JavaEclipseLinkPersistentAttribute(parent, accessor);
- }
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentField(PersistentType parent, JavaResourceField resourceField) {
- return new JavaEclipseLinkPersistentAttribute(parent, resourceField);
- }
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentProperty(PersistentType parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return new JavaEclipseLinkPersistentAttribute(parent, resourceGetter, resourceSetter);
- }
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkBasicMapping(parent);
- }
-
- @Override
- public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent, EmbeddableAnnotation embeddableAnnotation) {
- return new JavaEclipseLinkEmbeddableImpl(parent, embeddableAnnotation);
- }
-
- @Override
- public JavaEclipseLinkEntity buildJavaEntity(JavaPersistentType parent, EntityAnnotation entityAnnotation) {
- return new JavaEclipseLinkEntityImpl(parent, entityAnnotation);
- }
-
- @Override
- public JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkIdMapping(parent);
- }
-
- @Override
- public JavaEclipseLinkMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent, MappedSuperclassAnnotation mappedSuperclassAnnotation) {
- return new JavaEclipseLinkMappedSuperclassImpl(parent, mappedSuperclassAnnotation);
- }
-
- @Override
- public JavaVersionMapping buildJavaVersionMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkVersionMapping(parent);
- }
-
- @Override
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkOneToManyMapping(parent);
- }
-
- @Override
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkOneToOneMapping(parent);
- }
-
- @Override
- public JavaManyToManyMapping buildJavaManyToManyMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkManyToManyMapping(parent);
- }
-
- @Override
- public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkManyToOneMapping(parent);
- }
-
-
- // ********** EclipseLink-specific Java Context Model **********
-
- public JavaEclipseLinkBasicCollectionMapping buildJavaEclipseLinkBasicCollectionMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkBasicCollectionMapping(parent);
- }
-
- public JavaEclipseLinkBasicMapMapping buildJavaEclipseLinkBasicMapMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkBasicMapMapping(parent);
- }
-
- public JavaEclipseLinkTransformationMapping buildJavaEclipseLinkTransformationMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkTransformationMapping(parent);
- }
-
- public JavaEclipseLinkVariableOneToOneMapping buildJavaEclipseLinkVariableOneToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkVariableOneToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
deleted file mode 100644
index 5b510eebc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.Comparator;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.SimpleVersion;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.wst.common.project.facet.core.DefaultVersionComparator;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLinkJpaPlatformFactory
- implements JpaPlatformFactory
-{
-
- /**
- * zero-argument constructor
- */
- public EclipseLinkJpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLinkJpaFactory(),
- buildAnnotationProvider(),
- EclipseLinkJpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_0,
- JpaFacet.VERSION_1_0.getVersionString());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.NO;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- };
- }
-
-
- public static class EclipseLinkVersion extends SimpleVersion {
- public static final Comparator<String> VERSION_COMPARATOR = new DefaultVersionComparator();
-
- protected final String eclipseLinkVersion;
-
- public EclipseLinkVersion(String eclipseLinkVersion, String jpaVersion) {
- super(jpaVersion);
- this.eclipseLinkVersion = eclipseLinkVersion;
- }
-
- @Override
- public String getVersion() {
- return this.eclipseLinkVersion;
- }
-
- /**
- * Return whether the platform is compatible with the specified EclipseLink version.
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_1_0
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_1_1
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_1_2
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_0
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_1
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_2
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_3
- */
- public boolean isCompatibleWithVersion(String version) {
- return VERSION_COMPARATOR.compare(this.eclipseLinkVersion, version) >= 0;
- }
-
- @Override
- public String toString() {
- return super.toString() + " EclipseLink version: " + this.getVersion(); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java
deleted file mode 100644
index 641e5b14a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLinkJpaPlatformProvider
- extends AbstractJpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLinkJpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJpaPlatformProvider() {
- super();
- }
-
-
- // ********* resource models *********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition.instance(),
- EclipseLinkJavaEmbeddableDefinition.instance(),
- EclipseLinkJavaMappedSuperclassDefinition.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition.instance(),
- EclipseLinkJavaBasicMapMappingDefinition.instance(),
- EclipseLinkJavaIdMappingDefinition.instance(),
- EclipseLinkJavaVersionMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- EclipseLinkJavaTransformationMappingDefinition.instance(),
- EclipseLinkJavaManyToManyMappingDefinition.instance(),
- EclipseLinkJavaManyToOneMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java
deleted file mode 100644
index d354457ad5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaProject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-/**
- * EclipseLink-specific JPA project.
- */
-public class EclipseLinkJpaProjectImpl
- extends AbstractJpaProject
- implements EclipseLinkJpaProject {
-
- public EclipseLinkJpaProjectImpl(JpaProject.Config config) {
- super(config);
- }
-
- public JpaXmlResource getDefaultEclipseLinkOrmXmlResource() {
- return (JpaXmlResource) this.getResourceModel(
- JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH,
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java
deleted file mode 100644
index 9a85ca62f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-@SuppressWarnings("nls")
-public interface EclipseLinkJpaValidationMessages {
-
- public static final String BUNDLE_NAME = "eclipselink_jpa_validation";
-
- public static final String CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED = "CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED";
-
- public static final String CONVERTER_CLASS_IMPLEMENTS_CONVERTER = "CONVERTER_CLASS_IMPLEMENTS_CONVERTER";
-
- public static final String STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER = "STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER";
-
- public static final String CONVERTER_DUPLICATE_NAME = "CONVERTER_DUPLICATE_NAME";
-
- public static final String CONVERTER_NAME_UNDEFINED = "CONVERTER_NAME_UNDEFINED";
-
- public static final String RESERVED_CONVERTER_NAME = "RESERVED_CONVERTER_NAME";
-
- public static final String CONVERTER_CLASS_EXISTS = "CONVERTER_CLASS_EXISTS";
-
- public static final String CONVERTER_CLASS_DEFINED = "CONVERTER_CLASS_DEFINED";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED = "DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST = "DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID = "DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER = "DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER";
-
- public static final String EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED = "EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED";
-
- public static final String EXCEPTION_HANDLER_CLASS_NOT_EXIST = "EXCEPTION_HANDLER_CLASS_NOT_EXIST";
-
- public static final String EXCEPTION_HANDLER_CLASS_NOT_VALID = "EXCEPTION_HANDLER_CLASS_NOT_VALID";
-
- public static final String EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER = "EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER";
-
- public static final String GENERATOR_DUPLICATE_NAME = "GENERATOR_DUPLICATE_NAME";
-
- public static final String GENERATOR_IDENTICAL = "GENERATOR_IDENTICAL";
-
- public static final String ID_MAPPING_UNRESOLVED_CONVERTER_NAME = "ID_MAPPING_UNRESOLVED_CONVERTER_NAME";
-
- public static final String MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE = "MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE";
-
- public static final String PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE = "PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE";
-
- public static final String PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER = "PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER";
-
- public static final String PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING = "PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING";
-
- public static final String PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED = "PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED";
-
- public static final String QUERY_DUPLICATE_NAME = "QUERY_DUPLICATE_NAME";
-
- public static final String QUERY_IDENTICAL = "QUERY_IDENTICAL";
-
- public static final String SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED = "SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED";
-
- public static final String SESSION_CUSTOMIZER_CLASS_NOT_EXIST = "SESSION_CUSTOMIZER_CLASS_NOT_EXIST";
-
- public static final String SESSION_CUSTOMIZER_CLASS_NOT_VALID = "SESSION_CUSTOMIZER_CLASS_NOT_VALID";
-
- public static final String SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER = "SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER";
-
- public static final String SESSION_LOGGER_CLASS_NOT_SPECIFIED = "SESSION_LOGGER_CLASS_NOT_SPECIFIED";
-
- public static final String SESSION_LOGGER_CLASS_NOT_EXIST = "SESSION_LOGGER_CLASS_NOT_EXIST";
-
- public static final String SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG = "SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG";
-
- public static final String SESSION_PROFILER_CLASS_NOT_SPECIFIED = "SESSION_PROFILER_CLASS_NOT_SPECIFIED";
-
- public static final String SESSION_PROFILER_CLASS_NOT_EXIST = "SESSION_PROFILER_CLASS_NOT_EXIST";
-
- public static final String SESSION_PROFILER_CLASS_NOT_VALID = "SESSION_PROFILER_CLASS_NOT_VALID";
-
- public static final String SESSION_PROFILER_CLASS_IMPLEMENTS_SESSIONP_ROFILER = "SESSION_PROFILER_CLASS_IMPLEMENTS_SESSION_PROFILER";
-
- public static final String BASIC_COLLECTION_MAPPING_DEPRECATED = "BASIC_COLLECTION_MAPPING_DEPRECATED";
-
- public static final String BASIC_MAP_MAPPING_DEPRECATED = "BASIC_MAP_MAPPING_DEPRECATED";
-
- public static final String TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC = "TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC";
-
- public static final String TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME = "TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME = "VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME";
- public static final String TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID = "TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID = "VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID="VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID";
- public static final String MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS = "MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS";
- public static final String MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY = "MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY";
- public static final String MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED = "MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED";
- public static final String MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED = "MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED";
- public static final String MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM = "MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java
deleted file mode 100644
index d6d8ed6086..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm.EclipseLinkOrmXmlResourceProvider;
-
-/**
- * EclipseLink orm.xml
- */
-public class EclipseLinkOrmResourceModelProvider
- implements JpaResourceModelProvider
-{
- // singleton
- private static final JpaResourceModelProvider INSTANCE = new EclipseLinkOrmResourceModelProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmResourceModelProvider() {
- super();
- }
-
-
- public IContentType getContentType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
- public JpaXmlResource buildResourceModel(JpaProject jpaProject, IFile file) {
- return EclipseLinkOrmXmlResourceProvider.getXmlResourceProvider(file).getXmlResource();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java
deleted file mode 100644
index 0ada0fb11b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractTypeMappingValidator;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractEclipseLinkTypeMappingValidator<T extends TypeMapping>
- extends AbstractTypeMappingValidator<T>
-{
- protected AbstractEclipseLinkTypeMappingValidator(T typeMapping, JavaResourceType jrt, TypeMappingTextRangeResolver textRangeResolver) {
- super(typeMapping, jrt, textRangeResolver);
- }
-
-
- @Override
- protected void validateType(List<IMessage> messages) {
- if (this.isMemberType() && !this.isStaticType()) {
- messages.add(this.buildEclipseLinkTypeMessage(EclipseLinkJpaValidationMessages.TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC));
- }
- if (!this.hasNoArgConstructor()) {
- messages.add(this.buildTypeMessage(JpaValidationMessages.TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR));
- }
- }
-
- protected IMessage buildEclipseLinkTypeMessage(String msgID) {
- return DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- new String[] {this.typeMapping.getName()},
- this.typeMapping,
- this.textRangeResolver.getTypeMappingTextRange()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java
deleted file mode 100644
index 8a9057b880..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.ConverterTextRangeResolver;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkConvertValidator
- implements JptValidator
-{
- protected final EclipseLinkConvert convert;
-
- protected final ConverterTextRangeResolver textRangeResolver;
-
-
- public EclipseLinkConvertValidator(EclipseLinkConvert convert, ConverterTextRangeResolver textRangeResolver) {
- super();
- this.convert = convert;
- this.textRangeResolver = textRangeResolver;
- }
-
- protected AttributeMapping getAttributeMapping() {
- return this.convert.getParent();
- }
-
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return this.convert.getPersistenceUnit();
- }
-
- /**
- * The converters are validated in the persistence unit.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit#validateConverters(List, IReporter)
- */
- public boolean validate(List<IMessage> messages, IReporter reporter) {
- // converters are validated in the persistence unit
- return this.validateConverterName(messages);
- }
-
-
- private boolean validateConverterName(List<IMessage> messages) {
- String converterName = this.convert.getConverterName();
- if (converterName == null) {
- return true;
- }
-
- if (CollectionTools.contains(this.getPersistenceUnit().getUniqueConverterNames(), converterName)) {
- return true;
- }
-
- if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, converterName)) {
- return true;
- }
-
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.ID_MAPPING_UNRESOLVED_CONVERTER_NAME,
- new String[] {
- converterName,
- this.getAttributeMapping().getName()
- },
- this.getAttributeMapping(),
- this.textRangeResolver.getConverterTextRange()
- )
- );
- return false;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java
deleted file mode 100644
index b0c1a88645..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractEntityPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkEntityPrimaryKeyValidator
- extends AbstractEntityPrimaryKeyValidator
-{
- public EclipseLinkEntityPrimaryKeyValidator(
- EclipseLinkEntity entity, PrimaryKeyTextRangeResolver textRangeResolver) {
-
- super(entity, textRangeResolver);
- }
-
-
- @Override
- protected EclipseLinkEntity entity() {
- return (EclipseLinkEntity) typeMapping();
- }
-
- // in EclipseLink, a hierarchy may define its primary key on multiple classes, so long as the
- // root entity has a coherent defined primary key.
- // However, the id class may only be defined on one class in the hierarchy.
- @Override
- protected void validatePrimaryKeyIsNotRedefined(List<IMessage> messages, IReporter reporter) {
- if (idClassReference().isSpecified() && definesIdClassOnAncestor(typeMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_REDEFINED,
- new String[0],
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
- }
-
- @Override
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
- return super.definesPrimaryKey(typeMapping)
- || ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyColumns();
- }
-
- @Override
- protected boolean specifiesIdClass() {
- return super.specifiesIdClass() || definesIdClass(typeMapping());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
deleted file mode 100644
index c19560b114..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkMappedSuperclassPrimaryKeyValidator
- extends AbstractMappedSuperclassPrimaryKeyValidator
-{
- public EclipseLinkMappedSuperclassPrimaryKeyValidator(
- EclipseLinkMappedSuperclass mappedSuperclass, PrimaryKeyTextRangeResolver textRangeResolver) {
-
- super(mappedSuperclass, textRangeResolver);
- }
-
-
- @Override
- protected EclipseLinkMappedSuperclass mappedSuperclass() {
- return (EclipseLinkMappedSuperclass) typeMapping();
- }
-
- // in EclipseLink, a hierarchy may define its primary key on multiple classes, so long as the
- // root entity has a coherent defined primary key.
- // However, the id class may only be defined on one class in the hierarchy.
- @Override
- protected void validatePrimaryKeyIsNotRedefined(List<IMessage> messages, IReporter reporter) {
- if (idClassReference().isSpecified() && definesIdClassOnAncestor(typeMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_REDEFINED,
- new String[0],
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
- }
-
- // in EclipseLink, it's only the root entity where this matters
- @Override
- protected void validateIdClassIsUsedIfNecessary(List<IMessage> messages, IReporter reporter) {
- // no op
- }
-
- // in EclipseLink, it's only the root entity where this matters
- @Override
- protected void validateIdClass(JavaPersistentType idClass, List<IMessage> messages, IReporter reporter) {
- // no op
- }
-
- @Override
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
- return super.definesPrimaryKey(typeMapping)
- || ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyColumns();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java
deleted file mode 100644
index aab2123010..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkMappedSuperclassValidator
- extends AbstractEclipseLinkTypeMappingValidator<MappedSuperclass>
-{
- public EclipseLinkMappedSuperclassValidator(MappedSuperclass mappedSuperclass, JavaResourceType jrt, TypeMappingTextRangeResolver textRangeResolver) {
- super(mappedSuperclass, jrt, textRangeResolver);
- }
-
-
- @Override
- protected void validateType(List<IMessage> messages) {
- if (this.isFinalType()) {
- messages.add(this.buildTypeMessage(JpaValidationMessages.TYPE_MAPPING_FINAL_CLASS));
- }
- super.validateType(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java
deleted file mode 100644
index 1a0f14d1b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.PersistentAttributeTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractPersistentAttributeValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkPersistentAttributeValidator
- extends AbstractPersistentAttributeValidator
-{
- public EclipseLinkPersistentAttributeValidator(
- ReadOnlyPersistentAttribute persistentAttribute, PersistentAttributeTextRangeResolver textRangeResolver)
- {
- super(persistentAttribute, textRangeResolver);
- }
-
- /**
- * EclipseLink does not have the same restrictions on the
- * attribute as the JPA spec does (e.g. the spec prohibits a field from
- * being public).
- */
- @Override
- protected void validateMappedAttribute(List<IMessage> messages) {
- return;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java
deleted file mode 100644
index a2f720f05f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
-
-public class EclipseLinkTypeMappingValidator
- extends AbstractEclipseLinkTypeMappingValidator<TypeMapping>
-{
- public EclipseLinkTypeMappingValidator(TypeMapping typeMapping, JavaResourceType jrt, TypeMappingTextRangeResolver textRangeResolver) {
- super(typeMapping, jrt, textRangeResolver);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java
deleted file mode 100644
index 0ca15e5edc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractNamedColumnValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.EntityTableDescriptionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class TenantDiscriminatorColumnValidator2_3
- extends AbstractNamedColumnValidator<ReadOnlyTenantDiscriminatorColumn2_3, NamedColumnTextRangeResolver>
-{
- public TenantDiscriminatorColumnValidator2_3(
- ReadOnlyTenantDiscriminatorColumn2_3 namedColumn,
- NamedColumnTextRangeResolver textRangeResolver) {
- super(namedColumn, textRangeResolver, new EntityTableDescriptionProvider());
- }
-
- @Override
- protected JptValidator buildTableValidator() {
- return new TableValidator();
- }
-
- @Override
- protected IMessage buildUnresolvedNameMessage(String message) {
- return DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- message,
- new String[] {
- this.column.getName(),
- this.column.getDbTable().getName()
- },
- this.column,
- this.textRangeResolver.getNameTextRange()
- );
- }
-
- @Override
- protected IMessage buildUnresolvedNameMessage() {
- return this.column.isVirtual() ?
- this.buildUnresolvedNameMessage(this.getVirtualTenantDiscriminatorColumnUnresolvedNameMessage()) :
- super.buildUnresolvedNameMessage();
- }
-
- protected String getVirtualTenantDiscriminatorColumnUnresolvedNameMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getUnresolvedNameMessage() {
- return EclipseLinkJpaValidationMessages.TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedNameMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
- }
-
-
- // ********** table validator **********
-
- protected class TableValidator
- extends BaseColumnTableValidator
- {
- protected TableValidator() {
- super();
- }
-
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getColumn() {
- return (ReadOnlyTenantDiscriminatorColumn2_3) super.getColumn();
- }
-
- @Override
- protected IMessage buildTableNotValidMessage_() {
- return DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getColumnTableNotValidMessage(),
- new String[] {
- this.getColumn().getTable(),
- this.getColumn().getName(),
- this.getColumnTableDescriptionMessage()
- },
- this.getColumn(),
- this.getTextRangeResolver().getTableTextRange()
- );
- }
-
- @Override
- protected String getColumnTableNotValidMessage() {
- return this.getColumn().isVirtual() ?
- this.getVirtualTenantDiscriminatorColumnTableNotValidMessage() :
- this.getColumnTableNotValidMessage_();
- }
-
- protected String getVirtualTenantDiscriminatorColumnTableNotValidMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID;
- }
-
- protected String getColumnTableNotValidMessage_() {
- return EclipseLinkJpaValidationMessages.TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getVirtualAttributeColumnTableNotValidMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java
deleted file mode 100644
index 9697611f6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-public class EclipseLinkJavaBasicCollectionMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicCollectionMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicCollectionMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkBasicCollectionMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java
deleted file mode 100644
index 4e73f3e103..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaBasicCollectionMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaBasicCollectionMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicCollectionMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicCollectionMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java
deleted file mode 100644
index 498cbfbb94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-public class EclipseLinkJavaBasicMapMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMapMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMapMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkBasicMapMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java
deleted file mode 100644
index 3aa06e0148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaBasicMapMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaBasicMapMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMapMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMapMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java
deleted file mode 100644
index 2c0ab5a74a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-public class EclipseLinkJavaBasicMappingDefinition
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = JavaBasicMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMappingDefinition() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkMutableAnnotation.ANNOTATION_NAME,
- EclipseLinkConvertAnnotation.ANNOTATION_NAME,
- };
- // 'public' because the EclipseLink Id and Version mappings also support these annotations
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java
deleted file mode 100644
index 961bf8bd5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaBasicMappingDefinition2_0;
-
-public class EclipseLinkJavaBasicMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaBasicMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return EclipseLinkJavaBasicMappingDefinition.instance().isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java
deleted file mode 100644
index eae5607ac9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaElementCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-
-public class EclipseLinkJavaElementCollectionMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaElementCollectionMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaElementCollectionMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaElementCollectionMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME
- };
- private static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java
deleted file mode 100644
index f84d80d3e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaEmbeddableDefinition
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEmbeddableDefinition.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddableDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddableDefinition() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME,
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkCustomizerAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java
deleted file mode 100644
index 8803312721..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddableDefinition2_0;
-
-public class EclipseLinkJavaEmbeddableDefinition2_0
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEmbeddableDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddableDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddableDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEmbeddableDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java
deleted file mode 100644
index 7477386ae0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaEntityDefinition
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEntityDefinition.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEntityDefinition() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkCacheAnnotation.ANNOTATION_NAME,
- EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME,
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkCustomizerAnnotation.ANNOTATION_NAME,
- EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- // 'public' because EclipseLink MappedSuperclass also supports these annotations
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java
deleted file mode 100644
index 9e3021f20b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEntityDefinition2_0;
-
-public class EclipseLinkJavaEntityDefinition2_0
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEntityDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEntityDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java
deleted file mode 100644
index ca09ef2bf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-public class EclipseLinkJavaEntityDefinition2_3
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaEntityDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition2_3();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEntityDefinition2_3() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME,
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMNS
- };
- public static final Iterable<String> ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java
deleted file mode 100644
index 7bbfb2547b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaIdMappingDefinition;
-
-public class EclipseLinkJavaIdMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaIdMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaIdMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaIdMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java
deleted file mode 100644
index 2962443e4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaIdMappingDefinition2_0;
-
-public class EclipseLinkJavaIdMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaIdMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaIdMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaIdMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- /**
- * Check whether the <code>Id</code> mapping is "specified" according to
- * the spec then check for EclipseLink default mappings that negate the
- * <code>Id</code> mapping.
- */
- @Override
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- boolean specSpecified = super.isSpecified(persistentAttribute);
- return specSpecified && ! this.isDefaultDerivedId(persistentAttribute);
- }
-
- /**
- * EclipseLink supports default M:1 and 1:1 mappings.
- */
- private boolean isDefaultDerivedId(JavaPersistentAttribute persistentAttribute) {
- String defaultKey = persistentAttribute.getDefaultMappingKey();
- return Tools.valuesAreEqual(defaultKey, this.getManyToOneKey()) ||
- Tools.valuesAreEqual(defaultKey, this.getOneToOneKey());
- }
-
- private String getManyToOneKey() {
- return EclipseLinkJavaOneToOneMappingDefinition2_0.instance().getKey();
- }
-
- private String getOneToOneKey() {
- return EclipseLinkJavaOneToOneMappingDefinition2_0.instance().getKey();
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java
deleted file mode 100644
index 2fb4b88c87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-
-public class EclipseLinkJavaManyToManyMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToManyMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToManyMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToManyMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java
deleted file mode 100644
index 1a57786e09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaManyToManyMappingDefinition2_0;
-
-public class EclipseLinkJavaManyToManyMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToManyMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToManyMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToManyMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaManyToManyMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java
deleted file mode 100644
index ecbf7312e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-
-public class EclipseLinkJavaManyToOneMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToOneMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToOneMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToOneMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java
deleted file mode 100644
index 74c6d4ea0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaManyToOneMappingDefinition2_0;
-
-public class EclipseLinkJavaManyToOneMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToOneMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToOneMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToOneMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaManyToOneMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java
deleted file mode 100644
index 2bcb1ca038..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaMappedSuperclassDefinition
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaMappedSuperclassDefinition.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaMappedSuperclassDefinition() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java
deleted file mode 100644
index 8c407f5460..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaMappedSuperclassDefinition2_0;
-
-public class EclipseLinkJavaMappedSuperclassDefinition2_0
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaMappedSuperclassDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaMappedSuperclassDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java
deleted file mode 100644
index 3fbc63a5c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaMappedSuperclassDefinition2_3
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaMappedSuperclassDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition2_3();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaMappedSuperclassDefinition2_3() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition2_3.ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java
deleted file mode 100644
index eb09de2581..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-public class EclipseLinkJavaOneToManyMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToManyMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToManyMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToManyMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME,
- EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- String targetEntity = persistentAttribute.getMultiReferenceTargetTypeName();
- return (targetEntity != null)
- && (persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java
deleted file mode 100644
index ebae8afb9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToManyMappingDefinition2_0;
-
-public class EclipseLinkJavaOneToManyMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToManyMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToManyMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToManyMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaOneToManyMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return EclipseLinkJavaOneToManyMappingDefinition.instance().isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java
deleted file mode 100644
index 1da55872e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaOneToManyRelationship2_0;
-
-/**
- * We need this class because the EclipseLink 1.0 1:m mapping supports a join
- * column strategy while JPA did not until JPA 2.0. As a result, we need a class
- * that implements EclipseLink 1.0.
- */
-public class EclipseLinkJavaOneToManyRelationship
- extends GenericJavaOneToManyRelationship
- implements EclipseLinkJavaOneToManyRelationship2_0
-{
- public EclipseLinkJavaOneToManyRelationship(JavaOneToManyMapping parent) {
- super(parent, true); // true=supports join column strategy
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java
deleted file mode 100644
index fa78682973..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-public class EclipseLinkJavaOneToOneMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToOneMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToOneMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToOneMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME,
- EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- String targetEntity = persistentAttribute.getSingleReferenceTargetTypeName();
- return (targetEntity != null)
- && (persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java
deleted file mode 100644
index 5782117eb9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToOneMappingDefinition2_0;
-
-public class EclipseLinkJavaOneToOneMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToOneMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToOneMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToOneMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaOneToOneMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return EclipseLinkJavaOneToOneMappingDefinition.instance().isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 5fa2a8ba0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaNamedColumn;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.AbstractJavaNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * Java tenant discriminator column
- */
-public class EclipseLinkJavaTenantDiscriminatorColumn2_3
- extends AbstractJavaNamedDiscriminatorColumn<EclipseLinkTenantDiscriminatorColumnAnnotation2_3, JavaReadOnlyTenantDiscriminatorColumn2_3.Owner>
- implements JavaTenantDiscriminatorColumn2_3
-{
- /** @see AbstractJavaNamedColumn#AbstractJavaNamedColumn(JavaJpaContextNode, org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyNamedColumn.Owner, org.eclipse.jpt.jpa.core.resource.java.NamedColumnAnnotation) */
- protected /* final */ EclipseLinkTenantDiscriminatorColumnAnnotation2_3 columnAnnotation; // never null
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey;
-
- public EclipseLinkJavaTenantDiscriminatorColumn2_3(JavaEclipseLinkMultitenancyImpl2_3 parent, JavaReadOnlyTenantDiscriminatorColumn2_3.Owner owner, EclipseLinkTenantDiscriminatorColumnAnnotation2_3 columnAnnotation) {
- super(parent, owner, columnAnnotation);
- this.specifiedTable = this.buildSpecifiedTable();
- this.specifiedContextProperty = this.buildSpecifiedContextProperty();
- this.specifiedPrimaryKey = this.buildSpecifiedPrimaryKey();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedTable_(this.buildSpecifiedTable());
- this.setSpecifiedContextProperty_(this.buildSpecifiedContextProperty());
- this.setSpecifiedPrimaryKey_(this.buildSpecifiedPrimaryKey());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultTable(this.buildDefaultTable());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
- // ********** column annotation **********
-
- @Override
- public EclipseLinkTenantDiscriminatorColumnAnnotation2_3 getColumnAnnotation() {
- return this.columnAnnotation;
- }
-
- @Override
- protected void setColumnAnnotation(EclipseLinkTenantDiscriminatorColumnAnnotation2_3 columnAnnotation) {
- this.columnAnnotation = columnAnnotation;
- }
-
- @Override
- protected void removeColumnAnnotation() {
- // we don't remove a tenant discriminator column annotation when it is empty
- }
-
-
- // ********** table **********
-
- @Override
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String table) {
- if (this.valuesAreDifferent(this.specifiedTable, table)) {
- this.getColumnAnnotation().setTable(table);
- this.removeColumnAnnotationIfUnset();
- this.setSpecifiedTable_(table);
- }
- }
-
- protected void setSpecifiedTable_(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return this.getColumnAnnotation().getTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getColumnAnnotation().getTableTextRange(astRoot), astRoot);
- }
-
-
- // ********** contextProperty **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- public void setSpecifiedContextProperty(String contextProperty) {
- if (this.valuesAreDifferent(this.specifiedContextProperty, contextProperty)) {
- this.getColumnAnnotation().setContextProperty(contextProperty);
- this.removeColumnAnnotationIfUnset();
- this.setSpecifiedContextProperty_(contextProperty);
- }
- }
-
- protected void setSpecifiedContextProperty_(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return this.getColumnAnnotation().getContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
- public TextRange getContextPropertyTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getColumnAnnotation().getContextPropertyTextRange(astRoot), astRoot);
- }
-
-
- // ********** primaryKey **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.isDefaultPrimaryKey();
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- public void setSpecifiedPrimaryKey(Boolean primaryKey) {
- if (this.valuesAreDifferent(this.specifiedPrimaryKey, primaryKey)) {
- this.getColumnAnnotation().setPrimaryKey(primaryKey);
- this.removeColumnAnnotationIfUnset();
- this.setSpecifiedPrimaryKey_(primaryKey);
- }
- }
-
- protected void setSpecifiedPrimaryKey_(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return this.getColumnAnnotation().getPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean primaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = primaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return DEFAULT_PRIMARY_KEY;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkMultitenancyImpl2_3 getParent() {
- return (JavaEclipseLinkMultitenancyImpl2_3) super.getParent();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getParent().getJavaResourceType();
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.tableTouches(pos, astRoot)) {
- return this.getJavaCandidateTableNames(filter);
- }
- return null;
- }
-
- protected boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.getColumnAnnotation().tableTouches(pos, astRoot);
- }
-
- protected Iterable<String> getJavaCandidateTableNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateTableNames(filter));
- }
-
- protected Iterable<String> getCandidateTableNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateTableNames(), filter);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver(CompilationUnit astRoot) {
- return new JavaTableColumnTextRangeResolver(this, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java
deleted file mode 100644
index d04f0dc00b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-public class EclipseLinkJavaTimeOfDay
- extends AbstractJavaJpaContextNode
- implements EclipseLinkTimeOfDay
-{
- protected final EclipseLinkTimeOfDayAnnotation todAnnotation;
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
-
- public EclipseLinkJavaTimeOfDay(JavaEclipseLinkCaching parent, EclipseLinkTimeOfDayAnnotation todAnnotation) {
- super(parent);
- this.todAnnotation = todAnnotation;
- this.hour = todAnnotation.getHour();
- this.minute = todAnnotation.getMinute();
- this.second = todAnnotation.getSecond();
- this.millisecond = todAnnotation.getMillisecond();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setHour_(this.todAnnotation.getHour());
- this.setMinute_(this.todAnnotation.getMinute());
- this.setSecond_(this.todAnnotation.getSecond());
- this.setMillisecond_(this.todAnnotation.getMillisecond());
- }
-
-
- // ********** hour **********
-
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- this.todAnnotation.setHour(hour);
- this.setHour_(hour);
- }
-
- protected void setHour_(Integer hour) {
- Integer old = this.hour;
- this.hour = hour;
- this.firePropertyChanged(HOUR_PROPERTY, old, hour);
- }
-
-
- // ********** minute **********
-
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer minute) {
- this.todAnnotation.setMinute(minute);
- this.setMinute_(minute);
- }
-
- protected void setMinute_(Integer minute) {
- Integer old = this.minute;
- this.minute = minute;
- this.firePropertyChanged(MINUTE_PROPERTY, old, minute);
- }
-
-
- // ********** second **********
-
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer second) {
- this.todAnnotation.setSecond(second);
- this.setSecond_(second);
- }
-
- protected void setSecond_(Integer second) {
- Integer old = this.second;
- this.second = second;
- this.firePropertyChanged(SECOND_PROPERTY, old, second);
- }
-
-
- // ********** millisecond **********
-
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer millisecond) {
- this.todAnnotation.setMillisecond(millisecond);
- this.setMillisecond_(millisecond);
- }
-
- protected void setMillisecond_(Integer millisecond) {
- Integer old = this.millisecond;
- this.millisecond = millisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, old, millisecond);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkCaching getParent() {
- return (JavaEclipseLinkCaching) super.getParent();
- }
-
- public JavaEclipseLinkCaching getCaching() {
- return this.getParent();
- }
-
- public EclipseLinkTimeOfDayAnnotation getTimeOfDayAnnotation() {
- return this.todAnnotation;
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.todAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getCaching().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java
deleted file mode 100644
index 5319654deb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-public class EclipseLinkJavaTransformationMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaTransformationMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaTransformationMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkTransformationMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java
deleted file mode 100644
index 822c576a36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaTransformationMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaTransformationMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaTransformationMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaTransformationMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java
deleted file mode 100644
index f72dc3ea9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-public class EclipseLinkJavaVariableOneToOneMappingDefinition
- implements DefaultJavaAttributeMappingDefinition
-{
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVariableOneToOneMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVariableOneToOneMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkVariableOneToOneMapping(persistentAttribute);
- }
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return ((JavaEclipseLinkPersistentAttribute) persistentAttribute).typeIsValidForVariableOneToOne();
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java
deleted file mode 100644
index f67c17b0de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaVariableOneToOneMappingDefinition2_0
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaVariableOneToOneMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVariableOneToOneMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVariableOneToOneMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java
deleted file mode 100644
index 71d233c1ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaVersionMappingDefinition;
-
-public class EclipseLinkJavaVersionMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaVersionMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVersionMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVersionMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java
deleted file mode 100644
index 0d567694bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaVersionMappingDefinition2_0;
-
-public class EclipseLinkJavaVersionMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaVersionMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVersionMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVersionMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return EclipseLinkJavaOneToOneMappingDefinition.instance().isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 77b981a8d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaVirtualNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaVirtualTenantDiscriminatorColumn2_3;
-
-/**
- * Java virtual tenant discriminator column
- */
-public class EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3
- extends AbstractJavaVirtualNamedDiscriminatorColumn<JavaReadOnlyTenantDiscriminatorColumn2_3.Owner, ReadOnlyTenantDiscriminatorColumn2_3>
- implements JavaVirtualTenantDiscriminatorColumn2_3
-{
- protected final ReadOnlyTenantDiscriminatorColumn2_3 overriddenColumn;
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey;
-
-
- public EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3(JavaJpaContextNode parent, JavaReadOnlyTenantDiscriminatorColumn2_3.Owner owner, ReadOnlyTenantDiscriminatorColumn2_3 overriddenColumn) {
- super(parent, owner);
- this.overriddenColumn = overriddenColumn;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
-
- this.setSpecifiedTable(this.buildSpecifiedTable());
- this.setDefaultTable(this.buildDefaultTable());
-
- this.setSpecifiedContextProperty(this.buildSpecifiedContextProperty());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
-
- this.setSpecifiedPrimaryKey(this.buildSpecifiedPrimaryKey());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
-
- // ********** column **********
-
- @Override
- public ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn() {
- return this.overriddenColumn;
- }
-
- public boolean isVirtual() {
- return true;
- }
-
-
- // ********** table **********
-
- @Override
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- protected void setSpecifiedTable(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return this.getOverriddenColumn().getSpecifiedTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
-
- // ********** context property **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- protected void setSpecifiedContextProperty(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return this.getOverriddenColumn().getSpecifiedContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
-
- // ********** primary key **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.defaultPrimaryKey;
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- protected void setSpecifiedPrimaryKey(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return this.getOverriddenColumn().getSpecifiedPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean primaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = primaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return this.owner.getDefaultPrimaryKey();
- }
-
- // ********** misc **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(astRoot);
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver(CompilationUnit astRoot) {
- return new JavaTableColumnTextRangeResolver(this, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 02d43ef7d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-public class JavaEclipseLinkBasicCollectionMapping
- extends AbstractJavaAttributeMapping<EclipseLinkBasicCollectionAnnotation>
- implements EclipseLinkBasicCollectionMapping
-{
-
- public JavaEclipseLinkBasicCollectionMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = this.getPersistentAttribute().getMultiReferenceTargetTypeName();
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java
deleted file mode 100644
index b96b46292d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-public class JavaEclipseLinkBasicMapMapping
- extends AbstractJavaAttributeMapping<EclipseLinkBasicMapAnnotation>
- implements EclipseLinkBasicMapMapping
-{
-
- public JavaEclipseLinkBasicMapMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = this.getPersistentAttribute().getMultiReferenceTargetTypeName();
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
- @Override
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- this.addMetamodelFieldMapKeyTypeArgumentNameTo(typeArgumentNames);
- super.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- }
-
- protected void addMetamodelFieldMapKeyTypeArgumentNameTo(ArrayList<String> typeArgumentNames) {
- String mapKeyTypeName = this.getPersistentAttribute().getMultiReferenceMapKeyTypeName();
- mapKeyTypeName = mapKeyTypeName != null ? mapKeyTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- typeArgumentNames.add(mapKeyTypeName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java
deleted file mode 100644
index da41f55e9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkBasicMapping
- extends AbstractJavaBasicMapping
- implements EclipseLinkBasicMapping
-{
- protected final JavaEclipseLinkMutable mutable;
-
-
- public JavaEclipseLinkBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new JavaEclipseLinkMutable(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(
- JavaEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mutable.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java
deleted file mode 100644
index dcb40f9adc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.NullJavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkCachingImpl
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkCaching, JavaCacheableHolder2_0
-{
- protected EclipseLinkCacheType specifiedType;
- protected Integer specifiedSize;
- protected Boolean specifiedShared;
- protected Boolean specifiedAlwaysRefresh;
- protected Boolean specifiedRefreshOnlyIfNewer;
- protected Boolean specifiedDisableHits;
-
- protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
-
- protected Integer expiry;
- protected EclipseLinkJavaTimeOfDay expiryTimeOfDay;
-
- protected boolean existenceChecking;
- protected EclipseLinkExistenceType specifiedExistenceType;
- protected EclipseLinkExistenceType defaultExistenceType;
-
- protected final JavaCacheable2_0 cacheable;
-
- protected EclipseLinkCacheIsolationType2_2 specifiedIsolation;
-
- public JavaEclipseLinkCachingImpl(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- EclipseLinkCacheAnnotation cacheAnnotation = this.getCacheAnnotation();
- this.specifiedType = EclipseLinkCacheType.fromJavaResourceModel(cacheAnnotation.getType());
- this.specifiedSize = cacheAnnotation.getSize();
- this.specifiedShared = cacheAnnotation.getShared();
- this.specifiedAlwaysRefresh = cacheAnnotation.getAlwaysRefresh();
- this.specifiedRefreshOnlyIfNewer = cacheAnnotation.getRefreshOnlyIfNewer();
- this.specifiedDisableHits = cacheAnnotation.getDisableHits();
-
- this.specifiedCoordinationType = EclipseLinkCacheCoordinationType.fromJavaResourceModel(cacheAnnotation.getCoordinationType());
-
- this.expiry = cacheAnnotation.getExpiry();
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay(cacheAnnotation.getExpiryTimeOfDay());
-
- EclipseLinkExistenceCheckingAnnotation ecAnnotation = this.getExistenceCheckingAnnotation();
- this.existenceChecking = (ecAnnotation != null);
- this.specifiedExistenceType = this.buildSpecifiedExistenceType(ecAnnotation);
-
- this.cacheable = this.buildCacheable();
-
- this.specifiedIsolation = EclipseLinkCacheIsolationType2_2.fromJavaResourceModel(cacheAnnotation.getIsolation());
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
-
- EclipseLinkCacheAnnotation cacheAnnotation = this.getCacheAnnotation();
- this.setSpecifiedType_(EclipseLinkCacheType.fromJavaResourceModel(cacheAnnotation.getType()));
- this.setSpecifiedSize_(cacheAnnotation.getSize());
- this.setSpecifiedShared_(cacheAnnotation.getShared());
- this.setSpecifiedAlwaysRefresh_(cacheAnnotation.getAlwaysRefresh());
- this.setSpecifiedRefreshOnlyIfNewer_(cacheAnnotation.getRefreshOnlyIfNewer());
- this.setSpecifiedDisableHits_(cacheAnnotation.getDisableHits());
-
- this.setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType.fromJavaResourceModel(cacheAnnotation.getCoordinationType()));
-
- this.setExpiry_(cacheAnnotation.getExpiry());
- this.syncExpiryTimeOfDay(cacheAnnotation.getExpiryTimeOfDay());
-
- EclipseLinkExistenceCheckingAnnotation ecAnnotation = this.getExistenceCheckingAnnotation();
- this.setExistenceChecking_(ecAnnotation != null);
- this.setSpecifiedExistenceType_(this.buildSpecifiedExistenceType(ecAnnotation));
-
- this.cacheable.synchronizeWithResourceModel();
-
- this.setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2.fromJavaResourceModel(cacheAnnotation.getIsolation()));
- }
-
- @Override
- public void update() {
- super.update();
- if (this.expiryTimeOfDay != null) {
- this.expiryTimeOfDay.update();
- }
- this.setDefaultExistenceType(this.buildDefaultExistenceType());
- this.cacheable.update();
- }
-
-
- // ********** type **********
-
- public EclipseLinkCacheType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkCacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkCacheType type) {
- this.getCacheAnnotation().setType(EclipseLinkCacheType.toJavaResourceModel(type));
- this.setSpecifiedType_(type);
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkCacheType type) {
- EclipseLinkCacheType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- public EclipseLinkCacheType getDefaultType() {
- String puDefaultCacheTypeName = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheTypePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheTypeName)) {
- try {
- return EclipseLinkCacheType.valueOf(StringTools.convertCamelCaseToAllCaps(puDefaultCacheTypeName));
- } catch (IllegalArgumentException exception) {
- //no match, return default
- }
- }
- return DEFAULT_TYPE;
- }
-
- // ********** size **********
-
- public int getSize() {
- return (this.specifiedSize != null) ? this.specifiedSize.intValue() : this.getDefaultSize();
- }
-
- public Integer getSpecifiedSize() {
- return this.specifiedSize;
- }
-
- public void setSpecifiedSize(Integer size) {
- this.getCacheAnnotation().setSize(size);
- this.setSpecifiedSize_(size);
-
- if (size != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedSize_(Integer size) {
- Integer old = this.specifiedSize;
- this.specifiedSize = size;
- this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, size);
- }
-
- public int getDefaultSize() {
- String puDefaultCacheSize = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSizePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheSize)) {
- try {
- return Integer.valueOf(puDefaultCacheSize).intValue();
- } catch (NumberFormatException exception) {
- //couldn't parse, return default
- }
- }
- return DEFAULT_SIZE;
- }
-
-
- // ********** shared **********
-
- public boolean isShared() {
- return (this.specifiedShared != null) ? this.specifiedShared.booleanValue() : this.isDefaultShared();
- }
-
- public Boolean getSpecifiedShared() {
- return this.specifiedShared;
- }
-
- public void setSpecifiedShared(Boolean shared) {
- this.getCacheAnnotation().setShared(shared);
- this.setSpecifiedShared_(shared);
-
- if ((shared != null) && ! shared.booleanValue()) { // Boolean.FALSE
- this.setSpecifiedType(null);
- this.setSpecifiedSize(null);
- this.setSpecifiedAlwaysRefresh(null);
- this.setSpecifiedRefreshOnlyIfNewer(null);
- this.setSpecifiedDisableHits(null);
- this.setSpecifiedCoordinationType(null);
- this.setExpiry(null);
- this.removeExpiryTimeOfDayIfNecessary();
- }
- }
-
- protected void setSpecifiedShared_(Boolean shared) {
- Boolean old = this.specifiedShared;
- this.specifiedShared = shared;
- this.firePropertyChanged(SPECIFIED_SHARED_PROPERTY, old, shared);
- }
-
- public boolean isDefaultShared() {
- String puDefaultSharedCache = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSharedPropertyValue();
- return !StringTools.stringIsEmpty(puDefaultSharedCache) ? Boolean.valueOf(puDefaultSharedCache).booleanValue() : DEFAULT_SHARED;
- }
-
-
- // ********** always refresh **********
-
- public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh != null) ? this.specifiedAlwaysRefresh.booleanValue() : this.isDefaultAlwaysRefresh();
- }
-
- public Boolean getSpecifiedAlwaysRefresh() {
- return this.specifiedAlwaysRefresh;
- }
-
- public void setSpecifiedAlwaysRefresh(Boolean alwaysRefresh) {
- this.getCacheAnnotation().setAlwaysRefresh(alwaysRefresh);
- this.setSpecifiedAlwaysRefresh_(alwaysRefresh);
-
- if (alwaysRefresh != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedAlwaysRefresh_(Boolean alwaysRefresh) {
- Boolean old = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
- public boolean isDefaultAlwaysRefresh() {
- return DEFAULT_ALWAYS_REFRESH;
- }
-
-
- // ********** refresh only if newer **********
-
- public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer != null) ? this.specifiedRefreshOnlyIfNewer.booleanValue() : this.isDefaultRefreshOnlyIfNewer();
- }
-
- public Boolean getSpecifiedRefreshOnlyIfNewer() {
- return this.specifiedRefreshOnlyIfNewer;
- }
-
- public void setSpecifiedRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- this.getCacheAnnotation().setRefreshOnlyIfNewer(refreshOnlyIfNewer);
- this.setSpecifiedRefreshOnlyIfNewer_(refreshOnlyIfNewer);
-
- if (refreshOnlyIfNewer != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
- Boolean old = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
- public boolean isDefaultRefreshOnlyIfNewer() {
- return DEFAULT_REFRESH_ONLY_IF_NEWER;
- }
-
-
- // ********** disable hits **********
-
- public boolean isDisableHits() {
- return (this.specifiedDisableHits != null) ? this.specifiedDisableHits.booleanValue() : this.isDefaultDisableHits();
- }
-
- public Boolean getSpecifiedDisableHits() {
- return this.specifiedDisableHits;
- }
-
- public void setSpecifiedDisableHits(Boolean disableHits) {
- this.getCacheAnnotation().setDisableHits(disableHits);
- this.setSpecifiedDisableHits_(disableHits);
-
- if (disableHits != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedDisableHits_(Boolean disableHits) {
- Boolean old = this.specifiedDisableHits;
- this.specifiedDisableHits = disableHits;
- this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
- public boolean isDefaultDisableHits() {
- return DEFAULT_DISABLE_HITS;
- }
-
-
- // ********** coordination type **********
-
- public EclipseLinkCacheCoordinationType getCoordinationType() {
- return (this.specifiedCoordinationType != null) ? this.specifiedCoordinationType : this.getDefaultCoordinationType();
- }
-
- public EclipseLinkCacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType type) {
- this.getCacheAnnotation().setCoordinationType(EclipseLinkCacheCoordinationType.toJavaResourceModel(type));
- this.setSpecifiedCoordinationType_(type);
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType type) {
- EclipseLinkCacheCoordinationType old = this.specifiedCoordinationType;
- this.specifiedCoordinationType = type;
- this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, type);
- }
-
- public EclipseLinkCacheCoordinationType getDefaultCoordinationType() {
- return DEFAULT_COORDINATION_TYPE;
- }
-
-
- // ********** expiry **********
-
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- this.getCacheAnnotation().setExpiry(expiry);
- this.setExpiry_(expiry);
-
- if (expiry != null) {
- this.removeExpiryTimeOfDayIfNecessary();
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setExpiry_(Integer expiry) {
- Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
- }
-
-
- // ********** expiry time of day **********
-
- public EclipseLinkTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiry time of day already exists: " + this.expiryTimeOfDay); //$NON-NLS-1$
- }
- EclipseLinkTimeOfDayAnnotation timeOfDayAnnotation = this.getCacheAnnotation().addExpiryTimeOfDay();
- EclipseLinkJavaTimeOfDay timeOfDay = this.buildExpiryTimeOfDay(timeOfDayAnnotation);
- this.setExpiryTimeOfDay(timeOfDay);
-
- this.setExpiry(null);
- this.setSpecifiedShared(null);
-
- return timeOfDay;
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("expiry time of day does not exist"); //$NON-NLS-1$
- }
- this.removeExpiryTimeOfDay_();
- }
-
- protected void removeExpiryTimeOfDayIfNecessary() {
- if (this.expiryTimeOfDay != null) {
- this.removeExpiryTimeOfDay_();
- }
- }
-
- protected void removeExpiryTimeOfDay_() {
- this.getCacheAnnotation().removeExpiryTimeOfDay();
- this.setExpiryTimeOfDay(null);
- }
-
- public void setExpiryTimeOfDay(EclipseLinkJavaTimeOfDay timeOfDay) {
- EclipseLinkJavaTimeOfDay old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = timeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, timeOfDay);
- }
-
- protected void syncExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation timeOfDayAnnotation) {
- if (timeOfDayAnnotation == null) {
- if (this.expiryTimeOfDay != null) {
- this.setExpiryTimeOfDay(null);
- }
- } else {
- if ((this.expiryTimeOfDay != null) && (this.expiryTimeOfDay.getTimeOfDayAnnotation() == timeOfDayAnnotation)) {
- this.expiryTimeOfDay.synchronizeWithResourceModel();
- } else {
- this.setExpiryTimeOfDay(this.buildExpiryTimeOfDay(timeOfDayAnnotation));
- }
- }
- }
-
- protected EclipseLinkJavaTimeOfDay buildExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation timeOfDayAnnotation) {
- return (timeOfDayAnnotation == null) ? null : new EclipseLinkJavaTimeOfDay(this, timeOfDayAnnotation);
- }
-
-
- // ********** existence checking **********
-
- public boolean isExistenceChecking() {
- return this.existenceChecking;
- }
-
- public void setExistenceChecking(boolean existenceChecking) {
- if (existenceChecking != this.existenceChecking) {
- if (existenceChecking) {
- this.addExistenceCheckingAnnotation();
- } else {
- this.removeExistenceCheckingAnnotation();
- this.setSpecifiedExistenceType(null);
- }
- this.setExistenceChecking_(existenceChecking);
- }
- }
-
- protected void setExistenceChecking_(boolean existenceChecking) {
- boolean old = this.existenceChecking;
- this.existenceChecking = existenceChecking;
- this.firePropertyChanged(EXISTENCE_CHECKING_PROPERTY, old, existenceChecking);
- }
-
-
- // ********** existence type **********
-
- public EclipseLinkExistenceType getExistenceType() {
- return (this.specifiedExistenceType != null) ? this.specifiedExistenceType : this.defaultExistenceType;
- }
-
- public EclipseLinkExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(EclipseLinkExistenceType type) {
- if (this.valuesAreDifferent(type, this.specifiedExistenceType)) {
- if (type != null) {
- this.setExistenceChecking(true);
- }
- this.getExistenceCheckingAnnotation().setValue(EclipseLinkExistenceType.toJavaResourceModel(type));
- this.setSpecifiedExistenceType_(type);
- }
- }
-
- protected void setSpecifiedExistenceType_(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.specifiedExistenceType;
- this.specifiedExistenceType = type;
- this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkExistenceType buildSpecifiedExistenceType(EclipseLinkExistenceCheckingAnnotation ecAnnotation) {
- return (ecAnnotation == null) ? null : EclipseLinkExistenceType.fromJavaResourceModel(ecAnnotation.getValue());
- }
-
- public EclipseLinkExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.defaultExistenceType;
- this.defaultExistenceType = type;
- this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkExistenceType buildDefaultExistenceType() {
- return this.existenceChecking ? EclipseLinkExistenceType.CHECK_CACHE : DEFAULT_EXISTENCE_TYPE;
- }
-
-
- // ********** cacheable **********
-
- public JavaCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- public boolean calculateDefaultCacheable() {
- CacheableHolder2_0 superCacheableHolder = this.getCacheableSuperPersistentType(this.getPersistentType());
- return (superCacheableHolder != null) ?
- superCacheableHolder.getCacheable().isCacheable() :
- ((PersistenceUnit2_0) this.getPersistenceUnit()).calculateDefaultCacheable();
- }
-
- protected CacheableHolder2_0 getCacheableSuperPersistentType(PersistentType persistentType) {
- PersistentType superPersistentType = persistentType.getSuperPersistentType();
- if (superPersistentType == null) {
- return null;
- }
- TypeMapping superMapping = superPersistentType.getMapping();
- return (superMapping instanceof CacheableHolder2_0) ?
- (CacheableHolder2_0) superMapping :
- this.getCacheableSuperPersistentType(superPersistentType); // recurse
- }
-
- protected JavaCacheable2_0 buildCacheable() {
- return this.isJpa2_0Compatible() ?
- this.getJpaFactory2_0().buildJavaCacheable(this) :
- new NullJavaCacheable2_0(this);
- }
-
-
- // ********** isolation **********
-
- public EclipseLinkCacheIsolationType2_2 getIsolation() {
- return (this.specifiedIsolation != null) ? this.specifiedIsolation : this.getDefaultIsolation();
- }
-
- public EclipseLinkCacheIsolationType2_2 getSpecifiedIsolation() {
- return this.specifiedIsolation;
- }
-
- public void setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
- this.getCacheAnnotation().setIsolation(EclipseLinkCacheIsolationType2_2.toJavaResourceModel(isolation));
- this.setSpecifiedIsolation_(isolation);
-
- if (isolation != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2 isolation) {
- EclipseLinkCacheIsolationType2_2 old = this.specifiedIsolation;
- this.specifiedIsolation = isolation;
- this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, isolation);
- }
-
- public EclipseLinkCacheIsolationType2_2 getDefaultIsolation() {
- return DEFAULT_ISOLATION;
- }
-
- // ********** cache annotation **********
-
- protected EclipseLinkCacheAnnotation getCacheAnnotation() {
- return (EclipseLinkCacheAnnotation) this.getJavaResourceType().getNonNullAnnotation(this.getCacheAnnotationName());
- }
-
- protected String getCacheAnnotationName() {
- return EclipseLinkCacheAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** existence checking annotation **********
-
- protected EclipseLinkExistenceCheckingAnnotation getExistenceCheckingAnnotation() {
- return (EclipseLinkExistenceCheckingAnnotation) this.getJavaResourceType().getAnnotation(this.getExistenceCheckingAnnotationName());
- }
-
- protected EclipseLinkExistenceCheckingAnnotation addExistenceCheckingAnnotation() {
- return (EclipseLinkExistenceCheckingAnnotation) this.getJavaResourceType().addAnnotation(this.getExistenceCheckingAnnotationName());
- }
-
- protected void removeExistenceCheckingAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getExistenceCheckingAnnotationName());
- }
-
- protected String getExistenceCheckingAnnotationName() {
- return EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (JavaEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- public JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateExpiry(messages, astRoot);
- }
-
- protected void validateExpiry(List<IMessage> messages, CompilationUnit astRoot) {
- if ((this.expiry != null) && (this.expiryTimeOfDay != null)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED,
- new String[] {this.getPersistentType().getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getCacheAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java
deleted file mode 100644
index b391bc8ddf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-public class JavaEclipseLinkChangeTracking
- extends AbstractJavaJpaContextNode
- implements EclipseLinkChangeTracking
-{
- protected EclipseLinkChangeTrackingType specifiedType;
-
-
- public JavaEclipseLinkChangeTracking(JavaTypeMapping parent) {
- super(parent);
- this.specifiedType = this.buildSpecifiedType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedType_(this.buildSpecifiedType());
- }
-
-
- // ********** type **********
-
- public EclipseLinkChangeTrackingType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkChangeTrackingType type) {
- if (this.valuesAreDifferent(type, this.specifiedType)) {
- EclipseLinkChangeTrackingAnnotation annotation = this.getChangeTrackingAnnotation();
- if (type == null) {
- if (annotation != null) {
- this.removeChangeTrackingAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addChangeTrackingAnnotation();
- }
- annotation.setValue(EclipseLinkChangeTrackingType.toJavaResourceModel(type));
- }
- this.setSpecifiedType_(type);
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkChangeTrackingType type) {
- EclipseLinkChangeTrackingType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkChangeTrackingType buildSpecifiedType() {
- EclipseLinkChangeTrackingAnnotation annotation = this.getChangeTrackingAnnotation();
- if (annotation == null) {
- return null;
- }
- ChangeTrackingType value = annotation.getValue();
- return (value == null) ? DEFAULT_TYPE : EclipseLinkChangeTrackingType.fromJavaResourceModel(value);
- }
-
- public EclipseLinkChangeTrackingType getDefaultType() {
- return DEFAULT_TYPE;
- }
-
-
- // ********** change tracking annotation **********
-
- protected EclipseLinkChangeTrackingAnnotation getChangeTrackingAnnotation() {
- return (EclipseLinkChangeTrackingAnnotation) this.getJavaResourceType().getAnnotation(this.getChangeTrackingAnnotationName());
- }
-
- protected EclipseLinkChangeTrackingAnnotation addChangeTrackingAnnotation() {
- return (EclipseLinkChangeTrackingAnnotation) this.getJavaResourceType().addAnnotation(this.getChangeTrackingAnnotationName());
- }
-
- protected void removeChangeTrackingAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getChangeTrackingAnnotationName());
- }
-
- protected String getChangeTrackingAnnotationName() {
- return EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaTypeMapping getParent() {
- return (JavaTypeMapping) super.getParent();
- }
-
- protected JavaTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getPersistentType().getJavaResourceType();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkChangeTrackingAnnotation annotation = this.getChangeTrackingAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java
deleted file mode 100644
index de1e626871..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkConversionValue
- extends AbstractJavaJpaContextNode
- implements EclipseLinkConversionValue
-{
- private final EclipseLinkConversionValueAnnotation conversionValueAnnotation;
-
- private String dataValue;
-
- private String objectValue;
-
-
- public JavaEclipseLinkConversionValue(JavaEclipseLinkObjectTypeConverter parent, EclipseLinkConversionValueAnnotation conversionValueAnnotation) {
- super(parent);
- this.conversionValueAnnotation = conversionValueAnnotation;
- this.dataValue = conversionValueAnnotation.getDataValue();
- this.objectValue = conversionValueAnnotation.getObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataValue_(this.conversionValueAnnotation.getDataValue());
- this.setObjectValue_(this.conversionValueAnnotation.getObjectValue());
- }
-
-
- // ********** data value **********
-
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String value) {
- this.conversionValueAnnotation.setDataValue(value);
- this.setDataValue_(value);
- }
-
- protected void setDataValue_(String value) {
- String old = this.dataValue;
- this.dataValue = value;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** object value **********
-
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String value) {
- this.conversionValueAnnotation.setObjectValue(value);
- this.setObjectValue_(value);
- }
-
- protected void setObjectValue_(String value) {
- String old = this.objectValue;
- this.objectValue = value;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkObjectTypeConverter getParent() {
- return (JavaEclipseLinkObjectTypeConverter) super.getParent();
- }
-
- protected JavaEclipseLinkObjectTypeConverter getObjectTypeConverter() {
- return this.getParent();
- }
-
- public EclipseLinkConversionValueAnnotation getConversionValueAnnotation() {
- return this.conversionValueAnnotation;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- }
-
- public TextRange getDataValueTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.conversionValueAnnotation.getDataValueTextRange(astRoot), astRoot);
- }
-
- protected TextRange getObjectValueTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.conversionValueAnnotation.getObjectValueTextRange(astRoot), astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.conversionValueAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getObjectTypeConverter().getValidationTextRange(astRoot);
- }
-
- public boolean isIdentical(EclipseLinkConversionValue eclipseLinkConversionValue) {
- return StringTools.stringsAreEqual(this.getDataValue(), eclipseLinkConversionValue.getDataValue()) &&
- StringTools.stringsAreEqual(this.getObjectValue(), eclipseLinkConversionValue.getObjectValue());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java
deleted file mode 100644
index bc695a9867..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Association;
-import org.eclipse.jpt.common.utility.internal.SimpleAssociation;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.ConverterTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.AbstractJavaConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkConvertValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-
-public class JavaEclipseLinkConvert
- extends AbstractJavaConverter
- implements EclipseLinkConvert
-{
- private final EclipseLinkConvertAnnotation convertAnnotation;
-
- private String specifiedConverterName;
- private String defaultConverterName;
-
- private JavaEclipseLinkConverter<?> converter;
-
-
- protected static final JavaEclipseLinkConverter.Adapter[] CONVERTER_ADAPTER_ARRAY = new JavaEclipseLinkConverter.Adapter[] {
- JavaEclipseLinkCustomConverter.Adapter.instance(),
- JavaEclipseLinkTypeConverter.Adapter.instance(),
- JavaEclipseLinkObjectTypeConverter.Adapter.instance(),
- JavaEclipseLinkStructConverter.Adapter.instance()
- };
- protected static final Iterable<JavaEclipseLinkConverter.Adapter> CONVERTER_ADAPTERS = new ArrayIterable<JavaEclipseLinkConverter.Adapter>(CONVERTER_ADAPTER_ARRAY);
-
-
- public JavaEclipseLinkConvert(JavaAttributeMapping parent, EclipseLinkConvertAnnotation convertAnnotation, JavaConverter.Owner owner) {
- super(parent, owner);
- this.convertAnnotation = convertAnnotation;
- this.specifiedConverterName = convertAnnotation.getValue();
- this.converter = this.buildConverter();
- }
-
- public EclipseLinkConvertAnnotation getConverterAnnotation() {
- return this.convertAnnotation;
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedConverterName_(this.convertAnnotation.getValue());
- this.syncConverter();
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultConverterName(this.buildDefaultConverterName());
- if (this.converter != null) {
- this.converter.update();
- }
- }
-
-
- // ********** converter name **********
-
- public String getConverterName() {
- return (this.specifiedConverterName != null) ? this.specifiedConverterName : this.defaultConverterName;
- }
-
- public String getSpecifiedConverterName() {
- return this.specifiedConverterName;
- }
-
- public void setSpecifiedConverterName(String name) {
- this.convertAnnotation.setValue(name);
- this.setSpecifiedConverterName_(name);
- }
-
- protected void setSpecifiedConverterName_(String name) {
- String old = this.specifiedConverterName;
- this.specifiedConverterName = name;
- this.firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultConverterName() {
- return this.defaultConverterName;
- }
-
- protected void setDefaultConverterName(String name) {
- String old = this.defaultConverterName;
- this.defaultConverterName = name;
- this.firePropertyChanged(DEFAULT_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- protected String buildDefaultConverterName() {
- return DEFAULT_CONVERTER_NAME;
- }
-
-
- // ********** converter **********
-
- public JavaEclipseLinkConverter<?> getConverter() {
- return this.converter;
- }
-
- public void setConverter(Class<? extends EclipseLinkConverter> converterType) {
- if (converterType == null) {
- if (this.converter != null) {
- this.setConverter_(null);
- this.retainConverterAnnotation(null);
- }
- } else {
- if ((this.converter == null) || (this.converter.getType() != converterType)) {
- JavaEclipseLinkConverter.Adapter converterAdapter = this.getConverterAdapter(converterType);
- this.retainConverterAnnotation(converterAdapter);
- this.setConverter_(converterAdapter.buildNewConverter(this.getResourceAttribute(), this));
- }
- }
- }
-
- protected void setConverter_(JavaEclipseLinkConverter<?> converter) {
- JavaEclipseLinkConverter<?> old = this.converter;
- this.converter = converter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, converter);
- }
-
- protected JavaEclipseLinkConverter<?> buildConverter() {
- return this.isVirtual() ? null : this.buildConverter_();
- }
-
- protected JavaEclipseLinkConverter<?> buildConverter_() {
- JavaResourceAttribute resourceAttribute = this.getResourceAttribute();
- for (JavaEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- JavaEclipseLinkConverter<?> javaConverter = adapter.buildConverter(resourceAttribute, this);
- if (javaConverter != null) {
- return javaConverter;
- }
- }
- return null;
- }
-
- /**
- * Clear all the converter annotations <em>except</em> for the annotation
- * corresponding to the specified adapter. If the specified adapter is
- * <code>null</code>, remove <em>all</em> the converter annotations.
- */
- protected void retainConverterAnnotation(JavaEclipseLinkConverter.Adapter converterAdapter) {
- JavaResourceAttribute resourceAttribute = this.getResourceAttribute();
- for (JavaEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- if (adapter != converterAdapter) {
- adapter.removeConverterAnnotation(resourceAttribute);
- }
- }
- }
-
- protected void syncConverter() {
- if ( ! this.isVirtual()) {
- this.syncConverter_();
- }
- }
-
- protected void syncConverter_() {
- Association<JavaEclipseLinkConverter.Adapter, EclipseLinkNamedConverterAnnotation> assoc = this.getEclipseLinkConverterAnnotation();
- if (assoc == null) {
- if (this.converter != null) {
- this.setConverter_(null);
- }
- } else {
- JavaEclipseLinkConverter.Adapter adapter = assoc.getKey();
- EclipseLinkNamedConverterAnnotation annotation = assoc.getValue();
- if ((this.converter != null) &&
- (this.converter.getType() == adapter.getConverterType()) &&
- (this.converter.getConverterAnnotation() == annotation)) {
- this.converter.synchronizeWithResourceModel();
- } else {
- this.setConverter_(adapter.buildConverter(annotation, this));
- }
- }
- }
-
- /**
- * Return the first EclipseLink converter annotation we find along with its
- * corresponding adapter. Return <code>null</code> if there are no
- * converter annotations.
- */
- protected Association<JavaEclipseLinkConverter.Adapter, EclipseLinkNamedConverterAnnotation> getEclipseLinkConverterAnnotation() {
- JavaResourceAttribute resourceAttribute = this.getResourceAttribute();
- for (JavaEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- EclipseLinkNamedConverterAnnotation annotation = adapter.getConverterAnnotation(resourceAttribute);
- if (annotation != null) {
- return new SimpleAssociation<JavaEclipseLinkConverter.Adapter, EclipseLinkNamedConverterAnnotation>(adapter, annotation);
- }
- }
- return null;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * Return the converter adapter for the specified converter type.
- */
- protected JavaEclipseLinkConverter.Adapter getConverterAdapter(Class<? extends EclipseLinkConverter> converterType) {
- for (JavaEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- if (adapter.getConverterType() == converterType) {
- return adapter;
- }
- }
- throw new IllegalArgumentException("unknown converter type: " + converterType.getName()); //$NON-NLS-1$
- }
-
- protected Iterable<JavaEclipseLinkConverter.Adapter> getConverterAdapters() {
- return CONVERTER_ADAPTERS;
- }
-
-
- // ********** misc **********
-
- public Class<? extends Converter> getType() {
- return EclipseLinkConvert.class;
- }
-
- /**
- * Return whether the convert is <em>virtual</em> and, as a result, does
- * not have a converter.
- */
- protected boolean isVirtual() {
- return this.getAttributeMapping().getPersistentAttribute().isVirtual();
- }
-
- @Override
- public void dispose() {
- super.dispose();
- this.setConverter(null);
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.convertValueTouches(pos, astRoot)) {
- result = this.getJavaCandidateConverterNames(filter);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- protected boolean convertValueTouches(int pos, CompilationUnit astRoot) {
- return this.convertAnnotation.valueTouches(pos, astRoot);
- }
-
- protected Iterable<String> getJavaCandidateConverterNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateConverterNames(filter));
- }
-
- protected Iterable<String> getCandidateConverterNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getConverterNames(), filter);
- }
-
- protected Iterable<String> getConverterNames() {
- return this.getPersistenceUnit().getUniqueConverterNames();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // ********** adapter **********
-
- public static class Adapter
- extends JavaConverter.AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<? extends Converter> getConverterType() {
- return EclipseLinkConvert.class;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkConvertAnnotation.ANNOTATION_NAME;
- }
-
- public JavaConverter buildConverter(Annotation converterAnnotation, JavaAttributeMapping parent, JpaFactory factory) {
- return new JavaEclipseLinkConvert(parent, (EclipseLinkConvertAnnotation) converterAnnotation, this.buildOwner());
- }
-
- @Override
- protected Owner buildOwner() {
- return new Owner() {
- public JptValidator buildValidator(Converter converter, ConverterTextRangeResolver textRangeResolver) {
- return new EclipseLinkConvertValidator((EclipseLinkConvert) converter, textRangeResolver);
- }
- };
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java
deleted file mode 100644
index 0addd90d3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class JavaEclipseLinkConverter<A extends EclipseLinkNamedConverterAnnotation>
- extends AbstractJavaJpaContextNode
- implements EclipseLinkConverter
-{
- protected final A converterAnnotation;
-
- protected String name;
-
-
- protected JavaEclipseLinkConverter(JavaJpaContextNode parent, A converterAnnotation) {
- super(parent);
- this.converterAnnotation = converterAnnotation;
- this.name = converterAnnotation.getName();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setName_(this.converterAnnotation.getName());
- }
-
- @Override
- public void update() {
- super.update();
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.converterAnnotation.setName(name);
- this.setName_(name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaJpaContextNode getParent() {
- return (JavaJpaContextNode) super.getParent();
- }
-
- public A getConverterAnnotation() {
- return this.converterAnnotation;
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- public char getEnclosingTypeSeparator() {
- return '.';
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateName(messages, astRoot);
- }
-
- protected void validateName(List<IMessage> messages, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_NAME_UNDEFINED,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange(astRoot)
- )
- );
- return;
- }
-
- if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.RESERVED_CONVERTER_NAME,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange(astRoot)
- )
- );
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.converterAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot){
- return this.getValidationTextRange(this.getConverterAnnotation().getNameTextRange(astRoot), astRoot);
- }
-
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return StringTools.stringsAreEqual(this.getName(), eclipseLinkConverter.getName());
- }
-
- // ********** adapter **********
-
- /**
- * This interface allows a client to interact with various
- * EclipseLink Java converters via the same protocol.
- */
- public interface Adapter
- {
- /**
- * Return the type of converter handled by the adapter.
- */
- Class<? extends EclipseLinkConverter> getConverterType();
-
- /**
- * Build a converter corresponding to the specified Java resource
- * persistent member if the member is modified by the adapter's
- * converter annotation. Return <code>null</code> otherwise.
- * This is used to build a converter during construction of the
- * converter's parent.
- */
- JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildConverter(JavaResourceMember javaResourceMember, JavaJpaContextNode parent);
-
- /**
- * Return the adapter's converter annotation for the specified Java
- * resource persistent member.
- * Return <code>null</code> if the adapter's converter annotation is
- * missing.
- * The returned converter annotation is compared to the parent's
- * converter's converter annotation while the context model is synchronized
- * with the resource model. If it has changed, the parent will build
- * a new converter (via the adapter).
- *
- * @see #buildConverter(EclipseLinkNamedConverterAnnotation, JavaJpaContextNode)
- */
- EclipseLinkNamedConverterAnnotation getConverterAnnotation(JavaResourceMember javaResourceMember);
-
- /**
- * Build a converter using the specified converter annotation.
- * This is used when the context model is synchronized with the
- * resource model (and the resource model has changed).
- *
- * @see #getConverterAnnotation(JavaResourcePersistentMember)
- */
- JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildConverter(EclipseLinkNamedConverterAnnotation converterAnnotation, JavaJpaContextNode parent);
-
- /**
- * Build a new converter and, if necessary, its corresponding converter
- * annotation.
- */
- JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildNewConverter(JavaResourceMember javaResourceMember, JavaJpaContextNode parent);
-
- /**
- * Remove the adapter's converter annotation from the specified
- * Java resource persistent member.
- */
- void removeConverterAnnotation(JavaResourceMember javaResourceMember);
- }
-
-
- // ********** abstract adapter **********
-
- public abstract static class AbstractAdapter
- implements JavaEclipseLinkConverter.Adapter
- {
- public JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildConverter(JavaResourceMember member, JavaJpaContextNode parent) {
- EclipseLinkNamedConverterAnnotation annotation = this.getConverterAnnotation(member);
- return (annotation == null) ? null : this.buildConverter(annotation, parent);
- }
-
- public EclipseLinkNamedConverterAnnotation getConverterAnnotation(JavaResourceMember member) {
- return (EclipseLinkNamedConverterAnnotation) member.getAnnotation(this.getAnnotationName());
- }
-
- protected abstract String getAnnotationName();
-
- public JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildNewConverter(JavaResourceMember member, JavaJpaContextNode parent) {
- return this.buildConverter(this.buildConverterAnnotationIfNecessary(member), parent);
- }
-
- protected EclipseLinkNamedConverterAnnotation buildConverterAnnotationIfNecessary(JavaResourceMember member) {
- // the annotation may already be present, after we remove the other converter annotations
- EclipseLinkNamedConverterAnnotation annotation = this.getConverterAnnotation(member);
- return (annotation != null) ? annotation : this.buildConverterAnnotation(member);
- }
-
- protected EclipseLinkNamedConverterAnnotation buildConverterAnnotation(JavaResourceMember member) {
- return (EclipseLinkNamedConverterAnnotation) member.addAnnotation(this.getAnnotationName());
- }
-
- public void removeConverterAnnotation(JavaResourceMember member) {
- member.removeAnnotation(this.getAnnotationName());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, ClassName.getSimpleName(this.getAnnotationName()));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java
deleted file mode 100644
index cd24dcb264..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterClassConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.Converter
- * <li>org.eclipse.persistence.annotations.StructConverter
- * </ul>
- * </code>
- */
-public abstract class JavaEclipseLinkConverterClassConverter<A extends EclipseLinkNamedConverterAnnotation>
- extends JavaEclipseLinkConverter<A>
- implements EclipseLinkConverterClassConverter
-{
- private String converterClass;
-
-
- public JavaEclipseLinkConverterClassConverter(JavaJpaContextNode parent, A converterAnnotation, String converterClass) {
- super(parent, converterAnnotation);
- this.converterClass = converterClass;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setConverterClass_(this.getAnnotationConverterClass());
- }
-
-
- // ********** converter class **********
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- this.setAnnotationConverterClass(converterClass);
- this.setConverterClass_(converterClass);
- }
-
- protected void setConverterClass_(String converterClass) {
- String old = this.converterClass;
- this.converterClass = converterClass;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, converterClass);
- }
-
- protected abstract String getAnnotationConverterClass();
-
- protected abstract void setAnnotationConverterClass(String converterClass);
-
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateConverterClass(messages, astRoot);
- }
-
- protected void validateConverterClass(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.converterClass == null) {
- // the annotation will have a compile error if its converter class is missing
- return;
- }
-
- if (StringTools.stringIsEmpty(this.converterClass)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_DEFINED,
- this,
- this.getConverterClassTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.converterClassExists()) {
- this.addConverterClassDoesNotExistMessageTo(messages, astRoot);
- return;
- }
-
- if ( ! this.converterClassImplementsInterface(this.getEclipseLinkConverterInterface())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getEclipseLinkConverterInterfaceErrorMessage(),
- new String[] {this.getFullyQualifiedConverterClass()},
- this,
- this.getConverterClassTextRange(astRoot)
- )
- );
- }
- }
-
- protected void addConverterClassDoesNotExistMessageTo(List<IMessage> messages, CompilationUnit astRoot) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_EXISTS,
- new String[] {this.getFullyQualifiedConverterClass()},
- this,
- this.getConverterClassTextRange(astRoot)
- )
- );
- }
-
- /**
- * Return the name of the EclipseLink interface the converter class must
- * implement.
- */
- protected abstract String getEclipseLinkConverterInterface();
-
- protected abstract String getEclipseLinkConverterInterfaceErrorMessage();
-
- protected boolean converterClassExists() {
- return this.typeExists(this.getFullyQualifiedConverterClass());
- }
-
- /**
- * Add <code>null</code> check.
- */
- protected boolean typeExists(String typeName) {
- return (typeName != null) &&
- (JDTTools.findType(this.getJavaProject(), typeName) != null);
- }
-
- /**
- * Add <code>null</code> check.
- */
- protected boolean typeImplementsInterface(String typeName, String interfaceName) {
- return (typeName != null) &&
- JDTTools.typeIsSubType(this.getJavaProject(), typeName, interfaceName);
- }
-
- protected boolean converterClassImplementsInterface(String interfaceName) {
- return this.typeImplementsInterface(this.getFullyQualifiedConverterClass(), interfaceName);
- }
-
- protected abstract String getFullyQualifiedConverterClass();
-
- protected TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getAnnotationConverterClassTextRange(astRoot), astRoot);
- }
-
- protected abstract TextRange getAnnotationConverterClassTextRange(CompilationUnit astRoot);
-
- protected IJavaProject getJavaProject() {
- return this.getJpaProject().getJavaProject();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java
deleted file mode 100644
index 3e95f97e80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkConverterContainerImpl
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkConverterContainer
-{
- protected JavaEclipseLinkCustomConverter customConverter;
- protected JavaEclipseLinkObjectTypeConverter objectTypeConverter;
- protected JavaEclipseLinkStructConverter structConverter;
- protected JavaEclipseLinkTypeConverter typeConverter;
-
-
- public JavaEclipseLinkConverterContainerImpl(JavaTypeMapping parent) {
- super(parent);
- this.customConverter = this.buildCustomConverter();
- this.objectTypeConverter = this.buildObjectTypeConverter();
- this.structConverter = this.buildStructConverter();
- this.typeConverter = this.buildTypeConverter();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncCustomConverter();
- this.syncObjectTypeConverter();
- this.syncStructConverter();
- this.syncTypeConverter();
- }
-
- @Override
- public void update() {
- super.update();
- if (this.customConverter != null) {
- this.customConverter.update();
- }
- if (this.objectTypeConverter != null) {
- this.objectTypeConverter.update();
- }
- if (this.structConverter != null) {
- this.structConverter.update();
- }
- if (this.typeConverter != null) {
- this.typeConverter.update();
- }
- }
-
-
- // ********** custom converter **********
-
- public JavaEclipseLinkCustomConverter getCustomConverter() {
- return this.customConverter;
- }
-
- public JavaEclipseLinkCustomConverter addCustomConverter() {
- if (this.customConverter != null) {
- throw new IllegalStateException("custom converter already exists: " + this.customConverter); //$NON-NLS-1$
- }
- JavaEclipseLinkCustomConverter converter = this.buildNewConverter(this.getCustomConverterAdapter());
- this.setCustomConverter_(converter);
- return converter;
- }
-
- public void removeCustomConverter() {
- if (this.customConverter == null) {
- throw new IllegalStateException("custom converter is null"); //$NON-NLS-1$
- }
- this.getCustomConverterAdapter().removeConverterAnnotation(this.getJavaResourceType());
- this.setCustomConverter_(null);
- }
-
- protected void setCustomConverter_(JavaEclipseLinkCustomConverter converter) {
- JavaEclipseLinkCustomConverter old = this.customConverter;
- this.customConverter = converter;
- this.firePropertyChanged(CUSTOM_CONVERTER_PROPERTY, old, converter);
- }
-
- protected JavaEclipseLinkCustomConverter buildCustomConverter() {
- return this.buildConverter(this.getCustomConverterAdapter());
- }
-
- protected void syncCustomConverter() {
- EclipseLinkNamedConverterAnnotation annotation = this.getCustomConverterAdapter().getConverterAnnotation(this.getJavaResourceType());
- if (annotation == null) {
- if (this.customConverter != null) {
- this.setCustomConverter_(null);
- }
- } else {
- if ((this.customConverter != null) && (this.customConverter.getConverterAnnotation() == annotation)) {
- this.customConverter.synchronizeWithResourceModel();
- } else {
- JavaEclipseLinkCustomConverter converter = this.buildConverter(this.getCustomConverterAdapter(), annotation);
- this.setCustomConverter_(converter);
- }
- }
- }
-
- protected JavaEclipseLinkCustomConverter.Adapter getCustomConverterAdapter() {
- return JavaEclipseLinkCustomConverter.Adapter.instance();
- }
-
-
- // ********** object type converter **********
-
- public JavaEclipseLinkObjectTypeConverter getObjectTypeConverter() {
- return this.objectTypeConverter;
- }
-
- public JavaEclipseLinkObjectTypeConverter addObjectTypeConverter() {
- if (this.objectTypeConverter != null) {
- throw new IllegalStateException("object type converter already exists: " + this.objectTypeConverter); //$NON-NLS-1$
- }
- JavaEclipseLinkObjectTypeConverter converter = this.buildNewConverter(this.getObjectTypeConverterAdapter());
- this.setObjectTypeConverter_(converter);
- return converter;
- }
-
- public void removeObjectTypeConverter() {
- if (this.objectTypeConverter == null) {
- throw new IllegalStateException("object type converter is null"); //$NON-NLS-1$
- }
- this.getObjectTypeConverterAdapter().removeConverterAnnotation(this.getJavaResourceType());
- this.setObjectTypeConverter_(null);
- }
-
- protected void setObjectTypeConverter_(JavaEclipseLinkObjectTypeConverter converter) {
- JavaEclipseLinkObjectTypeConverter old = this.objectTypeConverter;
- this.objectTypeConverter = converter;
- this.firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, old, converter);
- }
-
- protected JavaEclipseLinkObjectTypeConverter buildObjectTypeConverter() {
- return this.buildConverter(this.getObjectTypeConverterAdapter());
- }
-
- protected void syncObjectTypeConverter() {
- EclipseLinkNamedConverterAnnotation annotation = this.getObjectTypeConverterAdapter().getConverterAnnotation(this.getJavaResourceType());
- if (annotation == null) {
- if (this.objectTypeConverter != null) {
- this.setObjectTypeConverter_(null);
- }
- } else {
- if ((this.objectTypeConverter != null) && (this.objectTypeConverter.getConverterAnnotation() == annotation)) {
- this.objectTypeConverter.synchronizeWithResourceModel();
- } else {
- JavaEclipseLinkObjectTypeConverter converter = this.buildConverter(this.getObjectTypeConverterAdapter(), annotation);
- this.setObjectTypeConverter_(converter);
- }
- }
- }
-
- protected JavaEclipseLinkObjectTypeConverter.Adapter getObjectTypeConverterAdapter() {
- return JavaEclipseLinkObjectTypeConverter.Adapter.instance();
- }
-
-
- // ********** struct converter **********
-
- public JavaEclipseLinkStructConverter getStructConverter() {
- return this.structConverter;
- }
-
- public JavaEclipseLinkStructConverter addStructConverter() {
- if (this.structConverter != null) {
- throw new IllegalStateException("struct converter already exists: " + this.structConverter); //$NON-NLS-1$
- }
- JavaEclipseLinkStructConverter converter = this.buildNewConverter(this.getStructConverterAdapter());
- this.setStructConverter_(converter);
- return converter;
- }
-
- public void removeStructConverter() {
- if (this.structConverter == null) {
- throw new IllegalStateException("struct converter is null"); //$NON-NLS-1$
- }
- this.getStructConverterAdapter().removeConverterAnnotation(this.getJavaResourceType());
- this.setStructConverter_(null);
- }
-
- protected void setStructConverter_(JavaEclipseLinkStructConverter converter) {
- JavaEclipseLinkStructConverter old = this.structConverter;
- this.structConverter = converter;
- this.firePropertyChanged(STRUCT_CONVERTER_PROPERTY, old, converter);
- }
-
- protected JavaEclipseLinkStructConverter buildStructConverter() {
- return this.buildConverter(this.getStructConverterAdapter());
- }
-
- protected void syncStructConverter() {
- EclipseLinkNamedConverterAnnotation annotation = this.getStructConverterAdapter().getConverterAnnotation(this.getJavaResourceType());
- if (annotation == null) {
- if (this.structConverter != null) {
- this.setStructConverter_(null);
- }
- } else {
- if ((this.structConverter != null) && (this.structConverter.getConverterAnnotation() == annotation)) {
- this.structConverter.synchronizeWithResourceModel();
- } else {
- JavaEclipseLinkStructConverter converter = this.buildConverter(this.getStructConverterAdapter(), annotation);
- this.setStructConverter_(converter);
- }
- }
- }
-
- protected JavaEclipseLinkStructConverter.Adapter getStructConverterAdapter() {
- return JavaEclipseLinkStructConverter.Adapter.instance();
- }
-
-
- // ********** object type converter **********
-
- public JavaEclipseLinkTypeConverter getTypeConverter() {
- return this.typeConverter;
- }
-
- public JavaEclipseLinkTypeConverter addTypeConverter() {
- if (this.typeConverter != null) {
- throw new IllegalStateException("type converter already exists: " + this.typeConverter); //$NON-NLS-1$
- }
- JavaEclipseLinkTypeConverter converter = this.buildNewConverter(this.getTypeConverterAdapter());
- this.setTypeConverter_(converter);
- return converter;
- }
-
- public void removeTypeConverter() {
- if (this.typeConverter == null) {
- throw new IllegalStateException("type converter is null"); //$NON-NLS-1$
- }
- this.getTypeConverterAdapter().removeConverterAnnotation(this.getJavaResourceType());
- this.setTypeConverter_(null);
- }
-
- protected void setTypeConverter_(JavaEclipseLinkTypeConverter converter) {
- JavaEclipseLinkTypeConverter old = this.typeConverter;
- this.typeConverter = converter;
- this.firePropertyChanged(TYPE_CONVERTER_PROPERTY, old, converter);
- }
-
- protected JavaEclipseLinkTypeConverter buildTypeConverter() {
- return this.buildConverter(this.getTypeConverterAdapter());
- }
-
- protected void syncTypeConverter() {
- EclipseLinkNamedConverterAnnotation annotation = this.getTypeConverterAdapter().getConverterAnnotation(this.getJavaResourceType());
- if (annotation == null) {
- if (this.typeConverter != null) {
- this.setTypeConverter_(null);
- }
- } else {
- if ((this.typeConverter != null) && (this.typeConverter.getConverterAnnotation() == annotation)) {
- this.typeConverter.synchronizeWithResourceModel();
- } else {
- JavaEclipseLinkTypeConverter converter = this.buildConverter(this.getTypeConverterAdapter(), annotation);
- this.setTypeConverter_(converter);
- }
- }
- }
-
- protected JavaEclipseLinkTypeConverter.Adapter getTypeConverterAdapter() {
- return JavaEclipseLinkTypeConverter.Adapter.instance();
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaTypeMapping getParent() {
- return (JavaTypeMapping) super.getParent();
- }
-
- protected JavaTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
- @SuppressWarnings("unchecked")
- protected <C extends JavaEclipseLinkConverter<?>> C buildConverter(C.Adapter adapter) {
- return (C) adapter.buildConverter(this.getJavaResourceType(), this);
- }
-
- @SuppressWarnings("unchecked")
- protected <C extends JavaEclipseLinkConverter<?>> C buildConverter(C.Adapter adapter, EclipseLinkNamedConverterAnnotation converterAnnotation) {
- return (C) adapter.buildConverter(converterAnnotation, this);
- }
-
- @SuppressWarnings("unchecked")
- protected <C extends JavaEclipseLinkConverter<?>> C buildNewConverter(C.Adapter adapter) {
- return (C) adapter.buildNewConverter(this.getJavaResourceType(), this);
- }
-
- public Iterable<EclipseLinkConverter> getConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- /**
- * This will include <code>null</code> converters.
- */
- protected Iterable<EclipseLinkConverter> getConverters_() {
- ArrayList<EclipseLinkConverter> result = new ArrayList<EclipseLinkConverter>(4);
- result.add(this.customConverter);
- result.add(this.objectTypeConverter);
- result.add(this.structConverter);
- result.add(this.typeConverter);
- return result;
- }
-
-
- // ********** validation **********
-
- /**
- * The converters are validated in the persistence unit.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit#validateConverters(List, IReporter)
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- // converters are validated in the persistence unit
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getJavaResourceType().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java
deleted file mode 100644
index 15293bb6c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * <code>org.eclipse.persistence.annotations.Converter</code>
- */
-public class JavaEclipseLinkCustomConverter
- extends JavaEclipseLinkConverterClassConverter<EclipseLinkConverterAnnotation>
- implements EclipseLinkCustomConverter
-{
- private String fullyQualifiedConverterClass;
- public static final String FULLY_QUALIFIED_CONVERTER_CLASS_PROPERTY = "fullyQualifiedConverterClass"; //$NON-NLS-1$
-
-
- public JavaEclipseLinkCustomConverter(JavaJpaContextNode parent, EclipseLinkConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation, converterAnnotation.getConverterClass());
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedConverterClass(this.converterAnnotation.getFullyQualifiedConverterClassName());
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getAnnotationConverterClass() {
- return this.converterAnnotation.getConverterClass();
- }
-
- @Override
- protected void setAnnotationConverterClass(String converterClass) {
- this.converterAnnotation.setConverterClass(converterClass);
- }
-
-
- // ********** fully qualified converter class **********
-
- @Override
- public String getFullyQualifiedConverterClass() {
- return this.fullyQualifiedConverterClass;
- }
-
- protected void setFullyQualifiedConverterClass(String converterClass) {
- String old = this.fullyQualifiedConverterClass;
- this.fullyQualifiedConverterClass = converterClass;
- this.firePropertyChanged(FULLY_QUALIFIED_CONVERTER_CLASS_PROPERTY, old, converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkCustomConverter> getType() {
- return EclipseLinkCustomConverter.class;
- }
-
-
- //************ validation ***************
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.CONVERTER_CLASS_IMPLEMENTS_CONVERTER;
- }
-
- @Override
- protected TextRange getAnnotationConverterClassTextRange(CompilationUnit astRoot) {
- return this.converterAnnotation.getConverterClassTextRange(astRoot);
- }
-
- @Override
- protected void addConverterClassDoesNotExistMessageTo(List<IMessage> messages, CompilationUnit astRoot) {
- // no need to add message since there will already be a compiler error
- }
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getFullyQualifiedConverterClass(), ((JavaEclipseLinkCustomConverter)eclipseLinkConverter).getFullyQualifiedConverterClass());
- }
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkCustomConverter> getConverterType() {
- return EclipseLinkCustomConverter.class;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkConverterAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildConverter(EclipseLinkNamedConverterAnnotation converterAnnotation, JavaJpaContextNode parent) {
- return new JavaEclipseLinkCustomConverter(parent, (EclipseLinkConverterAnnotation) converterAnnotation);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java
deleted file mode 100644
index a314cc60c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkCustomizer
- extends AbstractJavaJpaContextNode
- implements EclipseLinkCustomizer
-{
- private String specifiedCustomizerClass;
-
- private String fullyQualifiedCustomizerClass;
- public static final String FULLY_QUALIFIED_CUSTOMIZER_CLASS_PROPERTY = "fullyQualifiedCustomizerClass"; //$NON-NLS-1$
-
-
- public JavaEclipseLinkCustomizer(EclipseLinkJavaTypeMapping parent) {
- super(parent);
- this.specifiedCustomizerClass = this.buildSpecifiedCustomizerClass();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedCustomizerClass_(this.buildSpecifiedCustomizerClass());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedCustomizerClass(this.buildFullyQualifiedCustomizerClass());
- }
-
-
- // ********** customizer class **********
-
- public String getCustomizerClass() {
- return (this.specifiedCustomizerClass != null) ? this.specifiedCustomizerClass : null;
- }
-
- public String getSpecifiedCustomizerClass() {
- return this.specifiedCustomizerClass;
- }
-
- public void setSpecifiedCustomizerClass(String customizerClass) {
- if (this.valuesAreDifferent(customizerClass, this.specifiedCustomizerClass)) {
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- if (customizerClass == null) {
- if (annotation != null) {
- this.removeCustomizerAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addCustomizerAnnotation();
- }
- annotation.setValue(customizerClass);
- }
-
- this.setSpecifiedCustomizerClass_(customizerClass);
- }
- }
-
- protected void setSpecifiedCustomizerClass_(String customizerClass) {
- String old = this.specifiedCustomizerClass;
- this.specifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildSpecifiedCustomizerClass() {
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- return (annotation == null) ? null : annotation.getValue();
- }
-
- public String getDefaultCustomizerClass() {
- return null; // no default for Java
- }
-
-
- // ********** fully-qualified customizer class **********
-
- public String getFullyQualifiedCustomizerClass() {
- return this.fullyQualifiedCustomizerClass;
- }
-
- protected void setFullyQualifiedCustomizerClass(String customizerClass) {
- String old = this.fullyQualifiedCustomizerClass;
- this.fullyQualifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(FULLY_QUALIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildFullyQualifiedCustomizerClass() {
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- return (annotation == null) ? null : annotation.getFullyQualifiedCustomizerClassName();
- }
-
-
- // ********** customizer annotation **********
-
- protected EclipseLinkCustomizerAnnotation getCustomizerAnnotation() {
- return (EclipseLinkCustomizerAnnotation) this.getJavaResourceType().getAnnotation(this.getCustomizerAnnotationName());
- }
-
- protected EclipseLinkCustomizerAnnotation addCustomizerAnnotation() {
- return (EclipseLinkCustomizerAnnotation) this.getJavaResourceType().addAnnotation(this.getCustomizerAnnotationName());
- }
-
- protected void removeCustomizerAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getCustomizerAnnotationName());
- }
-
- protected String getCustomizerAnnotationName() {
- return EclipseLinkCustomizerAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkJavaTypeMapping getParent() {
- return (EclipseLinkJavaTypeMapping) super.getParent();
- }
-
- protected EclipseLinkJavaTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
- public char getCustomizerClassEnclosingTypeSeparator() {
- return '.';
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateCustomizerClass(messages, astRoot);
- }
-
- protected void validateCustomizerClass(List<IMessage> messages,CompilationUnit astRoot) {
- IJavaProject javaProject = getPersistenceUnit().getJpaProject().getJavaProject();
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- if (annotation != null && annotation.getValue() != null &&
- //if the type cannot be resolved there is no need to perform the following validation,
- //JDT will note the error in the source
- JDTTools.findType(javaProject, annotation.getValue()) != null) {
- if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, this.getFullyQualifiedCustomizerClass())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID,
- new String[] {this.getFullyQualifiedCustomizerClass()},
- this,
- this.getCustomizerClassTextRange(astRoot)
- )
- );
- } else if (!annotation.customizerClassImplementsInterface(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME, astRoot)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER,
- new String[] {this.getFullyQualifiedCustomizerClass()},
- this,
- this.getCustomizerClassTextRange(astRoot)
- )
- );
- }
- }
- }
-
- protected TextRange getCustomizerClassTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getCustomizerAnnotation().getValueTextRange(astRoot), astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getCustomizerAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java
deleted file mode 100644
index f669c74bcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.AbstractJavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class JavaEclipseLinkElementCollectionMapping2_0
- extends AbstractJavaElementCollectionMapping2_0
- implements EclipseLinkElementCollectionMapping2_0
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
-
- public JavaEclipseLinkElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(
- JavaEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java
deleted file mode 100644
index 201072bacf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * Java embeddable type mapping
- */
-public class JavaEclipseLinkEmbeddableImpl
- extends AbstractJavaEmbeddable
- implements JavaEclipseLinkEmbeddable
-{
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
-
- public JavaEclipseLinkEmbeddableImpl(JavaPersistentType parent, EmbeddableAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- }
-
-
- // ********** converter container **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new TransformationIterable<AttributeMapping, EclipseLinkConverter>(this.getAttributeMappings(), ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER);
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected JavaEclipseLinkChangeTracking buildChangeTracking() {
- return new JavaEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected JavaEclipseLinkCustomizer buildCustomizer() {
- return new JavaEclipseLinkCustomizer(this);
- }
-
-
- // ********** misc **********
-
- public boolean usesPrimaryKeyColumns() {
- return false;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.converterContainer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator(CompilationUnit astRoot) {
- return new EclipseLinkTypeMappingValidator(this, this.getJavaResourceType(), this.buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java
deleted file mode 100644
index 17c361848b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkEntityPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * Java entity
- */
-public class JavaEclipseLinkEntityImpl
- extends AbstractJavaEntity
- implements JavaEclipseLinkEntity
-{
- protected final JavaEclipseLinkCaching caching;
-
- protected final JavaEclipseLinkReadOnly readOnly;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
- protected final JavaEclipseLinkMultitenancy2_3 multitenancy;
-
- public JavaEclipseLinkEntityImpl(JavaPersistentType parent, EntityAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- }
-
-
- // ********** caching **********
-
- public JavaEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected JavaEclipseLinkCaching buildCaching() {
- return new JavaEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read-only **********
-
- public EclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected JavaEclipseLinkReadOnly buildReadOnly() {
- return new JavaEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new TransformationIterable<AttributeMapping, EclipseLinkConverter>(this.getAttributeMappings(), ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER);
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected JavaEclipseLinkChangeTracking buildChangeTracking() {
- return new JavaEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected JavaEclipseLinkCustomizer buildCustomizer() {
- return new JavaEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public JavaEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
- protected JavaEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new JavaEclipseLinkMultitenancyImpl2_3(this) :
- new NullJavaEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return this.isRootEntity() || this.isInheritanceStrategyTablePerClass();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
-
- // ********** discriminator column **********
-
- @Override
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return super.buildSpecifiedDiscriminatorColumnIsAllowed() && ! this.classExtractorIsSpecified();
- }
-
- protected boolean classExtractorIsSpecified() {
- return this.getClassExtractorAnnotation() != null;
- }
-
- protected EclipseLinkClassExtractorAnnotation2_1 getClassExtractorAnnotation() {
- return (EclipseLinkClassExtractorAnnotation2_1) this.getJavaResourceType().getAnnotation(EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME);
- }
-
-
- // ********** misc **********
-
- public boolean usesPrimaryKeyColumns() {
- return this.getJavaResourceType().getAnnotation(EclipseLink.PRIMARY_KEY) != null;
- }
-
- public JavaCacheable2_0 getCacheable() {
- return ((JavaCacheableHolder2_0) this.getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((JavaCacheableHolder2_0) this.getCaching()).calculateDefaultCacheable();
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.multitenancy.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.caching.validate(messages, reporter, astRoot);
- this.readOnly.validate(messages, reporter, astRoot);
- this.converterContainer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- this.multitenancy.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new EclipseLinkEntityPrimaryKeyValidator(this, this.buildTextRangeResolver(astRoot));
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator(CompilationUnit astRoot) {
- return new EclipseLinkTypeMappingValidator(this, this.getJavaResourceType(), buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java
deleted file mode 100644
index 3e7c5f9659..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkIdMapping
- extends AbstractJavaIdMapping
- implements EclipseLinkIdMapping
-{
- protected final JavaEclipseLinkMutable mutable;
-
-
- public JavaEclipseLinkIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new JavaEclipseLinkMutable(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(JavaEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mutable.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java
deleted file mode 100644
index fcb9dd1148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-public class JavaEclipseLinkJoinFetch
- extends AbstractJavaJpaContextNode
- implements EclipseLinkJoinFetch
-{
- protected EclipseLinkJoinFetchType value;
-
-
- public JavaEclipseLinkJoinFetch(JavaAttributeMapping parent) {
- super(parent);
- this.value = this.buildValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** value **********
-
- public EclipseLinkJoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(EclipseLinkJoinFetchType value) {
- if (this.valuesAreDifferent(value, this.value)) {
- EclipseLinkJoinFetchAnnotation annotation = this.getJoinFetchAnnotation();
- if (value == null) {
- if (annotation != null) {
- this.removeJoinFetchAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addJoinFetchAnnotation();
- }
- annotation.setValue(EclipseLinkJoinFetchType.toJavaResourceModel(value));
- }
-
- this.setValue_(value);
- }
- }
-
- protected void setValue_(EclipseLinkJoinFetchType value) {
- EclipseLinkJoinFetchType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private EclipseLinkJoinFetchType buildValue() {
- EclipseLinkJoinFetchAnnotation annotation = this.getJoinFetchAnnotation();
- if (annotation == null) {
- return null;
- }
- JoinFetchType annotationValue = annotation.getValue();
- return (annotationValue != null) ?
- EclipseLinkJoinFetchType.fromJavaResourceModel(annotationValue) :
- this.getDefaultValue(); // @JoinFetch is equivalent to @JoinFetch(JoinFetch.INNER)
- }
-
- protected EclipseLinkJoinFetchType getDefaultValue() {
- return DEFAULT_VALUE;
- }
-
-
- // ********** join fetch annotation **********
-
- protected EclipseLinkJoinFetchAnnotation getJoinFetchAnnotation() {
- return (EclipseLinkJoinFetchAnnotation) this.getResourceAttribute().getAnnotation(this.getJoinFetchAnnotationName());
- }
-
- protected EclipseLinkJoinFetchAnnotation addJoinFetchAnnotation() {
- return (EclipseLinkJoinFetchAnnotation) this.getResourceAttribute().addAnnotation(this.getJoinFetchAnnotationName());
- }
-
- protected void removeJoinFetchAnnotation() {
- this.getResourceAttribute().removeAnnotation(this.getJoinFetchAnnotationName());
- }
-
- protected String getJoinFetchAnnotationName() {
- return EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- protected JavaAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceAttribute getResourceAttribute() {
- return this.getAttributeMapping().getResourceAttribute();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkJoinFetchAnnotation annotation = this.getJoinFetchAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java
deleted file mode 100644
index 00ae92279f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkManyToManyMapping
- extends AbstractJavaManyToManyMapping
- implements EclipseLinkRelationshipMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
-
- public JavaEclipseLinkManyToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java
deleted file mode 100644
index 69c63f635e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkManyToOneMapping
- extends AbstractJavaManyToOneMapping
- implements EclipseLinkRelationshipMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
-
- public JavaEclipseLinkManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java
deleted file mode 100644
index e431505dda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * Java mapped superclass
- */
-public class JavaEclipseLinkMappedSuperclassImpl
- extends AbstractJavaMappedSuperclass
- implements JavaEclipseLinkMappedSuperclass, JavaCacheableHolder2_0
-{
- protected final JavaEclipseLinkCaching caching;
-
- protected final JavaEclipseLinkReadOnly readOnly;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
- protected final JavaEclipseLinkMultitenancy2_3 multitenancy;
-
- public JavaEclipseLinkMappedSuperclassImpl(JavaPersistentType parent, MappedSuperclassAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- }
-
-
- // ********** caching **********
-
- public JavaEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected JavaEclipseLinkCaching buildCaching() {
- return new JavaEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read-only **********
-
- public EclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected JavaEclipseLinkReadOnly buildReadOnly() {
- return new JavaEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new TransformationIterable<AttributeMapping, EclipseLinkConverter>(this.getAttributeMappings(), ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER);
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected JavaEclipseLinkChangeTracking buildChangeTracking() {
- return new JavaEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected JavaEclipseLinkCustomizer buildCustomizer() {
- return new JavaEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public JavaEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
-
- protected JavaEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new JavaEclipseLinkMultitenancyImpl2_3(this) :
- new NullJavaEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return true;
- }
-
- // ********** misc **********
-
- public boolean usesPrimaryKeyColumns() {
- return this.getJavaResourceType().getAnnotation(EclipseLink.PRIMARY_KEY) != null;
- }
-
- public JavaCacheable2_0 getCacheable() {
- return ((JavaCacheableHolder2_0) this.getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((CacheableHolder2_0) this.getCaching()).calculateDefaultCacheable();
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.multitenancy.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.caching.validate(messages, reporter, astRoot);
- this.readOnly.validate(messages, reporter, astRoot);
- this.converterContainer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- this.multitenancy.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new EclipseLinkMappedSuperclassPrimaryKeyValidator(this, this.buildTextRangeResolver(astRoot));
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator(CompilationUnit astRoot) {
- return new EclipseLinkMappedSuperclassValidator(this, this.getJavaResourceType(), this.buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java
deleted file mode 100644
index 40539d1d73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java
+++ /dev/null
@@ -1,729 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.MappingFileRoot;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaVirtualTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.TenantDiscriminatorColumnValidator2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkMultitenancyImpl2_3
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkMultitenancy2_3
-{
- protected boolean defaultMultitenant;
- protected boolean specifiedMultitenant;
-
- protected EclipseLinkMultitenantType2_3 specifiedType;
- protected EclipseLinkMultitenantType2_3 defaultType;
-
-// protected Boolean specifiedIncludeCriteria;
-
- protected final JavaReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
- protected final ContextListContainer<JavaTenantDiscriminatorColumn2_3, EclipseLinkTenantDiscriminatorColumnAnnotation2_3> specifiedTenantDiscriminatorColumnContainer;
- protected final ContextListContainer<JavaVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumnContainer;
-
- protected final JavaReadOnlyTenantDiscriminatorColumn2_3 defaultTenantDiscriminatorColumn;
-
- protected boolean specifiedTenantDiscriminatorColumnsAllowed;
-
- public JavaEclipseLinkMultitenancyImpl2_3(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- EclipseLinkMultitenantAnnotation2_3 multitenantAnnotation = this.getMultitenantAnnotation();
- this.specifiedMultitenant = multitenantAnnotation.isSpecified();
- this.specifiedType = EclipseLinkMultitenantType2_3.fromJavaResourceModel(multitenantAnnotation.getValue());
-// this.specifiedIncludeCriteria = multitenantAnnotation.getIncludeCriteria();
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.specifiedTenantDiscriminatorColumnContainer = this.buildSpecifiedTenantDiscriminatorColumnContainer();
- this.defaultTenantDiscriminatorColumn = this.buildTenantDiscriminatorColumn(this.buildNullTenantDiscriminatorColumnAnnotation());
- this.defaultTenantDiscriminatorColumnContainer = this.buildDefaultTenantDiscriminatorColumnContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
-
- EclipseLinkMultitenantAnnotation2_3 multitenantAnnotation = this.getMultitenantAnnotation();
- this.setSpecifiedType_(EclipseLinkMultitenantType2_3.fromJavaResourceModel(multitenantAnnotation.getValue()));
-// this.setSpecifiedIncludeCriteria_(multitenantAnnotation.getIncludeCriteria());
- this.syncSpecifiedTenantDiscriminatorColumns();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getSpecifiedTenantDiscriminatorColumns());
- this.setSpecifiedMultitenant_(this.isMultitenantAnnotationSpecified());
- this.setDefaultMultitenant(this.buildDefaultMultitenant());
- this.setDefaultType(this.buildDefaultType());
- this.setSpecifiedTenantDiscriminatorColumnsAllowed(this.buildSpecifiedTenantDiscriminatorColumnsAllowed());
- this.updateDefaultTenantDiscriminatorColumns();
- }
-
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return this.isSpecifiedMultitenant() || this.isDefaultMultitenant();
- }
-
- public boolean isDefaultMultitenant() {
- return this.defaultMultitenant;
- }
-
- public void setDefaultMultitenant(boolean defaultMultitenant) {
- boolean old = this.defaultMultitenant;
- this.defaultMultitenant = defaultMultitenant;
- this.firePropertyChanged(DEFAULT_MULTITENANT_PROPERTY, old, defaultMultitenant);
- }
-
- protected boolean buildDefaultMultitenant() {
- return this.isMultitenantInheritanceHierarchy() || this.isSuperMappedSuperclassMultitenant();
- }
-
- public boolean isSpecifiedMultitenant() {
- return this.specifiedMultitenant;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- if (isMultitenant) {
- if (getMultitenantAnnotation().isSpecified()) {
- throw new IllegalStateException("Multitenant annotation already specified"); //$NON-NLS-1$
- }
- this.addMultitenantAnnotation();
- }
- else {
- if (!getMultitenantAnnotation().isSpecified()) {
- throw new IllegalStateException("Multitenant annotation does not exist"); //$NON-NLS-1$
- }
- this.removeMultitenantAnnotation();
- this.setSpecifiedType(null);
- for (int i = this.getSpecifiedTenantDiscriminatorColumnsSize(); i-- > 0; ) {
- this.removeSpecifiedTenantDiscriminatorColumn(i);
- }
- }
- this.setSpecifiedMultitenant_(isMultitenant);
- }
-
- protected void setSpecifiedMultitenant_(boolean isMultitenant) {
- boolean old = this.specifiedMultitenant;
- this.specifiedMultitenant = isMultitenant;
- this.firePropertyChanged(SPECIFIED_MULTITENANT_PROPERTY, old, isMultitenant);
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- this.getMultitenantAnnotation().setValue(EclipseLinkMultitenantType2_3.toJavaResourceModel(type));
- this.setSpecifiedType_(type);
- }
-
- protected void setSpecifiedType_(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkMultitenantType2_3 buildDefaultType() {
- if (!isMultitenant()) {
- return null;
- }
- if (isSpecifiedMultitenant()) {
- return DEFAULT_TYPE;
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return getRootEntity().getMultitenancy().getType();
- }
- EclipseLinkMappedSuperclass superMappedSuperclass = getSuperMappedSuperclass();
- return superMappedSuperclass != null ? superMappedSuperclass.getMultitenancy().getType() : DEFAULT_TYPE;
- }
-
-
-// // ********** include criteria **********
-//
-// public boolean isIncludeCriteria() {
-// return (this.specifiedIncludeCriteria != null) ? this.specifiedIncludeCriteria.booleanValue() : this.isDefaultIncludeCriteria();
-// }
-//
-// public Boolean getSpecifiedIncludeCriteria() {
-// return this.specifiedIncludeCriteria;
-// }
-//
-// public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
-// this.getMultitenantAnnotation().setIncludeCriteria(includeCriteria);
-// this.setSpecifiedIncludeCriteria_(includeCriteria);
-// }
-//
-// protected void setSpecifiedIncludeCriteria_(Boolean includeCriteria) {
-// Boolean old = this.specifiedIncludeCriteria;
-// this.specifiedIncludeCriteria = includeCriteria;
-// this.firePropertyChanged(SPECIFIED_INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
-// }
-//
-// public boolean isDefaultIncludeCriteria() {
-// return DEFAULT_INCLUDE_CRITERIA;
-// }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getReadOnlySpecifiedTenantDiscriminatorColumns() :
- this.getReadOnlyDefaultTenantDiscriminatorColumns();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getSpecifiedTenantDiscriminatorColumnsSize() :
- this.getDefaultTenantDiscriminatorColumnsSize();
- }
-
-
- // ********** specified tenant discriminator columns **********
-
- public ListIterable<JavaTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getReadOnlySpecifiedTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<JavaReadOnlyTenantDiscriminatorColumn2_3>(this.getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return this.getSpecifiedTenantDiscriminatorColumnsSize() != 0;
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- return this.addSpecifiedTenantDiscriminatorColumn(this.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 annotation = this.addTenantDiscriminatorColumnAnnotation(index);
- return this.specifiedTenantDiscriminatorColumnContainer.addContextElement(index, annotation);
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeSpecifiedTenantDiscriminatorColumn(this.specifiedTenantDiscriminatorColumnContainer.indexOfContextElement((JavaTenantDiscriminatorColumn2_3) tenantDiscriminatorColumn));
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- this.removeTenantDiscriminatorColumnAnnotation(index);
- this.specifiedTenantDiscriminatorColumnContainer.removeContextElement(index);
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.moveTenantDiscriminatorColumnAnnotation(targetIndex, sourceIndex);
- this.specifiedTenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(EclipseLinkTenantDiscriminatorColumnAnnotation2_3 discriminatorColumnAnnotation) {
- return new EclipseLinkJavaTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, discriminatorColumnAnnotation);
- }
-
- protected EclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildNullTenantDiscriminatorColumnAnnotation() {
- return new NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3(this.getJavaResourceType());
- }
-
- protected void syncSpecifiedTenantDiscriminatorColumns() {
- this.specifiedTenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ContextListContainer<JavaTenantDiscriminatorColumn2_3, EclipseLinkTenantDiscriminatorColumnAnnotation2_3> buildSpecifiedTenantDiscriminatorColumnContainer() {
- SpecifiedTenantDiscriminatorColumnContainer container = new SpecifiedTenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
- protected JavaReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- /**
- * specified tenant discriminator column container
- */
- protected class SpecifiedTenantDiscriminatorColumnContainer
- extends ContextListContainer<JavaTenantDiscriminatorColumn2_3, EclipseLinkTenantDiscriminatorColumnAnnotation2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected JavaTenantDiscriminatorColumn2_3 buildContextElement(EclipseLinkTenantDiscriminatorColumnAnnotation2_3 resourceElement) {
- return JavaEclipseLinkMultitenancyImpl2_3.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<EclipseLinkTenantDiscriminatorColumnAnnotation2_3> getResourceElements() {
- return JavaEclipseLinkMultitenancyImpl2_3.this.getTenantDiscriminatorColumnAnnotations();
- }
- @Override
- protected EclipseLinkTenantDiscriminatorColumnAnnotation2_3 getResourceElement(JavaTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getColumnAnnotation();
- }
- }
-
-
- // ********** default tenant discriminator columns **********
-
- public ListIterable<JavaVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getReadOnlyDefaultTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<JavaReadOnlyTenantDiscriminatorColumn2_3>(this.getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- protected void clearDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.clearContextList();
- }
-
- /**
- * If there are any specified tenant discriminator columns, then there are no default
- * tenant discriminator columns.
- * @see #getTenantDiscriminatorColumnsForDefaults()
- */
- protected void updateDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.update();
- }
-
- protected ContextListContainer<JavaVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> buildDefaultTenantDiscriminatorColumnContainer() {
- return new DefaultTenantDiscriminatorColumnContainer();
- }
-
- protected JavaVirtualTenantDiscriminatorColumn2_3 buildVirtualTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- return new EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, tenantDiscriminatorColumn);
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumnsForDefaults() {
- if (this.getType() == null || this.getType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- return EmptyListIterable.instance();
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getRootEntity().getMultitenancy().getTenantDiscriminatorColumns());
- }
- if (!this.isSpecifiedMultitenant()) {
- EclipseLinkMappedSuperclass superMappedSuperclass = this.getSuperMappedSuperclass();
- if (superMappedSuperclass != null && superMappedSuperclass.getMultitenancy().isMultitenant()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(superMappedSuperclass.getMultitenancy().getTenantDiscriminatorColumns());
- }
- }
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() == 0) {
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> contextColumns = this.getContextDefaultTenantDiscriminatorColumns();
- if (CollectionTools.isEmpty(contextColumns)) {
- return new SingleElementListIterable<ReadOnlyTenantDiscriminatorColumn2_3>(this.defaultTenantDiscriminatorColumn);
- }
- return contextColumns;
- }
- return EmptyListIterable.instance();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getContextDefaultTenantDiscriminatorColumns() {
- EclipseLinkEntityMappings entityMappings = this.getEclipseLinkEntityMappings();
- return (entityMappings != null) ? entityMappings.getTenantDiscriminatorColumns() : this.getPersistenceUnit().getDefaultTenantDiscriminatorColumns();
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return this.specifiedTenantDiscriminatorColumnsAllowed;
- }
-
- public void setSpecifiedTenantDiscriminatorColumnsAllowed(boolean allowed) {
- boolean old = this.specifiedTenantDiscriminatorColumnsAllowed;
- this.specifiedTenantDiscriminatorColumnsAllowed = allowed;
- this.firePropertyChanged(SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_ALLOWED_PROPERTY, old, allowed);
- }
-
- protected boolean buildSpecifiedTenantDiscriminatorColumnsAllowed() {
- return this.getParent().isMultitenantMetadataAllowed();
- }
-
-
- /**
- * default tenant discriminator column container
- */
- protected class DefaultTenantDiscriminatorColumnContainer
- extends ContextListContainer<JavaVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected JavaVirtualTenantDiscriminatorColumn2_3 buildContextElement(ReadOnlyTenantDiscriminatorColumn2_3 resourceElement) {
- return JavaEclipseLinkMultitenancyImpl2_3.this.buildVirtualTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getResourceElements() {
- return JavaEclipseLinkMultitenancyImpl2_3.this.getTenantDiscriminatorColumnsForDefaults();
- }
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getResourceElement(JavaVirtualTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getOverriddenColumn();
- }
- }
-
-
-
- // ********** JavaReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements JavaReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- public Table resolveDbTable(String tableName) {
- return getTypeMapping().resolveDbTable(tableName);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return getTypeMapping().getAllAssociatedTableNames();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return new TenantDiscriminatorColumnValidator2_3((ReadOnlyTenantDiscriminatorColumn2_3) column, textRangeResolver);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return JavaEclipseLinkMultitenancyImpl2_3.this.getValidationTextRange(astRoot);
- }
- }
-
-
- // ********** multitenant annotation **********
-
- protected EclipseLinkMultitenantAnnotation2_3 addMultitenantAnnotation() {
- return (EclipseLinkMultitenantAnnotation2_3) this.getJavaResourceType().addAnnotation(this.getMultitenantAnnotationName());
- }
-
- protected void removeMultitenantAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getMultitenantAnnotationName());
- }
-
- protected EclipseLinkMultitenantAnnotation2_3 getMultitenantAnnotation() {
- return (EclipseLinkMultitenantAnnotation2_3) this.getJavaResourceType().getNonNullAnnotation(this.getMultitenantAnnotationName());
- }
-
- protected TextRange getMultitenantAnnotationTextRange(CompilationUnit astRoot) {
- return this.getMultitenantAnnotation().getTextRange(astRoot);
- }
-
- public boolean isMultitenantAnnotationSpecified() {
- return this.getMultitenantAnnotation().isSpecified();
- }
-
- protected String getMultitenantAnnotationName() {
- return EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME;
- }
-
-
- // ********** tenant discriminator column annotations **********
-
- protected ListIterable<EclipseLinkTenantDiscriminatorColumnAnnotation2_3> getTenantDiscriminatorColumnAnnotations() {
- return this.getTenantDiscriminatorColumnAnnotations_();
- }
-
- protected ListIterable<EclipseLinkTenantDiscriminatorColumnAnnotation2_3> getTenantDiscriminatorColumnAnnotations_() {
- return new SubListIterableWrapper<NestableAnnotation, EclipseLinkTenantDiscriminatorColumnAnnotation2_3>(this.getNestableTenantDiscriminatorColumnAnnotations_());
- }
-
- protected ListIterable<NestableAnnotation> getNestableTenantDiscriminatorColumnAnnotations_() {
- return this.getJavaResourceType().getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
- protected EclipseLinkTenantDiscriminatorColumnAnnotation2_3 addTenantDiscriminatorColumnAnnotation(int index) {
- return (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) this.getJavaResourceType().addAnnotation(index, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
- protected void removeTenantDiscriminatorColumnAnnotation(int index) {
- this.getJavaResourceType().removeAnnotation(index, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
- protected void moveTenantDiscriminatorColumnAnnotation(int targetIndex, int sourceIndex) {
- this.getJavaResourceType().moveAnnotation(targetIndex, sourceIndex, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (JavaEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- public JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
- public EclipseLinkEntityMappings getEclipseLinkEntityMappings() {
- MappingFileRoot mfRoot = super.getMappingFileRoot();
- if (mfRoot instanceof EclipseLinkEntityMappings) {
- return (EclipseLinkEntityMappings) mfRoot;
- }
- return null;
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- protected boolean isMultitenantInheritanceHierarchy() {
- if (this.isInheritanceStrategyTablePerClass()) {
- return false;
- }
- return this.isRootEntityMultitenant();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
- protected boolean isRootEntityMultitenant() {
- EclipseLinkEntity rootEntity = this.getRootEntity();
- return rootEntity != null && rootEntity != getParent() && rootEntity.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkEntity getRootEntity() {
- //instanceof check in case the rootEntity is in an orm.xml instead of an eclipselinkorm.xml file.
- Entity entity = getParent().getRootEntity();
- return entity instanceof EclipseLinkEntity ? (EclipseLinkEntity) entity : null;
- }
-
-
- protected boolean isSuperMappedSuperclassMultitenant() {
- EclipseLinkMappedSuperclass mappedSuperclass = this.getSuperMappedSuperclass(getParent());
- return mappedSuperclass != null && mappedSuperclass.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass() {
- return this.getSuperMappedSuperclass(this.getParent());
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass(TypeMapping typeMapping) {
- TypeMapping superTypeMapping = typeMapping.getSuperTypeMapping();
- if (superTypeMapping == null) {
- return null;
- }
- //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
- if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
- return (EclipseLinkMappedSuperclass) superTypeMapping;
- }
- return this.getSuperMappedSuperclass(superTypeMapping);
- }
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn : this.getSpecifiedTenantDiscriminatorColumns()) {
- result = tenantDiscriminatorColumn.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
-
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getSpecifiedType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getMultitenantAnnotationTextRange(astRoot)
- )
- );
- }
- if (getSpecifiedType() == EclipseLinkMultitenantType2_3.VPD) {
- String targetDatabase = getPersistenceUnit().getOptions().getTargetDatabase();
- if (targetDatabase == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getMultitenantAnnotationTextRange(astRoot)
- )
- );
- }
- else if (!TargetDatabase.isOracleDatabase(targetDatabase)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM,
- new String[] {targetDatabase},
- this,
- this.getMultitenantAnnotationTextRange(astRoot)
- )
- );
- }
- }
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() > 0) {
- if (!this.specifiedTenantDiscriminatorColumnsAllowed()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY,
- EMPTY_STRING_ARRAY,
- this,
- this.getJavaResourceType().getTextRange(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME, astRoot)
- )
- );
- }
- else if (this.isMultitenantAnnotationSpecified()) {
- for (JavaTenantDiscriminatorColumn2_3 column : this.getSpecifiedTenantDiscriminatorColumns()) {
- column.validate(messages, reporter, astRoot);
- }
- }
- else {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS,
- EMPTY_STRING_ARRAY,
- this,
- this.getJavaResourceType().getTextRange(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME, astRoot)
- )
- );
- }
- }
- if (this.specifiedTenantDiscriminatorColumnsAllowed()) {
- //bug 360731 no need to validate, they will be validated where they are specified
- for (JavaVirtualTenantDiscriminatorColumn2_3 column : this.getDefaultTenantDiscriminatorColumns()) {
- column.validate(messages, reporter, astRoot);
- }
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getMultitenantAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java
deleted file mode 100644
index 7e4c066ec9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-public class JavaEclipseLinkMutable
- extends AbstractJavaJpaContextNode
- implements EclipseLinkMutable
-{
- protected Boolean specifiedMutable;
- protected boolean defaultMutable;
-
-
- public JavaEclipseLinkMutable(JavaAttributeMapping parent) {
- super(parent);
- this.specifiedMutable = this.buildSpecifiedMutable();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedMutable_(this.buildSpecifiedMutable());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultMutable(this.buildDefaultMutable());
- }
-
-
- // ********** mutable **********
-
- public boolean isMutable() {
- return (this.specifiedMutable != null) ? this.specifiedMutable.booleanValue() : this.defaultMutable;
- }
-
- public Boolean getSpecifiedMutable() {
- return this.specifiedMutable;
- }
-
- public void setSpecifiedMutable(Boolean mutable) {
- if (this.valuesAreDifferent(mutable, this.specifiedMutable)) {
- EclipseLinkMutableAnnotation annotation = this.getMutableAnnotation();
- if (mutable == null) {
- if (annotation != null) {
- this.removeMutableAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addMutableAnnotation();
- }
- Boolean annotationValue = annotation.getValue();
- boolean annotationBooleanValue = (annotationValue == null) ? true : annotationValue.booleanValue();
- if (annotationBooleanValue != mutable.booleanValue()) {
- annotation.setValue(mutable);
- }
- }
-
- this.setSpecifiedMutable_(mutable);
- }
- }
-
- protected void setSpecifiedMutable_(Boolean mutable) {
- Boolean old = this.specifiedMutable;
- this.specifiedMutable = mutable;
- this.firePropertyChanged(SPECIFIED_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected Boolean buildSpecifiedMutable() {
- EclipseLinkMutableAnnotation annotation = this.getMutableAnnotation();
- if (annotation == null) {
- return null;
- }
-
- // @Mutable is equivalent to @Mutable(true)
- Boolean annotationValue = annotation.getValue();
- return (annotationValue == null) ? Boolean.TRUE : annotationValue;
- }
-
- public boolean isDefaultMutable() {
- return this.defaultMutable;
- }
-
- protected void setDefaultMutable(boolean mutable) {
- boolean old = this.defaultMutable;
- this.defaultMutable = mutable;
- this.firePropertyChanged(DEFAULT_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected boolean buildDefaultMutable() {
- JavaEclipseLinkPersistentAttribute javaAttribute = this.getPersistentAttribute();
- if (javaAttribute.typeIsDateOrCalendar()) {
- Boolean puTemporalMutable = this.getPersistenceUnit().getOptions().getTemporalMutable();
- return (puTemporalMutable == null) ? false : puTemporalMutable.booleanValue();
- }
- return javaAttribute.typeIsSerializable();
- }
-
-
- // ********** mutable annotation **********
-
- protected EclipseLinkMutableAnnotation getMutableAnnotation() {
- return (EclipseLinkMutableAnnotation) this.getResourceAttribute().getAnnotation(this.getMutableAnnotationName());
- }
-
- protected EclipseLinkMutableAnnotation addMutableAnnotation() {
- return (EclipseLinkMutableAnnotation) this.getResourceAttribute().addAnnotation(this.getMutableAnnotationName());
- }
-
- protected void removeMutableAnnotation() {
- this.getResourceAttribute().removeAnnotation(this.getMutableAnnotationName());
- }
-
- protected String getMutableAnnotationName() {
- return EclipseLinkMutableAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- protected JavaAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceAttribute getResourceAttribute() {
- return this.getAttributeMapping().getResourceAttribute();
- }
-
- protected JavaEclipseLinkPersistentAttribute getPersistentAttribute() {
- return (JavaEclipseLinkPersistentAttribute) this.getAttributeMapping().getPersistentAttribute();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkMutableAnnotation annotation = this.getMutableAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java
deleted file mode 100644
index e664335270..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>org.eclipse.persistence.annotations.ObjectTypeConverter</code>
- */
-public class JavaEclipseLinkObjectTypeConverter
- extends JavaEclipseLinkConverter<EclipseLinkObjectTypeConverterAnnotation>
- implements EclipseLinkObjectTypeConverter
-{
- private String dataType;
- private String fullyQualifiedDataType;
- public static final String FULLY_QUALIFIED_DATA_TYPE_PROPERTY = "fullyQualifiedDataType"; //$NON-NLS-1$
-
- private String objectType;
- private String fullyQualifiedObjectType;
- public static final String FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY = "fullyQualifiedObjectType"; //$NON-NLS-1$
-
- protected final ContextListContainer<JavaEclipseLinkConversionValue, EclipseLinkConversionValueAnnotation> conversionValueContainer;
-
- private String defaultObjectValue;
-
-
- public JavaEclipseLinkObjectTypeConverter(JavaJpaContextNode parent, EclipseLinkObjectTypeConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation);
- this.dataType = converterAnnotation.getDataType();
- this.objectType = converterAnnotation.getObjectType();
- this.conversionValueContainer = this.buildConversionValueContainer();
- this.defaultObjectValue = converterAnnotation.getDefaultObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.converterAnnotation.getDataType());
- this.setObjectType_(this.converterAnnotation.getObjectType());
- this.syncConversionValues();
- this.setDefaultObjectValue_(this.converterAnnotation.getDefaultObjectValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedDataType(this.converterAnnotation.getFullyQualifiedDataType());
- this.setFullyQualifiedObjectType(this.converterAnnotation.getFullyQualifiedObjectType());
- this.updateNodes(this.getConversionValues());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.converterAnnotation.setDataType(dataType);
- this.setDataType_(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** fully qualified data type **********
-
- public String getFullyQualifiedDataType() {
- return this.fullyQualifiedDataType;
- }
-
- protected void setFullyQualifiedDataType(String dataType) {
- String old = this.fullyQualifiedDataType;
- this.fullyQualifiedDataType = dataType;
- this.firePropertyChanged(FULLY_QUALIFIED_DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.converterAnnotation.setObjectType(objectType);
- this.setObjectType_(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** fully qualified object type **********
-
- public String getFullyQualifiedObjectType() {
- return this.fullyQualifiedObjectType;
- }
-
- protected void setFullyQualifiedObjectType(String objectType) {
- String old = this.fullyQualifiedObjectType;
- this.fullyQualifiedObjectType = objectType;
- this.firePropertyChanged(FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** conversion values **********
-
- public ListIterable<JavaEclipseLinkConversionValue> getConversionValues() {
- return this.conversionValueContainer.getContextElements();
- }
-
- public int getConversionValuesSize() {
- return this.conversionValueContainer.getContextElementsSize();
- }
-
- public JavaEclipseLinkConversionValue addConversionValue() {
- return this.addConversionValue(this.getConversionValuesSize());
- }
-
- public JavaEclipseLinkConversionValue addConversionValue(int index) {
- EclipseLinkConversionValueAnnotation annotation = this.converterAnnotation.addConversionValue(index);
- return this.conversionValueContainer.addContextElement(index, annotation);
- }
-
- public void removeConversionValue(EclipseLinkConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValueContainer.indexOfContextElement((JavaEclipseLinkConversionValue) conversionValue));
- }
-
- public void removeConversionValue(int index) {
- this.converterAnnotation.removeConversionValue(index);
- this.conversionValueContainer.removeContextElement(index);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- this.converterAnnotation.moveConversionValue(targetIndex, sourceIndex);
- this.conversionValueContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaEclipseLinkConversionValue buildConversionValue(EclipseLinkConversionValueAnnotation conversionValueAnnotation) {
- return new JavaEclipseLinkConversionValue(this, conversionValueAnnotation);
- }
-
- protected void syncConversionValues() {
- this.conversionValueContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<EclipseLinkConversionValueAnnotation> getConversionValueAnnotations() {
- return this.converterAnnotation.getConversionValues();
- }
-
- protected ContextListContainer<JavaEclipseLinkConversionValue, EclipseLinkConversionValueAnnotation> buildConversionValueContainer() {
- ConversionValueContainer container = new ConversionValueContainer();
- container.initialize();
- return container;
- }
-
- /**
- * conversion value container
- */
- protected class ConversionValueContainer
- extends ContextListContainer<JavaEclipseLinkConversionValue, EclipseLinkConversionValueAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return CONVERSION_VALUES_LIST;
- }
-
- @Override
- protected JavaEclipseLinkConversionValue buildContextElement(EclipseLinkConversionValueAnnotation resourceElement) {
- return JavaEclipseLinkObjectTypeConverter.this.buildConversionValue(resourceElement);
- }
-
- @Override
- protected ListIterable<EclipseLinkConversionValueAnnotation> getResourceElements() {
- return JavaEclipseLinkObjectTypeConverter.this.getConversionValueAnnotations();
- }
-
- @Override
- protected EclipseLinkConversionValueAnnotation getResourceElement(JavaEclipseLinkConversionValue contextElement) {
- return contextElement.getConversionValueAnnotation();
- }
- }
-
-
- // ********** data values **********
-
- public Iterable<String> getDataValues() {
- return new TransformationIterable<JavaEclipseLinkConversionValue, String>(this.getConversionValues()) {
- @Override
- protected String transform(JavaEclipseLinkConversionValue conversionValue) {
- return conversionValue.getDataValue();
- }
- };
- }
-
- public int getDataValuesSize() {
- return this.getConversionValuesSize();
- }
-
-
- // ********** default object value **********
-
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String value) {
- this.converterAnnotation.setDefaultObjectValue(value);
- this.setDefaultObjectValue_(value);
- }
-
- protected void setDefaultObjectValue_(String value) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = value;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkObjectTypeConverter> getType() {
- return EclipseLinkObjectTypeConverter.class;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.checkForDuplicateDataValues(messages, astRoot);
- for (JavaEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- conversionValue.validate(messages, reporter, astRoot);
- }
- }
-
- protected void checkForDuplicateDataValues(List<IMessage> messages, CompilationUnit astRoot) {
- for (ArrayList<JavaEclipseLinkConversionValue> dups : this.mapConversionValuesByDataValue().values()) {
- if (dups.size() > 1) {
- for (JavaEclipseLinkConversionValue dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE,
- new String[] {dup.getDataValue()},
- this,
- dup.getDataValueTextRange(astRoot)
- )
- );
- }
- }
- }
- }
-
- protected HashMap<String, ArrayList<JavaEclipseLinkConversionValue>> mapConversionValuesByDataValue() {
- HashMap<String, ArrayList<JavaEclipseLinkConversionValue>> map = new HashMap<String, ArrayList<JavaEclipseLinkConversionValue>>(this.getConversionValuesSize());
- for (JavaEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- String dataValue = conversionValue.getDataValue();
- ArrayList<JavaEclipseLinkConversionValue> list = map.get(dataValue);
- if (list == null) {
- list = new ArrayList<JavaEclipseLinkConversionValue>();
- map.put(dataValue, list);
- }
- list.add(conversionValue);
- }
- return map;
- }
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getFullyQualifiedObjectType(), ((JavaEclipseLinkObjectTypeConverter)eclipseLinkConverter).getFullyQualifiedObjectType()) &&
- StringTools.stringsAreEqual(this.getFullyQualifiedDataType(), ((JavaEclipseLinkObjectTypeConverter)eclipseLinkConverter).getFullyQualifiedDataType()) &&
- StringTools.stringsAreEqual(this.getDefaultObjectValue(), (((EclipseLinkObjectTypeConverter)eclipseLinkConverter).getDefaultObjectValue())) &&
- conversionValuesAreIdentical(((EclipseLinkObjectTypeConverter)eclipseLinkConverter).getConversionValues());
- }
-
- private boolean conversionValuesAreIdentical(ListIterable<? extends EclipseLinkConversionValue> conversionValues) {
- boolean isIdentical = true;
- if (this.getConversionValuesSize() != CollectionTools.size(conversionValues)) {
- return false;
- } else {
- for (int i=0; i<this.getConversionValuesSize(); i++) {
- if (!(CollectionTools.get(this.getConversionValues(), i)).isIdentical(CollectionTools.get(conversionValues, i))) {
- isIdentical = false;
- }
- }
- }
- return isIdentical;
- }
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkObjectTypeConverter> getConverterType() {
- return EclipseLinkObjectTypeConverter.class;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildConverter(EclipseLinkNamedConverterAnnotation converterAnnotation, JavaJpaContextNode parent) {
- return new JavaEclipseLinkObjectTypeConverter(parent, (EclipseLinkObjectTypeConverterAnnotation) converterAnnotation);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
deleted file mode 100644
index 12d6219739..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappingRelationship;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaOneToManyRelationship2_0;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkOneToManyMapping
- extends AbstractJavaOneToManyMapping
- implements EclipseLinkOneToManyMapping2_0
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkPrivateOwned privateOwned;
-
-
- public JavaEclipseLinkOneToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.privateOwned = new JavaEclipseLinkPrivateOwned(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** relationship **********
-
- @Override
- public EclipseLinkJavaOneToManyRelationship2_0 getRelationship() {
- return (EclipseLinkJavaOneToManyRelationship) super.getRelationship();
- }
-
- @Override
- protected JavaMappingRelationship buildRelationship() {
- return new EclipseLinkJavaOneToManyRelationship(this);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- this.privateOwned.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
deleted file mode 100644
index 2cddbfbcbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkOneToOneMapping
- extends AbstractJavaOneToOneMapping
- implements EclipseLinkOneToOneMapping2_0
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkPrivateOwned privateOwned;
-
-
- public JavaEclipseLinkOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.privateOwned = new JavaEclipseLinkPrivateOwned(this);
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- this.privateOwned.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java
deleted file mode 100644
index 9a3ab9d256..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.Accessor;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkPersistentAttributeValidator;
-
-/**
- * EclipseLink Java persistent attribute
- */
-public class JavaEclipseLinkPersistentAttribute
- extends AbstractJavaPersistentAttribute
-{
-
- public JavaEclipseLinkPersistentAttribute(PersistentType parent, JavaResourceField resourceField) {
- super(parent,resourceField);
- }
-
- public JavaEclipseLinkPersistentAttribute(PersistentType parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- super(parent, resourceGetter, resourceSetter);
- }
-
- public JavaEclipseLinkPersistentAttribute(PersistentType parent, Accessor accessor) {
- super(parent, accessor);
- }
-
- // ********** mapping **********
-
- @Override
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition(String key) {
- if (this.specifiedKeyIsInvalid(key)) {
- throw new IllegalArgumentException("invalid mapping: " + key); //$NON-NLS-1$
- }
- return super.getSpecifiedMappingDefinition(key);
- }
-
- /**
- * EclipseLink does not support setting an attribute with a default 1:1
- * mapping to a specified mapping of ID; because the resulting ID annotation
- * indicates a primary key derived from the 1:1 mapping, <em>not</em> an ID
- * mapping.
- */
- protected boolean specifiedKeyIsInvalid(String key) {
- return Tools.valuesAreEqual(key, MappingKeys.ID_ATTRIBUTE_MAPPING_KEY) &&
- Tools.valuesAreEqual(this.getDefaultMappingKey(), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
-
- // ********** type **********
-
- /**
- * Return whether the attribute's type is a subclass of
- * <code>java.util.Date</code> or <code>java.util.Calendar</code>.
- */
- public boolean typeIsDateOrCalendar() {
- return this.getResourceAttribute().typeIsSubTypeOf(DATE_TYPE_NAME)
- || this.getResourceAttribute().typeIsSubTypeOf(CALENDAR_TYPE_NAME);
- }
- protected static final String DATE_TYPE_NAME = java.util.Date.class.getName();
- protected static final String CALENDAR_TYPE_NAME = java.util.Calendar.class.getName();
-
- public boolean typeIsSerializable() {
- return this.getResourceAttribute().typeIsVariablePrimitive()
- || this.getResourceAttribute().typeIsSubTypeOf(SERIALIZABLE_TYPE_NAME);
- }
-
- public boolean typeIsValidForVariableOneToOne() {
- return this.getResourceAttribute().typeIsInterface()
- && this.interfaceIsValidForVariableOneToOne(getTypeName());
- }
-
- protected boolean interfaceIsValidForVariableOneToOne(String interfaceName) {
- return ! this.interfaceIsInvalidForVariableOneToOne(interfaceName);
- }
-
- // TODO we could probably add more interfaces to this list...
- protected boolean interfaceIsInvalidForVariableOneToOne(String interfaceName) {
- return (interfaceName == null) ||
- this.typeIsContainer(interfaceName) ||
- interfaceName.equals("org.eclipse.persistence.indirection.ValueHolderInterface"); //$NON-NLS-1$
- }
-
-
- // ********** validation **********
-
- @Override
- protected JptValidator buildAttributeValidator(CompilationUnit astRoot) {
- return new EclipseLinkPersistentAttributeValidator(this, buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java
deleted file mode 100644
index 01b6e9238b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-public class JavaEclipseLinkPrivateOwned
- extends AbstractJavaJpaContextNode
- implements EclipseLinkPrivateOwned
-{
- protected boolean privateOwned;
-
-
- public JavaEclipseLinkPrivateOwned(JavaAttributeMapping parent) {
- super(parent);
- this.privateOwned = this.buildPrivateOwned();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setPrivateOwned_(this.buildPrivateOwned());
- }
-
-
- // ********** private owned **********
-
- public boolean isPrivateOwned() {
- return this.privateOwned;
- }
-
- public void setPrivateOwned(boolean privateOwned) {
- if (privateOwned != this.privateOwned) {
- EclipseLinkPrivateOwnedAnnotation annotation = this.getPrivateOwnedAnnotation();
- if (privateOwned) {
- if (annotation == null) {
- this.addPrivateOwnedAnnotation();
- }
- } else {
- if (annotation != null) {
- this.removePrivateOwnedAnnotation();
- }
- }
-
- this.setPrivateOwned_(privateOwned);
- }
- }
-
- protected void setPrivateOwned_(boolean privateOwned) {
- boolean old = this.privateOwned;
- this.privateOwned = privateOwned;
- this.firePropertyChanged(PRIVATE_OWNED_PROPERTY, old, privateOwned);
- }
-
- protected boolean buildPrivateOwned() {
- return this.getPrivateOwnedAnnotation() != null;
- }
-
-
- // ********** private owned annotation **********
-
- protected EclipseLinkPrivateOwnedAnnotation getPrivateOwnedAnnotation() {
- return (EclipseLinkPrivateOwnedAnnotation) this.getResourceAttribute().getAnnotation(this.getPrivateOwnedAnnotationName());
- }
-
- protected EclipseLinkPrivateOwnedAnnotation addPrivateOwnedAnnotation() {
- return (EclipseLinkPrivateOwnedAnnotation) this.getResourceAttribute().addAnnotation(this.getPrivateOwnedAnnotationName());
- }
-
- protected void removePrivateOwnedAnnotation() {
- this.getResourceAttribute().removeAnnotation(this.getPrivateOwnedAnnotationName());
- }
-
- protected String getPrivateOwnedAnnotationName() {
- return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- protected JavaAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceAttribute getResourceAttribute() {
- return this.getAttributeMapping().getResourceAttribute();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkPrivateOwnedAnnotation annotation = this.getPrivateOwnedAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java
deleted file mode 100644
index 0cc0da0052..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-public class JavaEclipseLinkReadOnly
- extends AbstractJavaJpaContextNode
- implements EclipseLinkReadOnly
-{
- protected Boolean specifiedReadOnly; // TRUE or null
-
-
- public JavaEclipseLinkReadOnly(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- this.specifiedReadOnly = this.buildSpecifiedReadOnly();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedReadOnly_(this.buildSpecifiedReadOnly());
- }
-
-
- // ********** read-only **********
-
- public boolean isReadOnly() {
- return (this.specifiedReadOnly != null) ? this.specifiedReadOnly.booleanValue() : this.isDefaultReadOnly();
- }
-
- public Boolean getSpecifiedReadOnly() {
- return this.specifiedReadOnly;
- }
-
- public void setSpecifiedReadOnly(Boolean readOnly) {
- readOnly = (readOnly == null) ? null : readOnly.booleanValue() ? readOnly : null;
- if (this.valuesAreDifferent(readOnly, this.specifiedReadOnly)) {
- EclipseLinkReadOnlyAnnotation annotation = this.getReadOnlyAnnotation();
- if (readOnly != null) {
- if (annotation == null) {
- this.addReadOnlyAnnotation();
- }
- } else {
- if (annotation != null) {
- this.removeReadOnlyAnnotation();
- }
- }
-
- this.setSpecifiedReadOnly_(readOnly);
- }
- }
-
- protected void setSpecifiedReadOnly_(Boolean readOnly) {
- Boolean old = this.specifiedReadOnly;
- this.specifiedReadOnly = readOnly;
- this.firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, old, readOnly);
- }
-
- private Boolean buildSpecifiedReadOnly() {
- return (this.getReadOnlyAnnotation() == null) ? null : Boolean.TRUE;
- }
-
- public boolean isDefaultReadOnly() {
- return DEFAULT_READ_ONLY;
- }
-
-
- // ********** read-only annotation **********
-
- protected EclipseLinkReadOnlyAnnotation getReadOnlyAnnotation() {
- return (EclipseLinkReadOnlyAnnotation) this.getJavaResourceType().getAnnotation(this.getReadOnlyAnnotationName());
- }
-
- protected void addReadOnlyAnnotation() {
- this.getJavaResourceType().addAnnotation(this.getReadOnlyAnnotationName());
- }
-
- protected void removeReadOnlyAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getReadOnlyAnnotationName());
- }
-
- protected String getReadOnlyAnnotationName() {
- return EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (JavaEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkReadOnlyAnnotation annotation = this.getReadOnlyAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java
deleted file mode 100644
index 4b4419c7b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.StructConverter</code>
- */
-public class JavaEclipseLinkStructConverter
- extends JavaEclipseLinkConverterClassConverter<EclipseLinkStructConverterAnnotation>
- implements EclipseLinkStructConverter
-{
- public JavaEclipseLinkStructConverter(JavaJpaContextNode parent, EclipseLinkStructConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation, converterAnnotation.getConverter());
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getAnnotationConverterClass() {
- return this.converterAnnotation.getConverter();
- }
-
- @Override
- protected void setAnnotationConverterClass(String converterClass) {
- this.converterAnnotation.setConverter(converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkStructConverter> getType() {
- return EclipseLinkStructConverter.class;
- }
-
-
- // ********** validation **********
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER;
- }
-
- @Override
- protected TextRange getAnnotationConverterClassTextRange(CompilationUnit astRoot) {
- return this.converterAnnotation.getConverterTextRange(astRoot);
- }
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getFullyQualifiedConverterClass(), (((EclipseLinkStructConverter)eclipseLinkConverter).getConverterClass()));
- }
-
- /**
- * Since the converter class is a string, it must be fully-qualified.
- */
- @Override
- protected String getFullyQualifiedConverterClass() {
- return this.getConverterClass();
- }
-
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkStructConverter> getConverterType() {
- return EclipseLinkStructConverter.class;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkStructConverterAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildConverter(EclipseLinkNamedConverterAnnotation converterAnnotation, JavaJpaContextNode parent) {
- return new JavaEclipseLinkStructConverter(parent, (EclipseLinkStructConverterAnnotation) converterAnnotation);
- }
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java
deleted file mode 100644
index 74a4d668d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-public class JavaEclipseLinkTransformationMapping
- extends AbstractJavaAttributeMapping<EclipseLinkTransformationAnnotation>
- implements EclipseLinkTransformationMapping
-{
-
- public JavaEclipseLinkTransformationMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java
deleted file mode 100644
index e06c3a7cbd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.TypeConverter</code>
- */
-public class JavaEclipseLinkTypeConverter
- extends JavaEclipseLinkConverter<EclipseLinkTypeConverterAnnotation>
- implements EclipseLinkTypeConverter
-{
- private String dataType;
- private String fullyQualifiedDataType;
- public static final String FULLY_QUALIFIED_DATA_TYPE_PROPERTY = "fullyQualifiedDataType"; //$NON-NLS-1$
-
- private String objectType;
- private String fullyQualifiedObjectType;
- public static final String FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY = "fullyQualifiedObjectType"; //$NON-NLS-1$
-
-
- public JavaEclipseLinkTypeConverter(JavaJpaContextNode parent, EclipseLinkTypeConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation);
- this.dataType = this.converterAnnotation.getDataType();
- this.objectType = this.converterAnnotation.getObjectType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.converterAnnotation.getDataType());
- this.setObjectType_(this.converterAnnotation.getObjectType());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedDataType(this.converterAnnotation.getFullyQualifiedDataType());
- this.setFullyQualifiedObjectType(this.converterAnnotation.getFullyQualifiedObjectType());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.converterAnnotation.setDataType(dataType);
- this.setDataType_(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** fully qualified data type **********
-
- public String getFullyQualifiedDataType() {
- return this.fullyQualifiedDataType;
- }
-
- protected void setFullyQualifiedDataType(String dataType) {
- String old = this.fullyQualifiedDataType;
- this.fullyQualifiedDataType = dataType;
- this.firePropertyChanged(FULLY_QUALIFIED_DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.converterAnnotation.setObjectType(objectType);
- this.setObjectType_(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** fully qualified object type **********
-
- public String getFullyQualifiedObjectType() {
- return this.fullyQualifiedObjectType;
- }
-
- protected void setFullyQualifiedObjectType(String objectType) {
- String old = this.fullyQualifiedObjectType;
- this.fullyQualifiedObjectType = objectType;
- this.firePropertyChanged(FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkTypeConverter> getType() {
- return EclipseLinkTypeConverter.class;
- }
-
- // ********** validation *********
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getFullyQualifiedDataType(), ((JavaEclipseLinkTypeConverter)eclipseLinkConverter).getFullyQualifiedDataType()) &&
- StringTools.stringsAreEqual(this.getFullyQualifiedObjectType(), ((JavaEclipseLinkTypeConverter)eclipseLinkConverter).getFullyQualifiedObjectType());
- }
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkTypeConverter> getConverterType() {
- return EclipseLinkTypeConverter.class;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEclipseLinkConverter<? extends EclipseLinkNamedConverterAnnotation> buildConverter(EclipseLinkNamedConverterAnnotation converterAnnotation, JavaJpaContextNode parent) {
- return new JavaEclipseLinkTypeConverter(parent, (EclipseLinkTypeConverterAnnotation) converterAnnotation);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index a1ec8eefad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-public class JavaEclipseLinkVariableOneToOneMapping
- extends AbstractJavaAttributeMapping<EclipseLinkVariableOneToOneAnnotation>
- implements EclipseLinkVariableOneToOneMapping
-{
-
- public JavaEclipseLinkVariableOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java
deleted file mode 100644
index 00f02445cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkVersionMapping
- extends AbstractJavaVersionMapping
- implements EclipseLinkVersionMapping
-{
- protected final JavaEclipseLinkMutable mutable;
-
-
- public JavaEclipseLinkVersionMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new JavaEclipseLinkMutable(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(JavaEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mutable.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected void validateAttributeType(List<IMessage> messages, CompilationUnit astRoot) {
- if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getPersistentAttribute().getTypeName())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index df32a009e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaVirtualTenantDiscriminatorColumn2_3;
-
-public class NullJavaEclipseLinkMultitenancy2_3
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkMultitenancy2_3
-{
-
- public NullJavaEclipseLinkMultitenancy2_3(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- }
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return false;
- }
-
- public boolean isDefaultMultitenant() {
- return false;
- }
-
- public boolean isSpecifiedMultitenant() {
- return false;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return null;
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return null;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return null;
- }
-
- public boolean isIncludeCriteria() {
- return false;
- }
-
- public Boolean getSpecifiedIncludeCriteria() {
- return null;
- }
-
- public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public boolean isDefaultIncludeCriteria() {
- return false;
- }
-
- public ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public ListIterable<JavaTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return false;
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public ListIterable<JavaVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java
deleted file mode 100644
index c204c74f62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddableDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEntityDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-
-public abstract class AbstractEclipseLinkOrmXmlDefinition
- extends AbstractOrmXmlDefinition
-{
- protected AbstractEclipseLinkOrmXmlDefinition() {
- super();
- }
-
- public EFactory getResourceNodeFactory() {
- return EclipseLinkOrmFactory.eINSTANCE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXmlContextNodeFactory();
- }
-
- @Override
- protected void addTypeMappingDefinitionsTo(ArrayList<OrmTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, TYPE_MAPPING_DEFINITIONS);
- }
-
- /**
- * Order should not matter here; but we'll use the same order as for Java.
- * @see EclipseLinkJpaPlatformProvider
- */
- protected static final OrmTypeMappingDefinition[] TYPE_MAPPING_DEFINITIONS = new OrmTypeMappingDefinition[] {
- OrmEntityDefinition.instance(),
- OrmEmbeddableDefinition.instance(),
- OrmMappedSuperclassDefinition.instance()
- };
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- /**
- * Order should not matter here; but we'll use the same order as for Java.
- * @see EclipseLinkJpaPlatformProvider
- */
- protected static final OrmAttributeMappingDefinition[] ATTRIBUTE_MAPPING_DEFINITIONS = new OrmAttributeMappingDefinition[] {
- OrmTransientMappingDefinition.instance(),
- OrmEclipseLinkBasicCollectionMappingDefinition.instance(),
- OrmEclipseLinkBasicMapMappingDefinition.instance(),
- OrmIdMappingDefinition.instance(),
- OrmVersionMappingDefinition.instance(),
- OrmBasicMappingDefinition.instance(),
- OrmEmbeddedMappingDefinition.instance(),
- OrmEmbeddedIdMappingDefinition.instance(),
- OrmEclipseLinkTransformationMappingDefinition.instance(),
- OrmManyToManyMappingDefinition.instance(),
- OrmManyToOneMappingDefinition.instance(),
- OrmOneToManyMappingDefinition.instance(),
- OrmOneToOneMappingDefinition.instance(),
- OrmEclipseLinkVariableOneToOneMappingDefinition.instance(),
- NullOrmAttributeMappingDefinition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 962339cc9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.PersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public abstract class AbstractOrmEclipseLinkBasicCollectionMapping
- extends AbstractOrmAttributeMapping<XmlBasicCollection>
- implements EclipseLinkBasicCollectionMapping
-{
- protected AbstractOrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection xmlMapping) {
- super(parent, xmlMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicCollections().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicCollections().remove(this.xmlAttributeMapping);
- }
-
- public int getXmlSequence() {
- return 23;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((PersistentAttribute2_0) getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = null;
- JavaPersistentAttribute javaPersistentAttribute = getJavaPersistentAttribute();
- if (javaPersistentAttribute != null) {
- targetTypeName = javaPersistentAttribute.getMultiReferenceTargetTypeName();
- }
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java
deleted file mode 100644
index 2a7bf337c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.PersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public abstract class AbstractOrmEclipseLinkBasicMapMapping
- extends AbstractOrmAttributeMapping<XmlBasicMap>
- implements EclipseLinkBasicMapMapping
-{
- protected AbstractOrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap xmlMapping) {
- super(parent, xmlMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicMaps().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicMaps().remove(this.xmlAttributeMapping);
- }
-
-
- public int getXmlSequence() {
- return 27;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((PersistentAttribute2_0) getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = null;
- JavaPersistentAttribute javaPersistentAttribute = getJavaPersistentAttribute();
- if (javaPersistentAttribute != null) {
- targetTypeName = javaPersistentAttribute.getMultiReferenceTargetTypeName();
- }
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
- @Override
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- this.addMetamodelFieldMapKeyTypeArgumentNameTo(typeArgumentNames);
- super.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- }
-
- protected void addMetamodelFieldMapKeyTypeArgumentNameTo(ArrayList<String> typeArgumentNames) {
- String mapKeyTypeName = null;
- JavaPersistentAttribute javaPersistentAttribute = getJavaPersistentAttribute();
- if (javaPersistentAttribute != null) {
- mapKeyTypeName = javaPersistentAttribute.getMultiReferenceMapKeyTypeName();
- }
- mapKeyTypeName = mapKeyTypeName != null ? mapKeyTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- typeArgumentNames.add(mapKeyTypeName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java
deleted file mode 100644
index e72e20ad68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractEntityMappings;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkEntityMappingsImpl
- extends AbstractEntityMappings
- implements EclipseLinkEntityMappings
-{
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> specifiedTenantDiscriminatorColumnContainer;
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
-
- protected final ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumnContainer;
-
- public EclipseLinkEntityMappingsImpl(OrmXml parent, XmlEntityMappings resource) {
- super(parent, resource);
- this.converterContainer = this.buildConverterContainer();
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.specifiedTenantDiscriminatorColumnContainer = this.buildSpecifiedTenantDiscriminatorColumnContainer();
- this.defaultTenantDiscriminatorColumnContainer = this.buildDefaultTenantDiscriminatorColumnContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.syncSpecifiedTenantDiscriminatorColumns();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- this.updateNodes(this.getSpecifiedTenantDiscriminatorColumns());
- this.updateDefaultTenantDiscriminatorColumns();
- }
-
- @Override
- public XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) super.getXmlEntityMappings();
- }
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, (XmlEntityMappings) this.xmlEntityMappings);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getMappingFileConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getTypeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getTypeMappingConverters() {
- return new CompositeIterable<EclipseLinkConverter>(this.getTypeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getTypeMappingConverterLists() {
- return new TransformationIterable<OrmTypeMapping, Iterable<EclipseLinkConverter>>(this.getTypeMappings()) {
- @Override
- protected Iterable<EclipseLinkConverter> transform(OrmTypeMapping typeMapping) {
- return ((EclipseLinkTypeMapping) typeMapping).getConverters();
- }
- };
- }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getReadOnlySpecifiedTenantDiscriminatorColumns() :
- this.getReadOnlyDefaultTenantDiscriminatorColumns();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getSpecifiedTenantDiscriminatorColumnsSize() :
- this.getDefaultTenantDiscriminatorColumnsSize();
- }
-
- // ********** specified tenant discriminator columns **********
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getReadOnlySpecifiedTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return this.getSpecifiedTenantDiscriminatorColumnsSize() != 0;
- }
-
- public OrmTenantDiscriminatorColumn2_3 getSpecifiedTenantDiscriminatorColumn(int index) {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElement(index);
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- return this.addSpecifiedTenantDiscriminatorColumn(this.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- XmlTenantDiscriminatorColumn xmlJoinColumn = this.buildXmlTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 joinColumn = this.specifiedTenantDiscriminatorColumnContainer.addContextElement(index, xmlJoinColumn);
- this.getXmlEntityMappings().getTenantDiscriminatorColumns().add(index, xmlJoinColumn);
- return joinColumn;
- }
-
- protected XmlTenantDiscriminatorColumn buildXmlTenantDiscriminatorColumn() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn();
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeSpecifiedTenantDiscriminatorColumn(this.specifiedTenantDiscriminatorColumnContainer.indexOfContextElement(tenantDiscriminatorColumn));
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- this.specifiedTenantDiscriminatorColumnContainer.removeContextElement(index);
- this.getXmlEntityMappings().getTenantDiscriminatorColumns().remove(index);
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.specifiedTenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- this.getXmlEntityMappings().getTenantDiscriminatorColumns().move(targetIndex, sourceIndex);
- }
-
- protected void syncSpecifiedTenantDiscriminatorColumns() {
- this.specifiedTenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getXmlTenantDiscriminatorColumns() {
- if (getXmlEntityMappings() == null) {
- return EmptyListIterable.instance();
- }
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTenantDiscriminatorColumn_2_3>(this.getXmlEntityMappings().getTenantDiscriminatorColumns());
- }
-
- /**
- * specified tenant discriminator column container
- */
- protected class SpecifiedTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmTenantDiscriminatorColumn2_3 buildContextElement(XmlTenantDiscriminatorColumn_2_3 resourceElement) {
- return EclipseLinkEntityMappingsImpl.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getResourceElements() {
- return EclipseLinkEntityMappingsImpl.this.getXmlTenantDiscriminatorColumns();
- }
- @Override
- protected XmlTenantDiscriminatorColumn_2_3 getResourceElement(OrmTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getXmlColumn();
- }
- }
-
- protected OrmReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- protected SpecifiedTenantDiscriminatorColumnContainer buildSpecifiedTenantDiscriminatorColumnContainer() {
- SpecifiedTenantDiscriminatorColumnContainer container = new SpecifiedTenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
- protected OrmTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn) {
- return new EclipseLinkOrmTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, xmlTenantDiscriminatorColumn);
- }
-
-
- // ********** default tenant discriminator columns **********
-
- public ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getReadOnlyDefaultTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- protected void clearDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.clearContextList();
- }
-
- /**
- * If there are any specified tenant discriminator columns, then there are no default
- * tenant discriminator columns.
- * @see #getTenantDiscriminatorColumnsForDefaults()
- */
- protected void updateDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.update();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumnsForDefaults() {
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() > 0) {
- return EmptyListIterable.instance();
- }
- return getContextDefaultTenantDiscriminatorColumns();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getContextDefaultTenantDiscriminatorColumns() {
- return this.getPersistenceUnit().getDefaultTenantDiscriminatorColumns();
- }
-
- protected void moveDefaultTenantDiscriminatorColumn(int index, OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.moveContextElement(index, tenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 addDefaultTenantDiscriminatorColumn(int index, OrmTenantDiscriminatorColumn2_3 ormTenantDiscriminatorColumn) {
- return this.defaultTenantDiscriminatorColumnContainer.addContextElement(index, ormTenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildVirtualTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- return new GenericOrmVirtualTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, tenantDiscriminatorColumn);
- }
-
- protected void removeDefaultTenantDiscriminatorColumn(OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.removeContextElement(tenantDiscriminatorColumn);
- }
-
- protected DefaultTenantDiscriminatorColumnContainer buildDefaultTenantDiscriminatorColumnContainer() {
- return new DefaultTenantDiscriminatorColumnContainer();
- }
-
-
- /**
- * default tenant discriminator column container
- */
- protected class DefaultTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildContextElement(ReadOnlyTenantDiscriminatorColumn2_3 resourceElement) {
- return EclipseLinkEntityMappingsImpl.this.buildVirtualTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getResourceElements() {
- return EclipseLinkEntityMappingsImpl.this.getTenantDiscriminatorColumnsForDefaults();
- }
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getResourceElement(OrmVirtualTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getOverriddenColumn();
- }
- }
-
-
- // ********** OrmReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements OrmReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- /**
- * No default table name in the context of entity mappings
- */
- public String getDefaultTableName() {
- return null;
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- /**
- * No table in the context of entity mappings
- */
- public Table resolveDbTable(String tableName) {
- return null;
- }
-
- public Iterable<String> getCandidateTableNames() {
- return EmptyIterable.instance();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- /**
- * no column validation can be done in the context of the persistence unit defaults
- */
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return JptValidator.Null.instance();
- }
-
- public TextRange getValidationTextRange() {
- return EclipseLinkEntityMappingsImpl.this.getValidationTextRange();
- }
- }
-
- // ********** misc **********
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- @Override
- protected IContentType getContentType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
-
- // ********** refactoring **********
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createConverterRenameTypeEdits(originalType, newName));
- }
-
- protected Iterable<ReplaceEdit> createConverterRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createConverterMoveTypeEdits(originalType, newPackage));
- }
-
- protected Iterable<ReplaceEdit> createConverterMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createConverterRenamePackageEdits(originalPackage, newName));
- }
-
- protected Iterable<ReplaceEdit> createConverterRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java
deleted file mode 100644
index 50fc25680b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.AbstractOrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkOrmElementCollectionMapping2_0
- extends AbstractOrmElementCollectionMapping2_0<XmlElementCollection>
- implements EclipseLinkElementCollectionMapping2_0
-{
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
-
- public EclipseLinkOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, XmlElementCollection resourceMapping) {
- super(parent, resourceMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- if (getJpaPlatformVersion().getVersion().equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_0)) {
- throw new UnsupportedOperationException("join-fetch not supported in EclipseLink 2.0 platform"); //$NON-NLS-1$
- }
- return this.joinFetch;
- }
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(
- OrmEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO join fetch validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java
deleted file mode 100644
index 8c9def1627..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmOneToManyRelationship2_0;
-
-/**
- * We need this class because the EclipseLink 1.0 1:m mapping supports a join
- * column strategy while JPA did not until JPA 2.0. As a result, we need a class
- * that implements EclipseLink 1.0.
- */
-public class EclipseLinkOrmOneToManyRelationship
- extends GenericOrmOneToManyRelationship
- implements EclipseLinkOrmOneToManyRelationship2_0
-{
- public EclipseLinkOrmOneToManyRelationship(OrmOneToManyMapping parent) {
- super(parent, true); // true=supports join column strategy
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 8cc2a85ba7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-
-/**
- * <code>orm.xml</code> tenant discriminator column
- */
-public class EclipseLinkOrmTenantDiscriminatorColumn2_3
- extends AbstractOrmNamedDiscriminatorColumn<XmlTenantDiscriminatorColumn_2_3, OrmReadOnlyTenantDiscriminatorColumn2_3.Owner>
- implements OrmTenantDiscriminatorColumn2_3
-{
- protected XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn;
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey;
-
- public EclipseLinkOrmTenantDiscriminatorColumn2_3(XmlContextNode parent, OrmReadOnlyTenantDiscriminatorColumn2_3.Owner owner, XmlTenantDiscriminatorColumn_2_3 column) {
- super(parent, owner, column);
- this.specifiedTable = this.buildSpecifiedTable();
- this.specifiedContextProperty = this.buildSpecifiedContextProperty();
- this.specifiedPrimaryKey = this.buildSpecifiedPrimaryKey();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedTable_(this.buildSpecifiedTable());
- this.setSpecifiedContextProperty_(this.buildSpecifiedContextProperty());
- this.setSpecifiedPrimaryKey_(this.buildSpecifiedPrimaryKey());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultTable(this.buildDefaultTable());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
-
-
- // ********** XML column **********
-
- @Override
- public XmlTenantDiscriminatorColumn_2_3 getXmlColumn() {
- return this.xmlTenantDiscriminatorColumn;
- }
-
- @Override
- protected void setXmlColumn(XmlTenantDiscriminatorColumn_2_3 xmlColumn) {
- this.xmlTenantDiscriminatorColumn = xmlColumn;
- }
-
- /**
- * tenant discriminator columns are part of a collection;
- * the 'tenant-discriminator-column' element will be removed/added
- * when the XML tenant discriminator column is removed from/added to
- * the owner's collection
- */
- @Override
- protected XmlTenantDiscriminatorColumn buildXmlColumn() {
- throw new IllegalStateException("XML tenant discriminator column is missing"); //$NON-NLS-1$
- }
-
- /**
- * @see #buildXmlColumn()
- */
- @Override
- protected void removeXmlColumn() {
- // do nothing
- }
-
-
- // ********** table **********
-
- @Override
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String table) {
- if (this.valuesAreDifferent(this.specifiedTable, table)) {
- this.setSpecifiedTable_(table);
- this.xmlTenantDiscriminatorColumn.setTable(table);
- }
- }
-
- protected void setSpecifiedTable_(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return (this.xmlTenantDiscriminatorColumn == null) ? null : this.xmlTenantDiscriminatorColumn.getTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
- // ********** contextProperty **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- public void setSpecifiedContextProperty(String contextProperty) {
- if (this.valuesAreDifferent(this.specifiedContextProperty, contextProperty)) {
- this.setSpecifiedContextProperty_(contextProperty);
- this.xmlTenantDiscriminatorColumn.setContextProperty(contextProperty);
- }
- }
-
- protected void setSpecifiedContextProperty_(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return (this.xmlTenantDiscriminatorColumn == null) ? null : this.xmlTenantDiscriminatorColumn.getContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
-
- // ********** primaryKey **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.isDefaultPrimaryKey();
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- public void setSpecifiedPrimaryKey(Boolean primaryKey) {
- if (this.valuesAreDifferent(this.specifiedPrimaryKey, primaryKey)) {
- this.setSpecifiedPrimaryKey_(primaryKey);
- this.xmlTenantDiscriminatorColumn.setPrimaryKey(primaryKey);
- }
- }
-
- protected void setSpecifiedPrimaryKey_(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return (this.xmlTenantDiscriminatorColumn == null) ? null : this.xmlTenantDiscriminatorColumn.getPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean defaultPrimaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = defaultPrimaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, defaultPrimaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return this.owner.getDefaultPrimaryKey();
- }
-
-
- // ********** misc **********
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- public TextRange getTableTextRange() {
- return this.getValidationTextRange(this.getXmlColumnTableTextRange());
- }
-
- protected TextRange getXmlColumnTableTextRange() {
- XmlTenantDiscriminatorColumn_2_3 xmlColumn = this.getXmlColumn();
- return (xmlColumn == null) ? null : xmlColumn.getTableTextRange();
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver() {
- return new OrmTableColumnTextRangeResolver(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java
deleted file mode 100644
index 046fd56243..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay;
-
-public class EclipseLinkOrmTimeOfDay
- extends AbstractOrmXmlContextNode
- implements EclipseLinkTimeOfDay
-{
- protected final XmlTimeOfDay xmlTimeOfDay;
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
-
- public EclipseLinkOrmTimeOfDay(OrmEclipseLinkCaching parent, XmlTimeOfDay xmlTimeOfDay) {
- super(parent);
- this.xmlTimeOfDay = xmlTimeOfDay;
- this.hour = xmlTimeOfDay.getHour();
- this.minute = xmlTimeOfDay.getMinute();
- this.second = xmlTimeOfDay.getSecond();
- this.millisecond = xmlTimeOfDay.getMillisecond();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setHour_(this.xmlTimeOfDay.getHour());
- this.setMinute_(this.xmlTimeOfDay.getMinute());
- this.setSecond_(this.xmlTimeOfDay.getSecond());
- this.setMillisecond_(this.xmlTimeOfDay.getMillisecond());
- }
-
-
- // ********** hour **********
-
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- this.setHour_(hour);
- this.xmlTimeOfDay.setHour(hour);
- }
-
- protected void setHour_(Integer hour) {
- Integer old = this.hour;
- this.hour = hour;
- this.firePropertyChanged(HOUR_PROPERTY, old, hour);
- }
-
-
- // ********** minute **********
-
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer minute) {
- this.setMinute_(minute);
- this.xmlTimeOfDay.setMinute(minute);
- }
-
- protected void setMinute_(Integer minute) {
- Integer old = this.minute;
- this.minute = minute;
- this.firePropertyChanged(MINUTE_PROPERTY, old, minute);
- }
-
-
- // ********** second **********
-
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer second) {
- this.setSecond_(second);
- this.xmlTimeOfDay.setSecond(second);
- }
-
- protected void setSecond_(Integer second) {
- Integer old = this.second;
- this.second = second;
- this.firePropertyChanged(SECOND_PROPERTY, old, second);
- }
-
-
- // ********** millisecond **********
-
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer millisecond) {
- this.setMillisecond_(millisecond);
- this.xmlTimeOfDay.setMillisecond(millisecond);
- }
-
- protected void setMillisecond_(Integer millisecond) {
- Integer old = this.millisecond;
- this.millisecond = millisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, old, millisecond);
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkCaching getParent() {
- return (OrmEclipseLinkCaching) super.getParent();
- }
-
- protected OrmEclipseLinkCaching getCaching() {
- return this.getParent();
- }
-
- public XmlTimeOfDay getXmlTimeOfDay() {
- return this.xmlTimeOfDay;
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlTimeOfDay.getValidationTextRange();
- return (textRange != null) ? textRange : this.getCaching().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java
deleted file mode 100644
index 49bfdf8ec3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml1_1Definition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml1_1Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_1Definition() {
- super();
- }
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java
deleted file mode 100644
index 6dc73ecbbb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml1_2Definition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml1_2Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_2Definition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
deleted file mode 100644
index 8d4e85e5d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOrderable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmOrderable;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmNamedQuery2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmOrphanRemoval2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmSequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmAssociationOverrideContainer2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection;
-
-public class EclipseLinkOrmXml2_0ContextNodeFactory
- extends EclipseLinkOrmXmlContextNodeFactory
- implements OrmXml2_0ContextNodeFactory
-{
-
- public OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(OrmEmbeddedMapping2_0 parent, OrmAssociationOverrideContainer2_0.Owner owner) {
- return new GenericOrmAssociationOverrideContainer(parent, owner);
- }
-
- @Override
- public OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator resourceSequenceGenerator) {
- return new GenericOrmSequenceGenerator2_0(parent, resourceSequenceGenerator);
- }
-
- public OrmDerivedIdentity2_0 buildOrmDerivedIdentity(OrmSingleRelationshipMapping2_0 parent) {
- return new GenericOrmDerivedIdentity2_0(parent);
- }
-
- public OrmElementCollectionMapping2_0 buildOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection resourceMapping) {
- return new EclipseLinkOrmElementCollectionMapping2_0(parent, (XmlElementCollection) resourceMapping);
- }
-
- public OrmCacheable2_0 buildOrmCacheable(OrmCacheableHolder2_0 parent) {
- return new GenericOrmCacheable2_0(parent);
- }
-
- public OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent) {
- return new GenericOrmOrphanRemoval2_0(parent);
- }
-
- @Override
- public OrmNamedQuery buildOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery) {
- return new GenericOrmNamedQuery2_0(parent, resourceNamedQuery);
- }
-
- public OrmCollectionTable2_0 buildOrmCollectionTable(OrmElementCollectionMapping2_0 parent, Table.Owner owner) {
- return new GenericOrmCollectionTable2_0(parent, owner);
- }
-
- @Override
- public OrmOrderable buildOrmOrderable(OrmAttributeMapping parent) {
- throw new UnsupportedOperationException("use #buildOrmOrderable(OrmAttributeMapping parent, Orderable2_0.Owner owner)"); //$NON-NLS-1$
- }
-
- public OrmOrderable2_0 buildOrmOrderable(OrmAttributeMapping parent, Orderable2_0.Owner owner) {
- return new GenericOrmOrderable(parent, owner);
- }
-
- public OrmOrderColumn2_0 buildOrmOrderColumn(OrmOrderable2_0 parent, OrmOrderColumn2_0.Owner owner) {
- return new GenericOrmOrderColumn2_0(parent, owner);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java
deleted file mode 100644
index 8f9b759724..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddableDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEntityDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.OrmElementCollectionMapping2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaPlatformProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-
-public class EclipseLinkOrmXml2_0Definition
- extends AbstractOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_0Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected EclipseLinkOrmXml2_0Definition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE;
- }
-
- public EFactory getResourceNodeFactory() {
- return EclipseLinkOrmFactory.eINSTANCE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_0ContextNodeFactory();
- }
-
- @Override
- protected void addTypeMappingDefinitionsTo(ArrayList<OrmTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, TYPE_MAPPING_DEFINITIONS);
- }
-
- /**
- * Order should not matter here; but we'll use the same order as for Java.
- * @see EclipseLink2_0JpaPlatformProvider
- */
- protected static final OrmTypeMappingDefinition[] TYPE_MAPPING_DEFINITIONS = new OrmTypeMappingDefinition[] {
- OrmEntityDefinition.instance(),
- OrmEmbeddableDefinition.instance(),
- OrmMappedSuperclassDefinition.instance()
- };
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- /**
- * Order should not matter here; but we'll use the same order as for Java.
- * @see EclipseLink2_0JpaPlatformProvider
- */
- protected static final OrmAttributeMappingDefinition[] ATTRIBUTE_MAPPING_DEFINITIONS = new OrmAttributeMappingDefinition[] {
- OrmTransientMappingDefinition.instance(),
- OrmEclipseLinkBasicCollectionMappingDefinition.instance(),
- OrmEclipseLinkBasicMapMappingDefinition.instance(),
- OrmElementCollectionMapping2_0Definition.instance(),
- OrmIdMappingDefinition.instance(),
- OrmVersionMappingDefinition.instance(),
- OrmBasicMappingDefinition.instance(),
- OrmEmbeddedMappingDefinition.instance(),
- OrmEmbeddedIdMappingDefinition.instance(),
- OrmEclipseLinkTransformationMappingDefinition.instance(),
- OrmManyToManyMappingDefinition.instance(),
- OrmManyToOneMappingDefinition.instance(),
- OrmOneToManyMappingDefinition.instance(),
- OrmOneToOneMappingDefinition.instance(),
- OrmEclipseLinkVariableOneToOneMappingDefinition.instance(),
- NullOrmAttributeMappingDefinition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java
deleted file mode 100644
index 95ac734624..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class EclipseLinkOrmXml2_1ContextNodeFactory
- extends EclipseLinkOrmXml2_0ContextNodeFactory
-{
-
- @Override
- public AbstractOrmEclipseLinkBasicCollectionMapping buildOrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection resourceMapping) {
- return new OrmEclipseLinkBasicCollectionMapping2_1(parent, resourceMapping);
- }
-
- @Override
- public AbstractOrmEclipseLinkBasicMapMapping buildOrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap resourceMapping) {
- return new OrmEclipseLinkBasicMapMapping2_1(parent, resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java
deleted file mode 100644
index cd6e91424e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml2_1Definition
- extends EclipseLinkOrmXml2_0Definition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_1Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected EclipseLinkOrmXml2_1Definition() {
- super();
- }
-
- @Override
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_1ContextNodeFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java
deleted file mode 100644
index 2e844240d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml2_2Definition
- extends EclipseLinkOrmXml2_1Definition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE =
- new EclipseLinkOrmXml2_2Definition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected EclipseLinkOrmXml2_2Definition() {
- super();
- }
-
-
-// @Override
-// public EFactory getResourceNodeFactory() {
-// return EclipseLinkOrmFactory.eINSTANCE;
-// }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_1ContextNodeFactory();
- }
-
- @Override
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE;
- }
-
-
- // ********* ORM type mappings *********
-
-// @Override
-// protected OrmTypeMappingDefinition[] buildOrmTypeMappingDefinitions() {
-// // order should not matter here, but we'll use the same order as for java
-// // @see {@link EclipseLink1_1JpaPlatformProvider}
-// // NOTE: no new type mapping providers from eclipselink 1.0 to 1.1
-// return new OrmTypeMappingDefinition[] {
-// OrmEntityDefinition.instance(),
-// OrmEmbeddableDefinition.instance(),
-// OrmMappedSuperclassDefinition.instance()};
-// }
-
-
- // ********** ORM attribute mappings **********
-
-// @Override
-// protected OrmAttributeMappingDefinition[] buildOrmAttributeMappingDefinitions() {
-// // order should not matter here, but we'll use the same order as for java
-// // @see {@link EclipseLink1_1JpaPlatformProvider}
-// return new OrmAttributeMappingDefinition[] {
-// OrmTransientMappingDefinition.instance(),
-// OrmEclipseLinkBasicCollectionMappingDefinition.instance(),
-// OrmEclipseLinkBasicMapMappingDefinition.instance(),
-// OrmElementCollectionMapping2_0Definition.instance(),
-// OrmIdMappingDefinition.instance(),
-// OrmVersionMappingDefinition.instance(),
-// OrmBasicMappingDefinition.instance(),
-// OrmEmbeddedMappingDefinition.instance(),
-// OrmEmbeddedIdMappingDefinition.instance(),
-// OrmEclipseLinkTransformationMappingDefinition.instance(),
-// OrmManyToManyMappingDefinition.instance(),
-// OrmManyToOneMappingDefinition.instance(),
-// OrmOneToManyMappingDefinition.instance(),
-// OrmOneToOneMappingDefinition.instance(),
-// OrmEclipseLinkVariableOneToOneMappingDefinition.instance(),
-// NullOrmAttributeMappingDefinition.instance()};
-// }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java
deleted file mode 100644
index 8a2b1f41cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-
-public class EclipseLinkOrmXml2_3Definition
- extends EclipseLinkOrmXml2_2Definition {
-
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_3Definition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_3Definition() {
- super();
- }
-
-
- @Override
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java
deleted file mode 100644
index d0d1ce1095..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-
-public class EclipseLinkOrmXml2_4Definition
- extends EclipseLinkOrmXml2_2Definition {
-
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_4Definition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_4Definition() {
- super();
- }
-
-
- @Override
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
deleted file mode 100644
index 07a39fb222..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion;
-
-public class EclipseLinkOrmXmlContextNodeFactory
- extends AbstractOrmXmlContextNodeFactory
-{
-
- // ********** EclipseLink-specific ORM Context Model **********
-
- @Override
- public EntityMappings buildEntityMappings(OrmXml parent, org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings xmlEntityMappings) {
- return new EclipseLinkEntityMappingsImpl(parent, (XmlEntityMappings) xmlEntityMappings);
- }
-
- @Override
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping resourceMapping) {
- return new OrmEclipseLinkPersistentAttribute(parent, resourceMapping);
- }
-
- @Override
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType type, org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable resourceMapping) {
- return new OrmEclipseLinkEmbeddableImpl(type, (XmlEmbeddable) resourceMapping);
- }
-
- @Override
- public OrmEntity buildOrmEntity(OrmPersistentType type, org.eclipse.jpt.jpa.core.resource.orm.XmlEntity resourceMapping) {
- return new OrmEclipseLinkEntityImpl(type, (XmlEntity) resourceMapping);
- }
-
- @Override
- public OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType type, org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass resourceMapping) {
- return new OrmEclipseLinkMappedSuperclassImpl(type, (XmlMappedSuperclass) resourceMapping);
- }
-
- @Override
- public OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlBasic resourceMapping) {
- return new OrmEclipseLinkBasicMapping(parent, (XmlBasic) resourceMapping);
- }
-
- @Override
- public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlId resourceMapping) {
- return new OrmEclipseLinkIdMapping(parent, (XmlId) resourceMapping);
- }
-
- @Override
- public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany resourceMapping) {
- return new OrmEclipseLinkManyToManyMapping(parent, (XmlManyToMany) resourceMapping);
- }
-
- @Override
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne resourceMapping) {
- return new OrmEclipseLinkManyToOneMapping(parent, (XmlManyToOne) resourceMapping);
- }
-
- @Override
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany resourceMapping) {
- return new OrmEclipseLinkOneToManyMapping(parent, (XmlOneToMany) resourceMapping);
- }
-
- @Override
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne resourceMapping) {
- return new OrmEclipseLinkOneToOneMapping(parent, (XmlOneToOne) resourceMapping);
- }
-
- @Override
- public OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlVersion resourceMapping) {
- return new OrmEclipseLinkVersionMapping(parent, (XmlVersion) resourceMapping);
- }
-
- public AbstractOrmEclipseLinkBasicCollectionMapping buildOrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection resourceMapping) {
- return new OrmEclipseLinkBasicCollectionMapping(parent, resourceMapping);
- }
-
- public AbstractOrmEclipseLinkBasicMapMapping buildOrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap resourceMapping) {
- return new OrmEclipseLinkBasicMapMapping(parent, resourceMapping);
- }
-
- public OrmEclipseLinkTransformationMapping buildOrmEclipseLinkTransformationMapping(OrmPersistentAttribute parent, XmlTransformation resourceMapping) {
- return new OrmEclipseLinkTransformationMapping(parent, resourceMapping);
- }
-
- public OrmEclipseLinkVariableOneToOneMapping buildOrmEclipseLinkVariableOneToOneMapping(OrmPersistentAttribute parent, XmlVariableOneToOne resourceMapping) {
- return new OrmEclipseLinkVariableOneToOneMapping(parent, resourceMapping);
- }
-
- @Override
- public OrmPersistenceUnitDefaults buildOrmPersistenceUnitDefaults(OrmPersistenceUnitMetadata parent) {
- return new OrmEclipseLinkPersistenceUnitDefaults(parent);
- }
-
- @Override
- public OrmPersistenceUnitMetadata buildOrmPersistenceUnitMetadata(EntityMappings parent) {
- return new OrmEclipseLinkPersistenceUnitMetadata(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java
deleted file mode 100644
index 2ee432fa2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXmlDefinition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXmlDefinition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkOrmXmlDefinition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 7bd6a0185f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmVirtualNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-
-/**
- * <code>orm.xml</code> virtual tenant discriminator column
- */
-public class GenericOrmVirtualTenantDiscriminatorColumn2_3
- extends AbstractOrmVirtualNamedDiscriminatorColumn<OrmReadOnlyTenantDiscriminatorColumn2_3.Owner, ReadOnlyTenantDiscriminatorColumn2_3>
- implements OrmVirtualTenantDiscriminatorColumn2_3
-{
- protected final ReadOnlyTenantDiscriminatorColumn2_3 overriddenColumn;
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey;
-
-
- public GenericOrmVirtualTenantDiscriminatorColumn2_3(XmlContextNode parent, OrmReadOnlyTenantDiscriminatorColumn2_3.Owner owner, ReadOnlyTenantDiscriminatorColumn2_3 overridenColumn) {
- super(parent, owner);
- this.overriddenColumn = overridenColumn;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
-
- this.setSpecifiedTable(this.buildSpecifiedTable());
- this.setDefaultTable(this.buildDefaultTable());
-
- this.setSpecifiedContextProperty(this.buildSpecifiedContextProperty());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
-
- this.setSpecifiedPrimaryKey(this.buildSpecifiedPrimaryKey());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
-
- // ********** column **********
-
- @Override
- public ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn() {
- return this.overriddenColumn;
- }
-
- @Override
- public boolean isVirtual() {
- return true;
- }
-
-
- // ********** table **********
-
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- protected void setSpecifiedTable(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return this.getOverriddenColumn().getSpecifiedTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
- // ********** context property **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- protected void setSpecifiedContextProperty(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return this.getOverriddenColumn().getSpecifiedContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
-
- // ********** primary key **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.defaultPrimaryKey;
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- protected void setSpecifiedPrimaryKey(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return this.getOverriddenColumn().getSpecifiedPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean primaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = primaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return this.owner.getDefaultPrimaryKey();
- }
-
-
- // ********** misc **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public TextRange getTableTextRange() {
- return this.getValidationTextRange();
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver() {
- return new OrmTableColumnTextRangeResolver(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index d8428431e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-
-public class NullOrmEclipseLinkMultitenancy2_3
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkMultitenancy2_3
-{
-
- public NullOrmEclipseLinkMultitenancy2_3(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- }
-
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return false;
- }
-
- public boolean isDefaultMultitenant() {
- return false;
- }
-
- public boolean isSpecifiedMultitenant() {
- return false;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return null;
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return null;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return null;
- }
-
-
- // ********** include criteria **********
-
- public boolean isIncludeCriteria() {
- return false;
- }
-
- public Boolean getSpecifiedIncludeCriteria() {
- return null;
- }
-
- public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public boolean isDefaultIncludeCriteria() {
- return false;
- }
-
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return false;
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public TextRange getValidationTextRange() {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index c12804c92d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public class OrmEclipseLinkBasicCollectionMapping
- extends AbstractOrmEclipseLinkBasicCollectionMapping
-{
- public OrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection xmlMapping) {
- super(parent, xmlMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java
deleted file mode 100644
index cc74413dc1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkBasicCollectionMapping2_1
- extends AbstractOrmEclipseLinkBasicCollectionMapping
-{
- public OrmEclipseLinkBasicCollectionMapping2_1(OrmPersistentAttribute parent, XmlBasicCollection xmlMapping) {
- super(parent, xmlMapping);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.BASIC_COLLECTION_MAPPING_DEPRECATED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java
deleted file mode 100644
index 25b2416257..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public class OrmEclipseLinkBasicCollectionMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkBasicCollectionMappingDefinition INSTANCE =
- new OrmEclipseLinkBasicCollectionMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkBasicCollectionMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlBasicCollection(),
- XmlBasicCollection.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkBasicCollectionMapping(parent, (XmlBasicCollection) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java
deleted file mode 100644
index b968528b6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class OrmEclipseLinkBasicMapMapping
- extends AbstractOrmEclipseLinkBasicMapMapping
-{
- public OrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap xmlMapping) {
- super(parent, xmlMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java
deleted file mode 100644
index df70780bff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkBasicMapMapping2_1
- extends AbstractOrmEclipseLinkBasicMapMapping
-{
- public OrmEclipseLinkBasicMapMapping2_1(OrmPersistentAttribute parent, XmlBasicMap xmlMapping) {
- super(parent, xmlMapping);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.BASIC_MAP_MAPPING_DEPRECATED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java
deleted file mode 100644
index 5130e023ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class OrmEclipseLinkBasicMapMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkBasicMapMappingDefinition INSTANCE =
- new OrmEclipseLinkBasicMapMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensforce singleton usage
- */
- private OrmEclipseLinkBasicMapMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlBasicMap(),
- XmlBasicMap.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkBasicMapMapping(parent, (XmlBasicMap) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java
deleted file mode 100644
index c43844d42d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkBasicMapping
- extends AbstractOrmBasicMapping<XmlBasic>
- implements EclipseLinkBasicMapping
-{
- protected final OrmEclipseLinkMutable mutable;
-
-
- public OrmEclipseLinkBasicMapping(OrmPersistentAttribute parent, XmlBasic xmlMapping) {
- super(parent, xmlMapping);
- this.mutable = new OrmEclipseLinkMutable(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(
- OrmEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO mutable validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java
deleted file mode 100644
index a0a10b6872..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java
+++ /dev/null
@@ -1,805 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.NullOrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay;
-
-public class OrmEclipseLinkCachingImpl
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkCaching, OrmCacheableHolder2_0
-{
- protected EclipseLinkCacheType specifiedType;
- protected EclipseLinkCacheType defaultType;
-
- protected Integer specifiedSize;
- protected int defaultSize;
-
- protected Boolean specifiedShared;
- protected boolean defaultShared;
-
- protected Boolean specifiedAlwaysRefresh;
- protected boolean defaultAlwaysRefresh;
-
- protected Boolean specifiedRefreshOnlyIfNewer;
- protected boolean defaultRefreshOnlyIfNewer;
-
- protected Boolean specifiedDisableHits;
- protected boolean defaultDisableHits;
-
- protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
- protected EclipseLinkCacheCoordinationType defaultCoordinationType;
-
- protected Integer expiry;
- protected EclipseLinkOrmTimeOfDay expiryTimeOfDay;
-
- protected EclipseLinkExistenceType specifiedExistenceType;
- protected EclipseLinkExistenceType defaultExistenceType;
-
- protected final OrmCacheable2_0 cacheable;
-
- protected EclipseLinkCacheIsolationType2_2 specifiedIsolation;
- protected EclipseLinkCacheIsolationType2_2 defaultIsolation;
-
-
- public OrmEclipseLinkCachingImpl(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- this.specifiedType = this.buildSpecifiedType();
- this.specifiedSize = this.buildSpecifiedSize();
- this.specifiedShared = this.buildSpecifiedShared();
- this.specifiedAlwaysRefresh = this.buildSpecifiedAlwaysRefresh();
- this.specifiedRefreshOnlyIfNewer = this.buildSpecifiedRefreshOnlyIfNewer();
- this.specifiedDisableHits = this.buildSpecifiedDisableHits();
-
- this.specifiedCoordinationType = this.buildSpecifiedCoordinationType();
-
- this.expiry = this.buildExpiry();
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
-
- this.specifiedExistenceType = this.buildSpecifiedExistenceType();
-
- this.cacheable = this.buildCacheable();
-
- this.specifiedIsolation = this.buildSpecifiedIsolation();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
-
- this.setSpecifiedType_(this.buildSpecifiedType());
- this.setSpecifiedSize_(this.buildSpecifiedSize());
- this.setSpecifiedShared_(this.buildSpecifiedShared());
- this.setSpecifiedAlwaysRefresh_(this.buildSpecifiedAlwaysRefresh());
- this.setSpecifiedRefreshOnlyIfNewer_(this.buildSpecifiedRefreshOnlyIfNewer());
- this.setSpecifiedDisableHits_(this.buildSpecifiedDisableHits());
-
- this.setSpecifiedCoordinationType_(this.buildSpecifiedCoordinationType());
-
- this.setExpiry_(this.buildExpiry());
- this.syncExpiryTimeOfDay();
-
- this.setSpecifiedExistenceType_(this.buildSpecifiedExistenceType());
-
- this.cacheable.synchronizeWithResourceModel();
-
- this.setSpecifiedIsolation_(this.buildSpecifiedIsolation());
- }
-
- @Override
- public void update() {
- super.update();
-
- boolean xmlCacheNotSpecified = (this.getXmlCache() == null);
- JavaEclipseLinkCaching javaCaching = this.getJavaCachingForDefaults();
- boolean javaCacheSpecified = (javaCaching != null);
- boolean useJavaValue = (xmlCacheNotSpecified && javaCacheSpecified);
-
- this.setDefaultType(useJavaValue ? javaCaching.getType() : DEFAULT_TYPE);
- this.setDefaultSize(useJavaValue ? javaCaching.getSize() : DEFAULT_SIZE);
- this.setDefaultShared(useJavaValue ? javaCaching.isShared() : DEFAULT_SHARED);
- this.setDefaultAlwaysRefresh(useJavaValue ? javaCaching.isAlwaysRefresh() : DEFAULT_ALWAYS_REFRESH);
- this.setDefaultRefreshOnlyIfNewer(useJavaValue ? javaCaching.isRefreshOnlyIfNewer() : DEFAULT_REFRESH_ONLY_IF_NEWER);
- this.setDefaultDisableHits(useJavaValue ? javaCaching.isDisableHits() : DEFAULT_DISABLE_HITS);
-
- this.setDefaultCoordinationType(useJavaValue ? javaCaching.getCoordinationType() : DEFAULT_COORDINATION_TYPE);
-
- if (this.expiryTimeOfDay != null) {
- this.expiryTimeOfDay.update();
- }
-
- // existence checking is its own xml attribute, it is not part of the cache xml element
- this.setDefaultExistenceType(javaCacheSpecified ? javaCaching.getExistenceType() : DEFAULT_EXISTENCE_TYPE);
-
- this.cacheable.update();
-
- this.setDefaultIsolation(useJavaValue ? javaCaching.getIsolation() : DEFAULT_ISOLATION);
- }
-
-
- // ********** type **********
-
- public EclipseLinkCacheType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.defaultType;
- }
-
- public EclipseLinkCacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkCacheType type) {
- if (this.valuesAreDifferent(this.specifiedType, type)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedType_(type);
- xmlCache.setType(EclipseLinkCacheType.toOrmResourceModel(type));
- this.removeXmlCacheIfUnset();
- }
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkCacheType type) {
- EclipseLinkCacheType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkCacheType buildSpecifiedType() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : EclipseLinkCacheType.fromOrmResourceModel(xmlCache.getType());
- }
-
- public EclipseLinkCacheType getDefaultType() {
- String puDefaultCacheTypeName = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheTypePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheTypeName)) {
- try {
- return EclipseLinkCacheType.valueOf(StringTools.convertCamelCaseToAllCaps(puDefaultCacheTypeName));
- } catch (IllegalArgumentException exception) {
- //no match, return default
- }
- }
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkCacheType type) {
- EclipseLinkCacheType old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
-
- // ********** size **********
-
- public int getSize() {
- return (this.specifiedSize != null) ? this.specifiedSize.intValue() : this.defaultSize;
- }
-
- public Integer getSpecifiedSize() {
- return this.specifiedSize;
- }
-
- public void setSpecifiedSize(Integer size) {
- if (this.valuesAreDifferent(this.specifiedSize, size)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedSize_(size);
- xmlCache.setSize(size);
- this.removeXmlCacheIfUnset();
- }
-
- if (size != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedSize_(Integer size) {
- Integer old = this.specifiedSize;
- this.specifiedSize = size;
- this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, size);
- }
-
- protected Integer buildSpecifiedSize() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getSize();
- }
-
- public int getDefaultSize() {
- String puDefaultCacheSize = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSizePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheSize)) {
- try {
- return Integer.valueOf(puDefaultCacheSize).intValue();
- } catch (NumberFormatException exception) {
- //couldn't parse, return default
- }
- }
- return this.defaultSize;
- }
-
- protected void setDefaultSize(int size) {
- int old = this.defaultSize;
- this.defaultSize = size;
- this.firePropertyChanged(DEFAULT_SIZE_PROPERTY, old, size);
- }
-
-
- // ********** shared **********
-
- public boolean isShared() {
- return (this.specifiedShared != null) ? this.specifiedShared.booleanValue() : this.defaultShared;
- }
-
- public Boolean getSpecifiedShared() {
- return this.specifiedShared;
- }
-
- public void setSpecifiedShared(Boolean shared) {
- if (this.valuesAreDifferent(this.specifiedShared, shared)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedShared_(shared);
- xmlCache.setShared(shared);
- this.removeXmlCacheIfUnset();
- }
-
- if ((shared != null) && ! shared.booleanValue()) { // Boolean.FALSE
- this.setSpecifiedType(null);
- this.setSpecifiedSize(null);
- this.setSpecifiedAlwaysRefresh(null);
- this.setSpecifiedRefreshOnlyIfNewer(null);
- this.setSpecifiedDisableHits(null);
- this.setSpecifiedCoordinationType(null);
- this.setExpiry(null);
- this.removeExpiryTimeOfDayIfNecessary();
- }
- }
-
- protected void setSpecifiedShared_(Boolean shared) {
- Boolean old = this.specifiedShared;
- this.specifiedShared = shared;
- this.firePropertyChanged(SPECIFIED_SHARED_PROPERTY, old, shared);
- }
-
- protected Boolean buildSpecifiedShared() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getShared();
- }
-
- public boolean isDefaultShared() {
- String puDefaultSharedCache = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSharedPropertyValue();
- return !StringTools.stringIsEmpty(puDefaultSharedCache) ? Boolean.valueOf(puDefaultSharedCache) : this.defaultShared;
- }
-
- protected void setDefaultShared(boolean shared) {
- boolean old = this.defaultShared;
- this.defaultShared = shared;
- this.firePropertyChanged(DEFAULT_SHARED_PROPERTY, old, shared);
- }
-
-
- // ********** always refresh **********
-
- public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh != null) ? this.specifiedAlwaysRefresh.booleanValue() : this.defaultAlwaysRefresh;
- }
-
- public Boolean getSpecifiedAlwaysRefresh() {
- return this.specifiedAlwaysRefresh;
- }
-
- public void setSpecifiedAlwaysRefresh(Boolean alwaysRefresh) {
- if (this.valuesAreDifferent(this.specifiedAlwaysRefresh, alwaysRefresh)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedAlwaysRefresh_(alwaysRefresh);
- xmlCache.setAlwaysRefresh(alwaysRefresh);
- this.removeXmlCacheIfUnset();
- }
-
- if (alwaysRefresh != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedAlwaysRefresh_(Boolean alwaysRefresh) {
- Boolean old = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
- protected Boolean buildSpecifiedAlwaysRefresh() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getAlwaysRefresh();
- }
-
- public boolean isDefaultAlwaysRefresh() {
- return this.defaultAlwaysRefresh;
- }
-
- protected void setDefaultAlwaysRefresh(boolean alwaysRefresh) {
- boolean old = this.defaultAlwaysRefresh;
- this.defaultAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(DEFAULT_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
-
- // ********** refresh only if newer **********
-
- public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer != null) ? this.specifiedRefreshOnlyIfNewer.booleanValue() : this.defaultRefreshOnlyIfNewer;
- }
-
- public Boolean getSpecifiedRefreshOnlyIfNewer() {
- return this.specifiedRefreshOnlyIfNewer;
- }
-
- public void setSpecifiedRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- if (this.valuesAreDifferent(this.specifiedRefreshOnlyIfNewer, refreshOnlyIfNewer)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedRefreshOnlyIfNewer_(refreshOnlyIfNewer);
- xmlCache.setRefreshOnlyIfNewer(refreshOnlyIfNewer);
- this.removeXmlCacheIfUnset();
- }
-
- if (refreshOnlyIfNewer != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
- Boolean old = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
- protected Boolean buildSpecifiedRefreshOnlyIfNewer() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getRefreshOnlyIfNewer();
- }
-
- public boolean isDefaultRefreshOnlyIfNewer() {
- return this.defaultRefreshOnlyIfNewer;
- }
-
- protected void setDefaultRefreshOnlyIfNewer(boolean refreshOnlyIfNewer) {
- boolean old = this.defaultRefreshOnlyIfNewer;
- this.defaultRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
-
- // ********** disable hits **********
-
- public boolean isDisableHits() {
- return (this.specifiedDisableHits != null) ? this.specifiedDisableHits.booleanValue() : this.defaultDisableHits;
- }
-
- public Boolean getSpecifiedDisableHits() {
- return this.specifiedDisableHits;
- }
-
- public void setSpecifiedDisableHits(Boolean disableHits) {
- if (this.valuesAreDifferent(this.specifiedDisableHits, disableHits)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedDisableHits_(disableHits);
- xmlCache.setDisableHits(disableHits);
- this.removeXmlCacheIfUnset();
- }
-
- if (disableHits != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedDisableHits_(Boolean disableHits) {
- Boolean old = this.specifiedDisableHits;
- this.specifiedDisableHits = disableHits;
- this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
- protected Boolean buildSpecifiedDisableHits() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getDisableHits();
- }
-
- public boolean isDefaultDisableHits() {
- return this.defaultDisableHits;
- }
-
- protected void setDefaultDisableHits(boolean disableHits) {
- boolean old = this.defaultDisableHits;
- this.defaultDisableHits = disableHits;
- this.firePropertyChanged(DEFAULT_DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
-
- // ********** coordination type **********
-
- public EclipseLinkCacheCoordinationType getCoordinationType() {
- return (this.specifiedCoordinationType != null) ? this.specifiedCoordinationType : this.defaultCoordinationType;
- }
-
- public EclipseLinkCacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType type) {
- if (this.valuesAreDifferent(this.specifiedCoordinationType, type)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedCoordinationType_(type);
- xmlCache.setCoordinationType(EclipseLinkCacheCoordinationType.toOrmResourceModel(type));
- this.removeXmlCacheIfUnset();
- }
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType type) {
- EclipseLinkCacheCoordinationType old = this.specifiedCoordinationType;
- this.specifiedCoordinationType = type;
- this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkCacheCoordinationType buildSpecifiedCoordinationType() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : EclipseLinkCacheCoordinationType.fromOrmResourceModel(xmlCache.getCoordinationType());
- }
-
- public EclipseLinkCacheCoordinationType getDefaultCoordinationType() {
- return this.defaultCoordinationType;
- }
-
- protected void setDefaultCoordinationType(EclipseLinkCacheCoordinationType type) {
- EclipseLinkCacheCoordinationType old= this.defaultCoordinationType;
- this.defaultCoordinationType = type;
- this.firePropertyChanged(DEFAULT_COORDINATION_TYPE_PROPERTY, old, type);
- }
-
-
- // ********** expiry **********
-
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- if (this.valuesAreDifferent(this.expiry, expiry)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setExpiry_(expiry);
- xmlCache.setExpiry(expiry);
- this.removeXmlCacheIfUnset();
- }
-
- if (expiry != null) {
- this.removeExpiryTimeOfDayIfNecessary();
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setExpiry_(Integer expiry) {
- Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
- }
-
- protected Integer buildExpiry() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getExpiry();
- }
-
-
- // ********** expiry time of day **********
-
- public EclipseLinkTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiry time of day already exists: " + this.expiryTimeOfDay); //$NON-NLS-1$
- }
-
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- XmlTimeOfDay xmlTimeOfDay = this.buildXmlTimeOfDay();
- EclipseLinkOrmTimeOfDay timeOfDay = this.buildExpiryTimeOfDay(xmlTimeOfDay);
- this.setExpiryTimeOfDay(timeOfDay);
- xmlCache.setExpiryTimeOfDay(xmlTimeOfDay);
-
- this.setExpiry(null);
- this.setSpecifiedShared(null);
-
- return timeOfDay;
- }
-
- protected XmlTimeOfDay buildXmlTimeOfDay() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTimeOfDay();
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("expiry time of day does not exist"); //$NON-NLS-1$
- }
- this.removeExpiryTimeOfDay_();
- }
-
- protected void removeExpiryTimeOfDayIfNecessary() {
- if (this.expiryTimeOfDay != null) {
- this.removeExpiryTimeOfDay_();
- }
- }
-
- protected void removeExpiryTimeOfDay_() {
- this.setExpiryTimeOfDay(null);
- this.getXmlCache().setExpiryTimeOfDay(null);
- this.removeXmlCacheIfUnset();
- }
-
- protected void setExpiryTimeOfDay(EclipseLinkOrmTimeOfDay timeOfDay) {
- EclipseLinkOrmTimeOfDay old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = timeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, timeOfDay);
- }
-
- protected void syncExpiryTimeOfDay() {
- XmlTimeOfDay xmlTimeOfDay = this.getXmlExpiryTimeOfDay();
- if (xmlTimeOfDay == null) {
- if (this.expiryTimeOfDay != null) {
- this.setExpiryTimeOfDay(null);
- }
- } else {
- if ((this.expiryTimeOfDay != null) && (this.expiryTimeOfDay.getXmlTimeOfDay() == xmlTimeOfDay)) {
- this.expiryTimeOfDay.synchronizeWithResourceModel();
- } else {
- this.setExpiryTimeOfDay(this.buildExpiryTimeOfDay(xmlTimeOfDay));
- }
- }
- }
-
- protected EclipseLinkOrmTimeOfDay buildExpiryTimeOfDay() {
- return this.buildExpiryTimeOfDay(this.getXmlExpiryTimeOfDay());
- }
-
- protected XmlTimeOfDay getXmlExpiryTimeOfDay() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getExpiryTimeOfDay();
- }
-
- protected EclipseLinkOrmTimeOfDay buildExpiryTimeOfDay(XmlTimeOfDay xmlTimeOfDay) {
- return (xmlTimeOfDay == null) ? null : new EclipseLinkOrmTimeOfDay(this, xmlTimeOfDay);
- }
-
-
- // ********** existence type **********
-
- public EclipseLinkExistenceType getExistenceType() {
- return (this.specifiedExistenceType != null) ? this.specifiedExistenceType : this.defaultExistenceType;
- }
-
- public EclipseLinkExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(EclipseLinkExistenceType type) {
- if (this.setSpecifiedExistenceType_(type)) {
- this.getXmlCacheHolder().setExistenceChecking(EclipseLinkExistenceType.toOrmResourceModel(type));
- }
- }
-
- protected boolean setSpecifiedExistenceType_(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.specifiedExistenceType;
- this.specifiedExistenceType = type;
- return this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkExistenceType buildSpecifiedExistenceType() {
- XmlCacheHolder xmlCacheHolder = this.getXmlCacheHolder();
- return (xmlCacheHolder == null) ? null : EclipseLinkExistenceType.fromOrmResourceModel(xmlCacheHolder.getExistenceChecking());
- }
-
- public EclipseLinkExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.defaultExistenceType;
- this.defaultExistenceType = type;
- this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
-
- // ********** cacheable **********
-
- public OrmCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- protected OrmCacheable2_0 buildCacheable() {
- return this.isOrmXml2_0Compatible() ?
- this.getContextNodeFactory2_0().buildOrmCacheable(this) :
- new NullOrmCacheable2_0(this);
- }
-
- public boolean calculateDefaultCacheable() {
- if ( ! this.getTypeMapping().isMetadataComplete()) {
- JavaPersistentType javaPersistentType = this.getTypeMapping().getPersistentType().getJavaPersistentType();
- if ((javaPersistentType != null) && (javaPersistentType.getMapping() instanceof CacheableHolder2_0)) {
- return ((CacheableHolder2_0) javaPersistentType.getMapping()).getCacheable().isCacheable();
- }
- }
- CacheableHolder2_0 superCacheableHolder = this.getCacheableSuperPersistentType(this.getTypeMapping().getPersistentType());
- return (superCacheableHolder != null) ?
- superCacheableHolder.getCacheable().isCacheable() :
- ((PersistenceUnit2_0) this.getPersistenceUnit()).calculateDefaultCacheable();
- }
-
- protected CacheableHolder2_0 getCacheableSuperPersistentType(PersistentType persistentType) {
- PersistentType superPersistentType = persistentType.getSuperPersistentType();
- if (superPersistentType == null) {
- return null;
- }
- TypeMapping superMapping = superPersistentType.getMapping();
- return (superMapping instanceof CacheableHolder2_0) ?
- (CacheableHolder2_0) superMapping :
- this.getCacheableSuperPersistentType(superPersistentType); // recurse
- }
-
-
- // ********** isolation **********
-
- public EclipseLinkCacheIsolationType2_2 getIsolation() {
- return (this.specifiedIsolation != null) ? this.specifiedIsolation : this.defaultIsolation;
- }
-
- public EclipseLinkCacheIsolationType2_2 getSpecifiedIsolation() {
- return this.specifiedIsolation;
- }
-
- public void setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
- if (this.valuesAreDifferent(this.specifiedIsolation, isolation)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedIsolation_(isolation);
- xmlCache.setIsolation(EclipseLinkCacheIsolationType2_2.toOrmResourceModel(isolation));
- this.removeXmlCacheIfUnset();
- }
-
- if (isolation != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2 isolation) {
- EclipseLinkCacheIsolationType2_2 old = this.specifiedIsolation;
- this.specifiedIsolation = isolation;
- this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, isolation);
- }
-
- protected EclipseLinkCacheIsolationType2_2 buildSpecifiedIsolation() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : EclipseLinkCacheIsolationType2_2.fromOrmResourceModel(xmlCache.getIsolation());
- }
-
- public EclipseLinkCacheIsolationType2_2 getDefaultIsolation() {
- return this.defaultIsolation;
- }
-
- protected void setDefaultIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
- EclipseLinkCacheIsolationType2_2 old = this.defaultIsolation;
- this.defaultIsolation = isolation;
- this.firePropertyChanged(DEFAULT_ISOLATION_PROPERTY, old, isolation);
- }
-
- // ********** XML cache **********
-
- /**
- * Return null if the XML cache does not exists.
- */
- protected XmlCache getXmlCache() {
- return this.getXmlCacheHolder().getCache();
- }
-
- /**
- * Build the XML cache if it does not exist.
- */
- protected XmlCache getXmlCacheForUpdate() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache != null) ? xmlCache : this.buildXmlCache();
- }
-
- protected XmlCache buildXmlCache() {
- XmlCache xmlCache = EclipseLinkOrmFactory.eINSTANCE.createXmlCache();
- this.getXmlCacheHolder().setCache(xmlCache);
- return xmlCache;
- }
-
- protected void removeXmlCacheIfUnset() {
- if (this.getXmlCache().isUnset()) {
- this.removeXmlCache();
- }
- }
-
- protected void removeXmlCache() {
- this.getXmlCacheHolder().setCache(null);
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (OrmEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected OrmEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- public XmlCacheable_2_0 getXmlCacheable() {
- return (XmlCacheable_2_0) this.getXmlTypeMapping();
- }
-
- protected XmlCacheHolder getXmlCacheHolder() {
- return (XmlCacheHolder) this.getXmlTypeMapping();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected JavaEclipseLinkCaching getJavaCachingForDefaults() {
- JavaEclipseLinkNonEmbeddableTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getCaching();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java
deleted file mode 100644
index dd0657c4cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder;
-
-public class OrmEclipseLinkChangeTracking
- extends AbstractOrmXmlContextNode
- implements EclipseLinkChangeTracking
-{
- protected EclipseLinkChangeTrackingType specifiedType;
- protected EclipseLinkChangeTrackingType defaultType;
-
-
- public OrmEclipseLinkChangeTracking(EclipseLinkOrmTypeMapping parent) {
- super(parent);
- this.specifiedType = this.buildSpecifiedType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedType_(this.buildSpecifiedType());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultType(this.buildDefaultType());
- }
-
-
- // ********** type **********
-
- public EclipseLinkChangeTrackingType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.defaultType;
- }
-
- public EclipseLinkChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkChangeTrackingType type) {
- if (this.specifiedType != type) {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTrackingForUpdate();
- this.setSpecifiedType_(type);
- xmlChangeTracking.setType(EclipseLinkChangeTrackingType.toOrmResourceModel(type));
- this.removeXmlChangeTrackingIfUnset();
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkChangeTrackingType type) {
- EclipseLinkChangeTrackingType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkChangeTrackingType buildSpecifiedType() {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTracking();
- return (xmlChangeTracking == null) ? null : EclipseLinkChangeTrackingType.fromOrmResourceModel(xmlChangeTracking.getType());
- }
-
- public EclipseLinkChangeTrackingType getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkChangeTrackingType type) {
- EclipseLinkChangeTrackingType old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkChangeTrackingType buildDefaultType() {
- EclipseLinkChangeTracking javaChangeTracking = this.getJavaChangeTrackingForDefaults();
- return (javaChangeTracking != null) ? javaChangeTracking.getType() : DEFAULT_TYPE;
- }
-
-
- // ********** xml customizer class ref **********
-
- /**
- * Return <code>null</code> if the XML change tracking does not exists.
- */
- protected XmlChangeTracking getXmlChangeTracking() {
- return this.getXmlChangeTrackingHolder().getChangeTracking();
- }
-
- /**
- * Build the XML change tracking if it does not exist.
- */
- protected XmlChangeTracking getXmlChangeTrackingForUpdate() {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTracking();
- return (xmlChangeTracking != null) ? xmlChangeTracking : this.buildXmlChangeTracking();
- }
-
- protected XmlChangeTracking buildXmlChangeTracking() {
- XmlChangeTracking xmlChangeTracking = EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking();
- this.getXmlChangeTrackingHolder().setChangeTracking(xmlChangeTracking);
- return xmlChangeTracking;
- }
-
- protected void removeXmlChangeTrackingIfUnset() {
- if (this.getXmlChangeTracking().isUnset()) {
- this.removeXmlChangeTracking();
- }
- }
-
- protected void removeXmlChangeTracking() {
- this.getXmlChangeTrackingHolder().setChangeTracking(null);
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkOrmTypeMapping getParent() {
- return (EclipseLinkOrmTypeMapping) super.getParent();
- }
-
- protected EclipseLinkOrmTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- protected XmlChangeTrackingHolder getXmlChangeTrackingHolder() {
- return (XmlChangeTrackingHolder) this.getXmlTypeMapping();
- }
-
- protected EclipseLinkJavaTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected EclipseLinkChangeTracking getJavaChangeTrackingForDefaults() {
- EclipseLinkJavaTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getChangeTracking();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTracking();
- return (xmlChangeTracking == null) ? null : xmlChangeTracking.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java
deleted file mode 100644
index afacdf7a6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkConversionValue
- extends AbstractOrmXmlContextNode
- implements EclipseLinkConversionValue
-{
- private final XmlConversionValue xmlConversionValue;
-
- private String dataValue;
-
- private String objectValue;
-
-
- public OrmEclipseLinkConversionValue(OrmEclipseLinkObjectTypeConverter parent, XmlConversionValue xmlConversionValue) {
- super(parent);
- this.xmlConversionValue = xmlConversionValue;
- this.dataValue = xmlConversionValue.getDataValue();
- this.objectValue = xmlConversionValue.getObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataValue_(this.xmlConversionValue.getDataValue());
- this.setObjectValue_(this.xmlConversionValue.getObjectValue());
- }
-
-
- // ********** data value **********
-
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String value) {
- this.setDataValue_(value);
- this.xmlConversionValue.setDataValue(value);
- }
-
- protected void setDataValue_(String value) {
- String old = this.dataValue;
- this.dataValue = value;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** object value **********
-
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String value) {
- this.setObjectValue_(value);
- this.xmlConversionValue.setObjectValue(value);
- }
-
- protected void setObjectValue_(String value) {
- String old = this.objectValue;
- this.objectValue = value;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkObjectTypeConverter getParent() {
- return (OrmEclipseLinkObjectTypeConverter) super.getParent();
- }
-
- protected OrmEclipseLinkObjectTypeConverter getObjectTypeConverter() {
- return this.getParent();
- }
-
- public XmlConversionValue getXmlConversionValue() {
- return this.xmlConversionValue;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- }
-
- public TextRange getDataValueTextRange() {
- return this.getValidationTextRange(this.xmlConversionValue.getDataValueTextRange());
- }
-
- protected TextRange getObjectValueTextRange() {
- return this.getValidationTextRange(this.xmlConversionValue.getObjectValueTextRange());
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlConversionValue.getValidationTextRange();
- return (textRange != null) ? textRange : this.getObjectTypeConverter().getValidationTextRange();
- }
-
- public boolean isIdentical(EclipseLinkConversionValue eclipseLinkConversionValue) {
- return StringTools.stringsAreEqual(this.getDataValue(), eclipseLinkConversionValue.getDataValue()) &&
- StringTools.stringsAreEqual(this.getObjectValue(), eclipseLinkConversionValue.getObjectValue());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java
deleted file mode 100644
index 4f3cb4bd1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.Association;
-import org.eclipse.jpt.common.utility.internal.SimpleAssociation;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.ConverterTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmConverter;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkConvertValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-public class OrmEclipseLinkConvert
- extends AbstractOrmConverter
- implements EclipseLinkConvert
-{
- protected String specifiedConverterName;
- protected String defaultConverterName;
-
- protected OrmEclipseLinkConverter<?> converter;
-
-
- protected static final OrmEclipseLinkConverter.Adapter[] CONVERTER_ADAPTER_ARRAY = new OrmEclipseLinkConverter.Adapter[] {
- OrmEclipseLinkCustomConverter.Adapter.instance(),
- OrmEclipseLinkTypeConverter.Adapter.instance(),
- OrmEclipseLinkObjectTypeConverter.Adapter.instance(),
- OrmEclipseLinkStructConverter.Adapter.instance()
- };
- protected static final Iterable<OrmEclipseLinkConverter.Adapter> CONVERTER_ADAPTERS = new ArrayIterable<OrmEclipseLinkConverter.Adapter>(CONVERTER_ADAPTER_ARRAY);
-
-
- public OrmEclipseLinkConvert(OrmAttributeMapping parent, OrmConverter.Owner owner) {
- super(parent, owner);
- this.specifiedConverterName = this.getXmlConvertibleMapping().getConvert();
- this.converter = this.buildConverter();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit(){
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedConverterName_(this.getXmlConvertibleMapping().getConvert());
- this.syncConverter();
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultConverterName(this.buildDefaultConverterName());
- if (this.converter != null) {
- this.converter.update();
- }
- }
-
-
- // ********** converter name **********
-
- public String getConverterName() {
- return (this.specifiedConverterName != null) ? this.specifiedConverterName : this.defaultConverterName;
- }
-
- public String getSpecifiedConverterName() {
- return this.specifiedConverterName;
- }
-
- public void setSpecifiedConverterName(String name) {
- this.setSpecifiedConverterName_(name);
- this.getXmlConvertibleMapping().setConvert(name);
- }
-
- protected void setSpecifiedConverterName_(String name) {
- String old = this.specifiedConverterName;
- this.specifiedConverterName = name;
- this.firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultConverterName() {
- return this.defaultConverterName;
- }
-
- protected void setDefaultConverterName(String name) {
- String old = this.defaultConverterName;
- this.defaultConverterName = name;
- this.firePropertyChanged(DEFAULT_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- protected String buildDefaultConverterName() {
- return DEFAULT_CONVERTER_NAME;
- }
-
-
- // ********** converter **********
-
- public OrmEclipseLinkConverter<?> getConverter() {
- return this.converter;
- }
-
- public void setConverter(Class<? extends EclipseLinkConverter> converterType) {
- if (converterType == null) {
- if (this.converter != null) {
- this.setConverter_(null);
- this.removeXmlConverters();
- }
- } else {
- if ((this.converter == null) || (this.converter.getType() != converterType)) {
- // note: we may also remove the XML converter we want;
- // but if we leave it, the resulting sync will screw things up...
- this.removeXmlConverters();
- OrmEclipseLinkConverter.Adapter converterAdapter = this.getConverterAdapter(converterType);
- this.setConverter_(converterAdapter.buildConverter(this));
- converterAdapter.addXmlConverter(this.getXmlConvertibleMapping(), this.converter.getXmlConverter());
- }
- }
- }
-
- protected void setConverter_(OrmEclipseLinkConverter<?> converter) {
- OrmEclipseLinkConverter<?> old = this.converter;
- this.converter = converter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, converter);
- }
-
- protected void removeXmlConverters() {
- XmlConvertibleMapping xmlMapping = this.getXmlConvertibleMapping();
- for (OrmEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- adapter.removeXmlConverter(xmlMapping);
- }
- }
-
- protected OrmEclipseLinkConverter<?> buildConverter() {
- XmlConvertibleMapping xmlMapping = this.getXmlConvertibleMapping();
- for (OrmEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- OrmEclipseLinkConverter<?> ormConverter = adapter.buildConverter(xmlMapping, this);
- if (ormConverter != null) {
- return ormConverter;
- }
- }
- return null;
- }
-
- protected void syncConverter() {
- Association<OrmEclipseLinkConverter.Adapter, XmlNamedConverter> assoc = this.getXmlConverter();
- if (assoc == null) {
- if (this.converter != null) {
- this.setConverter_(null);
- }
- } else {
- OrmEclipseLinkConverter.Adapter adapter = assoc.getKey();
- XmlNamedConverter xmlConverter = assoc.getValue();
- if ((this.converter != null) &&
- (this.converter.getType() == adapter.getConverterType()) &&
- (this.converter.getXmlConverter() == xmlConverter)) {
- this.converter.synchronizeWithResourceModel();
- } else {
- this.setConverter_(adapter.buildConverter(xmlConverter, this));
- }
- }
- }
-
- /**
- * Return the first XML converter we find along with its corresponding
- * adapter. Return <code>null</code> if there are no converters in the XML.
- */
- protected Association<OrmEclipseLinkConverter.Adapter, XmlNamedConverter> getXmlConverter() {
- XmlConvertibleMapping xmlMapping = this.getXmlConvertibleMapping();
- for (OrmEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- XmlNamedConverter xmlConverter = adapter.getXmlConverter(xmlMapping);
- if (xmlConverter != null) {
- return new SimpleAssociation<OrmEclipseLinkConverter.Adapter, XmlNamedConverter>(adapter, xmlConverter);
- }
- }
- return null;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * Return the converter adapter for the specified converter type.
- */
- protected OrmEclipseLinkConverter.Adapter getConverterAdapter(Class<? extends EclipseLinkConverter> converterType) {
- for (OrmEclipseLinkConverter.Adapter adapter : this.getConverterAdapters()) {
- if (adapter.getConverterType() == converterType) {
- return adapter;
- }
- }
- throw new IllegalArgumentException("unknown converter type: " + converterType.getName()); //$NON-NLS-1$
- }
-
- protected Iterable<OrmEclipseLinkConverter.Adapter> getConverterAdapters() {
- return CONVERTER_ADAPTERS;
- }
-
-
- // ********** misc **********
-
- protected XmlConvertibleMapping getXmlConvertibleMapping() {
- // cast to EclipseLink type
- return (XmlConvertibleMapping) super.getXmlAttributeMapping();
- }
-
- public Class<? extends Converter> getType() {
- return EclipseLinkConvert.class;
- }
-
- public void initialize() {
- this.specifiedConverterName = ""; //$NON-NLS-1$
- this.getXmlConvertibleMapping().setConvert(this.specifiedConverterName);
- }
-
-
- // ********** refactoring **********
-
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return (this.converter != null) ?
- this.converter.createRenameTypeEdits(originalType, newName) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return (this.converter != null) ?
- this.converter.createRenamePackageEdits(originalPackage, newName) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return (this.converter != null) ?
- this.converter.createMoveTypeEdits(originalType, newPackage) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
-
- // ********** validation **********
-
- @Override
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlConvertibleMapping().getConvertTextRange();
- }
-
-
- // ********** adapter **********
-
- public static class Adapter
- implements OrmConverter.Adapter, OrmConverter.Owner
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<? extends Converter> getConverterType() {
- return EclipseLinkConvert.class;
- }
-
- public OrmConverter buildConverter(OrmAttributeMapping parent, OrmXmlContextNodeFactory factory) {
- XmlConvertibleMapping xmlMapping = (XmlConvertibleMapping) parent.getXmlAttributeMapping();
- return (xmlMapping.getConvert() == null) ? null : new OrmEclipseLinkConvert(parent, this);
- }
-
- public boolean isActive(XmlAttributeMapping xmlMapping) {
- return ((XmlConvertibleMapping) xmlMapping).getConvert() != null;
- }
-
- public OrmConverter buildNewConverter(OrmAttributeMapping parent, OrmXmlContextNodeFactory factory) {
- return new OrmEclipseLinkConvert(parent, this);
- }
-
- public void clearXmlValue(XmlAttributeMapping xmlMapping) {
- ((XmlConvertibleMapping) xmlMapping).setConvert(null);
- }
-
- public JptValidator buildValidator(Converter converter, ConverterTextRangeResolver textRangeResolver) {
- return new EclipseLinkConvertValidator((EclipseLinkConvert) converter, textRangeResolver);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java
deleted file mode 100644
index b3a8928877..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class OrmEclipseLinkConverter<X extends XmlNamedConverter>
- extends AbstractOrmXmlContextNode
- implements EclipseLinkConverter
-{
- protected final X xmlConverter;
-
- protected String name;
-
-
- protected OrmEclipseLinkConverter(XmlContextNode parent, X xmlConverter) {
- super(parent);
- this.xmlConverter = xmlConverter;
- this.name = xmlConverter.getName();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setName_(this.xmlConverter.getName());
- }
-
- @Override
- public void update() {
- super.update();
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.setName_(name);
- this.xmlConverter.setName(name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
-
- // ********** misc **********
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- public X getXmlConverter() {
- return this.xmlConverter;
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- public char getEnclosingTypeSeparator() {
- return '$';
- }
-
-
- // ********** refactoring **********
-
- public abstract Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName);
-
- public abstract Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage);
-
- public abstract Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName);
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateName(messages);
- }
-
- protected void validateName(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_NAME_UNDEFINED,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange()
- )
- );
- return;
- }
-
- if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.RESERVED_CONVERTER_NAME,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange()
- )
- );
- }
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlConverter.getValidationTextRange();
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange();
- }
-
- public TextRange getNameTextRange() {
- return this.getValidationTextRange(this.xmlConverter.getNameTextRange());
- }
-
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return StringTools.stringsAreEqual(this.getName(), eclipseLinkConverter.getName());
- }
-
- // ********** adapter **********
-
- /**
- * This interface allows a client to interact with various
- * EclipseLink <code>orm.xml</code> converters via the same protocol.
- */
- public interface Adapter
- {
- /**
- * Return the type of converter handled by the adapter.
- */
- Class<? extends EclipseLinkConverter> getConverterType();
-
- /**
- * Build a converter corresponding to the specified XML converter
- * container if the container holds the adapter's XML converter. Return
- * <code>null</code> otherwise.
- * This is used to build a converter during construction of the
- * converter's parent.
- */
- OrmEclipseLinkConverter<? extends XmlNamedConverter> buildConverter(XmlConverterHolder xmlConverterContainer, XmlContextNode parent);
-
- /**
- * Return the adapter's XML converter for the specified XML converter
- * container. Return <code>null</code> if the container does not hold
- * the adapter's XML converter.
- * The returned XML converter is compared to the parent's
- * converter's XML converter while the context model is synchronized
- * with the resource model. If it has changed, the parent will build
- * a new converter (via the adapter).
- *
- * @see #buildConverter(XmlNamedConverter, XmlContextNode)
- */
- XmlNamedConverter getXmlConverter(XmlConverterHolder xmlConverterContainer);
-
- /**
- * Build a converter using the specified XML converter.
- * This is used when the context model is synchronized with the
- * resource model (and the resource model has changed).
- *
- * @see #getXmlConverter(XmlConverterHolder)
- */
- OrmEclipseLinkConverter<? extends XmlNamedConverter> buildConverter(XmlNamedConverter xmlConverter, XmlContextNode parent);
-
- /**
- * Build a new converter and its corresponding XML converter.
- * The XML converter will be added to the XML converter container once
- * the context converter has been added to the context model.
- *
- * @see #addXmlConverter(XmlConverterHolder, XmlNamedConverter)
- */
- OrmEclipseLinkConverter<? extends XmlNamedConverter> buildConverter(XmlContextNode parent);
-
- /**
- * Remove the adapter's XML converter from the specified XML converter
- * container.
- */
- void removeXmlConverter(XmlConverterHolder xmlConverterContainer);
-
- /**
- * Add the specified XML converter to the specified XML converter
- * container.
- */
- void addXmlConverter(XmlConverterHolder xmlConverterContainer, XmlNamedConverter xmlConverter);
- }
-
-
- // ********** abstract adapter **********
-
- public abstract static class AbstractAdapter
- implements Adapter
- {
- public OrmEclipseLinkConverter<? extends XmlNamedConverter> buildConverter(XmlConverterHolder xmlConverterContainer, XmlContextNode parent) {
- XmlNamedConverter xmlConverter = this.getXmlConverter(xmlConverterContainer);
- return (xmlConverter == null) ? null : this.buildConverter(xmlConverter, parent);
- }
-
- public OrmEclipseLinkConverter<? extends XmlNamedConverter> buildConverter(XmlContextNode parent) {
- return this.buildConverter(this.buildXmlConverter(), parent);
- }
-
- protected abstract XmlNamedConverter buildXmlConverter();
-
- public void removeXmlConverter(XmlConverterHolder xmlConverterContainer) {
- this.setXmlConverter(xmlConverterContainer, null);
- }
-
- public void addXmlConverter(XmlConverterHolder xmlConverterContainer, XmlNamedConverter xmlConverter) {
- this.setXmlConverter(xmlConverterContainer, xmlConverter);
- }
-
- protected abstract void setXmlConverter(XmlConverterHolder xmlConverterContainer, XmlNamedConverter xmlConverter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java
deleted file mode 100644
index 9868e13404..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterClassConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class OrmEclipseLinkConverterClassConverter<X extends XmlNamedConverter>
- extends OrmEclipseLinkConverter<X>
- implements EclipseLinkConverterClassConverter
-{
- private String converterClass;
-
- protected JavaResourceAbstractType converterResourceType;
-
-
- public OrmEclipseLinkConverterClassConverter(XmlContextNode parent, X xmlConverter, String converterClass) {
- super(parent, xmlConverter);
- this.converterClass = converterClass;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setConverterClass_(this.getXmlConverterClass());
- }
-
-
- // ********** converter class **********
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- this.setConverterClass_(converterClass);
- this.setXmlConverterClass(converterClass);
- }
-
- protected void setConverterClass_(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- protected JavaResourceAbstractType getConverterJavaResourceType() {
- return this.getMappingFileRoot().resolveJavaResourceType(this.converterClass);
- }
-
- protected abstract String getXmlConverterClass();
-
- protected abstract void setXmlConverterClass(String converterClass);
-
-
- // ********** resource interaction **********
-
- protected void updateConverterResourceType() {
- this.converterResourceType = this.getConverterJavaResourceType();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateConverterClass(messages);
- }
-
- protected void validateConverterClass(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(this.converterClass)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_DEFINED,
- this,
- this.getConverterClassTextRange()
- )
- );
- return;
- }
-
- if ( ! this.converterClassExists()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_EXISTS,
- new String[] {this.converterClass},
- this,
- this.getConverterClassTextRange()
- )
- );
- return;
- }
-
- if ( ! this.converterClassImplementsInterface(this.getEclipseLinkConverterInterface())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getEclipseLinkConverterInterfaceErrorMessage(),
- new String[] {this.converterClass},
- this,
- this.getConverterClassTextRange()
- )
- );
- }
- }
-
- /**
- * Return the name of the EclipseLink interface the converter class must
- * implement.
- */
- protected abstract String getEclipseLinkConverterInterface();
-
- protected abstract String getEclipseLinkConverterInterfaceErrorMessage();
-
- protected boolean converterClassExists() {
- return this.typeExists(this.converterClass) ||
- this.typeExists(this.getAlternateConverterClass());
- }
-
- /**
- * Add <code>null</code> check.
- */
- protected boolean typeExists(String typeName) {
- return (typeName != null) &&
- (JDTTools.findType(this.getJavaProject(), typeName) != null);
- }
-
- /**
- * Add <code>null</code> check.
- */
- protected boolean typeImplementsInterface(String typeName, String interfaceName) {
- return (typeName != null) &&
- JDTTools.typeIsSubType(this.getJavaProject(), typeName, interfaceName);
- }
-
- protected boolean converterClassImplementsInterface(String interfaceName) {
- return this.typeImplementsInterface(this.converterClass, interfaceName) ||
- this.typeImplementsInterface(this.getAlternateConverterClass(), interfaceName);
- }
-
- /**
- * If present, append the mapping file package to the converter class and
- * return it. Return <code>null</code> if the mapping file package is not
- * specified.
- */
- protected String getAlternateConverterClass() {
- String mappingFilePackage = this.getMappingFileRoot().getPackage();
- if (StringTools.stringIsEmpty(mappingFilePackage)) {
- return null;
- }
- return mappingFilePackage + '.' + this.converterClass;
- }
-
- protected TextRange getConverterClassTextRange() {
- return this.getValidationTextRange(this.getXmlConverterClassTextRange());
- }
-
- protected abstract TextRange getXmlConverterClassTextRange();
-
- protected IJavaProject getJavaProject() {
- return this.getJpaProject().getJavaProject();
- }
-
-
- // ********** refactoring **********
-
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected abstract ReplaceEdit createRenameEdit(IType originalType, String newName);
-
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected abstract ReplaceEdit createRenamePackageEdit(String newName);
-
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.isIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected boolean isFor(String typeName) {
- JavaResourceAbstractType converterType = this.getConverterJavaResourceType();
- return (converterType != null) && converterType.getQualifiedName().equals(typeName);
- }
-
- protected boolean isIn(IPackageFragment packageFragment) {
- JavaResourceAbstractType converterType = this.getConverterJavaResourceType();
- return (converterType != null) && converterType.isIn(packageFragment);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java
deleted file mode 100644
index c7f9bc9496..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java
+++ /dev/null
@@ -1,610 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkConverterContainerImpl
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkConverterContainer
-{
- private final XmlConvertersHolder xmlConvertersHolder;
-
- protected final ContextListContainer<OrmEclipseLinkCustomConverter, XmlConverter> customConverterContainer;
- protected final ContextListContainer<OrmEclipseLinkObjectTypeConverter, XmlObjectTypeConverter> objectTypeConverterContainer;
- protected final ContextListContainer<OrmEclipseLinkStructConverter, XmlStructConverter> structConverterContainer;
- protected final ContextListContainer<OrmEclipseLinkTypeConverter, XmlTypeConverter> typeConverterContainer;
-
-
- public OrmEclipseLinkConverterContainerImpl(XmlContextNode parent, XmlConvertersHolder xmlConvertersHolder) {
- super(parent);
- this.xmlConvertersHolder = xmlConvertersHolder;
-
- this.customConverterContainer = this.buildCustomConverterContainer();
- this.objectTypeConverterContainer = this.buildObjectTypeConverterContainer();
- this.structConverterContainer = this.buildStructConverterContainer();
- this.typeConverterContainer = this.buildTypeConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncCustomConverters();
- this.syncObjectTypeConverters();
- this.syncStructConverters();
- this.syncTypeConverters();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getCustomConverters());
- this.updateNodes(this.getObjectTypeConverters());
- this.updateNodes(this.getStructConverters());
- this.updateNodes(this.getTypeConverters());
- }
-
-
- // ********** custom converters **********
-
- public ListIterable<OrmEclipseLinkCustomConverter> getCustomConverters() {
- return this.customConverterContainer.getContextElements();
- }
-
- public int getCustomConvertersSize() {
- return this.customConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkCustomConverter addCustomConverter() {
- return this.addCustomConverter(this.getCustomConvertersSize());
- }
-
- public OrmEclipseLinkCustomConverter addCustomConverter(int index) {
- XmlConverter xmlConverter = this.buildXmlCustomConverter();
- OrmEclipseLinkCustomConverter converter = this.customConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConvertersHolder.getConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlConverter buildXmlCustomConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- }
-
- public void removeCustomConverter(EclipseLinkCustomConverter converter) {
- this.removeCustomConverter(this.customConverterContainer.indexOfContextElement((OrmEclipseLinkCustomConverter) converter));
- }
-
- public void removeCustomConverter(int index) {
- this.customConverterContainer.removeContextElement(index);
- this.xmlConvertersHolder.getConverters().remove(index);
- }
-
- public void moveCustomConverter(int targetIndex, int sourceIndex) {
- this.customConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConvertersHolder.getConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkCustomConverter buildCustomConverter(XmlConverter xmlConverter) {
- return new OrmEclipseLinkCustomConverter(this, xmlConverter);
- }
-
- protected void syncCustomConverters() {
- this.customConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlConverter> getXmlCustomConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlConverter>(this.xmlConvertersHolder.getConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkCustomConverter, XmlConverter> buildCustomConverterContainer() {
- CustomConverterContainer container = new CustomConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * custom converter container
- */
- protected class CustomConverterContainer
- extends ContextListContainer<OrmEclipseLinkCustomConverter, XmlConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return CUSTOM_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkCustomConverter buildContextElement(XmlConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildCustomConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlCustomConverters();
- }
- @Override
- protected XmlConverter getResourceElement(OrmEclipseLinkCustomConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
-
- // ********** object type converters **********
-
- public ListIterable<OrmEclipseLinkObjectTypeConverter> getObjectTypeConverters() {
- return this.objectTypeConverterContainer.getContextElements();
- }
-
- public int getObjectTypeConvertersSize() {
- return this.objectTypeConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkObjectTypeConverter addObjectTypeConverter() {
- return this.addObjectTypeConverter(this.getObjectTypeConvertersSize());
- }
-
- public OrmEclipseLinkObjectTypeConverter addObjectTypeConverter(int index) {
- XmlObjectTypeConverter xmlConverter = this.buildXmlObjectTypeConverter();
- OrmEclipseLinkObjectTypeConverter converter = this.objectTypeConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConvertersHolder.getObjectTypeConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlObjectTypeConverter buildXmlObjectTypeConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- }
-
- public void removeObjectTypeConverter(EclipseLinkObjectTypeConverter converter) {
- this.removeObjectTypeConverter(this.objectTypeConverterContainer.indexOfContextElement((OrmEclipseLinkObjectTypeConverter) converter));
- }
-
- public void removeObjectTypeConverter(int index) {
- this.objectTypeConverterContainer.removeContextElement(index);
- this.xmlConvertersHolder.getObjectTypeConverters().remove(index);
- }
-
- public void moveObjectTypeConverter(int targetIndex, int sourceIndex) {
- this.objectTypeConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConvertersHolder.getObjectTypeConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkObjectTypeConverter buildObjectTypeConverter(XmlObjectTypeConverter xmlConverter) {
- return new OrmEclipseLinkObjectTypeConverter(this, xmlConverter);
- }
-
- protected void syncObjectTypeConverters() {
- this.objectTypeConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlObjectTypeConverter> getXmlObjectTypeConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlObjectTypeConverter>(this.xmlConvertersHolder.getObjectTypeConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkObjectTypeConverter, XmlObjectTypeConverter> buildObjectTypeConverterContainer() {
- ObjectTypeConverterContainer container = new ObjectTypeConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * object type converter container
- */
- protected class ObjectTypeConverterContainer
- extends ContextListContainer<OrmEclipseLinkObjectTypeConverter, XmlObjectTypeConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return OBJECT_TYPE_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkObjectTypeConverter buildContextElement(XmlObjectTypeConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildObjectTypeConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlObjectTypeConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlObjectTypeConverters();
- }
- @Override
- protected XmlObjectTypeConverter getResourceElement(OrmEclipseLinkObjectTypeConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
- // ********** struct converters **********
-
- public ListIterable<OrmEclipseLinkStructConverter> getStructConverters() {
- return this.structConverterContainer.getContextElements();
- }
-
- public int getStructConvertersSize() {
- return this.structConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkStructConverter addStructConverter() {
- return this.addStructConverter(this.getStructConvertersSize());
- }
-
- public OrmEclipseLinkStructConverter addStructConverter(int index) {
- XmlStructConverter xmlConverter = this.buildXmlStructConverter();
- OrmEclipseLinkStructConverter converter = this.structConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConvertersHolder.getStructConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlStructConverter buildXmlStructConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- }
-
- public void removeStructConverter(EclipseLinkStructConverter converter) {
- this.removeStructConverter(this.structConverterContainer.indexOfContextElement((OrmEclipseLinkStructConverter) converter));
- }
-
- public void removeStructConverter(int index) {
- this.structConverterContainer.removeContextElement(index);
- this.xmlConvertersHolder.getStructConverters().remove(index);
- }
-
- public void moveStructConverter(int targetIndex, int sourceIndex) {
- this.structConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConvertersHolder.getStructConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkStructConverter buildStructConverter(XmlStructConverter xmlConverter) {
- return new OrmEclipseLinkStructConverter(this, xmlConverter);
- }
-
- protected void syncStructConverters() {
- this.structConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlStructConverter> getXmlStructConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlStructConverter>(this.xmlConvertersHolder.getStructConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkStructConverter, XmlStructConverter> buildStructConverterContainer() {
- StructConverterContainer container = new StructConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * struct converter container
- */
- protected class StructConverterContainer
- extends ContextListContainer<OrmEclipseLinkStructConverter, XmlStructConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return STRUCT_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkStructConverter buildContextElement(XmlStructConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildStructConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlStructConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlStructConverters();
- }
- @Override
- protected XmlStructConverter getResourceElement(OrmEclipseLinkStructConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
-
- // ********** type converters **********
-
- public ListIterable<OrmEclipseLinkTypeConverter> getTypeConverters() {
- return this.typeConverterContainer.getContextElements();
- }
-
- public int getTypeConvertersSize() {
- return this.typeConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkTypeConverter addTypeConverter() {
- return this.addTypeConverter(this.getTypeConvertersSize());
- }
-
- public OrmEclipseLinkTypeConverter addTypeConverter(int index) {
- XmlTypeConverter xmlConverter = this.buildXmlTypeConverter();
- OrmEclipseLinkTypeConverter converter = this.typeConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConvertersHolder.getTypeConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlTypeConverter buildXmlTypeConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- }
-
- public void removeTypeConverter(EclipseLinkTypeConverter converter) {
- this.removeTypeConverter(this.typeConverterContainer.indexOfContextElement((OrmEclipseLinkTypeConverter) converter));
- }
-
- public void removeTypeConverter(int index) {
- this.typeConverterContainer.removeContextElement(index);
- this.xmlConvertersHolder.getTypeConverters().remove(index);
- }
-
- public void moveTypeConverter(int targetIndex, int sourceIndex) {
- this.typeConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConvertersHolder.getTypeConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkTypeConverter buildTypeConverter(XmlTypeConverter xmlConverter) {
- return new OrmEclipseLinkTypeConverter(this, xmlConverter);
- }
-
- protected void syncTypeConverters() {
- this.typeConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTypeConverter> getXmlTypeConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTypeConverter>(this.xmlConvertersHolder.getTypeConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkTypeConverter, XmlTypeConverter> buildTypeConverterContainer() {
- TypeConverterContainer container = new TypeConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * type converter container
- */
- protected class TypeConverterContainer
- extends ContextListContainer<OrmEclipseLinkTypeConverter, XmlTypeConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return TYPE_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkTypeConverter buildContextElement(XmlTypeConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildTypeConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlTypeConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlTypeConverters();
- }
- @Override
- protected XmlTypeConverter getResourceElement(OrmEclipseLinkTypeConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
-
- // ********** refactoring **********
-
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameObjectTypeConverterEdits(originalType, newName),
- this.createRenameTypeConverterEdits(originalType, newName),
- this.createRenameStructConverterEdits(originalType, newName),
- this.createRenameCustomConverterEdits(originalType, newName));
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypeConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkObjectTypeConverter, Iterable<ReplaceEdit>>(getObjectTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkObjectTypeConverter objectTypeConverter) {
- return objectTypeConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameTypeConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkTypeConverter, Iterable<ReplaceEdit>>(getTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkTypeConverter typeConverter) {
- return typeConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameStructConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkStructConverter, Iterable<ReplaceEdit>>(getStructConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkStructConverter structConverter) {
- return structConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameCustomConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkCustomConverter, Iterable<ReplaceEdit>>(getCustomConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkCustomConverter customConverter) {
- return customConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createMoveObjectTypeConverterEdits(originalType, newPackage),
- this.createMoveTypeConverterEdits(originalType, newPackage),
- this.createMoveStructConverterEdits(originalType, newPackage),
- this.createMoveCustomConverterEdits(originalType, newPackage));
- }
-
- protected Iterable<ReplaceEdit> createMoveObjectTypeConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkObjectTypeConverter, Iterable<ReplaceEdit>>(getObjectTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkObjectTypeConverter objectTypeConverter) {
- return objectTypeConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveTypeConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkTypeConverter, Iterable<ReplaceEdit>>(getTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkTypeConverter typeConverter) {
- return typeConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveStructConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkStructConverter, Iterable<ReplaceEdit>>(getStructConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkStructConverter structConverter) {
- return structConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveCustomConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkCustomConverter, Iterable<ReplaceEdit>>(getCustomConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkCustomConverter customConverter) {
- return customConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
-
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createObjectTypeConverterRenamePackageEdits(originalPackage, newName),
- this.createTypeConverterRenamePackageEdits(originalPackage, newName),
- this.createStructConverterRenamePackageEdits(originalPackage, newName),
- this.createCustomConverterRenamePackageEdits(originalPackage, newName));
- }
-
- protected Iterable<ReplaceEdit> createObjectTypeConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkObjectTypeConverter, Iterable<ReplaceEdit>>(getObjectTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkObjectTypeConverter objectTypeConverter) {
- return objectTypeConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createTypeConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkTypeConverter, Iterable<ReplaceEdit>>(getTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkTypeConverter typeConverter) {
- return typeConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createStructConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkStructConverter, Iterable<ReplaceEdit>>(getStructConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkStructConverter structConverter) {
- return structConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkCustomConverter, Iterable<ReplaceEdit>>(getCustomConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkCustomConverter customConverter) {
- return customConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
-
- // ********** validation **********
-
- /**
- * The converters are validated in the persistence unit.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit#validateConverters(List, IReporter)
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // converters are validated in the persistence unit
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlConvertersHolder.getValidationTextRange();
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange();
- }
-
-
- // ********** misc **********
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.getCustomConverters(),
- this.getObjectTypeConverters(),
- this.getStructConverters(),
- this.getTypeConverters()
- );
- }
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java
deleted file mode 100644
index 4fe24b7276..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-public class OrmEclipseLinkCustomConverter
- extends OrmEclipseLinkConverterClassConverter<XmlConverter>
- implements EclipseLinkCustomConverter
-{
- public OrmEclipseLinkCustomConverter(XmlContextNode parent, XmlConverter xmlConverter) {
- super(parent, xmlConverter, xmlConverter.getClassName());
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getXmlConverterClass() {
- return this.xmlConverter.getClassName();
- }
-
- @Override
- protected void setXmlConverterClass(String converterClass) {
- this.xmlConverter.setClassName(converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkCustomConverter> getType() {
- return EclipseLinkCustomConverter.class;
- }
-
-
- // ********** refactoring **********
-
- @Override
- protected ReplaceEdit createRenameEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameEdit(originalType, newName);
- }
-
- @Override
- protected ReplaceEdit createRenamePackageEdit(String newName) {
- return xmlConverter.createRenamePackageEdit(newName);
- }
-
-
- // ********** validation **********
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.CONVERTER_CLASS_IMPLEMENTS_CONVERTER;
- }
-
- @Override
- protected TextRange getXmlConverterClassTextRange() {
- return this.xmlConverter.getConverterClassTextRange();
- }
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getConverterClass(), ((EclipseLinkCustomConverter)eclipseLinkConverter).getConverterClass());
- }
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkCustomConverter> getConverterType() {
- return EclipseLinkCustomConverter.class;
- }
-
- public XmlConverter getXmlConverter(XmlConverterHolder xmlConverterContainer) {
- return xmlConverterContainer.getConverter();
- }
-
- public OrmEclipseLinkCustomConverter buildConverter(XmlNamedConverter xmlConverter, XmlContextNode parent) {
- return new OrmEclipseLinkCustomConverter(parent, (XmlConverter) xmlConverter);
- }
-
- @Override
- protected XmlConverter buildXmlConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- }
-
- @Override
- public void setXmlConverter(XmlConverterHolder xmlConverterContainer, XmlNamedConverter xmlConverter) {
- xmlConverterContainer.setConverter((XmlConverter) xmlConverter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java
deleted file mode 100644
index 7071a3aa08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkCustomizer
- extends AbstractOrmXmlContextNode
- implements EclipseLinkCustomizer
-{
- protected String specifiedCustomizerClass;
- protected String defaultCustomizerClass;
-
-
- public OrmEclipseLinkCustomizer(EclipseLinkOrmTypeMapping parent) {
- super(parent);
- this.specifiedCustomizerClass = this.buildSpecifiedCustomizerClass();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedCustomizerClass_(this.buildSpecifiedCustomizerClass());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultCustomizerClass(this.buildDefaultCustomizerClass());
- }
-
-
- // ********** customizer class **********
-
- public String getCustomizerClass() {
- return (this.specifiedCustomizerClass != null) ? this.specifiedCustomizerClass : this.defaultCustomizerClass;
- }
-
- public String getSpecifiedCustomizerClass() {
- return this.specifiedCustomizerClass;
- }
-
- public void setSpecifiedCustomizerClass(String customizerClass) {
- if (this.valuesAreDifferent(this.specifiedCustomizerClass, customizerClass)) {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRefForUpdate();
- this.setSpecifiedCustomizerClass_(customizerClass);
- xmlClassRef.setClassName(customizerClass);
- this.removeXmlCustomizerClassRefIfUnset();
- }
- }
-
- protected void setSpecifiedCustomizerClass_(String customizerClass) {
- String old = this.specifiedCustomizerClass;
- this.specifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildSpecifiedCustomizerClass() {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
- return (xmlClassRef == null) ? null : xmlClassRef.getClassName();
- }
-
- public String getDefaultCustomizerClass() {
- return this.defaultCustomizerClass;
- }
-
- protected void setDefaultCustomizerClass(String customizerClass) {
- String old = this.defaultCustomizerClass;
- this.defaultCustomizerClass = customizerClass;
- this.firePropertyChanged(DEFAULT_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildDefaultCustomizerClass() {
- JavaEclipseLinkCustomizer javaCustomizer = this.getJavaCustomizerForDefaults();
- return (javaCustomizer == null) ? null : javaCustomizer.getFullyQualifiedCustomizerClass();
- }
-
-
- // ********** xml customizer class ref **********
-
- /**
- * Return null if the XML class ref does not exists.
- */
- protected XmlClassReference getXmlCustomizerClassRef() {
- return this.getXmlCustomizerHolder().getCustomizer();
- }
-
- /**
- * Build the XML class ref if it does not exist.
- */
- protected XmlClassReference getXmlCustomizerClassRefForUpdate() {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
- return (xmlClassRef != null) ? xmlClassRef : this.buildXmlCustomizerClassRef();
- }
-
- protected XmlClassReference buildXmlCustomizerClassRef() {
- XmlClassReference ref = OrmFactory.eINSTANCE.createXmlClassReference();
- this.getXmlCustomizerHolder().setCustomizer(ref);
- return ref;
- }
-
- protected void removeXmlCustomizerClassRefIfUnset() {
- if (this.getXmlCustomizerClassRef().isUnset()) {
- this.removeXmlCustomizerClassRef();
- }
- }
-
- protected void removeXmlCustomizerClassRef() {
- this.getXmlCustomizerHolder().setCustomizer(null);
- }
-
- protected JavaResourceAbstractType getResourceCustomizerType() {
- XmlClassReference customizerClassRef = this.getXmlCustomizerClassRef();
- if (customizerClassRef == null) {
- return null;
- }
-
- String className = customizerClassRef.getClassName();
- if (className == null) {
- return null;
- }
-
- return this.getEntityMappings().resolveJavaResourceType(className);
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkOrmTypeMapping getParent() {
- return (EclipseLinkOrmTypeMapping) super.getParent();
- }
-
- protected EclipseLinkOrmTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- protected XmlCustomizerHolder getXmlCustomizerHolder() {
- return (XmlCustomizerHolder) this.getXmlTypeMapping();
- }
-
- protected EclipseLinkJavaTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected JavaEclipseLinkCustomizer getJavaCustomizerForDefaults() {
- EclipseLinkJavaTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : (JavaEclipseLinkCustomizer) javaTypeMapping.getCustomizer();
- }
-
- protected EntityMappings getEntityMappings() {
- return this.getMappingFileRoot();
- }
-
- protected boolean isFor(String typeName) {
- JavaResourceAbstractType customizerType = this.getResourceCustomizerType();
- return (customizerType != null) && customizerType.getQualifiedName().equals(typeName);
- }
-
- protected boolean isIn(IPackageFragment packageFragment) {
- JavaResourceAbstractType customizerType = this.getResourceCustomizerType();
- return (customizerType != null) && customizerType.isIn(packageFragment);
- }
-
- public char getCustomizerClassEnclosingTypeSeparator() {
- return '$';
- }
-
-
- // ********** refactoring **********
-
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameTypeEdit(IType originalType, String newName) {
- return this.getXmlCustomizerClassRef().createRenameEdit(originalType, newName);
- }
-
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.isIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenamePackageEdit(String newName) {
- return this.getXmlCustomizerClassRef().createRenamePackageEdit(newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateCustomizerClass(messages);
- }
-
- protected void validateCustomizerClass(List<IMessage> messages) {
- IJavaProject javaProject = this.getPersistenceUnit().getJpaProject().getJavaProject();
- if (this.getCustomizerClass() != null) {
- if (StringTools.stringIsEmpty(this.getCustomizerClass())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this,
- this.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, this.getCustomizerClass()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST,
- new String[] { this.getCustomizerClass()},
- this,
- this.getValidationTextRange()
- )
- );
- } else if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, this.getCustomizerClass())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID,
- new String[] {this.getCustomizerClass()},
- this,
- this.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(javaProject, this.getCustomizerClass(), ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER,
- new String[] {this.getCustomizerClass()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
- return (xmlClassRef == null) ? null : xmlClassRef.getClassNameTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java
deleted file mode 100644
index 5ffdb65146..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> embeddable type mapping
- */
-public class OrmEclipseLinkEmbeddableImpl
- extends AbstractOrmEmbeddable<XmlEmbeddable>
- implements OrmEclipseLinkEmbeddable
-{
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
-
- public OrmEclipseLinkEmbeddableImpl(OrmPersistentType parent, XmlEmbeddable xmlEmbeddable) {
- super(parent, xmlEmbeddable);
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- }
-
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this.getXmlTypeMapping());
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new TransformationIterable<AttributeMapping, EclipseLinkConverter>(this.getAttributeMappings(), ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER);
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected OrmEclipseLinkChangeTracking buildChangeTracking() {
- return new OrmEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected OrmEclipseLinkCustomizer buildCustomizer() {
- return new OrmEclipseLinkCustomizer(this);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkEmbeddable getJavaTypeMapping() {
- return (JavaEclipseLinkEmbeddable) super.getJavaTypeMapping();
- }
-
- @Override
- public JavaEclipseLinkEmbeddable getJavaTypeMappingForDefaults() {
- return (JavaEclipseLinkEmbeddable) super.getJavaTypeMappingForDefaults();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return false;
- }
-
-
- // ********** refactoring **********
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createCustomizerRenameTypeEdits(originalType, newName),
- this.createConverterHolderRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenameTypeEdits(IType originalType, String newName) {
- return this.customizer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createCustomizerMoveTypeEdits(originalType, newPackage),
- this.createConverterHolderMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.customizer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createCustomizerRenamePackageEdits(originalPackage, newName),
- this.createConverterHolderRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.customizer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator() {
- return new EclipseLinkTypeMappingValidator(this, getJavaResourceType(), buildTextRangeResolver());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java
deleted file mode 100644
index 3109eb567d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkEntityPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> entity type mapping
- */
-public class OrmEclipseLinkEntityImpl
- extends AbstractOrmEntity<XmlEntity>
- implements OrmEclipseLinkEntity
-{
- protected final OrmEclipseLinkReadOnly readOnly;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCaching caching;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final OrmEclipseLinkMultitenancy2_3 multitenancy;
-
-
- public OrmEclipseLinkEntityImpl(OrmPersistentType parent, XmlEntity xmlEntity) {
- super(parent, xmlEntity);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- }
-
-
- // ********** caching **********
-
- public OrmEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected OrmEclipseLinkCaching buildCaching() {
- return new OrmEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read only **********
-
- public OrmEclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected OrmEclipseLinkReadOnly buildReadOnly() {
- return new OrmEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this.xmlTypeMapping);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new TransformationIterable<AttributeMapping, EclipseLinkConverter>(this.getAttributeMappings(), ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER);
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected OrmEclipseLinkChangeTracking buildChangeTracking() {
- return new OrmEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected OrmEclipseLinkCustomizer buildCustomizer() {
- return new OrmEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public OrmEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
- protected OrmEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new OrmEclipseLinkMultitenancyImpl2_3(this) :
- new NullOrmEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return this.isRootEntity() || this.isInheritanceStrategyTablePerClass();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkEntity getJavaTypeMapping() {
- return (JavaEclipseLinkEntity) super.getJavaTypeMapping();
- }
-
- @Override
- public JavaEclipseLinkEntity getJavaTypeMappingForDefaults() {
- return (JavaEclipseLinkEntity) super.getJavaTypeMappingForDefaults();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return (this.getXmlTypeMapping().getPrimaryKey() != null)
- || this.usesJavaPrimaryKeyColumns();
- }
-
- protected boolean usesJavaPrimaryKeyColumns() {
- JavaEclipseLinkEntity javaEntity = this.getJavaTypeMappingForDefaults();
- return (javaEntity != null) && javaEntity.usesPrimaryKeyColumns();
- }
-
- @Override
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return super.buildSpecifiedDiscriminatorColumnIsAllowed() && ! this.classExtractorIsUsed();
- }
-
- protected boolean classExtractorIsUsed() {
- return (this.getXmlClassExtractor() != null) || (this.getClassExtractorAnnotation() != null);
- }
-
- protected XmlClassReference getXmlClassExtractor() {
- return this.getXmlTypeMapping().getClassExtractor();
- }
-
- protected EclipseLinkClassExtractorAnnotation2_1 getClassExtractorAnnotation() {
- if (this.getJavaTypeMappingForDefaults() != null) {
- JavaResourceType jrpt = this.getJavaPersistentType().getJavaResourceType();
- return (EclipseLinkClassExtractorAnnotation2_1) jrpt.getAnnotation(EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME);
- }
- return null;
- }
-
- public OrmCacheable2_0 getCacheable() {
- return this.getCacheableHolder().getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return this.getCacheableHolder().calculateDefaultCacheable();
- }
-
- protected OrmCacheableHolder2_0 getCacheableHolder() {
- return (OrmCacheableHolder2_0) this.caching;
- }
-
- public XmlCacheable_2_0 getXmlCacheable() {
- return this.getXmlTypeMapping();
- }
-
- protected JavaResourceAbstractType getResourceClassExtractorType() {
- XmlClassReference classExtractorClassRef = this.getXmlClassExtractor();
- if (classExtractorClassRef == null) {
- return null;
- }
-
- String className = classExtractorClassRef.getClassName();
- if (className == null) {
- return null;
- }
-
- return this.getMappingFileRoot().resolveJavaResourceType(className);
- }
-
- protected boolean classExtractorIsFor(String typeName) {
- JavaResourceAbstractType classExtractorType = this.getResourceClassExtractorType();
- return (classExtractorType != null) && classExtractorType.getQualifiedName().equals(typeName);
- }
-
- protected boolean classExtractorIsIn(IPackageFragment packageFragment) {
- JavaResourceAbstractType classExtractorType = this.getResourceClassExtractorType();
- return (classExtractorType != null) && classExtractorType.isIn(packageFragment);
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createCustomizerRenameTypeEdits(originalType, newName),
- this.createConverterHolderRenameTypeEdits(originalType, newName),
- this.createClassExtractorRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenameTypeEdits(IType originalType, String newName) {
- return this.customizer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createClassExtractorRenameTypeEdits(IType originalType, String newName) {
- return this.classExtractorIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.getXmlClassExtractor().createRenameEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createCustomizerMoveTypeEdits(originalType, newPackage),
- this.createConverterHolderMoveTypeEdits(originalType, newPackage),
- this.createClassExtractorMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.customizer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createClassExtractorMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.classExtractorIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.getXmlClassExtractor().createRenamePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createCustomizerRenamePackageEdits(originalPackage, newName),
- this.createConverterHolderRenamePackageEdits(originalPackage, newName),
- this.createClassExtractorRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.customizer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createClassExtractorRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.classExtractorIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.getXmlClassExtractor().createRenamePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.caching.validate(messages, reporter);
- this.readOnly.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.multitenancy.validate(messages, reporter);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator() {
- return new EclipseLinkEntityPrimaryKeyValidator(this, buildTextRangeResolver());
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator() {
- return new EclipseLinkTypeMappingValidator(this, getJavaResourceType(), buildTextRangeResolver());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java
deleted file mode 100644
index c0f40771b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkIdMapping
- extends AbstractOrmIdMapping<XmlId>
- implements EclipseLinkIdMapping
-{
- protected final OrmEclipseLinkMutable mutable;
-
-
- public OrmEclipseLinkIdMapping(OrmPersistentAttribute parent, XmlId xmlMapping) {
- super(parent, xmlMapping);
- this.mutable = new OrmEclipseLinkMutable(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(OrmEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO mutable validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java
deleted file mode 100644
index c29d55668b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch;
-
-public class OrmEclipseLinkJoinFetch
- extends AbstractOrmXmlContextNode
- implements EclipseLinkJoinFetch
-{
- protected EclipseLinkJoinFetchType value;
-
-
- public OrmEclipseLinkJoinFetch(OrmAttributeMapping parent) {
- super(parent);
- this.value = this.buildValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** value **********
-
- public EclipseLinkJoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(EclipseLinkJoinFetchType value) {
- this.setValue_(value);
- this.getXmlJoinFetch().setJoinFetch(EclipseLinkJoinFetchType.toOrmResourceModel(value));
- }
-
- protected void setValue_(EclipseLinkJoinFetchType value) {
- EclipseLinkJoinFetchType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- protected EclipseLinkJoinFetchType buildValue() {
- return EclipseLinkJoinFetchType.fromOrmResourceModel(this.getXmlJoinFetch().getJoinFetch());
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- protected OrmAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected XmlAttributeMapping getXmlAttributeMapping() {
- return this.getAttributeMapping().getXmlAttributeMapping();
- }
-
- protected XmlJoinFetch getXmlJoinFetch() {
- return (XmlJoinFetch) this.getXmlAttributeMapping();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlJoinFetch().getJoinFetchTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java
deleted file mode 100644
index de99c6f6e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkManyToManyMapping
- extends AbstractOrmManyToManyMapping<XmlManyToMany>
- implements EclipseLinkRelationshipMapping
-{
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
-
- public OrmEclipseLinkManyToManyMapping(OrmPersistentAttribute parent, XmlManyToMany xmlMapping) {
- super(parent, xmlMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO join fetch validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java
deleted file mode 100644
index 381c08a5ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkManyToOneMapping
- extends AbstractOrmManyToOneMapping<XmlManyToOne>
- implements EclipseLinkRelationshipMapping
-{
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
-
- protected OrmEclipseLinkManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne xmlMapping) {
- super(parent, xmlMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - join fetch validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java
deleted file mode 100644
index c13b63e159..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> mapped superclass
- */
-public class OrmEclipseLinkMappedSuperclassImpl
- extends AbstractOrmMappedSuperclass<XmlMappedSuperclass>
- implements OrmEclipseLinkMappedSuperclass, OrmCacheableHolder2_0
-{
- protected final OrmEclipseLinkReadOnly readOnly;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCaching caching;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final OrmEclipseLinkMultitenancy2_3 multitenancy;
-
- protected final OrmQueryContainer queryContainer;
-
- public OrmEclipseLinkMappedSuperclassImpl(OrmPersistentType parent, XmlMappedSuperclass xmlMappedSuperclass) {
- super(parent, xmlMappedSuperclass);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- this.queryContainer = this.buildQueryContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- this.queryContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- this.queryContainer.update();
- }
-
-
- // ********** caching **********
-
- public OrmEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected OrmEclipseLinkCaching buildCaching() {
- return new OrmEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read only **********
-
- public OrmEclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected OrmEclipseLinkReadOnly buildReadOnly() {
- return new OrmEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this.xmlTypeMapping);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new TransformationIterable<AttributeMapping, EclipseLinkConverter>(this.getAttributeMappings(), ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER);
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected OrmEclipseLinkChangeTracking buildChangeTracking() {
- return new OrmEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected OrmEclipseLinkCustomizer buildCustomizer() {
- return new OrmEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public OrmEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
-
- protected OrmEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new OrmEclipseLinkMultitenancyImpl2_3(this) :
- new NullOrmEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- // ********** query container **********
-
- public OrmQueryContainer getQueryContainer() {
- return this.queryContainer;
- }
-
- protected OrmQueryContainer buildQueryContainer() {
- return this.getContextNodeFactory().buildOrmQueryContainer(this, this.xmlTypeMapping);
- }
-
- @Override
- public Iterable<Query> getQueries() {
- return this.queryContainer.getQueries();
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return true;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkMappedSuperclass getJavaTypeMapping() {
- return (JavaEclipseLinkMappedSuperclass) super.getJavaTypeMapping();
- }
-
- @Override
- public JavaEclipseLinkMappedSuperclass getJavaTypeMappingForDefaults() {
- return (JavaEclipseLinkMappedSuperclass) super.getJavaTypeMappingForDefaults();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return (this.getXmlTypeMapping().getPrimaryKey() != null)
- || this.usesJavaPrimaryKeyColumns();
- }
-
- protected boolean usesJavaPrimaryKeyColumns() {
- JavaEclipseLinkMappedSuperclass javaMappedSuperclass = this.getJavaTypeMappingForDefaults();
- return (javaMappedSuperclass != null) && javaMappedSuperclass.usesPrimaryKeyColumns();
- }
-
- public OrmCacheable2_0 getCacheable() {
- return this.getCacheableHolder().getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return this.getCacheableHolder().calculateDefaultCacheable();
- }
-
- protected OrmCacheableHolder2_0 getCacheableHolder() {
- return (OrmCacheableHolder2_0) this.caching;
- }
-
- public XmlCacheable_2_0 getXmlCacheable() {
- return this.getXmlTypeMapping();
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createCustomizerRenameTypeEdits(originalType, newName),
- this.createConverterHolderRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenameTypeEdits(IType originalType, String newName) {
- return this.customizer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createCustomizerMoveTypeEdits(originalType, newPackage),
- this.createConverterHolderMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.customizer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createCustomizerRenamePackageEdits(originalPackage, newName),
- this.createConverterHolderRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.customizer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.caching.validate(messages, reporter);
- this.readOnly.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.multitenancy.validate(messages, reporter);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator() {
- return new EclipseLinkMappedSuperclassPrimaryKeyValidator(this, this.buildTextRangeResolver());
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator() {
- return new EclipseLinkMappedSuperclassValidator(this, this.getJavaResourceType(), this.buildTextRangeResolver());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java
deleted file mode 100644
index b75a3f0a95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java
+++ /dev/null
@@ -1,751 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.TenantDiscriminatorColumnValidator2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkMultitenancyImpl2_3
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkMultitenancy2_3
-{
- protected boolean specifiedMultitenant;
- protected boolean defaultMultitenant;
-
- protected EclipseLinkMultitenantType2_3 specifiedType;
- protected EclipseLinkMultitenantType2_3 defaultType;
-
-// protected Boolean specifiedIncludeCriteria;
-// protected boolean defaultIncludeCriteria;
-
- protected final ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> specifiedTenantDiscriminatorColumnContainer;
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
-
- protected final ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumnContainer;
-
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3 defaultTenantDiscriminatorColumn;
-
- protected boolean specifiedTenantDiscriminatorColumnsAllowed;
-
- public OrmEclipseLinkMultitenancyImpl2_3(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- this.specifiedMultitenant = isMultitenantElementSpecified();
- this.specifiedType = this.buildSpecifiedType();
-// this.specifiedIncludeCriteria = this.buildSpecifiedIncludeCriteria();
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.specifiedTenantDiscriminatorColumnContainer = this.buildSpecifiedTenantDiscriminatorColumnContainer();
- this.defaultTenantDiscriminatorColumn = this.buildTenantDiscriminatorColumn(null);
- this.defaultTenantDiscriminatorColumnContainer = this.buildDefaultTenantDiscriminatorColumnContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedMultitenant_(isMultitenantElementSpecified());
- this.setSpecifiedType_(this.buildSpecifiedType());
-// this.setSpecifiedIncludeCriteria_(this.buildSpecifiedIncludeCriteria());
- this.syncSpecifiedTenantDiscriminatorColumns();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getSpecifiedTenantDiscriminatorColumns());
-
- boolean xmlMultitenantNotSpecified = (this.getXmlMultitenant() == null);
- JavaEclipseLinkMultitenancy2_3 javaMultitenantPolicy = this.getJavaMultitenancyPolicyForDefaults();
- boolean javaMultitenantPolicySpecified = javaMultitenantPolicy != null;
- boolean useJavaValue = (xmlMultitenantNotSpecified && javaMultitenantPolicySpecified);
-
- this.setDefaultMultitenant(useJavaValue ? javaMultitenantPolicy.isMultitenant() : this.buildDefaultMultitenant());
- this.setDefaultType(useJavaValue ? javaMultitenantPolicy.getType() : this.buildDefaultType());
-// this.setDefaultIncludeCriteria(useJavaValue ? javaMultitenantPolicy.isIncludeCriteria() : DEFAULT_INCLUDE_CRITERIA);
- this.setSpecifiedTenantDiscriminatorColumnsAllowed(this.buildSpecifiedTenantDiscriminatorColumnsAllowed());
- this.updateDefaultTenantDiscriminatorColumns();
- }
-
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return isSpecifiedMultitenant() || isDefaultMultitenant();
- }
-
- public boolean isDefaultMultitenant() {
- return this.defaultMultitenant;
- }
-
- public void setDefaultMultitenant(boolean defaultMultitenant) {
- boolean old = this.defaultMultitenant;
- this.defaultMultitenant = defaultMultitenant;
- this.firePropertyChanged(DEFAULT_MULTITENANT_PROPERTY, old, defaultMultitenant);
- }
-
- protected boolean buildDefaultMultitenant() {
- return this.isMultitenantInheritanceHierarchy() || this.isSuperMappedSuperclassMultitenant();
- }
-
- public boolean isSpecifiedMultitenant() {
- return this.specifiedMultitenant;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- if (isMultitenant) {
- if (getXmlMultitenant() != null) {
- throw new IllegalStateException("Multitenant element already specified"); //$NON-NLS-1$
- }
- this.addXmlMultitenant();
- }
- else {
- if (getXmlMultitenant() == null) {
- throw new IllegalStateException("Multitenant element does not exist"); //$NON-NLS-1$
- }
- this.removeXmlMultitenant();
- this.setSpecifiedType(null);
- for (int i = this.getSpecifiedTenantDiscriminatorColumnsSize(); i-- > 0; ) {
- this.removeSpecifiedTenantDiscriminatorColumn(i);
- }
- }
- this.setSpecifiedMultitenant_(isMultitenant);
- }
-
- protected void setSpecifiedMultitenant_(boolean isMultitenant) {
- boolean old = this.specifiedMultitenant;
- this.specifiedMultitenant = isMultitenant;
- this.firePropertyChanged(SPECIFIED_MULTITENANT_PROPERTY, old, isMultitenant);
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- if (this.valuesAreDifferent(this.specifiedType, type)) {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenantForUpdate();
- this.setSpecifiedType_(type);
- xmlMultitenant.setType(EclipseLinkMultitenantType2_3.toOrmResourceModel(type));
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkMultitenantType2_3 buildSpecifiedType() {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenant();
- return (xmlMultitenant == null) ? null : EclipseLinkMultitenantType2_3.fromOrmResourceModel(xmlMultitenant.getType());
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkMultitenantType2_3 buildDefaultType() {
- if (!isMultitenant()) {
- return null;
- }
- if (isSpecifiedMultitenant()) {
- return DEFAULT_TYPE;
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return getRootEntity().getMultitenancy().getType();
- }
- EclipseLinkMappedSuperclass superMappedSuperclass = getSuperMappedSuperclass();
- return superMappedSuperclass != null ? superMappedSuperclass.getMultitenancy().getType() : DEFAULT_TYPE;
- }
-
-
- // ********** include criteria **********
-
-// public boolean isIncludeCriteria() {
-// return (this.specifiedIncludeCriteria != null) ? this.specifiedIncludeCriteria.booleanValue() : this.defaultIncludeCriteria;
-// }
-//
-// public Boolean getSpecifiedIncludeCriteria() {
-// return this.specifiedIncludeCriteria;
-// }
-//
-// public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
-// if (this.valuesAreDifferent(this.specifiedIncludeCriteria, includeCriteria)) {
-// XmlMultitenant xmlMultitenant = this.getXmlMultitenantForUpdate();
-// this.setSpecifiedIncludeCriteria_(includeCriteria);
-// xmlMultitenant.setIncludeCriteria(includeCriteria);
-// }
-// }
-//
-// protected void setSpecifiedIncludeCriteria_(Boolean includeCriteria) {
-// Boolean old = this.specifiedIncludeCriteria;
-// this.specifiedIncludeCriteria = includeCriteria;
-// this.firePropertyChanged(SPECIFIED_INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
-// }
-//
-// protected Boolean buildSpecifiedIncludeCriteria() {
-// XmlMultitenant xmlMultitenant = this.getXmlMultitenant();
-// return (xmlMultitenant == null) ? null : xmlMultitenant.getIncludeCriteria();
-// }
-//
-//
-// public boolean isDefaultIncludeCriteria() {
-// return this.defaultIncludeCriteria;
-// }
-//
-// protected void setDefaultIncludeCriteria(boolean includeCriteria) {
-// boolean old = this.defaultIncludeCriteria;
-// this.defaultIncludeCriteria = includeCriteria;
-// this.firePropertyChanged(DEFAULT_INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
-// }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getReadOnlySpecifiedTenantDiscriminatorColumns() :
- this.getReadOnlyDefaultTenantDiscriminatorColumns();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getSpecifiedTenantDiscriminatorColumnsSize() :
- this.getDefaultTenantDiscriminatorColumnsSize();
- }
-
- // ********** specified tenant discriminator columns **********
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getReadOnlySpecifiedTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<OrmReadOnlyTenantDiscriminatorColumn2_3>(this.getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return this.getSpecifiedTenantDiscriminatorColumnsSize() != 0;
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- return this.addSpecifiedTenantDiscriminatorColumn(this.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- XmlTenantDiscriminatorColumn xmlJoinColumn = this.buildXmlTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 joinColumn = this.specifiedTenantDiscriminatorColumnContainer.addContextElement(index, xmlJoinColumn);
- this.getXmlMultitenantForUpdate().getTenantDiscriminatorColumns().add(index, xmlJoinColumn);
- return joinColumn;
- }
-
- protected XmlTenantDiscriminatorColumn buildXmlTenantDiscriminatorColumn() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn();
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeSpecifiedTenantDiscriminatorColumn(this.specifiedTenantDiscriminatorColumnContainer.indexOfContextElement((OrmTenantDiscriminatorColumn2_3) tenantDiscriminatorColumn));
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- this.specifiedTenantDiscriminatorColumnContainer.removeContextElement(index);
- this.getXmlMultitenant().getTenantDiscriminatorColumns().remove(index);
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.specifiedTenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- this.getXmlMultitenant().getTenantDiscriminatorColumns().move(targetIndex, sourceIndex);
- }
-
-
- protected void syncSpecifiedTenantDiscriminatorColumns() {
- this.specifiedTenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getXmlTenantDiscriminatorColumns() {
- if (getXmlMultitenant() == null) {
- return EmptyListIterable.instance();
- }
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTenantDiscriminatorColumn_2_3>(this.getXmlMultitenant().getTenantDiscriminatorColumns());
- }
-
- /**
- * specified tenant discriminator column container
- */
- protected class SpecifiedTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmTenantDiscriminatorColumn2_3 buildContextElement(XmlTenantDiscriminatorColumn_2_3 resourceElement) {
- return OrmEclipseLinkMultitenancyImpl2_3.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getResourceElements() {
- return OrmEclipseLinkMultitenancyImpl2_3.this.getXmlTenantDiscriminatorColumns();
- }
- @Override
- protected XmlTenantDiscriminatorColumn_2_3 getResourceElement(OrmTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getXmlColumn();
- }
- }
-
- protected OrmReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- protected ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> buildSpecifiedTenantDiscriminatorColumnContainer() {
- SpecifiedTenantDiscriminatorColumnContainer container = new SpecifiedTenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
- protected OrmTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn) {
- return new EclipseLinkOrmTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, xmlTenantDiscriminatorColumn);
- }
-
-
- // ********** default tenant discriminator columns **********
-
- public ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getReadOnlyDefaultTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<OrmReadOnlyTenantDiscriminatorColumn2_3>(this.getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- protected void clearDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.clearContextList();
- }
-
- /**
- * If there are any specified tenant discriminator columns, then there are no default
- * tenant discriminator columns.
- * If there are Java specified tenant discriminator columns, then those are the default
- * tenant discriminator columns.
- * @see #getTenantDiscriminatorColumnsForDefaults()
- */
- protected void updateDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.update();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumnsForDefaults() {
- if (this.getType() == null || this.getType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- return EmptyListIterable.instance();
- }
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = this.getJavaMultitenancyPolicyForDefaults();
- if (javaMultitenancy != null && !this.isSpecifiedMultitenant()) {
- if (javaMultitenancy.hasSpecifiedTenantDiscriminatorColumns()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(javaMultitenancy.getSpecifiedTenantDiscriminatorColumns());
- }
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getRootEntity().getMultitenancy().getTenantDiscriminatorColumns());
- }
- if (!isSpecifiedMultitenant()) {
- EclipseLinkMappedSuperclass superMappedSuperclass = this.getSuperMappedSuperclass();
- if (superMappedSuperclass != null && superMappedSuperclass.getMultitenancy().isMultitenant()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(superMappedSuperclass.getMultitenancy().getTenantDiscriminatorColumns());
- }
- }
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() == 0) {
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> contextColumns = this.getContextDefaultTenantDiscriminatorColumns();
- if (CollectionTools.isEmpty(contextColumns)) {
- return new SingleElementListIterable<ReadOnlyTenantDiscriminatorColumn2_3>(this.defaultTenantDiscriminatorColumn);
- }
- return contextColumns;
- }
- return EmptyListIterable.instance();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getContextDefaultTenantDiscriminatorColumns() {
- EclipseLinkEntityMappings entityMappings = this.getEclipseLinkEntityMappings();
- return (entityMappings != null) ? entityMappings.getTenantDiscriminatorColumns() : this.getPersistenceUnit().getDefaultTenantDiscriminatorColumns();
- }
-
-
- protected void moveDefaultTenantDiscriminatorColumn(int index, OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.moveContextElement(index, tenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 addDefaultTenantDiscriminatorColumn(int index, JavaTenantDiscriminatorColumn2_3 javaTenantDiscriminatorColumn) {
- return this.defaultTenantDiscriminatorColumnContainer.addContextElement(index, javaTenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildVirtualTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- return new GenericOrmVirtualTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, tenantDiscriminatorColumn);
- }
-
- protected void removeDefaultTenantDiscriminatorColumn(OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.removeContextElement(tenantDiscriminatorColumn);
- }
-
- protected ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> buildDefaultTenantDiscriminatorColumnContainer() {
- return new DefaultTenantDiscriminatorColumnContainer();
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return this.specifiedTenantDiscriminatorColumnsAllowed;
- }
-
- public void setSpecifiedTenantDiscriminatorColumnsAllowed(boolean allowed) {
- boolean old = this.specifiedTenantDiscriminatorColumnsAllowed;
- this.specifiedTenantDiscriminatorColumnsAllowed = allowed;
- this.firePropertyChanged(SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_ALLOWED_PROPERTY, old, allowed);
- }
-
- protected boolean buildSpecifiedTenantDiscriminatorColumnsAllowed() {
- return this.getParent().isMultitenantMetadataAllowed();
- }
-
-
- /**
- * default tenant discriminator column container
- */
- protected class DefaultTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildContextElement(ReadOnlyTenantDiscriminatorColumn2_3 resourceElement) {
- return OrmEclipseLinkMultitenancyImpl2_3.this.buildVirtualTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getResourceElements() {
- return OrmEclipseLinkMultitenancyImpl2_3.this.getTenantDiscriminatorColumnsForDefaults();
- }
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getResourceElement(OrmVirtualTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getOverriddenColumn();
- }
- }
-
-
- // ********** OrmReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements OrmReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- public Table resolveDbTable(String tableName) {
- return getTypeMapping().resolveDbTable(tableName);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return getTypeMapping().getAllAssociatedTableNames();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return new TenantDiscriminatorColumnValidator2_3((ReadOnlyTenantDiscriminatorColumn2_3) column, textRangeResolver);
- }
-
- public TextRange getValidationTextRange() {
- return OrmEclipseLinkMultitenancyImpl2_3.this.getValidationTextRange();
- }
- }
-
- // ********** XML multitenant **********
-
- /**
- * Return null if the XML multitenant does not exists.
- */
- protected XmlMultitenant getXmlMultitenant() {
- return getXmlMultitenantHolder().getMultitenant();
- }
-
- protected XmlMultitenantHolder getXmlMultitenantHolder() {
- return (XmlMultitenantHolder) this.getXmlTypeMapping();
- }
-
- /**
- * Build the XML multitenant if it does not exist.
- */
- protected XmlMultitenant getXmlMultitenantForUpdate() {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenant();
- return (xmlMultitenant != null) ? xmlMultitenant : this.buildXmlMultitenant();
- }
-
- protected XmlMultitenant buildXmlMultitenant() {
- XmlMultitenant xmlMultitenant = EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant();
- this.getXmlMultitenantHolder().setMultitenant(xmlMultitenant);
- return xmlMultitenant;
- }
-
- public boolean isMultitenantElementSpecified() {
- return this.getXmlMultitenant() != null;
- }
-
- protected XmlMultitenant addXmlMultitenant() {
- XmlMultitenant xmlMultitenant = this.buildXmlMultitenant();
- this.getXmlMultitenantHolder().setMultitenant(xmlMultitenant);
- return xmlMultitenant;
- }
-
- protected void removeXmlMultitenant() {
- this.getXmlMultitenantHolder().setMultitenant(null);
- }
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (OrmEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected OrmEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- public EclipseLinkEntityMappings getEclipseLinkEntityMappings() {
- return (EclipseLinkEntityMappings) super.getMappingFileRoot();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected JavaEclipseLinkMultitenancy2_3 getJavaMultitenancyPolicyForDefaults() {
- JavaEclipseLinkNonEmbeddableTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getMultitenancy();
- }
-
- protected boolean isMultitenantInheritanceHierarchy() {
- if (this.isInheritanceStrategyTablePerClass()) {
- return false;
- }
- return this.isRootEntityMultitenant();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
- protected boolean isRootEntityMultitenant() {
- EclipseLinkEntity rootEntity = this.getRootEntity();
- return rootEntity != null && rootEntity != getParent() && rootEntity.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkEntity getRootEntity() {
- //instanceof check in case the rootEntity is in an orm.xml instead of an eclipselinkorm.xml file.
- Entity entity = getParent().getRootEntity();
- return entity instanceof EclipseLinkEntity ? (EclipseLinkEntity) entity : null;
- }
-
- protected boolean isSuperMappedSuperclassMultitenant() {
- EclipseLinkMappedSuperclass mappedSuperclass = this.getSuperMappedSuperclass(getParent());
- return mappedSuperclass != null && mappedSuperclass.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass() {
- return this.getSuperMappedSuperclass(this.getParent());
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass(TypeMapping typeMapping) {
- TypeMapping superTypeMapping = typeMapping.getSuperTypeMapping();
- if (superTypeMapping == null) {
- return null;
- }
- //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
- if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
- return (EclipseLinkMappedSuperclass) superTypeMapping;
- }
- return this.getSuperMappedSuperclass(superTypeMapping);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (getType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getValidationTextRange()
- )
- );
- }
- if (getType() == EclipseLinkMultitenantType2_3.VPD) {
- String targetDatabase = getPersistenceUnit().getOptions().getTargetDatabase();
- if (targetDatabase == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getValidationTextRange()
- )
- );
- }
- else if (!TargetDatabase.isOracleDatabase(targetDatabase)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM,
- new String[] {targetDatabase},
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
- if (getSpecifiedTenantDiscriminatorColumnsSize() > 0) {
- if (!this.specifiedTenantDiscriminatorColumnsAllowed()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY,
- EMPTY_STRING_ARRAY,
- this,
- this.getXmlMultitenant().getValidationTextRange()
- )
- );
- }
- else {
- for (OrmTenantDiscriminatorColumn2_3 column : this.getSpecifiedTenantDiscriminatorColumns()) {
- column.validate(messages, reporter);
- }
- }
- }
- if (this.specifiedTenantDiscriminatorColumnsAllowed()) {
- //bug 360731 no need to validate, they will be validated where they are specified
- for (OrmVirtualTenantDiscriminatorColumn2_3 column : this.getDefaultTenantDiscriminatorColumns()) {
- column.validate(messages, reporter);
- }
- }
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlMultitenantValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlMultitenantValidationTextRange() {
- XmlMultitenant_2_4 xmlMultitenant = this.getXmlMultitenant();
- return (xmlMultitenant == null) ? null : xmlMultitenant.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java
deleted file mode 100644
index d993626d2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable;
-
-public class OrmEclipseLinkMutable
- extends AbstractOrmXmlContextNode
- implements EclipseLinkMutable
-{
- protected Boolean specifiedMutable;
- protected boolean defaultMutable;
-
-
- public OrmEclipseLinkMutable(OrmAttributeMapping parent) {
- super(parent);
- this.specifiedMutable = this.buildSpecifiedMutable();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedMutable_(this.buildSpecifiedMutable());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultMutable(this.buildDefaultMutable());
- }
-
-
- // ********** mutable **********
-
- public boolean isMutable() {
- return (this.specifiedMutable != null) ? this.specifiedMutable.booleanValue() : this.defaultMutable;
- }
-
- public Boolean getSpecifiedMutable() {
- return this.specifiedMutable;
- }
-
- public void setSpecifiedMutable(Boolean mutable) {
- this.setSpecifiedMutable_(mutable);
- this.getXmlMutable().setMutable(mutable);
- }
-
- protected void setSpecifiedMutable_(Boolean mutable) {
- Boolean old = this.specifiedMutable;
- this.specifiedMutable = mutable;
- this.firePropertyChanged(SPECIFIED_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected Boolean buildSpecifiedMutable() {
- return this.getXmlMutable().getMutable();
- }
-
- public boolean isDefaultMutable() {
- return this.defaultMutable;
- }
-
- protected void setDefaultMutable(boolean mutable) {
- boolean old = this.defaultMutable;
- this.defaultMutable = mutable;
- this.firePropertyChanged(DEFAULT_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected boolean buildDefaultMutable() {
- JavaEclipseLinkPersistentAttribute javaAttribute = this.getJavaPersistentAttribute();
- if (javaAttribute == null) {
- return false;
- }
- if (javaAttribute.typeIsDateOrCalendar()) {
- Boolean puTemporalMutable = this.getPersistenceUnit().getOptions().getTemporalMutable();
- return (puTemporalMutable == null) ? false : puTemporalMutable.booleanValue();
- }
- return javaAttribute.typeIsSerializable();
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- protected OrmAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected XmlMutable getXmlMutable() {
- return (XmlMutable) this.getAttributeMapping().getXmlAttributeMapping();
- }
-
- protected JavaEclipseLinkPersistentAttribute getJavaPersistentAttribute() {
- return (JavaEclipseLinkPersistentAttribute) this.getAttributeMapping().getPersistentAttribute().getJavaPersistentAttribute();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlMutable().getMutableTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java
deleted file mode 100644
index dd91f2f9f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkObjectTypeConverter
- extends OrmEclipseLinkConverter<XmlObjectTypeConverter>
- implements EclipseLinkObjectTypeConverter
-{
- private String dataType;
-
- private String objectType;
-
-
- protected final ContextListContainer<OrmEclipseLinkConversionValue, XmlConversionValue> conversionValueContainer;
-
- private String defaultObjectValue;
-
-
- public OrmEclipseLinkObjectTypeConverter(XmlContextNode parent, XmlObjectTypeConverter xmlConverter) {
- super(parent, xmlConverter);
- this.dataType = xmlConverter.getDataType();
- this.objectType = xmlConverter.getObjectType();
- this.conversionValueContainer = this.buildConversionValueContainer();
- this.defaultObjectValue = xmlConverter.getDefaultObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.xmlConverter.getDataType());
- this.setObjectType_(this.xmlConverter.getObjectType());
- this.syncConversionValues();
- this.setDefaultObjectValue_(this.xmlConverter.getDefaultObjectValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getConversionValues());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.setDataType_(dataType);
- this.xmlConverter.setDataType(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
- protected boolean dataTypeIsFor(String typeName) {
- return this.typeIsFor(this.getDataTypeJavaResourceType(), typeName);
- }
-
- protected boolean dataTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getDataTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getDataTypeJavaResourceType() {
- return this.getMappingFileRoot().resolveJavaResourceType(this.getDataType());
- }
-
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.setObjectType_(objectType);
- this.xmlConverter.setObjectType(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- protected boolean objectTypeIsFor(String typeName) {
- return this.typeIsFor(this.getObjectTypeJavaResourceType(), typeName);
- }
-
- protected boolean objectTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getObjectTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getObjectTypeJavaResourceType() {
- return this.getMappingFileRoot().resolveJavaResourceType(this.getObjectType());
- }
-
-
- // ********** conversion values **********
-
- public ListIterable<OrmEclipseLinkConversionValue> getConversionValues() {
- return this.conversionValueContainer.getContextElements();
- }
-
- public int getConversionValuesSize() {
- return this.conversionValueContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkConversionValue addConversionValue() {
- return this.addConversionValue(this.getConversionValuesSize());
- }
-
- public OrmEclipseLinkConversionValue addConversionValue(int index) {
- XmlConversionValue xmlConversionValue = this.buildXmlConversionValue();
- OrmEclipseLinkConversionValue conversionValue = this.conversionValueContainer.addContextElement(index, xmlConversionValue);
- this.xmlConverter.getConversionValues().add(index, xmlConversionValue);
- return conversionValue;
- }
-
- protected XmlConversionValue buildXmlConversionValue() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValue();
- }
-
- public void removeConversionValue(EclipseLinkConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValueContainer.indexOfContextElement((OrmEclipseLinkConversionValue) conversionValue));
- }
-
- public void removeConversionValue(int index) {
- this.conversionValueContainer.removeContextElement(index);
- this.xmlConverter.getConversionValues().remove(index);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- this.conversionValueContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConverter.getConversionValues().move(targetIndex, sourceIndex);
- }
-
-
- protected OrmEclipseLinkConversionValue buildConversionValue(XmlConversionValue xmlConversionValue) {
- return new OrmEclipseLinkConversionValue(this, xmlConversionValue);
- }
-
- protected void syncConversionValues() {
- this.conversionValueContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlConversionValue> getXmlConversionValues() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlConversionValue>(this.xmlConverter.getConversionValues());
- }
-
- protected ContextListContainer<OrmEclipseLinkConversionValue, XmlConversionValue> buildConversionValueContainer() {
- ConversionValueContainer container = new ConversionValueContainer();
- container.initialize();
- return container;
- }
-
- /**
- * conversion value container
- */
- protected class ConversionValueContainer
- extends ContextListContainer<OrmEclipseLinkConversionValue, XmlConversionValue> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return CONVERSION_VALUES_LIST;
- }
-
- @Override
- protected OrmEclipseLinkConversionValue buildContextElement(XmlConversionValue resourceElement) {
- return OrmEclipseLinkObjectTypeConverter.this.buildConversionValue(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlConversionValue> getResourceElements() {
- return OrmEclipseLinkObjectTypeConverter.this.getXmlConversionValues();
- }
-
- @Override
- protected XmlConversionValue getResourceElement(OrmEclipseLinkConversionValue contextElement) {
- return contextElement.getXmlConversionValue();
- }
- }
-
-
- // ********** data values **********
-
- public Iterable<String> getDataValues() {
- return new TransformationIterable<OrmEclipseLinkConversionValue, String>(this.getConversionValues()) {
- @Override
- protected String transform(OrmEclipseLinkConversionValue conversionValue) {
- return conversionValue.getDataValue();
- }
- };
- }
-
- public int getDataValuesSize() {
- return this.getConversionValuesSize();
- }
-
-
- // ********** default object value **********
-
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String value) {
- this.setDefaultObjectValue_(value);
- this.xmlConverter.setDefaultObjectValue(value);
- }
-
- protected void setDefaultObjectValue_(String value) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = value;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkObjectTypeConverter> getType() {
- return EclipseLinkObjectTypeConverter.class;
- }
-
- protected boolean typeIsFor(JavaResourceAbstractType type, String typeName) {
- return (type != null) && type.getQualifiedName().equals(typeName);
- }
-
- protected boolean typeIsIn(JavaResourceAbstractType type, IPackageFragment packageFragment) {
- return (type != null) && type.isIn(packageFragment);
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypeEdits(originalType, newName),
- this.createRenameObjectTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypeEdits(IType originalType, String newName) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameDataTypeEdit(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypeEdits(IType originalType, String newName) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameObjectTypeEdit(originalType, newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createMoveDataTypeEdits(originalType, newPackage),
- this.createMoveObjectTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveDataTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameDataTypePackageEdit(newName);
- }
-
- protected Iterable<ReplaceEdit> createMoveObjectTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameObjectTypePackageEdit(newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypePackageEdits(originalPackage, newName),
- this.createRenameObjectTypePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.dataTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.objectTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.checkForDuplicateDataValues(messages);
- for (OrmEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- conversionValue.validate(messages, reporter);
- }
- }
-
- protected void checkForDuplicateDataValues(List<IMessage> messages) {
- for (ArrayList<OrmEclipseLinkConversionValue> dups : this.mapConversionValuesByDataValue().values()) {
- if (dups.size() > 1) {
- for (OrmEclipseLinkConversionValue dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE,
- new String[] {dup.getDataValue()},
- this,
- dup.getDataValueTextRange()
- )
- );
- }
- }
- }
- }
-
- protected HashMap<String, ArrayList<OrmEclipseLinkConversionValue>> mapConversionValuesByDataValue() {
- HashMap<String, ArrayList<OrmEclipseLinkConversionValue>> map = new HashMap<String, ArrayList<OrmEclipseLinkConversionValue>>(this.getConversionValuesSize());
- for (OrmEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- String dataValue = conversionValue.getDataValue();
- ArrayList<OrmEclipseLinkConversionValue> list = map.get(dataValue);
- if (list == null) {
- list = new ArrayList<OrmEclipseLinkConversionValue>();
- map.put(dataValue, list);
- }
- list.add(conversionValue);
- }
- return map;
- }
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getObjectType(), ((EclipseLinkObjectTypeConverter)eclipseLinkConverter).getObjectType()) &&
- StringTools.stringsAreEqual(this.getDataType(), (((EclipseLinkObjectTypeConverter)eclipseLinkConverter).getDataType())) &&
- StringTools.stringsAreEqual(this.getDefaultObjectValue(), (((EclipseLinkObjectTypeConverter)eclipseLinkConverter).getDefaultObjectValue())) &&
- conversionValuesAreIdentical(((EclipseLinkObjectTypeConverter)eclipseLinkConverter).getConversionValues());
- }
-
- private boolean conversionValuesAreIdentical(ListIterable<? extends EclipseLinkConversionValue> conversionValues) {
- boolean isIdentical = true;
- if (this.getConversionValuesSize() != CollectionTools.size(conversionValues)) {
- return false;
- } else {
- for (int i=0; i<this.getConversionValuesSize(); i++) {
- if (!(CollectionTools.get(this.getConversionValues(), i)).isIdentical(CollectionTools.get(conversionValues, i))) {
- isIdentical = false;
- }
- }
- }
- return isIdentical;
- }
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkObjectTypeConverter> getConverterType() {
- return EclipseLinkObjectTypeConverter.class;
- }
-
- public XmlObjectTypeConverter getXmlConverter(XmlConverterHolder xmlConverterContainer) {
- return xmlConverterContainer.getObjectTypeConverter();
- }
-
- public OrmEclipseLinkConverter<? extends XmlNamedConverter> buildConverter(XmlNamedConverter xmlConverter, XmlContextNode parent) {
- return new OrmEclipseLinkObjectTypeConverter(parent, (XmlObjectTypeConverter) xmlConverter);
- }
-
- @Override
- protected XmlObjectTypeConverter buildXmlConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- }
-
- @Override
- protected void setXmlConverter(XmlConverterHolder xmlConverterContainer, XmlNamedConverter xmlConverter) {
- xmlConverterContainer.setObjectTypeConverter((XmlObjectTypeConverter) xmlConverter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java
deleted file mode 100644
index 4a12ab238d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkOneToManyMapping
- extends AbstractOrmOneToManyMapping<XmlOneToMany>
- implements EclipseLinkOneToManyMapping2_0
-{
- protected final OrmEclipseLinkPrivateOwned privateOwned;
-
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
-
- public OrmEclipseLinkOneToManyMapping(OrmPersistentAttribute parent, XmlOneToMany xmlMapping) {
- super(parent, xmlMapping);
- this.privateOwned = new OrmEclipseLinkPrivateOwned(this);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** relationship **********
-
- @Override
- protected OrmOneToManyRelationship2_0 buildRelationship() {
- return new EclipseLinkOrmOneToManyRelationship(this);
- }
-
- @Override
- public EclipseLinkOrmOneToManyRelationship2_0 getRelationship() {
- return (EclipseLinkOrmOneToManyRelationship) super.getRelationship();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - private owned, join fetch validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java
deleted file mode 100644
index fba126803e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkOneToOneMapping
- extends AbstractOrmOneToOneMapping<XmlOneToOne>
- implements EclipseLinkOneToOneMapping
-{
- protected final OrmEclipseLinkPrivateOwned privateOwned;
-
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
-
- protected OrmEclipseLinkOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne xmlMapping) {
- super(parent, xmlMapping);
- this.privateOwned = new OrmEclipseLinkPrivateOwned(this);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - private owned, join fetch validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java
deleted file mode 100644
index 9d92c05a31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-
-/**
- * EclipseLink <code>orm.xml</code> file
- * <br>
- * <code>persistence-unit-defaults</code> element
- */
-public class OrmEclipseLinkPersistenceUnitDefaults
- extends AbstractOrmPersistenceUnitDefaults
- implements EclipseLinkPersistenceUnitDefaults
-{
-
- protected final ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumnContainer;
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
-
- // ********** constructor/initialization **********
-
- public OrmEclipseLinkPersistenceUnitDefaults(OrmPersistenceUnitMetadata parent) {
- super(parent);
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.tenantDiscriminatorColumnContainer = this.buildTenantDiscriminatorColumnContainer();
- }
-
- @Override
- protected XmlPersistenceUnitDefaults buildXmlPersistenceUnitDefaults() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- }
-
- @Override
- protected XmlPersistenceUnitDefaults getXmlDefaults() {
- return (XmlPersistenceUnitDefaults) super.getXmlDefaults();
- }
-
- @Override
- protected XmlPersistenceUnitDefaults getXmlDefaultsForUpdate() {
- return (XmlPersistenceUnitDefaults) super.getXmlDefaultsForUpdate();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncTenantDiscriminatorColumns();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getTenantDiscriminatorColumns());
- }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.tenantDiscriminatorColumnContainer.getContextElements();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.tenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasTenantDiscriminatorColumns() {
- return this.getTenantDiscriminatorColumnsSize() != 0;
- }
-
- public OrmTenantDiscriminatorColumn2_3 getTenantDiscriminatorColumn(int index) {
- return this.tenantDiscriminatorColumnContainer.getContextElement(index);
- }
-
- public OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn() {
- return this.addTenantDiscriminatorColumn(this.getTenantDiscriminatorColumnsSize());
- }
-
- public OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn(int index) {
- XmlTenantDiscriminatorColumn xmlJoinColumn = this.buildXmlTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 joinColumn = this.tenantDiscriminatorColumnContainer.addContextElement(index, xmlJoinColumn);
- this.getXmlDefaultsForUpdate().getTenantDiscriminatorColumns().add(index, xmlJoinColumn);
- return joinColumn;
- }
-
- protected XmlTenantDiscriminatorColumn buildXmlTenantDiscriminatorColumn() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn();
- }
-
- public void removeTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeTenantDiscriminatorColumn(this.tenantDiscriminatorColumnContainer.indexOfContextElement(tenantDiscriminatorColumn));
- }
-
- public void removeTenantDiscriminatorColumn(int index) {
- this.tenantDiscriminatorColumnContainer.removeContextElement(index);
- this.getXmlDefaults().getTenantDiscriminatorColumns().remove(index);
- }
-
- public void moveTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.tenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- this.getXmlDefaults().getTenantDiscriminatorColumns().move(targetIndex, sourceIndex);
- }
-
-
- protected void syncTenantDiscriminatorColumns() {
- this.tenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getXmlTenantDiscriminatorColumns() {
- if (getXmlDefaults() == null) {
- return EmptyListIterable.instance();
- }
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTenantDiscriminatorColumn_2_3>(this.getXmlDefaults().getTenantDiscriminatorColumns());
- }
-
- /**
- * tenant discriminator column container
- */
- protected class TenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmTenantDiscriminatorColumn2_3 buildContextElement(XmlTenantDiscriminatorColumn_2_3 resourceElement) {
- return OrmEclipseLinkPersistenceUnitDefaults.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getResourceElements() {
- return OrmEclipseLinkPersistenceUnitDefaults.this.getXmlTenantDiscriminatorColumns();
- }
- @Override
- protected XmlTenantDiscriminatorColumn_2_3 getResourceElement(OrmTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getXmlColumn();
- }
- }
-
- protected OrmReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- protected OrmTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn) {
- return new EclipseLinkOrmTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, xmlTenantDiscriminatorColumn);
- }
-
- protected ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> buildTenantDiscriminatorColumnContainer() {
- TenantDiscriminatorColumnContainer container = new TenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
- // ********** OrmReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements OrmReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- /**
- * No default table name in the context of the persistence unit defaults
- */
- public String getDefaultTableName() {
- return null;
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- /**
- * No table in the context of the persistence unit defaults
- */
- public Table resolveDbTable(String tableName) {
- return null;
- }
-
- public Iterable<String> getCandidateTableNames() {
- return EmptyIterable.instance();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- /**
- * no column validation can be done in the context of the persistence unit defaults
- */
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return JptValidator.Null.instance();
- }
-
- public TextRange getValidationTextRange() {
- return OrmEclipseLinkPersistenceUnitDefaults.this.getValidationTextRange();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java
deleted file mode 100644
index c80019d987..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata;
-
-/**
- * <code>eclipselink orm.xml</code> file
- * <br>
- * <code>persistence-unit-metadata</code> element
- */
-public class OrmEclipseLinkPersistenceUnitMetadata
- extends AbstractOrmPersistenceUnitMetadata
-{
-
- public OrmEclipseLinkPersistenceUnitMetadata(EntityMappings parent) {
- super(parent);
- }
-
- @Override
- public EclipseLinkPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return (EclipseLinkPersistenceUnitDefaults) super.getPersistenceUnitDefaults();
- }
-
- @Override
- protected XmlPersistenceUnitMetadata buildXmlPersistenceUnitMetadata_() {
- return EmfTools.create(
- this.getResourceNodeFactory(),
- EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata(),
- XmlPersistenceUnitMetadata.class
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java
deleted file mode 100644
index 1088105f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.SpecifiedOrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkPersistentAttributeValidator;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> persistent attribute
- */
-public class OrmEclipseLinkPersistentAttribute
- extends SpecifiedOrmPersistentAttribute
-{
- public OrmEclipseLinkPersistentAttribute(OrmPersistentType parent, XmlAttributeMapping xmlMapping) {
- super(parent, xmlMapping);
- }
-
- // ********** validation **********
-
- @Override
- protected JptValidator buildAttibuteValidator() {
- return new EclipseLinkPersistentAttributeValidator(this, buildTextRangeResolver());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java
deleted file mode 100644
index 4b5d9640b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned;
-
-public class OrmEclipseLinkPrivateOwned
- extends AbstractOrmXmlContextNode
- implements EclipseLinkPrivateOwned
-{
- protected boolean privateOwned;
-
-
- public OrmEclipseLinkPrivateOwned(OrmAttributeMapping parent) {
- super(parent);
- this.privateOwned = this.buildPrivateOwned();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setPrivateOwned_(this.buildPrivateOwned());
- }
-
-
- // ********** private owned **********
-
- public boolean isPrivateOwned() {
- return this.privateOwned;
- }
-
- public void setPrivateOwned(boolean privateOwned) {
- this.setPrivateOwned_(privateOwned);
- this.getXmlPrivateOwned().setPrivateOwned(privateOwned);
- }
-
- protected void setPrivateOwned_(boolean privateOwned) {
- boolean old = this.privateOwned;
- this.privateOwned = privateOwned;
- this.firePropertyChanged(PRIVATE_OWNED_PROPERTY, old, privateOwned);
- }
-
- protected boolean buildPrivateOwned() {
- return this.getXmlPrivateOwned().isPrivateOwned();
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- protected OrmAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected XmlAttributeMapping getXmlAttributeMapping() {
- return this.getAttributeMapping().getXmlAttributeMapping();
- }
-
- protected XmlPrivateOwned getXmlPrivateOwned() {
- return (XmlPrivateOwned) this.getXmlAttributeMapping();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlPrivateOwned().getPrivateOwnedTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java
deleted file mode 100644
index 35ecc5d959..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly;
-
-public class OrmEclipseLinkReadOnly
- extends AbstractOrmXmlContextNode
- implements EclipseLinkReadOnly
-{
- protected Boolean specifiedReadOnly;
- protected boolean defaultReadOnly;
-
-
- public OrmEclipseLinkReadOnly(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- this.specifiedReadOnly = this.buildSpecifiedReadOnly();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedReadOnly_(this.buildSpecifiedReadOnly());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultReadOnly(this.buildDefaultReadOnly());
- }
-
-
- // ********** read-only **********
-
- public boolean isReadOnly() {
- return (this.specifiedReadOnly != null) ? this.specifiedReadOnly.booleanValue() : this.defaultReadOnly;
- }
-
- public Boolean getSpecifiedReadOnly() {
- return this.specifiedReadOnly;
- }
-
- public void setSpecifiedReadOnly(Boolean readOnly) {
- this.setSpecifiedReadOnly_(readOnly);
- this.getXmlReadOnly().setReadOnly(readOnly);
- }
-
- protected void setSpecifiedReadOnly_(Boolean readOnly) {
- Boolean old = this.specifiedReadOnly;
- this.specifiedReadOnly = readOnly;
- this.firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, old, readOnly);
- }
-
- protected Boolean buildSpecifiedReadOnly() {
- return this.getXmlReadOnly().getReadOnly();
- }
-
- public boolean isDefaultReadOnly() {
- return this.defaultReadOnly;
- }
-
- protected void setDefaultReadOnly(boolean readOnly) {
- boolean old = this.defaultReadOnly;
- this.defaultReadOnly = readOnly;
- this.firePropertyChanged(DEFAULT_READ_ONLY_PROPERTY, old, readOnly);
- }
-
- protected boolean buildDefaultReadOnly() {
- EclipseLinkReadOnly javaReadOnly = this.getJavaReadOnlyForDefaults();
- return (javaReadOnly != null) ? javaReadOnly.isReadOnly() : DEFAULT_READ_ONLY;
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (OrmEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected OrmEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- protected XmlReadOnly getXmlReadOnly() {
- return (XmlReadOnly) this.getXmlTypeMapping();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected EclipseLinkReadOnly getJavaReadOnlyForDefaults() {
- JavaEclipseLinkNonEmbeddableTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getReadOnly();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlReadOnly().getReadOnlyTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java
deleted file mode 100644
index ce5e3b9091..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-public class OrmEclipseLinkStructConverter
- extends OrmEclipseLinkConverterClassConverter<XmlStructConverter>
- implements EclipseLinkStructConverter
-{
- public OrmEclipseLinkStructConverter(XmlContextNode parent, XmlStructConverter xmlConverter) {
- super(parent, xmlConverter, xmlConverter.getConverter());
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getXmlConverterClass() {
- return this.xmlConverter.getConverter();
- }
-
- @Override
- protected void setXmlConverterClass(String converterClass) {
- this.xmlConverter.setConverter(converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkStructConverter> getType() {
- return EclipseLinkStructConverter.class;
- }
-
-
- // ********** refactoring **********
-
- @Override
- protected ReplaceEdit createRenameEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameEdit(originalType, newName);
- }
-
- @Override
- protected ReplaceEdit createRenamePackageEdit(String newName) {
- return this.xmlConverter.createRenamePackageEdit(newName);
- }
-
-
- // ********** validation **********
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER;
- }
-
- @Override
- protected TextRange getXmlConverterClassTextRange() {
- return this.xmlConverter.getConverterClassTextRange();
- }
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getConverterClass(), (((EclipseLinkStructConverter)eclipseLinkConverter).getConverterClass()));
- }
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkStructConverter> getConverterType() {
- return EclipseLinkStructConverter.class;
- }
-
- public XmlStructConverter getXmlConverter(XmlConverterHolder xmlConverterContainer) {
- return xmlConverterContainer.getStructConverter();
- }
-
- public OrmEclipseLinkStructConverter buildConverter(XmlNamedConverter xmlConverter, XmlContextNode parent) {
- return new OrmEclipseLinkStructConverter(parent, (XmlStructConverter) xmlConverter);
- }
-
- @Override
- protected XmlStructConverter buildXmlConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- }
-
- @Override
- public void setXmlConverter(XmlConverterHolder xmlConverterContainer, XmlNamedConverter xmlConverter) {
- xmlConverterContainer.setStructConverter((XmlStructConverter) xmlConverter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java
deleted file mode 100644
index de3ed85c22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
-
-public class OrmEclipseLinkTransformationMapping
- extends AbstractOrmAttributeMapping<XmlTransformation>
- implements EclipseLinkTransformationMapping
-{
- public OrmEclipseLinkTransformationMapping(OrmPersistentAttribute parent, XmlTransformation xmlMapping) {
- super(parent, xmlMapping);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 85;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getTransformations().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getTransformations().remove(this.xmlAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java
deleted file mode 100644
index aec93cdb79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
-
-public class OrmEclipseLinkTransformationMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkTransformationMappingDefinition INSTANCE =
- new OrmEclipseLinkTransformationMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkTransformationMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTransformation(),
- XmlTransformation.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkTransformationMapping(parent, (XmlTransformation) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java
deleted file mode 100644
index d55d9269de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-public class OrmEclipseLinkTypeConverter
- extends OrmEclipseLinkConverter<XmlTypeConverter>
- implements EclipseLinkTypeConverter
-{
- private String dataType;
-
- private String objectType;
-
-
- public OrmEclipseLinkTypeConverter(XmlContextNode parent, XmlTypeConverter xmlConverter) {
- super(parent, xmlConverter);
- this.dataType = xmlConverter.getDataType();
- this.objectType = xmlConverter.getObjectType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.xmlConverter.getDataType());
- this.setObjectType_(this.xmlConverter.getObjectType());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.setDataType_(dataType);
- this.xmlConverter.setDataType(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
- protected boolean dataTypeIsFor(String typeName) {
- return this.typeIsFor(this.getDataTypeJavaResourceType(), typeName);
- }
-
- protected boolean dataTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getDataTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getDataTypeJavaResourceType() {
- return this.getMappingFileRoot().resolveJavaResourceType(this.dataType);
- }
-
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.setObjectType_(objectType);
- this.xmlConverter.setObjectType(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- protected boolean objectTypeIsFor(String typeName) {
- return this.typeIsFor(this.getObjectTypeJavaResourceType(), typeName);
- }
-
- protected boolean objectTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getObjectTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getObjectTypeJavaResourceType() {
- return this.getMappingFileRoot().resolveJavaResourceType(this.objectType);
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypeEdits(originalType, newName),
- this.createRenameObjectTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypeEdits(IType originalType, String newName) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameDataTypeEdit(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypeEdits(IType originalType, String newName) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameObjectTypeEdit(originalType, newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createMoveDataTypeEdits(originalType, newPackage),
- this.createMoveObjectTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveDataTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameDataTypePackageEdit(newName);
- }
-
- protected Iterable<ReplaceEdit> createMoveObjectTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameObjectTypePackageEdit(newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypePackageEdits(originalPackage, newName),
- this.createRenameObjectTypePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.dataTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.objectTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkTypeConverter> getType() {
- return EclipseLinkTypeConverter.class;
- }
-
- protected boolean typeIsFor(JavaResourceAbstractType type, String typeName) {
- return (type != null) && type.getQualifiedName().equals(typeName);
- }
-
- protected boolean typeIsIn(JavaResourceAbstractType type, IPackageFragment packageFragment) {
- return (type != null) && type.isIn(packageFragment);
- }
-
- // ********** validation *********
-
- @Override
- public boolean isIdentical(EclipseLinkConverter eclipseLinkConverter) {
- return super.isIdentical(eclipseLinkConverter) &&
- StringTools.stringsAreEqual(this.getDataType(), (((EclipseLinkTypeConverter)eclipseLinkConverter).getDataType())) &&
- StringTools.stringsAreEqual(this.getObjectType(), ((EclipseLinkTypeConverter)eclipseLinkConverter).getObjectType());
- }
-
- // ********** adapter **********
-
- public static class Adapter
- extends AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<EclipseLinkTypeConverter> getConverterType() {
- return EclipseLinkTypeConverter.class;
- }
-
- public XmlTypeConverter getXmlConverter(XmlConverterHolder xmlConverterContainer) {
- return xmlConverterContainer.getTypeConverter();
- }
-
- public OrmEclipseLinkTypeConverter buildConverter(XmlNamedConverter xmlConverter, XmlContextNode parent) {
- return new OrmEclipseLinkTypeConverter(parent, (XmlTypeConverter) xmlConverter);
- }
-
- @Override
- protected XmlTypeConverter buildXmlConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- }
-
- @Override
- public void setXmlConverter(XmlConverterHolder xmlConverterContainer, XmlNamedConverter xmlConverter) {
- xmlConverterContainer.setTypeConverter((XmlTypeConverter) xmlConverter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index 0e7351cfca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne;
-
-public class OrmEclipseLinkVariableOneToOneMapping
- extends AbstractOrmAttributeMapping<XmlVariableOneToOne>
- implements EclipseLinkVariableOneToOneMapping
-{
- public OrmEclipseLinkVariableOneToOneMapping(OrmPersistentAttribute parent, XmlVariableOneToOne xmlMapping) {
- super(parent, xmlMapping);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 65;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getVariableOneToOnes().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getVariableOneToOnes().remove(this.xmlAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java
deleted file mode 100644
index 308eb723ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne;
-
-public class OrmEclipseLinkVariableOneToOneMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkVariableOneToOneMappingDefinition INSTANCE =
- new OrmEclipseLinkVariableOneToOneMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkVariableOneToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlVariableOneToOne(),
- XmlVariableOneToOne.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkVariableOneToOneMapping(parent, (XmlVariableOneToOne) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java
deleted file mode 100644
index 77a0ec3dd6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkVersionMapping
- extends AbstractOrmVersionMapping<XmlVersion>
- implements EclipseLinkVersionMapping
-{
- protected final OrmEclipseLinkMutable mutable;
-
-
- public OrmEclipseLinkVersionMapping(OrmPersistentAttribute parent, XmlVersion xmlMapping) {
- super(parent, xmlMapping);
- this.mutable = new OrmEclipseLinkMutable(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(OrmEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO mutable validation
- }
-
- @Override
- protected void validateAttributeType(List<IMessage> messages) {
- if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getPersistentAttribute().getTypeName())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE,
- new String[] {this.getName()},
- this,
- this.getNameTextRange()
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 307c355616..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceXmlContextNodeFactory;
-
-
-public class EclipseLink2_0PersistenceXmlContextNodeFactory
- extends AbstractPersistenceXmlContextNodeFactory
- implements EclipseLinkPersistenceXmlContextNodeFactory
-{
-
- @Override
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- return new EclipseLinkPersistenceUnit(parent, xmlPersistenceUnit);
- }
-
- @Override
- public JarFileRef buildJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- return new EclipseLinkJarFileRef(parent, xmlJarFileRef);
- }
-
- public JpaConnection2_0 buildConnection(PersistenceUnit parent) {
- return new EclipseLinkConnection2_0((PersistenceUnit2_0) parent);
- }
-
- public JpaOptions2_0 buildOptions(PersistenceUnit parent) {
- return new EclipseLinkOptions2_0((PersistenceUnit2_0) parent);
- }
-
- public PersistenceUnitProperties buildLogging(PersistenceUnit parent) {
- return new EclipseLinkLogging2_0((PersistenceUnit2_0) parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java
deleted file mode 100644
index 1b37aec558..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.resource.persistence.v2_0.PersistenceV2_0Factory;
-
-public class EclipseLink2_0PersistenceXmlDefinition
- extends AbstractPersistenceXmlDefinition
-{
- // singleton
- private static final PersistenceXmlDefinition INSTANCE = new EclipseLink2_0PersistenceXmlDefinition();
-
- /**
- * Return the singleton
- */
- public static PersistenceXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_0PersistenceXmlDefinition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
-
- public EFactory getResourceNodeFactory() {
- return PersistenceV2_0Factory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLink2_0PersistenceXmlContextNodeFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java
deleted file mode 100644
index bf63d03e17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.FlushClearCache;
-
-/**
- * EclipseLinkCaching encapsulates EclipseLink Caching properties.
- */
-public class EclipseLinkCaching extends EclipseLinkPersistenceUnitProperties
- implements Caching
-{
- // ********** EclipseLink properties **********
- private CacheType cacheTypeDefault;
- private Integer cacheSizeDefault;
- private Boolean sharedCacheDefault;
- private FlushClearCache flushClearCache;
-
- private List<CachingEntity> entities;
-
- // ********** constructors **********
- public EclipseLinkCaching(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.entities = new ArrayList<CachingEntity>();
- this.cacheTypeDefault =
- this.getEnumValue(ECLIPSELINK_CACHE_TYPE_DEFAULT, CacheType.values());
- this.cacheSizeDefault =
- this.getIntegerValue(ECLIPSELINK_CACHE_SIZE_DEFAULT);
- this.sharedCacheDefault =
- this.getBooleanValue(ECLIPSELINK_CACHE_SHARED_DEFAULT);
- this.flushClearCache =
- this.getEnumValue(ECLIPSELINK_FLUSH_CLEAR_CACHE, FlushClearCache.values());
-
- Set<PersistenceUnit.Property> cacheTypeProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_CACHE_TYPE);
- Set<PersistenceUnit.Property> cacheSizeProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_CACHE_SIZE);
- Set<PersistenceUnit.Property> sharedCacheProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_SHARED_CACHE);
-
- this.initializeEntitiesCacheType(cacheTypeProperties);
- this.initializeEntitiesCacheSize(cacheSizeProperties);
- this.initializeEntitiesSharedCache(sharedCacheProperties);
- }
-
- private void initializeEntitiesCacheType(Set<PersistenceUnit.Property> cacheTypeProperties) {
- for (PersistenceUnit.Property cacheTypeProperty : cacheTypeProperties) {
- this.setEntityCacheTypeOf(cacheTypeProperty);
- }
- }
-
- private void initializeEntitiesCacheSize(Set<PersistenceUnit.Property> cacheSizeProperties) {
- for (PersistenceUnit.Property cacheSizeProperty : cacheSizeProperties) {
- this.setEntityCacheSizeOf(cacheSizeProperty);
- }
- }
-
- private void initializeEntitiesSharedCache(Set<PersistenceUnit.Property> sharedCacheProperties) {
- for (PersistenceUnit.Property sharedCacheProperty : sharedCacheProperties) {
- this.setEntitySharedCacheOf(sharedCacheProperty);
- }
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_CACHE_TYPE_DEFAULT)) {
- this.cacheTypeDefaultChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SIZE_DEFAULT)) {
- this.cacheSizeDefaultChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SHARED_DEFAULT)) {
- this.sharedCacheDefaultChanged(newValue);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_TYPE)) {
- this.cacheTypeChanged(propertyName, newValue);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_SIZE)) {
- this.cacheSizeChanged(propertyName, newValue);
- }
- else if (propertyName.startsWith(ECLIPSELINK_SHARED_CACHE)) {
- this.sharedCacheChanged(propertyName, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_FLUSH_CLEAR_CACHE)) {
- this.flushClearCacheChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_CACHE_TYPE_DEFAULT)) {
- this.cacheTypeDefaultChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SIZE_DEFAULT)) {
- this.cacheSizeDefaultChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SHARED_DEFAULT)) {
- this.sharedCacheDefaultChanged(null);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_TYPE)) {
- this.cacheTypeChanged(propertyName, null);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_SIZE)) {
- this.cacheSizeChanged(propertyName, null);
- }
- else if (propertyName.startsWith(ECLIPSELINK_SHARED_CACHE)) {
- this.sharedCacheChanged(propertyName, null);
- }
- else if (propertyName.equals(ECLIPSELINK_FLUSH_CLEAR_CACHE)) {
- this.flushClearCacheChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key;
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_CACHE_TYPE_DEFAULT,
- CACHE_TYPE_DEFAULT_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_SIZE_DEFAULT,
- CACHE_SIZE_DEFAULT_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_SHARED_DEFAULT,
- SHARED_CACHE_DEFAULT_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_FLUSH_CLEAR_CACHE,
- FLUSH_CLEAR_CACHE_PROPERTY);
-
- // Don't need to initialize propertyNames for:
- // cacheType, sharedCache, cacheSize
- }
-
- /**
- * Method used for identifying the given property.
- */
- @Override
- public boolean itemIsProperty(PersistenceUnit.Property item) {
- boolean isProperty = super.itemIsProperty(item);
-
- if ( ! isProperty && item.getName() != null) {
- if (item.getName().startsWith(ECLIPSELINK_CACHE_TYPE) ||
- item.getName().startsWith(ECLIPSELINK_CACHE_SIZE) ||
- item.getName().startsWith(ECLIPSELINK_SHARED_CACHE)) {
- return true;
- }
- }
- return isProperty;
- }
-
- /**
- * Returns the property name used for change notification of the given
- * property.
- */
- @Override
- public String propertyIdOf(PersistenceUnit.Property property) {
- try {
- return super.propertyIdOf(property);
- }
- catch (IllegalArgumentException e) {
- if (property.getName().startsWith(ECLIPSELINK_CACHE_TYPE)) {
- return CACHE_TYPE_PROPERTY;
- }
- else if (property.getName().startsWith(ECLIPSELINK_CACHE_SIZE)) {
- return CACHE_SIZE_PROPERTY;
- }
- else if (property.getName().startsWith(ECLIPSELINK_SHARED_CACHE)) {
- return SHARED_CACHE_PROPERTY;
- }
- }
- throw new IllegalArgumentException("Illegal property: " + property.toString()); //$NON-NLS-1$
- }
-
- public CachingEntity addEntity(String entityName) {
- if (this.entityExists(entityName)) {
- throw new IllegalStateException("Duplicate entity: " + entityName); //$NON-NLS-1$
- }
- CachingEntity newEntity = this.buildEntity(entityName);
- this.addItemToList(newEntity, this.entities, ENTITIES_LIST);
- return newEntity;
- }
-
- public void removeEntity(String entityName) {
- if ( ! this.entityExists(entityName)) {
- return;
- }
- CachingEntity entity = this.getEntityNamed(entityName);
- this.clearEntity(entity);
- this.removeEntity(entity);
- }
-
- // ********** CacheType **********
- public CacheType getCacheTypeOf(String entityName) {
- CachingEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getCacheType();
- }
-
- public void setCacheTypeOf(String entityName, CacheType newCacheType) {
- CachingEntity old = this.setEntityCacheTypeOf(entityName, newCacheType);
- this.putEnumValue(ECLIPSELINK_CACHE_TYPE, entityName, newCacheType, false);
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void cacheTypeChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CachingEntity old = this.setEntityCacheTypeOf(entityName, stringValue);
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public CacheType getDefaultCacheType() {
- return (this.cacheTypeDefault == null) ? DEFAULT_CACHE_TYPE : this.cacheTypeDefault;
- }
-
- // ********** CacheSize **********
- public Integer getCacheSizeOf(String entityName) {
- CachingEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getCacheSize();
- }
-
- public void setCacheSizeOf(String entityName, Integer newCacheSize) {
- CachingEntity old = this.setEntityCacheSizeOf(entityName, newCacheSize);
- this.putIntegerValue(ECLIPSELINK_CACHE_SIZE + entityName, newCacheSize);
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void cacheSizeChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CachingEntity old = this.setEntityCacheSizeOf(entityName, stringValue);
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public Integer getDefaultCacheSize() {
- return (this.cacheSizeDefault == null) ? DEFAULT_CACHE_SIZE : this.cacheSizeDefault;
- }
-
- // ********** SharedCache **********
- public Boolean getSharedCacheOf(String entityName) {
- CachingEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.cacheIsShared();
- }
-
- public void setSharedCacheOf(String entityName, Boolean newSharedCache) {
- CachingEntity old = this.setEntitySharedCacheOf(entityName, newSharedCache);
- this.putBooleanValue(ECLIPSELINK_SHARED_CACHE, entityName, newSharedCache, false);
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void sharedCacheChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CachingEntity old = this.setEntitySharedCacheOf(entityName, stringValue);
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public Boolean getDefaultSharedCache() {
- return (this.sharedCacheDefault == null) ? DEFAULT_SHARED_CACHE : this.sharedCacheDefault;
- }
-
- // ********** CacheTypeDefault **********
- public CacheType getCacheTypeDefault() {
- return this.cacheTypeDefault;
- }
-
- public void setCacheTypeDefault(CacheType newCacheTypeDefault) {
- CacheType old = this.cacheTypeDefault;
- this.cacheTypeDefault = newCacheTypeDefault;
- this.putProperty(CACHE_TYPE_DEFAULT_PROPERTY, newCacheTypeDefault);
- this.firePropertyChanged(CACHE_TYPE_DEFAULT_PROPERTY, old, newCacheTypeDefault);
- }
-
- private void cacheTypeDefaultChanged(String stringValue) {
- CacheType newValue = getEnumValueOf(stringValue, CacheType.values());
- CacheType old = this.cacheTypeDefault;
- this.cacheTypeDefault = newValue;
- this.firePropertyChanged(CACHE_TYPE_DEFAULT_PROPERTY, old, newValue);
- }
-
- public CacheType getDefaultCacheTypeDefault() {
- return DEFAULT_CACHE_TYPE_DEFAULT;
- }
-
- // ********** CacheSizeDefault **********
- public Integer getCacheSizeDefault() {
- return this.cacheSizeDefault;
- }
-
- public void setCacheSizeDefault(Integer newCacheSizeDefault) {
- Integer old = this.cacheSizeDefault;
- this.cacheSizeDefault = newCacheSizeDefault;
- this.putProperty(CACHE_SIZE_DEFAULT_PROPERTY, newCacheSizeDefault);
- this.firePropertyChanged(CACHE_SIZE_DEFAULT_PROPERTY, old, newCacheSizeDefault);
- }
-
- private void cacheSizeDefaultChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
- Integer old = this.cacheSizeDefault;
- this.cacheSizeDefault = newValue;
- this.firePropertyChanged(CACHE_SIZE_DEFAULT_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultCacheSizeDefault() {
- return DEFAULT_CACHE_SIZE_DEFAULT;
- }
-
- // ********** SharedCacheDefault **********
- public Boolean getSharedCacheDefault() {
- return this.sharedCacheDefault;
- }
-
- public void setSharedCacheDefault(Boolean newSharedCacheDefault) {
- Boolean old = this.sharedCacheDefault;
- this.sharedCacheDefault = newSharedCacheDefault;
- this.putProperty(SHARED_CACHE_DEFAULT_PROPERTY, newSharedCacheDefault);
- this.firePropertyChanged(SHARED_CACHE_DEFAULT_PROPERTY, old, newSharedCacheDefault);
- }
-
- private void sharedCacheDefaultChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.sharedCacheDefault;
- this.sharedCacheDefault = newValue;
- this.firePropertyChanged(SHARED_CACHE_DEFAULT_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultSharedCacheDefault() {
- return DEFAULT_SHARED_CACHE_DEFAULT;
- }
-
- // ********** FlushClearCache **********
-
- public FlushClearCache getFlushClearCache() {
- return this.flushClearCache;
- }
-
- public void setFlushClearCache(FlushClearCache newFlushClearCache) {
- FlushClearCache old = this.flushClearCache;
- this.flushClearCache = newFlushClearCache;
- this.putProperty(FLUSH_CLEAR_CACHE_PROPERTY, newFlushClearCache);
- this.firePropertyChanged(FLUSH_CLEAR_CACHE_PROPERTY, old, newFlushClearCache);
- }
-
- private void flushClearCacheChanged(String stringValue) {
- FlushClearCache newValue = getEnumValueOf(stringValue, FlushClearCache.values());
- FlushClearCache old = this.flushClearCache;
- this.flushClearCache = newValue;
- this.firePropertyChanged(FLUSH_CLEAR_CACHE_PROPERTY, old, newValue);
- }
-
- public FlushClearCache getDefaultFlushClearCache() {
- return DEFAULT_FLUSH_CLEAR_CACHE;
- }
-
- // ****** Entity CacheType *******
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheTypeOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(stringValue)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- CacheType newValue = getEnumValueOf(stringValue, CacheType.values());
- return this.setEntityCacheTypeOf(entityName, newValue);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheTypeOf(String entityName, CacheType cacheType) {
- CachingEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityCacheTypeOf(entity, cacheType);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheTypeOf(CachingEntity entity, CacheType cacheType) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CachingEntity old = entity.clone();
- entity.setCacheType(cacheType);
- return old;
- }
-
- private void setEntityCacheTypeOf(PersistenceUnit.Property cacheTypeProperty) {
- String entityName = this.extractEntityNameOf(cacheTypeProperty);
- this.setEntityCacheTypeOf(entityName, cacheTypeProperty.getValue());
- }
-
- // ****** Entity Cache size *******
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheSizeOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(stringValue)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- Integer newValue = getIntegerValueOf(stringValue);
- return this.setEntityCacheSizeOf(entityName, newValue);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheSizeOf(String entityName, Integer size) {
- CachingEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityCacheSizeOf(entity, size);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheSizeOf(CachingEntity entity, Integer size) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CachingEntity old = entity.clone();
- entity.setCacheSize(size);
- return old;
- }
-
- private void setEntityCacheSizeOf(PersistenceUnit.Property cacheSizeProperty) {
- String entityName = this.extractEntityNameOf(cacheSizeProperty);
- this.setEntityCacheSizeOf(entityName, cacheSizeProperty.getValue());
- }
-
- // ****** Entity SharedCache *******
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntitySharedCacheOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(stringValue)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- Boolean newValue = getBooleanValueOf(stringValue);
- return this.setEntitySharedCacheOf(entityName, newValue);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntitySharedCacheOf(String entityName, Boolean sharedCache) {
- CachingEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntitySharedCacheOf(entity, sharedCache);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntitySharedCacheOf(CachingEntity entity, Boolean sharedCache) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CachingEntity old = entity.clone();
- entity.setSharedCache(sharedCache);
- return old;
- }
-
- private void setEntitySharedCacheOf(PersistenceUnit.Property sharedCacheProperty) {
- String entityName = this.extractEntityNameOf(sharedCacheProperty);
- this.setEntitySharedCacheOf(entityName, sharedCacheProperty.getValue());
- }
-
- // ****** convenience methods *******
-
- /**
- * Set all Entity properties to default.
- */
- private void clearEntity(CachingEntity entity) {
- if(entity.isEmpty()) {
- return;
- }
- String entityName = entity.getName();
- this.setCacheTypeOf(entityName, null);
- this.setCacheSizeOf(entityName, null);
- this.setSharedCacheOf(entityName, null);
- }
-
- /**
- * Returns the Entity with the given name.
- */
- private CachingEntity getEntityNamed(String name) {
- for(CachingEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return entity;
- }
- }
- return null;
- }
-
- private CachingEntity buildEntity(String name) {
- return new CachingEntity(this, name);
- }
-
- private void removeEntity(CachingEntity entity) {
- if(entity == null) {
- throw new NullPointerException();
- }
- this.removeItemFromList(entity, this.entities, ENTITIES_LIST);
- }
-
- /**
- * Return whether the Entity exist.
- */
- public boolean entityExists(String name) {
- for(CachingEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Removes cacheTypeDefault, cacheSizeDefault, flushClearCache properties.
- */
- public void removeDefaultCachingProperties() {
- this.setCacheTypeDefault(null);
- this.setCacheSizeDefault(null);
- this.setFlushClearCache(null);
- }
-
- // ****** entities list *******
-
- public ListIterable<CachingEntity> getEntities() {
- return new LiveCloneListIterable<CachingEntity>(this.entities);
- }
-
- public Iterable<String> getEntityNames() {
- return new TransformationIterable<CachingEntity, String>(this.getEntities()) {
- @Override
- protected String transform(CachingEntity entity) {
- return entity.getName();
- }
- };
- }
-
- public int getEntitiesSize() {
- return this.entities.size();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java
deleted file mode 100644
index 9ab04c3bae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java
+++ /dev/null
@@ -1,676 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.BatchWriting;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.ExclusiveConnectionMode;
-
-/**
- * EclipseLinkConnection
- */
-public class EclipseLinkConnection extends EclipseLinkPersistenceUnitProperties
- implements Connection
-{
-
- // ********** EclipseLink properties **********
- private BatchWriting batchWriting;
- private Boolean nativeSql;
- private Boolean cacheStatements;
- private Integer cacheStatementsSize;
- protected String driver;
- protected String url;
- protected String user;
- protected String password;
- private Boolean bindParameters;
- private Boolean readConnectionsShared;
- private Integer readConnectionsMin;
- private Integer readConnectionsMax;
- private Integer writeConnectionsMin;
- private Integer writeConnectionsMax;
- private ExclusiveConnectionMode exclusiveConnectionMode;
- private Boolean lazyConnection;
-
-
- // ********** constructors **********
- public EclipseLinkConnection(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.initializeDatabaseConnectionProperties();
-
- this.batchWriting =
- this.getEnumValue(ECLIPSELINK_BATCH_WRITING, BatchWriting.values());
- this.nativeSql =
- this.getBooleanValue(ECLIPSELINK_NATIVE_SQL);
- this.cacheStatements =
- this.getBooleanValue(ECLIPSELINK_CACHE_STATEMENTS);
- this.cacheStatementsSize =
- this.getIntegerValue(ECLIPSELINK_CACHE_STATEMENTS_SIZE);
- this.bindParameters =
- this.getBooleanValue(ECLIPSELINK_BIND_PARAMETERS);
- this.readConnectionsShared =
- this.getBooleanValue(ECLIPSELINK_READ_CONNECTIONS_SHARED);
- this.readConnectionsMin =
- this.getIntegerValue(ECLIPSELINK_READ_CONNECTIONS_MIN);
- this.readConnectionsMax =
- this.getIntegerValue(ECLIPSELINK_READ_CONNECTIONS_MAX);
- this.writeConnectionsMin =
- this.getIntegerValue(ECLIPSELINK_WRITE_CONNECTIONS_MIN);
- this.writeConnectionsMax =
- this.getIntegerValue(ECLIPSELINK_WRITE_CONNECTIONS_MAX);
- this.exclusiveConnectionMode =
- this.getEnumValue(ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE, ExclusiveConnectionMode.values());
- this.lazyConnection =
- this.getBooleanValue(ECLIPSELINK_LAZY_CONNECTION);
- }
-
- protected void initializeDatabaseConnectionProperties() {
- this.driver =
- this.getStringValue(ECLIPSELINK_DRIVER);
- this.url =
- this.getStringValue(ECLIPSELINK_URL);
- this.user =
- this.getStringValue(ECLIPSELINK_USER);
- this.password =
- this.getStringValue(ECLIPSELINK_PASSWORD);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_NATIVE_SQL)) {
- this.nativeSqlChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_BATCH_WRITING)) {
- this.batchWritingChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS)) {
- this.cacheStatementsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DRIVER)) {
- this.driverChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_URL)) {
- this.urlChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_USER)) {
- this.userChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PASSWORD)) {
- this.passwordChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_BIND_PARAMETERS)) {
- this.bindParametersChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_SHARED)) {
- this.readConnectionsSharedChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS_SIZE)) {
- this.cacheStatementsSizeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MIN)) {
- readConnectionsMinChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MAX)) {
- readConnectionsMaxChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MIN)) {
- writeConnectionsMinChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MAX)) {
- writeConnectionsMaxChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE)) {
- this.exclusiveConnectionModeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_LAZY_CONNECTION)) {
- this.lazyConnectionChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_NATIVE_SQL)) {
- this.nativeSqlChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_BATCH_WRITING)) {
- this.batchWritingChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS)) {
- this.cacheStatementsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_DRIVER)) {
- this.driverChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_URL)) {
- this.urlChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_USER)) {
- this.userChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_PASSWORD)) {
- this.passwordChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_BIND_PARAMETERS)) {
- this.bindParametersChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_SHARED)) {
- this.readConnectionsSharedChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS_SIZE)) {
- this.cacheStatementsSizeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MIN)) {
- readConnectionsMinChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MAX)) {
- readConnectionsMaxChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MIN)) {
- writeConnectionsMinChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MAX)) {
- writeConnectionsMaxChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE)) {
- this.exclusiveConnectionModeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_LAZY_CONNECTION)) {
- this.lazyConnectionChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- this.addDatabaseConnectionPropertyNames(propertyNames);
-
- propertyNames.put(
- ECLIPSELINK_NATIVE_SQL,
- NATIVE_SQL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_BATCH_WRITING,
- BATCH_WRITING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_STATEMENTS,
- CACHE_STATEMENTS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_STATEMENTS_SIZE,
- CACHE_STATEMENTS_SIZE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_BIND_PARAMETERS,
- BIND_PARAMETERS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_READ_CONNECTIONS_SHARED,
- READ_CONNECTIONS_SHARED_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_READ_CONNECTIONS_MIN,
- READ_CONNECTIONS_MIN_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_READ_CONNECTIONS_MAX,
- READ_CONNECTIONS_MAX_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WRITE_CONNECTIONS_MIN,
- WRITE_CONNECTIONS_MIN_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WRITE_CONNECTIONS_MAX,
- WRITE_CONNECTIONS_MAX_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE,
- EXCLUSIVE_CONNECTION_MODE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_LAZY_CONNECTION,
- LAZY_CONNECTION_PROPERTY);
- }
-
- protected void addDatabaseConnectionPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_DRIVER,
- DRIVER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_URL,
- URL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_USER,
- USER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PASSWORD,
- PASSWORD_PROPERTY);
- }
-
- /**
- * Does all pre-treatment in this method before the property is set
- */
- protected void preSetProperty() {
- // do nothing by default
- }
-
- // ********** NativeSql **********
- public Boolean getNativeSql() {
- return this.nativeSql;
- }
-
- public void setNativeSql(Boolean newNativeSql) {
- this.preSetProperty();
-
- Boolean old = this.nativeSql;
- this.nativeSql = newNativeSql;
- this.putProperty(NATIVE_SQL_PROPERTY, newNativeSql);
- this.firePropertyChanged(NATIVE_SQL_PROPERTY, old, newNativeSql);
- }
-
- private void nativeSqlChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.nativeSql;
- this.nativeSql = newValue;
- this.firePropertyChanged(NATIVE_SQL_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultNativeSql() {
- return DEFAULT_NATIVE_SQL;
- }
-
- // ********** BatchWriting **********
-
- public BatchWriting getBatchWriting() {
- return this.batchWriting;
- }
-
- public void setBatchWriting(BatchWriting newBatchWriting) {
- this.preSetProperty();
-
- BatchWriting old = this.batchWriting;
- this.batchWriting = newBatchWriting;
- this.putProperty(BATCH_WRITING_PROPERTY, newBatchWriting);
- this.firePropertyChanged(BATCH_WRITING_PROPERTY, old, newBatchWriting);
- }
-
- private void batchWritingChanged(String stringValue) {
- BatchWriting newValue = getEnumValueOf(stringValue, BatchWriting.values());
- BatchWriting old = this.batchWriting;
- this.batchWriting = newValue;
- this.firePropertyChanged(BATCH_WRITING_PROPERTY, old, newValue);
- }
-
- public BatchWriting getDefaultBatchWriting() {
- return DEFAULT_BATCH_WRITING;
- }
-
- // ********** CacheStatements **********
- public Boolean getCacheStatements() {
- return this.cacheStatements;
- }
-
- public void setCacheStatements(Boolean newCacheStatements) {
- this.preSetProperty();
-
- Boolean old = this.cacheStatements;
- this.cacheStatements = newCacheStatements;
- this.putProperty(CACHE_STATEMENTS_PROPERTY, newCacheStatements);
- this.firePropertyChanged(CACHE_STATEMENTS_PROPERTY, old, newCacheStatements);
- }
-
- private void cacheStatementsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.cacheStatements;
- this.cacheStatements = newValue;
- this.firePropertyChanged(CACHE_STATEMENTS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultCacheStatements() {
- return DEFAULT_CACHE_STATEMENTS;
- }
-
- // ********** CacheStatementsSize **********
- public Integer getCacheStatementsSize() {
- return this.cacheStatementsSize;
- }
-
- public void setCacheStatementsSize(Integer newCacheStatementsSize) {
- this.preSetProperty();
-
- Integer old = this.cacheStatementsSize;
- this.cacheStatementsSize = newCacheStatementsSize;
- this.putProperty(CACHE_STATEMENTS_SIZE_PROPERTY, newCacheStatementsSize);
- this.firePropertyChanged(CACHE_STATEMENTS_SIZE_PROPERTY, old, newCacheStatementsSize);
- }
-
- private void cacheStatementsSizeChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.cacheStatementsSize;
- this.cacheStatementsSize = newValue;
- this.firePropertyChanged(CACHE_STATEMENTS_SIZE_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultCacheStatementsSize() {
- return DEFAULT_CACHE_STATEMENTS_SIZE;
- }
-
- // ********** Driver **********
- public String getDriver() {
- return this.driver;
- }
-
- public void setDriver(String newDriver) {
- this.preSetProperty();
-
- String old = this.driver;
- this.driver = newDriver;
- this.putProperty(DRIVER_PROPERTY, newDriver);
- this.firePropertyChanged(DRIVER_PROPERTY, old, newDriver);
- }
-
- protected void driverChanged(String newValue) {
- String old = this.driver;
- this.driver = newValue;
- this.firePropertyChanged(DRIVER_PROPERTY, old, newValue);
- }
-
- public String getDefaultDriver() {
- return DEFAULT_DRIVER;
- }
-
- // ********** URL **********
- public String getUrl() {
- return this.url;
- }
-
- public void setUrl(String newUrl) {
- this.preSetProperty();
-
- String old = this.url;
- this.url = newUrl;
- this.putProperty(URL_PROPERTY, newUrl);
- this.firePropertyChanged(URL_PROPERTY, old, newUrl);
- }
-
- protected void urlChanged(String newValue) {
- String old = this.url;
- this.url = newValue;
- this.firePropertyChanged(URL_PROPERTY, old, newValue);
- }
-
- public String getDefaultUrl() {
- return DEFAULT_URL;
- }
-
- // ********** User **********
- public String getUser() {
- return this.user;
- }
-
- public void setUser(String newUser) {
- this.preSetProperty();
-
- String old = this.user;
- this.user = newUser;
- this.putProperty(USER_PROPERTY, newUser);
- this.firePropertyChanged(USER_PROPERTY, old, newUser);
- }
-
- protected void userChanged(String newValue) {
- String old = this.user;
- this.user = newValue;
- this.firePropertyChanged(USER_PROPERTY, old, newValue);
- }
-
- public String getDefaultUser() {
- return DEFAULT_USER;
- }
-
- // ********** Password **********
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String newPassword) {
- this.preSetProperty();
-
- String old = this.password;
- this.password = newPassword;
- this.putProperty(PASSWORD_PROPERTY, newPassword);
- this.firePropertyChanged(PASSWORD_PROPERTY, old, newPassword);
- }
-
- protected void passwordChanged(String newValue) {
- String old = this.password;
- this.password = newValue;
- this.firePropertyChanged(PASSWORD_PROPERTY, old, newValue);
- }
-
- public String getDefaultPassword() {
- return DEFAULT_PASSWORD;
- }
-
- // ********** BindParameters **********
- public Boolean getBindParameters() {
- return this.bindParameters;
- }
-
- public void setBindParameters(Boolean newBindParameters) {
- this.preSetProperty();
-
- Boolean old = this.bindParameters;
- this.bindParameters = newBindParameters;
- this.putProperty(BIND_PARAMETERS_PROPERTY, newBindParameters);
- this.firePropertyChanged(BIND_PARAMETERS_PROPERTY, old, newBindParameters);
- }
-
- private void bindParametersChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.bindParameters;
- this.bindParameters = newValue;
- this.firePropertyChanged(BIND_PARAMETERS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultBindParameters() {
- return DEFAULT_BIND_PARAMETERS;
- }
-
- // ********** ReadConnectionsShared **********
- public Boolean getReadConnectionsShared() {
- return this.readConnectionsShared;
- }
-
- public void setReadConnectionsShared(Boolean newReadConnectionsShared) {
- this.preSetProperty();
-
- Boolean old = this.readConnectionsShared;
- this.readConnectionsShared = newReadConnectionsShared;
- this.putProperty(READ_CONNECTIONS_SHARED_PROPERTY, newReadConnectionsShared);
- this.firePropertyChanged(READ_CONNECTIONS_SHARED_PROPERTY, old, newReadConnectionsShared);
- }
-
- private void readConnectionsSharedChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.readConnectionsShared;
- this.readConnectionsShared = newValue;
- this.firePropertyChanged(READ_CONNECTIONS_SHARED_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultReadConnectionsShared() {
- return DEFAULT_READ_CONNECTIONS_SHARED;
- }
-
- // ********** ReadConnectionsMin **********
- public Integer getReadConnectionsMin() {
- return this.readConnectionsMin;
- }
-
- public void setReadConnectionsMin(Integer newReadConnectionsMin) {
- this.preSetProperty();
-
- Integer old = this.readConnectionsMin;
- this.readConnectionsMin = newReadConnectionsMin;
- this.putProperty(READ_CONNECTIONS_MIN_PROPERTY, newReadConnectionsMin);
- this.firePropertyChanged(READ_CONNECTIONS_MIN_PROPERTY, old, newReadConnectionsMin);
- }
-
- private void readConnectionsMinChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.readConnectionsMin;
- this.readConnectionsMin = newValue;
- this.firePropertyChanged(READ_CONNECTIONS_MIN_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultReadConnectionsMin() {
- return DEFAULT_READ_CONNECTIONS_MIN;
- }
-
- // ********** ReadConnectionsMax **********
- public Integer getReadConnectionsMax() {
- return this.readConnectionsMax;
- }
-
- public void setReadConnectionsMax(Integer newReadConnectionsMax) {
- this.preSetProperty();
-
- Integer old = this.readConnectionsMax;
- this.readConnectionsMax = newReadConnectionsMax;
- this.putProperty(READ_CONNECTIONS_MAX_PROPERTY, newReadConnectionsMax);
- this.firePropertyChanged(READ_CONNECTIONS_MAX_PROPERTY, old, newReadConnectionsMax);
- }
-
- private void readConnectionsMaxChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.readConnectionsMax;
- this.readConnectionsMax = newValue;
- this.firePropertyChanged(READ_CONNECTIONS_MAX_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultReadConnectionsMax() {
- return DEFAULT_READ_CONNECTIONS_MAX;
- }
-
- // ********** WriteConnectionsMin **********
- public Integer getWriteConnectionsMin() {
- return this.writeConnectionsMin;
- }
-
- public void setWriteConnectionsMin(Integer newWriteConnectionsMin) {
- this.preSetProperty();
-
- Integer old = this.writeConnectionsMin;
- this.writeConnectionsMin = newWriteConnectionsMin;
- this.putProperty(WRITE_CONNECTIONS_MIN_PROPERTY, newWriteConnectionsMin);
- this.firePropertyChanged(WRITE_CONNECTIONS_MIN_PROPERTY, old, newWriteConnectionsMin);
- }
-
- private void writeConnectionsMinChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.writeConnectionsMin;
- this.writeConnectionsMin = newValue;
- this.firePropertyChanged(WRITE_CONNECTIONS_MIN_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultWriteConnectionsMin() {
- return DEFAULT_WRITE_CONNECTIONS_MIN;
- }
-
- // ********** WriteConnectionsMax **********
- public Integer getWriteConnectionsMax() {
- return this.writeConnectionsMax;
- }
-
- public void setWriteConnectionsMax(Integer newWriteConnectionsMax) {
- this.preSetProperty();
-
- Integer old = this.writeConnectionsMax;
- this.writeConnectionsMax = newWriteConnectionsMax;
- this.putProperty(WRITE_CONNECTIONS_MAX_PROPERTY, newWriteConnectionsMax);
- this.firePropertyChanged(WRITE_CONNECTIONS_MAX_PROPERTY, old, newWriteConnectionsMax);
- }
-
- private void writeConnectionsMaxChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.writeConnectionsMax;
- this.writeConnectionsMax = newValue;
- this.firePropertyChanged(WRITE_CONNECTIONS_MAX_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultWriteConnectionsMax() {
- return DEFAULT_WRITE_CONNECTIONS_MAX;
- }
-
- // ********** ExclusiveConnectionMode **********
-
- public ExclusiveConnectionMode getExclusiveConnectionMode() {
- return this.exclusiveConnectionMode;
- }
-
- public void setExclusiveConnectionMode(ExclusiveConnectionMode newExclusiveConnectionMode) {
- this.preSetProperty();
-
- ExclusiveConnectionMode old = this.exclusiveConnectionMode;
- this.exclusiveConnectionMode = newExclusiveConnectionMode;
- this.putProperty(EXCLUSIVE_CONNECTION_MODE_PROPERTY, newExclusiveConnectionMode);
- this.firePropertyChanged(EXCLUSIVE_CONNECTION_MODE_PROPERTY, old, newExclusiveConnectionMode);
- }
-
- private void exclusiveConnectionModeChanged(String stringValue) {
- ExclusiveConnectionMode newValue = getEnumValueOf(stringValue, ExclusiveConnectionMode.values());
- ExclusiveConnectionMode old = this.exclusiveConnectionMode;
- this.exclusiveConnectionMode = newValue;
- this.firePropertyChanged(EXCLUSIVE_CONNECTION_MODE_PROPERTY, old, newValue);
- }
-
- public ExclusiveConnectionMode getDefaultExclusiveConnectionMode() {
- return DEFAULT_EXCLUSIVE_CONNECTION_MODE;
- }
-
- // ********** LazyConnection **********
- public Boolean getLazyConnection() {
- return this.lazyConnection;
- }
-
- public void setLazyConnection(Boolean newLazyConnection) {
- this.preSetProperty();
-
- Boolean old = this.lazyConnection;
- this.lazyConnection = newLazyConnection;
- this.putProperty(LAZY_CONNECTION_PROPERTY, newLazyConnection);
- this.firePropertyChanged(LAZY_CONNECTION_PROPERTY, old, newLazyConnection);
- }
-
- private void lazyConnectionChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.lazyConnection;
- this.lazyConnection = newValue;
- this.firePropertyChanged(LAZY_CONNECTION_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultLazyConnection() {
- return DEFAULT_LAZY_CONNECTION;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java
deleted file mode 100644
index 50e6aa126d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection2_0;
-
-
-/**
- * EclipseLinkConnection2_0
- */
-public class EclipseLinkConnection2_0 extends EclipseLinkConnection
- implements Connection2_0
-{
-
- // ********** constructors **********
- public EclipseLinkConnection2_0(PersistenceUnit2_0 parent) {
- super(parent);
- }
-
- // ********** initialization **********
- @Override
- protected void initializeDatabaseConnectionProperties() {
- this.driver =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_DRIVER);
- this.url =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_URL);
- this.user =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_USER);
- this.password =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD);
- }
-
- @Override
- protected void postInitialize() {
- super.postInitialize();
-
- // Initialize Properties from legacy properties names if not initialized.
- if(this.persistenceUnitKeyExists(ECLIPSELINK_DRIVER)) {
- if(this.driver == null) {
- this.driver = this.getStringValue(ECLIPSELINK_DRIVER);
- }
- }
- if(this.persistenceUnitKeyExists(ECLIPSELINK_URL)) {
- if(this.url == null) {
- this.url = this.getStringValue(ECLIPSELINK_URL);
- }
- }
- if(this.persistenceUnitKeyExists(ECLIPSELINK_USER)) {
- if(this.user == null) {
- this.user = this.getStringValue(ECLIPSELINK_USER);
- }
- }
- if(this.persistenceUnitKeyExists(ECLIPSELINK_PASSWORD)) {
- if(this.password == null) {
- this.password = this.getStringValue(ECLIPSELINK_PASSWORD);
- }
- }
- }
-
- // ********** behavior **********
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
-
- if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_DRIVER)) {
- this.driverChanged(newValue);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_URL)) {
- this.urlChanged(newValue);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_USER)) {
- this.userChanged(newValue);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD)) {
- this.passwordChanged(newValue);
- }
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
-
- if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_DRIVER)) {
- this.driverChanged(null);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_URL)) {
- this.urlChanged(null);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_USER)) {
- this.userChanged(null);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD)) {
- this.passwordChanged(null);
- }
- }
-
- @Override
- protected void addDatabaseConnectionPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_DRIVER,
- Connection.DRIVER_PROPERTY);
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_URL,
- Connection.URL_PROPERTY);
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_USER,
- Connection.USER_PROPERTY);
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD,
- Connection.PASSWORD_PROPERTY);
- }
-
- /**
- * Migrate properties names to EclipseLink 2.0 names.
- */
- private void migrateProperties() {
- this.migrateStringProperty(ECLIPSELINK_DRIVER, JpaConnection2_0.PERSISTENCE_JDBC_DRIVER, this.driver);
- this.migrateStringProperty(ECLIPSELINK_URL, JpaConnection2_0.PERSISTENCE_JDBC_URL, this.url);
- this.migrateStringProperty(ECLIPSELINK_USER, JpaConnection2_0.PERSISTENCE_JDBC_USER, this.user);
- this.migrateStringProperty(ECLIPSELINK_PASSWORD, JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD, this.password);
- }
-
- private void migrateStringProperty(String oldKey, String newKey, String value) {
- if(this.persistenceUnitKeyExists(oldKey)) {
- this.getPersistenceUnit().removeProperty(oldKey);
- this.getPersistenceUnit().setProperty(newKey, value);
- }
- }
-
- /**
- * Migrate all properties names before the property is set
- */
- @Override
- protected void preSetProperty() {
-
- this.migrateProperties();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java
deleted file mode 100644
index 3d5af04ef5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java
+++ /dev/null
@@ -1,870 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Profiler;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Weaving;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLinkCustomization
- */
-public class EclipseLinkCustomization extends EclipseLinkPersistenceUnitProperties
- implements Customization
-{
- // ********** EclipseLink properties **********
- private Boolean throwExceptions;
- private Weaving weaving;
- private Boolean weavingLazy;
- private Boolean weavingChangeTracking;
- private Boolean weavingFetchGroups;
- private Boolean weavingInternal;
- private Boolean weavingEager;
- private Boolean validationOnly;
- private Boolean validateSchema;
- private List<String> sessionCustomizers;
- private String profiler; // storing EclipseLinkStringValue since value can be Profiler or custom class
- private String exceptionHandler;
-
- private List<CustomizationEntity> entities;
-
- // ********** constructors **********
- public EclipseLinkCustomization(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.entities = new ArrayList<CustomizationEntity>();
-
- this.throwExceptions =
- this.getBooleanValue(ECLIPSELINK_THROW_EXCEPTIONS);
- this.weaving =
- this.getEnumValue(ECLIPSELINK_WEAVING, Weaving.values());
- this.weavingLazy =
- this.getBooleanValue(ECLIPSELINK_WEAVING_LAZY);
- this.weavingChangeTracking =
- this.getBooleanValue(ECLIPSELINK_WEAVING_CHANGE_TRACKING);
- this.weavingFetchGroups =
- this.getBooleanValue(ECLIPSELINK_WEAVING_FETCH_GROUPS);
- this.weavingInternal =
- this.getBooleanValue(ECLIPSELINK_WEAVING_INTERNAL);
- this.weavingEager =
- this.getBooleanValue(ECLIPSELINK_WEAVING_EAGER);
- this.validationOnly =
- this.getBooleanValue(ECLIPSELINK_VALIDATION_ONLY);
- this.validateSchema =
- this.getBooleanValue(ECLIPSELINK_VALIDATE_SCHEMA);
- this.initializeSessionCustomizersFromPersistenceUnit();
-
- Set<PersistenceUnit.Property> properties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER);
- this.initializeEntitiesCustomizerClass(properties);
-
- this.profiler = this.getProfilerPropertyValue();
- this.exceptionHandler =
- this.getStringValue(ECLIPSELINK_EXCEPTION_HANDLER);
- }
-
- private void initializeSessionCustomizersFromPersistenceUnit() {
- this.sessionCustomizers = this.buildSessionCustomizers();
- }
-
- private List<String> buildSessionCustomizers() {
- return CollectionTools.list(this.convertToValues(this.getPropertiesSetWithPrefix(ECLIPSELINK_SESSION_CUSTOMIZER)));
- }
-
- private Iterable<String> convertToValues(Iterable<PersistenceUnit.Property> properties) {
- return new TransformationIterable<PersistenceUnit.Property, String>(properties) {
- @Override
- protected String transform(PersistenceUnit.Property property) {
- return property.getValue();
- }
- };
- }
-
- private void initializeEntitiesCustomizerClass(Set<PersistenceUnit.Property> descriptorCustomizerProperties) {
- for (PersistenceUnit.Property descriptorCustomizerProperty : descriptorCustomizerProperties) {
- this.setEntityDescriptorCustomizerOf(descriptorCustomizerProperty);
- }
- }
-
- /**
- * Gets the Profiler property from the persistence unit.
- */
- private String getProfilerPropertyValue() {
-
- String value = this.getStringValue(ECLIPSELINK_PROFILER);
- if (value == null) {
- return null; // no property found
- }
- Profiler standardProfiler = this.getEnumValue(ECLIPSELINK_PROFILER, Profiler.values());
- return (standardProfiler == null) ? value : getPropertyStringValueOf(standardProfiler);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_THROW_EXCEPTIONS)) {
- this.throwExceptionsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING)) {
- this.weavingChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_LAZY)) {
- this.weavingLazyChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_CHANGE_TRACKING)) {
- this.weavingChangeTrackingChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_FETCH_GROUPS)) {
- this.weavingFetchGroupsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_INTERNAL)) {
- this.weavingInternalChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_EAGER)) {
- this.weavingEagerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATION_ONLY)) {
- this.validationOnlyChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATE_SCHEMA)) {
- this.validateSchemaChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- this.sessionCustomizersChanged();
- }
- else if (propertyName.startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- this.descriptorCustomizerChanged(propertyName, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PROFILER)) {
- this.profilerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTION_HANDLER)) {
- this.exceptionHandlerChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_THROW_EXCEPTIONS)) {
- this.throwExceptionsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING)) {
- this.weavingChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_LAZY)) {
- this.weavingLazyChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_CHANGE_TRACKING)) {
- this.weavingChangeTrackingChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_FETCH_GROUPS)) {
- this.weavingFetchGroupsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_INTERNAL)) {
- this.weavingInternalChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_EAGER)) {
- this.weavingEagerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATION_ONLY)) {
- this.validationOnlyChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATE_SCHEMA)) {
- this.validateSchemaChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- this.sessionCustomizersChanged();
- }
- else if (propertyName.startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- this.descriptorCustomizerChanged(propertyName, null);
- }
- else if (propertyName.equals(ECLIPSELINK_PROFILER)) {
- this.profilerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTION_HANDLER)) {
- this.exceptionHandlerChanged(null);
- }
-
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_THROW_EXCEPTIONS,
- THROW_EXCEPTIONS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING,
- WEAVING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_LAZY,
- WEAVING_LAZY_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_CHANGE_TRACKING,
- WEAVING_CHANGE_TRACKING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_FETCH_GROUPS,
- WEAVING_FETCH_GROUPS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_INTERNAL,
- WEAVING_INTERNAL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_EAGER,
- WEAVING_EAGER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_VALIDATION_ONLY,
- VALIDATION_ONLY_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_VALIDATE_SCHEMA,
- VALIDATE_SCHEMA_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION_CUSTOMIZER,
- SESSION_CUSTOMIZER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PROFILER,
- PROFILER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EXCEPTION_HANDLER,
- EXCEPTION_HANDLER_PROPERTY);
-
- // Don't need to initialize propertyNames for:
- // descriptorCustomizerProperty
- }
-
- /**
- * Method used for identifying the given property.
- */
- @Override
- public boolean itemIsProperty(PersistenceUnit.Property item) {
- boolean isProperty = super.itemIsProperty(item);
-
- if ( ! isProperty && item.getName() != null) {
- if (item.getName().startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- return true;
- }
- }
- return isProperty;
- }
-
- /**
- * Returns the property name used for change notification of the given
- * property.
- */
- @Override
- public String propertyIdOf(PersistenceUnit.Property property) {
- try {
- return super.propertyIdOf(property);
- }
- catch (IllegalArgumentException e) {
- if (property.getName().startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- return DESCRIPTOR_CUSTOMIZER_PROPERTY;
- }
- }
- throw new IllegalArgumentException("Illegal property: " + property); //$NON-NLS-1$
- }
-
- public CustomizationEntity addEntity(String entityName) {
- if (this.entityExists(entityName)) {
- throw new IllegalStateException("Duplicate entity: " + entityName); //$NON-NLS-1$
- }
- CustomizationEntity newEntity = this.buildEntity(entityName);
- this.addItemToList(newEntity, this.entities, ENTITIES_LIST);
- return newEntity;
- }
-
- public void removeEntity(String entityName) {
- if ( ! this.entityExists(entityName)) {
- return;
- }
- CustomizationEntity entity = this.getEntityNamed(entityName);
- this.clearEntity(entity);
- this.removeEntity(entity);
- }
-
-
- // ********** ThrowExceptions **********
- public Boolean getThrowExceptions() {
- return this.throwExceptions;
- }
-
- public void setThrowExceptions(Boolean newThrowExceptions) {
- Boolean old = this.throwExceptions;
- this.throwExceptions = newThrowExceptions;
- this.putProperty(THROW_EXCEPTIONS_PROPERTY, newThrowExceptions);
- this.firePropertyChanged(THROW_EXCEPTIONS_PROPERTY, old, newThrowExceptions);
- }
-
- private void throwExceptionsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.throwExceptions;
- this.throwExceptions = newValue;
- this.firePropertyChanged(THROW_EXCEPTIONS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultThrowExceptions() {
- return DEFAULT_THROW_EXCEPTIONS;
- }
-
- // ********** WeavingLazy **********
- public Boolean getWeavingLazy() {
- return this.weavingLazy;
- }
-
- public void setWeavingLazy(Boolean newWeavingLazy) {
- Boolean old = this.weavingLazy;
- this.weavingLazy = newWeavingLazy;
- this.putProperty(WEAVING_LAZY_PROPERTY, newWeavingLazy);
- this.firePropertyChanged(WEAVING_LAZY_PROPERTY, old, newWeavingLazy);
- }
-
- private void weavingLazyChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingLazy;
- this.weavingLazy = newValue;
- this.firePropertyChanged(WEAVING_LAZY_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingLazy() {
- return DEFAULT_WEAVING_LAZY;
- }
-
- // ********** WeavingChangeTracking **********
- public Boolean getWeavingChangeTracking() {
- return this.weavingChangeTracking;
- }
-
- public void setWeavingChangeTracking(Boolean newWeavingChangeTracking) {
- Boolean old = this.weavingChangeTracking;
- this.weavingChangeTracking = newWeavingChangeTracking;
- this.putProperty(WEAVING_CHANGE_TRACKING_PROPERTY, newWeavingChangeTracking);
- this.firePropertyChanged(WEAVING_CHANGE_TRACKING_PROPERTY, old, newWeavingChangeTracking);
- }
-
- private void weavingChangeTrackingChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingChangeTracking;
- this.weavingChangeTracking = newValue;
- this.firePropertyChanged(WEAVING_CHANGE_TRACKING_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingChangeTracking() {
- return DEFAULT_WEAVING_CHANGE_TRACKING;
- }
-
- // ********** WeavingFetchGroups **********
- public Boolean getWeavingFetchGroups() {
- return this.weavingFetchGroups;
- }
-
- public void setWeavingFetchGroups(Boolean newWeavingFetchGroups) {
- Boolean old = this.weavingFetchGroups;
- this.weavingFetchGroups = newWeavingFetchGroups;
- this.putProperty(WEAVING_FETCH_GROUPS_PROPERTY, newWeavingFetchGroups);
- this.firePropertyChanged(WEAVING_FETCH_GROUPS_PROPERTY, old, newWeavingFetchGroups);
- }
-
- private void weavingFetchGroupsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingFetchGroups;
- this.weavingFetchGroups = newValue;
- this.firePropertyChanged(WEAVING_FETCH_GROUPS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingFetchGroups() {
- return DEFAULT_WEAVING_FETCH_GROUPS;
- }
-
- // ********** WeavingInternal **********
- public Boolean getWeavingInternal() {
- return this.weavingInternal;
- }
-
- public void setWeavingInternal(Boolean newWeavingInternal) {
- Boolean old = this.weavingInternal;
- this.weavingInternal = newWeavingInternal;
- this.putProperty(WEAVING_INTERNAL_PROPERTY, newWeavingInternal);
- this.firePropertyChanged(WEAVING_INTERNAL_PROPERTY, old, newWeavingInternal);
- }
-
- private void weavingInternalChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingInternal;
- this.weavingInternal = newValue;
- this.firePropertyChanged(WEAVING_INTERNAL_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingInternal() {
- return DEFAULT_WEAVING_INTERNAL;
- }
-
- // ********** WeavingEager **********
- public Boolean getWeavingEager() {
- return this.weavingEager;
- }
-
- public void setWeavingEager(Boolean newWeavingEager) {
- Boolean old = this.weavingEager;
- this.weavingEager = newWeavingEager;
- this.putProperty(WEAVING_EAGER_PROPERTY, newWeavingEager);
- this.firePropertyChanged(WEAVING_EAGER_PROPERTY, old, newWeavingEager);
- }
-
- private void weavingEagerChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingEager;
- this.weavingEager = newValue;
- this.firePropertyChanged(WEAVING_EAGER_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingEager() {
- return DEFAULT_WEAVING_EAGER;
- }
-
- // ********** ValidationOnly **********
- public Boolean getValidationOnly() {
- return this.validationOnly;
- }
-
- public void setValidationOnly(Boolean newValidationOnly) {
- Boolean old = this.validationOnly;
- this.validationOnly = newValidationOnly;
- this.putProperty(VALIDATION_ONLY_PROPERTY, newValidationOnly);
- this.firePropertyChanged(VALIDATION_ONLY_PROPERTY, old, newValidationOnly);
- }
-
- private void validationOnlyChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.validationOnly;
- this.validationOnly = newValue;
- this.firePropertyChanged(VALIDATION_ONLY_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultValidationOnly() {
- return DEFAULT_VALIDATION_ONLY;
- }
-
- // ********** ValidateSchema **********
- public Boolean getValidateSchema() {
- return this.validateSchema;
- }
-
- public void setValidateSchema(Boolean newValidateSchema) {
- Boolean old = this.validateSchema;
- this.validateSchema = newValidateSchema;
- this.putProperty(VALIDATE_SCHEMA_PROPERTY, newValidateSchema);
- this.firePropertyChanged(VALIDATE_SCHEMA_PROPERTY, old, newValidateSchema);
- }
-
- private void validateSchemaChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.validateSchema;
- this.validateSchema = newValue;
- this.firePropertyChanged(VALIDATE_SCHEMA_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultValidateSchema() {
- return DEFAULT_VALIDATE_SCHEMA;
- }
-
- // ********** SessionCustomizers **********
- public ListIterable<String> getSessionCustomizers(){
- return new LiveCloneListIterable<String>(this.sessionCustomizers);
- }
-
- public int getSessionCustomizersSize(){
- return this.sessionCustomizers.size();
- }
-
- public boolean sessionCustomizerExists(String sessionCustomizerClassName) {
-
- for (String sessionCustomizer : this.sessionCustomizers) {
- if(sessionCustomizer.equals(sessionCustomizerClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addSessionCustomizer(String newSessionCustomizerClassName){
-
- if( ! this.sessionCustomizerExists(newSessionCustomizerClassName)) {
- this.addItemToList(newSessionCustomizerClassName, this.sessionCustomizers, SESSION_CUSTOMIZER_LIST);
- this.putProperty(SESSION_CUSTOMIZER_PROPERTY, newSessionCustomizerClassName, true);
- return newSessionCustomizerClassName;
- }
- return null;
- }
-
- public void removeSessionCustomizer(String className){
- if (this.removeItemFromList(className, this.sessionCustomizers, SESSION_CUSTOMIZER_LIST)) {
- this.removeProperty(SESSION_CUSTOMIZER_PROPERTY, className);
- }
- }
-
- private void sessionCustomizersChanged() {
- this.synchronizeList(this.buildSessionCustomizers(), this.sessionCustomizers, SESSION_CUSTOMIZER_LIST);
- }
-
- // ********** Weaving **********
-
- public Weaving getWeaving() {
- return this.weaving;
- }
-
- public void setWeaving(Weaving newWeaving) {
- Weaving old = this.weaving;
- this.weaving = newWeaving;
- this.putProperty(WEAVING_PROPERTY, newWeaving);
- this.firePropertyChanged(WEAVING_PROPERTY, old, newWeaving);
- }
-
- private void weavingChanged(String stringValue) {
- Weaving newValue = getEnumValueOf(stringValue, Weaving.values());
- Weaving old = this.weaving;
- this.weaving = newValue;
- this.firePropertyChanged(WEAVING_PROPERTY, old, newValue);
- }
-
- public Weaving getDefaultWeaving() {
- return DEFAULT_WEAVING;
- }
-
- // ********** ExceptionHandler **********
- public String getExceptionHandler() {
- return this.exceptionHandler;
- }
-
- public void setExceptionHandler(String newExceptionHandler) {
- String old = this.exceptionHandler;
- this.exceptionHandler = newExceptionHandler;
- this.putProperty(EXCEPTION_HANDLER_PROPERTY, newExceptionHandler);
- this.firePropertyChanged(EXCEPTION_HANDLER_PROPERTY, old, newExceptionHandler);
- }
-
- private void exceptionHandlerChanged(String newValue) {
- String old = this.exceptionHandler;
- this.exceptionHandler = newValue;
- this.firePropertyChanged(EXCEPTION_HANDLER_PROPERTY, old, newValue);
- }
-
- public String getDefaultExceptionHandler() {
- return DEFAULT_EXCEPTION_HANDLER;
- }
-
- // ********** DescriptorCustomizer **********
-
- public String getDescriptorCustomizerOf(String entityName) {
- CustomizationEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getDescriptorCustomizer();
- }
-
- public void setDescriptorCustomizerOf(String entityName, String newDescriptorCustomizer) {
- CustomizationEntity old = this.setEntityDescriptorCustomizerOf(entityName, newDescriptorCustomizer);
- this.putStringValue(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER, entityName, newDescriptorCustomizer, false);
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void descriptorCustomizerChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CustomizationEntity old = this.setEntityDescriptorCustomizerOf(entityName, stringValue);
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public String getDefaultDescriptorCustomizer() {
- return DEFAULT_DESCRIPTOR_CUSTOMIZER;
- }
-
- /**
- * Returns the old Entity
- */
- private CustomizationEntity setEntityDescriptorCustomizerOf(String entityName, String descriptorCustomizerClassName) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(descriptorCustomizerClassName)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- CustomizationEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityDescriptorCustomizerOf(entity, descriptorCustomizerClassName);
- }
-
- /**
- * Returns the old Entity
- */
- private CustomizationEntity setEntityDescriptorCustomizerOf(CustomizationEntity entity, String descriptorCustomizerClassName) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CustomizationEntity old = entity.clone();
- entity.setDescriptorCustomizer(descriptorCustomizerClassName);
- return old;
- }
-
- /**
- * Convenience method to update the descriptorCustomizerClassName in entities.
- * Returns the old Entity
- */
- private CustomizationEntity setEntityDescriptorCustomizerOf(PersistenceUnit.Property descriptorCustomizerProperty) {
- String entityName = this.extractEntityNameOf(descriptorCustomizerProperty);
- if(StringTools.stringIsEmpty(entityName)) {
- return null;
- }
- return this.setEntityDescriptorCustomizerOf(entityName, descriptorCustomizerProperty.getValue());
- }
-
- // ********** Profiler **********
- /**
- * Returns Profiler or custom profiler class.
- *
- * @return EclipseLink string value for Profiler enum or custom profiler class
- */
- public String getProfiler() {
- return this.profiler;
- }
-
- /**
- * Sets EclipseLink profiler.
- *
- * @param newProfiler - Profiler
- */
- public void setProfiler(Profiler newProfiler) {
- if( newProfiler == null) {
- this.setProfiler_((String) null);
- return;
- }
- this.setProfiler_(getPropertyStringValueOf(newProfiler));
- }
-
- /**
- * Sets EclipseLink profiler or custom profiler.
- *
- * @param newProfiler -
- * Can be a EclipseLink profiler literal or
- * a fully qualified class name of a custom profiler.
- */
- public void setProfiler(String newProfiler) {
- if( newProfiler == null) {
- this.setProfiler_((String) null);
- return;
- }
- Profiler p = Profiler.getProfilerFor(newProfiler);
- if(p == null) { // custom profiler class
- this.setProfiler_(newProfiler);
- }
- else {
- this.setProfiler(p);
- }
- }
-
- private void setProfiler_(String newProfiler) {
- String old = this.profiler;
- this.profiler = newProfiler;
- this.putProperty(PROFILER_PROPERTY, newProfiler);
- this.firePropertyChanged(PROFILER_PROPERTY, old, newProfiler);
- }
-
- private void profilerChanged(String newValue) {
- String old = this.profiler;
- this.profiler = newValue;
- this.firePropertyChanged(PROFILER_PROPERTY, old, newValue);
- }
-
- public String getDefaultProfiler() {
- return DEFAULT_PROFILER;
- }
-
-
- // ****** convenience methods *******
-
- /**
- * Set all Entity properties to default.
- */
- private void clearEntity(CustomizationEntity entity) {
- if(entity.isEmpty()) {
- return;
- }
- String entityName = entity.getName();
- this.setDescriptorCustomizerOf(entityName, null);
- }
-
- /**
- * Returns the Entity with the given name.
- */
- private CustomizationEntity getEntityNamed(String name) {
- for(CustomizationEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return entity;
- }
- }
- return null;
- }
-
- private CustomizationEntity buildEntity(String name) {
- return new CustomizationEntity(this, name);
- }
-
- private void removeEntity(CustomizationEntity entity) {
- if(entity == null) {
- throw new NullPointerException();
- }
- this.removeItemFromList(entity, this.entities, ENTITIES_LIST);
- }
-
- /**
- * Return whether the Entity exist.
- */
- public boolean entityExists(String name) {
- for(CustomizationEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- // ****** entities list *******
-
- public ListIterable<CustomizationEntity> getEntities() {
- return new LiveCloneListIterable<CustomizationEntity>(this.entities);
- }
-
- public Iterable<String> getEntityNames() {
- return new TransformationIterable<CustomizationEntity, String>(this.getEntities()) {
- @Override
- protected String transform(CustomizationEntity entity) {
- return entity.getName();
- }
- };
- }
-
- public int getEntitiesSize() {
- return this.entities.size();
- }
-
-
- // ********** refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createSessionCustomizerRenameTypeEdits(originalType, newName),
- this.createExceptionHandlerRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createSessionCustomizerRenameTypeEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<PersistenceUnit.Property, Iterable<ReplaceEdit>>(getPersistenceUnit().getPropertiesNamed(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- @Override
- protected Iterable<ReplaceEdit> transform(PersistenceUnit.Property property) {
- return property.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createExceptionHandlerRenameTypeEdits(IType originalType, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_EXCEPTION_HANDLER);
- return (property != null) ?
- property.createRenameTypeEdits(originalType, newName) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createSessionCustomizerMoveTypeEdits(originalType, newPackage),
- this.createExceptionHandlerMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createSessionCustomizerMoveTypeEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<PersistenceUnit.Property, Iterable<ReplaceEdit>>(getPersistenceUnit().getPropertiesNamed(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- @Override
- protected Iterable<ReplaceEdit> transform(PersistenceUnit.Property property) {
- return property.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createExceptionHandlerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_EXCEPTION_HANDLER);
- return (property != null) ?
- property.createMoveTypeEdits(originalType, newPackage) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createSessionCustomizerRenamePackageEdits(originalPackage, newName),
- this.createExceptionHandlerRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createSessionCustomizerRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<PersistenceUnit.Property, Iterable<ReplaceEdit>>(getPersistenceUnit().getPropertiesNamed(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- @Override
- protected Iterable<ReplaceEdit> transform(PersistenceUnit.Property property) {
- return property.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createExceptionHandlerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_EXCEPTION_HANDLER);
- return (property != null) ?
- property.createRenamePackageEdits(originalPackage, newName) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java
deleted file mode 100644
index a431f95779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.GeneralProperties;
-
-/**
- * EclipseLinkGeneralProperties
- */
-public class EclipseLinkGeneralProperties extends EclipseLinkPersistenceUnitProperties
- implements GeneralProperties
-{
- // ********** EclipseLink properties **********
- private Boolean excludeEclipselinkOrm;
-
- // ********** constructors **********
- public EclipseLinkGeneralProperties(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
-
- this.excludeEclipselinkOrm =
- this.getBooleanValue(ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM);
- }
-
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM)) {
- excludeEclipselinkOrmChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM)) {
- excludeEclipselinkOrmChanged(null);
- }
- }
-
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM,
- EXCLUDE_ECLIPSELINK_ORM_PROPERTY);
- }
-
-
- // ********** ExcludeEclipselinkOrm **********
- public Boolean getExcludeEclipselinkOrm() {
- return this.excludeEclipselinkOrm;
- }
-
- public void setExcludeEclipselinkOrm(Boolean newExcludeEclipselinkOrm) {
- Boolean old = this.excludeEclipselinkOrm;
- this.excludeEclipselinkOrm = newExcludeEclipselinkOrm;
- this.putProperty(EXCLUDE_ECLIPSELINK_ORM_PROPERTY, newExcludeEclipselinkOrm);
- this.firePropertyChanged(EXCLUDE_ECLIPSELINK_ORM_PROPERTY, old, newExcludeEclipselinkOrm);
- }
-
- private void excludeEclipselinkOrmChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.excludeEclipselinkOrm;
- this.excludeEclipselinkOrm = newValue;
- this.firePropertyChanged(EXCLUDE_ECLIPSELINK_ORM_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultExcludeEclipselinkOrm() {
- return DEFAULT_EXCLUDE_ECLIPSELINK_ORM;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java
deleted file mode 100644
index e1cc5b2cdd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractJarFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJarFileRef;
-
-public class EclipseLinkJarFileRef
- extends AbstractJarFileRef
-{
- public EclipseLinkJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- super(parent, xmlJarFileRef);
- }
-
- @Override
- protected IPath[] buildRuntimeJarFilePathWeb(IPath root, IPath jarFilePath) {
- IPath[] genericPath = super.buildRuntimeJarFilePathWeb(root, jarFilePath);
- return ArrayTools.removeLast(genericPath);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java
deleted file mode 100644
index e262cf4b30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logger;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLinkLogging
- */
-public class EclipseLinkLogging extends EclipseLinkPersistenceUnitProperties
- implements Logging
-{
- // ********** EclipseLink properties **********
- private LoggingLevel level;
- private Boolean timestamp;
- private Boolean thread;
- private Boolean session;
- private Boolean exceptions;
- private String logFileLocation;
- private String logger; // storing EclipseLinkStringValue since value can be Logger or custom class
-
- // ********** constructors **********
- public EclipseLinkLogging(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- // TOREVIEW - handle incorrect String in persistence.xml
- this.level =
- this.getEnumValue(ECLIPSELINK_LEVEL, LoggingLevel.values());
- this.timestamp =
- this.getBooleanValue(ECLIPSELINK_TIMESTAMP);
- this.thread =
- this.getBooleanValue(ECLIPSELINK_THREAD);
- this.session =
- this.getBooleanValue(ECLIPSELINK_SESSION);
- this.exceptions =
- this.getBooleanValue(ECLIPSELINK_EXCEPTIONS);
- this.logFileLocation =
- this.getStringValue(ECLIPSELINK_LOG_FILE_LOCATION);
-
- this.logger = this.getLoggerProtertyValue();
- }
-
- /**
- * Gets the Logger property from the persistence unit.
- */
- private String getLoggerProtertyValue() {
-
- String value = this.getStringValue(ECLIPSELINK_LOGGER);
- if (value == null) {
- return null; // no property found
- }
- Logger standardLogger = this.getEnumValue(ECLIPSELINK_LOGGER, Logger.values());
- return (standardLogger == null) ? value : getPropertyStringValueOf(standardLogger);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_LEVEL)) {
- this.levelChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TIMESTAMP)) {
- this.timestampChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_THREAD)) {
- this.threadChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION)) {
- this.sessionChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTIONS)) {
- this.exceptionsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_LOG_FILE_LOCATION)) {
- this.logFileLocationChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_LOGGER)) {
- this.loggerChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_LEVEL)) {
- this.levelChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TIMESTAMP)) {
- this.timestampChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_THREAD)) {
- this.threadChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION)) {
- this.sessionChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTIONS)) {
- this.exceptionsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_LOG_FILE_LOCATION)) {
- this.logFileLocationChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_LOGGER)) {
- this.loggerChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_LEVEL,
- LEVEL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TIMESTAMP,
- TIMESTAMP_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_THREAD,
- THREAD_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION,
- SESSION_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EXCEPTIONS,
- EXCEPTIONS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_LOG_FILE_LOCATION,
- LOG_FILE_LOCATION_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_LOGGER,
- LOGGER_PROPERTY);
- }
-
- // ********** LoggingLevel **********
-
- public LoggingLevel getLevel() {
- return this.level;
- }
-
- public void setLevel(LoggingLevel newLevel) {
- LoggingLevel old = this.level;
- this.level = newLevel;
- this.putProperty(LEVEL_PROPERTY, newLevel);
- this.firePropertyChanged(LEVEL_PROPERTY, old, newLevel);
- }
-
- private void levelChanged(String stringValue) {
- LoggingLevel newValue = getEnumValueOf(stringValue, LoggingLevel.values());
- LoggingLevel old = this.level;
- this.level = newValue;
- this.firePropertyChanged(LEVEL_PROPERTY, old, newValue);
- }
-
- public LoggingLevel getDefaultLevel() {
- return DEFAULT_LEVEL;
- }
-
- // ********** Timestamp **********
- public Boolean getTimestamp() {
- return this.timestamp;
- }
-
- public void setTimestamp(Boolean newTimestamp) {
- Boolean old = this.timestamp;
- this.timestamp = newTimestamp;
- this.putProperty(TIMESTAMP_PROPERTY, newTimestamp);
- this.firePropertyChanged(TIMESTAMP_PROPERTY, old, newTimestamp);
- }
-
- private void timestampChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.timestamp;
- this.timestamp = newValue;
- this.firePropertyChanged(TIMESTAMP_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultTimestamp() {
- return DEFAULT_TIMESTAMP;
- }
-
- // ********** Thread **********
- public Boolean getThread() {
- return this.thread;
- }
-
- public void setThread(Boolean newThread) {
- Boolean old = this.thread;
- this.thread = newThread;
- this.putProperty(THREAD_PROPERTY, newThread);
- this.firePropertyChanged(THREAD_PROPERTY, old, newThread);
- }
-
- private void threadChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.thread;
- this.thread = newValue;
- this.firePropertyChanged(THREAD_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultThread() {
- return DEFAULT_THREAD;
- }
-
- // ********** Session **********
- public Boolean getSession() {
- return this.session;
- }
-
- public void setSession(Boolean newSession) {
- Boolean old = this.session;
- this.session = newSession;
- this.putProperty(SESSION_PROPERTY, newSession);
- this.firePropertyChanged(SESSION_PROPERTY, old, newSession);
- }
-
- private void sessionChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.session;
- this.session = newValue;
- this.firePropertyChanged(SESSION_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultSession() {
- return DEFAULT_SESSION;
- }
-
- // ********** Exceptions **********
- public Boolean getExceptions() {
- return this.exceptions;
- }
-
- public void setExceptions(Boolean newExceptions) {
- Boolean old = this.exceptions;
- this.exceptions = newExceptions;
- this.putProperty(EXCEPTIONS_PROPERTY, newExceptions);
- this.firePropertyChanged(EXCEPTIONS_PROPERTY, old, newExceptions);
- }
-
- private void exceptionsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.exceptions;
- this.exceptions = newValue;
- this.firePropertyChanged(EXCEPTIONS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultExceptions() {
- return DEFAULT_EXCEPTIONS;
- }
-
- // ********** logFileLocation **********
- public String getLogFileLocation() {
- return this.logFileLocation;
- }
-
- public void setLogFileLocation(String newLogFileLocation) {
- String old = this.logFileLocation;
- this.logFileLocation = (StringTools.stringIsNotEmpty(newLogFileLocation)) ?
- newLogFileLocation :
- this.getDefaultLogFileLocation();
- this.putProperty(LOG_FILE_LOCATION_PROPERTY, this.logFileLocation);
- this.firePropertyChanged(LOG_FILE_LOCATION_PROPERTY, old, this.logFileLocation);
- }
-
- private void logFileLocationChanged(String newValue) {
- String old = this.logFileLocation;
- this.logFileLocation = newValue;
- this.firePropertyChanged(LOG_FILE_LOCATION_PROPERTY, old, newValue);
- }
-
- public String getDefaultLogFileLocation() {
- return DEFAULT_LOG_FILE_LOCATION;
- }
-
- // ********** Logger **********
- /**
- * Returns Logger or custom logger class.
- *
- * @return EclipseLink string value for Logger enum or custom logger class
- */
- public String getLogger() {
- return this.logger;
- }
-
- /**
- * Sets EclipseLink logger.
- *
- * @param newLogger - Logger
- */
- public void setLogger(Logger newLogger) {
- if( newLogger == null) {
- this.setLogger_((String) null);
- return;
- }
- this.setLogger_(getPropertyStringValueOf(newLogger));
- }
-
- /**
- * Sets EclipseLink logger or custom logger.
- *
- * @param newLogger -
- * Can be a EclipseLink logger literal or
- * a fully qualified class name of a custom logger.
- */
- public void setLogger(String newLogger) {
- if( newLogger == null) {
- this.setLogger_(null);
- return;
- }
- Logger l = Logger.getLoggerFor(newLogger);
- if(l == null) { // custom Logger class
- this.setLogger_(newLogger);
- }
- else {
- this.setLogger(l);
- }
- }
-
- private void setLogger_(String newLogger) {
- String old = this.logger;
- this.logger = newLogger;
- this.putProperty(LOGGER_PROPERTY, newLogger);
- this.firePropertyChanged(LOGGER_PROPERTY, old, newLogger);
- }
-
- private void loggerChanged(String newValue) {
- String old = this.logger;
- this.logger = newValue;
- this.firePropertyChanged(LOGGER_PROPERTY, old, newValue);
- }
-
- public String getDefaultLogger() {
- return DEFAULT_LOGGER;
- }
-
-
- // ********** refactoring ************
-
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.createLoggerRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createLoggerRenameTypeEdits(IType originalType, String newName) {
- //TODO seems like we should have the Property stored in a SessionCustomizer object instead of having to go
- //find all of the Properties from the persistence unit.
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_LOGGER);
- if (property != null) {
- return property.createRenameTypeEdits(originalType, newName);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.createLoggerMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createLoggerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_LOGGER);
- if (property != null) {
- return property.createMoveTypeEdits(originalType, newPackage);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.createLoggerRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createLoggerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- //find all of the Properties from the persistence unit.
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_LOGGER);
- if (property != null) {
- return property.createRenamePackageEdits(originalPackage, newName);
- }
- return EmptyIterable.instance();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java
deleted file mode 100644
index f9620744b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-
-/**
- * EclipseLinkLogging2_0
- */
-public class EclipseLinkLogging2_0 extends EclipseLinkLogging
- implements Logging2_0
-{
- // ********** EclipseLink properties **********
-
- /**
- * Store Category levels in a map
- * key/value pairs, where:
- * key = Category property id
- * value = value
- */
- private Map<String, LoggingLevel> categoryValues;
-
- private Boolean connection;
-
- private LoggingLevel categoriesDefaultValue;
-
- // ********** constructors **********
- public EclipseLinkLogging2_0(PersistenceUnit2_0 parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- super.initializeProperties();
-
- this.connection =
- this.getBooleanValue(ECLIPSELINK_CONNECTION);
-
- this.categoriesDefaultValue =
- this.getEnumValue(ECLIPSELINK_LEVEL, LoggingLevel.values());
- this.initializeCategory(SQL_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(TRANSACTION_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(EVENT_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(CONNECTION_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(QUERY_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(CACHE_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(PROPAGATION_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(SEQUENCING_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(EJB_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(DMS_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(METAMODEL_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(WEAVER_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(PROPERTIES_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(SERVER_CATEGORY_LOGGING_PROPERTY);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
-
- this.categoryValues = new HashMap<String, LoggingLevel>();
- }
-
- /**
- * Convenience method to set a logging level category value from the value in the persistence unit.
- *
- * key = Category property id; value = value (LoggingLevel)
- * @param categoryId - Category property id
- */
- private void initializeCategory(String categoryId) {
- String puKey = this.persistenceUnitKeyOf(categoryId);
- LoggingLevel puValue = this.getEnumValue(puKey, LoggingLevel.values());
-
- this.categoryValues.put(categoryId, puValue);
- }
-
- // ********** behavior **********
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
-
- if (propertyName.equals(ECLIPSELINK_CONNECTION)) {
- this.connectionChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL, newValue);
- }
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
-
- if (propertyName.equals(ECLIPSELINK_CONNECTION)) {
- this.connectionChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL, null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- super.addPropertyNames(propertyNames);
-
- propertyNames.put(
- ECLIPSELINK_CONNECTION,
- CONNECTION_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL,
- SQL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL,
- TRANSACTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL,
- EVENT_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL,
- CONNECTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL,
- QUERY_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL,
- CACHE_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL,
- PROPAGATION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL,
- SEQUENCING_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL,
- EJB_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL,
- DMS_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL,
- EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL,
- METAMODEL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL,
- WEAVER_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL,
- PROPERTIES_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL,
- SERVER_CATEGORY_LOGGING_PROPERTY);
- }
-
- // ********** Connection **********
- public Boolean getConnection() {
- return this.connection;
- }
-
- public void setConnection(Boolean newConnection) {
- Boolean old = this.connection;
- this.connection = newConnection;
- this.putProperty(CONNECTION_PROPERTY, newConnection);
- this.firePropertyChanged(CONNECTION_PROPERTY, old, newConnection);
- }
-
- private void connectionChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.connection;
- this.connection = newValue;
- this.firePropertyChanged(CONNECTION_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultConnection() {
- return DEFAULT_CONNECTION;
- }
-
- // ********** Category Levels **********
-
- public LoggingLevel getLevel(String category) {
-
- return this.categoryValues.get(category);
- }
-
- public void setLevel(String category, LoggingLevel newLevel) {
- LoggingLevel old = this.getLevel(category);
- this.categoryValues.put(category, newLevel);
- this.putProperty(category, newLevel);
- this.firePropertyChanged(category, old, newLevel);
- }
-
- private void categoryLoggingChanged_(String eclipselinkKey, String stringValue) {
- String category = this.propertyIdOf(eclipselinkKey);
- this.categoryLoggingChanged(category, stringValue);
- }
-
- private void categoryLoggingChanged(String category, String stringValue) {
- LoggingLevel enumValue = getEnumValueOf(stringValue, LoggingLevel.values());
- LoggingLevel old = this.getLevel(category);
- this.categoryValues.put(category, enumValue);
- this.firePropertyChanged(category, old, enumValue);
- }
-
- public LoggingLevel getCategoriesDefaultLevel() {
- return (this.categoriesDefaultValue == null) ? super.getDefaultLevel() : this.categoriesDefaultValue;
- }
-
- @Override
- public void setLevel(LoggingLevel level) {
- super.setLevel(level);
- this.setDefaultLevel(level);
- }
-
- public void setDefaultLevel(LoggingLevel level) {
- LoggingLevel old = this.categoriesDefaultValue;
- this.categoriesDefaultValue = level;
- this.firePropertyChanged(CATEGORIES_DEFAULT_LOGGING_PROPERTY, old, level);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java
deleted file mode 100644
index 6f99ed37f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetServer;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLinkOptions
- */
-public class EclipseLinkOptions extends EclipseLinkPersistenceUnitProperties
- implements Options
-{
- // ********** EclipseLink properties **********
- private String sessionName;
- private String sessionsXml;
- private Boolean includeDescriptorQueries;
- private String targetDatabase; // storing EclipseLinkStringValue since value can be TargetDatabase or custom class
- private String targetServer; // storing EclipseLinkStringValue since value can be TargetServer or custom class
- private String eventListener;
- private Boolean temporalMutable;
-
-
- // ********** constructors **********
- public EclipseLinkOptions(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- // TOREVIEW - handle incorrect String in persistence.xml
- this.sessionName =
- this.getStringValue(ECLIPSELINK_SESSION_NAME);
- this.sessionsXml =
- this.getStringValue(ECLIPSELINK_SESSIONS_XML);
- this.includeDescriptorQueries =
- this.getBooleanValue(ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES);
- this.targetDatabase = this.getTargetDatabaseFromPersistenceXml();
- this.targetServer = this.getTargetServerFromPersistenceXml();
- this.eventListener =
- this.getStringValue(ECLIPSELINK_SESSION_EVENT_LISTENER);
- this.temporalMutable =
- this.getBooleanValue(ECLIPSELINK_TEMPORAL_MUTABLE);
- }
-
- protected String getTargetDatabaseFromPersistenceXml() {
-
- String value = this.getStringValue(ECLIPSELINK_TARGET_DATABASE);
- if (value == null) {
- return null;
- }
- TargetDatabase standardTargetDatabase = this.getEnumValue(ECLIPSELINK_TARGET_DATABASE, TargetDatabase.values());
- return (standardTargetDatabase == null) ? value : getPropertyStringValueOf(standardTargetDatabase);
- }
-
- protected String getTargetServerFromPersistenceXml() {
-
- String value = this.getStringValue(ECLIPSELINK_TARGET_SERVER);
- if (value == null) {
- return null;
- }
- TargetServer standardTargetServer = this.getEnumValue(ECLIPSELINK_TARGET_SERVER, TargetServer.values());
- return (standardTargetServer == null) ? value : getPropertyStringValueOf(standardTargetServer);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_SESSION_NAME)) {
- this.sessionNameChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSIONS_XML)) {
- this.sessionsXmlChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_DATABASE)) {
- this.targetDatabaseChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_SERVER)) {
- this.targetServerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES)) {
- this.includeDescriptorQueriesChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_EVENT_LISTENER)) {
- this.eventListenerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TEMPORAL_MUTABLE)) {
- this.temporalMutableChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_SESSION_NAME)) {
- this.sessionNameChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSIONS_XML)) {
- this.sessionsXmlChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_DATABASE)) {
- this.targetDatabaseChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_SERVER)) {
- this.targetServerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES)) {
- this.includeDescriptorQueriesChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_EVENT_LISTENER)) {
- this.eventListenerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TEMPORAL_MUTABLE)) {
- this.temporalMutableChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_SESSION_NAME,
- SESSION_NAME_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSIONS_XML,
- SESSIONS_XML_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES,
- SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TARGET_DATABASE,
- TARGET_DATABASE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TARGET_SERVER,
- TARGET_SERVER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION_EVENT_LISTENER,
- SESSION_EVENT_LISTENER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TEMPORAL_MUTABLE,
- TEMPORAL_MUTABLE_PROPERTY);
- }
-
-
- // ********** SessionName **********
- public String getSessionName() {
- return this.sessionName;
- }
-
- public void setSessionName(String newSessionName) {
- String old = this.sessionName;
- this.sessionName = newSessionName;
- this.putProperty(SESSION_NAME_PROPERTY, newSessionName);
- this.firePropertyChanged(SESSION_NAME_PROPERTY, old, newSessionName);
- }
-
- private void sessionNameChanged(String newValue) {
- String old = this.sessionName;
- this.sessionName = newValue;
- this.firePropertyChanged(SESSION_NAME_PROPERTY, old, newValue);
- }
-
- public String getDefaultSessionName() {
- return DEFAULT_SESSION_NAME;
- }
-
- // ********** SessionsXml **********
- public String getSessionsXml() {
- return this.sessionsXml;
- }
-
- public void setSessionsXml(String newSessionsXml) {
- String old = this.sessionsXml;
- this.sessionsXml = newSessionsXml;
- this.putProperty(SESSIONS_XML_PROPERTY, newSessionsXml);
- this.firePropertyChanged(SESSIONS_XML_PROPERTY, old, newSessionsXml);
- }
-
- private void sessionsXmlChanged(String newValue) {
- String old = this.sessionsXml;
- this.sessionsXml = newValue;
- this.firePropertyChanged(SESSIONS_XML_PROPERTY, old, newValue);
- }
-
- public String getDefaultSessionsXml() {
- return DEFAULT_SESSIONS_XML;
- }
-
- // ********** IncludeDescriptorQueries **********
- public Boolean getIncludeDescriptorQueries() {
- return this.includeDescriptorQueries;
- }
-
- public void setIncludeDescriptorQueries(Boolean newIncludeDescriptorQueries) {
- Boolean old = this.includeDescriptorQueries;
- this.includeDescriptorQueries = newIncludeDescriptorQueries;
- this.putProperty(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, newIncludeDescriptorQueries);
- this.firePropertyChanged(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newIncludeDescriptorQueries);
- }
-
- private void includeDescriptorQueriesChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.includeDescriptorQueries;
- this.includeDescriptorQueries = newValue;
- this.firePropertyChanged(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultIncludeDescriptorQueries() {
- return DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES;
- }
-
- // ********** TargetDatabase **********
- /**
- * Returns TargetDatabase or custom targetDatabase class.
- *
- * @return EclipseLink string value for TargetDatabase enum or custom targetDatabase class
- */
- public String getTargetDatabase() {
- return this.targetDatabase;
- }
-
- /**
- * Sets EclipseLink targetDatabase.
- *
- * @param newTargetDatabase - TargetDatabase
- */
- public void setTargetDatabase(TargetDatabase newTargetDatabase) {
- if( newTargetDatabase == null) {
- this.setTargetDatabase_((String) null);
- return;
- }
- this.setTargetDatabase_(getPropertyStringValueOf(newTargetDatabase));
- }
-
- /**
- * Sets EclipseLink targetDatabase or custom targetDatabase.
- *
- * @param newTargetDatabase -
- * Can be a EclipseLink TargetDatabase literal or
- * a fully qualified class name of a custom targetDatabase.
- */
- public void setTargetDatabase(String newTargetDatabase) {
- if( newTargetDatabase == null) {
- this.setTargetDatabase_((String) null);
- return;
- }
- TargetDatabase customTargetDatabase = TargetDatabase.getTargetDatabaseFor(newTargetDatabase);
- if(customTargetDatabase == null) { // custom TargetDatabase class
- this.setTargetDatabase_(newTargetDatabase);
- }
- else {
- this.setTargetDatabase(customTargetDatabase);
- }
- }
-
- private void setTargetDatabase_(String newTargetDatabase) {
- String old = this.targetDatabase;
- this.targetDatabase = newTargetDatabase;
- this.putProperty(TARGET_DATABASE_PROPERTY, newTargetDatabase);
- this.firePropertyChanged(TARGET_DATABASE_PROPERTY, old, newTargetDatabase);
- }
-
- private void targetDatabaseChanged(String newValue) {
- String old = this.targetDatabase;
- this.targetDatabase = newValue;
- this.firePropertyChanged(TARGET_DATABASE_PROPERTY, old, newValue);
- }
-
- public String getDefaultTargetDatabase() {
- return DEFAULT_TARGET_DATABASE;
- }
-
- // ********** TargetServer **********
- /**
- * Returns TargetServer or custom targetServer class.
- *
- * @return EclipseLink string value for TargetServer enum or custom targetServer class
- */
- public String getTargetServer() {
- return this.targetServer;
- }
-
- /**
- * Sets EclipseLink targetServer.
- *
- * @param newTargetServer - TargetServer
- */
- public void setTargetServer(TargetServer newTargetServer) {
- if( newTargetServer == null) {
- this.setTargetServer_((String) null);
- return;
- }
- this.setTargetServer_(getPropertyStringValueOf(newTargetServer));
- }
-
- /**
- * Sets EclipseLink targetServer or custom targetServer.
- *
- * @param newTargetServer -
- * Can be a EclipseLink TargetServer literal or
- * a fully qualified class name of a custom targetServer.
- */
- public void setTargetServer(String newTargetServer) {
- if( newTargetServer == null) {
- this.setTargetServer_((String) null);
- return;
- }
- TargetServer customTargetServer = TargetServer.getTargetServerFor(newTargetServer);
- if(customTargetServer == null) { // custom TargetServer class
- this.setTargetServer_(newTargetServer);
- }
- else {
- this.setTargetServer(customTargetServer);
- }
- }
-
- private void setTargetServer_(String newTargetServer) {
- String old = this.targetServer;
- this.targetServer = newTargetServer;
- this.putProperty(TARGET_SERVER_PROPERTY, newTargetServer);
- this.firePropertyChanged(TARGET_SERVER_PROPERTY, old, newTargetServer);
- }
-
- private void targetServerChanged(String newValue) {
- String old = this.targetServer;
- this.targetServer = newValue;
- this.firePropertyChanged(TARGET_SERVER_PROPERTY, old, newValue);
- }
-
- public String getDefaultTargetServer() {
- return DEFAULT_TARGET_SERVER;
- }
-
- // ********** EventListener **********
- public String getEventListener() {
- return this.eventListener;
- }
-
- public void setEventListener(String newEventListener) {
- String old = this.eventListener;
- this.eventListener = newEventListener;
- this.putProperty(SESSION_EVENT_LISTENER_PROPERTY, newEventListener);
- this.firePropertyChanged(SESSION_EVENT_LISTENER_PROPERTY, old, newEventListener);
- }
-
- private void eventListenerChanged(String newValue) {
- String old = this.eventListener;
- this.eventListener = newValue;
- this.firePropertyChanged(SESSION_EVENT_LISTENER_PROPERTY, old, newValue);
- }
-
- public String getDefaultEventListener() {
- return DEFAULT_SESSION_EVENT_LISTENER;
- }
-
- // ********** TemporalMutable **********
-
- public Boolean getTemporalMutable() {
- return this.temporalMutable;
- }
-
- public void setTemporalMutable(Boolean newTemporalMutable) {
- Boolean old = this.temporalMutable;
- this.temporalMutable = newTemporalMutable;
- this.putProperty(TEMPORAL_MUTABLE_PROPERTY, newTemporalMutable);
- this.firePropertyChanged(TEMPORAL_MUTABLE_PROPERTY, old, newTemporalMutable);
- }
-
- private void temporalMutableChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.temporalMutable;
- this.temporalMutable = newValue;
- this.firePropertyChanged(TEMPORAL_MUTABLE_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultTemporalMutable() {
- return DEFAULT_TEMPORAL_MUTABLE;
- }
-
-
- // ********** refactoring ************
-
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.createEventListenerRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createEventListenerRenameTypeEdits(IType originalType, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_SESSION_EVENT_LISTENER);
- if (property != null) {
- return property.createRenameTypeEdits(originalType, newName);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.createEventListenerMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createEventListenerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_SESSION_EVENT_LISTENER);
- if (property != null) {
- return property.createMoveTypeEdits(originalType, newPackage);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.createEventListenerRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createEventListenerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_SESSION_EVENT_LISTENER);
- if (property != null) {
- return property.createRenamePackageEdits(originalPackage, newName);
- }
- return EmptyIterable.instance();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java
deleted file mode 100644
index 179b04a8c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-
-/**
- * EclipseLinkOptions2_0
- */
-public class EclipseLinkOptions2_0 extends EclipseLinkOptions
- implements Options2_0
-{
- // ********** GenericConnection properties **********
- private Integer lockTimeout;
- private Integer queryTimeout;
- private List<String> validationGroupPrePersists;
- private List<String> validationGroupPreUpdates;
- private List<String> validationGroupPreRemoves;
-
- // ********** constructors **********
- public EclipseLinkOptions2_0(PersistenceUnit2_0 parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- super.initializeProperties();
-
- this.lockTimeout =
- this.getIntegerValue(PERSISTENCE_LOCK_TIMEOUT);
- this.queryTimeout =
- this.getIntegerValue(PERSISTENCE_QUERY_TIMEOUT);
-
- // ValidationMode is initialized with the persistence unit element
- this.validationGroupPrePersists = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST);
- this.validationGroupPreUpdates = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE);
- this.validationGroupPreRemoves = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE);
- }
-
- // ********** behavior **********
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
-
- if (propertyName.equals(PERSISTENCE_LOCK_TIMEOUT)) {
- this.lockTimeoutChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_QUERY_TIMEOUT)) {
- this.queryTimeoutChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST)) {
- this.validationGroupPrePersistsChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdatesChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemovesChanged();
- }
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
-
- if (propertyName.equals(PERSISTENCE_LOCK_TIMEOUT)) {
- this.lockTimeoutChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_QUERY_TIMEOUT)) {
- this.queryTimeoutChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST)) {
- this.validationGroupPrePersistsChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdatesChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemovesChanged();
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = PU property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- super.addPropertyNames(propertyNames);
-
- propertyNames.put(
- PERSISTENCE_LOCK_TIMEOUT,
- LOCK_TIMEOUT_PROPERTY);
- propertyNames.put(
- PERSISTENCE_QUERY_TIMEOUT,
- QUERY_TIMEOUT_PROPERTY);
- propertyNames.put(
- PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST,
- VALIDATION_GROUP_PRE_PERSIST_PROPERTY);
- propertyNames.put(
- PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE,
- VALIDATION_GROUP_PRE_UPDATE_PROPERTY);
- propertyNames.put(
- PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE,
- VALIDATION_GROUP_PRE_REMOVE_PROPERTY);
- }
-
- @Override
- public PersistenceUnit2_0 getPersistenceUnit() {
- return (PersistenceUnit2_0) super.getPersistenceUnit();
- }
-
- // ********** LockTimeout **********
- public Integer getLockTimeout() {
- return this.lockTimeout;
- }
-
- public void setLockTimeout(Integer newLockTimeout) {
- Integer old = this.lockTimeout;
- this.lockTimeout = newLockTimeout;
- this.putProperty(LOCK_TIMEOUT_PROPERTY, newLockTimeout);
- this.firePropertyChanged(LOCK_TIMEOUT_PROPERTY, old, newLockTimeout);
- }
-
- private void lockTimeoutChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.lockTimeout;
- this.lockTimeout = newValue;
- this.firePropertyChanged(LOCK_TIMEOUT_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultLockTimeout() {
- return DEFAULT_LOCK_TIMEOUT;
- }
-
- // ********** QueryTimeout **********
- public Integer getQueryTimeout() {
- return this.queryTimeout;
- }
-
- public void setQueryTimeout(Integer newQueryTimeout) {
- Integer old = this.queryTimeout;
- this.queryTimeout = newQueryTimeout;
- this.putProperty(QUERY_TIMEOUT_PROPERTY, newQueryTimeout);
- this.firePropertyChanged(QUERY_TIMEOUT_PROPERTY, old, newQueryTimeout);
- }
-
- private void queryTimeoutChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.queryTimeout;
- this.queryTimeout = newValue;
- this.firePropertyChanged(QUERY_TIMEOUT_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultQueryTimeout() {
- return DEFAULT_QUERY_TIMEOUT;
- }
-
-
- // ********** ValidationGroupPrePersists **********
-
- public ListIterable<String> getValidationGroupPrePersists(){
- return new LiveCloneListIterable<String>(this.validationGroupPrePersists);
- }
-
- public int getValidationGroupPrePersistsSize(){
- return this.validationGroupPrePersists.size();
- }
-
- public boolean validationGroupPrePersistExists(String validationGroupPrePersistClassName) {
-
- for (String validationGroupPrePersist : this.validationGroupPrePersists) {
- if(validationGroupPrePersist.equals(validationGroupPrePersistClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addValidationGroupPrePersist(String newPrePersistClassName){
-
- if( ! this.validationGroupPrePersistExists(newPrePersistClassName)) {
- this.validationGroupPrePersists.add(newPrePersistClassName);
- this.putPropertyCompositeValue(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, newPrePersistClassName);
- this.fireListChanged(VALIDATION_GROUP_PRE_PERSIST_LIST, this.validationGroupPrePersists);
- return newPrePersistClassName;
- }
- return null;
- }
-
- public void removeValidationGroupPrePersist(String className){
-
- if(this.removeValidationGroupPrePersist_(className) != null) {
- this.removePropertyCompositeValue(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, className);
- this.fireListChanged(VALIDATION_GROUP_PRE_PERSIST_LIST, this.validationGroupPrePersists);
- }
- }
-
- private String removeValidationGroupPrePersist_(String className){
-
- for (String validationGroupPrePersist : this.getValidationGroupPrePersists()) {
- if(validationGroupPrePersist.equals(className)) {
- this.validationGroupPrePersists.remove(validationGroupPrePersist);
- return validationGroupPrePersist;
- }
- }
- return null;
- }
-
- private void validationGroupPrePersistsChanged() {
- this.validationGroupPrePersists = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST);
- this.fireListChanged(VALIDATION_GROUP_PRE_PERSIST_LIST, this.validationGroupPrePersists);
- }
-
- // ********** ValidationGroupPreUpdates **********
-
- public ListIterable<String> getValidationGroupPreUpdates(){
- return new LiveCloneListIterable<String>(this.validationGroupPreUpdates);
- }
-
- public int getValidationGroupPreUpdatesSize(){
- return this.validationGroupPreUpdates.size();
- }
-
- public boolean validationGroupPreUpdateExists(String validationGroupPreUpdateClassName) {
-
- for (String validationGroupPreUpdate : this.validationGroupPreUpdates) {
- if(validationGroupPreUpdate.equals(validationGroupPreUpdateClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addValidationGroupPreUpdate(String newPreUpdateClassName){
-
- if( ! this.validationGroupPreUpdateExists(newPreUpdateClassName)) {
- this.validationGroupPreUpdates.add(newPreUpdateClassName);
- this.putPropertyCompositeValue(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, newPreUpdateClassName);
- this.fireListChanged(VALIDATION_GROUP_PRE_UPDATE_LIST, this.validationGroupPreUpdates);
- return newPreUpdateClassName;
- }
- return null;
- }
-
- public void removeValidationGroupPreUpdate(String className){
-
- if(this.removeValidationGroupPreUpdate_(className) != null) {
- this.removePropertyCompositeValue(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, className);
- this.fireListChanged(VALIDATION_GROUP_PRE_UPDATE_LIST, this.validationGroupPreUpdates);
- }
- }
-
- private String removeValidationGroupPreUpdate_(String className){
-
- for(String validationGroupPreUpdate : this.getValidationGroupPreUpdates()) {
- if(validationGroupPreUpdate.equals(className)) {
- this.validationGroupPreUpdates.remove(validationGroupPreUpdate);
- return validationGroupPreUpdate;
- }
- }
- return null;
- }
-
- private void validationGroupPreUpdatesChanged() {
- this.validationGroupPreUpdates = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE);
- this.fireListChanged(VALIDATION_GROUP_PRE_UPDATE_LIST, this.validationGroupPreUpdates);
- }
-
- // ********** ValidationGroupPreRemoves **********
-
- public ListIterable<String> getValidationGroupPreRemoves(){
- return new LiveCloneListIterable<String>(this.validationGroupPreRemoves);
- }
-
- public int getValidationGroupPreRemovesSize(){
- return this.validationGroupPreRemoves.size();
- }
-
- public boolean validationGroupPreRemoveExists(String validationGroupPreRemoveClassName) {
-
- for (String validationGroupPreRemove : this.validationGroupPreRemoves) {
- if(validationGroupPreRemove.equals(validationGroupPreRemoveClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addValidationGroupPreRemove(String newPreRemoveClassName){
-
- if( ! this.validationGroupPreRemoveExists(newPreRemoveClassName)) {
- this.validationGroupPreRemoves.add(newPreRemoveClassName);
- this.putPropertyCompositeValue(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, newPreRemoveClassName);
- this.fireListChanged(VALIDATION_GROUP_PRE_REMOVE_LIST, this.validationGroupPreRemoves);
- return newPreRemoveClassName;
- }
- return null;
- }
-
- public void removeValidationGroupPreRemove(String className){
-
- if(this.removeValidationGroupPreRemove_(className) != null) {
- this.removePropertyCompositeValue(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, className);
- this.fireListChanged(VALIDATION_GROUP_PRE_REMOVE_LIST, this.validationGroupPreRemoves);
- }
- }
-
- private String removeValidationGroupPreRemove_(String className){
-
- for(String validationGroupPreRemove : this.getValidationGroupPreRemoves()) {
- if(validationGroupPreRemove.equals(className)) {
- this.validationGroupPreRemoves.remove(validationGroupPreRemove);
- return validationGroupPreRemove;
- }
- }
- return null;
- }
-
- private void validationGroupPreRemovesChanged() {
- this.validationGroupPreRemoves = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE);
- this.fireListChanged(VALIDATION_GROUP_PRE_REMOVE_LIST, this.validationGroupPreRemoves);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java
deleted file mode 100644
index 1888f71619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Set;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-
-/**
- * EclipseLinkPersistenceUnitProperties
- *
- * Listens to the propertyListAdapter
- */
-public abstract class EclipseLinkPersistenceUnitProperties extends AbstractPersistenceUnitProperties
-{
- // ********** constructors **********
- protected EclipseLinkPersistenceUnitProperties(PersistenceUnit parent) {
- super(parent);
- }
-
- // ******** Convenience methods ********
-
- protected Set<PersistenceUnit.Property> getPropertiesSetWithPrefix(String keyPrefix) {
- return CollectionTools.set(this.getPersistenceUnit().getPropertiesWithNamePrefix(keyPrefix));
- }
-
- /**
- * Extracts the entityName of the specified property name. If the property name
- * has no suffix, return an empty string.
- */
- protected String extractEntityNameOf(PersistenceUnit.Property property) {
- return extractEntityNameOf(property.getName());
- }
-
- /**
- * Extracts the entityName of the specified string. If the string
- * has no suffix, return an empty string.
- */
- protected String extractEntityNameOf(String propertyName) {
- int index = propertyName.lastIndexOf('.');
- if (index == -1) {
- return ""; //$NON-NLS-1$
- }
- return propertyName.substring(index + 1);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index dccd625f54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-
-
-public class EclipseLinkPersistenceXmlContextNodeFactory
- extends AbstractPersistenceXmlContextNodeFactory
- implements org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceXmlContextNodeFactory
-{
-
- @Override
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- return new EclipseLinkPersistenceUnit(parent, xmlPersistenceUnit);
- }
-
- @Override
- public JarFileRef buildJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- return new EclipseLinkJarFileRef(parent, xmlJarFileRef);
- }
-
- public PersistenceUnitProperties buildConnection(PersistenceUnit parent) {
- return new EclipseLinkConnection(parent);
- }
-
- public PersistenceUnitProperties buildOptions(PersistenceUnit parent) {
- return new EclipseLinkOptions(parent);
- }
-
- public PersistenceUnitProperties buildLogging(PersistenceUnit parent) {
- return new EclipseLinkLogging(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java
deleted file mode 100644
index e522115f3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-
-public class EclipseLinkPersistenceXmlDefinition
- extends AbstractPersistenceXmlDefinition
-{
- // singleton
- private static final PersistenceXmlDefinition INSTANCE = new EclipseLinkPersistenceXmlDefinition();
-
- /**
- * Return the singleton
- */
- public static PersistenceXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPersistenceXmlDefinition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
-
- public EFactory getResourceNodeFactory() {
- return PersistenceFactory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkPersistenceXmlContextNodeFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java
deleted file mode 100644
index df33932fc6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * EclipseLinkSchemaGeneration encapsulates EclipseLink SchemaGeneration
- * properties.
- */
-public class EclipseLinkSchemaGeneration
- extends EclipseLinkPersistenceUnitProperties implements SchemaGeneration
-{
- // ********** EclipseLink properties **********
-
- private OutputMode outputMode;
- private DdlGenerationType ddlGenerationType;
- private String createFileName;
- private String dropFileName;
- private String applicationLocation;
-
- // ********** constructors/initialization **********
-
- public EclipseLinkSchemaGeneration(PersistenceUnit parent) {
- super(parent);
- }
-
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.outputMode =
- this.getEnumValue(ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE, OutputMode.values());
- this.ddlGenerationType =
- this.getEnumValue(ECLIPSELINK_DDL_GENERATION_TYPE, DdlGenerationType.values());
- this.createFileName =
- this.getStringValue(ECLIPSELINK_CREATE_FILE_NAME);
- this.dropFileName =
- this.getStringValue(ECLIPSELINK_DROP_FILE_NAME);
- this.applicationLocation =
- this.getStringValue(ECLIPSELINK_APPLICATION_LOCATION);
- }
-
- /**
- * Adds property names key/value pairs, where: key = EclipseLink property
- * key; value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE,
- OUTPUT_MODE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_DDL_GENERATION_TYPE,
- DDL_GENERATION_TYPE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CREATE_FILE_NAME,
- CREATE_FILE_NAME_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_DROP_FILE_NAME,
- DROP_FILE_NAME_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_APPLICATION_LOCATION,
- APPLICATION_LOCATION_PROPERTY);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE)) {
- this.outputModeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_TYPE)) {
- this.ddlGenerationTypeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CREATE_FILE_NAME)) {
- this.createFileNameChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DROP_FILE_NAME)) {
- this.dropFileNameChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_APPLICATION_LOCATION)) {
- this.applicationLocationChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE)) {
- this.outputModeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_TYPE)) {
- this.ddlGenerationTypeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CREATE_FILE_NAME)) {
- this.createFileNameChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_DROP_FILE_NAME)) {
- this.dropFileNameChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_APPLICATION_LOCATION)) {
- this.applicationLocationChanged(null);
- }
- }
-
- // ********** DdlGenerationType **********
- public DdlGenerationType getDdlGenerationType() {
- return this.ddlGenerationType;
- }
-
- public void setDdlGenerationType(DdlGenerationType newDdlGenType) {
- DdlGenerationType old = this.ddlGenerationType;
- this.ddlGenerationType = newDdlGenType;
- this.putProperty(DDL_GENERATION_TYPE_PROPERTY, newDdlGenType);
- this.firePropertyChanged(DDL_GENERATION_TYPE_PROPERTY, old, newDdlGenType);
- }
-
- private void ddlGenerationTypeChanged(String stringValue) {
- DdlGenerationType newValue = getEnumValueOf(stringValue, DdlGenerationType.values());
- DdlGenerationType old = this.ddlGenerationType;
- this.ddlGenerationType = newValue;
- this.firePropertyChanged(DDL_GENERATION_TYPE_PROPERTY, old, newValue);
- }
-
- public DdlGenerationType getDefaultDdlGenerationType() {
- return DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE;
- }
-
- // ********** OutputMode **********
- public OutputMode getOutputMode() {
- return this.outputMode;
- }
-
- public void setOutputMode(OutputMode newOutputMode) {
- OutputMode old = this.outputMode;
- this.outputMode = newOutputMode;
- this.putProperty(OUTPUT_MODE_PROPERTY, newOutputMode);
- this.firePropertyChanged(OUTPUT_MODE_PROPERTY, old, newOutputMode);
- }
-
- private void outputModeChanged(String stringValue) {
- OutputMode newValue = getEnumValueOf(stringValue, OutputMode.values());
- OutputMode old = this.outputMode;
- this.outputMode = newValue;
- this.firePropertyChanged(OUTPUT_MODE_PROPERTY, old, newValue);
- }
-
- public OutputMode getDefaultOutputMode() {
- return DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE;
- }
-
- // ********** CreateFileName **********
- public String getCreateFileName() {
- return this.createFileName;
- }
-
- public void setCreateFileName(String newCreateFileName) {
- String old = this.createFileName;
- this.createFileName = newCreateFileName;
- this.putProperty(CREATE_FILE_NAME_PROPERTY, newCreateFileName);
- this.firePropertyChanged(CREATE_FILE_NAME_PROPERTY, old, newCreateFileName);
- }
-
- private void createFileNameChanged(String newValue) {
- String old = this.createFileName;
- this.createFileName = newValue;
- this.firePropertyChanged(CREATE_FILE_NAME_PROPERTY, old, newValue);
- }
-
- public String getDefaultCreateFileName() {
- return DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME;
- }
-
- // ********** dropFileName **********
- public String getDropFileName() {
- return this.dropFileName;
- }
-
- public void setDropFileName(String newDropFileName) {
- String old = this.dropFileName;
- this.dropFileName = newDropFileName;
- this.putProperty(DROP_FILE_NAME_PROPERTY, newDropFileName);
- this.firePropertyChanged(DROP_FILE_NAME_PROPERTY, old, newDropFileName);
- }
-
- private void dropFileNameChanged(String newValue) {
- String old = this.dropFileName;
- this.dropFileName = newValue;
- this.firePropertyChanged(DROP_FILE_NAME_PROPERTY, old, newValue);
- }
-
- public String getDefaultDropFileName() {
- return DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME;
- }
-
- // ********** applicationLocation **********
- public String getApplicationLocation() {
- return this.applicationLocation;
- }
-
- public void setApplicationLocation(String newApplicationLocation) {
- String old = this.applicationLocation;
- this.applicationLocation = (StringTools.stringIsNotEmpty(newApplicationLocation)) ?
- newApplicationLocation :
- this.getDefaultApplicationLocation();
- this.putProperty(APPLICATION_LOCATION_PROPERTY, this.applicationLocation);
- this.firePropertyChanged(APPLICATION_LOCATION_PROPERTY, old, this.applicationLocation);
- }
-
- private void applicationLocationChanged(String newValue) {
- String old = this.applicationLocation;
- this.applicationLocation = newValue;
- this.firePropertyChanged(APPLICATION_LOCATION_PROPERTY, old, newValue);
- }
-
- public String getDefaultApplicationLocation() {
- return DEFAULT_SCHEMA_GENERATION_APPLICATION_LOCATION;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java
deleted file mode 100644
index b06f8ba221..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.internal.JptCoreMessages;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-public abstract class AbstractEclipseLinkDDLGenerator extends AbstractJptGenerator
-{
- public static final String LAUNCH_CONFIG_NAME = "Dali EclipseLink Table Generation"; //$NON-NLS-1$
- public static final String DDL_GEN_PACKAGE_NAME = "org.eclipse.jpt.jpa.eclipselink.core.ddlgen"; //$NON-NLS-1$
- public static final String ECLIPSELINK_DDL_GEN_CLASS = DDL_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
- public static final String ECLIPSELINK_DDL_GEN_JAR_PREFIX = DDL_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
- public static final String BUNDLE_CLASSPATH = "Bundle-ClassPath"; //$NON-NLS-1$
- public static final String PROPERTIES_FILE_NAME = "login.properties"; //$NON-NLS-1$
- public static final String TRUE = "true"; //$NON-NLS-1$
- public static final String FALSE = "false"; //$NON-NLS-1$
- public static final String NONE = "NONE"; //$NON-NLS-1$
-
- private final String puName;
- private final JpaProject jpaProject;
- private final OutputMode outputMode;
-
- // ********** constructors **********
-
- protected AbstractEclipseLinkDDLGenerator(String puName, JpaProject jpaProject, OutputMode outputMode) {
- super(JavaCore.create(jpaProject.getProject()));
- this.puName = puName;
- this.jpaProject = jpaProject;
- this.outputMode = outputMode;
- }
-
- // ********** overrides **********
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected String getMainType() {
- return ECLIPSELINK_DDL_GEN_CLASS;
- }
-
- @Override
- protected String getBootstrapJarPrefix() {
- return ECLIPSELINK_DDL_GEN_JAR_PREFIX;
- }
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- SubMonitor sm = SubMonitor.convert(monitor, 2);
- //disconnect since the runtime provider will need to connect to generate the tables
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp != null) {
- cp.disconnect();
- sm.worked(1);
- }
- sm.setWorkRemaining(1);
- this.saveLoginProperties();
- sm.worked(1);
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- this.reconnect();
- this.validateProject();
- }
-
- // ********** Setting Launch Configuration **********
-
- @Override
- protected void specifyProgramArguments() {
- StringBuffer programArguments = new StringBuffer();
- this.appendPuNameArgument(programArguments);
- this.appendPropertiesFileArgument(programArguments);
- this.appendDebugArgument(programArguments);
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // DDL_GEN jar
- classpath.add(getBootstrapJarClasspathEntry().getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // Osgi Bundles
- classpath.addAll(this.getPersistenceOsgiBundlesMemento());
- // JDBC jar
- classpath.add(this.getJdbcJarClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- return classpath;
- }
-
- // ********** behavior **********
-
- //reconnect since we disconnected in preGenerate();
- //ensure the project is fully updated before validating - bug 277236
- protected void reconnect() {
- getJpaProject().updateAndWait();
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp != null) {
- cp.connect();
- }
- }
-
- protected void validateProject() {
- IProject project = this.getJpaProject().getProject();
- ValidateJob job = new ValidateJob(project);
- job.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(project));
- job.schedule();
- }
-
- // ********** ClasspathEntry **********
-
- private IRuntimeClasspathEntry getJdbcJarClasspathEntry() {
- return getArchiveClasspathEntry(this.buildJdbcJarPath());
- }
-
- private IRuntimeClasspathEntry getBundleClasspathEntry(String bundleId) {
- IPath persistClasspath = this.getBundleClasspath(bundleId);
- IRuntimeClasspathEntry bundleEntry = getArchiveClasspathEntry(persistClasspath);
-
- return bundleEntry;
- }
-
-
- // ********** EclipseLink properties **********
-
- protected void buildConnectionProperties(Properties properties) {
- this.putProperty(properties,
- Connection.ECLIPSELINK_BIND_PARAMETERS,
- FALSE);
- }
-
- private void buildLoggingProperties(Properties properties) {
- this.putProperty(properties,
- Logging.ECLIPSELINK_LEVEL,
- LoggingLevel.FINE);
- this.putProperty(properties,
- Logging.ECLIPSELINK_TIMESTAMP,
- FALSE);
- this.putProperty(properties,
- Logging.ECLIPSELINK_THREAD,
- FALSE);
- this.putProperty(properties,
- Logging.ECLIPSELINK_SESSION,
- FALSE);
- this.putProperty(properties,
- Logging.ECLIPSELINK_EXCEPTIONS,
- TRUE);
- }
-
- protected void buildCustomizationProperties(Properties properties) {
- this.putProperty(properties,
- Customization.ECLIPSELINK_THROW_EXCEPTIONS,
- TRUE);
- }
-
- protected void putProperty(Properties properties, String key, String value) {
- properties.put(key, (value == null) ? "" : value); //$NON-NLS-1$
- }
-
- /**
- * Returns the Property string value of the given property value.
- */
- protected String getPropertyStringValueOf(Object value) {
- if (value == null) {
- return null;
- }
- if (value.getClass().isEnum()) {
- return (String) ReflectionTools.getStaticFieldValue(value.getClass(), value.toString().toUpperCase(Locale.ENGLISH));
- }
- return value.toString();
- }
-
- protected void buildAllProperties(Properties properties) {
- this.buildConnectionProperties(properties);
- this.buildConnectionPoolingProperties(properties);
- this.buildLoggingProperties(properties);
- this.buildCustomizationProperties(properties);
- this.buildDDLModeProperties(properties);
- this.buildProjectLocationProperty(properties);
- }
-
- // ********** private methods **********
-
- private void buildProjectLocationProperty(Properties properties) {
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION,
- this.projectLocation);
- }
-
- private void buildDDLModeProperties(Properties properties) {
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE,
- this.getPropertyStringValueOf(this.outputMode));
-
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE,
- DdlGenerationType.DROP_AND_CREATE_TABLES);
-
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_CREATE_FILE_NAME,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME);
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DROP_FILE_NAME,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME);
- }
-
- private void buildConnectionPoolingProperties(Properties properties) {
- this.putProperty(properties,
- Connection.ECLIPSELINK_READ_CONNECTIONS_SHARED,
- TRUE);
- }
-
- private void saveLoginProperties() {
- String propertiesFile = this.projectLocation + "/" + PROPERTIES_FILE_NAME; //$NON-NLS-1$
-
- Properties elProperties = new Properties();
-
- this.buildAllProperties(elProperties);
- FileOutputStream stream = null;
- try {
- File file = new File(propertiesFile);
- if (!file.exists() && ! file.createNewFile()) {
- throw new RuntimeException("createNewFile() failed: " + file); //$NON-NLS-1$
- }
- stream = new FileOutputStream(file);
- elProperties.store(stream, null);
- }
- catch (Exception e) {
- String message = "Error saving: " + propertiesFile; //$NON-NLS-1$
- throw new RuntimeException(message, e);
- }
- finally {
- this.closeStream(stream);
- }
- }
-
- private void closeStream(OutputStream stream) {
- if (stream != null) {
- try {
- stream.close();
- }
- catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- /**
- * Performs validation after tables have been generated
- */
- private class ValidateJob extends Job
- {
- private IProject project;
-
-
- public ValidateJob(IProject project) {
- super(JptCoreMessages.VALIDATE_JOB);
- this.project = project;
- }
-
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try {
- ValidationFramework.getDefault().validate(
- new IProject[] {this.project}, true, false, monitor);
- }
- catch (CoreException ce) {
- status = Status.CANCEL_STATUS;
- }
- return status;
- }
- }
-
- private IPath buildJdbcJarPath() {
- return new Path(this.getJpaProjectConnectionDriverJarList());
- }
-
- private String getJpaProjectConnectionDriverJarList() {
- ConnectionProfile cp = this.getConnectionProfile();
- return (cp == null) ? "" : cp.getDriverJarList(); //$NON-NLS-1$
- }
-
- // ********** Main arguments **********
-
- private void appendPuNameArgument(StringBuffer sb) {
- sb.append(" -pu \""); //$NON-NLS-1$
- sb.append(this.puName);
- sb.append("\""); //$NON-NLS-1$
- }
-
- private void appendPropertiesFileArgument(StringBuffer sb) {
- sb.append(" -p \""); //$NON-NLS-1$
- sb.append(this.projectLocation).append("/").append(PROPERTIES_FILE_NAME).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-
- // ********** Queries **********
-
- protected JpaPlatform getPlatform() {
- return this.getJpaProject().getJpaPlatform();
- }
-
- protected JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
-
- protected ConnectionProfile getConnectionProfile() {
- return this.getJpaProject().getConnectionProfile();
- }
-
-
- // ********** Bundles *********
-
- private Collection<String> getPersistenceOsgiBundlesMemento() throws CoreException {
-
- Collection<String> result = new HashSet<String>();
- if (javaxPersistenceBundleExists()) {
- result.add(this.getBundleClasspathEntry(JAVAX_PERSISTENCE_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_CORE_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_ASM_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_ANTLR_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_JPA_BUNDLE).getMemento());
- }
- return result;
- }
-
- private IPath getBundleClasspath(String pluginID) {
- Bundle bundle = Platform.getBundle(pluginID);
- if (bundle == null) {
- throw new RuntimeException(pluginID + " cannot be retrieved from the Platform"); //$NON-NLS-1$
- }
- return this.getClassPath(bundle);
- }
-
- private IPath getClassPath(Bundle bundle) {
- String path = bundle.getHeaders().get(BUNDLE_CLASSPATH);
- if (path == null) {
- path = "."; //$NON-NLS-1$
- }
- ManifestElement[] elements = null;
- try {
- elements = ManifestElement.parseHeader(BUNDLE_CLASSPATH, path);
- }
- catch (BundleException e) {
- throw new RuntimeException("Error parsing bundle header: " + bundle, e); //$NON-NLS-1$
- }
- if (elements != null) {
- for (int i = 0; i < elements.length; ++i) {
- ManifestElement element = elements[i];
- String value = element.getValue();
- if (".".equals(value)) { //$NON-NLS-1$
- value = "/"; //$NON-NLS-1$
- }
- URL url = bundle.getEntry(value);
- if (url != null) {
- try {
- URL resolvedURL = FileLocator.resolve(url);
- String filestring = FileLocator.toFileURL(resolvedURL).getFile();
- if (filestring.startsWith("file:")) { //$NON-NLS-1$
- filestring = filestring.substring(filestring.indexOf(':') + 1);
- }
- if (filestring.endsWith("!/")) { //$NON-NLS-1$
- filestring = filestring.substring(0, filestring.lastIndexOf('!'));
- }
- File file = new File(filestring);
- String filePath = file.getCanonicalPath();
- return new Path(filePath);
- }
- catch (IOException e) {
- throw new RuntimeException("Error locating bundle: " + bundle, e); //$NON-NLS-1$
- }
- }
- }
- }
- return null;
- }
-
- private boolean javaxPersistenceBundleExists() {
- return Platform.getBundle(JAVAX_PERSISTENCE_BUNDLE) != null;
- }
-
- // ********** constants **********
-
- private static final String JAVAX_PERSISTENCE_BUNDLE = "javax.persistence"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_CORE_BUNDLE = "org.eclipse.persistence.core"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_ASM_BUNDLE = "org.eclipse.persistence.asm"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_ANTLR_BUNDLE = "org.eclipse.persistence.antlr"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_JPA_BUNDLE = "org.eclipse.persistence.jpa"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java
deleted file mode 100644
index 3fc9c1f91f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;
-
-import java.util.Properties;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-
-/**
- * EclipseLink2_0DLLGenerator launches the EclipseLink DDL generator in a separate VM.
- * For this it will create a Java Configuration named "Dali EclipseLink Table Generation"
- * in the target workspace (note: the configuration will be overridden at each run).
- * It will than launch the configuration created with the login information from
- * the current Dali project, and passes it to EclipseLink.
- *
- * Pre-req in PDE environment:
- * org.eclipse.jpt.jpa.eclipselink.core.ddlgen.jar in ECLIPSE_HOME/plugins
- */
-public class EclipseLink2_0DDLGenerator extends AbstractEclipseLinkDDLGenerator
-{
- static final String VALIDATION_MODE_PROPERTY = "javax.persistence.validation.mode"; //$NON-NLS-1$
-
- // ********** constructors **********
-
- public static void generate(String puName, JpaProject project, OutputMode outputMode, IProgressMonitor monitor) {
- if (puName == null || puName.length() == 0 || project == null) {
- throw new NullPointerException();
- }
- new EclipseLink2_0DDLGenerator(puName, project, outputMode).generate(monitor);
- }
-
- private EclipseLink2_0DDLGenerator(String puName, JpaProject jpaProject, OutputMode outputMode) {
- super(puName, jpaProject, outputMode);
- }
-
- // ********** EclipseLink properties **********
-
- @Override
- protected void buildAllProperties(Properties properties) {
- super.buildAllProperties(properties);
-
- this.putProperty(properties,
- VALIDATION_MODE_PROPERTY,
- NONE);
- }
-
- @Override
- protected void buildCustomizationProperties(Properties properties) {
- super.buildCustomizationProperties(properties);
-
- this.putProperty(properties,
- Customization.ECLIPSELINK_WEAVING,
- FALSE);
- }
-
- @Override
- protected void buildConnectionProperties(Properties properties) {
- super.buildConnectionProperties(properties);
- ConnectionProfile cp = this.getConnectionProfile();
-
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_DRIVER,
- (cp == null) ? "" : cp.getDriverClassName()); //$NON-NLS-1$
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_URL,
- (cp == null) ? "" : cp.getURL()); //$NON-NLS-1$
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_USER,
- (cp == null) ? "" : cp.getUserName()); //$NON-NLS-1$
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD,
- (cp == null) ? "" : cp.getUserPassword()); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java
deleted file mode 100644
index 8fa4666e07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;
-
-import java.util.Properties;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-
-/**
- * EclipseLinkDLLGenerator launches the EclipseLink DDL generator in a separate VM.
- * For this it will create a Java Configuration named "Dali EclipseLink Table Generation"
- * in the target workspace (note: the configuration will be overridden at each run).
- * It will than launch the configuration created with the login information from
- * the current Dali project, and passes it to EclipseLink.
- *
- * Pre-req in PDE environment:
- * org.eclipse.jpt.jpa.eclipselink.core.ddlgen.jar in ECLIPSE_HOME/plugins
- */
-public class EclipseLinkDDLGenerator extends AbstractEclipseLinkDDLGenerator
-{
-
- // ********** constructors **********
-
- public static void generate(String puName, JpaProject project, OutputMode outputMode, IProgressMonitor monitor) {
- if (puName == null || puName.length() == 0 || project == null) {
- throw new NullPointerException();
- }
- new EclipseLinkDDLGenerator(puName, project, outputMode).generate(monitor);
- }
-
- private EclipseLinkDDLGenerator(String puName, JpaProject jpaProject, OutputMode outputMode) {
- super(puName, jpaProject, outputMode);
- }
-
- @Override
- protected void buildConnectionProperties(Properties properties) {
- super.buildConnectionProperties(properties);
- ConnectionProfile cp = this.getConnectionProfile();
-
- this.putProperty(properties,
- Connection.ECLIPSELINK_DRIVER,
- (cp == null) ? "" : cp.getDriverClassName()); //$NON-NLS-1$
- this.putProperty(properties,
- Connection.ECLIPSELINK_URL,
- (cp == null) ? "" : cp.getURL()); //$NON-NLS-1$
- this.putProperty(properties,
- Connection.ECLIPSELINK_USER,
- (cp == null) ? "" : cp.getUserName()); //$NON-NLS-1$
- this.putProperty(properties,
- Connection.ECLIPSELINK_PASSWORD,
- (cp == null) ? "" : cp.getUserPassword()); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java
deleted file mode 100644
index 451eaf1435..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.libval;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.internal.libprov.JpaOsgiBundlesLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.internal.libval.AbstractOsgiBundlesLibraryValidator;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.osgi.service.resolver.VersionRange;
-
-public class EclipseLinkEclipseLinkBundlesLibraryValidator
- extends AbstractOsgiBundlesLibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
- JpaOsgiBundlesLibraryProviderInstallOperationConfig jpaConfig
- = (JpaOsgiBundlesLibraryProviderInstallOperationConfig) config;
- Map<String, VersionRange[]> bundleVersionRanges = new HashMap<String, VersionRange[]>();
- JpaPlatformDescription platform = jpaConfig.getJpaPlatform();
- if (EclipseLinkPlatform.VERSION_1_0.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_1.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_2.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_0.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_1.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_2.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_3.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_4.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- }
-
- return validate(jpaConfig, bundleVersionRanges);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java
deleted file mode 100644
index edfdad3057..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.libval;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.eclipselink.core.internal.libval.EclipseLinkLibValUtil;
-import org.eclipse.jpt.jpa.core.internal.libprov.JpaUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.osgi.service.resolver.VersionRange;
-
-/**
- * Library validator for EclipseLink user libraries.
- *
- * In order to validate that the correct eclipselink.jar is present in the user library, the version
- * class which appears in standard EclipseLink libraries will be examined and compared against the
- * union of calculated version ranges, depending on the platform specified in the config.
- */
-public class EclipseLinkUserLibraryValidator
- implements LibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
- JpaUserLibraryProviderInstallOperationConfig jpaConfig
- = (JpaUserLibraryProviderInstallOperationConfig) config;
- JpaPlatformDescription platform = jpaConfig.getJpaPlatform();
- Set<VersionRange> versionRanges = new HashSet<VersionRange>();
-
- if (EclipseLinkPlatform.VERSION_1_0.equals(platform)) {
- versionRanges.add(new VersionRange("[1.0, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_1.equals(platform)) {
- versionRanges.add(new VersionRange("[1.1, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_2.equals(platform)) {
- versionRanges.add(new VersionRange("[1.2, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_0.equals(platform)) {
- versionRanges.add(new VersionRange("[2.0, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_1.equals(platform)) {
- versionRanges.add(new VersionRange("[2.1, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_2.equals(platform)) {
- versionRanges.add(new VersionRange("[2.2, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_3.equals(platform)) {
- versionRanges.add(new VersionRange("[2.3, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_4.equals(platform)) {
- versionRanges.add(new VersionRange("[2.4, 3.0)")); //$NON-NLS-1$
- }
-
- return EclipseLinkLibValUtil.validate(jpaConfig.resolve(), versionRanges);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
deleted file mode 100644
index 25e4011de1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.operations;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-
-public class EclipseLinkOrmFileCreationDataModelProvider
- extends OrmFileCreationDataModelProvider
-{
- /**
- * required default constructor
- */
- public EclipseLinkOrmFileCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public IDataModelOperation getDefaultOperation() {
- return new EclipseLinkOrmFileCreationOperation(getDataModel());
- }
-
- @Override
- protected String getDefaultFileName() {
- return JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment();
- }
-
- @Override
- protected String getDefaultVersion() {
- if (getProject() == null) {
- return null;
- }
- try {
- return getJpaProject().getJpaPlatform().getMostRecentSupportedResourceType(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE).getVersion();
- }
- catch (IllegalArgumentException iae) {
- // eclipselink content not supported for project
- return null;
- }
- }
-
- @Override
- protected boolean fileVersionSupported(String fileVersion) {
- return fileVersion.equals(EclipseLink.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink1_1.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink1_2.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_0.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_1.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_2.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_3.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_4.SCHEMA_VERSION);
- }
-
- @Override
- protected boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion) {
- // assume that platform has been policed for facet version already
- return true;
- }
-
- @Override
- protected boolean isSupportedPlatformId(String id) {
- JpaPlatformDescription platform = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(id);
- if (platform == null) {
- return false;
- }
- return EclipseLinkPlatform.GROUP.equals(platform.getGroup());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java
deleted file mode 100644
index 06573a32b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.operations;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationOperation;
-import org.eclipse.jpt.jpa.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm.EclipseLinkOrmXmlResourceProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EclipseLinkOrmFileCreationOperation extends OrmFileCreationOperation
-{
- public EclipseLinkOrmFileCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
-
- @Override
- protected AbstractXmlResourceProvider getXmlResourceProvider(IFile file) {
- return EclipseLinkOrmXmlResourceProvider.getXmlResourceProvider(file);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java
deleted file mode 100644
index ad504bf147..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicCollectionAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicCollectionAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public class EclipseLinkBasicCollectionAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkBasicCollectionAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkBasicCollectionAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkBasicCollectionAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkBasicCollectionAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java
deleted file mode 100644
index 24edc251d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicMapAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicMapAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public class EclipseLinkBasicMapAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkBasicMapAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkBasicMapAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkBasicMapAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkBasicMapAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java
deleted file mode 100644
index 8932478ef8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Cache
- */
-public class EclipseLinkCacheAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkCacheAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkCacheAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkCacheAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkCacheAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkCacheAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkCacheAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java
deleted file mode 100644
index 6e9f5ed41a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ChangeTracking
- */
-public class EclipseLinkChangeTrackingAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkChangeTrackingAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkChangeTrackingAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkChangeTrackingAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkChangeTrackingAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java
deleted file mode 100644
index 78e87d2be3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-
-/**
- * org.eclipse.persistence.annotations.ClassExtractor
- */
-public class EclipseLinkClassExtractor2_1AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkClassExtractor2_1AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkClassExtractor2_1AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkClassExtractorAnnotation2_1(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkClassExtractorAnnotation2_1(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java
deleted file mode 100644
index 3ff2c2a540..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- */
-public class EclipseLinkConvertAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkConvertAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkConvertAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkConvertAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkConvertAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkConvertAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java
deleted file mode 100644
index 40c08a1a10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Converter
- */
-public class EclipseLinkConverterAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkConverterAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkConverterAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java
deleted file mode 100644
index d90ab00882..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Customizer
- */
-public class EclipseLinkCustomizerAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkCustomizerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkCustomizerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkCustomizerAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkCustomizerAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkCustomizerAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java
deleted file mode 100644
index 5a46c5fd4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ExistenceChecking
- */
-public class EclipseLinkExistenceCheckingAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkExistenceCheckingAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkExistenceCheckingAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkExistenceCheckingAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkExistenceCheckingAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java
deleted file mode 100644
index b9965fd207..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.JoinFetch
- */
-public class EclipseLinkJoinFetchAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkJoinFetchAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkJoinFetchAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkJoinFetchAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkJoinFetchAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkJoinFetchAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java
deleted file mode 100644
index 6ea716b774..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMapKeyConvertAnnotation2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMapKeyConvertAnnotation2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-/**
- * org.eclipse.persistence.annotations.MapKeyConvert
- */
-public class EclipseLinkMapKeyConvert2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkMapKeyConvert2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkMapKeyConvert2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkMapKeyConvertAnnotation2_0(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkMapKeyConvertAnnotation2_0(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java
deleted file mode 100644
index 2407058445..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-
-public class EclipseLinkMultitenant2_3AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE
- = new EclipseLinkMultitenant2_3AnnotationDefinition();
-
-
- /**
- * Return the singleton
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkMultitenant2_3AnnotationDefinition() {
- super();
- }
-
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkMultitenantAnnotation2_3(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkMultitenantAnnotation2_3(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkMultitenantAnnotation2_3(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java
deleted file mode 100644
index 448bcf6502..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Mutable
- */
-public class EclipseLinkMutableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkMutableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkMutableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkMutableAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkMutableAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMutableAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java
deleted file mode 100644
index fcb2dfbe7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- */
-public class EclipseLinkObjectTypeConverterAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkObjectTypeConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkObjectTypeConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkObjectTypeConverterAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkObjectTypeConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java
deleted file mode 100644
index 73e41c3798..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkPrimaryKeyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkPrimaryKeyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-public class EclipseLinkPrimaryKeyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE
- = new EclipseLinkPrimaryKeyAnnotationDefinition();
-
-
- /**
- * Return the singleton
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPrimaryKeyAnnotationDefinition() {
- super();
- }
-
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkPrimaryKeyAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkPrimaryKeyAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkPrimaryKeyAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java
deleted file mode 100644
index cd6847e3bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public class EclipseLinkPrivateOwnedAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkPrivateOwnedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkPrivateOwnedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkPrivateOwnedAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkPrivateOwnedAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java
deleted file mode 100644
index 402a0c5fb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public class EclipseLinkReadOnlyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkReadOnlyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkReadOnlyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkReadOnlyAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkReadOnlyAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java
deleted file mode 100644
index 94ff51b4a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public class EclipseLinkReadTransformerAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkReadTransformerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkReadTransformerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkReadTransformerAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkReadTransformerAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkReadTransformerAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java
deleted file mode 100644
index b8993247eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.StructConverter
- */
-public class EclipseLinkStructConverterAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkStructConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkStructConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkStructConverterAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkStructConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkStructConverterAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java
deleted file mode 100644
index 404489cd64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-public class EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition
- implements NestableAnnotationDefinition
-{
- // singleton
- private static final NestableAnnotationDefinition INSTANCE
- = new EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition();
-
-
- /**
- * Return the singleton
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition() {
- super();
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.buildSourceTenantDiscriminatorColumnAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3(parent, jdtAnnotation);
- }
-
- public String getNestableAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
- public String getContainerAnnotationName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMNS;
- }
-
- public String getElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMNS__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java
deleted file mode 100644
index 38f9023a61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-public final class EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMNS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java
deleted file mode 100644
index 0d27fb0462..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTransformationAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTransformationAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public class EclipseLinkTransformationAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkTransformationAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkTransformationAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkTransformationAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkTransformationAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkTransformationAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java
deleted file mode 100644
index 540ed98b72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverter
- */
-public class EclipseLinkTypeConverterAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkTypeConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkTypeConverterAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkTypeConverterAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkTypeConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java
deleted file mode 100644
index bd2b0d5fff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkVariableOneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkVariableOneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public class EclipseLinkVariableOneToOneAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkVariableOneToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkVariableOneToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkVariableOneToOneAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkVariableOneToOneAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java
deleted file mode 100644
index 13773e428b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkWriteTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkWriteTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.WriteTransformer
- */
-public class EclipseLinkWriteTransformerAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkWriteTransformerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkWriteTransformerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkWriteTransformerAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkWriteTransformerAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkWriteTransformerAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java
deleted file mode 100644
index 32fd488efc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Cache</code>
- */
-public final class NullEclipseLinkCacheAnnotation
- extends NullAnnotation<EclipseLinkCacheAnnotation>
- implements EclipseLinkCacheAnnotation
-{
- protected NullEclipseLinkCacheAnnotation(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** type
- public CacheType getType() {
- return null;
- }
-
- public void setType(CacheType type) {
- if (type != null) {
- this.addAnnotation().setType(type);
- }
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** size
- public Integer getSize() {
- return null;
- }
-
- public void setSize(Integer size) {
- if (size != null) {
- this.addAnnotation().setSize(size);
- }
- }
-
- public TextRange getSizeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** shared
- public Boolean getShared() {
- return null;
- }
-
- public void setShared(Boolean shared) {
- if (shared != null) {
- this.addAnnotation().setShared(shared);
- }
- }
-
- public TextRange getSharedTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** always refresh
- public Boolean getAlwaysRefresh() {
- return null;
- }
-
- public void setAlwaysRefresh(Boolean alwaysRefresh) {
- if (alwaysRefresh != null) {
- this.addAnnotation().setAlwaysRefresh(alwaysRefresh);
- }
- }
-
- public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** refresh only if newer
- public Boolean getRefreshOnlyIfNewer() {
- return null;
- }
-
- public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- if (refreshOnlyIfNewer != null) {
- this.addAnnotation().setRefreshOnlyIfNewer(refreshOnlyIfNewer);
- }
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** disable hits
- public Boolean getDisableHits() {
- return null;
- }
-
- public void setDisableHits(Boolean disableHits) {
- if (disableHits != null) {
- this.addAnnotation().setDisableHits(disableHits);
- }
- }
-
- public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** coordination type
- public CacheCoordinationType getCoordinationType() {
- return null;
- }
-
- public void setCoordinationType(CacheCoordinationType coordinationType) {
- if (coordinationType != null) {
- this.addAnnotation().setCoordinationType(coordinationType);
- }
- }
-
- public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** expiry
- public Integer getExpiry() {
- return null;
- }
-
- public void setExpiry(Integer expiry) {
- if (expiry != null) {
- this.addAnnotation().setExpiry(expiry);
- }
- }
-
- public TextRange getExpiryTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** expiry time of day
- public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() {
- return null;
- }
-
- public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() {
- return this.addAnnotation().addExpiryTimeOfDay();
- }
-
- public void removeExpiryTimeOfDay() {
- // do nothing
- }
-
- public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-
- // ***** isolation
- public CacheIsolationType2_2 getIsolation() {
- return null;
- }
-
- public void setIsolation(CacheIsolationType2_2 isolation) {
- if (isolation != null) {
- this.addAnnotation().setIsolation(isolation);
- }
- }
-
- public TextRange getIsolationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index e29ecd3062..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * <code>org.eclipse.persistence.annotations.JoinFetch</code>
- */
-public final class NullEclipseLinkJoinFetchAnnotation
- extends NullAnnotation<EclipseLinkJoinFetchAnnotation>
- implements EclipseLinkJoinFetchAnnotation
-{
- protected NullEclipseLinkJoinFetchAnnotation(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** value
- public JoinFetchType getValue() {
- return null;
- }
-
- public void setValue(JoinFetchType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index d4bbcf9b16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-/**
- * <code>org.eclipse.persistence.annotations.Multitenant</code>
- */
-public final class NullEclipseLinkMultitenantAnnotation2_3
- extends NullAnnotation<EclipseLinkMultitenantAnnotation2_3>
- implements EclipseLinkMultitenantAnnotation2_3
-{
- protected NullEclipseLinkMultitenantAnnotation2_3(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public boolean isSpecified() {
- return false;
- }
-
- // ***** type
- public MultitenantType2_3 getValue() {
- return null;
- }
-
- public void setValue(MultitenantType2_3 value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-// // ***** include criteria
-// public Boolean getIncludeCriteria() {
-// return null;
-// }
-//
-// public void setIncludeCriteria(Boolean includeCriteria) {
-// if (includeCriteria != null) {
-// this.addAnnotation().setIncludeCriteria(includeCriteria);
-// }
-// }
-//
-// public TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot) {
-// return null;
-// }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index c5170d1680..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.resource.java.NullBaseDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * <code>org.eclipse.persistence.annotations.TenantDiscriminatorColumn</code>
- */
-public final class NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends NullBaseDiscriminatorColumnAnnotation<EclipseLinkTenantDiscriminatorColumnAnnotation2_3>
- implements EclipseLinkTenantDiscriminatorColumnAnnotation2_3
-{
- public NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
- // ***** context property
- public String getContextProperty() {
- return null;
- }
-
- public void setContextProperty(String contextProperty) {
- if (contextProperty != null) {
- this.addAnnotation().setContextProperty(contextProperty);
- }
- }
-
- public TextRange getContextPropertyTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** table
- public String getTable() {
- return null;
- }
-
- public void setTable(String table) {
- if (table != null) {
- this.addAnnotation().setTable(table);
- }
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** primary key
- public Boolean getPrimaryKey() {
- return null;
- }
-
- public void setPrimaryKey(Boolean primaryKey) {
- if (primaryKey != null) {
- this.addAnnotation().setPrimaryKey(primaryKey);
- }
- }
-
- public TextRange getPrimaryKeyTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index a319a9707e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Transformation</code>
- */
-public final class NullEclipseLinkTransformationAnnotation
- extends NullAnnotation<EclipseLinkTransformationAnnotation>
- implements EclipseLinkTransformationAnnotation
-{
- protected NullEclipseLinkTransformationAnnotation(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** fetch
- public FetchType getFetch() {
- return null;
- }
-
- public void setFetch(FetchType fetch) {
- if (fetch != null) {
- this.addAnnotation().setFetch(fetch);
- }
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** optional
- public Boolean getOptional() {
- return null;
- }
-
- public void setOptional(Boolean optional) {
- if (optional != null) {
- this.addAnnotation().setOptional(optional);
- }
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java
deleted file mode 100644
index c508768725..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.internal.resource.java.NullColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * <code>javax.persistence.Column</code>
- */
-public final class NullEclipseLinkWriteTransformerColumnAnnotation
- extends NullColumnAnnotation
-{
- public NullEclipseLinkWriteTransformerColumnAnnotation(EclipseLinkWriteTransformerAnnotation parent) {
- super(parent);
- }
-
- private EclipseLinkWriteTransformerAnnotation getWriteTransformerAnnotation() {
- return (EclipseLinkWriteTransformerAnnotation) this.parent;
- }
-
- @Override
- protected ColumnAnnotation addAnnotation() {
- return this.getWriteTransformerAnnotation().addColumn();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkConvertAnnotation.java
deleted file mode 100644
index 1abb8bfd89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- * org.eclipse.persistence.annotations.MapKeyConvert
- */
-public abstract class BinaryBaseEclipseLinkConvertAnnotation
- extends BinaryAnnotation
- implements EclipseLinkConvertAnnotation
-{
- private String value;
-
- protected BinaryBaseEclipseLinkConvertAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** ConvertAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(this.getValueElementName());
- }
-
- protected abstract String getValueElementName();
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index b3cbed86e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.BaseEclipseLinkTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- * org.eclipse.persistence.annotations.TypeConverter
- */
-abstract class BinaryBaseEclipseLinkTypeConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements BaseEclipseLinkTypeConverterAnnotation
-{
- String dataType;
- String objectType;
-
-
- BinaryBaseEclipseLinkTypeConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.dataType = this.buildDataType();
- this.objectType = this.buildObjectType();
- }
-
- @Override
- public void update() {
- super.update();
- this.setDataType_(this.buildDataType());
- this.setObjectType_(this.buildObjectType());
- }
-
-
- // ********** ObjectTypeConverterAnnotation implementation **********
-
- // ***** data type
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- throw new UnsupportedOperationException();
- }
-
- private void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
- public String getFullyQualifiedDataType() {
- return this.dataType;
- }
-
- private String buildDataType() {
- return (String) this.getJdtMemberValue(this.getDataTypeElementName());
- }
-
- public TextRange getDataTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- abstract String getDataTypeElementName();
-
- // ***** object type
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- throw new UnsupportedOperationException();
- }
-
- private void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- public String getFullyQualifiedObjectType() {
- return this.objectType;
- }
-
- private String buildObjectType() {
- return (String) this.getJdtMemberValue(this.getObjectTypeElementName());
- }
-
- public TextRange getObjectTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- abstract String getObjectTypeElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index b3db1a0770..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public final class BinaryEclipseLinkBasicCollectionAnnotation
- extends BinaryAnnotation
- implements EclipseLinkBasicCollectionAnnotation
-{
- public BinaryEclipseLinkBasicCollectionAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 90a6124b89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public final class BinaryEclipseLinkBasicMapAnnotation
- extends BinaryAnnotation
- implements EclipseLinkBasicMapAnnotation
-{
- public BinaryEclipseLinkBasicMapAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java
deleted file mode 100644
index fa1823fddd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Cache
- */
-public final class BinaryEclipseLinkCacheAnnotation
- extends BinaryAnnotation
- implements EclipseLinkCacheAnnotation
-{
- private CacheType type;
- private Integer size;
- private Boolean shared;
- private Integer expiry;
- private EclipseLinkTimeOfDayAnnotation expiryTimeOfDay;
- private Boolean alwaysRefresh;
- private Boolean refreshOnlyIfNewer;
- private Boolean disableHits;
- private CacheCoordinationType coordinationType;
- private CacheIsolationType2_2 isolation;
-
-
- public BinaryEclipseLinkCacheAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.type = this.buildType();
- this.size = this.buildSize();
- this.shared = this.buildShared();
- this.expiry = this.buildExpiry();
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
- this.alwaysRefresh = this.buildAlwaysRefresh();
- this.refreshOnlyIfNewer = this.buildRefreshOnlyIfNewer();
- this.disableHits = this.buildDisableHits();
- this.coordinationType = this.buildCoordinationType();
- this.isolation = this.buildIsolation();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // TODO
- @Override
- public void update() {
- super.update();
- this.setType_(this.buildType());
- this.setSize_(this.buildSize());
- this.setShared_(this.buildShared());
- this.setExpiry_(this.buildExpiry());
- this.updateExpiryTimeOfDay();
- this.setAlwaysRefresh_(this.buildAlwaysRefresh());
- this.setRefreshOnlyIfNewer_(this.buildRefreshOnlyIfNewer());
- this.setDisableHits_(this.buildDisableHits());
- this.setCoordinationType_(this.buildCoordinationType());
- this.setIsolation_(this.buildIsolation());
- }
-
-
- // ********** CacheAnnotation implementation **********
-
- // ***** type
- public CacheType getType() {
- return this.type;
- }
-
- public void setType(CacheType type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(CacheType type) {
- CacheType old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- }
-
- private CacheType buildType() {
- return CacheType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__TYPE));
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** size
- public Integer getSize() {
- return this.size;
- }
-
- public void setSize(Integer size) {
- throw new UnsupportedOperationException();
- }
-
- private void setSize_(Integer size) {
- Integer old = this.size;
- this.size = size;
- this.firePropertyChanged(SIZE_PROPERTY, old, size);
- }
-
- private Integer buildSize() {
- return (Integer) this.getJdtMemberValue(EclipseLink.CACHE__SIZE);
- }
-
- public TextRange getSizeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** shared
- public Boolean getShared() {
- return this.shared;
- }
-
- public void setShared(Boolean shared) {
- throw new UnsupportedOperationException();
- }
-
- private void setShared_(Boolean shared) {
- Boolean old = this.shared;
- this.shared = shared;
- this.firePropertyChanged(SHARED_PROPERTY, old, shared);
- }
-
- private Boolean buildShared() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__SHARED);
- }
-
- public TextRange getSharedTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** expiry
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- throw new UnsupportedOperationException();
- }
-
- private void setExpiry_(Integer expiry) {
- Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
- }
-
- private Integer buildExpiry() {
- return (Integer) this.getJdtMemberValue(EclipseLink.CACHE__EXPIRY);
- }
-
- public TextRange getExpiryTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** expiry time of day
- public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() {
- throw new UnsupportedOperationException();
- }
-
- public void removeExpiryTimeOfDay() {
- throw new UnsupportedOperationException();
- }
-
- private EclipseLinkTimeOfDayAnnotation buildExpiryTimeOfDay() {
- IAnnotation jdtTimeOfDay = this.getJdtExpiryTimeOfDay();
- return (jdtTimeOfDay == null) ? null : this.buildTimeOfDay(jdtTimeOfDay);
- }
-
- private EclipseLinkTimeOfDayAnnotation buildTimeOfDay(IAnnotation jdtTimeOfDay) {
- return new BinaryEclipseLinkTimeOfDayAnnotation(this, jdtTimeOfDay);
- }
-
- private IAnnotation getJdtExpiryTimeOfDay() {
- return (IAnnotation) this.getJdtMemberValue(EclipseLink.CACHE__EXPIRY_TIME_OF_DAY);
- }
-
- private void setExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation expiryTimeOfDay) {
- EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = expiryTimeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, expiryTimeOfDay);
- }
-
- // TODO
- private void updateExpiryTimeOfDay() {
- throw new UnsupportedOperationException();
-// IAnnotation jdtTimeOfDay = this.getJdtExpiryTimeOfDay();
-// if (jdtTimeOfDay == null) {
-// this.setExpiryTimeOfDay(null);
-// } else {
-// if (this.expiryTimeOfDay == null) {
-// this.setExpiryTimeOfDay(this.buildTimeOfDay(jdtTimeOfDay));
-// } else {
-// this.expiryTimeOfDay.update(jdtTimeOfDay);
-// }
-// }
- }
-
- public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** always refresh
- public Boolean getAlwaysRefresh() {
- return this.alwaysRefresh;
- }
-
- public void setAlwaysRefresh(Boolean alwaysRefresh) {
- throw new UnsupportedOperationException();
- }
-
- private void setAlwaysRefresh_(Boolean alwaysRefresh) {
- Boolean old = this.alwaysRefresh;
- this.alwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
- private Boolean buildAlwaysRefresh() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__ALWAYS_REFRESH);
- }
-
- public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** refresh only if newer
- public Boolean getRefreshOnlyIfNewer() {
- return this.refreshOnlyIfNewer;
- }
-
- public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- throw new UnsupportedOperationException();
- }
-
- private void setRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
- Boolean old = this.refreshOnlyIfNewer;
- this.refreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
- private Boolean buildRefreshOnlyIfNewer() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER);
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** disable hits
- public Boolean getDisableHits() {
- return this.disableHits;
- }
-
- public void setDisableHits(Boolean disableHits) {
- throw new UnsupportedOperationException();
- }
-
- private void setDisableHits_(Boolean disableHits) {
- Boolean old = this.disableHits;
- this.disableHits = disableHits;
- this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
- private Boolean buildDisableHits() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__DISABLE_HITS);
- }
-
- public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** coordination type
- public CacheCoordinationType getCoordinationType() {
- return this.coordinationType;
- }
-
- public void setCoordinationType(CacheCoordinationType coordinationType) {
- throw new UnsupportedOperationException();
- }
-
- private void setCoordinationType_(CacheCoordinationType coordinationType) {
- CacheCoordinationType old = this.coordinationType;
- this.coordinationType = coordinationType;
- this.firePropertyChanged(TYPE_PROPERTY, old, coordinationType);
- }
-
- private CacheCoordinationType buildCoordinationType() {
- return CacheCoordinationType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__COORDINATION_TYPE));
- }
-
- public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** isolation
- public CacheIsolationType2_2 getIsolation() {
- return this.isolation;
- }
-
- public void setIsolation(CacheIsolationType2_2 isolation) {
- throw new UnsupportedOperationException();
- }
-
- private void setIsolation_(CacheIsolationType2_2 isolation) {
- CacheIsolationType2_2 old = this.isolation;
- this.isolation = isolation;
- this.firePropertyChanged(ISOLATION_PROPERTY, old, isolation);
- }
-
- private CacheIsolationType2_2 buildIsolation() {
- return CacheIsolationType2_2.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__ISOLATION));
- }
-
- public TextRange getIsolationTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index 3fbfd3dcf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ChangeTracking
- */
-public final class BinaryEclipseLinkChangeTrackingAnnotation
- extends BinaryAnnotation
- implements EclipseLinkChangeTrackingAnnotation
-{
- private ChangeTrackingType value;
-
-
- public BinaryEclipseLinkChangeTrackingAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // TODO
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** ChangeTrackingAnnotation implementation **********
-
- // ***** value
- public ChangeTrackingType getValue() {
- return this.value;
- }
-
- public void setValue(ChangeTrackingType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(ChangeTrackingType value) {
- ChangeTrackingType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private ChangeTrackingType buildValue() {
- return ChangeTrackingType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CHANGE_TRACKING__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index a7860cb76b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-
-/**
- * org.eclipse.persistence.annotations.ClassExtractor
- */
-public final class BinaryEclipseLinkClassExtractorAnnotation2_1
- extends BinaryAnnotation
- implements EclipseLinkClassExtractorAnnotation2_1
-{
- private String value;
-
-
- public BinaryEclipseLinkClassExtractorAnnotation2_1(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** EclipseLinkClassExtractorAnnotation2_1 implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CLASS_EXTRACTOR__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified class name
- /**
- * binary is already fully-qualified
- */
- public String getFullyQualifiedClassName() {
- return this.value;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index 25d07da0ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ConversionValue
- */
-final class BinaryEclipseLinkConversionValueAnnotation
- extends BinaryAnnotation
- implements EclipseLinkConversionValueAnnotation
-{
- private String dataValue;
- private String objectValue;
-
-
- BinaryEclipseLinkConversionValueAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.dataValue = this.buildDataValue();
- this.objectValue = this.buildObjectValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setDataValue_(this.buildDataValue());
- this.setObjectValue_(this.buildObjectValue());
- }
-
-
- // ********** ConversionValueAnnotation implementation **********
-
- // ***** data value
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String dataValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDataValue_(String dataValue) {
- String old = this.dataValue;
- this.dataValue = dataValue;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, dataValue);
- }
-
- private String buildDataValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CONVERSION_VALUE__DATA_VALUE);
- }
-
- public TextRange getDataValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** object value
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String objectValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setObjectValue_(String objectValue) {
- String old = this.objectValue;
- this.objectValue = objectValue;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, objectValue);
- }
-
- private String buildObjectValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CONVERSION_VALUE__OBJECT_VALUE);
- }
-
- public TextRange getObjectValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java
deleted file mode 100644
index c78feb57ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- */
-public final class BinaryEclipseLinkConvertAnnotation
- extends BinaryBaseEclipseLinkConvertAnnotation
-{
-
- public BinaryEclipseLinkConvertAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.CONVERT__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java
deleted file mode 100644
index 131832ded7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Converter
- */
-public final class BinaryEclipseLinkConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements EclipseLinkConverterAnnotation
-{
- private String converterClass;
-
-
- public BinaryEclipseLinkConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.converterClass = this.buildConverterClass();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setConverterClass_(this.buildConverterClass());
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.CONVERTER__NAME;
- }
-
- // ********** ConverterAnnotation implementation **********
-
- // ***** converter class
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setConverterClass_(String converterClass) {
- String old = this.converterClass;
- this.converterClass = converterClass;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, converterClass);
- }
-
- public String getFullyQualifiedConverterClassName() {
- return this.converterClass;
- }
-
- private String buildConverterClass() {
- return (String) this.getJdtMemberValue(EclipseLink.CONVERTER__CONVERTER_CLASS);
- }
-
- public TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index 32d51d8aff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Customizer
- */
-public final class BinaryEclipseLinkCustomizerAnnotation
- extends BinaryAnnotation
- implements EclipseLinkCustomizerAnnotation
-{
- private String value;
-
-
- public BinaryEclipseLinkCustomizerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** CustomizerAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- // ***** fully-qualified customizer class name
- public String getFullyQualifiedCustomizerClassName() {
- return this.value;
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CUSTOMIZER__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index 09ab28c7ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType;
-
-/**
- * org.eclipse.persistence.annotations.ExistenceChecking
- */
-public final class BinaryEclipseLinkExistenceCheckingAnnotation
- extends BinaryAnnotation
- implements EclipseLinkExistenceCheckingAnnotation
-{
- private ExistenceType value;
-
-
- public BinaryEclipseLinkExistenceCheckingAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** ExistenceCheckingAnnotation implementation **********
-
- // ***** value
- public ExistenceType getValue() {
- return this.value;
- }
-
- public void setValue(ExistenceType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(ExistenceType value) {
- ExistenceType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private ExistenceType buildValue() {
- return ExistenceType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.EXISTENCE_CHECKING__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index 978caf3279..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * org.eclipse.persistence.annotations.JoinFetch
- */
-public final class BinaryEclipseLinkJoinFetchAnnotation
- extends BinaryAnnotation
- implements EclipseLinkJoinFetchAnnotation
-{
- private JoinFetchType value;
-
-
- public BinaryEclipseLinkJoinFetchAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** BinaryJoinFetchAnnotation implementation **********
-
- // ***** value
- public JoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(JoinFetchType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(JoinFetchType value) {
- JoinFetchType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private JoinFetchType buildValue() {
- return JoinFetchType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.JOIN_FETCH__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java
deleted file mode 100644
index 6e4eeec07d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-/**
- * org.eclipse.persistence.annotations.MapKeyConvert
- */
-public final class BinaryEclipseLinkMapKeyConvertAnnotation2_0
- extends BinaryBaseEclipseLinkConvertAnnotation
- implements EclipseLinkMapKeyConvertAnnotation2_0
-{
-
- public BinaryEclipseLinkMapKeyConvertAnnotation2_0(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.MAP_KEY_CONVERT__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index 00d5ecc58c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-/**
- * org.eclipse.persistence.annotations.Multitenant
- */
-public class BinaryEclipseLinkMultitenantAnnotation2_3
- extends BinaryAnnotation
- implements EclipseLinkMultitenantAnnotation2_3
-{
- private MultitenantType2_3 value;
-// private Boolean includeCriteria; // added in EclipseLink 2.4
-
-
- public BinaryEclipseLinkMultitenantAnnotation2_3(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
-// this.includeCriteria = this.buildIncludeCriteria();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
-// this.setIncludeCriteria_(this.buildIncludeCriteria());
- }
-
-
- // ********** EclipseLinkMultitenantAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** value
- public MultitenantType2_3 getValue() {
- return this.value;
- }
-
- public void setValue(MultitenantType2_3 value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(MultitenantType2_3 value) {
- MultitenantType2_3 old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private MultitenantType2_3 buildValue() {
- return MultitenantType2_3.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.JOIN_FETCH__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-// // ***** include criteria
-// public Boolean getIncludeCriteria() {
-// return this.includeCriteria;
-// }
-//
-// public void setIncludeCriteria(Boolean includeCriteria) {
-// throw new UnsupportedOperationException();
-// }
-//
-// private void setIncludeCriteria_(Boolean includeCriteria) {
-// Boolean old = this.includeCriteria;
-// this.includeCriteria = includeCriteria;
-// this.firePropertyChanged(INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
-// }
-//
-// private Boolean buildIncludeCriteria() {
-// return (Boolean) this.getJdtMemberValue(EclipseLink.MULTITENANT__INCLUDE_CRITERIA);
-// }
-//
-// public TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot) {
-// throw new UnsupportedOperationException();
-// }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java
deleted file mode 100644
index caeb0a36f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Mutable
- */
-public final class BinaryEclipseLinkMutableAnnotation
- extends BinaryAnnotation
- implements EclipseLinkMutableAnnotation
-{
- private Boolean value;
-
-
- public BinaryEclipseLinkMutableAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** MutableAnnotation implementation **********
-
- // ***** value
- public Boolean getValue() {
- return this.value;
- }
-
- public void setValue(Boolean value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(Boolean value) {
- Boolean old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private Boolean buildValue() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.MUTABLE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index 031d082645..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Converter
- * org.eclipse.persistence.annotations.StructConverter
- * org.eclipse.persistence.annotations.TypeConverter
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- */
-abstract class BinaryEclipseLinkNamedConverterAnnotation
- extends BinaryAnnotation
- implements EclipseLinkNamedConverterAnnotation
-{
- String name;
-
- BinaryEclipseLinkNamedConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** NamedConverterAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- abstract String getNameElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index d86d7a8fff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- */
-public final class BinaryEclipseLinkObjectTypeConverterAnnotation
- extends BinaryBaseEclipseLinkTypeConverterAnnotation
- implements EclipseLinkObjectTypeConverterAnnotation
-{
- private String defaultObjectValue;
- private final Vector<EclipseLinkConversionValueAnnotation> conversionValues;
-
-
- public BinaryEclipseLinkObjectTypeConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.defaultObjectValue = this.buildDefaultObjectValue();
- this.conversionValues = this.buildConversionValues();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultObjectValue_(this.buildDefaultObjectValue());
- this.updateConversionValues();
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__NAME;
- }
-
- // ********** BinaryBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE;
- }
-
- // ********** ObjectTypeConverterAnnotation implementation **********
-
- // ***** default object value
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String defaultObjectValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultObjectValue_(String defaultObjectValue) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = defaultObjectValue;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, defaultObjectValue);
- }
-
- private String buildDefaultObjectValue() {
- return (String) this.getJdtMemberValue(EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE);
- }
-
- public TextRange getDefaultObjectValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** conversion values
- public ListIterable<EclipseLinkConversionValueAnnotation> getConversionValues() {
- return new LiveCloneListIterable<EclipseLinkConversionValueAnnotation>(this.conversionValues);
- }
-
- public int getConversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public EclipseLinkConversionValueAnnotation conversionValueAt(int index) {
- return this.conversionValues.get(index);
- }
-
- public EclipseLinkConversionValueAnnotation addConversionValue(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeConversionValue(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<EclipseLinkConversionValueAnnotation> buildConversionValues() {
- Object[] jdtConversionValues = this.getJdtMemberValues(EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES);
- Vector<EclipseLinkConversionValueAnnotation> result = new Vector<EclipseLinkConversionValueAnnotation>(jdtConversionValues.length);
- for (Object jdtConversionValue : jdtConversionValues) {
- result.add(new BinaryEclipseLinkConversionValueAnnotation(this, (IAnnotation) jdtConversionValue));
- }
- return result;
- }
-
- // TODO
- private void updateConversionValues() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index b9826b04b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrimaryKey
- */
-public class BinaryEclipseLinkPrimaryKeyAnnotation
- extends BinaryAnnotation
- implements EclipseLinkPrimaryKeyAnnotation
-{
- public BinaryEclipseLinkPrimaryKeyAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index a565257393..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public final class BinaryEclipseLinkPrivateOwnedAnnotation
- extends BinaryAnnotation
- implements EclipseLinkPrivateOwnedAnnotation
-{
-
- public BinaryEclipseLinkPrivateOwnedAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index cfcd2aa3e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public final class BinaryEclipseLinkReadOnlyAnnotation
- extends BinaryAnnotation
- implements EclipseLinkReadOnlyAnnotation
-{
-
- public BinaryEclipseLinkReadOnlyAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index 5c6c594cde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public final class BinaryEclipseLinkReadTransformerAnnotation
- extends BinaryEclipseLinkTransformerAnnotation
- implements EclipseLinkReadTransformerAnnotation
-{
-
- public BinaryEclipseLinkReadTransformerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.READ_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.READ_TRANSFORMER__METHOD;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index 52deb968a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.StructConverter
- */
-public final class BinaryEclipseLinkStructConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements EclipseLinkStructConverterAnnotation
-{
- private String converter;
-
-
- public BinaryEclipseLinkStructConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.converter = this.buildConverter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setConverter_(this.buildConverter());
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.STRUCT_CONVERTER__NAME;
- }
-
-
- // ********** StructConverterAnnotation implementation **********
-
- // ***** converter
- public String getConverter() {
- return this.converter;
- }
-
- public void setConverter(String converter) {
- throw new UnsupportedOperationException();
- }
-
- private void setConverter_(String converter) {
- String old = this.converter;
- this.converter = converter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, converter);
- }
-
- private String buildConverter() {
- return (String) this.getJdtMemberValue(EclipseLink.STRUCT_CONVERTER__CONVERTER);
- }
-
- public TextRange getConverterTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index edb8c95246..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryBaseDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.TenantDiscriminatorColumn
- */
-public final class BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends BinaryBaseDiscriminatorColumnAnnotation
- implements EclipseLinkTenantDiscriminatorColumnAnnotation2_3
-{
- private String contextProperty;
- private String table;
- private Boolean primaryKey;
-
- public BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.contextProperty = this.buildContextProperty();
- this.table = this.buildTable();
- this.primaryKey = this.buildPrimaryKey();
- }
-
- public String getAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setContextProperty_(this.buildContextProperty());
- this.setTable_(this.buildTable());
- this.setPrimaryKey_(this.buildPrimaryKey());
- }
-
- // ********** BinaryBaseDiscriminatorColumnAnnotation implementation **********
-
- @Override
- protected String getDiscriminatorTypeElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
- }
-
- @Override
- protected String getLengthElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__LENGTH;
- }
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- //************* EclipseLinkTenantDiscriminatorColumnAnnotation implementation *************
-
- // ***** contextProperty
- public String getContextProperty() {
- return this.contextProperty;
- }
-
- public void setContextProperty(String contextProperty) {
- throw new UnsupportedOperationException();
- }
-
- private void setContextProperty_(String contextProperty) {
- String old = this.contextProperty;
- this.contextProperty = contextProperty;
- this.firePropertyChanged(CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- private String buildContextProperty() {
- return (String) this.getJdtMemberValue(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY);
- }
-
- public TextRange getContextPropertyTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- throw new UnsupportedOperationException();
- }
-
- private void setTable_(String table) {
- String old = this.table;
- this.table = table;
- this.firePropertyChanged(TABLE_PROPERTY, old, table);
- }
-
- private String buildTable() {
- return (String) this.getJdtMemberValue(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__TABLE);
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** primaryKey
- public Boolean getPrimaryKey() {
- return this.primaryKey;
- }
-
- public void setPrimaryKey(Boolean primaryKey) {
- throw new UnsupportedOperationException();
- }
-
- private void setPrimaryKey_(Boolean primaryKey) {
- Boolean old = this.primaryKey;
- this.primaryKey = primaryKey;
- this.firePropertyChanged(PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- private Boolean buildPrimaryKey() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY);
- }
-
- public TextRange getPrimaryKeyTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index 98d51b6607..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TimeOfDay
- */
-public final class BinaryEclipseLinkTimeOfDayAnnotation
- extends BinaryAnnotation
- implements EclipseLinkTimeOfDayAnnotation
-{
- private Integer hour;
- private Integer minute;
- private Integer second;
- private Integer millisecond;
-
-
- public BinaryEclipseLinkTimeOfDayAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.hour = this.buildHour();
- this.minute = this.buildMinute();
- this.second = this.buildSecond();
- this.millisecond = this.buildMillisecond();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setHour_(this.buildHour());
- this.setMinute_(this.buildMinute());
- this.setSecond_(this.buildSecond());
- this.setMillisecond_(this.buildMillisecond());
- }
-
-
- // ********** TimeOfDayAnnotation implementation **********
-
- // ***** hour
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- throw new UnsupportedOperationException();
- }
-
- private void setHour_(Integer hour) {
- Integer old = this.hour;
- this.hour = hour;
- this.firePropertyChanged(HOUR_PROPERTY, old, hour);
- }
-
- private Integer buildHour() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__HOUR);
- }
-
- public TextRange getHourTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** minute
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer newMinute) {
- throw new UnsupportedOperationException();
- }
-
- private void setMinute_(Integer newMinute) {
- Integer oldMinute = this.minute;
- this.minute = newMinute;
- this.firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute);
- }
-
- private Integer buildMinute() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__MINUTE);
- }
-
- public TextRange getMinuteTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** second
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer newSecond) {
- throw new UnsupportedOperationException();
- }
-
- private void setSecond_(Integer newSecond) {
- Integer oldSecond = this.second;
- this.second = newSecond;
- this.firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond);
- }
-
- private Integer buildSecond() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__SECOND);
- }
-
- public TextRange getSecondTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** millisecond
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer newMillisecond) {
- throw new UnsupportedOperationException();
- }
-
- private void setMillisecond_(Integer newMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = newMillisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond);
- }
-
- private Integer buildMillisecond() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__MILLISECOND);
- }
-
- public TextRange getMillisecondTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index 26cc1abd5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public class BinaryEclipseLinkTransformationAnnotation
- extends BinaryAnnotation
- implements EclipseLinkTransformationAnnotation
-{
- private FetchType fetch;
- private Boolean optional;
-
-
- public BinaryEclipseLinkTransformationAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.fetch = this.buildFetch();
- this.optional = this.buildOptional();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setFetch_(this.buildFetch());
- this.setOptional_(this.buildOptional());
- }
-
-
- // ********** TransformationAnnotation implementation **********
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- throw new UnsupportedOperationException();
- }
-
- private void setFetch_(FetchType fetch) {
- FetchType old = this.fetch;
- this.fetch = fetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, fetch);
- }
-
- private FetchType buildFetch() {
- return FetchType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.TRANSFORMATION__FETCH));
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- throw new UnsupportedOperationException();
- }
-
- private void setOptional_(Boolean optional) {
- Boolean old = this.optional;
- this.optional = optional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional);
- }
-
- private Boolean buildOptional() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.TRANSFORMATION__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java
deleted file mode 100644
index a7b2e212c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- * org.eclipse.persistence.annotations.WriteTransformer
- */
-abstract class BinaryEclipseLinkTransformerAnnotation
- extends BinaryAnnotation
- implements EclipseLinkTransformerAnnotation
-{
- private String transformerClass;
- private String method;
-
-
- BinaryEclipseLinkTransformerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.transformerClass = this.buildTransformerClass();
- this.method = this.buildMethod();
- }
-
- @Override
- public void update() {
- super.update();
- this.setTransformerClass_(this.buildTransformerClass());
- this.setMethod_(this.buildMethod());
- }
-
-
- // ********** TransformerAnnotation implementation **********
-
- // ***** transformer class
- public String getTransformerClass() {
- return this.transformerClass;
- }
-
- public void setTransformerClass(String transformerClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setTransformerClass_(String transformerClass) {
- String old = this.transformerClass;
- this.transformerClass = transformerClass;
- this.firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, old, transformerClass);
- }
-
- private String buildTransformerClass() {
- return (String) this.getJdtMemberValue(this.getTransformerClassElementName());
- }
-
- public TextRange getTransformerClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- abstract String getTransformerClassElementName();
-
- // ***** method
- public String getMethod() {
- return this.method;
- }
-
- public void setMethod(String method) {
- throw new UnsupportedOperationException();
- }
-
- private void setMethod_(String method) {
- String old = this.method;
- this.method = method;
- this.firePropertyChanged(METHOD_PROPERTY, old, method);
- }
-
- private String buildMethod() {
- return (String) this.getJdtMemberValue(this.getMethodElementName());
- }
-
- public TextRange getMethodTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- abstract String getMethodElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index 9ffe93b996..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverter
- */
-public final class BinaryEclipseLinkTypeConverterAnnotation
- extends BinaryBaseEclipseLinkTypeConverterAnnotation
- implements EclipseLinkTypeConverterAnnotation
-{
- public BinaryEclipseLinkTypeConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.TYPE_CONVERTER__NAME;
- }
-
-
- // ********** BinaryBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__OBJECT_TYPE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 1fcd8aeabb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public class BinaryEclipseLinkVariableOneToOneAnnotation
- extends BinaryAnnotation
- implements EclipseLinkVariableOneToOneAnnotation
-{
- public BinaryEclipseLinkVariableOneToOneAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index 792fb52ca5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public class BinaryEclipseLinkWriteTransformerAnnotation
- extends BinaryEclipseLinkTransformerAnnotation
- implements EclipseLinkWriteTransformerAnnotation
-{
- private ColumnAnnotation column;
- private final ColumnAnnotation nullColumn;
-
-
- public BinaryEclipseLinkWriteTransformerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.column = this.buildColumn();
- this.nullColumn = this.buildNullColumn();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateColumn();
- }
-
-
- // ********** BinaryTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.WRITE_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.WRITE_TRANSFORMER__METHOD;
- }
-
-
- // ********** WriteTransformerAnnotation implementation **********
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : this.nullColumn;
- }
-
- public ColumnAnnotation addColumn() {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumn() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getColumnTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- private ColumnAnnotation buildColumn() {
- IAnnotation jdtColumn = this.getJdtColumn();
- return (jdtColumn == null) ? null : this.buildColumn(jdtColumn);
- }
-
- private ColumnAnnotation buildNullColumn() {
- return new NullEclipseLinkWriteTransformerColumnAnnotation(this);
- }
-
- private ColumnAnnotation buildColumn(IAnnotation jdtColumn) {
- return new BinaryColumnAnnotation(this, jdtColumn);
- }
-
- private IAnnotation getJdtColumn() {
- return (IAnnotation) this.getJdtMemberValue(EclipseLink.WRITE_TRANSFORMER__COLUMN);
- }
-
- private void setColumn(ColumnAnnotation column) {
- ColumnAnnotation old = this.column;
- this.column = column;
- this.firePropertyChanged(COLUMN_PROPERTY, old, column);
- }
-
- // TODO
- private void updateColumn() {
- throw new UnsupportedOperationException();
-// IAnnotation jdtColumn = this.getJdtColumn();
-// if (jdtColumn == null) {
-// this.setColumn(null);
-// } else {
-// if (this.column == null) {
-// this.setColumn(this.buildColumn(jdtColumn));
-// } else {
-// this.column.update(jdtColumn);
-// }
-// }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkConvertAnnotation.java
deleted file mode 100644
index 57d1b934f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- * org.eclipse.persistence.annotations.MapKeyConvert
- */
-public abstract class SourceBaseEclipseLinkConvertAnnotation
- extends SourceAnnotation
- implements EclipseLinkConvertAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- protected SourceBaseEclipseLinkConvertAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.valueDeclarationAdapter = this.buildValueDeclarationAdapter();
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, this.valueDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** ConvertAnnotation implementation **********
-
- // ***** value
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.valueDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueDeclarationAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, this.getValueElementName(), StringExpressionConverter.instance());
- }
-
- protected abstract String getValueElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index c3800fede8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.TypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.BaseEclipseLinkTypeConverterAnnotation;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul>
- * </code>
- */
-abstract class SourceBaseEclipseLinkTypeConverterAnnotation
- extends SourceEclipseLinkNamedConverterAnnotation
- implements BaseEclipseLinkTypeConverterAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> dataTypeDeclarationAdapter;
- final AnnotationElementAdapter<String> dataTypeAdapter;
- String dataType;
- TextRange dataTypeTextRange;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- String fullyQualifiedDataType;
- // we need a flag since the f-q name can be null
- boolean fqDataTypeStale = true;
-
- final DeclarationAnnotationElementAdapter<String> objectTypeDeclarationAdapter;
- final AnnotationElementAdapter<String> objectTypeAdapter;
- String objectType;
- TextRange objectTypeTextRange;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- String fullyQualifiedObjectType;
- // we need a flag since the f-q name can be null
- boolean fqObjectTypeStale = true;
-
-
- SourceBaseEclipseLinkTypeConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.dataTypeDeclarationAdapter = this.buildTypeAdapter(this.getDataTypeElementName());
- this.dataTypeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.dataTypeDeclarationAdapter);
-
- this.objectTypeDeclarationAdapter = this.buildTypeAdapter(this.getObjectTypeElementName());
- this.objectTypeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.objectTypeDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(String elementName) {
- // false = do not remove annotation when empty
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, elementName, TypeStringExpressionConverter.instance());
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.dataType = this.buildDataType(astRoot);
- this.dataTypeTextRange = this.buildDataTypeTextRange(astRoot);
- this.objectType = this.buildObjectType(astRoot);
- this.objectTypeTextRange = this.buildObjectTypeTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncDataType(this.buildDataType(astRoot));
- this.dataTypeTextRange = this.buildDataTypeTextRange(astRoot);
- this.syncObjectType(this.buildObjectType(astRoot));
- this.objectTypeTextRange = this.buildObjectTypeTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.dataType == null) &&
- (this.objectType == null);
- }
-
-
- // ********** BaseTypeConverterAnnotation implementation **********
-
- // ***** data type
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- if (this.attributeValueHasChanged(this.dataType, dataType)) {
- this.dataType = dataType;
- this.fqDataTypeStale = true;
- this.dataTypeAdapter.setValue(dataType);
- }
- }
-
- private void syncDataType(String astDataType) {
- if (this.attributeValueHasChanged(this.dataType, astDataType)) {
- this.syncDataType_(astDataType);
- }
- }
-
- private void syncDataType_(String astDataType) {
- String old = this.dataType;
- this.dataType = astDataType;
- this.fqDataTypeStale = true;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, astDataType);
- }
-
- private String buildDataType(CompilationUnit astRoot) {
- return this.dataTypeAdapter.getValue(astRoot);
- }
-
- public TextRange getDataTypeTextRange(CompilationUnit astRoot) {
- return this.dataTypeTextRange;
- }
-
- private TextRange buildDataTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.dataTypeDeclarationAdapter, astRoot);
- }
-
- abstract String getDataTypeElementName();
-
- // ***** fully-qualified data type
- public String getFullyQualifiedDataType() {
- if (this.fqDataTypeStale) {
- this.fullyQualifiedDataType = this.buildFullyQualifiedDataType();
- this.fqDataTypeStale = false;
- }
- return this.fullyQualifiedDataType;
- }
-
- private String buildFullyQualifiedDataType() {
- return (this.dataType == null) ? null : this.buildFullyQualifiedDataType_();
- }
-
- private String buildFullyQualifiedDataType_() {
- return ASTTools.resolveFullyQualifiedName(this.dataTypeAdapter.getExpression(this.buildASTRoot()));
- }
-
- // ***** object type
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- if (this.attributeValueHasChanged(this.objectType, objectType)) {
- this.objectType = objectType;
- this.fqObjectTypeStale = true;
- this.objectTypeAdapter.setValue(objectType);
- }
- }
-
- private void syncObjectType(String astObjectType) {
- if (this.attributeValueHasChanged(this.objectType, astObjectType)) {
- this.syncObjectType_(astObjectType);
- }
- }
-
- private void syncObjectType_(String astObjectType) {
- String old = this.objectType;
- this.objectType = astObjectType;
- this.fqObjectTypeStale = true;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, astObjectType);
- }
-
- private String buildObjectType(CompilationUnit astRoot) {
- return this.objectTypeAdapter.getValue(astRoot);
- }
-
- public TextRange getObjectTypeTextRange(CompilationUnit astRoot) {
- return this.objectTypeTextRange;
- }
-
- private TextRange buildObjectTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.objectTypeDeclarationAdapter, astRoot);
- }
-
- abstract String getObjectTypeElementName();
-
- // ***** fully-qualified object type
- public String getFullyQualifiedObjectType() {
- if (this.fqObjectTypeStale) {
- this.fullyQualifiedObjectType = this.buildFullyQualifiedObjectType();
- this.fqObjectTypeStale = false;
- }
- return this.fullyQualifiedObjectType;
- }
-
- private String buildFullyQualifiedObjectType() {
- return (this.objectType == null) ? null : this.buildFullyQualifiedObjectType_();
- }
-
- private String buildFullyQualifiedObjectType_() {
- return ASTTools.resolveFullyQualifiedName(this.objectTypeAdapter.getExpression(this.buildASTRoot()));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index e38edd3c39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public final class SourceEclipseLinkBasicCollectionAnnotation
- extends SourceAnnotation
- implements EclipseLinkBasicCollectionAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkBasicCollectionAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 5e40d37aa8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public final class SourceEclipseLinkBasicMapAnnotation
- extends SourceAnnotation
- implements EclipseLinkBasicMapAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkBasicMapAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java
deleted file mode 100644
index 4e74868c43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Cache
- */
-public final class SourceEclipseLinkCacheAnnotation
- extends SourceAnnotation
- implements EclipseLinkCacheAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TYPE_ADAPTER = buildTypeAdapter();
- private final AnnotationElementAdapter<String> typeAdapter;
- private CacheType type;
-
- private static final DeclarationAnnotationElementAdapter<Integer> SIZE_ADAPTER = buildSizeAdapter();
- private final AnnotationElementAdapter<Integer> sizeAdapter;
- private Integer size;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> SHARED_ADAPTER = buildSharedAdapter();
- private final AnnotationElementAdapter<Boolean> sharedAdapter;
- private Boolean shared;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> ALWAYS_REFRESH_ADAPTER = buildAlwaysRefreshAdapter();
- private final AnnotationElementAdapter<Boolean> alwaysRefreshAdapter;
- private Boolean alwaysRefresh;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> REFRESH_ONLY_IF_NEWER_ADAPTER = buildRefreshOnlyIfNewerAdapter();
- private final AnnotationElementAdapter<Boolean> refreshOnlyIfNewerAdapter;
- private Boolean refreshOnlyIfNewer;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> DISABLE_HITS_ADAPTER = buildDisableHitsAdapter();
- private final AnnotationElementAdapter<Boolean> disableHitsAdapter;
- private Boolean disableHits;
-
- private static final DeclarationAnnotationElementAdapter<String> COORDINATION_TYPE_ADAPTER = buildCoordinationTypeAdapter();
- private final AnnotationElementAdapter<String> coordinationTypeAdapter;
- private CacheCoordinationType coordinationType;
-
- private static final DeclarationAnnotationElementAdapter<Integer> EXPIRY_ADAPTER = buildExpiryAdapter();
- private final AnnotationElementAdapter<Integer> expiryAdapter;
- private Integer expiry;
-
- private static final NestedDeclarationAnnotationAdapter EXPIRY_TIME_OF_DAY_ADAPTER = buildExpiryTimeOfDayAdapter();
- private final ElementAnnotationAdapter expiryTimeOfDayAdapter;
- private EclipseLinkTimeOfDayAnnotation expiryTimeOfDay;
-
- private static final DeclarationAnnotationElementAdapter<String> ISOLATION_ADAPTER = buildIsolationAdapter();
- private final AnnotationElementAdapter<String> isolationAdapter;
- private CacheIsolationType2_2 isolation;
-
-
- public SourceEclipseLinkCacheAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.typeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, TYPE_ADAPTER);
- this.sizeAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, SIZE_ADAPTER);
- this.sharedAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, SHARED_ADAPTER);
- this.alwaysRefreshAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, ALWAYS_REFRESH_ADAPTER);
- this.refreshOnlyIfNewerAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, REFRESH_ONLY_IF_NEWER_ADAPTER);
- this.disableHitsAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, DISABLE_HITS_ADAPTER);
- this.coordinationTypeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, COORDINATION_TYPE_ADAPTER);
- this.expiryAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, EXPIRY_ADAPTER);
- this.expiryTimeOfDayAdapter = new ElementAnnotationAdapter(element, EXPIRY_TIME_OF_DAY_ADAPTER);
- this.isolationAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, ISOLATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.type = this.buildType(astRoot);
- this.size = this.buildSize(astRoot);
- this.shared = this.buildShared(astRoot);
- this.alwaysRefresh = this.buildAlwaysRefresh(astRoot);
- this.refreshOnlyIfNewer = this.buildRefreshOnlyIfNewer(astRoot);
- this.disableHits = this.buildDisableHits(astRoot);
- this.coordinationType = this.buildCoordinationType(astRoot);
- this.expiry = this.buildExpiry(astRoot);
- this.initializeExpiryTimeOfDay(astRoot);
- this.isolation = this.buildIsolation(astRoot);
- }
-
- private void initializeExpiryTimeOfDay(CompilationUnit astRoot) {
- if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) != null) {
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
- this.expiryTimeOfDay.initialize(astRoot);
- }
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncType(this.buildType(astRoot));
- this.syncSize(this.buildSize(astRoot));
- this.syncShared(this.buildShared(astRoot));
- this.syncAlwaysRefresh(this.buildAlwaysRefresh(astRoot));
- this.syncRefreshOnlyIfNewer(this.buildRefreshOnlyIfNewer(astRoot));
- this.syncDisableHits(this.buildDisableHits(astRoot));
- this.syncCoordinationType(this.buildCoordinationType(astRoot));
- this.syncExpiry(this.buildExpiry(astRoot));
- this.syncExpiryTimeOfDay(astRoot);
- this.syncIsolation(this.buildIsolation(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.type == null) &&
- (this.size == null) &&
- (this.shared == null) &&
- (this.alwaysRefresh == null) &&
- (this.refreshOnlyIfNewer == null) &&
- (this.disableHits == null) &&
- (this.coordinationType == null) &&
- (this.expiry == null) &&
- (this.expiryTimeOfDay == null) &&
- (this.isolation == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.type);
- }
-
-
- // ********** CacheAnnotation implementation **********
-
- // ***** type
- public CacheType getType() {
- return this.type;
- }
-
- public void setType(CacheType type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(CacheType.toJavaAnnotationValue(type));
- }
- }
-
- private void syncType(CacheType astType) {
- CacheType old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private CacheType buildType(CompilationUnit astRoot) {
- return CacheType.fromJavaAnnotationValue(this.typeAdapter.getValue(astRoot));
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(TYPE_ADAPTER, astRoot);
- }
-
- // ***** size
- public Integer getSize() {
- return this.size;
- }
-
- public void setSize(Integer size) {
- if (this.attributeValueHasChanged(this.size, size)) {
- this.size = size;
- this.sizeAdapter.setValue(size);
- }
- }
-
- private void syncSize(Integer astSize) {
- Integer old = this.size;
- this.size = astSize;
- this.firePropertyChanged(SIZE_PROPERTY, old, astSize);
- }
-
- private Integer buildSize(CompilationUnit astRoot) {
- return this.sizeAdapter.getValue(astRoot);
- }
-
- public TextRange getSizeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SIZE_ADAPTER, astRoot);
- }
-
- // ***** shared
- public Boolean getShared() {
- return this.shared;
- }
-
- public void setShared(Boolean shared) {
- if (this.attributeValueHasChanged(this.shared, shared)) {
- this.shared = shared;
- this.sharedAdapter.setValue(shared);
- }
- }
-
- private void syncShared(Boolean astShared) {
- Boolean old = this.shared;
- this.shared = astShared;
- this.firePropertyChanged(SHARED_PROPERTY, old, astShared);
- }
-
- private Boolean buildShared(CompilationUnit astRoot) {
- return this.sharedAdapter.getValue(astRoot);
- }
-
- public TextRange getSharedTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SHARED_ADAPTER, astRoot);
- }
-
- // ***** always refresh
- public Boolean getAlwaysRefresh() {
- return this.alwaysRefresh;
- }
-
- public void setAlwaysRefresh(Boolean alwaysRefresh) {
- if (this.attributeValueHasChanged(this.alwaysRefresh, alwaysRefresh)) {
- this.alwaysRefresh = alwaysRefresh;
- this.alwaysRefreshAdapter.setValue(alwaysRefresh);
- }
- }
-
- private void syncAlwaysRefresh(Boolean astAlwaysRefresh) {
- Boolean old = this.alwaysRefresh;
- this.alwaysRefresh = astAlwaysRefresh;
- this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, astAlwaysRefresh);
- }
-
- private Boolean buildAlwaysRefresh(CompilationUnit astRoot) {
- return this.alwaysRefreshAdapter.getValue(astRoot);
- }
-
- public TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ALWAYS_REFRESH_ADAPTER, astRoot);
- }
-
- // ***** refresh only if newer
- public Boolean getRefreshOnlyIfNewer() {
- return this.refreshOnlyIfNewer;
- }
-
- public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- if (this.attributeValueHasChanged(this.refreshOnlyIfNewer, refreshOnlyIfNewer)) {
- this.refreshOnlyIfNewer = refreshOnlyIfNewer;
- this.refreshOnlyIfNewerAdapter.setValue(refreshOnlyIfNewer);
- }
- }
-
- private void syncRefreshOnlyIfNewer(Boolean astRefreshOnlyIfNewer) {
- Boolean old = this.refreshOnlyIfNewer;
- this.refreshOnlyIfNewer = astRefreshOnlyIfNewer;
- this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, astRefreshOnlyIfNewer);
- }
-
- private Boolean buildRefreshOnlyIfNewer(CompilationUnit astRoot) {
- return this.refreshOnlyIfNewerAdapter.getValue(astRoot);
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(REFRESH_ONLY_IF_NEWER_ADAPTER, astRoot);
- }
-
- // ***** disable hits
- public Boolean getDisableHits() {
- return this.disableHits;
- }
-
- public void setDisableHits(Boolean disableHits) {
- if (this.attributeValueHasChanged(this.disableHits, disableHits)) {
- this.disableHits = disableHits;
- this.disableHitsAdapter.setValue(disableHits);
- }
- }
-
- private void syncDisableHits(Boolean astDisableHits) {
- Boolean old = this.disableHits;
- this.disableHits = astDisableHits;
- this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, astDisableHits);
- }
-
- private Boolean buildDisableHits(CompilationUnit astRoot) {
- return this.disableHitsAdapter.getValue(astRoot);
- }
-
- public TextRange getDisablesHitsTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(DISABLE_HITS_ADAPTER, astRoot);
- }
-
- // ***** coordination type
- public CacheCoordinationType getCoordinationType() {
- return this.coordinationType;
- }
-
- public void setCoordinationType(CacheCoordinationType coordinationType) {
- if (this.attributeValueHasChanged(this.coordinationType, coordinationType)) {
- this.coordinationType = coordinationType;
- this.coordinationTypeAdapter.setValue(CacheCoordinationType.toJavaAnnotationValue(coordinationType));
- }
- }
-
- private void syncCoordinationType(CacheCoordinationType astCoordinationType) {
- CacheCoordinationType old = this.coordinationType;
- this.coordinationType = astCoordinationType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astCoordinationType);
- }
-
- private CacheCoordinationType buildCoordinationType(CompilationUnit astRoot) {
- return CacheCoordinationType.fromJavaAnnotationValue(this.coordinationTypeAdapter.getValue(astRoot));
- }
-
- public TextRange getCoordinationTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(COORDINATION_TYPE_ADAPTER, astRoot);
- }
-
- // ***** expiry
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- if (this.attributeValueHasChanged(this.expiry, expiry)) {
- this.expiry = expiry;
- this.expiryAdapter.setValue(expiry);
- }
- }
-
- private void syncExpiry(Integer astExpiry) {
- Integer old = this.expiry;
- this.expiry = astExpiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, astExpiry);
- }
-
- private Integer buildExpiry(CompilationUnit astRoot) {
- return this.expiryAdapter.getValue(astRoot);
- }
-
- public TextRange getExpiryTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(EXPIRY_ADAPTER, astRoot);
- }
-
- // ***** expiry time of day
- public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("'expiryTimeOfDay' element already exists: " + this.expiryTimeOfDay); //$NON-NLS-1$
- }
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
- this.expiryTimeOfDay.newAnnotation();
- return this.expiryTimeOfDay;
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("'expiryTimeOfDay' element does not exist"); //$NON-NLS-1$
- }
- EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = null;
- old.removeAnnotation();
- }
-
- private EclipseLinkTimeOfDayAnnotation buildExpiryTimeOfDay() {
- return new SourceEclipseLinkTimeOfDayAnnotation(this, this.annotatedElement, EXPIRY_TIME_OF_DAY_ADAPTER);
- }
-
- private void syncExpiryTimeOfDay(CompilationUnit astRoot) {
- if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) == null) {
- this.syncExpiryTimeOfDay_(null);
- } else {
- if (this.expiryTimeOfDay == null) {
- EclipseLinkTimeOfDayAnnotation tod = this.buildExpiryTimeOfDay();
- tod.initialize(astRoot);
- this.syncExpiryTimeOfDay_(tod);
- } else {
- this.expiryTimeOfDay.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncExpiryTimeOfDay_(EclipseLinkTimeOfDayAnnotation astExpiryTimeOfDay) {
- EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = astExpiryTimeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, astExpiryTimeOfDay);
- }
-
- public TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.expiryTimeOfDayAdapter.getAstNode(astRoot));
- }
-
- // ***** isolation
- public CacheIsolationType2_2 getIsolation() {
- return this.isolation;
- }
-
- public void setIsolation(CacheIsolationType2_2 isolation) {
- if (this.attributeValueHasChanged(this.isolation, isolation)) {
- this.isolation = isolation;
- this.isolationAdapter.setValue(CacheIsolationType2_2.toJavaAnnotationValue(isolation));
- }
- }
-
- private void syncIsolation(CacheIsolationType2_2 astIsolation) {
- CacheIsolationType2_2 old = this.isolation;
- this.isolation = astIsolation;
- this.firePropertyChanged(ISOLATION_PROPERTY, old, astIsolation);
- }
-
- private CacheIsolationType2_2 buildIsolation(CompilationUnit astRoot) {
- return CacheIsolationType2_2.fromJavaAnnotationValue(this.isolationAdapter.getValue(astRoot));
- }
-
- public TextRange getIsolationTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ISOLATION_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__TYPE);
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildSizeAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__SIZE, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildSharedAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__SHARED, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildExpiryAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__EXPIRY, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildAlwaysRefreshAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__ALWAYS_REFRESH, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildRefreshOnlyIfNewerAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildDisableHitsAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__DISABLE_HITS, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildCoordinationTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__COORDINATION_TYPE);
- }
-
- private static NestedDeclarationAnnotationAdapter buildExpiryTimeOfDayAdapter() {
- return new NestedDeclarationAnnotationAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__EXPIRY_TIME_OF_DAY, EclipseLink.TIME_OF_DAY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildIsolationAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__ISOLATION);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index 591d977c86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ChangeTracking
- */
-public final class SourceEclipseLinkChangeTrackingAnnotation
- extends SourceAnnotation
- implements EclipseLinkChangeTrackingAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private ChangeTrackingType value;
-
-
- public SourceEclipseLinkChangeTrackingAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** ChangeTrackingAnnotation implementation **********
-
- // ***** value
- public ChangeTrackingType getValue() {
- return this.value;
- }
-
- public void setValue(ChangeTrackingType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(ChangeTrackingType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(ChangeTrackingType astValue) {
- ChangeTrackingType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private ChangeTrackingType buildValue(CompilationUnit astRoot) {
- return ChangeTrackingType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CHANGE_TRACKING__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index 959a9b6d5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-
-/**
- * org.eclipse.persistence.annotations.ClassExtractor
- */
-public final class SourceEclipseLinkClassExtractorAnnotation2_1
- extends SourceAnnotation
- implements EclipseLinkClassExtractorAnnotation2_1
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedClassName;
- // we need a flag since the f-q name can be null
- private boolean fqClassNameStale = true;
-
-
- public SourceEclipseLinkClassExtractorAnnotation2_1(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** EclipseLinkClassExtractorAnnotation2_1 implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.fqClassNameStale = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- if (this.attributeValueHasChanged(this.value, astValue)) {
- this.syncValue_(astValue);
- }
- }
-
- private void syncValue_(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.fqClassNameStale = true;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified class name
- public String getFullyQualifiedClassName() {
- if (this.fqClassNameStale) {
- this.fullyQualifiedClassName = this.buildFullyQualifiedClassName();
- this.fqClassNameStale = false;
- }
- return this.fullyQualifiedClassName;
- }
-
- private String buildFullyQualifiedClassName() {
- return (this.value == null) ? null : this.buildFullyQualifiedClassName_();
- }
-
- private String buildFullyQualifiedClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(this.buildASTRoot()));
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CLASS_EXTRACTOR__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index 74889ebf72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ConversionValue</code>
- */
-final class SourceEclipseLinkConversionValueAnnotation
- extends SourceAnnotation
- implements EclipseLinkConversionValueAnnotation
-{
- private DeclarationAnnotationElementAdapter<String> dataValueDeclarationAdapter;
- private AnnotationElementAdapter<String> dataValueAdapter;
- private String dataValue;
- private TextRange dataValueTextRange;
-
- private DeclarationAnnotationElementAdapter<String> objectValueDeclarationAdapter;
- private AnnotationElementAdapter<String> objectValueAdapter;
- private String objectValue;
- private TextRange objectValueTextRange;
-
- public static SourceEclipseLinkConversionValueAnnotation buildNestedSourceConversionValueAnnotation(
- JavaResourceNode parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceEclipseLinkConversionValueAnnotation(parent, element, idaa);
- }
-
- private SourceEclipseLinkConversionValueAnnotation(JavaResourceNode parent, AnnotatedElement element, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, element, idaa, new ElementIndexedAnnotationAdapter(element, idaa));
- this.dataValueDeclarationAdapter = this.buildDataValueDeclarationAdapter();
- this.dataValueAdapter = this.buildDataValueAdapter();
- this.objectValueDeclarationAdapter = this.buildObjectValueDeclarationAdapter();
- this.objectValueAdapter = this.buildObjectValueAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.dataValue = this.buildDataValue(astRoot);
- this.dataValueTextRange = this.buildDataValueTextRange(astRoot);
- this.objectValue = this.buildObjectValue(astRoot);
- this.objectValueTextRange = this.buildObjectValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncDataValue(this.buildDataValue(astRoot));
- this.dataValueTextRange = this.buildDataValueTextRange(astRoot);
- this.syncObjectValue(this.buildObjectValue(astRoot));
- this.objectValueTextRange = this.buildObjectValueTextRange(astRoot);
- }
-
-
- // ********** ConversionValueAnnotation implementation **********
-
- // ***** data value
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String dataValue) {
- if (this.attributeValueHasChanged(this.dataValue, dataValue)) {
- this.dataValue = dataValue;
- this.dataValueAdapter.setValue(dataValue);
- }
- }
-
- private void syncDataValue(String astDataValue) {
- String old = this.dataValue;
- this.dataValue = astDataValue;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, astDataValue);
- }
-
- private String buildDataValue(CompilationUnit astRoot) {
- return this.dataValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDataValueTextRange(CompilationUnit astRoot) {
- return this.dataValueTextRange;
- }
-
- private TextRange buildDataValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.dataValueDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDataValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, EclipseLink.CONVERSION_VALUE__DATA_VALUE);
- }
-
- private AnnotationElementAdapter<String> buildDataValueAdapter() {
- return this.buildStringElementAdapter(this.dataValueDeclarationAdapter);
- }
-
- // ***** object value
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String objectValue) {
- if (this.attributeValueHasChanged(this.objectValue, objectValue)) {
- this.objectValue = objectValue;
- this.objectValueAdapter.setValue(objectValue);
- }
- }
-
- private void syncObjectValue(String astObjectValue) {
- String old = this.objectValue;
- this.objectValue = astObjectValue;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, astObjectValue);
- }
-
- private String buildObjectValue(CompilationUnit astRoot) {
- return this.objectValueAdapter.getValue(astRoot);
- }
-
- public TextRange getObjectValueTextRange(CompilationUnit astRoot) {
- return this.objectValueTextRange;
- }
-
- private TextRange buildObjectValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.objectValueDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildObjectValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, EclipseLink.CONVERSION_VALUE__OBJECT_VALUE);
- }
-
- private AnnotationElementAdapter<String> buildObjectValueAdapter() {
- return this.buildStringElementAdapter(this.objectValueDeclarationAdapter);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.dataValue == null) &&
- (this.objectValue == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.dataValue);
- sb.append("=>"); //$NON-NLS-1$
- sb.append(this.objectValue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java
deleted file mode 100644
index ad16b145d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- */
-public final class SourceEclipseLinkConvertAnnotation
- extends SourceBaseEclipseLinkConvertAnnotation
- implements EclipseLinkConvertAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkConvertAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.CONVERT__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java
deleted file mode 100644
index 86d4e4ba57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Converter</code>
- */
-public final class SourceEclipseLinkConverterAnnotation
- extends SourceEclipseLinkNamedConverterAnnotation
- implements EclipseLinkConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> CONVERTER_CLASS_ADAPTER = buildConverterClassAdapter();
- private final AnnotationElementAdapter<String> converterClassAdapter;
- private String converterClass;
- private TextRange converterClassTextRange;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedConverterClassName;
- // we need a flag since the f-q name can be null
- private boolean fqConverterClassNameStale = true;
-
- public SourceEclipseLinkConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.converterClassAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, CONVERTER_CLASS_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.converterClass = this.buildConverterClass(astRoot);
- this.converterClassTextRange = this.buildConverterClassTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncConverterClass(this.buildConverterClass(astRoot));
- this.converterClassTextRange = this.buildConverterClassTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.converterClass == null);
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.CONVERTER__NAME;
- }
-
-
- // ********** ConverterAnnotation implementation **********
-
- // ***** converter class
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- if (this.attributeValueHasChanged(this.converterClass, converterClass)) {
- this.converterClass = converterClass;
- this.fqConverterClassNameStale = true;
- this.converterClassAdapter.setValue(converterClass);
- }
- }
-
- private void syncConverterClass(String astConverterClass) {
- if (this.attributeValueHasChanged(this.converterClass, astConverterClass)) {
- this.syncConverterClass_(astConverterClass);
- }
- }
-
- private void syncConverterClass_(String astConverterClass) {
- String old = this.converterClass;
- this.converterClass = astConverterClass;
- this.fqConverterClassNameStale = true;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, astConverterClass);
- }
-
- private String buildConverterClass(CompilationUnit astRoot) {
- return this.converterClassAdapter.getValue(astRoot);
- }
-
- public TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- return this.converterClassTextRange;
- }
-
- private TextRange buildConverterClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CONVERTER_CLASS_ADAPTER, astRoot);
- }
-
- public boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- return (this.converterClass != null)
- && ASTTools.typeImplementsInterface(this.converterClassAdapter.getExpression(astRoot), interfaceName);
- }
-
- // ***** fully-qualified converter class name
- public String getFullyQualifiedConverterClassName() {
- if (this.fqConverterClassNameStale) {
- this.fullyQualifiedConverterClassName = this.buildFullyQualifiedConverterClassName();
- this.fqConverterClassNameStale = false;
- }
- return this.fullyQualifiedConverterClassName;
- }
-
- private String buildFullyQualifiedConverterClassName() {
- return (this.converterClass == null) ? null : this.buildFullyQualifiedConverterClassName_();
- }
-
- private String buildFullyQualifiedConverterClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.converterClassAdapter.getExpression(this.buildASTRoot()));
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildConverterClassAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CONVERTER__CONVERTER_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index b59e03773a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Customizer
- */
-public final class SourceEclipseLinkCustomizerAnnotation
- extends SourceAnnotation
- implements EclipseLinkCustomizerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedCustomizerClassName;
- // we need a flag since the f-q name can be null
- private boolean fqCustomizerClassNameStale = true;
-
-
- public SourceEclipseLinkCustomizerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** CustomizerAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.fqCustomizerClassNameStale = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- if (this.attributeValueHasChanged(this.value, astValue)) {
- this.syncValue_(astValue);
- }
- }
-
- private void syncValue_(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.fqCustomizerClassNameStale = true;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- return (this.value != null)
- && ASTTools.typeIsSubTypeOf(this.valueAdapter.getExpression(astRoot), interfaceName);
- }
-
-
- // ***** fully-qualified customizer class name
- public String getFullyQualifiedCustomizerClassName() {
- if (this.fqCustomizerClassNameStale) {
- this.fullyQualifiedCustomizerClassName = this.buildFullyQualifiedCustomizerClassName();
- this.fqCustomizerClassNameStale = false;
- }
- return this.fullyQualifiedCustomizerClassName;
- }
-
- private String buildFullyQualifiedCustomizerClassName() {
- return (this.value == null) ? null : this.buildFullyQualifiedCustomizerClassName_();
- }
-
- private String buildFullyQualifiedCustomizerClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(this.buildASTRoot()));
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CUSTOMIZER__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index b371fe634f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType;
-
-/**
- * org.eclipse.persistence.annotations.ExistenceChecking
- */
-public final class SourceEclipseLinkExistenceCheckingAnnotation
- extends SourceAnnotation
- implements EclipseLinkExistenceCheckingAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private ExistenceType value;
-
-
- public SourceEclipseLinkExistenceCheckingAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** ExistenceCheckingAnnotation implementation **********
-
- // ***** value
- public ExistenceType getValue() {
- return this.value;
- }
-
- public void setValue(ExistenceType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(ExistenceType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(ExistenceType astValue) {
- ExistenceType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private ExistenceType buildValue(CompilationUnit astRoot) {
- return ExistenceType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.EXISTENCE_CHECKING__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index 92f086f42a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * org.eclipse.persistence.annotations.JoinFetch
- */
-public final class SourceEclipseLinkJoinFetchAnnotation
- extends SourceAnnotation
- implements EclipseLinkJoinFetchAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private JoinFetchType value;
-
-
- public SourceEclipseLinkJoinFetchAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** JoinFetchAnnotation implementation **********
-
- // ***** value
- public JoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(JoinFetchType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(JoinFetchType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(JoinFetchType astValue) {
- JoinFetchType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private JoinFetchType buildValue(CompilationUnit astRoot) {
- return JoinFetchType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.JOIN_FETCH__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java
deleted file mode 100644
index 393ec32de3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-/**
- * org.eclipse.persistence.annotations.MapKeyConvert
- */
-public final class SourceEclipseLinkMapKeyConvertAnnotation2_0
- extends SourceBaseEclipseLinkConvertAnnotation
- implements EclipseLinkMapKeyConvertAnnotation2_0
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME);
-
-
- public SourceEclipseLinkMapKeyConvertAnnotation2_0(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.MAP_KEY_CONVERT__VALUE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index c033d340ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-/**
- * org.eclipse.persistence.annotations.Multitenant
- */
-public class SourceEclipseLinkMultitenantAnnotation2_3
- extends SourceAnnotation
- implements EclipseLinkMultitenantAnnotation2_3
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private MultitenantType2_3 value;
-//
-// private static final DeclarationAnnotationElementAdapter<Boolean> INCLUDE_CRITERIA_ADAPTER = buildIncludeCriteriaAdapter();
-// private final AnnotationElementAdapter<Boolean> includeCriteriaAdapter;
-// private Boolean includeCriteria;
-
- public SourceEclipseLinkMultitenantAnnotation2_3(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
-// this.includeCriteriaAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, INCLUDE_CRITERIA_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
-// this.includeCriteria = this.buildIncludeCriteria(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
-// this.syncIncludeCriteria(this.buildIncludeCriteria(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null)/* &&
- (this.includeCriteria == null)*/;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
- // ********** EclipseLinkMultitenantAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** value
- public MultitenantType2_3 getValue() {
- return this.value;
- }
-
- public void setValue(MultitenantType2_3 value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(MultitenantType2_3.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(MultitenantType2_3 astValue) {
- MultitenantType2_3 old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private MultitenantType2_3 buildValue(CompilationUnit astRoot) {
- return MultitenantType2_3.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-// // ***** include criteria
-// public Boolean getIncludeCriteria() {
-// return this.includeCriteria;
-// }
-//
-// public void setIncludeCriteria(Boolean includeCriteria) {
-// if (this.attributeValueHasChanged(this.includeCriteria, includeCriteria)) {
-// this.includeCriteria = includeCriteria;
-// this.includeCriteriaAdapter.setValue(includeCriteria);
-// }
-// }
-//
-// private void syncIncludeCriteria(Boolean astIncludeCriteria) {
-// Boolean old = this.includeCriteria;
-// this.includeCriteria = astIncludeCriteria;
-// this.firePropertyChanged(INCLUDE_CRITERIA_PROPERTY, old, astIncludeCriteria);
-// }
-//
-// private Boolean buildIncludeCriteria(CompilationUnit astRoot) {
-// return this.includeCriteriaAdapter.getValue(astRoot);
-// }
-//
-// public TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot) {
-// return this.getElementTextRange(INCLUDE_CRITERIA_ADAPTER, astRoot);
-// }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.MULTITENANT__VALUE);
- }
-//
-// private static DeclarationAnnotationElementAdapter<Boolean> buildIncludeCriteriaAdapter() {
-// return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.MULTITENANT__INCLUDE_CRITERIA, BooleanExpressionConverter.instance());
-// }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java
deleted file mode 100644
index 319d10ba64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Mutable
- */
-public final class SourceEclipseLinkMutableAnnotation
- extends SourceAnnotation
- implements EclipseLinkMutableAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<Boolean> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<Boolean> valueAdapter;
- private Boolean value;
-
-
- public SourceEclipseLinkMutableAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** MutableAnnotation implementation **********
-
- // ***** value
- public Boolean getValue() {
- return this.value;
- }
-
- public void setValue(Boolean value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(Boolean astValue) {
- Boolean old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private Boolean buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.MUTABLE__VALUE, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index 3bd96c0339..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.Converter
- * <li>org.eclipse.persistence.annotations.StructConverter
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul>
- * </code>
- */
-abstract class SourceEclipseLinkNamedConverterAnnotation
- extends SourceAnnotation
- implements EclipseLinkNamedConverterAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
- TextRange nameTextRange;
-
-
- // ********** construction/initialization **********
-
- SourceEclipseLinkNamedConverterAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getNameElementName());
- this.nameAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.nameDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.nameTextRange = this.buildNameTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.nameTextRange = this.buildNameTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** NamedConverterAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(OverrideAnnotation.NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.nameTextRange;
- }
-
- private TextRange buildNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- abstract String getNameElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index acb77d31c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ObjectTypeConverter</code>
- */
-public final class SourceEclipseLinkObjectTypeConverterAnnotation
- extends SourceBaseEclipseLinkTypeConverterAnnotation
- implements EclipseLinkObjectTypeConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> DEFAULT_OBJECT_VALUE_ADAPTER = buildDefaultObjectValueAdapter();
- private final AnnotationElementAdapter<String> defaultObjectValueAdapter;
- private String defaultObjectValue;
- private TextRange defaultObjectValueTextRange;
-
- private final ConversionValuesAnnotationContainer conversionValuesContainer = new ConversionValuesAnnotationContainer();
-
-
- public SourceEclipseLinkObjectTypeConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.defaultObjectValueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, DEFAULT_OBJECT_VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.defaultObjectValue = this.buildDefaultObjectValue(astRoot);
- this.defaultObjectValueTextRange = this.buildDefaultObjectValueTextRange(astRoot);
- this.conversionValuesContainer.initialize(this.getAstAnnotation(astRoot));
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncDefaultObjectValue(this.buildDefaultObjectValue(astRoot));
- this.defaultObjectValueTextRange = this.buildDefaultObjectValueTextRange(astRoot);
- this.conversionValuesContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.defaultObjectValue == null) &&
- this.conversionValuesContainer.isEmpty();
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__NAME;
- }
-
-
- // ********** SourceBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE;
- }
-
-
- // ********** ObjectTypeConverterAnnotation implementation **********
-
- // ***** default object value
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String defaultObjectValue) {
- if (this.attributeValueHasChanged(this.defaultObjectValue, defaultObjectValue)) {
- this.defaultObjectValue = defaultObjectValue;
- this.defaultObjectValueAdapter.setValue(defaultObjectValue);
- }
- }
-
- private void syncDefaultObjectValue(String astDefaultObjectValue) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = astDefaultObjectValue;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, astDefaultObjectValue);
- }
-
- private String buildDefaultObjectValue(CompilationUnit astRoot) {
- return this.defaultObjectValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultObjectValueTextRange(CompilationUnit astRoot) {
- return this.defaultObjectValueTextRange;
- }
-
- private TextRange buildDefaultObjectValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(DEFAULT_OBJECT_VALUE_ADAPTER, astRoot);
- }
-
- // ***** conversion values
-
- public ListIterable<EclipseLinkConversionValueAnnotation> getConversionValues() {
- return this.conversionValuesContainer.getNestedAnnotations();
- }
-
- public int getConversionValuesSize() {
- return this.conversionValuesContainer.getNestedAnnotationsSize();
- }
-
- public EclipseLinkConversionValueAnnotation conversionValueAt(int index) {
- return this.conversionValuesContainer.nestedAnnotationAt(index);
- }
-
- public EclipseLinkConversionValueAnnotation addConversionValue(int index) {
- return this.conversionValuesContainer.addNestedAnnotation(index);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- this.conversionValuesContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeConversionValue(int index) {
- this.conversionValuesContainer.removeNestedAnnotation(index);
- }
-
- protected EclipseLinkConversionValueAnnotation buildConversionValue(int index) {
- return SourceEclipseLinkConversionValueAnnotation.buildNestedSourceConversionValueAnnotation(
- this, this.annotatedElement, this.buildConversionValueIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildConversionValueIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES, index, EclipseLink.CONVERSION_VALUE);
- }
-
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildDefaultObjectValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, StringExpressionConverter.instance());
- }
-
-
- // ********** hint container **********
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class ConversionValuesAnnotationContainer
- extends AnnotationContainer<EclipseLinkConversionValueAnnotation>
- {
- @Override
- protected String getAnnotationsPropertyName() {
- return CONVERSION_VALUES_LIST;
- }
- @Override
- protected String getElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES;
- }
- @Override
- protected String getNestedAnnotationName() {
- return EclipseLinkConversionValueAnnotation.ANNOTATION_NAME;
- }
- @Override
- protected EclipseLinkConversionValueAnnotation buildNestedAnnotation(int index) {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.buildConversionValue(index);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index 467ee1e470..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrimaryKey
- */
-public class SourceEclipseLinkPrimaryKeyAnnotation
- extends SourceAnnotation
- implements EclipseLinkPrimaryKeyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkPrimaryKeyAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to sync
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index da831d609c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public final class SourceEclipseLinkPrivateOwnedAnnotation
- extends SourceAnnotation
- implements EclipseLinkPrivateOwnedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkPrivateOwnedAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to sync
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index ae7014e382..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public final class SourceEclipseLinkReadOnlyAnnotation
- extends SourceAnnotation
- implements EclipseLinkReadOnlyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkReadOnlyAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to sync
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index 0e7fbd7bf8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public final class SourceEclipseLinkReadTransformerAnnotation
- extends SourceEclipseLinkTransformerAnnotation
- implements EclipseLinkReadTransformerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkReadTransformerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** SourceTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.READ_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.READ_TRANSFORMER__METHOD;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index c34798a57d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.StructConverter</code>
- */
-public final class SourceEclipseLinkStructConverterAnnotation
- extends SourceEclipseLinkNamedConverterAnnotation
- implements EclipseLinkStructConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> CONVERTER_ADAPTER = buildConverterAdapter();
- private final AnnotationElementAdapter<String> converterAdapter;
- private String converter;
- private TextRange converterTextRange;
-
-
- public SourceEclipseLinkStructConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.converterAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, CONVERTER_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.converter = this.buildConverter(astRoot);
- this.converterTextRange = this.buildConverterTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncConverter(this.buildConverter(astRoot));
- this.converterTextRange = this.buildConverterTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.converter == null);
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.STRUCT_CONVERTER__NAME;
- }
-
-
- // ********** StructConverterAnnotation implementation **********
-
- // ***** converter
- public String getConverter() {
- return this.converter;
- }
-
- public void setConverter(String converter) {
- if (this.attributeValueHasChanged(this.converter, converter)) {
- this.converter = converter;
- this.converterAdapter.setValue(converter);
- }
- }
-
- private void syncConverter(String astConverter) {
- String old = this.converter;
- this.converter = astConverter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, astConverter);
- }
-
- private String buildConverter(CompilationUnit astRoot) {
- return this.converterAdapter.getValue(astRoot);
- }
-
- public TextRange getConverterTextRange(CompilationUnit astRoot) {
- return this.converterTextRange;
- }
-
- private TextRange buildConverterTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CONVERTER_ADAPTER, astRoot);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildConverterAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.STRUCT_CONVERTER__CONVERTER, StringExpressionConverter.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index 55c0b6d4a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceBaseDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.TenantDiscriminatorColumn
- */
-public final class SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends SourceBaseDiscriminatorColumnAnnotation
- implements EclipseLinkTenantDiscriminatorColumnAnnotation2_3
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMNS);
-
- protected DeclarationAnnotationElementAdapter<String> contextPropertyDeclarationAdapter;
- protected AnnotationElementAdapter<String> contextPropertyAdapter;
- protected String contextProperty;
-
- protected DeclarationAnnotationElementAdapter<String> tableDeclarationAdapter;
- protected AnnotationElementAdapter<String> tableAdapter;
- protected String table;
-
- protected DeclarationAnnotationElementAdapter<Boolean> primaryKeyDeclarationAdapter;
- protected AnnotationElementAdapter<Boolean> primaryKeyAdapter;
- protected Boolean primaryKey;
-
- public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildSourceTenantDiscriminatorColumnAnnotation(
- JavaResourceNode parent,
- AnnotatedElement element) {
-
- return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildSourceTenantDiscriminatorColumnAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildTenantDiscriminatorColumnDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildTenantDiscriminatorColumnAnnotationAdapter(annotatedElement, idaa);
- return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
-
- public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildNestedSourceTenantDiscriminatorColumnAnnotation(
- JavaResourceNode parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(parent, element, idaa);
- }
-
- private SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- this(parent, element, daa, new ElementAnnotationAdapter(element, daa));
- }
-
- private SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceNode parent, AnnotatedElement element, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, element, idaa, new ElementIndexedAnnotationAdapter(element, idaa));
- }
-
- private SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.contextPropertyDeclarationAdapter = this.buildContextPropertyDeclarationAdapter();
- this.contextPropertyAdapter = this.buildContextPropertyAdapter();
- this.tableDeclarationAdapter = this.buildTableDeclarationAdapter();
- this.tableAdapter = this.buildTableAdapter();
- this.primaryKeyDeclarationAdapter = this.buildPrimaryKeyDeclarationAdapter();
- this.primaryKeyAdapter = this.buildPrimaryKeyAdapter();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.contextProperty = this.buildContextProperty(astRoot);
- this.table = this.buildTable(astRoot);
- this.primaryKey = this.buildPrimaryKey(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncContextProperty(this.buildContextProperty(astRoot));
- this.syncTable(this.buildTable(astRoot));
- this.syncPrimaryKey(this.buildPrimaryKey(astRoot));
- }
-
- public String getAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- //************* SourceBaseDiscriminatorColumnAnnotation implementation *************
-
- @Override
- protected String getDiscriminatorTypeElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
- }
-
- @Override
- protected String getLengthElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__LENGTH;
- }
-
-
- //************* TenantDiscriminatorColumnAnnotation implementation *************
-
- // ***** contextProperty
- public String getContextProperty() {
- return this.contextProperty;
- }
-
- public void setContextProperty(String contextProperty) {
- if (this.attributeValueHasChanged(this.contextProperty, contextProperty)) {
- this.contextProperty = contextProperty;
- this.contextPropertyAdapter.setValue(contextProperty);
- }
- }
-
- private void syncContextProperty(String astContextProperty) {
- String old = this.contextProperty;
- this.contextProperty = astContextProperty;
- this.firePropertyChanged(CONTEXT_PROPERTY_PROPERTY, old, astContextProperty);
- }
-
- private String buildContextProperty(CompilationUnit astRoot) {
- return this.contextPropertyAdapter.getValue(astRoot);
- }
-
- public TextRange getContextPropertyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.contextPropertyDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildContextPropertyDeclarationAdapter() {
- return this.buildStringElementAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY);
- }
-
- private AnnotationElementAdapter<String> buildContextPropertyAdapter() {
- return this.buildStringElementAdapter(this.contextPropertyDeclarationAdapter);
- }
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- if (this.attributeValueHasChanged(this.table, table)) {
- this.table = table;
- this.tableAdapter.setValue(table);
- }
- }
-
- private void syncTable(String astTable) {
- String old = this.table;
- this.table = astTable;
- this.firePropertyChanged(TABLE_PROPERTY, old, astTable);
- }
-
- private String buildTable(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.tableDeclarationAdapter, astRoot);
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.tableDeclarationAdapter, pos, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTableDeclarationAdapter() {
- return this.buildStringElementAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__TABLE);
- }
-
- private AnnotationElementAdapter<String> buildTableAdapter() {
- return this.buildStringElementAdapter(this.tableDeclarationAdapter);
- }
-
- // ***** primaryKey
- public Boolean getPrimaryKey() {
- return this.primaryKey;
- }
-
- public void setPrimaryKey(Boolean primaryKey) {
- if (this.attributeValueHasChanged(this.primaryKey, primaryKey)) {
- this.primaryKey = primaryKey;
- this.primaryKeyAdapter.setValue(primaryKey);
- }
- }
-
- private void syncPrimaryKey(Boolean astPrimaryKey) {
- Boolean old = this.primaryKey;
- this.primaryKey = astPrimaryKey;
- this.firePropertyChanged(PRIMARY_KEY_PROPERTY, old, astPrimaryKey);
- }
-
- private Boolean buildPrimaryKey(CompilationUnit astRoot) {
- return this.primaryKeyAdapter.getValue(astRoot);
- }
-
- public TextRange getPrimaryKeyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.primaryKeyDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildPrimaryKeyDeclarationAdapter() {
- return this.buildBooleanElementAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY);
- }
-
- private AnnotationElementAdapter<Boolean> buildPrimaryKeyAdapter() {
- return this.buildBooleanElementAdapter(this.primaryKeyDeclarationAdapter);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.contextProperty == null) &&
- (this.primaryKey == null) &&
- (this.table == null);
- }
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildTenantDiscriminatorColumnAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildTenantDiscriminatorColumnDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- return idaa;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index 4955b35964..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TimeOfDay
- */
-public final class SourceEclipseLinkTimeOfDayAnnotation
- extends SourceAnnotation
- implements EclipseLinkTimeOfDayAnnotation
-{
- private final DeclarationAnnotationElementAdapter<Integer> hourDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> hourAdapter;
- private Integer hour;
-
- private final DeclarationAnnotationElementAdapter<Integer> minuteDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> minuteAdapter;
- private Integer minute;
-
- private final DeclarationAnnotationElementAdapter<Integer> secondDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> secondAdapter;
- private Integer second;
-
- private final DeclarationAnnotationElementAdapter<Integer> millisecondDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> millisecondAdapter;
- private Integer millisecond;
-
-
- public SourceEclipseLinkTimeOfDayAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.hourDeclarationAdapter = buildHourAdapter(daa);
- this.hourAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.hourDeclarationAdapter);
- this.minuteDeclarationAdapter = buildMinuteAdapter(daa);
- this.minuteAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.minuteDeclarationAdapter);
- this.secondDeclarationAdapter = buildSecondAdapter(daa);
- this.secondAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.secondDeclarationAdapter);
- this.millisecondDeclarationAdapter = buildMillisecondAdapter(daa);
- this.millisecondAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.millisecondDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.hour = this.buildHour(astRoot);
- this.minute = this.buildMinute(astRoot);
- this.second = this.buildSecond(astRoot);
- this.millisecond = this.buildMillisecond(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncHour(this.buildHour(astRoot));
- this.syncMinute(this.buildMinute(astRoot));
- this.syncSecond(this.buildSecond(astRoot));
- this.syncMillisecond(this.buildMillisecond(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.hour == null) &&
- (this.minute == null) &&
- (this.second == null) &&
- (this.millisecond == null);
- }
-
-
- // ********** TimeOfDayAnnotation implementation **********
-
- // ***** hour
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- if (this.attributeValueHasChanged(this.hour, hour)) {
- this.hour = hour;
- this.hourAdapter.setValue(hour);
- }
- }
-
- private void syncHour(Integer astHour) {
- Integer old = this.hour;
- this.hour = astHour;
- this.firePropertyChanged(HOUR_PROPERTY, old, astHour);
- }
-
- private Integer buildHour(CompilationUnit astRoot) {
- return this.hourAdapter.getValue(astRoot);
- }
-
- public TextRange getHourTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.hourDeclarationAdapter, astRoot);
- }
-
- // ***** minute
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer minute) {
- if (this.attributeValueHasChanged(this.minute, minute)) {
- this.minute = minute;
- this.minuteAdapter.setValue(minute);
- }
- }
-
- private void syncMinute(Integer astMinute) {
- Integer old = this.minute;
- this.minute = astMinute;
- this.firePropertyChanged(MINUTE_PROPERTY, old, astMinute);
- }
-
- private Integer buildMinute(CompilationUnit astRoot) {
- return this.minuteAdapter.getValue(astRoot);
- }
-
- public TextRange getMinuteTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.minuteDeclarationAdapter, astRoot);
- }
-
- // ***** second
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer newSecond) {
- if (this.attributeValueHasChanged(this.second, newSecond)) {
- this.second = newSecond;
- this.secondAdapter.setValue(newSecond);
- }
- }
-
- private void syncSecond(Integer astSecond) {
- Integer old = this.second;
- this.second = astSecond;
- this.firePropertyChanged(SECOND_PROPERTY, old, astSecond);
- }
-
- private Integer buildSecond(CompilationUnit astRoot) {
- return this.secondAdapter.getValue(astRoot);
- }
-
- public TextRange getSecondTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.secondDeclarationAdapter, astRoot);
- }
-
- // ***** millisecond
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer millisecond) {
- if (this.attributeValueHasChanged(this.millisecond, millisecond)) {
- this.millisecond = millisecond;
- this.millisecondAdapter.setValue(millisecond);
- }
- }
-
- private void syncMillisecond(Integer astMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = astMillisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, astMillisecond);
- }
-
- private Integer buildMillisecond(CompilationUnit astRoot) {
- return this.millisecondAdapter.getValue(astRoot);
- }
-
- public TextRange getMillisecondTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.millisecondDeclarationAdapter, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Integer> buildHourAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__HOUR, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMinuteAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MINUTE, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildSecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__SECOND, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMillisecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MILLISECOND, NumberIntegerExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index 8f8716947e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public final class SourceEclipseLinkTransformationAnnotation
- extends SourceAnnotation
- implements EclipseLinkTransformationAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
- private final AnnotationElementAdapter<String> fetchAdapter;
- private FetchType fetch;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
-
- public SourceEclipseLinkTransformationAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.fetchAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, FETCH_ADAPTER);
- this.optionalAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, OPTIONAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.fetch = this.buildFetch(astRoot);
- this.optional = this.buildOptional(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncFetch(this.buildFetch(astRoot));
- this.syncOptional(this.buildOptional(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.fetch == null) &&
- (this.optional == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.fetch);
- }
-
-
- // ********** TransformationAnnotation implementation **********
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- if (this.attributeValueHasChanged(this.fetch, fetch)) {
- this.fetch = fetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(fetch));
- }
- }
-
- private void syncFetch(FetchType astFetch) {
- FetchType old = this.fetch;
- this.fetch = astFetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, astFetch);
- }
-
- private FetchType buildFetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FETCH_ADAPTER, astRoot);
- }
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- if (this.attributeValueHasChanged(this.optional, optional)) {
- this.optional = optional;
- this.optionalAdapter.setValue(optional);
- }
- }
-
- private void syncOptional(Boolean astOptional) {
- Boolean old = this.optional;
- this.optional = astOptional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, astOptional);
- }
-
- private Boolean buildOptional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.TRANSFORMATION__OPTIONAL, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.TRANSFORMATION__FETCH);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java
deleted file mode 100644
index 9b816106cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- * org.eclipse.persistence.annotations.WriteTransformer
- */
-abstract class SourceEclipseLinkTransformerAnnotation
- extends SourceAnnotation
- implements EclipseLinkTransformerAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> transformerClassDeclarationAdapter;
- final AnnotationElementAdapter<String> transformerClassAdapter;
- String transformerClass;
-
- final DeclarationAnnotationElementAdapter<String> methodDeclarationAdapter;
- final AnnotationElementAdapter<String> methodAdapter;
- String method;
-
-
- SourceEclipseLinkTransformerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.transformerClassDeclarationAdapter = new ConversionDeclarationAnnotationElementAdapter<String>(daa, this.getTransformerClassElementName(), SimpleTypeStringExpressionConverter.instance());
- this.transformerClassAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, this.transformerClassDeclarationAdapter);
-
- this.methodDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getMethodElementName());
- this.methodAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, this.methodDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.transformerClass = this.buildTransformerClass(astRoot);
- this.method = this.buildMethod(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncTransformerClass(this.buildTransformerClass(astRoot));
- this.syncMethod(this.buildMethod(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.transformerClass == null) &&
- (this.method == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.transformerClass);
- }
-
-
- // ********** TransformerAnnotation implementation **********
-
- // ***** transformer class
- public String getTransformerClass() {
- return this.transformerClass;
- }
-
- public void setTransformerClass(String transformerClass) {
- if (this.attributeValueHasChanged(this.transformerClass, transformerClass)) {
- this.transformerClass = transformerClass;
- this.transformerClassAdapter.setValue(transformerClass);
- }
- }
-
- private void syncTransformerClass(String astTransformerClass) {
- String old = this.transformerClass;
- this.transformerClass = astTransformerClass;
- this.firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, old, astTransformerClass);
- }
-
- private String buildTransformerClass(CompilationUnit astRoot) {
- return this.transformerClassAdapter.getValue(astRoot);
- }
-
- public TextRange getTransformerClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.transformerClassDeclarationAdapter, astRoot);
- }
-
- abstract String getTransformerClassElementName();
-
- // ***** method
- public String getMethod() {
- return this.method;
- }
-
- public void setMethod(String method) {
- if (this.attributeValueHasChanged(this.method, method)) {
- this.method = method;
- this.methodAdapter.setValue(method);
- }
- }
-
- private void syncMethod(String astMethod) {
- String old = this.method;
- this.method = astMethod;
- this.firePropertyChanged(METHOD_PROPERTY, old, astMethod);
- }
-
- private String buildMethod(CompilationUnit astRoot) {
- return this.methodAdapter.getValue(astRoot);
- }
-
- public TextRange getMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.methodDeclarationAdapter, astRoot);
- }
-
- abstract String getMethodElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index de5a00a78c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverter
- */
-public final class SourceEclipseLinkTypeConverterAnnotation
- extends SourceBaseEclipseLinkTypeConverterAnnotation
- implements EclipseLinkTypeConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkTypeConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.TYPE_CONVERTER__NAME;
- }
-
-
- // ********** SourceBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__OBJECT_TYPE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 8e8ee15d3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public final class SourceEclipseLinkVariableOneToOneAnnotation
- extends SourceAnnotation
- implements EclipseLinkVariableOneToOneAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkVariableOneToOneAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index 7ad33bd164..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.WriteTransformer
- */
-public final class SourceEclipseLinkWriteTransformerAnnotation
- extends SourceEclipseLinkTransformerAnnotation
- implements EclipseLinkWriteTransformerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final ElementAnnotationAdapter columnAdapter;
- private ColumnAnnotation column;
- private final ColumnAnnotation nullColumn;
-
-
- public SourceEclipseLinkWriteTransformerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.columnAdapter = new ElementAnnotationAdapter(this.annotatedElement, buildColumnAnnotationAdapter(this.daa));
- this.nullColumn = this.buildNullColumn();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) != null) {
- this.column = createColumn(this, this.annotatedElement, this.daa);
- this.column.initialize(astRoot);
- }
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncColumn(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.column == null);
- }
-
-
- // ********** SourceTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.WRITE_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.WRITE_TRANSFORMER__METHOD;
- }
-
-
- // ********** WriteTransformerAnnotation implementation **********
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : this.nullColumn;
- }
-
- public ColumnAnnotation addColumn() {
- if (this.column != null) {
- throw new IllegalStateException("'column' element already exists: " + this.column); //$NON-NLS-1$
- }
- this.column = createColumn(this, this.annotatedElement, this.daa);
- this.column.newAnnotation();
- return this.column;
- }
-
- public void removeColumn() {
- if (this.column == null) {
- throw new IllegalStateException("'column' element does not exist"); //$NON-NLS-1$
- }
- ColumnAnnotation old = this.column;
- this.column = null;
- old.removeAnnotation();
- }
-
- private void syncColumn(CompilationUnit astRoot) {
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.syncColumn_(null);
- } else {
- if (this.column == null) {
- ColumnAnnotation col = createColumn(this, this.annotatedElement, this.daa);
- col.initialize(astRoot);
- this.syncColumn_(col);
- } else {
- this.column.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncColumn_(ColumnAnnotation astColumn) {
- ColumnAnnotation old = this.column;
- this.column = astColumn;
- this.firePropertyChanged(COLUMN_PROPERTY, old, astColumn);
- }
-
- private ColumnAnnotation buildNullColumn() {
- return new NullEclipseLinkWriteTransformerColumnAnnotation(this);
- }
-
- public TextRange getColumnTextRange(CompilationUnit astRoot) {
- if (this.column != null) {
- return this.column.getTextRange(astRoot);
- }
- return getTextRange(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationAdapter buildColumnAnnotationAdapter(DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(writeTransformerAnnotationAdapter, EclipseLink.WRITE_TRANSFORMER__COLUMN, JPA.COLUMN);
- }
-
- private static ColumnAnnotation createColumn(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) {
- return new SourceColumnAnnotation(parent, element, buildColumnAnnotationAdapter(writeTransformerAnnotationAdapter));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java
deleted file mode 100644
index af778fb4e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.jpa.core.resource.orm.AccessType;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EclipseLinkOrmXmlResourceProvider
- extends AbstractXmlResourceProvider
- implements OrmFileCreationDataModelProperties
-{
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given file.
- */
- public static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider(IFile file) {
- return getXmlResourceProvider_(file.getProject(), file.getFullPath());
- }
-
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given project in the specified runtime location
- */
- public static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider(IProject project, IPath runtimePath) {
- return getXmlResourceProvider_(project, runtimePath);
- }
-
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given project in the default runtime location
- */
- public static EclipseLinkOrmXmlResourceProvider getDefaultXmlResourceProvider(IProject project) {
- return getXmlResourceProvider(project, JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- }
-
- private static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider_(IProject project, IPath fullPath) {
- return new EclipseLinkOrmXmlResourceProvider(project, fullPath);
- }
-
-
- public EclipseLinkOrmXmlResourceProvider(IProject project) {
- this(project, JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- }
-
- public EclipseLinkOrmXmlResourceProvider(IProject project, IPath filePath) {
- super(project, filePath, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE);
- }
-
-
- @Override
- protected void populateRoot(Object config) {
- IDataModel dataModel = (IDataModel) config;
- XmlEntityMappings entityMappings = EclipseLinkOrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion(dataModel.getStringProperty(VERSION));
- getResourceContents().add(entityMappings);
-
- AccessType defaultAccess = (AccessType) dataModel.getProperty(DEFAULT_ACCESS);
- if (defaultAccess != null) {
- XmlPersistenceUnitMetadata puMetadata = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- entityMappings.setPersistenceUnitMetadata(puMetadata);
- XmlPersistenceUnitDefaults puDefaults = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- puMetadata.setPersistenceUnitDefaults(puDefaults);
- puDefaults.setAccess(defaultAccess);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java
deleted file mode 100644
index b6401dd3e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.platform;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformGroupDescription;
-
-/**
- * Constants pertaining to the EclipseLink JPA platforms and their group
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public class EclipseLinkPlatform {
-
- public static final JpaPlatformGroupDescription GROUP
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatformGroup("eclipselink"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_1_0
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("org.eclipse.eclipselink.platform"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_1_1
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink1_1"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_1_2
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink1_2"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_0
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_0"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_1
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_1"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_2
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_2"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_3
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_3"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_4
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_4"); //$NON-NLS-1$
-
-
- /**
- * Not for instantiation
- */
- private EclipseLinkPlatform() {}
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index 33272083e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Common protocol among:
- * org.eclipse.persistence.annotations.TypeConverter
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface BaseEclipseLinkTypeConverterAnnotation
- extends EclipseLinkNamedConverterAnnotation
-{
- /**
- * Corresponds to the 'dataType' element of the TypeConverter annotation.
- * Returns null if the element does not exist in Java.
- */
- String getDataType();
- String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'dataType' element of the TypeConverter annotation.
- * Set to null to remove the element.
- */
- void setDataType(String dataType);
-
- /**
- * Return the {@link TextRange} for the 'dataType' element. If the element
- * does not exist return the {@link TextRange} for the TypeConverter annotation.
- */
- TextRange getDataTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified data type name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;TypeConverter(dataType = MyDataType.class)
- * </pre>
- * will return <code>"model.MyDataType"</code> if there is an import for
- * <code>model.MyDataType</code>.
- */
- String getFullyQualifiedDataType();
-
- /**
- * Corresponds to the 'objectType' element of the TypeConverter annotation.
- * Returns null if the element does not exist in Java.
- */
- String getObjectType();
- String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'objectType' element of the TypeConverter annotation.
- * Set to null to remove the element.
- */
- void setObjectType(String objectType);
-
- /**
- * Return the {@link TextRange} for the 'objectType' element. If the element
- * does not exist return the {@link TextRange} for the TypeConverter annotation.
- */
- TextRange getObjectTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified object type name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;TypeConverter(dataType = MyObjectType.class)
- * </pre>
- * will return <code>"model.MyObjectType"</code> if there is an import for
- * <code>model.MyObjectType</code>.
- */
- String getFullyQualifiedObjectType();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java
deleted file mode 100644
index c7cdae36a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.CacheCoordinationType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum CacheCoordinationType {
-
- SEND_OBJECT_CHANGES(EclipseLink.CACHE_COORDINATION_TYPE__SEND_OBJECT_CHANGES),
- INVALIDATE_CHANGED_OBJECTS(EclipseLink.CACHE_COORDINATION_TYPE__INVALIDATE_CHANGED_OBJECTS),
- SEND_NEW_OBJECTS_WITH_CHANGES(EclipseLink.CACHE_COORDINATION_TYPE__SEND_NEW_OBJECTS_WITH_CHANGES),
- NONE(EclipseLink.CACHE_COORDINATION_TYPE__NONE);
-
-
- private String javaAnnotationValue;
-
- CacheCoordinationType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static CacheCoordinationType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static CacheCoordinationType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (CacheCoordinationType cacheCoordinationType : CacheCoordinationType.values()) {
- if (cacheCoordinationType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return cacheCoordinationType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheCoordinationType cacheCoordinationType) {
- return (cacheCoordinationType == null) ? null : cacheCoordinationType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java
deleted file mode 100644
index e2ff2d7e8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.config.CacheIsolationType added in EclipseLink 2.2
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum CacheIsolationType2_2 {
-
- SHARED(EclipseLink.CACHE_ISOLATION_TYPE__SHARED),
- PROTECTED(EclipseLink.CACHE_ISOLATION_TYPE__PROTECTED),
- ISOLATED(EclipseLink.CACHE_ISOLATION_TYPE__ISOLATED);
-
-
- private String javaAnnotationValue;
-
- CacheIsolationType2_2(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static CacheIsolationType2_2 fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static CacheIsolationType2_2 fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (CacheIsolationType2_2 cacheCoordinationType : CacheIsolationType2_2.values()) {
- if (cacheCoordinationType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return cacheCoordinationType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheIsolationType2_2 cacheCoordinationType) {
- return (cacheCoordinationType == null) ? null : cacheCoordinationType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java
deleted file mode 100644
index 6f5dd969a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.CacheType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum CacheType {
-
- FULL(EclipseLink.CACHE_TYPE__FULL),
- WEAK(EclipseLink.CACHE_TYPE__WEAK),
- SOFT(EclipseLink.CACHE_TYPE__SOFT),
- SOFT_WEAK(EclipseLink.CACHE_TYPE__SOFT_WEAK),
- HARD_WEAK(EclipseLink.CACHE_TYPE__HARD_WEAK),
- CACHE(EclipseLink.CACHE_TYPE__CACHE),
- NONE(EclipseLink.CACHE_TYPE__NONE);
-
-
- private String javaAnnotationValue;
-
- CacheType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static CacheType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static CacheType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (CacheType cacheType : CacheType.values()) {
- if (cacheType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return cacheType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheType cacheType) {
- return (cacheType == null) ? null : cacheType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java
deleted file mode 100644
index f9dac5d315..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.ChangeTrackingType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum ChangeTrackingType {
-
- ATTRIBUTE(EclipseLink.CHANGE_TRACKING_TYPE__ATTRIBUTE),
- OBJECT(EclipseLink.CHANGE_TRACKING_TYPE__OBJECT),
- DEFERRED(EclipseLink.CHANGE_TRACKING_TYPE__DEFERRED),
- AUTO(EclipseLink.CHANGE_TRACKING_TYPE__AUTO);
-
-
- private String javaAnnotationValue;
-
- ChangeTrackingType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static ChangeTrackingType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static ChangeTrackingType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (ChangeTrackingType changeTrackingType : ChangeTrackingType.values()) {
- if (changeTrackingType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return changeTrackingType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(ChangeTrackingType changeTrackingType) {
- return (changeTrackingType == null) ? null : changeTrackingType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java
deleted file mode 100644
index 9f74e7900d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * EclipseLink Java-related stuff (annotations etc.)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-@SuppressWarnings("nls")
-public interface EclipseLink {
-
- // EclipseLink package
- String PACKAGE = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
- String PACKAGE_ = PACKAGE + ".";
-
-
- // ********** API **********
-
- // EclispeLink annotations
- String BASIC_COLLECTION = PACKAGE_ + "BasicCollection";
- String BASIC_MAP = PACKAGE_ + "BasicMap";
- String CACHE = PACKAGE_ + "Cache";
- String CACHE__SHARED = "shared";
- String CACHE__EXPIRY = "expiry";
- String CACHE__EXPIRY_TIME_OF_DAY = "expiryTimeOfDay";
- String CACHE__TYPE = "type";
- String CACHE__SIZE = "size";
- String CACHE__ALWAYS_REFRESH = "alwaysRefresh";
- String CACHE__REFRESH_ONLY_IF_NEWER = "refreshOnlyIfNewer";
- String CACHE__DISABLE_HITS = "disableHits";
- String CACHE__COORDINATION_TYPE = "coordinationType";
- String CHANGE_TRACKING = PACKAGE_ + "ChangeTracking";
- String CHANGE_TRACKING__VALUE = "value";
- String CONVERSION_VALUE = PACKAGE_ + "ConversionValue";
- String CONVERSION_VALUE__DATA_VALUE = "dataValue";
- String CONVERSION_VALUE__OBJECT_VALUE = "objectValue";
- String CONVERT = PACKAGE_ + "Convert";
- String CONVERT__VALUE = "value";
- String CONVERTER = PACKAGE_ + "Converter";
- String CONVERTER__NAME = "name";
- String CONVERTER__CONVERTER_CLASS = "converterClass";
- String CUSTOMIZER = PACKAGE_ + "Customizer";
- String CUSTOMIZER__VALUE = "value";
- String EXISTENCE_CHECKING = PACKAGE_ + "ExistenceChecking";
- String EXISTENCE_CHECKING__VALUE = "value";
- String JOIN_FETCH = PACKAGE_ + "JoinFetch";
- String JOIN_FETCH__VALUE = "value";
- String MUTABLE = PACKAGE_ + "Mutable";
- String MUTABLE__VALUE = "value";
- String OBJECT_TYPE_CONVERTER = PACKAGE_ + "ObjectTypeConverter";
- String OBJECT_TYPE_CONVERTER__NAME = "name";
- String OBJECT_TYPE_CONVERTER__DATA_TYPE = "dataType";
- String OBJECT_TYPE_CONVERTER__OBJECT_TYPE = "objectType";
- String OBJECT_TYPE_CONVERTER__CONVERSION_VALUES = "conversionValues";
- String OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = "defaultObjectValue";
- String PRIMARY_KEY = PACKAGE_ + "PrimaryKey";
- String PRIMARY_KEY__VALIDATION = "validation";
- String PRIMARY_KEY__CACHE_KEY_TYPE = "cacheKeyType";
- String PRIMARY_KEY__COLUMNS = "columns";
- String PRIVATE_OWNED = PACKAGE_ + "PrivateOwned";
- String READ_ONLY = PACKAGE_ + "ReadOnly";
- String READ_TRANSFORMER = PACKAGE_ + "ReadTransformer";
- String READ_TRANSFORMER__TRANSFORMER_CLASS = "transformerClass";
- String READ_TRANSFORMER__METHOD = "method";
- String STRUCT_CONVERTER = PACKAGE_ + "StructConverter";
- String STRUCT_CONVERTER__NAME = "name";
- String STRUCT_CONVERTER__CONVERTER = "converter";
- String TIME_OF_DAY = PACKAGE_ + "TimeOfDay";
- String TIME_OF_DAY__HOUR = "hour";
- String TIME_OF_DAY__MINUTE = "minute";
- String TIME_OF_DAY__SECOND = "second";
- String TIME_OF_DAY__MILLISECOND = "millisecond";
- String TRANSFORMATION = PACKAGE_ + "Transformation";
- String TRANSFORMATION__FETCH = "fetch";
- String TRANSFORMATION__OPTIONAL = "optional";
- String TYPE_CONVERTER = PACKAGE_ + "TypeConverter";
- String TYPE_CONVERTER__NAME = "name";
- String TYPE_CONVERTER__DATA_TYPE = "dataType";
- String TYPE_CONVERTER__OBJECT_TYPE = "objectType";
- String VARIABLE_ONE_TO_ONE = PACKAGE_ + "VariableOneToOne";
- String WRITE_TRANSFORMER = PACKAGE_ + "WriteTransformer";
- String WRITE_TRANSFORMER__TRANSFORMER_CLASS = "transformerClass";
- String WRITE_TRANSFORMER__METHOD = "method";
- String WRITE_TRANSFORMER__COLUMN = "column";
- String WRITE_TRANSFORMERS = PACKAGE_ + "WriteTransformers";
- String WRITE_TRANSFORMERS__VALUE = "value";
-
- // EclipseLink enums
- String CACHE_COORDINATION_TYPE = PACKAGE_ + "CacheCoordinationType";
- String CACHE_COORDINATION_TYPE_ = CACHE_COORDINATION_TYPE + ".";
- String CACHE_COORDINATION_TYPE__SEND_OBJECT_CHANGES = CACHE_COORDINATION_TYPE_ + "SEND_OBJECT_CHANGES";
- String CACHE_COORDINATION_TYPE__INVALIDATE_CHANGED_OBJECTS = CACHE_COORDINATION_TYPE_ + "INVALIDATE_CHANGED_OBJECTS";
- String CACHE_COORDINATION_TYPE__SEND_NEW_OBJECTS_WITH_CHANGES = CACHE_COORDINATION_TYPE_ + "SEND_NEW_OBJECTS_WITH_CHANGES";
- String CACHE_COORDINATION_TYPE__NONE = CACHE_COORDINATION_TYPE_ + "NONE";
- String CACHE_TYPE = PACKAGE_ + "CacheType";
- String CACHE_TYPE_ = CACHE_TYPE + ".";
- String CACHE_TYPE__FULL = CACHE_TYPE_ + "FULL";
- String CACHE_TYPE__WEAK = CACHE_TYPE_ + "WEAK";
- String CACHE_TYPE__SOFT = CACHE_TYPE_ + "SOFT";
- String CACHE_TYPE__SOFT_WEAK = CACHE_TYPE_ + "SOFT_WEAK";
- String CACHE_TYPE__HARD_WEAK = CACHE_TYPE_ + "HARD_WEAK";
- String CACHE_TYPE__CACHE = CACHE_TYPE_ + "CACHE";
- String CACHE_TYPE__NONE = CACHE_TYPE_ + "NONE";
- String CHANGE_TRACKING_TYPE = PACKAGE_ + "ChangeTrackingType";
- String CHANGE_TRACKING_TYPE_ = CHANGE_TRACKING_TYPE + ".";
- String CHANGE_TRACKING_TYPE__ATTRIBUTE = CHANGE_TRACKING_TYPE_ + "ATTRIBUTE";
- String CHANGE_TRACKING_TYPE__OBJECT = CHANGE_TRACKING_TYPE_ + "OBJECT";
- String CHANGE_TRACKING_TYPE__DEFERRED = CHANGE_TRACKING_TYPE_ + "DEFERRED";
- String CHANGE_TRACKING_TYPE__AUTO = CHANGE_TRACKING_TYPE_ + "AUTO";
- String EXISTENCE_TYPE = PACKAGE_ + "ExistenceType";
- String EXISTENCE_TYPE_ = EXISTENCE_TYPE + ".";
- String EXISTENCE_TYPE__CHECK_CACHE = EXISTENCE_TYPE_ + "CHECK_CACHE";
- String EXISTENCE_TYPE__CHECK_DATABASE = EXISTENCE_TYPE_ + "CHECK_DATABASE";
- String EXISTENCE_TYPE__ASSUME_EXISTENCE = EXISTENCE_TYPE_ + "ASSUME_EXISTENCE";
- String EXISTENCE_TYPE__ASSUME_NON_EXISTENCE = EXISTENCE_TYPE_ + "ASSUME_NON_EXISTENCE";
- String JOIN_FETCH_TYPE = PACKAGE_ + "JoinFetchType";
- String JOIN_FETCH_TYPE_ = JOIN_FETCH_TYPE + ".";
- String JOIN_FETCH_TYPE__INNER = JOIN_FETCH_TYPE_ + "INNER";
- String JOIN_FETCH_TYPE__OUTER = JOIN_FETCH_TYPE_ + "OUTER";
-
-
- // EclispeLink 2.0 annotations
- String MAP_KEY_CONVERT = PACKAGE_ + "MapKeyConvert";
- String MAP_KEY_CONVERT__VALUE = "value";
-
-
- // EclispeLink 2.1 annotations
- String CLASS_EXTRACTOR = PACKAGE_ + "ClassExtractor";
- String CLASS_EXTRACTOR__VALUE = "value";
-
-
- // EclispeLink 2.2 annotations
- String CACHE__ISOLATION = "isolation";
-
- // EclipseLink 2.2 enums
- String CACHE_ISOLATION_TYPE = "org.eclipse.persistence.config.CacheIsolationType";
- String CACHE_ISOLATION_TYPE_ = CACHE_ISOLATION_TYPE + ".";
- String CACHE_ISOLATION_TYPE__SHARED = CACHE_ISOLATION_TYPE_ + "SHARED";
- String CACHE_ISOLATION_TYPE__PROTECTED = CACHE_ISOLATION_TYPE_ + "PROTECTED";
- String CACHE_ISOLATION_TYPE__ISOLATED = CACHE_ISOLATION_TYPE_ + "ISOLATED";
-
-
- // EclispeLink 2.3 annotations
- String MULTITENANT = PACKAGE_ + "Multitenant";
- String MULTITENANT__VALUE = "value";
-
- String MULTITENANT_TYPE = PACKAGE_ + "MultitenantType";
- String MULTITENANT_TYPE_ = MULTITENANT_TYPE + ".";
- String MULTITENANT_TYPE__SINGLE_TABLE = MULTITENANT_TYPE_ + "SINGLE_TABLE";
- String MULTITENANT_TYPE__TABLE_PER_TENANT = MULTITENANT_TYPE_ + "TABLE_PER_TENANT";
- //TODO kfb 2.4 eclipselink only? do we want to only support multitenancy in eclipselink 2.4
- String MULTITENANT_TYPE__VPD = MULTITENANT_TYPE_ + "VPD";
-
- String TENANT_DISCRIMINATOR_COLUMN = PACKAGE_ + "TenantDiscriminatorColumn";
- String TENANT_DISCRIMINATOR_COLUMN__NAME = "name";
- String TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = "contextProperty";
- String TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType";
- String TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String TENANT_DISCRIMINATOR_COLUMN__LENGTH = "length";
- String TENANT_DISCRIMINATOR_COLUMN__TABLE = "table";
- String TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY = "primaryKey";
-
- String TENANT_DISCRIMINATOR_COLUMNS = PACKAGE_ + "TenantDiscriminatorColumns";
- String TENANT_DISCRIMINATOR_COLUMNS__VALUE = "value";
-
-
- // EclispeLink 2.4 annotations
- String MULTITENANT__INCLUDE_CRITERIA = "includeCriteria";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index ee73c4fa67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.BasicCollection
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicCollectionAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.BASIC_COLLECTION;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 9a12bd45b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the Eclipselink annotation
- * org.eclipse.persistence.annotations.BasicMap
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicMapAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.BASIC_MAP;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java
deleted file mode 100644
index 0b6caddcea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Cache
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkCacheAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CACHE;
-
- /**
- * Corresponds to the 'type' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- CacheType getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setType(CacheType type);
-
- /**
- * Return the {@link TextRange} for the 'type' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'size' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getSize();
- String SIZE_PROPERTY = "size"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'size' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setSize(Integer size);
-
- /**
- * Return the {@link TextRange} for the 'size' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getSizeTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'shared' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getShared();
- String SHARED_PROPERTY = "shared"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'shared' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setShared(Boolean shared);
-
- /**
- * Return the {@link TextRange} for the 'shared' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getSharedTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'expiry' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getExpiry();
- String EXPIRY_PROPERTY = "expiry"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'expiry' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setExpiry(Integer expiry);
-
- /**
- * Return the {@link TextRange} for the 'expiry' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getExpiryTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'expiryTimeOfDay' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDay"; //$NON-NLS-1$
-
- EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay();
-
- void removeExpiryTimeOfDay();
-
- /**
- * Return the {@link TextRange} for the 'expiryTimeOfDay' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getExpiryTimeOfDayTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'alwaysRefresh' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getAlwaysRefresh();
- String ALWAYS_REFRESH_PROPERTY = "alwaysRefresh"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'alwaysRefresh' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setAlwaysRefresh(Boolean alwaysRefresh);
-
- /**
- * Return the {@link TextRange} for the 'alwaysRefresh' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getAlwaysRefreshTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'refreshOnlyIfNewer' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRefreshOnlyIfNewer();
- String REFRESH_ONLY_IF_NEWER_PROPERTY = "refreshOnlyIfNewer"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'refreshOnlyIfNewer' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer);
-
- /**
- * Return the {@link TextRange} for the 'refreshOnlyIfNewer' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getRefreshOnlyIfNewerTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'disableHits' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getDisableHits();
- String DISABLE_HITS_PROPERTY = "disableHits"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'disableHits' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setDisableHits(Boolean disableHits);
-
- /**
- * Return the {@link TextRange} for the 'disableHits' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getDisablesHitsTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'coordinationType' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- CacheCoordinationType getCoordinationType();
- String COORDINATION_TYPE_PROPERTY = "coordinationType"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'coordinationType' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setCoordinationType(CacheCoordinationType coordinationType);
-
- /**
- * Return the {@link TextRange} for the 'coordinationType' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getCoordinationTypeTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'isolation' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- CacheIsolationType2_2 getIsolation();
- String ISOLATION_PROPERTY = "isolation"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'isolation' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setIsolation(CacheIsolationType2_2 isolation);
-
- /**
- * Return the {@link TextRange} for the 'isolation' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getIsolationTextRange(CompilationUnit astRoot);
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index d4a7722b0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.ChangeTracking
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkChangeTrackingAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CHANGE_TRACKING;
-
- /**
- * Corresponds to the 'value' element of the ChangeTracking annotation.
- * Return null if the element does not exist in Java.
- */
- ChangeTrackingType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the ChangeTracking annotation.
- * Set to null to remove the element.
- */
- void setValue(ChangeTrackingType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the ChangeTracking annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index 3780478606..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.ClassExtractor</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 2.3
- */
-public interface EclipseLinkClassExtractorAnnotation2_1
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CLASS_EXTRACTOR;
-
- /**
- * Corresponds to the 'value' element of the ClassExtractor annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;ClassExtractor(value=MyExtractor.class)
- * </pre>
- * will return "MyExtractor"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the ClassExtractor annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the ClassExtractor annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified class name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;ClassExtractor(MyExtractor.class)
- * </pre>
- * will return <code>"model.MyExtractor"</code> if there is an import for
- * <code>model.MyExtractor</code>.
- */
- String getFullyQualifiedClassName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index adbc1d35a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.ConversionValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConversionValueAnnotation
- extends NestableAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.CONVERSION_VALUE;
-
- /**
- * Corresponds to the 'dataValue' element of the ConversionValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getDataValue();
- String DATA_VALUE_PROPERTY = "dataValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'dataValue' element of the ConversionValue annotation.
- * Set to null to remove the element.
- */
- void setDataValue(String dataValue);
-
- /**
- * Return the {@link TextRange} for the 'dataValue' element. If the element
- * does not exist return the {@link TextRange} for the ConversionValue annotation.
- */
- TextRange getDataValueTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'objectValue' element of the ConversionValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getObjectValue();
- String OBJECT_VALUE_PROPERTY = "objectValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'objectValue' element of the ConversionValue annotation.
- * Set to null to remove the element.
- */
- void setObjectValue(String objectValue);
-
- /**
- * Return the {@link TextRange} for the 'objectValue' element. If the element
- * does not exist return the {@link TextRange} for the ConversionValue annotation.
- */
- TextRange getObjectValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java
deleted file mode 100644
index bf89b181a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Convert
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConvertAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CONVERT;
-
- /**
- * Corresponds to the 'value' element of the Convert annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Convert annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Convert annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'value' element.
- * Return false if the element does not exist.
- */
- boolean valueTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java
deleted file mode 100644
index 4541271964..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Converter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkConverterAnnotation
- extends EclipseLinkNamedConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.CONVERTER;
-
- /**
- * Corresponds to the 'converterClass' element of the Converter annotation.
- * Returns null if the element does not exist in java.
- */
- String getConverterClass();
- String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'converterClass' element of the Converter annotation.
- * Set to null to remove the element.
- */
- void setConverterClass(String value);
-
- /**
- * Return the fully-qualified converter class name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;Converter(GenderConverter.class)
- * </pre>
- * will return <code>"model.GenderConverter"</code> if there is an import for
- * <code>model.GenderConverter</code>.
- */
- String getFullyQualifiedConverterClassName();
-
- /**
- * Return the {@link TextRange} for the 'converterClass' element. If the element
- * does not exist return the {@link TextRange} for the Converter annotation.
- */
- TextRange getConverterClassTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the converter class implements the specified interface.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter#ECLIPSELINK_CONVERTER_CLASS_NAME
- */
- boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index 9005f36be0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Customizer
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkCustomizerAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CUSTOMIZER;
-
- /**
- * Corresponds to the 'value' element of the Customizer annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Customizer annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the fully-qualified customizer class name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;Customizer(EmployeeCustomizer.class)
- * </pre>
- * will return <code>"model.EmployeeCustomizer"</code> if there is an
- * import for <code>model.EmployeeCustomizer</code>.
- */
- String getFullyQualifiedCustomizerClassName();
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Customizer annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the customizer class implements the specified interface.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer#ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME
- */
- boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index ec83a0d272..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.ExistenceChecking
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkExistenceCheckingAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.EXISTENCE_CHECKING;
-
- /**
- * Corresponds to the 'value' element of the ExistenceChecking annotation.
- * Return null if the element does not exist in Java.
- */
- ExistenceType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the ExistenceChecking annotation.
- * Set to null to remove the element.
- */
- void setValue(ExistenceType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the ExistenceChecking annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index 4c5d89caee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.JoinFetch
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkJoinFetchAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.JOIN_FETCH;
-
- /**
- * Corresponds to the 'value' element of the JoinFetch annotation.
- * Return null if the element does not exist in Java.
- */
- JoinFetchType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the JoinFetch annotation.
- * Set to null to remove the element.
- */
- void setValue(JoinFetchType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the JoinFetch annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java
deleted file mode 100644
index 062f896282..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.MapKeyConvert
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkMapKeyConvertAnnotation2_0
- extends EclipseLinkConvertAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.MAP_KEY_CONVERT;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index 0ef58fdd45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Multitenant
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkMultitenantAnnotation2_3
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.MULTITENANT;
-
- /**
- * Return whether the annotation exists in Java.
- */
- boolean isSpecified();
-
- /**
- * Corresponds to the 'value' element of the Multitenant annotation.
- * Return null if the element does not exist in Java.
- */
- MultitenantType2_3 getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Multitenant annotation.
- * Set to null to remove the element.
- */
- void setValue(MultitenantType2_3 value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Multitenant annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-
-// //********* include criteria added in EclipseLink 2.4 **********
-// /**
-// * Corresponds to the 'includeCriteria' element of the Multitenant annotation.
-// * Return null if the element does not exist in Java.
-// */
-// Boolean getIncludeCriteria();
-// String INCLUDE_CRITERIA_PROPERTY = "includeCriteria"; //$NON-NLS-1$
-//
-// /**
-// * Corresponds to the 'includeCriteria' element of the Multitenant annotation.
-// * Set to null to remove the element.
-// */
-// void setIncludeCriteria(Boolean includeCriteria);
-//
-// /**
-// * Return the {@link TextRange} for the 'includeCriteria' element.
-// * If the element does not exist return the {@link TextRange}
-// * for the Multitenant annotation.
-// */
-// TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java
deleted file mode 100644
index 2e9d6701a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the Eclipselink annotation
- * org.eclipse.persistence.annotations.Mutable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkMutableAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.MUTABLE;
-
- /**
- * Corresponds to the 'value' element of the Mutable annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Mutable annotation.
- * Set to null to remove the element.
- */
- void setValue(Boolean value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Mutable annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index bd829120c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Common protocol among:
- * org.eclipse.persistence.annotations.Converter
- * org.eclipse.persistence.annotations.StructConverter
- * org.eclipse.persistence.annotations.TypeConverter
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkNamedConverterAnnotation
- extends Annotation
-{
- /**
- * Corresponds to the 'name' element of the *Converter annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the *Converter annotation.
- * Set to null to remove the element.
- */
- void setName(String value);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If the element
- * does not exist return the {@link TextRange} for the CustomConverter annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index f9e73a5ca1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkObjectTypeConverterAnnotation
- extends BaseEclipseLinkTypeConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.OBJECT_TYPE_CONVERTER;
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<EclipseLinkConversionValueAnnotation> getConversionValues();
- String CONVERSION_VALUES_LIST = "conversionValues"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- int getConversionValuesSize();
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- EclipseLinkConversionValueAnnotation conversionValueAt(int index);
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- EclipseLinkConversionValueAnnotation addConversionValue(int index);
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- void moveConversionValue(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- void removeConversionValue(int index);
-
-
- /**
- * Corresponds to the 'defaultObjectValue' element of the ObjectTypeConverter annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultObjectValue();
- String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultObjectValue' element of the ObjectTypeConverter annotation.
- * Set to null to remove the element.
- */
- void setDefaultObjectValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'defaultObjectValue' element. If the element
- * does not exist return the {@link TextRange} for the ObjectTypeConverter annotation.
- */
- TextRange getDefaultObjectValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index 11a0731a06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.PrimaryKey
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface EclipseLinkPrimaryKeyAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.PRIMARY_KEY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index ab96344b6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.PrivateOwned
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkPrivateOwnedAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.PRIVATE_OWNED;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index a11da33e60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.ReadOnly
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkReadOnlyAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.READ_ONLY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index c87bd19870..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.ReadTransformer
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkReadTransformerAnnotation
- extends EclipseLinkTransformerAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.READ_TRANSFORMER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index 03eb6bf40b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.StructConverter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkStructConverterAnnotation
- extends EclipseLinkNamedConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.STRUCT_CONVERTER;
-
- /**
- * Corresponds to the 'converter' element of the StructConverter annotation.
- * Returns null if the element does not exist in Java.
- */
- String getConverter();
- String CONVERTER_PROPERTY = "converter"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'converter' element of the StructConverter annotation.
- * Set to null to remove the element.
- */
- void setConverter(String converter);
-
- /**
- * Return the {@link TextRange} for the 'converter' element. If the element
- * does not exist return the {@link TextRange} for the StructConverter annotation.
- */
- TextRange getConverterTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index 07742d3d5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.TenantDiscriminatorColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends DiscriminatorColumnAnnotation,
- NestableAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.TENANT_DISCRIMINATOR_COLUMN;
-
- // ********** contextProperty **********
-
- /**
- * Corresponds to the 'contextProperty' element of the TenantDiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- String getContextProperty();
- String CONTEXT_PROPERTY_PROPERTY = "contextProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'contextProperty' element of the TenantDiscriminatorColumn annotation.
- * Set to null to remove the element.
- */
- void setContextProperty(String contextProperty);
-
- /**
- * Return the {@link TextRange} for the 'contextProperty' element. If the element
- * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation.
- */
- TextRange getContextPropertyTextRange(CompilationUnit astRoot);
-
- // ********** table **********
-
- /**
- * Corresponds to the 'table' element of the TenantDiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- String getTable();
- String TABLE_PROPERTY = "table"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'table' element of the TenantDiscriminatorColumn annotation.
- * Set to null to remove the element.
- */
- void setTable(String table);
-
- /**
- * Return the {@link TextRange} for the 'table' element. If the element
- * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation.
- */
- TextRange getTableTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'table' element.
- * Return false if the element does not exist.
- */
- boolean tableTouches(int pos, CompilationUnit astRoot);
-
- // ********** primaryKey **********
-
- /**
- * Corresponds to the 'primaryKey' element of the TenantDiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getPrimaryKey();
- String PRIMARY_KEY_PROPERTY = "primaryKey"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'primaryKey' element of the TenantDiscriminatorColumn annotation.
- * Set to null to remove the element.
- */
- void setPrimaryKey(Boolean primaryKey);
-
- /**
- * Return the {@link TextRange} for the 'primaryKey' element. If the element
- * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation.
- */
- TextRange getPrimaryKeyTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index 456178cf5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.TimeOfDay</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTimeOfDayAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.TIME_OF_DAY;
-
-
- // ********** hour **********
-
- /**
- * Corresponds to the 'hour' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getHour();
- String HOUR_PROPERTY = "hour"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'hour' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setHour(Integer hour);
-
- /**
- * Return the {@link TextRange} for the 'hour' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getHourTextRange(CompilationUnit astRoot);
-
-
- // ********** minute **********
-
- /**
- * Corresponds to the 'minute' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getMinute();
- String MINUTE_PROPERTY = "minute"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'minute' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setMinute(Integer minute);
-
- /**
- * Return the {@link TextRange} for the 'minute' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getMinuteTextRange(CompilationUnit astRoot);
-
-
- // ********** second **********
-
- /**
- * Corresponds to the 'second' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getSecond();
- String SECOND_PROPERTY = "second"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'second' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setSecond(Integer second);
-
- /**
- * Return the {@link TextRange} for the 'second' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getSecondTextRange(CompilationUnit astRoot);
-
-
- // ********** millisecond **********
-
- /**
- * Corresponds to the 'millisecond' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getMillisecond();
- String MILLISECOND_PROPERTY = "millisecond"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'millisecond' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setMillisecond(Integer millisecond);
-
- /**
- * Return the {@link TextRange} for the 'millisecond' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getMillisecondTextRange(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java
deleted file mode 100644
index 8cb7363749..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Transformation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTransformationAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.TRANSFORMATION;
-
- /**
- * Corresponds to the 'fetch' element of the Transformation annotation.
- * Return null if the element does not exist in Java.
- */
- FetchType getFetch();
- String FETCH_PROPERTY = "fetch"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'fetch' element of the Transformation annotation.
- * Set to null to remove the element.
- */
- void setFetch(FetchType fetch);
-
- /**
- * Return the {@link TextRange} for the 'fetch' element. If the element
- * does not exist return the {@link TextRange} for the Transformation annotation.
- */
- TextRange getFetchTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'optional' element of the Transformation annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getOptional();
- String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'optional' element of the Transformation annotation.
- * Set to null to remove the element.
- */
- void setOptional(Boolean optional);
-
- /**
- * Return the {@link TextRange} for the 'optional' element. If the element
- * does not exist return the {@link TextRange} for the Transformation annotation.
- */
- TextRange getOptionalTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java
deleted file mode 100644
index 576a50c3db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Common protocol among:
- * org.eclipse.persistence.annotations.ReadTransformer
- * org.eclipse.persistence.annotations.WriteTransformer
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTransformerAnnotation
- extends Annotation
-{
- /**
- * Corresponds to the 'transformerClass' element of the *Transformer annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;ReadTransformer(transformerClass=Employee.class)
- * </pre>
- * will return "Employee".
- */
- String getTransformerClass();
- String TRANSFORMER_CLASS_PROPERTY = "transformerClass"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'transformerClass' element of the *Transformer annotation.
- * Set to null to remove the element.
- */
- void setTransformerClass(String transformerClass);
-
- /**
- * Return the {@link TextRange} for the 'transformerClass' element. If the element
- * does not exist return the {@link TextRange} for the *Transformer annotation.
- */
- TextRange getTransformerClassTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'method' element of the *Transformer annotation.
- * Return null if the element does not exist in Java.
- */
- String getMethod();
- String METHOD_PROPERTY = "method"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'method' element of the *Transformer annotation.
- * Set to null to remove the element.
- */
- void setMethod(String method);
-
- /**
- * Return the {@link TextRange} for the 'method' element. If the element
- * does not exist return the {@link TextRange} for the *Transformer annotation.
- */
- TextRange getMethodTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index 0730284239..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.TypeConverter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTypeConverterAnnotation
- extends BaseEclipseLinkTypeConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.TYPE_CONVERTER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 91e3f4fd2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to EclipseLink annotation
- * org.eclipse.persistence.annotations.VariableOneToOne
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface EclipseLinkVariableOneToOneAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.VARIABLE_ONE_TO_ONE;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index 8d6a3452bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-
-/**
- * Corresponds to the Eclipselink annotation
- * org.eclipse.persistence.annotations.WriteTransformer
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkWriteTransformerAnnotation
- extends EclipseLinkTransformerAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.WRITE_TRANSFORMER;
-
- /**
- * Corresponds to the 'column' element of the WriteTransformer annotation.
- * Return null if the element does not exist in Java.
- */
- ColumnAnnotation getColumn();
- String COLUMN_PROPERTY = "column"; //$NON-NLS-1$
-
- /**
- * Return a ColumnAnnotation, but do not return null if the 'column'
- * element does not exist on the WriteTransformer annotation. Instead
- * return a null object.
- */
- ColumnAnnotation getNonNullColumn();
-
- /**
- * Add the 'column' element to the WriteTransformer annotation.
- */
- ColumnAnnotation addColumn();
-
- /**
- * Remove the 'column' element from the WriteTransformer annotation.
- */
- void removeColumn();
-
- /**
- * Return the {@link TextRange} for the 'column' element. If the element
- * does not exist return the {@link TextRange} for the WriteTransformer annotation.
- */
- TextRange getColumnTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java
deleted file mode 100644
index 52782728a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.ExistenceType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum ExistenceType {
-
- CHECK_CACHE(EclipseLink.EXISTENCE_TYPE__CHECK_CACHE),
- CHECK_DATABASE(EclipseLink.EXISTENCE_TYPE__CHECK_DATABASE),
- ASSUME_EXISTENCE(EclipseLink.EXISTENCE_TYPE__ASSUME_EXISTENCE),
- ASSUME_NON_EXISTENCE(EclipseLink.EXISTENCE_TYPE__ASSUME_NON_EXISTENCE);
-
-
- private String javaAnnotationValue;
-
- ExistenceType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static ExistenceType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static ExistenceType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (ExistenceType existenceType : ExistenceType.values()) {
- if (existenceType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return existenceType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(ExistenceType existenceType) {
- return (existenceType == null) ? null : existenceType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java
deleted file mode 100644
index 6ebf81d55c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.JoinFetchType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum JoinFetchType {
-
- INNER(EclipseLink.JOIN_FETCH_TYPE__INNER),
- OUTER(EclipseLink.JOIN_FETCH_TYPE__OUTER);
-
-
- private String javaAnnotationValue;
-
- JoinFetchType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static JoinFetchType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static JoinFetchType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (JoinFetchType joinFetchType : JoinFetchType.values()) {
- if (joinFetchType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return joinFetchType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(JoinFetchType joinFetchType) {
- return (joinFetchType == null) ? null : joinFetchType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java
deleted file mode 100644
index 2164eba36e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-
-/**
- * Corresponds to the EclipseLink JPA enum
- * org.eclipse.persistence.annotations.MultitenantType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum MultitenantType2_3 {
-
- SINGLE_TABLE(EclipseLink.MULTITENANT_TYPE__SINGLE_TABLE),
- TABLE_PER_TENANT(EclipseLink.MULTITENANT_TYPE__TABLE_PER_TENANT),
- VPD(EclipseLink.MULTITENANT_TYPE__VPD);
-
-
- private String javaAnnotationValue;
-
- MultitenantType2_3(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static MultitenantType2_3 fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static MultitenantType2_3 fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (MultitenantType2_3 multitenantType : MultitenantType2_3.values()) {
- if (multitenantType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return multitenantType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(MultitenantType2_3 multitenantType) {
- return (multitenantType == null) ? null : multitenantType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java
deleted file mode 100644
index 4b71f1aa60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attributes</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicCollections <em>Basic Collections</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicMaps <em>Basic Maps</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getTransformations <em>Transformations</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getVariableOneToOnes <em>Variable One To Ones</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @model kind="class"
- * @generated
- */
-public class Attributes extends org.eclipse.jpt.jpa.core.resource.orm.Attributes implements XmlAttributes_2_3
-{
- /**
- * The cached value of the '{@link #getStructures() <em>Structures</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructures()
- * @generated
- * @ordered
- */
- protected EList<XmlStructure_2_3> structures;
-
- /**
- * The cached value of the '{@link #getArrays() <em>Arrays</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getArrays()
- * @generated
- * @ordered
- */
- protected EList<XmlArray_2_3> arrays;
-
- /**
- * The cached value of the '{@link #getBasicCollections() <em>Basic Collections</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBasicCollections()
- * @generated
- * @ordered
- */
- protected EList<XmlBasicCollection> basicCollections;
-
- /**
- * The cached value of the '{@link #getBasicMaps() <em>Basic Maps</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBasicMaps()
- * @generated
- * @ordered
- */
- protected EList<XmlBasicMap> basicMaps;
-
- /**
- * The cached value of the '{@link #getTransformations() <em>Transformations</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTransformations()
- * @generated
- * @ordered
- */
- protected EList<XmlTransformation> transformations;
-
- /**
- * The cached value of the '{@link #getVariableOneToOnes() <em>Variable One To Ones</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVariableOneToOnes()
- * @generated
- * @ordered
- */
- protected EList<XmlVariableOneToOne> variableOneToOnes;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Attributes()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.ATTRIBUTES;
- }
-
- /**
- * Returns the value of the '<em><b>Structures</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Structures</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Structures</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributes_2_3_Structures()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructure_2_3> getStructures()
- {
- if (structures == null)
- {
- structures = new EObjectContainmentEList<XmlStructure_2_3>(XmlStructure_2_3.class, this, EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES);
- }
- return structures;
- }
-
- /**
- * Returns the value of the '<em><b>Arrays</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Arrays</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Arrays</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributes_2_3_Arrays()
- * @model containment="true"
- * @generated
- */
- public EList<XmlArray_2_3> getArrays()
- {
- if (arrays == null)
- {
- arrays = new EObjectContainmentEList<XmlArray_2_3>(XmlArray_2_3.class, this, EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS);
- }
- return arrays;
- }
-
- /**
- * Returns the value of the '<em><b>Basic Collections</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Basic Collections</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Basic Collections</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_BasicCollections()
- * @model containment="true"
- * @generated
- */
- public EList<XmlBasicCollection> getBasicCollections()
- {
- if (basicCollections == null)
- {
- basicCollections = new EObjectContainmentEList<XmlBasicCollection>(XmlBasicCollection.class, this, EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS);
- }
- return basicCollections;
- }
-
- /**
- * Returns the value of the '<em><b>Basic Maps</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Basic Maps</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Basic Maps</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_BasicMaps()
- * @model containment="true"
- * @generated
- */
- public EList<XmlBasicMap> getBasicMaps()
- {
- if (basicMaps == null)
- {
- basicMaps = new EObjectContainmentEList<XmlBasicMap>(XmlBasicMap.class, this, EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS);
- }
- return basicMaps;
- }
-
- /**
- * Returns the value of the '<em><b>Transformations</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Transformations</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Transformations</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_Transformations()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTransformation> getTransformations()
- {
- if (transformations == null)
- {
- transformations = new EObjectContainmentEList<XmlTransformation>(XmlTransformation.class, this, EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS);
- }
- return transformations;
- }
-
- /**
- * Returns the value of the '<em><b>Variable One To Ones</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Variable One To Ones</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Variable One To Ones</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_VariableOneToOnes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlVariableOneToOne> getVariableOneToOnes()
- {
- if (variableOneToOnes == null)
- {
- variableOneToOnes = new EObjectContainmentEList<XmlVariableOneToOne>(XmlVariableOneToOne.class, this, EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES);
- }
- return variableOneToOnes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- return ((InternalEList<?>)getStructures()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- return ((InternalEList<?>)getArrays()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- return ((InternalEList<?>)getBasicCollections()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- return ((InternalEList<?>)getBasicMaps()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- return ((InternalEList<?>)getTransformations()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- return ((InternalEList<?>)getVariableOneToOnes()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- return getStructures();
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- return getArrays();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- return getBasicCollections();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- return getBasicMaps();
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- return getTransformations();
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- return getVariableOneToOnes();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- getStructures().clear();
- getStructures().addAll((Collection<? extends XmlStructure_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- getArrays().clear();
- getArrays().addAll((Collection<? extends XmlArray_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- getBasicCollections().clear();
- getBasicCollections().addAll((Collection<? extends XmlBasicCollection>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- getBasicMaps().clear();
- getBasicMaps().addAll((Collection<? extends XmlBasicMap>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- getTransformations().clear();
- getTransformations().addAll((Collection<? extends XmlTransformation>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- getVariableOneToOnes().clear();
- getVariableOneToOnes().addAll((Collection<? extends XmlVariableOneToOne>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- getStructures().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- getArrays().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- getBasicCollections().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- getBasicMaps().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- getTransformations().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- getVariableOneToOnes().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- return structures != null && !structures.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- return arrays != null && !arrays.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- return basicCollections != null && !basicCollections.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- return basicMaps != null && !basicMaps.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- return transformations != null && !transformations.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- return variableOneToOnes != null && !variableOneToOnes.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAttributes_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES: return EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__STRUCTURES;
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS: return EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__ARRAYS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAttributes_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__STRUCTURES: return EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES;
- case EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__ARRAYS: return EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- @Override
- public List<XmlAttributeMapping> getAttributeMappings() {
- // convert lists to arrays to avoid ConcurrentModificationException while adding to result list
- ArrayList<XmlAttributeMapping> attributeMappings = new ArrayList<XmlAttributeMapping>();
- CollectionTools.addAll(attributeMappings, this.getIds().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getEmbeddedIds().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getBasics().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getBasicCollections().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getBasicMaps().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getVersions().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getManyToOnes().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getOneToManys().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getOneToOnes().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getVariableOneToOnes().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getManyToManys().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getElementCollections().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getEmbeddeds().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getTransformations().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getTransients().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- return attributeMappings;
- }
-
- protected static final XmlAttributeMapping[] EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY = new XmlAttributeMapping[0];
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getAttributes(),
- buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- EclipseLink.ATTRIBUTES,
- OrmPackage.eINSTANCE.getXmlTypeMapping_Attributes());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- XmlId.buildTranslator(EclipseLink2_0.ID, OrmPackage.eINSTANCE.getAttributes_Ids()),
- XmlEmbeddedId.buildTranslator(EclipseLink2_0.EMBEDDED_ID, OrmPackage.eINSTANCE.getAttributes_EmbeddedIds()),
- XmlBasic.buildTranslator(EclipseLink2_0.BASIC, OrmPackage.eINSTANCE.getAttributes_Basics()),
- XmlBasicCollection.buildTranslator(EclipseLink2_0.BASIC_COLLECTION, EclipseLinkOrmPackage.eINSTANCE.getAttributes_BasicCollections()),
- XmlBasicMap.buildTranslator(EclipseLink2_0.BASIC_MAP, EclipseLinkOrmPackage.eINSTANCE.getAttributes_BasicMaps()),
- XmlVersion.buildTranslator(EclipseLink2_0.VERSION, OrmPackage.eINSTANCE.getAttributes_Versions()),
- XmlManyToOne.buildTranslator(EclipseLink2_0.MANY_TO_ONE, OrmPackage.eINSTANCE.getAttributes_ManyToOnes()),
- XmlOneToMany.buildTranslator(EclipseLink2_0.ONE_TO_MANY, OrmPackage.eINSTANCE.getAttributes_OneToManys()),
- XmlOneToOne.buildTranslator(EclipseLink2_0.ONE_TO_ONE, OrmPackage.eINSTANCE.getAttributes_OneToOnes()),
- XmlVariableOneToOne.buildTranslator(EclipseLink2_0.VARIABLE_ONE_TO_ONE, EclipseLinkOrmPackage.eINSTANCE.getAttributes_VariableOneToOnes()),
- XmlManyToMany.buildTranslator(EclipseLink2_0.MANY_TO_MANY, OrmPackage.eINSTANCE.getAttributes_ManyToManys()),
- XmlElementCollection.buildTranslator(EclipseLink2_0.ELEMENT_COLLECTION, OrmV2_0Package.eINSTANCE.getXmlAttributes_2_0_ElementCollections()),
- XmlEmbedded.buildTranslator(EclipseLink2_0.EMBEDDED, OrmPackage.eINSTANCE.getAttributes_Embeddeds()),
- XmlTransformation.buildTranslator(EclipseLink2_0.TRANSFORMATION, EclipseLinkOrmPackage.eINSTANCE.getAttributes_Transformations()),
- XmlTransient.buildTranslator(EclipseLink2_0.TRANSIENT, OrmPackage.eINSTANCE.getAttributes_Transients()),
- XmlStructure.buildTranslator(EclipseLink2_3.STRUCTURE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlAttributes_2_3_Structures()),
- XmlArray.buildTranslator(EclipseLink2_3.ARRAY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlAttributes_2_3_Arrays()),
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java
deleted file mode 100644
index ce93ec06d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Cache Coordination Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType()
- * @model
- * @generated
- */
-public enum CacheCoordinationType implements Enumerator
-{
- /**
- * The '<em><b>SEND OBJECT CHANGES</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SEND_OBJECT_CHANGES_VALUE
- * @generated
- * @ordered
- */
- SEND_OBJECT_CHANGES(0, "SEND_OBJECT_CHANGES", "SEND_OBJECT_CHANGES"),
-
- /**
- * The '<em><b>INVALIDATE CHANGED OBJECTS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INVALIDATE_CHANGED_OBJECTS_VALUE
- * @generated
- * @ordered
- */
- INVALIDATE_CHANGED_OBJECTS(1, "INVALIDATE_CHANGED_OBJECTS", "INVALIDATE_CHANGED_OBJECTS"),
-
- /**
- * The '<em><b>SEND NEW OBJECTS WITH CHANGES</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SEND_NEW_OBJECTS_WITH_CHANGES_VALUE
- * @generated
- * @ordered
- */
- SEND_NEW_OBJECTS_WITH_CHANGES(2, "SEND_NEW_OBJECTS_WITH_CHANGES", "SEND_NEW_OBJECTS_WITH_CHANGES"),
-
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(3, "NONE", "NONE");
-
- /**
- * The '<em><b>SEND OBJECT CHANGES</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SEND OBJECT CHANGES</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SEND_OBJECT_CHANGES
- * @model
- * @generated
- * @ordered
- */
- public static final int SEND_OBJECT_CHANGES_VALUE = 0;
-
- /**
- * The '<em><b>INVALIDATE CHANGED OBJECTS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INVALIDATE CHANGED OBJECTS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INVALIDATE_CHANGED_OBJECTS
- * @model
- * @generated
- * @ordered
- */
- public static final int INVALIDATE_CHANGED_OBJECTS_VALUE = 1;
-
- /**
- * The '<em><b>SEND NEW OBJECTS WITH CHANGES</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SEND NEW OBJECTS WITH CHANGES</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SEND_NEW_OBJECTS_WITH_CHANGES
- * @model
- * @generated
- * @ordered
- */
- public static final int SEND_NEW_OBJECTS_WITH_CHANGES_VALUE = 2;
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Cache Coordination Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheCoordinationType[] VALUES_ARRAY =
- new CacheCoordinationType[]
- {
- SEND_OBJECT_CHANGES,
- INVALIDATE_CHANGED_OBJECTS,
- SEND_NEW_OBJECTS_WITH_CHANGES,
- NONE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Coordination Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheCoordinationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Coordination Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheCoordinationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheCoordinationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Coordination Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheCoordinationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheCoordinationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Coordination Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheCoordinationType get(int value)
- {
- switch (value)
- {
- case SEND_OBJECT_CHANGES_VALUE: return SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS_VALUE: return INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES_VALUE: return SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE_VALUE: return NONE;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheCoordinationType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheCoordinationType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java
deleted file mode 100644
index 2d35af2d10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType()
- * @model
- * @generated
- */
-public enum CacheType implements Enumerator
-{
- /**
- * The '<em><b>FULL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #FULL_VALUE
- * @generated
- * @ordered
- */
- FULL(0, "FULL", "FULL"),
-
- /**
- * The '<em><b>WEAK</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #WEAK_VALUE
- * @generated
- * @ordered
- */
- WEAK(1, "WEAK", "WEAK"),
-
- /**
- * The '<em><b>SOFT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SOFT_VALUE
- * @generated
- * @ordered
- */
- SOFT(2, "SOFT", "SOFT"),
-
- /**
- * The '<em><b>SOFT WEAK</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SOFT_WEAK_VALUE
- * @generated
- * @ordered
- */
- SOFT_WEAK(3, "SOFT_WEAK", "SOFT_WEAK"),
-
- /**
- * The '<em><b>HARD WEAK</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #HARD_WEAK_VALUE
- * @generated
- * @ordered
- */
- HARD_WEAK(4, "HARD_WEAK", "HARD_WEAK"),
-
- /**
- * The '<em><b>CACHE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CACHE_VALUE
- * @generated
- * @ordered
- */
- CACHE(5, "CACHE", "CACHE"),
-
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(6, "NONE", "NONE");
-
- /**
- * The '<em><b>FULL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>FULL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #FULL
- * @model
- * @generated
- * @ordered
- */
- public static final int FULL_VALUE = 0;
-
- /**
- * The '<em><b>WEAK</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>WEAK</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #WEAK
- * @model
- * @generated
- * @ordered
- */
- public static final int WEAK_VALUE = 1;
-
- /**
- * The '<em><b>SOFT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SOFT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SOFT
- * @model
- * @generated
- * @ordered
- */
- public static final int SOFT_VALUE = 2;
-
- /**
- * The '<em><b>SOFT WEAK</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SOFT WEAK</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SOFT_WEAK
- * @model
- * @generated
- * @ordered
- */
- public static final int SOFT_WEAK_VALUE = 3;
-
- /**
- * The '<em><b>HARD WEAK</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>HARD WEAK</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #HARD_WEAK
- * @model
- * @generated
- * @ordered
- */
- public static final int HARD_WEAK_VALUE = 4;
-
- /**
- * The '<em><b>CACHE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CACHE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CACHE
- * @model
- * @generated
- * @ordered
- */
- public static final int CACHE_VALUE = 5;
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 6;
-
- /**
- * An array of all the '<em><b>Cache Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheType[] VALUES_ARRAY =
- new CacheType[]
- {
- FULL,
- WEAK,
- SOFT,
- SOFT_WEAK,
- HARD_WEAK,
- CACHE,
- NONE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheType get(int value)
- {
- switch (value)
- {
- case FULL_VALUE: return FULL;
- case WEAK_VALUE: return WEAK;
- case SOFT_VALUE: return SOFT;
- case SOFT_WEAK_VALUE: return SOFT_WEAK;
- case HARD_WEAK_VALUE: return HARD_WEAK;
- case CACHE_VALUE: return CACHE;
- case NONE_VALUE: return NONE;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java
deleted file mode 100644
index bec2cb9d24..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-
-@SuppressWarnings("nls")
-public interface EclipseLink
- extends JPA
-{
- String SCHEMA_NAMESPACE = "http://www.eclipse.org/eclipselink/xsds/persistence/orm";
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd";
- String SCHEMA_VERSION = "1.0";
-
- // EclipseLink specific nodes
-
- String ACCESS_METHODS = "access-methods"; //$NON-NLS-1$
- String ACCESS_METHODS__GET_METHOD = "get-method"; //$NON-NLS-1$
- String ACCESS_METHODS__SET_METHOD = "set-method"; //$NON-NLS-1$
-
- String BASIC_COLLECTION = "basic-collection"; //$NON-NLS-1$
-
- String BASIC_MAP = "basic-map"; //$NON-NLS-1$
-
- String CACHE = "cache"; //$NON-NLS-1$
- String CACHE__EXPIRY = "expiry"; //$NON-NLS-1$
- String CACHE__SIZE = "size"; //$NON-NLS-1$
- String CACHE__SHARED = "shared"; //$NON-NLS-1$
- String CACHE__TYPE = "type"; //$NON-NLS-1$
- String CACHE__ALWAYS_REFRESH = "always-refresh"; //$NON-NLS-1$
- String CACHE__REFRESH_ONLY_IF_NEWER = "refresh-only-if-newer"; //$NON-NLS-1$
- String CACHE__DISABLE_HITS = "disable-hits"; //$NON-NLS-1$
- String CACHE__COORDINATION_TYPE = "coordination-type"; //$NON-NLS-1$
-
- String CHANGE_TRACKING = "change-tracking"; //$NON-NLS-1$
-
- String CONVERSION_VALUE = "conversion-value"; //$NON-NLS-1$
- String CONVERSION_VALUE__DATA_VALUE = "data-value"; //$NON-NLS-1$
- String CONVERSION_VALUE__OBJECT_VALUE = "object-value"; //$NON-NLS-1$
-
- String CONVERT = "convert"; //$NON-NLS-1$
-
- String CONVERTER = "converter"; //$NON-NLS-1$
- String CONVERTER__CLASS = "class"; //$NON-NLS-1$
- String CONVERTER__NAME = "name"; //$NON-NLS-1$
-
- String COPY_POLICY = "copy-policy"; //$NON-NLS-1$
- String COPY_POLICY__CLASS = "class"; //$NON-NLS-1$
-
- String CLONE_COPY_POLICY = "clone-copy-policy"; //$NON-NLS-1$
- String CLONE_COPY_POLICY__METHOD = "method"; //$NON-NLS-1$
- String CLONE_COPY_POLICY__WORKING_COPY_METHOD = "working-copy-method"; //$NON-NLS-1$
-
- String CUSTOMIZER = "customizer"; //$NON-NLS-1$
-
- String EXCLUDE_DEFAULT_MAPPINGS = "exclude-default-mappings"; //$NON-NLS-1$
-
- String EXISTENCE_CHECKING = "existence-checking"; //$NON-NLS-1$
-
- String EXPIRY_TIME_OF_DAY = "expiry-time-of-day"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__HOUR = "hour"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__MINUTE = "minute"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__SECOND = "second"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__MILLISECOND = "millisecond"; //$NON-NLS-1$
-
- String INSTANTIATION_COPY_POLICY = "instantiation-copy-policy"; //$NON-NLS-1$
-
- String JOIN_FETCH = "join-fetch"; //$NON-NLS-1$
-
- String MUTABLE = "mutable"; //$NON-NLS-1$
-
- String NAMED_STORED_PROCEDURE_QUERY = "named-stored-procedure-query"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__NAME = "name"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__HINT = "hint"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS = "result-class"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING = "result-set-mapping"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME = "procedure-name"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET = "returns-result-set"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__PARAMETER = "parameter"; //$NON-NLS-1$
- String PARAMETER__DIRECTION = "direction"; //$NON-NLS-1$
- String PARAMETER__NAME = "name"; //$NON-NLS-1$
- String PARAMETER__QUERY_PARAMETER = "query-parameter"; //$NON-NLS-1$
- String PARAMETER__TYPE = "type"; //$NON-NLS-1$
- String PARAMETER__JDBC_TYPE = "jdbc-type"; //$NON-NLS-1$
- String PARAMETER__JDBC_TYPE_NAME = "jdbc-type-name"; //$NON-NLS-1$
-
-
- String OBJECT_TYPE_CONVERTER = "object-type-converter"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__NAME = "name"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__DATA_TYPE = "data-type"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__OBJECT_TYPE = "object-type"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = "default-object-value"; //$NON-NLS-1$
-
- String OPTIMISTIC_LOCKING = "optimistic-locking"; //$NON-NLS-1$
- String OPTIMISTIC_LOCKING__SELECTED_COLUMN = "selected-column"; //$NON-NLS-1$
- String OPTIMISTIC_LOCKING__TYPE = "type"; //$NON-NLS-1$
- String OPTIMISTIC_LOCKING__CASCADE = "cascade"; //$NON-NLS-1$
-
- String PRIVATE_OWNED = "private-owned"; //$NON-NLS-1$
-
- String PROPERTY = "property"; //$NON-NLS-1$
- String PROPERTY__NAME = "name"; //$NON-NLS-1$
- String PROPERTY__VALUE = "value"; //$NON-NLS-1$
- String PROPERTY__VALUE_TYPE = "value-type"; //$NON-NLS-1$
-
- String READ_ONLY = "read-only"; //$NON-NLS-1$
-
-
- String STRUCT_CONVERTER = "struct-converter"; //$NON-NLS-1$
- String STRUCT_CONVERTER__NAME = "name"; //$NON-NLS-1$
- String STRUCT_CONVERTER__CONVERTER = "converter"; //$NON-NLS-1$
-
- String TRANSFORMATION = "transformation"; //$NON-NLS-1$
-
- String TYPE = "type"; //$NON-NLS-1$
-
- String TYPE_CONVERTER = "type-converter"; //$NON-NLS-1$
- String TYPE_CONVERTER__NAME = "name"; //$NON-NLS-1$
- String TYPE_CONVERTER__DATA_TYPE = "data-type"; //$NON-NLS-1$
- String TYPE_CONVERTER__OBJECT_TYPE = "object-type"; //$NON-NLS-1$
-
- String VARIABLE_ONE_TO_ONE = "variable-one-to-one"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java
deleted file mode 100644
index 4da6baf902..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java
+++ /dev/null
@@ -1,1199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage
- * @generated
- */
-public class EclipseLinkOrmFactory extends EFactoryImpl
-{
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmFactory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmFactory init()
- {
- try
- {
- EclipseLinkOrmFactory theEclipseLinkOrmFactory = (EclipseLinkOrmFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.xmi");
- if (theEclipseLinkOrmFactory != null)
- {
- return theEclipseLinkOrmFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmFactory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmFactory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS: return (EObject)createXmlAccessMethods();
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA: return (EObject)createXmlAdditionalCriteria();
- case EclipseLinkOrmPackage.XML_ARRAY: return (EObject)createXmlArray();
- case EclipseLinkOrmPackage.ATTRIBUTES: return (EObject)createAttributes();
- case EclipseLinkOrmPackage.XML_BASIC: return (EObject)createXmlBasic();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION: return (EObject)createXmlBasicCollection();
- case EclipseLinkOrmPackage.XML_BASIC_MAP: return (EObject)createXmlBasicMap();
- case EclipseLinkOrmPackage.XML_BATCH_FETCH: return (EObject)createXmlBatchFetch();
- case EclipseLinkOrmPackage.XML_CACHE: return (EObject)createXmlCache();
- case EclipseLinkOrmPackage.XML_CACHE_INDEX: return (EObject)createXmlCacheIndex();
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING: return (EObject)createXmlChangeTracking();
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY: return (EObject)createXmlCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE: return (EObject)createXmlCollectionTable();
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE: return (EObject)createXmlConversionValue();
- case EclipseLinkOrmPackage.XML_CONVERTER: return (EObject)createXmlConverter();
- case EclipseLinkOrmPackage.XML_COPY_POLICY: return (EObject)createXmlCopyPolicy();
- case EclipseLinkOrmPackage.XML_CUSTOMIZER: return (EObject)createXmlCustomizer();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION: return (EObject)createXmlElementCollection();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE: return (EObject)createXmlEmbeddable();
- case EclipseLinkOrmPackage.XML_EMBEDDED: return (EObject)createXmlEmbedded();
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID: return (EObject)createXmlEmbeddedId();
- case EclipseLinkOrmPackage.XML_ENTITY: return (EObject)createXmlEntity();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS: return (EObject)createXmlEntityMappings();
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE: return (EObject)createXmlFetchAttribute();
- case EclipseLinkOrmPackage.XML_FETCH_GROUP: return (EObject)createXmlFetchGroup();
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING: return (EObject)createXmlHashPartitioning();
- case EclipseLinkOrmPackage.XML_ID: return (EObject)createXmlId();
- case EclipseLinkOrmPackage.XML_INDEX: return (EObject)createXmlIndex();
- case EclipseLinkOrmPackage.XML_INSTANTIATION_COPY_POLICY: return (EObject)createXmlInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_JOIN_TABLE: return (EObject)createXmlJoinTable();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY: return (EObject)createXmlManyToMany();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE: return (EObject)createXmlManyToOne();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS: return (EObject)createXmlMappedSuperclass();
- case EclipseLinkOrmPackage.XML_MULTITENANT: return (EObject)createXmlMultitenant();
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER: return (EObject)createXmlNamedConverter();
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY: return (EObject)createXmlNamedPlsqlStoredFunctionQuery();
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY: return (EObject)createXmlNamedPlsqlStoredProcedureQuery();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY: return (EObject)createXmlNamedStoredFunctionQuery();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY: return (EObject)createXmlNamedStoredProcedureQuery();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER: return (EObject)createXmlObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY: return (EObject)createXmlOneToMany();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE: return (EObject)createXmlOneToOne();
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING: return (EObject)createXmlOptimisticLocking();
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN: return (EObject)createXmlOrderColumn();
- case EclipseLinkOrmPackage.XML_PARTITIONING: return (EObject)createXmlPartitioning();
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS: return (EObject)createXmlPersistenceUnitDefaults();
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA: return (EObject)createXmlPersistenceUnitMetadata();
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING: return (EObject)createXmlPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD: return (EObject)createXmlPlsqlRecord();
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE: return (EObject)createXmlPlsqlTable();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY: return (EObject)createXmlPrimaryKey();
- case EclipseLinkOrmPackage.XML_PROPERTY: return (EObject)createXmlProperty();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS: return (EObject)createXmlQueryRedirectors();
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING: return (EObject)createXmlRangePartitioning();
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING: return (EObject)createXmlReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_RETURN_INSERT: return (EObject)createXmlReturnInsert();
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING: return (EObject)createXmlRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE: return (EObject)createXmlSecondaryTable();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER: return (EObject)createXmlStoredProcedureParameter();
- case EclipseLinkOrmPackage.XML_STRUCT: return (EObject)createXmlStruct();
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER: return (EObject)createXmlStructConverter();
- case EclipseLinkOrmPackage.XML_STRUCTURE: return (EObject)createXmlStructure();
- case EclipseLinkOrmPackage.XML_TABLE: return (EObject)createXmlTable();
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR: return (EObject)createXmlTableGenerator();
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN: return (EObject)createXmlTenantDiscriminatorColumn();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY: return (EObject)createXmlTimeOfDay();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION: return (EObject)createXmlTransformation();
- case EclipseLinkOrmPackage.XML_TRANSIENT: return (EObject)createXmlTransient();
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER: return (EObject)createXmlTypeConverter();
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING: return (EObject)createXmlUnionPartitioning();
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING: return (EObject)createXmlValuePartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE: return (EObject)createXmlVariableOneToOne();
- case EclipseLinkOrmPackage.XML_VERSION: return (EObject)createXmlVersion();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmPackage.CACHE_COORDINATION_TYPE:
- return createCacheCoordinationTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.CACHE_TYPE:
- return createCacheTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_TYPE:
- return createXmlChangeTrackingTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_DIRECTION:
- return createXmlDirectionFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.EXISTENCE_TYPE:
- return createExistenceTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_JOIN_FETCH_TYPE:
- return createXmlJoinFetchTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING_TYPE:
- return createXmlOptimisticLockingTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmPackage.CACHE_COORDINATION_TYPE:
- return convertCacheCoordinationTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.CACHE_TYPE:
- return convertCacheTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_TYPE:
- return convertXmlChangeTrackingTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_DIRECTION:
- return convertXmlDirectionToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.EXISTENCE_TYPE:
- return convertExistenceTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_JOIN_FETCH_TYPE:
- return convertXmlJoinFetchTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING_TYPE:
- return convertXmlOptimisticLockingTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAccessMethods createXmlAccessMethods()
- {
- XmlAccessMethods xmlAccessMethods = new XmlAccessMethods();
- return xmlAccessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAdditionalCriteria createXmlAdditionalCriteria()
- {
- XmlAdditionalCriteria xmlAdditionalCriteria = new XmlAdditionalCriteria();
- return xmlAdditionalCriteria;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlArray createXmlArray()
- {
- XmlArray xmlArray = new XmlArray();
- return xmlArray;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Attributes createAttributes()
- {
- Attributes attributes = new Attributes();
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasic createXmlBasic()
- {
- XmlBasic xmlBasic = new XmlBasic();
- return xmlBasic;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicCollection createXmlBasicCollection()
- {
- XmlBasicCollection xmlBasicCollection = new XmlBasicCollection();
- return xmlBasicCollection;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicMap createXmlBasicMap()
- {
- XmlBasicMap xmlBasicMap = new XmlBasicMap();
- return xmlBasicMap;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBatchFetch createXmlBatchFetch()
- {
- XmlBatchFetch xmlBatchFetch = new XmlBatchFetch();
- return xmlBatchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCache createXmlCache()
- {
- XmlCache xmlCache = new XmlCache();
- return xmlCache;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCacheIndex createXmlCacheIndex()
- {
- XmlCacheIndex xmlCacheIndex = new XmlCacheIndex();
- return xmlCacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlChangeTracking createXmlChangeTracking()
- {
- XmlChangeTracking xmlChangeTracking = new XmlChangeTracking();
- return xmlChangeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCloneCopyPolicy createXmlCloneCopyPolicy()
- {
- XmlCloneCopyPolicy xmlCloneCopyPolicy = new XmlCloneCopyPolicy();
- return xmlCloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCollectionTable createXmlCollectionTable()
- {
- XmlCollectionTable xmlCollectionTable = new XmlCollectionTable();
- return xmlCollectionTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlConversionValue createXmlConversionValue()
- {
- XmlConversionValue xmlConversionValue = new XmlConversionValue();
- return xmlConversionValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlConverter createXmlConverter()
- {
- XmlConverter xmlConverter = new XmlConverter();
- return xmlConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCopyPolicy createXmlCopyPolicy()
- {
- XmlCopyPolicy xmlCopyPolicy = new XmlCopyPolicy();
- return xmlCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCustomizer createXmlCustomizer()
- {
- XmlCustomizer xmlCustomizer = new XmlCustomizer();
- return xmlCustomizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlElementCollection createXmlElementCollection()
- {
- XmlElementCollection xmlElementCollection = new XmlElementCollection();
- return xmlElementCollection;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddable createXmlEmbeddable()
- {
- XmlEmbeddable xmlEmbeddable = new XmlEmbeddable();
- return xmlEmbeddable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbedded createXmlEmbedded()
- {
- XmlEmbedded xmlEmbedded = new XmlEmbedded();
- return xmlEmbedded;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddedId createXmlEmbeddedId()
- {
- XmlEmbeddedId xmlEmbeddedId = new XmlEmbeddedId();
- return xmlEmbeddedId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntity createXmlEntity()
- {
- XmlEntity xmlEntity = new XmlEntity();
- return xmlEntity;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntityMappings createXmlEntityMappings()
- {
- XmlEntityMappings xmlEntityMappings = new XmlEntityMappings();
- return xmlEntityMappings;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlFetchAttribute createXmlFetchAttribute()
- {
- XmlFetchAttribute xmlFetchAttribute = new XmlFetchAttribute();
- return xmlFetchAttribute;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlFetchGroup createXmlFetchGroup()
- {
- XmlFetchGroup xmlFetchGroup = new XmlFetchGroup();
- return xmlFetchGroup;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlId createXmlId()
- {
- XmlId xmlId = new XmlId();
- return xmlId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlIndex createXmlIndex()
- {
- XmlIndex xmlIndex = new XmlIndex();
- return xmlIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlInstantiationCopyPolicy createXmlInstantiationCopyPolicy()
- {
- XmlInstantiationCopyPolicy xmlInstantiationCopyPolicy = new XmlInstantiationCopyPolicy();
- return xmlInstantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinTable createXmlJoinTable()
- {
- XmlJoinTable xmlJoinTable = new XmlJoinTable();
- return xmlJoinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToMany createXmlManyToMany()
- {
- XmlManyToMany xmlManyToMany = new XmlManyToMany();
- return xmlManyToMany;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToOne createXmlManyToOne()
- {
- XmlManyToOne xmlManyToOne = new XmlManyToOne();
- return xmlManyToOne;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappedSuperclass createXmlMappedSuperclass()
- {
- XmlMappedSuperclass xmlMappedSuperclass = new XmlMappedSuperclass();
- return xmlMappedSuperclass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMultitenant createXmlMultitenant()
- {
- XmlMultitenant xmlMultitenant = new XmlMultitenant();
- return xmlMultitenant;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedConverter createXmlNamedConverter()
- {
- XmlNamedConverter xmlNamedConverter = new XmlNamedConverter();
- return xmlNamedConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedPlsqlStoredFunctionQuery createXmlNamedPlsqlStoredFunctionQuery()
- {
- XmlNamedPlsqlStoredFunctionQuery xmlNamedPlsqlStoredFunctionQuery = new XmlNamedPlsqlStoredFunctionQuery();
- return xmlNamedPlsqlStoredFunctionQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedPlsqlStoredProcedureQuery createXmlNamedPlsqlStoredProcedureQuery()
- {
- XmlNamedPlsqlStoredProcedureQuery xmlNamedPlsqlStoredProcedureQuery = new XmlNamedPlsqlStoredProcedureQuery();
- return xmlNamedPlsqlStoredProcedureQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedStoredFunctionQuery createXmlNamedStoredFunctionQuery()
- {
- XmlNamedStoredFunctionQuery xmlNamedStoredFunctionQuery = new XmlNamedStoredFunctionQuery();
- return xmlNamedStoredFunctionQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedStoredProcedureQuery createXmlNamedStoredProcedureQuery()
- {
- XmlNamedStoredProcedureQuery xmlNamedStoredProcedureQuery = new XmlNamedStoredProcedureQuery();
- return xmlNamedStoredProcedureQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlObjectTypeConverter createXmlObjectTypeConverter()
- {
- XmlObjectTypeConverter xmlObjectTypeConverter = new XmlObjectTypeConverter();
- return xmlObjectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToMany createXmlOneToMany()
- {
- XmlOneToMany xmlOneToMany = new XmlOneToMany();
- return xmlOneToMany;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToOne createXmlOneToOne()
- {
- XmlOneToOne xmlOneToOne = new XmlOneToOne();
- return xmlOneToOne;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOptimisticLocking createXmlOptimisticLocking()
- {
- XmlOptimisticLocking xmlOptimisticLocking = new XmlOptimisticLocking();
- return xmlOptimisticLocking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOrderColumn createXmlOrderColumn()
- {
- XmlOrderColumn xmlOrderColumn = new XmlOrderColumn();
- return xmlOrderColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitDefaults createXmlPersistenceUnitDefaults()
- {
- XmlPersistenceUnitDefaults xmlPersistenceUnitDefaults = new XmlPersistenceUnitDefaults();
- return xmlPersistenceUnitDefaults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitMetadata createXmlPersistenceUnitMetadata()
- {
- XmlPersistenceUnitMetadata xmlPersistenceUnitMetadata = new XmlPersistenceUnitMetadata();
- return xmlPersistenceUnitMetadata;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPrimaryKey createXmlPrimaryKey()
- {
- XmlPrimaryKey xmlPrimaryKey = new XmlPrimaryKey();
- return xmlPrimaryKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlProperty createXmlProperty()
- {
- XmlProperty xmlProperty = new XmlProperty();
- return xmlProperty;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlQueryRedirectors createXmlQueryRedirectors()
- {
- XmlQueryRedirectors xmlQueryRedirectors = new XmlQueryRedirectors();
- return xmlQueryRedirectors;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlReturnInsert createXmlReturnInsert()
- {
- XmlReturnInsert xmlReturnInsert = new XmlReturnInsert();
- return xmlReturnInsert;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSecondaryTable createXmlSecondaryTable()
- {
- XmlSecondaryTable xmlSecondaryTable = new XmlSecondaryTable();
- return xmlSecondaryTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStoredProcedureParameter createXmlStoredProcedureParameter()
- {
- XmlStoredProcedureParameter xmlStoredProcedureParameter = new XmlStoredProcedureParameter();
- return xmlStoredProcedureParameter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStruct createXmlStruct()
- {
- XmlStruct xmlStruct = new XmlStruct();
- return xmlStruct;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStructConverter createXmlStructConverter()
- {
- XmlStructConverter xmlStructConverter = new XmlStructConverter();
- return xmlStructConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStructure createXmlStructure()
- {
- XmlStructure xmlStructure = new XmlStructure();
- return xmlStructure;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTable createXmlTable()
- {
- XmlTable xmlTable = new XmlTable();
- return xmlTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTableGenerator createXmlTableGenerator()
- {
- XmlTableGenerator xmlTableGenerator = new XmlTableGenerator();
- return xmlTableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTenantDiscriminatorColumn createXmlTenantDiscriminatorColumn()
- {
- XmlTenantDiscriminatorColumn xmlTenantDiscriminatorColumn = new XmlTenantDiscriminatorColumn();
- return xmlTenantDiscriminatorColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTimeOfDay createXmlTimeOfDay()
- {
- XmlTimeOfDay xmlTimeOfDay = new XmlTimeOfDay();
- return xmlTimeOfDay;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTransformation createXmlTransformation()
- {
- XmlTransformation xmlTransformation = new XmlTransformation();
- return xmlTransformation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTransient createXmlTransient()
- {
- XmlTransient xmlTransient = new XmlTransient();
- return xmlTransient;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTypeConverter createXmlTypeConverter()
- {
- XmlTypeConverter xmlTypeConverter = new XmlTypeConverter();
- return xmlTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVariableOneToOne createXmlVariableOneToOne()
- {
- XmlVariableOneToOne xmlVariableOneToOne = new XmlVariableOneToOne();
- return xmlVariableOneToOne;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVersion createXmlVersion()
- {
- XmlVersion xmlVersion = new XmlVersion();
- return xmlVersion;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlHashPartitioning createXmlHashPartitioning()
- {
- XmlHashPartitioning xmlHashPartitioning = new XmlHashPartitioning();
- return xmlHashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPartitioning createXmlPartitioning()
- {
- XmlPartitioning xmlPartitioning = new XmlPartitioning();
- return xmlPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPinnedPartitioning createXmlPinnedPartitioning()
- {
- XmlPinnedPartitioning xmlPinnedPartitioning = new XmlPinnedPartitioning();
- return xmlPinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPlsqlRecord createXmlPlsqlRecord()
- {
- XmlPlsqlRecord xmlPlsqlRecord = new XmlPlsqlRecord();
- return xmlPlsqlRecord;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPlsqlTable createXmlPlsqlTable()
- {
- XmlPlsqlTable xmlPlsqlTable = new XmlPlsqlTable();
- return xmlPlsqlTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlRangePartitioning createXmlRangePartitioning()
- {
- XmlRangePartitioning xmlRangePartitioning = new XmlRangePartitioning();
- return xmlRangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlReplicationPartitioning createXmlReplicationPartitioning()
- {
- XmlReplicationPartitioning xmlReplicationPartitioning = new XmlReplicationPartitioning();
- return xmlReplicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlRoundRobinPartitioning createXmlRoundRobinPartitioning()
- {
- XmlRoundRobinPartitioning xmlRoundRobinPartitioning = new XmlRoundRobinPartitioning();
- return xmlRoundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlUnionPartitioning createXmlUnionPartitioning()
- {
- XmlUnionPartitioning xmlUnionPartitioning = new XmlUnionPartitioning();
- return xmlUnionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlValuePartitioning createXmlValuePartitioning()
- {
- XmlValuePartitioning xmlValuePartitioning = new XmlValuePartitioning();
- return xmlValuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheCoordinationType createCacheCoordinationTypeFromString(EDataType eDataType, String initialValue)
- {
- CacheCoordinationType result = CacheCoordinationType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheCoordinationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheType createCacheTypeFromString(EDataType eDataType, String initialValue)
- {
- CacheType result = CacheType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlChangeTrackingType createXmlChangeTrackingTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlChangeTrackingType result = XmlChangeTrackingType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlChangeTrackingTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlDirection createXmlDirectionFromString(EDataType eDataType, String initialValue)
- {
- XmlDirection result = XmlDirection.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlDirectionToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ExistenceType createExistenceTypeFromString(EDataType eDataType, String initialValue)
- {
- ExistenceType result = ExistenceType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertExistenceTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinFetchType createXmlJoinFetchTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlJoinFetchType result = XmlJoinFetchType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlJoinFetchTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOptimisticLockingType createXmlOptimisticLockingTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlOptimisticLockingType result = XmlOptimisticLockingType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlOptimisticLockingTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmPackage getEclipseLinkOrmPackage()
- {
- return (EclipseLinkOrmPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmPackage getPackage()
- {
- return EclipseLinkOrmPackage.eINSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java
deleted file mode 100644
index 57b35bffee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java
+++ /dev/null
@@ -1,12962 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmPackage extends EPackageImpl
-{
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "orm";
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.xmi";
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm";
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmPackage eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage.init();
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods()
- * @generated
- */
- public static final int XML_ACCESS_METHODS = 0;
- /**
- * The feature id for the '<em><b>Get Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS__GET_METHOD = 0;
- /**
- * The feature id for the '<em><b>Set Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS__SET_METHOD = 1;
- /**
- * The number of structural features of the '<em>Xml Access Methods</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder()
- * @generated
- */
- public static final int XML_ACCESS_METHODS_HOLDER = 1;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS = 0;
- /**
- * The number of structural features of the '<em>Xml Access Methods Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria <em>Xml Additional Criteria</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria()
- * @generated
- */
- public static final int XML_ADDITIONAL_CRITERIA = 2;
- /**
- * The feature id for the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA__CRITERIA = EclipseLinkOrmV2_2Package.XML_ADDITIONAL_CRITERIA_22__CRITERIA;
- /**
- * The number of structural features of the '<em>Xml Additional Criteria</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_ADDITIONAL_CRITERIA_22_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray <em>Xml Array</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray()
- * @generated
- */
- public static final int XML_ARRAY = 3;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Array</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final int XML_ATTRIBUTE_MAPPING = 4;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__ACCESS = OrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__NAME = OrmPackage.XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__ACCESS_METHODS = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__PROPERTIES = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Attribute Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @generated
- */
- public static final int ATTRIBUTES = 5;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__DESCRIPTION = OrmPackage.ATTRIBUTES__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Element Collections</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ELEMENT_COLLECTIONS = OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS;
- /**
- * The feature id for the '<em><b>Ids</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__IDS = OrmPackage.ATTRIBUTES__IDS;
- /**
- * The feature id for the '<em><b>Embedded Ids</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__EMBEDDED_IDS = OrmPackage.ATTRIBUTES__EMBEDDED_IDS;
- /**
- * The feature id for the '<em><b>Basics</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__BASICS = OrmPackage.ATTRIBUTES__BASICS;
- /**
- * The feature id for the '<em><b>Versions</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__VERSIONS = OrmPackage.ATTRIBUTES__VERSIONS;
- /**
- * The feature id for the '<em><b>Many To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__MANY_TO_ONES = OrmPackage.ATTRIBUTES__MANY_TO_ONES;
- /**
- * The feature id for the '<em><b>One To Manys</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ONE_TO_MANYS = OrmPackage.ATTRIBUTES__ONE_TO_MANYS;
- /**
- * The feature id for the '<em><b>One To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ONE_TO_ONES = OrmPackage.ATTRIBUTES__ONE_TO_ONES;
- /**
- * The feature id for the '<em><b>Many To Manys</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__MANY_TO_MANYS = OrmPackage.ATTRIBUTES__MANY_TO_MANYS;
- /**
- * The feature id for the '<em><b>Embeddeds</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__EMBEDDEDS = OrmPackage.ATTRIBUTES__EMBEDDEDS;
- /**
- * The feature id for the '<em><b>Transients</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__TRANSIENTS = OrmPackage.ATTRIBUTES__TRANSIENTS;
- /**
- * The feature id for the '<em><b>Structures</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__STRUCTURES = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Arrays</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ARRAYS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Basic Collections</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__BASIC_COLLECTIONS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Basic Maps</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__BASIC_MAPS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Transformations</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__TRANSFORMATIONS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Variable One To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__VARIABLE_ONE_TO_ONES = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 5;
- /**
- * The number of structural features of the '<em>Attributes</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES_FEATURE_COUNT = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 6;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @generated
- */
- public static final int XML_BASIC = 6;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ACCESS = OrmPackage.XML_BASIC__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__NAME = OrmPackage.XML_BASIC__NAME;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__COLUMN = OrmPackage.XML_BASIC__COLUMN;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__LOB = OrmPackage.XML_BASIC__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__TEMPORAL = OrmPackage.XML_BASIC__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ENUMERATED = OrmPackage.XML_BASIC__ENUMERATED;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__FETCH = OrmPackage.XML_BASIC__FETCH;
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__OPTIONAL = OrmPackage.XML_BASIC__OPTIONAL;
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__SEQUENCE_GENERATOR = OrmPackage.XML_BASIC_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__TABLE_GENERATOR = OrmPackage.XML_BASIC_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__GENERATED_VALUE = OrmPackage.XML_BASIC_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__RETURN_INSERT = OrmPackage.XML_BASIC_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__RETURN_UPDATE = OrmPackage.XML_BASIC_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ATTRIBUTE_TYPE = OrmPackage.XML_BASIC_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__CACHE_INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ACCESS_METHODS = OrmPackage.XML_BASIC_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__PROPERTIES = OrmPackage.XML_BASIC_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__MUTABLE = OrmPackage.XML_BASIC_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__CONVERTER = OrmPackage.XML_BASIC_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__TYPE_CONVERTER = OrmPackage.XML_BASIC_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__OBJECT_TYPE_CONVERTER = OrmPackage.XML_BASIC_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__STRUCT_CONVERTER = OrmPackage.XML_BASIC_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__CONVERT = OrmPackage.XML_BASIC_FEATURE_COUNT + 15;
- /**
- * The number of structural features of the '<em>Xml Basic</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_FEATURE_COUNT = OrmPackage.XML_BASIC_FEATURE_COUNT + 16;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @generated
- */
- public static final int XML_BASIC_COLLECTION = 7;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Basic Collection</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @generated
- */
- public static final int XML_BASIC_MAP = 8;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Basic Map</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch()
- * @generated
- */
- public static final int XML_BATCH_FETCH = 9;
- /**
- * The feature id for the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH__SIZE = EclipseLinkOrmV2_1Package.XML_BATCH_FETCH_21__SIZE;
- /**
- * The feature id for the '<em><b>Batch Fetch Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH__BATCH_FETCH_TYPE = EclipseLinkOrmV2_1Package.XML_BATCH_FETCH_21__BATCH_FETCH_TYPE;
- /**
- * The number of structural features of the '<em>Xml Batch Fetch</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_BATCH_FETCH_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder()
- * @generated
- */
- public static final int XML_BATCH_FETCH_HOLDER = 10;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_HOLDER__BATCH_FETCH = 0;
- /**
- * The number of structural features of the '<em>Xml Batch Fetch Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @generated
- */
- public static final int XML_CACHE = 11;
- /**
- * The feature id for the '<em><b>Isolation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__ISOLATION = EclipseLinkOrmV2_2Package.XML_CACHE_22__ISOLATION;
- /**
- * The feature id for the '<em><b>Database Change Notification Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Expiry</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__EXPIRY = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__SIZE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Shared</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__SHARED = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__TYPE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Always Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__ALWAYS_REFRESH = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Refresh Only If Newer</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__REFRESH_ONLY_IF_NEWER = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Disable Hits</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__DISABLE_HITS = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Coordination Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__COORDINATION_TYPE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Expiry Time Of Day</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__EXPIRY_TIME_OF_DAY = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 9;
- /**
- * The number of structural features of the '<em>Xml Cache</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 10;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder()
- * @generated
- */
- public static final int XML_CACHE_HOLDER = 12;
- /**
- * The feature id for the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_HOLDER__CACHE = 0;
- /**
- * The feature id for the '<em><b>Existence Checking</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_HOLDER__EXISTENCE_CHECKING = 1;
- /**
- * The number of structural features of the '<em>Xml Cache Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_HOLDER_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex <em>Xml Cache Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex()
- * @generated
- */
- public static final int XML_CACHE_INDEX = 13;
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX__COLUMN_NAMES = EclipseLinkOrmV2_4Package.XML_CACHE_INDEX_24__COLUMN_NAMES;
- /**
- * The number of structural features of the '<em>Xml Cache Index</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX_FEATURE_COUNT = EclipseLinkOrmV2_4Package.XML_CACHE_INDEX_24_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING = 14;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING__TYPE = 0;
- /**
- * The number of structural features of the '<em>Xml Change Tracking</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING_HOLDER = 15;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING = 0;
- /**
- * The number of structural features of the '<em>Xml Change Tracking Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy()
- * @generated
- */
- public static final int XML_CLONE_COPY_POLICY = 16;
- /**
- * The feature id for the '<em><b>Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CLONE_COPY_POLICY__METHOD = 0;
- /**
- * The feature id for the '<em><b>Working Copy Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD = 1;
- /**
- * The number of structural features of the '<em>Xml Clone Copy Policy</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CLONE_COPY_POLICY_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable()
- * @generated
- */
- public static final int XML_COLLECTION_TABLE = 17;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__NAME = OrmPackage.XML_COLLECTION_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__CATALOG = OrmPackage.XML_COLLECTION_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__SCHEMA = OrmPackage.XML_COLLECTION_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_COLLECTION_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__JOIN_COLUMNS = OrmPackage.XML_COLLECTION_TABLE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__CREATION_SUFFIX = OrmPackage.XML_COLLECTION_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Collection Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE_FEATURE_COUNT = OrmPackage.XML_COLLECTION_TABLE_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue()
- * @generated
- */
- public static final int XML_CONVERSION_VALUE = 18;
- /**
- * The feature id for the '<em><b>Data Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERSION_VALUE__DATA_VALUE = 0;
- /**
- * The feature id for the '<em><b>Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERSION_VALUE__OBJECT_VALUE = 1;
- /**
- * The number of structural features of the '<em>Xml Conversion Value</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERSION_VALUE_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter()
- * @generated
- */
- public static final int XML_NAMED_CONVERTER = 46;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_CONVERTER__NAME = 0;
- /**
- * The number of structural features of the '<em>Xml Named Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_CONVERTER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter()
- * @generated
- */
- public static final int XML_CONVERTER = 19;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER__CLASS_NAME = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder <em>Xml Converter Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder()
- * @generated
- */
- public static final int XML_CONVERTER_HOLDER = 20;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_HOLDER__CONVERTER = 0;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_HOLDER__TYPE_CONVERTER = 1;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER = 2;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_HOLDER__STRUCT_CONVERTER = 3;
- /**
- * The number of structural features of the '<em>Xml Converter Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_HOLDER_FEATURE_COUNT = 4;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder <em>Xml Converters Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder()
- * @generated
- */
- public static final int XML_CONVERTERS_HOLDER = 21;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTERS_HOLDER__CONVERTERS = 0;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTERS_HOLDER__TYPE_CONVERTERS = 1;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS = 2;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS = 3;
- /**
- * The number of structural features of the '<em>Xml Converters Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTERS_HOLDER_FEATURE_COUNT = 4;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @generated
- */
- public static final int XML_CONVERTIBLE_MAPPING = 22;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__LOB = OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__TEMPORAL = OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__ENUMERATED = OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__CONVERTER = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__TYPE_CONVERTER = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__OBJECT_TYPE_CONVERTER = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__STRUCT_CONVERTER = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING__CONVERT = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 4;
- /**
- * The number of structural features of the '<em>Xml Convertible Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTIBLE_MAPPING_FEATURE_COUNT = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 5;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy()
- * @generated
- */
- public static final int XML_COPY_POLICY = 23;
- /**
- * The feature id for the '<em><b>Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COPY_POLICY__CLASS = 0;
- /**
- * The number of structural features of the '<em>Xml Copy Policy</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COPY_POLICY_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer()
- * @generated
- */
- public static final int XML_CUSTOMIZER = 24;
- /**
- * The feature id for the '<em><b>Customizer Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME = 0;
- /**
- * The number of structural features of the '<em>Xml Customizer</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder()
- * @generated
- */
- public static final int XML_CUSTOMIZER_HOLDER = 25;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER_HOLDER__CUSTOMIZER = 0;
- /**
- * The number of structural features of the '<em>Xml Customizer Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION = 26;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ACCESS = OrmPackage.XML_ELEMENT_COLLECTION__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__NAME = OrmPackage.XML_ELEMENT_COLLECTION__NAME;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__LOB = OrmPackage.XML_ELEMENT_COLLECTION__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__TEMPORAL = OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ENUMERATED = OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED;
- /**
- * The feature id for the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ORDER_COLUMN = OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN;
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ORDER_BY = OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL;
- /**
- * The feature id for the '<em><b>Map Key Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED;
- /**
- * The feature id for the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__TARGET_CLASS = OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__FETCH = OrmPackage.XML_ELEMENT_COLLECTION__FETCH;
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY;
- /**
- * The feature id for the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_CLASS = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS;
- /**
- * The feature id for the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN;
- /**
- * The feature id for the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__COLUMN = OrmPackage.XML_ELEMENT_COLLECTION__COLUMN;
- /**
- * The feature id for the '<em><b>Collection Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__COLLECTION_TABLE = OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ACCESS_METHODS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PROPERTIES = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__CONVERTER = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__TYPE_CONVERTER = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__STRUCT_CONVERTER = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__JOIN_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__BATCH_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PINNED_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__RANGE_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__VALUE_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__HASH_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__UNION_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 23;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PARTITIONED = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 24;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 25;
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__NONCACHEABLE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 26;
- /**
- * The feature id for the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 27;
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__DELETE_ALL = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 28;
- /**
- * The number of structural features of the '<em>Xml Element Collection</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_FEATURE_COUNT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 29;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final int XML_EMBEDDABLE = 27;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ACCESS = OrmPackage.XML_EMBEDDABLE__ACCESS;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CLASS_NAME = OrmPackage.XML_EMBEDDABLE__CLASS_NAME;
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__METADATA_COMPLETE = OrmPackage.XML_EMBEDDABLE__METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__DESCRIPTION = OrmPackage.XML_EMBEDDABLE__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ATTRIBUTES = OrmPackage.XML_EMBEDDABLE__ATTRIBUTES;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ACCESS_METHODS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ASSOCIATION_OVERRIDES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PARENT_CLASS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PLSQL_RECORDS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PLSQL_TABLES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__STRUCT = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CUSTOMIZER = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CHANGE_TRACKING = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__TYPE_CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__STRUCT_CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PROPERTIES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__COPY_POLICY = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CLONE_COPY_POLICY = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 17;
- /**
- * The number of structural features of the '<em>Xml Embeddable</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_FEATURE_COUNT = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 18;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final int XML_EMBEDDED = 28;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ACCESS = OrmPackage.XML_EMBEDDED__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__NAME = OrmPackage.XML_EMBEDDED__NAME;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ATTRIBUTE_OVERRIDES = OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ASSOCIATION_OVERRIDES = OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__PROPERTIES = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Embedded</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_FEATURE_COUNT = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 3;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final int XML_EMBEDDED_ID = 29;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ACCESS = OrmPackage.XML_EMBEDDED_ID__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__NAME = OrmPackage.XML_EMBEDDED_ID__NAME;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES = OrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__PROPERTIES = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Embedded Id</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_FEATURE_COUNT = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 3;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @generated
- */
- public static final int XML_ENTITY = 30;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ACCESS = OrmPackage.XML_ENTITY__ACCESS;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CLASS_NAME = OrmPackage.XML_ENTITY__CLASS_NAME;
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__METADATA_COMPLETE = OrmPackage.XML_ENTITY__METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DESCRIPTION = OrmPackage.XML_ENTITY__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ATTRIBUTES = OrmPackage.XML_ENTITY__ATTRIBUTES;
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_QUERIES = OrmPackage.XML_ENTITY__NAMED_QUERIES;
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_NATIVE_QUERIES = OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES;
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SEQUENCE_GENERATOR = OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR;
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TABLE_GENERATOR = OrmPackage.XML_ENTITY__TABLE_GENERATOR;
- /**
- * The feature id for the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_PERSIST = OrmPackage.XML_ENTITY__PRE_PERSIST;
- /**
- * The feature id for the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_PERSIST = OrmPackage.XML_ENTITY__POST_PERSIST;
- /**
- * The feature id for the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_REMOVE = OrmPackage.XML_ENTITY__PRE_REMOVE;
- /**
- * The feature id for the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_REMOVE = OrmPackage.XML_ENTITY__POST_REMOVE;
- /**
- * The feature id for the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_UPDATE = OrmPackage.XML_ENTITY__PRE_UPDATE;
- /**
- * The feature id for the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_UPDATE = OrmPackage.XML_ENTITY__POST_UPDATE;
- /**
- * The feature id for the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_LOAD = OrmPackage.XML_ENTITY__POST_LOAD;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ASSOCIATION_OVERRIDES = OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES;
- /**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHEABLE = OrmPackage.XML_ENTITY__CACHEABLE;
- /**
- * The feature id for the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ID_CLASS = OrmPackage.XML_ENTITY__ID_CLASS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAME = OrmPackage.XML_ENTITY__NAME;
- /**
- * The feature id for the '<em><b>Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TABLE = OrmPackage.XML_ENTITY__TABLE;
- /**
- * The feature id for the '<em><b>Secondary Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SECONDARY_TABLES = OrmPackage.XML_ENTITY__SECONDARY_TABLES;
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Inheritance</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__INHERITANCE = OrmPackage.XML_ENTITY__INHERITANCE;
- /**
- * The feature id for the '<em><b>Discriminator Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DISCRIMINATOR_VALUE = OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE;
- /**
- * The feature id for the '<em><b>Discriminator Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DISCRIMINATOR_COLUMN = OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN;
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS;
- /**
- * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS;
- /**
- * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS;
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ENTITY_LISTENERS = OrmPackage.XML_ENTITY__ENTITY_LISTENERS;
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRIMARY_KEY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHE_INTERCEPTOR = OrmPackage.XML_ENTITY_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__QUERY_REDIRECTORS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ACCESS_METHODS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__FETCH_GROUPS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CLASS_EXTRACTOR = OrmPackage.XML_ENTITY_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PARENT_CLASS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__REPLICATION_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PINNED_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__RANGE_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__VALUE_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__HASH_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__UNION_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PARTITIONED = OrmPackage.XML_ENTITY_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ADDITIONAL_CRITERIA = OrmPackage.XML_ENTITY_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CASCADE_ON_DELETE = OrmPackage.XML_ENTITY_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__INDEX = OrmPackage.XML_ENTITY_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__MULTITENANT = OrmPackage.XML_ENTITY_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PLSQL_RECORDS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 23;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PLSQL_TABLES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 24;
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__STRUCT = OrmPackage.XML_ENTITY_FEATURE_COUNT + 25;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHE_INDEX = OrmPackage.XML_ENTITY_FEATURE_COUNT + 26;
- /**
- * The feature id for the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__READ_ONLY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 27;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CUSTOMIZER = OrmPackage.XML_ENTITY_FEATURE_COUNT + 28;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CHANGE_TRACKING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 29;
- /**
- * The feature id for the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHE = OrmPackage.XML_ENTITY_FEATURE_COUNT + 30;
- /**
- * The feature id for the '<em><b>Existence Checking</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXISTENCE_CHECKING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 31;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 32;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TYPE_CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 33;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 34;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__STRUCT_CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 35;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 36;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PROPERTIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 37;
- /**
- * The feature id for the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__OPTIMISTIC_LOCKING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 38;
- /**
- * The feature id for the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__COPY_POLICY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 39;
- /**
- * The feature id for the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__INSTANTIATION_COPY_POLICY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 40;
- /**
- * The feature id for the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CLONE_COPY_POLICY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 41;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 42;
- /**
- * The number of structural features of the '<em>Xml Entity</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_FEATURE_COUNT = OrmPackage.XML_ENTITY_FEATURE_COUNT + 43;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS = 31;
- /**
- * The feature id for the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__VERSION = OrmPackage.XML_ENTITY_MAPPINGS__VERSION;
- /**
- * The feature id for the '<em><b>Schema Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SCHEMA_LOCATION = OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA_LOCATION;
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES;
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ACCESS = OrmPackage.XML_ENTITY_MAPPINGS__ACCESS;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__DESCRIPTION = OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Persistence Unit Metadata</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA;
- /**
- * The feature id for the '<em><b>Package</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PACKAGE = OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SCHEMA = OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__CATALOG = OrmPackage.XML_ENTITY_MAPPINGS__CATALOG;
- /**
- * The feature id for the '<em><b>Sequence Generators</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS = OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS;
- /**
- * The feature id for the '<em><b>Table Generators</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__TABLE_GENERATORS = OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS;
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS;
- /**
- * The feature id for the '<em><b>Mapped Superclasses</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES = OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES;
- /**
- * The feature id for the '<em><b>Entities</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ENTITIES = OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES;
- /**
- * The feature id for the '<em><b>Embeddables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__EMBEDDABLES = OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ACCESS_METHODS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PINNED_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__RANGE_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__VALUE_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__HASH_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__UNION_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PLSQL_RECORDS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PLSQL_TABLES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__TYPE_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 19;
- /**
- * The number of structural features of the '<em>Xml Entity Mappings</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_FEATURE_COUNT = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 20;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute()
- * @generated
- */
- public static final int XML_FETCH_ATTRIBUTE = 32;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_ATTRIBUTE__NAME = EclipseLinkOrmV2_1Package.XML_FETCH_ATTRIBUTE_21__NAME;
- /**
- * The number of structural features of the '<em>Xml Fetch Attribute</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_ATTRIBUTE_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_FETCH_ATTRIBUTE_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup()
- * @generated
- */
- public static final int XML_FETCH_GROUP = 33;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP__NAME = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21__NAME;
- /**
- * The feature id for the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP__LOAD = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21__LOAD;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP__ATTRIBUTES = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21__ATTRIBUTES;
- /**
- * The number of structural features of the '<em>Xml Fetch Group</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @generated
- */
- public static final int XML_ID = 35;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex <em>Xml Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex()
- * @generated
- */
- public static final int XML_INDEX = 36;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlInstantiationCopyPolicy()
- * @generated
- */
- public static final int XML_INSTANTIATION_COPY_POLICY = 37;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch()
- * @generated
- */
- public static final int XML_JOIN_FETCH = 38;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final int XML_JOIN_TABLE = 39;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final int XML_MANY_TO_MANY = 40;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final int XML_MANY_TO_ONE = 41;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS = 42;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable()
- * @generated
- */
- public static final int XML_MUTABLE = 45;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY = 50;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter()
- * @generated
- */
- public static final int XML_OBJECT_TYPE_CONVERTER = 51;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final int XML_ONE_TO_MANY = 52;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final int XML_ONE_TO_ONE = 53;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking()
- * @generated
- */
- public static final int XML_OPTIMISTIC_LOCKING = 54;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @generated
- */
- public static final int XML_ORDER_COLUMN = 55;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 57;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA = 58;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey()
- * @generated
- */
- public static final int XML_PRIMARY_KEY = 62;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned()
- * @generated
- */
- public static final int XML_PRIVATE_OWNED = 63;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty()
- * @generated
- */
- public static final int XML_PROPERTY = 64;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer()
- * @generated
- */
- public static final int XML_PROPERTY_CONTAINER = 65;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer()
- * @generated
- */
- public static final int XML_QUERY_CONTAINER = 66;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors()
- * @generated
- */
- public static final int XML_QUERY_REDIRECTORS = 67;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly()
- * @generated
- */
- public static final int XML_READ_ONLY = 69;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert()
- * @generated
- */
- public static final int XML_RETURN_INSERT = 71;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE = 73;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter()
- * @generated
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER = 74;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter()
- * @generated
- */
- public static final int XML_STRUCT_CONVERTER = 76;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable()
- * @generated
- */
- public static final int XML_TABLE = 78;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR = 79;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay()
- * @generated
- */
- public static final int XML_TIME_OF_DAY = 81;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @generated
- */
- public static final int XML_TRANSFORMATION = 82;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @generated
- */
- public static final int XML_TRANSIENT = 83;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter()
- * @generated
- */
- public static final int XML_TYPE_CONVERTER = 84;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @generated
- */
- public static final int XML_VARIABLE_ONE_TO_ONE = 87;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 88;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning <em>Xml Hash Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning()
- * @generated
- */
- public static final int XML_HASH_PARTITIONING = 34;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_HASH_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Hash Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_HASH_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ACCESS = OrmPackage.XML_ID__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__NAME = OrmPackage.XML_ID__NAME;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__COLUMN = OrmPackage.XML_ID__COLUMN;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__LOB = OrmPackage.XML_ID__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TEMPORAL = OrmPackage.XML_ID__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ENUMERATED = OrmPackage.XML_ID__ENUMERATED;
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__SEQUENCE_GENERATOR = OrmPackage.XML_ID__SEQUENCE_GENERATOR;
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TABLE_GENERATOR = OrmPackage.XML_ID__TABLE_GENERATOR;
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__GENERATED_VALUE = OrmPackage.XML_ID__GENERATED_VALUE;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ATTRIBUTE_TYPE = OrmPackage.XML_ID_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__CACHE_INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ACCESS_METHODS = OrmPackage.XML_ID_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__PROPERTIES = OrmPackage.XML_ID_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__MUTABLE = OrmPackage.XML_ID_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__CONVERTER = OrmPackage.XML_ID_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TYPE_CONVERTER = OrmPackage.XML_ID_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__OBJECT_TYPE_CONVERTER = OrmPackage.XML_ID_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__STRUCT_CONVERTER = OrmPackage.XML_ID_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__CONVERT = OrmPackage.XML_ID_FEATURE_COUNT + 10;
- /**
- * The number of structural features of the '<em>Xml Id</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_FEATURE_COUNT = OrmPackage.XML_ID_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__NAME = EclipseLinkOrmV2_2Package.XML_INDEX_22__NAME;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__SCHEMA = EclipseLinkOrmV2_2Package.XML_INDEX_22__SCHEMA;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__CATALOG = EclipseLinkOrmV2_2Package.XML_INDEX_22__CATALOG;
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__TABLE = EclipseLinkOrmV2_2Package.XML_INDEX_22__TABLE;
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__UNIQUE = EclipseLinkOrmV2_2Package.XML_INDEX_22__UNIQUE;
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__COLUMN_NAMES = EclipseLinkOrmV2_2Package.XML_INDEX_22__COLUMN_NAMES;
- /**
- * The number of structural features of the '<em>Xml Index</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_INDEX_22_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Instantiation Copy Policy</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INSTANTIATION_COPY_POLICY_FEATURE_COUNT = 0;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_FETCH__JOIN_FETCH = 0;
- /**
- * The number of structural features of the '<em>Xml Join Fetch</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_FETCH_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__NAME = OrmPackage.XML_JOIN_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__CATALOG = OrmPackage.XML_JOIN_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__SCHEMA = OrmPackage.XML_JOIN_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_JOIN_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__JOIN_COLUMNS = OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Inverse Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS = OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__CREATION_SUFFIX = OrmPackage.XML_JOIN_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Join Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_FEATURE_COUNT = OrmPackage.XML_JOIN_TABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ACCESS = OrmPackage.XML_MANY_TO_MANY__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__NAME = OrmPackage.XML_MANY_TO_MANY__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__TARGET_ENTITY = OrmPackage.XML_MANY_TO_MANY__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__FETCH = OrmPackage.XML_MANY_TO_MANY__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__CASCADE = OrmPackage.XML_MANY_TO_MANY__CASCADE;
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAPPED_BY = OrmPackage.XML_MANY_TO_MANY__MAPPED_BY;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__JOIN_TABLE = OrmPackage.XML_MANY_TO_MANY__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ORDER_COLUMN = OrmPackage.XML_MANY_TO_MANY__ORDER_COLUMN;
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ORDER_BY = OrmPackage.XML_MANY_TO_MANY__ORDER_BY;
- /**
- * The feature id for the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_TEMPORAL = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_TEMPORAL;
- /**
- * The feature id for the '<em><b>Map Key Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_ENUMERATED = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_ENUMERATED;
- /**
- * The feature id for the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_CLASS = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_CLASS;
- /**
- * The feature id for the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_COLUMN = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_COLUMN;
- /**
- * The feature id for the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_JOIN_COLUMNS = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY = OrmPackage.XML_MANY_TO_MANY__MAP_KEY;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__CONVERTER = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__TYPE_CONVERTER = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__STRUCT_CONVERTER = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_CONVERT = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__BATCH_FETCH = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PARTITIONED = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__NON_CACHEABLE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ACCESS_METHODS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PROPERTIES = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__JOIN_FETCH = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 21;
- /**
- * The number of structural features of the '<em>Xml Many To Many</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_FEATURE_COUNT = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ACCESS = OrmPackage.XML_MANY_TO_ONE__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__NAME = OrmPackage.XML_MANY_TO_ONE__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__TARGET_ENTITY = OrmPackage.XML_MANY_TO_ONE__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__FETCH = OrmPackage.XML_MANY_TO_ONE__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__CASCADE = OrmPackage.XML_MANY_TO_ONE__CASCADE;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__JOIN_TABLE = OrmPackage.XML_MANY_TO_ONE__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__JOIN_COLUMNS = OrmPackage.XML_MANY_TO_ONE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ID = OrmPackage.XML_MANY_TO_ONE__ID;
- /**
- * The feature id for the '<em><b>Maps Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__MAPS_ID = OrmPackage.XML_MANY_TO_ONE__MAPS_ID;
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__OPTIONAL = OrmPackage.XML_MANY_TO_ONE__OPTIONAL;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__BATCH_FETCH = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PINNED_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__RANGE_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__VALUE_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__HASH_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__UNION_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PARTITIONED = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__NON_CACHEABLE = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ACCESS_METHODS = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PROPERTIES = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__JOIN_FETCH = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 13;
- /**
- * The number of structural features of the '<em>Xml Many To One</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_FEATURE_COUNT = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ACCESS = OrmPackage.XML_MAPPED_SUPERCLASS__ACCESS;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CLASS_NAME = OrmPackage.XML_MAPPED_SUPERCLASS__CLASS_NAME;
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__METADATA_COMPLETE = OrmPackage.XML_MAPPED_SUPERCLASS__METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__DESCRIPTION = OrmPackage.XML_MAPPED_SUPERCLASS__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ATTRIBUTES = OrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTES;
- /**
- * The feature id for the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ID_CLASS = OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS;
- /**
- * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS = OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS;
- /**
- * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS = OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS;
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS = OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS;
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PRIMARY_KEY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHEABLE = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__FETCH_GROUPS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__TABLE_GENERATOR = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ACCESS_METHODS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PARENT_CLASS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__HASH_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__UNION_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PARTITIONED = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 23;
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 24;
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__MULTITENANT = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 25;
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 26;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 27;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 28;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PLSQL_RECORDS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 29;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PLSQL_TABLES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 30;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHE_INDEX = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 31;
- /**
- * The feature id for the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__READ_ONLY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 32;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CUSTOMIZER = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 33;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CHANGE_TRACKING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 34;
- /**
- * The feature id for the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHE = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 35;
- /**
- * The feature id for the '<em><b>Existence Checking</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 36;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 37;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 38;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 39;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 40;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PROPERTIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 41;
- /**
- * The feature id for the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 42;
- /**
- * The feature id for the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__COPY_POLICY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 43;
- /**
- * The feature id for the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 44;
- /**
- * The feature id for the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 45;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 46;
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_FEATURE_COUNT = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 47;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant <em>Xml Multitenant</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant()
- * @generated
- */
- public static final int XML_MULTITENANT = 43;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT__TYPE = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23__TYPE;
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS;
- /**
- * The feature id for the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT__INCLUDE_CRITERIA = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Multitenant</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder <em>Xml Multitenant Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder()
- * @generated
- */
- public static final int XML_MULTITENANT_HOLDER = 44;
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_HOLDER__MULTITENANT = 0;
- /**
- * The number of structural features of the '<em>Xml Multitenant Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_HOLDER_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MUTABLE__MUTABLE = 0;
- /**
- * The number of structural features of the '<em>Xml Mutable</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MUTABLE_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery <em>Xml Named Plsql Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY = 47;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Function Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery <em>Xml Named Plsql Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY = 48;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Procedure Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery <em>Xml Named Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery()
- * @generated
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY = 49;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY__NAME = EclipseLinkOrmV2_3Package.XML_NAMED_STORED_FUNCTION_QUERY_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Named Stored Function Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_NAMED_STORED_FUNCTION_QUERY_23_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__NAME = 0;
- /**
- * The feature id for the '<em><b>Result Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS = 1;
- /**
- * The feature id for the '<em><b>Result Set Mapping</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING = 2;
- /**
- * The feature id for the '<em><b>Procedure Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME = 3;
- /**
- * The feature id for the '<em><b>Returns Result Set</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET = 4;
- /**
- * The feature id for the '<em><b>Hints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__HINTS = 5;
- /**
- * The feature id for the '<em><b>Parameters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS = 6;
- /**
- * The number of structural features of the '<em>Xml Named Stored Procedure Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY_FEATURE_COUNT = 7;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__DATA_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Conversion Values</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES = XML_NAMED_CONVERTER_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Default Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = XML_NAMED_CONVERTER_FEATURE_COUNT + 3;
- /**
- * The number of structural features of the '<em>Xml Object Type Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ACCESS = OrmPackage.XML_ONE_TO_MANY__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__NAME = OrmPackage.XML_ONE_TO_MANY__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__TARGET_ENTITY = OrmPackage.XML_ONE_TO_MANY__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__FETCH = OrmPackage.XML_ONE_TO_MANY__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__CASCADE = OrmPackage.XML_ONE_TO_MANY__CASCADE;
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAPPED_BY = OrmPackage.XML_ONE_TO_MANY__MAPPED_BY;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_TABLE = OrmPackage.XML_ONE_TO_MANY__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ORDER_COLUMN = OrmPackage.XML_ONE_TO_MANY__ORDER_COLUMN;
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ORDER_BY = OrmPackage.XML_ONE_TO_MANY__ORDER_BY;
- /**
- * The feature id for the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_TEMPORAL = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_TEMPORAL;
- /**
- * The feature id for the '<em><b>Map Key Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_ENUMERATED = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_ENUMERATED;
- /**
- * The feature id for the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_CLASS = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_CLASS;
- /**
- * The feature id for the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_COLUMN = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_COLUMN;
- /**
- * The feature id for the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_JOIN_COLUMNS = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY = OrmPackage.XML_ONE_TO_MANY__MAP_KEY;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_COLUMNS = OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Orphan Removal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ORPHAN_REMOVAL = OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__CONVERTER = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__TYPE_CONVERTER = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__STRUCT_CONVERTER = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_CONVERT = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__BATCH_FETCH = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PARTITIONED = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__NONCACHEABLE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__DELETE_ALL = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ACCESS_METHODS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PROPERTIES = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PRIVATE_OWNED = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_FETCH = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 23;
- /**
- * The number of structural features of the '<em>Xml One To Many</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_FEATURE_COUNT = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 24;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ACCESS = OrmPackage.XML_ONE_TO_ONE__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__NAME = OrmPackage.XML_ONE_TO_ONE__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__TARGET_ENTITY = OrmPackage.XML_ONE_TO_ONE__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__FETCH = OrmPackage.XML_ONE_TO_ONE__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__CASCADE = OrmPackage.XML_ONE_TO_ONE__CASCADE;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_TABLE = OrmPackage.XML_ONE_TO_ONE__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_COLUMNS = OrmPackage.XML_ONE_TO_ONE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ID = OrmPackage.XML_ONE_TO_ONE__ID;
- /**
- * The feature id for the '<em><b>Maps Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__MAPS_ID = OrmPackage.XML_ONE_TO_ONE__MAPS_ID;
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__OPTIONAL = OrmPackage.XML_ONE_TO_ONE__OPTIONAL;
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__MAPPED_BY = OrmPackage.XML_ONE_TO_ONE__MAPPED_BY;
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Orphan Removal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ORPHAN_REMOVAL = OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__BATCH_FETCH = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PINNED_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__RANGE_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__VALUE_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__HASH_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__UNION_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PARTITIONED = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__CASCADE_ON_DELETE = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__NON_CACHEABLE = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ACCESS_METHODS = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PROPERTIES = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PRIVATE_OWNED = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_FETCH = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 15;
- /**
- * The number of structural features of the '<em>Xml One To One</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_FEATURE_COUNT = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING__TYPE = 0;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING__CASCADE = 1;
- /**
- * The feature id for the '<em><b>Selected Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS = 2;
- /**
- * The number of structural features of the '<em>Xml Optimistic Locking</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING_FEATURE_COUNT = 3;
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__COLUMN_DEFINITION = OrmPackage.XML_ORDER_COLUMN__COLUMN_DEFINITION;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__NAME = OrmPackage.XML_ORDER_COLUMN__NAME;
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__NULLABLE = OrmPackage.XML_ORDER_COLUMN__NULLABLE;
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__INSERTABLE = OrmPackage.XML_ORDER_COLUMN__INSERTABLE;
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__UPDATABLE = OrmPackage.XML_ORDER_COLUMN__UPDATABLE;
- /**
- * The feature id for the '<em><b>Correction Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__CORRECTION_TYPE = OrmPackage.XML_ORDER_COLUMN_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Order Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN_FEATURE_COUNT = OrmPackage.XML_ORDER_COLUMN_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning <em>Xml Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning()
- * @generated
- */
- public static final int XML_PARTITIONING = 56;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Delimited Identifiers</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG;
- /**
- * The feature id for the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST;
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION = OrmPackage.XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE = OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Persistence Unit Defaults</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS = OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_PERSISTENCE_UNIT_METADATA_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Metadata</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA_FEATURE_COUNT = OrmPackage.XML_PERSISTENCE_UNIT_METADATA_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning <em>Xml Pinned Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning()
- * @generated
- */
- public static final int XML_PINNED_PARTITIONING = 59;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_PINNED_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Pinned Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_PINNED_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord <em>Xml Plsql Record</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord()
- * @generated
- */
- public static final int XML_PLSQL_RECORD = 60;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD__NAME = EclipseLinkOrmV2_3Package.XML_PLSQL_RECORD_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Plsql Record</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_PLSQL_RECORD_23_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable <em>Xml Plsql Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable()
- * @generated
- */
- public static final int XML_PLSQL_TABLE = 61;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE__NAME = EclipseLinkOrmV2_3Package.XML_PLSQL_TABLE_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Plsql Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_PLSQL_TABLE_23_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Validation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY__VALIDATION = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11__VALIDATION;
- /**
- * The feature id for the '<em><b>Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY__COLUMNS = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11__COLUMNS;
- /**
- * The feature id for the '<em><b>Cache Key Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY__CACHE_KEY_TYPE = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Primary Key</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_FEATURE_COUNT = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIVATE_OWNED__PRIVATE_OWNED = 0;
- /**
- * The number of structural features of the '<em>Xml Private Owned</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIVATE_OWNED_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__NAME = 0;
- /**
- * The feature id for the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__VALUE = 1;
- /**
- * The feature id for the '<em><b>Value Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__VALUE_TYPE = 2;
- /**
- * The number of structural features of the '<em>Xml Property</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY_FEATURE_COUNT = 3;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY_CONTAINER__PROPERTIES = 0;
- /**
- * The number of structural features of the '<em>Xml Property Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY_CONTAINER_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES = 0;
- /**
- * The number of structural features of the '<em>Xml Query Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_CONTAINER_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__ALL_QUERIES = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__ALL_QUERIES;
- /**
- * The feature id for the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__READ_ALL = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__READ_ALL;
- /**
- * The feature id for the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__READ_OBJECT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__READ_OBJECT;
- /**
- * The feature id for the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__REPORT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__REPORT;
- /**
- * The feature id for the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__UPDATE = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__UPDATE;
- /**
- * The feature id for the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__INSERT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__INSERT;
- /**
- * The feature id for the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__DELETE = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__DELETE;
- /**
- * The number of structural features of the '<em>Xml Query Redirectors</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_FEATURE_COUNT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning <em>Xml Range Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning()
- * @generated
- */
- public static final int XML_RANGE_PARTITIONING = 68;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RANGE_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_RANGE_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Range Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RANGE_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_RANGE_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_READ_ONLY__READ_ONLY = 0;
- /**
- * The number of structural features of the '<em>Xml Read Only</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_READ_ONLY_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning <em>Xml Replication Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning()
- * @generated
- */
- public static final int XML_REPLICATION_PARTITIONING = 70;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REPLICATION_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_REPLICATION_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Replication Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REPLICATION_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_REPLICATION_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT__RETURN_ONLY = EclipseLinkOrmV2_1Package.XML_RETURN_INSERT_21__RETURN_ONLY;
- /**
- * The number of structural features of the '<em>Xml Return Insert</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_RETURN_INSERT_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning <em>Xml Round Robin Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning()
- * @generated
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING = 72;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_ROUND_ROBIN_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Round Robin Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_ROUND_ROBIN_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__NAME = OrmPackage.XML_SECONDARY_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__CATALOG = OrmPackage.XML_SECONDARY_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__SCHEMA = OrmPackage.XML_SECONDARY_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__CREATION_SUFFIX = OrmPackage.XML_SECONDARY_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Secondary Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_FEATURE_COUNT = OrmPackage.XML_SECONDARY_TABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Direction</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__DIRECTION = 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__NAME = 1;
- /**
- * The feature id for the '<em><b>Query Parameter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER = 2;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__TYPE = 3;
- /**
- * The feature id for the '<em><b>Jdbc Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE = 4;
- /**
- * The feature id for the '<em><b>Jdbc Type Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME = 5;
- /**
- * The number of structural features of the '<em>Xml Stored Procedure Parameter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER_FEATURE_COUNT = 6;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct <em>Xml Struct</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct()
- * @generated
- */
- public static final int XML_STRUCT = 75;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT__NAME = EclipseLinkOrmV2_3Package.XML_STRUCT_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Struct</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_STRUCT_23_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Converter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER__CONVERTER = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Struct Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure <em>Xml Structure</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructure()
- * @generated
- */
- public static final int XML_STRUCTURE = 77;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Structure</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__NAME = OrmPackage.XML_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__CATALOG = OrmPackage.XML_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__SCHEMA = OrmPackage.XML_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__CREATION_SUFFIX = OrmPackage.XML_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_FEATURE_COUNT = OrmPackage.XML_TABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__DESCRIPTION = OrmPackage.XML_TABLE_GENERATOR__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__NAME = OrmPackage.XML_TABLE_GENERATOR__NAME;
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__INITIAL_VALUE = OrmPackage.XML_TABLE_GENERATOR__INITIAL_VALUE;
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__ALLOCATION_SIZE = OrmPackage.XML_TABLE_GENERATOR__ALLOCATION_SIZE;
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__TABLE = OrmPackage.XML_TABLE_GENERATOR__TABLE;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__CATALOG = OrmPackage.XML_TABLE_GENERATOR__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__SCHEMA = OrmPackage.XML_TABLE_GENERATOR__SCHEMA;
- /**
- * The feature id for the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__PK_COLUMN_NAME = OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME;
- /**
- * The feature id for the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__VALUE_COLUMN_NAME = OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME;
- /**
- * The feature id for the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__PK_COLUMN_VALUE = OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__CREATION_SUFFIX = OrmPackage.XML_TABLE_GENERATOR_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Table Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_FEATURE_COUNT = OrmPackage.XML_TABLE_GENERATOR_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn <em>Xml Tenant Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn()
- * @generated
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN = 80;
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__NAME = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__NAME;
- /**
- * The feature id for the '<em><b>Discriminator Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__LENGTH = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__LENGTH;
- /**
- * The feature id for the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__TABLE = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Tenant Discriminator Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Hour</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__HOUR = 0;
- /**
- * The feature id for the '<em><b>Minute</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__MINUTE = 1;
- /**
- * The feature id for the '<em><b>Second</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__SECOND = 2;
- /**
- * The feature id for the '<em><b>Millisecond</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__MILLISECOND = 3;
- /**
- * The number of structural features of the '<em>Xml Time Of Day</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY_FEATURE_COUNT = 4;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Transformation</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__ACCESS = OrmPackage.XML_TRANSIENT__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__NAME = OrmPackage.XML_TRANSIENT__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__ACCESS_METHODS = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__PROPERTIES = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Transient</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT_FEATURE_COUNT = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER__DATA_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER__OBJECT_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Type Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning <em>Xml Union Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning()
- * @generated
- */
- public static final int XML_UNION_PARTITIONING = 85;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_UNION_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Union Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_UNION_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning <em>Xml Value Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning()
- * @generated
- */
- public static final int XML_VALUE_PARTITIONING = 86;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_VALUE_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Value Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_VALUE_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONED = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11;
- /**
- * The number of structural features of the '<em>Xml Variable One To One</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ACCESS = OrmPackage.XML_VERSION__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__NAME = OrmPackage.XML_VERSION__NAME;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__COLUMN = OrmPackage.XML_VERSION__COLUMN;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__LOB = OrmPackage.XML_VERSION__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__TEMPORAL = OrmPackage.XML_VERSION__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ENUMERATED = OrmPackage.XML_VERSION__ENUMERATED;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ATTRIBUTE_TYPE = OrmPackage.XML_VERSION_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__INDEX = OrmPackage.XML_VERSION_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ACCESS_METHODS = OrmPackage.XML_VERSION_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__PROPERTIES = OrmPackage.XML_VERSION_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__MUTABLE = OrmPackage.XML_VERSION_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__CONVERTER = OrmPackage.XML_VERSION_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__TYPE_CONVERTER = OrmPackage.XML_VERSION_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__OBJECT_TYPE_CONVERTER = OrmPackage.XML_VERSION_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__STRUCT_CONVERTER = OrmPackage.XML_VERSION_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__CONVERT = OrmPackage.XML_VERSION_FEATURE_COUNT + 9;
- /**
- * The number of structural features of the '<em>Xml Version</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_FEATURE_COUNT = OrmPackage.XML_VERSION_FEATURE_COUNT + 10;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType()
- * @generated
- */
- public static final int CACHE_COORDINATION_TYPE = 89;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType()
- * @generated
- */
- public static final int CACHE_TYPE = 90;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING_TYPE = 91;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlDirection()
- * @generated
- */
- public static final int XML_DIRECTION = 92;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType()
- * @generated
- */
- public static final int EXISTENCE_TYPE = 93;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType()
- * @generated
- */
- public static final int XML_JOIN_FETCH_TYPE = 94;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLockingType()
- * @generated
- */
- public static final int XML_OPTIMISTIC_LOCKING_TYPE = 95;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAccessMethodsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAccessMethodsHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAdditionalCriteriaEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlArrayEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeMappingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass attributesEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicCollectionEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicMapEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBatchFetchEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBatchFetchHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheIndexEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlChangeTrackingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlChangeTrackingHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCloneCopyPolicyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConversionValueEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConverterHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConvertersHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConvertibleMappingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCopyPolicyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCustomizerEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCustomizerHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollectionEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedIdEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappingsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchAttributeEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchGroupEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIndexEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlInstantiationCopyPolicyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinFetchEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclassEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenantEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenantHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMutableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredFunctionQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredProcedureQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedStoredFunctionQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedStoredProcedureQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlObjectTypeConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOptimisticLockingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOrderColumnEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaultsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitMetadataEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKeyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrivateOwnedEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertyContainerEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryContainerEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryRedirectorsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReadOnlyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReturnInsertEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStoredProcedureParameterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructureEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGeneratorEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTenantDiscriminatorColumnEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTimeOfDayEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransformationEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransientEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTypeConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVariableOneToOneEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlHashPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPinnedPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlRecordEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRangePartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReplicationPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRoundRobinPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUnionPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlValuePartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheCoordinationTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlChangeTrackingTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlDirectionEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum existenceTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlJoinFetchTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlOptimisticLockingTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmPackage()
- {
- super(eNS_URI, EclipseLinkOrmFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmPackage#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmPackage init()
- {
- if (isInited) return (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmPackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmPackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmPackage.eNS_URI, theEclipseLinkOrmPackage);
- return theEclipseLinkOrmPackage;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Access Methods</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods
- * @generated
- */
- public EClass getXmlAccessMethods()
- {
- return xmlAccessMethodsEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod <em>Get Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Get Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod()
- * @see #getXmlAccessMethods()
- * @generated
- */
- public EAttribute getXmlAccessMethods_GetMethod()
- {
- return (EAttribute)xmlAccessMethodsEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod <em>Set Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Set Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod()
- * @see #getXmlAccessMethods()
- * @generated
- */
- public EAttribute getXmlAccessMethods_SetMethod()
- {
- return (EAttribute)xmlAccessMethodsEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Access Methods Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @generated
- */
- public EClass getXmlAccessMethodsHolder()
- {
- return xmlAccessMethodsHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods <em>Access Methods</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Access Methods</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods()
- * @see #getXmlAccessMethodsHolder()
- * @generated
- */
- public EReference getXmlAccessMethodsHolder_AccessMethods()
- {
- return (EReference)xmlAccessMethodsHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria <em>Xml Additional Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Additional Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria
- * @generated
- */
- public EClass getXmlAdditionalCriteria()
- {
- return xmlAdditionalCriteriaEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray <em>Xml Array</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Array</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray
- * @generated
- */
- public EClass getXmlArray()
- {
- return xmlArrayEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Mapping</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping
- * @generated
- */
- public EClass getXmlAttributeMapping()
- {
- return xmlAttributeMappingEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Attributes</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes
- * @generated
- */
- public EClass getAttributes()
- {
- return attributesEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicCollections <em>Basic Collections</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Basic Collections</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicCollections()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_BasicCollections()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicMaps <em>Basic Maps</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Basic Maps</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicMaps()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_BasicMaps()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getTransformations <em>Transformations</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Transformations</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getTransformations()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Transformations()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getVariableOneToOnes <em>Variable One To Ones</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Variable One To Ones</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getVariableOneToOnes()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_VariableOneToOnes()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic
- * @generated
- */
- public EClass getXmlBasic()
- {
- return xmlBasicEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Collection</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection
- * @generated
- */
- public EClass getXmlBasicCollection()
- {
- return xmlBasicCollectionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Map</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap
- * @generated
- */
- public EClass getXmlBasicMap()
- {
- return xmlBasicMapEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Batch Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch
- * @generated
- */
- public EClass getXmlBatchFetch()
- {
- return xmlBatchFetchEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Batch Fetch Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @generated
- */
- public EClass getXmlBatchFetchHolder()
- {
- return xmlBatchFetchHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch <em>Batch Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Batch Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch()
- * @see #getXmlBatchFetchHolder()
- * @generated
- */
- public EReference getXmlBatchFetchHolder_BatchFetch()
- {
- return (EReference)xmlBatchFetchHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache
- * @generated
- */
- public EClass getXmlCache()
- {
- return xmlCacheEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry <em>Expiry</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Expiry</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Expiry()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize <em>Size</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Size</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Size()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared <em>Shared</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Shared</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Shared()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Type()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh <em>Always Refresh</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Always Refresh</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_AlwaysRefresh()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer <em>Refresh Only If Newer</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Refresh Only If Newer</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_RefreshOnlyIfNewer()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits <em>Disable Hits</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Disable Hits</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_DisableHits()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType <em>Coordination Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Coordination Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_CoordinationType()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay <em>Expiry Time Of Day</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Expiry Time Of Day</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay()
- * @see #getXmlCache()
- * @generated
- */
- public EReference getXmlCache_ExpiryTimeOfDay()
- {
- return (EReference)xmlCacheEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder
- * @generated
- */
- public EClass getXmlCacheHolder()
- {
- return xmlCacheHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache <em>Cache</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache()
- * @see #getXmlCacheHolder()
- * @generated
- */
- public EReference getXmlCacheHolder_Cache()
- {
- return (EReference)xmlCacheHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking <em>Existence Checking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Existence Checking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking()
- * @see #getXmlCacheHolder()
- * @generated
- */
- public EAttribute getXmlCacheHolder_ExistenceChecking()
- {
- return (EAttribute)xmlCacheHolderEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex <em>Xml Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex
- * @generated
- */
- public EClass getXmlCacheIndex()
- {
- return xmlCacheIndexEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Change Tracking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking
- * @generated
- */
- public EClass getXmlChangeTracking()
- {
- return xmlChangeTrackingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType()
- * @see #getXmlChangeTracking()
- * @generated
- */
- public EAttribute getXmlChangeTracking_Type()
- {
- return (EAttribute)xmlChangeTrackingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Change Tracking Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @generated
- */
- public EClass getXmlChangeTrackingHolder()
- {
- return xmlChangeTrackingHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking <em>Change Tracking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Change Tracking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking()
- * @see #getXmlChangeTrackingHolder()
- * @generated
- */
- public EReference getXmlChangeTrackingHolder_ChangeTracking()
- {
- return (EReference)xmlChangeTrackingHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @generated
- */
- public EClass getXmlCloneCopyPolicy()
- {
- return xmlCloneCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod <em>Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod()
- * @see #getXmlCloneCopyPolicy()
- * @generated
- */
- public EAttribute getXmlCloneCopyPolicy_Method()
- {
- return (EAttribute)xmlCloneCopyPolicyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod <em>Working Copy Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Working Copy Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod()
- * @see #getXmlCloneCopyPolicy()
- * @generated
- */
- public EAttribute getXmlCloneCopyPolicy_WorkingCopyMethod()
- {
- return (EAttribute)xmlCloneCopyPolicyEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Collection Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable
- * @generated
- */
- public EClass getXmlCollectionTable()
- {
- return xmlCollectionTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Conversion Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue
- * @generated
- */
- public EClass getXmlConversionValue()
- {
- return xmlConversionValueEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue <em>Data Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Data Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue()
- * @see #getXmlConversionValue()
- * @generated
- */
- public EAttribute getXmlConversionValue_DataValue()
- {
- return (EAttribute)xmlConversionValueEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue <em>Object Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Object Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue()
- * @see #getXmlConversionValue()
- * @generated
- */
- public EAttribute getXmlConversionValue_ObjectValue()
- {
- return (EAttribute)xmlConversionValueEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter
- * @generated
- */
- public EClass getXmlConverter()
- {
- return xmlConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName <em>Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName()
- * @see #getXmlConverter()
- * @generated
- */
- public EAttribute getXmlConverter_ClassName()
- {
- return (EAttribute)xmlConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder <em>Xml Converter Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Converter Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder
- * @generated
- */
- public EClass getXmlConverterHolder()
- {
- return xmlConverterHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getConverter <em>Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getConverter()
- * @see #getXmlConverterHolder()
- * @generated
- */
- public EReference getXmlConverterHolder_Converter()
- {
- return (EReference)xmlConverterHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getTypeConverter <em>Type Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Type Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getTypeConverter()
- * @see #getXmlConverterHolder()
- * @generated
- */
- public EReference getXmlConverterHolder_TypeConverter()
- {
- return (EReference)xmlConverterHolderEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getObjectTypeConverter <em>Object Type Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Object Type Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getObjectTypeConverter()
- * @see #getXmlConverterHolder()
- * @generated
- */
- public EReference getXmlConverterHolder_ObjectTypeConverter()
- {
- return (EReference)xmlConverterHolderEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getStructConverter <em>Struct Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Struct Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getStructConverter()
- * @see #getXmlConverterHolder()
- * @generated
- */
- public EReference getXmlConverterHolder_StructConverter()
- {
- return (EReference)xmlConverterHolderEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder <em>Xml Converters Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Converters Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder
- * @generated
- */
- public EClass getXmlConvertersHolder()
- {
- return xmlConvertersHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getConverters <em>Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getConverters()
- * @see #getXmlConvertersHolder()
- * @generated
- */
- public EReference getXmlConvertersHolder_Converters()
- {
- return (EReference)xmlConvertersHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getTypeConverters <em>Type Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Type Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getTypeConverters()
- * @see #getXmlConvertersHolder()
- * @generated
- */
- public EReference getXmlConvertersHolder_TypeConverters()
- {
- return (EReference)xmlConvertersHolderEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getObjectTypeConverters <em>Object Type Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Object Type Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getObjectTypeConverters()
- * @see #getXmlConvertersHolder()
- * @generated
- */
- public EReference getXmlConvertersHolder_ObjectTypeConverters()
- {
- return (EReference)xmlConvertersHolderEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getStructConverters <em>Struct Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Struct Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getStructConverters()
- * @see #getXmlConvertersHolder()
- * @generated
- */
- public EReference getXmlConvertersHolder_StructConverters()
- {
- return (EReference)xmlConvertersHolderEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Convertible Mapping</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @generated
- */
- public EClass getXmlConvertibleMapping()
- {
- return xmlConvertibleMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert <em>Convert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Convert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert()
- * @see #getXmlConvertibleMapping()
- * @generated
- */
- public EAttribute getXmlConvertibleMapping_Convert()
- {
- return (EAttribute)xmlConvertibleMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy
- * @generated
- */
- public EClass getXmlCopyPolicy()
- {
- return xmlCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ <em>Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_()
- * @see #getXmlCopyPolicy()
- * @generated
- */
- public EAttribute getXmlCopyPolicy_Class()
- {
- return (EAttribute)xmlCopyPolicyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Customizer</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer
- * @generated
- */
- public EClass getXmlCustomizer()
- {
- return xmlCustomizerEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName <em>Customizer Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Customizer Class Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName()
- * @see #getXmlCustomizer()
- * @generated
- */
- public EAttribute getXmlCustomizer_CustomizerClassName()
- {
- return (EAttribute)xmlCustomizerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Customizer Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @generated
- */
- public EClass getXmlCustomizerHolder()
- {
- return xmlCustomizerHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer <em>Customizer</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Customizer</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer()
- * @see #getXmlCustomizerHolder()
- * @generated
- */
- public EReference getXmlCustomizerHolder_Customizer()
- {
- return (EReference)xmlCustomizerHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection
- * @generated
- */
- public EClass getXmlElementCollection()
- {
- return xmlElementCollectionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable
- * @generated
- */
- public EClass getXmlEmbeddable()
- {
- return xmlEmbeddableEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy <em>Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EReference getXmlEmbeddable_CopyPolicy()
- {
- return (EReference)xmlEmbeddableEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EReference getXmlEmbeddable_InstantiationCopyPolicy()
- {
- return (EReference)xmlEmbeddableEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy <em>Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EReference getXmlEmbeddable_CloneCopyPolicy()
- {
- return (EReference)xmlEmbeddableEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EAttribute getXmlEmbeddable_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlEmbeddableEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded
- * @generated
- */
- public EClass getXmlEmbedded()
- {
- return xmlEmbeddedEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Id</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId
- * @generated
- */
- public EClass getXmlEmbeddedId()
- {
- return xmlEmbeddedIdEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity
- * @generated
- */
- public EClass getXmlEntity()
- {
- return xmlEntityEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking <em>Optimistic Locking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Optimistic Locking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_OptimisticLocking()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy <em>Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_CopyPolicy()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_InstantiationCopyPolicy()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy <em>Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_CloneCopyPolicy()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings
- * @generated
- */
- public EClass getXmlEntityMappings()
- {
- return xmlEntityMappingsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Attribute</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute
- * @generated
- */
- public EClass getXmlFetchAttribute()
- {
- return xmlFetchAttributeEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Group</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup
- * @generated
- */
- public EClass getXmlFetchGroup()
- {
- return xmlFetchGroupEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId
- * @generated
- */
- public EClass getXmlId()
- {
- return xmlIdEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex <em>Xml Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex
- * @generated
- */
- public EClass getXmlIndex()
- {
- return xmlIndexEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @generated
- */
- public EClass getXmlInstantiationCopyPolicy()
- {
- return xmlInstantiationCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch
- * @generated
- */
- public EClass getXmlJoinFetch()
- {
- return xmlJoinFetchEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch <em>Join Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Join Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch()
- * @see #getXmlJoinFetch()
- * @generated
- */
- public EAttribute getXmlJoinFetch_JoinFetch()
- {
- return (EAttribute)xmlJoinFetchEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable
- * @generated
- */
- public EClass getXmlJoinTable()
- {
- return xmlJoinTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany
- * @generated
- */
- public EClass getXmlManyToMany()
- {
- return xmlManyToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne
- * @generated
- */
- public EClass getXmlManyToOne()
- {
- return xmlManyToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @generated
- */
- public EClass getXmlMappedSuperclass()
- {
- return xmlMappedSuperclassEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking <em>Optimistic Locking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Optimistic Locking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_OptimisticLocking()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy <em>Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_CopyPolicy()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_InstantiationCopyPolicy()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy <em>Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_CloneCopyPolicy()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant <em>Xml Multitenant</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant
- * @generated
- */
- public EClass getXmlMultitenant()
- {
- return xmlMultitenantEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder <em>Xml Multitenant Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder
- * @generated
- */
- public EClass getXmlMultitenantHolder()
- {
- return xmlMultitenantHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant <em>Multitenant</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Multitenant</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant()
- * @see #getXmlMultitenantHolder()
- * @generated
- */
- public EReference getXmlMultitenantHolder_Multitenant()
- {
- return (EReference)xmlMultitenantHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mutable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable
- * @generated
- */
- public EClass getXmlMutable()
- {
- return xmlMutableEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable <em>Mutable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Mutable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable()
- * @see #getXmlMutable()
- * @generated
- */
- public EAttribute getXmlMutable_Mutable()
- {
- return (EAttribute)xmlMutableEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter
- * @generated
- */
- public EClass getXmlNamedConverter()
- {
- return xmlNamedConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName()
- * @see #getXmlNamedConverter()
- * @generated
- */
- public EAttribute getXmlNamedConverter_Name()
- {
- return (EAttribute)xmlNamedConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery <em>Xml Named Plsql Stored Function Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Function Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredFunctionQuery()
- {
- return xmlNamedPlsqlStoredFunctionQueryEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery <em>Xml Named Plsql Stored Procedure Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Procedure Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredProcedureQuery()
- {
- return xmlNamedPlsqlStoredProcedureQueryEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery <em>Xml Named Stored Function Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Stored Function Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery
- * @generated
- */
- public EClass getXmlNamedStoredFunctionQuery()
- {
- return xmlNamedStoredFunctionQueryEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Stored Procedure Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @generated
- */
- public EClass getXmlNamedStoredProcedureQuery()
- {
- return xmlNamedStoredProcedureQueryEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_Name()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass <em>Result Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Result Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ResultClass()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping <em>Result Set Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Result Set Mapping</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ResultSetMapping()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName <em>Procedure Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Procedure Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ProcedureName()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet <em>Returns Result Set</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Returns Result Set</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ReturnsResultSet()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getHints <em>Hints</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Hints</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getHints()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EReference getXmlNamedStoredProcedureQuery_Hints()
- {
- return (EReference)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getParameters <em>Parameters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Parameters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getParameters()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EReference getXmlNamedStoredProcedureQuery_Parameters()
- {
- return (EReference)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Object Type Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @generated
- */
- public EClass getXmlObjectTypeConverter()
- {
- return xmlObjectTypeConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType <em>Data Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Data Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EAttribute getXmlObjectTypeConverter_DataType()
- {
- return (EAttribute)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType <em>Object Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Object Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EAttribute getXmlObjectTypeConverter_ObjectType()
- {
- return (EAttribute)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getConversionValues <em>Conversion Values</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Conversion Values</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getConversionValues()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EReference getXmlObjectTypeConverter_ConversionValues()
- {
- return (EReference)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue <em>Default Object Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Default Object Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EAttribute getXmlObjectTypeConverter_DefaultObjectValue()
- {
- return (EAttribute)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany
- * @generated
- */
- public EClass getXmlOneToMany()
- {
- return xmlOneToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne
- * @generated
- */
- public EClass getXmlOneToOne()
- {
- return xmlOneToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Optimistic Locking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @generated
- */
- public EClass getXmlOptimisticLocking()
- {
- return xmlOptimisticLockingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType()
- * @see #getXmlOptimisticLocking()
- * @generated
- */
- public EAttribute getXmlOptimisticLocking_Type()
- {
- return (EAttribute)xmlOptimisticLockingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade <em>Cascade</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade()
- * @see #getXmlOptimisticLocking()
- * @generated
- */
- public EAttribute getXmlOptimisticLocking_Cascade()
- {
- return (EAttribute)xmlOptimisticLockingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getSelectedColumns <em>Selected Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Selected Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getSelectedColumns()
- * @see #getXmlOptimisticLocking()
- * @generated
- */
- public EReference getXmlOptimisticLocking_SelectedColumns()
- {
- return (EReference)xmlOptimisticLockingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Order Column</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn
- * @generated
- */
- public EClass getXmlOrderColumn()
- {
- return xmlOrderColumnEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults()
- {
- return xmlPersistenceUnitDefaultsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Metadata</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @generated
- */
- public EClass getXmlPersistenceUnitMetadata()
- {
- return xmlPersistenceUnitMetadataEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings()
- * @see #getXmlPersistenceUnitMetadata()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitMetadata_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlPersistenceUnitMetadataEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey
- * @generated
- */
- public EClass getXmlPrimaryKey()
- {
- return xmlPrimaryKeyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Private Owned</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned
- * @generated
- */
- public EClass getXmlPrivateOwned()
- {
- return xmlPrivateOwnedEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned <em>Private Owned</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Private Owned</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned()
- * @see #getXmlPrivateOwned()
- * @generated
- */
- public EAttribute getXmlPrivateOwned_PrivateOwned()
- {
- return (EAttribute)xmlPrivateOwnedEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Property</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty
- * @generated
- */
- public EClass getXmlProperty()
- {
- return xmlPropertyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_Name()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_Value()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType <em>Value Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_ValueType()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Property Container</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer
- * @generated
- */
- public EClass getXmlPropertyContainer()
- {
- return xmlPropertyContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer#getProperties <em>Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Properties</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer#getProperties()
- * @see #getXmlPropertyContainer()
- * @generated
- */
- public EReference getXmlPropertyContainer_Properties()
- {
- return (EReference)xmlPropertyContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Container</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer
- * @generated
- */
- public EClass getXmlQueryContainer()
- {
- return xmlQueryContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer#getNamedStoredProcedureQueries <em>Named Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer#getNamedStoredProcedureQueries()
- * @see #getXmlQueryContainer()
- * @generated
- */
- public EReference getXmlQueryContainer_NamedStoredProcedureQueries()
- {
- return (EReference)xmlQueryContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Redirectors</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @generated
- */
- public EClass getXmlQueryRedirectors()
- {
- return xmlQueryRedirectorsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Read Only</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly
- * @generated
- */
- public EClass getXmlReadOnly()
- {
- return xmlReadOnlyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly <em>Read Only</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Read Only</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly()
- * @see #getXmlReadOnly()
- * @generated
- */
- public EAttribute getXmlReadOnly_ReadOnly()
- {
- return (EAttribute)xmlReadOnlyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Return Insert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert
- * @generated
- */
- public EClass getXmlReturnInsert()
- {
- return xmlReturnInsertEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Secondary Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable
- * @generated
- */
- public EClass getXmlSecondaryTable()
- {
- return xmlSecondaryTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Stored Procedure Parameter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @generated
- */
- public EClass getXmlStoredProcedureParameter()
- {
- return xmlStoredProcedureParameterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection <em>Direction</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Direction</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_Direction()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_Name()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter <em>Query Parameter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Query Parameter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_QueryParameter()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_Type()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType <em>Jdbc Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Jdbc Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_JdbcType()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName <em>Jdbc Type Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Jdbc Type Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_JdbcTypeName()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct <em>Xml Struct</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Struct</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct
- * @generated
- */
- public EClass getXmlStruct()
- {
- return xmlStructEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Struct Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter
- * @generated
- */
- public EClass getXmlStructConverter()
- {
- return xmlStructConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter <em>Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter()
- * @see #getXmlStructConverter()
- * @generated
- */
- public EAttribute getXmlStructConverter_Converter()
- {
- return (EAttribute)xmlStructConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure <em>Xml Structure</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Structure</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure
- * @generated
- */
- public EClass getXmlStructure()
- {
- return xmlStructureEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable <em>Xml Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable
- * @generated
- */
- public EClass getXmlTable()
- {
- return xmlTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table Generator</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator
- * @generated
- */
- public EClass getXmlTableGenerator()
- {
- return xmlTableGeneratorEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn <em>Xml Tenant Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Tenant Discriminator Column</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn
- * @generated
- */
- public EClass getXmlTenantDiscriminatorColumn()
- {
- return xmlTenantDiscriminatorColumnEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Time Of Day</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay
- * @generated
- */
- public EClass getXmlTimeOfDay()
- {
- return xmlTimeOfDayEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour <em>Hour</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Hour</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Hour()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute <em>Minute</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Minute</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Minute()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond <em>Second</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Second</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Second()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond <em>Millisecond</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Millisecond</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Millisecond()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transformation</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation
- * @generated
- */
- public EClass getXmlTransformation()
- {
- return xmlTransformationEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transient</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient
- * @generated
- */
- public EClass getXmlTransient()
- {
- return xmlTransientEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Type Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter
- * @generated
- */
- public EClass getXmlTypeConverter()
- {
- return xmlTypeConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType <em>Data Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Data Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType()
- * @see #getXmlTypeConverter()
- * @generated
- */
- public EAttribute getXmlTypeConverter_DataType()
- {
- return (EAttribute)xmlTypeConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType <em>Object Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Object Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType()
- * @see #getXmlTypeConverter()
- * @generated
- */
- public EAttribute getXmlTypeConverter_ObjectType()
- {
- return (EAttribute)xmlTypeConverterEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Variable One To One</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @generated
- */
- public EClass getXmlVariableOneToOne()
- {
- return xmlVariableOneToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion
- * @generated
- */
- public EClass getXmlVersion()
- {
- return xmlVersionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning <em>Xml Hash Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Hash Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning
- * @generated
- */
- public EClass getXmlHashPartitioning()
- {
- return xmlHashPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning <em>Xml Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning
- * @generated
- */
- public EClass getXmlPartitioning()
- {
- return xmlPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning <em>Xml Pinned Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Pinned Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning
- * @generated
- */
- public EClass getXmlPinnedPartitioning()
- {
- return xmlPinnedPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord <em>Xml Plsql Record</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Record</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord
- * @generated
- */
- public EClass getXmlPlsqlRecord()
- {
- return xmlPlsqlRecordEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable <em>Xml Plsql Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable
- * @generated
- */
- public EClass getXmlPlsqlTable()
- {
- return xmlPlsqlTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning <em>Xml Range Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Range Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning
- * @generated
- */
- public EClass getXmlRangePartitioning()
- {
- return xmlRangePartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning <em>Xml Replication Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Replication Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning
- * @generated
- */
- public EClass getXmlReplicationPartitioning()
- {
- return xmlReplicationPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning <em>Xml Round Robin Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Round Robin Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning
- * @generated
- */
- public EClass getXmlRoundRobinPartitioning()
- {
- return xmlRoundRobinPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning <em>Xml Union Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Union Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning
- * @generated
- */
- public EClass getXmlUnionPartitioning()
- {
- return xmlUnionPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning <em>Xml Value Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Value Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning
- * @generated
- */
- public EClass getXmlValuePartitioning()
- {
- return xmlValuePartitioningEClass;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Coordination Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @generated
- */
- public EEnum getCacheCoordinationType()
- {
- return cacheCoordinationTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @generated
- */
- public EEnum getCacheType()
- {
- return cacheTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Change Tracking Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @generated
- */
- public EEnum getXmlChangeTrackingType()
- {
- return xmlChangeTrackingTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Direction</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @generated
- */
- public EEnum getXmlDirection()
- {
- return xmlDirectionEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Existence Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @generated
- */
- public EEnum getExistenceType()
- {
- return existenceTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Join Fetch Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @generated
- */
- public EEnum getXmlJoinFetchType()
- {
- return xmlJoinFetchTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Optimistic Locking Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @generated
- */
- public EEnum getXmlOptimisticLockingType()
- {
- return xmlOptimisticLockingTypeEEnum;
- }
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmFactory getEclipseLinkOrmFactory()
- {
- return (EclipseLinkOrmFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlAccessMethodsEClass = createEClass(XML_ACCESS_METHODS);
- createEAttribute(xmlAccessMethodsEClass, XML_ACCESS_METHODS__GET_METHOD);
- createEAttribute(xmlAccessMethodsEClass, XML_ACCESS_METHODS__SET_METHOD);
-
- xmlAccessMethodsHolderEClass = createEClass(XML_ACCESS_METHODS_HOLDER);
- createEReference(xmlAccessMethodsHolderEClass, XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS);
-
- xmlAdditionalCriteriaEClass = createEClass(XML_ADDITIONAL_CRITERIA);
-
- xmlArrayEClass = createEClass(XML_ARRAY);
-
- xmlAttributeMappingEClass = createEClass(XML_ATTRIBUTE_MAPPING);
-
- attributesEClass = createEClass(ATTRIBUTES);
- createEReference(attributesEClass, ATTRIBUTES__BASIC_COLLECTIONS);
- createEReference(attributesEClass, ATTRIBUTES__BASIC_MAPS);
- createEReference(attributesEClass, ATTRIBUTES__TRANSFORMATIONS);
- createEReference(attributesEClass, ATTRIBUTES__VARIABLE_ONE_TO_ONES);
-
- xmlBasicEClass = createEClass(XML_BASIC);
-
- xmlBasicCollectionEClass = createEClass(XML_BASIC_COLLECTION);
-
- xmlBasicMapEClass = createEClass(XML_BASIC_MAP);
-
- xmlBatchFetchEClass = createEClass(XML_BATCH_FETCH);
-
- xmlBatchFetchHolderEClass = createEClass(XML_BATCH_FETCH_HOLDER);
- createEReference(xmlBatchFetchHolderEClass, XML_BATCH_FETCH_HOLDER__BATCH_FETCH);
-
- xmlCacheEClass = createEClass(XML_CACHE);
- createEAttribute(xmlCacheEClass, XML_CACHE__EXPIRY);
- createEAttribute(xmlCacheEClass, XML_CACHE__SIZE);
- createEAttribute(xmlCacheEClass, XML_CACHE__SHARED);
- createEAttribute(xmlCacheEClass, XML_CACHE__TYPE);
- createEAttribute(xmlCacheEClass, XML_CACHE__ALWAYS_REFRESH);
- createEAttribute(xmlCacheEClass, XML_CACHE__REFRESH_ONLY_IF_NEWER);
- createEAttribute(xmlCacheEClass, XML_CACHE__DISABLE_HITS);
- createEAttribute(xmlCacheEClass, XML_CACHE__COORDINATION_TYPE);
- createEReference(xmlCacheEClass, XML_CACHE__EXPIRY_TIME_OF_DAY);
-
- xmlCacheHolderEClass = createEClass(XML_CACHE_HOLDER);
- createEReference(xmlCacheHolderEClass, XML_CACHE_HOLDER__CACHE);
- createEAttribute(xmlCacheHolderEClass, XML_CACHE_HOLDER__EXISTENCE_CHECKING);
-
- xmlCacheIndexEClass = createEClass(XML_CACHE_INDEX);
-
- xmlChangeTrackingEClass = createEClass(XML_CHANGE_TRACKING);
- createEAttribute(xmlChangeTrackingEClass, XML_CHANGE_TRACKING__TYPE);
-
- xmlChangeTrackingHolderEClass = createEClass(XML_CHANGE_TRACKING_HOLDER);
- createEReference(xmlChangeTrackingHolderEClass, XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING);
-
- xmlCloneCopyPolicyEClass = createEClass(XML_CLONE_COPY_POLICY);
- createEAttribute(xmlCloneCopyPolicyEClass, XML_CLONE_COPY_POLICY__METHOD);
- createEAttribute(xmlCloneCopyPolicyEClass, XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD);
-
- xmlCollectionTableEClass = createEClass(XML_COLLECTION_TABLE);
-
- xmlConversionValueEClass = createEClass(XML_CONVERSION_VALUE);
- createEAttribute(xmlConversionValueEClass, XML_CONVERSION_VALUE__DATA_VALUE);
- createEAttribute(xmlConversionValueEClass, XML_CONVERSION_VALUE__OBJECT_VALUE);
-
- xmlConverterEClass = createEClass(XML_CONVERTER);
- createEAttribute(xmlConverterEClass, XML_CONVERTER__CLASS_NAME);
-
- xmlConverterHolderEClass = createEClass(XML_CONVERTER_HOLDER);
- createEReference(xmlConverterHolderEClass, XML_CONVERTER_HOLDER__CONVERTER);
- createEReference(xmlConverterHolderEClass, XML_CONVERTER_HOLDER__TYPE_CONVERTER);
- createEReference(xmlConverterHolderEClass, XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER);
- createEReference(xmlConverterHolderEClass, XML_CONVERTER_HOLDER__STRUCT_CONVERTER);
-
- xmlConvertersHolderEClass = createEClass(XML_CONVERTERS_HOLDER);
- createEReference(xmlConvertersHolderEClass, XML_CONVERTERS_HOLDER__CONVERTERS);
- createEReference(xmlConvertersHolderEClass, XML_CONVERTERS_HOLDER__TYPE_CONVERTERS);
- createEReference(xmlConvertersHolderEClass, XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS);
- createEReference(xmlConvertersHolderEClass, XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS);
-
- xmlConvertibleMappingEClass = createEClass(XML_CONVERTIBLE_MAPPING);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__CONVERT);
-
- xmlCopyPolicyEClass = createEClass(XML_COPY_POLICY);
- createEAttribute(xmlCopyPolicyEClass, XML_COPY_POLICY__CLASS);
-
- xmlCustomizerEClass = createEClass(XML_CUSTOMIZER);
- createEAttribute(xmlCustomizerEClass, XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME);
-
- xmlCustomizerHolderEClass = createEClass(XML_CUSTOMIZER_HOLDER);
- createEReference(xmlCustomizerHolderEClass, XML_CUSTOMIZER_HOLDER__CUSTOMIZER);
-
- xmlElementCollectionEClass = createEClass(XML_ELEMENT_COLLECTION);
-
- xmlEmbeddableEClass = createEClass(XML_EMBEDDABLE);
- createEReference(xmlEmbeddableEClass, XML_EMBEDDABLE__COPY_POLICY);
- createEReference(xmlEmbeddableEClass, XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY);
- createEReference(xmlEmbeddableEClass, XML_EMBEDDABLE__CLONE_COPY_POLICY);
- createEAttribute(xmlEmbeddableEClass, XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlEmbeddedEClass = createEClass(XML_EMBEDDED);
-
- xmlEmbeddedIdEClass = createEClass(XML_EMBEDDED_ID);
-
- xmlEntityEClass = createEClass(XML_ENTITY);
- createEReference(xmlEntityEClass, XML_ENTITY__OPTIMISTIC_LOCKING);
- createEReference(xmlEntityEClass, XML_ENTITY__COPY_POLICY);
- createEReference(xmlEntityEClass, XML_ENTITY__INSTANTIATION_COPY_POLICY);
- createEReference(xmlEntityEClass, XML_ENTITY__CLONE_COPY_POLICY);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlEntityMappingsEClass = createEClass(XML_ENTITY_MAPPINGS);
-
- xmlFetchAttributeEClass = createEClass(XML_FETCH_ATTRIBUTE);
-
- xmlFetchGroupEClass = createEClass(XML_FETCH_GROUP);
-
- xmlHashPartitioningEClass = createEClass(XML_HASH_PARTITIONING);
-
- xmlIdEClass = createEClass(XML_ID);
-
- xmlIndexEClass = createEClass(XML_INDEX);
-
- xmlInstantiationCopyPolicyEClass = createEClass(XML_INSTANTIATION_COPY_POLICY);
-
- xmlJoinFetchEClass = createEClass(XML_JOIN_FETCH);
- createEAttribute(xmlJoinFetchEClass, XML_JOIN_FETCH__JOIN_FETCH);
-
- xmlJoinTableEClass = createEClass(XML_JOIN_TABLE);
-
- xmlManyToManyEClass = createEClass(XML_MANY_TO_MANY);
-
- xmlManyToOneEClass = createEClass(XML_MANY_TO_ONE);
-
- xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__COPY_POLICY);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlMultitenantEClass = createEClass(XML_MULTITENANT);
-
- xmlMultitenantHolderEClass = createEClass(XML_MULTITENANT_HOLDER);
- createEReference(xmlMultitenantHolderEClass, XML_MULTITENANT_HOLDER__MULTITENANT);
-
- xmlMutableEClass = createEClass(XML_MUTABLE);
- createEAttribute(xmlMutableEClass, XML_MUTABLE__MUTABLE);
-
- xmlNamedConverterEClass = createEClass(XML_NAMED_CONVERTER);
- createEAttribute(xmlNamedConverterEClass, XML_NAMED_CONVERTER__NAME);
-
- xmlNamedPlsqlStoredFunctionQueryEClass = createEClass(XML_NAMED_PLSQL_STORED_FUNCTION_QUERY);
-
- xmlNamedPlsqlStoredProcedureQueryEClass = createEClass(XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY);
-
- xmlNamedStoredFunctionQueryEClass = createEClass(XML_NAMED_STORED_FUNCTION_QUERY);
-
- xmlNamedStoredProcedureQueryEClass = createEClass(XML_NAMED_STORED_PROCEDURE_QUERY);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__NAME);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET);
- createEReference(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__HINTS);
- createEReference(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS);
-
- xmlObjectTypeConverterEClass = createEClass(XML_OBJECT_TYPE_CONVERTER);
- createEAttribute(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__DATA_TYPE);
- createEAttribute(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE);
- createEReference(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES);
- createEAttribute(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE);
-
- xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY);
-
- xmlOneToOneEClass = createEClass(XML_ONE_TO_ONE);
-
- xmlOptimisticLockingEClass = createEClass(XML_OPTIMISTIC_LOCKING);
- createEAttribute(xmlOptimisticLockingEClass, XML_OPTIMISTIC_LOCKING__TYPE);
- createEAttribute(xmlOptimisticLockingEClass, XML_OPTIMISTIC_LOCKING__CASCADE);
- createEReference(xmlOptimisticLockingEClass, XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS);
-
- xmlOrderColumnEClass = createEClass(XML_ORDER_COLUMN);
-
- xmlPartitioningEClass = createEClass(XML_PARTITIONING);
-
- xmlPersistenceUnitDefaultsEClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS);
-
- xmlPersistenceUnitMetadataEClass = createEClass(XML_PERSISTENCE_UNIT_METADATA);
- createEAttribute(xmlPersistenceUnitMetadataEClass, XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlPinnedPartitioningEClass = createEClass(XML_PINNED_PARTITIONING);
-
- xmlPlsqlRecordEClass = createEClass(XML_PLSQL_RECORD);
-
- xmlPlsqlTableEClass = createEClass(XML_PLSQL_TABLE);
-
- xmlPrimaryKeyEClass = createEClass(XML_PRIMARY_KEY);
-
- xmlPrivateOwnedEClass = createEClass(XML_PRIVATE_OWNED);
- createEAttribute(xmlPrivateOwnedEClass, XML_PRIVATE_OWNED__PRIVATE_OWNED);
-
- xmlPropertyEClass = createEClass(XML_PROPERTY);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__NAME);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__VALUE);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__VALUE_TYPE);
-
- xmlPropertyContainerEClass = createEClass(XML_PROPERTY_CONTAINER);
- createEReference(xmlPropertyContainerEClass, XML_PROPERTY_CONTAINER__PROPERTIES);
-
- xmlQueryContainerEClass = createEClass(XML_QUERY_CONTAINER);
- createEReference(xmlQueryContainerEClass, XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES);
-
- xmlQueryRedirectorsEClass = createEClass(XML_QUERY_REDIRECTORS);
-
- xmlRangePartitioningEClass = createEClass(XML_RANGE_PARTITIONING);
-
- xmlReadOnlyEClass = createEClass(XML_READ_ONLY);
- createEAttribute(xmlReadOnlyEClass, XML_READ_ONLY__READ_ONLY);
-
- xmlReplicationPartitioningEClass = createEClass(XML_REPLICATION_PARTITIONING);
-
- xmlReturnInsertEClass = createEClass(XML_RETURN_INSERT);
-
- xmlRoundRobinPartitioningEClass = createEClass(XML_ROUND_ROBIN_PARTITIONING);
-
- xmlSecondaryTableEClass = createEClass(XML_SECONDARY_TABLE);
-
- xmlStoredProcedureParameterEClass = createEClass(XML_STORED_PROCEDURE_PARAMETER);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__DIRECTION);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__NAME);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__TYPE);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME);
-
- xmlStructEClass = createEClass(XML_STRUCT);
-
- xmlStructConverterEClass = createEClass(XML_STRUCT_CONVERTER);
- createEAttribute(xmlStructConverterEClass, XML_STRUCT_CONVERTER__CONVERTER);
-
- xmlStructureEClass = createEClass(XML_STRUCTURE);
-
- xmlTableEClass = createEClass(XML_TABLE);
-
- xmlTableGeneratorEClass = createEClass(XML_TABLE_GENERATOR);
-
- xmlTenantDiscriminatorColumnEClass = createEClass(XML_TENANT_DISCRIMINATOR_COLUMN);
-
- xmlTimeOfDayEClass = createEClass(XML_TIME_OF_DAY);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__HOUR);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__MINUTE);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__SECOND);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__MILLISECOND);
-
- xmlTransformationEClass = createEClass(XML_TRANSFORMATION);
-
- xmlTransientEClass = createEClass(XML_TRANSIENT);
-
- xmlTypeConverterEClass = createEClass(XML_TYPE_CONVERTER);
- createEAttribute(xmlTypeConverterEClass, XML_TYPE_CONVERTER__DATA_TYPE);
- createEAttribute(xmlTypeConverterEClass, XML_TYPE_CONVERTER__OBJECT_TYPE);
-
- xmlUnionPartitioningEClass = createEClass(XML_UNION_PARTITIONING);
-
- xmlValuePartitioningEClass = createEClass(XML_VALUE_PARTITIONING);
-
- xmlVariableOneToOneEClass = createEClass(XML_VARIABLE_ONE_TO_ONE);
-
- xmlVersionEClass = createEClass(XML_VERSION);
-
- // Create enums
- cacheCoordinationTypeEEnum = createEEnum(CACHE_COORDINATION_TYPE);
- cacheTypeEEnum = createEEnum(CACHE_TYPE);
- xmlChangeTrackingTypeEEnum = createEEnum(XML_CHANGE_TRACKING_TYPE);
- xmlDirectionEEnum = createEEnum(XML_DIRECTION);
- existenceTypeEEnum = createEEnum(EXISTENCE_TYPE);
- xmlJoinFetchTypeEEnum = createEEnum(XML_JOIN_FETCH_TYPE);
- xmlOptimisticLockingTypeEEnum = createEEnum(XML_OPTIMISTIC_LOCKING_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Add subpackages
- getESubpackages().add(theEclipseLinkOrmV1_1Package);
- getESubpackages().add(theEclipseLinkOrmV2_0Package);
- getESubpackages().add(theEclipseLinkOrmV2_1Package);
- getESubpackages().add(theEclipseLinkOrmV2_2Package);
- getESubpackages().add(theEclipseLinkOrmV2_3Package);
- getESubpackages().add(theEclipseLinkOrmV2_4Package);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlAdditionalCriteriaEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlAdditionalCriteria_2_2());
- xmlArrayEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlArrayEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlArrayEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlArray_2_3());
- xmlAttributeMappingEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping());
- xmlAttributeMappingEClass.getESuperTypes().add(this.getXmlAccessMethodsHolder());
- xmlAttributeMappingEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- attributesEClass.getESuperTypes().add(theOrmPackage.getAttributes());
- attributesEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlAttributes_2_3());
- xmlBasicEClass.getESuperTypes().add(theOrmPackage.getXmlBasic());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlBasic_1_1());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlBasic_2_1());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlBasic_2_2());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlBasic_2_4());
- xmlBasicEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicEClass.getESuperTypes().add(this.getXmlMutable());
- xmlBasicEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlBasicCollectionEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlBasicCollectionEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlBasicCollection_2_2());
- xmlBasicMapEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlBasicMapEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicMapEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlBasicMap_2_2());
- xmlBatchFetchEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlBatchFetch_2_1());
- xmlCacheEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlCache_2_2());
- xmlCacheEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlCache_2_4());
- xmlCacheIndexEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlCacheIndex_2_4());
- xmlCollectionTableEClass.getESuperTypes().add(theOrmPackage.getXmlCollectionTable());
- xmlCollectionTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlCollectionTable_2_2());
- xmlConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlConvertibleMappingEClass.getESuperTypes().add(theOrmPackage.getXmlConvertibleMapping());
- xmlConvertibleMappingEClass.getESuperTypes().add(this.getXmlConverterHolder());
- xmlElementCollectionEClass.getESuperTypes().add(theOrmPackage.getXmlElementCollection());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlElementCollection_2_0());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlElementCollection_2_1());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlElementCollection_2_2());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlElementCollection_2_3());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlElementCollection_2_4());
- xmlEmbeddableEClass.getESuperTypes().add(theOrmPackage.getXmlEmbeddable());
- xmlEmbeddableEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEmbeddable_2_1());
- xmlEmbeddableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlEmbeddable_2_2());
- xmlEmbeddableEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlEmbeddable_2_3());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlCustomizerHolder());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlChangeTrackingHolder());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlConvertersHolder());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- xmlEmbeddedEClass.getESuperTypes().add(theOrmPackage.getXmlEmbedded());
- xmlEmbeddedEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEmbedded_2_1());
- xmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEmbeddedIdEClass.getESuperTypes().add(theOrmPackage.getXmlEmbeddedId());
- xmlEmbeddedIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEmbeddedId_2_1());
- xmlEmbeddedIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEntityEClass.getESuperTypes().add(theOrmPackage.getXmlEntity());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlEntity_1_1());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlEntity_2_0());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEntity_2_1());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlEntity_2_2());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlEntity_2_3());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlEntity_2_4());
- xmlEntityEClass.getESuperTypes().add(this.getXmlReadOnly());
- xmlEntityEClass.getESuperTypes().add(this.getXmlCustomizerHolder());
- xmlEntityEClass.getESuperTypes().add(this.getXmlChangeTrackingHolder());
- xmlEntityEClass.getESuperTypes().add(this.getXmlCacheHolder());
- xmlEntityEClass.getESuperTypes().add(this.getXmlConvertersHolder());
- xmlEntityEClass.getESuperTypes().add(this.getXmlQueryContainer());
- xmlEntityEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- xmlEntityMappingsEClass.getESuperTypes().add(theOrmPackage.getXmlEntityMappings());
- xmlEntityMappingsEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEntityMappings_2_1());
- xmlEntityMappingsEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlEntityMappings_2_2());
- xmlEntityMappingsEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlEntityMappings_2_3());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlConvertersHolder());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlQueryContainer());
- xmlFetchAttributeEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlFetchAttribute_2_1());
- xmlFetchGroupEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlFetchGroup_2_1());
- xmlHashPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlHashPartitioning_2_2());
- xmlIdEClass.getESuperTypes().add(theOrmPackage.getXmlId());
- xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlId_2_1());
- xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlId_2_2());
- xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlId_2_4());
- xmlIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlMutable());
- xmlIdEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlIndexEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlIndex_2_2());
- xmlJoinTableEClass.getESuperTypes().add(theOrmPackage.getXmlJoinTable());
- xmlJoinTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlJoinTable_2_2());
- xmlManyToManyEClass.getESuperTypes().add(theOrmPackage.getXmlManyToMany());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlManyToMany_2_0());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlManyToMany_2_1());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlManyToMany_2_2());
- xmlManyToManyEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlManyToManyEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlManyToOneEClass.getESuperTypes().add(theOrmPackage.getXmlManyToOne());
- xmlManyToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlManyToOne_2_1());
- xmlManyToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlManyToOne_2_2());
- xmlManyToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlManyToOneEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlMappedSuperclassEClass.getESuperTypes().add(theOrmPackage.getXmlMappedSuperclass());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlMappedSuperclass_1_1());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlMappedSuperclass_2_0());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlMappedSuperclass_2_1());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlMappedSuperclass_2_2());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlMappedSuperclass_2_3());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlMappedSuperclass_2_4());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlReadOnly());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlCustomizerHolder());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlChangeTrackingHolder());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlCacheHolder());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlConvertersHolder());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- xmlMultitenantEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlMultitenant_2_3());
- xmlMultitenantEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlMultitenant_2_4());
- xmlNamedPlsqlStoredFunctionQueryEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlNamedPlsqlStoredFunctionQuery_2_3());
- xmlNamedPlsqlStoredProcedureQueryEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlNamedPlsqlStoredProcedureQuery_2_3());
- xmlNamedStoredFunctionQueryEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlNamedStoredFunctionQuery_2_3());
- xmlObjectTypeConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlOneToManyEClass.getESuperTypes().add(theOrmPackage.getXmlOneToMany());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlOneToMany_2_0());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlOneToMany_2_1());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlOneToMany_2_2());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlOneToMany_2_4());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlPrivateOwned());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlOneToOneEClass.getESuperTypes().add(theOrmPackage.getXmlOneToOne());
- xmlOneToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlOneToOne_2_1());
- xmlOneToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlOneToOne_2_2());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlPrivateOwned());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlOrderColumnEClass.getESuperTypes().add(theOrmPackage.getXmlOrderColumn());
- xmlOrderColumnEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlOrderColumn_2_0());
- xmlPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlPartitioning_2_2());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theOrmPackage.getXmlPersistenceUnitDefaults());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlPersistenceUnitDefaults_2_1());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlPersistenceUnitDefaults_2_3());
- xmlPersistenceUnitMetadataEClass.getESuperTypes().add(theOrmPackage.getXmlPersistenceUnitMetadata());
- xmlPinnedPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlPinnedPartitioning_2_2());
- xmlPlsqlRecordEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlPlsqlRecord_2_3());
- xmlPlsqlTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlPlsqlTable_2_3());
- xmlPrimaryKeyEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlPrimaryKey_1_1());
- xmlPrimaryKeyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlPrimaryKey_2_1());
- xmlQueryRedirectorsEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlQueryRedirectors_2_0());
- xmlRangePartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlRangePartitioning_2_2());
- xmlReplicationPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlReplicationPartitioning_2_2());
- xmlReturnInsertEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlReturnInsert_2_1());
- xmlRoundRobinPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlRoundRobinPartitioning_2_2());
- xmlSecondaryTableEClass.getESuperTypes().add(theOrmPackage.getXmlSecondaryTable());
- xmlSecondaryTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlSecondaryTable_2_2());
- xmlStructEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlStruct_2_3());
- xmlStructConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlStructureEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlStructureEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlStructureEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlStructure_2_3());
- xmlTableEClass.getESuperTypes().add(theOrmPackage.getXmlTable());
- xmlTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlTable_2_2());
- xmlTableGeneratorEClass.getESuperTypes().add(theOrmPackage.getXmlTableGenerator());
- xmlTableGeneratorEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlTableGenerator_2_2());
- xmlTenantDiscriminatorColumnEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlBaseDiscriminatorColumn());
- xmlTenantDiscriminatorColumnEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlTenantDiscriminatorColumn_2_3());
- xmlTransformationEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlTransformationEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlTransformation_2_1());
- xmlTransformationEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlTransientEClass.getESuperTypes().add(theOrmPackage.getXmlTransient());
- xmlTransientEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlTypeConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlUnionPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlUnionPartitioning_2_2());
- xmlValuePartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlValuePartitioning_2_2());
- xmlVariableOneToOneEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlVariableOneToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlVariableOneToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlVariableOneToOne_2_2());
- xmlVersionEClass.getESuperTypes().add(theOrmPackage.getXmlVersion());
- xmlVersionEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlVersion_2_1());
- xmlVersionEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlVersion_2_2());
- xmlVersionEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlVersionEClass.getESuperTypes().add(this.getXmlMutable());
- xmlVersionEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlAccessMethodsEClass, XmlAccessMethods.class, "XmlAccessMethods", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAccessMethods_GetMethod(), theXMLTypePackage.getString(), "getMethod", null, 0, 1, XmlAccessMethods.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAccessMethods_SetMethod(), theXMLTypePackage.getString(), "setMethod", null, 0, 1, XmlAccessMethods.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAccessMethodsHolderEClass, XmlAccessMethodsHolder.class, "XmlAccessMethodsHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAccessMethodsHolder_AccessMethods(), this.getXmlAccessMethods(), null, "accessMethods", null, 0, 1, XmlAccessMethodsHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAdditionalCriteriaEClass, XmlAdditionalCriteria.class, "XmlAdditionalCriteria", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlArrayEClass, XmlArray.class, "XmlArray", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAttributeMappingEClass, XmlAttributeMapping.class, "XmlAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(attributesEClass, Attributes.class, "Attributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getAttributes_BasicCollections(), this.getXmlBasicCollection(), null, "basicCollections", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_BasicMaps(), this.getXmlBasicMap(), null, "basicMaps", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_Transformations(), this.getXmlTransformation(), null, "transformations", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_VariableOneToOnes(), this.getXmlVariableOneToOne(), null, "variableOneToOnes", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasicEClass, XmlBasic.class, "XmlBasic", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicCollectionEClass, XmlBasicCollection.class, "XmlBasicCollection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicMapEClass, XmlBasicMap.class, "XmlBasicMap", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBatchFetchEClass, XmlBatchFetch.class, "XmlBatchFetch", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBatchFetchHolderEClass, XmlBatchFetchHolder.class, "XmlBatchFetchHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBatchFetchHolder_BatchFetch(), this.getXmlBatchFetch(), null, "batchFetch", null, 0, 1, XmlBatchFetchHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheEClass, XmlCache.class, "XmlCache", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCache_Expiry(), theXMLTypePackage.getIntObject(), "expiry", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_Size(), theXMLTypePackage.getIntObject(), "size", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_Shared(), theXMLTypePackage.getBooleanObject(), "shared", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_Type(), this.getCacheType(), "type", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_AlwaysRefresh(), theXMLTypePackage.getBooleanObject(), "alwaysRefresh", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_RefreshOnlyIfNewer(), theXMLTypePackage.getBooleanObject(), "refreshOnlyIfNewer", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_DisableHits(), theXMLTypePackage.getBooleanObject(), "disableHits", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_CoordinationType(), this.getCacheCoordinationType(), "coordinationType", "", 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlCache_ExpiryTimeOfDay(), this.getXmlTimeOfDay(), null, "expiryTimeOfDay", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheHolderEClass, XmlCacheHolder.class, "XmlCacheHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlCacheHolder_Cache(), this.getXmlCache(), null, "cache", null, 0, 1, XmlCacheHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCacheHolder_ExistenceChecking(), this.getExistenceType(), "existenceChecking", "", 0, 1, XmlCacheHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheIndexEClass, XmlCacheIndex.class, "XmlCacheIndex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlChangeTrackingEClass, XmlChangeTracking.class, "XmlChangeTracking", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlChangeTracking_Type(), this.getXmlChangeTrackingType(), "type", null, 0, 1, XmlChangeTracking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlChangeTrackingHolderEClass, XmlChangeTrackingHolder.class, "XmlChangeTrackingHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlChangeTrackingHolder_ChangeTracking(), this.getXmlChangeTracking(), null, "changeTracking", null, 0, 1, XmlChangeTrackingHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCloneCopyPolicyEClass, XmlCloneCopyPolicy.class, "XmlCloneCopyPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCloneCopyPolicy_Method(), theXMLTypePackage.getString(), "method", null, 0, 1, XmlCloneCopyPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCloneCopyPolicy_WorkingCopyMethod(), theXMLTypePackage.getString(), "workingCopyMethod", null, 0, 1, XmlCloneCopyPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCollectionTableEClass, XmlCollectionTable.class, "XmlCollectionTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlConversionValueEClass, XmlConversionValue.class, "XmlConversionValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConversionValue_DataValue(), theXMLTypePackage.getString(), "dataValue", null, 0, 1, XmlConversionValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlConversionValue_ObjectValue(), theXMLTypePackage.getString(), "objectValue", null, 0, 1, XmlConversionValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConverterEClass, XmlConverter.class, "XmlConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConverter_ClassName(), theXMLTypePackage.getString(), "className", null, 0, 1, XmlConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConverterHolderEClass, XmlConverterHolder.class, "XmlConverterHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlConverterHolder_Converter(), this.getXmlConverter(), null, "converter", null, 0, 1, XmlConverterHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConverterHolder_TypeConverter(), this.getXmlTypeConverter(), null, "typeConverter", null, 0, 1, XmlConverterHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConverterHolder_ObjectTypeConverter(), this.getXmlObjectTypeConverter(), null, "objectTypeConverter", null, 0, 1, XmlConverterHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConverterHolder_StructConverter(), this.getXmlStructConverter(), null, "structConverter", null, 0, 1, XmlConverterHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConvertersHolderEClass, XmlConvertersHolder.class, "XmlConvertersHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlConvertersHolder_Converters(), this.getXmlConverter(), null, "converters", null, 0, -1, XmlConvertersHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConvertersHolder_TypeConverters(), this.getXmlTypeConverter(), null, "typeConverters", null, 0, -1, XmlConvertersHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConvertersHolder_ObjectTypeConverters(), this.getXmlObjectTypeConverter(), null, "objectTypeConverters", null, 0, -1, XmlConvertersHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConvertersHolder_StructConverters(), this.getXmlStructConverter(), null, "structConverters", null, 0, -1, XmlConvertersHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConvertibleMappingEClass, XmlConvertibleMapping.class, "XmlConvertibleMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConvertibleMapping_Convert(), theXMLTypePackage.getString(), "convert", null, 0, 1, XmlConvertibleMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCopyPolicyEClass, XmlCopyPolicy.class, "XmlCopyPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCopyPolicy_Class(), theXMLTypePackage.getString(), "class", null, 0, 1, XmlCopyPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCustomizerEClass, XmlCustomizer.class, "XmlCustomizer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCustomizer_CustomizerClassName(), theXMLTypePackage.getString(), "customizerClassName", null, 0, 1, XmlCustomizer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCustomizerHolderEClass, XmlCustomizerHolder.class, "XmlCustomizerHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlCustomizerHolder_Customizer(), theOrmPackage.getXmlClassReference(), null, "customizer", null, 0, 1, XmlCustomizerHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollectionEClass, XmlElementCollection.class, "XmlElementCollection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddableEClass, XmlEmbeddable.class, "XmlEmbeddable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEmbeddable_CopyPolicy(), this.getXmlCopyPolicy(), null, "copyPolicy", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_InstantiationCopyPolicy(), this.getXmlInstantiationCopyPolicy(), null, "instantiationCopyPolicy", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_CloneCopyPolicy(), this.getXmlCloneCopyPolicy(), null, "cloneCopyPolicy", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEmbeddable_ExcludeDefaultMappings(), theXMLTypePackage.getBooleanObject(), "excludeDefaultMappings", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddedEClass, XmlEmbedded.class, "XmlEmbedded", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddedIdEClass, XmlEmbeddedId.class, "XmlEmbeddedId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEntityEClass, XmlEntity.class, "XmlEntity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_OptimisticLocking(), this.getXmlOptimisticLocking(), null, "optimisticLocking", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_CopyPolicy(), this.getXmlCopyPolicy(), null, "copyPolicy", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_InstantiationCopyPolicy(), this.getXmlInstantiationCopyPolicy(), null, "instantiationCopyPolicy", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_CloneCopyPolicy(), this.getXmlCloneCopyPolicy(), null, "cloneCopyPolicy", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_ExcludeDefaultMappings(), theXMLTypePackage.getBooleanObject(), "excludeDefaultMappings", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappingsEClass, XmlEntityMappings.class, "XmlEntityMappings", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlFetchAttributeEClass, XmlFetchAttribute.class, "XmlFetchAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlFetchGroupEClass, XmlFetchGroup.class, "XmlFetchGroup", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlHashPartitioningEClass, XmlHashPartitioning.class, "XmlHashPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlIdEClass, XmlId.class, "XmlId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlIndexEClass, XmlIndex.class, "XmlIndex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlInstantiationCopyPolicyEClass, XmlInstantiationCopyPolicy.class, "XmlInstantiationCopyPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlJoinFetchEClass, XmlJoinFetch.class, "XmlJoinFetch", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJoinFetch_JoinFetch(), this.getXmlJoinFetchType(), "joinFetch", null, 0, 1, XmlJoinFetch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinTableEClass, XmlJoinTable.class, "XmlJoinTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyEClass, XmlManyToMany.class, "XmlManyToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneEClass, XmlManyToOne.class, "XmlManyToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_OptimisticLocking(), this.getXmlOptimisticLocking(), null, "optimisticLocking", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_CopyPolicy(), this.getXmlCopyPolicy(), null, "copyPolicy", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_InstantiationCopyPolicy(), this.getXmlInstantiationCopyPolicy(), null, "instantiationCopyPolicy", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_CloneCopyPolicy(), this.getXmlCloneCopyPolicy(), null, "cloneCopyPolicy", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMappedSuperclass_ExcludeDefaultMappings(), theXMLTypePackage.getBooleanObject(), "excludeDefaultMappings", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultitenantEClass, XmlMultitenant.class, "XmlMultitenant", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMultitenantHolderEClass, XmlMultitenantHolder.class, "XmlMultitenantHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMultitenantHolder_Multitenant(), this.getXmlMultitenant(), null, "multitenant", null, 0, 1, XmlMultitenantHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMutableEClass, XmlMutable.class, "XmlMutable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMutable_Mutable(), theXMLTypePackage.getBooleanObject(), "mutable", null, 0, 1, XmlMutable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedConverterEClass, XmlNamedConverter.class, "XmlNamedConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedConverter_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedPlsqlStoredFunctionQueryEClass, XmlNamedPlsqlStoredFunctionQuery.class, "XmlNamedPlsqlStoredFunctionQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedPlsqlStoredProcedureQueryEClass, XmlNamedPlsqlStoredProcedureQuery.class, "XmlNamedPlsqlStoredProcedureQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedStoredFunctionQueryEClass, XmlNamedStoredFunctionQuery.class, "XmlNamedStoredFunctionQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedStoredProcedureQueryEClass, XmlNamedStoredProcedureQuery.class, "XmlNamedStoredProcedureQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedStoredProcedureQuery_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ResultClass(), theXMLTypePackage.getString(), "resultClass", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ResultSetMapping(), theXMLTypePackage.getString(), "resultSetMapping", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ProcedureName(), theXMLTypePackage.getString(), "procedureName", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ReturnsResultSet(), theXMLTypePackage.getBooleanObject(), "returnsResultSet", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlNamedStoredProcedureQuery_Hints(), theOrmPackage.getXmlQueryHint(), null, "hints", null, 0, -1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlNamedStoredProcedureQuery_Parameters(), this.getXmlStoredProcedureParameter(), null, "parameters", null, 0, -1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlObjectTypeConverterEClass, XmlObjectTypeConverter.class, "XmlObjectTypeConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlObjectTypeConverter_DataType(), theXMLTypePackage.getString(), "dataType", null, 0, 1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlObjectTypeConverter_ObjectType(), theXMLTypePackage.getString(), "objectType", null, 0, 1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlObjectTypeConverter_ConversionValues(), this.getXmlConversionValue(), null, "conversionValues", null, 0, -1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlObjectTypeConverter_DefaultObjectValue(), theXMLTypePackage.getString(), "defaultObjectValue", null, 0, 1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToManyEClass, XmlOneToMany.class, "XmlOneToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToOneEClass, XmlOneToOne.class, "XmlOneToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOptimisticLockingEClass, XmlOptimisticLocking.class, "XmlOptimisticLocking", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOptimisticLocking_Type(), this.getXmlOptimisticLockingType(), "type", null, 0, 1, XmlOptimisticLocking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOptimisticLocking_Cascade(), theXMLTypePackage.getBooleanObject(), "cascade", null, 0, 1, XmlOptimisticLocking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlOptimisticLocking_SelectedColumns(), theOrmPackage.getXmlColumn(), null, "selectedColumns", null, 0, -1, XmlOptimisticLocking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOrderColumnEClass, XmlOrderColumn.class, "XmlOrderColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPartitioningEClass, XmlPartitioning.class, "XmlPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPersistenceUnitDefaultsEClass, XmlPersistenceUnitDefaults.class, "XmlPersistenceUnitDefaults", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPersistenceUnitMetadataEClass, XmlPersistenceUnitMetadata.class, "XmlPersistenceUnitMetadata", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitMetadata_ExcludeDefaultMappings(), theXMLTypePackage.getBoolean(), "excludeDefaultMappings", null, 0, 1, XmlPersistenceUnitMetadata.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPinnedPartitioningEClass, XmlPinnedPartitioning.class, "XmlPinnedPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPlsqlRecordEClass, XmlPlsqlRecord.class, "XmlPlsqlRecord", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPlsqlTableEClass, XmlPlsqlTable.class, "XmlPlsqlTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrimaryKeyEClass, XmlPrimaryKey.class, "XmlPrimaryKey", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrivateOwnedEClass, XmlPrivateOwned.class, "XmlPrivateOwned", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrivateOwned_PrivateOwned(), theXMLTypePackage.getBoolean(), "privateOwned", null, 0, 1, XmlPrivateOwned.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPropertyEClass, XmlProperty.class, "XmlProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlProperty_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlProperty_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlProperty_ValueType(), theXMLTypePackage.getString(), "valueType", null, 0, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPropertyContainerEClass, XmlPropertyContainer.class, "XmlPropertyContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPropertyContainer_Properties(), this.getXmlProperty(), null, "properties", null, 0, -1, XmlPropertyContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryContainerEClass, XmlQueryContainer.class, "XmlQueryContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlQueryContainer_NamedStoredProcedureQueries(), this.getXmlNamedStoredProcedureQuery(), null, "namedStoredProcedureQueries", null, 0, -1, XmlQueryContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryRedirectorsEClass, XmlQueryRedirectors.class, "XmlQueryRedirectors", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlRangePartitioningEClass, XmlRangePartitioning.class, "XmlRangePartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlReadOnlyEClass, XmlReadOnly.class, "XmlReadOnly", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlReadOnly_ReadOnly(), theXMLTypePackage.getBooleanObject(), "readOnly", null, 0, 1, XmlReadOnly.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlReplicationPartitioningEClass, XmlReplicationPartitioning.class, "XmlReplicationPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlReturnInsertEClass, XmlReturnInsert.class, "XmlReturnInsert", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlRoundRobinPartitioningEClass, XmlRoundRobinPartitioning.class, "XmlRoundRobinPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlSecondaryTableEClass, XmlSecondaryTable.class, "XmlSecondaryTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlStoredProcedureParameterEClass, XmlStoredProcedureParameter.class, "XmlStoredProcedureParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlStoredProcedureParameter_Direction(), this.getXmlDirection(), "direction", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_QueryParameter(), theXMLTypePackage.getString(), "queryParameter", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_Type(), theXMLTypePackage.getString(), "type", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_JdbcType(), theXMLTypePackage.getIntObject(), "jdbcType", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_JdbcTypeName(), theXMLTypePackage.getString(), "jdbcTypeName", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStructEClass, XmlStruct.class, "XmlStruct", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlStructConverterEClass, XmlStructConverter.class, "XmlStructConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlStructConverter_Converter(), theXMLTypePackage.getString(), "converter", null, 0, 1, XmlStructConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStructureEClass, XmlStructure.class, "XmlStructure", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTableEClass, XmlTable.class, "XmlTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTableGeneratorEClass, XmlTableGenerator.class, "XmlTableGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTenantDiscriminatorColumnEClass, XmlTenantDiscriminatorColumn.class, "XmlTenantDiscriminatorColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTimeOfDayEClass, XmlTimeOfDay.class, "XmlTimeOfDay", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTimeOfDay_Hour(), theXMLTypePackage.getIntObject(), "hour", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTimeOfDay_Minute(), theXMLTypePackage.getIntObject(), "minute", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTimeOfDay_Second(), theXMLTypePackage.getIntObject(), "second", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTimeOfDay_Millisecond(), theXMLTypePackage.getIntObject(), "millisecond", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTransformationEClass, XmlTransformation.class, "XmlTransformation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransientEClass, XmlTransient.class, "XmlTransient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTypeConverterEClass, XmlTypeConverter.class, "XmlTypeConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTypeConverter_DataType(), theXMLTypePackage.getString(), "dataType", null, 0, 1, XmlTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTypeConverter_ObjectType(), theXMLTypePackage.getString(), "objectType", null, 0, 1, XmlTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlUnionPartitioningEClass, XmlUnionPartitioning.class, "XmlUnionPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlValuePartitioningEClass, XmlValuePartitioning.class, "XmlValuePartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVariableOneToOneEClass, XmlVariableOneToOne.class, "XmlVariableOneToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVersionEClass, XmlVersion.class, "XmlVersion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- // Initialize enums and add enum literals
- initEEnum(cacheCoordinationTypeEEnum, CacheCoordinationType.class, "CacheCoordinationType");
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.SEND_OBJECT_CHANGES);
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.NONE);
-
- initEEnum(cacheTypeEEnum, CacheType.class, "CacheType");
- addEEnumLiteral(cacheTypeEEnum, CacheType.FULL);
- addEEnumLiteral(cacheTypeEEnum, CacheType.WEAK);
- addEEnumLiteral(cacheTypeEEnum, CacheType.SOFT);
- addEEnumLiteral(cacheTypeEEnum, CacheType.SOFT_WEAK);
- addEEnumLiteral(cacheTypeEEnum, CacheType.HARD_WEAK);
- addEEnumLiteral(cacheTypeEEnum, CacheType.CACHE);
- addEEnumLiteral(cacheTypeEEnum, CacheType.NONE);
-
- initEEnum(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.class, "XmlChangeTrackingType");
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.ATTRIBUTE);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.OBJECT);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.DEFERRED);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.AUTO);
-
- initEEnum(xmlDirectionEEnum, XmlDirection.class, "XmlDirection");
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.IN);
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.OUT);
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.IN_OUT);
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.OUT_CURSOR);
-
- initEEnum(existenceTypeEEnum, ExistenceType.class, "ExistenceType");
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.CHECK_CACHE);
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.CHECK_DATABASE);
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.ASSUME_EXISTENCE);
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.ASSUME_NON_EXISTENCE);
-
- initEEnum(xmlJoinFetchTypeEEnum, XmlJoinFetchType.class, "XmlJoinFetchType");
- addEEnumLiteral(xmlJoinFetchTypeEEnum, XmlJoinFetchType.INNER);
- addEEnumLiteral(xmlJoinFetchTypeEEnum, XmlJoinFetchType.OUTER);
-
- initEEnum(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.class, "XmlOptimisticLockingType");
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.ALL_COLUMNS);
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.CHANGED_COLUMNS);
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.SELECTED_COLUMNS);
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.VERSION_COLUMN);
-
- // Create resource
- createResource(eNS_URI);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods()
- * @generated
- */
- public static final EClass XML_ACCESS_METHODS = eINSTANCE.getXmlAccessMethods();
-
- /**
- * The meta object literal for the '<em><b>Get Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ACCESS_METHODS__GET_METHOD = eINSTANCE.getXmlAccessMethods_GetMethod();
-
- /**
- * The meta object literal for the '<em><b>Set Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ACCESS_METHODS__SET_METHOD = eINSTANCE.getXmlAccessMethods_SetMethod();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder()
- * @generated
- */
- public static final EClass XML_ACCESS_METHODS_HOLDER = eINSTANCE.getXmlAccessMethodsHolder();
-
- /**
- * The meta object literal for the '<em><b>Access Methods</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS = eINSTANCE.getXmlAccessMethodsHolder_AccessMethods();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria <em>Xml Additional Criteria</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria()
- * @generated
- */
- public static final EClass XML_ADDITIONAL_CRITERIA = eINSTANCE.getXmlAdditionalCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray <em>Xml Array</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray()
- * @generated
- */
- public static final EClass XML_ARRAY = eINSTANCE.getXmlArray();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_MAPPING = eINSTANCE.getXmlAttributeMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @generated
- */
- public static final EClass ATTRIBUTES = eINSTANCE.getAttributes();
-
- /**
- * The meta object literal for the '<em><b>Basic Collections</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__BASIC_COLLECTIONS = eINSTANCE.getAttributes_BasicCollections();
-
- /**
- * The meta object literal for the '<em><b>Basic Maps</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__BASIC_MAPS = eINSTANCE.getAttributes_BasicMaps();
-
- /**
- * The meta object literal for the '<em><b>Transformations</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__TRANSFORMATIONS = eINSTANCE.getAttributes_Transformations();
-
- /**
- * The meta object literal for the '<em><b>Variable One To Ones</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__VARIABLE_ONE_TO_ONES = eINSTANCE.getAttributes_VariableOneToOnes();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @generated
- */
- public static final EClass XML_BASIC = eINSTANCE.getXmlBasic();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @generated
- */
- public static final EClass XML_BASIC_COLLECTION = eINSTANCE.getXmlBasicCollection();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @generated
- */
- public static final EClass XML_BASIC_MAP = eINSTANCE.getXmlBasicMap();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch()
- * @generated
- */
- public static final EClass XML_BATCH_FETCH = eINSTANCE.getXmlBatchFetch();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder()
- * @generated
- */
- public static final EClass XML_BATCH_FETCH_HOLDER = eINSTANCE.getXmlBatchFetchHolder();
-
- /**
- * The meta object literal for the '<em><b>Batch Fetch</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BATCH_FETCH_HOLDER__BATCH_FETCH = eINSTANCE.getXmlBatchFetchHolder_BatchFetch();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @generated
- */
- public static final EClass XML_CACHE = eINSTANCE.getXmlCache();
-
- /**
- * The meta object literal for the '<em><b>Expiry</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__EXPIRY = eINSTANCE.getXmlCache_Expiry();
-
- /**
- * The meta object literal for the '<em><b>Size</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__SIZE = eINSTANCE.getXmlCache_Size();
-
- /**
- * The meta object literal for the '<em><b>Shared</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__SHARED = eINSTANCE.getXmlCache_Shared();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__TYPE = eINSTANCE.getXmlCache_Type();
-
- /**
- * The meta object literal for the '<em><b>Always Refresh</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__ALWAYS_REFRESH = eINSTANCE.getXmlCache_AlwaysRefresh();
-
- /**
- * The meta object literal for the '<em><b>Refresh Only If Newer</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__REFRESH_ONLY_IF_NEWER = eINSTANCE.getXmlCache_RefreshOnlyIfNewer();
-
- /**
- * The meta object literal for the '<em><b>Disable Hits</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__DISABLE_HITS = eINSTANCE.getXmlCache_DisableHits();
-
- /**
- * The meta object literal for the '<em><b>Coordination Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__COORDINATION_TYPE = eINSTANCE.getXmlCache_CoordinationType();
-
- /**
- * The meta object literal for the '<em><b>Expiry Time Of Day</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CACHE__EXPIRY_TIME_OF_DAY = eINSTANCE.getXmlCache_ExpiryTimeOfDay();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder()
- * @generated
- */
- public static final EClass XML_CACHE_HOLDER = eINSTANCE.getXmlCacheHolder();
-
- /**
- * The meta object literal for the '<em><b>Cache</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CACHE_HOLDER__CACHE = eINSTANCE.getXmlCacheHolder_Cache();
-
- /**
- * The meta object literal for the '<em><b>Existence Checking</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_HOLDER__EXISTENCE_CHECKING = eINSTANCE.getXmlCacheHolder_ExistenceChecking();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex <em>Xml Cache Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex()
- * @generated
- */
- public static final EClass XML_CACHE_INDEX = eINSTANCE.getXmlCacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking()
- * @generated
- */
- public static final EClass XML_CHANGE_TRACKING = eINSTANCE.getXmlChangeTracking();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CHANGE_TRACKING__TYPE = eINSTANCE.getXmlChangeTracking_Type();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder()
- * @generated
- */
- public static final EClass XML_CHANGE_TRACKING_HOLDER = eINSTANCE.getXmlChangeTrackingHolder();
-
- /**
- * The meta object literal for the '<em><b>Change Tracking</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING = eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy()
- * @generated
- */
- public static final EClass XML_CLONE_COPY_POLICY = eINSTANCE.getXmlCloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CLONE_COPY_POLICY__METHOD = eINSTANCE.getXmlCloneCopyPolicy_Method();
-
- /**
- * The meta object literal for the '<em><b>Working Copy Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD = eINSTANCE.getXmlCloneCopyPolicy_WorkingCopyMethod();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable()
- * @generated
- */
- public static final EClass XML_COLLECTION_TABLE = eINSTANCE.getXmlCollectionTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue()
- * @generated
- */
- public static final EClass XML_CONVERSION_VALUE = eINSTANCE.getXmlConversionValue();
-
- /**
- * The meta object literal for the '<em><b>Data Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERSION_VALUE__DATA_VALUE = eINSTANCE.getXmlConversionValue_DataValue();
-
- /**
- * The meta object literal for the '<em><b>Object Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERSION_VALUE__OBJECT_VALUE = eINSTANCE.getXmlConversionValue_ObjectValue();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter()
- * @generated
- */
- public static final EClass XML_CONVERTER = eINSTANCE.getXmlConverter();
-
- /**
- * The meta object literal for the '<em><b>Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERTER__CLASS_NAME = eINSTANCE.getXmlConverter_ClassName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder <em>Xml Converter Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder()
- * @generated
- */
- public static final EClass XML_CONVERTER_HOLDER = eINSTANCE.getXmlConverterHolder();
-
- /**
- * The meta object literal for the '<em><b>Converter</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTER_HOLDER__CONVERTER = eINSTANCE.getXmlConverterHolder_Converter();
-
- /**
- * The meta object literal for the '<em><b>Type Converter</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTER_HOLDER__TYPE_CONVERTER = eINSTANCE.getXmlConverterHolder_TypeConverter();
-
- /**
- * The meta object literal for the '<em><b>Object Type Converter</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER = eINSTANCE.getXmlConverterHolder_ObjectTypeConverter();
-
- /**
- * The meta object literal for the '<em><b>Struct Converter</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTER_HOLDER__STRUCT_CONVERTER = eINSTANCE.getXmlConverterHolder_StructConverter();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder <em>Xml Converters Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder()
- * @generated
- */
- public static final EClass XML_CONVERTERS_HOLDER = eINSTANCE.getXmlConvertersHolder();
-
- /**
- * The meta object literal for the '<em><b>Converters</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTERS_HOLDER__CONVERTERS = eINSTANCE.getXmlConvertersHolder_Converters();
-
- /**
- * The meta object literal for the '<em><b>Type Converters</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTERS_HOLDER__TYPE_CONVERTERS = eINSTANCE.getXmlConvertersHolder_TypeConverters();
-
- /**
- * The meta object literal for the '<em><b>Object Type Converters</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS = eINSTANCE.getXmlConvertersHolder_ObjectTypeConverters();
-
- /**
- * The meta object literal for the '<em><b>Struct Converters</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS = eINSTANCE.getXmlConvertersHolder_StructConverters();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @generated
- */
- public static final EClass XML_CONVERTIBLE_MAPPING = eINSTANCE.getXmlConvertibleMapping();
-
- /**
- * The meta object literal for the '<em><b>Convert</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERTIBLE_MAPPING__CONVERT = eINSTANCE.getXmlConvertibleMapping_Convert();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy()
- * @generated
- */
- public static final EClass XML_COPY_POLICY = eINSTANCE.getXmlCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COPY_POLICY__CLASS = eINSTANCE.getXmlCopyPolicy_Class();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer()
- * @generated
- */
- public static final EClass XML_CUSTOMIZER = eINSTANCE.getXmlCustomizer();
-
- /**
- * The meta object literal for the '<em><b>Customizer Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME = eINSTANCE.getXmlCustomizer_CustomizerClassName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder()
- * @generated
- */
- public static final EClass XML_CUSTOMIZER_HOLDER = eINSTANCE.getXmlCustomizerHolder();
-
- /**
- * The meta object literal for the '<em><b>Customizer</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CUSTOMIZER_HOLDER__CUSTOMIZER = eINSTANCE.getXmlCustomizerHolder_Customizer();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION = eINSTANCE.getXmlElementCollection();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE = eINSTANCE.getXmlEmbeddable();
-
- /**
- * The meta object literal for the '<em><b>Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE__COPY_POLICY = eINSTANCE.getXmlEmbeddable_CopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Instantiation Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlEmbeddable_InstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Clone Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE__CLONE_COPY_POLICY = eINSTANCE.getXmlEmbeddable_CloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlEmbeddable_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final EClass XML_EMBEDDED = eINSTANCE.getXmlEmbedded();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final EClass XML_EMBEDDED_ID = eINSTANCE.getXmlEmbeddedId();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @generated
- */
- public static final EClass XML_ENTITY = eINSTANCE.getXmlEntity();
-
- /**
- * The meta object literal for the '<em><b>Optimistic Locking</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__OPTIMISTIC_LOCKING = eINSTANCE.getXmlEntity_OptimisticLocking();
-
- /**
- * The meta object literal for the '<em><b>Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__COPY_POLICY = eINSTANCE.getXmlEntity_CopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Instantiation Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlEntity_InstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Clone Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__CLONE_COPY_POLICY = eINSTANCE.getXmlEntity_CloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlEntity_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS = eINSTANCE.getXmlEntityMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute()
- * @generated
- */
- public static final EClass XML_FETCH_ATTRIBUTE = eINSTANCE.getXmlFetchAttribute();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup()
- * @generated
- */
- public static final EClass XML_FETCH_GROUP = eINSTANCE.getXmlFetchGroup();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @generated
- */
- public static final EClass XML_ID = eINSTANCE.getXmlId();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex <em>Xml Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex()
- * @generated
- */
- public static final EClass XML_INDEX = eINSTANCE.getXmlIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlInstantiationCopyPolicy()
- * @generated
- */
- public static final EClass XML_INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlInstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch()
- * @generated
- */
- public static final EClass XML_JOIN_FETCH = eINSTANCE.getXmlJoinFetch();
-
- /**
- * The meta object literal for the '<em><b>Join Fetch</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JOIN_FETCH__JOIN_FETCH = eINSTANCE.getXmlJoinFetch_JoinFetch();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE = eINSTANCE.getXmlJoinTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY = eINSTANCE.getXmlManyToMany();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE = eINSTANCE.getXmlManyToOne();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
-
- /**
- * The meta object literal for the '<em><b>Optimistic Locking</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING = eINSTANCE.getXmlMappedSuperclass_OptimisticLocking();
-
- /**
- * The meta object literal for the '<em><b>Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__COPY_POLICY = eINSTANCE.getXmlMappedSuperclass_CopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Instantiation Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlMappedSuperclass_InstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Clone Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY = eINSTANCE.getXmlMappedSuperclass_CloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant <em>Xml Multitenant</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant()
- * @generated
- */
- public static final EClass XML_MULTITENANT = eINSTANCE.getXmlMultitenant();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder <em>Xml Multitenant Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder()
- * @generated
- */
- public static final EClass XML_MULTITENANT_HOLDER = eINSTANCE.getXmlMultitenantHolder();
-
- /**
- * The meta object literal for the '<em><b>Multitenant</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTITENANT_HOLDER__MULTITENANT = eINSTANCE.getXmlMultitenantHolder_Multitenant();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable()
- * @generated
- */
- public static final EClass XML_MUTABLE = eINSTANCE.getXmlMutable();
-
- /**
- * The meta object literal for the '<em><b>Mutable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MUTABLE__MUTABLE = eINSTANCE.getXmlMutable_Mutable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter()
- * @generated
- */
- public static final EClass XML_NAMED_CONVERTER = eINSTANCE.getXmlNamedConverter();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_CONVERTER__NAME = eINSTANCE.getXmlNamedConverter_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery <em>Xml Named Plsql Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_FUNCTION_QUERY = eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery <em>Xml Named Plsql Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY = eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery <em>Xml Named Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery()
- * @generated
- */
- public static final EClass XML_NAMED_STORED_FUNCTION_QUERY = eINSTANCE.getXmlNamedStoredFunctionQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public static final EClass XML_NAMED_STORED_PROCEDURE_QUERY = eINSTANCE.getXmlNamedStoredProcedureQuery();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__NAME = eINSTANCE.getXmlNamedStoredProcedureQuery_Name();
-
- /**
- * The meta object literal for the '<em><b>Result Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS = eINSTANCE.getXmlNamedStoredProcedureQuery_ResultClass();
-
- /**
- * The meta object literal for the '<em><b>Result Set Mapping</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING = eINSTANCE.getXmlNamedStoredProcedureQuery_ResultSetMapping();
-
- /**
- * The meta object literal for the '<em><b>Procedure Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME = eINSTANCE.getXmlNamedStoredProcedureQuery_ProcedureName();
-
- /**
- * The meta object literal for the '<em><b>Returns Result Set</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET = eINSTANCE.getXmlNamedStoredProcedureQuery_ReturnsResultSet();
-
- /**
- * The meta object literal for the '<em><b>Hints</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_NAMED_STORED_PROCEDURE_QUERY__HINTS = eINSTANCE.getXmlNamedStoredProcedureQuery_Hints();
-
- /**
- * The meta object literal for the '<em><b>Parameters</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS = eINSTANCE.getXmlNamedStoredProcedureQuery_Parameters();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter()
- * @generated
- */
- public static final EClass XML_OBJECT_TYPE_CONVERTER = eINSTANCE.getXmlObjectTypeConverter();
-
- /**
- * The meta object literal for the '<em><b>Data Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OBJECT_TYPE_CONVERTER__DATA_TYPE = eINSTANCE.getXmlObjectTypeConverter_DataType();
-
- /**
- * The meta object literal for the '<em><b>Object Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE = eINSTANCE.getXmlObjectTypeConverter_ObjectType();
-
- /**
- * The meta object literal for the '<em><b>Conversion Values</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES = eINSTANCE.getXmlObjectTypeConverter_ConversionValues();
-
- /**
- * The meta object literal for the '<em><b>Default Object Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = eINSTANCE.getXmlObjectTypeConverter_DefaultObjectValue();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY = eINSTANCE.getXmlOneToMany();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE = eINSTANCE.getXmlOneToOne();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking()
- * @generated
- */
- public static final EClass XML_OPTIMISTIC_LOCKING = eINSTANCE.getXmlOptimisticLocking();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OPTIMISTIC_LOCKING__TYPE = eINSTANCE.getXmlOptimisticLocking_Type();
-
- /**
- * The meta object literal for the '<em><b>Cascade</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OPTIMISTIC_LOCKING__CASCADE = eINSTANCE.getXmlOptimisticLocking_Cascade();
-
- /**
- * The meta object literal for the '<em><b>Selected Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS = eINSTANCE.getXmlOptimisticLocking_SelectedColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @generated
- */
- public static final EClass XML_ORDER_COLUMN = eINSTANCE.getXmlOrderColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getXmlPersistenceUnitDefaults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_METADATA = eINSTANCE.getXmlPersistenceUnitMetadata();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlPersistenceUnitMetadata_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY = eINSTANCE.getXmlPrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned()
- * @generated
- */
- public static final EClass XML_PRIVATE_OWNED = eINSTANCE.getXmlPrivateOwned();
-
- /**
- * The meta object literal for the '<em><b>Private Owned</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIVATE_OWNED__PRIVATE_OWNED = eINSTANCE.getXmlPrivateOwned_PrivateOwned();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty()
- * @generated
- */
- public static final EClass XML_PROPERTY = eINSTANCE.getXmlProperty();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__NAME = eINSTANCE.getXmlProperty_Name();
-
- /**
- * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__VALUE = eINSTANCE.getXmlProperty_Value();
-
- /**
- * The meta object literal for the '<em><b>Value Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__VALUE_TYPE = eINSTANCE.getXmlProperty_ValueType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer()
- * @generated
- */
- public static final EClass XML_PROPERTY_CONTAINER = eINSTANCE.getXmlPropertyContainer();
-
- /**
- * The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PROPERTY_CONTAINER__PROPERTIES = eINSTANCE.getXmlPropertyContainer_Properties();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer()
- * @generated
- */
- public static final EClass XML_QUERY_CONTAINER = eINSTANCE.getXmlQueryContainer();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors()
- * @generated
- */
- public static final EClass XML_QUERY_REDIRECTORS = eINSTANCE.getXmlQueryRedirectors();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly()
- * @generated
- */
- public static final EClass XML_READ_ONLY = eINSTANCE.getXmlReadOnly();
-
- /**
- * The meta object literal for the '<em><b>Read Only</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_READ_ONLY__READ_ONLY = eINSTANCE.getXmlReadOnly_ReadOnly();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert()
- * @generated
- */
- public static final EClass XML_RETURN_INSERT = eINSTANCE.getXmlReturnInsert();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE = eINSTANCE.getXmlSecondaryTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter()
- * @generated
- */
- public static final EClass XML_STORED_PROCEDURE_PARAMETER = eINSTANCE.getXmlStoredProcedureParameter();
-
- /**
- * The meta object literal for the '<em><b>Direction</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__DIRECTION = eINSTANCE.getXmlStoredProcedureParameter_Direction();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__NAME = eINSTANCE.getXmlStoredProcedureParameter_Name();
-
- /**
- * The meta object literal for the '<em><b>Query Parameter</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER = eINSTANCE.getXmlStoredProcedureParameter_QueryParameter();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__TYPE = eINSTANCE.getXmlStoredProcedureParameter_Type();
-
- /**
- * The meta object literal for the '<em><b>Jdbc Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE = eINSTANCE.getXmlStoredProcedureParameter_JdbcType();
-
- /**
- * The meta object literal for the '<em><b>Jdbc Type Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME = eINSTANCE.getXmlStoredProcedureParameter_JdbcTypeName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct <em>Xml Struct</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct()
- * @generated
- */
- public static final EClass XML_STRUCT = eINSTANCE.getXmlStruct();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter()
- * @generated
- */
- public static final EClass XML_STRUCT_CONVERTER = eINSTANCE.getXmlStructConverter();
-
- /**
- * The meta object literal for the '<em><b>Converter</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STRUCT_CONVERTER__CONVERTER = eINSTANCE.getXmlStructConverter_Converter();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure <em>Xml Structure</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructure()
- * @generated
- */
- public static final EClass XML_STRUCTURE = eINSTANCE.getXmlStructure();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable()
- * @generated
- */
- public static final EClass XML_TABLE = eINSTANCE.getXmlTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR = eINSTANCE.getXmlTableGenerator();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn <em>Xml Tenant Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn()
- * @generated
- */
- public static final EClass XML_TENANT_DISCRIMINATOR_COLUMN = eINSTANCE.getXmlTenantDiscriminatorColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay()
- * @generated
- */
- public static final EClass XML_TIME_OF_DAY = eINSTANCE.getXmlTimeOfDay();
-
- /**
- * The meta object literal for the '<em><b>Hour</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__HOUR = eINSTANCE.getXmlTimeOfDay_Hour();
-
- /**
- * The meta object literal for the '<em><b>Minute</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__MINUTE = eINSTANCE.getXmlTimeOfDay_Minute();
-
- /**
- * The meta object literal for the '<em><b>Second</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__SECOND = eINSTANCE.getXmlTimeOfDay_Second();
-
- /**
- * The meta object literal for the '<em><b>Millisecond</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__MILLISECOND = eINSTANCE.getXmlTimeOfDay_Millisecond();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @generated
- */
- public static final EClass XML_TRANSFORMATION = eINSTANCE.getXmlTransformation();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @generated
- */
- public static final EClass XML_TRANSIENT = eINSTANCE.getXmlTransient();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter()
- * @generated
- */
- public static final EClass XML_TYPE_CONVERTER = eINSTANCE.getXmlTypeConverter();
-
- /**
- * The meta object literal for the '<em><b>Data Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TYPE_CONVERTER__DATA_TYPE = eINSTANCE.getXmlTypeConverter_DataType();
-
- /**
- * The meta object literal for the '<em><b>Object Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TYPE_CONVERTER__OBJECT_TYPE = eINSTANCE.getXmlTypeConverter_ObjectType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @generated
- */
- public static final EClass XML_VARIABLE_ONE_TO_ONE = eINSTANCE.getXmlVariableOneToOne();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @generated
- */
- public static final EClass XML_VERSION = eINSTANCE.getXmlVersion();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning <em>Xml Hash Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning()
- * @generated
- */
- public static final EClass XML_HASH_PARTITIONING = eINSTANCE.getXmlHashPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning <em>Xml Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning()
- * @generated
- */
- public static final EClass XML_PARTITIONING = eINSTANCE.getXmlPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning <em>Xml Pinned Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning()
- * @generated
- */
- public static final EClass XML_PINNED_PARTITIONING = eINSTANCE.getXmlPinnedPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord <em>Xml Plsql Record</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord()
- * @generated
- */
- public static final EClass XML_PLSQL_RECORD = eINSTANCE.getXmlPlsqlRecord();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable <em>Xml Plsql Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable()
- * @generated
- */
- public static final EClass XML_PLSQL_TABLE = eINSTANCE.getXmlPlsqlTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning <em>Xml Range Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning()
- * @generated
- */
- public static final EClass XML_RANGE_PARTITIONING = eINSTANCE.getXmlRangePartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning <em>Xml Replication Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning()
- * @generated
- */
- public static final EClass XML_REPLICATION_PARTITIONING = eINSTANCE.getXmlReplicationPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning <em>Xml Round Robin Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning()
- * @generated
- */
- public static final EClass XML_ROUND_ROBIN_PARTITIONING = eINSTANCE.getXmlRoundRobinPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning <em>Xml Union Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning()
- * @generated
- */
- public static final EClass XML_UNION_PARTITIONING = eINSTANCE.getXmlUnionPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning <em>Xml Value Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning()
- * @generated
- */
- public static final EClass XML_VALUE_PARTITIONING = eINSTANCE.getXmlValuePartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType()
- * @generated
- */
- public static final EEnum CACHE_COORDINATION_TYPE = eINSTANCE.getCacheCoordinationType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType()
- * @generated
- */
- public static final EEnum CACHE_TYPE = eINSTANCE.getCacheType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType()
- * @generated
- */
- public static final EEnum XML_CHANGE_TRACKING_TYPE = eINSTANCE.getXmlChangeTrackingType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlDirection()
- * @generated
- */
- public static final EEnum XML_DIRECTION = eINSTANCE.getXmlDirection();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType()
- * @generated
- */
- public static final EEnum EXISTENCE_TYPE = eINSTANCE.getExistenceType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType()
- * @generated
- */
- public static final EEnum XML_JOIN_FETCH_TYPE = eINSTANCE.getXmlJoinFetchType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLockingType()
- * @generated
- */
- public static final EEnum XML_OPTIMISTIC_LOCKING_TYPE = eINSTANCE.getXmlOptimisticLockingType();
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java
deleted file mode 100644
index 57154bbb46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceFactory;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkOrmXmlResourceFactory extends TranslatorResourceFactory
-{
- public EclipseLinkOrmXmlResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public EclipseLinkOrmXmlResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public EclipseLinkOrmXmlResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
-
- /**
- * @see TranslatorResourceFactory#createResource(URI, Renderer)
- */
- @Override
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new JpaXmlResource(uri, renderer, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, XmlEntityMappings.getRootTranslator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java
deleted file mode 100644
index a89707ed20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Existence Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType()
- * @model
- * @generated
- */
-public enum ExistenceType implements Enumerator
-{
- /**
- * The '<em><b>CHECK CACHE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHECK_CACHE_VALUE
- * @generated
- * @ordered
- */
- CHECK_CACHE(0, "CHECK_CACHE", "CHECK_CACHE"),
-
- /**
- * The '<em><b>CHECK DATABASE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHECK_DATABASE_VALUE
- * @generated
- * @ordered
- */
- CHECK_DATABASE(1, "CHECK_DATABASE", "CHECK_DATABASE"),
-
- /**
- * The '<em><b>ASSUME EXISTENCE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ASSUME_EXISTENCE_VALUE
- * @generated
- * @ordered
- */
- ASSUME_EXISTENCE(2, "ASSUME_EXISTENCE", "ASSUME_EXISTENCE"),
-
- /**
- * The '<em><b>ASSUME NON EXISTENCE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ASSUME_NON_EXISTENCE_VALUE
- * @generated
- * @ordered
- */
- ASSUME_NON_EXISTENCE(3, "ASSUME_NON_EXISTENCE", "ASSUME_NON_EXISTENCE");
-
- /**
- * The '<em><b>CHECK CACHE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHECK CACHE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHECK_CACHE
- * @model
- * @generated
- * @ordered
- */
- public static final int CHECK_CACHE_VALUE = 0;
-
- /**
- * The '<em><b>CHECK DATABASE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHECK DATABASE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHECK_DATABASE
- * @model
- * @generated
- * @ordered
- */
- public static final int CHECK_DATABASE_VALUE = 1;
-
- /**
- * The '<em><b>ASSUME EXISTENCE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ASSUME EXISTENCE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ASSUME_EXISTENCE
- * @model
- * @generated
- * @ordered
- */
- public static final int ASSUME_EXISTENCE_VALUE = 2;
-
- /**
- * The '<em><b>ASSUME NON EXISTENCE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ASSUME NON EXISTENCE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ASSUME_NON_EXISTENCE
- * @model
- * @generated
- * @ordered
- */
- public static final int ASSUME_NON_EXISTENCE_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Existence Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final ExistenceType[] VALUES_ARRAY =
- new ExistenceType[]
- {
- CHECK_CACHE,
- CHECK_DATABASE,
- ASSUME_EXISTENCE,
- ASSUME_NON_EXISTENCE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Existence Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<ExistenceType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Existence Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static ExistenceType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- ExistenceType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Existence Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static ExistenceType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- ExistenceType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Existence Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static ExistenceType get(int value)
- {
- switch (value)
- {
- case CHECK_CACHE_VALUE: return CHECK_CACHE;
- case CHECK_DATABASE_VALUE: return CHECK_DATABASE;
- case ASSUME_EXISTENCE_VALUE: return ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE_VALUE: return ASSUME_NON_EXISTENCE;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private ExistenceType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //ExistenceType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java
deleted file mode 100644
index afbd13c1f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Access Methods</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod <em>Get Method</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod <em>Set Method</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlAccessMethods extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getGetMethod() <em>Get Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGetMethod()
- * @generated
- * @ordered
- */
- protected static final String GET_METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getGetMethod() <em>Get Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGetMethod()
- * @generated
- * @ordered
- */
- protected String getMethod = GET_METHOD_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSetMethod() <em>Set Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSetMethod()
- * @generated
- * @ordered
- */
- protected static final String SET_METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSetMethod() <em>Set Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSetMethod()
- * @generated
- * @ordered
- */
- protected String setMethod = SET_METHOD_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAccessMethods()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ACCESS_METHODS;
- }
-
- /**
- * Returns the value of the '<em><b>Get Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Get Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Get Method</em>' attribute.
- * @see #setGetMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods_GetMethod()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getGetMethod()
- {
- return getMethod;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod <em>Get Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Get Method</em>' attribute.
- * @see #getGetMethod()
- * @generated
- */
- public void setGetMethod(String newGetMethod)
- {
- String oldGetMethod = getMethod;
- getMethod = newGetMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD, oldGetMethod, getMethod));
- }
-
- /**
- * Returns the value of the '<em><b>Set Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Set Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Set Method</em>' attribute.
- * @see #setSetMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods_SetMethod()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSetMethod()
- {
- return setMethod;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod <em>Set Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Set Method</em>' attribute.
- * @see #getSetMethod()
- * @generated
- */
- public void setSetMethod(String newSetMethod)
- {
- String oldSetMethod = setMethod;
- setMethod = newSetMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD, oldSetMethod, setMethod));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- return getGetMethod();
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- return getSetMethod();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- setGetMethod((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- setSetMethod((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- setGetMethod(GET_METHOD_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- setSetMethod(SET_METHOD_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- return GET_METHOD_EDEFAULT == null ? getMethod != null : !GET_METHOD_EDEFAULT.equals(getMethod);
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- return SET_METHOD_EDEFAULT == null ? setMethod != null : !SET_METHOD_EDEFAULT.equals(setMethod);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (getMethod: ");
- result.append(getMethod);
- result.append(", setMethod: ");
- result.append(setMethod);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethods(),
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildGetMethodTranslator(),
- buildSetMethodTranslator(),
- };
- }
-
- protected static Translator buildGetMethodTranslator() {
- return new Translator(EclipseLink.ACCESS_METHODS__GET_METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethods_GetMethod(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSetMethodTranslator() {
- return new Translator(EclipseLink.ACCESS_METHODS__SET_METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethods_SetMethod(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlAccessMethods
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java
deleted file mode 100644
index 6e33a0f918..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Access Methods Holder</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods <em>Access Methods</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAccessMethodsHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- XmlAccessMethods getAccessMethods();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- void setAccessMethods(XmlAccessMethods value);
-
-} // XmlAccessMethodsHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java
deleted file mode 100644
index 15d23edb6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Additional Criteria</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria()
- * @model kind="class"
- * @generated
- */
-public class XmlAdditionalCriteria extends AbstractJpaEObject implements XmlAdditionalCriteria_2_2
-{
- /**
- * The default value of the '{@link #getCriteria() <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCriteria()
- * @generated
- * @ordered
- */
- protected static final String CRITERIA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCriteria() <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCriteria()
- * @generated
- * @ordered
- */
- protected String criteria = CRITERIA_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAdditionalCriteria()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ADDITIONAL_CRITERIA;
- }
-
- /**
- * Returns the value of the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Criteria</em>' attribute.
- * @see #setCriteria(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria_2_2_Criteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCriteria()
- {
- return criteria;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria#getCriteria <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Criteria</em>' attribute.
- * @see #getCriteria()
- * @generated
- */
- public void setCriteria(String newCriteria)
- {
- String oldCriteria = criteria;
- criteria = newCriteria;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA, oldCriteria, criteria));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- return getCriteria();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- setCriteria((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- setCriteria(CRITERIA_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- return CRITERIA_EDEFAULT == null ? criteria != null : !CRITERIA_EDEFAULT.equals(criteria);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (criteria: ");
- result.append(criteria);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlAdditionalCriteria(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildCriteriaTranslator()
- };
- }
-
- protected static Translator buildCriteriaTranslator() {
- return new Translator(EclipseLink2_2.CRITERIA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlAdditionalCriteria_2_2_Criteria());
- }
-
-} // XmlAdditionalCriteria
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java
deleted file mode 100644
index f020629619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Array</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray()
- * @model kind="class"
- * @generated
- */
-public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlArray_2_3
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlArray()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ARRAY;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- return getProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlArray_2_3.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlArray_2_3.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.ARRAY_ATTRIBUTE_MAPPING_KEY;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlArray(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator()
- };
- }
-} // XmlArray
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java
deleted file mode 100644
index bf5a017b56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Attribute Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlAttributeMapping
- extends org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping,
- XmlAccessMethodsHolder, XmlPropertyContainer
-{
-} // XmlAttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java
deleted file mode 100644
index 2ed293aa9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java
+++ /dev/null
@@ -1,1693 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Basic</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @model kind="class"
- * @generated
- */
-public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic implements XmlBasic_1_1, XmlBasic_2_1, XmlBasic_2_2, XmlBasic_2_4, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping
-{
- /**
- * The cached value of the '{@link #getSequenceGenerator() <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerator()
- * @generated
- * @ordered
- */
- protected XmlSequenceGenerator sequenceGenerator;
- /**
- * The cached value of the '{@link #getTableGenerator() <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerator()
- * @generated
- * @ordered
- */
- protected XmlTableGenerator tableGenerator;
- /**
- * The cached value of the '{@link #getGeneratedValue() <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGeneratedValue()
- * @generated
- * @ordered
- */
- protected XmlGeneratedValue generatedValue;
-
- /**
- * The cached value of the '{@link #getReturnInsert() <em>Return Insert</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnInsert()
- * @generated
- * @ordered
- */
- protected XmlReturnInsert returnInsert;
- /**
- * The default value of the '{@link #getReturnUpdate() <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnUpdate()
- * @generated
- * @ordered
- */
- protected static final Boolean RETURN_UPDATE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getReturnUpdate() <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnUpdate()
- * @generated
- * @ordered
- */
- protected Boolean returnUpdate = RETURN_UPDATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
- /**
- * The default value of the '{@link #getMutable() <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMutable()
- * @generated
- * @ordered
- */
- protected static final Boolean MUTABLE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getMutable() <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMutable()
- * @generated
- * @ordered
- */
- protected Boolean mutable = MUTABLE_EDEFAULT;
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected XmlConverter converter;
- /**
- * The cached value of the '{@link #getTypeConverter() <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlTypeConverter typeConverter;
- /**
- * The cached value of the '{@link #getObjectTypeConverter() <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlObjectTypeConverter objectTypeConverter;
- /**
- * The cached value of the '{@link #getStructConverter() <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverter()
- * @generated
- * @ordered
- */
- protected XmlStructConverter structConverter;
- /**
- * The default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasic()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC;
- }
-
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMutable()
- {
- return mutable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- public void setMutable(Boolean newMutable)
- {
- Boolean oldMutable = mutable;
- mutable = newMutable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__MUTABLE, oldMutable, mutable));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generator</em>' containment reference.
- * @see #setSequenceGenerator(XmlSequenceGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlSequenceGenerator getSequenceGenerator()
- {
- return sequenceGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetSequenceGenerator(XmlSequenceGenerator newSequenceGenerator, NotificationChain msgs)
- {
- XmlSequenceGenerator oldSequenceGenerator = sequenceGenerator;
- sequenceGenerator = newSequenceGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getSequenceGenerator <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Generator</em>' containment reference.
- * @see #getSequenceGenerator()
- * @generated
- */
- public void setSequenceGenerator(XmlSequenceGenerator newSequenceGenerator)
- {
- if (newSequenceGenerator != sequenceGenerator)
- {
- NotificationChain msgs = null;
- if (sequenceGenerator != null)
- msgs = ((InternalEObject)sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generator</em>' containment reference.
- * @see #setTableGenerator(XmlTableGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_TableGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlTableGenerator getTableGenerator()
- {
- return tableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTableGenerator(XmlTableGenerator newTableGenerator, NotificationChain msgs)
- {
- XmlTableGenerator oldTableGenerator = tableGenerator;
- tableGenerator = newTableGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getTableGenerator <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table Generator</em>' containment reference.
- * @see #getTableGenerator()
- * @generated
- */
- public void setTableGenerator(XmlTableGenerator newTableGenerator)
- {
- if (newTableGenerator != tableGenerator)
- {
- NotificationChain msgs = null;
- if (tableGenerator != null)
- msgs = ((InternalEObject)tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, newTableGenerator, newTableGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generated Value</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generated Value</em>' containment reference.
- * @see #setGeneratedValue(XmlGeneratedValue)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_1_1_GeneratedValue()
- * @model containment="true"
- * @generated
- */
- public XmlGeneratedValue getGeneratedValue()
- {
- return generatedValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetGeneratedValue(XmlGeneratedValue newGeneratedValue, NotificationChain msgs)
- {
- XmlGeneratedValue oldGeneratedValue = generatedValue;
- generatedValue = newGeneratedValue;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, oldGeneratedValue, newGeneratedValue);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getGeneratedValue <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generated Value</em>' containment reference.
- * @see #getGeneratedValue()
- * @generated
- */
- public void setGeneratedValue(XmlGeneratedValue newGeneratedValue)
- {
- if (newGeneratedValue != generatedValue)
- {
- NotificationChain msgs = null;
- if (generatedValue != null)
- msgs = ((InternalEObject)generatedValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, null, msgs);
- if (newGeneratedValue != null)
- msgs = ((InternalEObject)newGeneratedValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, null, msgs);
- msgs = basicSetGeneratedValue(newGeneratedValue, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, newGeneratedValue, newGeneratedValue));
- }
-
- /**
- * Returns the value of the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Insert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Insert</em>' containment reference.
- * @see #setReturnInsert(XmlReturnInsert)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_1_ReturnInsert()
- * @model containment="true"
- * @generated
- */
- public XmlReturnInsert getReturnInsert()
- {
- return returnInsert;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReturnInsert(XmlReturnInsert newReturnInsert, NotificationChain msgs)
- {
- XmlReturnInsert oldReturnInsert = returnInsert;
- returnInsert = newReturnInsert;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, oldReturnInsert, newReturnInsert);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getReturnInsert <em>Return Insert</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Insert</em>' containment reference.
- * @see #getReturnInsert()
- * @generated
- */
- public void setReturnInsert(XmlReturnInsert newReturnInsert)
- {
- if (newReturnInsert != returnInsert)
- {
- NotificationChain msgs = null;
- if (returnInsert != null)
- msgs = ((InternalEObject)returnInsert).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, null, msgs);
- if (newReturnInsert != null)
- msgs = ((InternalEObject)newReturnInsert).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, null, msgs);
- msgs = basicSetReturnInsert(newReturnInsert, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, newReturnInsert, newReturnInsert));
- }
-
- /**
- * Returns the value of the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Update</em>' attribute.
- * @see #setReturnUpdate(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_1_ReturnUpdate()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReturnUpdate()
- {
- return returnUpdate;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getReturnUpdate <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Update</em>' attribute.
- * @see #getReturnUpdate()
- * @generated
- */
- public void setReturnUpdate(Boolean newReturnUpdate)
- {
- Boolean oldReturnUpdate = returnUpdate;
- returnUpdate = newReturnUpdate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE, oldReturnUpdate, returnUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_BASIC__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' containment reference.
- * @see #setConverter(XmlConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- public XmlConverter getConverter()
- {
- return converter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetConverter(XmlConverter newConverter, NotificationChain msgs)
- {
- XmlConverter oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CONVERTER, oldConverter, newConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getConverter <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' containment reference.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(XmlConverter newConverter)
- {
- if (newConverter != converter)
- {
- NotificationChain msgs = null;
- if (converter != null)
- msgs = ((InternalEObject)converter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CONVERTER, newConverter, newConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converter</em>' containment reference.
- * @see #setTypeConverter(XmlTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlTypeConverter getTypeConverter()
- {
- return typeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTypeConverter(XmlTypeConverter newTypeConverter, NotificationChain msgs)
- {
- XmlTypeConverter oldTypeConverter = typeConverter;
- typeConverter = newTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER, oldTypeConverter, newTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getTypeConverter <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Converter</em>' containment reference.
- * @see #getTypeConverter()
- * @generated
- */
- public void setTypeConverter(XmlTypeConverter newTypeConverter)
- {
- if (newTypeConverter != typeConverter)
- {
- NotificationChain msgs = null;
- if (typeConverter != null)
- msgs = ((InternalEObject)typeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER, null, msgs);
- msgs = basicSetTypeConverter(newTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER, newTypeConverter, newTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converter</em>' containment reference.
- * @see #setObjectTypeConverter(XmlObjectTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlObjectTypeConverter getObjectTypeConverter()
- {
- return objectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter, NotificationChain msgs)
- {
- XmlObjectTypeConverter oldObjectTypeConverter = objectTypeConverter;
- objectTypeConverter = newObjectTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER, oldObjectTypeConverter, newObjectTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getObjectTypeConverter <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type Converter</em>' containment reference.
- * @see #getObjectTypeConverter()
- * @generated
- */
- public void setObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter)
- {
- if (newObjectTypeConverter != objectTypeConverter)
- {
- NotificationChain msgs = null;
- if (objectTypeConverter != null)
- msgs = ((InternalEObject)objectTypeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER, null, msgs);
- msgs = basicSetObjectTypeConverter(newObjectTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER, newObjectTypeConverter, newObjectTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converter</em>' containment reference.
- * @see #setStructConverter(XmlStructConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- public XmlStructConverter getStructConverter()
- {
- return structConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStructConverter(XmlStructConverter newStructConverter, NotificationChain msgs)
- {
- XmlStructConverter oldStructConverter = structConverter;
- structConverter = newStructConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER, oldStructConverter, newStructConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getStructConverter <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct Converter</em>' containment reference.
- * @see #getStructConverter()
- * @generated
- */
- public void setStructConverter(XmlStructConverter newStructConverter)
- {
- if (newStructConverter != structConverter)
- {
- NotificationChain msgs = null;
- if (structConverter != null)
- msgs = ((InternalEObject)structConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER, null, msgs);
- msgs = basicSetStructConverter(newStructConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER, newStructConverter, newStructConverter));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- return basicSetGeneratedValue(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- return basicSetReturnInsert(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER:
- return basicSetStructConverter(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- return getTableGenerator();
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- return getGeneratedValue();
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- return getReturnInsert();
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- return getReturnUpdate();
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- return getConvert();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- setReturnInsert((XmlReturnInsert)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- setReturnUpdate((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- setConvert((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- setReturnInsert((XmlReturnInsert)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- setReturnUpdate(RETURN_UPDATE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- return tableGenerator != null;
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- return generatedValue != null;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- return returnInsert != null;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- return RETURN_UPDATE_EDEFAULT == null ? returnUpdate != null : !RETURN_UPDATE_EDEFAULT.equals(returnUpdate);
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_1_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE: return EclipseLinkOrmV1_1Package.XML_BASIC_11__GENERATED_VALUE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT: return EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_INSERT;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE: return EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_UPDATE;
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_BASIC_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__INDEX: return EclipseLinkOrmV2_2Package.XML_BASIC_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_BASIC_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR: return EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR;
- case OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR: return EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_1_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV1_1Package.XML_BASIC_11__GENERATED_VALUE: return EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_INSERT: return EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT;
- case EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_UPDATE: return EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE;
- case EclipseLinkOrmV2_1Package.XML_BASIC_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_BASIC_22__INDEX: return EclipseLinkOrmPackage.XML_BASIC__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_BASIC_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_BASIC__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_BASIC__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_BASIC__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_BASIC__CONVERT;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (returnUpdate: ");
- result.append(returnUpdate);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLink.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlBasic(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMutableTranslator(),
- buildAttributeTypeTranslator(),
- buildColumnTranslator(),
- buildIndexTranslator(),
- buildCacheIndexTranslator(),
- buildGeneratedValueTranslator(),
- buildLobTranslator(),
- buildTemporalTranslator(),
- buildEnumeratedTranslator(),
- buildConvertTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildTableGeneratorTranslator(),
- buildSequenceGeneratorTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildReturnInsertTranslator(),
- buildReturnUpdateTranslator()};
- }
-
- protected static Translator buildMutableTranslator() {
- return new Translator(EclipseLink.MUTABLE, EclipseLinkOrmPackage.eINSTANCE.getXmlMutable_Mutable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlBasic_2_2_Index());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlBasic_2_4_CacheIndex());
- }
-
- protected static Translator buildGeneratedValueTranslator() {
- return XmlGeneratedValue.buildTranslator(EclipseLink1_1.GENERATED_VALUE, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlBasic_1_1_GeneratedValue());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_Converter());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_TypeConverter());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_StructConverter());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator.buildTranslator(EclipseLink1_1.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- protected static Translator buildSequenceGeneratorTranslator() {
- return XmlSequenceGenerator.buildTranslator(EclipseLink1_1.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_SequenceGenerator());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildReturnInsertTranslator() {
- return XmlReturnInsert.buildTranslator(EclipseLink2_1.RETURN_INSERT, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBasic_2_1_ReturnInsert());
- }
-
- protected static Translator buildReturnUpdateTranslator() {
- return new Translator(EclipseLink2_1.RETURN_UPDATE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBasic_2_1_ReturnUpdate());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBasic_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java
deleted file mode 100644
index 66459fddc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Collection Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves. *
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicCollection extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlBasicCollection_2_2
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasicCollection()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC_COLLECTION;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBasicCollection_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBasicCollection_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java
deleted file mode 100644
index 224d0cfd39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Map Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves. *
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlBasicMap_2_2
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasicMap()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC_MAP;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBasicMap_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_BASIC_MAP_22__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBasicMap_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_BASIC_MAP_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java
deleted file mode 100644
index a7301e857d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xm Batch Fetch</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch()
- * @model kind="class"
- * @generated
- */
-public class XmlBatchFetch extends AbstractJpaEObject implements XmlBatchFetch_2_1
-{
- /**
- * The default value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected static final Integer SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected Integer size = SIZE_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final BatchFetchType_2_1 BATCH_FETCH_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getBatchFetchType() <em>Batch Fetch Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetchType()
- * @generated
- * @ordered
- */
- protected BatchFetchType_2_1 batchFetchType = BATCH_FETCH_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBatchFetch()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BATCH_FETCH;
- }
-
- /**
- * Returns the value of the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Size</em>' attribute.
- * @see #setSize(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch_2_1_Size()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getSize()
- {
- return size;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch#getSize <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Size</em>' attribute.
- * @see #getSize()
- * @generated
- */
- public void setSize(Integer newSize)
- {
- Integer oldSize = size;
- size = newSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE, oldSize, size));
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #setBatchFetchType(BatchFetchType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch_2_1_BatchFetchType()
- * @model
- * @generated
- */
- public BatchFetchType_2_1 getBatchFetchType()
- {
- return batchFetchType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch#getBatchFetchType <em>Batch Fetch Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #getBatchFetchType()
- * @generated
- */
- public void setBatchFetchType(BatchFetchType_2_1 newBatchFetchType)
- {
- BatchFetchType_2_1 oldBatchFetchType = batchFetchType;
- batchFetchType = newBatchFetchType == null ? BATCH_FETCH_TYPE_EDEFAULT : newBatchFetchType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE, oldBatchFetchType, batchFetchType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- return getSize();
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- return getBatchFetchType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- setSize((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- setBatchFetchType((BatchFetchType_2_1)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- setSize(SIZE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- setBatchFetchType(BATCH_FETCH_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- return SIZE_EDEFAULT == null ? size != null : !SIZE_EDEFAULT.equals(size);
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- return batchFetchType != BATCH_FETCH_TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (size: ");
- result.append(size);
- result.append(", batchFetchType: ");
- result.append(batchFetchType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildSizeTranslator(),
- buildBatchFetchTypeTranslator(),
- };
- }
-
- protected static Translator buildSizeTranslator() {
- return new Translator(EclipseLink2_1.BATCH_FETCH__SIZE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBatchFetch_2_1_Size(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildBatchFetchTypeTranslator() {
- return new Translator(EclipseLink2_1.BATCH_FETCH__TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBatchFetch_2_1_BatchFetchType(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmBatchFetch
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java
deleted file mode 100644
index a1b6747965..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Batch Fetch Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch <em>Batch Fetch</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBatchFetchHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- XmlBatchFetch getBatchFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- void setBatchFetch(XmlBatchFetch value);
-
-} // XmlBatchFetchHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java
deleted file mode 100644
index 3577450bd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java
+++ /dev/null
@@ -1,1029 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Cache</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry <em>Expiry</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize <em>Size</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared <em>Shared</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh <em>Always Refresh</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer <em>Refresh Only If Newer</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits <em>Disable Hits</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType <em>Coordination Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay <em>Expiry Time Of Day</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @model kind="class"
- * @generated
- */
-public class XmlCache extends AbstractJpaEObject implements XmlCache_2_2, XmlCache_2_4
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final CacheIsolationType ISOLATION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getIsolation() <em>Isolation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIsolation()
- * @generated
- * @ordered
- */
- protected CacheIsolationType isolation = ISOLATION_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final DatabaseChangeNotificationType DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDatabaseChangeNotificationType() <em>Database Change Notification Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDatabaseChangeNotificationType()
- * @generated
- * @ordered
- */
- protected DatabaseChangeNotificationType databaseChangeNotificationType = DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getExpiry() <em>Expiry</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpiry()
- * @generated
- * @ordered
- */
- protected static final Integer EXPIRY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExpiry() <em>Expiry</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpiry()
- * @generated
- * @ordered
- */
- protected Integer expiry = EXPIRY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected static final Integer SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected Integer size = SIZE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getShared() <em>Shared</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getShared()
- * @generated
- * @ordered
- */
- protected static final Boolean SHARED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getShared() <em>Shared</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getShared()
- * @generated
- * @ordered
- */
- protected Boolean shared = SHARED_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final CacheType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected CacheType type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAlwaysRefresh() <em>Always Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAlwaysRefresh()
- * @generated
- * @ordered
- */
- protected static final Boolean ALWAYS_REFRESH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAlwaysRefresh() <em>Always Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAlwaysRefresh()
- * @generated
- * @ordered
- */
- protected Boolean alwaysRefresh = ALWAYS_REFRESH_EDEFAULT;
-
- /**
- * The default value of the '{@link #getRefreshOnlyIfNewer() <em>Refresh Only If Newer</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRefreshOnlyIfNewer()
- * @generated
- * @ordered
- */
- protected static final Boolean REFRESH_ONLY_IF_NEWER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getRefreshOnlyIfNewer() <em>Refresh Only If Newer</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRefreshOnlyIfNewer()
- * @generated
- * @ordered
- */
- protected Boolean refreshOnlyIfNewer = REFRESH_ONLY_IF_NEWER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDisableHits() <em>Disable Hits</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDisableHits()
- * @generated
- * @ordered
- */
- protected static final Boolean DISABLE_HITS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDisableHits() <em>Disable Hits</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDisableHits()
- * @generated
- * @ordered
- */
- protected Boolean disableHits = DISABLE_HITS_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final CacheCoordinationType COORDINATION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCoordinationType() <em>Coordination Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCoordinationType()
- * @generated
- * @ordered
- */
- protected CacheCoordinationType coordinationType = COORDINATION_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getExpiryTimeOfDay() <em>Expiry Time Of Day</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpiryTimeOfDay()
- * @generated
- * @ordered
- */
- protected XmlTimeOfDay expiryTimeOfDay;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCache()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CACHE;
- }
-
- /**
- * Returns the value of the '<em><b>Isolation</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Isolation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #setIsolation(CacheIsolationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_2_2_Isolation()
- * @model default=""
- * @generated
- */
- public CacheIsolationType getIsolation()
- {
- return isolation;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getIsolation <em>Isolation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #getIsolation()
- * @generated
- */
- public void setIsolation(CacheIsolationType newIsolation)
- {
- CacheIsolationType oldIsolation = isolation;
- isolation = newIsolation == null ? ISOLATION_EDEFAULT : newIsolation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__ISOLATION, oldIsolation, isolation));
- }
-
- /**
- * Returns the value of the '<em><b>Database Change Notification Type</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Database Change Notification Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #setDatabaseChangeNotificationType(DatabaseChangeNotificationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_2_4_DatabaseChangeNotificationType()
- * @model default=""
- * @generated
- */
- public DatabaseChangeNotificationType getDatabaseChangeNotificationType()
- {
- return databaseChangeNotificationType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #getDatabaseChangeNotificationType()
- * @generated
- */
- public void setDatabaseChangeNotificationType(DatabaseChangeNotificationType newDatabaseChangeNotificationType)
- {
- DatabaseChangeNotificationType oldDatabaseChangeNotificationType = databaseChangeNotificationType;
- databaseChangeNotificationType = newDatabaseChangeNotificationType == null ? DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT : newDatabaseChangeNotificationType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE, oldDatabaseChangeNotificationType, databaseChangeNotificationType));
- }
-
- /**
- * Returns the value of the '<em><b>Expiry</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Expiry</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Expiry</em>' attribute.
- * @see #setExpiry(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Expiry()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getExpiry()
- {
- return expiry;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry <em>Expiry</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Expiry</em>' attribute.
- * @see #getExpiry()
- * @generated
- */
- public void setExpiry(Integer newExpiry)
- {
- Integer oldExpiry = expiry;
- expiry = newExpiry;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__EXPIRY, oldExpiry, expiry));
- }
-
- /**
- * Returns the value of the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Size</em>' attribute.
- * @see #setSize(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Size()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getSize()
- {
- return size;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Size</em>' attribute.
- * @see #getSize()
- * @generated
- */
- public void setSize(Integer newSize)
- {
- Integer oldSize = size;
- size = newSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__SIZE, oldSize, size));
- }
-
- /**
- * Returns the value of the '<em><b>Shared</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Shared</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Shared</em>' attribute.
- * @see #setShared(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Shared()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getShared()
- {
- return shared;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared <em>Shared</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Shared</em>' attribute.
- * @see #getShared()
- * @generated
- */
- public void setShared(Boolean newShared)
- {
- Boolean oldShared = shared;
- shared = newShared;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__SHARED, oldShared, shared));
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see #setType(CacheType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Type()
- * @model
- * @generated
- */
- public CacheType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see #getType()
- * @generated
- */
- public void setType(CacheType newType)
- {
- CacheType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Always Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Always Refresh</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Always Refresh</em>' attribute.
- * @see #setAlwaysRefresh(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_AlwaysRefresh()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getAlwaysRefresh()
- {
- return alwaysRefresh;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh <em>Always Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Always Refresh</em>' attribute.
- * @see #getAlwaysRefresh()
- * @generated
- */
- public void setAlwaysRefresh(Boolean newAlwaysRefresh)
- {
- Boolean oldAlwaysRefresh = alwaysRefresh;
- alwaysRefresh = newAlwaysRefresh;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH, oldAlwaysRefresh, alwaysRefresh));
- }
-
- /**
- * Returns the value of the '<em><b>Refresh Only If Newer</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Refresh Only If Newer</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Refresh Only If Newer</em>' attribute.
- * @see #setRefreshOnlyIfNewer(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_RefreshOnlyIfNewer()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getRefreshOnlyIfNewer()
- {
- return refreshOnlyIfNewer;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer <em>Refresh Only If Newer</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Refresh Only If Newer</em>' attribute.
- * @see #getRefreshOnlyIfNewer()
- * @generated
- */
- public void setRefreshOnlyIfNewer(Boolean newRefreshOnlyIfNewer)
- {
- Boolean oldRefreshOnlyIfNewer = refreshOnlyIfNewer;
- refreshOnlyIfNewer = newRefreshOnlyIfNewer;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER, oldRefreshOnlyIfNewer, refreshOnlyIfNewer));
- }
-
- /**
- * Returns the value of the '<em><b>Disable Hits</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Disable Hits</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Disable Hits</em>' attribute.
- * @see #setDisableHits(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_DisableHits()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getDisableHits()
- {
- return disableHits;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits <em>Disable Hits</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Disable Hits</em>' attribute.
- * @see #getDisableHits()
- * @generated
- */
- public void setDisableHits(Boolean newDisableHits)
- {
- Boolean oldDisableHits = disableHits;
- disableHits = newDisableHits;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS, oldDisableHits, disableHits));
- }
-
- /**
- * Returns the value of the '<em><b>Coordination Type</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Coordination Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Coordination Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see #setCoordinationType(CacheCoordinationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_CoordinationType()
- * @model default=""
- * @generated
- */
- public CacheCoordinationType getCoordinationType()
- {
- return coordinationType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType <em>Coordination Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Coordination Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see #getCoordinationType()
- * @generated
- */
- public void setCoordinationType(CacheCoordinationType newCoordinationType)
- {
- CacheCoordinationType oldCoordinationType = coordinationType;
- coordinationType = newCoordinationType == null ? COORDINATION_TYPE_EDEFAULT : newCoordinationType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE, oldCoordinationType, coordinationType));
- }
-
- /**
- * Returns the value of the '<em><b>Expiry Time Of Day</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Expiry Time Of Day</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Expiry Time Of Day</em>' containment reference.
- * @see #setExpiryTimeOfDay(XmlTimeOfDay)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_ExpiryTimeOfDay()
- * @model containment="true"
- * @generated
- */
- public XmlTimeOfDay getExpiryTimeOfDay()
- {
- return expiryTimeOfDay;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetExpiryTimeOfDay(XmlTimeOfDay newExpiryTimeOfDay, NotificationChain msgs)
- {
- XmlTimeOfDay oldExpiryTimeOfDay = expiryTimeOfDay;
- expiryTimeOfDay = newExpiryTimeOfDay;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, oldExpiryTimeOfDay, newExpiryTimeOfDay);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay <em>Expiry Time Of Day</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Expiry Time Of Day</em>' containment reference.
- * @see #getExpiryTimeOfDay()
- * @generated
- */
- public void setExpiryTimeOfDay(XmlTimeOfDay newExpiryTimeOfDay)
- {
- if (newExpiryTimeOfDay != expiryTimeOfDay)
- {
- NotificationChain msgs = null;
- if (expiryTimeOfDay != null)
- msgs = ((InternalEObject)expiryTimeOfDay).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, null, msgs);
- if (newExpiryTimeOfDay != null)
- msgs = ((InternalEObject)newExpiryTimeOfDay).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, null, msgs);
- msgs = basicSetExpiryTimeOfDay(newExpiryTimeOfDay, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, newExpiryTimeOfDay, newExpiryTimeOfDay));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- return basicSetExpiryTimeOfDay(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- return getIsolation();
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- return getDatabaseChangeNotificationType();
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- return getExpiry();
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- return getSize();
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- return getShared();
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- return getAlwaysRefresh();
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- return getRefreshOnlyIfNewer();
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- return getDisableHits();
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- return getCoordinationType();
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- return getExpiryTimeOfDay();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- setIsolation((CacheIsolationType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- setDatabaseChangeNotificationType((DatabaseChangeNotificationType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- setExpiry((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- setSize((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- setShared((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- setType((CacheType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- setAlwaysRefresh((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- setRefreshOnlyIfNewer((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- setDisableHits((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- setCoordinationType((CacheCoordinationType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- setExpiryTimeOfDay((XmlTimeOfDay)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- setIsolation(ISOLATION_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- setDatabaseChangeNotificationType(DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- setExpiry(EXPIRY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- setSize(SIZE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- setShared(SHARED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- setAlwaysRefresh(ALWAYS_REFRESH_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- setRefreshOnlyIfNewer(REFRESH_ONLY_IF_NEWER_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- setDisableHits(DISABLE_HITS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- setCoordinationType(COORDINATION_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- setExpiryTimeOfDay((XmlTimeOfDay)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- return isolation != ISOLATION_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- return databaseChangeNotificationType != DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- return EXPIRY_EDEFAULT == null ? expiry != null : !EXPIRY_EDEFAULT.equals(expiry);
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- return SIZE_EDEFAULT == null ? size != null : !SIZE_EDEFAULT.equals(size);
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- return SHARED_EDEFAULT == null ? shared != null : !SHARED_EDEFAULT.equals(shared);
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- return type != TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- return ALWAYS_REFRESH_EDEFAULT == null ? alwaysRefresh != null : !ALWAYS_REFRESH_EDEFAULT.equals(alwaysRefresh);
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- return REFRESH_ONLY_IF_NEWER_EDEFAULT == null ? refreshOnlyIfNewer != null : !REFRESH_ONLY_IF_NEWER_EDEFAULT.equals(refreshOnlyIfNewer);
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- return DISABLE_HITS_EDEFAULT == null ? disableHits != null : !DISABLE_HITS_EDEFAULT.equals(disableHits);
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- return coordinationType != COORDINATION_TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- return expiryTimeOfDay != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCache_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE: return EclipseLinkOrmV2_4Package.XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCache_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE: return EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (isolation: ");
- result.append(isolation);
- result.append(", databaseChangeNotificationType: ");
- result.append(databaseChangeNotificationType);
- result.append(", expiry: ");
- result.append(expiry);
- result.append(", size: ");
- result.append(size);
- result.append(", shared: ");
- result.append(shared);
- result.append(", type: ");
- result.append(type);
- result.append(", alwaysRefresh: ");
- result.append(alwaysRefresh);
- result.append(", refreshOnlyIfNewer: ");
- result.append(refreshOnlyIfNewer);
- result.append(", disableHits: ");
- result.append(disableHits);
- result.append(", coordinationType: ");
- result.append(coordinationType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildExpiryTranslator(),
- buildExpiryTimeOfDayTranslator(),
- buildSizeTranslator(),
- buildSharedTranslator(),
- buildIsolationTranslator(),
- buildTypeTranslator(),
- buildAlwaysRefreshTranslator(),
- buildRefreshOnlyIfNewerTranslator(),
- buildDisableHitsTranslator(),
- buildCoordinationTypeTranslator(),
- buildDatabaseChangeNotificationTypeTranslator(),
- };
- }
-
- protected static Translator buildExpiryTranslator() {
- return new Translator(EclipseLink.CACHE__EXPIRY, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Expiry());
- }
-
- protected static Translator buildExpiryTimeOfDayTranslator() {
- return XmlTimeOfDay.buildTranslator(EclipseLink.EXPIRY_TIME_OF_DAY, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_ExpiryTimeOfDay());
- }
-
- protected static Translator buildSizeTranslator() {
- return new Translator(EclipseLink.CACHE__SIZE, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Size(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSharedTranslator() {
- return new Translator(EclipseLink.CACHE__SHARED, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Shared(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.CACHE__TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAlwaysRefreshTranslator() {
- return new Translator(EclipseLink.CACHE__ALWAYS_REFRESH, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_AlwaysRefresh(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildRefreshOnlyIfNewerTranslator() {
- return new Translator(EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_RefreshOnlyIfNewer(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDisableHitsTranslator() {
- return new Translator(EclipseLink.CACHE__DISABLE_HITS, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_DisableHits(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCoordinationTypeTranslator() {
- return new Translator(EclipseLink.CACHE__COORDINATION_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_CoordinationType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIsolationTranslator() {
- return new Translator(EclipseLink2_2.CACHE__ISOLATION, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlCache_2_2_Isolation(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDatabaseChangeNotificationTypeTranslator() {
- return new Translator(EclipseLink2_4.CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlCache_2_4_DatabaseChangeNotificationType(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCache
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java
deleted file mode 100644
index f0a5c0de09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Cache Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache <em>Cache</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking <em>Existence Checking</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCacheHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache</em>' containment reference.
- * @see #setCache(XmlCache)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_Cache()
- * @model containment="true"
- * @generated
- */
- XmlCache getCache();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache</em>' containment reference.
- * @see #getCache()
- * @generated
- */
- void setCache(XmlCache value);
-
- /**
- * Returns the value of the '<em><b>Existence Checking</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Existence Checking</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- ExistenceType getExistenceChecking();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #getExistenceChecking()
- * @generated
- */
- void setExistenceChecking(ExistenceType value);
-
-} // XmlCacheHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java
deleted file mode 100644
index aa252f224c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache Index</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex()
- * @model kind="class"
- * @generated
- */
-public class XmlCacheIndex extends AbstractJpaEObject implements XmlCacheIndex_2_4
-{
- /**
- * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnNames()
- * @generated
- * @ordered
- */
- protected EList<String> columnNames;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCacheIndex()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CACHE_INDEX;
- }
-
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex_2_4_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public EList<String> getColumnNames()
- {
- if (columnNames == null)
- {
- columnNames = new EDataTypeEList<String>(String.class, this, EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES);
- }
- return columnNames;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- return getColumnNames();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- getColumnNames().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- return columnNames != null && !columnNames.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (columnNames: ");
- result.append(columnNames);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlCacheIndex(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildColumnNameTranslator()
- };
- }
-
- protected static Translator buildColumnNameTranslator() {
- return new Translator(EclipseLink2_4.CACHE_INDEX__COLUMN_NAME, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlCacheIndex_2_4_ColumnNames());
- }
-} // XmlCacheIndex
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java
deleted file mode 100644
index e82bb7751e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
-
- * A representation of the model object '<em><b>Xml Change Tracking</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlChangeTracking extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlChangeTrackingType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected XmlChangeTrackingType type = TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlChangeTracking()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CHANGE_TRACKING;
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see #setType(XmlChangeTrackingType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking_Type()
- * @model
- * @generated
- */
- public XmlChangeTrackingType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see #getType()
- * @generated
- */
- public void setType(XmlChangeTrackingType newType)
- {
- XmlChangeTrackingType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE, oldType, type));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- return getType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- setType((XmlChangeTrackingType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- return type != TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (type: ");
- result.append(type);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, Translator.END_TAG_NO_INDENT, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildTypeTranslator()
- };
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTracking_Type(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlChangeTracking
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java
deleted file mode 100644
index 3144406326..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Change Tracking Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking <em>Change Tracking</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlChangeTrackingHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- XmlChangeTracking getChangeTracking();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- void setChangeTracking(XmlChangeTracking value);
-
-} // XmlChangeTrackingHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java
deleted file mode 100644
index 02a765c6fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Xml Change Tracking Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType()
- * @model
- * @generated
- */
-public enum XmlChangeTrackingType implements Enumerator
-{
- /**
- * The '<em><b>ATTRIBUTE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ATTRIBUTE_VALUE
- * @generated
- * @ordered
- */
- ATTRIBUTE(0, "ATTRIBUTE", "ATTRIBUTE"), /**
- * The '<em><b>OBJECT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OBJECT_VALUE
- * @generated
- * @ordered
- */
- OBJECT(1, "OBJECT", "OBJECT"), /**
- * The '<em><b>DEFERRED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #DEFERRED_VALUE
- * @generated
- * @ordered
- */
- DEFERRED(2, "DEFERRED", "DEFERRED"), /**
- * The '<em><b>AUTO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #AUTO_VALUE
- * @generated
- * @ordered
- */
- AUTO(3, "AUTO", "AUTO")
- ;
-
- /**
- * The '<em><b>ATTRIBUTE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ATTRIBUTE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ATTRIBUTE
- * @model
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTE_VALUE = 0;
-
-/**
- * The '<em><b>OBJECT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OBJECT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OBJECT
- * @model
- * @generated
- * @ordered
- */
- public static final int OBJECT_VALUE = 1;
-
-/**
- * The '<em><b>DEFERRED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>DEFERRED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #DEFERRED
- * @model
- * @generated
- * @ordered
- */
- public static final int DEFERRED_VALUE = 2;
-
-/**
- * The '<em><b>AUTO</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>AUTO</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #AUTO
- * @model
- * @generated
- * @ordered
- */
- public static final int AUTO_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Xml Change Tracking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlChangeTrackingType[] VALUES_ARRAY =
- new XmlChangeTrackingType[]
- {
- ATTRIBUTE,
- OBJECT,
- DEFERRED,
- AUTO,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Change Tracking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlChangeTrackingType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Change Tracking Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlChangeTrackingType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlChangeTrackingType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Change Tracking Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlChangeTrackingType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlChangeTrackingType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Change Tracking Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlChangeTrackingType get(int value)
- {
- switch (value)
- {
- case ATTRIBUTE_VALUE: return ATTRIBUTE;
- case OBJECT_VALUE: return OBJECT;
- case DEFERRED_VALUE: return DEFERRED;
- case AUTO_VALUE: return AUTO;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlChangeTrackingType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlChangeTrackingType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java
deleted file mode 100644
index 772affa448..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Clone Copy Policy</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod <em>Method</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod <em>Working Copy Method</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlCloneCopyPolicy extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getMethod() <em>Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethod()
- * @generated
- * @ordered
- */
- protected static final String METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMethod() <em>Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethod()
- * @generated
- * @ordered
- */
- protected String method = METHOD_EDEFAULT;
-
- /**
- * The default value of the '{@link #getWorkingCopyMethod() <em>Working Copy Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getWorkingCopyMethod()
- * @generated
- * @ordered
- */
- protected static final String WORKING_COPY_METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getWorkingCopyMethod() <em>Working Copy Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getWorkingCopyMethod()
- * @generated
- * @ordered
- */
- protected String workingCopyMethod = WORKING_COPY_METHOD_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCloneCopyPolicy()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CLONE_COPY_POLICY;
- }
-
- /**
- * Returns the value of the '<em><b>Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Method</em>' attribute.
- * @see #setMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy_Method()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMethod()
- {
- return method;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod <em>Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Method</em>' attribute.
- * @see #getMethod()
- * @generated
- */
- public void setMethod(String newMethod)
- {
- String oldMethod = method;
- method = newMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD, oldMethod, method));
- }
-
- /**
- * Returns the value of the '<em><b>Working Copy Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Working Copy Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Working Copy Method</em>' attribute.
- * @see #setWorkingCopyMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy_WorkingCopyMethod()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getWorkingCopyMethod()
- {
- return workingCopyMethod;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod <em>Working Copy Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Working Copy Method</em>' attribute.
- * @see #getWorkingCopyMethod()
- * @generated
- */
- public void setWorkingCopyMethod(String newWorkingCopyMethod)
- {
- String oldWorkingCopyMethod = workingCopyMethod;
- workingCopyMethod = newWorkingCopyMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD, oldWorkingCopyMethod, workingCopyMethod));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- return getMethod();
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- return getWorkingCopyMethod();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- setMethod((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- setWorkingCopyMethod((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- setMethod(METHOD_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- setWorkingCopyMethod(WORKING_COPY_METHOD_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- return METHOD_EDEFAULT == null ? method != null : !METHOD_EDEFAULT.equals(method);
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- return WORKING_COPY_METHOD_EDEFAULT == null ? workingCopyMethod != null : !WORKING_COPY_METHOD_EDEFAULT.equals(workingCopyMethod);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (method: ");
- result.append(method);
- result.append(", workingCopyMethod: ");
- result.append(workingCopyMethod);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildMethodTranslator(),
- buildWorkingCopyMethodTranslator(),
- };
- }
-
- protected static Translator buildMethodTranslator() {
- return new Translator(EclipseLink.CLONE_COPY_POLICY__METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlCloneCopyPolicy_Method(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildWorkingCopyMethodTranslator() {
- return new Translator(EclipseLink.CLONE_COPY_POLICY__WORKING_COPY_METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlCloneCopyPolicy_WorkingCopyMethod(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCloneCopyPolicy
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java
deleted file mode 100644
index ec331f1139..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Collection Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable()
- * @model kind="class"
- * @generated
- */
-public class XmlCollectionTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlCollectionTable implements XmlCollectionTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCollectionTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_COLLECTION_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCollectionTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_COLLECTION_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCollectionTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_COLLECTION_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlCollectionTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildJoinColumnTranslator(),
- buildUniqueConstraintTranslator()};
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlCollectionTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCollectionTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java
deleted file mode 100644
index d746c9261e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Conversion Value</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue <em>Data Value</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue <em>Object Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlConversionValue extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getDataValue() <em>Data Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataValue()
- * @generated
- * @ordered
- */
- protected static final String DATA_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDataValue() <em>Data Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataValue()
- * @generated
- * @ordered
- */
- protected String dataValue = DATA_VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getObjectValue() <em>Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectValue()
- * @generated
- * @ordered
- */
- protected static final String OBJECT_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getObjectValue() <em>Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectValue()
- * @generated
- * @ordered
- */
- protected String objectValue = OBJECT_VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlConversionValue()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CONVERSION_VALUE;
- }
-
- /**
- * Returns the value of the '<em><b>Data Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Data Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Data Value</em>' attribute.
- * @see #setDataValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue_DataValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDataValue()
- {
- return dataValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue <em>Data Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Data Value</em>' attribute.
- * @see #getDataValue()
- * @generated
- */
- public void setDataValue(String newDataValue)
- {
- String oldDataValue = dataValue;
- dataValue = newDataValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE, oldDataValue, dataValue));
- }
-
- /**
- * Returns the value of the '<em><b>Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Value</em>' attribute.
- * @see #setObjectValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue_ObjectValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getObjectValue()
- {
- return objectValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue <em>Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Value</em>' attribute.
- * @see #getObjectValue()
- * @generated
- */
- public void setObjectValue(String newObjectValue)
- {
- String oldObjectValue = objectValue;
- objectValue = newObjectValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE, oldObjectValue, objectValue));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- return getDataValue();
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- return getObjectValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- setDataValue((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- setObjectValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- setDataValue(DATA_VALUE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- setObjectValue(OBJECT_VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- return DATA_VALUE_EDEFAULT == null ? dataValue != null : !DATA_VALUE_EDEFAULT.equals(dataValue);
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- return OBJECT_VALUE_EDEFAULT == null ? objectValue != null : !OBJECT_VALUE_EDEFAULT.equals(objectValue);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (dataValue: ");
- result.append(dataValue);
- result.append(", objectValue: ");
- result.append(objectValue);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getDataValueTextRange() {
- return getAttributeTextRange(EclipseLink.CONVERSION_VALUE__DATA_VALUE);
- }
-
- public TextRange getObjectValueTextRange() {
- return getAttributeTextRange(EclipseLink.CONVERSION_VALUE__OBJECT_VALUE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDataValueTranslator(),
- buildObjectValueTranslator()
- };
- }
-
- protected static Translator buildDataValueTranslator() {
- return new Translator(EclipseLink.CONVERSION_VALUE__DATA_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlConversionValue_DataValue(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildObjectValueTranslator() {
- return new Translator(EclipseLink.CONVERSION_VALUE__OBJECT_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlConversionValue_ObjectValue(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlConversionValue
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java
deleted file mode 100644
index 581f386de0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected static final String CLASS_NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected String className = CLASS_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- public void setClassName(String newClassName)
- {
- String oldClassName = className;
- className = newClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- return getClassName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- setClassName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (className: ");
- result.append(className);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getConverterClassTextRange() {
- return getAttributeTextRange(EclipseLink.CONVERTER__CLASS);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, Translator.END_TAG_NO_INDENT, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildClassTranslator(),
- };
- }
-
- protected static Translator buildClassTranslator() {
- return new Translator(EclipseLink.CONVERTER__CLASS, EclipseLinkOrmPackage.eINSTANCE.getXmlConverter_ClassName(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.className.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.CONVERTER__CLASS).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenamePackageEdit(String newName) {
- int packageLength = this.className.lastIndexOf('.');
- if (packageLength == -1) {
- packageLength = 0;
- newName = newName + '.';
- }
- int offset = getAttributeNode(EclipseLink.CONVERTER__CLASS).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newName);
- }
-
-} // XmlConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterHolder.java
deleted file mode 100644
index 9f46330a1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterHolder.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml CustomConverter Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getConverter <em>Converter</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getTypeConverter <em>Type Converter</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getObjectTypeConverter <em>Object Type Converter</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getStructConverter <em>Struct Converter</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlConverterHolder
- extends JpaEObject
-{
-// TODO bjv rename to XmlConverterContainer
- /**
- * Returns the value of the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' containment reference.
- * @see #setConverter(XmlConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- XmlConverter getConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getConverter <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' containment reference.
- * @see #getConverter()
- * @generated
- */
- void setConverter(XmlConverter value);
-
- /**
- * Returns the value of the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converter</em>' containment reference.
- * @see #setTypeConverter(XmlTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- XmlTypeConverter getTypeConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getTypeConverter <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Converter</em>' containment reference.
- * @see #getTypeConverter()
- * @generated
- */
- void setTypeConverter(XmlTypeConverter value);
-
- /**
- * Returns the value of the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converter</em>' containment reference.
- * @see #setObjectTypeConverter(XmlObjectTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- XmlObjectTypeConverter getObjectTypeConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getObjectTypeConverter <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type Converter</em>' containment reference.
- * @see #getObjectTypeConverter()
- * @generated
- */
- void setObjectTypeConverter(XmlObjectTypeConverter value);
-
- /**
- * Returns the value of the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converter</em>' containment reference.
- * @see #setStructConverter(XmlStructConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- XmlStructConverter getStructConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder#getStructConverter <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct Converter</em>' containment reference.
- * @see #getStructConverter()
- * @generated
- */
- void setStructConverter(XmlStructConverter value);
-
-} // XmlConverterHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertersHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertersHolder.java
deleted file mode 100644
index ff870ef339..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertersHolder.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Converters Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getConverters <em>Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getTypeConverters <em>Type Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getObjectTypeConverters <em>Object Type Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder#getStructConverters <em>Struct Converters</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlConvertersHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_Converters()
- * @model containment="true"
- * @generated
- */
- EList<XmlConverter> getConverters();
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_TypeConverters()
- * @model containment="true"
- * @generated
- */
- EList<XmlTypeConverter> getTypeConverters();
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- EList<XmlObjectTypeConverter> getObjectTypeConverters();
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_StructConverters()
- * @model containment="true"
- * @generated
- */
- EList<XmlStructConverter> getStructConverters();
-
-} // XmlConvertersHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java
deleted file mode 100644
index b3d9d5869c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Convertible Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert <em>Convert</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlConvertibleMapping extends org.eclipse.jpt.jpa.core.resource.orm.XmlConvertibleMapping, XmlConverterHolder
-{
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getConvert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- void setConvert(String value);
-
- /**
- * Return the {@link TextRange} for the convert element. If the convert element
- * does not exist return the {@link TextRange} for the mapping element.
- */
- TextRange getConvertTextRange();
-
-} // XmlConvertibleMapping
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java
deleted file mode 100644
index 9b21b431a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Copy Policy</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ <em>Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlCopyPolicy extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getClass_() <em>Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClass_()
- * @generated
- * @ordered
- */
- protected static final String CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getClass_() <em>Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClass_()
- * @generated
- * @ordered
- */
- protected String class_ = CLASS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCopyPolicy()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_COPY_POLICY;
- }
-
- /**
- * Returns the value of the '<em><b>Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class</em>' attribute.
- * @see #setClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy_Class()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getClass_()
- {
- return class_;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ <em>Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class</em>' attribute.
- * @see #getClass_()
- * @generated
- */
- public void setClass(String newClass)
- {
- String oldClass = class_;
- class_ = newClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS, oldClass, class_));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- return getClass_();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- setClass((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- setClass(CLASS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- return CLASS_EDEFAULT == null ? class_ != null : !CLASS_EDEFAULT.equals(class_);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (class: ");
- result.append(class_);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildClassTranslator()
- };
- }
-
- protected static Translator buildClassTranslator() {
- return new Translator(EclipseLink.COPY_POLICY__CLASS, EclipseLinkOrmPackage.eINSTANCE.getXmlCopyPolicy_Class(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCopyPolicy
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java
deleted file mode 100644
index 89c35476dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Customizer</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName <em>Customizer Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlCustomizer extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getCustomizerClassName() <em>Customizer Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizerClassName()
- * @generated
- * @ordered
- */
- protected static final String CUSTOMIZER_CLASS_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCustomizerClassName() <em>Customizer Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizerClassName()
- * @generated
- * @ordered
- */
- protected String customizerClassName = CUSTOMIZER_CLASS_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCustomizer()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CUSTOMIZER;
- }
-
- /**
- * Returns the value of the '<em><b>Customizer Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer Class Name</em>' attribute.
- * @see #setCustomizerClassName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer_CustomizerClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCustomizerClassName()
- {
- return customizerClassName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName <em>Customizer Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer Class Name</em>' attribute.
- * @see #getCustomizerClassName()
- * @generated
- */
- public void setCustomizerClassName(String newCustomizerClassName)
- {
- String oldCustomizerClassName = customizerClassName;
- customizerClassName = newCustomizerClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME, oldCustomizerClassName, customizerClassName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- return getCustomizerClassName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- setCustomizerClassName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- setCustomizerClassName(CUSTOMIZER_CLASS_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- return CUSTOMIZER_CLASS_NAME_EDEFAULT == null ? customizerClassName != null : !CUSTOMIZER_CLASS_NAME_EDEFAULT.equals(customizerClassName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (customizerClassName: ");
- result.append(customizerClassName);
- result.append(')');
- return result.toString();
- }
-
-} // XmlCustomizer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java
deleted file mode 100644
index 65349782cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Customizer Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer <em>Customizer</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCustomizerHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getCustomizer();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- void setCustomizer(XmlClassReference value);
-
-} // XmlCustomizerHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java
deleted file mode 100644
index 07c7801060..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Xml Direction</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlDirection()
- * @model
- * @generated
- */
-public enum XmlDirection implements Enumerator
-{
- /**
- * The '<em><b>IN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IN_VALUE
- * @generated
- * @ordered
- */
- IN(0, "IN", "IN"),
-
- /**
- * The '<em><b>OUT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OUT_VALUE
- * @generated
- * @ordered
- */
- OUT(1, "OUT", "OUT"),
-
- /**
- * The '<em><b>IN OUT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IN_OUT_VALUE
- * @generated
- * @ordered
- */
- IN_OUT(2, "IN_OUT", "IN_OUT"),
-
- /**
- * The '<em><b>OUT CURSOR</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OUT_CURSOR_VALUE
- * @generated
- * @ordered
- */
- OUT_CURSOR(3, "OUT_CURSOR", "OUT_CURSOR");
-
- /**
- * The '<em><b>IN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IN
- * @model
- * @generated
- * @ordered
- */
- public static final int IN_VALUE = 0;
-
- /**
- * The '<em><b>OUT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OUT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OUT
- * @model
- * @generated
- * @ordered
- */
- public static final int OUT_VALUE = 1;
-
- /**
- * The '<em><b>IN OUT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IN OUT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IN_OUT
- * @model
- * @generated
- * @ordered
- */
- public static final int IN_OUT_VALUE = 2;
-
- /**
- * The '<em><b>OUT CURSOR</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OUT CURSOR</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OUT_CURSOR
- * @model
- * @generated
- * @ordered
- */
- public static final int OUT_CURSOR_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Xml Direction</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlDirection[] VALUES_ARRAY =
- new XmlDirection[]
- {
- IN,
- OUT,
- IN_OUT,
- OUT_CURSOR,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Direction</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlDirection> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Direction</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlDirection get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlDirection result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Direction</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlDirection getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlDirection result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Direction</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlDirection get(int value)
- {
- switch (value)
- {
- case IN_VALUE: return IN;
- case OUT_VALUE: return OUT;
- case IN_OUT_VALUE: return IN_OUT;
- case OUT_CURSOR_VALUE: return OUT_CURSOR;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlDirection(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlDirection
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java
deleted file mode 100644
index 7cf943227d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java
+++ /dev/null
@@ -1,2654 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @model kind="class"
- * @generated
- */
-public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection implements XmlElementCollection_2_0, XmlElementCollection_2_1, XmlElementCollection_2_2, XmlElementCollection_2_3, XmlElementCollection_2_4
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected XmlConverter converter;
-
- /**
- * The cached value of the '{@link #getTypeConverter() <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlTypeConverter typeConverter;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverter() <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlObjectTypeConverter objectTypeConverter;
-
- /**
- * The cached value of the '{@link #getStructConverter() <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverter()
- * @generated
- * @ordered
- */
- protected XmlStructConverter structConverter;
-
- /**
- * The default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getMapKeyAssociationOverrides() <em>Map Key Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> mapKeyAssociationOverrides;
-
- /**
- * The default value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected static final String MAP_KEY_CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected String mapKeyConvert = MAP_KEY_CONVERT_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NONCACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected boolean noncacheable = NONCACHEABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCompositeMember() <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCompositeMember()
- * @generated
- * @ordered
- */
- protected static final String COMPOSITE_MEMBER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCompositeMember() <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCompositeMember()
- * @generated
- * @ordered
- */
- protected String compositeMember = COMPOSITE_MEMBER_EDEFAULT;
-
- /**
- * The default value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected static final boolean DELETE_ALL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected boolean deleteAll = DELETE_ALL_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlElementCollection()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ELEMENT_COLLECTION;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' containment reference.
- * @see #setConverter(XmlConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- public XmlConverter getConverter()
- {
- return converter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetConverter(XmlConverter newConverter, NotificationChain msgs)
- {
- XmlConverter oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER, oldConverter, newConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getConverter <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' containment reference.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(XmlConverter newConverter)
- {
- if (newConverter != converter)
- {
- NotificationChain msgs = null;
- if (converter != null)
- msgs = ((InternalEObject)converter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER, newConverter, newConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converter</em>' containment reference.
- * @see #setTypeConverter(XmlTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlTypeConverter getTypeConverter()
- {
- return typeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTypeConverter(XmlTypeConverter newTypeConverter, NotificationChain msgs)
- {
- XmlTypeConverter oldTypeConverter = typeConverter;
- typeConverter = newTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER, oldTypeConverter, newTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getTypeConverter <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Converter</em>' containment reference.
- * @see #getTypeConverter()
- * @generated
- */
- public void setTypeConverter(XmlTypeConverter newTypeConverter)
- {
- if (newTypeConverter != typeConverter)
- {
- NotificationChain msgs = null;
- if (typeConverter != null)
- msgs = ((InternalEObject)typeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER, null, msgs);
- msgs = basicSetTypeConverter(newTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER, newTypeConverter, newTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converter</em>' containment reference.
- * @see #setObjectTypeConverter(XmlObjectTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlObjectTypeConverter getObjectTypeConverter()
- {
- return objectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter, NotificationChain msgs)
- {
- XmlObjectTypeConverter oldObjectTypeConverter = objectTypeConverter;
- objectTypeConverter = newObjectTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER, oldObjectTypeConverter, newObjectTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getObjectTypeConverter <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type Converter</em>' containment reference.
- * @see #getObjectTypeConverter()
- * @generated
- */
- public void setObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter)
- {
- if (newObjectTypeConverter != objectTypeConverter)
- {
- NotificationChain msgs = null;
- if (objectTypeConverter != null)
- msgs = ((InternalEObject)objectTypeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER, null, msgs);
- msgs = basicSetObjectTypeConverter(newObjectTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER, newObjectTypeConverter, newObjectTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converter</em>' containment reference.
- * @see #setStructConverter(XmlStructConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- public XmlStructConverter getStructConverter()
- {
- return structConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStructConverter(XmlStructConverter newStructConverter, NotificationChain msgs)
- {
- XmlStructConverter oldStructConverter = structConverter;
- structConverter = newStructConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER, oldStructConverter, newStructConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getStructConverter <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct Converter</em>' containment reference.
- * @see #getStructConverter()
- * @generated
- */
- public void setStructConverter(XmlStructConverter newStructConverter)
- {
- if (newStructConverter != structConverter)
- {
- NotificationChain msgs = null;
- if (structConverter != null)
- msgs = ((InternalEObject)structConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER, null, msgs);
- msgs = basicSetStructConverter(newStructConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER, newStructConverter, newStructConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getMapKeyAssociationOverrides()
- {
- if (mapKeyAssociationOverrides == null)
- {
- mapKeyAssociationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES);
- }
- return mapKeyAssociationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- public void setMapKeyConvert(String newMapKeyConvert)
- {
- String oldMapKeyConvert = mapKeyConvert;
- mapKeyConvert = newMapKeyConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT, oldMapKeyConvert, mapKeyConvert));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNoncacheable()
- {
- return noncacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- public void setNoncacheable(boolean newNoncacheable)
- {
- boolean oldNoncacheable = noncacheable;
- noncacheable = newNoncacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE, oldNoncacheable, noncacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Composite Member</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Composite Member</em>' attribute.
- * @see #setCompositeMember(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_3_CompositeMember()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCompositeMember()
- {
- return compositeMember;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getCompositeMember <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Composite Member</em>' attribute.
- * @see #getCompositeMember()
- * @generated
- */
- public void setCompositeMember(String newCompositeMember)
- {
- String oldCompositeMember = compositeMember;
- compositeMember = newCompositeMember;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER, oldCompositeMember, compositeMember));
- }
-
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isDeleteAll()
- {
- return deleteAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- public void setDeleteAll(boolean newDeleteAll)
- {
- boolean oldDeleteAll = deleteAll;
- deleteAll = newDeleteAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL, oldDeleteAll, deleteAll));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER:
- return basicSetStructConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- return getConvert();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- return getMapKeyAssociationOverrides();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- return getMapKeyConvert();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- return getJoinFetch();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- return isNoncacheable();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- return getCompositeMember();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- return isDeleteAll();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- setConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- getMapKeyAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- setMapKeyConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- setNoncacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- setCompositeMember((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- setDeleteAll((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- setMapKeyConvert(MAP_KEY_CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- setNoncacheable(NONCACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- setCompositeMember(COMPOSITE_MEMBER_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- setDeleteAll(DELETE_ALL_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- return mapKeyAssociationOverrides != null && !mapKeyAssociationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- return noncacheable != NONCACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- return COMPOSITE_MEMBER_EDEFAULT == null ? compositeMember != null : !COMPOSITE_MEMBER_EDEFAULT.equals(compositeMember);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- return deleteAll != DELETE_ALL_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT: return EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_0.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_ELEMENT_COLLECTION_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE: return EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER: return EclipseLinkOrmV2_3Package.XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL: return EclipseLinkOrmV2_4Package.XML_ELEMENT_COLLECTION_24__DELETE_ALL;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_ELEMENT_COLLECTION_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__NONCACHEABLE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ELEMENT_COLLECTION_24__DELETE_ALL: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (convert: ");
- result.append(convert);
- result.append(", mapKeyConvert: ");
- result.append(mapKeyConvert);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", noncacheable: ");
- result.append(noncacheable);
- result.append(", compositeMember: ");
- result.append(compositeMember);
- result.append(", deleteAll: ");
- result.append(deleteAll);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** validation **********
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return getAttributeTextRange(JPA.ENUMERATED);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return getAttributeTextRange(JPA.LOB);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return getAttributeTextRange(JPA.TEMPORAL);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlElementCollection(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetClassTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildCompositeMemberTranslator(),
- buildOrderByTranslator(),
- buildOrderColumnTranslator(),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyConvertTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyAssociationOverrideTranslator(),
- XmlColumn.buildTranslator(JPA2_0.MAP_KEY_COLUMN, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKeyColumn()),
- XmlJoinColumn.buildTranslator(JPA2_0.MAP_KEY_JOIN_COLUMN, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKeyJoinColumns()),
- XmlColumn.buildTranslator(JPA.COLUMN, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_Column()),
- buildTemporalTranslator(),
- buildEnumeratedTranslator(),
- buildLobTranslator(),
- buildConvertTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_Converter()),
- XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_TypeConverter()),
- XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_ObjectTypeConverter()),
- XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_StructConverter()),
- XmlCollectionTable.buildTranslator(JPA2_0.COLLECTION_TABLE, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_CollectionTable()),
- buildCascadeOnDeleteTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- buildDeleteAllTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- };
- }
-
- protected static Translator buildMapKeyConvertTranslator() {
- return new Translator(JPA2_0.MAP_KEY_CONVERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildMapKeyAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(EclipseLink2_0.MAP_KEY_ASSOCIATION_OVERRIDE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlElementCollection_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlElementCollection_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlElementCollection_2_2_Noncacheable());
- }
-
- protected static Translator buildCompositeMemberTranslator() {
- return new Translator(EclipseLink2_3.COMPOSITE_MEMBER, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlElementCollection_2_3_CompositeMember(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDeleteAllTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_4.DELETE_ALL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlElementCollection_2_4_DeleteAll());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java
deleted file mode 100644
index 190c71cf44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java
+++ /dev/null
@@ -1,1589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Embeddable</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddable extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable implements XmlEmbeddable_2_1, XmlEmbeddable_2_2, XmlEmbeddable_2_3, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlConvertersHolder, XmlPropertyContainer
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getAttributeOverrides() <em>Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> attributeOverrides;
-
- /**
- * The cached value of the '{@link #getAssociationOverrides() <em>Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> associationOverrides;
-
- /**
- * The default value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected static final String PARENT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected String parentClass = PARENT_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getStruct() <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStruct()
- * @generated
- * @ordered
- */
- protected XmlStruct_2_3 struct;
-
- /**
- * The cached value of the '{@link #getCustomizer() <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizer()
- * @generated
- * @ordered
- */
- protected XmlClassReference customizer;
-
- /**
- * The cached value of the '{@link #getChangeTracking() <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getChangeTracking()
- * @generated
- * @ordered
- */
- protected XmlChangeTracking changeTracking;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getCopyPolicy() <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCopyPolicy copyPolicy;
-
- /**
- * The cached value of the '{@link #getInstantiationCopyPolicy() <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInstantiationCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlInstantiationCopyPolicy instantiationCopyPolicy;
-
- /**
- * The cached value of the '{@link #getCloneCopyPolicy() <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCloneCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCloneCopyPolicy cloneCopyPolicy;
-
- /**
- * The default value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final Boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected Boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_EMBEDDABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_2_2_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getParentClass()
- {
- return parentClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- public void setParentClass(String newParentClass)
- {
- String oldParentClass = parentClass;
- parentClass = newParentClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS, oldParentClass, parentClass));
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- public XmlStruct_2_3 getStruct()
- {
- return struct;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStruct(XmlStruct_2_3 newStruct, NotificationChain msgs)
- {
- XmlStruct_2_3 oldStruct = struct;
- struct = newStruct;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, oldStruct, newStruct);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- public void setStruct(XmlStruct_2_3 newStruct)
- {
- if (newStruct != struct)
- {
- NotificationChain msgs = null;
- if (struct != null)
- msgs = ((InternalEObject)struct).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, null, msgs);
- if (newStruct != null)
- msgs = ((InternalEObject)newStruct).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, null, msgs);
- msgs = basicSetStruct(newStruct, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, newStruct, newStruct));
- }
-
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlClassReference newCustomizer, NotificationChain msgs)
- {
- XmlClassReference oldCustomizer = customizer;
- customizer = newCustomizer;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, oldCustomizer, newCustomizer);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- public void setCustomizer(XmlClassReference newCustomizer)
- {
- if (newCustomizer != customizer)
- {
- NotificationChain msgs = null;
- if (customizer != null)
- msgs = ((InternalEObject)customizer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, null, msgs);
- if (newCustomizer != null)
- msgs = ((InternalEObject)newCustomizer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, null, msgs);
- msgs = basicSetCustomizer(newCustomizer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, newCustomizer, newCustomizer));
- }
-
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- public XmlChangeTracking getChangeTracking()
- {
- return changeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetChangeTracking(XmlChangeTracking newChangeTracking, NotificationChain msgs)
- {
- XmlChangeTracking oldChangeTracking = changeTracking;
- changeTracking = newChangeTracking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, oldChangeTracking, newChangeTracking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- public void setChangeTracking(XmlChangeTracking newChangeTracking)
- {
- if (newChangeTracking != changeTracking)
- {
- NotificationChain msgs = null;
- if (changeTracking != null)
- msgs = ((InternalEObject)changeTracking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, null, msgs);
- if (newChangeTracking != null)
- msgs = ((InternalEObject)newChangeTracking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, null, msgs);
- msgs = basicSetChangeTracking(newChangeTracking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, newChangeTracking, newChangeTracking));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Copy Policy</em>' containment reference.
- * @see #setCopyPolicy(XmlCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_CopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCopyPolicy getCopyPolicy()
- {
- return copyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCopyPolicy(XmlCopyPolicy newCopyPolicy, NotificationChain msgs)
- {
- XmlCopyPolicy oldCopyPolicy = copyPolicy;
- copyPolicy = newCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, oldCopyPolicy, newCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Copy Policy</em>' containment reference.
- * @see #getCopyPolicy()
- * @generated
- */
- public void setCopyPolicy(XmlCopyPolicy newCopyPolicy)
- {
- if (newCopyPolicy != copyPolicy)
- {
- NotificationChain msgs = null;
- if (copyPolicy != null)
- msgs = ((InternalEObject)copyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, null, msgs);
- if (newCopyPolicy != null)
- msgs = ((InternalEObject)newCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, null, msgs);
- msgs = basicSetCopyPolicy(newCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, newCopyPolicy, newCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Instantiation Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #setInstantiationCopyPolicy(XmlInstantiationCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_InstantiationCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlInstantiationCopyPolicy getInstantiationCopyPolicy()
- {
- return instantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy, NotificationChain msgs)
- {
- XmlInstantiationCopyPolicy oldInstantiationCopyPolicy = instantiationCopyPolicy;
- instantiationCopyPolicy = newInstantiationCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, oldInstantiationCopyPolicy, newInstantiationCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #getInstantiationCopyPolicy()
- * @generated
- */
- public void setInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy)
- {
- if (newInstantiationCopyPolicy != instantiationCopyPolicy)
- {
- NotificationChain msgs = null;
- if (instantiationCopyPolicy != null)
- msgs = ((InternalEObject)instantiationCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, null, msgs);
- if (newInstantiationCopyPolicy != null)
- msgs = ((InternalEObject)newInstantiationCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, null, msgs);
- msgs = basicSetInstantiationCopyPolicy(newInstantiationCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, newInstantiationCopyPolicy, newInstantiationCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Clone Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #setCloneCopyPolicy(XmlCloneCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_CloneCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCloneCopyPolicy getCloneCopyPolicy()
- {
- return cloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy, NotificationChain msgs)
- {
- XmlCloneCopyPolicy oldCloneCopyPolicy = cloneCopyPolicy;
- cloneCopyPolicy = newCloneCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, oldCloneCopyPolicy, newCloneCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #getCloneCopyPolicy()
- * @generated
- */
- public void setCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy)
- {
- if (newCloneCopyPolicy != cloneCopyPolicy)
- {
- NotificationChain msgs = null;
- if (cloneCopyPolicy != null)
- msgs = ((InternalEObject)cloneCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, null, msgs);
- if (newCloneCopyPolicy != null)
- msgs = ((InternalEObject)newCloneCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, null, msgs);
- msgs = basicSetCloneCopyPolicy(newCloneCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, newCloneCopyPolicy, newCloneCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #getExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(Boolean newExcludeDefaultMappings)
- {
- Boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- return basicSetStruct(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- return basicSetCustomizer(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- return basicSetChangeTracking(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- return basicSetCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- return basicSetInstantiationCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- return basicSetCloneCopyPolicy(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- return getParentClass();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- return getStruct();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- return getCustomizer();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- return getChangeTracking();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- return getCopyPolicy();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- return getInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- return getCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- return getExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- setParentClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- setStruct((XmlStruct_2_3)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- setCustomizer((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- setParentClass(PARENT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- setStruct((XmlStruct_2_3)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- setCustomizer((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- return PARENT_CLASS_EDEFAULT == null ? parentClass != null : !PARENT_CLASS_EDEFAULT.equals(parentClass);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- return struct != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- return customizer != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- return changeTracking != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- return copyPolicy != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- return instantiationCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- return cloneCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- return EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT == null ? excludeDefaultMappings != null : !EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT.equals(excludeDefaultMappings);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS: return EclipseLinkOrmV2_2Package.XML_EMBEDDABLE_22__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_TABLES;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT: return EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER: return EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_EMBEDDABLE_22__PARENT_CLASS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES;
- case EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__STRUCT: return EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER: return EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (parentClass: ");
- result.append(parentClass);
- result.append(", excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildClassTranslator(),
- buildParentClassTranslator(),
- buildAccessTranslator(),
- buildMetadataCompleteTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- buildDescriptionTranslator(),
- buildAccessMethodsTranslator(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- XmlStruct.buildTranslator(EclipseLink2_3.STRUCT, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEmbeddable_2_3_Struct()),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEmbeddable_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEmbeddable_2_3_PlsqlTables()),
- buildPropertyTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- Attributes.buildTranslator()};
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new Translator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_ExcludeDefaultMappings(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCustomizerTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink.CUSTOMIZER, EclipseLinkOrmPackage.eINSTANCE.getXmlCustomizerHolder_Customizer());
- }
-
- protected static Translator buildChangeTrackingTranslator() {
- return XmlChangeTracking.buildTranslator(EclipseLink.CHANGE_TRACKING, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_StructConverters());
- }
-
- protected static Translator buildCopyPolicyTranslator() {
- return XmlCopyPolicy.buildTranslator(EclipseLink.COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_CopyPolicy());
- }
-
- protected static Translator buildInstantiationCoypPolicyTranslator() {
- return XmlInstantiationCopyPolicy.buildTranslator(EclipseLink.INSTANTIATION_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_InstantiationCopyPolicy());
- }
-
- protected static Translator buildCloneCopyPolicyTranslator() {
- return XmlCloneCopyPolicy.buildTranslator(EclipseLink.CLONE_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_CloneCopyPolicy());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildParentClassTranslator() {
- return new Translator(EclipseLink2_2.PARENT_CLASS, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEmbeddable_2_2_ParentClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA.ATTRIBUTE_OVERRIDE, OrmPackage.eINSTANCE.getXmlAttributeOverrideContainer_AttributeOverrides());
- }
-
- protected static Translator buildAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(JPA.ASSOCIATION_OVERRIDE, OrmPackage.eINSTANCE.getXmlAssociationOverrideContainer_AssociationOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java
deleted file mode 100644
index 45ee1b7166..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embedded Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded implements XmlEmbedded_2_1, XmlAttributeMapping
-{
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbedded()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_EMBEDDED;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- return getProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbedded_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_EMBEDDED_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbedded_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_EMBEDDED_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEmbedded(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlEmbedded_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java
deleted file mode 100644
index 6ff6d0100c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embedded Id Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId implements XmlEmbeddedId_2_1, XmlAttributeMapping
-{
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddedId()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_EMBEDDED_ID;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- return getProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbeddedId_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_EMBEDDED_ID_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbeddedId_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_EMBEDDED_ID_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddedId(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildAttributeOverrideTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlEmbeddedId_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java
deleted file mode 100644
index 0fe45daf5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java
+++ /dev/null
@@ -1,3763 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Entity</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking <em>Optimistic Locking</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @model kind="class"
- * @generated
- */
-public class XmlEntity extends org.eclipse.jpt.jpa.core.resource.orm.XmlEntity implements XmlEntity_1_1, XmlEntity_2_0, XmlEntity_2_1, XmlEntity_2_2, XmlEntity_2_3, XmlEntity_2_4, XmlReadOnly, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlCacheHolder, XmlConvertersHolder, XmlQueryContainer, XmlPropertyContainer
-{
- /**
- * The cached value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected XmlPrimaryKey primaryKey;
-
- /**
- * The cached value of the '{@link #getCacheInterceptor() <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheInterceptor()
- * @generated
- * @ordered
- */
- protected XmlClassReference cacheInterceptor;
-
- /**
- * The cached value of the '{@link #getQueryRedirectors() <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryRedirectors()
- * @generated
- * @ordered
- */
- protected XmlQueryRedirectors queryRedirectors;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getFetchGroups() <em>Fetch Groups</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetchGroups()
- * @generated
- * @ordered
- */
- protected EList<XmlFetchGroup> fetchGroups;
-
- /**
- * The cached value of the '{@link #getClassExtractor() <em>Class Extractor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassExtractor()
- * @generated
- * @ordered
- */
- protected XmlClassReference classExtractor;
-
- /**
- * The default value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected static final String PARENT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected String parentClass = PARENT_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAdditionalCriteria() <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAdditionalCriteria()
- * @generated
- * @ordered
- */
- protected XmlAdditionalCriteria_2_2 additionalCriteria;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
-
- /**
- * The cached value of the '{@link #getMultitenant() <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMultitenant()
- * @generated
- * @ordered
- */
- protected XmlMultitenant multitenant;
-
- /**
- * The cached value of the '{@link #getNamedStoredFunctionQueries() <em>Named Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredFunctionQuery_2_3> namedStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredFunctionQueries() <em>Named Plsql Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredFunctionQuery_2_3> namedPlsqlStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredProcedureQueries() <em>Named Plsql Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredProcedureQuery_2_3> namedPlsqlStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getStruct() <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStruct()
- * @generated
- * @ordered
- */
- protected XmlStruct_2_3 struct;
-
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
-
- /**
- * The default value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected static final Boolean READ_ONLY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected Boolean readOnly = READ_ONLY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getCustomizer() <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizer()
- * @generated
- * @ordered
- */
- protected XmlClassReference customizer;
-
- /**
- * The cached value of the '{@link #getChangeTracking() <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getChangeTracking()
- * @generated
- * @ordered
- */
- protected XmlChangeTracking changeTracking;
-
- /**
- * The cached value of the '{@link #getCache() <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCache()
- * @generated
- * @ordered
- */
- protected XmlCache cache;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final ExistenceType EXISTENCE_CHECKING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExistenceChecking() <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExistenceChecking()
- * @generated
- * @ordered
- */
- protected ExistenceType existenceChecking = EXISTENCE_CHECKING_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getNamedStoredProcedureQueries() <em>Named Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredProcedureQuery> namedStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getOptimisticLocking() <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptimisticLocking()
- * @generated
- * @ordered
- */
- protected XmlOptimisticLocking optimisticLocking;
-
- /**
- * The cached value of the '{@link #getCopyPolicy() <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCopyPolicy copyPolicy;
-
- /**
- * The cached value of the '{@link #getInstantiationCopyPolicy() <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInstantiationCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlInstantiationCopyPolicy instantiationCopyPolicy;
-
- /**
- * The cached value of the '{@link #getCloneCopyPolicy() <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCloneCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCloneCopyPolicy cloneCopyPolicy;
-
- /**
- * The default value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final Boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected Boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntity()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ENTITY;
- }
-
- /**
- * Returns the value of the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Only</em>' attribute.
- * @see #setReadOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly_ReadOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReadOnly()
- {
- return readOnly;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getReadOnly <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Only</em>' attribute.
- * @see #getReadOnly()
- * @generated
- */
- public void setReadOnly(Boolean newReadOnly)
- {
- Boolean oldReadOnly = readOnly;
- readOnly = newReadOnly;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY, oldReadOnly, readOnly));
- }
-
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlClassReference newCustomizer, NotificationChain msgs)
- {
- XmlClassReference oldCustomizer = customizer;
- customizer = newCustomizer;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, oldCustomizer, newCustomizer);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- public void setCustomizer(XmlClassReference newCustomizer)
- {
- if (newCustomizer != customizer)
- {
- NotificationChain msgs = null;
- if (customizer != null)
- msgs = ((InternalEObject)customizer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, null, msgs);
- if (newCustomizer != null)
- msgs = ((InternalEObject)newCustomizer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, null, msgs);
- msgs = basicSetCustomizer(newCustomizer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, newCustomizer, newCustomizer));
- }
-
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- public XmlChangeTracking getChangeTracking()
- {
- return changeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetChangeTracking(XmlChangeTracking newChangeTracking, NotificationChain msgs)
- {
- XmlChangeTracking oldChangeTracking = changeTracking;
- changeTracking = newChangeTracking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, oldChangeTracking, newChangeTracking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- public void setChangeTracking(XmlChangeTracking newChangeTracking)
- {
- if (newChangeTracking != changeTracking)
- {
- NotificationChain msgs = null;
- if (changeTracking != null)
- msgs = ((InternalEObject)changeTracking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, null, msgs);
- if (newChangeTracking != null)
- msgs = ((InternalEObject)newChangeTracking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, null, msgs);
- msgs = basicSetChangeTracking(newChangeTracking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, newChangeTracking, newChangeTracking));
- }
-
- /**
- * Returns the value of the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache</em>' containment reference.
- * @see #setCache(XmlCache)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_Cache()
- * @model containment="true"
- * @generated
- */
- public XmlCache getCache()
- {
- return cache;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCache(XmlCache newCache, NotificationChain msgs)
- {
- XmlCache oldCache = cache;
- cache = newCache;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE, oldCache, newCache);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCache <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache</em>' containment reference.
- * @see #getCache()
- * @generated
- */
- public void setCache(XmlCache newCache)
- {
- if (newCache != cache)
- {
- NotificationChain msgs = null;
- if (cache != null)
- msgs = ((InternalEObject)cache).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE, null, msgs);
- if (newCache != null)
- msgs = ((InternalEObject)newCache).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE, null, msgs);
- msgs = basicSetCache(newCache, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE, newCache, newCache));
- }
-
- /**
- * Returns the value of the '<em><b>Existence Checking</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Existence Checking</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- public ExistenceType getExistenceChecking()
- {
- return existenceChecking;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExistenceChecking <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #getExistenceChecking()
- * @generated
- */
- public void setExistenceChecking(ExistenceType newExistenceChecking)
- {
- ExistenceType oldExistenceChecking = existenceChecking;
- existenceChecking = newExistenceChecking == null ? EXISTENCE_CHECKING_EDEFAULT : newExistenceChecking;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING, oldExistenceChecking, existenceChecking));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optimistic Locking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #setOptimisticLocking(XmlOptimisticLocking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_OptimisticLocking()
- * @model containment="true"
- * @generated
- */
- public XmlOptimisticLocking getOptimisticLocking()
- {
- return optimisticLocking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOptimisticLocking(XmlOptimisticLocking newOptimisticLocking, NotificationChain msgs)
- {
- XmlOptimisticLocking oldOptimisticLocking = optimisticLocking;
- optimisticLocking = newOptimisticLocking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, oldOptimisticLocking, newOptimisticLocking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #getOptimisticLocking()
- * @generated
- */
- public void setOptimisticLocking(XmlOptimisticLocking newOptimisticLocking)
- {
- if (newOptimisticLocking != optimisticLocking)
- {
- NotificationChain msgs = null;
- if (optimisticLocking != null)
- msgs = ((InternalEObject)optimisticLocking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, null, msgs);
- if (newOptimisticLocking != null)
- msgs = ((InternalEObject)newOptimisticLocking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, null, msgs);
- msgs = basicSetOptimisticLocking(newOptimisticLocking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, newOptimisticLocking, newOptimisticLocking));
- }
-
- /**
- * Returns the value of the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Copy Policy</em>' containment reference.
- * @see #setCopyPolicy(XmlCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_CopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCopyPolicy getCopyPolicy()
- {
- return copyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCopyPolicy(XmlCopyPolicy newCopyPolicy, NotificationChain msgs)
- {
- XmlCopyPolicy oldCopyPolicy = copyPolicy;
- copyPolicy = newCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, oldCopyPolicy, newCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Copy Policy</em>' containment reference.
- * @see #getCopyPolicy()
- * @generated
- */
- public void setCopyPolicy(XmlCopyPolicy newCopyPolicy)
- {
- if (newCopyPolicy != copyPolicy)
- {
- NotificationChain msgs = null;
- if (copyPolicy != null)
- msgs = ((InternalEObject)copyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, null, msgs);
- if (newCopyPolicy != null)
- msgs = ((InternalEObject)newCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, null, msgs);
- msgs = basicSetCopyPolicy(newCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, newCopyPolicy, newCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Instantiation Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #setInstantiationCopyPolicy(XmlInstantiationCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_InstantiationCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlInstantiationCopyPolicy getInstantiationCopyPolicy()
- {
- return instantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy, NotificationChain msgs)
- {
- XmlInstantiationCopyPolicy oldInstantiationCopyPolicy = instantiationCopyPolicy;
- instantiationCopyPolicy = newInstantiationCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, oldInstantiationCopyPolicy, newInstantiationCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #getInstantiationCopyPolicy()
- * @generated
- */
- public void setInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy)
- {
- if (newInstantiationCopyPolicy != instantiationCopyPolicy)
- {
- NotificationChain msgs = null;
- if (instantiationCopyPolicy != null)
- msgs = ((InternalEObject)instantiationCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, null, msgs);
- if (newInstantiationCopyPolicy != null)
- msgs = ((InternalEObject)newInstantiationCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, null, msgs);
- msgs = basicSetInstantiationCopyPolicy(newInstantiationCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, newInstantiationCopyPolicy, newInstantiationCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Clone Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #setCloneCopyPolicy(XmlCloneCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_CloneCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCloneCopyPolicy getCloneCopyPolicy()
- {
- return cloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy, NotificationChain msgs)
- {
- XmlCloneCopyPolicy oldCloneCopyPolicy = cloneCopyPolicy;
- cloneCopyPolicy = newCloneCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, oldCloneCopyPolicy, newCloneCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #getCloneCopyPolicy()
- * @generated
- */
- public void setCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy)
- {
- if (newCloneCopyPolicy != cloneCopyPolicy)
- {
- NotificationChain msgs = null;
- if (cloneCopyPolicy != null)
- msgs = ((InternalEObject)cloneCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, null, msgs);
- if (newCloneCopyPolicy != null)
- msgs = ((InternalEObject)newCloneCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, null, msgs);
- msgs = basicSetCloneCopyPolicy(newCloneCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, newCloneCopyPolicy, newCloneCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries()
- {
- if (namedStoredProcedureQueries == null)
- {
- namedStoredProcedureQueries = new EObjectContainmentEList<XmlNamedStoredProcedureQuery>(XmlNamedStoredProcedureQuery.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES);
- }
- return namedStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- public XmlPrimaryKey getPrimaryKey()
- {
- return primaryKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrimaryKey(XmlPrimaryKey newPrimaryKey, NotificationChain msgs)
- {
- XmlPrimaryKey oldPrimaryKey = primaryKey;
- primaryKey = newPrimaryKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, oldPrimaryKey, newPrimaryKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- public void setPrimaryKey(XmlPrimaryKey newPrimaryKey)
- {
- if (newPrimaryKey != primaryKey)
- {
- NotificationChain msgs = null;
- if (primaryKey != null)
- msgs = ((InternalEObject)primaryKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, null, msgs);
- if (newPrimaryKey != null)
- msgs = ((InternalEObject)newPrimaryKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, null, msgs);
- msgs = basicSetPrimaryKey(newPrimaryKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, newPrimaryKey, newPrimaryKey));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCacheInterceptor()
- {
- return cacheInterceptor;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheInterceptor(XmlClassReference newCacheInterceptor, NotificationChain msgs)
- {
- XmlClassReference oldCacheInterceptor = cacheInterceptor;
- cacheInterceptor = newCacheInterceptor;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, oldCacheInterceptor, newCacheInterceptor);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- public void setCacheInterceptor(XmlClassReference newCacheInterceptor)
- {
- if (newCacheInterceptor != cacheInterceptor)
- {
- NotificationChain msgs = null;
- if (cacheInterceptor != null)
- msgs = ((InternalEObject)cacheInterceptor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, null, msgs);
- if (newCacheInterceptor != null)
- msgs = ((InternalEObject)newCacheInterceptor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, null, msgs);
- msgs = basicSetCacheInterceptor(newCacheInterceptor, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, newCacheInterceptor, newCacheInterceptor));
- }
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_0_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- public XmlQueryRedirectors getQueryRedirectors()
- {
- return queryRedirectors;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetQueryRedirectors(XmlQueryRedirectors newQueryRedirectors, NotificationChain msgs)
- {
- XmlQueryRedirectors oldQueryRedirectors = queryRedirectors;
- queryRedirectors = newQueryRedirectors;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, oldQueryRedirectors, newQueryRedirectors);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- public void setQueryRedirectors(XmlQueryRedirectors newQueryRedirectors)
- {
- if (newQueryRedirectors != queryRedirectors)
- {
- NotificationChain msgs = null;
- if (queryRedirectors != null)
- msgs = ((InternalEObject)queryRedirectors).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, null, msgs);
- if (newQueryRedirectors != null)
- msgs = ((InternalEObject)newQueryRedirectors).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, null, msgs);
- msgs = basicSetQueryRedirectors(newQueryRedirectors, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, newQueryRedirectors, newQueryRedirectors));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch Groups</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch Groups</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch Groups</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroupContainer_2_1_FetchGroups()
- * @model containment="true"
- * @generated
- */
- public EList<XmlFetchGroup> getFetchGroups()
- {
- if (fetchGroups == null)
- {
- fetchGroups = new EObjectContainmentEList<XmlFetchGroup>(XmlFetchGroup.class, this, EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS);
- }
- return fetchGroups;
- }
-
- /**
- * Returns the value of the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Extractor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Extractor</em>' containment reference.
- * @see #setClassExtractor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_1_ClassExtractor()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getClassExtractor()
- {
- return classExtractor;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetClassExtractor(XmlClassReference newClassExtractor, NotificationChain msgs)
- {
- XmlClassReference oldClassExtractor = classExtractor;
- classExtractor = newClassExtractor;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, oldClassExtractor, newClassExtractor);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getClassExtractor <em>Class Extractor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Extractor</em>' containment reference.
- * @see #getClassExtractor()
- * @generated
- */
- public void setClassExtractor(XmlClassReference newClassExtractor)
- {
- if (newClassExtractor != classExtractor)
- {
- NotificationChain msgs = null;
- if (classExtractor != null)
- msgs = ((InternalEObject)classExtractor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, null, msgs);
- if (newClassExtractor != null)
- msgs = ((InternalEObject)newClassExtractor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, null, msgs);
- msgs = basicSetClassExtractor(newClassExtractor, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, newClassExtractor, newClassExtractor));
- }
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getParentClass()
- {
- return parentClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- public void setParentClass(String newParentClass)
- {
- String oldParentClass = parentClass;
- parentClass = newParentClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS, oldParentClass, parentClass));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Multitenant</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Multitenant</em>' containment reference.
- * @see #setMultitenant(XmlMultitenant)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder_Multitenant()
- * @model containment="true"
- * @generated
- */
- public XmlMultitenant getMultitenant()
- {
- return multitenant;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMultitenant(XmlMultitenant newMultitenant, NotificationChain msgs)
- {
- XmlMultitenant oldMultitenant = multitenant;
- multitenant = newMultitenant;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, oldMultitenant, newMultitenant);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getMultitenant <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Multitenant</em>' containment reference.
- * @see #getMultitenant()
- * @generated
- */
- public void setMultitenant(XmlMultitenant newMultitenant)
- {
- if (newMultitenant != multitenant)
- {
- NotificationChain msgs = null;
- if (multitenant != null)
- msgs = ((InternalEObject)multitenant).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, null, msgs);
- if (newMultitenant != null)
- msgs = ((InternalEObject)newMultitenant).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, null, msgs);
- msgs = basicSetMultitenant(newMultitenant, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, newMultitenant, newMultitenant));
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries()
- {
- if (namedStoredFunctionQueries == null)
- {
- namedStoredFunctionQueries = new EObjectContainmentEList<XmlNamedStoredFunctionQuery_2_3>(XmlNamedStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES);
- }
- return namedStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries()
- {
- if (namedPlsqlStoredFunctionQueries == null)
- {
- namedPlsqlStoredFunctionQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredFunctionQuery_2_3>(XmlNamedPlsqlStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- }
- return namedPlsqlStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries()
- {
- if (namedPlsqlStoredProcedureQueries == null)
- {
- namedPlsqlStoredProcedureQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredProcedureQuery_2_3>(XmlNamedPlsqlStoredProcedureQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- }
- return namedPlsqlStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- public XmlStruct_2_3 getStruct()
- {
- return struct;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStruct(XmlStruct_2_3 newStruct, NotificationChain msgs)
- {
- XmlStruct_2_3 oldStruct = struct;
- struct = newStruct;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__STRUCT, oldStruct, newStruct);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- public void setStruct(XmlStruct_2_3 newStruct)
- {
- if (newStruct != struct)
- {
- NotificationChain msgs = null;
- if (struct != null)
- msgs = ((InternalEObject)struct).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__STRUCT, null, msgs);
- if (newStruct != null)
- msgs = ((InternalEObject)newStruct).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__STRUCT, null, msgs);
- msgs = basicSetStruct(newStruct, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__STRUCT, newStruct, newStruct));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- public XmlAdditionalCriteria_2_2 getAdditionalCriteria()
- {
- return additionalCriteria;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria, NotificationChain msgs)
- {
- XmlAdditionalCriteria_2_2 oldAdditionalCriteria = additionalCriteria;
- additionalCriteria = newAdditionalCriteria;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, oldAdditionalCriteria, newAdditionalCriteria);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- public void setAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria)
- {
- if (newAdditionalCriteria != additionalCriteria)
- {
- NotificationChain msgs = null;
- if (additionalCriteria != null)
- msgs = ((InternalEObject)additionalCriteria).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, null, msgs);
- if (newAdditionalCriteria != null)
- msgs = ((InternalEObject)newAdditionalCriteria).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, null, msgs);
- msgs = basicSetAdditionalCriteria(newAdditionalCriteria, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, newAdditionalCriteria, newAdditionalCriteria));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #getExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(Boolean newExcludeDefaultMappings)
- {
- Boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- return basicSetPrimaryKey(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- return basicSetCacheInterceptor(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- return basicSetQueryRedirectors(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- return ((InternalEList<?>)getFetchGroups()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- return basicSetClassExtractor(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- return basicSetAdditionalCriteria(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- return basicSetMultitenant(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- return basicSetStruct(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- return basicSetCustomizer(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- return basicSetChangeTracking(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- return basicSetCache(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- return basicSetOptimisticLocking(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- return basicSetCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- return basicSetInstantiationCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- return basicSetCloneCopyPolicy(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- return getPrimaryKey();
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- return getCacheInterceptor();
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- return getQueryRedirectors();
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- return getFetchGroups();
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- return getClassExtractor();
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- return getParentClass();
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- return getAdditionalCriteria();
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- return getMultitenant();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- return getNamedStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return getNamedPlsqlStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return getNamedPlsqlStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- return getStruct();
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- return getReadOnly();
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- return getCustomizer();
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- return getChangeTracking();
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- return getCache();
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- return getExistenceChecking();
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- return getNamedStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- return getOptimisticLocking();
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- return getCopyPolicy();
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- return getInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- return getCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- return getExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- getFetchGroups().clear();
- getFetchGroups().addAll((Collection<? extends XmlFetchGroup>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- setClassExtractor((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- setParentClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- setMultitenant((XmlMultitenant)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- getNamedStoredFunctionQueries().addAll((Collection<? extends XmlNamedStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- getNamedPlsqlStoredFunctionQueries().addAll((Collection<? extends XmlNamedPlsqlStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- getNamedPlsqlStoredProcedureQueries().addAll((Collection<? extends XmlNamedPlsqlStoredProcedureQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- setStruct((XmlStruct_2_3)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- setReadOnly((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- setCustomizer((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- setCache((XmlCache)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- setExistenceChecking((ExistenceType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- getNamedStoredProcedureQueries().addAll((Collection<? extends XmlNamedStoredProcedureQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- getFetchGroups().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- setClassExtractor((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- setParentClass(PARENT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- setMultitenant((XmlMultitenant)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- setStruct((XmlStruct_2_3)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- setReadOnly(READ_ONLY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- setCustomizer((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- setCache((XmlCache)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- setExistenceChecking(EXISTENCE_CHECKING_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- return primaryKey != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- return cacheInterceptor != null;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- return queryRedirectors != null;
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- return fetchGroups != null && !fetchGroups.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- return classExtractor != null;
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- return PARENT_CLASS_EDEFAULT == null ? parentClass != null : !PARENT_CLASS_EDEFAULT.equals(parentClass);
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- return additionalCriteria != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- return multitenant != null;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- return namedStoredFunctionQueries != null && !namedStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return namedPlsqlStoredFunctionQueries != null && !namedPlsqlStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return namedPlsqlStoredProcedureQueries != null && !namedPlsqlStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- return struct != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- return READ_ONLY_EDEFAULT == null ? readOnly != null : !READ_ONLY_EDEFAULT.equals(readOnly);
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- return customizer != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- return changeTracking != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- return cache != null;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- return existenceChecking != EXISTENCE_CHECKING_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- return namedStoredProcedureQueries != null && !namedStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- return optimisticLocking != null;
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- return copyPolicy != null;
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- return instantiationCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- return cloneCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- return EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT == null ? excludeDefaultMappings != null : !EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT.equals(excludeDefaultMappings);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEntity_1_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY: return EclipseLinkOrmV1_1Package.XML_ENTITY_11__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR: return EclipseLinkOrmV2_0Package.XML_ENTITY_20__CACHE_INTERCEPTOR;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS: return EclipseLinkOrmV2_0Package.XML_ENTITY_20__QUERY_REDIRECTORS;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS: return EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR: return EclipseLinkOrmV2_1Package.XML_ENTITY_21__CLASS_EXTRACTOR;
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS: return EclipseLinkOrmV2_1Package.XML_ENTITY_21__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA: return EclipseLinkOrmV2_2Package.XML_ENTITY_22__ADDITIONAL_CRITERIA;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ENTITY_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX: return EclipseLinkOrmV2_2Package.XML_ENTITY_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT: return EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_TABLES;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_ENTITY_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY: return EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER: return EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEntity_1_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV1_1Package.XML_ENTITY_11__PRIMARY_KEY: return EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_ENTITY_20__CACHE_INTERCEPTOR: return EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR;
- case EclipseLinkOrmV2_0Package.XML_ENTITY_20__QUERY_REDIRECTORS: return EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS: return EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_ENTITY_21__CLASS_EXTRACTOR: return EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR;
- case EclipseLinkOrmV2_1Package.XML_ENTITY_21__PARENT_CLASS: return EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ENTITY_22__ADDITIONAL_CRITERIA: return EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_22__INDEX: return EclipseLinkOrmPackage.XML_ENTITY__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT: return EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__STRUCT: return EclipseLinkOrmPackage.XML_ENTITY__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ENTITY_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY: return EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER: return EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE: return EclipseLinkOrmPackage.XML_ENTITY__CACHE;
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (parentClass: ");
- result.append(parentClass);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", readOnly: ");
- result.append(readOnly);
- result.append(", existenceChecking: ");
- result.append(existenceChecking);
- result.append(", excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReadOnlyTextRange() {
- return getAttributeTextRange(EclipseLink.READ_ONLY);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEntity(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildClassTranslator(),
- buildParentClassTranslator(),
- buildAccessTranslator(),
- buildCacheableTranslator(),
- buildMetadataCompleteTranslator(),
- buildReadOnlyTranslator(),
- buildExistenceCheckingTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- buildDescriptionTranslator(),
- buildAccessMethodsTranslator(),
- XmlMultitenant.buildTranslator(EclipseLink2_3.MULTITENANT, EclipseLinkOrmPackage.eINSTANCE.getXmlMultitenantHolder_Multitenant()),
- buildAdditionalCriteriaTranslator(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- buildTableTranslator(),
- buildSecondaryTableTranslator(),
- XmlStruct.buildTranslator(EclipseLink2_3.STRUCT, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_Struct()),
- buildPrimaryKeyJoinColumnTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildIndexTranslator(),
- buildIdClassTranslator(),
- buildPrimaryKeyTranslator(),
- buildInheritanceTranslator(),
- buildDiscriminatorValueTranslator(),
- buildDiscriminatorColumnTranslator(),
- buildClassExtractorTranslator(),
- buildOptimisticLockingTranslator(),
- buildCacheTranslator(),
- buildCacheInterceptorTranslator(),
- buildCacheIndexTranslator(),
- buildFetchGroupsTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- buildSequenceGeneratorTranslator(),
- buildTableGeneratorTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- buildNamedQueryTranslator(),
- buildNamedNativeQueryTranslator(),
- buildNamedStoredProcedureQueryTranslator(),
- XmlNamedStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_NamedStoredFunctionQueries()),
- XmlNamedPlsqlStoredProcedureQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()),
- XmlNamedPlsqlStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_PlsqlTables()),
- buildSqlResultSetMappingTranslator(),
- buildQueryRedirectorsTranslator(),
- buildExcludeDefaultListenersTranslator(),
- buildExcludeSuperclassListenersTranslator(),
- buildEntityListenersTranslator(),
- buildPrePersistTranslator(),
- buildPostPersistTranslator(),
- buildPreRemoveTranslator(),
- buildPostRemoveTranslator(),
- buildPreUpdateTranslator(),
- buildPostUpdateTranslator(),
- buildPostLoadTranslator(),
- buildPropertyTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- Attributes.buildTranslator()};
- }
-
- protected static Translator buildCustomizerTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink.CUSTOMIZER, EclipseLinkOrmPackage.eINSTANCE.getXmlCustomizerHolder_Customizer());
- }
-
- protected static Translator buildChangeTrackingTranslator() {
- return XmlChangeTracking.buildTranslator(EclipseLink.CHANGE_TRACKING, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking());
- }
-
- protected static Translator buildPrimaryKeyTranslator() {
- return XmlPrimaryKey.buildTranslator(EclipseLink1_1.PRIMARY_KEY, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlEntity_1_1_PrimaryKey());
- }
-
- protected static Translator buildClassExtractorTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink2_1.CLASS_EXTRACTOR, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlEntity_2_1_ClassExtractor());
- }
-
- protected static Translator buildOptimisticLockingTranslator() {
- return XmlOptimisticLocking.buildTranslator(EclipseLink.OPTIMISTIC_LOCKING, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_OptimisticLocking());
- }
-
- protected static Translator buildCacheTranslator() {
- return XmlCache.buildTranslator(EclipseLink.CACHE, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_Cache());
- }
-
- protected static Translator buildCacheInterceptorTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink2_0.CACHE_INTERCEPTOR, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlEntity_2_0_CacheInterceptor());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlEntity_2_4_CacheIndex());
- }
-
- protected static Translator buildFetchGroupsTranslator() {
- return XmlFetchGroup.buildTranslator(EclipseLink2_1.FETCH_GROUP, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroupContainer_2_1_FetchGroups());
- }
-
- protected static Translator buildQueryRedirectorsTranslator() {
- return XmlQueryRedirectors.buildTranslator(EclipseLink2_0.QUERY_REDIRECTORS, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlEntity_2_0_QueryRedirectors());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_StructConverters());
- }
-
- protected static Translator buildCopyPolicyTranslator() {
- return XmlCopyPolicy.buildTranslator(EclipseLink.COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_CopyPolicy());
- }
-
- protected static Translator buildInstantiationCoypPolicyTranslator() {
- return XmlInstantiationCopyPolicy.buildTranslator(EclipseLink.INSTANTIATION_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_InstantiationCopyPolicy());
- }
-
- protected static Translator buildCloneCopyPolicyTranslator() {
- return XmlCloneCopyPolicy.buildTranslator(EclipseLink.CLONE_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_CloneCopyPolicy());
- }
-
- protected static Translator buildReadOnlyTranslator() {
- return new Translator(EclipseLink.READ_ONLY, EclipseLinkOrmPackage.eINSTANCE.getXmlReadOnly_ReadOnly(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExistenceCheckingTranslator() {
- return new Translator(EclipseLink.EXISTENCE_CHECKING, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_ExistenceChecking(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new Translator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_ExcludeDefaultMappings(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildNamedStoredProcedureQueryTranslator() {
- return XmlNamedStoredProcedureQuery.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY, EclipseLinkOrmPackage.eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildParentClassTranslator() {
- return new Translator(EclipseLink2_1.PARENT_CLASS, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlEntity_2_1_ParentClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAdditionalCriteriaTranslator() {
- return XmlAdditionalCriteria.buildTranslator(EclipseLink2_2.ADDITIONAL_CRITERIA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntity_2_2_AdditionalCriteria());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntity_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntity_2_2_Index());
- }
-
- protected static Translator buildTableTranslator() {
- return XmlTable.buildTranslator(JPA.TABLE, OrmPackage.eINSTANCE.getXmlEntity_Table());
- }
-
- protected static Translator buildSecondaryTableTranslator() {
- return XmlSecondaryTable.buildTranslator(JPA.SECONDARY_TABLE, OrmPackage.eINSTANCE.getXmlEntity_SecondaryTables());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java
deleted file mode 100644
index 030f6c7b00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java
+++ /dev/null
@@ -1,1368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleRootTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Entity Mappings</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @model kind="class"
- * @generated
- */
-public class XmlEntityMappings extends org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings implements XmlEntityMappings_2_1, XmlEntityMappings_2_2, XmlEntityMappings_2_3, XmlConvertersHolder, XmlQueryContainer
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlPartitioning_2_2> partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlReplicationPartitioning_2_2> replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlRoundRobinPartitioning_2_2> roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlPinnedPartitioning_2_2> pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlRangePartitioning_2_2> rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlValuePartitioning_2_2> valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlHashPartitioning_2_2> hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlUnionPartitioning_2_2> unionPartitioning;
-
- /**
- * The cached value of the '{@link #getTenantDiscriminatorColumns() <em>Tenant Discriminator Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTenantDiscriminatorColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumns;
-
- /**
- * The cached value of the '{@link #getNamedStoredFunctionQueries() <em>Named Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredFunctionQuery_2_3> namedStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredFunctionQueries() <em>Named Plsql Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredFunctionQuery_2_3> namedPlsqlStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredProcedureQueries() <em>Named Plsql Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredProcedureQuery_2_3> namedPlsqlStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getNamedStoredProcedureQueries() <em>Named Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredProcedureQuery> namedStoredProcedureQueries;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntityMappings()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ENTITY_MAPPINGS;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPartitioning_2_2> getPartitioning()
- {
- if (partitioning == null)
- {
- partitioning = new EObjectContainmentEList<XmlPartitioning_2_2>(XmlPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING);
- }
- return partitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlReplicationPartitioning_2_2> getReplicationPartitioning()
- {
- if (replicationPartitioning == null)
- {
- replicationPartitioning = new EObjectContainmentEList<XmlReplicationPartitioning_2_2>(XmlReplicationPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING);
- }
- return replicationPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlRoundRobinPartitioning_2_2> getRoundRobinPartitioning()
- {
- if (roundRobinPartitioning == null)
- {
- roundRobinPartitioning = new EObjectContainmentEList<XmlRoundRobinPartitioning_2_2>(XmlRoundRobinPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING);
- }
- return roundRobinPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPinnedPartitioning_2_2> getPinnedPartitioning()
- {
- if (pinnedPartitioning == null)
- {
- pinnedPartitioning = new EObjectContainmentEList<XmlPinnedPartitioning_2_2>(XmlPinnedPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING);
- }
- return pinnedPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlRangePartitioning_2_2> getRangePartitioning()
- {
- if (rangePartitioning == null)
- {
- rangePartitioning = new EObjectContainmentEList<XmlRangePartitioning_2_2>(XmlRangePartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING);
- }
- return rangePartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlValuePartitioning_2_2> getValuePartitioning()
- {
- if (valuePartitioning == null)
- {
- valuePartitioning = new EObjectContainmentEList<XmlValuePartitioning_2_2>(XmlValuePartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING);
- }
- return valuePartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlHashPartitioning_2_2> getHashPartitioning()
- {
- if (hashPartitioning == null)
- {
- hashPartitioning = new EObjectContainmentEList<XmlHashPartitioning_2_2>(XmlHashPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING);
- }
- return hashPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlUnionPartitioning_2_2> getUnionPartitioning()
- {
- if (unionPartitioning == null)
- {
- unionPartitioning = new EObjectContainmentEList<XmlUnionPartitioning_2_2>(XmlUnionPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING);
- }
- return unionPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns()
- {
- if (tenantDiscriminatorColumns == null)
- {
- tenantDiscriminatorColumns = new EObjectContainmentEList<XmlTenantDiscriminatorColumn_2_3>(XmlTenantDiscriminatorColumn_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS);
- }
- return tenantDiscriminatorColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries()
- {
- if (namedStoredFunctionQueries == null)
- {
- namedStoredFunctionQueries = new EObjectContainmentEList<XmlNamedStoredFunctionQuery_2_3>(XmlNamedStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES);
- }
- return namedStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries()
- {
- if (namedPlsqlStoredFunctionQueries == null)
- {
- namedPlsqlStoredFunctionQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredFunctionQuery_2_3>(XmlNamedPlsqlStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- }
- return namedPlsqlStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries()
- {
- if (namedPlsqlStoredProcedureQueries == null)
- {
- namedPlsqlStoredProcedureQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredProcedureQuery_2_3>(XmlNamedPlsqlStoredProcedureQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- }
- return namedPlsqlStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries()
- {
- if (namedStoredProcedureQueries == null)
- {
- namedStoredProcedureQueries = new EObjectContainmentEList<XmlNamedStoredProcedureQuery>(XmlNamedStoredProcedureQuery.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES);
- }
- return namedStoredProcedureQueries;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- return ((InternalEList<?>)getPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- return ((InternalEList<?>)getReplicationPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- return ((InternalEList<?>)getRoundRobinPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- return ((InternalEList<?>)getPinnedPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- return ((InternalEList<?>)getRangePartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- return ((InternalEList<?>)getValuePartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- return ((InternalEList<?>)getHashPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- return ((InternalEList<?>)getUnionPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- return ((InternalEList<?>)getTenantDiscriminatorColumns()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- return getTenantDiscriminatorColumns();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- return getNamedStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return getNamedPlsqlStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return getNamedPlsqlStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- return getNamedStoredProcedureQueries();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- getPartitioning().clear();
- getPartitioning().addAll((Collection<? extends XmlPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- getReplicationPartitioning().clear();
- getReplicationPartitioning().addAll((Collection<? extends XmlReplicationPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- getRoundRobinPartitioning().clear();
- getRoundRobinPartitioning().addAll((Collection<? extends XmlRoundRobinPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- getPinnedPartitioning().clear();
- getPinnedPartitioning().addAll((Collection<? extends XmlPinnedPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- getRangePartitioning().clear();
- getRangePartitioning().addAll((Collection<? extends XmlRangePartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- getValuePartitioning().clear();
- getValuePartitioning().addAll((Collection<? extends XmlValuePartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- getHashPartitioning().clear();
- getHashPartitioning().addAll((Collection<? extends XmlHashPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- getUnionPartitioning().clear();
- getUnionPartitioning().addAll((Collection<? extends XmlUnionPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- getTenantDiscriminatorColumns().addAll((Collection<? extends XmlTenantDiscriminatorColumn_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- getNamedStoredFunctionQueries().addAll((Collection<? extends XmlNamedStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- getNamedPlsqlStoredFunctionQueries().addAll((Collection<? extends XmlNamedPlsqlStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- getNamedPlsqlStoredProcedureQueries().addAll((Collection<? extends XmlNamedPlsqlStoredProcedureQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- getNamedStoredProcedureQueries().addAll((Collection<? extends XmlNamedStoredProcedureQuery>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- getPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- getReplicationPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- getRoundRobinPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- getPinnedPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- getRangePartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- getValuePartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- getHashPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- getUnionPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- return partitioning != null && !partitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- return replicationPartitioning != null && !replicationPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null && !roundRobinPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- return pinnedPartitioning != null && !pinnedPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- return rangePartitioning != null && !rangePartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- return valuePartitioning != null && !valuePartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- return hashPartitioning != null && !hashPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- return unionPartitioning != null && !unionPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- return tenantDiscriminatorColumns != null && !tenantDiscriminatorColumns.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- return namedStoredFunctionQueries != null && !namedStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return namedPlsqlStoredFunctionQueries != null && !namedPlsqlStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return namedPlsqlStoredProcedureQueries != null && !namedPlsqlStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- return namedStoredProcedureQueries != null && !namedStoredProcedureQueries.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // **************** version -> schema location mapping ********************
-
- private static String namespace = EclipseLink.SCHEMA_NAMESPACE;
-
- @Override
- protected String getNamespace() {
- return namespace;
- }
-
- private static Map<String, String> versionsToSchemaLocations = buildVersionsToSchemaLocations();
-
- private static Map<String, String> buildVersionsToSchemaLocations() {
- Map<String, String> map = new HashMap<String, String>();
- map.put(EclipseLink.SCHEMA_VERSION, EclipseLink.SCHEMA_LOCATION);
- map.put(EclipseLink1_1.SCHEMA_VERSION, EclipseLink1_1.SCHEMA_LOCATION);
- map.put(EclipseLink1_2.SCHEMA_VERSION, EclipseLink1_2.SCHEMA_LOCATION);
- map.put(EclipseLink2_0.SCHEMA_VERSION, EclipseLink2_0.SCHEMA_LOCATION);
- map.put(EclipseLink2_1.SCHEMA_VERSION, EclipseLink2_1.SCHEMA_LOCATION);
- map.put(EclipseLink2_2.SCHEMA_VERSION, EclipseLink2_2.SCHEMA_LOCATION);
- map.put(EclipseLink2_3.SCHEMA_VERSION, EclipseLink2_3.SCHEMA_LOCATION);
- map.put(EclipseLink2_4.SCHEMA_VERSION, EclipseLink2_4.SCHEMA_LOCATION);
- return map;
- }
-
- @Override
- protected String getSchemaLocationForVersion(String version) {
- return versionsToSchemaLocations.get(version);
- }
-
-
- // **************** translators *******************************************
-
- private static final Translator ROOT_TRANSLATOR = buildRootTranslator();
-
- public static Translator getRootTranslator() {
- return ROOT_TRANSLATOR;
- }
-
- private static Translator buildRootTranslator() {
- return new SimpleRootTranslator(
- JPA.ENTITY_MAPPINGS,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEntityMappings(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildVersionTranslator(versionsToSchemaLocations),
- buildNamespaceTranslator(namespace),
- buildSchemaNamespaceTranslator(),
- buildSchemaLocationTranslator(namespace, versionsToSchemaLocations),
- buildDescriptionTranslator(),
- XmlPersistenceUnitMetadata.buildTranslator(JPA.PERSISTENCE_UNIT_METADATA, OrmPackage.eINSTANCE.getXmlEntityMappings_PersistenceUnitMetadata()),
- buildPackageTranslator(),
- buildSchemaTranslator(),
- buildCatalogTranslator(),
- buildAccessTranslator(),
- buildAccessMethodsTranslator(),
- XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_TenantDiscriminatorColumns()),
- XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_Converters()),
- XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_TypeConverters()),
- XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_ObjectTypeConverters()),
- XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_StructConverters()),
- XmlSequenceGenerator.buildTranslator(JPA.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlEntityMappings_SequenceGenerators()),
- XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlEntityMappings_TableGenerators()),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_UnionPartitioning()),
- XmlNamedQuery.buildTranslator(JPA.NAMED_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedQueries()),
- XmlNamedNativeQuery.buildTranslator(JPA.NAMED_NATIVE_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedNativeQueries()),
- XmlNamedStoredProcedureQuery.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY, EclipseLinkOrmPackage.eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries()),
- XmlNamedStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_NamedStoredFunctionQueries()),
- XmlNamedPlsqlStoredProcedureQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()),
- XmlNamedPlsqlStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_PlsqlTables()),
- SqlResultSetMapping.buildTranslator(JPA.SQL_RESULT_SET_MAPPING, OrmPackage.eINSTANCE.getXmlEntityMappings_SqlResultSetMappings()),
- XmlMappedSuperclass.buildTranslator(JPA.MAPPED_SUPERCLASS, OrmPackage.eINSTANCE.getXmlEntityMappings_MappedSuperclasses()),
- XmlEntity.buildTranslator(JPA.ENTITY, OrmPackage.eINSTANCE.getXmlEntityMappings_Entities()),
- XmlEmbeddable.buildTranslator(JPA.EMBEDDABLE, OrmPackage.eINSTANCE.getXmlEntityMappings_Embeddables()),
- };
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java
deleted file mode 100644
index 0a3bde590a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Attribute</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute()
- * @model kind="class"
- * @generated
- */
-public class XmlFetchAttribute extends AbstractJpaEObject implements XmlFetchAttribute_2_1
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlFetchAttribute()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_FETCH_ATTRIBUTE;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()};
- }
-
- private static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_1.NAME, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchAttribute_2_1_Name(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java
deleted file mode 100644
index 292ffda1c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Group</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup()
- * @model kind="class"
- * @generated
- */
-public class XmlFetchGroup extends AbstractJpaEObject implements XmlFetchGroup_2_1
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getLoad() <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLoad()
- * @generated
- * @ordered
- */
- protected static final Boolean LOAD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLoad() <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLoad()
- * @generated
- * @ordered
- */
- protected Boolean load = LOAD_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributes()
- * @generated
- * @ordered
- */
- protected EList<XmlFetchAttribute> attributes;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlFetchGroup()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_FETCH_GROUP;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attributes</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup_2_1_Attributes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlFetchAttribute> getAttributes()
- {
- if (attributes == null)
- {
- attributes = new EObjectContainmentEList<XmlFetchAttribute>(XmlFetchAttribute.class, this, EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES);
- }
- return attributes;
- }
-
- /**
- * Returns the value of the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Load</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Load</em>' attribute.
- * @see #setLoad(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup_2_1_Load()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getLoad()
- {
- return load;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup#getLoad <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Load</em>' attribute.
- * @see #getLoad()
- * @generated
- */
- public void setLoad(Boolean newLoad)
- {
- Boolean oldLoad = load;
- load = newLoad;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD, oldLoad, load));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- return getLoad();
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- return getAttributes();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- setLoad((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- getAttributes().clear();
- getAttributes().addAll((Collection<? extends XmlFetchAttribute>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- setLoad(LOAD_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- getAttributes().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- return LOAD_EDEFAULT == null ? load != null : !LOAD_EDEFAULT.equals(load);
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- return attributes != null && !attributes.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", load: ");
- result.append(load);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildLoadTranslator(),
- buildAttributesTranslator()};
- }
-
- private static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroup_2_1_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- private static Translator buildAttributesTranslator() {
- return XmlFetchAttribute.buildTranslator(EclipseLink2_1.ATTRIBUTE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroup_2_1_Attributes());
- }
-
- protected static Translator buildLoadTranslator() {
- return new Translator(EclipseLink2_1.FETCH_GROUP__LOAD, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroup_2_1_Load(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java
deleted file mode 100644
index 0a4f63c6ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Hash Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlHashPartitioning extends AbstractJpaEObject implements XmlHashPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlHashPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_HASH_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlHashPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlHashPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlHashPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java
deleted file mode 100644
index 4ba59442e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java
+++ /dev/null
@@ -1,1256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Id</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @model kind="class"
- * @generated
- */
-public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implements XmlId_2_1, XmlId_2_2, XmlId_2_4, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping
-{
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
-
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getMutable() <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMutable()
- * @generated
- * @ordered
- */
- protected static final Boolean MUTABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMutable() <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMutable()
- * @generated
- * @ordered
- */
- protected Boolean mutable = MUTABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected XmlConverter converter;
-
- /**
- * The cached value of the '{@link #getTypeConverter() <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlTypeConverter typeConverter;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverter() <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlObjectTypeConverter objectTypeConverter;
-
- /**
- * The cached value of the '{@link #getStructConverter() <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverter()
- * @generated
- * @ordered
- */
- protected XmlStructConverter structConverter;
-
- /**
- * The default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlId()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ID;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMutable()
- {
- return mutable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- public void setMutable(Boolean newMutable)
- {
- Boolean oldMutable = mutable;
- mutable = newMutable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__MUTABLE, oldMutable, mutable));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ID__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' containment reference.
- * @see #setConverter(XmlConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- public XmlConverter getConverter()
- {
- return converter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetConverter(XmlConverter newConverter, NotificationChain msgs)
- {
- XmlConverter oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CONVERTER, oldConverter, newConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getConverter <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' containment reference.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(XmlConverter newConverter)
- {
- if (newConverter != converter)
- {
- NotificationChain msgs = null;
- if (converter != null)
- msgs = ((InternalEObject)converter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CONVERTER, newConverter, newConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converter</em>' containment reference.
- * @see #setTypeConverter(XmlTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlTypeConverter getTypeConverter()
- {
- return typeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTypeConverter(XmlTypeConverter newTypeConverter, NotificationChain msgs)
- {
- XmlTypeConverter oldTypeConverter = typeConverter;
- typeConverter = newTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER, oldTypeConverter, newTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getTypeConverter <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Converter</em>' containment reference.
- * @see #getTypeConverter()
- * @generated
- */
- public void setTypeConverter(XmlTypeConverter newTypeConverter)
- {
- if (newTypeConverter != typeConverter)
- {
- NotificationChain msgs = null;
- if (typeConverter != null)
- msgs = ((InternalEObject)typeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER, null, msgs);
- msgs = basicSetTypeConverter(newTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER, newTypeConverter, newTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converter</em>' containment reference.
- * @see #setObjectTypeConverter(XmlObjectTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlObjectTypeConverter getObjectTypeConverter()
- {
- return objectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter, NotificationChain msgs)
- {
- XmlObjectTypeConverter oldObjectTypeConverter = objectTypeConverter;
- objectTypeConverter = newObjectTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER, oldObjectTypeConverter, newObjectTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getObjectTypeConverter <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type Converter</em>' containment reference.
- * @see #getObjectTypeConverter()
- * @generated
- */
- public void setObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter)
- {
- if (newObjectTypeConverter != objectTypeConverter)
- {
- NotificationChain msgs = null;
- if (objectTypeConverter != null)
- msgs = ((InternalEObject)objectTypeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER, null, msgs);
- msgs = basicSetObjectTypeConverter(newObjectTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER, newObjectTypeConverter, newObjectTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converter</em>' containment reference.
- * @see #setStructConverter(XmlStructConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- public XmlStructConverter getStructConverter()
- {
- return structConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStructConverter(XmlStructConverter newStructConverter, NotificationChain msgs)
- {
- XmlStructConverter oldStructConverter = structConverter;
- structConverter = newStructConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER, oldStructConverter, newStructConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getStructConverter <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct Converter</em>' containment reference.
- * @see #getStructConverter()
- * @generated
- */
- public void setStructConverter(XmlStructConverter newStructConverter)
- {
- if (newStructConverter != structConverter)
- {
- NotificationChain msgs = null;
- if (structConverter != null)
- msgs = ((InternalEObject)structConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER, null, msgs);
- msgs = basicSetStructConverter(newStructConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER, newStructConverter, newStructConverter));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ID__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ID__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER:
- return basicSetStructConverter(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ID__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_ID__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- return getConvert();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- setConvert((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ID__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ID__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_ID__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlId_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_ID_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlId_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__INDEX: return EclipseLinkOrmV2_2Package.XML_ID_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlId_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_ID_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlId_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_ID_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlId_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ID_22__INDEX: return EclipseLinkOrmPackage.XML_ID__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlId_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ID_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_ID__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ID__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_ID__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_ID__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_ID__CONVERT;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(", mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLink.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlId(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildMutableTranslator(),
- buildAttributeTypeTranslator(),
- buildColumnTranslator(),
- buildIndexTranslator(),
- buildCacheIndexTranslator(),
- buildGeneratedValueTranslator(),
- buildTemporalTranslator(),
- buildEnumeratedTranslator(),
- buildConvertTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildTableGeneratorTranslator(),
- buildSequenceGeneratorTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildMutableTranslator() {
- return new Translator(EclipseLink.MUTABLE, EclipseLinkOrmPackage.eINSTANCE.getXmlMutable_Mutable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlId_2_2_Index());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlId_2_4_CacheIndex());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_Converter());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_TypeConverter());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_StructConverter());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlId_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildEnumeratedTranslator() {
- return new Translator(JPA.ENUMERATED, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Enumerated());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java
deleted file mode 100644
index 35a950e5b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Index</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex()
- * @model kind="class"
- * @generated
- */
-public class XmlIndex extends AbstractJpaEObject implements XmlIndex_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected static final String SCHEMA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected String schema = SCHEMA_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected static final String CATALOG_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected String catalog = CATALOG_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected static final String TABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected String table = TABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUnique() <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnique()
- * @generated
- * @ordered
- */
- protected static final Boolean UNIQUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUnique() <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnique()
- * @generated
- * @ordered
- */
- protected Boolean unique = UNIQUE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnNames()
- * @generated
- * @ordered
- */
- protected EList<String> columnNames;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlIndex()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_INDEX;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- public void setSchema(String newSchema)
- {
- String oldSchema = schema;
- schema = newSchema;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCatalog()
- {
- return catalog;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- public void setCatalog(String newCatalog)
- {
- String oldCatalog = catalog;
- catalog = newCatalog;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTable()
- {
- return table;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- public void setTable(String newTable)
- {
- String oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__TABLE, oldTable, table));
- }
-
- /**
- * Returns the value of the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique</em>' attribute.
- * @see #setUnique(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Unique()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getUnique()
- {
- return unique;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getUnique <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Unique</em>' attribute.
- * @see #getUnique()
- * @generated
- */
- public void setUnique(Boolean newUnique)
- {
- Boolean oldUnique = unique;
- unique = newUnique;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__UNIQUE, oldUnique, unique));
- }
-
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public EList<String> getColumnNames()
- {
- if (columnNames == null)
- {
- columnNames = new EDataTypeEList<String>(String.class, this, EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES);
- }
- return columnNames;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- return getSchema();
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- return getCatalog();
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- return getTable();
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- return getUnique();
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- return getColumnNames();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- setSchema((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- setCatalog((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- setTable((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- setUnique((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- getColumnNames().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- setUnique(UNIQUE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- return UNIQUE_EDEFAULT == null ? unique != null : !UNIQUE_EDEFAULT.equals(unique);
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- return columnNames != null && !columnNames.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", schema: ");
- result.append(schema);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", table: ");
- result.append(table);
- result.append(", unique: ");
- result.append(unique);
- result.append(", columnNames: ");
- result.append(columnNames);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlIndex(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildColumnNameTranslator(),
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildTableTranslator(),
- buildUniqueTranslator()
- };
- }
-
- protected static Translator buildColumnNameTranslator() {
- return new Translator(EclipseLink2_2.INDEX__COLUMN_NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_ColumnNames());
- }
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_2.INDEX__NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCatalogTranslator() {
- return new Translator(EclipseLink2_2.INDEX__CATALOG, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Catalog(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSchemaTranslator() {
- return new Translator(EclipseLink2_2.INDEX__SCHEMA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Schema(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTableTranslator() {
- return new Translator(EclipseLink2_2.INDEX__TABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Table(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildUniqueTranslator() {
- return new BooleanTranslator(EclipseLink2_2.INDEX__UNIQUE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Unique(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlIndex
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java
deleted file mode 100644
index 6b87d945a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Instantiation Policy</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlInstantiationCopyPolicy()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlInstantiationCopyPolicy extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlInstantiationCopyPolicy()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_INSTANTIATION_COPY_POLICY;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {};
- }
-
-} // XmlInstantiationPolicy
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java
deleted file mode 100644
index ff86a6f6a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Join Fetch</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch <em>Join Fetch</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlJoinFetch extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- XmlJoinFetchType getJoinFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- void setJoinFetch(XmlJoinFetchType value);
-
- /**
- * Return the {@link TextRange} for the join-fetch element.
- */
- TextRange getJoinFetchTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java
deleted file mode 100644
index aa19b9044f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Xml Join Fetch Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType()
- * @model
- * @generated
- */
-public enum XmlJoinFetchType implements Enumerator
-{
- /**
- * The '<em><b>INNER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INNER_VALUE
- * @generated
- * @ordered
- */
- INNER(0, "INNER", "INNER"),
-
- /**
- * The '<em><b>OUTER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OUTER_VALUE
- * @generated
- * @ordered
- */
- OUTER(1, "OUTER", "OUTER");
-
- /**
- * The '<em><b>INNER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INNER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INNER
- * @model
- * @generated
- * @ordered
- */
- public static final int INNER_VALUE = 0;
-
- /**
- * The '<em><b>OUTER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OUTER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OUTER
- * @model
- * @generated
- * @ordered
- */
- public static final int OUTER_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Xml Join Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlJoinFetchType[] VALUES_ARRAY =
- new XmlJoinFetchType[]
- {
- INNER,
- OUTER,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Join Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlJoinFetchType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Join Fetch Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlJoinFetchType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlJoinFetchType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Join Fetch Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlJoinFetchType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlJoinFetchType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Join Fetch Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlJoinFetchType get(int value)
- {
- switch (value)
- {
- case INNER_VALUE: return INNER;
- case OUTER_VALUE: return OUTER;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlJoinFetchType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlJoinFetchType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java
deleted file mode 100644
index dae31a93cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Join Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable implements XmlJoinTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJoinTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_JOIN_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_JOIN_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_JOIN_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlJoinTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildJoinColumnTranslator(),
- buildInverseJoinColumnTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlJoinTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlJoinTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java
deleted file mode 100644
index f38ce6916a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java
+++ /dev/null
@@ -1,2182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Many To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany implements XmlManyToMany_2_0, XmlManyToMany_2_1, XmlManyToMany_2_2, XmlAttributeMapping, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected XmlConverter converter;
-
- /**
- * The cached value of the '{@link #getTypeConverter() <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlTypeConverter typeConverter;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverter() <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlObjectTypeConverter objectTypeConverter;
-
- /**
- * The cached value of the '{@link #getStructConverter() <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverter()
- * @generated
- * @ordered
- */
- protected XmlStructConverter structConverter;
-
- /**
- * The cached value of the '{@link #getMapKeyAssociationOverrides() <em>Map Key Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> mapKeyAssociationOverrides;
-
- /**
- * The default value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected static final String MAP_KEY_CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected String mapKeyConvert = MAP_KEY_CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToMany()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MANY_TO_MANY;
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' containment reference.
- * @see #setConverter(XmlConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- public XmlConverter getConverter()
- {
- return converter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetConverter(XmlConverter newConverter, NotificationChain msgs)
- {
- XmlConverter oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER, oldConverter, newConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getConverter <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' containment reference.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(XmlConverter newConverter)
- {
- if (newConverter != converter)
- {
- NotificationChain msgs = null;
- if (converter != null)
- msgs = ((InternalEObject)converter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER, newConverter, newConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converter</em>' containment reference.
- * @see #setTypeConverter(XmlTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlTypeConverter getTypeConverter()
- {
- return typeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTypeConverter(XmlTypeConverter newTypeConverter, NotificationChain msgs)
- {
- XmlTypeConverter oldTypeConverter = typeConverter;
- typeConverter = newTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER, oldTypeConverter, newTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getTypeConverter <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Converter</em>' containment reference.
- * @see #getTypeConverter()
- * @generated
- */
- public void setTypeConverter(XmlTypeConverter newTypeConverter)
- {
- if (newTypeConverter != typeConverter)
- {
- NotificationChain msgs = null;
- if (typeConverter != null)
- msgs = ((InternalEObject)typeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER, null, msgs);
- msgs = basicSetTypeConverter(newTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER, newTypeConverter, newTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converter</em>' containment reference.
- * @see #setObjectTypeConverter(XmlObjectTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlObjectTypeConverter getObjectTypeConverter()
- {
- return objectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter, NotificationChain msgs)
- {
- XmlObjectTypeConverter oldObjectTypeConverter = objectTypeConverter;
- objectTypeConverter = newObjectTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER, oldObjectTypeConverter, newObjectTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getObjectTypeConverter <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type Converter</em>' containment reference.
- * @see #getObjectTypeConverter()
- * @generated
- */
- public void setObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter)
- {
- if (newObjectTypeConverter != objectTypeConverter)
- {
- NotificationChain msgs = null;
- if (objectTypeConverter != null)
- msgs = ((InternalEObject)objectTypeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER, null, msgs);
- msgs = basicSetObjectTypeConverter(newObjectTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER, newObjectTypeConverter, newObjectTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converter</em>' containment reference.
- * @see #setStructConverter(XmlStructConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- public XmlStructConverter getStructConverter()
- {
- return structConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStructConverter(XmlStructConverter newStructConverter, NotificationChain msgs)
- {
- XmlStructConverter oldStructConverter = structConverter;
- structConverter = newStructConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER, oldStructConverter, newStructConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getStructConverter <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct Converter</em>' containment reference.
- * @see #getStructConverter()
- * @generated
- */
- public void setStructConverter(XmlStructConverter newStructConverter)
- {
- if (newStructConverter != structConverter)
- {
- NotificationChain msgs = null;
- if (structConverter != null)
- msgs = ((InternalEObject)structConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER, null, msgs);
- msgs = basicSetStructConverter(newStructConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER, newStructConverter, newStructConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getMapKeyAssociationOverrides()
- {
- if (mapKeyAssociationOverrides == null)
- {
- mapKeyAssociationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES);
- }
- return mapKeyAssociationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- public void setMapKeyConvert(String newMapKeyConvert)
- {
- String oldMapKeyConvert = mapKeyConvert;
- mapKeyConvert = newMapKeyConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT, oldMapKeyConvert, mapKeyConvert));
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER:
- return basicSetStructConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return getMapKeyAssociationOverrides();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- return getMapKeyConvert();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- return isNonCacheable();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- getMapKeyAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert(MAP_KEY_CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return mapKeyAssociationOverrides != null && !mapKeyAssociationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT: return EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_0.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_MANY_TO_MANY_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_MANY_TO_MANY_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mapKeyConvert: ");
- result.append(mapKeyConvert);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlManyToMany(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildAttributeTypeTranslator(),
- buildOrderByTranslator(),
- XmlOrderColumn.buildTranslator(JPA2_0.ORDER_COLUMN, OrmV2_0Package.eINSTANCE.getXmlOrderable_2_0_OrderColumn()),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyConvertTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyAssociationOverrideTranslator(),
- buildMapKeyColumnTranslator(),
- buildMapKeyJoinColumnTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildMapKeyConvertTranslator() {
- return new Translator(JPA2_0.MAP_KEY_CONVERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert());
- }
-
- protected static Translator buildMapKeyAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA2_0.MAP_KEY_ATTRIBUTE_OVERRIDE, OrmV2_0Package.eINSTANCE.getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides());
- }
-
- protected static Translator buildMapKeyAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(EclipseLink2_0.MAP_KEY_ASSOCIATION_OVERRIDE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_Converter());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_TypeConverter());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_StructConverter());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlManyToMany_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlManyToMany_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlManyToMany_2_2_NonCacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java
deleted file mode 100644
index 3f1513c7fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java
+++ /dev/null
@@ -1,1478 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Many To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne implements XmlManyToOne_2_1, XmlManyToOne_2_2, XmlAttributeMapping, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MANY_TO_ONE;
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- return isNonCacheable();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_MANY_TO_ONE_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_MANY_TO_ONE_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (partitioned: ");
- result.append(partitioned);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlManyToOne(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMapsIdTranslator(),
- buildIdTranslator(),
- buildJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.PRIVATE_OWNED, EclipseLinkOrmPackage.eINSTANCE.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlManyToOne_2_2_NonCacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java
deleted file mode 100644
index 015a6801cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java
+++ /dev/null
@@ -1,3988 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Mapped Superclass</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking <em>Optimistic Locking</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @model kind="class"
- * @generated
- */
-public class XmlMappedSuperclass extends org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass implements XmlMappedSuperclass_1_1, XmlMappedSuperclass_2_0, XmlMappedSuperclass_2_1, XmlMappedSuperclass_2_2, XmlMappedSuperclass_2_3, XmlMappedSuperclass_2_4, XmlReadOnly, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlCacheHolder, XmlConvertersHolder, XmlPropertyContainer
-{
- /**
- * The cached value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected XmlPrimaryKey primaryKey;
-
- /**
- * The default value of the '{@link #getCacheable() <em>Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheable()
- * @generated
- * @ordered
- */
- protected static final Boolean CACHEABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCacheable() <em>Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheable()
- * @generated
- * @ordered
- */
- protected Boolean cacheable = CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getCacheInterceptor() <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheInterceptor()
- * @generated
- * @ordered
- */
- protected XmlClassReference cacheInterceptor;
-
- /**
- * The cached value of the '{@link #getAssociationOverrides() <em>Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> associationOverrides;
-
- /**
- * The cached value of the '{@link #getAttributeOverrides() <em>Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> attributeOverrides;
-
- /**
- * The cached value of the '{@link #getFetchGroups() <em>Fetch Groups</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetchGroups()
- * @generated
- * @ordered
- */
- protected EList<XmlFetchGroup> fetchGroups;
-
- /**
- * The cached value of the '{@link #getSequenceGenerator() <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerator()
- * @generated
- * @ordered
- */
- protected XmlSequenceGenerator sequenceGenerator;
-
- /**
- * The cached value of the '{@link #getTableGenerator() <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerator()
- * @generated
- * @ordered
- */
- protected XmlTableGenerator tableGenerator;
-
- /**
- * The cached value of the '{@link #getNamedQueries() <em>Named Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedQuery> namedQueries;
-
- /**
- * The cached value of the '{@link #getNamedNativeQueries() <em>Named Native Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedNativeQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedNativeQuery> namedNativeQueries;
-
- /**
- * The cached value of the '{@link #getNamedStoredProcedureQueries() <em>Named Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredProcedureQuery> namedStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getSqlResultSetMappings() <em>Sql Result Set Mappings</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSqlResultSetMappings()
- * @generated
- * @ordered
- */
- protected EList<SqlResultSetMapping> sqlResultSetMappings;
-
- /**
- * The cached value of the '{@link #getQueryRedirectors() <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryRedirectors()
- * @generated
- * @ordered
- */
- protected XmlQueryRedirectors queryRedirectors;
-
- /**
- * The default value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected static final String PARENT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected String parentClass = PARENT_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAdditionalCriteria() <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAdditionalCriteria()
- * @generated
- * @ordered
- */
- protected XmlAdditionalCriteria_2_2 additionalCriteria;
-
- /**
- * The cached value of the '{@link #getMultitenant() <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMultitenant()
- * @generated
- * @ordered
- */
- protected XmlMultitenant multitenant;
-
- /**
- * The cached value of the '{@link #getNamedStoredFunctionQueries() <em>Named Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredFunctionQuery_2_3> namedStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredFunctionQueries() <em>Named Plsql Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredFunctionQuery_2_3> namedPlsqlStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredProcedureQueries() <em>Named Plsql Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredProcedureQuery_2_3> namedPlsqlStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
-
- /**
- * The default value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected static final Boolean READ_ONLY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected Boolean readOnly = READ_ONLY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getCustomizer() <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizer()
- * @generated
- * @ordered
- */
- protected XmlClassReference customizer;
-
- /**
- * The cached value of the '{@link #getChangeTracking() <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getChangeTracking()
- * @generated
- * @ordered
- */
- protected XmlChangeTracking changeTracking;
-
- /**
- * The cached value of the '{@link #getCache() <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCache()
- * @generated
- * @ordered
- */
- protected XmlCache cache;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final ExistenceType EXISTENCE_CHECKING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExistenceChecking() <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExistenceChecking()
- * @generated
- * @ordered
- */
- protected ExistenceType existenceChecking = EXISTENCE_CHECKING_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getOptimisticLocking() <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptimisticLocking()
- * @generated
- * @ordered
- */
- protected XmlOptimisticLocking optimisticLocking;
-
- /**
- * The cached value of the '{@link #getCopyPolicy() <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCopyPolicy copyPolicy;
-
- /**
- * The cached value of the '{@link #getInstantiationCopyPolicy() <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInstantiationCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlInstantiationCopyPolicy instantiationCopyPolicy;
-
- /**
- * The cached value of the '{@link #getCloneCopyPolicy() <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCloneCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCloneCopyPolicy cloneCopyPolicy;
-
- /**
- * The default value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final Boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected Boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMappedSuperclass()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MAPPED_SUPERCLASS;
- }
-
- /**
- * Returns the value of the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Only</em>' attribute.
- * @see #setReadOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly_ReadOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReadOnly()
- {
- return readOnly;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getReadOnly <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Only</em>' attribute.
- * @see #getReadOnly()
- * @generated
- */
- public void setReadOnly(Boolean newReadOnly)
- {
- Boolean oldReadOnly = readOnly;
- readOnly = newReadOnly;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY, oldReadOnly, readOnly));
- }
-
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlClassReference newCustomizer, NotificationChain msgs)
- {
- XmlClassReference oldCustomizer = customizer;
- customizer = newCustomizer;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, oldCustomizer, newCustomizer);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- public void setCustomizer(XmlClassReference newCustomizer)
- {
- if (newCustomizer != customizer)
- {
- NotificationChain msgs = null;
- if (customizer != null)
- msgs = ((InternalEObject)customizer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, null, msgs);
- if (newCustomizer != null)
- msgs = ((InternalEObject)newCustomizer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, null, msgs);
- msgs = basicSetCustomizer(newCustomizer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, newCustomizer, newCustomizer));
- }
-
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- public XmlChangeTracking getChangeTracking()
- {
- return changeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetChangeTracking(XmlChangeTracking newChangeTracking, NotificationChain msgs)
- {
- XmlChangeTracking oldChangeTracking = changeTracking;
- changeTracking = newChangeTracking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, oldChangeTracking, newChangeTracking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- public void setChangeTracking(XmlChangeTracking newChangeTracking)
- {
- if (newChangeTracking != changeTracking)
- {
- NotificationChain msgs = null;
- if (changeTracking != null)
- msgs = ((InternalEObject)changeTracking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, null, msgs);
- if (newChangeTracking != null)
- msgs = ((InternalEObject)newChangeTracking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, null, msgs);
- msgs = basicSetChangeTracking(newChangeTracking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, newChangeTracking, newChangeTracking));
- }
-
- /**
- * Returns the value of the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache</em>' containment reference.
- * @see #setCache(XmlCache)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_Cache()
- * @model containment="true"
- * @generated
- */
- public XmlCache getCache()
- {
- return cache;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCache(XmlCache newCache, NotificationChain msgs)
- {
- XmlCache oldCache = cache;
- cache = newCache;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, oldCache, newCache);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCache <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache</em>' containment reference.
- * @see #getCache()
- * @generated
- */
- public void setCache(XmlCache newCache)
- {
- if (newCache != cache)
- {
- NotificationChain msgs = null;
- if (cache != null)
- msgs = ((InternalEObject)cache).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, null, msgs);
- if (newCache != null)
- msgs = ((InternalEObject)newCache).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, null, msgs);
- msgs = basicSetCache(newCache, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, newCache, newCache));
- }
-
- /**
- * Returns the value of the '<em><b>Existence Checking</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Existence Checking</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- public ExistenceType getExistenceChecking()
- {
- return existenceChecking;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExistenceChecking <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #getExistenceChecking()
- * @generated
- */
- public void setExistenceChecking(ExistenceType newExistenceChecking)
- {
- ExistenceType oldExistenceChecking = existenceChecking;
- existenceChecking = newExistenceChecking == null ? EXISTENCE_CHECKING_EDEFAULT : newExistenceChecking;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING, oldExistenceChecking, existenceChecking));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optimistic Locking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #setOptimisticLocking(XmlOptimisticLocking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_OptimisticLocking()
- * @model containment="true"
- * @generated
- */
- public XmlOptimisticLocking getOptimisticLocking()
- {
- return optimisticLocking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOptimisticLocking(XmlOptimisticLocking newOptimisticLocking, NotificationChain msgs)
- {
- XmlOptimisticLocking oldOptimisticLocking = optimisticLocking;
- optimisticLocking = newOptimisticLocking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, oldOptimisticLocking, newOptimisticLocking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #getOptimisticLocking()
- * @generated
- */
- public void setOptimisticLocking(XmlOptimisticLocking newOptimisticLocking)
- {
- if (newOptimisticLocking != optimisticLocking)
- {
- NotificationChain msgs = null;
- if (optimisticLocking != null)
- msgs = ((InternalEObject)optimisticLocking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, null, msgs);
- if (newOptimisticLocking != null)
- msgs = ((InternalEObject)newOptimisticLocking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, null, msgs);
- msgs = basicSetOptimisticLocking(newOptimisticLocking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, newOptimisticLocking, newOptimisticLocking));
- }
-
- /**
- * Returns the value of the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Copy Policy</em>' containment reference.
- * @see #setCopyPolicy(XmlCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_CopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCopyPolicy getCopyPolicy()
- {
- return copyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCopyPolicy(XmlCopyPolicy newCopyPolicy, NotificationChain msgs)
- {
- XmlCopyPolicy oldCopyPolicy = copyPolicy;
- copyPolicy = newCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, oldCopyPolicy, newCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Copy Policy</em>' containment reference.
- * @see #getCopyPolicy()
- * @generated
- */
- public void setCopyPolicy(XmlCopyPolicy newCopyPolicy)
- {
- if (newCopyPolicy != copyPolicy)
- {
- NotificationChain msgs = null;
- if (copyPolicy != null)
- msgs = ((InternalEObject)copyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, null, msgs);
- if (newCopyPolicy != null)
- msgs = ((InternalEObject)newCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, null, msgs);
- msgs = basicSetCopyPolicy(newCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, newCopyPolicy, newCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Instantiation Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #setInstantiationCopyPolicy(XmlInstantiationCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_InstantiationCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlInstantiationCopyPolicy getInstantiationCopyPolicy()
- {
- return instantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy, NotificationChain msgs)
- {
- XmlInstantiationCopyPolicy oldInstantiationCopyPolicy = instantiationCopyPolicy;
- instantiationCopyPolicy = newInstantiationCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, oldInstantiationCopyPolicy, newInstantiationCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #getInstantiationCopyPolicy()
- * @generated
- */
- public void setInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy)
- {
- if (newInstantiationCopyPolicy != instantiationCopyPolicy)
- {
- NotificationChain msgs = null;
- if (instantiationCopyPolicy != null)
- msgs = ((InternalEObject)instantiationCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, null, msgs);
- if (newInstantiationCopyPolicy != null)
- msgs = ((InternalEObject)newInstantiationCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, null, msgs);
- msgs = basicSetInstantiationCopyPolicy(newInstantiationCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, newInstantiationCopyPolicy, newInstantiationCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Clone Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #setCloneCopyPolicy(XmlCloneCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_CloneCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCloneCopyPolicy getCloneCopyPolicy()
- {
- return cloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy, NotificationChain msgs)
- {
- XmlCloneCopyPolicy oldCloneCopyPolicy = cloneCopyPolicy;
- cloneCopyPolicy = newCloneCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, oldCloneCopyPolicy, newCloneCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #getCloneCopyPolicy()
- * @generated
- */
- public void setCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy)
- {
- if (newCloneCopyPolicy != cloneCopyPolicy)
- {
- NotificationChain msgs = null;
- if (cloneCopyPolicy != null)
- msgs = ((InternalEObject)cloneCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, null, msgs);
- if (newCloneCopyPolicy != null)
- msgs = ((InternalEObject)newCloneCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, null, msgs);
- msgs = basicSetCloneCopyPolicy(newCloneCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, newCloneCopyPolicy, newCloneCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- public XmlPrimaryKey getPrimaryKey()
- {
- return primaryKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrimaryKey(XmlPrimaryKey newPrimaryKey, NotificationChain msgs)
- {
- XmlPrimaryKey oldPrimaryKey = primaryKey;
- primaryKey = newPrimaryKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, oldPrimaryKey, newPrimaryKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- public void setPrimaryKey(XmlPrimaryKey newPrimaryKey)
- {
- if (newPrimaryKey != primaryKey)
- {
- NotificationChain msgs = null;
- if (primaryKey != null)
- msgs = ((InternalEObject)primaryKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, null, msgs);
- if (newPrimaryKey != null)
- msgs = ((InternalEObject)newPrimaryKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, null, msgs);
- msgs = basicSetPrimaryKey(newPrimaryKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, newPrimaryKey, newPrimaryKey));
- }
-
- /**
- * Returns the value of the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cacheable</em>' attribute.
- * @see #setCacheable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheable_2_0_Cacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCacheable()
- {
- return cacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCacheable <em>Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cacheable</em>' attribute.
- * @see #getCacheable()
- * @generated
- */
- public void setCacheable(Boolean newCacheable)
- {
- Boolean oldCacheable = cacheable;
- cacheable = newCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE, oldCacheable, cacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCacheInterceptor()
- {
- return cacheInterceptor;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheInterceptor(XmlClassReference newCacheInterceptor, NotificationChain msgs)
- {
- XmlClassReference oldCacheInterceptor = cacheInterceptor;
- cacheInterceptor = newCacheInterceptor;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, oldCacheInterceptor, newCacheInterceptor);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- public void setCacheInterceptor(XmlClassReference newCacheInterceptor)
- {
- if (newCacheInterceptor != cacheInterceptor)
- {
- NotificationChain msgs = null;
- if (cacheInterceptor != null)
- msgs = ((InternalEObject)cacheInterceptor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, null, msgs);
- if (newCacheInterceptor != null)
- msgs = ((InternalEObject)newCacheInterceptor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, null, msgs);
- msgs = basicSetCacheInterceptor(newCacheInterceptor, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, newCacheInterceptor, newCacheInterceptor));
- }
-
- /**
- * Returns the value of the '<em><b>Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Fetch Groups</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch Groups</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch Groups</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroupContainer_2_1_FetchGroups()
- * @model containment="true"
- * @generated
- */
- public EList<XmlFetchGroup> getFetchGroups()
- {
- if (fetchGroups == null)
- {
- fetchGroups = new EObjectContainmentEList<XmlFetchGroup>(XmlFetchGroup.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS);
- }
- return fetchGroups;
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generator</em>' containment reference.
- * @see #setSequenceGenerator(XmlSequenceGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlSequenceGenerator getSequenceGenerator()
- {
- return sequenceGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetSequenceGenerator(XmlSequenceGenerator newSequenceGenerator, NotificationChain msgs)
- {
- XmlSequenceGenerator oldSequenceGenerator = sequenceGenerator;
- sequenceGenerator = newSequenceGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getSequenceGenerator <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Generator</em>' containment reference.
- * @see #getSequenceGenerator()
- * @generated
- */
- public void setSequenceGenerator(XmlSequenceGenerator newSequenceGenerator)
- {
- if (newSequenceGenerator != sequenceGenerator)
- {
- NotificationChain msgs = null;
- if (sequenceGenerator != null)
- msgs = ((InternalEObject)sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generator</em>' containment reference.
- * @see #setTableGenerator(XmlTableGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_TableGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlTableGenerator getTableGenerator()
- {
- return tableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTableGenerator(XmlTableGenerator newTableGenerator, NotificationChain msgs)
- {
- XmlTableGenerator oldTableGenerator = tableGenerator;
- tableGenerator = newTableGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getTableGenerator <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table Generator</em>' containment reference.
- * @see #getTableGenerator()
- * @generated
- */
- public void setTableGenerator(XmlTableGenerator newTableGenerator)
- {
- if (newTableGenerator != tableGenerator)
- {
- NotificationChain msgs = null;
- if (tableGenerator != null)
- msgs = ((InternalEObject)tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, newTableGenerator, newTableGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Named Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedQuery> getNamedQueries()
- {
- if (namedQueries == null)
- {
- namedQueries = new EObjectContainmentEList<XmlNamedQuery>(XmlNamedQuery.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES);
- }
- return namedQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Native Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Native Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Native Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedNativeQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedNativeQuery> getNamedNativeQueries()
- {
- if (namedNativeQueries == null)
- {
- namedNativeQueries = new EObjectContainmentEList<XmlNamedNativeQuery>(XmlNamedNativeQuery.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES);
- }
- return namedNativeQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries()
- {
- if (namedStoredProcedureQueries == null)
- {
- namedStoredProcedureQueries = new EObjectContainmentEList<XmlNamedStoredProcedureQuery>(XmlNamedStoredProcedureQuery.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES);
- }
- return namedStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sql Result Set Mappings</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sql Result Set Mappings</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_1_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- public EList<SqlResultSetMapping> getSqlResultSetMappings()
- {
- if (sqlResultSetMappings == null)
- {
- sqlResultSetMappings = new EObjectContainmentEList<SqlResultSetMapping>(SqlResultSetMapping.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS);
- }
- return sqlResultSetMappings;
- }
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_1_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- public XmlQueryRedirectors getQueryRedirectors()
- {
- return queryRedirectors;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetQueryRedirectors(XmlQueryRedirectors newQueryRedirectors, NotificationChain msgs)
- {
- XmlQueryRedirectors oldQueryRedirectors = queryRedirectors;
- queryRedirectors = newQueryRedirectors;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, oldQueryRedirectors, newQueryRedirectors);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- public void setQueryRedirectors(XmlQueryRedirectors newQueryRedirectors)
- {
- if (newQueryRedirectors != queryRedirectors)
- {
- NotificationChain msgs = null;
- if (queryRedirectors != null)
- msgs = ((InternalEObject)queryRedirectors).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, null, msgs);
- if (newQueryRedirectors != null)
- msgs = ((InternalEObject)newQueryRedirectors).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, null, msgs);
- msgs = basicSetQueryRedirectors(newQueryRedirectors, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, newQueryRedirectors, newQueryRedirectors));
- }
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getParentClass()
- {
- return parentClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- public void setParentClass(String newParentClass)
- {
- String oldParentClass = parentClass;
- parentClass = newParentClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS, oldParentClass, parentClass));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- public XmlAdditionalCriteria_2_2 getAdditionalCriteria()
- {
- return additionalCriteria;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria, NotificationChain msgs)
- {
- XmlAdditionalCriteria_2_2 oldAdditionalCriteria = additionalCriteria;
- additionalCriteria = newAdditionalCriteria;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, oldAdditionalCriteria, newAdditionalCriteria);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- public void setAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria)
- {
- if (newAdditionalCriteria != additionalCriteria)
- {
- NotificationChain msgs = null;
- if (additionalCriteria != null)
- msgs = ((InternalEObject)additionalCriteria).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, null, msgs);
- if (newAdditionalCriteria != null)
- msgs = ((InternalEObject)newAdditionalCriteria).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, null, msgs);
- msgs = basicSetAdditionalCriteria(newAdditionalCriteria, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, newAdditionalCriteria, newAdditionalCriteria));
- }
-
- /**
- * Returns the value of the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Multitenant</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Multitenant</em>' containment reference.
- * @see #setMultitenant(XmlMultitenant)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder_Multitenant()
- * @model containment="true"
- * @generated
- */
- public XmlMultitenant getMultitenant()
- {
- return multitenant;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMultitenant(XmlMultitenant newMultitenant, NotificationChain msgs)
- {
- XmlMultitenant oldMultitenant = multitenant;
- multitenant = newMultitenant;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, oldMultitenant, newMultitenant);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getMultitenant <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Multitenant</em>' containment reference.
- * @see #getMultitenant()
- * @generated
- */
- public void setMultitenant(XmlMultitenant newMultitenant)
- {
- if (newMultitenant != multitenant)
- {
- NotificationChain msgs = null;
- if (multitenant != null)
- msgs = ((InternalEObject)multitenant).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, null, msgs);
- if (newMultitenant != null)
- msgs = ((InternalEObject)newMultitenant).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, null, msgs);
- msgs = basicSetMultitenant(newMultitenant, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, newMultitenant, newMultitenant));
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries()
- {
- if (namedStoredFunctionQueries == null)
- {
- namedStoredFunctionQueries = new EObjectContainmentEList<XmlNamedStoredFunctionQuery_2_3>(XmlNamedStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES);
- }
- return namedStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries()
- {
- if (namedPlsqlStoredFunctionQueries == null)
- {
- namedPlsqlStoredFunctionQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredFunctionQuery_2_3>(XmlNamedPlsqlStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- }
- return namedPlsqlStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries()
- {
- if (namedPlsqlStoredProcedureQueries == null)
- {
- namedPlsqlStoredProcedureQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredProcedureQuery_2_3>(XmlNamedPlsqlStoredProcedureQuery_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- }
- return namedPlsqlStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #getExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(Boolean newExcludeDefaultMappings)
- {
- Boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- return basicSetPrimaryKey(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- return basicSetCacheInterceptor(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- return ((InternalEList<?>)getFetchGroups()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- return ((InternalEList<?>)getNamedQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- return ((InternalEList<?>)getNamedNativeQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- return basicSetQueryRedirectors(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- return basicSetAdditionalCriteria(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- return basicSetMultitenant(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- return basicSetCustomizer(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- return basicSetChangeTracking(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- return basicSetCache(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- return basicSetOptimisticLocking(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- return basicSetCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- return basicSetInstantiationCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- return basicSetCloneCopyPolicy(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- return getPrimaryKey();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- return getCacheable();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- return getCacheInterceptor();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- return getFetchGroups();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- return getTableGenerator();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- return getNamedQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- return getNamedStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- return getSqlResultSetMappings();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- return getQueryRedirectors();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- return getParentClass();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- return getAdditionalCriteria();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- return getMultitenant();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- return getNamedStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return getNamedPlsqlStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return getNamedPlsqlStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- return getReadOnly();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- return getCustomizer();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- return getChangeTracking();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- return getCache();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- return getExistenceChecking();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- return getOptimisticLocking();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- return getCopyPolicy();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- return getInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- return getCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- return getExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- setCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- getFetchGroups().clear();
- getFetchGroups().addAll((Collection<? extends XmlFetchGroup>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- getNamedQueries().clear();
- getNamedQueries().addAll((Collection<? extends XmlNamedQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- getNamedNativeQueries().addAll((Collection<? extends XmlNamedNativeQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- getNamedStoredProcedureQueries().addAll((Collection<? extends XmlNamedStoredProcedureQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- getSqlResultSetMappings().addAll((Collection<? extends SqlResultSetMapping>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- setParentClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- setMultitenant((XmlMultitenant)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- getNamedStoredFunctionQueries().addAll((Collection<? extends XmlNamedStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- getNamedPlsqlStoredFunctionQueries().addAll((Collection<? extends XmlNamedPlsqlStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- getNamedPlsqlStoredProcedureQueries().addAll((Collection<? extends XmlNamedPlsqlStoredProcedureQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- setReadOnly((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- setCustomizer((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- setCache((XmlCache)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- setExistenceChecking((ExistenceType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- setCacheable(CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- getFetchGroups().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- setParentClass(PARENT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- setMultitenant((XmlMultitenant)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- setReadOnly(READ_ONLY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- setCustomizer((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- setCache((XmlCache)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- setExistenceChecking(EXISTENCE_CHECKING_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- return primaryKey != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- return CACHEABLE_EDEFAULT == null ? cacheable != null : !CACHEABLE_EDEFAULT.equals(cacheable);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- return cacheInterceptor != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- return fetchGroups != null && !fetchGroups.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- return tableGenerator != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- return namedQueries != null && !namedQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- return namedNativeQueries != null && !namedNativeQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- return namedStoredProcedureQueries != null && !namedStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- return queryRedirectors != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- return PARENT_CLASS_EDEFAULT == null ? parentClass != null : !PARENT_CLASS_EDEFAULT.equals(parentClass);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- return additionalCriteria != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- return multitenant != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- return namedStoredFunctionQueries != null && !namedStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return namedPlsqlStoredFunctionQueries != null && !namedPlsqlStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return namedPlsqlStoredProcedureQueries != null && !namedPlsqlStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- return READ_ONLY_EDEFAULT == null ? readOnly != null : !READ_ONLY_EDEFAULT.equals(readOnly);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- return customizer != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- return changeTracking != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- return cache != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- return existenceChecking != EXISTENCE_CHECKING_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- return optimisticLocking != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- return copyPolicy != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- return instantiationCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- return cloneCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- return EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT == null ? excludeDefaultMappings != null : !EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT.equals(excludeDefaultMappings);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMappedSuperclass_1_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY: return EclipseLinkOrmV1_1Package.XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheable_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE: return OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR: return EclipseLinkOrmV2_0Package.XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS: return EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS: return EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS: return EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS: return EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA: return EclipseLinkOrmV2_2Package.XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT: return EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_MAPPED_SUPERCLASS_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY: return EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER: return EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMappedSuperclass_1_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV1_1Package.XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheable_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR;
- case OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES;
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS;
- case EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS;
- case EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__PARENT_CLASS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_MAPPED_SUPERCLASS_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE;
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertersHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTERS_HOLDER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (cacheable: ");
- result.append(cacheable);
- result.append(", parentClass: ");
- result.append(parentClass);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", readOnly: ");
- result.append(readOnly);
- result.append(", existenceChecking: ");
- result.append(existenceChecking);
- result.append(", excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReadOnlyTextRange() {
- return getAttributeTextRange(EclipseLink.READ_ONLY);
- }
-
- public TextRange getCacheableTextRange() {
- return getAttributeTextRange(JPA2_0.CACHEABLE);
- }
-
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildClassTranslator(),
- buildParentClassTranslator(),
- buildAccessTranslator(),
- buildCacheableTranslator(),
- buildMetadataCompleteTranslator(),
- buildReadOnlyTranslator(),
- buildExistenceCheckingTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- buildDescriptionTranslator(),
- buildAccessMethodsTranslator(),
- XmlMultitenant.buildTranslator(EclipseLink2_3.MULTITENANT, EclipseLinkOrmPackage.eINSTANCE.getXmlMultitenantHolder_Multitenant()),
- buildAdditionalCriteriaTranslator(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- buildIdClassTranslator(),
- buildPrimaryKeyTranslator(),
- buildOptimisticLockingTranslator(),
- buildCacheTranslator(),
- buildCacheInterceptorTranslator(),
- buildCacheIndexTranslator(),
- buildFetchGroupsTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- buildSequenceGeneratorTranslator(),
- buildTableGeneratorTranslator(),
- buildNamedQueryTranslator(),
- buildNamedNativeQueryTranslator(),
- buildNamedStoredProcedureQueryTranslator(),
- XmlNamedStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()),
- XmlNamedPlsqlStoredProcedureQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()),
- XmlNamedPlsqlStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlTables()),
- buildSqlResultSetMappingTranslator(),
- buildQueryRedirectorsTranslator(),
- buildExcludeDefaultListenersTranslator(),
- buildExcludeSuperclassListenersTranslator(),
- buildEntityListenersTranslator(),
- buildPrePersistTranslator(),
- buildPostPersistTranslator(),
- buildPreRemoveTranslator(),
- buildPostRemoveTranslator(),
- buildPreUpdateTranslator(),
- buildPostUpdateTranslator(),
- buildPostLoadTranslator(),
- buildPropertyTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- Attributes.buildTranslator()};
- }
-
- protected static Translator buildCacheableTranslator() {
- return new Translator(JPA2_0.CACHEABLE, OrmV2_0Package.eINSTANCE.getXmlCacheable_2_0_Cacheable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReadOnlyTranslator() {
- return new Translator(EclipseLink.READ_ONLY, EclipseLinkOrmPackage.eINSTANCE.getXmlReadOnly_ReadOnly(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExistenceCheckingTranslator() {
- return new Translator(EclipseLink.EXISTENCE_CHECKING, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_ExistenceChecking(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new Translator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultMappings(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCustomizerTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink.CUSTOMIZER, EclipseLinkOrmPackage.eINSTANCE.getXmlCustomizerHolder_Customizer());
- }
-
- protected static Translator buildChangeTrackingTranslator() {
- return XmlChangeTracking.buildTranslator(EclipseLink.CHANGE_TRACKING, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking());
- }
-
- protected static Translator buildPrimaryKeyTranslator() {
- return XmlPrimaryKey.buildTranslator(EclipseLink1_1.PRIMARY_KEY, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlMappedSuperclass_1_1_PrimaryKey());
- }
-
- protected static Translator buildOptimisticLockingTranslator() {
- return XmlOptimisticLocking.buildTranslator(EclipseLink.OPTIMISTIC_LOCKING, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_OptimisticLocking());
- }
-
- protected static Translator buildCacheTranslator() {
- return XmlCache.buildTranslator(EclipseLink.CACHE, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_Cache());
- }
-
- protected static Translator buildCacheInterceptorTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink2_0.CACHE_INTERCEPTOR, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMappedSuperclass_2_0_CacheInterceptor());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlMappedSuperclass_2_4_CacheIndex());
- }
-
- protected static Translator buildFetchGroupsTranslator() {
- return XmlFetchGroup.buildTranslator(EclipseLink2_1.FETCH_GROUP, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroupContainer_2_1_FetchGroups());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertersHolder_StructConverters());
- }
-
- protected static Translator buildCopyPolicyTranslator() {
- return XmlCopyPolicy.buildTranslator(EclipseLink.COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_CopyPolicy());
- }
-
- protected static Translator buildInstantiationCoypPolicyTranslator() {
- return XmlInstantiationCopyPolicy.buildTranslator(EclipseLink.INSTANTIATION_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_InstantiationCopyPolicy());
- }
-
- protected static Translator buildCloneCopyPolicyTranslator() {
- return XmlCloneCopyPolicy.buildTranslator(EclipseLink.CLONE_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_CloneCopyPolicy());
- }
-
- protected static Translator buildSequenceGeneratorTranslator() {
- return XmlSequenceGenerator.buildTranslator(JPA.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_SequenceGenerator());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- protected static Translator buildNamedQueryTranslator() {
- return XmlNamedQuery.buildTranslator(JPA.NAMED_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedQueries());
- }
-
- protected static Translator buildNamedNativeQueryTranslator() {
- return XmlNamedNativeQuery.buildTranslator(JPA.NAMED_NATIVE_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedNativeQueries());
- }
-
- protected static Translator buildNamedStoredProcedureQueryTranslator() {
- return XmlNamedStoredProcedureQuery.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY, EclipseLinkOrmPackage.eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries());
- }
-
- protected static Translator buildSqlResultSetMappingTranslator() {
- return SqlResultSetMapping.buildTranslator(JPA.SQL_RESULT_SET_MAPPING, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlMappedSuperclass_2_1_SqlResultSetMappings());
- }
-
- protected static Translator buildQueryRedirectorsTranslator() {
- return XmlQueryRedirectors.buildTranslator(EclipseLink2_0.QUERY_REDIRECTORS, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlMappedSuperclass_2_1_QueryRedirectors());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA.ATTRIBUTE_OVERRIDE, OrmPackage.eINSTANCE.getXmlAttributeOverrideContainer_AttributeOverrides());
- }
-
- protected static Translator buildAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(JPA.ASSOCIATION_OVERRIDE, OrmPackage.eINSTANCE.getXmlAssociationOverrideContainer_AssociationOverrides());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildParentClassTranslator() {
- return new Translator(EclipseLink2_1.PARENT_CLASS, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlMappedSuperclass_2_1_ParentClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAdditionalCriteriaTranslator() {
- return XmlAdditionalCriteria.buildTranslator(EclipseLink2_2.ADDITIONAL_CRITERIA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlMappedSuperclass_2_2_AdditionalCriteria());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java
deleted file mode 100644
index f6db5c8574..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant()
- * @model kind="class"
- * @generated
- */
-public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant_2_3, XmlMultitenant_2_4
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final MultitenantType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected MultitenantType type = TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getTenantDiscriminatorColumns() <em>Tenant Discriminator Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTenantDiscriminatorColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumns;
-
- /**
- * The default value of the '{@link #getIncludeCriteria() <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIncludeCriteria()
- * @generated
- * @ordered
- */
- protected static final Boolean INCLUDE_CRITERIA_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getIncludeCriteria() <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIncludeCriteria()
- * @generated
- * @ordered
- */
- protected Boolean includeCriteria = INCLUDE_CRITERIA_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMultitenant()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MULTITENANT;
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #setType(MultitenantType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant_2_3_Type()
- * @model
- * @generated
- */
- public MultitenantType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #getType()
- * @generated
- */
- public void setType(MultitenantType newType)
- {
- MultitenantType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MULTITENANT__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns()
- {
- if (tenantDiscriminatorColumns == null)
- {
- tenantDiscriminatorColumns = new EObjectContainmentEList<XmlTenantDiscriminatorColumn_2_3>(XmlTenantDiscriminatorColumn_2_3.class, this, EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS);
- }
- return tenantDiscriminatorColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Include Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Include Criteria</em>' attribute.
- * @see #setIncludeCriteria(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant_2_4_IncludeCriteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getIncludeCriteria()
- {
- return includeCriteria;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant#getIncludeCriteria <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Include Criteria</em>' attribute.
- * @see #getIncludeCriteria()
- * @generated
- */
- public void setIncludeCriteria(Boolean newIncludeCriteria)
- {
- Boolean oldIncludeCriteria = includeCriteria;
- includeCriteria = newIncludeCriteria;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA, oldIncludeCriteria, includeCriteria));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- return ((InternalEList<?>)getTenantDiscriminatorColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- return getTenantDiscriminatorColumns();
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- return getIncludeCriteria();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- setType((MultitenantType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- getTenantDiscriminatorColumns().addAll((Collection<? extends XmlTenantDiscriminatorColumn_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- setIncludeCriteria((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- setIncludeCriteria(INCLUDE_CRITERIA_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- return type != TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- return tenantDiscriminatorColumns != null && !tenantDiscriminatorColumns.isEmpty();
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- return INCLUDE_CRITERIA_EDEFAULT == null ? includeCriteria != null : !INCLUDE_CRITERIA_EDEFAULT.equals(includeCriteria);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMultitenant_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA: return EclipseLinkOrmV2_4Package.XML_MULTITENANT_24__INCLUDE_CRITERIA;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMultitenant_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_MULTITENANT_24__INCLUDE_CRITERIA: return EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (type: ");
- result.append(type);
- result.append(", includeCriteria: ");
- result.append(includeCriteria);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlMultitenant(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildTypeTranslator(),
- buildIncludeCriteriaTranslator(),
- buildTenantDiscriminatorColumnsTranslator()
- };
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink2_3.MULTITENANT__TYPE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMultitenant_2_3_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTenantDiscriminatorColumnsTranslator() {
- return XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMultitenant_2_3_TenantDiscriminatorColumns());
- }
-
- protected static Translator buildIncludeCriteriaTranslator() {
- return new Translator(EclipseLink2_4.MULTITENANT__INCLUDE_CRITERIA, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlMultitenant_2_4_IncludeCriteria(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlMultitenant
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java
deleted file mode 100644
index 02bcea382f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant Holder</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant <em>Multitenant</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMultitenantHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Multitenant</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Multitenant</em>' containment reference.
- * @see #setMultitenant(XmlMultitenant)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder_Multitenant()
- * @model containment="true"
- * @generated
- */
- XmlMultitenant getMultitenant();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Multitenant</em>' containment reference.
- * @see #getMultitenant()
- * @generated
- */
- void setMultitenant(XmlMultitenant value);
-
-} // XmlMultitenantHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java
deleted file mode 100644
index 8d79dbdb82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Mutable</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable <em>Mutable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMutable extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getMutable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- void setMutable(Boolean value);
-
- /**
- * Return the {@link TextRange} for the mutable attibute.
- */
- TextRange getMutableTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java
deleted file mode 100644
index 04602b05dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Named Converter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlNamedConverter extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- // ********** translators **********
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.CONVERTER__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedConverter_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlNamedConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java
deleted file mode 100644
index d408d33c2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Function Query</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedPlsqlStoredFunctionQuery extends AbstractJpaEObject implements XmlNamedPlsqlStoredFunctionQuery_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedPlsqlStoredFunctionQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlNamedPlsqlStoredFunctionQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java
deleted file mode 100644
index 50af5ce82d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Procedure Query</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedPlsqlStoredProcedureQuery extends AbstractJpaEObject implements XmlNamedPlsqlStoredProcedureQuery_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedPlsqlStoredProcedureQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlNamedPlsqlStoredProcedureQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java
deleted file mode 100644
index 771ec817ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Stored Function Query</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedStoredFunctionQuery extends AbstractJpaEObject implements XmlNamedStoredFunctionQuery_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedStoredFunctionQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_STORED_FUNCTION_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredFunctionQuery(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlNamedStoredFunctionQuery_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlNamedStoredFunctionQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java
deleted file mode 100644
index 12be339a21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java
+++ /dev/null
@@ -1,644 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Stored Procedure Query</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass <em>Result Class</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping <em>Result Set Mapping</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName <em>Procedure Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet <em>Returns Result Set</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getHints <em>Hints</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getParameters <em>Parameters</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlNamedStoredProcedureQuery extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getResultClass() <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultClass()
- * @generated
- * @ordered
- */
- protected static final String RESULT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getResultClass() <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultClass()
- * @generated
- * @ordered
- */
- protected String resultClass = RESULT_CLASS_EDEFAULT;
-
- /**
- * The default value of the '{@link #getResultSetMapping() <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultSetMapping()
- * @generated
- * @ordered
- */
- protected static final String RESULT_SET_MAPPING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getResultSetMapping() <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultSetMapping()
- * @generated
- * @ordered
- */
- protected String resultSetMapping = RESULT_SET_MAPPING_EDEFAULT;
-
- /**
- * The default value of the '{@link #getProcedureName() <em>Procedure Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProcedureName()
- * @generated
- * @ordered
- */
- protected static final String PROCEDURE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getProcedureName() <em>Procedure Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProcedureName()
- * @generated
- * @ordered
- */
- protected String procedureName = PROCEDURE_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReturnsResultSet() <em>Returns Result Set</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnsResultSet()
- * @generated
- * @ordered
- */
- protected static final Boolean RETURNS_RESULT_SET_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReturnsResultSet() <em>Returns Result Set</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnsResultSet()
- * @generated
- * @ordered
- */
- protected Boolean returnsResultSet = RETURNS_RESULT_SET_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getHints() <em>Hints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHints()
- * @generated
- * @ordered
- */
- protected EList<XmlQueryHint> hints;
-
- /**
- * The cached value of the '{@link #getParameters() <em>Parameters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParameters()
- * @generated
- * @ordered
- */
- protected EList<XmlStoredProcedureParameter> parameters;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedStoredProcedureQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_STORED_PROCEDURE_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Result Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Result Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Result Class</em>' attribute.
- * @see #setResultClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ResultClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getResultClass()
- {
- return resultClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Result Class</em>' attribute.
- * @see #getResultClass()
- * @generated
- */
- public void setResultClass(String newResultClass)
- {
- String oldResultClass = resultClass;
- resultClass = newResultClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS, oldResultClass, resultClass));
- }
-
- /**
- * Returns the value of the '<em><b>Result Set Mapping</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Result Set Mapping</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Result Set Mapping</em>' attribute.
- * @see #setResultSetMapping(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ResultSetMapping()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getResultSetMapping()
- {
- return resultSetMapping;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Result Set Mapping</em>' attribute.
- * @see #getResultSetMapping()
- * @generated
- */
- public void setResultSetMapping(String newResultSetMapping)
- {
- String oldResultSetMapping = resultSetMapping;
- resultSetMapping = newResultSetMapping;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING, oldResultSetMapping, resultSetMapping));
- }
-
- /**
- * Returns the value of the '<em><b>Procedure Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Procedure Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Procedure Name</em>' attribute.
- * @see #setProcedureName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ProcedureName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getProcedureName()
- {
- return procedureName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName <em>Procedure Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Procedure Name</em>' attribute.
- * @see #getProcedureName()
- * @generated
- */
- public void setProcedureName(String newProcedureName)
- {
- String oldProcedureName = procedureName;
- procedureName = newProcedureName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME, oldProcedureName, procedureName));
- }
-
- /**
- * Returns the value of the '<em><b>Returns Result Set</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Returns Result Set</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Returns Result Set</em>' attribute.
- * @see #setReturnsResultSet(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ReturnsResultSet()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReturnsResultSet()
- {
- return returnsResultSet;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet <em>Returns Result Set</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Returns Result Set</em>' attribute.
- * @see #getReturnsResultSet()
- * @generated
- */
- public void setReturnsResultSet(Boolean newReturnsResultSet)
- {
- Boolean oldReturnsResultSet = returnsResultSet;
- returnsResultSet = newReturnsResultSet;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET, oldReturnsResultSet, returnsResultSet));
- }
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hints</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_Hints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlQueryHint> getHints()
- {
- if (hints == null)
- {
- hints = new EObjectContainmentEList<XmlQueryHint>(XmlQueryHint.class, this, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS);
- }
- return hints;
- }
-
- /**
- * Returns the value of the '<em><b>Parameters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parameters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parameters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_Parameters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStoredProcedureParameter> getParameters()
- {
- if (parameters == null)
- {
- parameters = new EObjectContainmentEList<XmlStoredProcedureParameter>(XmlStoredProcedureParameter.class, this, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS);
- }
- return parameters;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- return ((InternalEList<?>)getHints()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- return ((InternalEList<?>)getParameters()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- return getResultClass();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- return getResultSetMapping();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- return getProcedureName();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- return getReturnsResultSet();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- return getHints();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- return getParameters();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- setResultClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- setProcedureName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- setReturnsResultSet((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- getHints().clear();
- getHints().addAll((Collection<? extends XmlQueryHint>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- getParameters().clear();
- getParameters().addAll((Collection<? extends XmlStoredProcedureParameter>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- setResultClass(RESULT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping(RESULT_SET_MAPPING_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- setProcedureName(PROCEDURE_NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- setReturnsResultSet(RETURNS_RESULT_SET_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- getHints().clear();
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- getParameters().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- return RESULT_CLASS_EDEFAULT == null ? resultClass != null : !RESULT_CLASS_EDEFAULT.equals(resultClass);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- return RESULT_SET_MAPPING_EDEFAULT == null ? resultSetMapping != null : !RESULT_SET_MAPPING_EDEFAULT.equals(resultSetMapping);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- return PROCEDURE_NAME_EDEFAULT == null ? procedureName != null : !PROCEDURE_NAME_EDEFAULT.equals(procedureName);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- return RETURNS_RESULT_SET_EDEFAULT == null ? returnsResultSet != null : !RETURNS_RESULT_SET_EDEFAULT.equals(returnsResultSet);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- return hints != null && !hints.isEmpty();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- return parameters != null && !parameters.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", resultClass: ");
- result.append(resultClass);
- result.append(", resultSetMapping: ");
- result.append(resultSetMapping);
- result.append(", procedureName: ");
- result.append(procedureName);
- result.append(", returnsResultSet: ");
- result.append(returnsResultSet);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildResultClassTranslator(),
- buildResultSetMappingTranslator(),
- buildProcedureNameTranslator(),
- buildReturnResultSetTranslator(),
- buildHintTranslator(),
- buildParameterTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildResultClassTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ResultClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildResultSetMappingTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ResultSetMapping(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildProcedureNameTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ProcedureName(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReturnResultSetTranslator() {
- return new BooleanTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ReturnsResultSet(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildHintTranslator() {
- return XmlQueryHint.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__HINT, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_Hints());
- }
-
- protected static Translator buildParameterTranslator() {
- return XmlStoredProcedureParameter.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__PARAMETER, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_Parameters());
- }
-} // XmlNamedStoredProcedureQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java
deleted file mode 100644
index 07e6ef6e5d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java
+++ /dev/null
@@ -1,477 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Object Type CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType <em>Data Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType <em>Object Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getConversionValues <em>Conversion Values</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue <em>Default Object Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlObjectTypeConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected static final String DATA_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected String dataType = DATA_TYPE_EDEFAULT;
- /**
- * The default value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected static final String OBJECT_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected String objectType = OBJECT_TYPE_EDEFAULT;
- /**
- * The cached value of the '{@link #getConversionValues() <em>Conversion Values</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConversionValues()
- * @generated
- * @ordered
- */
- protected EList<XmlConversionValue> conversionValues;
- /**
- * The default value of the '{@link #getDefaultObjectValue() <em>Default Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDefaultObjectValue()
- * @generated
- * @ordered
- */
- protected static final String DEFAULT_OBJECT_VALUE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getDefaultObjectValue() <em>Default Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDefaultObjectValue()
- * @generated
- * @ordered
- */
- protected String defaultObjectValue = DEFAULT_OBJECT_VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlObjectTypeConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_OBJECT_TYPE_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Data Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Data Type</em>' attribute.
- * @see #setDataType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_DataType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDataType()
- {
- return dataType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Data Type</em>' attribute.
- * @see #getDataType()
- * @generated
- */
- public void setDataType(String newDataType)
- {
- String oldDataType = dataType;
- dataType = newDataType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE, oldDataType, dataType));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type</em>' attribute.
- * @see #setObjectType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_ObjectType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getObjectType()
- {
- return objectType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type</em>' attribute.
- * @see #getObjectType()
- * @generated
- */
- public void setObjectType(String newObjectType)
- {
- String oldObjectType = objectType;
- objectType = newObjectType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE, oldObjectType, objectType));
- }
-
- /**
- * Returns the value of the '<em><b>Conversion Values</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Conversion Values</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Conversion Values</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_ConversionValues()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConversionValue> getConversionValues()
- {
- if (conversionValues == null)
- {
- conversionValues = new EObjectContainmentEList<XmlConversionValue>(XmlConversionValue.class, this, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES);
- }
- return conversionValues;
- }
-
- /**
- * Returns the value of the '<em><b>Default Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Default Object Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Default Object Value</em>' attribute.
- * @see #setDefaultObjectValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_DefaultObjectValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDefaultObjectValue()
- {
- return defaultObjectValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue <em>Default Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Default Object Value</em>' attribute.
- * @see #getDefaultObjectValue()
- * @generated
- */
- public void setDefaultObjectValue(String newDefaultObjectValue)
- {
- String oldDefaultObjectValue = defaultObjectValue;
- defaultObjectValue = newDefaultObjectValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, oldDefaultObjectValue, defaultObjectValue));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- return ((InternalEList<?>)getConversionValues()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- return getDataType();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- return getObjectType();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- return getConversionValues();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- return getDefaultObjectValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- setDataType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- getConversionValues().clear();
- getConversionValues().addAll((Collection<? extends XmlConversionValue>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- setDefaultObjectValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- setDataType(DATA_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType(OBJECT_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- getConversionValues().clear();
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- setDefaultObjectValue(DEFAULT_OBJECT_VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- return DATA_TYPE_EDEFAULT == null ? dataType != null : !DATA_TYPE_EDEFAULT.equals(dataType);
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- return OBJECT_TYPE_EDEFAULT == null ? objectType != null : !OBJECT_TYPE_EDEFAULT.equals(objectType);
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- return conversionValues != null && !conversionValues.isEmpty();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- return DEFAULT_OBJECT_VALUE_EDEFAULT == null ? defaultObjectValue != null : !DEFAULT_OBJECT_VALUE_EDEFAULT.equals(defaultObjectValue);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (dataType: ");
- result.append(dataType);
- result.append(", objectType: ");
- result.append(objectType);
- result.append(", defaultObjectValue: ");
- result.append(defaultObjectValue);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildConversionValueTranslator(),
- buildDefaultObjectValueTranslator(),
- buildNameTranslator(),
- buildDataTypeTranslator(),
- buildObjectTypeTranslator(),
- };
- }
-
- protected static Translator buildConversionValueTranslator() {
- return XmlConversionValue.buildTranslator(EclipseLink.CONVERSION_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_ConversionValues());
- }
-
- protected static Translator buildDefaultObjectValueTranslator() {
- return new Translator(EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_DefaultObjectValue());
- }
-
- protected static Translator buildDataTypeTranslator() {
- return new Translator(EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_DataType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildObjectTypeTranslator() {
- return new Translator(EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_ObjectType(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.dataType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameDataTypePackageEdit(String newName) {
- int packageLength = this.dataType.lastIndexOf('.');
- if (packageLength == -1) {
- packageLength = 0;
- newName = newName + '.';
- }
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newName);
- }
-
- public ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.objectType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameObjectTypePackageEdit(String newName) {
- int packageLength = this.objectType.lastIndexOf('.');
- if (packageLength == -1) {
- packageLength = 0;
- newName = newName + '.';
- }
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newName);
- }
-
-} // XmlObjectTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java
deleted file mode 100644
index 096efbfde7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java
+++ /dev/null
@@ -1,2361 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml One To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany implements XmlOneToMany_2_0, XmlOneToMany_2_1, XmlOneToMany_2_2, XmlOneToMany_2_4, XmlAttributeMapping, XmlPrivateOwned, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected XmlConverter converter;
-
- /**
- * The cached value of the '{@link #getTypeConverter() <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlTypeConverter typeConverter;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverter() <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlObjectTypeConverter objectTypeConverter;
-
- /**
- * The cached value of the '{@link #getStructConverter() <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverter()
- * @generated
- * @ordered
- */
- protected XmlStructConverter structConverter;
-
- /**
- * The cached value of the '{@link #getMapKeyAssociationOverrides() <em>Map Key Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> mapKeyAssociationOverrides;
-
- /**
- * The default value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected static final String MAP_KEY_CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected String mapKeyConvert = MAP_KEY_CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NONCACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected boolean noncacheable = NONCACHEABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected static final boolean DELETE_ALL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected boolean deleteAll = DELETE_ALL_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected static final boolean PRIVATE_OWNED_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected boolean privateOwned = PRIVATE_OWNED_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToMany()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ONE_TO_MANY;
- }
-
- /**
- * Returns the value of the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Private Owned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Private Owned</em>' attribute.
- * @see #setPrivateOwned(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned_PrivateOwned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isPrivateOwned()
- {
- return privateOwned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#isPrivateOwned <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Private Owned</em>' attribute.
- * @see #isPrivateOwned()
- * @generated
- */
- public void setPrivateOwned(boolean newPrivateOwned)
- {
- boolean oldPrivateOwned = privateOwned;
- privateOwned = newPrivateOwned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED, oldPrivateOwned, privateOwned));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' containment reference.
- * @see #setConverter(XmlConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- public XmlConverter getConverter()
- {
- return converter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetConverter(XmlConverter newConverter, NotificationChain msgs)
- {
- XmlConverter oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER, oldConverter, newConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getConverter <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' containment reference.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(XmlConverter newConverter)
- {
- if (newConverter != converter)
- {
- NotificationChain msgs = null;
- if (converter != null)
- msgs = ((InternalEObject)converter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER, newConverter, newConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converter</em>' containment reference.
- * @see #setTypeConverter(XmlTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlTypeConverter getTypeConverter()
- {
- return typeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTypeConverter(XmlTypeConverter newTypeConverter, NotificationChain msgs)
- {
- XmlTypeConverter oldTypeConverter = typeConverter;
- typeConverter = newTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER, oldTypeConverter, newTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getTypeConverter <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Converter</em>' containment reference.
- * @see #getTypeConverter()
- * @generated
- */
- public void setTypeConverter(XmlTypeConverter newTypeConverter)
- {
- if (newTypeConverter != typeConverter)
- {
- NotificationChain msgs = null;
- if (typeConverter != null)
- msgs = ((InternalEObject)typeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER, null, msgs);
- msgs = basicSetTypeConverter(newTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER, newTypeConverter, newTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converter</em>' containment reference.
- * @see #setObjectTypeConverter(XmlObjectTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlObjectTypeConverter getObjectTypeConverter()
- {
- return objectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter, NotificationChain msgs)
- {
- XmlObjectTypeConverter oldObjectTypeConverter = objectTypeConverter;
- objectTypeConverter = newObjectTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER, oldObjectTypeConverter, newObjectTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getObjectTypeConverter <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type Converter</em>' containment reference.
- * @see #getObjectTypeConverter()
- * @generated
- */
- public void setObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter)
- {
- if (newObjectTypeConverter != objectTypeConverter)
- {
- NotificationChain msgs = null;
- if (objectTypeConverter != null)
- msgs = ((InternalEObject)objectTypeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER, null, msgs);
- msgs = basicSetObjectTypeConverter(newObjectTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER, newObjectTypeConverter, newObjectTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converter</em>' containment reference.
- * @see #setStructConverter(XmlStructConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- public XmlStructConverter getStructConverter()
- {
- return structConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStructConverter(XmlStructConverter newStructConverter, NotificationChain msgs)
- {
- XmlStructConverter oldStructConverter = structConverter;
- structConverter = newStructConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER, oldStructConverter, newStructConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getStructConverter <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct Converter</em>' containment reference.
- * @see #getStructConverter()
- * @generated
- */
- public void setStructConverter(XmlStructConverter newStructConverter)
- {
- if (newStructConverter != structConverter)
- {
- NotificationChain msgs = null;
- if (structConverter != null)
- msgs = ((InternalEObject)structConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER, null, msgs);
- msgs = basicSetStructConverter(newStructConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER, newStructConverter, newStructConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getMapKeyAssociationOverrides()
- {
- if (mapKeyAssociationOverrides == null)
- {
- mapKeyAssociationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES);
- }
- return mapKeyAssociationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- public void setMapKeyConvert(String newMapKeyConvert)
- {
- String oldMapKeyConvert = mapKeyConvert;
- mapKeyConvert = newMapKeyConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT, oldMapKeyConvert, mapKeyConvert));
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNoncacheable()
- {
- return noncacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- public void setNoncacheable(boolean newNoncacheable)
- {
- boolean oldNoncacheable = noncacheable;
- noncacheable = newNoncacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE, oldNoncacheable, noncacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isDeleteAll()
- {
- return deleteAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- public void setDeleteAll(boolean newDeleteAll)
- {
- boolean oldDeleteAll = deleteAll;
- deleteAll = newDeleteAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL, oldDeleteAll, deleteAll));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER:
- return basicSetStructConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return getMapKeyAssociationOverrides();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- return getMapKeyConvert();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- return isNoncacheable();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- return isDeleteAll();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- return isPrivateOwned();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- getMapKeyAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- setNoncacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- setDeleteAll((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- setPrivateOwned((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert(MAP_KEY_CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- setNoncacheable(NONCACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- setDeleteAll(DELETE_ALL_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- setPrivateOwned(PRIVATE_OWNED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return mapKeyAssociationOverrides != null && !mapKeyAssociationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- return noncacheable != NONCACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- return deleteAll != DELETE_ALL_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- return privateOwned != PRIVATE_OWNED_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT: return EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_0.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_ONE_TO_MANY_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL: return EclipseLinkOrmV2_4Package.XML_ONE_TO_MANY_24__DELETE_ALL;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_ONE_TO_MANY_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__NONCACHEABLE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ONE_TO_MANY_24__DELETE_ALL: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mapKeyConvert: ");
- result.append(mapKeyConvert);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", noncacheable: ");
- result.append(noncacheable);
- result.append(", deleteAll: ");
- result.append(deleteAll);
- result.append(", privateOwned: ");
- result.append(privateOwned);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return getElementTextRange(EclipseLink.PRIVATE_OWNED);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlOneToMany(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildOrphanRemovalTranslator(),
- buildAttributeTypeTranslator(),
- buildOrderByTranslator(),
- XmlOrderColumn.buildTranslator(JPA2_0.ORDER_COLUMN, OrmV2_0Package.eINSTANCE.getXmlOrderable_2_0_OrderColumn()),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyConvertTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyAssociationOverrideTranslator(),
- buildMapKeyColumnTranslator(),
- buildMapKeyJoinColumnTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildJoinTableTranslator(),
- buildJoinColumnTranslator(),
- buildCascadeTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildPrivateOwnedTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- buildDeleteAllTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildMapKeyConvertTranslator() {
- return new Translator(JPA2_0.MAP_KEY_CONVERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert());
- }
-
- protected static Translator buildMapKeyAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(EclipseLink2_0.MAP_KEY_ASSOCIATION_OVERRIDE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_Converter());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_TypeConverter());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_StructConverter());
- }
-
- protected static Translator buildPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.PRIVATE_OWNED, EclipseLinkOrmPackage.eINSTANCE.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlOneToMany_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToMany_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToMany_2_2_Noncacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-
- protected static Translator buildDeleteAllTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_4.DELETE_ALL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlOneToMany_2_4_DeleteAll());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java
deleted file mode 100644
index 65173b5cd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java
+++ /dev/null
@@ -1,1643 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml One To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne implements XmlOneToOne_2_1, XmlOneToOne_2_2, XmlAttributeMapping, XmlPrivateOwned, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected static final boolean PRIVATE_OWNED_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected boolean privateOwned = PRIVATE_OWNED_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ONE_TO_ONE;
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Private Owned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Private Owned</em>' attribute.
- * @see #setPrivateOwned(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned_PrivateOwned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isPrivateOwned()
- {
- return privateOwned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#isPrivateOwned <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Private Owned</em>' attribute.
- * @see #isPrivateOwned()
- * @generated
- */
- public void setPrivateOwned(boolean newPrivateOwned)
- {
- boolean oldPrivateOwned = privateOwned;
- privateOwned = newPrivateOwned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED, oldPrivateOwned, privateOwned));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- return isNonCacheable();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- return isPrivateOwned();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- setPrivateOwned((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- setPrivateOwned(PRIVATE_OWNED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- return privateOwned != PRIVATE_OWNED_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(", privateOwned: ");
- result.append(privateOwned);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return getElementTextRange(EclipseLink.PRIVATE_OWNED);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlOneToOne(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildOrphanRemovalTranslator(),
- buildMapsIdTranslator(),
- buildIdTranslator(),
- buildPrimaryKeyJoinColumnTranslator(),
- buildJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildPrivateOwnedTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.PRIVATE_OWNED, EclipseLinkOrmPackage.eINSTANCE.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToOne_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToOne_2_2_NonCacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java
deleted file mode 100644
index 2a10792549..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Optimistic Locking</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade <em>Cascade</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getSelectedColumns <em>Selected Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlOptimisticLocking extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlOptimisticLockingType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected XmlOptimisticLockingType type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascade() <em>Cascade</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascade() <em>Cascade</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected Boolean cascade = CASCADE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getSelectedColumns() <em>Selected Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSelectedColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlColumn> selectedColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOptimisticLocking()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_OPTIMISTIC_LOCKING;
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see #setType(XmlOptimisticLockingType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking_Type()
- * @model
- * @generated
- */
- public XmlOptimisticLockingType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see #getType()
- * @generated
- */
- public void setType(XmlOptimisticLockingType newType)
- {
- XmlOptimisticLockingType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade</em>' attribute.
- * @see #setCascade(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking_Cascade()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascade()
- {
- return cascade;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade <em>Cascade</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' attribute.
- * @see #getCascade()
- * @generated
- */
- public void setCascade(Boolean newCascade)
- {
- Boolean oldCascade = cascade;
- cascade = newCascade;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE, oldCascade, cascade));
- }
-
- /**
- * Returns the value of the '<em><b>Selected Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Selected Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Selected Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking_SelectedColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlColumn> getSelectedColumns()
- {
- if (selectedColumns == null)
- {
- selectedColumns = new EObjectContainmentEList<XmlColumn>(XmlColumn.class, this, EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS);
- }
- return selectedColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- return ((InternalEList<?>)getSelectedColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- return getCascade();
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- return getSelectedColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- setType((XmlOptimisticLockingType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- setCascade((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- getSelectedColumns().clear();
- getSelectedColumns().addAll((Collection<? extends XmlColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- setCascade(CASCADE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- getSelectedColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- return type != TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- return CASCADE_EDEFAULT == null ? cascade != null : !CASCADE_EDEFAULT.equals(cascade);
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- return selectedColumns != null && !selectedColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (type: ");
- result.append(type);
- result.append(", cascade: ");
- result.append(cascade);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildTypeTranslator(),
- buildCascadeTranslator(),
- buildSelectedColumnTranslator(),
- };
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.OPTIMISTIC_LOCKING__TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlOptimisticLocking_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCascadeTranslator() {
- return new BooleanTranslator(EclipseLink.OPTIMISTIC_LOCKING__CASCADE, EclipseLinkOrmPackage.eINSTANCE.getXmlOptimisticLocking_Cascade(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSelectedColumnTranslator() {
- return XmlColumn.buildTranslator(EclipseLink.OPTIMISTIC_LOCKING__SELECTED_COLUMN, EclipseLinkOrmPackage.eINSTANCE.getXmlOptimisticLocking_SelectedColumns());
- }
-
-} // XmlOptimisticLocking
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java
deleted file mode 100644
index 508934af9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Xml Optimistic Locking Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLockingType()
- * @model
- * @generated
- */
-public enum XmlOptimisticLockingType implements Enumerator
-{
- /**
- * The '<em><b>ALL COLUMNS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ALL_COLUMNS_VALUE
- * @generated
- * @ordered
- */
- ALL_COLUMNS(0, "ALL_COLUMNS", "ALL_COLUMNS"),
-
- /**
- * The '<em><b>CHANGED COLUMNS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHANGED_COLUMNS_VALUE
- * @generated
- * @ordered
- */
- CHANGED_COLUMNS(1, "CHANGED_COLUMNS", "CHANGED_COLUMNS"),
-
- /**
- * The '<em><b>SELECTED COLUMNS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SELECTED_COLUMNS_VALUE
- * @generated
- * @ordered
- */
- SELECTED_COLUMNS(2, "SELECTED_COLUMNS", "SELECTED_COLUMNS"),
-
- /**
- * The '<em><b>VERSION COLUMN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #VERSION_COLUMN_VALUE
- * @generated
- * @ordered
- */
- VERSION_COLUMN(3, "VERSION_COLUMN", "VERSION_COLUMN");
-
- /**
- * The '<em><b>ALL COLUMNS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ALL COLUMNS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ALL_COLUMNS
- * @model
- * @generated
- * @ordered
- */
- public static final int ALL_COLUMNS_VALUE = 0;
-
- /**
- * The '<em><b>CHANGED COLUMNS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHANGED COLUMNS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHANGED_COLUMNS
- * @model
- * @generated
- * @ordered
- */
- public static final int CHANGED_COLUMNS_VALUE = 1;
-
- /**
- * The '<em><b>SELECTED COLUMNS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SELECTED COLUMNS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SELECTED_COLUMNS
- * @model
- * @generated
- * @ordered
- */
- public static final int SELECTED_COLUMNS_VALUE = 2;
-
- /**
- * The '<em><b>VERSION COLUMN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>VERSION COLUMN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #VERSION_COLUMN
- * @model
- * @generated
- * @ordered
- */
- public static final int VERSION_COLUMN_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Xml Optimistic Locking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlOptimisticLockingType[] VALUES_ARRAY =
- new XmlOptimisticLockingType[]
- {
- ALL_COLUMNS,
- CHANGED_COLUMNS,
- SELECTED_COLUMNS,
- VERSION_COLUMN,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Optimistic Locking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlOptimisticLockingType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Optimistic Locking Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlOptimisticLockingType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlOptimisticLockingType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Optimistic Locking Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlOptimisticLockingType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlOptimisticLockingType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Optimistic Locking Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlOptimisticLockingType get(int value)
- {
- switch (value)
- {
- case ALL_COLUMNS_VALUE: return ALL_COLUMNS;
- case CHANGED_COLUMNS_VALUE: return CHANGED_COLUMNS;
- case SELECTED_COLUMNS_VALUE: return SELECTED_COLUMNS;
- case VERSION_COLUMN_VALUE: return VERSION_COLUMN;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlOptimisticLockingType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlOptimisticLockingType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java
deleted file mode 100644
index f6273a9229..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Order Column</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlOrderColumn extends org.eclipse.jpt.jpa.core.resource.orm.XmlOrderColumn implements XmlOrderColumn_2_0
-{
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final OrderCorrectionType_2_0 CORRECTION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCorrectionType() <em>Correction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCorrectionType()
- * @generated
- * @ordered
- */
- protected OrderCorrectionType_2_0 correctionType = CORRECTION_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOrderColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ORDER_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Correction Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Correction Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #setCorrectionType(OrderCorrectionType_2_0)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn_2_0_CorrectionType()
- * @model
- * @generated
- */
- public OrderCorrectionType_2_0 getCorrectionType()
- {
- return correctionType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn#getCorrectionType <em>Correction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #getCorrectionType()
- * @generated
- */
- public void setCorrectionType(OrderCorrectionType_2_0 newCorrectionType)
- {
- OrderCorrectionType_2_0 oldCorrectionType = correctionType;
- correctionType = newCorrectionType == null ? CORRECTION_TYPE_EDEFAULT : newCorrectionType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE, oldCorrectionType, correctionType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- return getCorrectionType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- setCorrectionType((OrderCorrectionType_2_0)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- setCorrectionType(CORRECTION_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- return correctionType != CORRECTION_TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlOrderColumn_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE: return EclipseLinkOrmV2_0Package.XML_ORDER_COLUMN_20__CORRECTION_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlOrderColumn_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_ORDER_COLUMN_20__CORRECTION_TYPE: return EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (correctionType: ");
- result.append(correctionType);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildNullableTranslator(),
- buildInsertableTranslator(),
- buildUpdatableTranslator(),
- buildColumnDefinitionTranslator(),
- buildCorrectionTypeTranslator(),
- };
- }
-
- protected static Translator buildCorrectionTypeTranslator() {
- return new Translator(EclipseLink2_0.CORRECTION_TYPE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlOrderColumn_2_0_CorrectionType(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java
deleted file mode 100644
index 314ca5d908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlPartitioning extends AbstractJpaEObject implements XmlPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java
deleted file mode 100644
index 9dedcb8ce9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Defaults</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitDefaults extends org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults implements XmlPersistenceUnitDefaults_2_1, XmlPersistenceUnitDefaults_2_3
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getTenantDiscriminatorColumns() <em>Tenant Discriminator Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTenantDiscriminatorColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitDefaults()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PERSISTENCE_UNIT_DEFAULTS;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns()
- {
- if (tenantDiscriminatorColumns == null)
- {
- tenantDiscriminatorColumns = new EObjectContainmentEList<XmlTenantDiscriminatorColumn_2_3>(XmlTenantDiscriminatorColumn_2_3.class, this, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS);
- }
- return tenantDiscriminatorColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- return ((InternalEList<?>)getTenantDiscriminatorColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- return getTenantDiscriminatorColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- getTenantDiscriminatorColumns().addAll((Collection<? extends XmlTenantDiscriminatorColumn_2_3>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- return tenantDiscriminatorColumns != null && !tenantDiscriminatorColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmV2_3Package.XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitDefaults(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDescriptionTranslator(),
- buildSchemaTranslator(),
- buildCatalogTranslator(),
- buildDelimitedIdentifiersTranslator(),
- buildAccessTranslator(),
- buildAccessMethodsTranslator(),
- buildCascadePersistTranslator(),
- buildTenantDiscriminatorColumnsTranslator(),
- buildEntityListenersTranslator()
- };
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildTenantDiscriminatorColumnsTranslator() {
- return XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns());
- }
-} // XmlPersistenceUnitDefaults
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java
deleted file mode 100644
index fcec1babc6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Metadata</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitMetadata extends org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata
-{
- /**
- * The default value of the '{@link #isExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitMetadata()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PERSISTENCE_UNIT_METADATA;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #isExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(boolean newExcludeDefaultMappings)
- {
- boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- return isExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- return excludeDefaultMappings != EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDescriptionTranslator(),
- buildXmlMappingMetadataCompleteTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- XmlPersistenceUnitDefaults.buildTranslator(JPA.PERSISTENCE_UNIT_DEFAULTS, OrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata_PersistenceUnitDefaults())
- };
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata_ExcludeDefaultMappings());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java
deleted file mode 100644
index 49d3b010cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Pinned Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlPinnedPartitioning extends AbstractJpaEObject implements XmlPinnedPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPinnedPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PINNED_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPinnedPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPinnedPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlPinnedPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java
deleted file mode 100644
index 0e11f9a16e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Record</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord()
- * @model kind="class"
- * @generated
- */
-public class XmlPlsqlRecord extends AbstractJpaEObject implements XmlPlsqlRecord_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPlsqlRecord()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PLSQL_RECORD;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPlsqlRecord(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.PLSQL_RECORD__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPlsqlRecord_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlPlsqlRecord
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java
deleted file mode 100644
index 9933871f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Table</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable()
- * @model kind="class"
- * @generated
- */
-public class XmlPlsqlTable extends AbstractJpaEObject implements XmlPlsqlTable_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPlsqlTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PLSQL_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPlsqlTable(),
- buildTranslatorChildren());
- }
-
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.PLSQL_TABLE__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPlsqlTable_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlPlsqlTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java
deleted file mode 100644
index 6344aa61f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Primary Key</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey()
- * @model kind="class"
- * @generated
- */
-public class XmlPrimaryKey extends AbstractJpaEObject implements XmlPrimaryKey_1_1, XmlPrimaryKey_2_1
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final IdValidationType_1_1 VALIDATION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValidation() <em>Validation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValidation()
- * @generated
- * @ordered
- */
- protected IdValidationType_1_1 validation = VALIDATION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getColumns() <em>Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlColumn> columns;
-
- /**
- * The default value of the '{@link #getCacheKeyType() <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheKeyType()
- * @generated
- * @ordered
- */
- protected static final CacheKeyType_2_1 CACHE_KEY_TYPE_EDEFAULT = CacheKeyType_2_1.ID_VALUE;
-
- /**
- * The cached value of the '{@link #getCacheKeyType() <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheKeyType()
- * @generated
- * @ordered
- */
- protected CacheKeyType_2_1 cacheKeyType = CACHE_KEY_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPrimaryKey()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PRIMARY_KEY;
- }
-
- /**
- * Returns the value of the '<em><b>Validation</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Validation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #setValidation(IdValidationType_1_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey_1_1_Validation()
- * @model
- * @generated
- */
- public IdValidationType_1_1 getValidation()
- {
- return validation;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey#getValidation <em>Validation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #getValidation()
- * @generated
- */
- public void setValidation(IdValidationType_1_1 newValidation)
- {
- IdValidationType_1_1 oldValidation = validation;
- validation = newValidation == null ? VALIDATION_EDEFAULT : newValidation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION, oldValidation, validation));
- }
-
- /**
- * Returns the value of the '<em><b>Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey_1_1_Columns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlColumn> getColumns()
- {
- if (columns == null)
- {
- columns = new EObjectContainmentEList<XmlColumn>(XmlColumn.class, this, EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS);
- }
- return columns;
- }
-
- /**
- * Returns the value of the '<em><b>Cache Key Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Key Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #setCacheKeyType(CacheKeyType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey_2_1_CacheKeyType()
- * @model
- * @generated
- */
- public CacheKeyType_2_1 getCacheKeyType()
- {
- return cacheKeyType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey#getCacheKeyType <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #getCacheKeyType()
- * @generated
- */
- public void setCacheKeyType(CacheKeyType_2_1 newCacheKeyType)
- {
- CacheKeyType_2_1 oldCacheKeyType = cacheKeyType;
- cacheKeyType = newCacheKeyType == null ? CACHE_KEY_TYPE_EDEFAULT : newCacheKeyType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE, oldCacheKeyType, cacheKeyType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- return ((InternalEList<?>)getColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- return getValidation();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- return getColumns();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- return getCacheKeyType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- setValidation((IdValidationType_1_1)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- getColumns().clear();
- getColumns().addAll((Collection<? extends XmlColumn>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- setCacheKeyType((CacheKeyType_2_1)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- setValidation(VALIDATION_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- getColumns().clear();
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- setCacheKeyType(CACHE_KEY_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- return validation != VALIDATION_EDEFAULT;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- return columns != null && !columns.isEmpty();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- return cacheKeyType != CACHE_KEY_TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlPrimaryKey_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE: return EclipseLinkOrmV2_1Package.XML_PRIMARY_KEY_21__CACHE_KEY_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlPrimaryKey_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_PRIMARY_KEY_21__CACHE_KEY_TYPE: return EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (validation: ");
- result.append(validation);
- result.append(", cacheKeyType: ");
- result.append(cacheKeyType);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPrimaryKey(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildValidationTranslator(),
- buildCacheKeyTypeTranslator(),
- buildColumnTranslator()
- };
- }
-
- protected static Translator buildValidationTranslator() {
- return new Translator(EclipseLink1_1.PRIMARY_KEY__VALIDATION, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlPrimaryKey_1_1_Validation(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCacheKeyTypeTranslator() {
- return new Translator(EclipseLink2_1.CACHE_KEY_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlPrimaryKey_2_1_CacheKeyType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(EclipseLink1_1.PRIMARY_KEY__COLUMN, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlPrimaryKey_1_1_Columns());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java
deleted file mode 100644
index 98d1914012..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Private Owned</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned <em>Private Owned</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPrivateOwned extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Private Owned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Private Owned</em>' attribute.
- * @see #setPrivateOwned(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned_PrivateOwned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isPrivateOwned();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Private Owned</em>' attribute.
- * @see #isPrivateOwned()
- * @generated
- */
- void setPrivateOwned(boolean value);
-
- /**
- * Return the {@link TextRange} for the private-owned attibute.
- */
- TextRange getPrivateOwnedTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java
deleted file mode 100644
index 7b064d3e1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Property</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue <em>Value</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType <em>Value Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlProperty extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValueType() <em>Value Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueType()
- * @generated
- * @ordered
- */
- protected static final String VALUE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValueType() <em>Value Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueType()
- * @generated
- * @ordered
- */
- protected String valueType = VALUE_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlProperty()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PROPERTY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PROPERTY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty_Value()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- public void setValue(String newValue)
- {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PROPERTY__VALUE, oldValue, value));
- }
-
- /**
- * Returns the value of the '<em><b>Value Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Type</em>' attribute.
- * @see #setValueType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty_ValueType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getValueType()
- {
- return valueType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType <em>Value Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Type</em>' attribute.
- * @see #getValueType()
- * @generated
- */
- public void setValueType(String newValueType)
- {
- String oldValueType = valueType;
- valueType = newValueType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE, oldValueType, valueType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- return getValue();
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- return getValueType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- setValue((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- setValueType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- setValueType(VALUE_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- return VALUE_TYPE_EDEFAULT == null ? valueType != null : !VALUE_TYPE_EDEFAULT.equals(valueType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- result.append(", valueType: ");
- result.append(valueType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildValueTranslator(),
- buildValueTypeTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.PROPERTY__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlProperty_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildValueTranslator() {
- return new Translator(EclipseLink.PROPERTY__VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlProperty_Value(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildValueTypeTranslator() {
- return new Translator(EclipseLink.PROPERTY__VALUE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlProperty_ValueType(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlProperty
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java
deleted file mode 100644
index 3eba00d2c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Property Container</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer#getProperties <em>Properties</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPropertyContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- EList<XmlProperty> getProperties();
-
-} // XmlPropertyContainer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java
deleted file mode 100644
index 4afab0cb94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query Container</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer#getNamedStoredProcedureQueries <em>Named Stored Procedure Queries</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQueryContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries();
-
-} // XmlQueryContainer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java
deleted file mode 100644
index a2b1e96876..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java
+++ /dev/null
@@ -1,654 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query Redirectors</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors()
- * @model kind="class"
- * @generated
- */
-public class XmlQueryRedirectors extends AbstractJpaEObject implements XmlQueryRedirectors_2_0
-{
- /**
- * The default value of the '{@link #getAllQueries() <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllQueries()
- * @generated
- * @ordered
- */
- protected static final String ALL_QUERIES_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAllQueries() <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllQueries()
- * @generated
- * @ordered
- */
- protected String allQueries = ALL_QUERIES_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReadAll() <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadAll()
- * @generated
- * @ordered
- */
- protected static final String READ_ALL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadAll() <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadAll()
- * @generated
- * @ordered
- */
- protected String readAll = READ_ALL_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReadObject() <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadObject()
- * @generated
- * @ordered
- */
- protected static final String READ_OBJECT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadObject() <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadObject()
- * @generated
- * @ordered
- */
- protected String readObject = READ_OBJECT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReport() <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReport()
- * @generated
- * @ordered
- */
- protected static final String REPORT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReport() <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReport()
- * @generated
- * @ordered
- */
- protected String report = REPORT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUpdate() <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdate()
- * @generated
- * @ordered
- */
- protected static final String UPDATE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUpdate() <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdate()
- * @generated
- * @ordered
- */
- protected String update = UPDATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getInsert() <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsert()
- * @generated
- * @ordered
- */
- protected static final String INSERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInsert() <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsert()
- * @generated
- * @ordered
- */
- protected String insert = INSERT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDelete() <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDelete()
- * @generated
- * @ordered
- */
- protected static final String DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDelete() <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDelete()
- * @generated
- * @ordered
- */
- protected String delete = DELETE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlQueryRedirectors()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_QUERY_REDIRECTORS;
- }
-
- /**
- * Returns the value of the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>All Queries</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>All Queries</em>' attribute.
- * @see #setAllQueries(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_AllQueries()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAllQueries()
- {
- return allQueries;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getAllQueries <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>All Queries</em>' attribute.
- * @see #getAllQueries()
- * @generated
- */
- public void setAllQueries(String newAllQueries)
- {
- String oldAllQueries = allQueries;
- allQueries = newAllQueries;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES, oldAllQueries, allQueries));
- }
-
- /**
- * Returns the value of the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read All</em>' attribute.
- * @see #setReadAll(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_ReadAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReadAll()
- {
- return readAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getReadAll <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read All</em>' attribute.
- * @see #getReadAll()
- * @generated
- */
- public void setReadAll(String newReadAll)
- {
- String oldReadAll = readAll;
- readAll = newReadAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL, oldReadAll, readAll));
- }
-
- /**
- * Returns the value of the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Object</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Object</em>' attribute.
- * @see #setReadObject(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_ReadObject()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReadObject()
- {
- return readObject;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getReadObject <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Object</em>' attribute.
- * @see #getReadObject()
- * @generated
- */
- public void setReadObject(String newReadObject)
- {
- String oldReadObject = readObject;
- readObject = newReadObject;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT, oldReadObject, readObject));
- }
-
- /**
- * Returns the value of the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Report</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Report</em>' attribute.
- * @see #setReport(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Report()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReport()
- {
- return report;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getReport <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Report</em>' attribute.
- * @see #getReport()
- * @generated
- */
- public void setReport(String newReport)
- {
- String oldReport = report;
- report = newReport;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT, oldReport, report));
- }
-
- /**
- * Returns the value of the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Update</em>' attribute.
- * @see #setUpdate(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Update()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getUpdate()
- {
- return update;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getUpdate <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Update</em>' attribute.
- * @see #getUpdate()
- * @generated
- */
- public void setUpdate(String newUpdate)
- {
- String oldUpdate = update;
- update = newUpdate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE, oldUpdate, update));
- }
-
- /**
- * Returns the value of the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insert</em>' attribute.
- * @see #setInsert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Insert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getInsert()
- {
- return insert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getInsert <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insert</em>' attribute.
- * @see #getInsert()
- * @generated
- */
- public void setInsert(String newInsert)
- {
- String oldInsert = insert;
- insert = newInsert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT, oldInsert, insert));
- }
-
- /**
- * Returns the value of the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete</em>' attribute.
- * @see #setDelete(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Delete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDelete()
- {
- return delete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getDelete <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete</em>' attribute.
- * @see #getDelete()
- * @generated
- */
- public void setDelete(String newDelete)
- {
- String oldDelete = delete;
- delete = newDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE, oldDelete, delete));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- return getAllQueries();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- return getReadAll();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- return getReadObject();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- return getReport();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- return getUpdate();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- return getInsert();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- return getDelete();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- setAllQueries((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- setReadAll((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- setReadObject((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- setReport((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- setUpdate((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- setInsert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- setDelete((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- setAllQueries(ALL_QUERIES_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- setReadAll(READ_ALL_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- setReadObject(READ_OBJECT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- setReport(REPORT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- setUpdate(UPDATE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- setInsert(INSERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- setDelete(DELETE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- return ALL_QUERIES_EDEFAULT == null ? allQueries != null : !ALL_QUERIES_EDEFAULT.equals(allQueries);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- return READ_ALL_EDEFAULT == null ? readAll != null : !READ_ALL_EDEFAULT.equals(readAll);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- return READ_OBJECT_EDEFAULT == null ? readObject != null : !READ_OBJECT_EDEFAULT.equals(readObject);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- return REPORT_EDEFAULT == null ? report != null : !REPORT_EDEFAULT.equals(report);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- return UPDATE_EDEFAULT == null ? update != null : !UPDATE_EDEFAULT.equals(update);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- return INSERT_EDEFAULT == null ? insert != null : !INSERT_EDEFAULT.equals(insert);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- return DELETE_EDEFAULT == null ? delete != null : !DELETE_EDEFAULT.equals(delete);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (allQueries: ");
- result.append(allQueries);
- result.append(", readAll: ");
- result.append(readAll);
- result.append(", readObject: ");
- result.append(readObject);
- result.append(", report: ");
- result.append(report);
- result.append(", update: ");
- result.append(update);
- result.append(", insert: ");
- result.append(insert);
- result.append(", delete: ");
- result.append(delete);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- EclipseLinkOrmPackage.eINSTANCE.getXmlQueryRedirectors(),
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildAllQueriesTranslator(),
- buildReadAllTranslator(),
- buildReadObjectTranslator(),
- buildReportTranslator(),
- buildUpdateTranslator(),
- buildInsertTranslator(),
- buildDeleteTranslator(),
- };
- }
-
- protected static Translator buildAllQueriesTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__ALL_QUERIES, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReadAllTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__READ_ALL, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_ReadAll(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReadObjectTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__READ_OBJECT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_ReadObject(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReportTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__REPORT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildUpdateTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__UPDATE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildInsertTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__INSERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDeleteTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__DELETE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlQueryRedirectors
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java
deleted file mode 100644
index b168ad07ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Range Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlRangePartitioning extends AbstractJpaEObject implements XmlRangePartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlRangePartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_RANGE_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlRangePartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlRangePartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlRangePartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java
deleted file mode 100644
index b4f928abf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Read Only</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly <em>Read Only</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlReadOnly extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Only</em>' attribute.
- * @see #setReadOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly_ReadOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getReadOnly();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Only</em>' attribute.
- * @see #getReadOnly()
- * @generated
- */
- void setReadOnly(Boolean value);
-
- /**
- * Return the {@link TextRange} for the read-only attibute.
- */
- TextRange getReadOnlyTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java
deleted file mode 100644
index 14607841ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Replication Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlReplicationPartitioning extends AbstractJpaEObject implements XmlReplicationPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlReplicationPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_REPLICATION_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlReplicationPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlReplicationPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlReplicationPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java
deleted file mode 100644
index 0762f0007a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Return Insert</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert()
- * @model kind="class"
- * @generated
- */
-public class XmlReturnInsert extends AbstractJpaEObject implements XmlReturnInsert_2_1
-{
- /**
- * The default value of the '{@link #getReturnOnly() <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnOnly()
- * @generated
- * @ordered
- */
- protected static final Boolean RETURN_ONLY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReturnOnly() <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnOnly()
- * @generated
- * @ordered
- */
- protected Boolean returnOnly = RETURN_ONLY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlReturnInsert()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_RETURN_INSERT;
- }
-
- /**
- * Returns the value of the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Only</em>' attribute.
- * @see #setReturnOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert_2_1_ReturnOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReturnOnly()
- {
- return returnOnly;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert#getReturnOnly <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Only</em>' attribute.
- * @see #getReturnOnly()
- * @generated
- */
- public void setReturnOnly(Boolean newReturnOnly)
- {
- Boolean oldReturnOnly = returnOnly;
- returnOnly = newReturnOnly;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY, oldReturnOnly, returnOnly));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- return getReturnOnly();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- setReturnOnly((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- setReturnOnly(RETURN_ONLY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- return RETURN_ONLY_EDEFAULT == null ? returnOnly != null : !RETURN_ONLY_EDEFAULT.equals(returnOnly);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (returnOnly: ");
- result.append(returnOnly);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildReturnOnlyTranslator()};
- }
-
- protected static Translator buildReturnOnlyTranslator() {
- return new Translator(EclipseLink2_1.RETURN_ONLY, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlReturnInsert_2_1_ReturnOnly());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java
deleted file mode 100644
index d67d354ab8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Round Robin Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlRoundRobinPartitioning extends AbstractJpaEObject implements XmlRoundRobinPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlRoundRobinPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ROUND_ROBIN_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlRoundRobinPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlRoundRobinPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlRoundRobinPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java
deleted file mode 100644
index 502d043f47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Secondary Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable()
- * @model kind="class"
- * @generated
- */
-public class XmlSecondaryTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable implements XmlSecondaryTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlSecondaryTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_SECONDARY_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlSecondaryTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_SECONDARY_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlSecondaryTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_SECONDARY_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlSecondaryTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildPrimaryKeyJoinColumnsTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlSecondaryTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlSecondaryTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java
deleted file mode 100644
index 4c219d0fc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java
+++ /dev/null
@@ -1,590 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Stored Procedure Parameter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection <em>Direction</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter <em>Query Parameter</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType <em>Jdbc Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName <em>Jdbc Type Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlStoredProcedureParameter extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlDirection DIRECTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDirection() <em>Direction</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDirection()
- * @generated
- * @ordered
- */
- protected XmlDirection direction = DIRECTION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getQueryParameter() <em>Query Parameter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryParameter()
- * @generated
- * @ordered
- */
- protected static final String QUERY_PARAMETER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getQueryParameter() <em>Query Parameter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryParameter()
- * @generated
- * @ordered
- */
- protected String queryParameter = QUERY_PARAMETER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected static final String TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected String type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getJdbcType() <em>Jdbc Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcType()
- * @generated
- * @ordered
- */
- protected static final Integer JDBC_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJdbcType() <em>Jdbc Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcType()
- * @generated
- * @ordered
- */
- protected Integer jdbcType = JDBC_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getJdbcTypeName() <em>Jdbc Type Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcTypeName()
- * @generated
- * @ordered
- */
- protected static final String JDBC_TYPE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJdbcTypeName() <em>Jdbc Type Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcTypeName()
- * @generated
- * @ordered
- */
- protected String jdbcTypeName = JDBC_TYPE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStoredProcedureParameter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STORED_PROCEDURE_PARAMETER;
- }
-
- /**
- * Returns the value of the '<em><b>Direction</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Direction</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Direction</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see #setDirection(XmlDirection)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_Direction()
- * @model
- * @generated
- */
- public XmlDirection getDirection()
- {
- return direction;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection <em>Direction</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Direction</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see #getDirection()
- * @generated
- */
- public void setDirection(XmlDirection newDirection)
- {
- XmlDirection oldDirection = direction;
- direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION, oldDirection, direction));
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Query Parameter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Parameter</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Parameter</em>' attribute.
- * @see #setQueryParameter(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_QueryParameter()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getQueryParameter()
- {
- return queryParameter;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter <em>Query Parameter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Parameter</em>' attribute.
- * @see #getQueryParameter()
- * @generated
- */
- public void setQueryParameter(String newQueryParameter)
- {
- String oldQueryParameter = queryParameter;
- queryParameter = newQueryParameter;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER, oldQueryParameter, queryParameter));
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see #setType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_Type()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see #getType()
- * @generated
- */
- public void setType(String newType)
- {
- String oldType = type;
- type = newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Jdbc Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jdbc Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Jdbc Type</em>' attribute.
- * @see #setJdbcType(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_JdbcType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getJdbcType()
- {
- return jdbcType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType <em>Jdbc Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Jdbc Type</em>' attribute.
- * @see #getJdbcType()
- * @generated
- */
- public void setJdbcType(Integer newJdbcType)
- {
- Integer oldJdbcType = jdbcType;
- jdbcType = newJdbcType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE, oldJdbcType, jdbcType));
- }
-
- /**
- * Returns the value of the '<em><b>Jdbc Type Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jdbc Type Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Jdbc Type Name</em>' attribute.
- * @see #setJdbcTypeName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_JdbcTypeName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getJdbcTypeName()
- {
- return jdbcTypeName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName <em>Jdbc Type Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Jdbc Type Name</em>' attribute.
- * @see #getJdbcTypeName()
- * @generated
- */
- public void setJdbcTypeName(String newJdbcTypeName)
- {
- String oldJdbcTypeName = jdbcTypeName;
- jdbcTypeName = newJdbcTypeName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME, oldJdbcTypeName, jdbcTypeName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- return getDirection();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- return getQueryParameter();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- return getJdbcType();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- return getJdbcTypeName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- setDirection((XmlDirection)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- setQueryParameter((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- setType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- setJdbcType((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- setJdbcTypeName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- setDirection(DIRECTION_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- setQueryParameter(QUERY_PARAMETER_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- setJdbcType(JDBC_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- setJdbcTypeName(JDBC_TYPE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- return direction != DIRECTION_EDEFAULT;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- return QUERY_PARAMETER_EDEFAULT == null ? queryParameter != null : !QUERY_PARAMETER_EDEFAULT.equals(queryParameter);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- return JDBC_TYPE_EDEFAULT == null ? jdbcType != null : !JDBC_TYPE_EDEFAULT.equals(jdbcType);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- return JDBC_TYPE_NAME_EDEFAULT == null ? jdbcTypeName != null : !JDBC_TYPE_NAME_EDEFAULT.equals(jdbcTypeName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (direction: ");
- result.append(direction);
- result.append(", name: ");
- result.append(name);
- result.append(", queryParameter: ");
- result.append(queryParameter);
- result.append(", type: ");
- result.append(type);
- result.append(", jdbcType: ");
- result.append(jdbcType);
- result.append(", jdbcTypeName: ");
- result.append(jdbcTypeName);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDirectionTranslator(),
- buildNameTranslator(),
- buildQueryParameterTranslator(),
- buildTypeTranslator(),
- buildJdbcTypeTranslator(),
- buildJdbcTypeNameTranslator(),
- };
- }
-
- protected static Translator buildDirectionTranslator() {
- return new Translator(EclipseLink.PARAMETER__DIRECTION, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_Direction(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.PARAMETER__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildQueryParameterTranslator() {
- return new Translator(EclipseLink.PARAMETER__QUERY_PARAMETER, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_QueryParameter(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.PARAMETER__TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJdbcTypeTranslator() {
- return new Translator(EclipseLink.PARAMETER__JDBC_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_JdbcType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJdbcTypeNameTranslator() {
- return new Translator(EclipseLink.PARAMETER__JDBC_TYPE_NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_JdbcTypeName(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlStoredProcedureParameter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java
deleted file mode 100644
index 498236b916..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Struct</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct()
- * @model kind="class"
- * @generated
- */
-public class XmlStruct extends AbstractJpaEObject implements XmlStruct_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStruct()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STRUCT;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCT__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlStruct(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.STRUCT__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlStruct_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlStruct
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java
deleted file mode 100644
index b7028939fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Struct CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter <em>Converter</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlStructConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getConverter() <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected static final String CONVERTER_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected String converter = CONVERTER_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStructConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STRUCT_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>CustomConverter</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' attribute.
- * @see #setConverter(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter_Converter()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConverter()
- {
- return converter;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' attribute.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(String newConverter)
- {
- String oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER, oldConverter, converter));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- return getConverter();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- setConverter((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- setConverter(CONVERTER_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- return CONVERTER_EDEFAULT == null ? converter != null : !CONVERTER_EDEFAULT.equals(converter);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (converter: ");
- result.append(converter);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getConverterClassTextRange() {
- return getAttributeTextRange(EclipseLink.STRUCT_CONVERTER__CONVERTER);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildConverterTranslator()
- };
- }
-
- protected static Translator buildConverterTranslator() {
- return new Translator(EclipseLink.STRUCT_CONVERTER__CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlStructConverter_Converter(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.converter.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.STRUCT_CONVERTER__CONVERTER).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenamePackageEdit(String newName) {
- int packageLength = this.converter.lastIndexOf('.');
- if (packageLength == -1) {
- packageLength = 0;
- newName = newName + '.';
- }
- int offset = getAttributeNode(EclipseLink.STRUCT_CONVERTER__CONVERTER).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newName);
- }
-} // XmlStructConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java
deleted file mode 100644
index 4ed829980f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Structure</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructure()
- * @model kind="class"
- * @generated
- */
-public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlStructure_2_3
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStructure()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STRUCTURE;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- return getProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlStructure_2_3.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlStructure_2_3.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlStructure(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator()
- };
- }
-
-} // XmlStructure
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java
deleted file mode 100644
index 33d9d07657..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable()
- * @model kind="class"
- * @generated
- */
-public class XmlTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlTable implements XmlTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java
deleted file mode 100644
index a314c639bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * A representation of the model object '<em><b>Xml Table Generator</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator()
- * @model kind="class"
- * @generated
- */
-public class XmlTableGenerator extends org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator implements XmlTableGenerator_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTableGenerator()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TABLE_GENERATOR;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTableGenerator_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_TABLE_GENERATOR_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTableGenerator_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_TABLE_GENERATOR_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTableGenerator(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTableTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildPkColumnNameTranslator(),
- buildValueColumnNameTranslator(),
- buildPkColumnValueTranslator(),
- buildInitialValueTranslator(),
- buildAllocationSizeTranslator(),
- buildDescriptionTranslator(),
- XmlUniqueConstraint.buildTranslator(JPA.UNIQUE_CONSTRAINT, OrmPackage.eINSTANCE.getXmlTableGenerator_UniqueConstraints())
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlTableGenerator_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlTableGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java
deleted file mode 100644
index 394033db7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlBaseDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Tenant Discriminator</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlTenantDiscriminatorColumn extends AbstractXmlBaseDiscriminatorColumn implements XmlTenantDiscriminatorColumn_2_3
-{
- /**
- * The default value of the '{@link #getContextProperty() <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getContextProperty()
- * @generated
- * @ordered
- */
- protected static final String CONTEXT_PROPERTY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getContextProperty() <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getContextProperty()
- * @generated
- * @ordered
- */
- protected String contextProperty = CONTEXT_PROPERTY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected static final String TABLE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected String table = TABLE_EDEFAULT;
- /**
- * The default value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected static final Boolean PRIMARY_KEY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected Boolean primaryKey = PRIMARY_KEY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTenantDiscriminatorColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TENANT_DISCRIMINATOR_COLUMN;
- }
- /**
- * Returns the value of the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Context Property</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Context Property</em>' attribute.
- * @see #setContextProperty(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_ContextProperty()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getContextProperty()
- {
- return contextProperty;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getContextProperty <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Context Property</em>' attribute.
- * @see #getContextProperty()
- * @generated
- */
- public void setContextProperty(String newContextProperty)
- {
- String oldContextProperty = contextProperty;
- contextProperty = newContextProperty;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY, oldContextProperty, contextProperty));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTable()
- {
- return table;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- public void setTable(String newTable)
- {
- String oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE, oldTable, table));
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' attribute.
- * @see #setPrimaryKey(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_PrimaryKey()
- * @model
- * @generated
- */
- public Boolean getPrimaryKey()
- {
- return primaryKey;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getPrimaryKey <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' attribute.
- * @see #getPrimaryKey()
- * @generated
- */
- public void setPrimaryKey(Boolean newPrimaryKey)
- {
- Boolean oldPrimaryKey = primaryKey;
- primaryKey = newPrimaryKey;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY, oldPrimaryKey, primaryKey));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- return getContextProperty();
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- return getTable();
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- return getPrimaryKey();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- setContextProperty((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- setTable((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- setPrimaryKey((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- setContextProperty(CONTEXT_PROPERTY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- setPrimaryKey(PRIMARY_KEY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- return CONTEXT_PROPERTY_EDEFAULT == null ? contextProperty != null : !CONTEXT_PROPERTY_EDEFAULT.equals(contextProperty);
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- return PRIMARY_KEY_EDEFAULT == null ? primaryKey != null : !PRIMARY_KEY_EDEFAULT.equals(primaryKey);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTenantDiscriminatorColumn_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY: return EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE: return EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY: return EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTenantDiscriminatorColumn_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY: return EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY;
- case EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE: return EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE;
- case EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY: return EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (contextProperty: ");
- result.append(contextProperty);
- result.append(", table: ");
- result.append(table);
- result.append(", primaryKey: ");
- result.append(primaryKey);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getTableTextRange() {
- return getAttributeTextRange(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTenantDiscriminatorColumn(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildContextPropertyTranslator(),
- buildDiscriminatorTypeTranslator(),
- buildColumnDefinitionTranslator(),
- buildLengthTranslator(),
- buildTableTranslator(),
- buildPrimaryKeyTranslator()
- };
- }
-
- protected static Translator buildContextPropertyTranslator() {
- return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_ContextProperty(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTableTranslator() {
- return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Table(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildPrimaryKeyTranslator() {
- return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_PrimaryKey(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlTenantDiscriminator
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java
deleted file mode 100644
index ea0c735488..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Time Of Day</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour <em>Hour</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute <em>Minute</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond <em>Second</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond <em>Millisecond</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlTimeOfDay extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getHour() <em>Hour</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHour()
- * @generated
- * @ordered
- */
- protected static final Integer HOUR_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getHour() <em>Hour</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHour()
- * @generated
- * @ordered
- */
- protected Integer hour = HOUR_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMinute() <em>Minute</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinute()
- * @generated
- * @ordered
- */
- protected static final Integer MINUTE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMinute() <em>Minute</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinute()
- * @generated
- * @ordered
- */
- protected Integer minute = MINUTE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSecond() <em>Second</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSecond()
- * @generated
- * @ordered
- */
- protected static final Integer SECOND_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSecond() <em>Second</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSecond()
- * @generated
- * @ordered
- */
- protected Integer second = SECOND_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMillisecond() <em>Millisecond</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMillisecond()
- * @generated
- * @ordered
- */
- protected static final Integer MILLISECOND_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMillisecond() <em>Millisecond</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMillisecond()
- * @generated
- * @ordered
- */
- protected Integer millisecond = MILLISECOND_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTimeOfDay()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TIME_OF_DAY;
- }
-
- /**
- * Returns the value of the '<em><b>Hour</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hour</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hour</em>' attribute.
- * @see #setHour(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Hour()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getHour()
- {
- return hour;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour <em>Hour</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hour</em>' attribute.
- * @see #getHour()
- * @generated
- */
- public void setHour(Integer newHour)
- {
- Integer oldHour = hour;
- hour = newHour;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR, oldHour, hour));
- }
-
- /**
- * Returns the value of the '<em><b>Minute</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Minute</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Minute</em>' attribute.
- * @see #setMinute(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Minute()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getMinute()
- {
- return minute;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute <em>Minute</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Minute</em>' attribute.
- * @see #getMinute()
- * @generated
- */
- public void setMinute(Integer newMinute)
- {
- Integer oldMinute = minute;
- minute = newMinute;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE, oldMinute, minute));
- }
-
- /**
- * Returns the value of the '<em><b>Second</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Second</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Second</em>' attribute.
- * @see #setSecond(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Second()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getSecond()
- {
- return second;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond <em>Second</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Second</em>' attribute.
- * @see #getSecond()
- * @generated
- */
- public void setSecond(Integer newSecond)
- {
- Integer oldSecond = second;
- second = newSecond;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND, oldSecond, second));
- }
-
- /**
- * Returns the value of the '<em><b>Millisecond</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Millisecond</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Millisecond</em>' attribute.
- * @see #setMillisecond(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Millisecond()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getMillisecond()
- {
- return millisecond;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond <em>Millisecond</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Millisecond</em>' attribute.
- * @see #getMillisecond()
- * @generated
- */
- public void setMillisecond(Integer newMillisecond)
- {
- Integer oldMillisecond = millisecond;
- millisecond = newMillisecond;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND, oldMillisecond, millisecond));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- return getHour();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- return getMinute();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- return getSecond();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- return getMillisecond();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- setHour((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- setMinute((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- setSecond((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- setMillisecond((Integer)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- setHour(HOUR_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- setMinute(MINUTE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- setSecond(SECOND_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- setMillisecond(MILLISECOND_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- return HOUR_EDEFAULT == null ? hour != null : !HOUR_EDEFAULT.equals(hour);
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- return MINUTE_EDEFAULT == null ? minute != null : !MINUTE_EDEFAULT.equals(minute);
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- return SECOND_EDEFAULT == null ? second != null : !SECOND_EDEFAULT.equals(second);
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- return MILLISECOND_EDEFAULT == null ? millisecond != null : !MILLISECOND_EDEFAULT.equals(millisecond);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (hour: ");
- result.append(hour);
- result.append(", minute: ");
- result.append(minute);
- result.append(", second: ");
- result.append(second);
- result.append(", millisecond: ");
- result.append(millisecond);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildHourTranslator(),
- buildMinuteTranslator(),
- buildSecondTranslator(),
- buildMillisecondTranslator(),
- };
- }
-
- protected static Translator buildHourTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__HOUR, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Hour(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildMinuteTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__MINUTE, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Minute(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSecondTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__SECOND, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Second(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildMillisecondTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__MILLISECOND, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Millisecond(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlTimeOfDay
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java
deleted file mode 100644
index 1dd37310cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Transformation Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves. *
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @model kind="class"
- * @generated
- */
-public class XmlTransformation extends AbstractXmlAttributeMapping implements XmlTransformation_2_1, XmlAttributeMapping
-{
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransformation()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TRANSFORMATION;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- return getProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTransformation_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_TRANSFORMATION_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTransformation_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_TRANSFORMATION_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
-// buildFetchTranslator(),
-// buildOptionalTranslator(),
- buildAccessTranslator(),
-// buildMutableTranslator(),
- buildAttributeTypeTranslator(),
-// buildReadTransformerTranslator(),
-// buildWriteTransformerTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlTransformation_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java
deleted file mode 100644
index b1cc8eef0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Transient</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @model kind="class"
- * @generated
- */
-public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTransient implements XmlAttributeMapping
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransient()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TRANSIENT;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- return getProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTransient(),
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java
deleted file mode 100644
index 6ed61ef56f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Type CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType <em>Data Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType <em>Object Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlTypeConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected static final String DATA_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected String dataType = DATA_TYPE_EDEFAULT;
- /**
- * The default value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected static final String OBJECT_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected String objectType = OBJECT_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTypeConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TYPE_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Data Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Data Type</em>' attribute.
- * @see #setDataType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter_DataType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDataType()
- {
- return dataType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Data Type</em>' attribute.
- * @see #getDataType()
- * @generated
- */
- public void setDataType(String newDataType)
- {
- String oldDataType = dataType;
- dataType = newDataType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE, oldDataType, dataType));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type</em>' attribute.
- * @see #setObjectType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter_ObjectType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getObjectType()
- {
- return objectType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type</em>' attribute.
- * @see #getObjectType()
- * @generated
- */
- public void setObjectType(String newObjectType)
- {
- String oldObjectType = objectType;
- objectType = newObjectType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE, oldObjectType, objectType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- return getDataType();
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- return getObjectType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- setDataType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- setDataType(DATA_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType(OBJECT_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- return DATA_TYPE_EDEFAULT == null ? dataType != null : !DATA_TYPE_EDEFAULT.equals(dataType);
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- return OBJECT_TYPE_EDEFAULT == null ? objectType != null : !OBJECT_TYPE_EDEFAULT.equals(objectType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (dataType: ");
- result.append(dataType);
- result.append(", objectType: ");
- result.append(objectType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildDataTypeTranslator(),
- buildObjectTypeTranslator(),
- };
- }
-
- protected static Translator buildDataTypeTranslator() {
- return new Translator(EclipseLink.TYPE_CONVERTER__DATA_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlTypeConverter_DataType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildObjectTypeTranslator() {
- return new Translator(EclipseLink.TYPE_CONVERTER__OBJECT_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlTypeConverter_ObjectType(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.dataType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameDataTypePackageEdit(String newName) {
- int packageLength = this.dataType.lastIndexOf('.');
- if (packageLength == -1) {
- packageLength = 0;
- newName = newName + '.';
- }
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newName);
- }
-
- public ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.objectType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameObjectTypePackageEdit(String newName) {
- int packageLength = this.objectType.lastIndexOf('.');
- if (packageLength == -1) {
- packageLength = 0;
- newName = newName + '.';
- }
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newName);
- }
-
-} // XmlTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java
deleted file mode 100644
index 67b5c220b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Union Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlUnionPartitioning extends AbstractJpaEObject implements XmlUnionPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlUnionPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_UNION_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlUnionPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlUnionPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlUnionPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java
deleted file mode 100644
index e1782a71b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Value Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlValuePartitioning extends AbstractJpaEObject implements XmlValuePartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlValuePartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_VALUE_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlValuePartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlValuePartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlValuePartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java
deleted file mode 100644
index 5c23628bc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java
+++ /dev/null
@@ -1,1219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Variable One To One Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlVariableOneToOne_2_2
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlVariableOneToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_VARIABLE_ONE_TO_ONE;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- return isNonCacheable();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlVariableOneToOne_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlVariableOneToOne_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (partitioned: ");
- result.append(partitioned);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java
deleted file mode 100644
index 0770375ca9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java
+++ /dev/null
@@ -1,1135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Version</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @model kind="class"
- * @generated
- */
-public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion implements XmlVersion_2_1, XmlVersion_2_2, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping
-{
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getMutable() <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMutable()
- * @generated
- * @ordered
- */
- protected static final Boolean MUTABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMutable() <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMutable()
- * @generated
- * @ordered
- */
- protected Boolean mutable = MUTABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected XmlConverter converter;
-
- /**
- * The cached value of the '{@link #getTypeConverter() <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlTypeConverter typeConverter;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverter() <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverter()
- * @generated
- * @ordered
- */
- protected XmlObjectTypeConverter objectTypeConverter;
-
- /**
- * The cached value of the '{@link #getStructConverter() <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverter()
- * @generated
- * @ordered
- */
- protected XmlStructConverter structConverter;
-
- /**
- * The default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlVersion()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_VERSION;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMutable()
- {
- return mutable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- public void setMutable(Boolean newMutable)
- {
- Boolean oldMutable = mutable;
- mutable = newMutable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__MUTABLE, oldMutable, mutable));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_VERSION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' containment reference.
- * @see #setConverter(XmlConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- public XmlConverter getConverter()
- {
- return converter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetConverter(XmlConverter newConverter, NotificationChain msgs)
- {
- XmlConverter oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__CONVERTER, oldConverter, newConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getConverter <em>Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' containment reference.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(XmlConverter newConverter)
- {
- if (newConverter != converter)
- {
- NotificationChain msgs = null;
- if (converter != null)
- msgs = ((InternalEObject)converter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__CONVERTER, null, msgs);
- if (newConverter != null)
- msgs = ((InternalEObject)newConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__CONVERTER, null, msgs);
- msgs = basicSetConverter(newConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__CONVERTER, newConverter, newConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converter</em>' containment reference.
- * @see #setTypeConverter(XmlTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlTypeConverter getTypeConverter()
- {
- return typeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTypeConverter(XmlTypeConverter newTypeConverter, NotificationChain msgs)
- {
- XmlTypeConverter oldTypeConverter = typeConverter;
- typeConverter = newTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER, oldTypeConverter, newTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getTypeConverter <em>Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type Converter</em>' containment reference.
- * @see #getTypeConverter()
- * @generated
- */
- public void setTypeConverter(XmlTypeConverter newTypeConverter)
- {
- if (newTypeConverter != typeConverter)
- {
- NotificationChain msgs = null;
- if (typeConverter != null)
- msgs = ((InternalEObject)typeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER, null, msgs);
- if (newTypeConverter != null)
- msgs = ((InternalEObject)newTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER, null, msgs);
- msgs = basicSetTypeConverter(newTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER, newTypeConverter, newTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converter</em>' containment reference.
- * @see #setObjectTypeConverter(XmlObjectTypeConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- public XmlObjectTypeConverter getObjectTypeConverter()
- {
- return objectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter, NotificationChain msgs)
- {
- XmlObjectTypeConverter oldObjectTypeConverter = objectTypeConverter;
- objectTypeConverter = newObjectTypeConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER, oldObjectTypeConverter, newObjectTypeConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getObjectTypeConverter <em>Object Type Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type Converter</em>' containment reference.
- * @see #getObjectTypeConverter()
- * @generated
- */
- public void setObjectTypeConverter(XmlObjectTypeConverter newObjectTypeConverter)
- {
- if (newObjectTypeConverter != objectTypeConverter)
- {
- NotificationChain msgs = null;
- if (objectTypeConverter != null)
- msgs = ((InternalEObject)objectTypeConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER, null, msgs);
- if (newObjectTypeConverter != null)
- msgs = ((InternalEObject)newObjectTypeConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER, null, msgs);
- msgs = basicSetObjectTypeConverter(newObjectTypeConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER, newObjectTypeConverter, newObjectTypeConverter));
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct CustomConverter</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converter</em>' containment reference.
- * @see #setStructConverter(XmlStructConverter)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- public XmlStructConverter getStructConverter()
- {
- return structConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStructConverter(XmlStructConverter newStructConverter, NotificationChain msgs)
- {
- XmlStructConverter oldStructConverter = structConverter;
- structConverter = newStructConverter;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER, oldStructConverter, newStructConverter);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getStructConverter <em>Struct Converter</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct Converter</em>' containment reference.
- * @see #getStructConverter()
- * @generated
- */
- public void setStructConverter(XmlStructConverter newStructConverter)
- {
- if (newStructConverter != structConverter)
- {
- NotificationChain msgs = null;
- if (structConverter != null)
- msgs = ((InternalEObject)structConverter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER, null, msgs);
- if (newStructConverter != null)
- msgs = ((InternalEObject)newStructConverter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER, null, msgs);
- msgs = basicSetStructConverter(newStructConverter, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER, newStructConverter, newStructConverter));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTER:
- return basicSetConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER:
- return basicSetTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER:
- return basicSetObjectTypeConverter(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER:
- return basicSetStructConverter(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_VERSION__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTER:
- return getConverter();
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER:
- return getTypeConverter();
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER:
- return getObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER:
- return getStructConverter();
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- return getConvert();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTER:
- setConverter((XmlConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- setConvert((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTER:
- setConverter((XmlConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER:
- setTypeConverter((XmlTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER:
- setObjectTypeConverter((XmlObjectTypeConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER:
- setStructConverter((XmlStructConverter)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_VERSION__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTER:
- return converter != null;
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER:
- return typeConverter != null;
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER:
- return objectTypeConverter != null;
- case EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER:
- return structConverter != null;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlVersion_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_VERSION_21__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__INDEX: return EclipseLinkOrmV2_2Package.XML_VERSION_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlVersion_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_VERSION_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_VERSION_22__INDEX: return EclipseLinkOrmPackage.XML_VERSION__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_VERSION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_VERSION__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER: return EclipseLinkOrmPackage.XML_VERSION__CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER: return EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTER;
- case EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER: return EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTER;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_VERSION__CONVERT;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(", mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLink.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlVersion(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildMutableTranslator(),
- buildAttributeTypeTranslator(),
- buildColumnTranslator(),
- buildIndexTranslator(),
- buildTemporalTranslator(),
- buildConvertTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildMutableTranslator() {
- return new Translator(EclipseLink.MUTABLE, EclipseLinkOrmPackage.eINSTANCE.getXmlMutable_Mutable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlVersion_2_2_Index());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_Converter());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_TypeConverter());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_ObjectTypeConverter());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_StructConverter());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlVersion_2_1_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java
deleted file mode 100644
index 67a19897f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-
-@SuppressWarnings("nls")
-public interface EclipseLink1_1
- extends EclipseLink
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_1.xsd";
- String SCHEMA_VERSION = "1.1";
-
- // EclipseLink 1.1 specific nodes
-
- String PRIMARY_KEY = "primary-key"; //$NON-NLS-1$
- String PRIMARY_KEY__VALIDATION = "validation"; //$NON-NLS-1$
- String PRIMARY_KEY__COLUMN = "column"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java
deleted file mode 100644
index e96e4dc88e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package
- * @generated
- */
-public class EclipseLinkOrmV1_1Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV1_1Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV1_1Factory init()
- {
- try
- {
- EclipseLinkOrmV1_1Factory theEclipseLinkOrmV1_1Factory = (EclipseLinkOrmV1_1Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v1_1.xmi");
- if (theEclipseLinkOrmV1_1Factory != null)
- {
- return theEclipseLinkOrmV1_1Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV1_1Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV1_1Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV1_1Package.ID_VALIDATION_TYPE_11:
- return createIdValidationType_1_1FromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV1_1Package.ID_VALIDATION_TYPE_11:
- return convertIdValidationType_1_1ToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IdValidationType_1_1 createIdValidationType_1_1FromString(EDataType eDataType, String initialValue)
- {
- IdValidationType_1_1 result = IdValidationType_1_1.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertIdValidationType_1_1ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV1_1Package getEclipseLinkOrmV1_1Package()
- {
- return (EclipseLinkOrmV1_1Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV1_1Package getPackage()
- {
- return EclipseLinkOrmV1_1Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV1_1Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java
deleted file mode 100644
index 42e5d8554d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java
+++ /dev/null
@@ -1,696 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV1_1Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v1_1";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v1_1.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV1_1Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1 <em>Xml Basic 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1()
- * @generated
- */
- public static final int XML_BASIC_11 = 0;
-
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11__SEQUENCE_GENERATOR = OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
-
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11__TABLE_GENERATOR = OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
-
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11__GENERATED_VALUE = OrmPackage.XML_GENERATOR_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11_FEATURE_COUNT = OrmPackage.XML_GENERATOR_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1 <em>Xml Entity 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1()
- * @generated
- */
- public static final int XML_ENTITY_11 = 1;
-
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_11__PRIMARY_KEY = 0;
-
- /**
- * The number of structural features of the '<em>Xml Entity 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_11_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1 <em>Xml Mapped Superclass 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_11 = 2;
-
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY = 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_11_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1 <em>Xml Primary Key 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_11 = 3;
-
- /**
- * The feature id for the '<em><b>Validation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_11__VALIDATION = 0;
-
- /**
- * The feature id for the '<em><b>Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_11__COLUMNS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Primary Key 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_11_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1 <em>Id Validation Type 11</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getIdValidationType_1_1()
- * @generated
- */
- public static final int ID_VALIDATION_TYPE_11 = 4;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKey_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum idValidationType_1_1EEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV1_1Package()
- {
- super(eNS_URI, EclipseLinkOrmV1_1Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV1_1Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV1_1Package init()
- {
- if (isInited) return (EclipseLinkOrmV1_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV1_1Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV1_1Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV1_1Package.eNS_URI, theEclipseLinkOrmV1_1Package);
- return theEclipseLinkOrmV1_1Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1 <em>Xml Basic 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @generated
- */
- public EClass getXmlBasic_1_1()
- {
- return xmlBasic_1_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue <em>Generated Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Generated Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue()
- * @see #getXmlBasic_1_1()
- * @generated
- */
- public EReference getXmlBasic_1_1_GeneratedValue()
- {
- return (EReference)xmlBasic_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1 <em>Xml Entity 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @generated
- */
- public EClass getXmlEntity_1_1()
- {
- return xmlEntity_1_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey <em>Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey()
- * @see #getXmlEntity_1_1()
- * @generated
- */
- public EReference getXmlEntity_1_1_PrimaryKey()
- {
- return (EReference)xmlEntity_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1 <em>Xml Mapped Superclass 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @generated
- */
- public EClass getXmlMappedSuperclass_1_1()
- {
- return xmlMappedSuperclass_1_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey <em>Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey()
- * @see #getXmlMappedSuperclass_1_1()
- * @generated
- */
- public EReference getXmlMappedSuperclass_1_1_PrimaryKey()
- {
- return (EReference)xmlMappedSuperclass_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1 <em>Xml Primary Key 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @generated
- */
- public EClass getXmlPrimaryKey_1_1()
- {
- return xmlPrimaryKey_1_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation <em>Validation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Validation</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation()
- * @see #getXmlPrimaryKey_1_1()
- * @generated
- */
- public EAttribute getXmlPrimaryKey_1_1_Validation()
- {
- return (EAttribute)xmlPrimaryKey_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getColumns <em>Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getColumns()
- * @see #getXmlPrimaryKey_1_1()
- * @generated
- */
- public EReference getXmlPrimaryKey_1_1_Columns()
- {
- return (EReference)xmlPrimaryKey_1_1EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1 <em>Id Validation Type 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Id Validation Type 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @generated
- */
- public EEnum getIdValidationType_1_1()
- {
- return idValidationType_1_1EEnum;
- }
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV1_1Factory getEclipseLinkOrmV1_1Factory()
- {
- return (EclipseLinkOrmV1_1Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlBasic_1_1EClass = createEClass(XML_BASIC_11);
- createEReference(xmlBasic_1_1EClass, XML_BASIC_11__GENERATED_VALUE);
-
- xmlEntity_1_1EClass = createEClass(XML_ENTITY_11);
- createEReference(xmlEntity_1_1EClass, XML_ENTITY_11__PRIMARY_KEY);
-
- xmlMappedSuperclass_1_1EClass = createEClass(XML_MAPPED_SUPERCLASS_11);
- createEReference(xmlMappedSuperclass_1_1EClass, XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY);
-
- xmlPrimaryKey_1_1EClass = createEClass(XML_PRIMARY_KEY_11);
- createEAttribute(xmlPrimaryKey_1_1EClass, XML_PRIMARY_KEY_11__VALIDATION);
- createEReference(xmlPrimaryKey_1_1EClass, XML_PRIMARY_KEY_11__COLUMNS);
-
- // Create enums
- idValidationType_1_1EEnum = createEEnum(ID_VALIDATION_TYPE_11);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlBasic_1_1EClass.getESuperTypes().add(theOrmPackage.getXmlGeneratorContainer());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlBasic_1_1EClass, XmlBasic_1_1.class, "XmlBasic_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_1_1_GeneratedValue(), theOrmPackage.getXmlGeneratedValue(), null, "generatedValue", null, 0, 1, XmlBasic_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_1_1EClass, XmlEntity_1_1.class, "XmlEntity_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_1_1_PrimaryKey(), theEclipseLinkOrmPackage.getXmlPrimaryKey(), null, "primaryKey", null, 0, 1, XmlEntity_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_1_1EClass, XmlMappedSuperclass_1_1.class, "XmlMappedSuperclass_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_1_1_PrimaryKey(), theEclipseLinkOrmPackage.getXmlPrimaryKey(), null, "primaryKey", null, 0, 1, XmlMappedSuperclass_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPrimaryKey_1_1EClass, XmlPrimaryKey_1_1.class, "XmlPrimaryKey_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrimaryKey_1_1_Validation(), this.getIdValidationType_1_1(), "validation", null, 0, 1, XmlPrimaryKey_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPrimaryKey_1_1_Columns(), theOrmPackage.getXmlColumn(), null, "columns", null, 0, -1, XmlPrimaryKey_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(idValidationType_1_1EEnum, IdValidationType_1_1.class, "IdValidationType_1_1");
- addEEnumLiteral(idValidationType_1_1EEnum, IdValidationType_1_1.NULL);
- addEEnumLiteral(idValidationType_1_1EEnum, IdValidationType_1_1.ZERO);
- addEEnumLiteral(idValidationType_1_1EEnum, IdValidationType_1_1.NONE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1 <em>Xml Basic 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1()
- * @generated
- */
- public static final EClass XML_BASIC_11 = eINSTANCE.getXmlBasic_1_1();
-
- /**
- * The meta object literal for the '<em><b>Generated Value</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_11__GENERATED_VALUE = eINSTANCE.getXmlBasic_1_1_GeneratedValue();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1 <em>Xml Entity 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1()
- * @generated
- */
- public static final EClass XML_ENTITY_11 = eINSTANCE.getXmlEntity_1_1();
-
- /**
- * The meta object literal for the '<em><b>Primary Key</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_11__PRIMARY_KEY = eINSTANCE.getXmlEntity_1_1_PrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1 <em>Xml Mapped Superclass 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_11 = eINSTANCE.getXmlMappedSuperclass_1_1();
-
- /**
- * The meta object literal for the '<em><b>Primary Key</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY = eINSTANCE.getXmlMappedSuperclass_1_1_PrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1 <em>Xml Primary Key 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY_11 = eINSTANCE.getXmlPrimaryKey_1_1();
-
- /**
- * The meta object literal for the '<em><b>Validation</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIMARY_KEY_11__VALIDATION = eINSTANCE.getXmlPrimaryKey_1_1_Validation();
-
- /**
- * The meta object literal for the '<em><b>Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PRIMARY_KEY_11__COLUMNS = eINSTANCE.getXmlPrimaryKey_1_1_Columns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1 <em>Id Validation Type 11</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getIdValidationType_1_1()
- * @generated
- */
- public static final EEnum ID_VALIDATION_TYPE_11 = eINSTANCE.getIdValidationType_1_1();
-
- }
-
-} //EclipseLinkOrmV1_1Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java
deleted file mode 100644
index 86526aa17f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Id Validation Type 11</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getIdValidationType_1_1()
- * @model
- * @generated
- */
-public enum IdValidationType_1_1 implements Enumerator
-{
- /**
- * The '<em><b>NULL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NULL_VALUE
- * @generated
- * @ordered
- */
- NULL(0, "NULL", "NULL"),
-
- /**
- * The '<em><b>ZERO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ZERO_VALUE
- * @generated
- * @ordered
- */
- ZERO(2, "ZERO", "ZERO"),
-
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(2, "NONE", "NONE");
-
- /**
- * The '<em><b>NULL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NULL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NULL
- * @model
- * @generated
- * @ordered
- */
- public static final int NULL_VALUE = 0;
-
- /**
- * The '<em><b>ZERO</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ZERO</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ZERO
- * @model
- * @generated
- * @ordered
- */
- public static final int ZERO_VALUE = 2;
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Id Validation Type 11</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final IdValidationType_1_1[] VALUES_ARRAY =
- new IdValidationType_1_1[]
- {
- NULL,
- ZERO,
- NONE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Id Validation Type 11</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<IdValidationType_1_1> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Id Validation Type 11</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static IdValidationType_1_1 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- IdValidationType_1_1 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Id Validation Type 11</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static IdValidationType_1_1 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- IdValidationType_1_1 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Id Validation Type 11</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static IdValidationType_1_1 get(int value)
- {
- switch (value)
- {
- case NULL_VALUE: return NULL;
- case ZERO_VALUE: return ZERO;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private IdValidationType_1_1(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //IdValidationType_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java
deleted file mode 100644
index 62f5765c4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue <em>Generated Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasic_1_1 extends XmlGeneratorContainer
-{
- /**
- * Returns the value of the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generated Value</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generated Value</em>' containment reference.
- * @see #setGeneratedValue(XmlGeneratedValue)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1_GeneratedValue()
- * @model containment="true"
- * @generated
- */
- XmlGeneratedValue getGeneratedValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generated Value</em>' containment reference.
- * @see #getGeneratedValue()
- * @generated
- */
- void setGeneratedValue(XmlGeneratedValue value);
-
-} // XmlBasic_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java
deleted file mode 100644
index 69bdd82004..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntity_1_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- XmlPrimaryKey getPrimaryKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- void setPrimaryKey(XmlPrimaryKey value);
-
-} // XmlEntity_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java
deleted file mode 100644
index 7451f79963..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMappedSuperclass_1_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- XmlPrimaryKey getPrimaryKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- void setPrimaryKey(XmlPrimaryKey value);
-
-} // XmlMappedSuperclass_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java
deleted file mode 100644
index 8388ed1714..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Primary Key 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation <em>Validation</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getColumns <em>Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPrimaryKey_1_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Validation</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Validation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #setValidation(IdValidationType_1_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1_Validation()
- * @model
- * @generated
- */
- IdValidationType_1_1 getValidation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation <em>Validation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #getValidation()
- * @generated
- */
- void setValidation(IdValidationType_1_1 value);
-
- /**
- * Returns the value of the '<em><b>Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1_Columns()
- * @model containment="true"
- * @generated
- */
- EList<XmlColumn> getColumns();
-
-} // XmlPrimaryKey_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java
deleted file mode 100644
index 9ae73b0371..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-
-@SuppressWarnings("nls")
-public interface EclipseLink1_2
- extends EclipseLink1_1
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_2.xsd";
- String SCHEMA_VERSION = "1.2";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java
deleted file mode 100644
index f7663cce81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_0
- extends EclipseLink1_1, JPA2_0
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_0.xsd";
- String SCHEMA_VERSION = "2.0";
-
- // EclipseLink 2.0 specific nodes
-
- String CACHE_INTERCEPTOR = "cache-interceptor";
-
- String CORRECTION_TYPE = "correction-type";
- String MAP_KEY_ASSOCIATION_OVERRIDE = "map-key-association-override";
-
- String QUERY_REDIRECTORS = "query-redirectors";
- String QUERY_REDIRECTORS__ALL_QUERIES = "all-queries";
- String QUERY_REDIRECTORS__READ_ALL = "read-all";
- String QUERY_REDIRECTORS__READ_OBJECT = "read-object";
- String QUERY_REDIRECTORS__REPORT = "report";
- String QUERY_REDIRECTORS__UPDATE = "update";
- String QUERY_REDIRECTORS__INSERT = "insert";
- String QUERY_REDIRECTORS__DELETE = "delete";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java
deleted file mode 100644
index 9c17c127d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package
- * @generated
- */
-public class EclipseLinkOrmV2_0Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_0Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_0Factory init()
- {
- try
- {
- EclipseLinkOrmV2_0Factory theEclipseLinkOrmV2_0Factory = (EclipseLinkOrmV2_0Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_0.xmi");
- if (theEclipseLinkOrmV2_0Factory != null)
- {
- return theEclipseLinkOrmV2_0Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_0Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_0Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_0Package.ORDER_CORRECTION_TYPE_20:
- return createOrderCorrectionType_2_0FromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_0Package.ORDER_CORRECTION_TYPE_20:
- return convertOrderCorrectionType_2_0ToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrderCorrectionType_2_0 createOrderCorrectionType_2_0FromString(EDataType eDataType, String initialValue)
- {
- OrderCorrectionType_2_0 result = OrderCorrectionType_2_0.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertOrderCorrectionType_2_0ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_0Package getEclipseLinkOrmV2_0Package()
- {
- return (EclipseLinkOrmV2_0Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_0Package getPackage()
- {
- return EclipseLinkOrmV2_0Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_0Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java
deleted file mode 100644
index 7b6ade8e55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java
+++ /dev/null
@@ -1,1526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_0Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_0";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_0.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_0Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0 <em>Xml Map Key Association Override Container 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0()
- * @generated
- */
- public static final int XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20 = 4;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Map Key Association Override Container 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0 <em>Xml Collection Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0()
- * @generated
- */
- public static final int XML_COLLECTION_MAPPING_20 = 0;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_MAPPING_20__MAP_KEY_ASSOCIATION_OVERRIDES = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Collection Mapping 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_MAPPING_20_FEATURE_COUNT = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0 <em>Xml Element Collection 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlElementCollection_2_0()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_20 = 1;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__ACCESS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__NAME = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS_METHODS;
-
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__PROPERTIES = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__PROPERTIES;
-
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__LOB = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__TEMPORAL = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__ENUMERATED = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__CONVERTER = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__TYPE_CONVERTER = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__OBJECT_TYPE_CONVERTER = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__STRUCT_CONVERTER = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__CONVERT = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__TYPE_CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__OBJECT_TYPE_CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__STRUCT_CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__MAP_KEY_ASSOCIATION_OVERRIDES = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__MAP_KEY_CONVERT = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 13;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 14;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0()
- * @generated
- */
- public static final int XML_ENTITY_20 = 2;
-
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_20__CACHE_INTERCEPTOR = 0;
-
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_20__QUERY_REDIRECTORS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Entity 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_20_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0 <em>Xml Many To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlManyToMany_2_0()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_20 = 3;
-
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
-
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__TYPE_CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
-
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__OBJECT_TYPE_CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
-
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__STRUCT_CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__MAP_KEY_ASSOCIATION_OVERRIDES = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__MAP_KEY_CONVERT = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20_FEATURE_COUNT = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0 <em>Xml Mapped Superclass 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_20 = 5;
-
- /**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_20__CACHEABLE = OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE;
-
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR = OrmV2_0Package.XML_CACHEABLE_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_20_FEATURE_COUNT = OrmV2_0Package.XML_CACHEABLE_20_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0 <em>Xml One To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOneToMany_2_0()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_20 = 6;
-
- /**
- * The feature id for the '<em><b>Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__CONVERTER;
-
- /**
- * The feature id for the '<em><b>Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__TYPE_CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__TYPE_CONVERTER;
-
- /**
- * The feature id for the '<em><b>Object Type Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__OBJECT_TYPE_CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__OBJECT_TYPE_CONVERTER;
-
- /**
- * The feature id for the '<em><b>Struct Converter</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__STRUCT_CONVERTER = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER__STRUCT_CONVERTER;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__MAP_KEY_ASSOCIATION_OVERRIDES = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__MAP_KEY_CONVERT = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20_FEATURE_COUNT = EclipseLinkOrmPackage.XML_CONVERTER_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0 <em>Xml Order Column 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0()
- * @generated
- */
- public static final int XML_ORDER_COLUMN_20 = 7;
-
- /**
- * The feature id for the '<em><b>Correction Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN_20__CORRECTION_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Order Column 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0 <em>Xml Query Redirectors 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0()
- * @generated
- */
- public static final int XML_QUERY_REDIRECTORS_20 = 8;
-
- /**
- * The feature id for the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__ALL_QUERIES = 0;
-
- /**
- * The feature id for the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__READ_ALL = 1;
-
- /**
- * The feature id for the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__READ_OBJECT = 2;
-
- /**
- * The feature id for the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__REPORT = 3;
-
- /**
- * The feature id for the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__UPDATE = 4;
-
- /**
- * The feature id for the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__INSERT = 5;
-
- /**
- * The feature id for the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__DELETE = 6;
-
- /**
- * The number of structural features of the '<em>Xml Query Redirectors 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20_FEATURE_COUNT = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0 <em>Order Correction Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getOrderCorrectionType_2_0()
- * @generated
- */
- public static final int ORDER_CORRECTION_TYPE_20 = 9;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionMapping_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToMany_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMapKeyAssociationOverrideContainer_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOrderColumn_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryRedirectors_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum orderCorrectionType_2_0EEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_0Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_0Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_0Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_0Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_0Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_0Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_0Package.eNS_URI, theEclipseLinkOrmV2_0Package);
- return theEclipseLinkOrmV2_0Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0 <em>Xml Collection Mapping 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Collection Mapping 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @generated
- */
- public EClass getXmlCollectionMapping_2_0()
- {
- return xmlCollectionMapping_2_0EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert <em>Map Key Convert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Map Key Convert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert()
- * @see #getXmlCollectionMapping_2_0()
- * @generated
- */
- public EAttribute getXmlCollectionMapping_2_0_MapKeyConvert()
- {
- return (EAttribute)xmlCollectionMapping_2_0EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0 <em>Xml Element Collection 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @generated
- */
- public EClass getXmlElementCollection_2_0()
- {
- return xmlElementCollection_2_0EClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @generated
- */
- public EClass getXmlEntity_2_0()
- {
- return xmlEntity_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor <em>Cache Interceptor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Interceptor</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor()
- * @see #getXmlEntity_2_0()
- * @generated
- */
- public EReference getXmlEntity_2_0_CacheInterceptor()
- {
- return (EReference)xmlEntity_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors <em>Query Redirectors</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Query Redirectors</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors()
- * @see #getXmlEntity_2_0()
- * @generated
- */
- public EReference getXmlEntity_2_0_QueryRedirectors()
- {
- return (EReference)xmlEntity_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0 <em>Xml Many To Many 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @generated
- */
- public EClass getXmlManyToMany_2_0()
- {
- return xmlManyToMany_2_0EClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0 <em>Xml Map Key Association Override Container 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Map Key Association Override Container 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @generated
- */
- public EClass getXmlMapKeyAssociationOverrideContainer_2_0()
- {
- return xmlMapKeyAssociationOverrideContainer_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0#getMapKeyAssociationOverrides <em>Map Key Association Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Map Key Association Overrides</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0#getMapKeyAssociationOverrides()
- * @see #getXmlMapKeyAssociationOverrideContainer_2_0()
- * @generated
- */
- public EReference getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- {
- return (EReference)xmlMapKeyAssociationOverrideContainer_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0 <em>Xml Mapped Superclass 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_0()
- {
- return xmlMappedSuperclass_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor <em>Cache Interceptor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Interceptor</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor()
- * @see #getXmlMappedSuperclass_2_0()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_0_CacheInterceptor()
- {
- return (EReference)xmlMappedSuperclass_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0 <em>Xml One To Many 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @generated
- */
- public EClass getXmlOneToMany_2_0()
- {
- return xmlOneToMany_2_0EClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0 <em>Xml Order Column 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Order Column 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @generated
- */
- public EClass getXmlOrderColumn_2_0()
- {
- return xmlOrderColumn_2_0EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType <em>Correction Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Correction Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType()
- * @see #getXmlOrderColumn_2_0()
- * @generated
- */
- public EAttribute getXmlOrderColumn_2_0_CorrectionType()
- {
- return (EAttribute)xmlOrderColumn_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0 <em>Xml Query Redirectors 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Redirectors 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @generated
- */
- public EClass getXmlQueryRedirectors_2_0()
- {
- return xmlQueryRedirectors_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries <em>All Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>All Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_AllQueries()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll <em>Read All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Read All</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_ReadAll()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject <em>Read Object</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Read Object</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_ReadObject()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport <em>Report</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Report</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Report()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate <em>Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Update</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Update()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert <em>Insert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Insert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Insert()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete <em>Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Delete()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0 <em>Order Correction Type 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Order Correction Type 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @generated
- */
- public EEnum getOrderCorrectionType_2_0()
- {
- return orderCorrectionType_2_0EEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_0Factory getEclipseLinkOrmV2_0Factory()
- {
- return (EclipseLinkOrmV2_0Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlCollectionMapping_2_0EClass = createEClass(XML_COLLECTION_MAPPING_20);
- createEAttribute(xmlCollectionMapping_2_0EClass, XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT);
-
- xmlElementCollection_2_0EClass = createEClass(XML_ELEMENT_COLLECTION_20);
-
- xmlEntity_2_0EClass = createEClass(XML_ENTITY_20);
- createEReference(xmlEntity_2_0EClass, XML_ENTITY_20__CACHE_INTERCEPTOR);
- createEReference(xmlEntity_2_0EClass, XML_ENTITY_20__QUERY_REDIRECTORS);
-
- xmlManyToMany_2_0EClass = createEClass(XML_MANY_TO_MANY_20);
-
- xmlMapKeyAssociationOverrideContainer_2_0EClass = createEClass(XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20);
- createEReference(xmlMapKeyAssociationOverrideContainer_2_0EClass, XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES);
-
- xmlMappedSuperclass_2_0EClass = createEClass(XML_MAPPED_SUPERCLASS_20);
- createEReference(xmlMappedSuperclass_2_0EClass, XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR);
-
- xmlOneToMany_2_0EClass = createEClass(XML_ONE_TO_MANY_20);
-
- xmlOrderColumn_2_0EClass = createEClass(XML_ORDER_COLUMN_20);
- createEAttribute(xmlOrderColumn_2_0EClass, XML_ORDER_COLUMN_20__CORRECTION_TYPE);
-
- xmlQueryRedirectors_2_0EClass = createEClass(XML_QUERY_REDIRECTORS_20);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__ALL_QUERIES);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__READ_ALL);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__READ_OBJECT);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__REPORT);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__UPDATE);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__INSERT);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__DELETE);
-
- // Create enums
- orderCorrectionType_2_0EEnum = createEEnum(ORDER_CORRECTION_TYPE_20);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlCollectionMapping_2_0EClass.getESuperTypes().add(this.getXmlMapKeyAssociationOverrideContainer_2_0());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAttributeMapping());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlConvertibleMapping());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlConvertersHolder());
- xmlElementCollection_2_0EClass.getESuperTypes().add(this.getXmlCollectionMapping_2_0());
- xmlManyToMany_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlConverterHolder());
- xmlManyToMany_2_0EClass.getESuperTypes().add(this.getXmlCollectionMapping_2_0());
- xmlMappedSuperclass_2_0EClass.getESuperTypes().add(theOrmV2_0Package.getXmlCacheable_2_0());
- xmlOneToMany_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlConverterHolder());
- xmlOneToMany_2_0EClass.getESuperTypes().add(this.getXmlCollectionMapping_2_0());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlCollectionMapping_2_0EClass, XmlCollectionMapping_2_0.class, "XmlCollectionMapping_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCollectionMapping_2_0_MapKeyConvert(), theXMLTypePackage.getString(), "mapKeyConvert", null, 0, 1, XmlCollectionMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_0EClass, XmlElementCollection_2_0.class, "XmlElementCollection_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEntity_2_0EClass, XmlEntity_2_0.class, "XmlEntity_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_0_CacheInterceptor(), theOrmPackage.getXmlClassReference(), null, "cacheInterceptor", null, 0, 1, XmlEntity_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_0_QueryRedirectors(), theEclipseLinkOrmPackage.getXmlQueryRedirectors(), null, "queryRedirectors", null, 0, 1, XmlEntity_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToMany_2_0EClass, XmlManyToMany_2_0.class, "XmlManyToMany_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMapKeyAssociationOverrideContainer_2_0EClass, XmlMapKeyAssociationOverrideContainer_2_0.class, "XmlMapKeyAssociationOverrideContainer_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides(), theOrmPackage.getXmlAssociationOverride(), null, "mapKeyAssociationOverrides", null, 0, -1, XmlMapKeyAssociationOverrideContainer_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_0EClass, XmlMappedSuperclass_2_0.class, "XmlMappedSuperclass_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_0_CacheInterceptor(), theOrmPackage.getXmlClassReference(), null, "cacheInterceptor", null, 0, 1, XmlMappedSuperclass_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_0EClass, XmlOneToMany_2_0.class, "XmlOneToMany_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOrderColumn_2_0EClass, XmlOrderColumn_2_0.class, "XmlOrderColumn_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOrderColumn_2_0_CorrectionType(), this.getOrderCorrectionType_2_0(), "correctionType", null, 0, 1, XmlOrderColumn_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryRedirectors_2_0EClass, XmlQueryRedirectors_2_0.class, "XmlQueryRedirectors_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQueryRedirectors_2_0_AllQueries(), theXMLTypePackage.getString(), "allQueries", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_ReadAll(), theXMLTypePackage.getString(), "readAll", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_ReadObject(), theXMLTypePackage.getString(), "readObject", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Report(), theXMLTypePackage.getString(), "report", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Update(), theXMLTypePackage.getString(), "update", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Insert(), theXMLTypePackage.getString(), "insert", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Delete(), theXMLTypePackage.getString(), "delete", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.class, "OrderCorrectionType_2_0");
- addEEnumLiteral(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.READ);
- addEEnumLiteral(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.READ_WRITE);
- addEEnumLiteral(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.EXCEPTION);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0 <em>Xml Collection Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0()
- * @generated
- */
- public static final EClass XML_COLLECTION_MAPPING_20 = eINSTANCE.getXmlCollectionMapping_2_0();
-
- /**
- * The meta object literal for the '<em><b>Map Key Convert</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT = eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0 <em>Xml Element Collection 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlElementCollection_2_0()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_20 = eINSTANCE.getXmlElementCollection_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0()
- * @generated
- */
- public static final EClass XML_ENTITY_20 = eINSTANCE.getXmlEntity_2_0();
-
- /**
- * The meta object literal for the '<em><b>Cache Interceptor</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_20__CACHE_INTERCEPTOR = eINSTANCE.getXmlEntity_2_0_CacheInterceptor();
-
- /**
- * The meta object literal for the '<em><b>Query Redirectors</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_20__QUERY_REDIRECTORS = eINSTANCE.getXmlEntity_2_0_QueryRedirectors();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0 <em>Xml Many To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlManyToMany_2_0()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_20 = eINSTANCE.getXmlManyToMany_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0 <em>Xml Map Key Association Override Container 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0()
- * @generated
- */
- public static final EClass XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20 = eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0();
-
- /**
- * The meta object literal for the '<em><b>Map Key Association Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES = eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0 <em>Xml Mapped Superclass 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_20 = eINSTANCE.getXmlMappedSuperclass_2_0();
-
- /**
- * The meta object literal for the '<em><b>Cache Interceptor</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR = eINSTANCE.getXmlMappedSuperclass_2_0_CacheInterceptor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0 <em>Xml One To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOneToMany_2_0()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_20 = eINSTANCE.getXmlOneToMany_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0 <em>Xml Order Column 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0()
- * @generated
- */
- public static final EClass XML_ORDER_COLUMN_20 = eINSTANCE.getXmlOrderColumn_2_0();
-
- /**
- * The meta object literal for the '<em><b>Correction Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ORDER_COLUMN_20__CORRECTION_TYPE = eINSTANCE.getXmlOrderColumn_2_0_CorrectionType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0 <em>Xml Query Redirectors 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0()
- * @generated
- */
- public static final EClass XML_QUERY_REDIRECTORS_20 = eINSTANCE.getXmlQueryRedirectors_2_0();
-
- /**
- * The meta object literal for the '<em><b>All Queries</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__ALL_QUERIES = eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries();
-
- /**
- * The meta object literal for the '<em><b>Read All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__READ_ALL = eINSTANCE.getXmlQueryRedirectors_2_0_ReadAll();
-
- /**
- * The meta object literal for the '<em><b>Read Object</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__READ_OBJECT = eINSTANCE.getXmlQueryRedirectors_2_0_ReadObject();
-
- /**
- * The meta object literal for the '<em><b>Report</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__REPORT = eINSTANCE.getXmlQueryRedirectors_2_0_Report();
-
- /**
- * The meta object literal for the '<em><b>Update</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__UPDATE = eINSTANCE.getXmlQueryRedirectors_2_0_Update();
-
- /**
- * The meta object literal for the '<em><b>Insert</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__INSERT = eINSTANCE.getXmlQueryRedirectors_2_0_Insert();
-
- /**
- * The meta object literal for the '<em><b>Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__DELETE = eINSTANCE.getXmlQueryRedirectors_2_0_Delete();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0 <em>Order Correction Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getOrderCorrectionType_2_0()
- * @generated
- */
- public static final EEnum ORDER_CORRECTION_TYPE_20 = eINSTANCE.getOrderCorrectionType_2_0();
-
- }
-
-} //EclipseLinkOrmV2_0Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java
deleted file mode 100644
index d9a1f50eb9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Order Column Correction Type 20</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getOrderCorrectionType_2_0()
- * @model
- * @generated
- */
-public enum OrderCorrectionType_2_0 implements Enumerator
-{
- /**
- * The '<em><b>READ</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #READ_VALUE
- * @generated
- * @ordered
- */
- READ(0, "READ", "READ"),
-
- /**
- * The '<em><b>READ WRITE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #READ_WRITE_VALUE
- * @generated
- * @ordered
- */
- READ_WRITE(1, "READ_WRITE", "READ_WRITE"),
-
- /**
- * The '<em><b>EXCEPTION</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #EXCEPTION_VALUE
- * @generated
- * @ordered
- */
- EXCEPTION(2, "EXCEPTION", "EXCEPTION");
-
- /**
- * The '<em><b>READ</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>READ</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #READ
- * @model
- * @generated
- * @ordered
- */
- public static final int READ_VALUE = 0;
-
- /**
- * The '<em><b>READ WRITE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>READ WRITE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #READ_WRITE
- * @model
- * @generated
- * @ordered
- */
- public static final int READ_WRITE_VALUE = 1;
-
- /**
- * The '<em><b>EXCEPTION</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>EXCEPTION</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #EXCEPTION
- * @model
- * @generated
- * @ordered
- */
- public static final int EXCEPTION_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Order Correction Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final OrderCorrectionType_2_0[] VALUES_ARRAY =
- new OrderCorrectionType_2_0[]
- {
- READ,
- READ_WRITE,
- EXCEPTION,
- };
-
- /**
- * A public read-only list of all the '<em><b>Order Correction Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<OrderCorrectionType_2_0> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Order Correction Type 20</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrderCorrectionType_2_0 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- OrderCorrectionType_2_0 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Order Correction Type 20</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrderCorrectionType_2_0 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- OrderCorrectionType_2_0 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Order Correction Type 20</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrderCorrectionType_2_0 get(int value)
- {
- switch (value)
- {
- case READ_VALUE: return READ;
- case READ_WRITE_VALUE: return READ_WRITE;
- case EXCEPTION_VALUE: return EXCEPTION;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private OrderCorrectionType_2_0(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //OrderColumnCorrectionType_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java
deleted file mode 100644
index 1c09a599ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache Interceptor2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCacheInterceptor_2_0#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCacheInterceptor_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCacheInterceptor_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCacheInterceptor_2_0_ClassName()
- * @model
- * @generated
- */
- String getClassName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCacheInterceptor_2_0#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- void setClassName(String value);
-
-} // XmlCacheInterceptor2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java
deleted file mode 100644
index d355767009..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Collection Mapping 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert <em>Map Key Convert</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlCollectionMapping_2_0 extends XmlMapKeyAssociationOverrideContainer_2_0
-{
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getMapKeyConvert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- void setMapKeyConvert(String value);
-
-} // XmlCollectionMapping_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java
deleted file mode 100644
index 4b32697f58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertersHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlElementCollection_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlElementCollection_2_0 extends XmlAttributeMapping, XmlConvertibleMapping, XmlConvertersHolder, XmlCollectionMapping_2_0
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java
deleted file mode 100644
index 142a7d844f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor <em>Cache Interceptor</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors <em>Query Redirectors</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntity_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getCacheInterceptor();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- void setCacheInterceptor(XmlClassReference value);
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- XmlQueryRedirectors getQueryRedirectors();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- void setQueryRedirectors(XmlQueryRedirectors value);
-
-} // XmlEntity2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java
deleted file mode 100644
index 31bb9c6e53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To Many 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlManyToMany_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany_2_0 extends XmlConverterHolder, XmlCollectionMapping_2_0
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java
deleted file mode 100644
index 5e56cca4f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Map Key Association Override Container2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0#getMapKeyAssociationOverrides <em>Map Key Association Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMapKeyAssociationOverrideContainer_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAssociationOverride> getMapKeyAssociationOverrides();
-
-} // XmlMapKeyAssociationOverrideContainer2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java
deleted file mode 100644
index 20cb2803d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor <em>Cache Interceptor</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_0 extends XmlCacheable_2_0
-{
-
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getCacheInterceptor();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- void setCacheInterceptor(XmlClassReference value);
-
-} // XmlMappedSuperclass_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java
deleted file mode 100644
index ad28f54969..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOneToMany_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany_2_0 extends XmlConverterHolder, XmlCollectionMapping_2_0
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java
deleted file mode 100644
index f7c5c71ed6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Order Column 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType <em>Correction Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlOrderColumn_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Correction Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Correction Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #setCorrectionType(OrderCorrectionType_2_0)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0_CorrectionType()
- * @model
- * @generated
- */
- OrderCorrectionType_2_0 getCorrectionType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType <em>Correction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #getCorrectionType()
- * @generated
- */
- void setCorrectionType(OrderCorrectionType_2_0 value);
-
-} // XmlOrderColumn_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java
deleted file mode 100644
index 38fa1162ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query Redirectors2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries <em>All Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll <em>Read All</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject <em>Read Object</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport <em>Report</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate <em>Update</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert <em>Insert</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete <em>Delete</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQueryRedirectors_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>All Queries</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>All Queries</em>' attribute.
- * @see #setAllQueries(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_AllQueries()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAllQueries();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>All Queries</em>' attribute.
- * @see #getAllQueries()
- * @generated
- */
- void setAllQueries(String value);
-
- /**
- * Returns the value of the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read All</em>' attribute.
- * @see #setReadAll(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_ReadAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getReadAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read All</em>' attribute.
- * @see #getReadAll()
- * @generated
- */
- void setReadAll(String value);
-
- /**
- * Returns the value of the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Object</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Object</em>' attribute.
- * @see #setReadObject(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_ReadObject()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getReadObject();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Object</em>' attribute.
- * @see #getReadObject()
- * @generated
- */
- void setReadObject(String value);
-
- /**
- * Returns the value of the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Report</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Report</em>' attribute.
- * @see #setReport(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Report()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getReport();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Report</em>' attribute.
- * @see #getReport()
- * @generated
- */
- void setReport(String value);
-
- /**
- * Returns the value of the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Update</em>' attribute.
- * @see #setUpdate(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Update()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getUpdate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Update</em>' attribute.
- * @see #getUpdate()
- * @generated
- */
- void setUpdate(String value);
-
- /**
- * Returns the value of the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insert</em>' attribute.
- * @see #setInsert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Insert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getInsert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insert</em>' attribute.
- * @see #getInsert()
- * @generated
- */
- void setInsert(String value);
-
- /**
- * Returns the value of the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete</em>' attribute.
- * @see #setDelete(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Delete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete</em>' attribute.
- * @see #getDelete()
- * @generated
- */
- void setDelete(String value);
-
-} // XmlQueryRedirectors2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java
deleted file mode 100644
index 6dda927b61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Batch Fetch Type 21</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getBatchFetchType_2_1()
- * @model
- * @generated
- */
-public enum BatchFetchType_2_1 implements Enumerator
-{
- /**
- * The '<em><b>JOIN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #JOIN_VALUE
- * @generated
- * @ordered
- */
- JOIN(0, "JOIN", "JOIN"),
-
- /**
- * The '<em><b>EXISTS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #EXISTS_VALUE
- * @generated
- * @ordered
- */
- EXISTS(1, "EXISTS", "EXISTS"),
-
- /**
- * The '<em><b>IN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IN_VALUE
- * @generated
- * @ordered
- */
- IN(2, "IN", "IN");
-
- /**
- * The '<em><b>JOIN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>JOIN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #JOIN
- * @model
- * @generated
- * @ordered
- */
- public static final int JOIN_VALUE = 0;
-
- /**
- * The '<em><b>EXISTS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>EXISTS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #EXISTS
- * @model
- * @generated
- * @ordered
- */
- public static final int EXISTS_VALUE = 1;
-
- /**
- * The '<em><b>IN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IN
- * @model
- * @generated
- * @ordered
- */
- public static final int IN_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Batch Fetch Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final BatchFetchType_2_1[] VALUES_ARRAY =
- new BatchFetchType_2_1[]
- {
- JOIN,
- EXISTS,
- IN,
- };
-
- /**
- * A public read-only list of all the '<em><b>Batch Fetch Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<BatchFetchType_2_1> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Batch Fetch Type 21</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static BatchFetchType_2_1 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- BatchFetchType_2_1 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Batch Fetch Type 21</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static BatchFetchType_2_1 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- BatchFetchType_2_1 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Batch Fetch Type 21</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static BatchFetchType_2_1 get(int value)
- {
- switch (value)
- {
- case JOIN_VALUE: return JOIN;
- case EXISTS_VALUE: return EXISTS;
- case IN_VALUE: return IN;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private BatchFetchType_2_1(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //BatchFetchType_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java
deleted file mode 100644
index 6d36604765..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Cache Key Type 21</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getCacheKeyType_2_1()
- * @model
- * @generated
- */
-public enum CacheKeyType_2_1 implements Enumerator
-{
- /**
- * The '<em><b>ID VALUE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ID_VALUE_VALUE
- * @generated
- * @ordered
- */
- ID_VALUE(0, "ID_VALUE", "ID_VALUE"),
-
- /**
- * The '<em><b>CACHE KEY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CACHE_KEY_VALUE
- * @generated
- * @ordered
- */
- CACHE_KEY(1, "CACHE_KEY", "CACHE_KEY"),
-
- /**
- * The '<em><b>AUTO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #AUTO_VALUE
- * @generated
- * @ordered
- */
- AUTO(2, "AUTO", "AUTO");
-
- /**
- * The '<em><b>ID VALUE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ID VALUE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ID_VALUE
- * @model
- * @generated
- * @ordered
- */
- public static final int ID_VALUE_VALUE = 0;
-
- /**
- * The '<em><b>CACHE KEY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CACHE KEY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CACHE_KEY
- * @model
- * @generated
- * @ordered
- */
- public static final int CACHE_KEY_VALUE = 1;
-
- /**
- * The '<em><b>AUTO</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>AUTO</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #AUTO
- * @model
- * @generated
- * @ordered
- */
- public static final int AUTO_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Cache Key Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheKeyType_2_1[] VALUES_ARRAY =
- new CacheKeyType_2_1[]
- {
- ID_VALUE,
- CACHE_KEY,
- AUTO,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Key Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheKeyType_2_1> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Key Type 21</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheKeyType_2_1 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheKeyType_2_1 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Key Type 21</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheKeyType_2_1 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheKeyType_2_1 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Key Type 21</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheKeyType_2_1 get(int value)
- {
- switch (value)
- {
- case ID_VALUE_VALUE: return ID_VALUE;
- case CACHE_KEY_VALUE: return CACHE_KEY;
- case AUTO_VALUE: return AUTO;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheKeyType_2_1(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheKeyType_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java
deleted file mode 100644
index 5bd544a267..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_1
- extends EclipseLink2_0
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_1.xsd";
- String SCHEMA_VERSION = "2.1";
-
-
- // EclipseLink 2.1 specific nodes
-
- String ATTRIBUTE = "attribute";
- String ATTRIBUTE_TYPE = "attribute-type";
- String BATCH_FETCH = "batch-fetch";
- String BATCH_FETCH__SIZE = "size";
- String BATCH_FETCH__TYPE = "type";
- String CACHE_KEY_TYPE = "cache-key-type";
- String CLASS_EXTRACTOR = "class-extractor";
- String FETCH_GROUP = "fetch-group";
- String FETCH_GROUP__LOAD = "load";
- String PARENT_CLASS = "parent-class";
- String RETURN_INSERT = "return-insert";
- String RETURN_ONLY = "return-only";
- String RETURN_UPDATE = "return-update";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java
deleted file mode 100644
index b3d74cbfef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package
- * @generated
- */
-public class EclipseLinkOrmV2_1Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_1Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_1Factory init()
- {
- try
- {
- EclipseLinkOrmV2_1Factory theEclipseLinkOrmV2_1Factory = (EclipseLinkOrmV2_1Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_1.xmi");
- if (theEclipseLinkOrmV2_1Factory != null)
- {
- return theEclipseLinkOrmV2_1Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_1Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_1Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_1Package.CACHE_KEY_TYPE_21:
- return createCacheKeyType_2_1FromString(eDataType, initialValue);
- case EclipseLinkOrmV2_1Package.BATCH_FETCH_TYPE_21:
- return createBatchFetchType_2_1FromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_1Package.CACHE_KEY_TYPE_21:
- return convertCacheKeyType_2_1ToString(eDataType, instanceValue);
- case EclipseLinkOrmV2_1Package.BATCH_FETCH_TYPE_21:
- return convertBatchFetchType_2_1ToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheKeyType_2_1 createCacheKeyType_2_1FromString(EDataType eDataType, String initialValue)
- {
- CacheKeyType_2_1 result = CacheKeyType_2_1.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheKeyType_2_1ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public BatchFetchType_2_1 createBatchFetchType_2_1FromString(EDataType eDataType, String initialValue)
- {
- BatchFetchType_2_1 result = BatchFetchType_2_1.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertBatchFetchType_2_1ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_1Package getEclipseLinkOrmV2_1Package()
- {
- return (EclipseLinkOrmV2_1Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_1Package getPackage()
- {
- return EclipseLinkOrmV2_1Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_1Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java
deleted file mode 100644
index 22a2392882..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java
+++ /dev/null
@@ -1,2567 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_1Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_1";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_1.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_1Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1 <em>Xml Basic 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1()
- * @generated
- */
- public static final int XML_BASIC_21 = 0;
-
- /**
- * The feature id for the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21__RETURN_INSERT = 0;
-
- /**
- * The feature id for the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21__RETURN_UPDATE = 1;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21__ATTRIBUTE_TYPE = 2;
-
- /**
- * The number of structural features of the '<em>Xml Basic 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1 <em>Xml Batch Fetch 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1()
- * @generated
- */
- public static final int XML_BATCH_FETCH_21 = 1;
-
- /**
- * The feature id for the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_21__SIZE = 0;
-
- /**
- * The feature id for the '<em><b>Batch Fetch Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_21__BATCH_FETCH_TYPE = 1;
-
- /**
- * The number of structural features of the '<em>Xml Batch Fetch 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_21_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1 <em>Xml Element Collection 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlElementCollection_2_1()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_21 = 2;
-
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_21__JOIN_FETCH = EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_JOIN_FETCH_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_21__ATTRIBUTE_TYPE = EclipseLinkOrmPackage.XML_JOIN_FETCH_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_JOIN_FETCH_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1 <em>Xml Embeddable 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbeddable_2_1()
- * @generated
- */
- public static final int XML_EMBEDDABLE_21 = 3;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_21__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
-
- /**
- * The number of structural features of the '<em>Xml Embeddable 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1 <em>Xml Embedded 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbedded_2_1()
- * @generated
- */
- public static final int XML_EMBEDDED_21 = 4;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_21__ATTRIBUTE_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1 <em>Xml Embedded Id 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbeddedId_2_1()
- * @generated
- */
- public static final int XML_EMBEDDED_ID_21 = 5;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_21__ATTRIBUTE_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded Id 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1 <em>Xml Fetch Group Container 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1()
- * @generated
- */
- public static final int XML_FETCH_GROUP_CONTAINER_21 = 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1 <em>Xml Entity 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1()
- * @generated
- */
- public static final int XML_ENTITY_21 = 6;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
-
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__FETCH_GROUPS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__CLASS_EXTRACTOR = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__PARENT_CLASS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Entity 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1 <em>Xml Entity Mappings 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntityMappings_2_1()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS_21 = 7;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_21__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
-
- /**
- * The number of structural features of the '<em>Xml Entity Mappings 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1 <em>Xml Fetch Attribute 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1()
- * @generated
- */
- public static final int XML_FETCH_ATTRIBUTE_21 = 8;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_ATTRIBUTE_21__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Fetch Attribute 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_ATTRIBUTE_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1 <em>Xml Fetch Group 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1()
- * @generated
- */
- public static final int XML_FETCH_GROUP_21 = 9;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_21__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_21__LOAD = 1;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_21__ATTRIBUTES = 2;
-
- /**
- * The number of structural features of the '<em>Xml Fetch Group 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_21_FEATURE_COUNT = 3;
-
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Fetch Group Container 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_CONTAINER_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1 <em>Xml Id 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlId_2_1()
- * @generated
- */
- public static final int XML_ID_21 = 11;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_21__ATTRIBUTE_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Id 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1 <em>Xml Many To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToMany_2_1()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_21 = 12;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_21__ATTRIBUTE_TYPE = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1 <em>Xml Many To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToOne_2_1()
- * @generated
- */
- public static final int XML_MANY_TO_ONE_21 = 13;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The number of structural features of the '<em>Xml Many To One 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1 <em>Xml Mapped Superclass 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_21 = 14;
-
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__ASSOCIATION_OVERRIDES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__FETCH_GROUPS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__SEQUENCE_GENERATOR = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__TABLE_GENERATOR = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__NAMED_QUERIES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__NAMED_NATIVE_QUERIES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__ACCESS_METHODS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 7;
-
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 8;
-
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 9;
-
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__PARENT_CLASS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 10;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21_FEATURE_COUNT = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1 <em>Xml One To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToMany_2_1()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_21 = 15;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_21__ATTRIBUTE_TYPE = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1 <em>Xml One To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToOne_2_1()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_21 = 16;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The number of structural features of the '<em>Xml One To One 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1 <em>Xml Persistence Unit Defaults 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPersistenceUnitDefaults_2_1()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_21 = 17;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_21__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1 <em>Xml Return Insert 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1()
- * @generated
- */
- public static final int XML_RETURN_INSERT_21 = 19;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1 <em>Xml Transformation 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTransformation_2_1()
- * @generated
- */
- public static final int XML_TRANSFORMATION_21 = 20;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1 <em>Xml Version 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlVersion_2_1()
- * @generated
- */
- public static final int XML_VERSION_21 = 21;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1 <em>Xml Primary Key 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_21 = 18;
-
- /**
- * The feature id for the '<em><b>Cache Key Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_21__CACHE_KEY_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Primary Key 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_21_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT_21__RETURN_ONLY = 0;
-
- /**
- * The number of structural features of the '<em>Xml Return Insert 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT_21_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION_21__ATTRIBUTE_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Transformation 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION_21_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_21__ATTRIBUTE_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Version 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1 <em>Cache Key Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getCacheKeyType_2_1()
- * @generated
- */
- public static final int CACHE_KEY_TYPE_21 = 22;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1 <em>Batch Fetch Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getBatchFetchType_2_1()
- * @generated
- */
- public static final int BATCH_FETCH_TYPE_21 = 23;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBatchFetch_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddable_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbedded_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedId_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappings_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchAttribute_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchGroup_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchGroupContainer_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlId_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToMany_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOne_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOne_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaults_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReturnInsert_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransformation_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersion_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKey_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheKeyType_2_1EEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum batchFetchType_2_1EEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_1Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_1Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_1Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_1Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_1Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_1Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_1Package.eNS_URI, theEclipseLinkOrmV2_1Package);
- return theEclipseLinkOrmV2_1Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1 <em>Xml Basic 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @generated
- */
- public EClass getXmlBasic_2_1()
- {
- return xmlBasic_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert <em>Return Insert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Return Insert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert()
- * @see #getXmlBasic_2_1()
- * @generated
- */
- public EReference getXmlBasic_2_1_ReturnInsert()
- {
- return (EReference)xmlBasic_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate <em>Return Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Return Update</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate()
- * @see #getXmlBasic_2_1()
- * @generated
- */
- public EAttribute getXmlBasic_2_1_ReturnUpdate()
- {
- return (EAttribute)xmlBasic_2_1EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getAttributeType()
- * @see #getXmlBasic_2_1()
- * @generated
- */
- public EAttribute getXmlBasic_2_1_AttributeType()
- {
- return (EAttribute)xmlBasic_2_1EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1 <em>Xml Batch Fetch 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Batch Fetch 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @generated
- */
- public EClass getXmlBatchFetch_2_1()
- {
- return xmlBatchFetch_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize <em>Size</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Size</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize()
- * @see #getXmlBatchFetch_2_1()
- * @generated
- */
- public EAttribute getXmlBatchFetch_2_1_Size()
- {
- return (EAttribute)xmlBatchFetch_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType <em>Batch Fetch Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Batch Fetch Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType()
- * @see #getXmlBatchFetch_2_1()
- * @generated
- */
- public EAttribute getXmlBatchFetch_2_1_BatchFetchType()
- {
- return (EAttribute)xmlBatchFetch_2_1EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1 <em>Xml Element Collection 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @generated
- */
- public EClass getXmlElementCollection_2_1()
- {
- return xmlElementCollection_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1#getAttributeType()
- * @see #getXmlElementCollection_2_1()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_1_AttributeType()
- {
- return (EAttribute)xmlElementCollection_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1 <em>Xml Embeddable 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1
- * @generated
- */
- public EClass getXmlEmbeddable_2_1()
- {
- return xmlEmbeddable_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1 <em>Xml Embedded 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1
- * @generated
- */
- public EClass getXmlEmbedded_2_1()
- {
- return xmlEmbedded_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1#getAttributeType()
- * @see #getXmlEmbedded_2_1()
- * @generated
- */
- public EAttribute getXmlEmbedded_2_1_AttributeType()
- {
- return (EAttribute)xmlEmbedded_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1 <em>Xml Embedded Id 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Id 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1
- * @generated
- */
- public EClass getXmlEmbeddedId_2_1()
- {
- return xmlEmbeddedId_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1#getAttributeType()
- * @see #getXmlEmbeddedId_2_1()
- * @generated
- */
- public EAttribute getXmlEmbeddedId_2_1_AttributeType()
- {
- return (EAttribute)xmlEmbeddedId_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1 <em>Xml Entity 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @generated
- */
- public EClass getXmlEntity_2_1()
- {
- return xmlEntity_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor <em>Class Extractor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Class Extractor</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor()
- * @see #getXmlEntity_2_1()
- * @generated
- */
- public EReference getXmlEntity_2_1_ClassExtractor()
- {
- return (EReference)xmlEntity_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getParentClass <em>Parent Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Parent Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getParentClass()
- * @see #getXmlEntity_2_1()
- * @generated
- */
- public EAttribute getXmlEntity_2_1_ParentClass()
- {
- return (EAttribute)xmlEntity_2_1EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1 <em>Xml Entity Mappings 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @generated
- */
- public EClass getXmlEntityMappings_2_1()
- {
- return xmlEntityMappings_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1 <em>Xml Fetch Attribute 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Attribute 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @generated
- */
- public EClass getXmlFetchAttribute_2_1()
- {
- return xmlFetchAttribute_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName()
- * @see #getXmlFetchAttribute_2_1()
- * @generated
- */
- public EAttribute getXmlFetchAttribute_2_1_Name()
- {
- return (EAttribute)xmlFetchAttribute_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1 <em>Xml Fetch Group 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Group 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @generated
- */
- public EClass getXmlFetchGroup_2_1()
- {
- return xmlFetchGroup_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName()
- * @see #getXmlFetchGroup_2_1()
- * @generated
- */
- public EAttribute getXmlFetchGroup_2_1_Name()
- {
- return (EAttribute)xmlFetchGroup_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getAttributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Attributes</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getAttributes()
- * @see #getXmlFetchGroup_2_1()
- * @generated
- */
- public EReference getXmlFetchGroup_2_1_Attributes()
- {
- return (EReference)xmlFetchGroup_2_1EClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad <em>Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Load</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad()
- * @see #getXmlFetchGroup_2_1()
- * @generated
- */
- public EAttribute getXmlFetchGroup_2_1_Load()
- {
- return (EAttribute)xmlFetchGroup_2_1EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1 <em>Xml Fetch Group Container 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Group Container 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @generated
- */
- public EClass getXmlFetchGroupContainer_2_1()
- {
- return xmlFetchGroupContainer_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1#getFetchGroups <em>Fetch Groups</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Fetch Groups</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1#getFetchGroups()
- * @see #getXmlFetchGroupContainer_2_1()
- * @generated
- */
- public EReference getXmlFetchGroupContainer_2_1_FetchGroups()
- {
- return (EReference)xmlFetchGroupContainer_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1 <em>Xml Id 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1
- * @generated
- */
- public EClass getXmlId_2_1()
- {
- return xmlId_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1#getAttributeType()
- * @see #getXmlId_2_1()
- * @generated
- */
- public EAttribute getXmlId_2_1_AttributeType()
- {
- return (EAttribute)xmlId_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1 <em>Xml Many To Many 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @generated
- */
- public EClass getXmlManyToMany_2_1()
- {
- return xmlManyToMany_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1#getAttributeType()
- * @see #getXmlManyToMany_2_1()
- * @generated
- */
- public EAttribute getXmlManyToMany_2_1_AttributeType()
- {
- return (EAttribute)xmlManyToMany_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1 <em>Xml Many To One 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @generated
- */
- public EClass getXmlManyToOne_2_1()
- {
- return xmlManyToOne_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1 <em>Xml Mapped Superclass 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_1()
- {
- return xmlMappedSuperclass_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sql Result Set Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getSqlResultSetMappings()
- * @see #getXmlMappedSuperclass_2_1()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_1_SqlResultSetMappings()
- {
- return (EReference)xmlMappedSuperclass_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors <em>Query Redirectors</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Query Redirectors</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors()
- * @see #getXmlMappedSuperclass_2_1()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_1_QueryRedirectors()
- {
- return (EReference)xmlMappedSuperclass_2_1EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getParentClass <em>Parent Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Parent Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getParentClass()
- * @see #getXmlMappedSuperclass_2_1()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_2_1_ParentClass()
- {
- return (EAttribute)xmlMappedSuperclass_2_1EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1 <em>Xml One To Many 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @generated
- */
- public EClass getXmlOneToMany_2_1()
- {
- return xmlOneToMany_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1#getAttributeType()
- * @see #getXmlOneToMany_2_1()
- * @generated
- */
- public EAttribute getXmlOneToMany_2_1_AttributeType()
- {
- return (EAttribute)xmlOneToMany_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1 <em>Xml One To One 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @generated
- */
- public EClass getXmlOneToOne_2_1()
- {
- return xmlOneToOne_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1 <em>Xml Persistence Unit Defaults 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults_2_1()
- {
- return xmlPersistenceUnitDefaults_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1 <em>Xml Return Insert 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Return Insert 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @generated
- */
- public EClass getXmlReturnInsert_2_1()
- {
- return xmlReturnInsert_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly <em>Return Only</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Return Only</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly()
- * @see #getXmlReturnInsert_2_1()
- * @generated
- */
- public EAttribute getXmlReturnInsert_2_1_ReturnOnly()
- {
- return (EAttribute)xmlReturnInsert_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1 <em>Xml Transformation 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transformation 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1
- * @generated
- */
- public EClass getXmlTransformation_2_1()
- {
- return xmlTransformation_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1#getAttributeType()
- * @see #getXmlTransformation_2_1()
- * @generated
- */
- public EAttribute getXmlTransformation_2_1_AttributeType()
- {
- return (EAttribute)xmlTransformation_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1 <em>Xml Version 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1
- * @generated
- */
- public EClass getXmlVersion_2_1()
- {
- return xmlVersion_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1#getAttributeType()
- * @see #getXmlVersion_2_1()
- * @generated
- */
- public EAttribute getXmlVersion_2_1_AttributeType()
- {
- return (EAttribute)xmlVersion_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1 <em>Xml Primary Key 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @generated
- */
- public EClass getXmlPrimaryKey_2_1()
- {
- return xmlPrimaryKey_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType <em>Cache Key Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cache Key Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType()
- * @see #getXmlPrimaryKey_2_1()
- * @generated
- */
- public EAttribute getXmlPrimaryKey_2_1_CacheKeyType()
- {
- return (EAttribute)xmlPrimaryKey_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1 <em>Cache Key Type 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Key Type 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @generated
- */
- public EEnum getCacheKeyType_2_1()
- {
- return cacheKeyType_2_1EEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1 <em>Batch Fetch Type 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Batch Fetch Type 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @generated
- */
- public EEnum getBatchFetchType_2_1()
- {
- return batchFetchType_2_1EEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_1Factory getEclipseLinkOrmV2_1Factory()
- {
- return (EclipseLinkOrmV2_1Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlBasic_2_1EClass = createEClass(XML_BASIC_21);
- createEReference(xmlBasic_2_1EClass, XML_BASIC_21__RETURN_INSERT);
- createEAttribute(xmlBasic_2_1EClass, XML_BASIC_21__RETURN_UPDATE);
- createEAttribute(xmlBasic_2_1EClass, XML_BASIC_21__ATTRIBUTE_TYPE);
-
- xmlBatchFetch_2_1EClass = createEClass(XML_BATCH_FETCH_21);
- createEAttribute(xmlBatchFetch_2_1EClass, XML_BATCH_FETCH_21__SIZE);
- createEAttribute(xmlBatchFetch_2_1EClass, XML_BATCH_FETCH_21__BATCH_FETCH_TYPE);
-
- xmlElementCollection_2_1EClass = createEClass(XML_ELEMENT_COLLECTION_21);
- createEAttribute(xmlElementCollection_2_1EClass, XML_ELEMENT_COLLECTION_21__ATTRIBUTE_TYPE);
-
- xmlEmbeddable_2_1EClass = createEClass(XML_EMBEDDABLE_21);
-
- xmlEmbedded_2_1EClass = createEClass(XML_EMBEDDED_21);
- createEAttribute(xmlEmbedded_2_1EClass, XML_EMBEDDED_21__ATTRIBUTE_TYPE);
-
- xmlEmbeddedId_2_1EClass = createEClass(XML_EMBEDDED_ID_21);
- createEAttribute(xmlEmbeddedId_2_1EClass, XML_EMBEDDED_ID_21__ATTRIBUTE_TYPE);
-
- xmlEntity_2_1EClass = createEClass(XML_ENTITY_21);
- createEReference(xmlEntity_2_1EClass, XML_ENTITY_21__CLASS_EXTRACTOR);
- createEAttribute(xmlEntity_2_1EClass, XML_ENTITY_21__PARENT_CLASS);
-
- xmlEntityMappings_2_1EClass = createEClass(XML_ENTITY_MAPPINGS_21);
-
- xmlFetchAttribute_2_1EClass = createEClass(XML_FETCH_ATTRIBUTE_21);
- createEAttribute(xmlFetchAttribute_2_1EClass, XML_FETCH_ATTRIBUTE_21__NAME);
-
- xmlFetchGroup_2_1EClass = createEClass(XML_FETCH_GROUP_21);
- createEAttribute(xmlFetchGroup_2_1EClass, XML_FETCH_GROUP_21__NAME);
- createEAttribute(xmlFetchGroup_2_1EClass, XML_FETCH_GROUP_21__LOAD);
- createEReference(xmlFetchGroup_2_1EClass, XML_FETCH_GROUP_21__ATTRIBUTES);
-
- xmlFetchGroupContainer_2_1EClass = createEClass(XML_FETCH_GROUP_CONTAINER_21);
- createEReference(xmlFetchGroupContainer_2_1EClass, XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS);
-
- xmlId_2_1EClass = createEClass(XML_ID_21);
- createEAttribute(xmlId_2_1EClass, XML_ID_21__ATTRIBUTE_TYPE);
-
- xmlManyToMany_2_1EClass = createEClass(XML_MANY_TO_MANY_21);
- createEAttribute(xmlManyToMany_2_1EClass, XML_MANY_TO_MANY_21__ATTRIBUTE_TYPE);
-
- xmlManyToOne_2_1EClass = createEClass(XML_MANY_TO_ONE_21);
-
- xmlMappedSuperclass_2_1EClass = createEClass(XML_MAPPED_SUPERCLASS_21);
- createEReference(xmlMappedSuperclass_2_1EClass, XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS);
- createEReference(xmlMappedSuperclass_2_1EClass, XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS);
- createEAttribute(xmlMappedSuperclass_2_1EClass, XML_MAPPED_SUPERCLASS_21__PARENT_CLASS);
-
- xmlOneToMany_2_1EClass = createEClass(XML_ONE_TO_MANY_21);
- createEAttribute(xmlOneToMany_2_1EClass, XML_ONE_TO_MANY_21__ATTRIBUTE_TYPE);
-
- xmlOneToOne_2_1EClass = createEClass(XML_ONE_TO_ONE_21);
-
- xmlPersistenceUnitDefaults_2_1EClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS_21);
-
- xmlPrimaryKey_2_1EClass = createEClass(XML_PRIMARY_KEY_21);
- createEAttribute(xmlPrimaryKey_2_1EClass, XML_PRIMARY_KEY_21__CACHE_KEY_TYPE);
-
- xmlReturnInsert_2_1EClass = createEClass(XML_RETURN_INSERT_21);
- createEAttribute(xmlReturnInsert_2_1EClass, XML_RETURN_INSERT_21__RETURN_ONLY);
-
- xmlTransformation_2_1EClass = createEClass(XML_TRANSFORMATION_21);
- createEAttribute(xmlTransformation_2_1EClass, XML_TRANSFORMATION_21__ATTRIBUTE_TYPE);
-
- xmlVersion_2_1EClass = createEClass(XML_VERSION_21);
- createEAttribute(xmlVersion_2_1EClass, XML_VERSION_21__ATTRIBUTE_TYPE);
-
- // Create enums
- cacheKeyType_2_1EEnum = createEEnum(CACHE_KEY_TYPE_21);
- batchFetchType_2_1EEnum = createEEnum(BATCH_FETCH_TYPE_21);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlElementCollection_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlJoinFetch());
- xmlElementCollection_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlEmbeddable_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
- xmlEntity_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
- xmlEntity_2_1EClass.getESuperTypes().add(this.getXmlFetchGroupContainer_2_1());
- xmlEntityMappings_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
- xmlManyToMany_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlManyToOne_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlAssociationOverrideContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlAttributeOverrideContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(this.getXmlFetchGroupContainer_2_1());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlGeneratorContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlQueryContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlQueryContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
- xmlOneToMany_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlOneToOne_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlPersistenceUnitDefaults_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlBasic_2_1EClass, XmlBasic_2_1.class, "XmlBasic_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_2_1_ReturnInsert(), theEclipseLinkOrmPackage.getXmlReturnInsert(), null, "returnInsert", null, 0, 1, XmlBasic_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_2_1_ReturnUpdate(), theXMLTypePackage.getBooleanObject(), "returnUpdate", null, 0, 1, XmlBasic_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlBasic_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBatchFetch_2_1EClass, XmlBatchFetch_2_1.class, "XmlBatchFetch_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBatchFetch_2_1_Size(), theXMLTypePackage.getIntObject(), "size", null, 0, 1, XmlBatchFetch_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBatchFetch_2_1_BatchFetchType(), this.getBatchFetchType_2_1(), "batchFetchType", null, 0, 1, XmlBatchFetch_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_1EClass, XmlElementCollection_2_1.class, "XmlElementCollection_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlElementCollection_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlElementCollection_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddable_2_1EClass, XmlEmbeddable_2_1.class, "XmlEmbeddable_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbedded_2_1EClass, XmlEmbedded_2_1.class, "XmlEmbedded_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEmbedded_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlEmbedded_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddedId_2_1EClass, XmlEmbeddedId_2_1.class, "XmlEmbeddedId_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEmbeddedId_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlEmbeddedId_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_2_1EClass, XmlEntity_2_1.class, "XmlEntity_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_1_ClassExtractor(), theOrmPackage.getXmlClassReference(), null, "classExtractor", null, 0, 1, XmlEntity_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_2_1_ParentClass(), theXMLTypePackage.getString(), "parentClass", null, 0, 1, XmlEntity_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappings_2_1EClass, XmlEntityMappings_2_1.class, "XmlEntityMappings_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlFetchAttribute_2_1EClass, XmlFetchAttribute_2_1.class, "XmlFetchAttribute_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlFetchAttribute_2_1_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlFetchAttribute_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlFetchGroup_2_1EClass, XmlFetchGroup_2_1.class, "XmlFetchGroup_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlFetchGroup_2_1_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlFetchGroup_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlFetchGroup_2_1_Load(), theXMLTypePackage.getBooleanObject(), "load", null, 0, 1, XmlFetchGroup_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlFetchGroup_2_1_Attributes(), theEclipseLinkOrmPackage.getXmlFetchAttribute(), null, "attributes", null, 0, -1, XmlFetchGroup_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlFetchGroupContainer_2_1EClass, XmlFetchGroupContainer_2_1.class, "XmlFetchGroupContainer_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlFetchGroupContainer_2_1_FetchGroups(), theEclipseLinkOrmPackage.getXmlFetchGroup(), null, "fetchGroups", null, 0, -1, XmlFetchGroupContainer_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlId_2_1EClass, XmlId_2_1.class, "XmlId_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlId_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlId_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToMany_2_1EClass, XmlManyToMany_2_1.class, "XmlManyToMany_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlManyToMany_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlManyToMany_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToOne_2_1EClass, XmlManyToOne_2_1.class, "XmlManyToOne_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMappedSuperclass_2_1EClass, XmlMappedSuperclass_2_1.class, "XmlMappedSuperclass_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_1_SqlResultSetMappings(), theOrmPackage.getSqlResultSetMapping(), null, "sqlResultSetMappings", null, 0, -1, XmlMappedSuperclass_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_1_QueryRedirectors(), theEclipseLinkOrmPackage.getXmlQueryRedirectors(), null, "queryRedirectors", null, 0, 1, XmlMappedSuperclass_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMappedSuperclass_2_1_ParentClass(), theXMLTypePackage.getString(), "parentClass", null, 0, 1, XmlMappedSuperclass_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_1EClass, XmlOneToMany_2_1.class, "XmlOneToMany_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToMany_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlOneToMany_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToOne_2_1EClass, XmlOneToOne_2_1.class, "XmlOneToOne_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPersistenceUnitDefaults_2_1EClass, XmlPersistenceUnitDefaults_2_1.class, "XmlPersistenceUnitDefaults_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrimaryKey_2_1EClass, XmlPrimaryKey_2_1.class, "XmlPrimaryKey_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrimaryKey_2_1_CacheKeyType(), this.getCacheKeyType_2_1(), "cacheKeyType", null, 0, 1, XmlPrimaryKey_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlReturnInsert_2_1EClass, XmlReturnInsert_2_1.class, "XmlReturnInsert_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlReturnInsert_2_1_ReturnOnly(), theXMLTypePackage.getBooleanObject(), "returnOnly", null, 0, 1, XmlReturnInsert_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTransformation_2_1EClass, XmlTransformation_2_1.class, "XmlTransformation_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTransformation_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlTransformation_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVersion_2_1EClass, XmlVersion_2_1.class, "XmlVersion_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlVersion_2_1_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlVersion_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(cacheKeyType_2_1EEnum, CacheKeyType_2_1.class, "CacheKeyType_2_1");
- addEEnumLiteral(cacheKeyType_2_1EEnum, CacheKeyType_2_1.ID_VALUE);
- addEEnumLiteral(cacheKeyType_2_1EEnum, CacheKeyType_2_1.CACHE_KEY);
- addEEnumLiteral(cacheKeyType_2_1EEnum, CacheKeyType_2_1.AUTO);
-
- initEEnum(batchFetchType_2_1EEnum, BatchFetchType_2_1.class, "BatchFetchType_2_1");
- addEEnumLiteral(batchFetchType_2_1EEnum, BatchFetchType_2_1.JOIN);
- addEEnumLiteral(batchFetchType_2_1EEnum, BatchFetchType_2_1.EXISTS);
- addEEnumLiteral(batchFetchType_2_1EEnum, BatchFetchType_2_1.IN);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1 <em>Xml Basic 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1()
- * @generated
- */
- public static final EClass XML_BASIC_21 = eINSTANCE.getXmlBasic_2_1();
-
- /**
- * The meta object literal for the '<em><b>Return Insert</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_21__RETURN_INSERT = eINSTANCE.getXmlBasic_2_1_ReturnInsert();
-
- /**
- * The meta object literal for the '<em><b>Return Update</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC_21__RETURN_UPDATE = eINSTANCE.getXmlBasic_2_1_ReturnUpdate();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlBasic_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1 <em>Xml Batch Fetch 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1()
- * @generated
- */
- public static final EClass XML_BATCH_FETCH_21 = eINSTANCE.getXmlBatchFetch_2_1();
-
- /**
- * The meta object literal for the '<em><b>Size</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BATCH_FETCH_21__SIZE = eINSTANCE.getXmlBatchFetch_2_1_Size();
-
- /**
- * The meta object literal for the '<em><b>Batch Fetch Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BATCH_FETCH_21__BATCH_FETCH_TYPE = eINSTANCE.getXmlBatchFetch_2_1_BatchFetchType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1 <em>Xml Element Collection 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlElementCollection_2_1()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_21 = eINSTANCE.getXmlElementCollection_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlElementCollection_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1 <em>Xml Embeddable 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbeddable_2_1()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE_21 = eINSTANCE.getXmlEmbeddable_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1 <em>Xml Embedded 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbedded_2_1()
- * @generated
- */
- public static final EClass XML_EMBEDDED_21 = eINSTANCE.getXmlEmbedded_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_EMBEDDED_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlEmbedded_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1 <em>Xml Embedded Id 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbeddedId_2_1()
- * @generated
- */
- public static final EClass XML_EMBEDDED_ID_21 = eINSTANCE.getXmlEmbeddedId_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_EMBEDDED_ID_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlEmbeddedId_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1 <em>Xml Entity 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1()
- * @generated
- */
- public static final EClass XML_ENTITY_21 = eINSTANCE.getXmlEntity_2_1();
-
- /**
- * The meta object literal for the '<em><b>Class Extractor</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_21__CLASS_EXTRACTOR = eINSTANCE.getXmlEntity_2_1_ClassExtractor();
-
- /**
- * The meta object literal for the '<em><b>Parent Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_21__PARENT_CLASS = eINSTANCE.getXmlEntity_2_1_ParentClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1 <em>Xml Entity Mappings 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntityMappings_2_1()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS_21 = eINSTANCE.getXmlEntityMappings_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1 <em>Xml Fetch Attribute 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1()
- * @generated
- */
- public static final EClass XML_FETCH_ATTRIBUTE_21 = eINSTANCE.getXmlFetchAttribute_2_1();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_FETCH_ATTRIBUTE_21__NAME = eINSTANCE.getXmlFetchAttribute_2_1_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1 <em>Xml Fetch Group 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1()
- * @generated
- */
- public static final EClass XML_FETCH_GROUP_21 = eINSTANCE.getXmlFetchGroup_2_1();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_FETCH_GROUP_21__NAME = eINSTANCE.getXmlFetchGroup_2_1_Name();
-
- /**
- * The meta object literal for the '<em><b>Attributes</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_FETCH_GROUP_21__ATTRIBUTES = eINSTANCE.getXmlFetchGroup_2_1_Attributes();
-
- /**
- * The meta object literal for the '<em><b>Load</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_FETCH_GROUP_21__LOAD = eINSTANCE.getXmlFetchGroup_2_1_Load();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1 <em>Xml Fetch Group Container 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1()
- * @generated
- */
- public static final EClass XML_FETCH_GROUP_CONTAINER_21 = eINSTANCE.getXmlFetchGroupContainer_2_1();
-
- /**
- * The meta object literal for the '<em><b>Fetch Groups</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS = eINSTANCE.getXmlFetchGroupContainer_2_1_FetchGroups();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1 <em>Xml Id 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlId_2_1()
- * @generated
- */
- public static final EClass XML_ID_21 = eINSTANCE.getXmlId_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ID_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlId_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1 <em>Xml Many To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToMany_2_1()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_21 = eINSTANCE.getXmlManyToMany_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MANY_TO_MANY_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlManyToMany_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1 <em>Xml Many To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToOne_2_1()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE_21 = eINSTANCE.getXmlManyToOne_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1 <em>Xml Mapped Superclass 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_21 = eINSTANCE.getXmlMappedSuperclass_2_1();
-
- /**
- * The meta object literal for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS = eINSTANCE.getXmlMappedSuperclass_2_1_SqlResultSetMappings();
-
- /**
- * The meta object literal for the '<em><b>Query Redirectors</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS = eINSTANCE.getXmlMappedSuperclass_2_1_QueryRedirectors();
-
- /**
- * The meta object literal for the '<em><b>Parent Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS_21__PARENT_CLASS = eINSTANCE.getXmlMappedSuperclass_2_1_ParentClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1 <em>Xml One To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToMany_2_1()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_21 = eINSTANCE.getXmlOneToMany_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_MANY_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlOneToMany_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1 <em>Xml One To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToOne_2_1()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_21 = eINSTANCE.getXmlOneToOne_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1 <em>Xml Persistence Unit Defaults 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPersistenceUnitDefaults_2_1()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS_21 = eINSTANCE.getXmlPersistenceUnitDefaults_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1 <em>Xml Return Insert 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1()
- * @generated
- */
- public static final EClass XML_RETURN_INSERT_21 = eINSTANCE.getXmlReturnInsert_2_1();
-
- /**
- * The meta object literal for the '<em><b>Return Only</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_RETURN_INSERT_21__RETURN_ONLY = eINSTANCE.getXmlReturnInsert_2_1_ReturnOnly();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1 <em>Xml Transformation 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTransformation_2_1()
- * @generated
- */
- public static final EClass XML_TRANSFORMATION_21 = eINSTANCE.getXmlTransformation_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TRANSFORMATION_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlTransformation_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1 <em>Xml Version 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlVersion_2_1()
- * @generated
- */
- public static final EClass XML_VERSION_21 = eINSTANCE.getXmlVersion_2_1();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_VERSION_21__ATTRIBUTE_TYPE = eINSTANCE.getXmlVersion_2_1_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1 <em>Xml Primary Key 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY_21 = eINSTANCE.getXmlPrimaryKey_2_1();
-
- /**
- * The meta object literal for the '<em><b>Cache Key Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIMARY_KEY_21__CACHE_KEY_TYPE = eINSTANCE.getXmlPrimaryKey_2_1_CacheKeyType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1 <em>Cache Key Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getCacheKeyType_2_1()
- * @generated
- */
- public static final EEnum CACHE_KEY_TYPE_21 = eINSTANCE.getCacheKeyType_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1 <em>Batch Fetch Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getBatchFetchType_2_1()
- * @generated
- */
- public static final EEnum BATCH_FETCH_TYPE_21 = eINSTANCE.getBatchFetchType_2_1();
-
- }
-
-} //EclipseLinkOrmV2_1Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java
deleted file mode 100644
index b0e26ec5b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert <em>Return Insert</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate <em>Return Update</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasic_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Insert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Insert</em>' containment reference.
- * @see #setReturnInsert(XmlReturnInsert)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1_ReturnInsert()
- * @model containment="true"
- * @generated
- */
- XmlReturnInsert getReturnInsert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert <em>Return Insert</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Insert</em>' containment reference.
- * @see #getReturnInsert()
- * @generated
- */
- void setReturnInsert(XmlReturnInsert value);
-
- /**
- * Returns the value of the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Update</em>' attribute.
- * @see #setReturnUpdate(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1_ReturnUpdate()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getReturnUpdate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Update</em>' attribute.
- * @see #getReturnUpdate()
- * @generated
- */
- void setReturnUpdate(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlBasic_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java
deleted file mode 100644
index 24e9b3379c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Batch Fetch 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize <em>Size</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType <em>Batch Fetch Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBatchFetch_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Size</em>' attribute.
- * @see #setSize(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1_Size()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getSize();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Size</em>' attribute.
- * @see #getSize()
- * @generated
- */
- void setSize(Integer value);
-
- /**
- * Returns the value of the '<em><b>Batch Fetch Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #setBatchFetchType(BatchFetchType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1_BatchFetchType()
- * @model
- * @generated
- */
- BatchFetchType_2_1 getBatchFetchType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType <em>Batch Fetch Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #getBatchFetchType()
- * @generated
- */
- void setBatchFetchType(BatchFetchType_2_1 value);
-
-} // XmlBatchFetch_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java
deleted file mode 100644
index 9d1222403d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlElementCollection_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlElementCollection_2_1 extends XmlJoinFetch, XmlBatchFetchHolder
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlElementCollection_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlElementCollection_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddable_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddable_2_1.java
deleted file mode 100644
index 0236db9340..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddable_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embeddable 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbeddable_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbeddable_2_1 extends XmlAccessMethodsHolder
-{
-} // XmlEmbeddable_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddedId_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddedId_2_1.java
deleted file mode 100644
index 250ea5b7b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbeddedId_2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embedded Id 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbeddedId_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEmbeddedId_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbeddedId_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlEmbeddedId_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbedded_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbedded_2_1.java
deleted file mode 100644
index 13315805b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEmbedded_2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embedded 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbedded_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEmbedded_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEmbedded_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlEmbedded_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java
deleted file mode 100644
index 50d417e5e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity Mappings 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntityMappings_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntityMappings_2_1 extends XmlAccessMethodsHolder
-{
-} // XmlEntityMappings_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java
deleted file mode 100644
index 4fb916b515..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor <em>Class Extractor</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getParentClass <em>Parent Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_1 extends XmlAccessMethodsHolder, XmlFetchGroupContainer_2_1
-{
- /**
- * Returns the value of the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Extractor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Extractor</em>' containment reference.
- * @see #setClassExtractor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1_ClassExtractor()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getClassExtractor();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor <em>Class Extractor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Extractor</em>' containment reference.
- * @see #getClassExtractor()
- * @generated
- */
- void setClassExtractor(XmlClassReference value);
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getParentClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- void setParentClass(String value);
-
-} // XmlEntity_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java
deleted file mode 100644
index 82ccb4cde7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Attribute 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlFetchAttribute_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlFetchAttribute_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java
deleted file mode 100644
index b3e8bf93cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Group Container 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1#getFetchGroups <em>Fetch Groups</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlFetchGroupContainer_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Fetch Groups</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch Groups</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch Groups</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1_FetchGroups()
- * @model containment="true"
- * @generated
- */
- EList<XmlFetchGroup> getFetchGroups();
-
-} // XmlFetchGroupContainer_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java
deleted file mode 100644
index ce3e4dc0b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Group 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad <em>Load</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getAttributes <em>Attributes</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlFetchGroup_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attributes</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1_Attributes()
- * @model containment="true"
- * @generated
- */
- EList<XmlFetchAttribute> getAttributes();
-
- /**
- * Returns the value of the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Load</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Load</em>' attribute.
- * @see #setLoad(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1_Load()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getLoad();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Load</em>' attribute.
- * @see #getLoad()
- * @generated
- */
- void setLoad(Boolean value);
-
-} // XmlFetchGroup_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlId_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlId_2_1.java
deleted file mode 100644
index ef3ed3c1f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlId_2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Id 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlId_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlId_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlId_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlId_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java
deleted file mode 100644
index 7caefb6b7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To Many 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToMany_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany_2_1 extends XmlBatchFetchHolder
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToMany_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlManyToMany_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java
deleted file mode 100644
index 38619f5aa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To One 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToOne_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToOne_2_1 extends XmlBatchFetchHolder
-{
-} // XmlManyToOne_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java
deleted file mode 100644
index eda794877b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors <em>Query Redirectors</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getParentClass <em>Parent Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_1 extends XmlAssociationOverrideContainer, XmlAttributeOverrideContainer, XmlFetchGroupContainer_2_1, XmlGeneratorContainer, XmlQueryContainer, org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer, XmlAccessMethodsHolder
-{
- /**
- * Returns the value of the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sql Result Set Mappings</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sql Result Set Mappings</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- EList<SqlResultSetMapping> getSqlResultSetMappings();
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- XmlQueryRedirectors getQueryRedirectors();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- void setQueryRedirectors(XmlQueryRedirectors value);
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getParentClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- void setParentClass(String value);
-
-} // XmlMappedSuperclass_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java
deleted file mode 100644
index 51b4e953e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToMany_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany_2_1 extends XmlBatchFetchHolder
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToMany_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlOneToMany_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java
deleted file mode 100644
index 38cc74ba5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To One 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToOne_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne_2_1 extends XmlBatchFetchHolder
-{
-} // XmlOneToOne_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java
deleted file mode 100644
index f7e8e87111..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Defaults 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPersistenceUnitDefaults_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlPersistenceUnitDefaults_2_1 extends XmlAccessMethodsHolder
-{
-} // XmlPersistenceUnitDefaults_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java
deleted file mode 100644
index 0127f3b912..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Primary Key 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType <em>Cache Key Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPrimaryKey_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Key Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Key Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #setCacheKeyType(CacheKeyType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1_CacheKeyType()
- * @model
- * @generated
- */
- CacheKeyType_2_1 getCacheKeyType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #getCacheKeyType()
- * @generated
- */
- void setCacheKeyType(CacheKeyType_2_1 value);
-
-} // XmlPrimaryKey_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java
deleted file mode 100644
index f8fa5eb769..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Return Insert 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly <em>Return Only</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlReturnInsert_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Only</em>' attribute.
- * @see #setReturnOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1_ReturnOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getReturnOnly();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Only</em>' attribute.
- * @see #getReturnOnly()
- * @generated
- */
- void setReturnOnly(Boolean value);
-
-} // XmlReturnInsert_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTransformation_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTransformation_2_1.java
deleted file mode 100644
index 43fdb09ee9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTransformation_2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Transformation 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTransformation_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlTransformation_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTransformation_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlTransformation_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlVersion_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlVersion_2_1.java
deleted file mode 100644
index 2cd3528b93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlVersion_2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Version 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlVersion_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlVersion_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlVersion_2_1_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
-} // XmlVersion_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java
deleted file mode 100644
index 74ad68e591..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Cache Isolation Type</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getCacheIsolationType()
- * @model
- * @generated
- */
-public enum CacheIsolationType implements Enumerator
-{
- /**
- * The '<em><b>SHARED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SHARED_VALUE
- * @generated
- * @ordered
- */
- SHARED(0, "SHARED", "SHARED"),
-
- /**
- * The '<em><b>PROTECTED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #PROTECTED_VALUE
- * @generated
- * @ordered
- */
- PROTECTED(1, "PROTECTED", "PROTECTED"),
-
- /**
- * The '<em><b>ISOLATED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ISOLATED_VALUE
- * @generated
- * @ordered
- */
- ISOLATED(2, "ISOLATED", "ISOLATED");
-
- /**
- * The '<em><b>SHARED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SHARED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SHARED
- * @model
- * @generated
- * @ordered
- */
- public static final int SHARED_VALUE = 0;
-
- /**
- * The '<em><b>PROTECTED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>PROTECTED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #PROTECTED
- * @model
- * @generated
- * @ordered
- */
- public static final int PROTECTED_VALUE = 1;
-
- /**
- * The '<em><b>ISOLATED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ISOLATED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ISOLATED
- * @model
- * @generated
- * @ordered
- */
- public static final int ISOLATED_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Cache Isolation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheIsolationType[] VALUES_ARRAY =
- new CacheIsolationType[]
- {
- SHARED,
- PROTECTED,
- ISOLATED,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Isolation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheIsolationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Isolation Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheIsolationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheIsolationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Isolation Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheIsolationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheIsolationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Isolation Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheIsolationType get(int value)
- {
- switch (value)
- {
- case SHARED_VALUE: return SHARED;
- case PROTECTED_VALUE: return PROTECTED;
- case ISOLATED_VALUE: return ISOLATED;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheIsolationType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheIsolationType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java
deleted file mode 100644
index 667e03a5b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_2
- extends EclipseLink2_1
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_2.xsd";
- String SCHEMA_VERSION = "2.2";
-
-
- // EclipseLink 2.2 specific nodes
- String ADDITIONAL_CRITERIA = "additional-criteria";
- String CACHE__ISOLATION = "isolation";
- String CASCADE_ON_DELETE = "cascade-on-delete";
- String CREATION_SUFFIX = "creation-suffix";
- String CRITERIA = "criteria";
- String HASH_PARTITIONING = "hash-partitioning";
- String INDEX = "index";
- String INDEX__COLUMN_NAME = "column-name";
- String INDEX__NAME = "name";
- String INDEX__CATALOG = "catalog";
- String INDEX__SCHEMA = "schema";
- String INDEX__TABLE = "table";
- String INDEX__UNIQUE = "unique";
- String NONCACHEABLE = "noncacheable";
- String PARENT_CLASS = "parent-class";
- String PARTITIONING = "partitioning";
- String PARTITIONING_GROUP__PARTITIONED = "partitioned";
- String PINNED_PARTITIONING = "pinned-partitioning";
- String RANGE_PARTITIONING = "range-partitioning";
- String REPLICATION_PARTITIONING = "replication-partitioning";
- String ROUND_ROBIN_PARTITIONING = "round-robin-partitioning";
- String UNION_PARTITIONING = "union-partitioning";
- String VALUE_PARTITIONING = "value-partitioning";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java
deleted file mode 100644
index ceb547f4bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package
- * @generated
- */
-public class EclipseLinkOrmV2_2Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_2Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_2Factory init()
- {
- try
- {
- EclipseLinkOrmV2_2Factory theEclipseLinkOrmV2_2Factory = (EclipseLinkOrmV2_2Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_2.xmi");
- if (theEclipseLinkOrmV2_2Factory != null)
- {
- return theEclipseLinkOrmV2_2Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_2Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_2Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_2Package.CACHE_ISOLATION_TYPE:
- return createCacheIsolationTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_2Package.CACHE_ISOLATION_TYPE:
- return convertCacheIsolationTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheIsolationType createCacheIsolationTypeFromString(EDataType eDataType, String initialValue)
- {
- CacheIsolationType result = CacheIsolationType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheIsolationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_2Package getEclipseLinkOrmV2_2Package()
- {
- return (EclipseLinkOrmV2_2Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_2Package getPackage()
- {
- return EclipseLinkOrmV2_2Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_2Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java
deleted file mode 100644
index 0ccb0c4c99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java
+++ /dev/null
@@ -1,4649 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_2Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_2";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_2.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_2Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2 <em>Xml Additional Criteria 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2()
- * @generated
- */
- public static final int XML_ADDITIONAL_CRITERIA_22 = 0;
-
- /**
- * The feature id for the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA_22__CRITERIA = 0;
-
- /**
- * The number of structural features of the '<em>Xml Additional Criteria 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2 <em>Xml Basic 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2()
- * @generated
- */
- public static final int XML_BASIC_22 = 1;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_22__INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2 <em>Xml Basic Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2()
- * @generated
- */
- public static final int XML_BASIC_COLLECTION_22 = 2;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic Collection 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2 <em>Xml Basic Map 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2()
- * @generated
- */
- public static final int XML_BASIC_MAP_22 = 3;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_22__CASCADE_ON_DELETE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic Map 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2 <em>Xml Cache 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2()
- * @generated
- */
- public static final int XML_CACHE_22 = 4;
-
- /**
- * The feature id for the '<em><b>Isolation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_22__ISOLATION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cache 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2 <em>Xml Collection Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2()
- * @generated
- */
- public static final int XML_COLLECTION_TABLE_22 = 5;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Collection Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2 <em>Xml Partitioning Group 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2()
- * @generated
- */
- public static final int XML_PARTITIONING_GROUP_22 = 20;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__PARTITIONING = 0;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING = 1;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING = 2;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING = 3;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING = 4;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING = 5;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__HASH_PARTITIONING = 6;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__UNION_PARTITIONING = 7;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__PARTITIONED = 8;
-
- /**
- * The number of structural features of the '<em>Xml Partitioning Group 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22_FEATURE_COUNT = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2 <em>Xml Element Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_22 = 6;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__NONCACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2 <em>Xml Entity 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2()
- * @generated
- */
- public static final int XML_ENTITY_22 = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2 <em>Xml Entity Mappings 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS_22 = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2 <em>Xml Hash Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2()
- * @generated
- */
- public static final int XML_HASH_PARTITIONING_22 = 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2 <em>Xml Many To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_22 = 14;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2 <em>Xml Many To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2()
- * @generated
- */
- public static final int XML_MANY_TO_ONE_22 = 15;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2 <em>Xml One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_22 = 17;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2 <em>Xml One To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_22 = 18;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2 <em>Xml Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2()
- * @generated
- */
- public static final int XML_PARTITIONING_22 = 19;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2 <em>Xml Pinned Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2()
- * @generated
- */
- public static final int XML_PINNED_PARTITIONING_22 = 21;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2 <em>Xml Range Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2()
- * @generated
- */
- public static final int XML_RANGE_PARTITIONING_22 = 22;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2 <em>Xml Replication Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2()
- * @generated
- */
- public static final int XML_REPLICATION_PARTITIONING_22 = 23;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2 <em>Xml Round Robin Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2()
- * @generated
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_22 = 24;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2 <em>Xml Embeddable 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEmbeddable_2_2()
- * @generated
- */
- public static final int XML_EMBEDDABLE_22 = 7;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_22__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
-
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_22__ASSOCIATION_OVERRIDES = OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_22__PARENT_CLASS = OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Embeddable 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_22_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__ADDITIONAL_CRITERIA = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__INDEX = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Entity 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__PARTITIONING = 0;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING = 1;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING = 2;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING = 3;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING = 4;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING = 5;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING = 6;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING = 7;
-
- /**
- * The number of structural features of the '<em>Xml Entity Mappings 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22_FEATURE_COUNT = 8;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Hash Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2 <em>Xml Id 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2()
- * @generated
- */
- public static final int XML_ID_22 = 11;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_22__INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Id 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2 <em>Xml Index 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2()
- * @generated
- */
- public static final int XML_INDEX_22 = 12;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__SCHEMA = 1;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__CATALOG = 2;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__TABLE = 3;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__UNIQUE = 4;
-
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__COLUMN_NAMES = 5;
-
- /**
- * The number of structural features of the '<em>Xml Index 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22_FEATURE_COUNT = 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2 <em>Xml Join Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2()
- * @generated
- */
- public static final int XML_JOIN_TABLE_22 = 13;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Many To One 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2 <em>Xml Mapped Superclass 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_22 = 16;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To One 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__NONCACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Pinned Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RANGE_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Range Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RANGE_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REPLICATION_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Replication Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REPLICATION_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Round Robin Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2 <em>Xml Secondary Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE_22 = 25;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Secondary Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2 <em>Xml Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2()
- * @generated
- */
- public static final int XML_TABLE_22 = 26;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2 <em>Xml Table Generator 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR_22 = 27;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Table Generator 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2 <em>Xml Union Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2()
- * @generated
- */
- public static final int XML_UNION_PARTITIONING_22 = 28;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Union Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2 <em>Xml Value Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2()
- * @generated
- */
- public static final int XML_VALUE_PARTITIONING_22 = 29;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Value Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2 <em>Xml Variable One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2()
- * @generated
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22 = 30;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Variable One To One 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2 <em>Xml Version 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2()
- * @generated
- */
- public static final int XML_VERSION_22 = 31;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_22__INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Version 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType <em>Cache Isolation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getCacheIsolationType()
- * @generated
- */
- public static final int CACHE_ISOLATION_TYPE = 32;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAdditionalCriteria_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicCollection_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicMap_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCache_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappings_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlHashPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToMany_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOne_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOne_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPartitioningGroup_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPinnedPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRangePartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReplicationPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRoundRobinPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlId_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIndex_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGenerator_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUnionPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlValuePartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVariableOneToOne_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersion_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheIsolationTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_2Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_2Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_2Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_2Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_2Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_2Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_2Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_2Package.eNS_URI, theEclipseLinkOrmV2_2Package);
- return theEclipseLinkOrmV2_2Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2 <em>Xml Additional Criteria 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Additional Criteria 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2
- * @generated
- */
- public EClass getXmlAdditionalCriteria_2_2()
- {
- return xmlAdditionalCriteria_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria <em>Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria()
- * @see #getXmlAdditionalCriteria_2_2()
- * @generated
- */
- public EAttribute getXmlAdditionalCriteria_2_2_Criteria()
- {
- return (EAttribute)xmlAdditionalCriteria_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2 <em>Xml Basic 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2
- * @generated
- */
- public EClass getXmlBasic_2_2()
- {
- return xmlBasic_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex()
- * @see #getXmlBasic_2_2()
- * @generated
- */
- public EReference getXmlBasic_2_2_Index()
- {
- return (EReference)xmlBasic_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2 <em>Xml Basic Collection 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Collection 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2
- * @generated
- */
- public EClass getXmlBasicCollection_2_2()
- {
- return xmlBasicCollection_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete()
- * @see #getXmlBasicCollection_2_2()
- * @generated
- */
- public EAttribute getXmlBasicCollection_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlBasicCollection_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2 <em>Xml Basic Map 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Map 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2
- * @generated
- */
- public EClass getXmlBasicMap_2_2()
- {
- return xmlBasicMap_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete()
- * @see #getXmlBasicMap_2_2()
- * @generated
- */
- public EAttribute getXmlBasicMap_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlBasicMap_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2 <em>Xml Cache 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2
- * @generated
- */
- public EClass getXmlCache_2_2()
- {
- return xmlCache_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation <em>Isolation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Isolation</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation()
- * @see #getXmlCache_2_2()
- * @generated
- */
- public EAttribute getXmlCache_2_2_Isolation()
- {
- return (EAttribute)xmlCache_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2 <em>Xml Collection Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Collection Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2
- * @generated
- */
- public EClass getXmlCollectionTable_2_2()
- {
- return xmlCollectionTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix()
- * @see #getXmlCollectionTable_2_2()
- * @generated
- */
- public EAttribute getXmlCollectionTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlCollectionTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2 <em>Xml Element Collection 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2
- * @generated
- */
- public EClass getXmlElementCollection_2_2()
- {
- return xmlElementCollection_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete()
- * @see #getXmlElementCollection_2_2()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlElementCollection_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable <em>Noncacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Noncacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable()
- * @see #getXmlElementCollection_2_2()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_2_Noncacheable()
- {
- return (EAttribute)xmlElementCollection_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2 <em>Xml Entity 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2
- * @generated
- */
- public EClass getXmlEntity_2_2()
- {
- return xmlEntity_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete()
- * @see #getXmlEntity_2_2()
- * @generated
- */
- public EAttribute getXmlEntity_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlEntity_2_2EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex()
- * @see #getXmlEntity_2_2()
- * @generated
- */
- public EReference getXmlEntity_2_2_Index()
- {
- return (EReference)xmlEntity_2_2EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2 <em>Xml Entity Mappings 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2
- * @generated
- */
- public EClass getXmlEntityMappings_2_2()
- {
- return xmlEntityMappings_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPartitioning <em>Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_Partitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Replication Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getReplicationPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_ReplicationPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Round Robin Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRoundRobinPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_RoundRobinPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Pinned Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPinnedPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_PinnedPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRangePartitioning <em>Range Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Range Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRangePartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_RangePartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getValuePartitioning <em>Value Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Value Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getValuePartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_ValuePartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getHashPartitioning <em>Hash Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Hash Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getHashPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_HashPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getUnionPartitioning <em>Union Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Union Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getUnionPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_UnionPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2 <em>Xml Hash Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Hash Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2
- * @generated
- */
- public EClass getXmlHashPartitioning_2_2()
- {
- return xmlHashPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName()
- * @see #getXmlHashPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlHashPartitioning_2_2_Name()
- {
- return (EAttribute)xmlHashPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria <em>Additional Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Additional Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria()
- * @see #getXmlEntity_2_2()
- * @generated
- */
- public EReference getXmlEntity_2_2_AdditionalCriteria()
- {
- return (EReference)xmlEntity_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2 <em>Xml Many To Many 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2
- * @generated
- */
- public EClass getXmlManyToMany_2_2()
- {
- return xmlManyToMany_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete()
- * @see #getXmlManyToMany_2_2()
- * @generated
- */
- public EAttribute getXmlManyToMany_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlManyToMany_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable()
- * @see #getXmlManyToMany_2_2()
- * @generated
- */
- public EAttribute getXmlManyToMany_2_2_NonCacheable()
- {
- return (EAttribute)xmlManyToMany_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2 <em>Xml Many To One 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2
- * @generated
- */
- public EClass getXmlManyToOne_2_2()
- {
- return xmlManyToOne_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable()
- * @see #getXmlManyToOne_2_2()
- * @generated
- */
- public EAttribute getXmlManyToOne_2_2_NonCacheable()
- {
- return (EAttribute)xmlManyToOne_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2 <em>Xml One To One 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2
- * @generated
- */
- public EClass getXmlOneToOne_2_2()
- {
- return xmlOneToOne_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete()
- * @see #getXmlOneToOne_2_2()
- * @generated
- */
- public EAttribute getXmlOneToOne_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlOneToOne_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable()
- * @see #getXmlOneToOne_2_2()
- * @generated
- */
- public EAttribute getXmlOneToOne_2_2_NonCacheable()
- {
- return (EAttribute)xmlOneToOne_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2 <em>Xml One To Many 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2
- * @generated
- */
- public EClass getXmlOneToMany_2_2()
- {
- return xmlOneToMany_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete()
- * @see #getXmlOneToMany_2_2()
- * @generated
- */
- public EAttribute getXmlOneToMany_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlOneToMany_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable <em>Noncacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Noncacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable()
- * @see #getXmlOneToMany_2_2()
- * @generated
- */
- public EAttribute getXmlOneToMany_2_2_Noncacheable()
- {
- return (EAttribute)xmlOneToMany_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2 <em>Xml Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2
- * @generated
- */
- public EClass getXmlPartitioning_2_2()
- {
- return xmlPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName()
- * @see #getXmlPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlPartitioning_2_2_Name()
- {
- return (EAttribute)xmlPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2 <em>Xml Partitioning Group 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Partitioning Group 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2
- * @generated
- */
- public EClass getXmlPartitioningGroup_2_2()
- {
- return xmlPartitioningGroup_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning <em>Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_Partitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Replication Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Round Robin Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pinned Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_PinnedPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning <em>Range Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Range Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_RangePartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning <em>Value Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Value Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_ValuePartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning <em>Hash Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Hash Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_HashPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning <em>Union Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Union Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_UnionPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned <em>Partitioned</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Partitioned</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EAttribute getXmlPartitioningGroup_2_2_Partitioned()
- {
- return (EAttribute)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2 <em>Xml Pinned Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Pinned Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2
- * @generated
- */
- public EClass getXmlPinnedPartitioning_2_2()
- {
- return xmlPinnedPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName()
- * @see #getXmlPinnedPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlPinnedPartitioning_2_2_Name()
- {
- return (EAttribute)xmlPinnedPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2 <em>Xml Range Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Range Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2
- * @generated
- */
- public EClass getXmlRangePartitioning_2_2()
- {
- return xmlRangePartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName()
- * @see #getXmlRangePartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlRangePartitioning_2_2_Name()
- {
- return (EAttribute)xmlRangePartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2 <em>Xml Replication Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Replication Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2
- * @generated
- */
- public EClass getXmlReplicationPartitioning_2_2()
- {
- return xmlReplicationPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName()
- * @see #getXmlReplicationPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlReplicationPartitioning_2_2_Name()
- {
- return (EAttribute)xmlReplicationPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2 <em>Xml Round Robin Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Round Robin Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2
- * @generated
- */
- public EClass getXmlRoundRobinPartitioning_2_2()
- {
- return xmlRoundRobinPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName()
- * @see #getXmlRoundRobinPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlRoundRobinPartitioning_2_2_Name()
- {
- return (EAttribute)xmlRoundRobinPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2 <em>Xml Embeddable 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2
- * @generated
- */
- public EClass getXmlEmbeddable_2_2()
- {
- return xmlEmbeddable_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2#getParentClass <em>Parent Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Parent Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2#getParentClass()
- * @see #getXmlEmbeddable_2_2()
- * @generated
- */
- public EAttribute getXmlEmbeddable_2_2_ParentClass()
- {
- return (EAttribute)xmlEmbeddable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2 <em>Xml Id 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2
- * @generated
- */
- public EClass getXmlId_2_2()
- {
- return xmlId_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex()
- * @see #getXmlId_2_2()
- * @generated
- */
- public EReference getXmlId_2_2_Index()
- {
- return (EReference)xmlId_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2 <em>Xml Index 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Index 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2
- * @generated
- */
- public EClass getXmlIndex_2_2()
- {
- return xmlIndex_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Name()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Schema()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Catalog()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Table()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique <em>Unique</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Unique</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Unique()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getColumnNames <em>Column Names</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Column Names</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getColumnNames()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_ColumnNames()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2 <em>Xml Join Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2
- * @generated
- */
- public EClass getXmlJoinTable_2_2()
- {
- return xmlJoinTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix()
- * @see #getXmlJoinTable_2_2()
- * @generated
- */
- public EAttribute getXmlJoinTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlJoinTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2 <em>Xml Mapped Superclass 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_2()
- {
- return xmlMappedSuperclass_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria <em>Additional Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Additional Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria()
- * @see #getXmlMappedSuperclass_2_2()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_2_AdditionalCriteria()
- {
- return (EReference)xmlMappedSuperclass_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2 <em>Xml Secondary Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Secondary Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2
- * @generated
- */
- public EClass getXmlSecondaryTable_2_2()
- {
- return xmlSecondaryTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix()
- * @see #getXmlSecondaryTable_2_2()
- * @generated
- */
- public EAttribute getXmlSecondaryTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlSecondaryTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2 <em>Xml Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2
- * @generated
- */
- public EClass getXmlTable_2_2()
- {
- return xmlTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix()
- * @see #getXmlTable_2_2()
- * @generated
- */
- public EAttribute getXmlTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2 <em>Xml Table Generator 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table Generator 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2
- * @generated
- */
- public EClass getXmlTableGenerator_2_2()
- {
- return xmlTableGenerator_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix()
- * @see #getXmlTableGenerator_2_2()
- * @generated
- */
- public EAttribute getXmlTableGenerator_2_2_CreationSuffix()
- {
- return (EAttribute)xmlTableGenerator_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2 <em>Xml Union Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Union Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2
- * @generated
- */
- public EClass getXmlUnionPartitioning_2_2()
- {
- return xmlUnionPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName()
- * @see #getXmlUnionPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlUnionPartitioning_2_2_Name()
- {
- return (EAttribute)xmlUnionPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2 <em>Xml Value Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Value Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2
- * @generated
- */
- public EClass getXmlValuePartitioning_2_2()
- {
- return xmlValuePartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName()
- * @see #getXmlValuePartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlValuePartitioning_2_2_Name()
- {
- return (EAttribute)xmlValuePartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2 <em>Xml Variable One To One 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Variable One To One 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2
- * @generated
- */
- public EClass getXmlVariableOneToOne_2_2()
- {
- return xmlVariableOneToOne_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable()
- * @see #getXmlVariableOneToOne_2_2()
- * @generated
- */
- public EAttribute getXmlVariableOneToOne_2_2_NonCacheable()
- {
- return (EAttribute)xmlVariableOneToOne_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2 <em>Xml Version 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2
- * @generated
- */
- public EClass getXmlVersion_2_2()
- {
- return xmlVersion_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex()
- * @see #getXmlVersion_2_2()
- * @generated
- */
- public EReference getXmlVersion_2_2_Index()
- {
- return (EReference)xmlVersion_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType <em>Cache Isolation Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Isolation Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @generated
- */
- public EEnum getCacheIsolationType()
- {
- return cacheIsolationTypeEEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_2Factory getEclipseLinkOrmV2_2Factory()
- {
- return (EclipseLinkOrmV2_2Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlAdditionalCriteria_2_2EClass = createEClass(XML_ADDITIONAL_CRITERIA_22);
- createEAttribute(xmlAdditionalCriteria_2_2EClass, XML_ADDITIONAL_CRITERIA_22__CRITERIA);
-
- xmlBasic_2_2EClass = createEClass(XML_BASIC_22);
- createEReference(xmlBasic_2_2EClass, XML_BASIC_22__INDEX);
-
- xmlBasicCollection_2_2EClass = createEClass(XML_BASIC_COLLECTION_22);
- createEAttribute(xmlBasicCollection_2_2EClass, XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE);
-
- xmlBasicMap_2_2EClass = createEClass(XML_BASIC_MAP_22);
- createEAttribute(xmlBasicMap_2_2EClass, XML_BASIC_MAP_22__CASCADE_ON_DELETE);
-
- xmlCache_2_2EClass = createEClass(XML_CACHE_22);
- createEAttribute(xmlCache_2_2EClass, XML_CACHE_22__ISOLATION);
-
- xmlCollectionTable_2_2EClass = createEClass(XML_COLLECTION_TABLE_22);
- createEAttribute(xmlCollectionTable_2_2EClass, XML_COLLECTION_TABLE_22__CREATION_SUFFIX);
-
- xmlElementCollection_2_2EClass = createEClass(XML_ELEMENT_COLLECTION_22);
- createEAttribute(xmlElementCollection_2_2EClass, XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE);
- createEAttribute(xmlElementCollection_2_2EClass, XML_ELEMENT_COLLECTION_22__NONCACHEABLE);
-
- xmlEmbeddable_2_2EClass = createEClass(XML_EMBEDDABLE_22);
- createEAttribute(xmlEmbeddable_2_2EClass, XML_EMBEDDABLE_22__PARENT_CLASS);
-
- xmlEntity_2_2EClass = createEClass(XML_ENTITY_22);
- createEReference(xmlEntity_2_2EClass, XML_ENTITY_22__ADDITIONAL_CRITERIA);
- createEAttribute(xmlEntity_2_2EClass, XML_ENTITY_22__CASCADE_ON_DELETE);
- createEReference(xmlEntity_2_2EClass, XML_ENTITY_22__INDEX);
-
- xmlEntityMappings_2_2EClass = createEClass(XML_ENTITY_MAPPINGS_22);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING);
-
- xmlHashPartitioning_2_2EClass = createEClass(XML_HASH_PARTITIONING_22);
- createEAttribute(xmlHashPartitioning_2_2EClass, XML_HASH_PARTITIONING_22__NAME);
-
- xmlId_2_2EClass = createEClass(XML_ID_22);
- createEReference(xmlId_2_2EClass, XML_ID_22__INDEX);
-
- xmlIndex_2_2EClass = createEClass(XML_INDEX_22);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__NAME);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__SCHEMA);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__CATALOG);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__TABLE);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__UNIQUE);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__COLUMN_NAMES);
-
- xmlJoinTable_2_2EClass = createEClass(XML_JOIN_TABLE_22);
- createEAttribute(xmlJoinTable_2_2EClass, XML_JOIN_TABLE_22__CREATION_SUFFIX);
-
- xmlManyToMany_2_2EClass = createEClass(XML_MANY_TO_MANY_22);
- createEAttribute(xmlManyToMany_2_2EClass, XML_MANY_TO_MANY_22__CASCADE_ON_DELETE);
- createEAttribute(xmlManyToMany_2_2EClass, XML_MANY_TO_MANY_22__NON_CACHEABLE);
-
- xmlManyToOne_2_2EClass = createEClass(XML_MANY_TO_ONE_22);
- createEAttribute(xmlManyToOne_2_2EClass, XML_MANY_TO_ONE_22__NON_CACHEABLE);
-
- xmlMappedSuperclass_2_2EClass = createEClass(XML_MAPPED_SUPERCLASS_22);
- createEReference(xmlMappedSuperclass_2_2EClass, XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA);
-
- xmlOneToOne_2_2EClass = createEClass(XML_ONE_TO_ONE_22);
- createEAttribute(xmlOneToOne_2_2EClass, XML_ONE_TO_ONE_22__CASCADE_ON_DELETE);
- createEAttribute(xmlOneToOne_2_2EClass, XML_ONE_TO_ONE_22__NON_CACHEABLE);
-
- xmlOneToMany_2_2EClass = createEClass(XML_ONE_TO_MANY_22);
- createEAttribute(xmlOneToMany_2_2EClass, XML_ONE_TO_MANY_22__CASCADE_ON_DELETE);
- createEAttribute(xmlOneToMany_2_2EClass, XML_ONE_TO_MANY_22__NONCACHEABLE);
-
- xmlPartitioning_2_2EClass = createEClass(XML_PARTITIONING_22);
- createEAttribute(xmlPartitioning_2_2EClass, XML_PARTITIONING_22__NAME);
-
- xmlPartitioningGroup_2_2EClass = createEClass(XML_PARTITIONING_GROUP_22);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__HASH_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__UNION_PARTITIONING);
- createEAttribute(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__PARTITIONED);
-
- xmlPinnedPartitioning_2_2EClass = createEClass(XML_PINNED_PARTITIONING_22);
- createEAttribute(xmlPinnedPartitioning_2_2EClass, XML_PINNED_PARTITIONING_22__NAME);
-
- xmlRangePartitioning_2_2EClass = createEClass(XML_RANGE_PARTITIONING_22);
- createEAttribute(xmlRangePartitioning_2_2EClass, XML_RANGE_PARTITIONING_22__NAME);
-
- xmlReplicationPartitioning_2_2EClass = createEClass(XML_REPLICATION_PARTITIONING_22);
- createEAttribute(xmlReplicationPartitioning_2_2EClass, XML_REPLICATION_PARTITIONING_22__NAME);
-
- xmlRoundRobinPartitioning_2_2EClass = createEClass(XML_ROUND_ROBIN_PARTITIONING_22);
- createEAttribute(xmlRoundRobinPartitioning_2_2EClass, XML_ROUND_ROBIN_PARTITIONING_22__NAME);
-
- xmlSecondaryTable_2_2EClass = createEClass(XML_SECONDARY_TABLE_22);
- createEAttribute(xmlSecondaryTable_2_2EClass, XML_SECONDARY_TABLE_22__CREATION_SUFFIX);
-
- xmlTable_2_2EClass = createEClass(XML_TABLE_22);
- createEAttribute(xmlTable_2_2EClass, XML_TABLE_22__CREATION_SUFFIX);
-
- xmlTableGenerator_2_2EClass = createEClass(XML_TABLE_GENERATOR_22);
- createEAttribute(xmlTableGenerator_2_2EClass, XML_TABLE_GENERATOR_22__CREATION_SUFFIX);
-
- xmlUnionPartitioning_2_2EClass = createEClass(XML_UNION_PARTITIONING_22);
- createEAttribute(xmlUnionPartitioning_2_2EClass, XML_UNION_PARTITIONING_22__NAME);
-
- xmlValuePartitioning_2_2EClass = createEClass(XML_VALUE_PARTITIONING_22);
- createEAttribute(xmlValuePartitioning_2_2EClass, XML_VALUE_PARTITIONING_22__NAME);
-
- xmlVariableOneToOne_2_2EClass = createEClass(XML_VARIABLE_ONE_TO_ONE_22);
- createEAttribute(xmlVariableOneToOne_2_2EClass, XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE);
-
- xmlVersion_2_2EClass = createEClass(XML_VERSION_22);
- createEReference(xmlVersion_2_2EClass, XML_VERSION_22__INDEX);
-
- // Create enums
- cacheIsolationTypeEEnum = createEEnum(CACHE_ISOLATION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlElementCollection_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlEmbeddable_2_2EClass.getESuperTypes().add(theOrmPackage.getXmlAttributeOverrideContainer());
- xmlEmbeddable_2_2EClass.getESuperTypes().add(theOrmPackage.getXmlAssociationOverrideContainer());
- xmlEntity_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlManyToMany_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlManyToOne_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlMappedSuperclass_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlOneToOne_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlOneToMany_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlVariableOneToOne_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlAdditionalCriteria_2_2EClass, XmlAdditionalCriteria_2_2.class, "XmlAdditionalCriteria_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAdditionalCriteria_2_2_Criteria(), theXMLTypePackage.getString(), "criteria", null, 0, 1, XmlAdditionalCriteria_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasic_2_2EClass, XmlBasic_2_2.class, "XmlBasic_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlBasic_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasicCollection_2_2EClass, XmlBasicCollection_2_2.class, "XmlBasicCollection_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBasicCollection_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlBasicCollection_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasicMap_2_2EClass, XmlBasicMap_2_2.class, "XmlBasicMap_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBasicMap_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlBasicMap_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCache_2_2EClass, XmlCache_2_2.class, "XmlCache_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCache_2_2_Isolation(), this.getCacheIsolationType(), "isolation", "", 0, 1, XmlCache_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCollectionTable_2_2EClass, XmlCollectionTable_2_2.class, "XmlCollectionTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCollectionTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlCollectionTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_2EClass, XmlElementCollection_2_2.class, "XmlElementCollection_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlElementCollection_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlElementCollection_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlElementCollection_2_2_Noncacheable(), theXMLTypePackage.getBoolean(), "noncacheable", null, 0, 1, XmlElementCollection_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddable_2_2EClass, XmlEmbeddable_2_2.class, "XmlEmbeddable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEmbeddable_2_2_ParentClass(), theXMLTypePackage.getString(), "parentClass", null, 0, 1, XmlEmbeddable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_2_2EClass, XmlEntity_2_2.class, "XmlEntity_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_2_AdditionalCriteria(), this.getXmlAdditionalCriteria_2_2(), null, "additionalCriteria", null, 0, 1, XmlEntity_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlEntity_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlEntity_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappings_2_2EClass, XmlEntityMappings_2_2.class, "XmlEntityMappings_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntityMappings_2_2_Partitioning(), this.getXmlPartitioning_2_2(), null, "partitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_ReplicationPartitioning(), this.getXmlReplicationPartitioning_2_2(), null, "replicationPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_RoundRobinPartitioning(), this.getXmlRoundRobinPartitioning_2_2(), null, "roundRobinPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_PinnedPartitioning(), this.getXmlPinnedPartitioning_2_2(), null, "pinnedPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_RangePartitioning(), this.getXmlRangePartitioning_2_2(), null, "rangePartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_ValuePartitioning(), this.getXmlValuePartitioning_2_2(), null, "valuePartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_HashPartitioning(), this.getXmlHashPartitioning_2_2(), null, "hashPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_UnionPartitioning(), this.getXmlUnionPartitioning_2_2(), null, "unionPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlHashPartitioning_2_2EClass, XmlHashPartitioning_2_2.class, "XmlHashPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlHashPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlHashPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlId_2_2EClass, XmlId_2_2.class, "XmlId_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlId_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlId_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlIndex_2_2EClass, XmlIndex_2_2.class, "XmlIndex_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlIndex_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Unique(), theXMLTypePackage.getBooleanObject(), "unique", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_ColumnNames(), theXMLTypePackage.getString(), "columnNames", null, 0, -1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinTable_2_2EClass, XmlJoinTable_2_2.class, "XmlJoinTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJoinTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlJoinTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToMany_2_2EClass, XmlManyToMany_2_2.class, "XmlManyToMany_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlManyToMany_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlManyToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlManyToMany_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlManyToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToOne_2_2EClass, XmlManyToOne_2_2.class, "XmlManyToOne_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlManyToOne_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlManyToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_2EClass, XmlMappedSuperclass_2_2.class, "XmlMappedSuperclass_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_2_AdditionalCriteria(), this.getXmlAdditionalCriteria_2_2(), null, "additionalCriteria", null, 0, 1, XmlMappedSuperclass_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToOne_2_2EClass, XmlOneToOne_2_2.class, "XmlOneToOne_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToOne_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlOneToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOneToOne_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlOneToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_2EClass, XmlOneToMany_2_2.class, "XmlOneToMany_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToMany_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlOneToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOneToMany_2_2_Noncacheable(), theXMLTypePackage.getBoolean(), "noncacheable", null, 0, 1, XmlOneToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPartitioning_2_2EClass, XmlPartitioning_2_2.class, "XmlPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPartitioningGroup_2_2EClass, XmlPartitioningGroup_2_2.class, "XmlPartitioningGroup_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPartitioningGroup_2_2_Partitioning(), this.getXmlPartitioning_2_2(), null, "partitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_ReplicationPartitioning(), this.getXmlReplicationPartitioning_2_2(), null, "replicationPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_RoundRobinPartitioning(), this.getXmlRoundRobinPartitioning_2_2(), null, "roundRobinPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_PinnedPartitioning(), this.getXmlPinnedPartitioning_2_2(), null, "pinnedPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_RangePartitioning(), this.getXmlRangePartitioning_2_2(), null, "rangePartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_ValuePartitioning(), this.getXmlValuePartitioning_2_2(), null, "valuePartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_HashPartitioning(), this.getXmlHashPartitioning_2_2(), null, "hashPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_UnionPartitioning(), this.getXmlUnionPartitioning_2_2(), null, "unionPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPartitioningGroup_2_2_Partitioned(), theXMLTypePackage.getString(), "partitioned", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPinnedPartitioning_2_2EClass, XmlPinnedPartitioning_2_2.class, "XmlPinnedPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPinnedPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPinnedPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlRangePartitioning_2_2EClass, XmlRangePartitioning_2_2.class, "XmlRangePartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlRangePartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlRangePartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlReplicationPartitioning_2_2EClass, XmlReplicationPartitioning_2_2.class, "XmlReplicationPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlReplicationPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlReplicationPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlRoundRobinPartitioning_2_2EClass, XmlRoundRobinPartitioning_2_2.class, "XmlRoundRobinPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlRoundRobinPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlRoundRobinPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSecondaryTable_2_2EClass, XmlSecondaryTable_2_2.class, "XmlSecondaryTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSecondaryTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlSecondaryTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTable_2_2EClass, XmlTable_2_2.class, "XmlTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTableGenerator_2_2EClass, XmlTableGenerator_2_2.class, "XmlTableGenerator_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTableGenerator_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlTableGenerator_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlUnionPartitioning_2_2EClass, XmlUnionPartitioning_2_2.class, "XmlUnionPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlUnionPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlUnionPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlValuePartitioning_2_2EClass, XmlValuePartitioning_2_2.class, "XmlValuePartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlValuePartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlValuePartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVariableOneToOne_2_2EClass, XmlVariableOneToOne_2_2.class, "XmlVariableOneToOne_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlVariableOneToOne_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlVariableOneToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVersion_2_2EClass, XmlVersion_2_2.class, "XmlVersion_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlVersion_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlVersion_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(cacheIsolationTypeEEnum, CacheIsolationType.class, "CacheIsolationType");
- addEEnumLiteral(cacheIsolationTypeEEnum, CacheIsolationType.SHARED);
- addEEnumLiteral(cacheIsolationTypeEEnum, CacheIsolationType.PROTECTED);
- addEEnumLiteral(cacheIsolationTypeEEnum, CacheIsolationType.ISOLATED);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2 <em>Xml Additional Criteria 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2()
- * @generated
- */
- public static final EClass XML_ADDITIONAL_CRITERIA_22 = eINSTANCE.getXmlAdditionalCriteria_2_2();
-
- /**
- * The meta object literal for the '<em><b>Criteria</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ADDITIONAL_CRITERIA_22__CRITERIA = eINSTANCE.getXmlAdditionalCriteria_2_2_Criteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2 <em>Xml Basic 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2()
- * @generated
- */
- public static final EClass XML_BASIC_22 = eINSTANCE.getXmlBasic_2_2();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_22__INDEX = eINSTANCE.getXmlBasic_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2 <em>Xml Basic Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2()
- * @generated
- */
- public static final EClass XML_BASIC_COLLECTION_22 = eINSTANCE.getXmlBasicCollection_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE = eINSTANCE.getXmlBasicCollection_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2 <em>Xml Basic Map 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2()
- * @generated
- */
- public static final EClass XML_BASIC_MAP_22 = eINSTANCE.getXmlBasicMap_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC_MAP_22__CASCADE_ON_DELETE = eINSTANCE.getXmlBasicMap_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2 <em>Xml Cache 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2()
- * @generated
- */
- public static final EClass XML_CACHE_22 = eINSTANCE.getXmlCache_2_2();
-
- /**
- * The meta object literal for the '<em><b>Isolation</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_22__ISOLATION = eINSTANCE.getXmlCache_2_2_Isolation();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2 <em>Xml Collection Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2()
- * @generated
- */
- public static final EClass XML_COLLECTION_TABLE_22 = eINSTANCE.getXmlCollectionTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLLECTION_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlCollectionTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2 <em>Xml Element Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_22 = eINSTANCE.getXmlElementCollection_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE = eINSTANCE.getXmlElementCollection_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Noncacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_22__NONCACHEABLE = eINSTANCE.getXmlElementCollection_2_2_Noncacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2 <em>Xml Entity 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2()
- * @generated
- */
- public static final EClass XML_ENTITY_22 = eINSTANCE.getXmlEntity_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_22__CASCADE_ON_DELETE = eINSTANCE.getXmlEntity_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_22__INDEX = eINSTANCE.getXmlEntity_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2 <em>Xml Entity Mappings 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS_22 = eINSTANCE.getXmlEntityMappings_2_2();
-
- /**
- * The meta object literal for the '<em><b>Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_Partitioning();
-
- /**
- * The meta object literal for the '<em><b>Replication Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_ReplicationPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Round Robin Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_RoundRobinPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Pinned Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_PinnedPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Range Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_RangePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Value Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_ValuePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Hash Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_HashPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Union Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_UnionPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2 <em>Xml Hash Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_HASH_PARTITIONING_22 = eINSTANCE.getXmlHashPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_HASH_PARTITIONING_22__NAME = eINSTANCE.getXmlHashPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '<em><b>Additional Criteria</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_22__ADDITIONAL_CRITERIA = eINSTANCE.getXmlEntity_2_2_AdditionalCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2 <em>Xml Many To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_22 = eINSTANCE.getXmlManyToMany_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MANY_TO_MANY_22__CASCADE_ON_DELETE = eINSTANCE.getXmlManyToMany_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MANY_TO_MANY_22__NON_CACHEABLE = eINSTANCE.getXmlManyToMany_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2 <em>Xml Many To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE_22 = eINSTANCE.getXmlManyToOne_2_2();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MANY_TO_ONE_22__NON_CACHEABLE = eINSTANCE.getXmlManyToOne_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2 <em>Xml One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_22 = eINSTANCE.getXmlOneToOne_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_ONE_22__CASCADE_ON_DELETE = eINSTANCE.getXmlOneToOne_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_ONE_22__NON_CACHEABLE = eINSTANCE.getXmlOneToOne_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2 <em>Xml One To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_22 = eINSTANCE.getXmlOneToMany_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_MANY_22__CASCADE_ON_DELETE = eINSTANCE.getXmlOneToMany_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Noncacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_MANY_22__NONCACHEABLE = eINSTANCE.getXmlOneToMany_2_2_Noncacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2 <em>Xml Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_PARTITIONING_22 = eINSTANCE.getXmlPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PARTITIONING_22__NAME = eINSTANCE.getXmlPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2 <em>Xml Partitioning Group 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2()
- * @generated
- */
- public static final EClass XML_PARTITIONING_GROUP_22 = eINSTANCE.getXmlPartitioningGroup_2_2();
-
- /**
- * The meta object literal for the '<em><b>Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning();
-
- /**
- * The meta object literal for the '<em><b>Replication Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Round Robin Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Pinned Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Range Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Value Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Hash Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__HASH_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Union Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__UNION_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Partitioned</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PARTITIONING_GROUP_22__PARTITIONED = eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2 <em>Xml Pinned Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_PINNED_PARTITIONING_22 = eINSTANCE.getXmlPinnedPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PINNED_PARTITIONING_22__NAME = eINSTANCE.getXmlPinnedPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2 <em>Xml Range Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2()
- * @generated
- */
- public static final EClass XML_RANGE_PARTITIONING_22 = eINSTANCE.getXmlRangePartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_RANGE_PARTITIONING_22__NAME = eINSTANCE.getXmlRangePartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2 <em>Xml Replication Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_REPLICATION_PARTITIONING_22 = eINSTANCE.getXmlReplicationPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_REPLICATION_PARTITIONING_22__NAME = eINSTANCE.getXmlReplicationPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2 <em>Xml Round Robin Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_ROUND_ROBIN_PARTITIONING_22 = eINSTANCE.getXmlRoundRobinPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ROUND_ROBIN_PARTITIONING_22__NAME = eINSTANCE.getXmlRoundRobinPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2 <em>Xml Embeddable 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEmbeddable_2_2()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE_22 = eINSTANCE.getXmlEmbeddable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Parent Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_EMBEDDABLE_22__PARENT_CLASS = eINSTANCE.getXmlEmbeddable_2_2_ParentClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2 <em>Xml Id 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2()
- * @generated
- */
- public static final EClass XML_ID_22 = eINSTANCE.getXmlId_2_2();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID_22__INDEX = eINSTANCE.getXmlId_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2 <em>Xml Index 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2()
- * @generated
- */
- public static final EClass XML_INDEX_22 = eINSTANCE.getXmlIndex_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__NAME = eINSTANCE.getXmlIndex_2_2_Name();
-
- /**
- * The meta object literal for the '<em><b>Schema</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__SCHEMA = eINSTANCE.getXmlIndex_2_2_Schema();
-
- /**
- * The meta object literal for the '<em><b>Catalog</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__CATALOG = eINSTANCE.getXmlIndex_2_2_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__TABLE = eINSTANCE.getXmlIndex_2_2_Table();
-
- /**
- * The meta object literal for the '<em><b>Unique</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__UNIQUE = eINSTANCE.getXmlIndex_2_2_Unique();
-
- /**
- * The meta object literal for the '<em><b>Column Names</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__COLUMN_NAMES = eINSTANCE.getXmlIndex_2_2_ColumnNames();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2 <em>Xml Join Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE_22 = eINSTANCE.getXmlJoinTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JOIN_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlJoinTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2 <em>Xml Mapped Superclass 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_22 = eINSTANCE.getXmlMappedSuperclass_2_2();
-
- /**
- * The meta object literal for the '<em><b>Additional Criteria</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA = eINSTANCE.getXmlMappedSuperclass_2_2_AdditionalCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2 <em>Xml Secondary Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE_22 = eINSTANCE.getXmlSecondaryTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_SECONDARY_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlSecondaryTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2 <em>Xml Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2()
- * @generated
- */
- public static final EClass XML_TABLE_22 = eINSTANCE.getXmlTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2 <em>Xml Table Generator 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR_22 = eINSTANCE.getXmlTableGenerator_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR_22__CREATION_SUFFIX = eINSTANCE.getXmlTableGenerator_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2 <em>Xml Union Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_UNION_PARTITIONING_22 = eINSTANCE.getXmlUnionPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_UNION_PARTITIONING_22__NAME = eINSTANCE.getXmlUnionPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2 <em>Xml Value Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2()
- * @generated
- */
- public static final EClass XML_VALUE_PARTITIONING_22 = eINSTANCE.getXmlValuePartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_VALUE_PARTITIONING_22__NAME = eINSTANCE.getXmlValuePartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2 <em>Xml Variable One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2()
- * @generated
- */
- public static final EClass XML_VARIABLE_ONE_TO_ONE_22 = eINSTANCE.getXmlVariableOneToOne_2_2();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE = eINSTANCE.getXmlVariableOneToOne_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2 <em>Xml Version 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2()
- * @generated
- */
- public static final EClass XML_VERSION_22 = eINSTANCE.getXmlVersion_2_2();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_VERSION_22__INDEX = eINSTANCE.getXmlVersion_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType <em>Cache Isolation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getCacheIsolationType()
- * @generated
- */
- public static final EEnum CACHE_ISOLATION_TYPE = eINSTANCE.getCacheIsolationType();
-
- }
-
-} //EclipseLinkOrmV2_2Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java
deleted file mode 100644
index 3b131f3abc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Additional Criteria 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria <em>Criteria</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAdditionalCriteria_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Criteria</em>' attribute.
- * @see #setCriteria(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2_Criteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Criteria</em>' attribute.
- * @see #getCriteria()
- * @generated
- */
- void setCriteria(String value);
-
-} // XmlAdditionalCriteria_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java
deleted file mode 100644
index af8f99d010..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Collection 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasicCollection_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
-} // XmlBasicCollection_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java
deleted file mode 100644
index 1fccc92fe3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Map 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasicMap_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
-} // XmlBasicMap_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java
deleted file mode 100644
index 6eb2e28aca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasic_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
-} // XmlBasic_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java
deleted file mode 100644
index a51a7c9920..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache2 2</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation <em>Isolation</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCache_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Isolation</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Isolation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #setIsolation(CacheIsolationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2_Isolation()
- * @model default=""
- * @generated
- */
- CacheIsolationType getIsolation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation <em>Isolation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #getIsolation()
- * @generated
- */
- void setIsolation(CacheIsolationType value);
-
-} // XmlCache2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java
deleted file mode 100644
index 87dab02df6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Collection Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCollectionTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlCollectionTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java
deleted file mode 100644
index ebed8e887e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable <em>Noncacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlElementCollection_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNoncacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- void setNoncacheable(boolean value);
-
-} // XmlElementCollection_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java
deleted file mode 100644
index bd073d130d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embeddable 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2#getParentClass <em>Parent Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEmbeddable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbeddable_2_2 extends XmlAttributeOverrideContainer, XmlAssociationOverrideContainer
-{
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEmbeddable_2_2_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getParentClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- void setParentClass(String value);
-
-} // XmlEmbeddable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java
deleted file mode 100644
index cb303b5216..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity Mappings 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPartitioning <em>Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRangePartitioning <em>Range Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getValuePartitioning <em>Value Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getHashPartitioning <em>Hash Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getUnionPartitioning <em>Union Partitioning</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntityMappings_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlPartitioning_2_2> getPartitioning();
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlReplicationPartitioning_2_2> getReplicationPartitioning();
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlRoundRobinPartitioning_2_2> getRoundRobinPartitioning();
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlPinnedPartitioning_2_2> getPinnedPartitioning();
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlRangePartitioning_2_2> getRangePartitioning();
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlValuePartitioning_2_2> getValuePartitioning();
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlHashPartitioning_2_2> getHashPartitioning();
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlUnionPartitioning_2_2> getUnionPartitioning();
-
-} // XmlEntityMappings_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java
deleted file mode 100644
index cd27063979..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria <em>Additional Criteria</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- XmlAdditionalCriteria_2_2 getAdditionalCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- void setAdditionalCriteria(XmlAdditionalCriteria_2_2 value);
-
-} // XmlEntity_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java
deleted file mode 100644
index b5535220e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Hash Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlHashPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlHashPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java
deleted file mode 100644
index c0e2b70fc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlId_2_2.java,v 1.1 2011/02/06 02:13:00 kmoore Exp $
- */
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Id 22</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlId_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
-} // XmlId_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java
deleted file mode 100644
index 98d259385b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Index 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique <em>Unique</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getColumnNames <em>Column Names</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlIndex_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getSchema();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- void setSchema(String value);
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCatalog();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- void setCatalog(String value);
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique</em>' attribute.
- * @see #setUnique(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Unique()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getUnique();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Unique</em>' attribute.
- * @see #getUnique()
- * @generated
- */
- void setUnique(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- EList<String> getColumnNames();
-
-} // XmlIndex_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java
deleted file mode 100644
index 33db965771..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Join Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlJoinTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlJoinTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java
deleted file mode 100644
index 328c0dc19d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To Many 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlManyToMany_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java
deleted file mode 100644
index f9ed6b9270..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To One 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToOne_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlManyToOne_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java
deleted file mode 100644
index f949aa8c74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria <em>Additional Criteria</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- XmlAdditionalCriteria_2_2 getAdditionalCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- void setAdditionalCriteria(XmlAdditionalCriteria_2_2 value);
-
-} // XmlMappedSuperclass_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java
deleted file mode 100644
index 6807ef6f1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable <em>Noncacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNoncacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- void setNoncacheable(boolean value);
-
-} // XmlOneToMany_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java
deleted file mode 100644
index cc745a9b5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To One 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlOneToOne_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java
deleted file mode 100644
index 30dbd3998c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Partitioning Group2 2</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning <em>Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning <em>Range Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning <em>Value Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning <em>Hash Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning <em>Union Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned <em>Partitioned</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPartitioningGroup_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- XmlPartitioning_2_2 getPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- void setPartitioning(XmlPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlReplicationPartitioning_2_2 getReplicationPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- void setReplicationPartitioning(XmlReplicationPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlPinnedPartitioning_2_2 getPinnedPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- void setPinnedPartitioning(XmlPinnedPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- XmlRangePartitioning_2_2 getRangePartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- void setRangePartitioning(XmlRangePartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- XmlValuePartitioning_2_2 getValuePartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- void setValuePartitioning(XmlValuePartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlHashPartitioning_2_2 getHashPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- void setHashPartitioning(XmlHashPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlUnionPartitioning_2_2 getUnionPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- void setUnionPartitioning(XmlUnionPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getPartitioned();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- void setPartitioned(String value);
-
-} // XmlPartitioningGroup2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java
deleted file mode 100644
index c11826e163..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java
deleted file mode 100644
index 4ff0d03d03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Pinned Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPinnedPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlPinnedPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java
deleted file mode 100644
index 526a939fe6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Range Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlRangePartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlRangePartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java
deleted file mode 100644
index 536dd2597c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Replication Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlReplicationPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlReplicationPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java
deleted file mode 100644
index 7a2bb0f9d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Round Robin Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlRoundRobinPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlRoundRobinPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java
deleted file mode 100644
index 860e82acf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Secondary Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlSecondaryTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlSecondaryTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java
deleted file mode 100644
index 6fde551d1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Table Generator 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlTableGenerator_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlTableGenerator_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java
deleted file mode 100644
index 4a620143e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java
deleted file mode 100644
index 23926069ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Union Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlUnionPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlUnionPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java
deleted file mode 100644
index 6871869bb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Value Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlValuePartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlValuePartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java
deleted file mode 100644
index ee10991c84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Variable One To One 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlVariableOneToOne_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlVariableOneToOne_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java
deleted file mode 100644
index 6b92520779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Version 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlVersion_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
-} // XmlVersion_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java
deleted file mode 100644
index 518d4a4afa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_3
- extends EclipseLink2_2
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_3.xsd";
- String SCHEMA_VERSION = "2.3";
-
- // EclipseLink 2.3 specific nodes
- String ARRAY = "array";
- String COMPOSITE_MEMBER = "composite-member";
-
- String MULTITENANT = "multitenant";
- String MULTITENANT__TYPE = "type";
- String MULTITENANT_TYPE = "multiltenant-type";
-
- String NAMED_STORED_FUNCTION_QUERY = "named-stored-function-query";
- String NAMED_STORED_FUNCTION_QUERY__NAME = "nname";
- String NAMED_PLSQL_STORED_PROCEDURE_QUERY = "named-plsql-stored-procedure-query";
- String NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME = "name";
- String NAMED_PLSQL_STORED_FUNCTION_QUERY = "named-plsql-stored-function-query";
- String NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME = "name";
- String PLSQL_RECORD = "plsql-record";
- String PLSQL_RECORD__NAME = "name";
- String PLSQL_TABLE = "plsql-table";
- String PLSQL_TABLE__NAME = "name";
- String STRUCT = "struct";
- String STRUCT__NAME = "name";
- String STRUCTURE = "structure";
-
- String TENANT_DISCRIMINATOR_COLUMN = "tenant-discriminator-column";
- String TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = "context-property";
- String TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY= "primary-key";
- String TENANT_DISCRIMINATOR_COLUMN__TABLE = "table";
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java
deleted file mode 100644
index a9cb1f678f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package
- * @generated
- */
-public class EclipseLinkOrmV2_3Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_3Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_3Factory init()
- {
- try
- {
- EclipseLinkOrmV2_3Factory theEclipseLinkOrmV2_3Factory = (EclipseLinkOrmV2_3Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_3.xmi");
- if (theEclipseLinkOrmV2_3Factory != null)
- {
- return theEclipseLinkOrmV2_3Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_3Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_3Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_3Package.MULTITENANT_TYPE:
- return createMultitenantTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_3Package.MULTITENANT_TYPE:
- return convertMultitenantTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MultitenantType createMultitenantTypeFromString(EDataType eDataType, String initialValue)
- {
- MultitenantType result = MultitenantType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertMultitenantTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_3Package getEclipseLinkOrmV2_3Package()
- {
- return (EclipseLinkOrmV2_3Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_3Package getPackage()
- {
- return EclipseLinkOrmV2_3Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_3Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java
deleted file mode 100644
index 6416e86153..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java
+++ /dev/null
@@ -1,2464 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_3Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_3";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_3.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_3Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3 <em>Xml Embeddable 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3()
- * @generated
- */
- public static final int XML_EMBEDDABLE_23 = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3 <em>Xml Multitenant 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3()
- * @generated
- */
- public static final int XML_MULTITENANT_23 = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3 <em>Xml Entity 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3()
- * @generated
- */
- public static final int XML_ENTITY_23 = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3 <em>Xml Mapped Superclass 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_23 = 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3 <em>Xml Entity Mappings 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS_23 = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23 = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3 <em>Xml Named Plsql Stored Procedure Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23 = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3 <em>Xml Named Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3()
- * @generated
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_23 = 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3 <em>Xml Persistence Unit Defaults 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_23 = 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3 <em>Xml Plsql Record 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3()
- * @generated
- */
- public static final int XML_PLSQL_RECORD_23 = 12;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3 <em>Xml Plsql Table 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3()
- * @generated
- */
- public static final int XML_PLSQL_TABLE_23 = 13;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3 <em>Xml Struct 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3()
- * @generated
- */
- public static final int XML_STRUCT_23 = 14;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3()
- * @generated
- */
- public static final int XML_ATTRIBUTES_23 = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3 <em>Xml Structure 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStructure_2_3()
- * @generated
- */
- public static final int XML_STRUCTURE_23 = 16;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3 <em>Xml Array 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3()
- * @generated
- */
- public static final int XML_ARRAY_23 = 0;
-
- /**
- * The number of structural features of the '<em>Xml Array 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_23_FEATURE_COUNT = 0;
-
- /**
- * The feature id for the '<em><b>Structures</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_23__STRUCTURES = 0;
-
- /**
- * The feature id for the '<em><b>Arrays</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_23__ARRAYS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Attributes 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_23_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3 <em>Xml Tenant Discriminator Column 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23 = 15;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3 <em>Xml Element Collection 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_23 = 2;
-
- /**
- * The feature id for the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER = 0;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23__PLSQL_RECORDS = 0;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23__PLSQL_TABLES = 1;
-
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23__STRUCT = 2;
-
- /**
- * The number of structural features of the '<em>Xml Embeddable 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23_FEATURE_COUNT = 3;
-
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__MULTITENANT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
-
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__PLSQL_RECORDS = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__PLSQL_TABLES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__STRUCT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Entity 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23_FEATURE_COUNT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS = 0;
-
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES = 1;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = 2;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = 3;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS = 4;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__PLSQL_TABLES = 5;
-
- /**
- * The number of structural features of the '<em>Xml Entity Mappings 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23_FEATURE_COUNT = 6;
-
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__MULTITENANT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
-
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23_FEATURE_COUNT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_23__TYPE = 0;
-
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Multitenant 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_23_FEATURE_COUNT = 2;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Function Query 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Procedure Query 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Stored Function Query 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Plsql Record 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Plsql Table 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Struct 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__COLUMN_DEFINITION = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__NAME = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Discriminator Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__DISCRIMINATOR_TYPE = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
-
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__LENGTH = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__LENGTH;
-
- /**
- * The feature id for the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Tenant Discriminator Column 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23_FEATURE_COUNT = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the '<em>Xml Structure 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE_23_FEATURE_COUNT = 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType <em>Multitenant Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getMultitenantType()
- * @generated
- */
- public static final int MULTITENANT_TYPE = 17;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddable_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenant_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredFunctionQuery_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredProcedureQuery_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedStoredFunctionQuery_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappings_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaults_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlRecord_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlTable_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStruct_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTenantDiscriminatorColumn_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributes_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructure_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlArray_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum multitenantTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_3Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_3Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_3Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_3Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_3Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_3Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_3Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_3Package.eNS_URI, theEclipseLinkOrmV2_3Package);
- return theEclipseLinkOrmV2_3Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3 <em>Xml Embeddable 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3
- * @generated
- */
- public EClass getXmlEmbeddable_2_3()
- {
- return xmlEmbeddable_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlRecords()
- * @see #getXmlEmbeddable_2_3()
- * @generated
- */
- public EReference getXmlEmbeddable_2_3_PlsqlRecords()
- {
- return (EReference)xmlEmbeddable_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlTables()
- * @see #getXmlEmbeddable_2_3()
- * @generated
- */
- public EReference getXmlEmbeddable_2_3_PlsqlTables()
- {
- return (EReference)xmlEmbeddable_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct <em>Struct</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Struct</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct()
- * @see #getXmlEmbeddable_2_3()
- * @generated
- */
- public EReference getXmlEmbeddable_2_3_Struct()
- {
- return (EReference)xmlEmbeddable_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3 <em>Xml Multitenant 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3
- * @generated
- */
- public EClass getXmlMultitenant_2_3()
- {
- return xmlMultitenant_2_3EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType()
- * @see #getXmlMultitenant_2_3()
- * @generated
- */
- public EAttribute getXmlMultitenant_2_3_Type()
- {
- return (EAttribute)xmlMultitenant_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Tenant Discriminator Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns()
- * @see #getXmlMultitenant_2_3()
- * @generated
- */
- public EReference getXmlMultitenant_2_3_TenantDiscriminatorColumns()
- {
- return (EReference)xmlMultitenant_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Function Query 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredFunctionQuery_2_3()
- {
- return xmlNamedPlsqlStoredFunctionQuery_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName()
- * @see #getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @generated
- */
- public EAttribute getXmlNamedPlsqlStoredFunctionQuery_2_3_Name()
- {
- return (EAttribute)xmlNamedPlsqlStoredFunctionQuery_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3 <em>Xml Named Plsql Stored Procedure Query 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Procedure Query 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredProcedureQuery_2_3()
- {
- return xmlNamedPlsqlStoredProcedureQuery_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName()
- * @see #getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @generated
- */
- public EAttribute getXmlNamedPlsqlStoredProcedureQuery_2_3_Name()
- {
- return (EAttribute)xmlNamedPlsqlStoredProcedureQuery_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3 <em>Xml Named Stored Function Query 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Stored Function Query 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3
- * @generated
- */
- public EClass getXmlNamedStoredFunctionQuery_2_3()
- {
- return xmlNamedStoredFunctionQuery_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName()
- * @see #getXmlNamedStoredFunctionQuery_2_3()
- * @generated
- */
- public EAttribute getXmlNamedStoredFunctionQuery_2_3_Name()
- {
- return (EAttribute)xmlNamedStoredFunctionQuery_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3 <em>Xml Entity 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3
- * @generated
- */
- public EClass getXmlEntity_2_3()
- {
- return xmlEntity_2_3EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedStoredFunctionQueries()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_NamedStoredFunctionQueries()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredFunctionQueries()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredProcedureQueries()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlRecords()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_PlsqlRecords()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlTables()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_PlsqlTables()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct <em>Struct</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Struct</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_Struct()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3 <em>Xml Mapped Superclass 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_3()
- {
- return xmlMappedSuperclass_2_3EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedStoredFunctionQueries()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredFunctionQueries()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredProcedureQueries()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlRecords()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_PlsqlRecords()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlTables()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_PlsqlTables()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3 <em>Xml Entity Mappings 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3
- * @generated
- */
- public EClass getXmlEntityMappings_2_3()
- {
- return xmlEntityMappings_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Tenant Discriminator Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getTenantDiscriminatorColumns()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_TenantDiscriminatorColumns()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedStoredFunctionQueries()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_NamedStoredFunctionQueries()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredFunctionQueries()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredProcedureQueries()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlRecords()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_PlsqlRecords()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlTables()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_PlsqlTables()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3 <em>Xml Persistence Unit Defaults 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults_2_3()
- {
- return xmlPersistenceUnitDefaults_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Tenant Discriminator Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3#getTenantDiscriminatorColumns()
- * @see #getXmlPersistenceUnitDefaults_2_3()
- * @generated
- */
- public EReference getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()
- {
- return (EReference)xmlPersistenceUnitDefaults_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3 <em>Xml Plsql Record 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Record 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3
- * @generated
- */
- public EClass getXmlPlsqlRecord_2_3()
- {
- return xmlPlsqlRecord_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName()
- * @see #getXmlPlsqlRecord_2_3()
- * @generated
- */
- public EAttribute getXmlPlsqlRecord_2_3_Name()
- {
- return (EAttribute)xmlPlsqlRecord_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3 <em>Xml Plsql Table 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Table 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3
- * @generated
- */
- public EClass getXmlPlsqlTable_2_3()
- {
- return xmlPlsqlTable_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName()
- * @see #getXmlPlsqlTable_2_3()
- * @generated
- */
- public EAttribute getXmlPlsqlTable_2_3_Name()
- {
- return (EAttribute)xmlPlsqlTable_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3 <em>Xml Struct 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Struct 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3
- * @generated
- */
- public EClass getXmlStruct_2_3()
- {
- return xmlStruct_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName()
- * @see #getXmlStruct_2_3()
- * @generated
- */
- public EAttribute getXmlStruct_2_3_Name()
- {
- return (EAttribute)xmlStruct_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3 <em>Xml Tenant Discriminator Column 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Tenant Discriminator Column 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3
- * @generated
- */
- public EClass getXmlTenantDiscriminatorColumn_2_3()
- {
- return xmlTenantDiscriminatorColumn_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Context Property</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty()
- * @see #getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public EAttribute getXmlTenantDiscriminatorColumn_2_3_ContextProperty()
- {
- return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable()
- * @see #getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public EAttribute getXmlTenantDiscriminatorColumn_2_3_Table()
- {
- return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey()
- * @see #getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public EAttribute getXmlTenantDiscriminatorColumn_2_3_PrimaryKey()
- {
- return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attributes 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3
- * @generated
- */
- public EClass getXmlAttributes_2_3()
- {
- return xmlAttributes_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getStructures <em>Structures</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Structures</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getStructures()
- * @see #getXmlAttributes_2_3()
- * @generated
- */
- public EReference getXmlAttributes_2_3_Structures()
- {
- return (EReference)xmlAttributes_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getArrays <em>Arrays</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Arrays</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getArrays()
- * @see #getXmlAttributes_2_3()
- * @generated
- */
- public EReference getXmlAttributes_2_3_Arrays()
- {
- return (EReference)xmlAttributes_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3 <em>Xml Structure 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Structure 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3
- * @generated
- */
- public EClass getXmlStructure_2_3()
- {
- return xmlStructure_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3 <em>Xml Array 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Array 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3
- * @generated
- */
- public EClass getXmlArray_2_3()
- {
- return xmlArray_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3 <em>Xml Element Collection 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3
- * @generated
- */
- public EClass getXmlElementCollection_2_3()
- {
- return xmlElementCollection_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember <em>Composite Member</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Composite Member</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember()
- * @see #getXmlElementCollection_2_3()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_3_CompositeMember()
- {
- return (EAttribute)xmlElementCollection_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType <em>Multitenant Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Multitenant Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @generated
- */
- public EEnum getMultitenantType()
- {
- return multitenantTypeEEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_3Factory getEclipseLinkOrmV2_3Factory()
- {
- return (EclipseLinkOrmV2_3Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlArray_2_3EClass = createEClass(XML_ARRAY_23);
-
- xmlAttributes_2_3EClass = createEClass(XML_ATTRIBUTES_23);
- createEReference(xmlAttributes_2_3EClass, XML_ATTRIBUTES_23__STRUCTURES);
- createEReference(xmlAttributes_2_3EClass, XML_ATTRIBUTES_23__ARRAYS);
-
- xmlElementCollection_2_3EClass = createEClass(XML_ELEMENT_COLLECTION_23);
- createEAttribute(xmlElementCollection_2_3EClass, XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER);
-
- xmlEmbeddable_2_3EClass = createEClass(XML_EMBEDDABLE_23);
- createEReference(xmlEmbeddable_2_3EClass, XML_EMBEDDABLE_23__PLSQL_RECORDS);
- createEReference(xmlEmbeddable_2_3EClass, XML_EMBEDDABLE_23__PLSQL_TABLES);
- createEReference(xmlEmbeddable_2_3EClass, XML_EMBEDDABLE_23__STRUCT);
-
- xmlEntity_2_3EClass = createEClass(XML_ENTITY_23);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__PLSQL_RECORDS);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__PLSQL_TABLES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__STRUCT);
-
- xmlEntityMappings_2_3EClass = createEClass(XML_ENTITY_MAPPINGS_23);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__PLSQL_TABLES);
-
- xmlMappedSuperclass_2_3EClass = createEClass(XML_MAPPED_SUPERCLASS_23);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES);
-
- xmlMultitenant_2_3EClass = createEClass(XML_MULTITENANT_23);
- createEAttribute(xmlMultitenant_2_3EClass, XML_MULTITENANT_23__TYPE);
- createEReference(xmlMultitenant_2_3EClass, XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS);
-
- xmlNamedPlsqlStoredFunctionQuery_2_3EClass = createEClass(XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23);
- createEAttribute(xmlNamedPlsqlStoredFunctionQuery_2_3EClass, XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME);
-
- xmlNamedPlsqlStoredProcedureQuery_2_3EClass = createEClass(XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23);
- createEAttribute(xmlNamedPlsqlStoredProcedureQuery_2_3EClass, XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME);
-
- xmlNamedStoredFunctionQuery_2_3EClass = createEClass(XML_NAMED_STORED_FUNCTION_QUERY_23);
- createEAttribute(xmlNamedStoredFunctionQuery_2_3EClass, XML_NAMED_STORED_FUNCTION_QUERY_23__NAME);
-
- xmlPersistenceUnitDefaults_2_3EClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS_23);
- createEReference(xmlPersistenceUnitDefaults_2_3EClass, XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS);
-
- xmlPlsqlRecord_2_3EClass = createEClass(XML_PLSQL_RECORD_23);
- createEAttribute(xmlPlsqlRecord_2_3EClass, XML_PLSQL_RECORD_23__NAME);
-
- xmlPlsqlTable_2_3EClass = createEClass(XML_PLSQL_TABLE_23);
- createEAttribute(xmlPlsqlTable_2_3EClass, XML_PLSQL_TABLE_23__NAME);
-
- xmlStruct_2_3EClass = createEClass(XML_STRUCT_23);
- createEAttribute(xmlStruct_2_3EClass, XML_STRUCT_23__NAME);
-
- xmlTenantDiscriminatorColumn_2_3EClass = createEClass(XML_TENANT_DISCRIMINATOR_COLUMN_23);
- createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY);
- createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE);
- createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY);
-
- xmlStructure_2_3EClass = createEClass(XML_STRUCTURE_23);
-
- // Create enums
- multitenantTypeEEnum = createEEnum(MULTITENANT_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlEntity_2_3EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlMultitenantHolder());
- xmlMappedSuperclass_2_3EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlMultitenantHolder());
- xmlTenantDiscriminatorColumn_2_3EClass.getESuperTypes().add(theOrmPackage.getXmlBaseDiscriminatorColumn());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlArray_2_3EClass, XmlArray_2_3.class, "XmlArray_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAttributes_2_3EClass, XmlAttributes_2_3.class, "XmlAttributes_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAttributes_2_3_Structures(), this.getXmlStructure_2_3(), null, "structures", null, 0, -1, XmlAttributes_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlAttributes_2_3_Arrays(), this.getXmlArray_2_3(), null, "arrays", null, 0, -1, XmlAttributes_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_3EClass, XmlElementCollection_2_3.class, "XmlElementCollection_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlElementCollection_2_3_CompositeMember(), theXMLTypePackage.getString(), "compositeMember", null, 0, 1, XmlElementCollection_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddable_2_3EClass, XmlEmbeddable_2_3.class, "XmlEmbeddable_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEmbeddable_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlEmbeddable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlEmbeddable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_2_3_Struct(), this.getXmlStruct_2_3(), null, "struct", null, 0, 1, XmlEmbeddable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_2_3EClass, XmlEntity_2_3.class, "XmlEntity_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_3_NamedStoredFunctionQueries(), this.getXmlNamedStoredFunctionQuery_2_3(), null, "namedStoredFunctionQueries", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries(), this.getXmlNamedPlsqlStoredFunctionQuery_2_3(), null, "namedPlsqlStoredFunctionQueries", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries(), this.getXmlNamedPlsqlStoredProcedureQuery_2_3(), null, "namedPlsqlStoredProcedureQueries", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_Struct(), this.getXmlStruct_2_3(), null, "struct", null, 0, 1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappings_2_3EClass, XmlEntityMappings_2_3.class, "XmlEntityMappings_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntityMappings_2_3_TenantDiscriminatorColumns(), this.getXmlTenantDiscriminatorColumn_2_3(), null, "tenantDiscriminatorColumns", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_NamedStoredFunctionQueries(), this.getXmlNamedStoredFunctionQuery_2_3(), null, "namedStoredFunctionQueries", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries(), this.getXmlNamedPlsqlStoredFunctionQuery_2_3(), null, "namedPlsqlStoredFunctionQueries", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries(), this.getXmlNamedPlsqlStoredProcedureQuery_2_3(), null, "namedPlsqlStoredProcedureQueries", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_3EClass, XmlMappedSuperclass_2_3.class, "XmlMappedSuperclass_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries(), this.getXmlNamedStoredFunctionQuery_2_3(), null, "namedStoredFunctionQueries", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries(), this.getXmlNamedPlsqlStoredFunctionQuery_2_3(), null, "namedPlsqlStoredFunctionQueries", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries(), this.getXmlNamedPlsqlStoredProcedureQuery_2_3(), null, "namedPlsqlStoredProcedureQueries", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultitenant_2_3EClass, XmlMultitenant_2_3.class, "XmlMultitenant_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMultitenant_2_3_Type(), this.getMultitenantType(), "type", null, 0, 1, XmlMultitenant_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMultitenant_2_3_TenantDiscriminatorColumns(), this.getXmlTenantDiscriminatorColumn_2_3(), null, "tenantDiscriminatorColumns", null, 0, -1, XmlMultitenant_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedPlsqlStoredFunctionQuery_2_3EClass, XmlNamedPlsqlStoredFunctionQuery_2_3.class, "XmlNamedPlsqlStoredFunctionQuery_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedPlsqlStoredFunctionQuery_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedPlsqlStoredFunctionQuery_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedPlsqlStoredProcedureQuery_2_3EClass, XmlNamedPlsqlStoredProcedureQuery_2_3.class, "XmlNamedPlsqlStoredProcedureQuery_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedPlsqlStoredProcedureQuery_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedPlsqlStoredProcedureQuery_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedStoredFunctionQuery_2_3EClass, XmlNamedStoredFunctionQuery_2_3.class, "XmlNamedStoredFunctionQuery_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedStoredFunctionQuery_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedStoredFunctionQuery_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitDefaults_2_3EClass, XmlPersistenceUnitDefaults_2_3.class, "XmlPersistenceUnitDefaults_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns(), this.getXmlTenantDiscriminatorColumn_2_3(), null, "tenantDiscriminatorColumns", null, 0, -1, XmlPersistenceUnitDefaults_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPlsqlRecord_2_3EClass, XmlPlsqlRecord_2_3.class, "XmlPlsqlRecord_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPlsqlRecord_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPlsqlRecord_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPlsqlTable_2_3EClass, XmlPlsqlTable_2_3.class, "XmlPlsqlTable_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPlsqlTable_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPlsqlTable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStruct_2_3EClass, XmlStruct_2_3.class, "XmlStruct_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlStruct_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlStruct_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTenantDiscriminatorColumn_2_3EClass, XmlTenantDiscriminatorColumn_2_3.class, "XmlTenantDiscriminatorColumn_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTenantDiscriminatorColumn_2_3_ContextProperty(), theXMLTypePackage.getString(), "contextProperty", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTenantDiscriminatorColumn_2_3_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTenantDiscriminatorColumn_2_3_PrimaryKey(), ecorePackage.getEBooleanObject(), "primaryKey", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStructure_2_3EClass, XmlStructure_2_3.class, "XmlStructure_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- // Initialize enums and add enum literals
- initEEnum(multitenantTypeEEnum, MultitenantType.class, "MultitenantType");
- addEEnumLiteral(multitenantTypeEEnum, MultitenantType.SINGLE_TABLE);
- addEEnumLiteral(multitenantTypeEEnum, MultitenantType.TABLE_PER_TENANT);
- addEEnumLiteral(multitenantTypeEEnum, MultitenantType.VPD);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3 <em>Xml Embeddable 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE_23 = eINSTANCE.getXmlEmbeddable_2_3();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE_23__PLSQL_RECORDS = eINSTANCE.getXmlEmbeddable_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE_23__PLSQL_TABLES = eINSTANCE.getXmlEmbeddable_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '<em><b>Struct</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE_23__STRUCT = eINSTANCE.getXmlEmbeddable_2_3_Struct();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3 <em>Xml Multitenant 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3()
- * @generated
- */
- public static final EClass XML_MULTITENANT_23 = eINSTANCE.getXmlMultitenant_2_3();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTITENANT_23__TYPE = eINSTANCE.getXmlMultitenant_2_3_Type();
-
- /**
- * The meta object literal for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS = eINSTANCE.getXmlMultitenant_2_3_TenantDiscriminatorColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23 = eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME = eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3 <em>Xml Named Plsql Stored Procedure Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23 = eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME = eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3 <em>Xml Named Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3()
- * @generated
- */
- public static final EClass XML_NAMED_STORED_FUNCTION_QUERY_23 = eINSTANCE.getXmlNamedStoredFunctionQuery_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_FUNCTION_QUERY_23__NAME = eINSTANCE.getXmlNamedStoredFunctionQuery_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3 <em>Xml Entity 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3()
- * @generated
- */
- public static final EClass XML_ENTITY_23 = eINSTANCE.getXmlEntity_2_3();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntity_2_3_NamedStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__PLSQL_RECORDS = eINSTANCE.getXmlEntity_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__PLSQL_TABLES = eINSTANCE.getXmlEntity_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '<em><b>Struct</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__STRUCT = eINSTANCE.getXmlEntity_2_3_Struct();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3 <em>Xml Mapped Superclass 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_23 = eINSTANCE.getXmlMappedSuperclass_2_3();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS = eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES = eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3 <em>Xml Entity Mappings 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS_23 = eINSTANCE.getXmlEntityMappings_2_3();
-
- /**
- * The meta object literal for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS = eINSTANCE.getXmlEntityMappings_2_3_TenantDiscriminatorColumns();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntityMappings_2_3_NamedStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS = eINSTANCE.getXmlEntityMappings_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__PLSQL_TABLES = eINSTANCE.getXmlEntityMappings_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3 <em>Xml Persistence Unit Defaults 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS_23 = eINSTANCE.getXmlPersistenceUnitDefaults_2_3();
-
- /**
- * The meta object literal for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS = eINSTANCE.getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3 <em>Xml Plsql Record 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3()
- * @generated
- */
- public static final EClass XML_PLSQL_RECORD_23 = eINSTANCE.getXmlPlsqlRecord_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PLSQL_RECORD_23__NAME = eINSTANCE.getXmlPlsqlRecord_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3 <em>Xml Plsql Table 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3()
- * @generated
- */
- public static final EClass XML_PLSQL_TABLE_23 = eINSTANCE.getXmlPlsqlTable_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PLSQL_TABLE_23__NAME = eINSTANCE.getXmlPlsqlTable_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3 <em>Xml Struct 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3()
- * @generated
- */
- public static final EClass XML_STRUCT_23 = eINSTANCE.getXmlStruct_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STRUCT_23__NAME = eINSTANCE.getXmlStruct_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3 <em>Xml Tenant Discriminator Column 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public static final EClass XML_TENANT_DISCRIMINATOR_COLUMN_23 = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3();
-
- /**
- * The meta object literal for the '<em><b>Context Property</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_ContextProperty();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Table();
-
- /**
- * The meta object literal for the '<em><b>Primary Key</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_PrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3()
- * @generated
- */
- public static final EClass XML_ATTRIBUTES_23 = eINSTANCE.getXmlAttributes_2_3();
-
- /**
- * The meta object literal for the '<em><b>Structures</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTES_23__STRUCTURES = eINSTANCE.getXmlAttributes_2_3_Structures();
-
- /**
- * The meta object literal for the '<em><b>Arrays</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTES_23__ARRAYS = eINSTANCE.getXmlAttributes_2_3_Arrays();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3 <em>Xml Structure 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStructure_2_3()
- * @generated
- */
- public static final EClass XML_STRUCTURE_23 = eINSTANCE.getXmlStructure_2_3();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3 <em>Xml Array 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3()
- * @generated
- */
- public static final EClass XML_ARRAY_23 = eINSTANCE.getXmlArray_2_3();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3 <em>Xml Element Collection 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_23 = eINSTANCE.getXmlElementCollection_2_3();
-
- /**
- * The meta object literal for the '<em><b>Composite Member</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER = eINSTANCE.getXmlElementCollection_2_3_CompositeMember();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType <em>Multitenant Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getMultitenantType()
- * @generated
- */
- public static final EEnum MULTITENANT_TYPE = eINSTANCE.getMultitenantType();
-
- }
-
-} //EclipseLinkOrmV2_3Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java
deleted file mode 100644
index c963c264f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Multitenant Type</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getMultitenantType()
- * @model
- * @generated
- */
-public enum MultitenantType implements Enumerator
-{
- /**
- * The '<em><b>SINGLE TABLE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SINGLE_TABLE_VALUE
- * @generated
- * @ordered
- */
- SINGLE_TABLE(0, "SINGLE_TABLE", "SINGLE_TABLE"),
-
- /**
- * The '<em><b>TABLE PER TENANT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TABLE_PER_TENANT_VALUE
- * @generated
- * @ordered
- */
- TABLE_PER_TENANT(1, "TABLE_PER_TENANT", "TABLE_PER_TENANT"), /**
- * The '<em><b>VPD</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #VPD_VALUE
- * @generated
- * @ordered
- */
- VPD(2, "VPD", "VPD");
-
- /**
- * The '<em><b>SINGLE TABLE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SINGLE TABLE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SINGLE_TABLE
- * @model
- * @generated
- * @ordered
- */
- public static final int SINGLE_TABLE_VALUE = 0;
-
- /**
- * The '<em><b>TABLE PER TENANT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TABLE PER TENANT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TABLE_PER_TENANT
- * @model
- * @generated
- * @ordered
- */
- public static final int TABLE_PER_TENANT_VALUE = 1;
-
- /**
- * The '<em><b>VPD</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>VPD</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #VPD
- * @model
- * @generated
- * @ordered
- */
- public static final int VPD_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Multitenant Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final MultitenantType[] VALUES_ARRAY =
- new MultitenantType[]
- {
- SINGLE_TABLE,
- TABLE_PER_TENANT,
- VPD,
- };
-
- /**
- * A public read-only list of all the '<em><b>Multitenant Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<MultitenantType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Multitenant Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static MultitenantType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- MultitenantType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Multitenant Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static MultitenantType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- MultitenantType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Multitenant Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static MultitenantType get(int value)
- {
- switch (value)
- {
- case SINGLE_TABLE_VALUE: return SINGLE_TABLE;
- case TABLE_PER_TENANT_VALUE: return TABLE_PER_TENANT;
- case VPD_VALUE: return VPD;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private MultitenantType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlMultitenantType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java
deleted file mode 100644
index 0640d17f38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Array 23</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlArray_2_3 extends JpaEObject
-{
-} // XmlArray_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java
deleted file mode 100644
index 91905162a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Attributes 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getStructures <em>Structures</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getArrays <em>Arrays</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributes_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Structures</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Structures</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Structures</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3_Structures()
- * @model containment="true"
- * @generated
- */
- EList<XmlStructure_2_3> getStructures();
-
- /**
- * Returns the value of the '<em><b>Arrays</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Arrays</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Arrays</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3_Arrays()
- * @model containment="true"
- * @generated
- */
- EList<XmlArray_2_3> getArrays();
-
-} // XmlAttributes_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java
deleted file mode 100644
index f098a869f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlElementCollection_2_3.java,v 1.1 2011/06/24 15:49:56 kmoore Exp $
- */
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember <em>Composite Member</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlElementCollection_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Composite Member</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Composite Member</em>' attribute.
- * @see #setCompositeMember(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3_CompositeMember()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCompositeMember();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Composite Member</em>' attribute.
- * @see #getCompositeMember()
- * @generated
- */
- void setCompositeMember(String value);
-
-} // XmlElementCollection_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java
deleted file mode 100644
index 51e4eb93a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embeddable 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct <em>Struct</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEmbeddable_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- XmlStruct_2_3 getStruct();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- void setStruct(XmlStruct_2_3 value);
-
-} // XmlEmbeddable_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java
deleted file mode 100644
index 9c1ddf28bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity Mappings 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntityMappings_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns();
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries();
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
-} // XmlEntityMappings_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java
deleted file mode 100644
index dd27d915d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct <em>Struct</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_3 extends XmlMultitenantHolder
-{
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries();
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- XmlStruct_2_3 getStruct();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- void setStruct(XmlStruct_2_3 value);
-
-} // XmlEntity_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java
deleted file mode 100644
index 2868c3f44b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_3 extends XmlMultitenantHolder
-{
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries();
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
-} // XmlMappedSuperclass_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java
deleted file mode 100644
index 907e1e1000..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMultitenant_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #setType(MultitenantType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3_Type()
- * @model
- * @generated
- */
- MultitenantType getType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #getType()
- * @generated
- */
- void setType(MultitenantType value);
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns();
-} // XmlMultitenant_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java
deleted file mode 100644
index 6cd2cf408d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Function Query2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedPlsqlStoredFunctionQuery_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlNamedPlsqlStoredFunctionQuery2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java
deleted file mode 100644
index f4ffe08590..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Procedure Query2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedPlsqlStoredProcedureQuery_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlNamedPlsqlStoredProcedureQuery2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java
deleted file mode 100644
index 6d5b9b62d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Stored Function Query2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedStoredFunctionQuery_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlNamedStoredFunctionQuery2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java
deleted file mode 100644
index e63726e7f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Defaults 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPersistenceUnitDefaults_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns();
-
-} // XmlPersistenceUnitDefaults_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java
deleted file mode 100644
index 19892e1459..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Record2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPlsqlRecord_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlPlsqlRecord2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java
deleted file mode 100644
index 254d000c31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Table2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPlsqlTable_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlPlsqlTable2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java
deleted file mode 100644
index 9cd71de2f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Struct2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlStruct_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlStruct2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java
deleted file mode 100644
index 26b6dc2e79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Structure 23</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStructure_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlStructure_2_3 extends JpaEObject
-{
-} // XmlStructure_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java
deleted file mode 100644
index e51f38c4a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBaseDiscriminatorColumn;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Tenant Discriminator2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTenantDiscriminatorColumn_2_3 extends XmlBaseDiscriminatorColumn
-{
-
- /**
- * Returns the value of the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Context Property</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Context Property</em>' attribute.
- * @see #setContextProperty(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_ContextProperty()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getContextProperty();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Context Property</em>' attribute.
- * @see #getContextProperty()
- * @generated
- */
- void setContextProperty(String value);
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' attribute.
- * @see #setPrimaryKey(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_PrimaryKey()
- * @model
- * @generated
- */
- Boolean getPrimaryKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' attribute.
- * @see #getPrimaryKey()
- * @generated
- */
- void setPrimaryKey(Boolean value);
-
- TextRange getTableTextRange();
-} // XmlTenantDiscriminator2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java
deleted file mode 100644
index d293742434..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Database Change Notification Type</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getDatabaseChangeNotificationType()
- * @model
- * @generated
- */
-public enum DatabaseChangeNotificationType implements Enumerator
-{
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(0, "NONE", "NONE"),
-
- /**
- * The '<em><b>INVALIDATION</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INVALIDATION_VALUE
- * @generated
- * @ordered
- */
- INVALIDATION(1, "INVALIDATION", "INVALIDATION");
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 0;
-
- /**
- * The '<em><b>INVALIDATION</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INVALIDATION</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INVALIDATION
- * @model
- * @generated
- * @ordered
- */
- public static final int INVALIDATION_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Database Change Notification Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final DatabaseChangeNotificationType[] VALUES_ARRAY =
- new DatabaseChangeNotificationType[]
- {
- NONE,
- INVALIDATION,
- };
-
- /**
- * A public read-only list of all the '<em><b>Database Change Notification Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<DatabaseChangeNotificationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Database Change Notification Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DatabaseChangeNotificationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DatabaseChangeNotificationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Database Change Notification Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DatabaseChangeNotificationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DatabaseChangeNotificationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Database Change Notification Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DatabaseChangeNotificationType get(int value)
- {
- switch (value)
- {
- case NONE_VALUE: return NONE;
- case INVALIDATION_VALUE: return INVALIDATION;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private DatabaseChangeNotificationType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //DatabaseChangeNotificationType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java
deleted file mode 100644
index d4000b74c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_4
- extends EclipseLink2_2
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd";
- String SCHEMA_VERSION = "2.4";
-
- // EclipseLink 2.4 specific nodes
- String CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE = "database-change-notification-type";
- String CACHE_INDEX = "cache-index";
- String CACHE_INDEX__COLUMN_NAME = "column-name";
- String DELETE_ALL = "delete-all";
- String MULTITENANT__INCLUDE_CRITERIA = "include-criteria";
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java
deleted file mode 100644
index f882e85117..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package
- * @generated
- */
-public class EclipseLinkOrmV2_4Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_4Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_4Factory init()
- {
- try
- {
- EclipseLinkOrmV2_4Factory theEclipseLinkOrmV2_4Factory = (EclipseLinkOrmV2_4Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_4.xmi");
- if (theEclipseLinkOrmV2_4Factory != null)
- {
- return theEclipseLinkOrmV2_4Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_4Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_4Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_4Package.DATABASE_CHANGE_NOTIFICATION_TYPE:
- return createDatabaseChangeNotificationTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_4Package.DATABASE_CHANGE_NOTIFICATION_TYPE:
- return convertDatabaseChangeNotificationTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DatabaseChangeNotificationType createDatabaseChangeNotificationTypeFromString(EDataType eDataType, String initialValue)
- {
- DatabaseChangeNotificationType result = DatabaseChangeNotificationType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertDatabaseChangeNotificationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_4Package getEclipseLinkOrmV2_4Package()
- {
- return (EclipseLinkOrmV2_4Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_4Package getPackage()
- {
- return EclipseLinkOrmV2_4Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_4Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java
deleted file mode 100644
index 014b58d70d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java
+++ /dev/null
@@ -1,1099 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_4Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_4";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_4.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_4Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4 <em>Xml Multitenant 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4()
- * @generated
- */
- public static final int XML_MULTITENANT_24 = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4 <em>Xml Element Collection 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_24 = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4 <em>Xml One To Many 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_24 = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4 <em>Xml Entity 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4()
- * @generated
- */
- public static final int XML_ENTITY_24 = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4 <em>Xml Basic 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4()
- * @generated
- */
- public static final int XML_BASIC_24 = 0;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4 <em>Xml Cache 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4()
- * @generated
- */
- public static final int XML_CACHE_24 = 1;
-
- /**
- * The feature id for the '<em><b>Database Change Notification Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cache 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4 <em>Xml Cache Index 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4()
- * @generated
- */
- public static final int XML_CACHE_INDEX_24 = 2;
-
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX_24__COLUMN_NAMES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cache Index 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_24__DELETE_ALL = 0;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Entity 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4 <em>Xml Id 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4()
- * @generated
- */
- public static final int XML_ID_24 = 5;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Id 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4 <em>Xml Mapped Superclass 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_24 = 6;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_24__INCLUDE_CRITERIA = 0;
-
- /**
- * The number of structural features of the '<em>Xml Multitenant 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_24__DELETE_ALL = 0;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType <em>Database Change Notification Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getDatabaseChangeNotificationType()
- * @generated
- */
- public static final int DATABASE_CHANGE_NOTIFICATION_TYPE = 9;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenant_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCache_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheIndex_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlId_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum databaseChangeNotificationTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_4Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_4Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_4Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_4Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_4Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_4Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_4Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_4Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_4Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_4Package.eNS_URI, theEclipseLinkOrmV2_4Package);
- return theEclipseLinkOrmV2_4Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4 <em>Xml Multitenant 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4
- * @generated
- */
- public EClass getXmlMultitenant_2_4()
- {
- return xmlMultitenant_2_4EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria <em>Include Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Include Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria()
- * @see #getXmlMultitenant_2_4()
- * @generated
- */
- public EAttribute getXmlMultitenant_2_4_IncludeCriteria()
- {
- return (EAttribute)xmlMultitenant_2_4EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4 <em>Xml Element Collection 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4
- * @generated
- */
- public EClass getXmlElementCollection_2_4()
- {
- return xmlElementCollection_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll <em>Delete All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Delete All</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll()
- * @see #getXmlElementCollection_2_4()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_4_DeleteAll()
- {
- return (EAttribute)xmlElementCollection_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4 <em>Xml One To Many 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4
- * @generated
- */
- public EClass getXmlOneToMany_2_4()
- {
- return xmlOneToMany_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll <em>Delete All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Delete All</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll()
- * @see #getXmlOneToMany_2_4()
- * @generated
- */
- public EAttribute getXmlOneToMany_2_4_DeleteAll()
- {
- return (EAttribute)xmlOneToMany_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4 <em>Xml Entity 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4
- * @generated
- */
- public EClass getXmlEntity_2_4()
- {
- return xmlEntity_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex()
- * @see #getXmlEntity_2_4()
- * @generated
- */
- public EReference getXmlEntity_2_4_CacheIndex()
- {
- return (EReference)xmlEntity_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4 <em>Xml Basic 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4
- * @generated
- */
- public EClass getXmlBasic_2_4()
- {
- return xmlBasic_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex()
- * @see #getXmlBasic_2_4()
- * @generated
- */
- public EReference getXmlBasic_2_4_CacheIndex()
- {
- return (EReference)xmlBasic_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4 <em>Xml Cache 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4
- * @generated
- */
- public EClass getXmlCache_2_4()
- {
- return xmlCache_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Database Change Notification Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType()
- * @see #getXmlCache_2_4()
- * @generated
- */
- public EAttribute getXmlCache_2_4_DatabaseChangeNotificationType()
- {
- return (EAttribute)xmlCache_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4 <em>Xml Cache Index 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache Index 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4
- * @generated
- */
- public EClass getXmlCacheIndex_2_4()
- {
- return xmlCacheIndex_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4#getColumnNames <em>Column Names</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Column Names</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4#getColumnNames()
- * @see #getXmlCacheIndex_2_4()
- * @generated
- */
- public EAttribute getXmlCacheIndex_2_4_ColumnNames()
- {
- return (EAttribute)xmlCacheIndex_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4 <em>Xml Id 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4
- * @generated
- */
- public EClass getXmlId_2_4()
- {
- return xmlId_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex()
- * @see #getXmlId_2_4()
- * @generated
- */
- public EReference getXmlId_2_4_CacheIndex()
- {
- return (EReference)xmlId_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4 <em>Xml Mapped Superclass 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_4()
- {
- return xmlMappedSuperclass_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex()
- * @see #getXmlMappedSuperclass_2_4()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_4_CacheIndex()
- {
- return (EReference)xmlMappedSuperclass_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType <em>Database Change Notification Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Database Change Notification Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @generated
- */
- public EEnum getDatabaseChangeNotificationType()
- {
- return databaseChangeNotificationTypeEEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_4Factory getEclipseLinkOrmV2_4Factory()
- {
- return (EclipseLinkOrmV2_4Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlBasic_2_4EClass = createEClass(XML_BASIC_24);
- createEReference(xmlBasic_2_4EClass, XML_BASIC_24__CACHE_INDEX);
-
- xmlCache_2_4EClass = createEClass(XML_CACHE_24);
- createEAttribute(xmlCache_2_4EClass, XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE);
-
- xmlCacheIndex_2_4EClass = createEClass(XML_CACHE_INDEX_24);
- createEAttribute(xmlCacheIndex_2_4EClass, XML_CACHE_INDEX_24__COLUMN_NAMES);
-
- xmlElementCollection_2_4EClass = createEClass(XML_ELEMENT_COLLECTION_24);
- createEAttribute(xmlElementCollection_2_4EClass, XML_ELEMENT_COLLECTION_24__DELETE_ALL);
-
- xmlEntity_2_4EClass = createEClass(XML_ENTITY_24);
- createEReference(xmlEntity_2_4EClass, XML_ENTITY_24__CACHE_INDEX);
-
- xmlId_2_4EClass = createEClass(XML_ID_24);
- createEReference(xmlId_2_4EClass, XML_ID_24__CACHE_INDEX);
-
- xmlMappedSuperclass_2_4EClass = createEClass(XML_MAPPED_SUPERCLASS_24);
- createEReference(xmlMappedSuperclass_2_4EClass, XML_MAPPED_SUPERCLASS_24__CACHE_INDEX);
-
- xmlMultitenant_2_4EClass = createEClass(XML_MULTITENANT_24);
- createEAttribute(xmlMultitenant_2_4EClass, XML_MULTITENANT_24__INCLUDE_CRITERIA);
-
- xmlOneToMany_2_4EClass = createEClass(XML_ONE_TO_MANY_24);
- createEAttribute(xmlOneToMany_2_4EClass, XML_ONE_TO_MANY_24__DELETE_ALL);
-
- // Create enums
- databaseChangeNotificationTypeEEnum = createEEnum(DATABASE_CHANGE_NOTIFICATION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlBasic_2_4EClass, XmlBasic_2_4.class, "XmlBasic_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlBasic_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCache_2_4EClass, XmlCache_2_4.class, "XmlCache_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCache_2_4_DatabaseChangeNotificationType(), this.getDatabaseChangeNotificationType(), "databaseChangeNotificationType", "", 0, 1, XmlCache_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheIndex_2_4EClass, XmlCacheIndex_2_4.class, "XmlCacheIndex_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCacheIndex_2_4_ColumnNames(), theXMLTypePackage.getString(), "columnNames", null, 0, -1, XmlCacheIndex_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_4EClass, XmlElementCollection_2_4.class, "XmlElementCollection_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlElementCollection_2_4_DeleteAll(), theXMLTypePackage.getBoolean(), "deleteAll", null, 0, 1, XmlElementCollection_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_2_4EClass, XmlEntity_2_4.class, "XmlEntity_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlEntity_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlId_2_4EClass, XmlId_2_4.class, "XmlId_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlId_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlId_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_4EClass, XmlMappedSuperclass_2_4.class, "XmlMappedSuperclass_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlMappedSuperclass_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultitenant_2_4EClass, XmlMultitenant_2_4.class, "XmlMultitenant_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMultitenant_2_4_IncludeCriteria(), theXMLTypePackage.getBooleanObject(), "includeCriteria", null, 0, 1, XmlMultitenant_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_4EClass, XmlOneToMany_2_4.class, "XmlOneToMany_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToMany_2_4_DeleteAll(), theXMLTypePackage.getBoolean(), "deleteAll", null, 0, 1, XmlOneToMany_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(databaseChangeNotificationTypeEEnum, DatabaseChangeNotificationType.class, "DatabaseChangeNotificationType");
- addEEnumLiteral(databaseChangeNotificationTypeEEnum, DatabaseChangeNotificationType.NONE);
- addEEnumLiteral(databaseChangeNotificationTypeEEnum, DatabaseChangeNotificationType.INVALIDATION);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4 <em>Xml Multitenant 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4()
- * @generated
- */
- public static final EClass XML_MULTITENANT_24 = eINSTANCE.getXmlMultitenant_2_4();
-
- /**
- * The meta object literal for the '<em><b>Include Criteria</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTITENANT_24__INCLUDE_CRITERIA = eINSTANCE.getXmlMultitenant_2_4_IncludeCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4 <em>Xml Element Collection 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_24 = eINSTANCE.getXmlElementCollection_2_4();
-
- /**
- * The meta object literal for the '<em><b>Delete All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_24__DELETE_ALL = eINSTANCE.getXmlElementCollection_2_4_DeleteAll();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4 <em>Xml One To Many 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_24 = eINSTANCE.getXmlOneToMany_2_4();
-
- /**
- * The meta object literal for the '<em><b>Delete All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_MANY_24__DELETE_ALL = eINSTANCE.getXmlOneToMany_2_4_DeleteAll();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4 <em>Xml Entity 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4()
- * @generated
- */
- public static final EClass XML_ENTITY_24 = eINSTANCE.getXmlEntity_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_24__CACHE_INDEX = eINSTANCE.getXmlEntity_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4 <em>Xml Basic 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4()
- * @generated
- */
- public static final EClass XML_BASIC_24 = eINSTANCE.getXmlBasic_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_24__CACHE_INDEX = eINSTANCE.getXmlBasic_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4 <em>Xml Cache 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4()
- * @generated
- */
- public static final EClass XML_CACHE_24 = eINSTANCE.getXmlCache_2_4();
-
- /**
- * The meta object literal for the '<em><b>Database Change Notification Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE = eINSTANCE.getXmlCache_2_4_DatabaseChangeNotificationType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4 <em>Xml Cache Index 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4()
- * @generated
- */
- public static final EClass XML_CACHE_INDEX_24 = eINSTANCE.getXmlCacheIndex_2_4();
-
- /**
- * The meta object literal for the '<em><b>Column Names</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_INDEX_24__COLUMN_NAMES = eINSTANCE.getXmlCacheIndex_2_4_ColumnNames();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4 <em>Xml Id 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4()
- * @generated
- */
- public static final EClass XML_ID_24 = eINSTANCE.getXmlId_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID_24__CACHE_INDEX = eINSTANCE.getXmlId_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4 <em>Xml Mapped Superclass 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_24 = eINSTANCE.getXmlMappedSuperclass_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_24__CACHE_INDEX = eINSTANCE.getXmlMappedSuperclass_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType <em>Database Change Notification Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getDatabaseChangeNotificationType()
- * @generated
- */
- public static final EEnum DATABASE_CHANGE_NOTIFICATION_TYPE = eINSTANCE.getDatabaseChangeNotificationType();
-
- }
-
-} //EclipseLinkOrmV2_4Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java
deleted file mode 100644
index b21c332b05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasic_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlBasic_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java
deleted file mode 100644
index 86a129458b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache Index 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4#getColumnNames <em>Column Names</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCacheIndex_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- EList<String> getColumnNames();
-
-} // XmlCacheIndex_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java
deleted file mode 100644
index 745c03b914..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache2 4</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCache_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Database Change Notification Type</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Database Change Notification Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #setDatabaseChangeNotificationType(DatabaseChangeNotificationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4_DatabaseChangeNotificationType()
- * @model default=""
- * @generated
- */
- DatabaseChangeNotificationType getDatabaseChangeNotificationType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #getDatabaseChangeNotificationType()
- * @generated
- */
- void setDatabaseChangeNotificationType(DatabaseChangeNotificationType value);
-
-} // XmlCache2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java
deleted file mode 100644
index 8564b2b1ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll <em>Delete All</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlElementCollection_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isDeleteAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- void setDeleteAll(boolean value);
-
-} // XmlElementCollection_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java
deleted file mode 100644
index 0d7a419336..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntity_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlEntity_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java
deleted file mode 100644
index 2e108a7a81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Id 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlId_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlId_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java
deleted file mode 100644
index 823e4f8eee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMappedSuperclass_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlMappedSuperclass_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java
deleted file mode 100644
index a8c7b5d69f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria <em>Include Criteria</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMultitenant_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Include Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Include Criteria</em>' attribute.
- * @see #setIncludeCriteria(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4_IncludeCriteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getIncludeCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Include Criteria</em>' attribute.
- * @see #getIncludeCriteria()
- * @generated
- */
- void setIncludeCriteria(Boolean value);
-
-} // XmlMultitenant_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java
deleted file mode 100644
index 87cd3826bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll <em>Delete All</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlOneToMany_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isDeleteAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- void setDeleteAll(boolean value);
-
-} // XmlOneToMany_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath
deleted file mode 100644
index 8f257414e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.project b/jpa/plugins/org.eclipse.jpt.jpa.gen/.project
deleted file mode 100644
index 3e6e8c6148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.gen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 051d6a3c89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:26 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF
deleted file mode 100644
index b6207bb3c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,26 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.gen
-Bundle-Version: 2.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.jpa.gen.internal;x-internal:=true,
- org.eclipse.jpt.jpa.gen.internal.util;x-internal:=true
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.apache.commons.collections;bundle-version="3.2.0",
- org.apache.commons.lang;bundle-version="2.1.0",
- org.apache.oro;bundle-version="2.0.8",
- org.apache.velocity;bundle-version="1.5.0",
- org.jdom;bundle-version="1.0.0",
- org.eclipse.wst.common.emf;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)"
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/about.html b/jpa/plugins/org.eclipse.jpt.jpa.gen/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties
deleted file mode 100644
index 4fe875d02e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties,\
- templates/
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml
deleted file mode 100644
index ff5a350e51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.gen"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpa.gen" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties
deleted file mode 100644
index 9537a25a08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Entity Gen
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties b/jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties
deleted file mode 100644
index db907a2472..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-PackageGenerator_taskName=Generate Entities
-GenScope_taskName=Build Database Model
-EntityGenerator_taskName=Generate Entity: {0}
-Error_Generating_Entities = Error Generating Entities
-
-Delete_Folder_Error = "The directory {0} could not be deleted."
-Delete_File_Error = "The file {0} could not be deleted."
-File_Read_Only_Error= "The file {0} could not be modified because write access is denied.\nPlease make sure that the file is not marked as readonly in the file system."
-
-Templates_notFound = Unable to find JPA entities generation templates in plugin \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java
deleted file mode 100644
index 889b4a7d6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Represents an ORM association.
- * There are two types of associations:
- * <ul><li>simple association: An association between two database tables.
- * The <em>referrer</code> table is the one containing the foreign key
- * , the <em>referenced</code> table is the other party.<br>
- *
- * <li>many to many association: An association between two tables joined by
- * a <em>join table</em>.
- * In the example AUTHOR, BOOK, AUTHOR_BOOK, The referrer and referenced are
- * AUTHOR and BOOK, and the join table is AUTHOR_BOOK.
- * </ul>
- *
- */
-public class Association implements java.io.Serializable
-{
- private final static long serialVersionUID = 2;
-
- public static final String MANY_TO_ONE = "many-to-one";
- public static final String MANY_TO_MANY = "many-to-many";
- public static final String ONE_TO_ONE = "one-to-one";
- public static final String ONE_TO_MANY = "one-to-many";
-
- public static final String BI_DI = "bi-di";
- public static final String NORMAL_DI = "normal-di"; //referrer->referenced
- public static final String OPPOSITE_DI = "opposite-di"; //referenced->referrer
-
- private transient ORMGenCustomizer mCustomizer;
- private String mReferrerTableName;
- private String mReferencedTableName;
- private String mJoinTableName;
-
- private List<String> mReferrerColNames; /*String objects*/
- private List<String> mReferencedColNames; /*String objects*/
- private List<String> mReferrerJoinColNames; /*String objects*/
- private List<String> mReferencedJoinColNames; /*String objects*/
-
- private transient List<ORMGenColumn> mReferrerCols; /*ORMGenColumn objects*/
- private transient List<ORMGenColumn> mReferencedCols; /*ORMGenColumn objects*/
- private transient List<ORMGenColumn> mReferrerJoinCols; /*ORMGenColumn objects*/
- private transient List<ORMGenColumn> mReferencedJoinCols; /*ORMGenColumn objects*/
-
- private String mCardinality;
- private String mDirectionality;
- private byte mFlags = GENERATED;
-
- private AssociationRole mReferrerRole;
- private AssociationRole mReferencedRole;
-
- private transient ForeignKey mForeignKey;
-
- /*constants for mFlags*/
- /*whether the association should be generated*/
- private static final byte GENERATED = 1 << 0;
- /*whether the association is custom (i.e is not auto computed from foreign keys relationships).*/
- private static final byte CUSTOM = 1 << 1;
-
- /**
- * The simple association constructor.
- * The 2 tables are joined when the values of each column in
- * referrerColNames match its corresponding column in referencedColNames.
- *
- * @param referrerTableName The "foreign key" table.
- * @param referrerColNames The column names in the referrer table.
- * @param referencedTableName The "primary key" table.
- * @param referencedColNames The column names in the referenced table.
- */
- public Association(ORMGenCustomizer customizer, String referrerTableName, List<String> referrerColNames
- , String referencedTableName, List<String> referencedColNames) {
- super();
-
- mCustomizer = customizer;
- mReferrerTableName = referrerTableName;
- mReferencedTableName = referencedTableName;
- mReferrerColNames = referrerColNames;
- mReferencedColNames = referencedColNames;
-
- mCardinality = MANY_TO_ONE;
- mDirectionality = BI_DI;
-
- setCustom(true);
- }
- /**
- * The many to many constructor.
- * The 2 tables are joined when the values of each column in
- * referrerColNames match its corresponding column in referrerJoinColNames
- * , and each column in referencedColNames match its corresponding column in referencedJoinColNames.
- *
- */
- public Association(ORMGenCustomizer customizer, String referrerTableName, List<String> referrerColNames
- , String referencedTableName, List<String> referencedColNames
- , String joinTableName, List<String> referrerJoinColNames, List<String> referencedJoinColNames) {
- super();
-
- mCustomizer = customizer;
- mReferrerTableName = referrerTableName;
- mReferencedTableName = referencedTableName;
- mReferrerColNames = referrerColNames;
- mReferencedColNames = referencedColNames;
- mJoinTableName = joinTableName;
- mReferrerJoinColNames = referrerJoinColNames;
- mReferencedJoinColNames = referencedJoinColNames;
-
- mCardinality = MANY_TO_MANY;
- mDirectionality = BI_DI;
-
- setCustom(true);
- }
- /**
- * Empty constructor needed by the deserialization (should not be used otherwise).
- */
- public Association() {
- }
- /**
- * Computes the cardinality basedon the forign key definitions.
- */
- public void computeCardinality() {
- /*by default the association is many-to-one unless the foreign key
- * is also the primary key, in which case it is a one-to-one.*/
- mCardinality = MANY_TO_ONE;
-
- List<ORMGenColumn> referrerCols = getReferrerColumns();
- List<ORMGenColumn> pkCols = getReferrerTable().getPrimaryKeyColumns();
- if (pkCols.size() == referrerCols.size()) {
- boolean isFkPk = true;
- for (int i = 0, n = pkCols.size(); i < n; ++i) {
- if (!((ORMGenColumn)pkCols.get(i)).getName().equals(((ORMGenColumn)referrerCols.get(i)).getName())) {
- isFkPk = false;
- break;
- }
- }
- if (isFkPk) {
- mCardinality = ONE_TO_ONE;
- }
- }
-
- setCustom(false);
- }
- /**
- * Called after the asscociations are deserialized to attach
- * the customizer object.
- */
- protected void restore(ORMGenCustomizer customizer) {
- mCustomizer = customizer;
-
- if (mReferrerRole != null) {
- mReferrerRole.restore(this);
- }
- if (mReferencedRole != null) {
- mReferencedRole.restore(this);
- }
- }
- public ORMGenTable getReferrerTable() {
- return mCustomizer.getTable(mReferrerTableName);
- }
- public String getReferrerTableName() {
- return mReferrerTableName;
- }
- public ORMGenTable getReferencedTable() {
- return mCustomizer.getTable(mReferencedTableName);
- }
- public String getReferencedTableName() {
- return mReferencedTableName;
- }
- public ORMGenTable getJoinTable() {
- return mCustomizer.getTable(mJoinTableName);
- }
- public String getJoinTableName() {
- return mJoinTableName;
- }
- /**
- * Returns the <code>ORMGenColumn</code> objects for the referrer
- * columns.
- */
- public List<ORMGenColumn> getReferrerColumns() {
- if (mReferrerCols == null) {
- ORMGenTable referrerTable = getReferrerTable();
- mReferrerCols = referrerTable.getColumnsByNames(mReferrerColNames);
- }
- return mReferrerCols;
- }
- public List<String> getReferrerColumnNames() {
- return mReferrerColNames;
- }
- /**
- * Returns the <code>ORMGenColumn</code> objects for the referenced
- * columns.
- */
- public List<ORMGenColumn> getReferencedColumns() {
- if (mReferencedCols == null) {
- mReferencedCols = getReferencedTable().getColumnsByNames(mReferencedColNames);
- }
- return mReferencedCols;
- }
- public List<String> getReferencedColumnNames() {
- return mReferencedColNames;
- }
- public List<ORMGenColumn> getReferrerJoinColumns() {
- if (mReferrerJoinCols == null) {
- mReferrerJoinCols = getJoinTable().getColumnsByNames(mReferrerJoinColNames);
- }
- return mReferrerJoinCols;
- }
- public List<String> getReferrerJoinColumnNames() {
- return mReferrerJoinColNames;
- }
- public List<ORMGenColumn> getReferencedJoinColumns() {
- if (mReferencedJoinCols == null) {
- mReferencedJoinCols = getJoinTable().getColumnsByNames(mReferencedJoinColNames);
- }
- return mReferencedJoinCols;
- }
- public List<String> getReferencedJoinColumnNames() {
- return mReferencedJoinColNames;
- }
- /**
- * Returns the association cardinality, one of {@link #MANY_TO_ONE}|{@link #MANY_TO_MANY}
- * |{@link #ONE_TO_ONE}|{@link #ONE_TO_MANY}
- */
- public String getCardinality() {
- return mCardinality;
- }
- public void setCardinality(String cardinality) {
- assert(cardinality.equals(MANY_TO_ONE) || cardinality.equals(MANY_TO_MANY) || cardinality.equals(ONE_TO_ONE) || cardinality.equals(ONE_TO_MANY));
- mCardinality = cardinality;
- }
- /**
- * Returns the association directionality, one of {@link #BI_DI}|{@link #NORMAL_DI}
- * |{@link #OPPOSITE_DI}
- */
- public String getDirectionality() {
- return mDirectionality;
- }
- public void setDirectionality(String dir) {
- assert(dir.equals(BI_DI) || dir.equals(NORMAL_DI) || dir.equals(OPPOSITE_DI));
- if (!dir.equals(mDirectionality)) {
- mDirectionality = dir;
-
- if (dir.equals(NORMAL_DI)) {
- mReferencedRole = null;
- } else if (dir.equals(OPPOSITE_DI)) {
- mReferrerRole = null;
- }
- }
- }
-
- /**
- * Tests whether this association is bidirectional.
- * This is a shortcut for <code>getDirectionality().equals(BI_DI)</code>.
- */
- public boolean isBidirectional() {
- return mDirectionality.equals(BI_DI);
- }
- /**
- * Returns true of this association should be generated.
- */
- public boolean isGenerated() {
- return (mFlags & GENERATED) != 0;
- }
- public void setGenerated(boolean generated) {
- if (generated != isGenerated()) {
- if (generated) {
- mFlags |= GENERATED;
- } else {
- mFlags &= ~GENERATED;
- }
- mReferrerRole = mReferencedRole = null;
- }
- }
- /**
- * Returns true of this association is custom (i.e is not auto computed from foreign keys relationships).
- */
- public boolean isCustom() {
- return (mFlags & CUSTOM) != 0;
- }
- public void setCustom(boolean custom) {
- if (custom) {
- mFlags |= CUSTOM;
- } else {
- mFlags &= ~CUSTOM;
- }
- }
- /**
- * Returns the association role for the referrer side, or null
- * if none (i.e if the directionality does not include it).
- */
- public AssociationRole getReferrerRole() {
- if (mReferrerRole == null && isGenerated()) {
- if (!getDirectionality().equals(OPPOSITE_DI)) { //BI_DI or NORMAL_DI
- mReferrerRole = new AssociationRole(this, true/*isReferrerEnd*/);
- }
- }
- return mReferrerRole;
- }
- /**
- * Returns the association role for the referenced side, or null
- * if none (i.e if the directionality does not include it).
- */
- public AssociationRole getReferencedRole() {
- if (mReferencedRole == null && isGenerated()) {
- if (!getDirectionality().equals(Association.NORMAL_DI)) { //BI_DI or OPPOSITE_DI
- mReferencedRole = new AssociationRole(this, false/*isReferrerEnd*/);
- }
- }
- return mReferencedRole;
- }
- /**
- * Tests whether this association is valid (valid table and column names).
- */
- protected boolean isValid(){
- if (!isValidTableAndColumns(mReferrerTableName, mReferrerColNames)
- || !isValidTableAndColumns(mReferencedTableName, mReferencedColNames)) {
- return false;
- }
- if (mJoinTableName != null) {
- if (!isValidTableAndColumns(mJoinTableName, mReferrerJoinColNames)
- || !isValidTableAndColumns(mJoinTableName, mReferencedJoinColNames)) {
- return false;
- }
- }
- return true;
- }
- private boolean isValidTableAndColumns(String tableName, List<String> columnNames) {
- ORMGenTable table = mCustomizer.getTable(tableName);
- if (table == null) {
- return false;
- }
- for (int i = 0, n = columnNames.size(); i < n; ++i) {
- String colName = (String)columnNames.get(i);
- if (table.getColumnByName(colName) == null) {
- return false;
- }
- }
- return true;
- }
-
- public void setForeignKey(ForeignKey foreignKey) {
- this.mForeignKey = foreignKey;
-
- }
- public ForeignKey getForeignKey(){
- return this.mForeignKey;
- };
- public boolean equals(Object obj) {
- if( this == obj )
- return true;
- if( obj instanceof Association ){
- Association association2 = (Association)obj;
- if (!this.getReferrerTableName().equals(association2.getReferrerTableName())
- || !this.getReferencedTableName().equals(association2.getReferencedTableName())
- || !StringUtil.equalObjects(this.getJoinTableName(), association2.getJoinTableName())
- || !this.getReferrerColumnNames().equals(association2.getReferrerColumnNames())
- || !this.getReferencedColumnNames().equals(association2.getReferencedColumnNames())
- ) {
- return false;
- }
- /*the 2 association have the same referrer, referenced and join table*/
- //If MTO or OTM association
- if (this.getJoinTableName() == null) {
- return true;
- }
- if (this.getReferrerJoinColumnNames().equals(association2.getReferrerJoinColumnNames())
- && this.getReferencedJoinColumnNames().equals(association2.getReferencedJoinColumnNames())) {
- return true;
- }
- }
- return false;
- }
- public String toString(){
- return mReferrerTableName + " " + mCardinality + " " + mReferencedTableName ;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java
deleted file mode 100644
index a9d734439a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Represents an association role (the referrer or referenced role).
- *
- */
-public class AssociationRole implements java.io.Serializable
-{
- private transient Association mAssociation; //transient: see restore
- private boolean mIsReferrerRole;
- private String mPropertyName;
- private String mCascade;
-
- private final static long serialVersionUID = 1;
-
- AssociationRole(Association association, boolean isReferrerRole) {
- super();
-
- mAssociation = association;
- mIsReferrerRole = isReferrerRole;
- }
-
- /**
- * Empty constructor needed by the deserialization (should not be used otherwise).
- */
- public AssociationRole() {
- }
-
- /**
- * Called after the asscociations are deserialized to attach
- * the customizer object.
- */
- protected void restore(Association association) {
- mAssociation = association;
- }
-
- public Association getAssociation() {
- return mAssociation;
- }
-
- public boolean isReferrerRole() {
- return mIsReferrerRole;
- }
-
- /**
- * Returns the opposite role or null if the association
- * is not bi directional.
- */
- public AssociationRole getOppositeRole() {
- Association association = getAssociation();
- if (!association.getDirectionality().equals(Association.BI_DI)) {
- return null;
- }
- if (isReferrerRole()) {
- return association.getReferencedRole();
- } else {
- return association.getReferrerRole();
- }
- }
-
- /**
- * Returns the association cardinality, one of {@link #MANY_TO_ONE}|{@link #MANY_TO_MANY}
- * |{@link #ONE_TO_ONE}|{@link #ONE_TO_MANY}
- */
- public String getCardinality() {
- String type = mAssociation.getCardinality();
- if (!mIsReferrerRole) {
- if (type.equals(Association.ONE_TO_MANY)) {
- type = Association.MANY_TO_ONE;
- } else if (type.equals(Association.MANY_TO_ONE)) {
- type = Association.ONE_TO_MANY;
- }
- }
- return type;
- }
-
- public ORMGenTable getReferrerTable() {
- if (mIsReferrerRole) {
- return mAssociation.getReferrerTable();
- } else {
- return mAssociation.getReferencedTable();
- }
- }
-
- public List<ORMGenColumn> getReferrerColumns(){
- if (mIsReferrerRole) {
- return mAssociation.getReferrerColumns();
- } else {
- return mAssociation.getReferencedColumns();
- }
- }
-
- /**
- * Returns the referenced column corresponding to a referrer column.
- */
- public ORMGenColumn getReferencedColumn(String referrerColumn) {
- boolean hasJoinTable = mAssociation.getJoinTable() != null;
- List<ORMGenColumn> referrerColumns = getReferrerColumns();
- for (int i = 0, n = referrerColumns.size(); i < n; ++i) {
- ORMGenColumn column = referrerColumns.get(i);
- if (column.getName().equals(referrerColumn)) {
- if (hasJoinTable) {
- return getReferrerJoinColumns().get(i);
- } else {
- return getReferencedColumns().get(i);
- }
- }
- }
- assert(false);
- return null;
- }
-
- /**
- * Returns the referrer column corresponding to a referenced column.
- */
- public ORMGenColumn getReferrerColumn(String referencedColumn) {
- boolean hasJoinTable = mAssociation.getJoinTable() != null;
- List<ORMGenColumn> referencedColumns = getReferencedColumns();
- for (int i = 0, n = referencedColumns.size(); i < n; ++i) {
- ORMGenColumn column = referencedColumns.get(i);
- if (column.getName().equals(referencedColumn)) {
- if (hasJoinTable) {
- return getReferencedJoinColumns().get(i);
- } else {
- return getReferrerColumns().get(i);
- }
- }
- }
- assert(false);
- return null;
- }
-
- public ORMGenTable getReferencedTable() {
- if (mIsReferrerRole) {
- return mAssociation.getReferencedTable();
- } else {
- return mAssociation.getReferrerTable();
- }
- }
-
- public List<ORMGenColumn> getReferencedColumns() {
- if (mIsReferrerRole) {
- return mAssociation.getReferencedColumns();
- } else {
- return mAssociation.getReferrerColumns();
- }
- }
-
- public List<ORMGenColumn> getReferrerJoinColumns() {
- if (mIsReferrerRole) {
- return mAssociation.getReferrerJoinColumns();
- } else {
- return mAssociation.getReferencedJoinColumns();
- }
- }
- public List<ORMGenColumn> getReferencedJoinColumns() {
- if (mIsReferrerRole) {
- return mAssociation.getReferencedJoinColumns();
- } else {
- return mAssociation.getReferrerJoinColumns();
- }
- }
-
- /**
- * Returns the name that should be used by the generator for
- * the property corresponding to this role.
- */
- public String getPropertyName() {
- if (mPropertyName != null) { //if the user explicitly set it then don't be too smart
- return mPropertyName;
- }
- return getDefaultPropertyName();
- }
-
- private String getDefaultPropertyName() {
- String propName = "";
- ORMGenTable referrerTable = getReferrerTable();
- ORMGenTable referencedTable = getReferencedTable();
-
- boolean isSingular = isSingular();
- propName = referencedTable.getVarName(isSingular);
-
- List<AssociationRole> clashingRoles = new java.util.ArrayList<AssociationRole>(); //roles with our same referrer and referenced tables (i.e would yield the same property name in the same bean)
- /*make sure there is no role with the same name.*/
- for (Iterator<AssociationRole> iter = referrerTable.getAssociationRoles().iterator(); iter.hasNext(); ) {
- AssociationRole role = iter.next();
- if (role.getReferrerTable().getName().equals(referrerTable.getName())
- && role.getReferencedTable().getName().equals(referencedTable.getName())
- && role.isSingular() == isSingular) {
- clashingRoles.add(role);
- }
- }
- if (clashingRoles.size() > 1) {
- int index = clashingRoles.indexOf(this);
- assert(index >= 0);
- propName += index+1;
- }
-
- /*make sure there is no column with the same name.*/
- for (Iterator<ORMGenColumn> iter = referrerTable.getColumns().iterator(); iter.hasNext(); ) {
- ORMGenColumn column = iter.next();
- if (column.getPropertyName().equals(propName)) {
- String prefix = isSingular ? "Bean" : "Set";
- propName += prefix;
- break;
- }
- }
-
- return propName;
- }
-
- private boolean isSingular() {
- String cardinality = getCardinality();
- return cardinality.equals(Association.ONE_TO_ONE) || cardinality.equals(Association.MANY_TO_ONE);
- }
-
- /**
- * Changes the name that should be used by the generator for
- * the property corresponding to this role.
- * If the argument name is null or empty string then the
- * default computed name is used.
- */
- public void setPropertyName(String name) {
- if (name != null && name.length() == 0) {
- name = null;
- }
- if (name != null && name.equals(getDefaultPropertyName())) {
- name = null;
- }
- mPropertyName = name;
- }
-
- /**
- * Returns the cascade value for this role, or null if none.
- */
- public String getCascade() {
- return mCascade;
- }
-
- public void setCascade(String cascade) {
- if (cascade != null && cascade.length() == 0) {
- cascade = null;
- }
- mCascade = cascade;
- }
-
- /**
- * Returns a descriptive string used in a comment in the generated
- * file (from the Velocity template).
- */
- public String getDescription() {
- //<!-- $directionality $cardinality association to $referencedClassName -->
- String directionality;
- if (getAssociation().getDirectionality().equals(Association.BI_DI)) {
- directionality = "bi-directional";
- } else {
- directionality = "uni-directional";
- }
- return directionality + " " + getAssociation().getCardinality() + " association to " + getReferencedTable().getClassName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java
deleted file mode 100644
index 6819f98b5d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.io.File;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Default implementation of ORMGenCustomizer according to JPA specification for
- * entity generation.
- *
- * This is used to retrieve/change the properties from the wizard and is also
- * passed as a context object to Velocity.
- */
-public class BaseEntityGenCustomizer extends ORMGenCustomizer
- implements java.io.Serializable
-{
- private final static long serialVersionUID = 1;
-
- /* mapping kinds */
- private static final String BASIC_MAPPING_KIND = "basic"; //$NON-NLS-1$
- private static final String ID_MAPPING_KIND = "id"; //$NON-NLS-1$
- private static final String VERSION_MAPPING_KIND = "version"; //$NON-NLS-1$
-
- /*
- * the strings for generator names. These appear in a combo box and used by
- * the Velocity template processing.
- */
- private static final String AUTO_GENERATOR = "auto"; //$NON-NLS-1$
- private static final String NONE_GENERATOR = "none"; //$NON-NLS-1$
- private static final String IDENTITY_GENERATOR = "identity"; //$NON-NLS-1$
- private static final String SEQUENCE_GENERATOR = "sequence"; //$NON-NLS-1$
- private static final String TABLE_GENERATOR = "table"; //$NON-NLS-1$
-
- public BaseEntityGenCustomizer() {
- super();
- }
-
- @Override
- public void init(File file, Schema schema) {
- super.init(file, schema);
- }
-
- // -----------------------------------------
- // ------ ORMGenCustomizer methods
- // -----------------------------------------
- @Override
- public List<String> getAllIdGenerators() {
- List<String> result = new java.util.ArrayList<String>(5);
- /* add in the order in which they would appear in the combo */
- result.add(AUTO_GENERATOR);
- result.add(IDENTITY_GENERATOR);
- result.add(SEQUENCE_GENERATOR);
- result.add(TABLE_GENERATOR);
- result.add(NONE_GENERATOR);
- return result;
- }
-
- @Override
- public String getNoIdGenerator() {
- return NONE_GENERATOR;
- }
-
- @Override
- public String getIdentityIdGenerator() {
- return IDENTITY_GENERATOR;
- }
-
- @Override
- public Set<String> getSequenceIdGenerators() {
- Set<String> result = new java.util.HashSet<String>(3);
- result.add(SEQUENCE_GENERATOR);
- return result;
- }
-
- @Override
- public String getPropertyTypeFromColumn(Column column) {
- return DTPUtil.getJavaType(column);
- }
-
- @Override
- @SuppressWarnings("nls")
- public String[] getAllPropertyTypes() {
- /*
- * Java primitive types, wrapper of the primitive types ,
- * java.lang.String, java.math.BigInteger, java.math.BigDecimal,
- * java.util.Date, java.util.Calendar, java.sql.Date, java.sql.Time,
- * java.sql.Timestamp, byte[], Byte[], char[], Character[], enums, and
- * any other type that implements Serializable.
- */
- // return in the order that will be used in the combo
- return new String[] {
- "boolean",
- "Boolean",
- "byte",
- "Byte",
- "byte[]",
- "char",
- "char[]",
- "Character",
- "Character[]",
- "double",
- "Double",
- "float",
- "Float",
- "int",
- "Integer",
- "long",
- "Long",
- "Object",
- "short",
- "Short",
- "String",
- java.math.BigDecimal.class.getName(),
- java.math.BigInteger.class.getName(),
- java.util.Calendar.class.getName(),
- java.util.Date.class.getName(),
- java.sql.Date.class.getName(),
- java.sql.Time.class.getName(),
- java.sql.Timestamp.class.getName()
- };
- }
-
- @Override
- public String[] getAllMappingKinds() {
- return new String[] {
- BASIC_MAPPING_KIND, ID_MAPPING_KIND, VERSION_MAPPING_KIND
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getBasicMappingKind() {
- return BASIC_MAPPING_KIND;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getIdMappingKind() {
- return ID_MAPPING_KIND;
- }
-
- @Override
- public boolean editCascade(AssociationRole role) {
- return false;
- }
-
- @Override
- protected boolean manySideIsAssociationOwner() {
- return true;
- }
-
- // -----------------------------------------
- // ---- Velocity templates methods
- // -----------------------------------------
- /**
- * Returns the cascades annotation member value, or empty string if none.
- * Empty string is returned instead of null because Velocity does not like
- * null when used in #set.
- */
- public String genCascades(AssociationRole role) {
- List<String> cascades = StringUtil.strToList(role.getCascade(), ',', true/* trim */);
- if (cascades == null) {
- return ""; //$NON-NLS-1$
- }
- StringBuffer buffer = new StringBuffer();
- buffer.append( '{' );
- for (int i = 0, n = cascades.size(); i < n; ++i) {
- String cascade = cascades.get(i);
- String enumStr;
- if (cascade.equals(TagNames.ALL_CASCADE)) {
- enumStr = "CascadeType.ALL"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.PERSIST_CASCADE)) {
- enumStr = "CascadeType.PERSIST"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.MERGE_CASCADE)) {
- enumStr = "CascadeType.MERGE"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.REMOVE_CASCADE)) {
- enumStr = "CascadeType.REMOVE"; //$NON-NLS-1$
- }
- else {
- assert (cascade.equals(TagNames.REFRESH_CASCADE));
- enumStr = "CascadeType.REFRESH"; //$NON-NLS-1$
- }
- if (i != 0) {
- buffer.append(", "); //$NON-NLS-1$
- }
- buffer.append(enumStr);
- }
- buffer.append('}');
- return buffer.toString();
- }
-
- /**
- * Returns the fetch type annotation member value, or empty string if none.
- * Empty string is returned instead of null because Velocity does not like
- * null when used in #set.
- */
- @Override
- public String genFetch(ORMGenTable table) {
- String fetch = table.getDefaultFetch();
- if (fetch == null || ORMGenTable.DEFAULT_FETCH.equals(fetch)) {
- return ""; //$NON-NLS-1$
- }
- else if (fetch.equals(ORMGenTable.LAZY_FETCH)) {
- return "FetchType.LAZY"; //$NON-NLS-1$
- }
- else {
- return "FetchType.EAGER"; //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java
deleted file mode 100644
index 630142a316..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Table;
-
-
-/**
- * Provide a pluggable way to determine whether and how the entity generator
- * prints the names of various database objects.
- */
-public interface DatabaseAnnotationNameBuilder {
-
- /**
- * Given the name of an entity and the table to which it is mapped,
- * build and return a string to be used as the value for the entity's
- * Table annotation's 'name' element. Return null if the entity
- * maps to the table by default.
- */
- String buildTableAnnotationName(String entityName, Table table);
-
- /**
- * Given the name of an attribute (field or property) and the column
- * to which it is mapped,
- * build and return a string to be used as the value for the attribute's
- * Column annotation's 'name' element. Return null if the attribute
- * maps to the column by default.
- */
- String buildColumnAnnotationName(String attributeName, Column column);
-
- /**
- * Given the name of an attribute (field or property) and the
- * many-to-one or many-to-many foreign key to which it is mapped,
- * build and return a string to be used as the value for the attribute's
- * JoinColumn annotation's 'name' element. Return null if the attribute
- * maps to the join column by default.
- * The specified foreign key consists of a single column pair whose
- * referenced column is the single-column primary key of the foreign
- * key's referenced table.
- */
- String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey);
-
- /**
- * Build and return a string to be used as the value for a JoinColumn
- * annotation's 'name' or 'referencedColumnName' element.
- * This is called for many-to-one and many-to-many mappings when
- * the default join column name and/or referenced column name are/is
- * not applicable.
- * @see buildJoinColumnAnnotationName(String, ForeignKey)
- */
- String buildJoinColumnAnnotationName(Column column);
-
- /**
- * Build and return a string to be used as the value for a JoinTable
- * annotation's 'name' element.
- * This is called for many-to-many mappings when the default
- * join table name is not applicable.
- */
- String buildJoinTableAnnotationName(Table table);
-
-
- /**
- * The default implementation simple returns the database object's name,
- * unaltered.
- */
- final class Default implements DatabaseAnnotationNameBuilder {
- public static final DatabaseAnnotationNameBuilder INSTANCE = new Default();
- public static DatabaseAnnotationNameBuilder instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public String buildTableAnnotationName(String entityName, Table table) {
- return table.getName();
- }
- public String buildColumnAnnotationName(String attributeName, Column column) {
- return column.getName();
- }
- public String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey) {
- return foreignKey.getColumnPair().getBaseColumn().getName();
- }
- public String buildJoinColumnAnnotationName(Column column) {
- return column.getName();
- }
- public String buildJoinTableAnnotationName(Table table) {
- return table.getName();
- }
- @Override
- public String toString() {
- return "DatabaseAnnotationNameBuilder.Default"; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java
deleted file mode 100644
index 16073bc071..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali entity generation.
- */
-public class JptGenMessages {
-
- public static String PackageGenerator_taskName;
- public static String GenScope_taskName;
- public static String EntityGenerator_taskName;
- public static String Templates_notFound;
- public static String Error_Generating_Entities;
- public static String Delete_Folder_Error;
- public static String Delete_File_Error;
- public static String File_Read_Only_Error;
-
- private static final String BUNDLE_NAME = "jpt_gen"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptGenMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptGenMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java
deleted file mode 100644
index d99645f6b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-public class JptJpaGenPlugin {
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.gen";
- public static void logException ( String msg, Throwable e ) {
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- ILog log = Platform.getLog(bundle);
- log.log(new Status(IStatus.ERROR, PLUGIN_ID, msg, e ));
- }
-
- public static void logException( CoreException ce ) {
- IStatus status = ce.getStatus();
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- ILog log = Platform.getLog(bundle);
- log.log(new Status(IStatus.ERROR, PLUGIN_ID, status.getMessage(), ce));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java
deleted file mode 100644
index 6fed0571d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.util.EntityGenTools;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-
-/**
- * Represents the ORM generation properties for a database
- * column.
- *
- * <p>This is designed to be created/changed by the generation wizard,
- * and generated using Velocity templates.
- * The modified properties (if any) are persisted/retrieved using
- * <code>ORMGenCustomizer</code>.
- *
- */
-public class ORMGenColumn
-{
- private Table mTable;
- private Column mDbColumn;
- private ORMGenCustomizer mCustomizer;
- private ORMGenTable mGenTable;
- private static String JAVA_LANG_PACKAGE = "java.lang."; //$NON-NLS-1$
-
- public ORMGenColumn(Column dbColumn, ORMGenCustomizer customizer) {
- super();
-
- mDbColumn = dbColumn;
- mCustomizer = customizer;
- mTable = dbColumn.getTable();
- }
-
- public ORMGenCustomizer getCustomizer() {
- return mCustomizer;
- }
-
- public void setGenTable(ORMGenTable ormGenTable) {
- mGenTable = ormGenTable;
- }
-
- protected String customized(String propName) {
- return getCustomizer().getProperty(propName, mTable.getName(), getDbName());
- }
-
- protected boolean customizedBoolean(String propName) {
- return getCustomizer().getBooleanProperty(propName, mTable.getName(), getDbName());
- }
-
- protected void setCustomized(String propName, String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- getCustomizer().setProperty(propName, value, mTable.getName(), getDbName());
- }
-
- protected void setCustomizedBoolean(String propName, boolean value, boolean defaultValue) {
- if (defaultValue == value) {
- setCustomized(propName, null); //remove the property
- } else {
- getCustomizer().setBooleanProperty(propName, value, mTable.getName(), getDbName());
- }
- }
-
- /**
- * Returns the column name.
- */
- public String getName() {
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildColumnAnnotationName(mDbColumn.getName(), mDbColumn);
- return annotationName != null ? annotationName : mDbColumn.getName();
- }
-
- public String getDbName() {
- return mDbColumn.getName();
- }
-
- public String getJoinColumnName(){
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildJoinColumnAnnotationName(mDbColumn);
- return annotationName != null ? annotationName : mDbColumn.getName();
- }
-
- public Column getDbColumn() {
- return this.mDbColumn;
- }
-
- /**
- * Returns the generated bean property name for the given column.
- * Does not return null.
- */
- public String getPropertyName() {
- String name = customized(PROPERTY_NAME);
- if (name == null) {
- //name = StringUtil.columnNameToVarName(getName());
- name = EntityGenTools.convertToUniqueJavaStyleAttributeName(getDbName(), Collections.<String>emptySet());
- }
- return name;
- }
-
- public void setPropertyName(String name) {
- if (!StringUtil.equalObjects(name, getPropertyName())) {
- setCustomized(PROPERTY_NAME, name);
- }
- }
-
- /**
- * Return true if the values of name element in the @Column is default
- * so we can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefault(){
- return isDefaultname() && isUpdateable() && isInsertable();
- }
-
- /**
- * Return true if the values of name element in the @Column is default
- * so we can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefaultname(){
- String propName = getPropertyName();
-// String dbColumnName = getName();
-// return propName.equalsIgnoreCase( dbColumnName );
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildColumnAnnotationName(propName, this.mDbColumn );
- return annotationName==null;
- }
-
- /**
- * Return true if the values of name element in the @Column is default
- * so we can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefaultJoinColumnName(String associationRolePropName){
- if( !this.mDbColumn.isPartOfForeignKey()){
- return false;
- }
-
- Iterable<ForeignKey> it = mDbColumn.getTable().getForeignKeys();
- Iterator<ForeignKey> i = it.iterator();
- while( i.hasNext() ){
- ForeignKey fk = i.next();
- Column c = fk.getBaseColumns().iterator().next();
- if( c.equals( this.mDbColumn ) ){
- try{
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildJoinColumnAnnotationName(associationRolePropName, fk );
- return annotationName==null;
- }catch(Exception e){
- //catch the case that referenced table has multiple primary key columns
- return false;
- }
- }
- }
- return false;
- }
-
-
- /**
- * Returns the column type.
- * Does not return null.
- */
- public String getPropertyType() {
- String type = customized(PROPERTY_TYPE);
- if (type == null) {
- type = getCustomizer().getPropertyTypeFromColumn( this.mDbColumn );
- }
- if( type.startsWith(JAVA_LANG_PACKAGE) ) {
- type = type.substring( JAVA_LANG_PACKAGE.length() );
- }
- if( type.equals("java.sql.Date")){ //$NON-NLS-1$
- type = "java.util.Date"; //$NON-NLS-1$
- }
-
- return type;
- }
-
- public String getSimplePropertyType() {
- return mGenTable.getSimplifiedColType( getPropertyType() );
- }
-
- public void setPropertyType(String type) {
- if (!StringUtil.equalObjects(type, getPropertyType())) {
- setCustomized(PROPERTY_TYPE, type);
- }
- }
- /**
- * Returns true if the column type is numeric.
- */
- public boolean isNumeric() {
- boolean ret = this.mDbColumn.isNumeric();
- return ret;
- }
-
- /**
- * Returns the mapping kind, one of {@link #PROPERTY_MAPPING_KIND}|{@link #ID_MAPPING_KIND}
- * |{@link #VERSION_MAPPING_KIND}|{@link #TIMESTAMP_MAPPING_KIND}.
- *
- * This method does not return null (defaults to basic property type).
- */
- public String getMappingKind() {
- String kind = customized(MAPPING_KIND);
- if (kind == null) {
- kind = getCustomizer().getBasicMappingKind();
-
- if ( this.mDbColumn.isPartOfPrimaryKey()
- && this.mDbColumn.getTable().getPrimaryKeyColumnsSize() == 1) {
- kind = getCustomizer().getIdMappingKind();
- }
- }
- return kind;
- }
-
- public void setMappingKind(String mappingKind) {
- if (!StringUtil.equalObjects(mappingKind, getMappingKind())) {
- setCustomized(MAPPING_KIND, mappingKind);
- }
- }
-
- public boolean isNullable() {
- return this.mDbColumn.isNullable();
- }
-
- public int getSize() {
- if ( this.mDbColumn.isNumeric()){
- return mDbColumn.getPrecision();
- }
- return mDbColumn.getLength();
- }
-
- public int getDecimalDigits() {
- if ( this.mDbColumn.isNumeric() ){
- return mDbColumn.getScale();
- }
- return -1;
- }
-
- public boolean isPrimaryKey() {
- return this.mDbColumn.isPartOfPrimaryKey();
- }
-
- public boolean isPartOfCompositePrimaryKey() {
- return this.mDbColumn.isPartOfPrimaryKey() &&
- this.mTable.getPrimaryKeyColumnsSize() > 1;
- }
-
- public boolean isForeignKey() {
- return this.mDbColumn.isPartOfForeignKey();
- }
-
- public boolean isUnique() {
- return this.mDbColumn.isPartOfUniqueConstraint();
- }
-
- public String getPropertyDescription() {
- return customized(PROPERTY_DESC);
- }
-
- public boolean isDataTypeLOB() {
- return this.mDbColumn.isLOB();
- }
-
- public boolean isNeedMapTemporalType() {
- String propertyType = this.getPropertyType();
- return ( propertyType.equals("java.util.Date") || propertyType.equals("java.util.Calendar") ); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public String getTemporalType() {
- String defaultType = getCustomizer().getPropertyTypeFromColumn( this.mDbColumn );
- if( defaultType.equals("java.sql.Date")){ //$NON-NLS-1$
- return "DATE"; //$NON-NLS-1$
- }else if( defaultType.equals("java.sql.Time")){ //$NON-NLS-1$
- return "TIME"; //$NON-NLS-1$
- }else {
- return "TIMESTAMP"; //$NON-NLS-1$
- }
- }
-
- /**
- * Returns the generated property getter scope, one of {@link #PUBLIC_SCOPE}|{@link #PROTECTED_SCOPE}
- * |{@link #PRIVATE_SCOPE}.
- * This method never returns null (defaults to public).
- */
- public String getPropertyGetScope() {
- String scope = customized(PROPERTY_GET_SCOPE);
- if (scope == null) {
- scope = PUBLIC_SCOPE;
- }
- return scope;
- }
-
- public void setPropertyGetScope(String scope) {
- if (!StringUtil.equalObjects(scope, getPropertyGetScope())) {
- setCustomized(PROPERTY_GET_SCOPE, scope);
- }
- }
-
- /**
- * Returns the generated property setter scope, one of {@link #PUBLIC_SCOPE}|{@link #PROTECTED_SCOPE}
- * |{@link #PRIVATE_SCOPE}.
- * This method never returns null (defaults to public).
- */
- public String getPropertySetScope() {
- String scope = customized(PROPERTY_SET_SCOPE);
- if (scope == null) {
- scope = PUBLIC_SCOPE;
- }
- return scope;
- }
-
- public void setPropertySetScope(String scope) {
- if (!StringUtil.equalObjects(scope, getPropertySetScope())) {
- setCustomized(PROPERTY_SET_SCOPE, scope);
- }
- }
-
- /**
- * Returns the generated field member scope, one of {@link #PUBLIC_SCOPE}|{@link #PROTECTED_SCOPE}
- * |{@link #PRIVATE_SCOPE}.
- * This method never returns null (defaults to private).
- */
- public String getFieldScope() {
- String scope = customized(FIELD_SCOPE);
- if (scope == null) {
- scope = PRIVATE_SCOPE;
- }
- return scope;
- }
-
- /**
- * Returns true if this column should be used in the
- * <code>equals</code> method implementation.
- */
- public boolean isUseInEquals() {
- return customizedBoolean(USE_IN_EQUALS) || isPrimaryKey();
- }
-
- public void setUseInEquals(boolean value) {
- setCustomizedBoolean(USE_IN_EQUALS, value, false);
- }
-
- /**
- * Returns true if this column should be used in the
- * <code>toString</code> method implementation.
- */
- public boolean isUseInToString() {
- return customizedBoolean(USE_IN_TO_STRING) || isPrimaryKey();
- }
-
- public void setUseInToString(boolean value) {
- setCustomizedBoolean(USE_IN_TO_STRING, value, false);
- }
-
- public boolean isUpdateable() {
- return !"false".equals(customized(UPDATEABLE)); //defaults to true //$NON-NLS-1$
- }
-
- public void setUpdateable(boolean value) {
- setCustomizedBoolean(UPDATEABLE, value, true);
- }
-
- public boolean isInsertable() {
- return !"false".equals(customized(INSERTABLE)); //defaults to true //$NON-NLS-1$
- }
-
- public void setInsertable(boolean value) {
- setCustomizedBoolean(INSERTABLE, value, true);
- }
-
- public boolean isGenerated() {
- return !"false".equals(customized(GENERATED)); //defaults to true //$NON-NLS-1$
- }
-
- public void setGenerated(boolean value) {
- setCustomizedBoolean(GENERATED, value, true);
- }
-
- @Override
- public String toString() {
- return "name=" + getName() + "; type=" + getPropertyType() ; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*get/set and field scopes*/
- public static final String PUBLIC_SCOPE = "public"; //$NON-NLS-1$
- public static final String PROTECTED_SCOPE = "protected"; //$NON-NLS-1$
- public static final String PRIVATE_SCOPE = "private"; //$NON-NLS-1$
-
- /*customization properties*/
- private static final String PROPERTY_NAME = "propertyName"; //$NON-NLS-1$
- protected static final String PROPERTY_TYPE = "propertyType"; //$NON-NLS-1$
- protected static final String MAPPING_KIND = "mappingKind"; //$NON-NLS-1$
- private static final String PROPERTY_DESC = "propertyDesc"; //$NON-NLS-1$
- private static final String PROPERTY_GET_SCOPE = "propertyGetScope"; //$NON-NLS-1$
- private static final String PROPERTY_SET_SCOPE = "propertySetScope"; //$NON-NLS-1$
- private static final String FIELD_SCOPE = "fieldScope"; //$NON-NLS-1$
- private static final String USE_IN_EQUALS = "useInEquals"; //$NON-NLS-1$
- private static final String USE_IN_TO_STRING = "useInToString"; //$NON-NLS-1$
- private static final String UPDATEABLE = "updateable"; //$NON-NLS-1$
- private static final String INSERTABLE = "insertable"; //$NON-NLS-1$
- private static final String GENERATED = "genProperty"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java
deleted file mode 100644
index 55c53d45ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java
+++ /dev/null
@@ -1,824 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.FileUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.ForeignKeyInfo;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Contains the information used to customize the database schema to ORM entity
- * generation.
- *
- * <p>The customization settings are mainly exposed in the form of
- * properties. There are no assumptions in this class about the meaning of the
- * property names. Properties can be associated to specific tables and table
- * columns, or globally for any table and/or column.
- *
- * <p>Subclass can implement the sets of abstract methods to provide ORM vendor
- * specific properties.
- *
- */
-public abstract class ORMGenCustomizer implements java.io.Serializable
-{
- private final static long serialVersionUID = 1;
-
- /**
- * A value passed for the table name argument to get/setProperty
- * indicating that the value applies to any table.
- */
- public static final String ANY_TABLE = "__anyTable__";
- public static final String GENERATE_DDL_ANNOTATION = "generateDDLAnnotations";
- /*the string used in the property name in mProps to indicate
- * a null table value.*/
- private static final String NULL_TABLE = "";
- /*the string used in the property name in mProps to indicate
- * a null column value.*/
- private static final String NULL_COLUMN = "";
-
- /*This version number is written in the header of the customization stream
- * and read at de-serialization time, if it is different then the file is invalidated.
- */
- private static final int FILE_VERSION = 2;
-
- private static final String UPDATE_CONFIG_FILE = "updateConfigFile";
-
- private transient Schema mSchema;
- private transient File mFile;
-
- private List<String> mTableNames;
- /*key: table name, value: ORMGenTable object.*/
- private transient Map<String , ORMGenTable> mTables;
- /*the <code>Association</code> objects sorted by their "from"
- * table name. Includes all association derived from foreign keys
- * in user selected tables. Since some of the foreign keys may point to table
- * user does not select, this list may be different from mValidAssociations
- */
- private List<Association> mAssociations;
- /*
- * List of valid associations within the user selected tables
- */
- private transient List<Association> mValidAssociations;
- private transient boolean mInvalidForeignAssociations;
-
- /*the property name is in the form $tableName.$columnName.$propertyName.
- * Where tableName could be NULL_TABLE or ANY_TABLE
- * and columnName could be NULL_COLUMN*/
- private Map<String, String> mProps = new java.util.HashMap<String, String>();
-
- private transient DatabaseAnnotationNameBuilder databaseAnnotationNameBuilder = DatabaseAnnotationNameBuilder.Default.INSTANCE;
-
- private boolean mUpdatePersistenceXml = true;
-
- //-----------------------------------------
- //---- abstract methods
- //-----------------------------------------
- /**
- * Returns all the primary key generator schemes.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract List<String> getAllIdGenerators();
- /**
- * Returns the string representing the developer-assigned id generator.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getNoIdGenerator();
- /**
- * Returns the string representing the identity id generator.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getIdentityIdGenerator();
- /**
- * Returns the strings representing the sequence generators.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract Set<String> getSequenceIdGenerators();
- /**
- * Returns a property type from the given database column.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getPropertyTypeFromColumn(Column column) ;
- /**
- * Returns all the strings representing property types.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String[] getAllPropertyTypes();
- /**
- * Returns all the strings representing property mapping kinds.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String[] getAllMappingKinds();
- /**
- * Returns the basic (default) property mapping kind.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getBasicMappingKind();
- /**
- * Returns the id (primary key) property mapping kind.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getIdMappingKind();
- /**
- * Interacts with the user to edit the cascade of the given
- * role.
- * This method should also call <code>AssociationRole.setCascade</code>.
- *
- * @return false if the user interaction is cancelled.
- */
- public abstract boolean editCascade(AssociationRole role);
-
- //-----------------------------------------
- //-----------------------------------------
-
- /**
- * @param file The file that contains the customization settings.
- * The file is created if necessary when the <code>save</code>
- * method is called.
- */
- public void init( File file, Schema schema) {
- this.mSchema = schema;
- mFile = file;
-
- if (!file.exists()) {
- setProperty(ORMGenTable.DEFAULT_FETCH, ORMGenTable.DEFAULT_FETCH, ORMGenCustomizer.ANY_TABLE, null);
- return;
- }
- InputStream istream = null;
- ObjectInputStream ois = null;
- try
- {
- //read it in a file first to speedup deserialization
- byte[] bytes = FileUtil.readFile(file);
- istream = new ByteArrayInputStream(bytes);
- ois = new ObjectInputStream(istream);
-
- FileHeader header = (FileHeader)ois.readObject();
- if (header.mVersion == FILE_VERSION) {
- ORMGenCustomizer customizer = (ORMGenCustomizer)ois.readObject();
- restore(customizer);
- }
- } catch (Exception ex) {
- JptJpaGenPlugin.logException("***ORMGenCustomizer.load failed "+file, ex);
- }
- finally
- {
- if (ois != null)
- {
- try
- {
- ois.close();
- } catch (IOException e) {
- }
- }
-
- if (istream != null)
- {
- try
- {
- istream.close();
- } catch (IOException e) {
- }
- }
- }
- }
-
- public File getFile(){
- return this.mFile;
- }
-
- public void setSchema(Schema schema){
- this.mSchema = schema;
- }
-
- public Schema getSchema(){
- return mSchema;
- }
-
- /**
- * Empty constructor needed by the deserialization.
- */
- public ORMGenCustomizer() {
- super();
- }
-
- /**
- * Saves the customization file.
- * The file is created if necessary.
- */
- public void save() throws IOException {
- //System.out.println("---ORMGenCustomizer.save: " + mFile);
- if (!mFile.exists() && !mFile.createNewFile()) {
- return;
- }
- java.io.FileOutputStream fos = null;
- java.io.ObjectOutputStream oos = null;
- boolean deleteIt = true;
- try {
- fos = new java.io.FileOutputStream(mFile);
- oos = new java.io.ObjectOutputStream(fos);
- FileHeader header = new FileHeader();
- oos.writeObject(header);
- oos.writeObject(this);
- deleteIt = false;
- } catch (Exception ex) {
- //deleteIt is true, so the cache is not saved.
- CoreException ce = new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID,
- "Unable to save the ORMGenCustomizer file: "+mFile,ex));
- JptJpaGenPlugin.logException( ce );
- } finally {
- try {
- if (oos!=null) oos.close();
- if (fos!=null) fos.close();
- if (deleteIt) {
- mFile.delete();
- }
- } catch (java.io.IOException ex2) {}
- }
- }
-
- public DatabaseAnnotationNameBuilder getDatabaseAnnotationNameBuilder() {
- return this.databaseAnnotationNameBuilder;
- }
- public void setDatabaseAnnotationNameBuilder(DatabaseAnnotationNameBuilder databaseAnnotationNameBuilder) {
- if (databaseAnnotationNameBuilder == null) {
- throw new NullPointerException("database annotation name builder is required"); //$NON-NLS-1$
- }
- this.databaseAnnotationNameBuilder = databaseAnnotationNameBuilder;
- }
-
- /**
- * Returns {@link #GENERATE_DDL_ANNOTATION} indicating whether
- * the optional DDL parameters like length, nullable, unqiue, etc should be generated
- * in @Column annotation.
- * defaults to false.
- */
- public boolean isGenerateDDLAnnotations() {
- return "true".equals(getProperty(GENERATE_DDL_ANNOTATION, ANY_TABLE, null)); //defaults to false
- }
-
- /**
- * Returns a property value.
- */
- public String getProperty(String propertyName, String tableName, String colName) {
- String key = getPropKey(propertyName, tableName, colName);
- String value = mProps.get(key);
- /*if the key does not exist and it is a table property then
- * get the default table property.*/
- if (value == null && tableName != null && colName == null && !tableName.equals(ANY_TABLE)) {
- value = getProperty(propertyName, ANY_TABLE, colName);
- }
- return value;
- }
- /**
- * Changes a property value.
- *
- * @param value The new value, could be null.
- */
- public void setProperty(String propertyName, String value, String tableName, String colName) {
- String key = getPropKey(propertyName, tableName, colName);
- if (value != null) {
- mProps.put(key, value);
- } else {
- mProps.remove(key);
- }
- }
- /**
- * Same as {@link #getProperty(String, String, String)} but
- * converts the value to boolean.
- */
- public boolean getBooleanProperty(String propertyName, String tableName, String colName) {
- String value = getProperty(propertyName, tableName, colName);
- return "true".equals(value);
- }
- /**
- * Changes a table boolean property value.
- */
- public void setBooleanProperty(String propertyName, boolean value, String tableName, String colName) {
- setProperty(propertyName, value ? "true" : "false", tableName, colName);
- }
- /**
- * Returns the names of the tables to generate.
- */
- @SuppressWarnings("unchecked")
- public List<String> getTableNames() {
- return mTableNames != null ? mTableNames : java.util.Collections.EMPTY_LIST;
- }
-
- /**
- * Returns the fetch type annotation member value, or empty string
- * if none.
- * Empty string is returned instead of null because Velocity does not like null
- * when used in #set.
- */
- public String genFetch(ORMGenTable table) {
- return "";
- }
- /**
- * Called when the table user selection is changed in the
- * generation wizard.
- */
- public void setTableNames(List<String> tableNames) {
- mTableNames = tableNames;
- mTables = null;
- mValidAssociations = null; //recompute
- mInvalidForeignAssociations = true; //make sure foreign associations from newly added tables are computed.
- }
- /**
- * Returns the table names to be generated.
- * This might be different from <code>getTableNames</code> if there
- * are many-to-many join tables and are not contributing
- * in any other associations.
- */
- public List<String> getGenTableNames() {
- List<String> names = getTableNames();
- List<String> result = new java.util.ArrayList<String>(names.size());
-
- /*filter out join tables*/
- List<Association> associations = getAssociations();
- for (Iterator<String> tableNamesIter = names.iterator(); tableNamesIter.hasNext(); ) {
- String tableName = tableNamesIter.next();
- boolean isValid = true;
-
- for (Iterator<Association> assocIter = associations.iterator(); assocIter.hasNext(); ) {
- Association association = assocIter.next();
- if (!association.isGenerated()) {
- continue;
- }
- if (tableName.equals(association.getReferrerTableName())
- || tableName.equals(association.getReferencedTableName())) {
- isValid = true;
- break;
- }
- if (tableName.equals(association.getJoinTableName())) {
- isValid = false;
- }
- }
- if (isValid) {
- result.add(tableName);
- }
- }
- return result;
- }
- /**
- * Returns an <code>ORMGenTable</code> object given its name, or
- * null if none.
- */
- public ORMGenTable getTable(String tableName) {
- if (mTables == null) {
- mTables = new java.util.HashMap<String, ORMGenTable>(mTableNames.size());
- }
-
- if(mTableNames!=null && mSchema!=null){
- for (Iterator<String> iter = mTableNames.iterator(); iter.hasNext(); ) {
- String name = iter.next();
- Table dbTable = mSchema.getTableNamed( name );
- if (dbTable != null) {
- mTables.put(name, createGenTable(dbTable));
- }
- }
- }
- return mTables.get(tableName);
- }
- /**
- * Returns the <code>Association</code> objects sorted by their "from"
- * table name.
- */
- public List<Association> getAssociations(){
- return getAssociations(true/*validOnly*/);
- }
- /**
- * Adds the given association.
- */
- public void addAssociation(Association association) {
- getAssociations(false/*validOnly*/).add(association);
- if (mValidAssociations != null) {
- mValidAssociations.add(association);
- }
-
- }
- /**
- * Deletes the given association.
- */
- public void deleteAssociation(Association association) {
- boolean removed = getAssociations(false/*validOnly*/).remove(association);
- assert(removed);
-
- if (mValidAssociations != null) {
- removed = mValidAssociations.remove(association);
- assert(removed);
- }
- }
- /**
- * Returns true if an association similar to the given association
- * already exists.
- * This is decided based only on the association tables and columns.
- */
- public boolean similarAssociationExists(Association association) {
- try {
- for (Iterator<Association> iter = getAssociations(false/*validOnly*/).iterator(); iter.hasNext(); ) {
- Association association2 = iter.next();
- if (!association.getReferrerTableName().equals(association2.getReferrerTableName())
- || !association.getReferencedTableName().equals(association2.getReferencedTableName())
- || !StringUtil.equalObjects(association.getJoinTableName(), association2.getJoinTableName())
- || !association.getReferrerColumnNames().equals(association2.getReferrerColumnNames())
- || !association.getReferencedColumnNames().equals(association2.getReferencedColumnNames())
- ) {
- continue;
- }
- /*the 2 association have the same referrer, referenced and join table*/
- if (association.getJoinTableName() == null) {
- return true;
- }
- if (association.getReferrerJoinColumnNames().equals(association2.getReferrerJoinColumnNames())
- && association.getReferencedJoinColumnNames().equals(association2.getReferencedJoinColumnNames())) {
- return true;
- }
- }
- } catch (Exception e) {
- return false;
- }
- return false;
- }
- /**
- * Creates the <code>ORMGenTable</code> instance.
- */
- public ORMGenTable createGenTable(Table dbTable) {
- return new ORMGenTable(dbTable, this);
- }
- /**
- * Creates the <code>ORMGenColumn</code> instance.
- */
- protected ORMGenColumn createGenColumn(Column dbCol) {
- return new ORMGenColumn(dbCol, this);
- }
- /**
- * Returns true of the underlying persistence specs require the "many" side
- * of an association to be the owner (like EJB3).
- */
- protected boolean manySideIsAssociationOwner() {
- return false;
- }
- public boolean isUpdateConfigFile() {
- return !"false".equals(getProperty(UPDATE_CONFIG_FILE, null, null)); //defaults to true
- }
- public void setUpdateConfigFile(boolean value) {
- if (value) { //default is true
- setProperty(UPDATE_CONFIG_FILE, null, null, null); //remove it
- } else {
- setBooleanProperty(UPDATE_CONFIG_FILE, value, null, null);
- }
- }
-
- //-----------------------------------------
- //---- Velocity templates methods
- //-----------------------------------------
- /**
- * Returns a getter method name given a property name.
- */
- public String propertyGetter(String propertyName) {
- return "get"+StringUtil.initUpper(propertyName);
- }
- /**
- * Returns a setter method name given a property name.
- */
- public String propertySetter(String propertyName) {
- return "set"+StringUtil.initUpper(propertyName);
- }
- public String quote(String s) {
- return StringUtil.quote(s, '"');
- }
- public String quote(boolean b) {
- return quote(String.valueOf(b));
- }
- public String quote(int i) {
- return quote(String.valueOf(i));
- }
- public String convertToJavaStringLiteral(String s) {
- return StringTools.convertToJavaStringLiteral(s);
- }
- /**
- * Appends an annotation member name and value to an existing annotation.
- *
- * @param s The annotation members string.
- *
- * @param memberValue The member value, if null or empty strings then
- * nothing is appened.
- *
- * @param whether to double quote the member value.
- */
- public String appendAnnotation(String s, String memberName, String memberValue, boolean quote) {
- if (memberValue == null || memberValue.length() == 0) {
- return s;
- }
- StringBuffer buffer = new StringBuffer(s);
- if (buffer.length() != 0) {
- buffer.append(", ");
- }
- buffer.append(memberName);
- buffer.append('=');
- if (quote) {
- buffer.append('"');
- }
- buffer.append(memberValue);
- if (quote) {
- buffer.append('"');
- }
- return buffer.toString();
- }
- public boolean isJDK1_5() {
- return true;
- }
-
- //-----------------------------------------
- //---- private methods
- //-----------------------------------------
- /**
- * Restores the customization settings from the given
- * (persisted) customizer.
- */
- private void restore(ORMGenCustomizer customizer) {
- mTableNames = customizer.mTableNames;
- mAssociations = customizer.mAssociations;
- mProps = customizer.mProps;
- mUpdatePersistenceXml = customizer.mUpdatePersistenceXml;
- if( mSchema == null )
- return;
-
- /*remove invalid table names*/
- for (int i = mTableNames.size()-1; i >= 0; --i) {
- String tableName = mTableNames.get(i);
- if (mSchema.getTableNamed( tableName) == null) {
- mTableNames.remove(i);
- }
- }
- if( mAssociations!=null ){
- /*restore the associations*/
- for (Iterator<Association> iter = mAssociations.iterator(); iter.hasNext(); ) {
- Association association = iter.next();
- association.restore(this);
- }
- /*add the foreign keys associations just in case the tables changed since
- * the last time the state was persisted. Pass checkExisting true so that the
- * associations restored above are not overwritten.*/
- addForeignKeyAssociations(true/*checkExisting*/);
- // sort on restore
- sortAssociations( mAssociations );
- }
- }
- /**
- * Returns the key in mProps corresponding to the specified
- * propertyName, table and column.
- */
- private String getPropKey(String propertyName, String tableName, String colName) {
- if (tableName == null) {
- tableName = NULL_TABLE;
- }
- if (colName == null) {
- colName = NULL_COLUMN;
- }
- return tableName + '.' + colName + '.' + propertyName;
- }
- /**
- * Returns the associations that are valid for the
- * current tables.
- */
- private List<Association> getAssociations(boolean validOnly){
- if (mAssociations == null) {
- mAssociations = new java.util.ArrayList<Association>();
-
- addForeignKeyAssociations(false/*checkExisting*/);
- } else if (mInvalidForeignAssociations) {
- mInvalidForeignAssociations = false;
-
- addForeignKeyAssociations(true/*checkExisting*/);
- }
- List<Association> associations;
- if (validOnly) {
- if (mValidAssociations == null) {
- /*filter out the invalid associations*/
- mValidAssociations = new ArrayList<Association>(mAssociations.size());
- for (int i = 0, n = mAssociations.size(); i < n; ++i) {
- Association association = mAssociations.get(i);
- if (association.isValid()) {
- mValidAssociations.add(association);
- }
- }
- }
- associations = mValidAssociations;
- } else {
- associations = mAssociations;
- }
- return associations;
- }
- private void addForeignKeyAssociations(boolean checkExisting) {
- List<String> tableNames = getTableNames();
- for (Iterator<String> iter = tableNames.iterator(); iter.hasNext(); ) {
- ORMGenTable table = getTable(iter.next());
- addForeignKeyAssociations(table, checkExisting);
- }
- }
- private void addForeignKeyAssociations(ORMGenTable table, boolean checkExisting) {
- if(table==null)
- return;
-
-
- List<ForeignKeyInfo> fKeys = null;
-
- try{
- fKeys = DTPUtil.getForeignKeys(table.getDbTable());
- }catch(Exception ise){
- //workaround Dali bug for now
- return;
- }
-
- if( fKeys.size()==0 )
- return;
-
- List<Association> addedAssociations = new java.util.ArrayList<Association>();
- for (Iterator<ForeignKeyInfo> iter = fKeys.iterator(); iter.hasNext(); ) {
- ForeignKeyInfo fki = iter.next();
- ORMGenTable referencedTable = getTable(fki.getReferencedTableName());
- if (referencedTable == null) {
- continue;
- }
- Association association = new Association(this, table.getName(), fki.getReferrerColumnNames()
- , referencedTable.getName(), fki.getReferencedColumnNames());
- association.computeCardinality();
- //Defer the check of similarAssociationExists after computeManyToMany()
- //otherwise the MTM association will not computed correctly in some cases.
- //if (checkExisting && similarAssociationExists(association)) {
- // continue;
- //}
- addedAssociations.add(association);
- }
-
- Association m2m = computeManyToMany(table, addedAssociations);
- if (m2m != null) {
- /*do not generate the 2 many-to-one*/
- addedAssociations.clear();
- addedAssociations.add(0, m2m);
- }
- //remove the association if already existing
- Iterator<Association> it = addedAssociations.iterator();
- while( it.hasNext() ){
- Association newAssociation = it.next();
- for( Association association : mAssociations ){
- if( newAssociation.equals( association )){
- it.remove();
- break;
- }
- }
- }
- mAssociations.addAll(addedAssociations);
- }
- private Association computeManyToMany(ORMGenTable table, List<Association> addedAssociations) {
- /** many-to-many associations if:
- * - addedAssociations contains 2 many-to-one associations
- * - tables t1 and t2 does NOT have to be different( for self-MTM-self situation)
- * - <code>table</code> contains only the foreign key columns.
- *
- * Note: following restrictions have been removed:
- * -table has only two columns
- * -t1 and t2 must be different
- * -the primary key of <code>table</code> is the concatenation of its foreign
- * keys to t1 and t2.*/
-
- if (addedAssociations.size() != 2) {
- return null;
- }
-
- //MTM table should have two MTO relations to orginal tables
- Association assoc1 = addedAssociations.get(0);
- Association assoc2 = addedAssociations.get(1);
- if (assoc1.getCardinality() != Association.MANY_TO_ONE
- || assoc2.getCardinality() != Association.MANY_TO_ONE) {
- return null;
- }
-
- //MTM table should only include foreign key columns
- for( ORMGenColumn col : table.getColumns()){
- if( !col.isForeignKey())
- return null;
- }
-
-
- ORMGenTable t1 = assoc1.getReferencedTable();
- ORMGenTable t2 = assoc2.getReferencedTable();
-
- if( t1.getName().equals(table.getName()) || t2.getName().equals(table.getName()) ) {
- return null;
- }
-
- //Make a guess which table is the owning side of the MTM relation
- //See https://bugs.eclipse.org/bugs/show_bug.cgi?id=268445
- //Logic borrowed from DTPTableWrapper.getJoinTableOwningForeignKey()
- if( !table.getName().equals(t1.getName() + "_" + t2.getName() ) ) {
- //swap t1 and t2
- ORMGenTable t3 = t1;
- t1=t2;
- t2=t3;
- //swap assoc1 and assoc2
- Association assoc3=assoc1;
- assoc1=assoc2;
- assoc2=assoc3;
- }
-
-//Commented out because the assumption is too restrictive:
-//this check will prevent generating MTM mapping table not having
-//primary key defined
-// List pkNames = DTPUtil.getPrimaryKeyColumnNames(table.getDbTable());
-// if (pkNames.size() != table.getColumnNames().size()) {
-// return null;
-// }
-// List fkNames = new java.util.ArrayList(assoc1.getReferrerColumnNames()); //clone because we modify by addAll below
-// fkNames.addAll(assoc2.getReferrerColumnNames());
-// if (!CollectionUtil.equalsIgnoreOrder(pkNames, fkNames)) {
-// return null;
-// }
- Association m2m = new Association(this, t1.getName()/*referrerTableName*/, assoc1.getReferencedColumnNames()/*referrerColNames*/
- , t2.getName()/*referencedTableName*/, assoc2.getReferencedColumnNames()/*referencedColNames*/
- , table.getName(), assoc1.getReferrerColumnNames()/*referrerJoinColNames*/, assoc2.getReferrerColumnNames()/*referencedJoinColNames*/);
- m2m.setCustom(false);
- return m2m;
- }
-
- //---------------------------------------------------
- //---- FileHeader class -----------------------------
- //---------------------------------------------------
- /**
- * The header of the customization file.
- */
- private static class FileHeader implements java.io.Serializable
- {
- private static final long serialVersionUID = 1L;
- /**
- * Should be argument-less because it is used in
- * the de-serialization process.
- */
- public FileHeader() {
- mVersion = FILE_VERSION;
- }
- int mVersion;
- }
-
- private void sortAssociations( List< Association > list ) {
- Collections.sort( list, new Comparator< Association >() {
- public int compare( Association lhs, Association rhs ) {
- // sort by referrer table name first...
- int test = lhs.getReferrerTableName().compareTo( rhs.getReferrerTableName() );
- if( test != 0 )
- return test;
- // then by referenced table name...
- test = lhs.getReferencedTableName().compareTo( rhs.getReferencedTableName() );
- if( test != 0 )
- return test;
- // if referrer and referenced tables are the same, they should
- // appear next to each other
- return 0;
- }
- } );
- }
- public boolean updatePersistenceXml() {
- return mUpdatePersistenceXml;
- }
- public void setUpdatePersistenceXml(boolean updatePersistenceXml) {
- this.mUpdatePersistenceXml = updatePersistenceXml;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java
deleted file mode 100644
index bcca94d610..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java
+++ /dev/null
@@ -1,1037 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.EntityGenTools;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Represents the ORM generation properties for a database table.
- *
- * <p>
- * This is designed to be created/changed by the generation wizard, and
- * generated using Velocity templates. The modified properties (if any) are
- * persisted/retrieved using <code>ORMGenCustomizer</code>.
- *
- */
-public class ORMGenTable
-{
- private ORMGenCustomizer mCustomizer;
- private List<ORMGenColumn> mColumns;
- private Table mDbTable;
- private HashMap<String, String> columnTypesMap = null;
- /**
- * @param table
- * The database table or null if this table is used to get/set
- * the default table properties (properties that apply to all
- * tables unless overriden).
- */
- public ORMGenTable(Table table, ORMGenCustomizer customizer) {
- super();
- mDbTable = table;
- mCustomizer = customizer;
- }
-
- public ORMGenCustomizer getCustomizer() {
- return mCustomizer;
- }
-
- /**
- * Returns true if this table is is used to get/set the default table
- * properties.
- */
- public boolean isDefaultsTable() {
- return mDbTable == null;
- }
-
- protected String customized(String propName) {
- return getCustomizer().getProperty(propName, getTableName(), null);
- }
-
- protected boolean customizedBoolean(String propName) {
- return getCustomizer().getBooleanProperty(propName, getTableName(), null);
- }
-
- protected void setCustomized(String propName, String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- getCustomizer().setProperty(propName, value, getTableName(), null);
- }
-
- protected void setCustomizedBoolean(String propName, boolean value, boolean defaultValue) {
- if (defaultValue == value) {
- setCustomized(propName, null); // remove the property
- }
- else {
- getCustomizer().setBooleanProperty(propName, value, getTableName(), null);
- }
- }
-
- public Table getDbTable() {
- return mDbTable;
- }
-
- /**
- * Returns the table name.
- */
- public String getTableName() {
- return mDbTable != null ? mDbTable.getName() : ORMGenCustomizer.ANY_TABLE;
- }
-
- public String getName() {
- if (mDbTable == null)
- return ORMGenCustomizer.ANY_TABLE;
- String tableName = getTableName();
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().buildTableAnnotationName(tableName, mDbTable);
- return annotationName != null ? annotationName : tableName;
- }
-
- public String getJoinTableAnnotationName() {
- if (mDbTable == null)
- return ORMGenCustomizer.ANY_TABLE;
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().buildJoinTableAnnotationName(mDbTable);
- return annotationName != null ? annotationName : mDbTable.getName();
- }
-
- /**
- * Returns the database schema containing the table.
- */
- public String getSchema() {
- if (DTPUtil.isDefaultSchema(mDbTable) || mDbTable.getSchema()==null)
- return ""; //$NON-NLS-1$
- String schemaName = mDbTable.getSchema().getName();
- return schemaName;
- }
-
- public void setSourceFolder(String srcFolder){
- setCustomized(SRC_FOLDER, srcFolder);
- }
-
- public String getSourceFolder(){
- String srcFolder = customized(SRC_FOLDER);
- return srcFolder == null ? "" : srcFolder;
- }
-
- public String getImportStatements(){
- buildColumnTypesMap();
- Collection<String> packages = columnTypesMap.keySet();
- StringBuilder ret = new StringBuilder();
- for ( String s : packages ) {
- ret.append( "import " + s + ";\n"); //$NON-NLS-1$
- }
-
- List<AssociationRole> associationRoles = getAssociationRoles();
- for ( AssociationRole role : associationRoles ) {
- if ( role.getCardinality().equals( Association.ONE_TO_MANY )
- || role.getCardinality().equals( Association.MANY_TO_MANY ) ) {
- ret.append( "import " + getDefaultCollectionType() + ";\n"); //$NON-NLS-1$
- break;
- }
- }
-
- return ret.toString();
- }
-
- /**
- * Construct import statements for types from javax.persistence package
- * @return
- */
- private String getJavaxPersistenceImportStatements() {
- StringBuilder ret = new StringBuilder();
- ret.append( "import javax.persistence.Entity;\n"); //$NON-NLS-1$
- //TODO: only if @Columns is needed
- ret.append( "import javax.persistence.Column;\n");//$NON-NLS-1$
- //TODO: only if there is @Id
- ret.append( "import javax.persistence.Id;\n");//$NON-NLS-1$
- if( !this.isDefaultname() )
- ret.append( "import javax.persistence.Table;\n");//$NON-NLS-1$
- if( this.isCompositeKey() )
- ret.append( "import javax.persistence.EmbeddedId;\n"); //$NON-NLS-1$
- // append javax.persistence package imports
- HashSet<String> jpaImports = new HashSet<String>();
- List<AssociationRole> associationRoles = getAssociationRoles();
- for( AssociationRole role : associationRoles ){
- if( role.getCardinality().equals( Association.ONE_TO_ONE ) ){
- jpaImports.add( "import javax.persistence.OneToOne;" );//$NON-NLS-1$
- }else{
- if( role.getCardinality().equals( Association.ONE_TO_MANY ) ){
- jpaImports.add( "import javax.persistence.OneToMany;\n" );//$NON-NLS-1$
- }else if( role.getCardinality().equals( Association.MANY_TO_ONE ) ){
- jpaImports.add( "import javax.persistence.ManyToOne;\n" );//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinColumn;\n" ); //$NON-NLS-1$
- }else if( role.getCardinality().equals( Association.MANY_TO_MANY ) ){
- jpaImports.add( "import javax.persistence.ManyToMany;\n" );//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinTable;\n" );//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinColumns;\n");//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinColumn;\n" );//$NON-NLS-1$
- }
- }
- }
- for( String s: jpaImports){
- ret.append(s);
- }
- return ret.toString();
- }
-
- public HashMap<String, String> buildColumnTypesMap(){
- if ( columnTypesMap != null) {
- return columnTypesMap;
- }
- columnTypesMap = new HashMap<String, String>();
- for ( ORMGenColumn col : this.getColumns() ) {
- String type = col.getPropertyType();
- if ( !col.isPartOfCompositePrimaryKey()
- && !col.isForeignKey()
- && !type.startsWith("java.lang") && type.indexOf('.')>0 ) {
- String simpleType= type.substring( type.lastIndexOf('.')+1 );
- columnTypesMap.put(type, simpleType);
- }
- }
- return columnTypesMap;
- }
-
- public String getSimplifiedColType(String fqtn ) {
- HashMap<String, String> map = buildColumnTypesMap();
- String typeName = map.get(fqtn);
- if ( typeName != null ) {
- return typeName;
- }
- return fqtn;
- }
-
- /**
- * Sets the package for the generated class (empty string for the default
- * package)
- */
- public void setPackage(String pkg) {
- getCustomizer().setProperty(PACKAGE, pkg, getName(), null);
- // not calling setCustomized so that empty strings do not get nulled out.
- }
-
- /**
- * Returns the Java package (empty string for the default package).
- */
- public String getPackage() {
- String packageName = customized(PACKAGE);
- return packageName == null ? "" : packageName; //$NON-NLS-1$
- }
-
- /**
- * Returns the generated Java class name (not qualified).
- */
- public String getClassName() {
- String name = customized(CLASS_NAME);
- if (name == null) {
- // name = StringUtil.tableNameToVarName(getName());
- // name = StringUtil.initUpper(name);
- name = EntityGenTools.convertToUniqueJavaStyleClassName(getTableName(), new ArrayList<String>());
- name = StringUtil.singularise(name);
- }
- return name;
- }
-
- public void setClassName(String className) {
- /*
- * if the class name is the same as the (possibly computed) class name
- * then nothing to do
- */
- if (!StringUtil.equalObjects(className, getClassName())) {
- setCustomized(CLASS_NAME, className);
- }
- }
-
- /**
- * Returns a name suitable to be used as a variable or class name. This is
- * computed based on the table name.
- *
- * @param singular
- * Whether the name should be singular or plural.
- */
- public String getVarName(boolean singular) {
- String name = StringUtil.tableNameToVarName(getTableName());
- if (singular) {
- name = StringUtil.singularise(name);
- }
- else {
- name = StringUtil.pluralise(name);
- }
- return name;
- }
-
- /**
- * Returns the fully qualified generated Java class name.
- */
- public String getQualifiedClassName() {
- return qualify(getClassName());
- }
-
- /**
- * Returns the composite key Java class name (not qualified).
- */
- public String getCompositeKeyClassName() {
- String name = customized(COMPOSITE_KEY_CLASS_NAME);
- if (name == null) {
- name = getClassName() + "PK"; //$NON-NLS-1$
- }
- return name;
- }
-
- /**
- * Returns the fully qualified composite key Java class name.
- */
- public String getQualifiedCompositeKeyClassName() {
- return qualify(getCompositeKeyClassName());
- }
-
- /**
- * Returns the composite key property name.
- */
- public String getCompositeKeyPropertyName() {
- return "id"; //$NON-NLS-1$
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects to be generated for this
- * table.
- */
- public List<ORMGenColumn> getColumns() {
- if (mColumns == null) {
- mColumns = new ArrayList<ORMGenColumn>();
- for (Column c : mDbTable.getColumns()) {
- ORMGenColumn genColumn = getCustomizer().createGenColumn(c);
- genColumn.setGenTable(this);
- mColumns.add(genColumn);
- }
- }
- return mColumns;
- }
-
- public List<String> getColumnNames() {
- List<String> ret = new ArrayList<String>();
- for (Column c : mDbTable.getColumns()) {
- ret.add(c.getName());
- }
- return ret;
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects representing the table's
- * primary key.
- */
- public List<ORMGenColumn> getPrimaryKeyColumns() {
- List<ORMGenColumn> ret = new ArrayList<ORMGenColumn>();
- for (Column column : mDbTable.getPrimaryKeyColumns()) {
- ret.add(new ORMGenColumn(column, this.mCustomizer));
- }
- return ret;
- }
-
- /**
- * Returns the primary key column or null if there is no or many primary key
- * columns.
- */
- public ORMGenColumn getPrimaryKeyColumn() {
- ORMGenColumn pkCol = null;
- List<ORMGenColumn> pkColumns = getPrimaryKeyColumns();
- if (pkColumns.size() == 1) {
- // Column dbCol = (Column)pkColumns.get(0);
- pkCol = pkColumns.get(0); // (ORMGenColumn)
- // mCustomizer.createGenColumn(dbCol);
- }
- else {
- /*
- * if no pk column then look for the first column with id mapping
- * kind. This is so that the wizard can be used with tables not
- * having primary keys.
- */
- List<ORMGenColumn> columns = getColumns();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (column.getMappingKind().equals(mCustomizer.getIdMappingKind())) {
- pkCol = column;
- break;
- }
- }
- }
- return pkCol;
- }
-
- /**
- * Returns true if there is more than 1 pk column.
- */
- public boolean isCompositeKey() {
- return mDbTable.getPrimaryKeyColumnsSize() > 1;
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects for the the columns that
- * are not part of any association.
- *
- * @param genOnly
- * Whether to include only the columns marked for generation.
- *
- * @param includePk
- * Whether to include the primary kley column(s).
- *
- * @param includeInherited
- * Whether to include the columns associated with Java properties
- * that exist in the super class (if any).
- */
- public List<ORMGenColumn> getSimpleColumns(boolean genOnly, boolean includePk, boolean includeInherited) {
- List<ORMGenColumn> result = new java.util.ArrayList<ORMGenColumn>();
- List<ORMGenColumn> columns = getColumns();
- List<AssociationRole> roles = getAssociationRoles();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (genOnly && !column.isGenerated()) {
- continue;
- }
- if (column.isPrimaryKey()) {
- if (!includePk || isCompositeKey()) {
- continue;
- } else {
- result.add(0, column);
- continue;
- }
- }
- else if (isColumnInAsscociation(column, roles)) {
- continue;
- }
- result.add(column);
- }
- return result;
- }
-
- public List<ORMGenColumn> getSimpleColumns() {
- return getSimpleColumns(true/* genOnly */, true/* includePk */, true/* includeInherited */);
- }
-
- /**
- * Returns false if the given column should be generated with false
- * updatable/insertable. This is the case when the column is mapped more
- * than once, this usually happen with columns in composite keys and
- * many-to-one associations.
- *
- * <br>
- * Note that for Hibernate the column param is null because the
- * insert/update attributes are specified for the many-to-one tag itself
- * instead of the nested column tags (bogus obviously).
- */
- public boolean isColumnUpdateInsert(AssociationRole role, ORMGenColumn column) {
- if (column == null) {
- for (Iterator<ORMGenColumn> iter = role.getReferrerColumns().iterator(); iter.hasNext();) {
- ORMGenColumn c = iter.next();
- if (!isColumnUpdateInsert(role, c)) {
- return false;
- }
- }
- return true;
- }
- if (column.isPrimaryKey()) {
- return false;
- }
- /*
- * should look if there are multiple associations using the same column
- * and return false, but this is probably an unusual case.
- */
- return true;
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects corresponding to the given
- * column names.
- */
- public List<ORMGenColumn> getColumnsByNames(List<String> names) {
- List<ORMGenColumn> result = new java.util.ArrayList<ORMGenColumn>();
- for (String name : names) {
- ORMGenColumn column = getColumnByName(name);
- assert (column != null);
- if (column != null) {
- result.add(column);
- }
- }
- return result;
- }
-
- /**
- * Returns the columns having the given name, or null if none.
- */
- public ORMGenColumn getColumnByName(String name) {
- List<ORMGenColumn> columns = getColumns();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (column.getName().equals(name)) {
- return column;
- }
- }
- return null;
- }
-
- /**
- * Returns the <code>AssociationRole</code> objects for this table. Only the
- * association marked for generation are returned.
- */
- public List<AssociationRole> getAssociationRoles() {
- /*
- * this is not cached intentionally because invalidating the cache with
- * wizard changes is kinda tricky.
- */
- List<AssociationRole> associationRoles = new ArrayList<AssociationRole>();
- String name = getName();
- List<Association> associations = mCustomizer.getAssociations();
- for (Iterator<Association> iter = associations.iterator(); iter.hasNext();) {
- Association association = iter.next();
- if (!association.isGenerated()) {
- continue;
- }
- /*
- * check both referrerand referenced because an association could be
- * from-to the same table (employee/manager)
- */
- if (association.getReferrerTable().getName().equals(name)) {
- AssociationRole role = association.getReferrerRole();
- if (role != null) {
- associationRoles.add(role);
- }
- }
- if (association.getReferencedTable().getName().equals(name)) {
- AssociationRole role = association.getReferencedRole();
- if (role != null) {
- associationRoles.add(role);
- }
- }
- }
- return associationRoles;
- }
-
- public String getClassDescription() {
- return customized(CLASS_DESC);
- }
-
- /**
- * Returns the generated class scope, one of {@link #PUBLIC_SCOPE}|
- * {@link #PROTECTED_SCOPE} |{@link #PRIVATE_SCOPE}. This method never
- * returns null (defaults to public).
- */
- public String getClassScope() {
- String scope = customized(CLASS_SCOPE);
- if (scope == null) {
- scope = PUBLIC_SCOPE;
- }
- return scope;
- }
-
- public String getExtends() {
- return customized(EXTENDS);
- }
-
- public void setExtends(String baseClass) {
- setCustomized(EXTENDS, baseClass);
- }
-
- public List<String> getImplements() {
- String str = customized(IMPLEMENTS);
- List<String> result = StringUtil.strToList(str, ',', true/* trim */);
- if (result == null) {
- result = Collections.emptyList();
- }
- return result;
- }
-
- public void setImplements(List<String> interfaces) {
- setCustomized(IMPLEMENTS, StringUtil.listToStr(interfaces, ','));
- }
-
- /**
- * Returns the string that should be generated in the Java class for extends
- * and implements.
- */
- public String generateExtendsImplements() {
- StringBuffer buffer = new StringBuffer();
- String extendsClass = getExtends();
- if (extendsClass != null && !extendsClass.equals("java.lang.Object") && !extendsClass.equals("Object")) {
- buffer.append("extends " + simplifyClassName(extendsClass) + " "); //fix for bug 278626
- }
- buffer.append("implements Serializable"); // assuming that the Java
- // file template imports the
- // java.io.Serializable
- for (Iterator<String> iter = getImplements().iterator(); iter.hasNext();) {
- buffer.append(", " + simplifyClassName(iter.next()));
- }
- return buffer.toString();
- }
-
- private String simplifyClassName(String fullClassName) {
- final String JAVA_LANG = "java.lang.";
- if (fullClassName.startsWith(JAVA_LANG)) {
- return fullClassName.substring(JAVA_LANG.length());
- }
- String pkg = StringUtil.getPackageName(fullClassName);
- if (pkg != null && StringUtil.equalObjects(pkg, getPackage())) {
- return StringUtil.getClassName(fullClassName);
- }
- return fullClassName;
- }
-
- /**
- * Returns the id generator scheme (assigned, sequence, etc). Does not
- * return null, defaults to "assigned" or "identity" depending on whether
- * the table has an identity column.
- */
- public String getIdGenerator() {
- String generator = customized(ID_GENERATOR);
- String noneGenerator = getCustomizer().getNoIdGenerator();
- if (!isDefaultsTable()) {
- /*
- * This is done mainly because there might be cases where some
- * tables have autoinctement pk and others are assigned. In this
- * case this makes it so that it is possible to have a "none"
- * default value that is interpreted depending on the case.
- */
- if (generator == null || generator.equals(noneGenerator)) {
- ORMGenColumn pkColumn = getPrimaryKeyColumn();
- if (pkColumn != null && DTPUtil.isAutoIncrement(pkColumn.getDbColumn())) {
- generator = getCustomizer().getIdentityIdGenerator();
- }
- }
- }
- if (generator == null) {
- generator = noneGenerator;
- }
- return generator;
- }
-
- /**
- * Changes the id generator scheme (assigned, sequence, etc).
- */
- public void setIdGenerator(String scheme) {
- setCustomized(ID_GENERATOR, scheme);
- }
-
- /**
- * Returns the sequence name for the given table, or null if none (makes
- * sense only when the scheme is native, sequence, ..).
- */
- public String getSequence() {
- return customized(SEQUENCE);
- }
-
- public void setSequence(String name) {
- setCustomized(SEQUENCE, name);
- }
-
- /**
- * Returns the sequence name after replacing the ${table} and ${pk} by their
- * values, or null if none.
- */
- public String getFormattedSequence() {
- String sequence = getSequence();
- if (sequence != null) {
- /* resolve the ${table} and ${pk} patterns */
- sequence = StringUtil.strReplace(sequence, TABLE_SEQ_PATTERN, getName());
- if (sequence.indexOf(PK_SEQ_PATTERN) >= 0) {
- Iterator<Column> pkCols = getDbTable().getPrimaryKeyColumns().iterator();
- String pkName = pkCols.hasNext() ? pkCols.next().getName() : null;
- sequence = StringUtil.strReplace(sequence, PK_SEQ_PATTERN, pkName);
- }
- }
- return sequence != null ? sequence.toUpperCase() : "";
- }
-
- public boolean isImplementEquals() {
- return !"true".equals(customized(IMPLEMENT_EQUALS)); // defaults to
- // false
- }
-
- public void setImplementEquals(boolean value) {
- setCustomizedBoolean(IMPLEMENT_EQUALS, value, true);
- }
-
- /**
- * Returns true if there is any column participating in equals/hashcode.
- */
- public boolean hasColumnsInEquals() {
- List<ORMGenColumn> columns = getSimpleColumns();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (column.isUseInEquals()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns {@link #GENERATE_DDL_ANNOTATION} indicating whether the optional
- * DDL parameters like length, nullable, unqiue, etc should be generated in @Column
- * annotation. defaults to false.
- */
- public boolean isGenerateDDLAnnotations() {
- return "true".equals(customized(ORMGenCustomizer.GENERATE_DDL_ANNOTATION)); // defaults
- // to
- // false
- }
-
- public void setGenerateDDLAnnotations(boolean generate) {
- setCustomizedBoolean(ORMGenCustomizer.GENERATE_DDL_ANNOTATION, generate, false);
- }
-
- /**
- * Returns one of {@link #PROPERTY_ACCESS}|{@link #FIELD_ACCESS} indicating
- * how the entity properties are mapped. Does not return null (defaults to
- * {@link #FIELD_ACCESS}).
- */
- public String getAccess() {
- String name = customized(ACCESS);
- if (name == null) {
- name = FIELD_ACCESS;
- }
- return name;
- }
-
- public void setAccess(String access) {
- assert (access == null || access.equals(PROPERTY_ACCESS) || access.equals(FIELD_ACCESS));
- if (!StringUtil.equalObjects(access, getAccess())) {
- setCustomized(ACCESS, access);
- }
- }
-
- /**
- * Returns one of {@link #LAZY_FETCH}|{@link #EAGER_FETCH} indicating how
- * the table associations are feched. Returns null if the provider defaults
- * should be used.
- */
- public String getDefaultFetch() {
- return customized(DEFAULT_FETCH);
- }
-
- public void setDefaultFetch(String fetch) {
- assert (fetch == null || fetch.equals(LAZY_FETCH) || fetch.equals(EAGER_FETCH));
- setCustomized(DEFAULT_FETCH, fetch);
- }
-
- public String[] getSupportedCollectionTypes() {
- return new String[] {
- SET_COLLECTION_TYPE, LIST_COLLECTION_TYPE
- };
- }
-
- /**
- * Returns one of {@link #LIST_COLLECTION_TYPE}|{@link #SET_COLLECTION_TYPE}
- * indicating the Java type (full class name) used for properties of
- * collection types. This does not return null (defaults to list).
- */
- public String getDefaultCollectionType() {
- String cType = customized(DEFAULT_COLLECTION_TYPE);
- if (cType == null) {
- cType = SET_COLLECTION_TYPE;
- }
- return cType;
- }
-
- public String getSimpleCollectionType(){
- String type = getDefaultCollectionType();
- return type.substring( type.lastIndexOf('.') +1 );
- }
-
- public void setDefaultCollectionType(String cType) {
- assert (cType.equals(LIST_COLLECTION_TYPE) || cType.equals(SET_COLLECTION_TYPE));
- setCustomized(DEFAULT_COLLECTION_TYPE, cType);
- }
-
- /**
- * Returns true if the primary key is compound and any of its columns should
- * be included in the <code>equals</code> method implementation.
- */
- public boolean isCompoundKeyUseInEquals() {
- if (isCompositeKey()) {
- for (Iterator<ORMGenColumn> iter = getPrimaryKeyColumns().iterator(); iter.hasNext();) {
- ORMGenColumn column = iter.next();
- if (column.isUseInEquals()) {
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean isRoleUseInEquals(AssociationRole role) {
- for (Iterator<ORMGenColumn> iter = role.getReferrerColumns().iterator(); iter.hasNext();) {
- ORMGenColumn column = iter.next();
- if (column.isUseInEquals()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return true if the values of name element in the @Table is default so we
- * can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefaultname() {
- String entityName = getClassName();
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().buildTableAnnotationName(entityName, mDbTable);
- return annotationName == null;
- }
-
- /**
- * Qualifies a class name if there is a package.
- */
- private String qualify(String className) {
- String pkg = getPackage();
- if (pkg != null && pkg.length() != 0) {
- className = pkg + '.' + className;
- }
- return className;
- }
-
- /**
- * Returns true if the given column is part of any association.
- */
- private boolean isColumnInAsscociation(ORMGenColumn column, List<AssociationRole> roles) {
- for (int i = 0, n = roles.size(); i < n; ++i) {
- AssociationRole role = roles.get(i);
- List<ORMGenColumn> cols = role.getReferrerColumns();
- for (ORMGenColumn col : cols) {
- if (col.getName().equals(column.getName())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Print the clause to be used in the generated equals() method
- *
- * @return String
- */
- public String getPrimaryKeyEqualsClause() {
- StringBuilder buf = new StringBuilder();
- Iterator<ORMGenColumn> columns = this.getPrimaryKeyColumns().iterator();
- while (columns.hasNext()) {
- this.printPrimaryKeyEqualsClauseOn(columns.next(), buf);
- if (columns.hasNext()) {
- buf.append("\n");
- buf.append("\t\t\t");
- buf.append("&& ");
- }
- }
- buf.append(";");
- return buf.toString();
- }
-
- private void printPrimaryKeyEqualsClauseOn(ORMGenColumn column, StringBuilder buf) {
- String fieldName = column.getPropertyName();
- JavaType javaType = column.getDbColumn().getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveEqualsClauseOn(fieldName, buf);
- }
- else {
- this.printReferenceEqualsClauseOn(fieldName, buf);
- }
- }
-
- private void printPrimitiveEqualsClauseOn(String fieldName, StringBuilder buf) {
- buf.append("(this.");
- buf.append(fieldName);
- buf.append(" == castOther.");
- buf.append(fieldName);
- buf.append(')');
- }
-
- private void printReferenceEqualsClauseOn(String fieldName, StringBuilder buf) {
- buf.append("this.");
- buf.append(fieldName);
- buf.append(".equals(castOther.");
- buf.append(fieldName);
- buf.append(')');
- }
-
- /**
- * Print the clause to be used in the generated hasCode() method
- *
- * @return String
- */
- public String getPrimaryKeyHashCodeClause() {
- StringBuilder buf = new StringBuilder();
- Iterator<ORMGenColumn> columns = this.getPrimaryKeyColumns().iterator();
- while (columns.hasNext()) {
- buf.append("hash = hash * prime + ");
- this.printPrimaryKeyHashCodeClauseOn(columns.next(), buf);
- buf.append(';');
- buf.append('\n');
- buf.append("\t\t");
- }
- return buf.toString();
- }
-
- private void printPrimaryKeyHashCodeClauseOn(ORMGenColumn column, StringBuilder buf) {
- String fieldName = column.getPropertyName();
- JavaType javaType = column.getDbColumn().getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveHashCodeClauseOn(javaType.getElementTypeName(), fieldName, buf);
- }
- else {
- this.printReferenceHashCodeClauseOn(fieldName, buf);
- }
- }
-
- private void printPrimitiveHashCodeClauseOn(String primitiveName, String fieldName, StringBuilder buf) {
- if (primitiveName.equals("int")) {
- // this.value
- buf.append("this.");
- buf.append(fieldName);
- }
- else if (primitiveName.equals("short") || primitiveName.equals("byte") || primitiveName.equals("char")) { // explicit
- // cast
- // ((int) this.value)
- buf.append("((int) this.");
- buf.append(fieldName);
- buf.append(')');
- }
- else if (primitiveName.equals("long")) { // cribbed from Long#hashCode()
- // ((int) (this.value ^ (this.value >>> 32)))
- buf.append("((int) (this.");
- buf.append(fieldName);
- buf.append(" ^ (this.");
- buf.append(fieldName);
- buf.append(" >>> 32)))");
- }
- else if (primitiveName.equals("float")) { // cribbed from
- // Float#hashCode()
- // java.lang.Float.floatToIntBits(this.value)
- buf.append("java.lang.Float");
- buf.append(".floatToIntBits(this.");
- buf.append(fieldName);
- buf.append(')');
- }
- else if (primitiveName.equals("double")) { // cribbed from
- // Double#hashCode()
- // ((int) (java.lang.Double.doubleToLongBits(this.value) ^
- // (java.lang.Double.doubleToLongBits(this.value) >>> 32)))
- buf.append("((int) (");
- buf.append("java.lang.Double");
- buf.append(".doubleToLongBits(this.");
- buf.append(fieldName);
- buf.append(") ^ (");
- buf.append("java.lang.Double");
- buf.append(".doubleToLongBits(this.");
- buf.append(fieldName);
- buf.append(") >>> 32)))");
- }
- else if (primitiveName.equals("boolean")) {
- // (this.value ? 1 : 0)
- buf.append("(this.");
- buf.append(fieldName);
- buf.append(" ? 1 : 0)");
- }
- else {
- throw new IllegalArgumentException(primitiveName);
- }
- }
-
- private void printReferenceHashCodeClauseOn(String fieldName, StringBuilder buf) {
- buf.append("this.");
- buf.append(fieldName);
- buf.append(".hashCode()");
- }
-
- @Override
- public String toString() {
- return "name=" + this.getName() + "; columns=" + Arrays.toString(this.getColumnNames().toArray());
- }
-
- /* class scopes */
- public static final String PUBLIC_SCOPE = "public";
-
- public static final String PROTECTED_SCOPE = "protected";
-
- public static final String PRIVATE_SCOPE = "private";
-
- /* access constants. Note that these strings are used in the ui */
- public static final String PROPERTY_ACCESS = "property";
-
- public static final String FIELD_ACCESS = "field";
-
- /*
- * default fech constants. Note that these strings are used in the gen
- * velocity templates.
- */
- public static final String DEFAULT_FETCH = "defaultFetch";
-
- public static final String LAZY_FETCH = "lazy";
-
- public static final String EAGER_FETCH = "eager";
-
- /*
- * default collection type constants. Note that these strings are used in
- * the gen velocity templates.
- */
- public static final String LIST_COLLECTION_TYPE = "java.util.List";
-
- public static final String SET_COLLECTION_TYPE = "java.util.Set";
-
- /**
- * The pattern replaced by the table name in the id generator sequence name
- * param.
- */
- public static final String TABLE_SEQ_PATTERN = "$table";
-
- /**
- * The pattern replaced by the primary key in the id generator sequence name
- * param.
- */
- public static final String PK_SEQ_PATTERN = "$pk";
-
- /* customization properties */
- private static final String PACKAGE = "package";
-
- private static final String SRC_FOLDER = "srcFolder";
-
- private static final String CLASS_NAME = "className";
-
- private static final String CLASS_DESC = "classDesc";
-
- private static final String CLASS_SCOPE = "classScope";
-
- private static final String EXTENDS = "extends";
-
- private static final String IMPLEMENTS = "implements";
-
- private static final String ID_GENERATOR = "idGenerator";
-
- private static final String SEQUENCE = "sequence";
-
- private static final String COMPOSITE_KEY_CLASS_NAME = "compositeKeyClassName";
-
- private static final String IMPLEMENT_EQUALS = "implementEquals";
-
- private static final String ACCESS = "access";
-
- private static final String DEFAULT_COLLECTION_TYPE = "defaultCollectionType";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java
deleted file mode 100644
index c805473ea7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-public interface OverwriteConfirmer {
- /**
- * Return whether the entity generator should overwrite the specified
- * file.
- */
- boolean overwrite(String className);
-
-
- final class Always implements OverwriteConfirmer {
- public static final OverwriteConfirmer INSTANCE = new Always();
- public static OverwriteConfirmer instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Always() {
- super();
- }
- // everything will be overwritten
- public boolean overwrite(String arg0) {
- return true;
- }
- @Override
- public String toString() {
- return "OverwriteConfirmer.Always"; //$NON-NLS-1$
- }
- }
-
-
- final class Never implements OverwriteConfirmer {
- public static final OverwriteConfirmer INSTANCE = new Never();
- public static OverwriteConfirmer instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Never() {
- super();
- }
- // nothing will be overwritten
- public boolean overwrite(String arg0) {
- return false;
- }
- @Override
- public String toString() {
- return "OverwriteConfirmer.Never"; //$NON-NLS-1$
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java
deleted file mode 100644
index 9dba602a26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.runtime.log.JdkLogChute;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.gen.internal.util.CompilationUnitModifier;
-import org.eclipse.jpt.jpa.gen.internal.util.FileUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.UrlUtil;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-
-/**
- * This generator will generate a package of entities for a set of tables.
- */
-public class PackageGenerator {
-
- private static final String LOGGER_NAME = "org.eclipse.jpt.entities.gen.log"; //$NON-NLS-1$
- private final JpaProject jpaProject;
- private final ORMGenCustomizer customizer;
- private final OverwriteConfirmer overwriteConfirmer;
-
- public static void generate(JpaProject jpaProject, ORMGenCustomizer customizer, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, 20);
- PackageGenerator generator = new PackageGenerator(jpaProject, customizer, overwriteConfirmer);
- sm.worked(1);
- try {
- generator.doGenerate(sm.newChild(19));
- } catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Error_Generating_Entities, e));
- }
- }
-
- private PackageGenerator(JpaProject jpaProject, ORMGenCustomizer customizer, OverwriteConfirmer confirmer) {
- super();
- this.jpaProject = jpaProject;
- this.customizer = customizer;
- this.overwriteConfirmer = confirmer;
- }
-
- private Object getCustomizer() {
- return this.customizer;
- }
-
- private IJavaProject getJavaProject(){
- return this.jpaProject.getJavaProject();
- }
-
-
- protected void doGenerate(IProgressMonitor monitor) throws Exception {
- generateInternal(monitor);
- }
-
- protected void generateInternal(IProgressMonitor monitor) throws Exception {
- File templDir = prepareTemplatesFolder();
-
- List<String> genClasses = new java.util.ArrayList<String>();
- List<String> tableNames = this.customizer.getGenTableNames();
-
- /* .java per table, persistence.xml, refresh package folder */
- SubMonitor sm = SubMonitor.convert(monitor, tableNames.size() + 2);
-
-
- for (Iterator<String> iter = tableNames.iterator(); iter.hasNext();) {
- if (sm.isCanceled()) {
- return;
- }
- String tableName = iter.next();
- ORMGenTable table = this.customizer.getTable(tableName);
-
- String className = table.getQualifiedClassName();
-
- generateClass(table, templDir.getAbsolutePath(), sm.newChild(1, SubMonitor.SUPPRESS_NONE));
-
- genClasses.add(className);
- /*
- * add the composite key class to persistence.xml because some
- * JPA provider(e.g. Kodo) requires it. Hibernate doesn't seem to care).
- */
- if (table.isCompositeKey()) {
- genClasses.add(table.getQualifiedCompositeKeyClassName());
- }
- }
- if (sm.isCanceled()) {
- return;
- }
-
- //update persistence.xml
- if (this.customizer.updatePersistenceXml()) {
- updatePersistenceXml(genClasses);
- }
- sm.worked(2);
- }
-
- private void updatePersistenceXml(final List<String> genClasses) {
- JpaXmlResource resource = this.jpaProject.getPersistenceXmlResource();
- if (resource == null) {
- //the resource would only be null if the persistence.xml file had an invalid content type,
- //do not attempt to update
- return;
- }
-
- resource.modify(new Runnable() {
- public void run() {
- Persistence persistence = PackageGenerator.this.jpaProject.getRootContextNode().getPersistenceXml().getPersistence();
- if (persistence == null) {
- // invalid content, do not attempt to update
- return;
- }
- PersistenceUnit persistenceUnit;
- // create a persistence unit if one doesn't already exist
- if (persistence.getPersistenceUnitsSize() == 0) {
- persistenceUnit = persistence.addPersistenceUnit();
- persistenceUnit.setName(PackageGenerator.this.jpaProject.getName());
- } else {
- // we only support one persistence unit - take the first one
- persistenceUnit = persistence.getPersistenceUnits().iterator().next();
- }
- for (Iterator<String> stream = genClasses.iterator(); stream.hasNext();) {
- String className = stream.next();
- if (CollectionTools.isEmpty(persistenceUnit.getMappingFileRefsContaining(className)) && !persistenceUnit.specifiesPersistentType(className)) {
- persistenceUnit.addSpecifiedClassRef(className);
- }
- }
- }
- });
- }
-
- private File prepareTemplatesFolder() throws IOException, Exception,
- CoreException {
- //Prepare the Velocity template folder:
- //If the plug-in is packaged as a JAR, we need extract the template
- //folder into the plug-in state location. This is required by Velocity
- //since we use included templates.
- Bundle bundle = Platform.getBundle(JptJpaGenPlugin.PLUGIN_ID);
- String templatesPath = "templates/entities/"; //$NON-NLS-1$
- Path path = new Path( templatesPath);
- URL url = FileLocator.find(bundle, path, null);
- if (url == null) {
- throw new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + " "+ JptJpaGenPlugin.PLUGIN_ID + "/" + templatesPath) );//$NON-NLS-1$
- }
- URL templUrl = FileLocator.resolve(url);
-
- //Have this check so that the code would work in both PDE and JARed plug-in at runtime
- File templDir = null;
- if (UrlUtil.isJarUrl(templUrl)) {
- templDir = FileUtil.extractFilesFromBundle( templUrl, bundle, templatesPath );
- } else {
- templDir = UrlUtil.getUrlFile(templUrl);
- }
-
-
- if (templDir == null || !templDir.exists()) {
- throw new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + " "+ JptJpaGenPlugin.PLUGIN_ID ) );//$NON-NLS-1$
- }
- return templDir;
- }
-
- /**
- * Saves/Creates the .java file corresponding to a database table
- * with the given content.
- *
- * @param templDir The velocity template file directory. It is assumed
- * that this directory contains the 2 files <em>main.java.vm</em>
- * and <em>pk.java.vm</em>
- * @param progress
- */
- protected void generateClass(ORMGenTable table, String templateDirPath, IProgressMonitor monitor) throws Exception {
-
- String subTaskName = NLS.bind(JptGenMessages.EntityGenerator_taskName, table.getName());
- SubMonitor sm = SubMonitor.convert(monitor, subTaskName, 10);
-
- try {
- IFolder javaPackageFolder = getJavaPackageFolder(table, monitor);
- IFile javaFile = javaPackageFolder.getFile( table.getClassName() + ".java"); //$NON-NLS-1$
-
- if (javaFile.exists()) {
- if (this.overwriteConfirmer != null && !this.overwriteConfirmer.overwrite(javaFile.getName())) {
- return;
- }
- }
- //JdkLogChute in this version of Velocity not allow to set log level
- //Workaround by preset the log level before Velocity is initialized
- Logger logger = Logger.getLogger( LOGGER_NAME );
- logger.setLevel( Level.SEVERE );
-
- Properties vep = new Properties();
- vep.setProperty("file.resource.loader.path", templateDirPath); //$NON-NLS-1$
- vep.setProperty( JdkLogChute.RUNTIME_LOG_JDK_LOGGER, LOGGER_NAME );
- VelocityEngine ve = new VelocityEngine();
- ve.init(vep);
- sm.worked(2);
-
- generateJavaFile(table, javaFile, ve, "main.java.vm", true/*isDomainClass*/, sm.newChild(6)); //$NON-NLS-1$
-
- if (table.isCompositeKey()) {
- IFile compositeKeyFile = javaPackageFolder.getFile( table.getCompositeKeyClassName()+".java"); //$NON-NLS-1$
- generateJavaFile(table, compositeKeyFile, ve, "pk.java.vm", false/*isDomainClass*/, sm.newChild(1)); //$NON-NLS-1$
- }
- else {
- sm.setWorkRemaining(1);
- }
- javaFile.refreshLocal(1, sm.newChild(1));
-
- } catch (Throwable e) {
- CoreException ce = new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + "" + JptJpaGenPlugin.PLUGIN_ID , e) );//$NON-NLS-1$
- JptJpaGenPlugin.logException( ce );
- }
- }
-
- private void generateJavaFile(ORMGenTable table, IFile javaFile, VelocityEngine ve
- , String templateName, boolean isDomainClass, IProgressMonitor monitor) throws Exception {
- VelocityContext context = new VelocityContext();
- context.put("table", table); //$NON-NLS-1$
- context.put("customizer", getCustomizer()); //$NON-NLS-1$
-
- StringWriter w = new StringWriter();
- ve.mergeTemplate(templateName, context, w);
-
- String fileContent = w.toString();
- if (javaFile.exists()) {
- if (isDomainClass) {
- updateExistingDomainClass(table.getQualifiedClassName(), javaFile, fileContent);
- } else {
- byte[] content = fileContent.getBytes(javaFile.getCharset());
- javaFile.setContents(new ByteArrayInputStream(content), true, true, monitor);
- }
- } else {
- byte[] content = fileContent.getBytes(javaFile.getCharset());
- createFile(javaFile, new ByteArrayInputStream(content));
- }
- }
-
-
- /**
- * Updates the (existing) Java file corresponding to the given class.
- *
- * @param className The qualified class name.
- *
- * @param javaFile The existing Java file of the class to update.
- *
- * @param fileContent The new file content.
- */
- protected void updateExistingDomainClass(String className, IFile javaFile, String fileContent) throws Exception {
- /*use CompilationUnitModifier instead of calling WideEnv.getEnv().setFileContent
- * so that if the unit is up to date if it is used before file change
- * notifications are delivered (see EJB3ImportSchemaWizard.updateExistingDomainClass for example)*/
- CompilationUnitModifier modifier = new CompilationUnitModifier(this.getJavaProject(), className);
- modifier.setJavaSource(fileContent);
- modifier.save();
- }
-
- public void createFile(IFile file, java.io.InputStream contents) throws CoreException {
- file.create(contents, false, null/*monitor*/);
- }
-
- public IFolder getJavaPackageFolder(ORMGenTable table, IProgressMonitor monitor) throws CoreException {
- IPackageFragmentRoot root = getDefaultJavaSourceLocation(this.getJavaProject(), table.getSourceFolder());
- String packageName = table.getPackage();
- if (packageName == null) packageName = ""; //$NON-NLS-1$
- IPackageFragment packageFragment = root.getPackageFragment(packageName);
- if( !packageFragment.exists()){
- root.createPackageFragment(packageName, true, monitor);
- }
- return (IFolder) packageFragment.getResource();
- }
-
- private IPackageFragmentRoot getDefaultJavaSourceLocation(IJavaProject jproject, String sourceFolder){
- IPackageFragmentRoot defaultSrcPath = null;
- if (jproject != null && jproject.exists()) {
- try {
- IPackageFragmentRoot[] roots = jproject.getPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE ){
- if (defaultSrcPath == null) {
- defaultSrcPath = roots[i];
- }
- String path = roots[i].getPath().toString();
- if (path.equals('/' + sourceFolder)) {
- return roots[i] ;
- }
- }
- }
- } catch (JavaModelException e) {
- JptJpaGenPlugin.logException(e);
- }
- }
- return defaultSrcPath;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java
deleted file mode 100644
index daeecd6458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-/**
- * TODO: merge with JPA class ?
- * The JPA mapping tag and attribute names.
- *
- */
-public class TagNames
-{
- public static final String BASIC_TAG = "basic";
- public static final String CASCADE_TAG = "cascade";
- public static final String COLUMN_TAG = "column";
- public static final String EMBEDDED_TAG = "embedded";
- public static final String EMBEDDED_ID_TAG = "embedded-id";
- public static final String GENERATED_VALUE_TAG = "generated-value";
- public static final String ID_TAG = "id";
- public static final String ID_CLASS_TAG = "id";
- public static final String JOIN_COLUMN_TAG = "join-column";
- public static final String INVERSE_JOIN_COLUMN_TAG = "inverse-join-column";
- public static final String LOB_TAG = "lob";
- public static final String MANY_TO_MANY_TAG = "many-to-many";
- public static final String MANY_TO_ONE_TAG = "many-to-one";
- public static final String MAPPED_BY_TAG = "mapped-by";
- public static final String ONE_TO_MANY_TAG = "one-to-many";
- public static final String ONE_TO_ONE_TAG = "one-to-one";
- public static final String PK_JOIN_COLUMN_TAG = "primary-key-join-column";
- public static final String TABLE_TAG = "table";
- public static final String VERSION_TAG = "version";
- public static final String JOIN_TABLE_TAG = "join-table";
-
- /*cascade tags*/
- public static final String ALL_CASCADE = "all";
- public static final String PERSIST_CASCADE = "persist";
- public static final String MERGE_CASCADE = "merge";
- public static final String REMOVE_CASCADE = "remove";
- public static final String REFRESH_CASCADE = "refresh";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java
deleted file mode 100644
index 4ca46e1e5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTParser;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jface.text.Document;
-import org.eclipse.text.edits.TextEdit;
-
-
-/**
- * Performs the grunt work needed for modifying a compilation
- * unit and performs the modified compilation unit save.
- *
- * The typical usage is as follows:
- * <ol><li>Create an instance.
- *
- * <li>Modify the compilation unit using AST operations performed
- * on the node returned by {@link #getCompilationUnitNode()}.
- * Alternatively you can call <code>setJavaSource</code> to change the entire source code.
- *
- * <li>Call the {@link #save()} method.
- *
- */
-public class CompilationUnitModifier
-{
- private IJavaProject mProject;
- private ICompilationUnit mCompilationUnit;
- private CompilationUnit mCompilationUnitNode;
- private Document mDocument;
-
- public CompilationUnitModifier(IJavaProject project, String className) throws Exception {
- super();
-
- mProject = project;
-
- IType type = project.findType(className);
- if (type == null) {
- throw new Exception("The class " + className + " does not exist.");
- }
- mCompilationUnit = type.getCompilationUnit();
- if (mCompilationUnit == null) {
- throw new Exception("The source code for " + className + " does not exist.");
- }
- }
- public CompilationUnitModifier(IJavaProject project, ICompilationUnit cu) throws Exception {
- super();
-
- mProject = project;
- mCompilationUnit = cu;
- }
- public CompilationUnitModifier(IJavaProject project, ICompilationUnit cu, CompilationUnit cuNode) throws Exception {
- super();
-
- mProject = project;
- mCompilationUnit = cu;
- mCompilationUnitNode = cuNode;
-
- getCompilationUnitNode(); //to create mDocument (the caller in this case does not have to call getCompilationUnitNode)
- }
- public ICompilationUnit getCompilationUnit() {
- return mCompilationUnit;
- }
- /**
- * Returns the compilation unit node that should be used for
- * tyhe modification AST operations.
- */
- public CompilationUnit getCompilationUnitNode() {
- if (mCompilationUnitNode == null) {
- ASTParser c = ASTParser.newParser(AST.JLS3);
- c.setSource(mCompilationUnit);
- c.setResolveBindings(true);
- mCompilationUnitNode = (CompilationUnit)c.createAST(null);
- }
- if (mDocument == null) {
- try {
- mDocument = new Document(mCompilationUnit.getBuffer().getContents());
- } catch (JavaModelException e) {
- e.printStackTrace();
- }
-
- mCompilationUnitNode.recordModifications();
- }
-
- return mCompilationUnitNode;
- }
- /**
- * Changes the entire Java source code of the compilation unit.
- */
- public void setJavaSource(String newSource) {
- try {
- mCompilationUnit.getBuffer().setContents(newSource);
- } catch (JavaModelException e) {
- e.printStackTrace();
- }
- }
- /**
- * Saves the compilation unit modifications.
- */
- public void save() throws Exception {
- if (mCompilationUnitNode != null) {
- assert(mDocument != null); //see getCompilationUnitNode
-
- //computation of the text edits
- TextEdit edits = mCompilationUnitNode.rewrite(mDocument, mProject.getOptions(true));
- //computation of the new source code
- edits.apply(mDocument);
- String newSource = mDocument.get();
- // update of the compilation unit
- mCompilationUnit.getBuffer().setContents(newSource);
- }
-
- if (mCompilationUnit.isWorkingCopy()) {
- mCompilationUnit.commitWorkingCopy(true/*force*/, null/*monitor*/);
- } else {
- mCompilationUnit.save(null/*monitor*/, true/*force*/);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java
deleted file mode 100644
index ec2280ae21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.db.ForeignKey.ColumnPair;
-
-/**
- * Collection of utility methods to access DTP and other jpt.db APIs
- *
- */
-public class DTPUtil {
-
- public static boolean isAutoIncrement(Column c){
- //@ TODO
- //Blocked by DTP bug
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=250023
- //The Dali bug is
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=249658
- //
- return false;
- }
-
- /**
- * Return list of fk
- * @param dbTable
- * @return
- */
- public static List<ForeignKeyInfo> getForeignKeys(Table dbTable) {
- List<ForeignKeyInfo> ret = new ArrayList<ForeignKeyInfo>();
- if(dbTable!=null){
- for (ForeignKey fk : dbTable.getForeignKeys()) {
- Iterator<ColumnPair> columnPaires = fk.getColumnPairs().iterator();
- ForeignKeyInfo fkInfo = null;
- while( columnPaires.hasNext() ){
- ColumnPair columnPair = columnPaires.next();
- if( fkInfo == null){
- String tableName = dbTable.getName();
- String referencedTableName = "";
- Table referencedTable = fk.getReferencedTable();
- referencedTableName = referencedTable.getName();
- fkInfo = new ForeignKeyInfo(fk, tableName, referencedTableName );
- }
- String baseColName = columnPair.getBaseColumn().getName();
- String referencedColName = columnPair.getReferencedColumn().getName();
- fkInfo.addColumnMapping( baseColName, referencedColName );
- }
- if( fkInfo !=null )
- ret.add( fkInfo );
- }
- }
- return ret;
- }
-
- public static String getJavaType(Column dbColumn) {
- return dbColumn.isPartOfPrimaryKey() ?
- dbColumn.getPrimaryKeyJavaTypeDeclaration() :
- dbColumn.getJavaTypeDeclaration();
- }
-
- public static boolean isDefaultSchema(Table dbTable){
- String schemaName = dbTable.getSchema().getName();
- Schema defaultSchema = dbTable.getSchema().getDatabase().getDefaultSchema();
- return defaultSchema.getName() == schemaName;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java
deleted file mode 100644
index faa48c38e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.utility.internal.NameTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Utility methods for entity generation.
- */
-public class EntityGenTools {
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * class name.
- * @see #convertToUniqueJavaStyleIdentifier(String, boolean, Collection)
- */
- public static String convertToUniqueJavaStyleClassName(String identifier, Collection<String> classNames) {
- return convertToUniqueJavaStyleIdentifier(identifier, true, classNames);
- }
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * attribute (field/property) name.
- * @see #convertToUniqueJavaStyleIdentifier(String, boolean, Collection)
- */
- public static String convertToUniqueJavaStyleAttributeName(String identifier, Collection<String> attributeNames) {
- return convertToUniqueJavaStyleIdentifier(identifier, false, attributeNames);
- }
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * identifier:
- * - if the identifier is all-caps, convert underscores to "camel case"
- * - if the identifier is not all-caps, leave it unchanged (except, possibly, for the first letter)
- * - convert to a legal Java identifier
- * - eliminate illegal characters
- * - if the result is a reserved word, modify it slightly
- * If the result is already one of the specified existing identifiers
- * (ignoring case so we don't have filename collisions on Windows),
- * modify it slightly again.
- * "FOO" => "Foo" or "foo"
- * "FOO_BAR" => "FooBar" or "fooBar"
- * "PACKAGE" => "Package" or "package_"
- */
- public static String convertToUniqueJavaStyleIdentifier(String identifier, boolean capitalizeFirstLetter, Collection<String> identifiers) {
- String result = identifier;
- if (StringTools.stringIsUppercase(result) || StringTools.stringIsLowercase(result)) {
- // leave mixed case identifiers alone?
- result = StringTools.convertUnderscoresToCamelCase(result, capitalizeFirstLetter);
- } else {
- result = capitalizeFirstLetter ? StringTools.capitalize(result) : StringTools.uncapitalize(result);
- }
- result = NameTools.convertToJavaIdentifier(result);
- // assume that converting to a unique name will not result in a Java reserved word
- // (since no Java reserved words end with a number)
- result = NameTools.uniqueNameForIgnoreCase(result, identifiers);
- return result;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private EntityGenTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java
deleted file mode 100644
index 8cab9042d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.jar.JarInputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jpt.jpa.gen.internal.JptGenMessages;
-
-import org.eclipse.osgi.service.datalocation.Location;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-
-/**
- * Collections of utility methods handling files.
- *
- */
-public class FileUtil
-{
-
- public static void deleteFolder(File folder)
- throws IOException
- {
- File[] files = folder.listFiles();
- //empty the folder first (java.io.file.delete requires it empty)
- if (files != null) {
- for (int i = 0; i < files.length; ++i) {
- File f = files[i];
- if (f.isDirectory())
- deleteFolder(f);
- else
- deletePath(f);
- }
- }
- deletePath(folder);
- }
-
- public static void deletePath(File f)
- throws IOException
- {
- if (!f.delete()) {
- String msgId = f.isDirectory() ? JptGenMessages.Delete_Folder_Error : JptGenMessages.Delete_File_Error;
- throw new IOException( NLS.bind(msgId,f.getPath()));
- }
- }
-
- public static byte[] readFile(File src)
- throws IOException
- {
- java.io.FileInputStream fin = new java.io.FileInputStream(src);
- try {
- long fileLen = src.length();
- if (fileLen > Integer.MAX_VALUE)
- throw new IOException("file length too big to be read by FileUtil.readFile: " + fileLen);
-
- byte[] bytes = new byte[(int)fileLen];
- fin.read(bytes);
- return bytes;
- }
- finally {
- fin.close();
- }
- }
-
- public static void writeFile(File dest, byte[] bytes)
- throws IOException
- {
- if (dest.exists() && !dest.canWrite())
- throw new IOException( NLS.bind(JptGenMessages.File_Read_Only_Error, dest.getPath())); //throw with a clear error because otherwise FileOutputStream throws FileNotFoundException!
- java.io.FileOutputStream fout = new java.io.FileOutputStream(dest.getPath(), false/*append*/);
- try {
- fout.write(bytes);
- }
- finally {
- fout.flush();
- fout.close();
- }
- }
-
- /**
- * Returns the url for a file.
- * This basically the same as file.toUrl() but without the non-sense exception.
- */
- public static URL getFileUrl(File file) {
- try {
- return file.toURI().toURL();
- } catch (MalformedURLException e) {
- return null; //should not happen as file.toURL() does not really throw an exception
- }
- }
-
- public static void setFileContent(File file, java.io.InputStream contents) throws java.io.IOException {
- Path path = new Path(file.getAbsolutePath());
- try {
- IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- if (iFile == null) {
- throw new IOException("The path " + file + " does not seem to be a valid file path.");
- }
- iFile.setContents(contents, true/*force*/, true/*keepHistory*/, null/*monitor*/);
- } catch (CoreException ex) {
- throw new IOException(ex.getMessage());
- }
- }
-
- /**
- * Extract the contents of a Jar archive to the specified destination.
- */
- public static void unjar(InputStream in, File dest) throws IOException {
- if (!dest.exists()) {
- dest.mkdirs();
- }
- if (!dest.isDirectory()) {
- throw new IOException("Destination must be a directory.");//$NON-NLS-1$
- }
- JarInputStream jin = new JarInputStream(in);
- byte[] buffer = new byte[1024];
-
- ZipEntry entry = jin.getNextEntry();
- while (entry != null) {
- String fileName = entry.getName();
- if (fileName.charAt(fileName.length() - 1) == '/') {
- fileName = fileName.substring(0, fileName.length() - 1);
- }
- if (fileName.charAt(0) == '/') {
- fileName = fileName.substring(1);
- }
- if (File.separatorChar != '/') {
- fileName = fileName.replace('/', File.separatorChar);
- }
- File file = new File(dest, fileName);
- if (entry.isDirectory()) {
- // make sure the directory exists
- file.mkdirs();
- jin.closeEntry();
- } else {
- // make sure the directory exists
- File parent = file.getParentFile();
- if (parent != null && !parent.exists()) {
- parent.mkdirs();
- }
-
- // dump the file
- OutputStream out = new FileOutputStream(file);
- int len = 0;
- while ((len = jin.read(buffer, 0, buffer.length)) != -1) {
- out.write(buffer, 0, len);
- }
- out.flush();
- out.close();
- jin.closeEntry();
- file.setLastModified(entry.getTime());
- }
- entry = jin.getNextEntry();
- }
- /* Explicitly write out the META-INF/MANIFEST.MF so that any headers such
- as the Class-Path are seen for the unpackaged jar
- */
- Manifest mf = jin.getManifest();
- if (mf != null) {
- File file = new File(dest, "META-INF/MANIFEST.MF");//$NON-NLS-1$
- File parent = file.getParentFile();
- if (parent.exists() == false) {
- parent.mkdirs();
- }
- OutputStream out = new FileOutputStream(file);
- mf.write(out);
- out.flush();
- out.close();
- }
- jin.close();
- }
-
- //Used to Unzip the a specific folder packed inside a plug-in bundle to the plug-in state location
- public static File extractFilesFromBundle( URL url, Bundle bundle, String path ) throws Exception {
- URL jarUrl = UrlUtil.getJarFileUrl(url);
- File jarFile = new File(jarUrl.getFile() );
- Location configLocation = Platform.getConfigurationLocation();
- String pluginId = bundle.getSymbolicName();
- File configFolder = new File( configLocation.getURL().getFile(), pluginId);
- File templDir = new File( configFolder, path );
- if( !templDir.exists() ){
- FileUtil.unjar( new FileInputStream( jarFile ), configFolder );
- //Delete un-related files and folders
- File[] files = configFolder.listFiles();
- for( File f : files ){
- if( f.isFile() )
- f.delete();
- else if( templDir.getPath().indexOf( f.getPath() ) !=0 ){
- FileUtil.deleteFolder(f);
- }
- }
- }
- return templDir ;
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java
deleted file mode 100644
index 70f5eb862f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.util.List;
-
-import org.eclipse.jpt.jpa.db.ForeignKey;
-
-/**
- * Represents the metadata for a particular foreign key relationship
- * in a relational database schema.
- * <p/>
- * The referrer column is one which actually contains a foreign
- * key constraint, and is equivalent to the "foreign key" column.
- * <p/>
- * The referenced column is one which a referrer or foreign key
- * column references, and is equivalent to the "primary key" column.
- *
- */
-public class ForeignKeyInfo
-{
- private transient ForeignKey mForeignKey ;
- private String mName;
- private String mReferrerTableName;
- private String mReferencedTableName;
- private List<String> mReferrerColNames = new java.util.ArrayList<String>();
- private List<String> mReferencedColNames = new java.util.ArrayList<String>();
-
- /**
- * @param fk The name of the constraint backing
- * this foreign key metadata instance.
- */
- public ForeignKeyInfo(ForeignKey fk, String referrerTableName, String referencedTableName) {
- mForeignKey = fk;
- mName = fk.getName();
- mReferrerTableName = referrerTableName;
- mReferencedTableName = referencedTableName;
- }
- /**
- * Obtain the constraint name for this foreign key specification.
- * The name for a Foreign Key may, as per the JDBC specification,
- * be <code>null</code> where the constraint is not named.
- * In addition, it may be hardly recognizable to the user,
- * particularly for DB/2 constraints.
- *
- * @return The name of the constraint backing
- * this foreign key metadata instance.
- */
- public String getName()
- {
- return mName;
- }
-
- public ForeignKey getForeignKey(){
- return mForeignKey;
- }
- /**
- * Add another pair of foreign key mappings for this foreign key
- * definition.
- *
- * @param referrerColumn The referrer column name for this mapping.
- *
- * @param referencedColumn The referenced column name for this mapping.
- */
- public void addColumnMapping(String referrerColName, String referencedColName) {
- mReferrerColNames.add(referrerColName);
- mReferencedColNames.add(referencedColName);
- }
- /**
- * Returns the referrer table name of this foreign key
- * relationship.
- */
- public String getReferrerTableName() {
- return mReferrerTableName;
- }
- /**
- * Returns the referrer column names for this
- * foreign key.
- * The size of this list is always the same as the size of
- * the list retured from <code>getReferencedColumnNames</code>
- */
- public List<String> getReferrerColumnNames() {
- return mReferrerColNames;
- }
- /**
- * Returns the referenced table name of this foreign key
- * relationship.
- */
- public String getReferencedTableName() {
- return mReferencedTableName;
- }
- /**
- * Returns the referenced column names for this
- * foreign key.
- * The size of this list is always the same as the size of
- * the list retured from <code>getReferrerColumnNames</code>
- */
- public List<String> getReferencedColumnNames() {
- return mReferencedColNames;
- }
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "name=" + mName
- + ", referrerTable=" + mReferrerTableName
- + ", referencedTable=" + mReferencedTableName
- + ", referrerColumns=" + mReferrerColNames
- + ", referencedColumns=" + mReferencedColNames
- ;
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java
deleted file mode 100644
index 99f2291e26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java
+++ /dev/null
@@ -1,648 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.beans.Introspector;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-public class StringUtil
-{
- /**
- * Pads a string by adding a sequence of an arbitrary character at the beginning.
- * @param padChar The character to be used for padding.
- * @param len The desired length after padding.
- * @return The padded string. For example if <code>str</code> is "f4e" and <code>padChar</code> is '0'
- * and <code>len</code> is 6 then this method returns "000f4e"
- */
- public static String padLeft(String str, char padChar, int len) {
- if(str == null) {
- return null;
- }
- int strLen = str.length();
- if (strLen < len) {
- StringBuffer buffer = new StringBuffer(len);
- int count = len-strLen;
- for (int i = 0; i < count; ++i)
- buffer.append(padChar);
- buffer.append(str);
- str = buffer.toString();
- }
- return str;
- }
- /**
- * Inserts a given character at the beginning and at the end of the specified string.
- * For example if the string is <tt>extreme</tt> and the char is <tt>'</tt> then
- * the returned string is <tt>'exterme'</tt>.
- */
- public static String quote(String str, char c) {
- assert(str != null);
- StringBuffer buffer = new StringBuffer(str.length()+2);
- buffer.append(c);
- buffer.append(str);
- buffer.append(c);
- return buffer.toString();
- }
- public static String doubleQuote(String str) {
- return quote(str, '"');
- }
- /**
- * Removes the first and last single or double quotes (if they exist).
- */
- public static String unquote(String quoted) {
- if (quoted != null && quoted.length() >= 2){
- int len = quoted.length();
- char firstChar = quoted.charAt(0);
- char lastChar = quoted.charAt(len-1);
- if (firstChar == lastChar && (firstChar == '\'' || firstChar == '"')) {
- return quoted.substring(1, len-1);
- }
- }
- return quoted;
- }
- /**
- * Truncates a string and adds "..." in the result string.
- * If the string length is less or equal to the max len then
- * the original string is returned.
- */
- public static String truncate(String s, int maxLen) {
- if (s == null) {
- return null;
- }
- int len = s.length();
- if (len > maxLen) {
- int segmentLen = maxLen/2;
- s = s.substring(0, segmentLen) + "..." + s.substring(len-segmentLen);
- }
- return s;
- }
- /**
- * Returns a string containing the same character repeated.
- */
- public static String repeat(char c, int count) {
- StringBuffer buffer = new StringBuffer(count);
- for (int i = 0; i < count; ++i) {
- buffer.append(c);
- }
- return buffer.toString();
- }
- /**
- * Returns the given string unless it is emtpty where it returns null.
- */
- public static String nullIfEmpty(String s) {
- if (s != null && s.length() == 0) {
- s = null;
- }
- return s;
- }
- /**
- * Returns a string containing the same characters as the argument string
- * except that the control characters are replaced by the their hex code.
- * For example if the string is "ab\nc" the returned string is "ab{0xA}c".
- */
- public static String getVisibleString(String s) {
- if (s == null)
- return null;
- int len = s.length();
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < len; ++i) {
- char c = s.charAt(i);
- if (c <= 0x1F || (c == 0x20 && (i == 0 || i == len-1))) {
- buffer.append("(0x" + Integer.toHexString((int)c).toUpperCase() + ")");
- }
- else buffer.append(c);
- }
- return buffer.toString();
- }
- /**
- * Replaces a portion of string.
- * @param str The original string.
- * @param offset The offset in the original string where the replace starts
- * @param len The replace length the original string
- * @param replaceStr The replacement string
- */
- public static String strReplace(String str, int offset, int len, String replaceStr) {
- StringBuffer buffer = new StringBuffer(str.length()-len+replaceStr.length());
- buffer.append(str.substring(0, offset));
- buffer.append(replaceStr);
- buffer.append(str.substring(offset+len));
-
- return buffer.toString();
- }
- public static String strReplace(String str, String pattern, String replaceStr)
- {
- if(str == null) {
- return null;
- }
- if(pattern == null || pattern.equals("")) {
- return str;
- }
- int index = str.indexOf(pattern);
- if (index < 0)
- return str;
-
- if (replaceStr == null)
- replaceStr = "";
- return str.substring(0, index) + replaceStr + str.substring(index + pattern.length());
- }
- public static String strReplaceAll(String str, String pattern, String replaceStr)
- {
- if(str == null) {
- return null;
- }
- if (replaceStr == null)
- replaceStr = "";
- if(pattern == null || pattern.equals("")) {
- return str;
- }
- int index = str.indexOf(pattern);
- while (index >= 0) {
- str = str.substring(0, index) + replaceStr + str.substring(index + pattern.length());
- index = str.indexOf(pattern, index+replaceStr.length());
- }
- return str;
- }
- public static String strInsert(String str, int index, String insertStr)
- {
- return str.substring(0, index)
- + insertStr
- + str.substring(index);
- }
- /**
- * Tokenize the specified string into a <code>List</code> of
- * words.
- * If the string specified is <code>null</code> or empty, this
- * method will return <code>null</code>.
- *
- * @param s The string to tokenize into a <code>List</code>.
- * @param sep The separator character to use to split
- * the string.
- * @param trim If <code>true</code>, run <code>trim</code> on
- * each element in the result <code>List</code>.
- *
- * @return A <code>List</code> containing all tokenized words
- * in the parameter string.
- * Each element is of type <code>String</code>.
- */
- public static List<String> strToList(String s, char sep, boolean trim)
- {
- //ex: if sep is ';' then s should be someting like "Red;Black"
- if (s == null || s.length() == 0)
- return null;
-
- ArrayList<String> result = new ArrayList<String>();
-
- char delimiters[] = {sep};
- java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(s, new String(delimiters), true/*returnDelimiters*/);
- String lastTok=null;
- while (tokenizer.hasMoreTokens()) {
- String tok = tokenizer.nextToken();
- if (tok.length()==1 && tok.charAt(0)==sep){//delimiter
- if (tok.equals(lastTok)||lastTok==null/*first element is empty*/)
- result.add("");
- }
- else{
- if (trim)
- tok = tok.trim();
- result.add(tok);
- }
- lastTok=tok;
- }
- if(lastTok.length()==1 && lastTok.charAt(0)==sep)//last element is empty
- result.add("");
- result.trimToSize();
- return result;
- }
- public static List<String> strToList(String s, char sep)
- {
- return strToList(s, sep, false/*trim*/);
- }
-
- @SuppressWarnings("unchecked")
- public static String listToStr(Collection a, char sep)
- {
- return listToStr(a, String.valueOf(sep));
- }
-
- public static String listToStr(Collection<Object> a, String sep) {
- //reverse of strToList
- if (a == null)
- return null;
- int count = a.size();
- if (count == 0)
- return null;
-
- StringBuffer buffer = null;
- for (Iterator<Object> iter = a.iterator(); iter.hasNext(); )
- {
- Object obj = iter.next();
- if (obj == null)
- continue;
-
- if (buffer == null)
- buffer = new StringBuffer();
- else
- buffer.append(sep);
- if (obj instanceof String)
- buffer.append((String)obj);
- else
- buffer.append(obj);
- }
- return (buffer != null) ? buffer.toString() : null;
- }
- /**
- * Convert the text of a String into a Map of Strings, where each
- * key and value in the Map is of type String.
- *
- * @param s The string to be converted to a Map.
- * @param sep1 The separator between keys and their
- * values.
- * @param sep2 The separator between key-value pairs.
- *
- * @return The string converted to a Map.
- */
- public static java.util.Map<String, String> strToMap(String s, char sep1, char sep2)
- {
- return strToMap(s, sep1, sep2, false/*lowercaseKeys*/);
- }
- /**
- * Convert the text of a String into a Map of Strings, where each
- * key and value in the Map is of type String.
- * This form also allows you to specify that all keys will be
- * converted to lower-case before adding to the Map.
- *
- * @param s The string to be converted to a Map.
- * @param sep1 The separator between keys and their
- * values.
- * @param sep2 The separator between key-value pairs.
- * @param lowercaseKeys
- * Whether to convert keys to lower case
- * before adding to the Map.
- *
- * @return The string converted to a Map.
- */
- public static java.util.Map<String, String> strToMap(String s, char sep1, char sep2, boolean lowercaseKeys)
- {
- //ex: if sep1 is ':' and sep2 is ',' then s should be something like "color:Red,size:XL"
-
- if (s == null || s.length() == 0) {
- return Collections.emptyMap();
- }
-
- java.util.List<String> a = strToList(s, sep2);
- if (a == null) {
- return Collections.emptyMap();
- }
-
- java.util.HashMap<String, String> hm = new java.util.HashMap<String, String>();
- int count = a.size();
- for (int i = 0; i < count; ++i)
- {
- String s2 = (String)a.get(i); //ex: color:Red
- int pos = s2.indexOf(sep1);
- if (pos >= 0)
- {
- String name = s2.substring(0, pos);
- String val = s2.substring(pos+1);
- if (lowercaseKeys)
- name = name.toLowerCase();
- hm.put(name, val);
- }
- }
- return hm;
- }
-
- @SuppressWarnings("unchecked")
- public static String mapToStr(java.util.Map hm, char sep1, char sep2)
- //reverse of strToMap
- {
- if (hm == null || hm.isEmpty())
- return null;
-
- StringBuffer buffer = new StringBuffer();
- java.util.Iterator<java.util.Map.Entry> iter = hm.entrySet().iterator();
- while (iter.hasNext()) {
- java.util.Map.Entry entry = (java.util.Map.Entry)iter.next();
- buffer.append(entry.getKey());
- buffer.append(sep1);
- buffer.append(entry.getValue());
- if (iter.hasNext()) {
- buffer.append(sep2);
- }
- }
- return buffer.toString();
- }
- /**
- * Perform a <em>case insensitive</em> comparison between
- * the string representations of two objects.
- *
- * @param obj1 The first object to compare.
- * @param obj2 The second object to compare.
- *
- * @return <code>true</code> if both objects have the
- * same case-insensitive string representation.
- */
- public static boolean compareAsStrings(Object obj1, Object obj2)
- {
- if (obj1 == null || obj2 == null)
- return obj1 == obj2;
-
- String s1, s2;
- if (obj1 instanceof String) {
- s1 = (String)obj1;
- } else {
- s1 = obj1.toString();
- }
- if (obj2 instanceof String) {
- s2 = (String)obj2;
- }
- else {
- s2 = obj2.toString();
- }
-
- return s1.equalsIgnoreCase(s2);
- }
- /**
- * Tests whether a string starts with any of a list of strings.
- */
- public static boolean startsWithAny(String s, List<String> prefixes) {
- int count = prefixes.size();
- for (int i = 0; i < count; ++i) {
- if (s.startsWith((String)prefixes.get(i))) {
- return true;
- }
- }
- return false;
- }
- /**
- * Returns the argument string with the first char upper-case.
- */
- public static String initUpper(String str) {
- if (str == null || str.length() == 0) {
- return str;
- }
- return Character.toUpperCase(str.charAt(0)) + str.substring(1);
- }
- /**
- * Returns the argument string with the first char lower-case.
- */
- public static String initLower(String str) {
- if (str == null || str.length() == 0) {
- return str;
- }
- return Character.toLowerCase(str.charAt(0)) + str.substring(1);
- }
- /**
- * Tests whether all characters in the given string are upper
- * case.
- */
- public static boolean isUpperCase(String s) {
- return s.toUpperCase().equals(s);
- }
- /**
- * Returns the first non-white char index starting from the
- * specified index.
- */
- public static int skipWhiteSpaces(String str, int index) {
- int len = str.length();
- while (index < len) {
- if (!Character.isWhitespace(str.charAt(index))) {
- break;
- }
- ++index;
- }
- return index;
- }
- /**
- * Collapses consecutive white spaces into one space.
- */
- public static String collapseWhiteSpaces(String str){
- String result=null;
- if (str!=null){
- StringBuffer buffer=new StringBuffer();
- boolean isInWhiteSpace=false;
- for (int i=0;i<str.length();i++){
- char c=str.charAt(i);
- if (Character.isWhitespace(c)){
- isInWhiteSpace=true;
- }
- else {
- if (isInWhiteSpace)
- buffer.append(" ");
- isInWhiteSpace=false;
- buffer.append(c);
- }
- }
- result=buffer.toString();
- }
- return result;
- }
-
- /**
- * Utility methods used to convert DB object names to
- * appropriate Java type and field name
- */
- public static String pluralise(String name) {
- String result = name;
- if (name.length() == 1) {
- result += 's';
- } else if (!seemsPluralised(name)) {
- String lower = name.toLowerCase();
- if (!lower.endsWith("data")) { //orderData --> orderDatas is dumb
- char secondLast = lower.charAt(name.length() - 2);
- if (!isVowel(secondLast) && lower.endsWith("y")) {
- // city, body etc --> cities, bodies
- result = name.substring(0, name.length() - 1) + "ies";
- } else if (lower.endsWith("ch") || lower.endsWith("s")) {
- // switch --> switches or bus --> buses
- result = name + "es";
- } else {
- result = name + "s";
- }
- }
- }
- return result;
- }
-
- public static String singularise(String name) {
- String result = name;
- if (seemsPluralised(name)) {
- String lower = name.toLowerCase();
- if (lower.endsWith("ies")) {
- // cities --> city
- result = name.substring(0, name.length() - 3) + "y";
- } else if (lower.endsWith("ches") || lower.endsWith("ses")) {
- // switches --> switch or buses --> bus
- result = name.substring(0, name.length() - 2);
- } else if (lower.endsWith("s")) {
- // customers --> customer
- result = name.substring(0, name.length() - 1);
- }
- }
- return result;
- }
- private final static boolean isVowel(char c) {
- boolean vowel = false;
- vowel |= c == 'a';
- vowel |= c == 'e';
- vowel |= c == 'i';
- vowel |= c == 'o';
- vowel |= c == 'u';
- vowel |= c == 'y';
- return vowel;
- }
- private static boolean seemsPluralised(String name) {
- name = name.toLowerCase();
- boolean pluralised = false;
- pluralised |= name.endsWith("es");
- pluralised |= name.endsWith("s");
- pluralised &= !(name.endsWith("ss") || name.endsWith("us"));
- return pluralised;
- }
-
- /**
- * Returns the package name of a class name.
- * For example if given <code>oracle.util.ObjectUtil</code> it would return
- * <code>oracle.util</code>. If the class is not in a package then null is returned.
- */
- public static String getPackageName(String className) {
- if(className == null) {
- return null;
- }
- int lastDotIndex = className.lastIndexOf('.');
- if (lastDotIndex < 0)
- return null;
- return className.substring(0, lastDotIndex);
- }
- /**
- * Returns the class name given a full class name.
- * For example if given <code>oracle.util.ObjectUtil</code> it would return
- * <code>ObjectUtil</code>
- */
- public static String getClassName(String fullClassName) {
- if(fullClassName == null) {
- return null;
- }
- int lastDotIndex = fullClassName.lastIndexOf('.');
- if (lastDotIndex < 0)
- return fullClassName;
- return fullClassName.substring(lastDotIndex+1);
- }
-
-
- /**
- * Converts a database column name to a Java variable name (<em>first letter
- * not capitalized</em>).
- */
- public static String columnNameToVarName(String columnName) {
- return dbNameToVarName(columnName);
- }
- /**
- * Converts a database table name to a Java variable name (<em>first letter
- * not capitalized</em>).
- */
- public static String tableNameToVarName(String tableName) {
- return dbNameToVarName(tableName);
- }
- /**
- * Converts a database name (table or column) to a java name (<em>first letter
- * not capitalized</em>). employee_name or employee-name -> employeeName
- */
- private static String dbNameToVarName(String s) {
- if ("".equals(s)) {
- return s;
- }
- StringBuffer result = new StringBuffer();
-
- boolean capitalize = true;
- boolean lastCapital = false;
- boolean lastDecapitalized = false;
- String p = null;
- for (int i = 0; i < s.length(); i++) {
- String c = s.substring(i, i + 1);
- if ("_".equals(c) || " ".equals(c)) {
- capitalize = true;
- continue;
- }
-
- if (c.toUpperCase().equals(c)) {
- if (lastDecapitalized && !lastCapital) {
- capitalize = true;
- }
- lastCapital = true;
- } else {
- lastCapital = false;
- }
-
- if (capitalize) {
- if (p == null || !p.equals("_")) {
- result.append(c.toUpperCase());
- capitalize = false;
- p = c;
- } else {
- result.append(c.toLowerCase());
- capitalize = false;
- p = c;
- }
- } else {
- result.append(c.toLowerCase());
- lastDecapitalized = true;
- p = c;
- }
-
- }
- /*this was using StringUtil.initLower. Changed to Introspector.decapitalize so that
- * it returns the correct bean property name when called from columnNameToVarName.
- * This is necessary because otherwise URL would be uRL which would cause
- * an "The property uRL is undefined for the type xx" error because
- * Introspector.getBeanInfo (used by JavaTypeIntrospector) returns
- * the property name as URL.*/
- String resultStr = Introspector.decapitalize(result.toString());
- if (resultStr.equals("class")) {
- // "class" is illegal becauseOf Object.getClass() clash
- resultStr = "clazz";
- }
- return resultStr;
- }
-
- /**
- * Compare two objects. If both String, ignore case
- * @param o1
- * @param o2
- * @param ignoreCaseIfStr
- * @return
- */
- public static boolean equalObjects(Object o1, Object o2, boolean ignoreCaseIfStr)
- {
- if (o1 == o2) {
- return true;
- }
- boolean result;
- if (o1 == null || o2 == null) {
- return false; //we already checked o1 == o2 above
- }
- if (ignoreCaseIfStr && o1 instanceof String && o2 instanceof String)
- result = ((String)o1).equalsIgnoreCase((String)o2);
- else
- result = o1.equals(o2);
-
- return result;
- }
-
- public static boolean equalObjects(Object o1, Object o2)
- {
- return equalObjects(o1, o2, false/*ignoreCaseIfStr*/);
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java
deleted file mode 100644
index db4f13b5ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
-/**
- * Collections of utility methods handling URLs.
- *
- */
-public class UrlUtil
-{
- /**
- * The <code>file</code> string indicating a url file protocol.
- */
- public static final String FILE_PROTOCOL = "file";
- /**
- * The <code>file</code> string indicating a url http protocol.
- */
- public static final String HTTP_PROTOCOL = "http";
- /**
- * The <code>file</code> string indicating a url http protocol.
- */
- public static final String HTTPS_PROTOCOL = "https";
- /**
- * The <code>file</code> string indicating a url file protocol.
- */
- public static final String JAR_PROTOCOL = "jar";
-
-
- /**
- * Returns true if the specified url is to a file, i.e its protocol is <code>file</code>.
- */
- public static boolean isFileUrl(URL url) {
- return url != null && FILE_PROTOCOL.equals(url.getProtocol());
- }
- /**
- * Returns true if the specified url is to a jar, i.e its protocol is <code>jar</code>.
- * For example <code>jar:file:/C:/testapps/example/WEB-INF/lib/struts.jar!/META-INF/tlds/struts-bean.tld</code>.
- */
- public static boolean isJarUrl(URL url) {
- return url != null && JAR_PROTOCOL.equals(url.getProtocol());
- }
- /**
- * Returns true if the specified url protocol is http.
- */
- public static boolean isHttpUrl(URL url) {
- String protocol = url.getProtocol();
- return url != null && (HTTP_PROTOCOL.equals(protocol) || HTTPS_PROTOCOL.equals(protocol));
- }
- /**
- * Returns the <code>File</code> corresponding to a url, or null if the url
- * protocol is not file.
- */
- public static java.io.File getUrlFile(URL url) {
- if (isFileUrl(url) && !isJarUrl( url ) ){
- File ret = new java.io.File(url.getFile());
- return ret ;
- }
- return null;
- }
-
-
- /**
- * Returns the url to a jar file given a url to a file inside
- * the jar.
- * For example if given
- * <code>jar:file:/C:/testapps/example/WEB-INF/lib/struts.jar!/META-INF/tlds/struts-bean.tld</code>
- * this method returns <code>file:/C:/testapps/example/WEB-INF/lib/struts.jar</code>.
- *
- * <p>Returns null if the given url is not recognized as a url to a file
- * inside a jar.
- */
- public static URL getJarFileUrl(URL url) {
- if (!isJarUrl(url)) {
- return null;
- }
- String file = url.getFile(); //file:/C:/testapps/example/WEB-INF/lib/struts.jar!/META-INF/tlds/struts-bean.tld
- int index = file.indexOf('!');
- if (index < 0) {
- return null;
- }
- String jarFileUrlStr = file.substring(0, index);
- try {
- return new URL(jarFileUrlStr);
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public static boolean isRemote(String url){
- return url.startsWith("http:")||url.startsWith("https:")||url.startsWith("www.");
- }
-
- public static File getTemplateFolder(String plugId , String strPath ){
- Bundle bundle = Platform.getBundle( plugId );
- Path path = new Path( strPath );
- URL url = FileLocator.find(bundle, path, null);
- try {
- URL templUrl;
- templUrl = FileLocator.resolve(url);
- File templDir = UrlUtil.getUrlFile(templUrl);
- return templDir ;
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm
deleted file mode 100644
index b8b19a4e69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm
+++ /dev/null
@@ -1,54 +0,0 @@
-##included template. Generates the @Column annotation.
-##Assumes that the context has a "column" and a "table" object
-##generate annotation only the parameters for the column NOT default
-##and the generateDLLAnnotation property is not set on the table
-###------------------------------------------------
-#macro( append $members $parameters )
-#if( $members == "")
-#set( $members = $parameters )
-#else
-#set( $members = "$members, $parameters" )
-#end
-#end
-###------------------------------------------------
-#if ( $column.dataTypeLOB)
- @Lob()
-#end
-#if ( $column.needMapTemporalType)
- @Temporal( TemporalType.$column.temporalType)
-#end
-#set ($members = "")
-#if ( !$column.default || $customizer.generateDDLAnnotations )
-#if ( !${column.defaultname} )
-#append($members "name=$customizer.convertToJavaStringLiteral($column.name)" )
-#end
-#if (!$column.insertable)
-#append(${members} "insertable=false")
-#end
-#if (!$column.updateable)
-#append(${members} "updatable=false")
-#end
-#end
-#if( $customizer.generateDDLAnnotations )
-#if ($column.unique)
-#append($members "unique=true")
-#end
-#if (!$column.nullable)
-#append($members "nullable=false")
-#end
-#if ($column.size > 0)
-#if ($column.numeric)
-#append($members "precision=$column.size")
-#if ($column.decimalDigits != 0 && $column.decimalDigits != -1)
-#append($members "scale=$column.decimalDigits")
-#end
-#else
-#if ( !$column.dataTypeLOB)
-#append($members "length=$column.size")
-#end
-#end
-#end
-#end
-#if( $members !="" )
- @Column($members)
-#end
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm
deleted file mode 100644
index a98f87381f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm
+++ /dev/null
@@ -1,81 +0,0 @@
-##included template. Generates the @JoinTable, @JoinColumn or @JoinColumns annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-##macro joinColumn uses $column, $referencedColumn
-#macro (joinColumn $column $referencedColumn)
-#set ($members = "name=$customizer.convertToJavaStringLiteral($column.joinColumnName)")
-#if( !$referencedColumn.primaryKey || $referencedColumn.partOfCompositePrimaryKey )
-#set ($members = "$members, referencedColumnName=$customizer.convertToJavaStringLiteral($referencedColumn.name)")
-#end
-#if( $customizer.generateDDLAnnotations )
-#if ($column.unique && !$column.primaryKey)
-#set ($members = "$members, unique=true")
-#end
-#if (!$column.nullable)
-#set ($members = "$members, nullable=false")
-#end
-#end
-#if ($customizer.generateDDLAnnotations && !$role.association.joinTable && !$role.referrerTable.isColumnUpdateInsert($role, $column))
-#set ($members = "$members, insertable=false, updatable=false")
-#end
-@JoinColumn($members)#end
-##
-##
-##
-#if ($role.association.joinTable)
-#set ($joinTable = $role.association.joinTable)
- @JoinTable(
- name=$customizer.convertToJavaStringLiteral(${joinTable.joinTableAnnotationName})
- , joinColumns={
-#foreach ($column in $role.referrerColumns)
-#set ($referencedColumn = $role.getReferencedColumn(${column.name}))
-##$referencedColumn is the column in the join table
- #joinColumn($referencedColumn $column)
-#if ($velocityCount < $role.referrerColumns.size() )
-,
-#end
-#end
-
- }
- , inverseJoinColumns={
-#foreach ($column in $role.referencedColumns)
-#set ($referencedColumn = $role.getReferrerColumn(${column.name})
-)
-##$referencedColumn is the column in the join table
- #joinColumn($referencedColumn $column)
-#if ($velocityCount < $role.referencedColumns.size() )
-,
-#end
-#end
-
- }
- )
-#else
-#if ($role.referrerColumns.size() == 1)
-#set ($column = $role.referrerColumns.get(0))
-#set ($referencedColumn = $role.getReferencedColumn(${column.name}))
-#set ($referencedTableName = $customizer.convertToJavaStringLiteral($role.getReferencedTable().getName()) )
-#set( $referencedTablePkName = $customizer.convertToJavaStringLiteral($role.getReferencedTable().getPrimaryKeyColumn().name) )
-#set( $computedJoinColumnName = $customizer.convertToJavaStringLiteral("${role.propertyName}_${referencedTablePkName}") )
-#set( $isDefaultJoinColumnName = $column.isDefaultJoinColumnName( ${role.propertyName}) )
-#if( ! $isDefaultJoinColumnName )
- #joinColumn($column $referencedColumn)
-
-#elseif( $customizer.generateDDLAnnotations )
- #joinColumn($column $referencedColumn)
-
-#end
-#else
- @JoinColumns({
-#foreach ($column in $role.referrerColumns)
-#set ($referencedColumn = $role.getReferencedColumn(${column.name}))
- #joinColumn($column $referencedColumn)
-#if ($velocityCount < $role.referrerColumns.size() )
-,
-#else
-
-#end
-#end
- })
-#end
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm
deleted file mode 100644
index 1a4585792a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm
+++ /dev/null
@@ -1,134 +0,0 @@
-#if ($table.package != "")
-package ${table.package};
-#end
-
-import java.io.Serializable;
-import javax.persistence.*;
-${table.importStatements}
-
-/**
- * The persistent class for the ${table.name} database table.
- *
- */
-@Entity
-#if( !${table.defaultname} || $customizer.generateDDLAnnotations)
-@Table(name=$customizer.convertToJavaStringLiteral(${table.name}))
-#end
-public class ${table.className} ${table.generateExtendsImplements()} {
- private static final long serialVersionUID = 1L;
-#####
-##### fields
-#####
-#if ($table.compositeKey)
-#if ($table.access == "field")
-
- @EmbeddedId
-#end
- private ${table.compositeKeyClassName} ${table.compositeKeyPropertyName};
-#end
-#foreach ($column in $table.getSimpleColumns(true, true, false))
-#if ($table.access == "field")
-
-#parse("mappingKind.vm")
-#parse("column.vm")
-#end
- ${column.fieldScope} ${column.simplePropertyType} ${column.propertyName};
-#end
-#foreach ($role in $table.associationRoles)
-#####
-##### field annotations
-#####
-#if ($table.access == "field")
-
- //${role.description}
-#if ($role.cardinality == "many-to-one")
-#parse("manyToOne.vm")
-#elseif ($role.cardinality == "many-to-many")
-#parse("manyToMany.vm")
-#elseif ($role.cardinality == "one-to-many")
-#parse("oneToMany.vm")
-#elseif ($role.cardinality == "one-to-one")
-#parse("oneToOne.vm")
-#end
-#end
-#####
-##### field declaration
-#####
-#if ($role.cardinality == "many-to-one" || $role.cardinality == "one-to-one")
-#set ($propertyType = ${role.referencedTable.className})
-#elseif ($role.cardinality == "many-to-many" || $role.cardinality == "one-to-many")
-#set ($propertyType = "${role.referencedTable.simpleCollectionType}<${role.referencedTable.className}>")
-#end
- private $propertyType $role.propertyName;
-#end
-
- public ${table.className}() {
- }
-
-#####
-##### simple properties getters and setters
-#####
-#if ($table.compositeKey)
-#if ($table.access == "property")
-
- @EmbeddedId
-#end
- public $table.compositeKeyClassName $customizer.propertyGetter($table.compositeKeyPropertyName)() {
- return this.${table.compositeKeyPropertyName};
- }
-
- public void $customizer.propertySetter($table.compositeKeyPropertyName)($table.compositeKeyClassName $table.compositeKeyPropertyName) {
- this.${table.compositeKeyPropertyName} = ${table.compositeKeyPropertyName};
- }
-
-#end
-#foreach ($column in $table.getSimpleColumns(true, true, false))
-#if ($table.access == "property")
-
-#parse("mappingKind.vm")
-#parse("column.vm")
-#end
- $column.propertyGetScope $column.simplePropertyType $customizer.propertyGetter($column.propertyName)() {
- return this.${column.propertyName};
- }
-
- $column.propertySetScope void $customizer.propertySetter($column.propertyName)($column.simplePropertyType $column.propertyName) {
- this.${column.propertyName} = ${column.propertyName};
- }
-
-#end
-#####
-##### associations getters and setters
-#####
-#foreach ($role in $table.associationRoles)
-#if ($table.access == "property")
-
- //${role.description}
-#if ($role.cardinality == "many-to-one")
-#parse("manyToOne.vm")
-#elseif ($role.cardinality == "many-to-many")
-#parse("manyToMany.vm")
-#elseif ($role.cardinality == "one-to-many")
-#parse("oneToMany.vm")
-#elseif ($role.cardinality == "one-to-one")
-#parse("oneToOne.vm")
-#end
-#end
-##
-#if ($role.cardinality == "many-to-one" || $role.cardinality == "one-to-one")
-#set ($propertyType = $role.referencedTable.className)
-#elseif ($role.cardinality == "many-to-many" || $role.cardinality == "one-to-many")
-#set ($propertyType = "${role.referencedTable.simpleCollectionType}<${role.referencedTable.className}>")
-#end
- public $propertyType $customizer.propertyGetter($role.propertyName)() {
- return this.${role.propertyName};
- }
-
- public void ${customizer.propertySetter($role.propertyName)}($propertyType $role.propertyName) {
- this.${role.propertyName} = $role.propertyName;
- }
-
-##
-#end
-##
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm
deleted file mode 100644
index aed48c63c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm
+++ /dev/null
@@ -1,26 +0,0 @@
-##included template. Generates the @ManyToMany annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#if ($role.association.bidirectional && !$role.isReferrerRole())##the owning side (either side for many-to-many)
-#set ($members = $customizer.appendAnnotation("", "mappedBy", $role.oppositeRole.propertyName, true))
-#set ($members = $customizer.appendAnnotation($members, "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @ManyToMany($members)
-#else
- @ManyToMany
-#end
-#else
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @ManyToMany($members)
-#else
- @ManyToMany
-#end
-#parse("join.vm")
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm
deleted file mode 100644
index e4b1608829..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm
+++ /dev/null
@@ -1,13 +0,0 @@
-##included template. Generates the @ManyToOne annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if( $customizer.genFetch($role.referrerTable)!= "" && $customizer.genFetch($role.referrerTable)!= "FetchType.EAGER")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @ManyToOne($members)
-#else
- @ManyToOne
-#end
-#parse("join.vm") \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm
deleted file mode 100644
index c43f187d33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm
+++ /dev/null
@@ -1,34 +0,0 @@
-##included template. Generates the @Basic, @Id, @Version annotations.
-##Assumes that the context has a "column" object
-##
-#set ($mappingKind = $column.mappingKind)
-#if ($mappingKind == "id")
- @Id
-#set ($idGenerator = $table.idGenerator)
-#if ($idGenerator == "auto")
-#set ($generationType = "GenerationType.AUTO")
-#elseif ($idGenerator == "identity")
-#set ($generationType = "GenerationType.IDENTITY")
-#elseif ($idGenerator == "sequence")
-#set ($generationType = "GenerationType.SEQUENCE")
-#elseif ($idGenerator == "table")
-#set ($generationType = "GenerationType.TABLE")
-#else
-#set ($generationType = "")
-#end
-#if ($idGenerator == "sequence" )
-#set ($generatorName = "${table.name.toUpperCase()}_${column.propertyName.toUpperCase()}_GENERATOR")
-#if( $table.formattedSequence != "" )
- @SequenceGenerator(name="$generatorName", sequenceName="$table.formattedSequence")
-#else
- @SequenceGenerator(name="$generatorName" )
-#end
- @GeneratedValue(strategy=$generationType, generator="$generatorName")
-#elseif ($generationType != "")
- @GeneratedValue(strategy=$generationType)
-#end
-#elseif ($mappingKind == "version")
- @Version
-#else
-##DEFAULT is @Basic, no need to generate
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm
deleted file mode 100644
index 647bb3c10e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm
+++ /dev/null
@@ -1,18 +0,0 @@
-##included template. Generates the @OneToMany annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#if ($role.association.bidirectional)
-#set ($members = $customizer.appendAnnotation("", "mappedBy", $role.oppositeRole.propertyName, true))
-#set ($members = $customizer.appendAnnotation($members, "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable) !="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
- @OneToMany($members)
-#else
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable) !="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
- @OneToMany($members)
-#parse("join.vm")
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm
deleted file mode 100644
index 39849b4b7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm
+++ /dev/null
@@ -1,22 +0,0 @@
-##included template. Generates the @OneToOne annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#if ($role.association.bidirectional && !$role.isReferrerRole())##the owning side (either side for one-to-one)
-#set ($members = $customizer.appendAnnotation("", "mappedBy", $role.oppositeRole.propertyName, true))
-#set ($members = $customizer.appendAnnotation($members, "cascade", $customizer.genCascades($role), false))
-#if( $customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.EAGER" )
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
- @OneToOne($members)
-#else
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if( $customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.EAGER" )
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @OneToOne($members)
-#else
- @OneToOne
-#end
-#parse("join.vm")
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm
deleted file mode 100644
index 4874f6841b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm
+++ /dev/null
@@ -1,66 +0,0 @@
-#if ($table.package != "")
-package ${table.package};
-#end
-
-import java.io.Serializable;
-import javax.persistence.*;
-
-/**
- * The primary key class for the ${table.name} database table.
- *
- */
-@Embeddable
-public class ${table.compositeKeyClassName} implements Serializable {
- //default serial version id, required for serializable classes.
- private static final long serialVersionUID = 1L;
-#####
-##### fields
-#####
-#foreach ($column in $table.primaryKeyColumns)
-#if ($table.access == "field")
-
-#parse("column.vm")
-#end
- ${column.fieldScope} ${column.propertyType} ${column.propertyName};
-#end
-
- public ${table.compositeKeyClassName}() {
- }
-#####
-##### simple properties getters and setters
-#####
-#foreach ($column in $table.primaryKeyColumns)
-#if ($table.access == "property")
-
-#parse("column.vm")
-#end
- $column.propertyGetScope $column.propertyType $customizer.propertyGetter($column.propertyName)() {
- return this.${column.propertyName};
- }
- $column.propertySetScope void $customizer.propertySetter($column.propertyName)($column.propertyType $column.propertyName) {
- this.${column.propertyName} = ${column.propertyName};
- }
-#end
-##
-## equals/hashCode
-
- public boolean equals(Object other) {
- if (this == other) {
- return true;
- }
- if (!(other instanceof ${table.compositeKeyClassName})) {
- return false;
- }
- ${table.compositeKeyClassName} castOther = (${table.compositeKeyClassName})other;
- return
- ${table.primaryKeyEqualsClause}
-
- }
-
- public int hashCode() {
- final int prime = 31;
- int hash = 17;
- ${table.primaryKeyHashCodeClause}
- return hash;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.project b/jpa/plugins/org.eclipse.jpt.ui/.project
deleted file mode 100644
index 254a17a7d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.ui</name>
- <comment>renamed to org.eclipse.jpt.jpa.ui</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.project b/jpa/plugins/org.eclipse.jpt.utility/.project
deleted file mode 100644
index 417751d1f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility</name>
- <comment>renamed to org.eclipse.jpt.common.utility and moved to common component</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
deleted file mode 100644
index 5eca35f465..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core.tests.extension.resource</name>
- <comment>renamed to org.eclipse.jpt.jpa.core.tests.extension.resource</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.project b/jpa/tests/org.eclipse.jpt.core.tests/.project
deleted file mode 100644
index 5652fd45d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core.tests</name>
- <comment>renamed to rg.eclipse.jpt.jpa.core.tests</comment>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.project b/jpa/tests/org.eclipse.jpt.db.tests/.project
deleted file mode 100644
index a1ffb1d2c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.db.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project
deleted file mode 100644
index baaef71e6a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.core.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.core.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/.project b/jpa/tests/org.eclipse.jpt.gen.tests/.project
deleted file mode 100644
index 633d887433..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.gen.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.gen.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath
deleted file mode 100644
index fe3e03bba0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project
deleted file mode 100644
index b7783a563f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.core.tests.extension.resource</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 839a8cef45..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:34 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/META-INF/MANIFEST.MF
deleted file mode 100644
index 5720562bec..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.core.tests.extension.resource;singleton:=true
-Bundle-Version: 3.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jdt.core,
- org.eclipse.jpt.common.core,
- org.eclipse.jpt.jpa.core,
- org.eclipse.jpt.jpa.ui,
- org.eclipse.jpt.jpa.gen,
- org.eclipse.jpt.jpa.db,
- org.eclipse.jpt.common.utility,
- org.eclipse.swt,
- org.eclipse.wst.common.project.facet.core,
- org.eclipse.wst.validation
-Export-Package: org.eclipse.jpt.jpa.core.tests.extension.resource;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties
deleted file mode 100644
index 6a1163bc4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.xml,\
- plugin.properties,\
- about.html
-jars.compile.order = .
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties
deleted file mode 100644
index 0558789278..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Extension Tests
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml
deleted file mode 100644
index 747a8d16d1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?> <!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.jpt.jpa.core.jpaPlatforms">
-
- <jpaPlatform
- id="core.testJpaPlatform"
- label="Test Jpa Platform"
- factoryClass="org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformFactory"/>
-
- </extension>
-
- <extension
- point="org.eclipse.jpt.jpa.ui.jpaPlatformUis">
-
- <jpaPlatformUi
- id="core.testJpaPlatform.ui"
- jpaPlatform="core.testJpaPlatform"
- factoryClass="org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformUiFactory"/>
-
- </extension>
-
-</plugin>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java
deleted file mode 100644
index ae5cd6e783..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class ExtensionTestPlugin extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.core.tests.extension.resource"; //$NON-NLS-1$
-
- // The shared instance
- private static ExtensionTestPlugin plugin;
-
- /**
- * The constructor
- */
- public ExtensionTestPlugin() {
- super();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static ExtensionTestPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java
deleted file mode 100644
index ead09942ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-
-public class JavaTestAttributeMapping
- extends AbstractJavaAttributeMapping<Annotation>
-{
- public static final String TEST_ATTRIBUTE_MAPPING_KEY = "testAttribute"; //$NON-NLS-1$
- public static final String TEST_ATTRIBUTE_ANNOTATION_NAME = "test.TestAttribute"; //$NON-NLS-1$
-
-
- public JavaTestAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java
deleted file mode 100644
index 00ba8dc305..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-
-public class JavaTestAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaTestAttributeMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaTestAttributeMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestAttributeMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java
deleted file mode 100644
index f60da33a87..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaTypeMapping;
-
-public class JavaTestTypeMapping
- extends AbstractJavaTypeMapping<Annotation>
-{
- public static final String TEST_TYPE_MAPPING_KEY = "test"; //$NON-NLS-1$
- public static final String TEST_TYPE_ANNOTATION_NAME = "test.Test"; //$NON-NLS-1$
-
-
- public JavaTestTypeMapping(JavaPersistentType parent) {
- super(parent, null);
- }
-
- public String getKey() {
- return TEST_TYPE_MAPPING_KEY;
- }
-
- public JavaPersistentType getIdClass() {
- return null;
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public Iterable<Query> getQueries() {
- return EmptyIterable.instance();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java
deleted file mode 100644
index 6b0be26a03..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-
-public class JavaTestTypeMappingDefinition
- implements JavaTypeMappingDefinition
-{
- // singleton
- private static final JavaTestTypeMappingDefinition INSTANCE = new JavaTestTypeMappingDefinition();
-
- /**
- * Return the singleton
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaTestTypeMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestTypeMapping.TEST_TYPE_ANNOTATION_NAME;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaTestTypeMapping buildMapping(JavaPersistentType persistentType, Annotation annotation, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestTypeMapping(persistentType);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java
deleted file mode 100644
index c4ade4014e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaBasicMapping;
-
-public class TestJavaBasicMapping
- extends AbstractJavaBasicMapping
-{
- public TestJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java
deleted file mode 100644
index 2aee63a1e2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-
-public class TestJavaEntity
- extends AbstractJavaEntity
-{
- protected TestJavaEntity(JavaPersistentType parent, EntityAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- }
-
- public JavaCacheable2_0 getCacheable() {
- return null;
- }
-
- public boolean calculateDefaultCacheable() {
- return false;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java
deleted file mode 100644
index 1fb3e08be3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaFactory;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-
-public class TestJpaFactory
- extends AbstractJpaFactory
-{
- @Override
- public JavaEntity buildJavaEntity(JavaPersistentType parent, EntityAnnotation entityAnnotation) {
- return new TestJavaEntity(parent, entityAnnotation);
- }
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new TestJavaBasicMapping(parent);
- }
-
- public JavaTestTypeMapping buildJavaTestTypeMapping(JavaPersistentType parent) {
- return new JavaTestTypeMapping(parent);
- }
-
- public JavaTestAttributeMapping buildJavaTestAttributeMapping(JavaPersistentAttribute parent) {
- return new JavaTestAttributeMapping(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java
deleted file mode 100644
index 754eeeb007..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.SimpleVersion;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-@SuppressWarnings("nls")
-public class TestJpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public TestJpaPlatformFactory() {
- super();
- }
-
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new TestJpaFactory(),
- new JpaAnnotationProvider(GenericJpaAnnotationDefinitionProvider.instance()),
- TestJpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new SimpleVersion(JpaFacet.VERSION_1_0.getVersionString()) {
- @Override
- public String getVersion() {
- return "BOOOYAH!";
- }
- };
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.MAYBE;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- };
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java
deleted file mode 100644
index 5a072bf5b1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXmlDefinition;
-
-public class TestJpaPlatformProvider extends AbstractJpaPlatformProvider
-{
- public static final String ID = "core.testJpaPlatform"; //$NON-NLS-1$
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new TestJpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private TestJpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance()
- };
-
-
- // ********** Java type mappings **********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by the Reference Implementation (EclipseLink)
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance(),
- JavaTestTypeMappingDefinition.instance() // added
- };
-
-
- // ********** Java attribute mappings **********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by the Reference Implementation (EclipseLink)
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()
- };
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by the Reference Implementation (EclipseLink)
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaIdMappingDefinition.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaOneToManyMappingDefinition.instance(),
- JavaOneToOneMappingDefinition.instance(),
- JavaTestAttributeMappingDefinition.instance() // added
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- GenericPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance()
- };
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java
deleted file mode 100644
index 32db21485c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.GenericJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericNavigatorProvider;
-
-public class TestJpaPlatformUiFactory implements JpaPlatformUiFactory
-{
-
- /**
- * Zero arg constructor for extension point
- */
- public TestJpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new GenericJpaPlatformUi(
- new GenericNavigatorProvider(),
- GenericJpaPlatformUiProvider.instance());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath
deleted file mode 100644
index 9bca2d5b69..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.project
deleted file mode 100644
index b24f205d61..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index bf070b1a9e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:27 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 3e5ee6c357..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,45 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.core.tests;singleton:=true
-Bundle-Version: 3.1.100.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.commands;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.core.tests.extension.resource;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility.tests;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.jpa.core.tests;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.platform;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.projects;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.resource.java;x-internal:=true
-Bundle-Activator: org.eclipse.jpt.jpa.core.tests.JptJpaCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties
deleted file mode 100644
index 82227ce10a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties
deleted file mode 100644
index 113453a4d6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java
deleted file mode 100644
index f9168afacd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * Configure the core for testing:<ul>
- * <li>handle events synchronously
- * <li>do not flush preferences
- * </ul>
- */
-@SuppressWarnings("nls")
-public class JptJpaCoreTestsPlugin
- extends Plugin
-{
-
- private static JptJpaCoreTestsPlugin INSTANCE;
-
- public static JptJpaCoreTestsPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJpaCoreTestsPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- JpaProjectManager jpaProjectManager = JptJpaCorePlugin.getJpaProjectManager();
- ReflectionTools.executeMethod(jpaProjectManager, "handleEventsSynchronously");
- ReflectionTools.executeStaticMethod(JptJpaCorePlugin.class, "doNotFlushPreferences");
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java
deleted file mode 100644
index f0ce85043d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-
-@SuppressWarnings("nls")
-public class MiscTests extends TestCase {
-
- public MiscTests(String name) {
- super(name);
- }
-
- /*
- *
- */
- public void testJobsAndLocks() throws Exception {
- ILock lock = Job.getJobManager().newLock();
- Job testJob = new TestJob(lock);
- testJob.schedule();
- }
-
- class TestJob extends Job {
- private final ILock lock;
- TestJob(ILock lock) {
- super("test job");
- this.lock = lock;
- }
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- this.run();
- return Status.OK_STATUS;
- }
- private void run() {
- try {
- this.lock.acquire();
- MiscTests.sleep(100);
- } finally {
- this.lock.release();
- }
- }
- }
-
- static void sleep(long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java
deleted file mode 100644
index c61b1046e9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal;
-
-import java.io.File;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.context.JptJpaCoreContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.model.JptJpaCoreModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.JptJpaCoreResourceModelTests;
-
-/**
- * decentralize test creation code
- *
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- */
-@SuppressWarnings("nls")
-public class JptJpaCoreTests {
- private static final String JPA_JAR_PROPERTY = TestJpaProject.JPA_JAR_NAME_SYSTEM_PROPERTY;
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreTests.class.getPackage().getName());
- suite.addTest(JptJpaCoreModelTests.suite());
- suite.addTest(JptJpaCoreResourceModelTests.suite());
- suite.addTest(JptJpaCoreContextModelTests.suite());
- return suite;
- }
-
- public static boolean requiredJarsExists() {
- return jpaJarPropertyExists() && jpaJarFileExists();
- }
-
- public static boolean jpaJarPropertyExists() {
- return getSystemProperty(JPA_JAR_PROPERTY) != null;
- }
-
- public static boolean jpaJarFileExists() {
- return (new File(getSystemProperty(JPA_JAR_PROPERTY))).exists();
- }
-
- public static String buildMissingJarErrorMessage() {
- if( ! jpaJarPropertyExists()) {
- return errorMissingProperty(JPA_JAR_PROPERTY);
- }
- return errorJarFileDoesNotExist(getSystemProperty(JPA_JAR_PROPERTY));
- }
-
- /*********** private **********/
- private static String errorMissingProperty(String propertyName) {
- return "missing Java system property: \"" + propertyName + "\"";
- }
-
- private static String errorJarFileDoesNotExist(String propertyValue) {
- return "JAR file doesn't exist: \"" + propertyValue + "\"";
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
- private JptJpaCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java
deleted file mode 100644
index c21bb21b2c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.MappingFile;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-
-@SuppressWarnings("nls")
-public abstract class ContextModelTestCase extends AnnotationTestCase
-{
- protected static final String BASE_PROJECT_NAME = "ContextModelTestProject";
-
- protected JpaXmlResource persistenceXmlResource;
-
- protected JpaXmlResource ormXmlResource;
-
-
- protected ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.persistenceXmlResource = getJpaProject().getPersistenceXmlResource();
- this.ormXmlResource = getJpaProject().getDefaultOrmXmlResource();
- this.waitForWorkspaceJobsToFinish();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.persistenceXmlResource = null;
- this.ormXmlResource = null;
- JptJpaCorePlugin.getWorkspacePreferences().clear();
- this.waitForWorkspaceJobsToFinish();
- super.tearDown();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return buildJpaProject(BASE_PROJECT_NAME, autoBuild, buildJpaConfigDataModel());
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig)
- throws Exception {
- return TestJpaProject.buildJpaProject(projectName, autoBuild, jpaConfig);
- }
-
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = DataModelFactory.createDataModel(new JpaFacetInstallDataModelProvider());
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, this.getJpaFacetVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, this.getJpaPlatformDescription());
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.valueOf(this.createOrmXml()));
- return dataModel;
- }
-
- // default facet version is 2.0 - most tests use 1.0
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_1_0.getVersionString();
- }
-
- // most tests use the basic generic platform
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return GenericPlatform.VERSION_1_0;
- }
-
- // most tests do use an orm.xml
- protected boolean createOrmXml() {
- return true;
- }
-
- protected JpaProject getJpaProject() {
- return getJavaProject().getJpaProject();
- }
-
- protected void waitForWorkspaceJobsToFinish() throws InterruptedException {
- // This job will not start running until all the other workspace jobs are done
- Job waitJob = new Job("Wait job") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- return Status.OK_STATUS;
- }
- };
- waitJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
- waitJob.schedule();
- waitJob.join();
- }
-
- protected JpaXmlResource getPersistenceXmlResource() {
- return this.persistenceXmlResource;
- }
-
- protected JpaXmlResource getOrmXmlResource() {
- return this.ormXmlResource;
- }
-
- /**
- * It's nice to be able to call this method from the debugger,
- * to force the XML files to be written out so you can see their current state.
- */
- protected void saveXmlFiles() {
- try {
- this.saveXmlFiles_();
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-
- protected void saveXmlFiles_() throws Exception {
- this.persistenceXmlResource.saveIfNecessary();
- this.ormXmlResource.saveIfNecessary();
- }
-
- protected XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) getOrmXmlResource().getRootObject();
- }
-
- protected XmlPersistence getXmlPersistence() {
- return (XmlPersistence) getPersistenceXmlResource().getRootObject();
- }
-
- protected MappingFile getMappingFile() {
- return this.getPersistenceUnit().getMappingFileRefs().iterator().next().getMappingFile();
- }
-
- protected EntityMappings getEntityMappings() {
- MappingFile mappingFile = this.getMappingFile();
- return (mappingFile == null) ? null : (EntityMappings) mappingFile.getRoot();
- }
-
- protected XmlPersistenceUnit getXmlPersistenceUnit() {
- return getXmlPersistence().getPersistenceUnits().get(0);
- }
-
- protected PersistenceUnit getPersistenceUnit() {
- return getRootContextNode().getPersistenceXml().getPersistence().getPersistenceUnits().iterator().next();
- }
-
- protected ClassRef getSpecifiedClassRef() {
- return getPersistenceUnit().getSpecifiedClassRefs().iterator().next();
- }
-
- protected JavaPersistentType getJavaPersistentType() {
- return getSpecifiedClassRef().getJavaPersistentType();
- }
-
- protected JavaEntity getJavaEntity() {
- return (JavaEntity) getJavaPersistentType().getMapping();
- }
-
- protected void addXmlClassRef(String className) {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass(className);
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- }
-
- protected void removeXmlClassRef(String className) {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- XmlJavaClassRef xmlJavaClassRefToRemove = null;
- for (XmlJavaClassRef xmlJavaClassRef : xmlPersistenceUnit.getClasses()) {
- if (xmlJavaClassRef.getJavaClass().equals(className)) {
- xmlJavaClassRefToRemove = xmlJavaClassRef;
- }
- }
- if (xmlJavaClassRefToRemove == null) {
- throw new IllegalArgumentException();
- }
- xmlPersistenceUnit.getClasses().remove(xmlJavaClassRefToRemove);
- }
-
- protected void addXmlMappingFileRef(String fileName) {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName(fileName);
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- }
-
- protected JpaRootContextNode getRootContextNode() {
- return getJavaProject().getJpaProject().getRootContextNode();
- }
-
- @Override
- protected TestJpaProject getJavaProject() {
- return (TestJpaProject) super.getJavaProject();
- }
-
- protected void deleteResource(Resource resource) throws CoreException {
- WorkbenchResourceHelper.deleteResource(resource);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java
deleted file mode 100644
index 2b03132660..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-
-@SuppressWarnings("nls")
-public class JpaFileTests extends ContextModelTestCase
-{
- public JpaFileTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- public void testGetRootStructureNode() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
-
- assertEquals(getEntityMappings(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- //verify the mapping file reference "wins" as the root structure node when both
- //persistence.xml <class> tag and mapping file <entity> tag exist for a particulary java class
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- getEntityMappings().removePersistentType(ormPersistentType);
-
- assertEquals(getJavaEntity().getPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
- public void testEntityMappingsRootStructureNodeRemoved() throws Exception {
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
- assertEquals(getEntityMappings(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) ormXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(ormXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testImpliedEntityMappingsRootStructureNodeRemoved() throws Exception {
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
-
- assertNull(getPersistenceUnit().getImpliedMappingFileRef());
-
- getXmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(getPersistenceUnit().getImpliedMappingFileRef());
- assertEquals(getPersistenceUnit().getImpliedMappingFileRef().getMappingFile().getRoot(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) ormXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(ormXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testEntityMappingsRootStructureNodeRemovedFromResourceModel() throws Exception {
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
- assertEquals(getEntityMappings(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
- getOrmXmlResource().getContents().remove(getOrmXmlResource().getRootObject());
-
- assertFalse(ormXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdatePersistenceRootStructureNodePersistenceRemoved() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
- assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) persistenceXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(persistenceXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateOrmJavaRootStructureNodePersistenceRemoved() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) persistenceXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateJavaRootStructureNodePersistenceRemoved() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) persistenceXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testPersistenceRootStructureNodeRemovedFromResourceModel() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
- getRootContextNode().getPersistenceXml().getPersistence();
- assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.getRootStructureNodes().iterator().next());
-
- getPersistenceXmlResource().getContents().remove(getXmlPersistence());
-
- assertFalse(persistenceXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateOrmJavaRootStructureNodePersistenceXmlRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- getPersistenceXmlResource().getContents().remove(getXmlPersistence());
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateJavaRootStructureNodePersistenceXmlRemoved() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- getPersistenceXmlResource().getContents().remove(getXmlPersistence());
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testOrmJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertTrue(javaJpaFile.getRootStructureNodes().iterator().next().getParent() instanceof OrmPersistentType);
-
-
- getEntityMappings().removePersistentType(0);
-
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- assertTrue(javaJpaFile.getRootStructureNodes().iterator().next().getParent() instanceof ClassRef);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
- public void testOrmJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertTrue(javaJpaFile.getRootStructureNodes().iterator().next().getParent() instanceof OrmPersistentType);
-
- getXmlEntityMappings().getEntities().remove(0);
-
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- assertTrue(javaJpaFile.getRootStructureNodes().iterator().next().getParent() instanceof ClassRef);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
- public void testJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(getEntityMappings().getPersistenceUnit().getSpecifiedClassRefs().iterator().next(), javaJpaFile.getRootStructureNodes().iterator().next().getParent());
-
- getEntityMappings().getPersistenceUnit().removeSpecifiedClassRef(0);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), javaJpaFile.getRootStructureNodes().iterator().next().getParent());
- }
-
- public void testJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- Iterator<JpaStructureNode> rootStructureNodes = javaJpaFile.getRootStructureNodes().iterator();
- JpaStructureNode rootStructureNode = rootStructureNodes.next();
- assertEquals(javaPersistentType, rootStructureNode);
- assertEquals(getEntityMappings().getPersistenceUnit().getSpecifiedClassRefs().iterator().next(), rootStructureNode.getParent());
- assertFalse(rootStructureNodes.hasNext());
-
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), javaJpaFile.getRootStructureNodes().iterator().next().getParent());
- }
-
- public void testImpliedJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- getJpaProject().setDiscoversAnnotatedClasses(true);
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = getPersistenceUnit().getImpliedClassRefs().iterator().next().getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- javaPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testJavaRootStructureNodesEntityMappingsRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getOrmXmlResource().getContents().remove(getXmlEntityMappings());
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- assertEquals(getPersistenceUnit().getImpliedClassRefs().iterator().next(), javaJpaFile.getRootStructureNodes().iterator().next().getParent());
- }
-
- public void testJavaRootStructureNodesPersistenceUnitRemovedFromResourceModel() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getXmlPersistence().getPersistenceUnits().remove(0);
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- assertEquals(0, javaJpaFile.getRootStructureNodesSize());
- }
-
- public void testJavaRootStructureNodesPersistenceUnitRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getJpaProject().getRootContextNode().getPersistenceXml().getPersistence().removePersistenceUnit(0);
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- assertEquals(0, javaJpaFile.getRootStructureNodesSize());
- }
-
- public void testJavaRootStructureNodesOrmPersistentTypeRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getEntityMappings().removePersistentType(0);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), javaJpaFile.getRootStructureNodes().iterator().next().getParent());
- }
-
- public void testJavaRootStructureNodesOrmTypeMappingMorphed() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- javaPersistentType = getEntityMappings().getPersistentTypes().iterator().next().getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getEntityMappings().removePersistentType(0);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), javaJpaFile.getRootStructureNodes().iterator().next().getParent());
- }
-
- public void testUpdateOrmJavaRootStructureNodeMappingFileRefChanged() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- MappingFileRef mappingFileRef = getPersistenceUnit().getMappingFileRefs().iterator().next();
- mappingFileRef.setFileName("foo");
-
- ormPersistentType = ((EntityMappings) getPersistenceUnit().getImpliedMappingFileRef().getMappingFile().getRoot()).getPersistentTypes().iterator().next();
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile ormXmlJpaFile = JptJpaCorePlugin.getJpaFile(file);
-
- assertEquals(1, ormXmlJpaFile.getRootStructureNodesSize());
- }
-
- public void testUpdateJavaRootStructureNodeMappingFileRefChanged() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- MappingFileRef mappingFileRef = getPersistenceUnit().getMappingFileRefs().iterator().next();
- mappingFileRef.setFileName("foo");
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
-
- public void testUpdateJavaRootStrucutreNodeDeleteOrmResource() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = JptJpaCorePlugin.getJpaFile((IFile) cu.getResource());
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
-
- deleteResource(getOrmXmlResource());
-
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- assertEquals(getPersistenceUnit().getImpliedClassRefs().iterator().next(), javaJpaFile.getRootStructureNodes().iterator().next().getParent());
- }
- //TODO test rootStructureNodes with a static inner class
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java
deleted file mode 100644
index 9d161a60e5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.internal.operations.PersistenceFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class JpaProjectTests extends TestCase
-{
- static final String BASE_PROJECT_NAME = JpaProjectTests.class.getSimpleName();
-
- TestJpaProject jpaProject;
-
-
- public JpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.jpaProject = TestJpaProject.buildJpaProject(BASE_PROJECT_NAME, false, buildJpaConfigDataModel()); // false = no auto-build
- }
-
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = DataModelFactory.createDataModel(new JpaFacetInstallDataModelProvider());
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_1_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, GenericPlatform.VERSION_1_0);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.jpaProject.getProject().delete(true, true, null);
- this.jpaProject = null;
- super.tearDown();
- }
-
- protected JpaProject getJpaProject() {
- return this.jpaProject.getJpaProject();
- }
-
- public void testGetPersistenceXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getPersistenceXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/persistence.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the persistence.xml file and verify it is not returned from getPersistenceXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getPersistenceXmlResource();
- assertNull(resource);
-
- //add the persistence.xml file back
- createPersistenceXmlFile();
- resource = this.getJpaProject().getPersistenceXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/persistence.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- private void createPersistenceXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new PersistenceFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the default orm.xml file back
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createOrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the orm.xml file back
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetMappingFileResourceDifferentlyName() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java
deleted file mode 100644
index 52c3042f96..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.JptJpaCoreTests;
-import org.eclipse.jpt.jpa.core.tests.internal.context.java.JptCoreContextJavaModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.context.orm.JptCoreOrmContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.JptCorePersistenceContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java.Generic2_0JavaContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm.Generic2_0OrmContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence.Generic2_0PersistenceContextModelTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- */
-public class JptJpaCoreContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreContextModelTests.class.getPackage().getName());
-
- if (JptJpaCoreTests.requiredJarsExists()) {
- suite.addTestSuite(JpaProjectTests.class);
- suite.addTestSuite(JpaFileTests.class);
- suite.addTest(JptCorePersistenceContextModelTests.suite());
- suite.addTest(JptCoreOrmContextModelTests.suite());
- suite.addTest(JptCoreContextJavaModelTests.suite());
- suite.addTest(Generic2_0JavaContextModelTests.suite());
- suite.addTest(Generic2_0OrmContextModelTests.suite());
- suite.addTest(Generic2_0PersistenceContextModelTests.suite());
- } else {
- suite.addTest(TestSuite.warning(JptJpaCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java
deleted file mode 100644
index 43bf4247d5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentAttributeTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public GenericJavaPersistentAttributeTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertEquals("id", persistentAttribute.getName());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping() instanceof JavaIdMapping);
-
- persistentAttribute.setMappingKey(null);
- assertTrue(persistentAttribute.getMapping() instanceof JavaBasicMapping);
- }
-
- public void testGetSpecifiedMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping() instanceof JavaIdMapping);
-
- persistentAttribute.setMappingKey(null);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testGetSpecifiedMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertNotNull(persistentAttribute.getMapping());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setMappingKey(null);
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- }
-
- public void testDefaultMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- }
-
- public void testSetSpecifiedMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- assertNotNull(resourceAttribute.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertTrue(persistentAttribute.getMapping() instanceof JavaEmbeddedMapping);
- }
-
- public void testSetSpecifiedMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- assertNotNull(resourceAttribute.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertTrue(persistentAttribute.getMapping() instanceof JavaEmbeddedMapping);
- }
-
- public void testSetSpecifiedMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- assertNull(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME));
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- resourceAttribute.setPrimaryAnnotation(EmbeddedAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- resourceAttribute.setPrimaryAnnotation(BasicAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMapping().getKey());
- }
-
- public void testGetAccessField() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(AccessType.FIELD, persistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, persistentAttribute.getDefaultAccess());
- assertEquals(null, persistentAttribute.getSpecifiedAccess());
- }
-
- public void testGetAccessProperty() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(AccessType.PROPERTY, persistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, persistentAttribute.getDefaultAccess());
- assertEquals(null, persistentAttribute.getSpecifiedAccess());
- }
-
- public void testNonResolvingField() throws Exception {
- createTestEntityWithNonResolvingField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = getJavaPersistentType().getJavaResourceType().getFields().iterator().next();
-
- JavaPersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("foo");
- assertTrue(attribute.isFor(resourceField));
- }
-
- public void testIsPersistableMethod2() throws Exception {
- createTestEntityWithNonResolvingMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<JavaResourceMethod> methods = getJavaPersistentType().getJavaResourceType().getMethods().iterator();
-
- JavaResourceMethod resourceGetter = methods.next();
- JavaResourceMethod resourceSetter = methods.next();
- JavaPersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("foo");
-
- assertTrue(attribute.isFor(resourceGetter, resourceSetter));
- }
-
- private ICompilationUnit createTestEntityWithNonResolvingField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonResolvingMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- sb.append(CR);
- sb.append(" public Foo getFoo() {").append(CR);
- sb.append(" return this.foo;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append(CR);
- sb.append(" public void setFoo(Foo foo) {").append(CR);
- sb.append(" this.foo = foo;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java
deleted file mode 100644
index 0147eb8427..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java
+++ /dev/null
@@ -1,935 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.context.java.FieldAccessor;
-import org.eclipse.jpt.jpa.core.internal.context.java.PropertyAccessor;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentTypeTests extends ContextModelTestCase
-{
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
- private ICompilationUnit createTestEntityAnnotatedFieldAndMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestSubTypeWithFieldAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeWithMethodAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypePersistentExtendsNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild2.java", "AnnotationTestTypeChild2", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends AnnotationTestTypeChild ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedConstructor() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("@Id").append(CR);
- sb.append(" public " + TYPE_NAME + "() {").append(CR);
- sb.append(" super();").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public GenericJavaPersistentTypeTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, getJavaPersistentType().getName());
- }
-
- public void testGetAccessNothingAnnotated() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessField() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessProperty() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
- }
-
- public void testAccessFieldAndMethodAnnotated() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessInheritance() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance2() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance3() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubTypeWithMethodAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance4() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inherited class having annotations set wins over the default access set on persistence-unit-defaults
- public void testAccessInheritancePersistenceUnitDefaultAccess() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlNoAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
-
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityPropertyAccessAndFieldAnnotations() throws Exception {
- //xml access set to property, field annotations, JavaPersistentType access is field
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityFieldAccessAndPropertyAnnotations() throws Exception {
- //xml access set to field, property annotations, JavaPersistentType access is property
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ormPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessFieldAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inheritance wins over entity-mappings specified access
- public void testAccessXmlEntityMappingsAccessWithInheritance() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childEntityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- createTestEntityAnnotatedMethod();
- createTestSubType();
- JavaPersistentType childJavaPersistentType = childEntityPersistentType.getJavaPersistentType();
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, entityPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.PROPERTY, childJavaPersistentType.getAccess());
- }
-
- public void testAccessXmlMetadataCompleteFieldAnnotations() throws Exception {
- //xml access set to property, java has field annotations so the access should be field
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- }
-
- public void testAccessNoXmlAccessXmlMetdataCompletePropertyAnnotations() throws Exception {
- //xml access not set, metadata complete set. JavaPersistentType access is property because properties are annotated
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testSuperPersistentType() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testSuperPersistentType2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- //super is not added to the persistenceUnit, but it should still be found
- //as the superPersistentType because of impliedClassRefs and changes for bug 190317
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType javaPersistentType = classRefs.next().getJavaPersistentType();
-
- assertNotNull(javaPersistentType.getSuperPersistentType());
- }
-
- //Entity extends Non-Entity extends Entity
- public void testSuperPersistentType3() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testInheritanceHierarchy() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testInheritanceHierarchy2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testGetMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testMappingKeyNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EmbeddableAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EntityAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testIsMapped() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(getJavaPersistentType().isMapped());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertFalse(getJavaPersistentType().isMapped());
- }
-
- public void testAttributes() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- assertEquals("id", attributes.next().getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributes2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- JavaPersistentAttribute attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("name", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof PropertyAccessor);
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributesSize() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(1, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributesSize2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributeNamed() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("id");
-
- assertEquals("id", attribute.getName());
- assertNull(getJavaPersistentType().getAttributeNamed("name"));
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testAttributeNamed2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("name");
-
- assertEquals("name", attribute.getName());
-
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testRenameAttribute() throws Exception {
- ICompilationUnit testType = createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute idAttribute = attributes.next();
- JavaPersistentAttribute nameAttribute = attributes.next();
-
-
- assertEquals("id", idAttribute.getName());
- assertEquals("name", nameAttribute.getName());
-
- IField idField = testType.findPrimaryType().getField("id");
- idField.rename("id2", false, null);
-
- attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute nameAttribute2 = attributes.next();
- JavaPersistentAttribute id2Attribute = attributes.next();
-
- assertNotSame(idAttribute, id2Attribute);
- assertEquals("id2", id2Attribute.getName());
- assertEquals(nameAttribute, nameAttribute2);
- assertEquals("name", nameAttribute2.getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testSuperPersistentTypeGeneric() throws Exception {
- createTestGenericEntity();
- createTestGenericMappedSuperclass();
-
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Entity2");
-
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- assertEquals("test.Entity1", javaPersistentType.getName());
- assertNotNull(javaPersistentType.getSuperPersistentType());
-
- assertEquals("test.Entity2", javaPersistentType.getSuperPersistentType().getName());
- }
-
- private void createTestGenericEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 ");
- sb.append("extends Entity2<Integer> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericMappedSuperclass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class Entity2<K> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity2.java", sourceWriter);
- }
-
-
- public void testGetAccessNoAttributesAnnotated() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessFieldsAnnotated() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessMethodsAnnotated() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessFieldsAndMethodsAnnotated() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessNonPersistableMethodAnnotated() throws Exception {
- createTestEntityAnnotatedNonPersistableMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessPersistableMethodAndNonPersistableFieldAnnotated() throws Exception {
- createTestEntityAnnotatedPersistableMethodNonPersistableField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessNoPersistableFieldsAnnotated() throws Exception {
- createTestEntityNoPersistableFields();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- //this is invalid and covered by validation (bug 360002)
- public void testGetAccessConstructorAnnotated() throws Exception {
- createTestEntityAnnotatedConstructor();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- private ICompilationUnit createTestEntityAnnotatedNonPersistableMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedPersistableMethodNonPersistableField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- sb.append(" private transient int notPersistable;").append(CR);
- sb.append(CR);
-
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestEntityNoPersistableFields() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.delete(sb.indexOf("private int id;"), sb.indexOf("private int id;") + "private int id;".length());
- sb.delete(sb.indexOf("private String name;"), sb.indexOf("private String name;") + "private String name;".length());
- }
- });
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java
deleted file mode 100644
index b5e0df8915..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaAssociationOverrideTests extends ContextModelTestCase
-{
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE_NAME";
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(CR);
- sb.append(" private AnnotationTestTypeChild address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public JavaAssociationOverrideTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME_ + "AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- VirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- AssociationOverride javaAssociationOverride = virtualOverride.convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the resource model, verify context model updated
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- //set name to null in the resource model
- associationOverrideResource.setName(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
- assertNull(associationOverrideResource.getName());
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, overrideContainer.getSpecifiedOverridesSize());
- javaAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator().hasNext());
- }
-
- public void testModifyName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- AssociationOverride javaAssociationOverride = virtualAssociationOverride.convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the context model, verify resource model modified
- javaAssociationOverride.setName("foo");
- assertEquals("foo", javaAssociationOverride.getName());
- assertEquals("foo", associationOverrideResource.getName());
-
- //set name to null in the context model
- javaAssociationOverride.setName(null);
- assertNull(javaAssociationOverride.getName());
- associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- assertNull(associationOverrideResource.getName());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = virtualOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideAnnotation = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
-
- JavaJoinColumn joinColumn1 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn1.setSpecifiedName("FOO");
-
- assertEquals("FOO", associationOverrideAnnotation.joinColumnAt(0).getName());
-
- JavaJoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", associationOverrideAnnotation.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverrideAnnotation.joinColumnAt(1).getName());
-
- JavaJoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideAnnotation.getJoinColumnsSize());
- assertEquals("BAR", associationOverrideAnnotation.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideAnnotation.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideAnnotation.joinColumnAt(2).getName());
- assertEquals("address_id", associationOverrideAnnotation.joinColumnAt(3).getName()); // the old default join column
-
- assertEquals(4, joiningStrategy.getSpecifiedJoinColumnsSize());
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn1, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName()); // the old default join column
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(3, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, associationOverrideResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- JoinColumn joinColumn = joinColumns.next();
- assertEquals("address_id", joinColumn.getSpecifiedName());
- assertEquals("id", joinColumn.getSpecifiedReferencedColumnName());
-
-
- associationOverrideResource.addJoinColumn(0);
- associationOverrideResource.addJoinColumn(1);
- associationOverrideResource.addJoinColumn(2);
-
- associationOverrideResource.joinColumnAt(0).setName("FOO");
- associationOverrideResource.joinColumnAt(1).setName("BAR");
- associationOverrideResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("address_id", joinColumns.next().getName());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", specifiedAssociationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
- specifiedAssociationOverride.setName("FOO");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("FOO", associationOverrideResource.getName());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", associationOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(associationOverride.isVirtual());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java
deleted file mode 100644
index 35bb9702ae..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaAttributeOverrideTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE_NAME";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "MY_ATTRIBUTE_OVERRIDE_COLUMN_NAME";
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public JavaAttributeOverrideTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- attributeOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", specifiedAttributeOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
-
- specifiedAttributeOverride.setName("FOO");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertEquals("FOO", attributeOverrideResource.getName());
- }
-
- public void testColumnGetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation columnResource = attributeOverrideResource.getColumn();
- columnResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
-
- column = overrideContainer.getSpecifiedOverrides().iterator().next().getColumn();
- assertEquals("FOO", column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName());
-
- column.setSpecifiedName("FOO");
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation columnResource = attributeOverrideResource.getColumn();
-
- assertEquals("FOO", columnResource.getName());
-
- column.setSpecifiedName(null);
-
- attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertNull(attributeOverrideResource.getColumn());
- assertNotNull(specifiedAttributeOverride.getColumn());
- }
-
- public void testColumnDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", attributeOverride.getColumn().getDefaultName());
-
-
- JavaPersistentType mappedSuperclass = CollectionTools.list(getPersistenceUnit().getSpecifiedClassRefs()).get(1).getJavaPersistentType();
- BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping();
- basicMapping.getColumn().setSpecifiedName("FOO");
-
- attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("FOO", attributeOverride.getColumn().getDefaultName());
- }
-
- public void testColumnDefaultTableName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("AnnotationTestTypeChild", attributeOverride.getColumn().getDefaultTable());
-
-
- JavaPersistentType mappedSuperclass = CollectionTools.list(getPersistenceUnit().getSpecifiedClassRefs()).get(1).getJavaPersistentType();
- BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping();
- basicMapping.getColumn().setSpecifiedTable("BAR");
-
- attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", attributeOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(attributeOverride.isVirtual());
- }
-
- public void testSetColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaVirtualAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- attributeOverride.convertToSpecified().getColumn().setSpecifiedName("FOO");
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertEquals("FOO", attributeOverrideResource.getColumn().getName());
- assertEquals("FOO", overrideContainer.getSpecifiedOverrides().iterator().next().getColumn().getSpecifiedName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java
deleted file mode 100644
index 103d128b80..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java
+++ /dev/null
@@ -1,997 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.LobConverter;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaBasicMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithBasicMappingFetchOptionalSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch=FetchType.EAGER, optional=false)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithLob() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.LOB);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Lob").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated(EnumType.STRING)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- public JavaBasicMappingTests(String name) {
- super(name);
- }
-
- public void testDefaultBasicGetDefaultFetch() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch());
- }
-
- public void testSpecifiedBasicGetDefaultFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch());
- }
-
- public void testGetFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(FetchType.EAGER, basicMapping.getFetch());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, basicMapping.getFetch());
- }
-
- public void testGetSpecifiedFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getSpecifiedFetch());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- basic.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- }
-
- public void testGetSpecifiedFetch2() throws Exception {
- createTestEntityWithBasicMappingFetchOptionalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(FetchType.EAGER, basicMapping.getSpecifiedFetch());
- }
-
- public void testSetSpecifiedFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedFetch());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, basic.getFetch());
-
- basicMapping.setSpecifiedFetch(null);
- assertNotNull(resourceField.getAnnotation(JPA.BASIC));
- }
-
- public void testSetSpecifiedFetch2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- createOrmXmlFile();
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedFetch());
- assertTrue(basicMapping.isDefault());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceMethod resourceMethod = resourceType.getMethods().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceMethod.getAnnotation(JPA.BASIC);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, basic.getFetch());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- assertFalse(basicMapping.isDefault());
-
- basicMapping.setSpecifiedFetch(null);
- assertNotNull(resourceMethod.getAnnotation(JPA.BASIC));
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- }
-
- protected void createOrmXmlFile() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testSetBasicToDefault() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(basicMapping.isDefault());
-
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
-
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNotSame(basicMapping, persistentAttribute.getMapping());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertTrue(basicMapping.isDefault());
- assertEquals("FOO", basicMapping.getColumn().getSpecifiedName());
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToDefaultBasic() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getEnumType());
-
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToVersion() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbedded() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbeddedId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToTransient() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IOneToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((IOneToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IOneToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertNotNull(resourceField.mappingAnnotation(OneToMany.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
- public void testBasicMorphToManyToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((IManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToManyToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IManyToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertNotNull(resourceField.mappingAnnotation(ManyToMany.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultBasicGetDefaultOptional() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(true, basicMapping.isDefaultOptional());
- }
-
- public void testSpecifiedBasicGetDefaultOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(true, basicMapping.isDefaultOptional());
- }
-
- public void testGetOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(true, basicMapping.isOptional());
-
- basicMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(true, basicMapping.isOptional());
- }
-
- public void testGetSpecifiedOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getSpecifiedOptional());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- basic.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
- }
-
- public void testGetSpecifiedOptional2() throws Exception {
- createTestEntityWithBasicMappingFetchOptionalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
- }
-
- public void testSetSpecifiedOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedOptional());
-
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
-
- assertEquals(Boolean.FALSE, basic.getOptional());
-
- basicMapping.setSpecifiedOptional(null);
- assertNotNull(resourceField.getAnnotation(JPA.BASIC));
- }
-
- public void testSetSpecifiedOptional2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedOptional());
- assertTrue(basicMapping.isDefault());
-
- basicMapping.setSpecifiedOptional(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
-
- assertEquals(Boolean.TRUE, basic.getOptional());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, basicMapping.getSpecifiedOptional());
- assertFalse(basicMapping.isDefault());
-
- basicMapping.setSpecifiedOptional(null);
- assertNotNull(resourceField.getAnnotation(JPA.BASIC));
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- }
-
-
- public void testGetSpecifiedOptionalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getSpecifiedOptional());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- basic.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
-
- basic.setOptional(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getSpecifiedOptional());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
-
- basic.setOptional(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(true, ((BasicMapping) persistentAttribute.getMapping()).isOptional());
- }
-
-
- public void testIsLob() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertFalse(basicMapping.getConverter().getType() == LobConverter.class);
- }
-
- public void testIsLob2() throws Exception {
- createTestEntityWithLob();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertTrue(basicMapping.getConverter().getType() == LobConverter.class);
- }
-
- public void testSetLob() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- basicMapping.setConverter(LobConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- }
-
- public void testIsLobUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertFalse(basicMapping.getConverter().getType() == LobConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertTrue(basicMapping.getConverter().getType() == LobConverter.class);
-
- resourceField.removeAnnotation(LobAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertFalse(basicMapping.getConverter().getType() == LobConverter.class);
- }
-
- public void testDefaultBasicGetDefaultConverter() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
- }
-
- public void testSpecifiedBasicGetDefaultConverter() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
- }
-
- public void testGetEnumerated() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EnumeratedAnnotation enumeratedAnnotation = (EnumeratedAnnotation) resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) basicMapping.getConverter()).getDefaultEnumType());
-
- enumeratedAnnotation.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
- assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- }
-
- public void testGetSpecifiedEnumerated() throws Exception {
- createTestEntityWithEnumerated();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- }
-
- public void testSetSpecifiedEnumerated() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
-
- basicMapping.setConverter(EnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(TemporalConverter.class, basicMapping.getConverter().getType());
- }
-
- public void testGetTemporal2() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(TemporalConverter.class, basicMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) basicMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
-
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.DATE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalConverter.class, basicMapping.getConverter().getType());
- assertEquals(TemporalType.DATE, ((TemporalConverter) basicMapping.getConverter()).getTemporalType());
-
- resourceField.removeAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
- assertEquals("id", basicMapping.getColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
- assertEquals("foo", basicMapping.getColumn().getName());
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java
deleted file mode 100644
index b2fe6086c3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaCascade;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaCascadeTests
- extends ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
-
- public JavaCascadeTests(String name) {
- super(name);
- }
-
-
- public void testUpdateCascadeAll() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isAll());
- assertFalse(annotation.isCascadeAll());
-
- //set all in the resource model, verify context model updated
- annotation.setCascadeAll(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeAll());
- assertTrue(cascade.isAll());
-
- //set all to false in the resource model
- annotation.setCascadeAll(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeAll());
- assertFalse(cascade.isAll());
- }
-
- public void testModifyCascadeAll() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isAll());
- assertFalse(annotation.isCascadeAll());
-
- //set all in the context model, verify resource model updated
- cascade.setAll(true);
- assertTrue(annotation.isCascadeAll());
- assertTrue(cascade.isAll());
-
- //set all to false in the context model
- cascade.setAll(false);
- assertFalse(annotation.isCascadeAll());
- assertFalse(cascade.isAll());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isPersist());
- assertFalse(annotation.isCascadePersist());
-
- //set persist in the resource model, verify context model updated
- annotation.setCascadePersist(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadePersist());
- assertTrue(cascade.isPersist());
-
- //set persist to false in the resource model
- annotation.setCascadePersist(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadePersist());
- assertFalse(cascade.isPersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isPersist());
- assertFalse(annotation.isCascadePersist());
-
- //set persist in the context model, verify resource model updated
- cascade.setPersist(true);
- assertTrue(annotation.isCascadePersist());
- assertTrue(cascade.isPersist());
-
- //set persist to false in the context model
- cascade.setPersist(false);
- assertFalse(annotation.isCascadePersist());
- assertFalse(cascade.isPersist());
- }
-
- public void testUpdateCascadeMerge() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isMerge());
- assertFalse(annotation.isCascadeMerge());
-
- //set merge in the resource model, verify context model updated
- annotation.setCascadeMerge(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeMerge());
- assertTrue(cascade.isMerge());
-
- //set merge to false in the resource model
- annotation.setCascadeMerge(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeMerge());
- assertFalse(cascade.isMerge());
- }
-
- public void testModifyCascadeMerge() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isMerge());
- assertFalse(annotation.isCascadeMerge());
-
- //set merge in the context model, verify resource model updated
- cascade.setMerge(true);
- assertTrue(annotation.isCascadeMerge());
- assertTrue(cascade.isMerge());
-
- //set merge to false in the context model
- cascade.setMerge(false);
- assertFalse(annotation.isCascadeMerge());
- assertFalse(cascade.isMerge());
- }
-
- public void testUpdateCascadeRemove() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRemove());
- assertFalse(annotation.isCascadeRemove());
-
- //set remove in the resource model, verify context model updated
- annotation.setCascadeRemove(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeRemove());
- assertTrue(cascade.isRemove());
-
- //set remove to false in the resource model
- annotation.setCascadeRemove(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeRemove());
- assertFalse(cascade.isRemove());
- }
-
- public void testModifyCascadeRemove() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRemove());
- assertFalse(annotation.isCascadeRemove());
-
- //set remove in the context model, verify resource model updated
- cascade.setRemove(true);
- assertTrue(annotation.isCascadeRemove());
- assertTrue(cascade.isRemove());
-
- //set remove to false in the context model
- cascade.setRemove(false);
- assertFalse(annotation.isCascadeRemove());
- assertFalse(cascade.isRemove());
- }
-
- public void testUpdateCascadeRefresh() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRefresh());
- assertFalse(annotation.isCascadeRefresh());
-
- //set refresh in the resource model, verify context model updated
- annotation.setCascadeRefresh(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeRefresh());
- assertTrue(cascade.isRefresh());
-
- //set refresh to false in the resource model
- annotation.setCascadeRefresh(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeRefresh());
- assertFalse(cascade.isRefresh());
- }
-
- public void testModifyCascadeRefresh() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRefresh());
- assertFalse(annotation.isCascadeRefresh());
-
- //set refresh in the context model, verify resource model updated
- cascade.setRefresh(true);
- assertTrue(annotation.isCascadeRefresh());
- assertTrue(cascade.isRefresh());
-
- //set refresh to false in the context model
- cascade.setRefresh(false);
- assertFalse(annotation.isCascadeRefresh());
- assertFalse(cascade.isRefresh());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java
deleted file mode 100644
index 5df35938fb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java
+++ /dev/null
@@ -1,844 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaColumnTests extends ContextModelTestCase
-{
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDefaultBasicColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name=\"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicColumnTableSet() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Column(table=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicColumnColumnDefinitionSet() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Column(columnDefinition=\"" + COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- public JavaColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(COLUMN_NAME, basicMapping.getColumn().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(basicMapping.getPersistentAttribute().getName(), basicMapping.getColumn().getDefaultName());
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("id", basicMapping.getColumn().getDefaultName());
-
- basicMapping.getColumn().setSpecifiedName("foo");
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals("id", basicMapping.getColumn().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(COLUMN_NAME, basicMapping.getColumn().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedName("foo");
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedName(null);
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetNameUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
-
- columnAnnotation.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
- assertEquals("foo", basicMapping.getColumn().getName());
-
- columnAnnotation.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getColumn().getSpecifiedName());
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- public void testGetSpecifiedTableNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetSpecifiedTable() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(TABLE_NAME, basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetDefaultTableSpecifiedTableNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(((Entity) basicMapping.getTypeMapping()).getName(), basicMapping.getColumn().getDefaultTable());
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
- }
-
- public void testGetDefaultTable() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
-
- basicMapping.getColumn().setSpecifiedTable("foo");
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
- }
-
- public void testGetTable() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(TABLE_NAME, basicMapping.getColumn().getTable());
- }
-
- public void testSetSpecifiedTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedTable("foo");
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getTable());
- }
-
- public void testSetSpecifiedTableNull() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedTable(null);
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetTableUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
-
- column.setTable("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", basicMapping.getColumn().getSpecifiedTable());
- assertEquals("foo", basicMapping.getColumn().getTable());
-
- column.setTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(COLUMN_DEFINITION, basicMapping.getColumn().getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setColumnDefinition("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- basicMapping.getColumn().setColumnDefinition(null);
- assertNull(column.getColumnDefinition());
- }
-
- public void testGetColumnDefinitionUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getColumnDefinition());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
-
- column.setColumnDefinition("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", basicMapping.getColumn().getColumnDefinition());
-
- column.setColumnDefinition(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getColumn().getColumnDefinition());
-
- }
-
- public void testGetLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, basicMapping.getColumn().getLength());
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55));
- assertEquals(55, basicMapping.getColumn().getLength());
- }
-
- public void testGetDefaultLength() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, basicMapping.getColumn().getDefaultLength());
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55));
-
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, basicMapping.getColumn().getDefaultLength());
- }
-
- public void testGetSpecifiedLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setLength(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedLength());
- assertEquals(66, basicMapping.getColumn().getLength());
-
- columnAnnotation.setLength(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
- }
-
- public void testSetSpecifiedLength() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
-
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), columnAnnotation.getLength());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedLength(null);
-
- assertNull(columnAnnotation.getLength());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetPrecision() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, basicMapping.getColumn().getPrecision());
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55));
- assertEquals(55, basicMapping.getColumn().getPrecision());
- }
-
- public void testGetDefaultPrecision() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, basicMapping.getColumn().getDefaultPrecision());
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55));
-
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, basicMapping.getColumn().getDefaultPrecision());
- }
-
- public void testGetSpecifiedPrecision() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setPrecision(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedPrecision());
- assertEquals(66, basicMapping.getColumn().getPrecision());
-
- columnAnnotation.setPrecision(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
- }
-
- public void testSetSpecifiedPrecision() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
-
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), columnAnnotation.getPrecision());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedPrecision(null);
-
- assertNull(columnAnnotation.getPrecision());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetScale() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, basicMapping.getColumn().getScale());
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55));
- assertEquals(55, basicMapping.getColumn().getScale());
- }
-
- public void testGetDefaultScale() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, basicMapping.getColumn().getDefaultScale());
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55));
-
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, basicMapping.getColumn().getDefaultScale());
- }
-
- public void testGetSpecifiedScale() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setScale(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedScale());
- assertEquals(66, basicMapping.getColumn().getScale());
-
- columnAnnotation.setScale(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
- }
-
- public void testSetSpecifiedScale() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
-
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), columnAnnotation.getScale());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedScale(null);
-
- assertNull(columnAnnotation.getScale());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetUnique() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isUnique());
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isUnique());
- }
-
- public void testGetDefaultUnique() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isDefaultUnique());
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isDefaultUnique());
- }
-
- public void testGetSpecifiedUnique() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setUnique(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedUnique());
- assertEquals(true, basicMapping.getColumn().isUnique());
-
- columnAnnotation.setUnique(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
- }
-
- public void testSetSpecifiedUnique() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
-
- basicMapping.getColumn().setSpecifiedUnique(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getUnique());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedUnique(null);
-
- assertNull(columnAnnotation.getUnique());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetInsertable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isInsertable());
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isInsertable());
- }
-
- public void testGetDefaultInsertable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isDefaultInsertable());
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isDefaultInsertable());
- }
-
- public void testGetSpecifiedInsertable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setInsertable(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedInsertable());
- assertEquals(true, basicMapping.getColumn().isInsertable());
-
- columnAnnotation.setInsertable(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
- }
-
- public void testSetSpecifiedInsertable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
-
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getInsertable());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedInsertable(null);
-
- assertNull(columnAnnotation.getInsertable());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetNullable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isNullable());
- basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isNullable());
- }
-
- public void testGetDefaultNullable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isDefaultNullable());
- basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isDefaultNullable());
- }
-
- public void testGetSpecifiedNullable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setNullable(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedNullable());
- assertEquals(true, basicMapping.getColumn().isNullable());
-
- columnAnnotation.setNullable(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
- }
-
- public void testSetSpecifiedNullable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
-
- basicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getNullable());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedNullable(null);
-
- assertNull(columnAnnotation.getNullable());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetUpdatable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isUpdatable());
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isUpdatable());
- }
-
- public void testGetDefaultUpdatable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isDefaultUpdatable());
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isDefaultUpdatable());
- }
-
- public void testGetSpecifiedUpdatable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setUpdatable(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedUpdatable());
- assertEquals(true, basicMapping.getColumn().isUpdatable());
-
- columnAnnotation.setUpdatable(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
- }
-
- public void testSetSpecifiedUpdatable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
-
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getUpdatable());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedUpdatable(null);
-
- assertNull(columnAnnotation.getUpdatable());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java
deleted file mode 100644
index d9dacae611..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaDiscriminatorColumnTests extends ContextModelTestCase
-{
- private static final String DISCRIMINATOR_COLUMN_NAME = "MY_DISCRIMINATOR_COLUMN";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@DiscriminatorColumn(name=\"" + DISCRIMINATOR_COLUMN_NAME + "\")");
- }
- });
- }
-
- private void createTestAbstractEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
- public JavaDiscriminatorColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_COLUMN_NAME, getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDefaultName());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDefaultName());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName("foo");
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getName());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_COLUMN_NAME, getJavaEntity().getDiscriminatorColumn().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals("foo", discriminatorColumn.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNull(discriminatorColumn);
- }
-
- public void testGetDefaultDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorType.STRING, getJavaEntity().getDiscriminatorColumn().getDefaultDiscriminatorType());
- }
-
- public void testGetDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorType.STRING, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
- assertEquals(DiscriminatorType.CHAR, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
- }
-
- public void testGetSpecifiedDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- discriminatorColumn.setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType.CHAR);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(DiscriminatorType.CHAR, getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- }
-
- public void testSetSpecifiedDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType.CHAR, discriminatorColumn.getDiscriminatorType());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null);
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- assertNull(resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN));
- }
-
- public void testGetDiscriminatorTypeUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.addAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- column.setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType.INTEGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(DiscriminatorType.INTEGER, getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- assertEquals(DiscriminatorType.INTEGER, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- column.setDiscriminatorType(null);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
- }
-
- public void testGetLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getDiscriminatorColumn().getLength());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getLength());
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55));
- assertEquals(55, getJavaEntity().getDiscriminatorColumn().getLength());
- }
-
- public void testGetDefaultLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getDiscriminatorColumn().getDefaultLength());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getDefaultLength());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55));
-
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getDefaultLength());
- }
-
- public void testGetSpecifiedLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- discriminatorColumn.setLength(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(66, getJavaEntity().getDiscriminatorColumn().getLength());
- discriminatorColumn.setName(null);
- discriminatorColumn.setLength(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- }
-
- public void testSetSpecifiedLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(100), discriminatorColumn.getLength());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null);
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(null);
- assertNull(resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN));
- }
-
- public void testGetLengthUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.addAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- column.setLength(Integer.valueOf(78));
- getJpaProject().synchronizeContextModel();
- assertEquals(Integer.valueOf(78), getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(78, getJavaEntity().getDiscriminatorColumn().getLength());
-
- column.setLength(null);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(0, getJavaEntity().getDiscriminatorColumn().getLength());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getLength());
- }
-
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- column.setColumnDefinition(COLUMN_DEFINITION);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(COLUMN_DEFINITION, getJavaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- column.setColumnDefinition(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- resourceType.removeAnnotation(JPA.DISCRIMINATOR_COLUMN);
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getDiscriminatorColumn().setColumnDefinition("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- getJavaEntity().getDiscriminatorColumn().setColumnDefinition(null);
- column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNull(column.getColumnDefinition());
- }
-
- public void testDefaults() throws Exception {
- createTestAbstractEntity();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + "." + "AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- JavaEntity childEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
-
- //test defaults with single-table inheritance, no specified discriminator column set
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set on root
- abstractEntity.getDiscriminatorColumn().setSpecifiedName("DTYPE2");
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(5));
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals("DTYPE2", abstractEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(Integer.valueOf(5), abstractEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(DiscriminatorType.CHAR, abstractEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("DTYPE2", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
-
- //test defaults with table-per-class inheritance, discriminator column does not apply
- abstractEntity.getDiscriminatorColumn().setSpecifiedName(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- abstractEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getInheritanceStrategy());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getDefaultInheritanceStrategy());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java
deleted file mode 100644
index c096920447..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddableTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable");
- }
- });
- }
-
-
- public JavaEmbeddableTests(String name) {
- super(name);
- }
-
- public void testMorphToEntity() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Entity);
-
- JavaResourceAbstractType resourceType = getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToMappedSuperclass() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass);
-
- JavaResourceAbstractType resourceType = getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- JavaResourceAbstractType resourceType = getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testEmbeddable() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = embeddable.getOverridableAttributeNames().iterator();
- assertEquals(overridableAttributeNames.next(), "id");
- assertEquals(overridableAttributeNames.next(), "name");
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = embeddable.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME));
- assertFalse(embeddable.tableNameIsInvalid("FOO"));
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
-
- public void testAssociatedTables() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.getAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.getAllAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.getAllAssociatedTableNames().iterator().hasNext());
- }
-
- //TODO need to create a subclass mappedSuperclass and test this
- public void testAllOverridableAssociationNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = embeddable.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
deleted file mode 100644
index 7ce0b398e8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId").append(CR);
- sb.append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME +" myEmbeddedId;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
-
- public JavaEmbeddedIdMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((JavaEmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("myEmbeddedId", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("myEmbeddedId", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state");
- getJpaProject().synchronizeContextModel();
- assertEquals(0, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
deleted file mode 100644
index c7ce2cafd5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
+++ /dev/null
@@ -1,861 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddedMappingTests extends ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded").append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME + " myEmbedded;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
-
- public JavaEmbeddedMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((EmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testDefaultEmbeddedMappingGenericEmbeddable() throws Exception {
- createTestEntityWithDefaultEmbeddedMapping();
- createTestGenericEmbeddable();
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Embeddable1");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertNotNull(persistentAttribute.getMapping());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- private void createTestEntityWithDefaultEmbeddedMapping() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 { ").append(CR);
- sb.append("private Embeddable1<Integer> myEmbeddable;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericEmbeddable() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class Embeddable1<T> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Embeddable1.java", sourceWriter);
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state");
- getJpaProject().synchronizeContextModel();
- assertEquals(0, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- //1.0 projects do not support dot-notation, this tests to make sure that support does not exist
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify there is no attribute override named zipCode.plusfour
- virtualAttributeOverride = ((EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java
deleted file mode 100644
index b865594e6c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java
+++ /dev/null
@@ -1,3437 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.NamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEntityTests extends ContextModelTestCase
-{
- private static final String ENTITY_NAME = "entityName";
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String DISCRIMINATOR_VALUE = "MY_DISCRIMINATOR_VALUE";
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public JavaEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityInvalidNamedQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@NamedQueries(value={@NamedQuery(query=\"asdf\", name=\"foo\"), @NamedQuer})");
- }
- });
- }
-
- private void createTestAbstractEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- private ICompilationUnit createTestEntityAnnotationOnProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- JPA.BASIC,
- JPA.VERSION,
- JPA.TRANSIENT,
- JPA.EMBEDDED,
- JPA.EMBEDDED_ID,
- JPA.ONE_TO_ONE,
- JPA.ONE_TO_MANY,
- JPA.MANY_TO_ONE,
- JPA.MANY_TO_MANY,
- JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @Basic");
- sb.append(CR);
- sb.append(" private int basic;").append(CR);
- sb.append(CR);
- sb.append(" @Version");
- sb.append(CR);
- sb.append(" private int version;").append(CR);
- sb.append(CR);
- sb.append(" @Transient");
- sb.append(CR);
- sb.append(" private int transient;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" private int embedded;").append(CR);
- sb.append(CR);
- sb.append(" @EmbeddedId");
- sb.append(CR);
- sb.append(" private int embeddedId;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private " + SUB_TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int oneToMany;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int manyToOne;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int manyToMany;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name=\"" + ENTITY_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Table(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithInheritance() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDiscriminatorValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@DiscriminatorValue(value=\"" + DISCRIMINATOR_VALUE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTable(name=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"foo\"), @SecondaryTable(name=\"bar\")})");
- }
- });
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testMorphToMappedSuperclass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = (JavaEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
-
- getJavaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = (JavaEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = (JavaEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testAccessNoAnnotations() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessAnnotationsOnSuper() throws Exception {
- createTestEntityAnnotationOnProperty();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME_ + "AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- JavaPersistentType childPersistentType = getJavaPersistentType();
- PersistentType superPersistentType = childPersistentType.getSuperPersistentType();
-
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- ((IdMapping) superPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO");
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- resourceType.getMethods().iterator().next().removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- //no mapping(Id) annotation, but still a Column annotation, so access should still be property
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- ((BasicMapping) superPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null);
- assertEquals(AccessType.FIELD, superPersistentType.getAccess());
- assertEquals(AccessType.FIELD, childPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- //still accessType of PROPERTY because the java class is not specified in this orm.xml
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //only parent specified in orm.xml, i think this outcome is right??
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.FIELD, childPersistentType.getAccess());
-
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- removeXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- //both parent and child specified in orm.xml
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.FIELD, childOrmPersistentType.getJavaPersistentType().getAccess());
- }
-
- public void testAccessWithXmlSettings() throws Exception {
- createTestEntityAnnotationOnProperty();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO");
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- resourceType.getMethods().iterator().next().removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- //no mapping(Id) annotation, but still a Column annotation, so access should still be property
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- ((BasicMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- //still accessType of PROPERTY because the java class is not specified in this orm.xml
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //now class is specified in orm.xml, so entityMappings access setting wins over persistence-unit-defaults
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
-
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
-
- //accessType should be PROPERTY now, java gets the access from xml entity if it is specified
- assertEquals(AccessType.PROPERTY, ormPersistentType.getJavaPersistentType().getAccess());
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(ENTITY_NAME, getJavaEntity().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(ENTITY_NAME, getJavaEntity().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals("foo", ((EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME)).getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().setSpecifiedName(null);
-
- assertNull(getJavaEntity().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNull(((EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME)).getName());
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME);
- entity.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getSpecifiedName());
- }
-
- public void testGetTableName() throws Exception {
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityWithName();
-
- assertEquals(ENTITY_NAME, getJavaEntity().getPrimaryTableName());
- }
-
- public void testGetTableName2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getPrimaryTableName());
- }
-
- public void testGetTableName3() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, getJavaEntity().getPrimaryTableName());
- }
-
- public void testSetTableNameWithNullTable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = getJavaEntity().getTable();
- assertEquals(TYPE_NAME, table.getName());
- assertSourceDoesNotContain("@Table", cu);
-
- table.setSpecifiedName(TABLE_NAME);
- assertSourceContains("@Table(name = \"" + TABLE_NAME + "\")", cu);
-
- assertEquals(TABLE_NAME, getJavaEntity().getPrimaryTableName());
- assertEquals(TABLE_NAME, table.getName());
-
- table.setSpecifiedCatalog(TABLE_NAME);
- }
-
- public void testGetInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getInheritanceStrategy());
- }
-
- public void testGetDefaultInheritanceStrategy() throws Exception {
- createTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertNotSame(childEntity, rootEntity);
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
-
- //change root inheritance strategy, verify default is changed for child entity
- rootEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.SINGLE_TABLE, rootEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getInheritanceStrategy());
- assertNull(childEntity.getSpecifiedInheritanceStrategy());
- }
-
- public void testGetSpecifiedInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
-
- inheritance.setStrategy(org.eclipse.jpt.jpa.core.resource.java.InheritanceType.JOINED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(InheritanceType.JOINED, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- inheritance.setStrategy(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getSpecifiedInheritanceStrategy());
- }
-
- public void testSetSpecifiedInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- assertEquals(InheritanceType.JOINED, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.InheritanceType.JOINED, inheritance.getStrategy());
-
- }
-
- public void testGetDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getDiscriminatorValue());
- }
-
- public void testGetDefaultDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDefaultDiscriminatorValue());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- assertEquals(getJavaEntity().getName(), getJavaEntity().getDefaultDiscriminatorValue());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER);
- assertNull(getJavaEntity().getDefaultDiscriminatorValue());
- }
-
- public void testGetSpecifiedDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getSpecifiedDiscriminatorValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
-
- discriminatorValue.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getSpecifiedDiscriminatorValue());
-
- discriminatorValue.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getSpecifiedDiscriminatorValue());
- }
-
- public void testSetSpecifiedDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getSpecifiedDiscriminatorValue());
-
- getJavaEntity().setSpecifiedDiscriminatorValue("foo");
-
- assertEquals("foo", getJavaEntity().getSpecifiedDiscriminatorValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
- assertEquals("foo", discriminatorValue.getValue());
- }
-
- public void testSecondaryTables() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
-
- assertTrue(secondaryTables.hasNext());
- assertEquals("foo", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testSecondaryTablesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getSecondaryTablesSize());
-
- ((SecondaryTableAnnotation) resourceType.addAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getSecondaryTablesSize());
- }
-
- public void testSpecifiedSecondaryTables() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaSecondaryTable> specifiedSecondaryTables = getJavaEntity().getSpecifiedSecondaryTables().iterator();
-
- assertTrue(specifiedSecondaryTables.hasNext());
- assertEquals("foo", specifiedSecondaryTables.next().getName());
- assertEquals("bar", specifiedSecondaryTables.next().getName());
- assertFalse(specifiedSecondaryTables.hasNext());
- }
-
- public void testSpecifiedSecondaryTablesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getSpecifiedSecondaryTablesSize());
-
- ((SecondaryTableAnnotation) resourceType.addAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getSpecifiedSecondaryTablesSize());
- }
-
- public void testAddSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAddSpecifiedSecondaryTable2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAddSpecifiedSecondaryTablePreservePkJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable specifiedSecondaryTable = getJavaEntity().addSpecifiedSecondaryTable(0);
- specifiedSecondaryTable.setSpecifiedName("FOO");
- specifiedSecondaryTable.setSpecifiedCatalog("CATALOG");
- specifiedSecondaryTable.setSpecifiedSchema("SCHEMA");
- specifiedSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("PK_NAME");
-
- //add another specified secondary table, pkJoinColumns from first should be saved.
- SecondaryTable specifiedSecondaryTable2 = getJavaEntity().addSpecifiedSecondaryTable(1);
- specifiedSecondaryTable2.setSpecifiedName("BAR");
-
-
- Iterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- SecondaryTable secondaryTable = secondaryTables.next();
- assertEquals(secondaryTable, specifiedSecondaryTable);
- assertEquals("FOO", secondaryTable.getName());
- assertEquals("CATALOG", secondaryTable.getCatalog());
- assertEquals("SCHEMA", secondaryTable.getSchema());
- assertEquals(1, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
- PrimaryKeyJoinColumn pkJoinColumn = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("PK_NAME", pkJoinColumn.getName());
-
- secondaryTable = secondaryTables.next();
- assertEquals(secondaryTable, specifiedSecondaryTable2);
- assertEquals("BAR", secondaryTable.getName());
- assertEquals(0, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
-
- }
-
- public void testRemoveSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(3, resourceType.getAnnotationsSize(SecondaryTableAnnotation.ANNOTATION_NAME));
-
- getJavaEntity().removeSpecifiedSecondaryTable(1);
-
- Iterator<NestableAnnotation> secondaryTableResources = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertFalse(secondaryTableResources.hasNext());
-
- Iterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
-
- getJavaEntity().removeSpecifiedSecondaryTable(1);
- secondaryTableResources = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertFalse(secondaryTableResources.hasNext());
-
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
-
- getJavaEntity().removeSpecifiedSecondaryTable(0);
- secondaryTableResources = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(secondaryTableResources.hasNext());
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertFalse(secondaryTables.hasNext());
-
- assertNull(resourceType.getAnnotation(SecondaryTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- entity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- Iterator<NestableAnnotation> javaSecondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaSecondaryTables));
-
-
- entity.moveSpecifiedSecondaryTable(2, 0);
- ListIterator<JavaSecondaryTable> secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
-
- javaSecondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("BAZ", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
-
-
- entity.moveSpecifiedSecondaryTable(0, 1);
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
-
- javaSecondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- }
-
- public void testUpdateSpecifiedSecondaryTables() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((SecondaryTableAnnotation) resourceType.addAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaSecondaryTable> secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.moveAnnotation(2, 0, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.moveAnnotation(0, 1, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.removeAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.removeAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.removeAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAssociatedTables() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, CollectionTools.size(getJavaEntity().getAssociatedTables()));
- Iterator<ReadOnlyTable> associatedTables = getJavaEntity().getAssociatedTables().iterator();
- ReadOnlyTable table1 = associatedTables.next();
- SecondaryTable table2 = (SecondaryTable) associatedTables.next();
- SecondaryTable table3 = (SecondaryTable) associatedTables.next();
- assertEquals(TYPE_NAME, table1.getName());
- assertEquals("foo", table2.getName());
- assertEquals("bar", table3.getName());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestEntityWithSecondaryTables();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertEquals(3, CollectionTools.size(rootEntity.getAllAssociatedTables()));
- Iterator<ReadOnlyTable> associatedTables = rootEntity.getAllAssociatedTables().iterator();
- ReadOnlyTable table1 = associatedTables.next();
- SecondaryTable table2 = (SecondaryTable) associatedTables.next();
- SecondaryTable table3 = (SecondaryTable) associatedTables.next();
- assertEquals(TYPE_NAME, table1.getName());
- assertEquals("foo", table2.getName());
- assertEquals("bar", table3.getName());
-
- //TODO probably want this to be 3, since in this case the child descriptor really uses the
- //parent table because it is single table inheritance strategy. Not sure yet how to deal with this.
- assertEquals(4, CollectionTools.size(childEntity.getAllAssociatedTables()));
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestEntityWithSecondaryTables();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertEquals(3, CollectionTools.size(rootEntity.getAllAssociatedTableNames()));
- Iterator<String> associatedTables = rootEntity.getAllAssociatedTableNames().iterator();
- String table1 = associatedTables.next();
- String table2 = associatedTables.next();
- String table3 = associatedTables.next();
- assertEquals(TYPE_NAME, table1);
- assertEquals("foo", table2);
- assertEquals("bar", table3);
-
- //TODO probably want this to be 3, since in this case the child descriptor really uses the
- //parent table because it is single table inheritance strategy. Not sure yet how to deal with this.
- assertEquals(4, CollectionTools.size(childEntity.getAllAssociatedTableNames()));
- }
-
- public void testAddSecondaryTableToResourceModel() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(1, getJavaEntity().getSecondaryTablesSize());
- assertEquals("FOO", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedName());
- assertEquals("FOO", getJavaEntity().getSecondaryTables().iterator().next().getName());
-
- SecondaryTableAnnotation secondaryTable2 = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable2.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, getJavaEntity().getSecondaryTablesSize());
- ListIterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
-
- SecondaryTableAnnotation secondaryTable3 = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable3.setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, getJavaEntity().getSecondaryTablesSize());
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- }
-
- public void testRemoveSecondaryTableFromResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("baz");
- ListIterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
-
- assertEquals(3, getJavaEntity().getSecondaryTablesSize());
- assertEquals("foo", secondaryTables.next().getSpecifiedName());
- assertEquals("bar", secondaryTables.next().getSpecifiedName());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, getJavaEntity().getSecondaryTablesSize());
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("bar", secondaryTables.next().getSpecifiedName());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
- getJpaProject().synchronizeContextModel();
-
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals(1, getJavaEntity().getSecondaryTablesSize());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
- getJpaProject().synchronizeContextModel();
-
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals(0, getJavaEntity().getSecondaryTablesSize());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testGetSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
- assertEquals(0, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
- assertEquals(2, resourceType.getAnnotationsSize());
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- getJavaEntity().getGeneratorContainer().getSequenceGenerator().setName("foo");
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
-
- getJavaEntity().getGeneratorContainer().addSequenceGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNotNull(resourceType.getAnnotation(JPA.SEQUENCE_GENERATOR));
- assertNotNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- getJavaEntity().getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
- assertNull(resourceType.getAnnotation(JPA.SEQUENCE_GENERATOR));
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
- assertEquals(0, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
- assertEquals(2, resourceType.getAnnotationsSize());
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- getJavaEntity().getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
-
- getJavaEntity().getGeneratorContainer().addTableGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNotNull(resourceType.getAnnotation(JPA.TABLE_GENERATOR));
- assertNotNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- getJavaEntity().getGeneratorContainer().removeTableGenerator();
-
- assertNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
- assertNull(resourceType.getAnnotation(JPA.TABLE_GENERATOR));
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetDiscriminatorColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(getJavaEntity().getDiscriminatorColumn());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.addAnnotation(JPA.DISCRIMINATOR_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- column.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- resourceType.removeAnnotation(JPA.DISCRIMINATOR_COLUMN);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(getJavaEntity().getDiscriminatorColumn());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
-
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- pkJoinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- pkJoinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- pkJoinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(specifiedPkJoinColumns.hasNext());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getSpecifiedPrimaryKeyJoinColumnsSize());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertEquals(3, getJavaEntity().getSpecifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- //just the default pkJoinColumn, so 1
- assertEquals(1, getJavaEntity().getPrimaryKeyJoinColumnsSize());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- //only the specified pkJoinColumns, 3
- assertEquals(3, getJavaEntity().getPrimaryKeyJoinColumnsSize());
- }
-
- public void testGetDefaultPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> pkJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertFalse(pkJoinColumns.hasNext());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> pkJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertFalse(pkJoinColumns.hasNext());
- }
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(3, resourceType.getAnnotationsSize(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
-
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> pkJoinColumnResources = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- Iterator<JavaPrimaryKeyJoinColumn> pkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(1);
- pkJoinColumnResources = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- pkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumnResources = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(pkJoinColumnResources.hasNext());
- pkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(pkJoinColumns.hasNext());
-
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- entity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- entity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<NestableAnnotation> javaPrimaryKeyJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaPrimaryKeyJoinColumns));
-
-
- entity.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaPrimaryKeyJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
-
-
- entity.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaPrimaryKeyJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(2, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.moveAnnotation(2, 0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.moveAnnotation(0, 1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.removeAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.removeAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.removeAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(primaryKeyJoinColumns.hasNext());
- }
-
- public void testPrimaryKeyJoinColumnIsVirtual() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(getJavaEntity().getDefaultPrimaryKeyJoinColumn().isDefault());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isDefault());
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertFalse(getJavaEntity().tableNameIsInvalid(TYPE_NAME));
- assertTrue(getJavaEntity().tableNameIsInvalid("FOO"));
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
-
- assertFalse(getJavaEntity().tableNameIsInvalid("BAR"));
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributes.next());
- assertEquals("basic", overridableAttributes.next());
- assertEquals("version", overridableAttributes.next());
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributes.next());
- assertEquals("basic", overridableAttributes.next());
- assertEquals("version", overridableAttributes.next());
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributeNames.next());
- assertEquals("basic", overridableAttributeNames.next());
- assertEquals("version", overridableAttributeNames.next());
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrideDefaults() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertEquals("foo", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- BasicMapping fooMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("foo").getMapping();
- fooMapping.getColumn().setSpecifiedName("FOO");
- fooMapping.getColumn().setSpecifiedTable("BAR");
- fooMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- fooMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- fooMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- fooMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- fooMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- fooMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- fooMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- fooMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- fooMapping.getColumn().setSpecifiedName(null);
- fooMapping.getColumn().setSpecifiedTable(null);
- fooMapping.getColumn().setColumnDefinition(null);
- fooMapping.getColumn().setSpecifiedInsertable(null);
- fooMapping.getColumn().setSpecifiedUpdatable(null);
- fooMapping.getColumn().setSpecifiedUnique(null);
- fooMapping.getColumn().setSpecifiedNullable(null);
- fooMapping.getColumn().setSpecifiedLength(null);
- fooMapping.getColumn().setSpecifiedPrecision(null);
- fooMapping.getColumn().setSpecifiedScale(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertEquals("foo", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testVirtualAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- JavaEntity superclass = (JavaEntity) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(5, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(5, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(5, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(6, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("basic", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("basic", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(4, CollectionTools.size(resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME)));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("basic", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("version", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("basic", attributeOverrides.next().getName());
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("version", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("id", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(4, CollectionTools.size(javaAttributeOverrides));
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("basic", attributeOverrides.next().getName());
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("basic", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("version", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("basic", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("version", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("basic", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(2, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("oneToOne", overridableAssociationNames.next());
- assertEquals("manyToOne", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociations() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("oneToOne", overridableAssociations.next());
- assertEquals("manyToOne", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-//
-// public void testAllOverridableAssociationsMappedSuperclassInOrmXml() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-// getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// Iterator<RelationshipMapping> overridableAssociations = getJavaEntity().allOverridableAssociations();
-// assertEquals("oneToOne", overridableAssociations.next().getName());
-// assertEquals("manyToOne", overridableAssociations.next().getName());
-// assertFalse(overridableAssociations.hasNext());
-// }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideDefaults() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AssociationOverrideContainer overrideContainer = javaEntity.getAssociationOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- ReadOnlyJoinColumnRelationshipStrategy joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- ReadOnlyJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("oneToOne_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(SUB_TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) getJavaPersistentType().getAttributeNamed("oneToOne").getMapping();
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
-
-
-
-
-
- //idMapping.getColumn().setSpecifiedName(null);
- //idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(2, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("manyToOne", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("manyToOne", associationOverrides.next().getName());
- assertEquals("oneToOne", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("oneToOne", associationOverrides.next().getName());
- assertEquals("manyToOne", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(2, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("manyToOne", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("manyToOne", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testAddNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- NamedQuery namedQuery1 = entity.getQueryContainer().addNamedQuery(0);
- namedQuery1.setName("FOO");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedQuery namedQuery2 = entity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedQuery namedQuery3 = entity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery1, namedQueries.next());
-
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("foo");
- }
-
- public void testInvalidNamedQueries() throws Exception {
- createTestEntityInvalidNamedQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- assertEquals(1, entity.getQueryContainer().getNamedQueriesSize());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testAddNamedNativeQueryWithNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
-
-
- NamedNativeQueryAnnotation nativeQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- nativeQuery.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(1, entity.getQueryContainer().getNamedNativeQueriesSize());
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- }
-
- public void testAddNamedQueryWithNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
-
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(1, entity.getQueryContainer().getNamedQueriesSize());
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- }
-
- public void testMoveNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
-
- entity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
-
- entity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
-
- ((NamedQueryAnnotation) resourceType.addAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedQueryAnnotation) resourceType.addAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedQueryAnnotation) resourceType.addAnnotation(2, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.moveAnnotation(2, 0, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.moveAnnotation(0, 1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.removeAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testNamedQueriesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getQueryContainer().getNamedQueriesSize());
-
- ((NamedQueryAnnotation) resourceType.addAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedQueryAnnotation) resourceType.addAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedQueryAnnotation) resourceType.addAnnotation(2, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getQueryContainer().getNamedQueriesSize());
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedNativeQuery namedNativeQuery2 = entity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedNativeQuery namedNativeQuery3 = entity.getQueryContainer().addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals(namedNativeQuery2, namedQueries.next());
- assertEquals(namedNativeQuery3, namedQueries.next());
- assertEquals(namedNativeQuery, namedQueries.next());
-
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().removeNamedNativeQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedNativeQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedNativeQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().moveNamedNativeQuery(2, 0);
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
-
- entity.getQueryContainer().moveNamedNativeQuery(0, 1);
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
-
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(2, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.moveAnnotation(2, 0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.moveAnnotation(0, 1, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.removeAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testNamedNativeQueriesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getQueryContainer().getNamedNativeQueriesSize());
-
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(2, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getQueryContainer().getNamedNativeQueriesSize());
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestEntity();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- IdClassAnnotation idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- // test setting id class name to nonexistent class. test class name is set, but class is null
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassAnnotation.setValue(nonExistentIdClassName);
- getJpaProject().synchronizeContextModel();
- assertEquals(nonExistentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- // test setting id class name to existent class. test class name is set and class is not null
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassAnnotation.setValue(existentIdClassName);
- getJpaProject().synchronizeContextModel();
- assertEquals(existentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertNotNull(getJavaEntity().getIdClassReference().getIdClass());
-
- //test setting @IdClass value to null
- idClassAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- //reset @IdClass value and then remove @IdClass
- idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- idClassAnnotation.setValue(existentIdClassName);
- resourceType.removeAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestEntity();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME_ + "Foo";
- getJavaEntity().getIdClassReference().setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(nonExistentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- String existentIdClassName = PACKAGE_NAME_ + "TestTypeId";
- getJavaEntity().getIdClassReference().setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(existentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNotNull(getJavaEntity().getIdClassReference().getIdClass());
-
- getJavaEntity().getIdClassReference().setSpecifiedIdClassName(null);
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
- }
-
- public void testGetPrimaryKeyColumnNameWithAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType entityPersistentType = classRefs.next().getJavaPersistentType();
- JavaEntity javaEntity = (JavaEntity) entityPersistentType.getMapping();
- JavaPersistentType mappedSuperclassPersistentType = classRefs.next().getJavaPersistentType();
-
- assertEquals("id", javaEntity.getPrimaryKeyColumnName());
-
- ((JavaIdMapping) mappedSuperclassPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("MY_ID", javaEntity.getPrimaryKeyColumnName());
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = javaEntity.getAttributeOverrideContainer().getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next();
- JavaVirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
-
- virtualOverride.convertToSpecified().getColumn().setSpecifiedName("ID");
- assertEquals("ID", javaEntity.getPrimaryKeyColumnName());
- }
-
- public void testDiscriminatorValueIsUndefinedConcreteClass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaEntity().discriminatorValueIsUndefined());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertFalse(getJavaEntity().discriminatorValueIsUndefined());
- }
-
- public void testDiscriminatorValueIsUndefinedAbstractClass() throws Exception {
- createTestAbstractEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaEntity().discriminatorValueIsUndefined());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertTrue(getJavaEntity().discriminatorValueIsUndefined());
- }
-
- public void testSpecifiedDiscriminatorColumnIsAllowed() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity concreteEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
- //table-per-class, no discriminator column allowed
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertFalse(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
-
-
- //single-table, discriminator column allowed on root entity
- abstractEntity.setSpecifiedInheritanceStrategy(null);
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertTrue(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
- }
-
- public void testAbstractEntityGetDefaultDiscriminatorColumnNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity concreteEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(null, concreteEntity.getDiscriminatorColumn().getDefaultName());
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertEquals(null, abstractEntity.getDefaultDiscriminatorValue());
- assertTrue(concreteEntity.discriminatorValueIsUndefined());
- assertEquals(null, concreteEntity.getDefaultDiscriminatorValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java
deleted file mode 100644
index 3df675ec4b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GenerationType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaGeneratedValueTests extends ContextModelTestCase
-{
- private static final String GENERATOR = "MY_GENERATOR";
-
- private ICompilationUnit createTestEntityWithGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.GENERATED_VALUE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@GeneratedValue(generator=\"" + GENERATOR + "\")");
- }
- });
- }
-
- public JavaGeneratedValueTests(String name) {
- super(name);
- }
-
- public void testGetGenerator() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- generatedValue.setGenerator("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getGeneratedValue().getGenerator());
- }
-
- public void testSetSpecifiedGenerator() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- idMapping.getGeneratedValue().setSpecifiedGenerator("foo");
-
- assertEquals("foo", idMapping.getGeneratedValue().getGenerator());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- assertEquals("foo", generatedValue.getGenerator());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- idMapping.getGeneratedValue().setSpecifiedGenerator(null);
-
- assertNotNull(idMapping.getGeneratedValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- assertNotNull(generatedValue);
- }
-
- public void testGetStrategy() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- generatedValue.setStrategy(org.eclipse.jpt.jpa.core.resource.java.GenerationType.IDENTITY);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(GenerationType.IDENTITY, idMapping.getGeneratedValue().getStrategy());
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getDefaultStrategy());
- }
-
- public void testSetSpecifiedStrategy() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
-
- idMapping.getGeneratedValue().setSpecifiedStrategy(GenerationType.IDENTITY);
-
- assertEquals(GenerationType.IDENTITY, idMapping.getGeneratedValue().getStrategy());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.GenerationType.IDENTITY, generatedValue.getStrategy());
-
- idMapping.getGeneratedValue().setSpecifiedStrategy(null);
-
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
- generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertNotNull(generatedValue);
- assertNull(generatedValue.getStrategy());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java
deleted file mode 100644
index 38c7d85056..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java
+++ /dev/null
@@ -1,716 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaIdMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdMappingGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.GENERATED_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@GeneratedValue").append(CR);
- }
- });
- }
-
- public JavaIdMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) idMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getConverter().getType());
-
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- idMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.DATE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.DATE, ((TemporalConverter) idMapping.getConverter()).getTemporalType());
-
- resourceField.removeAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(idMapping.getConverter().getType());
- assertFalse(idMapping.isDefault());
- assertSame(idMapping, persistentAttribute.getMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getColumn().getSpecifiedName());
- assertEquals("id", idMapping.getColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getColumn().getSpecifiedName());
- assertEquals("foo", idMapping.getColumn().getName());
- assertEquals("id", idMapping.getColumn().getDefaultName());
- }
-
- public void testGetSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator());
- assertEquals(0, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
- assertNotNull(idMapping.getGeneratorContainer().getSequenceGenerator());
- assertEquals(2, resourceField.getAnnotationsSize());
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator());
-
- idMapping.getGeneratorContainer().addSequenceGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR));
- assertNotNull(idMapping.getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
-
- idMapping.getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR));
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getGeneratorContainer().getTableGenerator());
- assertEquals(0, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
- assertNotNull(idMapping.getGeneratorContainer().getTableGenerator());
- assertEquals(2, resourceField.getAnnotationsSize());
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- idMapping.getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator());
-
- idMapping.getGeneratorContainer().addTableGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(resourceField.getAnnotation(JPA.TABLE_GENERATOR));
- assertNotNull(idMapping.getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
-
- idMapping.getGeneratorContainer().removeTableGenerator();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator());
- assertNull(resourceField.getAnnotation(JPA.TABLE_GENERATOR));
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratedValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.GENERATED_VALUE);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(idMapping.getGeneratedValue());
- assertEquals(2, resourceField.getAnnotationsSize());
- }
-
- public void testGetGeneratedValue2() throws Exception {
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityWithIdMappingGeneratedValue();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(idMapping.getGeneratedValue());
- assertEquals(2, resourceField.getAnnotationsSize());
- }
-
- public void testAddGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratedValue());
-
- idMapping.addGeneratedValue();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(resourceField.getAnnotation(JPA.GENERATED_VALUE));
- assertNotNull(idMapping.getGeneratedValue());
-
- //try adding another generated value, should get an IllegalStateException
- try {
- idMapping.addGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.GENERATED_VALUE);
- getJpaProject().synchronizeContextModel();
-
- idMapping.removeGeneratedValue();
-
- assertNull(idMapping.getGeneratedValue());
- assertNull(resourceField.getAnnotation(JPA.GENERATED_VALUE));
-
- //try removing the generatedValue again, should get an IllegalStateException
- try {
- idMapping.removeGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java
deleted file mode 100644
index e9bdd2a798..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaJoinColumnTests extends ContextModelTestCase
-{
- public JavaJoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- sb.append(" private Project project;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(joinColumnAnnotation);
-
-
- //set name in the resource model, verify context model updated
- joinColumnAnnotation = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- joinColumnAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnAnnotation.getName());
-
- //set name to null, annotation is NOT removed
- joinColumn.setSpecifiedName(null);
- assertEquals(1, joinColumns.getSpecifiedJoinColumnsSize());
- joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertNull(joinColumnAnnotation.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- JoinColumnAnnotation joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinColumn.getSpecifiedName());
- assertEquals("foo", joinColumnAnnotation.getName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedName(null);
- assertNull(joinColumn.getSpecifiedName());
- joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertNull(joinColumnAnnotation.getName());
- }
-
- // <attribute name>_<referenced column name>
- // or
- // <target entity name>_<referenced column name>
- public void testDefaultName() throws Exception {
- createTestEntityWithValidOneToOne();
- createTargetEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
-// JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping();
-// JavaJoinColumnJoiningStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy();
-// JavaJoinColumn defaultJavaJoinColumn = joinColumns.getDefaultJoinColumn();
-//
-// assertNull(defaultJavaJoinColumn.getDefaultName());
-//TODO test default join column name
-// //add target entity to the persistence unit, now join table name is [table name]_[target table name]
-// addXmlClassRef(PACKAGE_NAME + ".Project");
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-//
-// JavaPersistentTypeResource typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME);
-// JavaPersistentresourceField resourceField = typeResource.attributes().next();
-// assertNull(resourceField.annotation(JoinTable.ANNOTATION_NAME));
-//
-// //target entity does not resolve, default name is null
-// manyToManyMapping.setSpecifiedTargetEntity("Foo");
-// assertNull(joinTable.getDefaultName());
-//
-// //default target entity does resolve, so default name is again [table name]_[target table name]
-// manyToManyMapping.setSpecifiedTargetEntity(null);
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-//
-// //add the join table annotation, verify default join table name is the same
-// resourceField.addAnnotation(JoinTable.ANNOTATION_NAME);
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-// assertNotNull(resourceField.annotation(JoinTable.ANNOTATION_NAME));
-//
-// //set a table on the target entity, very default join table name updates
-// manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-//
-// //set a table on the owning entity, very default join table name updates
-// javaEntity().getTable().setSpecifiedName("BAR");
-// assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set referenced column name in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setReferencedColumnName("BAR");
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals("BAR", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", javaJoinColumn.getReferencedColumnName());
-
- //set referenced column name to null in the resource model,
- javaJoinColumn.setReferencedColumnName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull("BAR", javaJoinColumn.getReferencedColumnName());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set referenced column name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedReferencedColumnName("BAR");
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", javaJoinColumn.getReferencedColumnName());
-
- //set referenced column name to null in the context model
- joinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(javaJoinColumn.getReferencedColumnName());
- }
-
- public void testDefaultReferencedColumnName() throws Exception {
- //TODO test default join column referenced column name
-
- }
-
- public void testUpdateTable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set table in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setTable("BAR");
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals("BAR", joinColumn.getSpecifiedTable());
- assertEquals("BAR", javaJoinColumn.getTable());
-
- //set table to null in the resource model,
- javaJoinColumn.setTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedTable());
- assertNull("BAR", javaJoinColumn.getTable());
- }
-
- public void testModifyTable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set table in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedTable("BAR");
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", joinColumn.getSpecifiedTable());
- assertEquals("BAR", javaJoinColumn.getTable());
-
- //set table to null in the context model
- joinColumn.setSpecifiedTable(null);
- assertNull(joinColumn.getSpecifiedTable());
- assertNull(javaJoinColumn.getTable());
- }
-
- public void testDefaultTable() throws Exception {
- //TODO test default join column table
-
- }
-
- public void testUpdateUnique() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set unique in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setUnique(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, javaJoinColumn.getUnique());
-
- //set unique to null in the resource model,
- javaJoinColumn.setUnique(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedUnique());
- assertNull(javaJoinColumn.getUnique());
- }
-
- public void testModifyUnique() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set unique in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, javaJoinColumn.getUnique());
-
- //set unique to null in the context model
- joinColumn.setSpecifiedUnique(null);
- assertNull(joinColumn.getSpecifiedUnique());
- assertNull(javaJoinColumn.getUnique());
- }
-
- public void testUpdateNullable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set nullable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setNullable(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getNullable());
-
- //set nullable to null in the resource model,
- javaJoinColumn.setNullable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedNullable());
- assertNull(javaJoinColumn.getNullable());
- }
-
- public void testModifyNullable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set nullable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getNullable());
-
- //set nullable to null in the context model
- joinColumn.setSpecifiedNullable(null);
- assertNull(joinColumn.getSpecifiedNullable());
- assertNull(javaJoinColumn.getNullable());
- }
-
- public void testUpdateInsertable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set insertable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setInsertable(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getInsertable());
-
- //set insertable to null in the resource model,
- javaJoinColumn.setInsertable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedInsertable());
- assertNull(javaJoinColumn.getInsertable());
- }
-
- public void testModifyInsertable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set insertable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getInsertable());
-
- //set insertable to null in the context model
- joinColumn.setSpecifiedInsertable(null);
- assertNull(joinColumn.getSpecifiedInsertable());
- assertNull(javaJoinColumn.getInsertable());
- }
-
- public void testUpdateUpdatable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set updatable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setUpdatable(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getUpdatable());
-
- //set updatable to null in the resource model,
- javaJoinColumn.setUpdatable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedUpdatable());
- assertNull(javaJoinColumn.getUpdatable());
- }
-
- public void testModifyUpdatable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set updatable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getUpdatable());
-
- //set updatable to null in the context model
- joinColumn.setSpecifiedUpdatable(null);
- assertNull(joinColumn.getSpecifiedUpdatable());
- assertNull(javaJoinColumn.getUpdatable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java
deleted file mode 100644
index f680861ebf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java
+++ /dev/null
@@ -1,1179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaJoinTableTests extends ContextModelTestCase
-{
- public JavaJoinTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append(" private Collection<Project> projects;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- private void createTargetEntityWithBackPointer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(" @ManyToMany(mappedBy=\"projects\"").append(CR);
- sb.append(" private java.util.Collection<" + TYPE_NAME + "> employees;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedName());
- assertNull(javaJoinTable);
-
-
- //set name in the resource model, verify context model updated
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("FOO", javaJoinTable.getName());
-
- //set name to null in the resource model
- javaJoinTable.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedName());
- assertNull(javaJoinTable.getName());
-
- javaJoinTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("FOO", javaJoinTable.getName());
-
- resourceField.removeAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedName());
- assertNull(joinTableAnnotation);
-
- //set name in the context model, verify resource model modified
- joinTable.setSpecifiedName("foo");
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedName());
- assertEquals("foo", joinTableAnnotation.getName());
-
- //set name to null in the context model
- joinTable.setSpecifiedName(null);
- assertNull(joinTable.getSpecifiedName());
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTableAnnotation.getName());
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinTable.getDefaultName());
-
- //add target entity to the persistence unit, now join table name is [table name]_[target table name]
- createTargetEntity();
- addXmlClassRef(PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //target entity does not resolve, default name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertNull(joinTable.getDefaultName());
-
- //default target entity does resolve, so default name is again [table name]_[target table name]
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- //add the join table annotation, verify default join table name is the same
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //set a table on the target entity, very default join table name updates
- manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-
- //set a table on the owning entity, very default join table name updates
- getJavaEntity().getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testDefaultJoinColumns() throws Exception {
- createTestEntityWithValidManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntity();
- addXmlClassRef(PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(TYPE_NAME + "_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table annotation, verify default join table name is the same
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultJoinColumnsBidirectionalRelationship() throws Exception {
- createTestEntityWithValidManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntityWithBackPointer();
- addXmlClassRef(PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("employees_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table annotation, verify default join table name is the same
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(javaJoinTable);
-
-
- //set schema in the resource model, verify context model updated
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedSchema());
- assertEquals("FOO", javaJoinTable.getSchema());
-
- //set schema to null in the resource model
- javaJoinTable.setSchema(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(javaJoinTable.getSchema());
-
- javaJoinTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedSchema());
- assertEquals("FOO", javaJoinTable.getSchema());
-
- resourceField.removeAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(joinTableAnnotation);
-
- //set schema in the context model, verify resource model modified
- joinTable.setSpecifiedSchema("foo");
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedSchema());
- assertEquals("foo", joinTableAnnotation.getSchema());
-
- //set schema to null in the context model
- joinTable.setSpecifiedSchema(null);
- assertNull(joinTable.getSpecifiedSchema());
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTableAnnotation.getSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(javaJoinTable);
-
-
- //set catalog in the resource model, verify context model updated
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedCatalog());
- assertEquals("FOO", javaJoinTable.getCatalog());
-
- //set catalog to null in the resource model
- javaJoinTable.setCatalog(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(javaJoinTable.getCatalog());
-
- javaJoinTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedCatalog());
- assertEquals("FOO", javaJoinTable.getCatalog());
-
- resourceField.removeAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(joinTableAnnotation);
-
- //set catalog in the context model, verify resource model modified
- joinTable.setSpecifiedCatalog("foo");
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedCatalog());
- assertEquals("foo", joinTableAnnotation.getCatalog());
-
- //set catalog to null in the context model
- joinTable.setSpecifiedCatalog(null);
- assertNull(joinTable.getSpecifiedCatalog());
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTableAnnotation.getCatalog());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn joinColumn = joinTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = joinTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = joinTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableAnnotation.getJoinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableAnnotation.getJoinColumnsSize());
- assertEquals("BAR", joinTableAnnotation.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableAnnotation.joinColumnAt(1).getName());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableAnnotation.getJoinColumnsSize());
- assertEquals("BAZ", joinTableAnnotation.joinColumnAt(0).getName());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableAnnotation.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
-
- joinTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
-
- joinTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableResource.addJoinColumn(0);
- joinTableResource.addJoinColumn(1);
- joinTableResource.addJoinColumn(2);
-
- joinTableResource.joinColumnAt(0).setName("FOO");
- joinTableResource.joinColumnAt(1).setName("BAR");
- joinTableResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joinTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(0, joinTable.getSpecifiedJoinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.getSpecifiedJoinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTable.getSpecifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(1, joinTable.getJoinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.getJoinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(2, joinTable.getJoinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.getJoinColumnsSize());
-
- // default columns
- assertNotNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable());
- JavaResourceAttribute resAttribute = this.getJavaPersistentType().getAttributes().iterator().next().getResourceAttribute();
- assertNotNull(resAttribute.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- manyToManyMapping.getRelationship().getJoinTableStrategy().removeStrategy();
- // default join table
- 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().getMappedByStrategy().setMappedByAttribute("foo");
- assertNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable());
- }
-
- public void testAddSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn inverseJoinColumn = joinTable.addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("FOO");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(0).getName());
-
- JoinColumn inverseJoinColumn2 = joinTable.addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(1).getName());
-
- JoinColumn inverseJoinColumn3 = joinTable.addSpecifiedInverseJoinColumn(1);
- inverseJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals(inverseJoinColumn2, inverseJoinColumns.next());
- assertEquals(inverseJoinColumn3, inverseJoinColumns.next());
- assertEquals(inverseJoinColumn, inverseJoinColumns.next());
-
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getInverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTableResource.getInverseJoinColumnsSize());
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTableResource.getInverseJoinColumnsSize());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(0).getName());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTableResource.getInverseJoinColumnsSize());
- }
-
- public void testMoveSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getInverseJoinColumnsSize());
-
-
- joinTable.moveSpecifiedInverseJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
-
-
- joinTable.moveSpecifiedInverseJoinColumn(0, 1);
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
- }
-
- public void testUpdateInverseJoinColumns() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableResource.addInverseJoinColumn(0);
- joinTableResource.addInverseJoinColumn(1);
- joinTableResource.addInverseJoinColumn(2);
-
- joinTableResource.inverseJoinColumnAt(0).setName("FOO");
- joinTableResource.inverseJoinColumnAt(1).setName("BAR");
- joinTableResource.inverseJoinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.moveInverseJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.moveInverseJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joinTable.getSpecifiedInverseJoinColumns().iterator().hasNext());
- }
-
- public void testGetDefaultInverseJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedInverseJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(0, joinTable.getSpecifiedInverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.getSpecifiedInverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTable.getSpecifiedInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTable.getInverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
-
- //if non-owning side of the relationship then no default join table
- manyToManyMapping.getRelationship().setStrategyToMappedBy();
- assertNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(0, joinTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, joinTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
- joinTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- joinTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- joinTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
-
- joinTable.moveUniqueConstraint(2, 0);
- ListIterator<? extends UniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- joinTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java
deleted file mode 100644
index 6137fb3420..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,1183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaManyToManyMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithCollectionManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithNonCollectionManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Address addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Map;");
- sb.append(CR);
- sb.append("import ").append(JPA.MANY_TO_MANY).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Map<Integer, Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- public JavaManyToManyMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToManyAnnotation = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToManyAnnotation.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToManyAnnotation.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", manyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToManyAnnotation.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToManyAnnotation.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToManyAnnotation.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the context model
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, manyToMany.getFetch());
-
-
- //set fetch to null in the resource model
- manyToMany.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
-
- //set fetch in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, manyToMany.getFetch());
-
- manyToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, manyToMany.getFetch());
-
- //set fetch to null in the context model
- manyToManyMapping.setSpecifiedFetch(null);
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- 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().getMappedByStrategy().getMappedByAttribute());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //set mappedByJoiningStrategy to null in the resource model
- manyToMany.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- 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().getMappedByStrategy().setMappedByAttribute(null);
- assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation annotation = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping mapping = (ManyToManyMapping) contextAttribute.getMapping();
- ManyToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation annotation = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping mapping = (ManyToManyMapping) contextAttribute.getMapping();
- ManyToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityNonCollectionType() throws Exception {
- createTestEntityWithNonCollectionManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getTargetEntity());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", manyToManyMapping.getTargetEntity());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(manyToManyMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertNull(manyToManyMapping.getResolvedTargetEntity());
-
-
- manyToManyMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
-
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKey(null);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- manyToManyMapping.setNoMapKey(true);
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- javaManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = javaManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = javaManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
- public void testUpdateOrderBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newOrderBy", manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set mappedBy in the context model, verify resource model updated
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set mappedBy to null in the context model
- manyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateNoOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isNoOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isNoOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyNoOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
-// manyToManyMapping.setNoOrdering(false); //this does nothing
-// //set mappedBy in the context model, verify resource model updated
-// manyToManyMapping.setOrderBy("newOrderBy");
-// assertEquals("newOrderBy", manyToManyMapping.getOrderBy());
-// OrderBy orderBy = (OrderBy) resourceField.annotation(OrderBy.ANNOTATION_NAME);
-// assertEquals("newOrderBy", orderBy.getValue());
-//
-// //set mappedBy to null in the context model
-// manyToManyMapping.setOrderBy(null);
-// assertNull(manyToManyMapping.getOrderBy());
-// assertNull(resourceField.annotation(OrderBy.ANNOTATION_NAME));
- }
-
- public void testUpdatePkOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(manyToManyMapping.getOrderable().isPkOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateCustomOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertTrue(manyToManyMapping.getOrderable().isCustomOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultTargetEntityForMap() throws Exception {
- createTestEmployee();
- createTestDepartment();
- addXmlClassRef(PACKAGE_NAME + ".Department");
- addXmlClassRef(PACKAGE_NAME + ".Employee");
-
- JavaPersistentType departmentPersistentType = getJavaPersistentType();
- ManyToManyMapping employeesMapping = (ManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java
deleted file mode 100644
index efacd87b99..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,964 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaManyToOneMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Collection address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericizedCollectionManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- public JavaManyToOneMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToOne.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", manyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToOne.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- manyToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the context model
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
-
- //set optional in the resource model, verify context model updated
- manyToOne.setOptional(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
- //set optional to null in the resource model
- manyToOne.setOptional(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
-
- //set optional in the context model, verify resource model updated
- manyToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
-
- //set optional to null in the context model
- manyToOneMapping.setSpecifiedOptional(null);
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
- }
-
-
- public void testSpecifiedJoinColumns() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- ListIterator<? extends JoinColumn> specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
-
- assertFalse(specifiedJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(specifiedJoinColumns.hasNext());
- }
-
- public void testGetDefaultJoin() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(2, joinColumns.getJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedJoinColumn2() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
-
- joinColumns.removeSpecifiedJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
- joinColumns.moveSpecifiedJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- joinColumns.moveSpecifiedJoinColumn(0, 1);
- primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedJoinColumns() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN)).setName("FOO");
- ((JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN)).setName("BAR");
- ((JoinColumnAnnotation) resourceField.addAnnotation(2, JPA.JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
- public void testJoinColumnIsVirtual() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertTrue(joinColumns.getDefaultJoinColumn().isDefault());
-
- joinColumns.addSpecifiedJoinColumn(0);
- JoinColumn specifiedJoinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isDefault());
-
- assertNull(joinColumns.getDefaultJoinColumn());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping mapping = (ManyToOneMapping) contextAttribute.getMapping();
- ManyToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping mapping = (ManyToOneMapping) contextAttribute.getMapping();
- ManyToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertNull(manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityGenericizedCollectionType() throws Exception {
- createTestEntityWithGenericizedCollectionManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertNull(manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getTargetEntity());
-
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", manyToOneMapping.getTargetEntity());
-
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(manyToOneMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertNull(manyToOneMapping.getResolvedTargetEntity());
-
-
- manyToOneMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
-
-
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java
deleted file mode 100644
index d078818d70..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaMappedSuperclassTests extends ContextModelTestCase
-{
- public JavaMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testMorphToEntity() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Entity);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMappedSuperclass() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass);
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = mappedSuperclass.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = mappedSuperclass.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME));
- assertFalse(mappedSuperclass.tableNameIsInvalid("FOO"));
- }
-
- public void testAssociatedTables() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.getAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.getAllAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.getAllAssociatedTableNames().iterator().hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = mappedSuperclass.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- //TODO need to create a subclass mappedSuperclass and test this
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = mappedSuperclass.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestMappedSuperclass();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- IdClassReference idClassRef = mappedSuperclass.getIdClassReference();
-
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- IdClassAnnotation idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- this.getJpaProject().synchronizeContextModel();
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- // test setting id class name to nonexistent class. test class name is set, but class is null
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassAnnotation.setValue(nonExistentIdClassName);
- this.getJpaProject().synchronizeContextModel();
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- // test setting id class name to existent class. test class name is set and class is not null
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassAnnotation.setValue(existentIdClassName);
- this.getJpaProject().synchronizeContextModel();
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- //test setting @IdClass value to null, IdClass annotation is removed
- idClassRef.setSpecifiedIdClassName(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- //reset @IdClass value and then remove @IdClass
- idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- idClassAnnotation.setValue(existentIdClassName);
- resourceType.removeAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestMappedSuperclass();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- IdClassReference idClassRef = mappedSuperclass.getIdClassReference();
-
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassRef.setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassRef.setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- idClassRef.setSpecifiedIdClassName(null);
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java
deleted file mode 100644
index ff43788f3f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.NamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.QueryHint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaNamedNativeQueryTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
- private static final String QUERY_QUERY = "MY_QUERY";
-
- private ICompilationUnit createTestEntityWithNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedNativeQuery(name=\"" + QUERY_NAME + "\", query=\"" + QUERY_QUERY + "\")");
- }
- });
- }
-
-
-
- public JavaNamedNativeQueryTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedNativeQuery.getName());
- assertEquals(QUERY_NAME, namedNativeQuery.getName());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedNativeQuery.getName());
- assertNull(namedNativeQuery.getName());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedNativeQuery.getName());
- assertEquals("foo", namedNativeQuery.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedNativeQuery.getName());
- assertEquals(QUERY_NAME, namedNativeQuery.getName());
-
- //set name to null in the context model
- namedNativeQuery.setName(null);
- assertNull(javaNamedNativeQuery.getName());
- assertNull(namedNativeQuery.getName());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setName("foo");
- assertEquals("foo", javaNamedNativeQuery.getName());
- assertEquals("foo", namedNativeQuery.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery());
- assertEquals(QUERY_QUERY, namedNativeQuery.getQuery());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setQuery(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedNativeQuery.getQuery());
- assertNull(namedNativeQuery.getQuery());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setQuery("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedNativeQuery.getQuery());
- assertEquals("foo", namedNativeQuery.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery());
- assertEquals(QUERY_QUERY, namedNativeQuery.getQuery());
-
- //set name to null in the context model
- namedNativeQuery.setQuery(null);
- assertNull(javaNamedNativeQuery.getQuery());
- assertNull(namedNativeQuery.getQuery());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setQuery("foo");
- assertEquals("foo", javaNamedNativeQuery.getQuery());
- assertEquals("foo", namedNativeQuery.getQuery());
- }
-
-
- public void testAddHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
-
- QueryHint queryHint = namedNativeQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", javaNamedNativeQuery.hintAt(0).getName());
-
- QueryHint queryHint2 = namedNativeQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(1).getName());
-
- QueryHint queryHint3 = namedNativeQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
-
- ListIterator<? extends QueryHint> hints = namedNativeQuery.getHints().iterator();
- assertEquals(queryHint2, hints.next());
- assertEquals(queryHint3, hints.next());
- assertEquals(queryHint, hints.next());
-
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- namedNativeQuery.addHint(0).setName("FOO");
- namedNativeQuery.addHint(1).setName("BAR");
- namedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedNativeQuery.getHintsSize());
-
- namedNativeQuery.removeHint(0);
- assertEquals(2, javaNamedNativeQuery.getHintsSize());
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
-
- namedNativeQuery.removeHint(0);
- assertEquals(1, javaNamedNativeQuery.getHintsSize());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(0).getName());
-
- namedNativeQuery.removeHint(0);
- assertEquals(0, javaNamedNativeQuery.getHintsSize());
- }
-
- public void testMoveHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- namedNativeQuery.addHint(0).setName("FOO");
- namedNativeQuery.addHint(1).setName("BAR");
- namedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedNativeQuery.getHintsSize());
-
-
- namedNativeQuery.moveHint(2, 0);
- ListIterator<? extends QueryHint> hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
-
-
- namedNativeQuery.moveHint(0, 1);
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAR", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation queryAnnotation = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- queryAnnotation.addHint(0).setName("FOO");
- queryAnnotation.addHint(1).setName("BAR");
- queryAnnotation.addHint(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends QueryHint> hints = namedNativeQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.moveHint(2, 0);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.moveHint(0, 1);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(namedNativeQuery.getHints().iterator().hasNext());
- }
-
- public void testHintsSize() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
-
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
- assertEquals(0, namedNativeQuery.getHintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
-
- javaNamedNativeQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, namedNativeQuery.getHintsSize());
-
- javaNamedNativeQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(2, namedNativeQuery.getHintsSize());
-
- javaNamedNativeQuery.removeHint(0);
- javaNamedNativeQuery.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, namedNativeQuery.getHintsSize());
- }
-
- public void testUpdateResultClass() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation queryAnnotation = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, queryAnnotation.getResultClass());
- assertEquals(null, namedNativeQuery.getResultClass());
-
- //set name in the resource model, verify context model updated
- queryAnnotation.setResultClass("foo");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("foo", queryAnnotation.getResultClass());
- assertEquals("foo", namedNativeQuery.getResultClass());
-
- //set name to null in the resource model
- queryAnnotation.setResultClass(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(queryAnnotation.getResultClass());
- assertNull(namedNativeQuery.getResultClass());
- }
-
- public void testModifyResultClass() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultClass());
- assertEquals(null, namedNativeQuery.getResultClass());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setResultClass("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultClass());
- assertEquals("foo", namedNativeQuery.getResultClass());
-
- //set name to null in the context model
- namedNativeQuery.setResultClass(null);
- assertNull(javaNamedNativeQuery.getResultClass());
- assertNull(namedNativeQuery.getResultClass());
- }
-
- public void testUpdateResultSetMapping() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultSetMapping());
- assertEquals(null, namedNativeQuery.getResultSetMapping());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setResultSetMapping("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedNativeQuery.getResultSetMapping());
- assertEquals("foo", namedNativeQuery.getResultSetMapping());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setResultSetMapping(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedNativeQuery.getResultSetMapping());
- assertNull(namedNativeQuery.getResultSetMapping());
- }
-
- public void testModifyResultSetMapping() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultSetMapping());
- assertEquals(null, namedNativeQuery.getResultSetMapping());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setResultSetMapping("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultSetMapping());
- assertEquals("foo", namedNativeQuery.getResultSetMapping());
-
- //set name to null in the context model
- namedNativeQuery.setResultSetMapping(null);
- assertNull(javaNamedNativeQuery.getResultSetMapping());
- assertNull(namedNativeQuery.getResultSetMapping());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java
deleted file mode 100644
index 6d95c28765..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.QueryHint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaNamedQueryTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
- private static final String QUERY_QUERY = "MY_QUERY";
-
- private ICompilationUnit createTestEntityWithNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"" + QUERY_NAME + "\", query=\"" + QUERY_QUERY + "\")");
- }
- });
- }
-
-
-
- public JavaNamedQueryTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedQuery.getName());
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- //set name to null in the resource model
- javaNamedQuery.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedQuery.getName());
- assertNull(namedQuery.getName());
-
- //set name in the resource model, verify context model updated
- javaNamedQuery.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedQuery.getName());
- assertEquals("foo", namedQuery.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedQuery.getName());
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- //set name to null in the context model
- namedQuery.setName(null);
- assertNull(javaNamedQuery.getName());
- assertNull(namedQuery.getName());
-
- //set name in the context model, verify resource model updated
- namedQuery.setName("foo");
- assertEquals("foo", javaNamedQuery.getName());
- assertEquals("foo", namedQuery.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedQuery.getQuery());
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- //set name to null in the resource model
- javaNamedQuery.setQuery(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedQuery.getQuery());
- assertNull(namedQuery.getQuery());
-
- //set name in the resource model, verify context model updated
- javaNamedQuery.setQuery("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedQuery.getQuery());
- assertEquals("foo", namedQuery.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedQuery.getQuery());
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- //set name to null in the context model
- namedQuery.setQuery(null);
- assertNull(javaNamedQuery.getQuery());
- assertNull(namedQuery.getQuery());
-
- //set name in the context model, verify resource model updated
- namedQuery.setQuery("foo");
- assertEquals("foo", javaNamedQuery.getQuery());
- assertEquals("foo", namedQuery.getQuery());
- }
-
-
- public void testAddHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
-
- QueryHint queryHint = namedQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", javaNamedQuery.hintAt(0).getName());
-
- QueryHint queryHint2 = namedQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(1).getName());
-
- QueryHint queryHint3 = namedQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
-
- ListIterator<? extends QueryHint> hints = namedQuery.getHints().iterator();
- assertEquals(queryHint2, hints.next());
- assertEquals(queryHint3, hints.next());
- assertEquals(queryHint, hints.next());
-
- hints = namedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1).setName("BAR");
- namedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedQuery.getHintsSize());
-
- namedQuery.removeHint(0);
- assertEquals(2, javaNamedQuery.getHintsSize());
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
-
- namedQuery.removeHint(0);
- assertEquals(1, javaNamedQuery.getHintsSize());
- assertEquals("BAZ", javaNamedQuery.hintAt(0).getName());
-
- namedQuery.removeHint(0);
- assertEquals(0, javaNamedQuery.getHintsSize());
- }
-
- public void testMoveHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1).setName("BAR");
- namedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedQuery.getHintsSize());
-
-
- namedQuery.moveHint(2, 0);
- ListIterator<? extends QueryHint> hints = namedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
-
-
- namedQuery.moveHint(0, 1);
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAR", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation namedQueryAnnotation = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQueryAnnotation.addHint(0).setName("FOO");
- namedQueryAnnotation.addHint(1).setName("BAR");
- namedQueryAnnotation.addHint(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends QueryHint> hints = namedQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.moveHint(2, 0);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.moveHint(0, 1);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(namedQuery.getHints().iterator().hasNext());
- }
-
- public void testHintsSize() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
-
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
- assertEquals(0, namedQuery.getHintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
-
- javaNamedQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, namedQuery.getHintsSize());
-
- javaNamedQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(2, namedQuery.getHintsSize());
-
- javaNamedQuery.removeHint(0);
- javaNamedQuery.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, namedQuery.getHintsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java
deleted file mode 100644
index caea3e45a0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,1163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaOneToManyMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithNonCollectionOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Address addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Map;");
- sb.append(CR);
- sb.append("import ").append(JPA.ONE_TO_MANY).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Map<Integer, Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- public JavaOneToManyMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToManyAnnotation = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToManyAnnotation.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToManyAnnotation.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", oneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToManyAnnotation.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToManyAnnotation.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToManyAnnotation.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the context model
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToMany.getFetch());
-
-
- //set fetch to null in the resource model
- oneToMany.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
-
- //set fetch in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToMany.getFetch());
-
- oneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToMany.getFetch());
-
- //set fetch to null in the context model
- oneToManyMapping.setSpecifiedFetch(null);
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- 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().getMappedByStrategy().getMappedByAttribute());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToMany.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- 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().getMappedByStrategy().setMappedByAttribute(null);
- assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- //TODO this needs to return null for 1.0 mappings. we want the validation error for dot-notation since this is only supported in 2.0
- //TODO need to copy this to all the other mapped by tests.
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping mapping = (OneToManyMapping) contextAttribute.getMapping();
- OneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping mapping = (OneToManyMapping) contextAttribute.getMapping();
- OneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityNonCollectionType() throws Exception {
- createTestEntityWithNonCollectionOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getTargetEntity());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", oneToManyMapping.getTargetEntity());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(oneToManyMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertNull(oneToManyMapping.getResolvedTargetEntity());
-
-
- oneToManyMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
-
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKey(null);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- oneToManyMapping.setNoMapKey(true);
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testUpdateOrderBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newOrderBy", oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set mappedBy in the context model, verify resource model updated
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set mappedBy to null in the context model
- oneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateNoOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertTrue(oneToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isNoOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isNoOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(oneToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdatePkOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(oneToManyMapping.getOrderable().isPkOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateCustomOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertTrue(oneToManyMapping.getOrderable().isCustomOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultTargetEntityForMap() throws Exception {
- createTestEmployee();
- createTestDepartment();
- addXmlClassRef(PACKAGE_NAME + ".Department");
- addXmlClassRef(PACKAGE_NAME + ".Employee");
-
- JavaPersistentType departmentPersistentType = getJavaPersistentType();
- OneToManyMapping employeesMapping = (OneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java
deleted file mode 100644
index 1182d2e810..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,1516 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaOneToOneMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Collection address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericizedCollectionOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- public JavaOneToOneMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOneAnnotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOneAnnotation.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToOneAnnotation.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", oneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOneAnnotation.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToOneAnnotation.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOneAnnotation.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the context model
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToOne.setMappedBy("newMappedBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newMappedBy", mappedBy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToOne.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedByJoiningStrategy in the context model, verify resource model updated
- mappedBy.setMappedByAttribute("newTargetEntity");
- assertEquals("newTargetEntity", mappedBy.getMappedByAttribute());
- assertEquals("newTargetEntity", oneToOne.getMappedBy());
-
- //set mappedByJoiningStrategy to null in the context model
- mappedBy.setMappedByAttribute(null);
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
-
- //set optional in the resource model, verify context model updated
- oneToOne.setOptional(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
-
- //set optional to null in the resource model
- oneToOne.setOptional(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
-
- //set optional in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
-
- //set optional to null in the context model
- oneToOneMapping.setSpecifiedOptional(null);
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToOne.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToOne.getFetch());
-
- //set fetch to null in the resource model
- oneToOne.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
-
- //set fetch in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToOne.getFetch());
-
- oneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToOne.getFetch());
-
- //set fetch to null in the context model
- oneToOneMapping.setSpecifiedFetch(null);
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
- }
-
- public void testSpecifiedJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- ListIterator<? extends JoinColumn> specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
-
- assertFalse(specifiedJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(specifiedJoinColumns.hasNext());
- }
-
- public void testGetDefaultJoin() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(2, joinColumns.getJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- //if non-owning side of the relationship then no default join column
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("foo");
- assertEquals(0, joinColumns.getJoinColumnsSize());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedJoinColumn2() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
-
- joinColumns.removeSpecifiedJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- joinColumns.moveSpecifiedJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- joinColumns.moveSpecifiedJoinColumn(0, 1);
- primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN)).setName("FOO");
- ((JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN)).setName("BAR");
- ((JoinColumnAnnotation) resourceField.addAnnotation(2, JPA.JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testJoinColumnIsVirtual() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertTrue(joinColumns.getDefaultJoinColumn().isDefault());
-
- joinColumns.addSpecifiedJoinColumn(0);
- JoinColumn specifiedJoinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isDefault());
-
- assertNull(joinColumns.getDefaultJoinColumn());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertNull(oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityGenericizedCollectionType() throws Exception {
- createTestEntityWithGenericizedCollectionOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertNull(oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getTargetEntity());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", oneToOneMapping.getTargetEntity());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(oneToOneMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertNull(oneToOneMapping.getResolvedTargetEntity());
-
-
- oneToOneMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
-
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
- }
-
- public void testPrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
- Iterator<? extends PrimaryKeyJoinColumn> primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
-
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
-
- joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertFalse(primaryKeyJoinColumns.hasNext());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- assertEquals(0, strategy.getPrimaryKeyJoinColumnsSize());
-
- strategy.addPrimaryKeyJoinColumn(0);
- assertEquals(1, strategy.getPrimaryKeyJoinColumnsSize());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(0, strategy.getPrimaryKeyJoinColumnsSize());
- }
-
- public void testAddPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testAddPrimaryKeyJoinColumn2() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testRemovePrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
-
- strategy.removePrimaryKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends PrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- strategy.removePrimaryKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- strategy.removePrimaryKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertFalse(joinColumns.hasNext());
-
- assertNull(resourceField.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMovePrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- strategy.movePrimaryKeyJoinColumn(2, 0);
- ListIterator<? extends PrimaryKeyJoinColumn> primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- strategy.movePrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- ((PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN)).setName("FOO");
- ((PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN)).setName("BAR");
- ((PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(2, JPA.PRIMARY_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends PrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.moveAnnotation(2, 0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.moveAnnotation(0, 1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.removeAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.removeAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertFalse(joinColumns.hasNext());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping mapping = (OneToOneMapping) contextAttribute.getMapping();
- OneToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping mapping = (OneToOneMapping) contextAttribute.getMapping();
- OneToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java
deleted file mode 100644
index ff0501b14d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase
-{
- private static final String PRIMARY_KEY_JOIN_COLUMN_NAME = "MY_PRIMARY_KEY_JOIN_COLUMN";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@PrimaryKeyJoinColumn(name=\"" + PRIMARY_KEY_JOIN_COLUMN_NAME + "\")");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public JavaPrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getSpecifiedName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("FOO", specifiedPkJoinColumn.getName());
- }
-
- public void testGetDefaultNameNoSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn pkJoinColumn = getJavaEntity().getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", pkJoinColumn.getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("id", specifiedPkJoinColumn.getDefaultName());
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(specifiedPkJoinColumn.getDefaultName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
-
- specifiedPkJoinColumn.setSpecifiedName("foo");
- assertEquals("foo", specifiedPkJoinColumn.getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", columnAnnotation.getName());
-
- specifiedPkJoinColumn.setSpecifiedName(null);
- assertNull(specifiedPkJoinColumn.getSpecifiedName());
- columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(columnAnnotation.getName());
- }
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertNull(specifiedPkJoinColumn.getColumnDefinition());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- column.setColumnDefinition(COLUMN_DEFINITION);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(COLUMN_DEFINITION, specifiedPkJoinColumn.getColumnDefinition());
-
- column.setColumnDefinition(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(specifiedPkJoinColumn.getColumnDefinition());
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(0, getJavaEntity().getSpecifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- specifiedPkJoinColumn.setColumnDefinition("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- specifiedPkJoinColumn.setColumnDefinition(null);
- column = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(column.getColumnDefinition());
- }
-
- public void testGetSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertNull(specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setReferencedColumnName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("FOO", specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testGetDefaultReferencedColumnNameNoSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn pkJoinColumn = getJavaEntity().getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", pkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testGetDefaultReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("id", specifiedPkJoinColumn.getDefaultReferencedColumnName());
-
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(specifiedPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testGetReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setReferencedColumnName("FOO");
- getJpaProject().synchronizeContextModel();
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("FOO", specifiedPkJoinColumn.getReferencedColumnName());
- }
-
- public void testSetSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
-
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", columnAnnotation.getReferencedColumnName());
-
- specifiedPkJoinColumn.setSpecifiedName(null);
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
- columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(columnAnnotation.getReferencedColumnName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isDefault());
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(0);
- assertTrue(getJavaEntity().getDefaultPrimaryKeyJoinColumn().isDefault());
- }
-
- public void testIsReferencedColumnResolved() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(((Boolean) ReflectionTools.executeMethod(specifiedPkJoinColumn, "referencedColumnIsResolved")).booleanValue());
- }
-
- public void testDbColumn() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isResolved());
- }
-
- public void testDbReferencedColumn() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(((Boolean) ReflectionTools.executeMethod(specifiedPkJoinColumn, "referencedColumnIsResolved")).booleanValue());
- }
-
- public void testDbTable() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertNull(specifiedPkJoinColumn.getDbTable());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java
deleted file mode 100644
index 541ba70e81..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.QueryHint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaQueryHintTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
-
- private ICompilationUnit createTestEntityWithNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"" + QUERY_NAME + "\", hints=@QueryHint())");
- }
- });
- }
-
-
-
- public JavaQueryHintTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getName());
- assertNull(queryHint.getName());
-
- //set name in the resource model, verify context model updated
- queryHintAnnotation.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", queryHintAnnotation.getName());
- assertEquals("foo", queryHint.getName());
-
- //set name to null in the resource model
- queryHintAnnotation.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(queryHint.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getName());
- assertNull(queryHint.getName());
-
- //set name in the context model, verify resource model updated
- queryHint.setName("foo");
- assertEquals("foo", queryHintAnnotation.getName());
- assertEquals("foo", queryHint.getName());
-
- //set name to null in the context model
- queryHint.setName(null);
- assertNull(queryHintAnnotation.getName());
- assertNull(queryHint.getName());
- }
-
- public void testUpdateValue() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getValue());
- assertNull(queryHint.getValue());
-
- //set name in the resource model, verify context model updated
- queryHintAnnotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", queryHintAnnotation.getValue());
- assertEquals("foo", queryHint.getValue());
-
- //set name to null in the resource model
- queryHintAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNull(queryHint.getValue());
- }
-
- public void testModifyValue() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getValue());
- assertNull(queryHint.getValue());
-
- //set name in the context model, verify resource model updated
- queryHint.setValue("foo");
- assertEquals("foo", queryHintAnnotation.getValue());
- assertEquals("foo", queryHint.getValue());
-
- //set name to null in the context model
- queryHint.setValue(null);
- assertNull(queryHintAnnotation.getValue());
- assertNull(queryHint.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java
deleted file mode 100644
index 93238c717c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java
+++ /dev/null
@@ -1,731 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaSecondaryTableTests extends ContextModelTestCase
-{
- private static final String TABLE_NAME = "MY_TABLE";
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTable(name=\"" + TABLE_NAME + "\")");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"foo\"), @SecondaryTable(name=\"bar\")})");
- }
- });
- }
-
-
-
-
- public JavaSecondaryTableTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- assertEquals(TABLE_NAME, secondaryTable.getSpecifiedName());
- }
-
- public void testGetDefaultNameNull() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- assertNull(secondaryTable.getDefaultName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- assertEquals(TABLE_NAME, secondaryTable.getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- secondaryTable.setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals("foo", table.getName());
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- table.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedName());
- }
-
- public void testUpdateFromSpecifiedCatalogChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTableResources = resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator();
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("foo");
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("bar");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaSecondaryTable> secondaryTsbles = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("foo", secondaryTsbles.next().getSpecifiedCatalog());
- assertEquals("bar", secondaryTsbles.next().getSpecifiedCatalog());
- }
-
- public void testUpdateFromSpecifiedSchemaChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTableResources = resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator();
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("foo");
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("bar");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaSecondaryTable> secondaryTsbles = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("foo", secondaryTsbles.next().getSpecifiedSchema());
- assertEquals("bar", secondaryTsbles.next().getSpecifiedSchema());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.setCatalog("myCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myCatalog", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedCatalog());
- assertEquals("myCatalog", getJavaEntity().getSecondaryTables().iterator().next().getCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultCatalog());
-
- getJavaEntity().getSecondaryTables().iterator().next().setSpecifiedCatalog("myCatalog");
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable table = getJavaEntity().getSecondaryTables().iterator().next();
- table.setSpecifiedCatalog("myCatalog");
- table.setSpecifiedName(null);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals("myCatalog", tableAnnotation.getCatalog());
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- tableResource.setSchema("mySchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySchema", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedSchema());
- assertEquals("mySchema", getJavaEntity().getSecondaryTables().iterator().next().getSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultSchema());
-
- getJavaEntity().getSecondaryTables().iterator().next().setSpecifiedSchema("mySchema");
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable table = getJavaEntity().getSecondaryTables().iterator().next();
- table.setSpecifiedSchema("mySchema");
- table.setSpecifiedName(null);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals("mySchema", tableAnnotation.getSchema());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
-
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = tableResource.addPkJoinColumn(0);
- pkJoinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- pkJoinColumn = tableResource.addPkJoinColumn(0);
- pkJoinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- //move an annotation to the resource model and verify the context model is updated
- tableResource.movePkJoinColumn(1, 0);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- tableResource.removePkJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- tableResource.removePkJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(specifiedPkJoinColumns.hasNext());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- assertEquals(0, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- //just the default pkJoinColumn, so 1
- assertEquals(1, secondaryTable.getPrimaryKeyJoinColumnsSize());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- //only the specified pkJoinColumns, 3
- assertEquals(3, secondaryTable.getPrimaryKeyJoinColumnsSize());
- }
-
- public void testGetDefaultPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- assertNotNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testPrimaryKeyJoinColumnDefaults() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertNotNull(defaultPkJoinColumn);
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
-
- IdMapping idMapping = (IdMapping) getJavaEntity().getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- assertEquals("FOO", defaultPkJoinColumn.getDefaultName());
- assertEquals("FOO", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
- idMapping.getColumn().setSpecifiedName(null);
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- Iterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn2() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
- }
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, tableResource.getPkJoinColumnsSize());
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(1);
-
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumnResources = tableResource.getPkJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumnResources.next().getName());
- assertEquals("BAZ", pkJoinColumnResources.next().getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- Iterator<JavaPrimaryKeyJoinColumn> pkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(1);
- pkJoinColumnResources = tableResource.getPkJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumnResources.next().getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- pkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumnResources = tableResource.getPkJoinColumns().iterator();
- assertFalse(pkJoinColumnResources.hasNext());
- pkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(pkJoinColumns.hasNext());
-
- assertEquals(0, tableResource.getPkJoinColumnsSize());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
-
-
- secondaryTable.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertEquals("FOO", pkJoinColumns.next().getName());
- }
-
- public void testPrimaryKeyJoinColumnGetDefaultName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
-
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(defaultPkJoinColumn.getDefaultName());
- }
- public void testPrimaryKeyJoinColumnGetDefaultReferencedColumnName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(defaultPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testPrimaryKeyJoinColumnIsVirtual() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- assertTrue(secondaryTable.getDefaultPrimaryKeyJoinColumn().isDefault());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumn specifiedPkJoinColumn = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isDefault());
-
- assertNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- assertEquals(0, secondaryTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- secondaryTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, secondaryTableAnnotation.getUniqueConstraintsSize());
-
- secondaryTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- secondaryTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- secondaryTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, secondaryTableAnnotation.getUniqueConstraintsSize());
-
-
- secondaryTable.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- secondaryTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- secondaryTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- secondaryTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java
deleted file mode 100644
index 06495d7bd0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaSequenceGeneratorTests extends ContextModelTestCase
-{
- private static final String SEQUENCE_GENERATOR_NAME = "MY_SEQUENCE_GENERATOR";
-
-
- protected ICompilationUnit createTestEntityWithSequenceGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SEQUENCE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@SequenceGenerator(name=\"" + SEQUENCE_GENERATOR_NAME + "\")");
- }
- });
- }
-
- public JavaSequenceGeneratorTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getGeneratorContainer().getSequenceGenerator().getName());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getGeneratorContainer().getSequenceGenerator().getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getGeneratorContainer().getSequenceGenerator().getName());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setName("foo");
-
- assertEquals("foo", idMapping.getGeneratorContainer().getSequenceGenerator().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals("foo", sequenceGenerator.getName());
- }
-
- public void testGetInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getSequenceGenerator().getInitialValue());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setInitialValue(Integer.valueOf(82));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(82, idMapping.getGeneratorContainer().getSequenceGenerator().getInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedInitialValue());
- }
-
- public void testGetDefaultInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultInitialValue());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedInitialValue(Integer.valueOf(82));
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedInitialValue());
- }
-
- public void testSetSpecifiedInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedInitialValue(Integer.valueOf(20));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals(Integer.valueOf(20), generatorAnnotation.getInitialValue());
- }
-
- public void testGetAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getSequenceGenerator().getAllocationSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(20));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(20, idMapping.getGeneratorContainer().getSequenceGenerator().getAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedAllocationSize());
- }
-
- public void testGetDefaultAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultAllocationSize());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedAllocationSize(Integer.valueOf(20));
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedAllocationSize());
- }
-
- public void testSetSpecifiedAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedAllocationSize(Integer.valueOf(25));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals(Integer.valueOf(25), generatorAnnotation.getAllocationSize());
- }
-
-
-
- public void testGetSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator().getSequenceName());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setSequenceName("mySequenceName");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySequenceName", idMapping.getGeneratorContainer().getSequenceGenerator().getSequenceName());
- assertEquals("mySequenceName", idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedSequenceName());
- }
-
- public void testGetDefaultSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultSequenceName());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedSequenceName("mySequenceName");
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultSequenceName());
- assertEquals("mySequenceName", idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedSequenceName());
- }
-
- public void testSetSpecifiedSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedSequenceName("mySequenceName");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals("mySequenceName", generatorAnnotation.getSequenceName());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setName(null);
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedSequenceName(null);
- generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNull(generatorAnnotation.getName());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java
deleted file mode 100644
index f76929a311..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java
+++ /dev/null
@@ -1,672 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaTableGeneratorTests extends ContextModelTestCase
-{
- private static final String TABLE_GENERATOR_NAME = "MY_TABLE_GENERATOR";
-
- private ICompilationUnit createTestEntityWithTableGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@TableGenerator(name=\"" + TABLE_GENERATOR_NAME + "\")");
- }
- });
- }
-
- public JavaTableGeneratorTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(TABLE_GENERATOR_NAME, idMapping.getGeneratorContainer().getTableGenerator().getName());
-
- //change resource model tableGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getGeneratorContainer().getTableGenerator().getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(TABLE_GENERATOR_NAME, idMapping.getGeneratorContainer().getTableGenerator().getName());
-
- idMapping.getGeneratorContainer().getTableGenerator().setName("foo");
-
- assertEquals("foo", idMapping.getGeneratorContainer().getTableGenerator().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("foo", tableGenerator.getName());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getCatalog());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setCatalog("myCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myCatalog", idMapping.getGeneratorContainer().getTableGenerator().getCatalog());
- assertEquals("myCatalog", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultCatalog());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedCatalog("myCatalog");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultCatalog());
- assertEquals("myCatalog", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedCatalog("myCatalog");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myCatalog", generatorAnnotation.getCatalog());
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getSchema());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setSchema("mySchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySchema", idMapping.getGeneratorContainer().getTableGenerator().getSchema());
- assertEquals("mySchema", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedSchema("mySchema");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
- assertEquals("mySchema", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntityWithTableGenerator();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- IdMapping idMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- getEntityMappings().removePersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedSchema("mySchema");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("mySchema", generatorAnnotation.getSchema());
- }
-
- public void testGetPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getPkColumnName());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setPkColumnName("myPkColumnName");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myPkColumnName", idMapping.getGeneratorContainer().getTableGenerator().getPkColumnName());
- assertEquals("myPkColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnName());
- }
-
- public void testGetDefaultPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnName());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnName("myPkColumnName");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnName());
- assertEquals("myPkColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnName());
- }
-
- public void testSetSpecifiedPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnName("myPkColumnName");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myPkColumnName", generatorAnnotation.getPkColumnName());
- }
-
- public void testGetValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getValueColumnName());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setValueColumnName("myValueColumnName");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myValueColumnName", idMapping.getGeneratorContainer().getTableGenerator().getValueColumnName());
- assertEquals("myValueColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedValueColumnName());
- }
-
- public void testGetDefaultValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultValueColumnName());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedValueColumnName("myValueColumnName");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultValueColumnName());
- assertEquals("myValueColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedValueColumnName());
- }
-
- public void testSetSpecifiedValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedValueColumnName("myValueColumnName");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myValueColumnName", generatorAnnotation.getValueColumnName());
- }
-
- public void testGetPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getPkColumnValue());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setPkColumnValue("myPkColumnValue");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myPkColumnValue", idMapping.getGeneratorContainer().getTableGenerator().getPkColumnValue());
- assertEquals("myPkColumnValue", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnValue());
- }
-
- public void testGetDefaultPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnValue());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnValue("myPkColumnValue");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnValue());
- assertEquals("myPkColumnValue", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnValue());
- }
-
- public void testSetSpecifiedPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnValue("myPkColumnValue");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myPkColumnValue", generatorAnnotation.getPkColumnValue());
- }
-
- public void testGetInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getTableGenerator().getInitialValue());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setInitialValue(Integer.valueOf(82));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(82, idMapping.getGeneratorContainer().getTableGenerator().getInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedInitialValue());
- }
-
- public void testGetDefaultInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultInitialValue());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedInitialValue(Integer.valueOf(82));
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedInitialValue());
- }
-
- public void testSetSpecifiedInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedInitialValue(Integer.valueOf(20));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(Integer.valueOf(20), generatorAnnotation.getInitialValue());
- }
-
- public void testGetAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getTableGenerator().getAllocationSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setAllocationSize(Integer.valueOf(20));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(20, idMapping.getGeneratorContainer().getTableGenerator().getAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedAllocationSize());
- }
-
- public void testGetDefaultAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultAllocationSize());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedAllocationSize(Integer.valueOf(20));
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedAllocationSize());
- }
-
- public void testSetSpecifiedAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedAllocationSize(Integer.valueOf(25));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(Integer.valueOf(25), generatorAnnotation.getAllocationSize());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTableGenerator tableGenerator =(JavaTableGenerator) ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
-
- assertEquals(0, tableGenerator.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableGeneratorAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGeneratorAnnotation.getUniqueConstraintsSize());
-
- tableGenerator.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGeneratorAnnotation.getUniqueConstraintsSize());
-
-
- tableGenerator.moveUniqueConstraint(2, 0);
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- tableGenerator.moveUniqueConstraint(0, 1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- tableGeneratorAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- tableGeneratorAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java
deleted file mode 100644
index bf56915960..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaTableTests extends ContextModelTestCase
-{
- private static final String TABLE_NAME = "MY_TABLE";
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Table(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
-
- public JavaTableTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, getJavaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getTable().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getTable().getDefaultName());
-
- //test that setting the java entity name will change the table default name
- getJavaEntity().setSpecifiedName("foo");
- assertEquals("foo", getJavaEntity().getTable().getDefaultName());
- }
-
- public void testGetDefaultNameSingleTableInheritance() throws Exception {
- createTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertNotSame(getJavaEntity(), rootEntity);
- assertEquals(TYPE_NAME, childEntity.getTable().getDefaultName());
- assertEquals(TYPE_NAME, rootEntity.getTable().getDefaultName());
-
- //test that setting the root java entity name will change the table default name of the child
- rootEntity.setSpecifiedName("foo");
- assertEquals("foo", childEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- JavaEntity javaEntity = ormEntity.getJavaTypeMapping();
-
- assertNull(javaEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", javaEntity.getTable().getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", javaEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", javaEntity.getTable().getDefaultSchema());
-
- getEntityMappings().removePersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", getJavaEntity().getTable().getDefaultSchema());
-
- IFile file = getOrmXmlResource().getFile();
- //remove the mapping file reference from the persistence.xml. default schema
- //should still come from persistence-unit-defaults because of implied mapped-file-ref
- getXmlPersistenceUnit().getMappingFiles().remove(mappingFileRef);
- assertEquals("FOO", getJavaEntity().getTable().getDefaultSchema());
-
- file.delete(true, null);
- assertNull(getJavaEntity().getTable().getDefaultSchema());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getTable().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, getJavaEntity().getTable().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getTable().setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getTable().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals("foo", table.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getTable().setSpecifiedName(null);
-
- assertNull(getJavaEntity().getTable().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertNull(table);
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- table.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getTable().getSpecifiedName());
-
- resourceType.removeAnnotation(JPA.TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.setCatalog("myCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myCatalog", getJavaEntity().getTable().getSpecifiedCatalog());
- assertEquals("myCatalog", getJavaEntity().getTable().getCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getTable().getDefaultCatalog());
-
- getJavaEntity().getTable().setSpecifiedCatalog("myCatalog");
-
- assertNull(getJavaEntity().getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- JavaEntity javaEntity = ormEntity.getJavaTypeMapping();
-
- assertNull(javaEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", javaEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", javaEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedCatalog("XML_CATALOG");
- assertEquals("BAR", javaEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().removePersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default catalog taken from persistence-unite-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", getJavaEntity().getTable().getDefaultCatalog());
-
- IFile file = getOrmXmlResource().getFile();
- //remove the mapping file reference from the persistence.xml. default schema
- //should still come from persistence-unit-defaults because of implied mapped-file-ref
- getXmlPersistenceUnit().getMappingFiles().remove(mappingFileRef);
- assertEquals("FOO", getJavaEntity().getTable().getDefaultCatalog());
-
- file.delete(true, null);
- assertNull(getJavaEntity().getTable().getDefaultCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Table table = getJavaEntity().getTable();
- table.setSpecifiedCatalog("myCatalog");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableResource = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals("myCatalog", tableResource.getCatalog());
-
- table.setSpecifiedCatalog(null);
- assertNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.setSchema("mySchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySchema", getJavaEntity().getTable().getSpecifiedSchema());
- assertEquals("mySchema", getJavaEntity().getTable().getSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getTable().getDefaultSchema());
-
- getJavaEntity().getTable().setSpecifiedSchema("mySchema");
-
- assertNull(getJavaEntity().getTable().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Table table = getJavaEntity().getTable();
- table.setSpecifiedSchema("mySchema");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableResource = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals("mySchema", tableResource.getSchema());
-
- table.setSpecifiedSchema(null);
- assertNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = getJavaEntity().getTable().getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = getJavaEntity().getTable().getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getTable().getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, getJavaEntity().getTable().getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(0).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTable table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(3, tableAnnotation.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTable table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(3, tableAnnotation.getUniqueConstraintsSize());
-
-
- table.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- table.moveUniqueConstraint(0, 1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTable table = getJavaEntity().getTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- tableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- tableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- tableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAbstractEntityGetDefaultNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity concreteEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertEquals(null, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
-
- assertEquals("AnnotationTestTypeChild", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java
deleted file mode 100644
index 1cd48c8b30..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaTransientMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient").append(CR);
- }
- });
- }
-
- public JavaTransientMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testTransientMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
-
- assertNotNull(transientMapping);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java
deleted file mode 100644
index ddf1b927f4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaVersionMappingTests extends ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- public JavaVersionMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) versionMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertNull(versionMapping.getConverter().getType());
-
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- versionMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertNull(versionMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.DATE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.DATE, ((TemporalConverter) versionMapping.getConverter()).getTemporalType());
-
- resourceField.removeAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(versionMapping.getConverter().getType());
- assertFalse(versionMapping.isDefault());
- assertSame(versionMapping, persistentAttribute.getMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertNull(versionMapping.getColumn().getSpecifiedName());
- assertEquals("id", versionMapping.getColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", versionMapping.getColumn().getSpecifiedName());
- assertEquals("foo", versionMapping.getColumn().getName());
- assertEquals("id", versionMapping.getColumn().getDefaultName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java
deleted file mode 100644
index c81d28bf5d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCoreContextJavaModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreContextJavaModelTests.class.getPackage().getName());
- suite.addTestSuite(JavaAssociationOverrideTests.class);
- suite.addTestSuite(JavaAttributeOverrideTests.class);
- suite.addTestSuite(JavaBasicMappingTests.class);
- suite.addTestSuite(JavaCascadeTests.class);
- suite.addTestSuite(JavaColumnTests.class);
- suite.addTestSuite(JavaDiscriminatorColumnTests.class);
- suite.addTestSuite(JavaEmbeddableTests.class);
- suite.addTestSuite(JavaEmbeddedIdMappingTests.class);
- suite.addTestSuite(JavaEmbeddedMappingTests.class);
- suite.addTestSuite(JavaEntityTests.class);
- suite.addTestSuite(JavaGeneratedValueTests.class);
- suite.addTestSuite(JavaIdMappingTests.class);
- suite.addTestSuite(JavaJoinColumnTests.class);
- suite.addTestSuite(JavaJoinTableTests.class);
- suite.addTestSuite(JavaMappedSuperclassTests.class);
- suite.addTestSuite(JavaManyToManyMappingTests.class);
- suite.addTestSuite(JavaManyToOneMappingTests.class);
- suite.addTestSuite(JavaNamedQueryTests.class);
- suite.addTestSuite(JavaNamedNativeQueryTests.class);
- suite.addTestSuite(JavaQueryHintTests.class);
- suite.addTestSuite(JavaOneToManyMappingTests.class);
- suite.addTestSuite(JavaOneToOneMappingTests.class);
- suite.addTestSuite(GenericJavaPersistentTypeTests.class);
- suite.addTestSuite(GenericJavaPersistentAttributeTests.class);
- suite.addTestSuite(JavaPrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(JavaSecondaryTableTests.class);
- suite.addTestSuite(JavaSequenceGeneratorTests.class);
- suite.addTestSuite(JavaTableGeneratorTests.class);
- suite.addTestSuite(JavaTableTests.class);
- suite.addTestSuite(JavaTransientMappingTests.class);
- suite.addTestSuite(JavaVersionMappingTests.class);
- return suite;
- }
-
- private JptCoreContextJavaModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java
deleted file mode 100644
index 75e9d99837..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java
+++ /dev/null
@@ -1,1066 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EntityMappingsTests extends ContextModelTestCase
-{
- public EntityMappingsTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testGetVersion() throws Exception {
- assertEquals("1.0", getEntityMappings().getVersion());
- }
-
- public void testUpdateDescription() throws Exception {
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
-
- //set description in the resource model, verify context model updated
- getXmlEntityMappings().setDescription("newDescription");
- assertEquals("newDescription", getEntityMappings().getDescription());
- assertEquals("newDescription", getXmlEntityMappings().getDescription());
-
- //set description to null in the resource model
- getXmlEntityMappings().setDescription(null);
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
- }
-
- public void testModifyDescription() throws Exception {
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
-
- //set description in the context model, verify resource model modified
- getEntityMappings().setDescription("newDescription");
- assertEquals("newDescription", getEntityMappings().getDescription());
- assertEquals("newDescription", getXmlEntityMappings().getDescription());
-
- //set description to null in the context model
- getEntityMappings().setDescription(null);
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
- }
-
- public void testUpdatePackage() throws Exception {
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
-
- //set package in the resource model, verify context model updated
- getXmlEntityMappings().setPackage("foo.model");
- assertEquals("foo.model", getEntityMappings().getPackage());
- assertEquals("foo.model", getXmlEntityMappings().getPackage());
-
- //set package to null in the resource model
- getXmlEntityMappings().setPackage(null);
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
- }
-
- public void testModifyPackage() throws Exception {
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
-
- //set package in the context model, verify resource model modified
- getEntityMappings().setPackage("foo.model");
- assertEquals("foo.model", getEntityMappings().getPackage());
- assertEquals("foo.model", getXmlEntityMappings().getPackage());
-
- //set package to null in the context model
- getEntityMappings().setPackage(null);
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- //set schema in the resource model, verify context model updated
- getXmlEntityMappings().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getSchema());
-
- //set schema to null in the resource model
- getXmlEntityMappings().setSchema(null);
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- //set schema in the context model, verify resource model modified
- getEntityMappings().setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getSchema());
-
- //set schema to null in the context model
- getEntityMappings().setSpecifiedSchema(null);
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- //set catalog in the resource model, verify context model updated
- getXmlEntityMappings().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getCatalog());
-
- //set catalog to null in the resource model
- getXmlEntityMappings().setCatalog(null);
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- }
-
- public void testUpdateDefaultSchema() throws Exception {
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- persistenceUnitDefaults.setSchema(null);
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testUpdateSchema() throws Exception {
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getXmlEntityMappings().setSchema("MY_SCHEMA");
- assertNull(getEntityMappings().getDefaultSchema());
- assertEquals("MY_SCHEMA", getEntityMappings().getSchema());
- assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getSchema());
-
- getXmlEntityMappings().setSchema(null);
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("DEFAULT_SCHEMA");
- assertEquals("DEFAULT_SCHEMA", getEntityMappings().getDefaultSchema());
- assertEquals("DEFAULT_SCHEMA", getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- //set catalog in the context model, verify resource model modified
- getEntityMappings().setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getCatalog());
-
- //set catalog to null in the context model
- getEntityMappings().setSpecifiedCatalog(null);
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- }
-
- public void testUpdateDefaultCatalog() throws Exception {
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- persistenceUnitDefaults.setCatalog(null);
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testUpdateCatalog() throws Exception {
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getXmlEntityMappings().setCatalog("MY_CATALOG");
- assertNull(getEntityMappings().getDefaultCatalog());
- assertEquals("MY_CATALOG", getEntityMappings().getCatalog());
- assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getCatalog());
-
- getXmlEntityMappings().setCatalog(null);
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("DEFAULT_CATALOG");
- assertEquals("DEFAULT_CATALOG", getEntityMappings().getDefaultCatalog());
- assertEquals("DEFAULT_CATALOG", getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- }
-
- public void testUpdateSpecifiedAccess() throws Exception {
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().setAccess(null);
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- //set access in the context model, verify resource model modified
- getEntityMappings().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getAccess());
-
- //set access to null in the context model
- getEntityMappings().setSpecifiedAccess(null);
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testUpdateDefaultAccess() throws Exception {
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(null);
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testUpdateAccess() throws Exception {
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertNull(getEntityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setAccess(null);
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
-
- public void testUpdateOrmPersistentTypes() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- //add embeddable in the resource model, verify context model updated
- XmlEmbeddable embeddable = OrmFactory.eINSTANCE.createXmlEmbeddable();
- getXmlEntityMappings().getEmbeddables().add(embeddable);
- embeddable.setClassName("model.Foo");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo", getXmlEntityMappings().getEmbeddables().get(0).getClassName());
-
- //add entity in the resource model, verify context model updated
- XmlEntity entity = OrmFactory.eINSTANCE.createXmlEntity();
- getXmlEntityMappings().getEntities().add(entity);
- entity.setClassName("model.Foo2");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo2", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo2", getXmlEntityMappings().getEntities().get(0).getClassName());
-
- //add mapped-superclass in the resource model, verify context model updated
- XmlMappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createXmlMappedSuperclass();
- getXmlEntityMappings().getMappedSuperclasses().add(mappedSuperclass);
- mappedSuperclass.setClassName("model.Foo3");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo3", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo3", getXmlEntityMappings().getMappedSuperclasses().get(0).getClassName());
- }
-
-
- public void testAddOrmPersistentType() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- //add embeddable in the context model, verify resource model modified
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getEntityMappings().getPersistentTypes().iterator().next().getMapping().getKey());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo", getXmlEntityMappings().getEmbeddables().get(0).getClassName());
-
- //add entity in the context model, verify resource model modified
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo2", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getEntityMappings().getPersistentTypes().iterator().next().getMapping().getKey());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo2", getXmlEntityMappings().getEntities().get(0).getClassName());
-
- //add mapped-superclass in the context model, verify resource model modified
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo3", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, getEntityMappings().getPersistentTypes().iterator().next().getMapping().getKey());
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo3", getXmlEntityMappings().getMappedSuperclasses().get(0).getClassName());
- }
-
- public void testRemoveOrmPersistentType() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
-
- //remove ormPersistentType from the context model, verify resource model modified
- getEntityMappings().removePersistentType(1);
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- getEntityMappings().removePersistentType(1);
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- getEntityMappings().removePersistentType(0);
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
- }
-
- public void testUpdateTableGenerators() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlTableGenerator tableGeneratorResource = OrmFactory.eINSTANCE.createXmlTableGenerator();
- getXmlEntityMappings().getTableGenerators().add(tableGeneratorResource);
- tableGeneratorResource.setName("FOO");
-
- TableGenerator tableGenerator = getEntityMappings().getTableGenerators().iterator().next();
- assertEquals("FOO", tableGenerator.getName());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlTableGenerator tableGeneratorResource2 = OrmFactory.eINSTANCE.createXmlTableGenerator();
- getXmlEntityMappings().getTableGenerators().add(0, tableGeneratorResource2);
- tableGeneratorResource2.setName("BAR");
-
- ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlTableGenerator tableGeneratorResource3 = OrmFactory.eINSTANCE.createXmlTableGenerator();
- getXmlEntityMappings().getTableGenerators().add(1, tableGeneratorResource3);
- tableGeneratorResource3.setName("BAZ");
-
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("BAZ", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().move(2, 0);
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAZ", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertEquals("BAR", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().remove(0);
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("FOO", tableGenerators.next().getName());
- assertEquals("BAR", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().remove(1);
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().clear();
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertFalse(tableGenerators.hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
- getEntityMappings().addTableGenerator(0).setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
-
- getEntityMappings().addTableGenerator(0).setName("BAR");
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals(2, getXmlEntityMappings().getTableGenerators().size());
-
- ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- }
-
- public void testRemoveTableGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
-
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
-
- getEntityMappings().removeTableGenerator(0);
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(1).getName());
-
- ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().getTableGenerators().iterator();
- OrmTableGenerator xmlTableGenerator = tableGenerators.next();
- assertEquals("BAR", xmlTableGenerator.getName());
- assertEquals(tableGenerator2, xmlTableGenerator);
- xmlTableGenerator = tableGenerators.next();
- assertEquals("BAZ", xmlTableGenerator.getName());
- assertEquals(tableGenerator3, xmlTableGenerator);
- assertFalse(tableGenerators.hasNext());
-
-
- getEntityMappings().removeTableGenerator(1);
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- xmlTableGenerator = tableGenerators.next();
- assertEquals("BAR", xmlTableGenerator.getName());
- assertEquals(tableGenerator2, xmlTableGenerator);
- assertFalse(tableGenerators.hasNext());
-
-
- getEntityMappings().removeTableGenerator(0);
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertFalse(tableGenerators.hasNext());
- }
-
- public void testMoveTableGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
-
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
-
- getEntityMappings().moveTableGenerator(2, 0);
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
-
- getEntityMappings().moveTableGenerator(0, 2);
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
- }
-
- public void testTableGeneratorsSize() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
-
-
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
-
- assertEquals(3, getEntityMappings().getTableGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().remove(0);
- assertEquals(2, getEntityMappings().getTableGeneratorsSize());
- }
-
- public void testUpdateSequenceGenerators() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlSequenceGenerator sequenceGeneratorResource = OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- getXmlEntityMappings().getSequenceGenerators().add(sequenceGeneratorResource);
- sequenceGeneratorResource.setName("FOO");
-
- SequenceGenerator sequenceGenerator = getEntityMappings().getSequenceGenerators().iterator().next();
- assertEquals("FOO", sequenceGenerator.getName());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlSequenceGenerator sequenceGeneratorResource2 = OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- getXmlEntityMappings().getSequenceGenerators().add(0, sequenceGeneratorResource2);
- sequenceGeneratorResource2.setName("BAR");
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlSequenceGenerator sequenceGeneratorResource3 = OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- getXmlEntityMappings().getSequenceGenerators().add(1, sequenceGeneratorResource3);
- sequenceGeneratorResource3.setName("BAZ");
-
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("BAZ", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().move(2, 0);
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAZ", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
-
- getXmlEntityMappings().getSequenceGenerators().remove(0);
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().remove(1);
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().clear();
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddSequenceGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().addSequenceGenerator(0).setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
-
- getEntityMappings().addSequenceGenerator(0).setName("BAR");
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals(2, getXmlEntityMappings().getSequenceGenerators().size());
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().removeSequenceGenerator(0);
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- SequenceGenerator xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAR", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator2, xmlSequenceGenerator);
- xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAZ", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator3, xmlSequenceGenerator);
- assertFalse(sequenceGenerators.hasNext());
-
-
- getEntityMappings().removeSequenceGenerator(1);
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAR", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator2, xmlSequenceGenerator);
- assertFalse(sequenceGenerators.hasNext());
-
-
- getEntityMappings().removeSequenceGenerator(0);
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertFalse(sequenceGenerators.hasNext());
- }
-
- public void testMoveSequenceGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().moveSequenceGenerator(2, 0);
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().moveSequenceGenerator(0, 2);
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- }
-
- public void testSequenceGeneratorsSize() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
-
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
-
- assertEquals(3, getEntityMappings().getSequenceGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().remove(0);
- assertEquals(2, getEntityMappings().getSequenceGeneratorsSize());
- }
-
-
- public void testAddNamedQuery() throws Exception {
- OrmNamedQuery namedQuery = getEntityMappings().getQueryContainer().addNamedQuery(0);
- namedQuery.setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(0).getName());
-
- OrmNamedQuery namedQuery2 = getEntityMappings().getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(1).getName());
-
- OrmNamedQuery namedQuery3 = getEntityMappings().getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedQueries().size());
-
- getEntityMappings().getQueryContainer().removeNamedQuery(0);
- assertEquals(2, getXmlEntityMappings().getNamedQueries().size());
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(1).getName());
-
- getEntityMappings().getQueryContainer().removeNamedQuery(0);
- assertEquals(1, getXmlEntityMappings().getNamedQueries().size());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(0).getName());
-
- getEntityMappings().getQueryContainer().removeNamedQuery(0);
- assertEquals(0, getXmlEntityMappings().getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedQueries().size());
-
-
- getEntityMappings().getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(2).getName());
-
-
- getEntityMappings().getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- getXmlEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- getXmlEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
-
- getXmlEntityMappings().getNamedQueries().get(0).setName("FOO");
- getXmlEntityMappings().getNamedQueries().get(1).setName("BAR");
- getXmlEntityMappings().getNamedQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().move(2, 0);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- getXmlEntityMappings().getNamedQueries().move(0, 1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- getXmlEntityMappings().getNamedQueries().remove(1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().remove(1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().remove(0);
- assertFalse(getEntityMappings().getQueryContainer().getNamedQueries().iterator().hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- OrmNamedNativeQuery namedNativeQuery = getEntityMappings().getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
-
- OrmNamedNativeQuery namedNativeQuery2 = getEntityMappings().getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
-
- OrmNamedNativeQuery namedNativeQuery3 = getEntityMappings().getQueryContainer().addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(2).getName());
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals(namedNativeQuery2, namedNativeQueries.next());
- assertEquals(namedNativeQuery3, namedNativeQueries.next());
- assertEquals(namedNativeQuery, namedNativeQueries.next());
-
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedNativeQueries().size());
-
- getEntityMappings().getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(2, getXmlEntityMappings().getNamedNativeQueries().size());
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
-
- getEntityMappings().getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(1, getXmlEntityMappings().getNamedNativeQueries().size());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
-
- getEntityMappings().getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(0, getXmlEntityMappings().getNamedNativeQueries().size());
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedNativeQueries().size());
-
-
- getEntityMappings().getQueryContainer().moveNamedNativeQuery(2, 0);
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(2).getName());
-
-
- getEntityMappings().getQueryContainer().moveNamedNativeQuery(0, 1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(2).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- getXmlEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- getXmlEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
-
- getXmlEntityMappings().getNamedNativeQueries().get(0).setName("FOO");
- getXmlEntityMappings().getNamedNativeQueries().get(1).setName("BAR");
- getXmlEntityMappings().getNamedNativeQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().move(2, 0);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- getXmlEntityMappings().getNamedNativeQueries().move(0, 1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- getXmlEntityMappings().getNamedNativeQueries().remove(1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().remove(1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().remove(0);
- assertFalse(getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator().hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java
deleted file mode 100644
index ce45b8a0d2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmIdMapping;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentAttributeTests extends ContextModelTestCase
-{
- public GenericOrmPersistentAttributeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNull(ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof GenericOrmOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof GenericOrmIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getVirtualAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).convertToVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java
deleted file mode 100644
index b35ba86429..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentTypeTests extends ContextModelTestCase
-{
- public static final String MODEL_TYPE_NAME = "Model";
- public static final String FULLY_QUALIFIED_MODEL_TYPE_NAME = PACKAGE_NAME + "." + MODEL_TYPE_NAME;
-
- public static final String EMPLOYEE_TYPE_NAME = "Employee";
- public static final String FULLY_QUALIFIED_EMPLOYEE_TYPE_NAME = PACKAGE_NAME + "." + EMPLOYEE_TYPE_NAME;
-
-
- public GenericOrmPersistentTypeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private void createModelType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public abstract class ").append(MODEL_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, MODEL_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createEmployeeType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(EMPLOYEE_TYPE_NAME).append(" extends ").append(MODEL_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String department;").append(CR);
- sb.append(CR);
- sb.append(" private java.util.Date startDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMPLOYEE_TYPE_NAME + ".java", sourceWriter);
- }
-
-// public void testUpdateXmlTypeMapping() throws Exception {
-// assertFalse(entityMappings().ormPersistentTypes().hasNext());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-//
-// //add embeddable in the resource model, verify context model updated
-// Embeddable embeddable = OrmFactory.eINSTANCE.createEmbeddable();
-// ormResource().getEntityMappings().getEmbeddables().add(embeddable);
-// embeddable.setClassName("model.Foo");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName());
-//
-// //add entity in the resource model, verify context model updated
-// Entity entity = OrmFactory.eINSTANCE.createEntity();
-// ormResource().getEntityMappings().getEntities().add(entity);
-// entity.setClassName("model.Foo2");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo2", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo2", ormResource().getEntityMappings().getEntities().get(0).getClassName());
-//
-// //add mapped-superclass in the resource model, verify context model updated
-// MappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createMappedSuperclass();
-// ormResource().getEntityMappings().getMappedSuperclasses().add(mappedSuperclass);
-// mappedSuperclass.setClassName("model.Foo3");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo3", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo3", ormResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName());
-// }
-//
-
- public void testMorphXmlTypeMapping() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
-
- OrmPersistentType ormPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- assertEquals(mappedSuperclassPersistentType, ormPersistentType);
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, ormPersistentType.getMapping().getKey());
-
- ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertEquals(0, getXmlEntityMappings().getMappedSuperclasses().size());
- assertEquals(1, getXmlEntityMappings().getEntities().size());
- assertEquals(2, getXmlEntityMappings().getEmbeddables().size());
-
- Iterator<OrmPersistentType> ormPersistentTypes = getEntityMappings().getPersistentTypes().iterator();
- //the same OrmPersistentTypes should still be in the context model
- assertEquals(ormPersistentTypes.next(), entityPersistentType);
- assertEquals(ormPersistentTypes.next(), embeddablePersistentType);
- assertEquals(ormPersistentTypes.next(), mappedSuperclassPersistentType);
-
- assertEquals("model.Foo", getXmlEntityMappings().getEmbeddables().get(0).getClassName());
- assertEquals("model.Foo3", getXmlEntityMappings().getEmbeddables().get(1).getClassName());
- }
-
- public void testAddSpecifiedPersistentAttribute() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute");
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entity.getAttributes().getBasics().get(0);
- assertEquals("basicAttribute", basic.getName());
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute");
-
- XmlEmbedded embedded = entity.getAttributes().getEmbeddeds().get(0);
- assertEquals("embeddedAttribute", embedded.getName());
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute");
-
- XmlTransient transientResource = entity.getAttributes().getTransients().get(0);
- assertEquals("transientAttribute", transientResource.getName());
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionAttribute");
-
- XmlVersion version = entity.getAttributes().getVersions().get(0);
- assertEquals("versionAttribute", version.getName());
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute");
-
- XmlId id = entity.getAttributes().getIds().get(0);
- assertEquals("idAttribute", id.getName());
-
-
- Iterator<OrmPersistentAttribute> persistentAttributes = entityPersistentType.getSpecifiedAttributes().iterator();
- assertEquals("idAttribute", persistentAttributes.next().getName());
- assertEquals("basicAttribute", persistentAttributes.next().getName());
- assertEquals("versionAttribute", persistentAttributes.next().getName());
- assertEquals("embeddedAttribute", persistentAttributes.next().getName());
- assertEquals("transientAttribute", persistentAttributes.next().getName());
- assertFalse(persistentAttributes.hasNext());
- }
-
- public void testRemoveSpecifiedPersistentAttribute() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute");
- entityPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute");
- entityPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionAttribute");
- entityPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute");
- entityPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute");
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("basicAttribute", entity.getAttributes().getBasics().get(0).getName());
- assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName());
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("basicAttribute")).convertToVirtual();
- assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName());
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("embeddedAttribute")).convertToVirtual();
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("versionAttribute")).convertToVirtual();
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("idAttribute")).convertToVirtual();
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("transientAttribute")).convertToVirtual();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveId() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute");
- assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("idAttribute")).convertToVirtual();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveBasic() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute");
- assertEquals("basicAttribute", entity.getAttributes().getBasics().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("basicAttribute")).convertToVirtual();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveVersion() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionAttribute");
- assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("versionAttribute")).convertToVirtual();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveEmbedded() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute");
- assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("embeddedAttribute")).convertToVirtual();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveTransient() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- entityPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute");
- assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("transientAttribute")).convertToVirtual();
- assertNull(entity.getAttributes());
- }
-
- public void testUpdateSpecifiedPersistentAttributes() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- entity.setAttributes(OrmFactory.eINSTANCE.createAttributes());
- XmlBasic basic = OrmFactory.eINSTANCE.createXmlBasic();
- entity.getAttributes().getBasics().add(basic);
- basic.setName("basicAttribute");
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = entityPersistentType.getAttributes().iterator().next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
-
- XmlEmbedded embedded = OrmFactory.eINSTANCE.createXmlEmbedded();
- entity.getAttributes().getEmbeddeds().add(embedded);
- embedded.setName("embeddedAttribute");
-
- Iterator<OrmReadOnlyPersistentAttribute> attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlVersion version = OrmFactory.eINSTANCE.createXmlVersion();
- entity.getAttributes().getVersions().add(version);
- version.setName("versionAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlId id = OrmFactory.eINSTANCE.createXmlId();
- entity.getAttributes().getIds().add(id);
- id.setName("idAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlTransient transientResource = OrmFactory.eINSTANCE.createXmlTransient();
- entity.getAttributes().getTransients().add(transientResource);
- transientResource.setName("transientAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlManyToOne manyToOneResource = OrmFactory.eINSTANCE.createXmlManyToOne();
- entity.getAttributes().getManyToOnes().add(manyToOneResource);
- manyToOneResource.setName("manyToOneAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlManyToMany manyToManyResource = OrmFactory.eINSTANCE.createXmlManyToMany();
- entity.getAttributes().getManyToManys().add(manyToManyResource);
- manyToManyResource.setName("manyToManyAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlOneToMany oneToManyResource = OrmFactory.eINSTANCE.createXmlOneToMany();
- entity.getAttributes().getOneToManys().add(oneToManyResource);
- oneToManyResource.setName("oneToManyAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlOneToOne oneToOneResource = OrmFactory.eINSTANCE.createXmlOneToOne();
- entity.getAttributes().getOneToOnes().add(oneToOneResource);
- oneToOneResource.setName("oneToOneAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
-
- XmlEmbeddedId embeddedIdResource = OrmFactory.eINSTANCE.createXmlEmbeddedId();
- entity.getAttributes().getEmbeddedIds().add(embeddedIdResource);
- embeddedIdResource.setName("embeddedIdAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedIdAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- entity.getAttributes().getBasics().remove(0);
- entity.getAttributes().getEmbeddeds().remove(0);
- entity.getAttributes().getTransients().remove(0);
- entity.getAttributes().getIds().remove(0);
- entity.getAttributes().getVersions().remove(0);
- entity.getAttributes().getManyToOnes().remove(0);
- entity.getAttributes().getManyToManys().remove(0);
- entity.getAttributes().getOneToManys().remove(0);
- entity.getAttributes().getOneToOnes().remove(0);
- entity.getAttributes().getEmbeddedIds().remove(0);
- assertFalse(entityPersistentType.getAttributes().iterator().hasNext());
- assertNotNull(entity.getAttributes());
- }
-
-
-
- public void testInheritedAttributesResolve() throws Exception {
- createModelType();
- createEmployeeType();
-
- OrmPersistentType employeePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_EMPLOYEE_TYPE_NAME);
-
-
- employeePersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
- employeePersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "name");
- OrmPersistentAttribute startDateAttribute = employeePersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "startDate");
- ((OrmBasicMapping) startDateAttribute.getMapping()).setConverter(TemporalConverter.class);
- ((TemporalConverter) ((OrmBasicMapping) startDateAttribute.getMapping()).getConverter()).setTemporalType(TemporalType.DATE);
-
- OrmReadOnlyPersistentAttribute idAttribute = employeePersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = idAttribute.getJavaPersistentAttribute();
- assertNotNull(javaPersistentAttribute);
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals("test.Employee", javaPersistentAttribute.getOwningPersistentType().getName());
- assertEquals("test.Model", javaPersistentAttribute.getResourceAttribute().getParent().getQualifiedName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java
deleted file mode 100644
index 68e86e2e8a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCoreOrmContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreOrmContextModelTests.class.getPackage().getName());
- suite.addTestSuite(OrmXmlTests.class);
- suite.addTestSuite(EntityMappingsTests.class);
- suite.addTestSuite(PersistenceUnitMetadataTests.class);
- suite.addTestSuite(PersistenceUnitDefaultsTests.class);
- suite.addTestSuite(GenericOrmPersistentAttributeTests.class);
- suite.addTestSuite(GenericOrmPersistentTypeTests.class);
- suite.addTestSuite(OrmAssociationOverrideTests.class);
- suite.addTestSuite(OrmAttributeOverrideTests.class);
- suite.addTestSuite(OrmBasicMappingTests.class);
- suite.addTestSuite(OrmCascadeTests.class);
- suite.addTestSuite(OrmColumnTests.class);
- suite.addTestSuite(OrmDiscriminatorColumnTests.class);
- suite.addTestSuite(OrmIdMappingTests.class);
- suite.addTestSuite(OrmEmbeddableTests.class);
- suite.addTestSuite(OrmEmbeddedMappingTests.class);
- suite.addTestSuite(OrmEmbeddedIdMappingTests.class);
- suite.addTestSuite(OrmEntityTests.class);
- suite.addTestSuite(OrmGeneratedValueTests.class);
- suite.addTestSuite(OrmJoinColumnTests.class);
- suite.addTestSuite(OrmJoinTableTests.class);
- suite.addTestSuite(OrmMappedSuperclassTests.class);
- suite.addTestSuite(OrmManyToManyMappingTests.class);
- suite.addTestSuite(OrmManyToOneMappingTests.class);
- suite.addTestSuite(OrmNamedQueryTests.class);
- suite.addTestSuite(OrmNamedNativeQueryTests.class);
- suite.addTestSuite(OrmOneToManyMappingTests.class);
- suite.addTestSuite(OrmOneToOneMappingTests.class);
- suite.addTestSuite(OrmPrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(OrmQueryHintTests.class);
- suite.addTestSuite(OrmSecondaryTableTests.class);
- suite.addTestSuite(OrmSequenceGeneratorTests.class);
- suite.addTestSuite(OrmTableGeneratorTests.class);
- suite.addTestSuite(OrmTableTests.class);
- suite.addTestSuite(OrmTransientMappingTests.class);
- suite.addTestSuite(OrmVersionMappingTests.class);
- return suite;
- }
-
- private JptCoreOrmContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java
deleted file mode 100644
index fd8da14991..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmAssociationOverrideTests extends ContextModelTestCase
-{
- public OrmAssociationOverrideTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAssociationOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- //set name to null in the resource model
- xmlAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(overrideContainer.getOverrides().iterator().hasNext());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- //set name in the context model, verify resource model modified
- ormAssociationOverride.setName("foo");
- assertEquals("foo", ormAssociationOverride.getName());
- assertEquals("foo", xmlAssociationOverride.getName());
-
- //set name to null in the context model
- ormAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(entityResource.getAssociationOverrides().get(0).getName());
- }
-
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- OrmJoinColumn joinColumn = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, xmlAssociationOverride.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- xmlAssociationOverride.getJoinColumns().get(0).setName("FOO");
- xmlAssociationOverride.getJoinColumns().get(1).setName("BAR");
- xmlAssociationOverride.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(2, 0);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(0);
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java
deleted file mode 100644
index a2879c6303..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmAttributeOverrideTests extends ContextModelTestCase
-{
- public OrmAttributeOverrideTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0);
- OrmAttributeOverride ormAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAttributeOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- attributeOverrideResource.setName("FOO");
- assertEquals("FOO", ormAttributeOverride.getName());
- assertEquals("FOO", attributeOverrideResource.getName());
-
- //set name to null in the resource model
- attributeOverrideResource.setName(null);
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
-
- attributeOverrideResource.setName("FOO");
- assertEquals("FOO", ormAttributeOverride.getName());
- assertEquals("FOO", attributeOverrideResource.getName());
-
- entityResource.getAttributeOverrides().remove(0);
- assertFalse(overrideContainer.getOverrides().iterator().hasNext());
- assertTrue(entityResource.getAttributeOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0);
- OrmAttributeOverride ormAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
-
- //set name in the context model, verify resource model modified
- ormAttributeOverride.setName("foo");
- assertEquals("foo", ormAttributeOverride.getName());
- assertEquals("foo", attributeOverrideResource.getName());
-
- //set name to null in the context model
- ormAttributeOverride.setName(null);
- assertNull(ormAttributeOverride.getName());
- assertNull(entityResource.getAttributeOverrides().get(0).getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java
deleted file mode 100644
index d3b18d40a3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java
+++ /dev/null
@@ -1,711 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.LobConverter;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmBasicMappingTests extends ContextModelTestCase
-{
- public OrmBasicMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.FETCH_TYPE, JPA.COLUMN, JPA.LOB, JPA.TEMPORAL, JPA.TEMPORAL_TYPE, JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch=FetchType.LAZY, optional=false)");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Lob");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- sb.append(CR);
- sb.append(" @Enumerated(EnumType.STRING)");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertEquals("basicMapping", ormBasicMapping.getName());
- assertEquals("basicMapping", basicResource.getName());
-
- //set name in the resource model, verify context model updated
- basicResource.setName("newName");
- assertEquals("newName", ormBasicMapping.getName());
- assertEquals("newName", basicResource.getName());
-
- //set name to null in the resource model
- basicResource.setName(null);
- assertNull(ormBasicMapping.getName());
- assertNull(basicResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertEquals("basicMapping", ormBasicMapping.getName());
- assertEquals("basicMapping", basicResource.getName());
-
- //set name in the context model, verify resource model updated
- ormBasicMapping.setName("newName");
- assertEquals("newName", ormBasicMapping.getName());
- assertEquals("newName", basicResource.getName());
-
- //set name to null in the context model
- ormBasicMapping.setName(null);
- assertNull(ormBasicMapping.getName());
- assertNull(basicResource.getName());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- basicResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormBasicMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, basicResource.getFetch());
-
- basicResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormBasicMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, basicResource.getFetch());
-
- //set fetch to null in the resource model
- basicResource.setFetch(null);
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, basicResource.getFetch());
- assertEquals(FetchType.EAGER, ormBasicMapping.getSpecifiedFetch());
-
- ormBasicMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, basicResource.getFetch());
- assertEquals(FetchType.LAZY, ormBasicMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormBasicMapping.setSpecifiedFetch(null);
- assertNull(basicResource.getFetch());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- basicResource.setEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, basicResource.getEnumerated());
-
- basicResource.setEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, basicResource.getEnumerated());
-
- //set enumerated to null in the resource model
- basicResource.setEnumerated(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormBasicMapping.setConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) ormBasicMapping.getConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, basicResource.getEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormBasicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, basicResource.getEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormBasicMapping.setConverter(null);
- assertNull(basicResource.getEnumerated());
- assertNull(ormBasicMapping.getConverter().getType());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
-
- //set enumerated in the resource model, verify context model updated
- basicResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormBasicMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, basicResource.getOptional());
-
- basicResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormBasicMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, basicResource.getOptional());
-
- //set enumerated to null in the resource model
- basicResource.setOptional(null);
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
-
- //set enumerated in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, basicResource.getOptional());
- assertEquals(Boolean.TRUE, ormBasicMapping.getSpecifiedOptional());
-
- ormBasicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, basicResource.getOptional());
- assertEquals(Boolean.FALSE, ormBasicMapping.getSpecifiedOptional());
-
- //set enumerated to null in the context model
- ormBasicMapping.setSpecifiedOptional(null);
- assertNull(basicResource.getOptional());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- }
-
- public void testUpdateSpecifiedLob() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertFalse(basicResource.isLob());
-
- //set lob in the resource model, verify context model updated
- basicResource.setLob(true);
- assertEquals(LobConverter.class, ormBasicMapping.getConverter().getType());
- assertTrue(basicResource.isLob());
-
- //set lob to null in the resource model
- basicResource.setLob(false);
- assertNull(ormBasicMapping.getConverter().getType());
- assertFalse(basicResource.isLob());
- }
-
- public void testModifySpecifiedLob() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertFalse(basicResource.isLob());
-
- //set lob in the context model, verify resource model updated
- ormBasicMapping.setConverter(LobConverter.class);
- assertTrue(basicResource.isLob());
- assertEquals(LobConverter.class, ormBasicMapping.getConverter().getType());
-
- //set lob to false in the context model
- ormBasicMapping.setConverter(null);
- assertFalse(basicResource.isLob());
- assertNull(ormBasicMapping.getConverter().getType());
- }
-
- public void testUpdateTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- basicResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, basicResource.getTemporal());
-
- basicResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, basicResource.getTemporal());
-
- basicResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, basicResource.getTemporal());
-
- //set temporal to null in the resource model
- basicResource.setTemporal(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormBasicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) ormBasicMapping.getConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, basicResource.getTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
-
- ((TemporalConverter) ormBasicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, basicResource.getTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
-
- ((TemporalConverter) ormBasicMapping.getConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, basicResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormBasicMapping.setConverter(null);
- assertNull(basicResource.getTemporal());
- assertNull(ormBasicMapping.getConverter().getType());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
-
- public void testBasicMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormBasicMapping.getName());
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertEquals(FetchType.EAGER, ormBasicMapping.getFetch());
- assertEquals(true, ormBasicMapping.isOptional());
-
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", basicMapping.getName());
- assertEquals(EnumeratedConverter.class, basicMapping.getConverter().getType());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getEnumType());
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
-
- Column column = basicMapping.getColumn();
- assertEquals("MY_COLUMN", column.getSpecifiedName());
- assertEquals(Boolean.TRUE, column.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, column.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, column.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, column.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", column.getColumnDefinition());
- assertEquals("MY_TABLE", column.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), column.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), column.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), column.getSpecifiedScale());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", basicMapping.getName());
- assertNull(basicMapping.getConverter().getType());
- assertEquals(FetchType.EAGER, basicMapping.getFetch());
- assertTrue(basicMapping.isOptional());
-
- Column column = basicMapping.getColumn();
- assertEquals("id", column.getName());
- assertFalse(column.isUnique());
- assertTrue(column.isNullable());
- assertTrue(column.isInsertable());
- assertTrue(column.isUpdatable());
- assertNull(column.getColumnDefinition());
- assertEquals(TYPE_NAME, column.getTable());
- assertEquals(255, column.getLength());
- assertEquals(0, column.getPrecision());
- assertEquals(0, column.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormBasicMapping.getName());
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertEquals(FetchType.EAGER, ormBasicMapping.getDefaultFetch());
- assertEquals(true, ormBasicMapping.isDefaultOptional());
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
-
- }
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
-
- public void testBasicMorphToIdMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testBasicMorphToVersionMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((VersionMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testBasicMorphToTransientMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToEmbeddedMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToOneToOneMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToOneToManyMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToManyToOneMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToManyToManyMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("basic", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java
deleted file mode 100644
index c7cc548907..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmCascadeTests extends ContextModelTestCase
-{
- public OrmCascadeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateCascadeAll() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isAll());
- assertNotNull(oneToOne.getCascade());
-
- //set all in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeAll(true);
- assertEquals(true, cascade.isAll());
- assertEquals(true, oneToOne.getCascade().isCascadeAll());
-
- //set all to false in the resource model
- oneToOne.getCascade().setCascadeAll(false);
- assertEquals(false, cascade.isAll());
- assertEquals(false, oneToOne.getCascade().isCascadeAll());
- }
-
- public void testModifyCascadeAll() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
-
- //set all in the context model, verify resource model updated
- cascade.setAll(true);
- assertEquals(true, cascade.isAll());
- assertEquals(true, oneToOne.getCascade().isCascadeAll());
-
- //set all to false in the context model
- cascade.setAll(false);
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isPersist());
- assertNotNull(oneToOne.getCascade());
-
- //set Persist in the resource model, verify context model updated
- oneToOne.getCascade().setCascadePersist(true);
- assertEquals(true, cascade.isPersist());
- assertEquals(true, oneToOne.getCascade().isCascadePersist());
-
- //set Persist to false in the resource model
- oneToOne.getCascade().setCascadePersist(false);
- assertEquals(false, cascade.isPersist());
- assertEquals(false, oneToOne.getCascade().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
-
- //set Persist in the context model, verify resource model updated
- cascade.setPersist(true);
- assertEquals(true, cascade.isPersist());
- assertEquals(true, oneToOne.getCascade().isCascadePersist());
-
- //set Persist to false in the context model
- cascade.setPersist(false);
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeMerge() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isMerge());
- assertNotNull(oneToOne.getCascade());
-
- //set Merge in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeMerge(true);
- assertEquals(true, cascade.isMerge());
- assertEquals(true, oneToOne.getCascade().isCascadeMerge());
-
- //set Merge to false in the resource model
- oneToOne.getCascade().setCascadeMerge(false);
- assertEquals(false, cascade.isMerge());
- assertEquals(false, oneToOne.getCascade().isCascadeMerge());
- }
-
- public void testModifyCascadeMerge() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
-
- //set Merge in the context model, verify resource model updated
- cascade.setMerge(true);
- assertEquals(true, cascade.isMerge());
- assertEquals(true, oneToOne.getCascade().isCascadeMerge());
-
- //set Merge to false in the context model
- cascade.setMerge(false);
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeRemove() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isRemove());
- assertNotNull(oneToOne.getCascade());
-
- //set Remove in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeRemove(true);
- assertEquals(true, cascade.isRemove());
- assertEquals(true, oneToOne.getCascade().isCascadeRemove());
-
- //set Remove to false in the resource model
- oneToOne.getCascade().setCascadeRemove(false);
- assertEquals(false, cascade.isRemove());
- assertEquals(false, oneToOne.getCascade().isCascadeRemove());
- }
-
- public void testModifyCascadeRemove() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
-
- //set Remove in the context model, verify resource model updated
- cascade.setRemove(true);
- assertEquals(true, cascade.isRemove());
- assertEquals(true, oneToOne.getCascade().isCascadeRemove());
-
- //set Remove to false in the context model
- cascade.setRemove(false);
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeRefresh() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isRefresh());
- assertNotNull(oneToOne.getCascade());
-
- //set Refresh in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeRefresh(true);
- assertEquals(true, cascade.isRefresh());
- assertEquals(true, oneToOne.getCascade().isCascadeRefresh());
-
- //set Refresh to false in the resource model
- oneToOne.getCascade().setCascadeRefresh(false);
- assertEquals(false, cascade.isRefresh());
- assertEquals(false, oneToOne.getCascade().isCascadeRefresh());
- }
-
- public void testModifyCascadeRefresh() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
-
- //set Refresh in the context model, verify resource model updated
- cascade.setRefresh(true);
- assertEquals(true, cascade.isRefresh());
- assertEquals(true, oneToOne.getCascade().isCascadeRefresh());
-
- //set Refresh to false in the context model
- cascade.setRefresh(false);
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java
deleted file mode 100644
index 2db4c1b957..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java
+++ /dev/null
@@ -1,835 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmColumnTests extends ContextModelTestCase
-{
- public OrmColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", basic.getColumn().getName());
-
- //set name to null in the resource model
- basic.getColumn().setName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn().getName());
-
- basic.getColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", basic.getColumn().getName());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedName("foo");
- assertEquals("foo", ormColumn.getSpecifiedName());
- assertEquals("foo", basic.getColumn().getName());
-
- //set name to null in the context model
- ormColumn.setSpecifiedName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", basic.getColumn().getColumnDefinition());
-
- //set name to null in the resource model
- basic.getColumn().setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn().getColumnDefinition());
-
- basic.getColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", basic.getColumn().getColumnDefinition());
-
- basic.setColumn(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
- }
-
- public void testModifyColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setColumnDefinition("foo");
- assertEquals("foo", ormColumn.getColumnDefinition());
- assertEquals("foo", basic.getColumn().getColumnDefinition());
-
- //set name to null in the context model
- ormColumn.setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setTable("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedTable());
- assertEquals("FOO", basic.getColumn().getTable());
-
- //set name to null in the resource model
- basic.getColumn().setTable(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn().getTable());
-
- basic.getColumn().setTable("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedTable());
- assertEquals("FOO", basic.getColumn().getTable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedTable("foo");
- assertEquals("foo", ormColumn.getSpecifiedTable());
- assertEquals("foo", basic.getColumn().getTable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedTable(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedNullable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setNullable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, basic.getColumn().getNullable());
-
- //set name to null in the resource model
- basic.getColumn().setNullable(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn().getNullable());
-
- basic.getColumn().setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, basic.getColumn().getNullable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedNullable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, basic.getColumn().getNullable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedNullable(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedUpdatable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setUpdatable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, basic.getColumn().getUpdatable());
-
- //set name to null in the resource model
- basic.getColumn().setUpdatable(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn().getUpdatable());
-
- basic.getColumn().setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, basic.getColumn().getUpdatable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedUpdatable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, basic.getColumn().getUpdatable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedUpdatable(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedInsertable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setInsertable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, basic.getColumn().getInsertable());
-
- //set name to null in the resource model
- basic.getColumn().setInsertable(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn().getInsertable());
-
- basic.getColumn().setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, basic.getColumn().getInsertable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedInsertable() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, basic.getColumn().getInsertable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedInsertable(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedUnique() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setUnique(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, basic.getColumn().getUnique());
-
- //set name to null in the resource model
- basic.getColumn().setUnique(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn().getUnique());
-
- basic.getColumn().setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, basic.getColumn().getUnique());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedUnique() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, basic.getColumn().getUnique());
-
- //set name to null in the context model
- ormColumn.setSpecifiedUnique(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setLength(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(8), basic.getColumn().getLength());
-
- //set name to null in the resource model
- basic.getColumn().setLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getLength());
-
- basic.getColumn().setLength(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(11), basic.getColumn().getLength());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedLength(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(7), basic.getColumn().getLength());
-
- //set name to null in the context model
- ormColumn.setSpecifiedLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedPrecision() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setPrecision(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(8), basic.getColumn().getPrecision());
-
- //set name to null in the resource model
- basic.getColumn().setPrecision(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getPrecision());
-
- basic.getColumn().setPrecision(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(11), basic.getColumn().getPrecision());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedPrecision() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedPrecision(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), basic.getColumn().getPrecision());
-
- //set name to null in the context model
- ormColumn.setSpecifiedPrecision(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedScale() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setScale(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(8), basic.getColumn().getScale());
-
- //set name to null in the resource model
- basic.getColumn().setScale(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getScale());
-
- basic.getColumn().setScale(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(11), basic.getColumn().getScale());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedScale() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedScale(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(7), basic.getColumn().getScale());
-
- //set name to null in the context model
- ormColumn.setSpecifiedScale(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testVirtualColumnDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- Iterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getVirtualAttributes().iterator();
- attributes.next();
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute namePersistentAttribute = attributes.next();
- BasicMapping nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- Column virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(Column.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(Column.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(Column.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- JavaColumn javaColumn = javaBasicMapping.getColumn();
- javaColumn.setSpecifiedName("FOO");
- javaColumn.setSpecifiedTable("FOO_TABLE");
- javaColumn.setColumnDefinition("COLUMN_DEFINITION");
- javaColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaColumn.setSpecifiedNullable(Boolean.FALSE);
- javaColumn.setSpecifiedUnique(Boolean.TRUE);
- javaColumn.setSpecifiedLength(Integer.valueOf(45));
- javaColumn.setSpecifiedPrecision(Integer.valueOf(46));
- javaColumn.setSpecifiedScale(Integer.valueOf(47));
-
- this.getJpaProject().synchronizeContextModel();
-
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("FOO", virtualColumn.getName());
- assertEquals("FOO_TABLE", virtualColumn.getTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertFalse(virtualColumn.isInsertable());
- assertFalse(virtualColumn.isUpdatable());
- assertFalse(virtualColumn.isNullable());
- assertTrue(virtualColumn.isUnique());
- assertEquals(45, virtualColumn.getLength());
- assertEquals(46, virtualColumn.getPrecision());
- assertEquals(47, virtualColumn.getScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(Column.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(Column.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(Column.DEFAULT_SCALE, virtualColumn.getScale());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(Column.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(Column.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(Column.DEFAULT_SCALE, virtualColumn.getScale());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(Column.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(Column.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(Column.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set metadata-complete false, orm.xml virtual column gets setting from java annotation
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("FOO", virtualColumn.getName());
- assertEquals("FOO_TABLE", virtualColumn.getTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertFalse(virtualColumn.isInsertable());
- assertFalse(virtualColumn.isUpdatable());
- assertFalse(virtualColumn.isNullable());
- assertTrue(virtualColumn.isUnique());
- assertEquals(45, virtualColumn.getLength());
- assertEquals(46, virtualColumn.getPrecision());
- assertEquals(47, virtualColumn.getScale());
- }
-
- public void testNullColumnDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute namePersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "name");
-
- OrmBasicMapping nameVirtualMapping = (OrmBasicMapping) namePersistentAttribute.getMapping();
- OrmColumn ormColumn = nameVirtualMapping.getColumn();
-
- //set Column annotation in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- JavaColumn javaColumn = javaBasicMapping.getColumn();
- javaColumn.setSpecifiedName("FOO");
- javaColumn.setSpecifiedTable("FOO_TABLE");
- javaColumn.setColumnDefinition("COLUMN_DEFINITION");
- javaColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaColumn.setSpecifiedNullable(Boolean.FALSE);
- javaColumn.setSpecifiedUnique(Boolean.TRUE);
- javaColumn.setSpecifiedLength(Integer.valueOf(45));
- javaColumn.setSpecifiedPrecision(Integer.valueOf(46));
- javaColumn.setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("name", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualColumnTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute nameOrmAttribute = ormPersistentType.getAttributeNamed("name");
- BasicMapping nameVirtualMapping = (BasicMapping) nameOrmAttribute.getMapping();
- Column virtualColumn = nameVirtualMapping.getColumn();
-
- assertEquals(TYPE_NAME, virtualColumn.getTable());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedTable("JAVA_TABLE");
- nameVirtualMapping = (BasicMapping) nameOrmAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not virtual
- nameOrmAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "name");
- BasicMapping nameSpecifiedMapping = (OrmBasicMapping) nameOrmAttribute.getMapping();
- Column specifiedColumn = nameSpecifiedMapping.getColumn();
- assertNull(specifiedColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE", specifiedColumn.getDefaultTable());
- assertEquals("ORM_TABLE", specifiedColumn.getTable());
- }
-
-//public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", xmlEntity.getTable().getDefaultName());
-//}
-//
-//public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-//}
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java
deleted file mode 100644
index ba52aa35f2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmDiscriminatorColumnTests extends ContextModelTestCase
-{
- public OrmDiscriminatorColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private void createTestAbstractEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn().getName());
-
- entityResource.getDiscriminatorColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedName("foo");
- assertEquals("foo", ormColumn.getSpecifiedName());
- assertEquals("foo", entityResource.getDiscriminatorColumn().getName());
-
- //set name to null in the context model
- ormColumn.setSpecifiedName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
-// public void testUpdateDefaultNameFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.javaEntity().getTable().setSpecifiedName("Foo");
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(null);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.getTable().setSpecifiedName("Bar");
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-// }
-
- public void testUpdateSpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setLength(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(8), entityResource.getDiscriminatorColumn().getLength());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn().getLength());
-
- entityResource.getDiscriminatorColumn().setLength(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(11), entityResource.getDiscriminatorColumn().getLength());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedLength(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(7), entityResource.getDiscriminatorColumn().getLength());
-
- //set name to null in the context model
- ormColumn.setSpecifiedLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- entityResource.getDiscriminatorColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setColumnDefinition("foo");
- assertEquals("foo", ormColumn.getColumnDefinition());
- assertEquals("foo", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- //set name to null in the context model
- ormColumn.setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testUpdateSpecifiedDiscriminatorType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set discriminator type in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.STRING);
- assertEquals(DiscriminatorType.STRING, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.STRING, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- //set discriminator type to null in the resource model
- entityResource.getDiscriminatorColumn().setDiscriminatorType(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- entityResource.getDiscriminatorColumn().setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.CHAR);
- assertEquals(DiscriminatorType.CHAR, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.CHAR, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedDiscriminatorType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set discriminator type in the context model, verify resource model modified
- ormColumn.setSpecifiedDiscriminatorType(DiscriminatorType.STRING);
- assertEquals(DiscriminatorType.STRING, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.STRING, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- //set discriminator type to null in the context model
- ormColumn.setSpecifiedDiscriminatorType(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testDefaultsNoDiscriminatorColumnInJava() throws Exception {
- createTestAbstractEntity();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity abstractEntity = (OrmEntity) persistentType.getMapping();
-
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + "." + "AnnotationTestTypeChild");
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- //test defaults with single-table inheritance, no specified discriminator column set
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set on root
- abstractEntity.getDiscriminatorColumn().setSpecifiedName("DTYPE2");
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(5));
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals("DTYPE2", abstractEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(Integer.valueOf(5), abstractEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(DiscriminatorType.CHAR, abstractEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("DTYPE2", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
-
- //test defaults with table-per-class inheritance, discriminator column does not apply
- abstractEntity.getDiscriminatorColumn().setSpecifiedName(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- abstractEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getInheritanceStrategy());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getDefaultInheritanceStrategy());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- }
-
- public void testDefaultsDiscriminatorColumnInJava() throws Exception {
- createTestAbstractEntity();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity abstractEntity = (OrmEntity) persistentType.getMapping();
-
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + "." + "AnnotationTestTypeChild");
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- ((Entity) persistentType.getJavaPersistentType().getMapping()).getDiscriminatorColumn().setSpecifiedName("FOO");
- ((Entity) persistentType.getJavaPersistentType().getMapping()).getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(5));
- ((Entity) persistentType.getJavaPersistentType().getMapping()).getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- //test defaults with single-table inheritance, specified discriminator column set in java
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals("FOO", abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("FOO", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set in java, metadata-complete true
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set in orm
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- abstractEntity.getDiscriminatorColumn().setSpecifiedName("BAR");
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(6));
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER);
-
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("BAR", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(6, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.INTEGER, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java
deleted file mode 100644
index af963c394f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEmbeddableTests extends ContextModelTestCase
-{
- public OrmEmbeddableTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals("model.Foo", embeddableResource.getClassName());
-
- //set class in the resource model, verify context model updated
- embeddableResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormEmbeddable.getClass_());
- assertEquals("com.Bar", embeddableResource.getClassName());
-
- //set class to null in the resource model
- embeddableResource.setClassName(null);
- assertNull(ormEmbeddable.getClass_());
- assertNull(embeddableResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals("model.Foo", embeddableResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormEmbeddable.setClass("com.Bar");
- assertEquals("com.Bar", ormEmbeddable.getClass_());
- assertEquals("com.Bar", embeddableResource.getClassName());
-
- //set class to null in the context model
- ormEmbeddable.setClass(null);
- assertNull(ormEmbeddable.getClass_());
- assertNull(embeddableResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
-
- //set access in the resource model, verify context model updated
- embeddableResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, embeddableResource.getAccess());
-
- //set access to null in the resource model
- embeddableResource.setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddableResource.getAccess());
-
- //set access to null in the context model
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
- }
- //TODO test default access from
- //underlying java
- //persistence-unit-defaults
- //entity-mappings
- //with xml-mapping-metadata-complete set
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(embeddableResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- embeddableResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, embeddableResource.getMetadataComplete());
-
- //set access to false in the resource model
- embeddableResource.setMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, embeddableResource.getMetadataComplete());
-
- embeddableResource.setMetadataComplete(null);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(embeddableResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormEmbeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, embeddableResource.getMetadataComplete());
-
- //set access to null in the context model
- ormEmbeddable.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, embeddableResource.getMetadataComplete());
-
- ormEmbeddable.setSpecifiedMetadataComplete(null);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isOverrideMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEmbeddable.isOverrideMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isOverrideMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEmbeddable.isMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormEmbeddable.isMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testMakeEmbeddableEntity() throws Exception {
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
- }
-
- //test with 2 Embeddables, make the second one an Entity so it has to move to the front of the list
- public void testMakeEmbeddableEntity2() throws Exception {
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testMakeEmbeddableMappedSuperclass() throws Exception {
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
- }
-
- //test with 2 Embeddables, make the second one a MappedSuperclass so it has to move to the front of the list
- public void testMakeEmbeddableMappedSuperclass2() throws Exception {
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java
deleted file mode 100644
index 1b2238fc02..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java
+++ /dev/null
@@ -1,923 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEmbeddedIdMappingTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public OrmEmbeddedIdMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @EmbeddedId");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// assertEquals("embeddedIdMapping", xmlEmbeddedIdMapping.getName());
-// assertEquals("embeddedIdMapping", embeddedIdResource.getName());
-//
-// //set name in the resource model, verify context model updated
-// embeddedIdResource.setName("newName");
-// assertEquals("newName", xmlEmbeddedIdMapping.getName());
-// assertEquals("newName", embeddedIdResource.getName());
-//
-// //set name to null in the resource model
-// embeddedIdResource.setName(null);
-// assertNull(xmlEmbeddedIdMapping.getName());
-// assertNull(embeddedIdResource.getName());
-// }
-//
-// public void testModifyName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// assertEquals("embeddedIdMapping", xmlEmbeddedIdMapping.getName());
-// assertEquals("embeddedIdMapping", embeddedIdResource.getName());
-//
-// //set name in the context model, verify resource model updated
-// xmlEmbeddedIdMapping.setName("newName");
-// assertEquals("newName", xmlEmbeddedIdMapping.getName());
-// assertEquals("newName", embeddedIdResource.getName());
-//
-// //set name to null in the context model
-// xmlEmbeddedIdMapping.setName(null);
-// assertNull(xmlEmbeddedIdMapping.getName());
-// assertNull(embeddedIdResource.getName());
-// }
-//
-// public void testAddSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// XmlAttributeOverride attributeOverride = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0);
-// ormResource().save(null);
-// attributeOverride.setName("FOO");
-// ormResource().save(null);
-//
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(0).getName());
-//
-// XmlAttributeOverride attributeOverride2 = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0);
-// ormResource().save(null);
-// attributeOverride2.setName("BAR");
-// ormResource().save(null);
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(1).getName());
-//
-// XmlAttributeOverride attributeOverride3 = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1);
-// ormResource().save(null);
-// attributeOverride3.setName("BAZ");
-// ormResource().save(null);
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-//
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals(attributeOverride2, attributeOverrides.next());
-// assertEquals(attributeOverride3, attributeOverrides.next());
-// assertEquals(attributeOverride, attributeOverrides.next());
-//
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(2, embeddedIdResource.getAttributeOverrides().size());
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(1, embeddedIdResource.getAttributeOverrides().size());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(0, embeddedIdResource.getAttributeOverrides().size());
-// }
-//
-// public void testMoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-//
-//
-// xmlEmbeddedIdMapping.moveSpecifiedAttributeOverride(2, 0);
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-//
-//
-// xmlEmbeddedIdMapping.moveSpecifiedAttributeOverride(0, 1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-//
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-// }
-//
-// public void testUpdateAttributeOverrides() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverride());
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverride());
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverride());
-//
-// embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
-// embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
-// embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-//
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().move(2, 0);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().move(0, 1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(0);
-// assertFalse(xmlEmbeddedIdMapping.specifiedAttributeOverrides().hasNext());
-// }
-
- public void testEmbeddedIdMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToEmbeddedMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedMapping) ormPersistentAttribute.getMapping()).getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedIdMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId");
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("embeddedId", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the resource model, verify context model updated
- embeddedResource.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the resource model
- embeddedResource.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the context model, verify resource model updated
- ormEmbeddedMapping.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the context model
- ormEmbeddedMapping.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedIdMapping.getAttributeOverrideContainer();
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedIdMapping.getAttributeOverrideContainer();
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedIdMapping.getAttributeOverrideContainer();
-
- assertEquals("foo", ormEmbeddedIdMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType embeddableAddressType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
-
- //embedded mapping is virtual, attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("address");
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- AttributeOverride specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", specifiedAttributeOverride.getName());
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
-
- JavaEmbeddedIdMapping javaEmbeddedIdMapping = (JavaEmbeddedIdMapping) ormPersistentAttribute.resolveJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaEmbeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) embeddableAddressType.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", specifiedAttributeOverride.getName());
- assertEquals("FOO_COLUMN", specifiedAttributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(false, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(5, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(6, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(7, specifiedAttributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualAttributeOverride.getColumn().getSpecifiedName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").convertToSpecified();
- OrmEmbeddedIdMapping ormMapping = (OrmEmbeddedIdMapping) persistentType.getAttributeNamed("address").getMapping();
- OrmAttributeOverrideContainer ormOverrideContainer = ormMapping.getAttributeOverrideContainer();
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(4, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, ormOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> ormOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride ormOverride = ormOverrides.next();
- assertEquals("id", ormOverride.getName());
- ormOverride = ormOverrides.next();
- assertEquals("city", ormOverride.getName());
- assertEquals("city", ormOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, ormOverride.getColumn().getDefaultTable());
- assertEquals(null, ormOverride.getColumn().getColumnDefinition());
- assertEquals(true, ormOverride.getColumn().isInsertable());
- assertEquals(true, ormOverride.getColumn().isUpdatable());
- assertEquals(false, ormOverride.getColumn().isUnique());
- assertEquals(true, ormOverride.getColumn().isNullable());
- assertEquals(255, ormOverride.getColumn().getLength());
- assertEquals(0, ormOverride.getColumn().getPrecision());
- assertEquals(0, ormOverride.getColumn().getScale());
- ormOverride = ormOverrides.next();
- assertEquals("state", ormOverride.getName());
- assertEquals("MY_STATE_COLUMN", ormOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, ormOverride.getColumn().getDefaultTable());
- ormOverride = ormOverrides.next();
- assertEquals("zip", ormOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- ormOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(1, ormOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals("id", ormOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- ormOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- ormOverride = ormOverrides.next();
- assertEquals("city", ormOverride.getName());
- ormOverride = ormOverrides.next();
- assertEquals("state", ormOverride.getName());
- ormOverride = ormOverrides.next();
- assertEquals("zip", ormOverride.getName());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals("address", embeddedIdMapping.getName());
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- AttributeOverride specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getSpecifiedName());
-
- this.ormXmlResource.saveIfNecessary();
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- JavaVirtualColumn virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("id", virtualColumn.getName());
- assertNull(virtualColumn.getSpecifiedName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("A_STATE", virtualColumn.getName());
- assertEquals("A_STATE", virtualColumn.getSpecifiedName());
- assertEquals("A_STATE", virtualColumn.getDefaultName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("zip", virtualColumn.getName());
- assertNull(virtualColumn.getSpecifiedName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertTrue(ormPersistentAttribute.isVirtual());
-
- //will be an OrmEmbeddedMapping instead of OrmEmbeddedIdMapping since that is the default
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", embeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedIdMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedIdMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedIdMapping.getName());
-
- assertEquals(0, ormEmbeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedIdMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedIdMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java
deleted file mode 100644
index f5bcd81c2f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java
+++ /dev/null
@@ -1,943 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEmbeddedMappingTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public OrmEmbeddedMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityEmbeddedMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress2() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the resource model, verify context model updated
- embeddedResource.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the resource model
- embeddedResource.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the context model, verify resource model updated
- ormEmbeddedMapping.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the context model
- ormEmbeddedMapping.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
-// public void testAddSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
-// OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-// XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-//
-// OrmAttributeOverride attributeOverride = ormEmbeddedMapping.addSpecifiedAttributeOverride(0);
-// attributeOverride.setName("FOO");
-//
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(0).getName());
-//
-// OrmAttributeOverride attributeOverride2 = ormEmbeddedMapping.addSpecifiedAttributeOverride(0);
-// attributeOverride2.setName("BAR");
-//
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(1).getName());
-//
-// OrmAttributeOverride attributeOverride3 = ormEmbeddedMapping.addSpecifiedAttributeOverride(1);
-// attributeOverride3.setName("BAZ");
-//
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-//
-// ListIterator<OrmAttributeOverride> attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-// assertEquals(attributeOverride2, attributeOverrides.next());
-// assertEquals(attributeOverride3, attributeOverrides.next());
-// assertEquals(attributeOverride, attributeOverrides.next());
-//
-// attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
-// OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-// XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-//
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedResource.getAttributeOverrides().size());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(2, embeddedResource.getAttributeOverrides().size());
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(1, embeddedResource.getAttributeOverrides().size());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(0, embeddedResource.getAttributeOverrides().size());
-// }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
-
- assertEquals("foo", ormEmbeddedMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
-
- //embedded mapping is virtual, Java attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("address");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- AttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- JavaEmbeddedMapping javaEmbeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType2.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- embeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getMapping();
- attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").convertToSpecified();
- OrmEmbeddedMapping ormMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping();
- OrmAttributeOverrideContainer ormOverrideContainer = ormMapping.getAttributeOverrideContainer();
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(4, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, ormOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> ormVirtualAttributeOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("id", ormVirtualOverride.getName());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("city", ormVirtualOverride.getName());
- assertEquals("city", ormVirtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME, ormVirtualOverride.getColumn().getTable());
- assertEquals(null, ormVirtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, ormVirtualOverride.getColumn().isInsertable());
- assertEquals(true, ormVirtualOverride.getColumn().isUpdatable());
- assertEquals(false, ormVirtualOverride.getColumn().isUnique());
- assertEquals(true, ormVirtualOverride.getColumn().isNullable());
- assertEquals(255, ormVirtualOverride.getColumn().getLength());
- assertEquals(0, ormVirtualOverride.getColumn().getPrecision());
- assertEquals(0, ormVirtualOverride.getColumn().getScale());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("state", ormVirtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", ormVirtualOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, ormVirtualOverride.getColumn().getDefaultTable());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("zip", ormVirtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- ormOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(1, ormOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals("id", ormOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- ormVirtualAttributeOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("city", ormVirtualOverride.getName());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("state", ormVirtualOverride.getName());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("zip", ormVirtualOverride.getName());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals("address", embeddedMapping.getName());
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- JavaAttributeOverride specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getSpecifiedName());
-
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- VirtualColumn virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("id", virtualColumn.getName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("A_STATE", virtualColumn.getName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("zip", virtualColumn.getName());
-
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", embeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedMapping.getName());
-
- assertEquals(0, ormEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-
- public void testEmbeddedMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedIdMapping) ormPersistentAttribute.getMapping()).getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- //1.0 projects do not support dot-notation, this tests to make sure that support does not exist
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress2();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- customerPersistentType.getAttributeNamed("address").convertToSpecified();
- OrmEmbeddedMapping embeddedMapping = (OrmEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
- addressPersistentType.getAttributeNamed("zipCode").convertToSpecified();
- OrmEmbeddedMapping nestedEmbeddedMapping = (OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- OrmAttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- zipCodePersistentType.getAttributeNamed("plusfour").convertToSpecified();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify there is no attribute override named zipCode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java
deleted file mode 100644
index d62222a79a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java
+++ /dev/null
@@ -1,2803 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualSecondaryTable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEntityTests extends ContextModelTestCase
-{
- protected static final String CHILD_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_CHILD_TYPE_NAME = PACKAGE_NAME + "." + CHILD_TYPE_NAME;
-
-
- public OrmEntityTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityDefaultFieldAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityFieldAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityPropertyAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append(CHILD_TYPE_NAME).append(" ");
- sb.append("extends ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestSubTypeUnmapped() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(CHILD_TYPE_NAME).append(" ");
- sb.append("extends ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- JPA.BASIC,
- JPA.VERSION,
- JPA.TRANSIENT,
- JPA.EMBEDDED,
- JPA.EMBEDDED_ID,
- JPA.ONE_TO_ONE,
- JPA.ONE_TO_MANY,
- JPA.MANY_TO_ONE,
- JPA.MANY_TO_MANY,
- JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @Basic");
- sb.append(CR);
- sb.append(" private int basic;").append(CR);
- sb.append(CR);
- sb.append(" @Version");
- sb.append(CR);
- sb.append(" private int version;").append(CR);
- sb.append(CR);
- sb.append(" @Transient");
- sb.append(CR);
- sb.append(" private int transient;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" private int embedded;").append(CR);
- sb.append(CR);
- sb.append(" @EmbeddedId");
- sb.append(CR);
- sb.append(" private int embeddedId;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private " + CHILD_TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int oneToMany;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int manyToOne;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int manyToMany;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestAbstractType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
-
- //set name in the resource model, verify context model updated
- entityResource.setName("foo");
- assertEquals("foo", ormEntity.getSpecifiedName());
- assertEquals("foo", entityResource.getName());
-
- //set name to null in the resource model
- entityResource.setName(null);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
-
- //set name in the context model, verify resource model modified
- ormEntity.setSpecifiedName("foo");
- assertEquals("foo", ormEntity.getSpecifiedName());
- assertEquals("foo", entityResource.getName());
-
- //set name to null in the context model
- ormEntity.setSpecifiedName(null);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
- }
-
- public void testUpdateDefaultName() throws Exception {
- createTestEntityFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- ormEntity.getJavaTypeMapping().setSpecifiedName("Foo");
- //xml default entity name comes from java
- assertEquals("Foo", ormEntity.getDefaultName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("Bar", ormEntity.getDefaultName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertNull(ormEntity.getDefaultName());
-
- entityResource.setClassName(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("Foo", ormEntity.getDefaultName());
- entityResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- ormEntity.getJavaTypeMapping().setSpecifiedName("Foo1");
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- entityResource.setMetadataComplete(null);
- assertEquals("Foo1", ormEntity.getDefaultName());
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals("Foo", ormEntity.getName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("Bar", ormEntity.getName());
-
- entityResource.setName("Baz");
- assertEquals("Baz", ormEntity.getName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertEquals("Baz", ormEntity.getName());
-
- entityResource.setName(null);
- assertNull(ormEntity.getName());
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals("model.Foo", entityResource.getClassName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormEntity.getClass_());
- assertEquals("com.Bar", entityResource.getClassName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertNull(ormEntity.getClass_());
- assertNull(entityResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals("model.Foo", entityResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormEntity.setClass("com.Bar");
- assertEquals("com.Bar", ormEntity.getClass_());
- assertEquals("com.Bar", entityResource.getClassName());
-
- //set class to null in the context model
- ormEntity.setClass(null);
- assertNull(ormEntity.getClass_());
- assertNull(entityResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- //set access in the resource model, verify context model updated
- entityResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, entityResource.getAccess());
-
- //set access to null in the resource model
- entityResource.setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entityResource.getAccess());
-
- //set access to null in the context model
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testUpdateDefaultAccessFromPersistenceUnitDefaults() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- assertNull(entityResource.getAccess());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testUpdateDefaultAccessFromJava() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- //java has no annotations, defaultAccess in xml is FIELD anyway
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- //entityMappings access wins over persistence-unit-defaults access
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().setSpecifiedAccess(null);
- //persistence-unit-defaults access used now
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- //java has annotations on fields now, that should win in all cases
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.PROPERTY);
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessFromJavaFieldAccess() throws Exception {
- createTestEntityFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessFromJavaPropertyAccess() throws Exception {
- createTestEntityPropertyAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessNoUnderlyingJava() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- entityResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, entityResource.getMetadataComplete());
-
- //set access to false in the resource model
- entityResource.setMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, entityResource.getMetadataComplete());
-
- entityResource.setMetadataComplete(null);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertTrue(ormEntity.getSpecifiedMetadataComplete().booleanValue());
- assertTrue(entityResource.getMetadataComplete().booleanValue());
-
- //set access to null in the context model
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertFalse(ormEntity.getSpecifiedMetadataComplete().booleanValue());
- assertFalse(entityResource.getMetadataComplete().booleanValue());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isOverrideMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEntity.isOverrideMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isOverrideMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEntity.getSpecifiedMetadataComplete());
- assertTrue(ormEntity.isOverrideMetadataComplete());
- assertTrue(ormEntity.isMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEntity.isMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormEntity.isMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
-
- public void testUpdateInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set inheritance strategy in the resource model, verify context model updated
- entityResource.setInheritance(OrmFactory.eINSTANCE.createInheritance());
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, ormEntity.getInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.TABLE_PER_CLASS, entityResource.getInheritance().getStrategy());
- }
-
- public void testUpdateDefaultInheritanceStrategyFromJava() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- //no inheritance strategy specified in java so single-table is default
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.getJavaTypeMapping().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- //inheritance tag exists in xml, so it overrides anything in java
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedInheritanceStrategy(null);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //this setting overrides the false meta-data complete found on ormEntity
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
- }
-
- public void testUpdateDefaultInheritanceStrategyFromParent() throws Exception {
- createTestEntityDefaultFieldAccess();
- createTestSubType();
-
- OrmPersistentType superPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType subPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) superPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) subPersistentType.getMapping();
-
- assertEquals(parentXmlEntity, childXmlEntity.getParentEntity());
- assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy());
-
- //change root inheritance strategy, verify default is changed for child entity
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, childXmlEntity.getDefaultInheritanceStrategy());
- assertNull(childXmlEntity.getSpecifiedInheritanceStrategy());
-
- //set specified inheritance strategy in java and verify defaults in xml are correct
- parentXmlEntity.setSpecifiedInheritanceStrategy(null);
- parentXmlEntity.getJavaTypeMapping().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.JOINED, childXmlEntity.getDefaultInheritanceStrategy());
- assertNull(parentXmlEntity.getSpecifiedInheritanceStrategy());
- assertNull(childXmlEntity.getSpecifiedInheritanceStrategy());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy());
- }
-
- public void testUpdateSpecifiedInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set strategy in the resource model, verify context model updated
- entityResource.setInheritance(OrmFactory.eINSTANCE.createInheritance());
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.JOINED, entityResource.getInheritance().getStrategy());
-
- //set strategy to null in the resource model
- entityResource.getInheritance().setStrategy(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance().getStrategy());
-
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.SINGLE_TABLE);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.SINGLE_TABLE, entityResource.getInheritance().getStrategy());
-
- entityResource.setInheritance(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
- }
-
- public void testModifySpecifiedInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set strategy in the context model, verify resource model modified
- ormEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(InheritanceType.TABLE_PER_CLASS, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.TABLE_PER_CLASS, entityResource.getInheritance().getStrategy());
-
- //set strategy to null in the context model
- ormEntity.setSpecifiedInheritanceStrategy(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
- }
-
- public void testAddSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedName("FOO");
-
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getName());
-
- OrmSecondaryTable secondaryTable2 = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable2.setSpecifiedName("BAR");
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(1).getName());
-
- OrmSecondaryTable secondaryTable3 = ormEntity.addSpecifiedSecondaryTable(1);
- secondaryTable3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
-
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals(secondaryTable2, secondaryTables.next());
- assertEquals(secondaryTable3, secondaryTables.next());
- assertEquals(secondaryTable, secondaryTables.next());
-
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- }
-
- public void testRemoveSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getSecondaryTables().size());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(2, entityResource.getSecondaryTables().size());
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(1, entityResource.getSecondaryTables().size());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(0).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testMoveSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getSecondaryTables().size());
-
-
- ormEntity.moveSpecifiedSecondaryTable(2, 0);
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
-
-
- ormEntity.moveSpecifiedSecondaryTable(0, 1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
-
- assertEquals("BAZ", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAR", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
- }
-
- public void testUpdateSecondaryTables() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
-
- entityResource.getSecondaryTables().get(0).setName("FOO");
- entityResource.getSecondaryTables().get(1).setName("BAR");
- entityResource.getSecondaryTables().get(2).setName("BAZ");
-
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().move(2, 0);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().move(0, 1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- }
-
- public void testVirtualSecondaryTables() throws Exception {
- createTestEntityFieldAccess();
- createTestSubType();
-
- OrmPersistentType superPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType subPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentOrmEntity = (OrmEntity) superPersistentType.getMapping();
- OrmEntity childOrmEntity = (OrmEntity) subPersistentType.getMapping();
- JavaEntity javaEntity = childOrmEntity.getJavaTypeMapping();
-
- JavaSecondaryTable javaSecondaryTableFoo = javaEntity.addSpecifiedSecondaryTable(0);
- javaSecondaryTableFoo.setSpecifiedName("FOO");
- OrmVirtualSecondaryTable virtualSecondaryTableFoo = childOrmEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("FOO", childOrmEntity.getSecondaryTables().iterator().next().getName());
- assertEquals("FOO", virtualSecondaryTableFoo.getName());
- assertEquals(0, virtualSecondaryTableFoo.getSpecifiedPrimaryKeyJoinColumnsSize());
- assertEquals("id", virtualSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultName());
- assertEquals("id", virtualSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultReferencedColumnName());
-
- assertEquals(0, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getSecondaryTablesSize());
-
- javaEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- ListIterator<OrmVirtualSecondaryTable> virtualSecondaryTables = childOrmEntity.getVirtualSecondaryTables().iterator();
- ListIterator<ReadOnlySecondaryTable> secondaryTables = childOrmEntity.getSecondaryTables().iterator();
- assertEquals("BAR", virtualSecondaryTables.next().getName());
- assertEquals("FOO", virtualSecondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals(0, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSecondaryTablesSize());
-
- childOrmEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(0, childOrmEntity.getVirtualSecondaryTablesSize());
-
- childOrmEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
-
-
- childOrmEntity.setSecondaryTablesAreDefinedInXml(true);
- assertEquals(0, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSecondaryTablesSize());
- ListIterator<OrmSecondaryTable> specifiedSecondaryTables = childOrmEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", specifiedSecondaryTables.next().getName());
- OrmSecondaryTable specifiedSecondaryTableFoo = specifiedSecondaryTables.next();
- assertEquals("FOO", specifiedSecondaryTableFoo.getName());
- assertEquals(0, specifiedSecondaryTableFoo.getSpecifiedPrimaryKeyJoinColumnsSize());
- assertEquals("id", specifiedSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultName());
- assertEquals("id", specifiedSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultReferencedColumnName());
-
-
- childOrmEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getSecondaryTablesSize());
- assertEquals("FOO", childOrmEntity.getSpecifiedSecondaryTables().iterator().next().getName());
-
-
- childOrmEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSecondaryTablesSize());
- virtualSecondaryTables = childOrmEntity.getVirtualSecondaryTables().iterator();
- assertEquals("BAR", virtualSecondaryTables.next().getName());
- assertEquals("FOO", virtualSecondaryTables.next().getName());
-
-
- //add a specified secondary table to the parent, this will not affect virtual secondaryTables in child
- parentOrmEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("PARENT_TABLE");
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
- }
-
- public void testAssociatedTables() throws Exception {
- createTestEntityFieldAccess();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertEquals(1, CollectionTools.size(entity.getAssociatedTables()));
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- assertEquals(2, CollectionTools.size(entity.getAssociatedTables()));
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- assertEquals(3, CollectionTools.size(entity.getAssociatedTables()));
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- // TODO
- }
-
- public void testTableNameIsInvalid() throws Exception {
- // TODO
- }
-
- public void testMakeEntityEmbeddable() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
- }
-
- //TODO test that attribute mappings are not removed when changing type mapping.
- public void testMakeEntityEmbeddable2() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-// entityPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
-
- entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-// assertEquals("basicMapping", embeddable.getAttributes().getBasics().get(0).getName());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
-// assertEquals("basicMapping", ormEmbeddable.persistentType().attributes().next().getName());
- }
-
- public void testMakeEntityMappedSuperclass() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
- }
-
- public void testMakeEntityMappedSuperclass2() throws Exception {
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
- }
-
-
- public void testAddSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- ormEntity.getGeneratorContainer().addSequenceGenerator();
-
- assertNotNull(entityResource.getSequenceGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- ormEntity.getGeneratorContainer().addSequenceGenerator();
- assertNotNull(entityResource.getSequenceGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
-
- ormEntity.getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGenerator());
-
- assertNotNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(entityResource.getSequenceGenerator());
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- ormEntity.getGeneratorContainer().getSequenceGenerator().setName("foo");
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setSequenceGenerator(null);
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- ormEntity.getGeneratorContainer().addTableGenerator();
-
- assertNotNull(entityResource.getTableGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- ormEntity.getGeneratorContainer().addTableGenerator();
- assertNotNull(entityResource.getTableGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getTableGenerator());
-
- ormEntity.getGeneratorContainer().removeTableGenerator();
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGenerator());
-
- assertNotNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNotNull(entityResource.getTableGenerator());
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- ormEntity.getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setTableGenerator(null);
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testUpdateDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNotNull(ormEntity.getDiscriminatorColumn());
-
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setName("FOO");
-
- assertEquals("FOO", ormEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- entityResource.getDiscriminatorColumn().setName(null);
-
- assertNull(ormEntity.getDiscriminatorColumn().getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn().getName());
-
- entityResource.setDiscriminatorColumn(null);
-
- assertNotNull(ormEntity.getDiscriminatorColumn());
- }
-
- public void testUpdateDiscriminatorValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
-
- entityResource.setDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getSpecifiedDiscriminatorValue());
- assertEquals("FOO", entityResource.getDiscriminatorValue());
-
- entityResource.setDiscriminatorValue(null);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
- }
-
- public void testModifyDiscriminatorValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
-
- ormEntity.setSpecifiedDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getSpecifiedDiscriminatorValue());
- assertEquals("FOO", entityResource.getDiscriminatorValue());
-
- ormEntity.setSpecifiedDiscriminatorValue(null);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
- }
-
- public void testGetDefaultDiscriminatorValue() throws Exception {
- createTestEntityFieldAccess();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- JavaEntity javaEntity = (JavaEntity) persistentType.getJavaPersistentType().getMapping();
- assertEquals(null, ormEntity.getDefaultDiscriminatorValue());
-
- createTestSubType();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- assertEquals(ormEntity.getName(), ormEntity.getDefaultDiscriminatorValue());
-
- javaEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER);
- assertNull(ormEntity.getDefaultDiscriminatorValue());
-
- javaEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- javaEntity.setSpecifiedDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getDefaultDiscriminatorValue());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(ormEntity.getName(), ormEntity.getDefaultDiscriminatorValue());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn2 = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn3 = ormEntity.addSpecifiedPrimaryKeyJoinColumn(1);
- primaryKeyJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals(primaryKeyJoinColumn2, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn3, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn, primaryKeyJoinColumns.next());
-
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(2, entityResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(1, entityResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(0, entityResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size());
-
-
- ormEntity.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- ormEntity.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
-
- entityResource.getPrimaryKeyJoinColumns().get(0).setName("FOO");
- entityResource.getPrimaryKeyJoinColumns().get(1).setName("BAR");
- entityResource.getPrimaryKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().move(2, 0);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().move(0, 1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- }
-
- public void testDefaultPrimaryKeyJoinColumns() throws Exception {
- createTestType();
- createTestSubTypeUnmapped();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- persistentType.getAttributeNamed("id").convertToSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- ((OrmEntity) persistentType.getMapping()).setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
- OrmPrimaryKeyJoinColumn specifiedPkJoinColumn = childEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- specifiedPkJoinColumn.setSpecifiedName("FOO");
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("BAR");
-
- assertFalse(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
-
- //remove the pkJoinColumn from the context mode, verify context model has a default pkJoinColumn
- childEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- specifiedPkJoinColumn = childEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- specifiedPkJoinColumn.setSpecifiedName("FOO");
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("BAR");
- assertFalse(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- //now remove the pkJoinColumn from the resource model, verify context model updates and has a default pkJoinColumn
- childEntity.getXmlTypeMapping().getPrimaryKeyJoinColumns().remove(0);
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
- }
-
- public void testDefaultPrimaryKeyJoinColumnsFromJava() throws Exception {
- createTestEntityFieldAccess();
- createTestSubType();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
-
-
- ((JavaEntity) persistentType.getJavaPersistentType().getMapping()).setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
- JavaEntity javaEntity = (JavaEntity) childPersistentType.getJavaPersistentType().getMapping();
- JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn = javaEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- javaPrimaryKeyJoinColumn.setSpecifiedName("FOO");
- javaPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName("BAR");
-
- JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn2 = javaEntity.addSpecifiedPrimaryKeyJoinColumn(1);
- javaPrimaryKeyJoinColumn2.setSpecifiedName("FOO2");
- javaPrimaryKeyJoinColumn2.setSpecifiedReferencedColumnName("BAR2");
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- ListIterator<ReadOnlyPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns = childEntity.getDefaultPrimaryKeyJoinColumns().iterator();
- ReadOnlyPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("FOO", defaultPrimaryKeyJoinColumn.getName());
- assertEquals("BAR", defaultPrimaryKeyJoinColumn.getReferencedColumnName());
-
- defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("FOO2", defaultPrimaryKeyJoinColumn.getName());
- assertEquals("BAR2", defaultPrimaryKeyJoinColumn.getReferencedColumnName());
- assertFalse(defaultPrimaryKeyJoinColumns.hasNext());
-
- childEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- defaultPrimaryKeyJoinColumns = childEntity.getDefaultPrimaryKeyJoinColumns().iterator();
- defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("id", defaultPrimaryKeyJoinColumn.getDefaultName());
- assertEquals("id", defaultPrimaryKeyJoinColumn.getDefaultReferencedColumnName());
-
- assertFalse(defaultPrimaryKeyJoinColumns.hasNext());
-
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAttributeOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
- assertEquals("name", virtualOverride.getColumn().getName());
- assertEquals(CHILD_TYPE_NAME, virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
-
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- entity.setSpecifiedMetadataComplete(Boolean.FALSE);
- entity.getJavaTypeMapping().getAttributeOverrideContainer().getVirtualOverrides().iterator().next().convertToSpecified();
- JavaColumn javaColumn = entity.getJavaTypeMapping().getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
- javaColumn.setSpecifiedName("FOO");
- javaColumn.setSpecifiedTable("BAR");
- javaColumn.setColumnDefinition("COLUMN_DEF");
- javaColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaColumn.setSpecifiedUnique(Boolean.TRUE);
- javaColumn.setSpecifiedNullable(Boolean.FALSE);
- javaColumn.setSpecifiedLength(Integer.valueOf(7));
- javaColumn.setSpecifiedPrecision(Integer.valueOf(8));
- javaColumn.setSpecifiedScale(Integer.valueOf(9));
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualOverride.getName());
- assertEquals("FOO", virtualOverride.getColumn().getSpecifiedName());
- assertEquals("FOO", virtualOverride.getColumn().getDefaultName());
- assertEquals("BAR", virtualOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, virtualOverride.getColumn().getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedNullable());
- assertEquals(Integer.valueOf(7), virtualOverride.getColumn().getSpecifiedLength());
- assertEquals(Integer.valueOf(8), virtualOverride.getColumn().getSpecifiedPrecision());
- assertEquals(Integer.valueOf(9), virtualOverride.getColumn().getSpecifiedScale());
-
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- assertNull(virtualOverride.getColumn().getSpecifiedName());
- assertEquals("basic", virtualOverride.getColumn().getDefaultName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
-
- persistentType2.getAttributeNamed("basic").convertToSpecified();
- OrmBasicMapping basicMapping = (OrmBasicMapping) persistentType2.getAttributeNamed("basic").getMapping();
- basicMapping.getColumn().setSpecifiedName("MY_NAME");
- basicMapping.getColumn().setSpecifiedTable("BAR");
- basicMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- basicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
-
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualOverride.getName());
- assertEquals("FOO", virtualOverride.getColumn().getSpecifiedName());//TODO specified or default?
- assertEquals("BAR", virtualOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, virtualOverride.getColumn().getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedNullable());
- assertEquals(Integer.valueOf(7), virtualOverride.getColumn().getSpecifiedLength());
- assertEquals(Integer.valueOf(8), virtualOverride.getColumn().getSpecifiedPrecision());
- assertEquals(Integer.valueOf(9), virtualOverride.getColumn().getSpecifiedScale());
-
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- assertEquals("MY_NAME", virtualOverride.getColumn().getSpecifiedName());
- assertEquals("BAR", virtualOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualOverride.getColumn().isInsertable());
- assertEquals(false, virtualOverride.getColumn().isUpdatable());
- assertEquals(true, virtualOverride.getColumn().isUnique());
- assertEquals(false, virtualOverride.getColumn().isNullable());
- assertEquals(5, virtualOverride.getColumn().getLength());
- assertEquals(6, virtualOverride.getColumn().getPrecision());
- assertEquals(7, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- }
-
- public void testVirtualAttributeOverridesNoJavaEntity() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("basic", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("version", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- }
-
- public void testAttributeOverrideColumnDefaults() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- OrmAttributeOverride attributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals(CHILD_TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
-
- ((JavaEntity) persistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals("FOO", attributeOverride.getColumn().getDefaultTable());
-
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals(CHILD_TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
-
- entity.setSpecifiedMetadataComplete(Boolean.FALSE);
- entity.getTable().setSpecifiedName("BAR");
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
- }
-
- public void testAttributeOverrideColumnDefaultsNoJavaAnnotations() throws Exception {
- createTestType();
- createTestSubTypeUnmapped();
- OrmPersistentType childType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmEntity childEntity = (OrmEntity) childType.getMapping();
- OrmAttributeOverrideContainer childOverrideContainer = childEntity.getAttributeOverrideContainer();
- OrmReadOnlyAttributeOverride attributeOverride = childOverrideContainer.getVirtualOverrides().iterator().next();
- ((OrmReadOnlyPersistentAttribute) childType.getSuperPersistentType().getAttributeNamed("id")).convertToSpecified();
- BasicMapping basicMapping = (BasicMapping) ((OrmReadOnlyPersistentAttribute) childType.getSuperPersistentType().getAttributeNamed("id")).getMapping();
- basicMapping.getColumn().setSpecifiedName("MY_COLUMN");
- basicMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals("MY_COLUMN", attributeOverride.getColumn().getDefaultName());
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- attributeOverride = childOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("MY_COLUMN", attributeOverride.getColumn().getName());
- assertEquals("BAR", attributeOverride.getColumn().getTable());
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = (Entity) persistentType.getMapping();
- Iterator<String> overridableAttributes = persistentType.getMapping().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = (Entity) persistentType.getMapping();
- Iterator<String> overridableAttributeNames = persistentType.getMapping().getOverridableAttributeNames().iterator();
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributes.next());
- assertEquals("basic", overridableAttributes.next());
- assertEquals("version", overridableAttributes.next());
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmEntity abstractEntity = (OrmEntity) abstractPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testVirtualAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmEntity concreteEntity = (OrmEntity) concretePersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = concreteEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- OrmVirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(CHILD_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- abstractPersistentType.getAttributeNamed("id").convertToSpecified();
- BasicMapping idMapping = (OrmBasicMapping) abstractPersistentType.getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(CHILD_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
-
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- assertEquals(3, entityResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
-
- assertEquals("BAR", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("BAZ", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAssociationOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
-
- assertEquals("BAZ", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("BAR", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAssociationOverrides().get(2).getName());
- }
-
- public void testUpdateAssociationOverrides() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
-
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualOverride = virtualOverrides.next();
- OrmVirtualJoinColumnRelationshipStrategy joiningStrategy = ((OrmVirtualJoinColumnRelationship) virtualOverride.getRelationship()).getJoinColumnStrategy();
-
- assertEquals("oneToOne", virtualOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- OrmVirtualJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("oneToOne_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(CHILD_TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
-
- virtualOverride = virtualOverrides.next();
- assertEquals("manyToOne", virtualOverride.getName());
- assertFalse(virtualOverrides.hasNext());
-
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- assertEquals("manyToOne", virtualOverride.getName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- assertEquals("manyToOne", virtualOverride.getName());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- ormEntity.getJavaTypeMapping().getAssociationOverrideContainer().getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaAssociationOverride javaAssociationOverride = ormEntity.getJavaTypeMapping().getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- JavaJoinColumnRelationshipStrategy javaJoiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy();
- JavaJoinColumn javaJoinColumn = javaJoiningStrategy.getJoinColumns().iterator().next();
- javaJoinColumn.setSpecifiedName("FOO");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCE");
- javaJoinColumn.setSpecifiedTable("BAR");
- javaJoinColumn.setColumnDefinition("COLUMN_DEF");
- javaJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaJoinColumn.setSpecifiedUnique(Boolean.TRUE);
- javaJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("oneToOne", virtualOverride.getName());
- OrmVirtualJoinColumn ormJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("FOO", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("manyToOne", virtualOverride.getName());
- assertEquals(null, joiningStrategy.getJoinColumns().iterator().next().getSpecifiedName());
-
- persistentType2.getAttributeNamed("manyToOne").convertToSpecified();
- OrmManyToOneMapping manyToOneMapping = (OrmManyToOneMapping) persistentType2.getAttributeNamed("manyToOne").getMapping();
- OrmJoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_NAME");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERNCE_NAME");
- joinColumn.setSpecifiedTable("BAR2");
- joinColumn.setColumnDefinition("COLUMN_DEF2");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("oneToOne", virtualOverride.getName());
- ormJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("FOO", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("manyToOne", virtualOverride.getName());
- ormJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERNCE_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR2", ormJoinColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEF2", ormJoinColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- }
-//TODO
-// public void testVirtualAssociationOverridesNoJavaEntity() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
-// OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-// persistentType2.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-//
-// persistentType2.getAttributeNamed("oneToOne").setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-// persistentType2.getAttributeNamed("manyToOne").setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-//
-// OrmEntity entity = (OrmEntity) persistentType.getMapping();
-//
-// assertEquals(2, entity.virtualAssociationOverridesSize());
-// ListIterator<OrmAssociationOverride> virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// OrmAssociationOverride associationOverride = virtualAssociationOverrides.next();
-// assertEquals("oneToOne", associationOverride.getName());
-// assertEquals(1, associationOverride.joinColumnsSize());
-// OrmJoinColumn joinColumn = associationOverride.joinColumns().next();
-// assertEquals("oneToOne_id", joinColumn.getName());
-// assertEquals("id", joinColumn.getReferencedColumnName());
-// assertEquals(CHILD_TYPE_NAME, joinColumn.getTable());
-// assertEquals(null, joinColumn.getColumnDefinition());
-// assertEquals(true, joinColumn.isInsertable());
-// assertEquals(true, joinColumn.isUpdatable());
-// assertEquals(false, joinColumn.isUnique());
-// assertEquals(true, joinColumn.isNullable());
-//
-//
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-// assertFalse(virtualAssociationOverrides.hasNext());
-//
-//
-// entity.virtualAssociationOverrides().next().convertToSpecified();
-//
-// assertEquals(1, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-//
-// entity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(1, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-//
-// entity.specifiedAssociationOverrides().next().setVirtual(true);
-// entity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// entity.getJavaEntity().virtualAssociationOverrides().next().convertToSpecified();
-// JavaAssociationOverride javaAssociationOverride = entity.getJavaEntity().specifiedAssociationOverrides().next();
-// JavaJoinColumn javaJoinColumn = javaAssociationOverride.addSpecifiedJoinColumn(0);
-// javaJoinColumn.setSpecifiedName("FOO");
-// javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCE");
-// javaJoinColumn.setSpecifiedTable("BAR");
-// javaJoinColumn.setColumnDefinition("COLUMN_DEF");
-// javaJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
-// javaJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
-// javaJoinColumn.setSpecifiedUnique(Boolean.TRUE);
-// javaJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-//
-// assertEquals(2, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("oneToOne", associationOverride.getName());
-// OrmJoinColumn ormJoinColumn = associationOverride.joinColumns().next();
-// assertEquals("FOO", ormJoinColumn.getSpecifiedName());
-// assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
-// assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-//
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-// assertEquals(null, associationOverride.joinColumns().next().getSpecifiedName());
-//
-// persistentType2.getAttributeNamed("manyToOne").makeSpecified();
-// OrmManyToOneMapping manyToOneMapping = (OrmManyToOneMapping) persistentType2.getAttributeNamed("manyToOne").getMapping();
-// joinColumn = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0);
-// joinColumn.setSpecifiedName("MY_NAME");
-// joinColumn.setSpecifiedReferencedColumnName("MY_REFERNCE_NAME");
-// joinColumn.setSpecifiedTable("BAR2");
-// joinColumn.setColumnDefinition("COLUMN_DEF2");
-// joinColumn.setSpecifiedInsertable(Boolean.FALSE);
-// joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
-// joinColumn.setSpecifiedUnique(Boolean.TRUE);
-// joinColumn.setSpecifiedNullable(Boolean.FALSE);
-//
-//
-//
-// assertEquals(2, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// assertEquals("oneToOne", associationOverride.getName());
-// ormJoinColumn = associationOverride.joinColumns().next();
-// assertEquals("FOO", ormJoinColumn.getSpecifiedName());
-// assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
-// assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-//
-//
-// associationOverride = entity.virtualAssociationOverrides().next();
-// associationOverride = entity.virtualAssociationOverrides().next();
-// assertEquals("manyToOne", associationOverride.getName());
-// ormJoinColumn = associationOverride.joinColumns().next();
-// assertEquals("MY_NAME", ormJoinColumn.getSpecifiedName());
-// assertEquals("MY_REFERNCE_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals("BAR2", ormJoinColumn.getSpecifiedTable());
-// assertEquals("COLUMN_DEF2", ormJoinColumn.getColumnDefinition());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-// }
-
- public void testAddNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmNamedQuery namedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery.setName("FOO");
-
- assertEquals("FOO", entityResource.getNamedQueries().get(0).getName());
-
- OrmNamedQuery namedQuery2 = ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(1).getName());
-
- OrmNamedQuery namedQuery3 = ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(2, entityResource.getNamedQueries().size());
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(1, entityResource.getNamedQueries().size());
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(0, entityResource.getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAR", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().get(0).setName("FOO");
- entityResource.getNamedQueries().get(1).setName("BAR");
- entityResource.getNamedQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().move(2, 0);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().move(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(0);
- assertFalse(ormEntity.getQueryContainer().getNamedQueries().iterator().hasNext());
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmNamedNativeQuery namedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(0).getName());
-
- OrmNamedNativeQuery namedNativeQuery2 = ormEntity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(1).getName());
-
- OrmNamedNativeQuery namedNativeQuery3 = ormEntity.getQueryContainer().addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals(namedNativeQuery2, namedNativeQueries.next());
- assertEquals(namedNativeQuery3, namedNativeQueries.next());
- assertEquals(namedNativeQuery, namedNativeQueries.next());
-
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedNativeQueries().size());
-
- ormEntity.getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(2, entityResource.getNamedNativeQueries().size());
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
-
- ormEntity.getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(1, entityResource.getNamedNativeQueries().size());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(0).getName());
-
- ormEntity.getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(0, entityResource.getNamedNativeQueries().size());
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedNativeQueries().size());
-
-
- ormEntity.getQueryContainer().moveNamedNativeQuery(2, 0);
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
-
-
- ormEntity.getQueryContainer().moveNamedNativeQuery(0, 1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().get(0).setName("FOO");
- entityResource.getNamedNativeQueries().get(1).setName("BAR");
- entityResource.getNamedNativeQueries().get(2).setName("BAZ");
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(3, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedNativeQueries().move(2, 0);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- entityResource.getNamedNativeQueries().move(0, 1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- entityResource.getNamedNativeQueries().remove(1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(2, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedNativeQueries().remove(1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(1, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedNativeQueries().remove(0);
- assertFalse(ormEntity.getQueryContainer().getNamedNativeQueries().iterator().hasNext());
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType persistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- IdClassReference idClassRef = ormEntity.getIdClassReference();
-
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- entityResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNotNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- entityResource.getIdClass().setClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- entityResource.getIdClass().setClassName(existentIdClassName);
- assertEquals(existentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- //test setting @IdClass value to null, id-class tag is not removed
- entityResource.getIdClass().setClassName(null);
- assertNotNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- //reset @IdClass value and then remove id-class tag
- entityResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- entityResource.getIdClass().setClassName("model.Foo");
- entityResource.setIdClass(null);
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType persistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- IdClassReference idClassRef = ormEntity.getIdClassReference();
-
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassRef.setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassRef.setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- idClassRef.setSpecifiedIdClassName(null);
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
-
- public void testGetPrimaryKeyColumnNameWithAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType superPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType subPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity childXmlEntity = (OrmEntity) subPersistentType.getMapping();
-
- superPersistentType.getAttributeNamed("id").convertToSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("id", childXmlEntity.getPrimaryKeyColumnName());
-
- ((OrmIdMapping) superPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("MY_ID", childXmlEntity.getPrimaryKeyColumnName());
-
- //TODO once bug 228718 is fixed
- OrmVirtualAttributeOverride ormAttributeOverride = childXmlEntity.getAttributeOverrideContainer().getVirtualOverrides().iterator().next();
- assertEquals("id", ormAttributeOverride.getName());
-
- ormAttributeOverride.convertToSpecified().getColumn().setSpecifiedName("ID");
- assertEquals("ID", childXmlEntity.getPrimaryKeyColumnName());
- }
-
-
- public void testDiscriminatorValueIsUndefinedConcreteClass() throws Exception {
- createTestType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertTrue(entity.discriminatorValueIsUndefined());
-
- createTestSubType();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- assertFalse(entity.discriminatorValueIsUndefined());
- }
-
- public void testDiscriminatorValueIsAllowedAbstractClass() throws Exception {
- createTestAbstractType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertTrue(entity.discriminatorValueIsUndefined());
-
- createTestSubType();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- assertTrue(entity.discriminatorValueIsUndefined());
- }
-
- public void testDiscriminatorColumnIsAllowed() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Entity concreteEntity = (Entity) concretePersistentType.getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) abstractPersistentType.getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- //table-per-class, no discriminator column allowed
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertFalse(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
-
-
- //single-table, discriminator column allowed on root entity
- ((JavaEntity) abstractPersistentType.getJavaPersistentType().getMapping()).setSpecifiedInheritanceStrategy(null);
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertTrue(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
- }
-
- public void testAbstractEntityGetDefaultDiscriminatorColumnNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
-
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Entity concreteEntity = (Entity) concretePersistentType.getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) abstractPersistentType.getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- assertEquals(null, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(null, concreteEntity.getDiscriminatorColumn().getDefaultName());
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertEquals(null, abstractEntity.getDefaultDiscriminatorValue());
- assertTrue(concreteEntity.discriminatorValueIsUndefined());
- assertEquals(null, concreteEntity.getDefaultDiscriminatorValue());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java
deleted file mode 100644
index 02baa501ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GenerationType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-
-@SuppressWarnings("nls")public class OrmGeneratedValueTests extends ContextModelTestCase
-{
- public OrmGeneratedValueTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue();
-
- //set generator in the resource model, verify context model updated
- generatedValueResource.setGenerator("FOO");
- assertEquals("FOO", ormGeneratedValue.getSpecifiedGenerator());
- assertEquals("FOO", generatedValueResource.getGenerator());
-
- //set name to null in the resource model
- generatedValueResource.setGenerator(null);
- assertNull(ormGeneratedValue.getSpecifiedGenerator());
- assertNull(generatedValueResource.getGenerator());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue();
-
- //set name in the context model, verify resource model modified
- ormGeneratedValue.setSpecifiedGenerator("FOO");
- assertEquals("FOO", generatedValueResource.getGenerator());
- assertEquals("FOO", ormGeneratedValue.getSpecifiedGenerator());
-
- //set name to null in the context model
- ormGeneratedValue.setSpecifiedGenerator(null);
- assertNull(generatedValueResource.getGenerator());
- assertNull(ormGeneratedValue.getSpecifiedGenerator());
- }
-
- public void testDefaultsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormIdAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- IdMapping ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals(null, ormIdMapping.getGeneratedValue());
-
- IdMapping javaIdMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- GeneratedValue javaGeneratedValue = javaIdMapping.addGeneratedValue();
- javaGeneratedValue.setSpecifiedGenerator("Foo");
- javaGeneratedValue.setSpecifiedStrategy(GenerationType.SEQUENCE);
-
- assertEquals("Foo", ormIdMapping.getGeneratedValue().getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, ormIdMapping.getGeneratedValue().getSpecifiedStrategy());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
-
- ormIdAttribute.convertToSpecified();
- ormIdAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals(null, ormIdMapping.getGeneratedValue());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
-
- ((OrmPersistentAttribute) ormIdAttribute).convertToVirtual();
- ormIdAttribute = ormPersistentType.getAttributeNamed("id");
- ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals("Foo", ormIdMapping.getGeneratedValue().getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, ormIdMapping.getGeneratedValue().getSpecifiedStrategy());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java
deleted file mode 100644
index b8c9fa1f03..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java
+++ /dev/null
@@ -1,753 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GenerationType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmIdMappingTests extends ContextModelTestCase
-{
- public OrmIdMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN, JPA.TEMPORAL, JPA.TEMPORAL_TYPE, JPA.GENERATED_VALUE, JPA.GENERATION_TYPE, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- sb.append(CR);
- sb.append(" @GeneratedValue(strategy=GenerationType.TABLE, generator=\"myTableGenerator\")");
- sb.append(CR);
- sb.append(" @TableGenerator(name=\"myTableGenerator\", table=\"myTable\", catalog=\"myCatalog\", schema=\"mySchema\", pkColumnName=\"myPkColumnName\", valueColumnName=\"myValueColumnName\", pkColumnValue=\"myPkColumnValue\", initialValue=1, allocationSize=1)");
- sb.append(CR);
- sb.append(" @SequenceGenerator(name=\"mySequenceGenerator\")");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertEquals("idMapping", ormIdMapping.getName());
- assertEquals("idMapping", idResource.getName());
-
- //set name in the resource model, verify context model updated
- idResource.setName("newName");
- assertEquals("newName", ormIdMapping.getName());
- assertEquals("newName", idResource.getName());
-
- //set name to null in the resource model
- idResource.setName(null);
- assertNull(ormIdMapping.getName());
- assertNull(idResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertEquals("idMapping", ormIdMapping.getName());
- assertEquals("idMapping", idResource.getName());
-
- //set name in the context model, verify resource model updated
- ormIdMapping.setName("newName");
- assertEquals("newName", ormIdMapping.getName());
- assertEquals("newName", idResource.getName());
-
- //set name to null in the context model
- ormIdMapping.setName(null);
- assertNull(ormIdMapping.getName());
- assertNull(idResource.getName());
- }
-
- public void testUpdateTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(idResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- idResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, idResource.getTemporal());
-
- idResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, idResource.getTemporal());
-
- idResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, idResource.getTemporal());
-
- //set temporal to null in the resource model
- idResource.setTemporal(null);
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(idResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(idResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormIdMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) ormIdMapping.getConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, idResource.getTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
-
- ((TemporalConverter) ormIdMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, idResource.getTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
-
- ((TemporalConverter) ormIdMapping.getConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, idResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormIdMapping.getConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormIdMapping.setConverter(null);
- assertNull(idResource.getTemporal());
- assertNull(ormIdMapping.getConverter().getType());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
-
- public void testAddSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- ormIdMapping.getGeneratorContainer().addSequenceGenerator();
-
- assertNotNull(idResource.getSequenceGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- ormIdMapping.getGeneratorContainer().addSequenceGenerator();
- assertNotNull(idResource.getSequenceGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
-
- ormIdMapping.getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- idResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(idResource.getSequenceGenerator());
- assertEquals(1, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- ormIdMapping.getGeneratorContainer().getSequenceGenerator().setName("foo");
- assertEquals(1, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- idResource.setSequenceGenerator(null);
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- ormIdMapping.getGeneratorContainer().addTableGenerator();
-
- assertNotNull(idResource.getTableGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- ormIdMapping.getGeneratorContainer().addTableGenerator();
- assertNotNull(idResource.getTableGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- ormIdMapping.getGeneratorContainer().removeTableGenerator();
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- idResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNotNull(idResource.getTableGenerator());
- assertEquals(1, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- ormIdMapping.getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, ormIdMapping.getGeneratorContainer().getPersistenceUnit().getGeneratorsSize());
-
- idResource.setTableGenerator(null);
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddGeneratedValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- ormIdMapping.addGeneratedValue();
-
- assertNotNull(idResource.getGeneratedValue());
- assertNotNull(ormIdMapping.getGeneratedValue());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormIdMapping.addGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveGeneratedValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- ormIdMapping.addGeneratedValue();
- assertNotNull(idResource.getGeneratedValue());
- assertNotNull(ormIdMapping.getGeneratedValue());
-
- ormIdMapping.removeGeneratedValue();
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormIdMapping.removeGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateGeneratedValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- idResource.setGeneratedValue(OrmFactory.eINSTANCE.createXmlGeneratedValue());
-
- assertNotNull(ormIdMapping.getGeneratedValue());
- assertNotNull(idResource.getGeneratedValue());
-
- idResource.setGeneratedValue(null);
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
- }
-
-
- public void testIdMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormIdMapping.getName());
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", idMapping.getName());
- assertEquals(TemporalConverter.class, idMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) idMapping.getConverter()).getTemporalType());
-
- Column column = idMapping.getColumn();
- assertEquals("MY_COLUMN", column.getSpecifiedName());
- assertEquals(Boolean.TRUE, column.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, column.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, column.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, column.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", column.getColumnDefinition());
- assertEquals("MY_TABLE", column.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), column.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), column.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), column.getSpecifiedScale());
-
- GeneratedValue generatedValue = idMapping.getGeneratedValue();
- assertEquals("myTableGenerator", generatedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.TABLE, generatedValue.getSpecifiedStrategy());
-
-// >>> I'm going to argue there is no such thing as a "virtual" generator,
-// since a Java generator is *not* overridden when its ID mapping (or entity)
-// is overridden in the orm.xml file - both the orm.xml ID mapping and the
-// Java mapping can define an "active" generator as long as they have different
-// names ~bjv
- TableGenerator tableGenerator = idMapping.getGeneratorContainer().getTableGenerator();
- assertNull(tableGenerator);
-// assertEquals("myTableGenerator", tableGenerator.getName());
-// assertEquals("myTable", tableGenerator.getSpecifiedTable());
-// assertEquals("myCatalog", tableGenerator.getSpecifiedCatalog());
-// assertEquals("mySchema", tableGenerator.getSpecifiedSchema());
-// assertEquals("myPkColumnName", tableGenerator.getSpecifiedPkColumnName());
-// assertEquals("myPkColumnValue", tableGenerator.getSpecifiedPkColumnValue());
-// assertEquals("myValueColumnName", tableGenerator.getSpecifiedValueColumnName());
-// assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
-// assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedAllocationSize());
-
- SequenceGenerator sequenceGenerator = idMapping.getGeneratorContainer().getSequenceGenerator();
- assertNull(sequenceGenerator);
-// assertEquals("mySequenceGenerator", sequenceGenerator.getName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.convertToSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals("id", ormIdMapping.getName());
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertEquals("id", ormColumn.getName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getTable());
- assertEquals(255, ormColumn.getLength());
- assertEquals(0, ormColumn.getPrecision());
- assertEquals(0, ormColumn.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormIdMapping.getName());
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
- public void testIdMorphToBasicMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testIdMorphToVersionMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((VersionMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testIdMorphToTransientMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToEmbeddedMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToOneToOneMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToOneToManyMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToManyToOneMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToManyToManyMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java
deleted file mode 100644
index 81466a3691..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmJoinColumnTests extends ContextModelTestCase
-{
- public OrmJoinColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnResource.getName());
-
- //set name to null in the resource model
- joinColumnResource.setName(null);
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- joinColumnResource.setName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnResource.getName());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- assertEquals("foo", joinColumn.getSpecifiedName());
- assertEquals("foo", joinColumnResource.getName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedName(null);
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinTableResource.getJoinColumns().get(0).getName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", joinColumnResource.getReferencedColumnName());
-
- //set name to null in the resource model
- joinColumnResource.setReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- joinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", joinColumnResource.getReferencedColumnName());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("foo", joinColumnResource.getReferencedColumnName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinTableResource.getJoinColumns().get(0).getReferencedColumnName());
- }
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", joinColumn.getColumnDefinition());
- assertEquals("FOO", joinColumnResource.getColumnDefinition());
-
- //set name to null in the resource model
- joinColumnResource.setColumnDefinition(null);
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- joinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", joinColumn.getColumnDefinition());
- assertEquals("FOO", joinColumnResource.getColumnDefinition());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- //set name in the context model, verify resource model modified
- joinColumn.setColumnDefinition("foo");
- assertEquals("foo", joinColumn.getColumnDefinition());
- assertEquals("foo", joinColumnResource.getColumnDefinition());
-
- //set name to null in the context model
- joinColumn.setColumnDefinition(null);
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinTableResource.getJoinColumns().get(0).getColumnDefinition());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- //set table in the resource model, verify context model updated
- joinColumnResource.setTable("FOO");
- assertEquals("FOO", ormJoinColumn.getSpecifiedTable());
- assertEquals("FOO", joinColumnResource.getTable());
-
- //set table to null in the resource model
- joinColumnResource.setTable(null);
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- joinColumnResource.setTable("FOO");
- assertEquals("FOO", ormJoinColumn.getSpecifiedTable());
- assertEquals("FOO", joinColumnResource.getTable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- //set table in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedTable("foo");
- assertEquals("foo", ormJoinColumn.getSpecifiedTable());
- assertEquals("foo", joinColumnResource.getTable());
-
- //set table to null in the context model
- ormJoinColumn.setSpecifiedTable(null);
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinTableResource.getJoinColumns().get(0).getTable());
- }
-
- public void testUpdateSpecifiedNullable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- //set nullable in the resource model, verify context model updated
- joinColumnResource.setNullable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, joinColumnResource.getNullable());
-
- //set nullable to null in the resource model
- joinColumnResource.setNullable(null);
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- joinColumnResource.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumnResource.getNullable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedNullable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- //set nullable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumnResource.getNullable());
-
- //set nullable to null in the context model
- ormJoinColumn.setSpecifiedNullable(null);
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinTableResource.getJoinColumns().get(0).getNullable());
- }
-
- public void testUpdateSpecifiedUpdatable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- //set updatable in the resource model, verify context model updated
- joinColumnResource.setUpdatable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, joinColumnResource.getUpdatable());
-
- //set updatable to null in the resource model
- joinColumnResource.setUpdatable(null);
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- joinColumnResource.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, joinColumnResource.getUpdatable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedUpdatable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- //set updatable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, joinColumnResource.getUpdatable());
-
- //set updatable to null in the context model
- ormJoinColumn.setSpecifiedUpdatable(null);
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinTableResource.getJoinColumns().get(0).getUpdatable());
- }
-
- public void testUpdateSpecifiedInsertable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- //set insertable in the resource model, verify context model updated
- joinColumnResource.setInsertable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, joinColumnResource.getInsertable());
-
- //set insertable to null in the resource model
- joinColumnResource.setInsertable(null);
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- joinColumnResource.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumnResource.getInsertable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedInsertable() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- //set insertable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumnResource.getInsertable());
-
- //set insertable to null in the context model
- ormJoinColumn.setSpecifiedInsertable(null);
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinTableResource.getJoinColumns().get(0).getInsertable());
- }
-
- public void testUpdateSpecifiedUnique() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- //set unique in the resource model, verify context model updated
- joinColumnResource.setUnique(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, joinColumnResource.getUnique());
-
- //set unique to null in the resource model
- joinColumnResource.setUnique(null);
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- joinColumnResource.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumnResource.getUnique());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedUnique() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- //set unique in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumnResource.getUnique());
-
- //set unique to null in the context model
- ormJoinColumn.setSpecifiedUnique(null);
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinTableResource.getJoinColumns().get(0).getUnique());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java
deleted file mode 100644
index 4c1fd47226..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java
+++ /dev/null
@@ -1,1365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.internal.context.orm.VirtualOrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmJoinTableTests extends ContextModelTestCase
-{
- public OrmJoinTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithValidManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append(" private Collection<Project> projects;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- private void createTargetEntityWithBackPointer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(" @ManyToMany(mappedBy=\"projects\"").append(CR);
- sb.append(" private java.util.Collection<" + TYPE_NAME + "> employees;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
-
-
- //set name in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- manyToMany.getJoinTable().setName("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("FOO", manyToMany.getJoinTable().getName());
-
- //set name to null in the resource model
- manyToMany.getJoinTable().setName(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable().getName());
-
- manyToMany.getJoinTable().setName("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("FOO", manyToMany.getJoinTable().getName());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
-
- //set name in the context model, verify resource model modified
- ormJoinTable.setSpecifiedName("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedName());
- assertEquals("foo", manyToMany.getJoinTable().getName());
-
- //set name to null in the context model
- ormJoinTable.setSpecifiedName(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTargetEntity();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Project");
-
- assertEquals(TYPE_NAME + "_Project", virtualJoinTable.getName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn ormJoinColumn = virtualJoinTable.getDefaultJoinColumn();
-//TODO need to test joinColumn defaults here as well as in java and all the relatioship mapping types
-// assertEquals("id_project_id", ormJoinColumn.getDefaultName());
-// assertEquals("id_project_id", ormJoinColumn.getDefaultReferencedColumnName());
- JoinColumn inverseOrmJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
-// assertEquals("id_project_id", inverseOrmJoinColumn.getDefaultName());
-// assertEquals("id_project_id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) javaPersistentAttribute.getMapping();
- JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- ormJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", inverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", inverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "projects");
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTargetEntity();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- JavaManyToManyMapping javaManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping();
- javaManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.convertToVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("projects");
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentAttribute2.getMapping();
- 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().getJoinTableStrategy().getJoinTable().setSpecifiedName(null);
- javaManyMapping.getRelationship().setStrategyToJoinTable();
- assertNull(virtualJoinTable.getSpecifiedName());
- assertEquals("BAR_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
-
- //set schema in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- manyToMany.getJoinTable().setSchema("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedSchema());
- assertEquals("FOO", manyToMany.getJoinTable().getSchema());
-
- //set Schema to null in the resource model
- manyToMany.getJoinTable().setSchema(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable().getSchema());
-
- manyToMany.getJoinTable().setSchema("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedSchema());
- assertEquals("FOO", manyToMany.getJoinTable().getSchema());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
- }
-
-// public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedSchema("Foo");
-// assertEquals("Foo", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.setSpecifiedMetadataComplete(null);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName("Bar");
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertNull(childXmlEntity.getTable().getDefaultSchema());
-//
-// parentXmlEntity.getTable().setSpecifiedSchema("FOO");
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultSchema());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertNull(childXmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("FOO");
-// assertEquals("FOO", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().setSpecifiedSchema("BAR");
-// assertEquals("BAR", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedSchema("JAVA_SCHEMA");
-// assertEquals("JAVA_SCHEMA", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName("BLAH");
-// //xml entity now has a table element so default schema is not taken from java
-// assertEquals("BAR", xmlEntity.getTable().getDefaultSchema());
-//
-//
-// xmlEntity.entityMappings().setSpecifiedSchema(null);
-// assertEquals("FOO", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName(null);
-// assertEquals("JAVA_SCHEMA", xmlEntity.getTable().getDefaultSchema());
-// }
-
- public void testModifySpecifiedSchema() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
-
- //set Schema in the context model, verify resource model modified
- ormJoinTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedSchema());
- assertEquals("foo", manyToMany.getJoinTable().getSchema());
-
- //set Schema to null in the context model
- ormJoinTable.setSpecifiedSchema(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
-
- //set Catalog in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- manyToMany.getJoinTable().setCatalog("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedCatalog());
- assertEquals("FOO", manyToMany.getJoinTable().getCatalog());
-
- //set Catalog to null in the resource model
- manyToMany.getJoinTable().setCatalog(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable().getCatalog());
-
- manyToMany.getJoinTable().setCatalog("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedCatalog());
- assertEquals("FOO", manyToMany.getJoinTable().getCatalog());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
-
- //set Catalog in the context model, verify resource model modified
- ormJoinTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedCatalog());
- assertEquals("foo", manyToMany.getJoinTable().getCatalog());
-
- //set Catalog to null in the context model
- ormJoinTable.setSpecifiedCatalog(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
- }
-
-// public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedCatalog("Foo");
-// assertEquals("Foo", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.setSpecifiedMetadataComplete(null);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName("Bar");
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertNull(childXmlEntity.getTable().getDefaultCatalog());
-//
-// parentXmlEntity.getTable().setSpecifiedCatalog("FOO");
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultCatalog());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertNull(childXmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("FOO");
-// assertEquals("FOO", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().setSpecifiedCatalog("BAR");
-// assertEquals("BAR", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedCatalog("JAVA_CATALOG");
-// assertEquals("JAVA_CATALOG", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName("BLAH");
-// //xml entity now has a table element so default schema is not taken from java
-// assertEquals("BAR", xmlEntity.getTable().getDefaultCatalog());
-//
-//
-// xmlEntity.entityMappings().setSpecifiedCatalog(null);
-// assertEquals("FOO", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName(null);
-// assertEquals("JAVA_CATALOG", xmlEntity.getTable().getDefaultCatalog());
-//}
-
-//
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// Entity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals("Foo", xmlEntity.getName());
-//
-// //set class in the resource model, verify context model updated
-// entityResource.setClassName("com.Bar");
-// assertEquals("Bar", xmlEntity.getName());
-//
-// entityResource.setName("Baz");
-// assertEquals("Baz", xmlEntity.getName());
-//
-// //set class to null in the resource model
-// entityResource.setClassName(null);
-// assertEquals("Baz", xmlEntity.getName());
-//
-// entityResource.setName(null);
-// assertNull(xmlEntity.getName());
-// }
-
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals("FOO", joinTableResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormJoinTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormJoinTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getJoinColumns().size());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.getJoinColumns().size());
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.getJoinColumns().size());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(0).getName());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getJoinColumns().size());
-
-
- ormJoinTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
-
-
- ormJoinTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateInverseJoinColumns() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- joinTableResource.getInverseJoinColumns().get(0).setName("FOO");
- joinTableResource.getInverseJoinColumns().get(1).setName("BAR");
- joinTableResource.getInverseJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().move(2, 0);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().move(0, 1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedInverseJoinColumns().iterator().hasNext());
- }
-
- public void testAddSpecifiedInverseJoinColumn() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormJoinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormJoinTable.addSpecifiedInverseJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedInverseJoinColumn() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getInverseJoinColumns().size());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTableResource.getInverseJoinColumns().size());
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTableResource.getInverseJoinColumns().size());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(0).getName());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTableResource.getInverseJoinColumns().size());
- }
-
- public void testMoveSpecifiedInverseJoinColumn() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getInverseJoinColumns().size());
-
-
- ormJoinTable.moveSpecifiedInverseJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
-
-
- ormJoinTable.moveSpecifiedInverseJoinColumn(0, 1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- joinTableResource.getJoinColumns().get(0).setName("FOO");
- joinTableResource.getJoinColumns().get(1).setName("BAR");
- joinTableResource.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().move(2, 0);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().move(0, 1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- assertEquals(0, ormJoinTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormJoinTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = joinTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = joinTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, joinTableResource.getUniqueConstraints().size());
-
- ormJoinTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormJoinTable.removeUniqueConstraint(1);
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormJoinTable.removeUniqueConstraint(0);
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, joinTableResource.getUniqueConstraints().size());
-
-
- ormJoinTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormJoinTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualAttribute.getMapping();
- JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertTrue(virtualAttribute.isVirtual());
-
- ListIterator<? extends UniqueConstraint> uniqueConstraints = virtualJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- javaJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = virtualJoinTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- OrmManyToManyMapping specifiedManyToManyMapping = (OrmManyToManyMapping) ((VirtualOrmPersistentAttribute) virtualAttribute).convertToSpecified().getMapping();
- assertEquals(0, specifiedManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().getUniqueConstraintsSize());
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidManyToMany();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ormPersistentType.getAttributeNamed("projects").convertToSpecified();
- OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinTable.getDefaultName());
-
- //add target entity to the persistence unit, now join table name is [table name]_[target table name]
- createTargetEntity();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(manyToMany.getJoinTable());
-
- //target entity does not resolve, default name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertNull(joinTable.getDefaultName());
-
- //default target entity does resolve, so default name is again [table name]_[target table name]
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- //add the join table xml element, verify default join table name is the same
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
- assertNotNull(manyToMany.getJoinTable());
-
- //set a table on the target entity, very default join table name updates
- manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-
- //set a table on the owning entity, very default join table name updates
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testDefaultJoinColumns() throws Exception {
- createTestEntityWithValidManyToMany();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ormPersistentType.getAttributeNamed("projects").convertToSpecified();
- OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntity();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(TYPE_NAME + "_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(manyToMany.getJoinTable());
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table xml element, verify default join column defaults are the same
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(manyToMany.getJoinTable());
- }
-
- public void testDefaultJoinColumnsBidirectionalRelationship() throws Exception {
- createTestEntityWithValidManyToMany();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ormPersistentType.getAttributeNamed("projects").convertToSpecified();
- OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntityWithBackPointer();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("employees_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(manyToMany.getJoinTable());
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table xml element, verify default join column defaults are the same
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(manyToMany.getJoinTable());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
deleted file mode 100644
index ac7a850c1d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,1064 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmManyToManyMappingTests extends ContextModelTestCase
-{
- public OrmManyToManyMappingTests(String name) {
- super(name);
- }
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEntityWithManyToManyMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertEquals("manyToManyMapping", ormManyToManyMapping.getName());
- assertEquals("manyToManyMapping", manyToMany.getName());
-
- //set name in the resource model, verify context model updated
- manyToMany.setName("newName");
- assertEquals("newName", ormManyToManyMapping.getName());
- assertEquals("newName", manyToMany.getName());
-
- //set name to null in the resource model
- manyToMany.setName(null);
- assertNull(ormManyToManyMapping.getName());
- assertNull(manyToMany.getName());
- }
-
- public void testModifyName() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertEquals("manyToManyMapping", ormManyToManyMapping.getName());
- assertEquals("manyToManyMapping", manyToMany.getName());
-
- //set name in the context model, verify resource model updated
- ormManyToManyMapping.setName("newName");
- assertEquals("newName", ormManyToManyMapping.getName());
- assertEquals("newName", manyToMany.getName());
-
- //set name to null in the context model
- ormManyToManyMapping.setName(null);
- assertNull(ormManyToManyMapping.getName());
- assertNull(manyToMany.getName());
- }
-
- public void testUpdateTargetEntity() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToMany.setTargetEntity(null);
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the context model
- ormManyToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- 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();
- XmlManyToMany manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToManyResource.getFetch());
-
- manyToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToManyResource.getFetch());
-
- //set fetch to null in the resource model
- manyToManyResource.setFetch(null);
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- 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();
- XmlManyToMany manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToManyResource.getFetch());
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
-
- ormManyToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToManyResource.getFetch());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormManyToManyMapping.setSpecifiedFetch(null);
- assertNull(manyToManyResource.getFetch());
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- 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().getMappedByStrategy();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- manyToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //setmappedBy to null in the resource model
- manyToMany.setMappedBy(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- 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().getMappedByStrategy();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- strategy.setMappedByAttribute("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- strategy.setMappedByAttribute(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToManyMapping contextMapping = (OrmManyToManyMapping) contextAttribute.getMapping();
- OrmManyToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToMany resourceMapping = resourceEntity.getAttributes().getManyToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToManyMapping contextMapping = (OrmManyToManyMapping) contextAttribute.getMapping();
- OrmManyToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToMany resourceMapping = resourceEntity.getAttributes().getManyToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdateMapKey() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNotNull(manyToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKey().setName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
-
- manyToMany.getMapKey().setName("myMapKey");
- manyToMany.setMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setNoMapKey(true);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualManyToManyMapping.getSpecifiedMapKey());
- assertNull(virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertTrue(virtualManyToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualManyToManyMapping.getMapKey());
- assertTrue(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setCustomMapKey(true);
- javaManyToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualManyToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertTrue(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
- }
-
- public void testUpdateOrderBy() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
-
- //set orderBy in the resource model, verify context model updated
- manyToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", manyToMany.getOrderBy());
-
- //set orderBy to null in the resource model
- manyToMany.setOrderBy(null);
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
- }
-
- public void testModifyOrderBy() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", manyToMany.getOrderBy());
-
- //set mappedBy to null in the context model
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
- }
-
- public void testIsNoOrdering() throws Exception {
- 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();
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- }
-
- public void testSetNoOrdering() throws Exception {
- 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();
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setNoOrdering(true);
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-//TODO
-// public boolean isOrderByPk() {
-// return "".equals(getOrderBy());
-// }
-//
-// public void setOrderByPk() {
-// setOrderBy("");
-// }
-
- public void testIsCustomOrdering() throws Exception {
- 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();
-
- assertFalse(ormManyToManyMapping.getOrderable().isCustomOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertTrue(ormManyToManyMapping.getOrderable().isCustomOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertFalse(ormManyToManyMapping.getOrderable().isCustomOrdering());
- }
-
- public void testManyToManyMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToOneToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- 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());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testManyToManyMorphToOneToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- 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().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- JoinTable joinTable = ((OneToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals("name", joinTable.getJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("referenceName", joinTable.getJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- assertEquals("inverseName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("inverseReferenceName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- }
-
- public void testManyToManyMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testManyToManyMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").convertToSpecified();
- OrmManyToManyMapping specifiedManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java
deleted file mode 100644
index 473d2ca0b0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,617 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmManyToOneMappingTests extends ContextModelTestCase
-{
- public OrmManyToOneMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEntityWithManyToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- public void testUpdateName() 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();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertEquals("manyToOneMapping", ormManyToOneMapping.getName());
- assertEquals("manyToOneMapping", manyToOne.getName());
-
- //set name in the resource model, verify context model updated
- manyToOne.setName("newName");
- assertEquals("newName", ormManyToOneMapping.getName());
- assertEquals("newName", manyToOne.getName());
-
- //set name to null in the resource model
- manyToOne.setName(null);
- assertNull(ormManyToOneMapping.getName());
- assertNull(manyToOne.getName());
- }
-
- public void testModifyName() 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();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertEquals("manyToOneMapping", ormManyToOneMapping.getName());
- assertEquals("manyToOneMapping", manyToOne.getName());
-
- //set name in the context model, verify resource model updated
- ormManyToOneMapping.setName("newName");
- assertEquals("newName", ormManyToOneMapping.getName());
- assertEquals("newName", manyToOne.getName());
-
- //set name to null in the context model
- ormManyToOneMapping.setName(null);
- assertNull(ormManyToOneMapping.getName());
- assertNull(manyToOne.getName());
- }
-
- public void testUpdateTargetEntity() 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();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToOne.setTargetEntity(null);
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testModifyTargetEntity() 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();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the context model
- ormManyToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() 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();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToOneResource.getFetch());
-
- manyToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToOneResource.getFetch());
-
- //set fetch to null in the resource model
- manyToOneResource.setFetch(null);
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() 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();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToOneResource.getFetch());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getSpecifiedFetch());
-
- ormManyToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToOneResource.getFetch());
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormManyToOneMapping.setSpecifiedFetch(null);
- assertNull(manyToOneResource.getFetch());
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedOptional() 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();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
-
- //set optional in the resource model, verify context model updated
- manyToOneResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOneResource.getOptional());
-
- manyToOneResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOneResource.getOptional());
-
- //set optional to null in the resource model
- manyToOneResource.setOptional(null);
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() 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();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
-
- //set optional in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, manyToOneResource.getOptional());
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getSpecifiedOptional());
-
- ormManyToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOneResource.getOptional());
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
-
- //set optional to null in the context model
- ormManyToOneMapping.setSpecifiedOptional(null);
- assertNull(manyToOneResource.getOptional());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- }
-
- public void testAddSpecifiedJoinColumn() 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().getJoinColumnStrategy();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- OrmJoinColumn joinColumn = strategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = strategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = strategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() 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().getJoinColumnStrategy();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToOneResource.getJoinColumns().size());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, manyToOneResource.getJoinColumns().size());
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, manyToOneResource.getJoinColumns().size());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(0).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, manyToOneResource.getJoinColumns().size());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping contextMapping = (OrmManyToOneMapping) contextAttribute.getMapping();
- OrmManyToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping contextMapping = (OrmManyToOneMapping) contextAttribute.getMapping();
- OrmManyToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- 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().getJoinColumnStrategy();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToOneResource.getJoinColumns().size());
-
-
- strategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
-
-
- strategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
- }
-
-
- public void testManyToOneMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals("foo", ormManyToOneMapping.getName());
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getFetch());
- assertEquals(true, ormManyToOneMapping.isOptional());
- assertNull(ormManyToOneMapping.getTargetEntity());
-
-
- assertFalse(strategy.getSpecifiedJoinColumns().iterator().hasNext());
- //TODO default joinColumns
- //assertTrue(ormManyToOneMapping.defaultJoinColumns().hasNext());
-
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", manyToOneMapping.getName());
- assertEquals(FetchType.LAZY, manyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", manyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", joinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", joinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", joinColumn.getSpecifiedTable());
-
- Cascade cascade = manyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- //TODO hmm, is this correct?
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormManyToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormManyToOneMapping.getName());
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getFetch());
- assertEquals(true, ormManyToOneMapping.isOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- assertFalse(ormManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().hasNext());
-
- //TODO default join columns for specified xmlManyToOne mapping
-// XmlJoinColumn ormJoinColumn = ormManyToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java
deleted file mode 100644
index f778dc33ec..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmMappedSuperclassTests extends ContextModelTestCase
-{
- public OrmMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals("model.Foo", mappedSuperclassResource.getClassName());
-
- //set class in the resource model, verify context model updated
- mappedSuperclassResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormMappedSuperclass.getClass_());
- assertEquals("com.Bar", mappedSuperclassResource.getClassName());
-
- //set class to null in the resource model
- mappedSuperclassResource.setClassName(null);
- assertNull(ormMappedSuperclass.getClass_());
- assertNull(mappedSuperclassResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals("model.Foo", mappedSuperclassResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormMappedSuperclass.setClass("com.Bar");
- assertEquals("com.Bar", ormMappedSuperclass.getClass_());
- assertEquals("com.Bar", mappedSuperclassResource.getClassName());
-
- //set class to null in the context model
- ormMappedSuperclass.setClass(null);
- assertNull(ormMappedSuperclass.getClass_());
- assertNull(mappedSuperclassResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
-
- //set access in the resource model, verify context model updated
- mappedSuperclassResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, mappedSuperclassResource.getAccess());
-
- //set access to null in the resource model
- mappedSuperclassResource.setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclassResource.getAccess());
-
- //set access to null in the context model
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
- }
- //TODO test default access from
- //underlying java
- //persistence-unit-defaults
- //entity-mappings
- //with xml-mapping-metadata-complete set
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- mappedSuperclassResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getMetadataComplete());
-
- //set access to false in the resource model
- mappedSuperclassResource.setMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getMetadataComplete());
-
- mappedSuperclassResource.setMetadataComplete(null);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getMetadataComplete());
-
- //set access to null in the context model
- ormMappedSuperclass.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getMetadataComplete());
-
- ormMappedSuperclass.setSpecifiedMetadataComplete(null);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isOverrideMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormMappedSuperclass.isOverrideMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isOverrideMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormMappedSuperclass.isMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormMappedSuperclass.isMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
-
- public void testMakeMappedSuperclassEntity() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
- }
-
- //test with 2 MappedSuperclasses, make the first one an Entity so it has to move to the end of the list
- public void testMakeMappedSuperclassEntity2() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testMakeMappedSuperclassEmbeddable() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
- }
- //test with 2 MappedSuperclasses, make the first one an Embeddable so it has to move to the end of the list
- public void testMakeMappedSuperclassEmbeddable2() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
-
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- IdClassReference idClassRef = ormMappedSuperclass.getIdClassReference();
-
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- mappedSuperclassResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNotNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- mappedSuperclassResource.getIdClass().setClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- mappedSuperclassResource.getIdClass().setClassName(existentIdClassName);
- assertEquals(existentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- //test setting @IdClass value to null, id-class tag is not removed
- mappedSuperclassResource.getIdClass().setClassName(null);
- assertNotNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- //reset @IdClass value and then remove id-class tag
- mappedSuperclassResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- mappedSuperclassResource.getIdClass().setClassName("model.Foo");
- mappedSuperclassResource.setIdClass(null);
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
-
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- IdClassReference idClassRef = ormMappedSuperclass.getIdClassReference();
-
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassRef.setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassRef.setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- idClassRef.setSpecifiedIdClassName(null);
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java
deleted file mode 100644
index f5bcbe0f55..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmNamedNativeQueryTests extends ContextModelTestCase
-{
- public OrmNamedNativeQueryTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setName("newName");
- assertEquals("newName", ormNamedNativeQuery.getName());
- assertEquals("newName", namedNativeQueryResource.getName());
-
- //set name to null in the resource model
- namedNativeQueryResource.setName(null);
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setName("newName");
- assertEquals("newName", ormNamedNativeQuery.getName());
- assertEquals("newName", namedNativeQueryResource.getName());
-
- //set name to null in the context model
- ormNamedNativeQuery.setName(null);
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setQuery("newName");
- assertEquals("newName", ormNamedNativeQuery.getQuery());
- assertEquals("newName", namedNativeQueryResource.getQuery());
-
- //set name to null in the resource model
- namedNativeQueryResource.setQuery(null);
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setQuery("newName");
- assertEquals("newName", ormNamedNativeQuery.getQuery());
- assertEquals("newName", namedNativeQueryResource.getQuery());
-
- //set name to null in the context model
- ormNamedNativeQuery.setQuery(null);
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
- }
-
- public void testAddHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- OrmQueryHint queryHint = ormNamedNativeQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", namedNativeQueryResource.getHints().get(0).getName());
-
- OrmQueryHint queryHint2 = ormNamedNativeQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(1).getName());
-
- OrmQueryHint queryHint3 = ormNamedNativeQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
-
- ListIterator<OrmQueryHint> queryHints = ormNamedNativeQuery.getHints().iterator();
- assertEquals(queryHint2, queryHints.next());
- assertEquals(queryHint3, queryHints.next());
- assertEquals(queryHint, queryHints.next());
-
- queryHints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAR", queryHints.next().getName());
- assertEquals("BAZ", queryHints.next().getName());
- assertEquals("FOO", queryHints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- ormNamedNativeQuery.addHint(0).setName("FOO");
- ormNamedNativeQuery.addHint(1).setName("BAR");
- ormNamedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedNativeQueryResource.getHints().size());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(2, namedNativeQueryResource.getHints().size());
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(1, namedNativeQueryResource.getHints().size());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(0).getName());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(0, namedNativeQueryResource.getHints().size());
- }
-
- public void testMoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- ormNamedNativeQuery.addHint(0).setName("FOO");
- ormNamedNativeQuery.addHint(1).setName("BAR");
- ormNamedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedNativeQueryResource.getHints().size());
-
-
- ormNamedNativeQuery.moveHint(2, 0);
- ListIterator<OrmQueryHint> hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
-
-
- ormNamedNativeQuery.moveHint(0, 1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAR", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
-
- namedNativeQueryResource.getHints().get(0).setName("FOO");
- namedNativeQueryResource.getHints().get(1).setName("BAR");
- namedNativeQueryResource.getHints().get(2).setName("BAZ");
-
- ListIterator<OrmQueryHint> hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().move(2, 0);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().move(0, 1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(0);
- assertFalse(ormNamedNativeQuery.getHints().iterator().hasNext());
- }
-
-
- public void testUpdateResultSetMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultSetMapping());
- assertEquals(null, ormNamedNativeQuery.getResultSetMapping());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setResultSetMapping("foo");
- assertEquals("foo", namedNativeQueryResource.getResultSetMapping());
- assertEquals("foo", ormNamedNativeQuery.getResultSetMapping());
-
- //set name to null in the resource model
- namedNativeQueryResource.setResultSetMapping(null);
- assertNull(namedNativeQueryResource.getResultSetMapping());
- assertNull(ormNamedNativeQuery.getResultSetMapping());
- }
-
- public void testModifyResultSetMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultSetMapping());
- assertEquals(null, ormNamedNativeQuery.getResultSetMapping());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setResultSetMapping("foo");
- assertEquals("foo", namedNativeQueryResource.getResultSetMapping());
- assertEquals("foo", ormNamedNativeQuery.getResultSetMapping());
-
- //set name to null in the context model
- ormNamedNativeQuery.setResultSetMapping(null);
- assertNull(namedNativeQueryResource.getResultSetMapping());
- assertNull(ormNamedNativeQuery.getResultSetMapping());
- }
-
- public void testUpdateResultClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultClass());
- assertEquals(null, ormNamedNativeQuery.getResultClass());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setResultClass("foo");
- assertEquals("foo", namedNativeQueryResource.getResultClass());
- assertEquals("foo", ormNamedNativeQuery.getResultClass());
-
- //set name to null in the resource model
- namedNativeQueryResource.setResultClass(null);
- assertNull(namedNativeQueryResource.getResultClass());
- assertNull(ormNamedNativeQuery.getResultClass());
- }
-
- public void testModifyResultClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultClass());
- assertEquals(null, ormNamedNativeQuery.getResultClass());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setResultClass("foo");
- assertEquals("foo", namedNativeQueryResource.getResultClass());
- assertEquals("foo", ormNamedNativeQuery.getResultClass());
-
- //set name to null in the context model
- ormNamedNativeQuery.setResultClass(null);
- assertNull(namedNativeQueryResource.getResultClass());
- assertNull(ormNamedNativeQuery.getResultClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java
deleted file mode 100644
index 61c3126611..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmNamedQueryTests extends ContextModelTestCase
-{
- public OrmNamedQueryTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
-
- //set name in the resource model, verify context model updated
- namedQueryResource.setName("newName");
- assertEquals("newName", ormNamedQuery.getName());
- assertEquals("newName", namedQueryResource.getName());
-
- //set name to null in the resource model
- namedQueryResource.setName(null);
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
-
- //set name in the context model, verify resource model updated
- ormNamedQuery.setName("newName");
- assertEquals("newName", ormNamedQuery.getName());
- assertEquals("newName", namedQueryResource.getName());
-
- //set name to null in the context model
- ormNamedQuery.setName(null);
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
-
- //set name in the resource model, verify context model updated
- namedQueryResource.setQuery("newName");
- assertEquals("newName", ormNamedQuery.getQuery());
- assertEquals("newName", namedQueryResource.getQuery());
-
- //set name to null in the resource model
- namedQueryResource.setQuery(null);
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
-
- //set name in the context model, verify resource model updated
- ormNamedQuery.setQuery("newName");
- assertEquals("newName", ormNamedQuery.getQuery());
- assertEquals("newName", namedQueryResource.getQuery());
-
- //set name to null in the context model
- ormNamedQuery.setQuery(null);
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
- }
-
- public void testAddHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- OrmQueryHint queryHint = ormNamedQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", namedQueryResource.getHints().get(0).getName());
-
- OrmQueryHint queryHint2 = ormNamedQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(1).getName());
-
- OrmQueryHint queryHint3 = ormNamedQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
-
- ListIterator<OrmQueryHint> queryHints = ormNamedQuery.getHints().iterator();
- assertEquals(queryHint2, queryHints.next());
- assertEquals(queryHint3, queryHints.next());
- assertEquals(queryHint, queryHints.next());
-
- queryHints = ormNamedQuery.getHints().iterator();
- assertEquals("BAR", queryHints.next().getName());
- assertEquals("BAZ", queryHints.next().getName());
- assertEquals("FOO", queryHints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- ormNamedQuery.addHint(0).setName("FOO");
- ormNamedQuery.addHint(1).setName("BAR");
- ormNamedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedQueryResource.getHints().size());
-
- ormNamedQuery.removeHint(0);
- assertEquals(2, namedQueryResource.getHints().size());
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
-
- ormNamedQuery.removeHint(0);
- assertEquals(1, namedQueryResource.getHints().size());
- assertEquals("BAZ", namedQueryResource.getHints().get(0).getName());
-
- ormNamedQuery.removeHint(0);
- assertEquals(0, namedQueryResource.getHints().size());
- }
-
- public void testMoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- ormNamedQuery.addHint(0).setName("FOO");
- ormNamedQuery.addHint(1).setName("BAR");
- ormNamedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedQueryResource.getHints().size());
-
-
- ormNamedQuery.moveHint(2, 0);
- ListIterator<OrmQueryHint> hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
-
-
- ormNamedQuery.moveHint(0, 1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAR", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
-
- namedQueryResource.getHints().get(0).setName("FOO");
- namedQueryResource.getHints().get(1).setName("BAR");
- namedQueryResource.getHints().get(2).setName("BAZ");
-
- ListIterator<OrmQueryHint> hints = ormNamedQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().move(2, 0);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().move(0, 1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(0);
- assertFalse(ormNamedQuery.getHints().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
deleted file mode 100644
index 4d9ddf18e6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,1057 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmOneToManyMappingTests extends ContextModelTestCase
-{
- public OrmOneToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToManyMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each :ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals("oneToManyMapping", ormOneToManyMapping.getName());
- assertEquals("oneToManyMapping", oneToMany.getName());
-
- //set name in the resource model, verify context model updated
- oneToMany.setName("newName");
- assertEquals("newName", ormOneToManyMapping.getName());
- assertEquals("newName", oneToMany.getName());
-
- //set name to null in the resource model
- oneToMany.setName(null);
- assertNull(ormOneToManyMapping.getName());
- assertNull(oneToMany.getName());
- }
-
- public void testModifyName() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals("oneToManyMapping", ormOneToManyMapping.getName());
- assertEquals("oneToManyMapping", oneToMany.getName());
-
- //set name in the context model, verify resource model updated
- ormOneToManyMapping.setName("newName");
- assertEquals("newName", ormOneToManyMapping.getName());
- assertEquals("newName", oneToMany.getName());
-
- //set name to null in the context model
- ormOneToManyMapping.setName(null);
- assertNull(ormOneToManyMapping.getName());
- assertNull(oneToMany.getName());
- }
-
- public void testUpdateTargetEntity() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToMany.setTargetEntity(null);
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the context model
- ormOneToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- 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();
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToManyResource.getFetch());
-
- oneToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToManyResource.getFetch());
-
- //set fetch to null in the resource model
- oneToManyResource.setFetch(null);
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- 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();
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToManyResource.getFetch());
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
-
- ormOneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToManyResource.getFetch());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormOneToManyMapping.setSpecifiedFetch(null);
- assertNull(oneToManyResource.getFetch());
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- 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().getMappedByStrategy();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //setmappedBy to null in the resource model
- oneToMany.setMappedBy(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- 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().getMappedByStrategy();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- strategy.setMappedByAttribute("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- strategy.setMappedByAttribute(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToManyMapping contextMapping = (OrmOneToManyMapping) contextAttribute.getMapping();
- OrmOneToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToManyMapping contextMapping = (OrmOneToManyMapping) contextAttribute.getMapping();
- OrmOneToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdateMapKey() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNotNull(oneToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKey().setName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
-
- oneToMany.getMapKey().setName("myMapKey");
- oneToMany.setMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualOneToManyMapping.getSpecifiedMapKey());
- assertNull(virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertTrue(virtualOneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualOneToManyMapping.getMapKey());
- assertTrue(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualOneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertTrue(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setNoMapKey(true);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateOrderBy() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
-
- //set orderBy in the resource model, verify context model updated
- oneToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", oneToMany.getOrderBy());
-
- //set orderBy to null in the resource model
- oneToMany.setOrderBy(null);
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
- }
-
- public void testModifyOrderBy() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", oneToMany.getOrderBy());
-
- //set mappedBy to null in the context model
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
- }
-
- public void testIsNoOrdering() throws Exception {
- 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();
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- }
-
- public void testSetNoOrdering() throws Exception {
- 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();
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setNoOrdering(true);
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-//TODO
-// public boolean isOrderByPk() {
-// return "".equals(getOrderBy());
-// }
-//
-// public void setOrderByPk() {
-// setOrderBy("");
-// }
-
- public void testIsCustomOrdering() throws Exception {
- 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();
-
- assertFalse(ormOneToManyMapping.getOrderable().isCustomOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertTrue(ormOneToManyMapping.getOrderable().isCustomOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertFalse(ormOneToManyMapping.getOrderable().isCustomOrdering());
- }
-
- public void testOneToManyMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- 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().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- 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().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToOneToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- 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());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToManyMorphToManyToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- 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().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- JoinTable joinTable = ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals("name", joinTable.getJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("referenceName", joinTable.getJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- assertEquals("inverseName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("inverseReferenceName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- }
-
- public void testOneToManyMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToManyMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) virtualAttribute.getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- OrmOneToManyMapping specifiedOneToManyMapping = (OrmOneToManyMapping) virtualAttribute.convertToSpecified().getMapping();
- mapKeyNames = specifiedOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- specifiedOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = specifiedOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- specifiedOneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = specifiedOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch());
- assertEquals("test.Address", ormOneToManyMapping.getTargetEntity());
- assertNull(ormOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = ormOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java
deleted file mode 100644
index b0dfe76a21..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,1195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmOneToOneMappingTests extends ContextModelTestCase
-{
- public OrmOneToOneMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEntityWithOneToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals("oneToOneMapping", ormOneToOneMapping.getName());
- assertEquals("oneToOneMapping", oneToOne.getName());
-
- //set name in the resource model, verify context model updated
- oneToOne.setName("newName");
- assertEquals("newName", ormOneToOneMapping.getName());
- assertEquals("newName", oneToOne.getName());
-
- //set name to null in the resource model
- oneToOne.setName(null);
- assertNull(ormOneToOneMapping.getName());
- assertNull(oneToOne.getName());
- }
-
- public void testModifyName() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals("oneToOneMapping", ormOneToOneMapping.getName());
- assertEquals("oneToOneMapping", oneToOne.getName());
-
- //set name in the context model, verify resource model updated
- ormOneToOneMapping.setName("newName");
- assertEquals("newName", ormOneToOneMapping.getName());
- assertEquals("newName", oneToOne.getName());
-
- //set name to null in the context model
- ormOneToOneMapping.setName(null);
- assertNull(ormOneToOneMapping.getName());
- assertNull(oneToOne.getName());
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToOne.setTargetEntity(null);
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the context model
- ormOneToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- 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();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToOneResource.getFetch());
-
- oneToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToOneResource.getFetch());
-
- //set fetch to null in the resource model
- oneToOneResource.setFetch(null);
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- 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();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToOneResource.getFetch());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getSpecifiedFetch());
-
- ormOneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToOneResource.getFetch());
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormOneToOneMapping.setSpecifiedFetch(null);
- assertNull(oneToOneResource.getFetch());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- 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().getMappedByStrategy();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToOne.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToOne.setMappedBy(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- 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().getMappedByStrategy();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- strategy.setMappedByAttribute("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the context model
- strategy.setMappedByAttribute(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping contextMapping = (OrmOneToOneMapping) contextAttribute.getMapping();
- OrmOneToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping contextMapping = (OrmOneToOneMapping) contextAttribute.getMapping();
- OrmOneToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- 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.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.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.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.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.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.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- 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();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
-
- //set optional in the resource model, verify context model updated
- oneToOneResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOneResource.getOptional());
-
- oneToOneResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOneResource.getOptional());
-
- //set optional to null in the resource model
- oneToOneResource.setOptional(null);
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- 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();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
-
- //set optional in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneResource.getOptional());
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getSpecifiedOptional());
-
- ormOneToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneResource.getOptional());
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
-
- //set optional to null in the context model
- ormOneToOneMapping.setSpecifiedOptional(null);
- assertNull(oneToOneResource.getOptional());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- 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().getJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- OrmJoinColumn joinColumn = strategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = strategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = strategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- 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().getJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getJoinColumns().size());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, oneToOneResource.getJoinColumns().size());
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, oneToOneResource.getJoinColumns().size());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(0).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, oneToOneResource.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- 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().getJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getJoinColumns().size());
-
-
- strategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
-
-
- strategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
- }
-
- public void testOneToOneMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormOneToOneMapping.getName());
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertNull(ormOneToOneMapping.getTargetEntity());
-
-
- assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnStrategy().getJoinColumnsSize() > 0);
- //TODO default joinColumns
- //assertTrue(ormOneToOneMapping.defaultJoinColumns().hasNext());
-
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", oneToOneMapping.getName());
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn joinColumn =
- oneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", joinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", joinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", joinColumn.getSpecifiedTable());
-
- Cascade cascade = oneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormOneToOneMapping.getName());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- 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().getJoinColumnStrategy().getJoinColumnsSize() > 0);
-
- //TODO default join columns for specified xmlOneToOne mapping
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
-
- public void testOneToOneMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToManyToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- 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());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToOneMorphToOneToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- 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());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToOneMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
-
- joinColumn = ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("name", joinColumn.getName());
- assertEquals("referenceName", joinColumn.getReferencedColumnName());
- }
-
- public void testOneToOneMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- 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().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
-
-
-
-
- public void testAddPrimaryKeyJoinColumn() throws Exception {
- 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().getPrimaryKeyJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- OrmPrimaryKeyJoinColumn joinColumn = strategy.addPrimaryKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn joinColumn2 = strategy.addPrimaryKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn joinColumn3 = strategy.addPrimaryKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemovePrimaryKeyJoinColumn() throws Exception {
- 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().getPrimaryKeyJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getPrimaryKeyJoinColumns().size());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(2, oneToOneResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(1, oneToOneResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(0, oneToOneResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMovePrimaryKeyJoinColumn() throws Exception {
- 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().getPrimaryKeyJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getPrimaryKeyJoinColumns().size());
-
-
- strategy.movePrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- strategy.movePrimaryKeyJoinColumn(0, 1);
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java
deleted file mode 100644
index 429125de57..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase
-{
- public OrmPrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getName());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- primaryKeyJoinColumnResource.setName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getName());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setSpecifiedName("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("foo", primaryKeyJoinColumnResource.getName());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setSpecifiedName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setReferencedColumnName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- primaryKeyJoinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("foo", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getReferencedColumnName());
- }
-
-// public void testUpdateDefaultNameFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.javaEntity().getTable().setSpecifiedName("Foo");
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(null);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.getTable().setSpecifiedName("Bar");
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-// }
-
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("FOO", primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setColumnDefinition(null);
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- primaryKeyJoinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("FOO", primaryKeyJoinColumnResource.getColumnDefinition());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setColumnDefinition("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("foo", primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setColumnDefinition(null);
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getColumnDefinition());
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java
deleted file mode 100644
index 9a96d1436a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmQueryHintTests extends ContextModelTestCase
-{
- public OrmQueryHintTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
-
- //set name in the resource model, verify context model updated
- queryHintResource.setName("newName");
- assertEquals("newName", ormQueryHint.getName());
- assertEquals("newName", queryHintResource.getName());
-
- //set name to null in the resource model
- queryHintResource.setName(null);
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
-
- //set name in the context model, verify resource model updated
- ormQueryHint.setName("newName");
- assertEquals("newName", ormQueryHint.getName());
- assertEquals("newName", queryHintResource.getName());
-
- //set name to null in the context model
- ormQueryHint.setName(null);
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
- }
-
- public void testUpdateValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
-
- //set name in the resource model, verify context model updated
- queryHintResource.setValue("newName");
- assertEquals("newName", ormQueryHint.getValue());
- assertEquals("newName", queryHintResource.getValue());
-
- //set name to null in the resource model
- queryHintResource.setValue(null);
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
- }
-
- public void testModifyValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
-
- //set name in the context model, verify resource model updated
- ormQueryHint.setValue("newName");
- assertEquals("newName", ormQueryHint.getValue());
- assertEquals("newName", queryHintResource.getValue());
-
- //set name to null in the context model
- ormQueryHint.setValue(null);
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java
deleted file mode 100644
index f9c29b218a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java
+++ /dev/null
@@ -1,767 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualSecondaryTable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmSecondaryTableTests extends ContextModelTestCase
-{
- public OrmSecondaryTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set name in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().get(0).setName("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- assertEquals("FOO", secondaryTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getName());
-
- //set name to null in the resource model
- entityResource.getSecondaryTables().get(0).setName(null);
- assertNull(secondaryTable.getSpecifiedName());
- assertNull(entityResource.getSecondaryTables().get(0).getName());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set name in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedName("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedName());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getName());
-
- //set name to null in the context model
- secondaryTable.setSpecifiedName(null);
- assertNull(secondaryTable.getSpecifiedName());
- assertNull(entityResource.getSecondaryTables().get(0).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
-
- ReadOnlySecondaryTable ormSecondaryTable = ormEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("FOO", ormSecondaryTable.getSpecifiedName());
-
- ormEntity.getJavaTypeMapping().getSpecifiedSecondaryTables().iterator().next().setSpecifiedName("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedName());
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- assertNull(ormEntity.getSpecifiedSecondaryTables().iterator().next().getDefaultName());
- assertEquals("BAZ", ormEntity.getSpecifiedSecondaryTables().iterator().next().getSpecifiedName());
-
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set schema in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().get(0).setSchema("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- assertEquals("FOO", secondaryTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getSchema());
-
- //set schema to null in the resource model
- entityResource.getSecondaryTables().get(0).setSchema(null);
- assertNull(secondaryTable.getSpecifiedSchema());
- assertNull(entityResource.getSecondaryTables().get(0).getSchema());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set schema in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedSchema("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedSchema());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getSchema());
-
- //set schema to null in the context model
- secondaryTable.setSpecifiedSchema(null);
- assertNull(secondaryTable.getSpecifiedSchema());
- assertNull(entityResource.getSecondaryTables().get(0).getSchema());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedSchema("BAR");
-
- OrmVirtualSecondaryTable ormSecondaryTable = ormEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("BAR", ormSecondaryTable.getSpecifiedSchema());
-
- javaSecondaryTable.setSpecifiedSchema("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedSchema());
-
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- assertNull(ormEntity.getSpecifiedSecondaryTables().iterator().next().getDefaultSchema());
- assertEquals("BAZ", ormEntity.getSpecifiedSecondaryTables().iterator().next().getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentOrmEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childOrmEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertNull(childOrmEntity.getTable().getDefaultSchema());
-
- parentOrmEntity.getTable().setSpecifiedSchema("FOO");
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertEquals("FOO", childOrmEntity.getTable().getDefaultSchema());
-
- parentOrmEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertNull(childOrmEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- ormSecondaryTable.setSpecifiedName("FOO");
- assertNull(ormSecondaryTable.getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", ormSecondaryTable.getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", ormSecondaryTable.getDefaultSchema());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedSchema("JAVA_SCHEMA");
- assertEquals("BAR", ormSecondaryTable.getDefaultSchema()); //schema is not defaulted from underlying java
-
- getEntityMappings().setSpecifiedSchema(null);
- assertEquals("FOO", ormSecondaryTable.getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(ormSecondaryTable.getDefaultSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set catalog in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().get(0).setCatalog("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- assertEquals("FOO", secondaryTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getCatalog());
-
- //set catalog to null in the resource model
- entityResource.getSecondaryTables().get(0).setCatalog(null);
- assertNull(secondaryTable.getSpecifiedCatalog());
- assertNull(entityResource.getSecondaryTables().get(0).getCatalog());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set catalog in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedCatalog("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedCatalog());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getCatalog());
-
- //set catalog to null in the context model
- secondaryTable.setSpecifiedCatalog(null);
- assertNull(secondaryTable.getSpecifiedCatalog());
- assertNull(entityResource.getSecondaryTables().get(0).getCatalog());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedCatalog("BAR");
-
- OrmVirtualSecondaryTable ormSecondaryTable = ormEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("BAR", ormSecondaryTable.getSpecifiedCatalog());
-
- javaSecondaryTable.setSpecifiedCatalog("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedCatalog());
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- assertNull(ormEntity.getSpecifiedSecondaryTables().iterator().next().getDefaultCatalog());
- assertEquals("BAZ", ormEntity.getSpecifiedSecondaryTables().iterator().next().getSpecifiedCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- ormSecondaryTable.setSpecifiedName("FOO");
- assertNull(ormSecondaryTable.getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", ormSecondaryTable.getDefaultCatalog());
-
- getEntityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", ormSecondaryTable.getDefaultCatalog());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedCatalog("JAVA_CATALOG");
- assertEquals("BAR", ormSecondaryTable.getDefaultCatalog()); //schema is not defaulted from underlying java
-
- getEntityMappings().setSpecifiedCatalog(null);
- assertEquals("FOO", ormSecondaryTable.getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(ormSecondaryTable.getDefaultCatalog());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn2 = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn3 = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1);
- primaryKeyJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals(primaryKeyJoinColumn2, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn3, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn, primaryKeyJoinColumns.next());
-
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTableResource.getPrimaryKeyJoinColumns().size());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(2, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(1, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(0, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTableResource.getPrimaryKeyJoinColumns().size());
-
-
- ormSecondaryTable.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- ormSecondaryTable.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().get(0).setName("FOO");
- secondaryTableResource.getPrimaryKeyJoinColumns().get(1).setName("BAR");
- secondaryTableResource.getPrimaryKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().move(2, 0);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().move(0, 1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- assertEquals(0, ormSecondaryTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormSecondaryTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = secondaryTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = secondaryTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, secondaryTableResource.getUniqueConstraints().size());
-
- ormSecondaryTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormSecondaryTable.removeUniqueConstraint(1);
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormSecondaryTable.removeUniqueConstraint(0);
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, secondaryTableResource.getUniqueConstraints().size());
-
-
- ormSecondaryTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormSecondaryTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- JavaEntity javaEntity = (JavaEntity) ormPersistentType.getJavaPersistentType().getMapping();
- JavaSecondaryTable javaSecondaryTable = javaEntity.addSpecifiedSecondaryTable();
- javaSecondaryTable.setSpecifiedName("SECONDARY");
-
- ReadOnlySecondaryTable ormSecondaryTable = ormEntity.getSecondaryTables().iterator().next();
- assertTrue(ormSecondaryTable.isVirtual());
- assertFalse(ormSecondaryTable.getUniqueConstraints().iterator().hasNext());
-
-
- javaSecondaryTable.addUniqueConstraint().addColumnName("FOO");
- javaSecondaryTable.addUniqueConstraint().addColumnName("BAR");
- javaSecondaryTable.addUniqueConstraint().addColumnName("BAZ");
-
- List<ReadOnlyUniqueConstraint> uniqueConstraints = CollectionTools.list(ormSecondaryTable.getUniqueConstraints());
- assertEquals(3, uniqueConstraints.size());
- assertEquals("FOO", uniqueConstraints.get(0).getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.get(1).getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.get(2).getColumnNames().iterator().next());
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- OrmSecondaryTable ormSecondaryTable2 = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- ormSecondaryTable2.setSpecifiedName("SECONDARY");
-
- assertEquals("SECONDARY", ormSecondaryTable.getSpecifiedName());
- assertFalse(ormSecondaryTable2.isVirtual());
- assertEquals(3, ormSecondaryTable2.getUniqueConstraintsSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java
deleted file mode 100644
index e345249de2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmSequenceGeneratorTests extends ContextModelTestCase
-{
- public OrmSequenceGeneratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setName("FOO");
- assertEquals("FOO", sequenceGenerator.getName());
- assertEquals("FOO", sequenceGeneratorResource.getName());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setName(null);
- assertNull(sequenceGenerator.getName());
- assertNull(sequenceGeneratorResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setName("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getName());
- assertEquals("FOO", sequenceGenerator.getName());
-
- //set name to null in the context model
- sequenceGenerator.setName(null);
- assertNull(sequenceGeneratorResource.getName());
- assertNull(sequenceGenerator.getName());
- }
-
- public void testUpdateSpecifiedSequenceName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setSequenceName("FOO");
- assertEquals("FOO", sequenceGenerator.getSpecifiedSequenceName());
- assertEquals("FOO", sequenceGeneratorResource.getSequenceName());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setSequenceName(null);
- assertNull(sequenceGenerator.getSpecifiedSequenceName());
- assertNull(sequenceGeneratorResource.getSequenceName());
- }
-
- public void testModifySpecifiedSequenceName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedSequenceName("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getSequenceName());
- assertEquals("FOO", sequenceGenerator.getSpecifiedSequenceName());
-
- //set name to null in the context model
- sequenceGenerator.setSpecifiedSequenceName(null);
- assertNull(sequenceGeneratorResource.getSequenceName());
- assertNull(sequenceGenerator.getSpecifiedSequenceName());
- }
-
- public void testUpdateSpecifiedInitialValue() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set initial value in the resource model, verify context model updated
- sequenceGeneratorResource.setInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getInitialValue());
-
- //set initial value to 1, which happens to be the default, in the resource model
- sequenceGeneratorResource.setInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getInitialValue());
-
- //set initial value to null in the resource model
- sequenceGeneratorResource.setInitialValue(null);
- assertNull(sequenceGenerator.getSpecifiedInitialValue());
- assertNull(sequenceGeneratorResource.getInitialValue());
- }
-
- public void testModifySpecifiedInitialValue() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set initial value in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedInitialValue());
-
- sequenceGenerator.setSpecifiedInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedInitialValue());
-
- //set initial value to null in the context model
- sequenceGenerator.setSpecifiedInitialValue(null);
- assertNull(sequenceGeneratorResource.getInitialValue());
- assertNull(sequenceGenerator.getSpecifiedInitialValue());
- }
-
- public void testUpdateSpecifiedAllocationSize() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set allocation size in the resource model, verify context model updated
- sequenceGeneratorResource.setAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getAllocationSize());
-
- //set allocation size to 50, which happens to be the default, in the resource model
- sequenceGeneratorResource.setAllocationSize(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getAllocationSize());
-
- //set allocation size to null in the resource model
- sequenceGeneratorResource.setAllocationSize(null);
- assertNull(sequenceGenerator.getSpecifiedAllocationSize());
- assertNull(sequenceGeneratorResource.getAllocationSize());
- }
-
- public void testModifySpecifiedAllocationSize() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set allocation size in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedAllocationSize());
-
- sequenceGenerator.setSpecifiedAllocationSize(Integer.valueOf(50));
- assertEquals(Integer.valueOf(50), sequenceGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(50), sequenceGenerator.getSpecifiedAllocationSize());
-
- //set allocation size to null in the context model
- sequenceGenerator.setSpecifiedAllocationSize(null);
- assertNull(sequenceGeneratorResource.getAllocationSize());
- assertNull(sequenceGenerator.getSpecifiedAllocationSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java
deleted file mode 100644
index d0783f6dc9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmTableGeneratorTests extends ContextModelTestCase
-{
- public OrmTableGeneratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setName("FOO");
- assertEquals("FOO", tableGenerator.getName());
- assertEquals("FOO", tableGeneratorResource.getName());
-
- //set name to null in the resource model
- tableGeneratorResource.setName(null);
- assertNull(tableGenerator.getName());
- assertNull(tableGeneratorResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setName("FOO");
- assertEquals("FOO", tableGeneratorResource.getName());
- assertEquals("FOO", tableGenerator.getName());
-
- //set name to null in the context model
- tableGenerator.setName(null);
- assertNull(tableGeneratorResource.getName());
- assertNull(tableGenerator.getName());
- }
-
- public void testUpdateSpecifiedInitialValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set initial value in the resource model, verify context model updated
- tableGeneratorResource.setInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getInitialValue());
-
- //set initial value to 1, which happens to be the default, in the resource model
- tableGeneratorResource.setInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getInitialValue());
-
- //set initial value to null in the resource model
- tableGeneratorResource.setInitialValue(null);
- assertNull(tableGenerator.getSpecifiedInitialValue());
- assertNull(tableGeneratorResource.getInitialValue());
- }
-
- public void testModifySpecifiedInitialValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set initial value in the context model, verify resource model modified
- tableGenerator.setSpecifiedInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedInitialValue());
-
- tableGenerator.setSpecifiedInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
-
- //set initial value to null in the context model
- tableGenerator.setSpecifiedInitialValue(null);
- assertNull(tableGeneratorResource.getInitialValue());
- assertNull(tableGenerator.getSpecifiedInitialValue());
- }
-
- public void testUpdateSpecifiedAllocationSize() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set allocation size in the resource model, verify context model updated
- tableGeneratorResource.setAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getAllocationSize());
-
- //set allocation size to 50, which happens to be the default, in the resource model
- tableGeneratorResource.setAllocationSize(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getAllocationSize());
-
- //set allocation size to null in the resource model
- tableGeneratorResource.setAllocationSize(null);
- assertNull(tableGenerator.getSpecifiedAllocationSize());
- assertNull(tableGeneratorResource.getAllocationSize());
- }
-
- public void testModifySpecifiedAllocationSize() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set allocation size in the context model, verify resource model modified
- tableGenerator.setSpecifiedAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedAllocationSize());
-
- tableGenerator.setSpecifiedAllocationSize(Integer.valueOf(50));
- assertEquals(Integer.valueOf(50), tableGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(50), tableGenerator.getSpecifiedAllocationSize());
-
- //set allocation size to null in the context model
- tableGenerator.setSpecifiedAllocationSize(null);
- assertNull(tableGeneratorResource.getAllocationSize());
- assertNull(tableGenerator.getSpecifiedAllocationSize());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setTable("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedTable());
- assertEquals("FOO", tableGeneratorResource.getTable());
-
- //set name to null in the resource model
- tableGeneratorResource.setTable(null);
- assertNull(tableGenerator.getSpecifiedTable());
- assertNull(tableGeneratorResource.getTable());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedTable("FOO");
- assertEquals("FOO", tableGeneratorResource.getTable());
- assertEquals("FOO", tableGenerator.getSpecifiedTable());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedTable(null);
- assertNull(tableGeneratorResource.getTable());
- assertNull(tableGenerator.getSpecifiedTable());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setSchema("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedSchema());
- assertEquals("FOO", tableGeneratorResource.getSchema());
-
- //set name to null in the resource model
- tableGeneratorResource.setSchema(null);
- assertNull(tableGenerator.getSpecifiedSchema());
- assertNull(tableGeneratorResource.getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedSchema("FOO");
- assertEquals("FOO", tableGeneratorResource.getSchema());
- assertEquals("FOO", tableGenerator.getSpecifiedSchema());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedSchema(null);
- assertNull(tableGeneratorResource.getSchema());
- assertNull(tableGenerator.getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
-
- assertNull(tableGenerator.getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", tableGenerator.getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", tableGenerator.getDefaultSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setCatalog("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedCatalog());
- assertEquals("FOO", tableGeneratorResource.getCatalog());
-
- //set name to null in the resource model
- tableGeneratorResource.setCatalog(null);
- assertNull(tableGenerator.getSpecifiedCatalog());
- assertNull(tableGeneratorResource.getCatalog());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedCatalog("FOO");
- assertEquals("FOO", tableGeneratorResource.getCatalog());
- assertEquals("FOO", tableGenerator.getSpecifiedCatalog());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedCatalog(null);
- assertNull(tableGeneratorResource.getCatalog());
- assertNull(tableGenerator.getSpecifiedCatalog());
- }
-
- public void testUpdateSpecifiedPkColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setPkColumnName("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnName());
- assertEquals("FOO", tableGeneratorResource.getPkColumnName());
-
- //set name to null in the resource model
- tableGeneratorResource.setPkColumnName(null);
- assertNull(tableGenerator.getSpecifiedPkColumnName());
- assertNull(tableGeneratorResource.getPkColumnName());
- }
-
- public void testModifySpecifiedPkColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedPkColumnName("FOO");
- assertEquals("FOO", tableGeneratorResource.getPkColumnName());
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnName());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedPkColumnName(null);
- assertNull(tableGeneratorResource.getPkColumnName());
- assertNull(tableGenerator.getSpecifiedPkColumnName());
- }
-
- public void testUpdateSpecifiedValueColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setValueColumnName("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedValueColumnName());
- assertEquals("FOO", tableGeneratorResource.getValueColumnName());
-
- //set name to null in the resource model
- tableGeneratorResource.setValueColumnName(null);
- assertNull(tableGenerator.getSpecifiedValueColumnName());
- assertNull(tableGeneratorResource.getValueColumnName());
- }
-
- public void testModifySpecifiedValueColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedValueColumnName("FOO");
- assertEquals("FOO", tableGeneratorResource.getValueColumnName());
- assertEquals("FOO", tableGenerator.getSpecifiedValueColumnName());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedValueColumnName(null);
- assertNull(tableGeneratorResource.getValueColumnName());
- assertNull(tableGenerator.getSpecifiedValueColumnName());
- }
-
- public void testUpdateSpecifiedPkColumnValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setPkColumnValue("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnValue());
- assertEquals("FOO", tableGeneratorResource.getPkColumnValue());
-
- //set name to null in the resource model
- tableGeneratorResource.setPkColumnValue(null);
- assertNull(tableGenerator.getSpecifiedPkColumnValue());
- assertNull(tableGeneratorResource.getPkColumnValue());
- }
-
- public void testModifySpecifiedPkColumnValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedPkColumnValue("FOO");
- assertEquals("FOO", tableGeneratorResource.getPkColumnValue());
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnValue());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedPkColumnValue(null);
- assertNull(tableGeneratorResource.getPkColumnValue());
- assertNull(tableGenerator.getSpecifiedPkColumnValue());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- OrmTableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- assertEquals(0, tableGenerator.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableGeneratorResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableGeneratorResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, tableGeneratorResource.getUniqueConstraints().size());
-
- tableGenerator.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(1);
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(0);
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, tableGeneratorResource.getUniqueConstraints().size());
-
-
- tableGenerator.moveUniqueConstraint(2, 0);
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- tableGenerator.moveUniqueConstraint(0, 1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(0);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributes().iterator().next();
- IdMapping virtualIdMapping = (IdMapping) virtualAttribute.getMapping();
-
- JavaIdMapping javaIdMapping = (JavaIdMapping) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaTableGenerator javaTableGenerator = javaIdMapping.getGeneratorContainer().addTableGenerator();
- javaTableGenerator.setName("TABLE_GENERATOR");
-
-// >>> I'm going to argue there is no such thing as a "virtual" generator,
-// since a Java generator is *not* overridden when its ID mapping (or entity)
-// is overridden in the orm.xml file - both the orm.xml ID mapping and the
-// Java mapping can define an "active" generator as long as they have different
-// names ~bjv
- TableGenerator tableGenerator = virtualIdMapping.getGeneratorContainer().getTableGenerator();
- assertNull(tableGenerator);
-// Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
-// assertFalse(uniqueConstraints.hasNext());
-
- javaTableGenerator.addUniqueConstraint().addColumnName("FOO");
- javaTableGenerator.addUniqueConstraint().addColumnName("BAR");
- javaTableGenerator.addUniqueConstraint().addColumnName("BAZ");
-
- assertNull(tableGenerator);
-// uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
-// assertTrue(uniqueConstraints.hasNext());
-// assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-// assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
-// assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
-// assertFalse(uniqueConstraints.hasNext());
-
- OrmIdMapping ormIdMapping = (OrmIdMapping) virtualAttribute.convertToSpecified().getMapping();
-
- OrmTableGenerator ormTableGenerator2 = ormIdMapping.getGeneratorContainer().addTableGenerator();
- ormTableGenerator2.setName("TABLE_GENERATOR");
-
- assertEquals(0, ormTableGenerator2.getUniqueConstraintsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java
deleted file mode 100644
index ca9d06d9c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java
+++ /dev/null
@@ -1,827 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmTableTests extends ContextModelTestCase
-{
- public OrmTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
-
- //set name in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setName("FOO");
- assertEquals("FOO", ormTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getTable().getName());
-
- //set name to null in the resource model
- entityResource.getTable().setName(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable().getName());
-
- entityResource.getTable().setName("FOO");
- assertEquals("FOO", ormTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getTable().getName());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmTable ormTable = ((OrmEntity) ormPersistentType.getMapping()).getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
-
- //set name in the context model, verify resource model modified
- ormTable.setSpecifiedName("foo");
- assertEquals("foo", ormTable.getSpecifiedName());
- assertEquals("foo", entityResource.getTable().getName());
-
- //set name to null in the context model
- ormTable.setSpecifiedName(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedName("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameNoJava() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameFromEntityName() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- ormEntity.setSpecifiedName("foo");
-
- assertEquals("foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedName(null);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.getJavaTypeMapping().setSpecifiedName("foo");
- assertEquals("foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-
- parentXmlEntity.getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
-
- //set schema in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setSchema("FOO");
- assertEquals("FOO", ormTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getTable().getSchema());
-
- //set Schema to null in the resource model
- entityResource.getTable().setSchema(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable().getSchema());
-
- entityResource.getTable().setSchema("FOO");
- assertEquals("FOO", ormTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getTable().getSchema());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedSchema("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertNull(ormEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaNoJava() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertNull(childXmlEntity.getTable().getDefaultSchema());
-
- parentXmlEntity.getTable().setSpecifiedSchema("FOO");
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultSchema());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertNull(childXmlEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedSchema("JAVA_SCHEMA");
- assertEquals("JAVA_SCHEMA", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName("BLAH");
- //xml entity now has a table element so default schema is not taken from java
- assertEquals("BAR", ormEntity.getTable().getDefaultSchema());
-
-
- getEntityMappings().setSpecifiedSchema(null);
- assertEquals("FOO", ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName(null);
- assertEquals("JAVA_SCHEMA", ormEntity.getTable().getDefaultSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
-
- //set Schema in the context model, verify resource model modified
- ormTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormTable.getSpecifiedSchema());
- assertEquals("foo", entityResource.getTable().getSchema());
-
- //set Schema to null in the context model
- ormTable.setSpecifiedSchema(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
-
- //set Catalog in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setCatalog("FOO");
- assertEquals("FOO", ormTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getTable().getCatalog());
-
- //set Catalog to null in the resource model
- entityResource.getTable().setCatalog(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable().getCatalog());
-
- entityResource.getTable().setCatalog("FOO");
- assertEquals("FOO", ormTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getTable().getCatalog());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
-
- //set Catalog in the context model, verify resource model modified
- ormTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormTable.getSpecifiedCatalog());
- assertEquals("foo", entityResource.getTable().getCatalog());
-
- //set Catalog to null in the context model
- ormTable.setSpecifiedCatalog(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedCatalog("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertNull(ormEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogNoJava() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertNull(childXmlEntity.getTable().getDefaultCatalog());
-
- parentXmlEntity.getTable().setSpecifiedCatalog("FOO");
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultCatalog());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertNull(childXmlEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedCatalog("JAVA_CATALOG");
- assertEquals("JAVA_CATALOG", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName("BLAH");
- //xml entity now has a table element so default schema is not taken from java
- assertEquals("BAR", ormEntity.getTable().getDefaultCatalog());
-
-
- getEntityMappings().setSpecifiedCatalog(null);
- assertEquals("FOO", ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName(null);
- assertEquals("JAVA_CATALOG", ormEntity.getTable().getDefaultCatalog());
-}
-
-//
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// Entity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals("Foo", ormEntity.getName());
-//
-// //set class in the resource model, verify context model updated
-// entityResource.setClassName("com.Bar");
-// assertEquals("Bar", ormEntity.getName());
-//
-// entityResource.setName("Baz");
-// assertEquals("Baz", ormEntity.getName());
-//
-// //set class to null in the resource model
-// entityResource.setClassName(null);
-// assertEquals("Baz", ormEntity.getName());
-//
-// entityResource.setName(null);
-// assertNull(ormEntity.getName());
-// }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormEntity.getTable().getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormEntity.getTable().getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- assertEquals(0, ormEntity.getTable().getUniqueConstraintsSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormEntity.getTable().getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(0).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- assertEquals(3, tableResource.getUniqueConstraints().size());
-
- table.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(1);
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(0);
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- assertEquals(3, tableResource.getUniqueConstraints().size());
-
-
- table.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- table.moveUniqueConstraint(0, 1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-//TODO not yet supporting unique constriants from java
-// public void testUniqueConstraintsFromJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-//
-// ListIterator<OrmUniqueConstraint> uniqueConstraints = ormEntity.getTable().uniqueConstraints();
-// assertFalse(uniqueConstraints.hasNext());
-//
-// JavaEntity javaEntity = (JavaEntity) ormPersistentType.getJavaPersistentType().getMapping();
-// javaEntity.getTable().addUniqueConstraint(0).addColumnName(0, "FOO");
-// javaEntity.getTable().addUniqueConstraint(1).addColumnName(0, "BAR");
-// javaEntity.getTable().addUniqueConstraint(2).addColumnName(0, "BAZ");
-//
-//
-// XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertNull(entityResource.getTable());
-//
-// uniqueConstraints = ormEntity.getTable().uniqueConstraints();
-// assertTrue(uniqueConstraints.hasNext());
-// assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-// assertEquals("BAR", uniqueConstraints.next().columnNames().next());
-// assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
-// assertFalse(uniqueConstraints.hasNext());
-//
-// entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
-// assertEquals(0, ormEntity.getTable().uniqueConstraintsSize());
-// }
-
- public void testAbstractEntityGetDefaultNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity abstractEntity = (OrmEntity) abstractPersistentType.getMapping();
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity concreteEntity = (OrmEntity) concretePersistentType.getMapping();
-
- assertEquals(null, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertEquals(null, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
- assertEquals("AnnotationTestTypeChild", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
-
- //meta-data complete true, inheritance strategy no single-table
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(TYPE_NAME, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
- assertEquals("AnnotationTestType", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
-
-
- //set inheritance strategy to table-per-class in orm.xml
- abstractEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(null, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
- assertEquals("AnnotationTestTypeChild", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java
deleted file mode 100644
index 8086ff8db0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmTransientMappingTests extends ContextModelTestCase
-{
- public OrmTransientMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient");
- }
- });
- }
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientMapping");
- OrmTransientMapping xmlTransientnMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- XmlTransient transientResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0);
-
- assertEquals("transientMapping", xmlTransientnMapping.getName());
- assertEquals("transientMapping", transientResource.getName());
-
- //set name in the resource model, verify context model updated
- transientResource.setName("newName");
- assertEquals("newName", xmlTransientnMapping.getName());
- assertEquals("newName", transientResource.getName());
-
- //set name to null in the resource model
- transientResource.setName(null);
- assertNull(xmlTransientnMapping.getName());
- assertNull(transientResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientMapping");
- OrmTransientMapping xmlTransientnMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- XmlTransient transientResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0);
-
- assertEquals("transientMapping", xmlTransientnMapping.getName());
- assertEquals("transientMapping", transientResource.getName());
-
- //set name in the context model, verify resource model updated
- xmlTransientnMapping.setName("newName");
- assertEquals("newName", xmlTransientnMapping.getName());
- assertEquals("newName", transientResource.getName());
-
- //set name to null in the context model
- xmlTransientnMapping.setName(null);
- assertNull(xmlTransientnMapping.getName());
- assertNull(transientResource.getName());
- }
-
-
- public void testTransientMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityTransientMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormTransientMapping.getName());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", transientMapping.getName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.convertToSpecified(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormTransientMapping.getName());
- assertFalse(ormPersistentAttribute.isVirtual());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityTransientMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormTransientMapping.getName());
- }
-
- public void testTransientMorphToIdMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToVersionMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToTransientMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToEmbeddedMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToOneToOneMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToOneToManyMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToManyToOneMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToManyToManyMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient");
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("transient", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java
deleted file mode 100644
index da7a2d2abf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmVersionMappingTests extends ContextModelTestCase
-{
- public OrmVersionMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, JPA.COLUMN, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertEquals("versionMapping", ormVersionMapping.getName());
- assertEquals("versionMapping", versionResource.getName());
-
- //set name in the resource model, verify context model updated
- versionResource.setName("newName");
- assertEquals("newName", ormVersionMapping.getName());
- assertEquals("newName", versionResource.getName());
-
- //set name to null in the resource model
- versionResource.setName(null);
- assertNull(ormVersionMapping.getName());
- assertNull(versionResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertEquals("versionMapping", ormVersionMapping.getName());
- assertEquals("versionMapping", versionResource.getName());
-
- //set name in the context model, verify resource model updated
- ormVersionMapping.setName("newName");
- assertEquals("newName", ormVersionMapping.getName());
- assertEquals("newName", versionResource.getName());
-
- //set name to null in the context model
- ormVersionMapping.setName(null);
- assertNull(ormVersionMapping.getName());
- assertNull(versionResource.getName());
- }
-
- public void testUpdateTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(versionResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- versionResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, versionResource.getTemporal());
-
- versionResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, versionResource.getTemporal());
-
- versionResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, versionResource.getTemporal());
-
- //set temporal to null in the resource model
- versionResource.setTemporal(null);
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(versionResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(versionResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormVersionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) ormVersionMapping.getConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, versionResource.getTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
-
- ((TemporalConverter) ormVersionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, versionResource.getTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
-
- ((TemporalConverter) ormVersionMapping.getConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, versionResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormVersionMapping.setConverter(null);
- assertNull(versionResource.getTemporal());
- assertNull(ormVersionMapping.getConverter().getType());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
- public void testVersionMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityVersionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormVersionMapping.getName());
- assertNull(ormVersionMapping.getConverter().getType());
-
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", versionMapping.getName());
- assertEquals(TemporalConverter.class, versionMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) versionMapping.getConverter()).getTemporalType());
-
- Column column = versionMapping.getColumn();
- assertEquals("MY_COLUMN", column.getSpecifiedName());
- assertEquals(Boolean.TRUE, column.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, column.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, column.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, column.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", column.getColumnDefinition());
- assertEquals("MY_TABLE", column.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), column.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), column.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), column.getSpecifiedScale());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.convertToSpecified(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getAttributeNamed("id");
-
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormVersionMapping.getName());
- assertFalse(ormPersistentAttribute.isVirtual());
- assertNull(ormVersionMapping.getConverter().getType());
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertEquals("id", ormColumn.getName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getTable());
- assertEquals(255, ormColumn.getLength());
- assertEquals(0, ormColumn.getPrecision());
- assertEquals(0, ormColumn.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityVersionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "id");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormVersionMapping.getName());
- assertNull(ormVersionMapping.getConverter().getType());
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- public void testVersionMorphToIdMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testVersionMorphToBasicMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testVersionMorphToTransientMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToEmbeddedMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToOneToOneMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToOneToManyMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToManyToOneMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToManyToManyMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version");
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("version", ormPersistentAttribute.getMapping().getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java
deleted file mode 100644
index a3bb91a275..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmXmlTests extends ContextModelTestCase
-{
- public OrmXmlTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- getXmlPersistenceUnit().setName("foo");
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmXml getOrmXml() {
- return (OrmXml) getPersistenceUnit().getMappingFileRefs().iterator().next().getMappingFile();
- }
-
- public void testUpdateAddEntityMappings() throws Exception {
- assertEquals(2, getJpaProject().getJpaFilesSize());
- JpaXmlResource ormResource = getOrmXmlResource();
- ormResource.getContents().clear();
- ormResource.save(null);
-
- //the ContentType of the orm.xml file is no longer orm, so the jpa file is removed
- assertNull(getOrmXml());
- assertEquals(1, getJpaProject().getJpaFilesSize()); //should only be the persistence.xml file
-
- XmlEntityMappings xmlEntityMappings = OrmFactory.eINSTANCE.createXmlEntityMappings();
- xmlEntityMappings.setVersion("1.0");
- ormResource.getContents().add(xmlEntityMappings);
- ormResource.save(null);
-
- assertNotNull(getOrmXml().getRoot());
- assertEquals(2, getJpaProject().getJpaFilesSize());
- }
-
- public void testUpdateRemoveEntityMappings() throws Exception {
- JpaXmlResource ormResource = getOrmXmlResource();
-
- assertNotNull(getOrmXml().getRoot());
-
- ormResource.getContents().clear();
- assertNull(getOrmXml());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java
deleted file mode 100644
index b4ac863b89..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class PersistenceUnitDefaultsTests extends ContextModelTestCase
-{
- public PersistenceUnitDefaultsTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaultsResource = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- persistenceUnitMetadata.setPersistenceUnitDefaults(persistenceUnitDefaultsResource);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(true);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(false);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
- }
-
- public void testUpdateSchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifySchema2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCatalog2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the resource model, persistence-unit-defaults tag not removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCascadePersist2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-
- public void testUpdateAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyAccess2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java
deleted file mode 100644
index 42d6c8c41a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-public class PersistenceUnitMetadataTests extends ContextModelTestCase
-{
- public PersistenceUnitMetadataTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitMetadata persistenceUnitMetadata() {
- return getEntityMappings().getPersistenceUnitMetadata();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertFalse(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- assertFalse(persistenceUnitMetadata.isUnset());
- }
-
- public void testUpdateXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-
- public void testModifyXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyXmlMappingMetadataComplete2() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- //set another element on the persistence-unit-metadata element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java
deleted file mode 100644
index a74b1892a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class ClassRefTests extends ContextModelTestCase
-{
- public ClassRefTests(String name) {
- super(name);
- }
-
- public void testUpdateClassName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add class ref
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- ClassRef classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
-
- // test that class names are initially equal
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set xml class name to different name, test equality
- xmlClassRef.setJavaClass("com.bar.Foo");
-
- classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to empty string, test equality
- xmlClassRef.setJavaClass("");
-
- classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set name back to non empty string, test equality
- xmlClassRef.setJavaClass("com.foo.Bar");
-
- classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
- }
-
- public void testModifyClassName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add class ref
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- ClassRef classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
-
- // test that class names are initially equal
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set context class name to different name, test equality
- classRef.setClassName("com.bar.Foo");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to empty string, test equality
- classRef.setClassName("");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to null, test equality
- classRef.setClassName(null);
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set name back to non-null, test equality
- classRef.setClassName("com.foo.Bar");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
- }
-
-
- public void testGetPersistentType() throws Exception {
- createTestType();
-
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- ClassRef classRef = getSpecifiedClassRef();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRef.getJavaPersistentType().getName());
-
- //test setting to a class that does not exist in the project
- xmlClassRef.setJavaClass("com.foo.Bar");
-
- classRef = getSpecifiedClassRef();
- assertNull(classRef.getJavaPersistentType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java
deleted file mode 100644
index e6456ad1f4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCorePersistenceContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCorePersistenceContextModelTests.class.getPackage().getName());
- suite.addTestSuite(RootContextNodeTests.class);
- suite.addTestSuite(PersistenceXmlTests.class);
- suite.addTestSuite(PersistenceTests.class);
- suite.addTestSuite(PersistenceUnitTests.class);
- suite.addTestSuite(MappingFileRefTests.class);
- suite.addTestSuite(ClassRefTests.class);
- return suite;
- }
-
- private JptCorePersistenceContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java
deleted file mode 100644
index 7881090779..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class MappingFileRefTests extends ContextModelTestCase
-{
- public MappingFileRefTests(String name) {
- super(name);
- }
-
- protected MappingFileRef mappingFileRef() {
- return getPersistenceUnit().getMappingFileRefs().iterator().next();
- }
-
- public void testUpdateFileName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add mapping file ref
- XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlFileRef.setFileName("foo.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlFileRef);
- MappingFileRef fileRef = persistenceUnit.getSpecifiedMappingFileRefs().iterator().next();
-
- // test that file names are initially equal
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set xml to different file name, test equality
- xmlFileRef.setFileName("bar.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to empty string, test equality
- xmlFileRef.setFileName("");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to null, test equality
- xmlFileRef.setFileName(null);
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name back to non-null, test equality
- xmlFileRef.setFileName("baz.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
- }
-
- public void testModifyFileName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add mapping file ref
- XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlFileRef.setFileName("foo.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlFileRef);
- MappingFileRef fileRef = persistenceUnit.getSpecifiedMappingFileRefs().iterator().next();
-
- // test that file names are initially equal
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set context to different file name, test equality
- fileRef.setFileName("bar.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to empty string, test equality
- fileRef.setFileName("");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to null, test equality
- fileRef.setFileName(null);
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name back to non-null, test equality
- fileRef.setFileName("baz.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java
deleted file mode 100644
index d7655ef4db..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class PersistenceTests extends ContextModelTestCase
-{
- public PersistenceTests(String name) {
- super(name);
- }
-
- protected Persistence persistence() {
- return getRootContextNode().getPersistenceXml().getPersistence();
- }
-
- public void testUpdateAddPersistenceUnit() throws Exception {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence();
-
- // clear xml persistence units, test that it's clear in context
- xmlPersistence.getPersistenceUnits().clear();
-
- assertEquals(0, persistence.getPersistenceUnitsSize());
-
- // add xml persistence unit, test that it's added to context
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // add another, test that it *isn't* add to context
- xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test2");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(1, persistence.getPersistenceUnitsSize());
- }
-
- public void testModifyAddPersistencUnit() {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = persistence();
-
- // clear xml persistence units, test that it's clear in context
- xmlPersistence.getPersistenceUnits().clear();
- assertEquals(0, persistence.getPersistenceUnitsSize());
-
- // add persistence unit, test that it's added to resource
- persistence.addPersistenceUnit();
-
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // add another, test that we get an exception
- boolean exception = false;
- try {
- persistence.addPersistenceUnit();
- }
- catch (IllegalStateException e) {
- exception = true;
- }
-
- assertTrue(exception);
- }
-
- public void testUpdateRemovePersistenceUnit() throws Exception {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence();
-
- // add a persistence unit and test that there are two existing xml and
- // one context persistence unit
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(2, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove persistence unit from xml, test that context remains unchanged
- xmlPersistenceUnit = xmlPersistence.getPersistenceUnits().get(0);
- xmlPersistence.getPersistenceUnits().remove(xmlPersistenceUnit);
-
- assertEquals(1, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove another one from xml, text that it's now removed from context
- xmlPersistenceUnit = xmlPersistence.getPersistenceUnits().get(0);
- xmlPersistence.getPersistenceUnits().remove(xmlPersistenceUnit);
-
- assertEquals(0, xmlPersistence.getPersistenceUnits().size());
- assertEquals(0, persistence.getPersistenceUnitsSize());
- }
-
- public void testModifyRemovePersistenceUnit() {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = persistence();
-
- // add a persistence unit and test that there are two existing xml and
- // one context persistence unit
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(2, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove persistence unit, test that it's removed from resource and that
- // a *new* persistence unit representing the previously unrepresented one
- // is present
- persistence.removePersistenceUnit(0);
-
- assertEquals(1, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove new persistence unit, test that it's removed from resource and
- // context
- persistence.removePersistenceUnit(0);
-
- assertEquals(0, xmlPersistence.getPersistenceUnits().size());
- assertEquals(0, persistence.getPersistenceUnitsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java
deleted file mode 100644
index 48befbb7ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-/**
- * PersistenceUnitTestCase
- */
-@SuppressWarnings("nls")
-public abstract class PersistenceUnitTestCase extends ContextModelTestCase
-{
- protected PropertyChangeEvent propertyChangedEvent;
-
- protected int propertyChangedEventCount;
-
- protected int propertiesTotal;
-
- protected int modelPropertiesSizeOriginal;
-
- protected int modelPropertiesSize;
-
- // ********** constructors **********
- protected PersistenceUnitTestCase(String name) {
- super(name);
- }
-
- // ****** abstract methods *******
- protected abstract PersistenceUnitProperties getModel();
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- protected abstract void populatePu();
-
- /**
- * Gets the model's property identified by the given propertyName.
- *
- * @param propertyName
- * name of property to get
- * @throws Exception
- */
- protected abstract Object getProperty(String propertyName) throws Exception;
-
-
- /**
- * Sets the model's property identified by the given propertyName.
- * Used in verifySetProperty()
- *
- * @param propertyName
- * name of property to be set
- * @param newValue
- * value of property
- * @throws Exception
- */
- protected abstract void setProperty(String propertyName, Object newValue) throws Exception;
-
-
- // ****** convenience test methods *******
-
- protected String getPropertyStringValueOf(Object value) {
- return AbstractPersistenceUnitProperties.getPropertyStringValueOf(value);
- }
-
- protected <E> E getFirstElement(Iterator<E> iterator) {
- if(iterator.hasNext()) {
- return iterator.next();
- }
- return null;
- }
-
- /**
- * Put into persistenceUnit properties. Do not allows to put duplicate entry.
- *
- * @param key -
- * PersistenceUnit property key
- * @param value -
- * property value
- */
- protected void persistenceUnitSetProperty(String key, Object value) {
-
- this.persistenceUnitSetProperty( key, value, false);
- }
-
- protected void persistenceUnitSetProperty(String key, Object value, boolean allowDuplicates) {
- if (key == null) {
- throw new IllegalArgumentException("PersistenceUnit property key cannot be null");
- }
- if (value == null)
- this.setNullProperty(key);
- else
- this.putProperty_(key, value, allowDuplicates);
- }
-
- private void putProperty_(String puKey, Object value, boolean allowDuplicates) {
- this.clearEvent();
- this.getPersistenceUnit().setProperty(puKey, this.getPropertyStringValueOf(value), allowDuplicates);
- }
-
- protected void setNullProperty(String puKey) {
- this.clearEvent();
- this.getPersistenceUnit().setProperty(puKey, null, false);
- }
-
- protected void clearEvent() {
- this.propertyChangedEvent = null;
- this.propertyChangedEventCount = 0;
- }
-
- protected void throwMissingDefinition(String methodName, String propertyName) throws NoSuchFieldException {
- throw new NoSuchFieldException("Missing Definition for: " + methodName + "( " + propertyName + ")");
- }
-
- public void throwUnsupportedOperationException(ListEvent e) {
- throw new UnsupportedOperationException(e.getListName());
- }
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- PersistenceUnitTestCase.this.propertyChangedEvent = event;
- PersistenceUnitTestCase.this.propertyChangedEventCount++;
- }
-
- @Override
- public String toString() {
- return "PersistenceUnit listener";
- }
- };
- }
-
- /**
- * Verify if the property exists in the pesistence.xml
- */
- protected boolean propertyExists(String puPropertyName) {
- return this.getPersistenceUnit().getProperty(puPropertyName) != null;
- }
-
- protected boolean propertyValueEquals(String puPropertyName, String propertyValue) {
- return this.getPersistenceUnit().getProperty(puPropertyName).getValue().equals(propertyValue);
- }
-
- // ****** verify PersistenceUnit properties *******
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyAAValue(Boolean expectedValue, Boolean subjectValue, PropertyValueModel<Boolean> aa, String persistenceXmlKey) {
- assertEquals(expectedValue, subjectValue);
- assertEquals(expectedValue, aa.getValue());
- if (expectedValue != null) {
- assertTrue("PersistenceUnit property value not equals", this.propertyValueEquals(persistenceXmlKey, expectedValue.toString()));
- }
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected <T extends Enum<T>> void verifyAAValue(T expectedValue, T subjectValue, PropertyValueModel<? extends Enum<T>> aa, String puKey) {
- assertEquals(expectedValue, subjectValue);
- assertEquals(expectedValue, aa.getValue());
- if (expectedValue != null) {
- assertTrue("PersistenceUnit property value not equals", this.propertyValueEquals(puKey, this.getPropertyStringValueOf(expectedValue)));
- }
- }
-
- /**
- * Performs the following tests:<br>
- * 1. verify total number of PersistenceUnit properties<br>
- * 2. verify PU has the given propertyName<br>
- * 3. verify listening to propertyListAdapter<br>
- * 4. verify that the model can identify propertyName<br>
- */
- protected void verifyInitialState(String propertyName, String puKey, ListValueModel<PersistenceUnit.Property> propertyListAdapter) throws Exception {
- assertEquals("Total not updated in populatePu(): ", propertyListAdapter.size(), this.propertiesTotal);
- this.verifyPuHasProperty(puKey, "Property not added to populatePu()");
- this.verifyHasListeners(propertyListAdapter);
- this.verifyHasListeners(this.getModel(), propertyName);
-
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- assertTrue("model.itemIsProperty() is false: ", this.getModel().itemIsProperty(property));
- assertEquals("propertyIdFor() not updated: ", propertyName, this.getModel().propertyIdOf(property));
- }
-
- /**
- * Verifies that the persistence unit is populated, and that the model for
- * the tested Property is initialized with the value from the persistence
- * unit.
- * @throws Exception
- */
- protected void verifyModelInitialized(String puKey, Object expectedValue) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- assertTrue("model.itemIsProperty() is false: ", this.getModel().itemIsProperty(property));
-
- assertTrue("PersistenceUnit not populated - populatedPu()", this.propertyValueEquals(puKey, this.getPropertyStringValueOf(expectedValue)));
- String propertyName = this.getModel().propertyIdOf(property);
- Object modelValue = this.getProperty(propertyName);
- assertEquals(
- "Model not initialized - model.initializeProperties() - modelValue = " + modelValue,
- expectedValue,
- modelValue);
- }
-
- /**
- * Performs the following operations with the property:<br>
- * 1. verifies the initial state<br>
- * 2. persistenceUnit putProperty<br>
- * 3. adapter setProperty<br>
- */
- protected void verifySetProperty(String puKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Replace
- this.persistenceUnitSetProperty(puKey, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // Replace by setting model object
- this.clearEvent();
- this.setProperty(propertyName, testValue1);
- this.verifyPutProperty(propertyName, testValue1);
- }
-
- /**
- * Performs the following operations with the property:<br>
- * 1. performs a remove on the PU<br>
- * 2. performs a add with putProperty<br>
- * 3. performs a replace with putProperty<br>
- */
- protected void verifyAddRemoveProperty(String puKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.verifyPuHasProperty(puKey, "persistenceUnit.properties doesn't contains: ");
- this.getPersistenceUnit().removeProperty(puKey);
- assertNull(this.getPersistenceUnit().getProperty(puKey));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- this.verifyPutProperty(propertyName, null);
-
- // Add original CacheTypeDefault
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(puKey, testValue1);
- this.verifyPutProperty(propertyName, testValue1);
-
- // Replace
- this.persistenceUnitSetProperty(puKey, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
- }
-
- /**
- * Verifies the model's property identified by the given propertyName
- * Used in verifySetProperty() and verifyAddRemoveProperty
- *
- * @param propertyName
- * name of property to be verified
- * @param expectedValue
- * @throws Exception
- */
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
-
- this.verifyPutEvent(propertyName, this.getProperty(propertyName), expectedValue);
- }
-
- /**
- * Verifies the event of the put() action.
- *
- * @param propertyName
- * name of property to be verified
- * @param propertyValue
- * value of property
- * @param expectedValue
- * @throws Exception
- */
- protected void verifyPutEvent(String propertyName, Object propertyValue, Object expectedValue) {
-
- this.verifyEvent(propertyName);
- this.verifyEventValue(propertyValue, expectedValue);
- }
-
- /**
- * Performs the following tests:<br>
- * 1. verifies the new value of this.propertyChangedEvent<br>
- * 2. verifies the given value<br>
- */
- protected void verifyEventValue(Object value, Object expectedValue) {
- // verify event value
- assertEquals(expectedValue, this.propertyChangedEvent.getNewValue());
- assertEquals(expectedValue, value);
- }
-
- /**
- * Performs the following tests:<br>
- * 1. verifies that an event is fired<br>
- * 2. verifies that it is the correct event<br>
- * 3. verifies that a single event is fired<br>
- */
- protected void verifyEvent(String propertyName) {
- // verify event received
- assertNotNull("No Event Fired.", this.propertyChangedEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.propertyChangedEvent.getPropertyName(), propertyName);
- // verify event occurrence
- assertTrue("No Event Received.", this.propertyChangedEventCount > 0);
- assertTrue("Multiple Event Received (" + this.propertyChangedEventCount + ")",
- this.propertyChangedEventCount < 2);
- }
-
- protected void verifyHasNoListeners(ListValueModel<?> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- protected void verifyHasListeners(ListValueModel<?> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- protected void verifyHasListeners(PersistenceUnitProperties model, String propertyName) throws Exception {
- assertTrue("Listener not added in setUp() - " + propertyName, ((AbstractModel) model).hasAnyPropertyChangeListeners(propertyName));
- }
-
- protected void verifyHasListeners(PropertyValueModel<?> pvm, String propertyName) throws Exception {
- assertTrue(((AbstractModel) pvm).hasAnyPropertyChangeListeners(propertyName));
- }
-
- protected void verifyPuHasProperty(String puPropertyName, String msg) {
- assertTrue(msg + " - " + puPropertyName, this.propertyExists(puPropertyName));
- }
-
- protected void verifyPuHasNotProperty(String puPropertyName, String msg) {
- assertFalse(msg + " - " + puPropertyName, this.propertyExists(puPropertyName));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java
deleted file mode 100644
index d6a932cd4e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java
+++ /dev/null
@@ -1,1245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlProperties;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlProperty;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class PersistenceUnitTests extends ContextModelTestCase
-{
-
- protected static final String INNER_CLASS_NAME = "InnerAnnotationTestType";
- protected static final String FULLY_QUALIFIED_INNER_CLASS_NAME = PACKAGE_NAME + "." + TYPE_NAME + "." + INNER_CLASS_NAME;
-
- public static final String OTHER_TYPE_NAME = "OtherTestType";
- public static final String FULLY_QUALIFIED_OTHER_TYPE_NAME = PACKAGE_NAME + "." + OTHER_TYPE_NAME;
-
-
- public PersistenceUnitTests(String name) {
- super(name);
- }
-
- public void testUpdateName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that names are initially equal
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to different name, test equality
- xmlPersistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to empty string, test equality
- xmlPersistenceUnit.setName("");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to null, test equality
- xmlPersistenceUnit.setName(null);
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name back to non-null, test equality
- xmlPersistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
- }
-
- public void testModifyName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that names are initially equal
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to different name, test equality
- persistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to empty string, test equality
- persistenceUnit.setName("");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to null, test equality
- persistenceUnit.setName(null);
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name back to non-null, test equality
- persistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
- }
-
- public void testUpdateTransactionType() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(xmlPersistenceUnit.getTransactionType());
- assertNull(persistenceUnit.getSpecifiedTransactionType());
-
- // 2 - set value, context changed
- xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.JTA);
-
- assertEquals(PersistenceUnitTransactionType.JTA, persistenceUnit.getSpecifiedTransactionType());
-
- xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- assertEquals(PersistenceUnitTransactionType.RESOURCE_LOCAL, persistenceUnit.getSpecifiedTransactionType());
-
- // 3 - unset value, context changed
- xmlPersistenceUnit.setTransactionType(null);
-
- assertNull(persistenceUnit.getSpecifiedTransactionType());
- }
-
- public void testModifyTransactionType() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(xmlPersistenceUnit.getTransactionType());
- assertNull(persistenceUnit.getSpecifiedTransactionType());
-
- // 2 - set context value, resource changed
- persistenceUnit.setSpecifiedTransactionType(PersistenceUnitTransactionType.JTA);
-
- assertEquals(XmlPersistenceUnitTransactionType.JTA, xmlPersistenceUnit.getTransactionType());
-
- persistenceUnit.setSpecifiedTransactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- assertEquals(XmlPersistenceUnitTransactionType.RESOURCE_LOCAL, xmlPersistenceUnit.getTransactionType());
-
- // 3 - set context value to default, resource unset
- persistenceUnit.setSpecifiedTransactionType(null);
-
- assertNull(persistenceUnit.getSpecifiedTransactionType());
- assertNull(xmlPersistenceUnit.getTransactionType());
- }
-
- public void testUpdateDescription() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that descriptions are initially equal
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to different description, test equality
- xmlPersistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to empty string, test equality
- xmlPersistenceUnit.setDescription("");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to null, test equality
- xmlPersistenceUnit.setDescription(null);
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description back to non-null, test equality
- xmlPersistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
- }
-
- public void testModifyDescription() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that descriptions are initially equal
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to different description, test equality
- persistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to empty string, test equality
- persistenceUnit.setDescription("");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to null, test equality
- persistenceUnit.setDescription(null);
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description back to non-null, test equality
- persistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
- }
-
- public void testUpdateProvider() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that providers are initially equal
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to different provider, test equality
- xmlPersistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to empty string, test equality
- xmlPersistenceUnit.setProvider("");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to null, test equality
- xmlPersistenceUnit.setProvider(null);
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider back to non-null, test equality
- xmlPersistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
- }
-
- public void testModifyProvider() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that providers are initially equal
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to different provider, test equality
- persistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to empty string, test equality
- persistenceUnit.setProvider("");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to null, test equality
- persistenceUnit.setProvider(null);
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider back to non-null, test equality
- persistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
- }
-
- public void testUpdateJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that jtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to different jtaDataSource, test equality
- xmlPersistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to empty string, test equality
- xmlPersistenceUnit.setJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to null, test equality
- xmlPersistenceUnit.setJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource back to non-null, test equality
- xmlPersistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
- }
-
- public void testModifyJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that jtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to different jtaDataSource, test equality
- persistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to empty string, test equality
- persistenceUnit.setJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to null, test equality
- persistenceUnit.setJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource back to non-null, test equality
- persistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
- }
-
- public void testUpdateNonJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that nonJtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to different nonJtaDataSource, test equality
- xmlPersistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to empty string, test equality
- xmlPersistenceUnit.setNonJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to null, test equality
- xmlPersistenceUnit.setNonJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource back to non-null, test equality
- xmlPersistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
- }
-
- public void testModifyNonJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that nonJtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to different nonJtaDataSource, test equality
- persistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to empty string, test equality
- persistenceUnit.setNonJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to null, test equality
- persistenceUnit.setNonJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource back to non-null, test equality
- persistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
- }
-
- public void testUpdateJarFileRefs1() {
- // TODO
- }
-
- public void testUpdateJarFileRefs2() {
- // TODO
- }
-
- public void testUpdateImpliedMappingFileRef1() throws Exception {
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource ormResource = getOrmXmlResource();
- assertTrue(ormResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
-
- // remove orm.xml
- deleteResource(ormResource);
-
- assertFalse(ormResource.fileExists());
- assertNull(persistenceUnit.getImpliedMappingFileRef());
- }
-
- public void testUpdateImpliedMappingFileRef2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource ormResource = getOrmXmlResource();
- assertTrue(ormResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
-
- // add specified orm.xml
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("META-INF/orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- assertTrue(ormResource.fileExists());
- assertNull(persistenceUnit.getImpliedMappingFileRef());
- }
-
- public void testUpdateSpecifiedMappingFileRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(0, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // add mapping file ref, test that it's added to context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // add another ...
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(2, persistenceUnit.getSpecifiedMappingFileRefsSize());
- }
-
- public void testUpdateSpecifiedMappingFileRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two mapping file refs and test that there are two existing in xml and context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(xmlPersistenceUnit.getMappingFiles().size(), 2);
- assertEquals(2, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // remove mapping file ref from xml, test that it's removed from context
- xmlMappingFileRef = xmlPersistenceUnit.getMappingFiles().get(0);
- xmlPersistenceUnit.getMappingFiles().remove(xmlMappingFileRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // remove another one ...
- xmlMappingFileRef = xmlPersistenceUnit.getMappingFiles().get(0);
- xmlPersistenceUnit.getMappingFiles().remove(xmlMappingFileRef);
-
- assertEquals(0, persistenceUnit.getSpecifiedMappingFileRefsSize());
- }
-
- public void testModifySpecifiedMappingFileRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(0, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // add mapping file ref, test that it's added to resource
- persistenceUnit.addSpecifiedMappingFileRef("foo");
-
- assertEquals(1, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
-
- // add another ...
- persistenceUnit.addSpecifiedMappingFileRef("bar");
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
- assertEquals("bar", xmlPersistenceUnit.getMappingFiles().get(1).getFileName());
-
- assertEquals(2, xmlPersistenceUnit.getMappingFiles().size());
-
- // add another, testing order
- persistenceUnit.addSpecifiedMappingFileRef(0, "baz");
- assertEquals(3, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals("baz", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(1).getFileName());
- assertEquals("bar", xmlPersistenceUnit.getMappingFiles().get(2).getFileName());
- }
-
- public void testModifySpecifiedMappingFileRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two mapping file refs and test that there are two existing in xml and context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(2, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(2, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // remove mapping file ref from context, test that it's removed from xml
- persistenceUnit.removeSpecifiedMappingFileRef(0);
-
- assertEquals(1, xmlPersistenceUnit.getMappingFiles().size());
-
- // remove another one ...
- persistenceUnit.removeSpecifiedMappingFileRef(0);
-
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- }
-
- public void testUpdateClassRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- assertEquals(0, persistenceUnit.getSpecifiedClassRefsSize());
-
- // add mapping file ref, test that it's added to context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedClassRefsSize());
-
- // add another ...
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, persistenceUnit.getSpecifiedClassRefsSize());
- }
-
- public void testUpdateClassRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two class refs and test that there are two existing in xml and context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals(2, persistenceUnit.getSpecifiedClassRefsSize());
-
- // remove class ref from xml, test that it's removed from context
- xmlClassRef = xmlPersistenceUnit.getClasses().get(0);
- xmlPersistenceUnit.getClasses().remove(xmlClassRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedClassRefsSize());
-
- // remove another one ...
- xmlClassRef = xmlPersistenceUnit.getClasses().get(0);
- xmlPersistenceUnit.getClasses().remove(xmlClassRef);
-
- assertEquals(0, persistenceUnit.getSpecifiedClassRefsSize());
- }
-
- public void testModifyClassRefs1() throws Exception {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- assertEquals(0, persistenceUnit.getSpecifiedClassRefsSize());
-
- // add class ref, test that it's added to context
- persistenceUnit.addSpecifiedClassRef("Foo");
-
- getPersistenceXmlResource().save(null);
- assertEquals(1, xmlPersistenceUnit.getClasses().size());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
-
- // add another ...
- persistenceUnit.addSpecifiedClassRef("Bar");
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
- assertEquals("Bar", xmlPersistenceUnit.getClasses().get(1).getJavaClass());
-
-
- persistenceUnit.addSpecifiedClassRef(0, "Baz");
-
- assertEquals(3, xmlPersistenceUnit.getClasses().size());
- assertEquals("Baz", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(1).getJavaClass());
- assertEquals("Bar", xmlPersistenceUnit.getClasses().get(2).getJavaClass());
- }
-
- public void testModifyClassRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two class refs and test that there are two existing in xml and context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals(2, persistenceUnit.getSpecifiedClassRefsSize());
-
- // remove class ref from context, test that it's removed from xml
- persistenceUnit.removeSpecifiedClassRef(0);
-
- assertEquals(1, xmlPersistenceUnit.getClasses().size());
-
- // remove another one ...
- persistenceUnit.removeSpecifiedClassRef(0);
-
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- }
-
- public void testImpliedClassRefs1() throws Exception {
- createTestEntityWithPersistentInnerClass();
-
- getJpaProject().setDiscoversAnnotatedClasses(false);
- getPersistenceUnit().setSpecifiedExcludeUnlistedClasses(Boolean.TRUE);
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- getJpaProject().setDiscoversAnnotatedClasses(true);
- getPersistenceUnit().setSpecifiedExcludeUnlistedClasses(Boolean.FALSE);
- assertEquals(2, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_TYPE_NAME);
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_TYPE_NAME);
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- addXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- removeXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_INNER_CLASS_NAME);
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
- }
-
- protected void verifyVirtualClassRef(String className) {
- if (this.getVirtualClassRef(className) == null) {
- fail("missing virtual class ref: " + className);
- }
- }
-
- protected ClassRef getVirtualClassRef(String className) {
- for (ClassRef ref : this.getPersistenceUnit().getImpliedClassRefs()) {
- if (Tools.valuesAreEqual(ref.getClassName(), className)) {
- return ref;
- }
- }
- return null;
- }
-
- public void testImpliedClassRefs2() throws Exception {
- createTestEntity();
- getJpaProject().setDiscoversAnnotatedClasses(true);
- JavaResourceType javaType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(1, CollectionTools.size(getPersistenceUnit().getImpliedClassRefs()));
-
- javaType.removeAnnotation(JPA.ENTITY);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- javaType.addAnnotation(JPA.EMBEDDABLE);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
-
- javaType.removeAnnotation(JPA.EMBEDDABLE);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- javaType.addAnnotation(JPA.MAPPED_SUPERCLASS);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- }
-
- public void testRenamePersistentTypeImpliedClassRefs() throws Exception {
- getJavaProject().getJpaProject().setDiscoversAnnotatedClasses(true);
- ICompilationUnit testType = createTestEntity();
- @SuppressWarnings("unused")
- ICompilationUnit otherTestType = this.createTestOtherTypeEntity();
-
- ClassRef testTypeClassRef = this.getVirtualClassRef(FULLY_QUALIFIED_TYPE_NAME);
- ClassRef otherTestTypeClassRef = this.getVirtualClassRef(FULLY_QUALIFIED_OTHER_TYPE_NAME);
-
- assertNotNull(testTypeClassRef);
- assertNotNull(otherTestTypeClassRef);
-
- JavaPersistentType testJavaPersistentType = testTypeClassRef.getJavaPersistentType();
- JavaPersistentType otherTestJavaPersistentType = otherTestTypeClassRef.getJavaPersistentType();
-
- testType.findPrimaryType().rename("TestType2", false, null);
-
- testTypeClassRef = this.getVirtualClassRef("test.TestType2");
- otherTestTypeClassRef = this.getVirtualClassRef(FULLY_QUALIFIED_OTHER_TYPE_NAME);
-
- assertNotNull(testTypeClassRef);
- assertNotNull(otherTestTypeClassRef);
-
- assertEquals(otherTestJavaPersistentType, otherTestTypeClassRef.getJavaPersistentType());
- assertNotSame(testJavaPersistentType, testTypeClassRef.getJavaPersistentType());
- }
-
- public void testUpdateExcludeUnlistedClasses() throws Exception {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 2 - set value, context changed
- xmlPersistenceUnit.setExcludeUnlistedClasses(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertTrue(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.TRUE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- xmlPersistenceUnit.setExcludeUnlistedClasses(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.FALSE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 3 - unset value, context changed
- xmlPersistenceUnit.setExcludeUnlistedClasses(null);
-
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
- }
-
- public void testModifyExcludeUnlistedClasses() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 2 - set value, resource changed
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertTrue(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.TRUE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.FALSE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 3 - set context to default, resource unset
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(null);
-
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
- }
-
- public void testUpdateProperties1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertNull(xmlPersistenceUnit.getProperties());
- assertEquals(0, persistenceUnit.getPropertiesSize());
-
- // add "properties", test that there's no real change to context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- assertEquals(0, persistenceUnit.getPropertiesSize());
-
- // add property, test that it's added to context
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(1, persistenceUnit.getPropertiesSize());
-
- // add another ...
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, persistenceUnit.getPropertiesSize());
- }
-
- public void testUpdateProperties2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // remove property from xml, test that it's removed from context
- xmlProperty = xmlProperties.getProperties().get(0);
- xmlProperties.getProperties().remove(xmlProperty);
-
- assertEquals(1, persistenceUnit.getPropertiesSize());
-
- // remove another one ...
- xmlProperty = xmlProperties.getProperties().get(0);
- xmlProperties.getProperties().remove(xmlProperty);
-
- assertEquals(0, persistenceUnit.getPropertiesSize());
- }
-
- public void testModifyProperties1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertNull(xmlPersistenceUnit.getProperties());
- assertEquals(0, persistenceUnit.getPropertiesSize());
-
- // add property, test that it's added to resource
- persistenceUnit.addProperty().setName("foo");
-
- assertNotNull(xmlPersistenceUnit.getProperties());
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
-
- // add another ...
- persistenceUnit.addProperty().setName("bar");
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
- assertEquals("bar", xmlPersistenceUnit.getProperties().getProperties().get(1).getName());
-
- // add another testing order
- persistenceUnit.addProperty(0).setName("baz");
-
- assertEquals(3, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("baz", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(1).getName());
- assertEquals("bar", xmlPersistenceUnit.getProperties().getProperties().get(2).getName());
- }
-
- public void testModifyProperties2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("foo");
-
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove another one. test that properties object is nulled
- persistenceUnit.removeProperty("FOO", "BAR");
-
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties3() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- persistenceUnit.setProperty("foo", "bar", false);
- persistenceUnit.setProperty("FOO", "BAR", false);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("foo", "bar");
-
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove another one, test that properties object is nulled
- persistenceUnit.removeProperty("FOO");
-
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties4() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- persistenceUnit.setProperty("foo", "bar", false);
- persistenceUnit.setProperty("FOO", "BAR", false);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // modify a property, test its value
- persistenceUnit.setProperty("foo", "", false);
- assertEquals("", persistenceUnit.getProperty("foo").getValue());
-
- persistenceUnit.setProperty("foo", "BAR", false);
- assertEquals("BAR", persistenceUnit.getProperty("foo").getValue());
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("FOO");
- assertNull(persistenceUnit.getProperty("FOO"));
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove by setting value to null, test that properties object is nulled
- persistenceUnit.setProperty("notExist", null, false);
- assertNull(persistenceUnit.getProperty("notExist"));
-
- persistenceUnit.setProperty("foo", null, false);
- assertNull(persistenceUnit.getProperty("foo"));
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties5() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // testing duplicate keys, add four properties and test that there are four existing in xml and context
- persistenceUnit.setProperty("FOO", "BAR", false);
- persistenceUnit.setProperty("foo", "bar 3", true);
- persistenceUnit.setProperty("foo", "bar 2", true);
- persistenceUnit.setProperty("foo", "bar 1", true);
-
- assertEquals(4, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(4, persistenceUnit.getPropertiesSize());
-
- // remove a property, test that there are four existing in xml and context
- persistenceUnit.removeProperty("foo", "bar 1");
- assertEquals(3, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(3, persistenceUnit.getPropertiesSize());
- }
-
- public void testAccessProperty() {
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and try to access it.
- persistenceUnit.setProperty("foo", "bar", false);
- persistenceUnit.setProperty("FOO", "BAR", false);
-
- PersistenceUnit.Property property = persistenceUnit.getProperty("foo");
- assertNotNull(property);
- assertEquals("bar", property.getValue());
- assertNotNull(persistenceUnit.getProperty("FOO"));
- assertEquals("BAR", persistenceUnit.getProperty("FOO").getValue());
- assertNull(persistenceUnit.getProperty("notExist"));
- }
-
- private PersistenceUnit.Property persistenceUnitFirstProperty() {
- return getPersistenceUnit().getProperties().iterator().next();
- }
-
- public void testUpdatePropertyName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- // add property for testing
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperties.getProperties().add(xmlProperty);
-
- // test that names are initially equal
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name to different name, test equality
- xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name to empty string, test equality
- xmlProperty.setName("");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name back to non-null, test equality
- xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
- }
-
- public void testUpdatePropertyValue() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- // add property for testing
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperties.getProperties().add(xmlProperty);
-
- // test that values are initially equal
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to different value, test equality
- xmlProperty.setValue("newValue");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to empty string, test equality
- xmlProperty.setValue("");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to null, test equality
- xmlProperty.setValue(null);
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value back to non-null, test equality
- xmlProperty.setValue("newValue");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
- }
-
- public void testGetDefaultAccess() throws Exception {
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- createOrm2XmlFile();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = getPersistenceUnit().getMappingFileRefs().iterator();
- OrmXml ormMappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
- OrmXml orm2MappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
-
- assertEquals(null, persistenceUnit.getDefaultAccess());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnit.getDefaultAccess());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnit.getDefaultAccess());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertFalse(ormMappingFile.getRoot().getPersistenceUnitMetadata().resourceExists());
- assertEquals(null, persistenceUnit.getDefaultAccess());
-
- orm2MappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnit.getDefaultAccess());
- }
-
- public void testGetDefaultSchema() throws Exception {
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- createOrm2XmlFile();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = getPersistenceUnit().getMappingFileRefs().iterator();
- OrmXml ormMappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
- OrmXml orm2MappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
-
- assertEquals(null, persistenceUnit.getDefaultSchema());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", persistenceUnit.getDefaultSchema());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertFalse(ormMappingFile.getRoot().getPersistenceUnitMetadata().resourceExists());
- assertEquals(null, persistenceUnit.getDefaultSchema());
-
- orm2MappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("BAR");
- assertEquals("BAR", persistenceUnit.getDefaultSchema());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- createOrm2XmlFile();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = getPersistenceUnit().getMappingFileRefs().iterator();
- OrmXml ormMappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
- OrmXml orm2MappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
-
- assertEquals(null, persistenceUnit.getDefaultCatalog());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", persistenceUnit.getDefaultCatalog());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertFalse(ormMappingFile.getRoot().getPersistenceUnitMetadata().resourceExists());
- assertEquals(null, persistenceUnit.getDefaultCatalog());
-
- orm2MappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("BAR");
- assertEquals("BAR", persistenceUnit.getDefaultCatalog());
- }
-
- protected void createOrm2XmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, "orm2.xml");
- config.getDefaultOperation().execute(null, null);
-
- addXmlMappingFileRef("META-INF/orm2.xml");
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestOtherTypeEntity() throws Exception {
- return this.createTestType(PACKAGE_NAME, OTHER_TYPE_NAME + ".java", OTHER_TYPE_NAME, new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestEntityWithPersistentInnerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append(" public static class " + INNER_CLASS_NAME + " {}").append(CR);
- }
- });
- }
-
- public void testPersistentType() throws Exception {
- getJpaProject().setDiscoversAnnotatedClasses(false);
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- createTestEntity();
-
- //persistentType not listed in persistence.xml and discoverAnnotatedClasses is false
- //still find the persistentType because of changes for bug 190317
- assertFalse(getJpaProject().discoversAnnotatedClasses());
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType not listed in persistence.xml, discover annotated classes set to true
- getJpaProject().setDiscoversAnnotatedClasses(true);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType list as class in persistence.xml
- getJpaProject().setDiscoversAnnotatedClasses(false);
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- getXmlPersistenceUnit().getClasses().add(classRef);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
-
- //test persistentType from orm.xml file that is specified in the persistence.xml
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- assertEquals(ormPersistentType, persistenceUnit.getPersistentType("model.Foo"));
-
- //test persistentType from orm.xml file that is implied(not specified) in the persistence.xml
- getXmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- }
-
-//TODO
-// String getDefaultSchema();
-// String getDefaultCatalog();
-// AccessType getDefaultAccess();
-// boolean getDefaultCascadePersist();
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java
deleted file mode 100644
index 11bd30a5ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class PersistenceXmlTests extends ContextModelTestCase
-{
- public PersistenceXmlTests(String name) {
- super(name);
- }
-
- protected PersistenceXml getPersistenceXml() {
- return getRootContextNode().getPersistenceXml();
- }
-
- public void testUpdateAddPersistence() throws Exception {
- assertEquals(2, getJpaProject().getJpaFilesSize());
- JpaXmlResource prm = getPersistenceXmlResource();
- prm.getContents().clear();
- prm.save(null);
-
- //the ContentType of the persistence.xml file is no longer persistence, so the jpa file is removed
- assertNull(getPersistenceXml());
- assertEquals(1, getJpaProject().getJpaFilesSize()); //should only be the orm.xml file
-
- XmlPersistence xmlPersistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- xmlPersistence.setVersion("1.0");
- prm.getContents().add(xmlPersistence);
- prm.save(null);
-
- assertNotNull(getPersistenceXml().getPersistence());
- assertEquals(2, getJpaProject().getJpaFilesSize());
- }
-
- public void testUpdateRemovePersistence() throws Exception {
- JpaXmlResource prm = getPersistenceXmlResource();
-
- assertNotNull(getPersistenceXml().getPersistence());
-
- prm.getContents().clear();
- assertNull(getPersistenceXml());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java
deleted file mode 100644
index 82354ff11b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.internal.operations.PersistenceFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class RootContextNodeTests extends ContextModelTestCase
-{
- public RootContextNodeTests(String name) {
- super(name);
- }
-
- public void testUpdateAddPersistenceXml() throws Exception {
- deleteResource(getPersistenceXmlResource());
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
-
- assertFalse(getPersistenceXmlResource().fileExists());
- assertNull(baseJpaContent.getPersistenceXml());
-
- IDataModel config =
- DataModelFactory.createDataModel(new PersistenceFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
-
- assertNotNull(baseJpaContent.getPersistenceXml());
- }
-
- public void testUpdateRemovePersistenceXml() throws Exception {
- JpaXmlResource pr = getPersistenceXmlResource();
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
-
- assertNotNull(baseJpaContent.getPersistenceXml());
-
- deleteResource(pr);
-
- assertNull(baseJpaContent.getPersistenceXml());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java
deleted file mode 100644
index efc6a77229..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class Generic2_0ContextModelTestCase extends ContextModelTestCase
-{
- protected Generic2_0ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_2_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, GenericPlatform.VERSION_2_0);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return GenericPlatform.VERSION_2_0;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java
deleted file mode 100644
index 2f80cfeb5f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class Generic2_0JavaContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(Generic2_0JavaContextModelTests.class.getPackage().getName());
- suite.addTestSuite(GenericJavaAssociationOverride2_0Tests.class);
- suite.addTestSuite(GenericJavaBasicMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaCascade2_0Tests.class);
- suite.addTestSuite(GenericJavaCollectionTable2_0Tests.class);
- suite.addTestSuite(GenericJavaElementCollectionMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaEntity2_0Tests.class);
- suite.addTestSuite(GenericJavaEmbeddedMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaEmbeddedIdMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaIdMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaManyToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaManyToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaOneToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaOneToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaPersistentAttribute2_0Tests.class);
- suite.addTestSuite(GenericJavaPersistentType2_0Tests.class);
- suite.addTestSuite(GenericJavaSequenceGenerator2_0Tests.class);
- suite.addTestSuite(GenericJavaVersionMapping2_0Tests.class);
- return suite;
- }
-
- private Generic2_0JavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java
deleted file mode 100644
index fa0ff6e174..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.OverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE_NAME";
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(CR);
- sb.append(" private AnnotationTestTypeChild address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- sb.append(CR);
- sb.append(" private java.util.Collection<AnnotationTestTypeChild> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public GenericJavaAssociationOverride2_0Tests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the resource model, verify context model updated
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- //set name to null in the resource model
- associationOverrideResource.setName(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
- assertNull(associationOverrideResource.getName());
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, overrideContainer.getSpecifiedOverridesSize());
- javaAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator().hasNext());
- }
-
- public void testModifyName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- AssociationOverride specifiedAssociationOverride = virtualAssociationOverride.convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", specifiedAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the context model, verify resource model modified
- specifiedAssociationOverride.setName("foo");
- assertEquals("foo", specifiedAssociationOverride.getName());
- assertEquals("foo", associationOverrideResource.getName());
-
- //set name to null in the context model
- specifiedAssociationOverride.setName(null);
- assertNull(specifiedAssociationOverride.getName());
- associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- assertNull(associationOverrideResource.getName());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride specifiedOverride = overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
-
- JoinColumn joinColumn = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", associationOverrideResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(3, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, associationOverrideResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaVirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedAssociationOverride = virtualAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- JoinColumn joinColumn = joinColumns.next();
- assertEquals("address_id", joinColumn.getSpecifiedName());
- assertEquals("id", joinColumn.getSpecifiedReferencedColumnName());
-
- associationOverrideResource.addJoinColumn(0);
- associationOverrideResource.addJoinColumn(1);
- associationOverrideResource.addJoinColumn(2);
-
- associationOverrideResource.joinColumnAt(0).setName("FOO");
- associationOverrideResource.joinColumnAt(1).setName("BAR");
- associationOverrideResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("address_id", joinColumns.next().getName());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", specifiedAssociationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
- specifiedAssociationOverride.setName("FOO");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("FOO", associationOverrideResource.getName());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", associationOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(associationOverride.isVirtual());
- }
-
-
- public void testSetJoinTableName() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified();
- JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverride2_0Annotation associationOverrideResource = (AssociationOverride2_0Annotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
-
- JoinTable joinTable = joiningStrategy.getJoinTable();
- joinTable.setSpecifiedName("FOO");
-
- assertEquals("FOO", associationOverrideResource.getJoinTable().getName());
- }
-
- public void testUpdateJoinTable() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified();
- JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverride2_0Annotation associationOverrideResource = (AssociationOverride2_0Annotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.getJoinTable().setName("MY_JOIN_TABLE");
- getJpaProject().synchronizeContextModel();
- assertEquals("MY_JOIN_TABLE", joiningStrategy.getJoinTable().getSpecifiedName());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(0); // remove default
- associationOverrideResource.getJoinTable().addJoinColumn(0);
- associationOverrideResource.getJoinTable().addJoinColumn(1);
- associationOverrideResource.getJoinTable().addJoinColumn(2);
-
- associationOverrideResource.getJoinTable().joinColumnAt(0).setName("FOO");
- associationOverrideResource.getJoinTable().joinColumnAt(1).setName("BAR");
- associationOverrideResource.getJoinTable().joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testDefaultJoinTableName() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualOverrideRelationship2_0 rel = (VirtualOverrideRelationship2_0) javaAssociationOverride.getRelationship();
- VirtualJoinTable joinTable = rel.getJoinTableStrategy().getJoinTable();
-
- assertEquals("AnnotationTestTypeChild_AnnotationTestTypeChild", joinTable.getName());
-
-
- getJavaEntity().getTable().setSpecifiedName("FOO");
- assertEquals("FOO_FOO", joinTable.getName());
-
- PersistentType mappedSuperclass = getJavaEntity().getPersistentType().getSuperPersistentType();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) mappedSuperclass.getAttributeNamed("address").getMapping();
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTable.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java
deleted file mode 100644
index f957f6b0a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaBasicMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
- public GenericJavaBasicMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testBasicMorphToDefaultBasic() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getEnumType());
-
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToVersion() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbedded() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbeddedId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToTransient() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((OneToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((OneToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((OneToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
- public void testBasicMorphToManyToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((ManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((ManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToManyToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
-// assertEquals(FetchType.EAGER, ((ManyToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToElementCollection() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
-// assertEquals(FetchType.EAGER, ((ElementCollectionMapping2_0) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java
deleted file mode 100644
index f7858aa4ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaCascade2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
-
- public GenericJavaCascade2_0Tests(String name) {
- super(name);
- }
-
-
- public void testUpdateCascadeDetach() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation annotation = (OneToOne2_0Annotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping2_0 mapping = (JavaOneToOneMapping2_0) persistentAttribute.getMapping();
- JavaCascade2_0 cascade = (JavaCascade2_0) mapping.getCascade();
-
- assertFalse(cascade.isDetach());
- assertFalse(annotation.isCascadeDetach());
-
- //set detach in the resource model, verify context model updated
- annotation.setCascadeDetach(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeDetach());
- assertTrue(cascade.isDetach());
-
- //set detach to false in the resource model
- annotation.setCascadeDetach(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeDetach());
- assertFalse(cascade.isDetach());
- }
-
- public void testModifyCascadeDetach() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation annotation = (OneToOne2_0Annotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping2_0 mapping = (JavaOneToOneMapping2_0) persistentAttribute.getMapping();
- JavaCascade2_0 cascade = (JavaCascade2_0) mapping.getCascade();
-
- assertFalse(cascade.isDetach());
- assertFalse(annotation.isCascadeDetach());
-
- //set detach in the context model, verify resource model updated
- cascade.setDetach(true);
- assertTrue(annotation.isCascadeDetach());
- assertTrue(cascade.isDetach());
-
- //set detach to false in the context model
- cascade.setDetach(false);
- assertFalse(annotation.isCascadeDetach());
- assertFalse(cascade.isDetach());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java
deleted file mode 100644
index 58a2b8f8b1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java
+++ /dev/null
@@ -1,723 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaCollectionTable2_0Tests extends Generic2_0ContextModelTestCase
-{
- public GenericJavaCollectionTable2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- }
- });
- }
-
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable);
-
-
- //set name in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- //set name to null in the resource model
- resourceCollectionTable.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable.getName());
-
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable3);
-
- //set name in the context model, verify resource model modified
- collectionTable.setSpecifiedName("foo");
- resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedName());
- assertEquals("foo", resourceCollectionTable3.getName());
-
- //set name to null in the context model
- collectionTable.setSpecifiedName(null);
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //add the collection table annotation, verify default collection table name is the same
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
- assertNotNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //set the entity name, verify default collection table name updates
- getJavaEntity().setSpecifiedName("Foo");
- assertEquals("Foo_projects", collectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
-
- //set schema in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- //set schema to null in the resource model
- resourceCollectionTable.setSchema(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable.getSchema());
-
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
- //set schema in the context model, verify resource model modified
- collectionTable.setSpecifiedSchema("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceCollectionTable.getSchema());
-
- //set schema to null in the context model
- collectionTable.setSpecifiedSchema(null);
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
-
- //set catalog in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the resource model
- resourceCollectionTable.setCatalog(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable.getCatalog());
-
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
- //set catalog in the context model, verify resource model modified
- collectionTable.setSpecifiedCatalog("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the context model
- collectionTable.setSpecifiedCatalog(null);
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn joinColumn = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = collectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.getJoinColumnsSize());
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.getJoinColumnsSize());
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
-
- collectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
-
- collectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableResource.addJoinColumn(0);
- joinTableResource.addJoinColumn(1);
- joinTableResource.addJoinColumn(2);
-
- joinTableResource.joinColumnAt(0).setName("FOO");
- joinTableResource.joinColumnAt(1).setName("BAR");
- joinTableResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(collectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetDefaultJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.addSpecifiedJoinColumn(0);
- assertEquals(1, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, collectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
- collectionTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
-
- collectionTable.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- collectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java
deleted file mode 100644
index aea21aac8c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java
+++ /dev/null
@@ -1,2615 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- public static final String EMBEDDABLE_TYPE_NAME = "Address";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEntityKeyElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddablePropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public GenericJavaElementCollectionMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollectionAnnotation = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollectionAnnotation.setTargetClass("newTargetClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollectionAnnotation.getTargetClass());
-
- //set target class to null in the resource model
- elementCollectionAnnotation.setTargetClass(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testDefaultTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Embeddable, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericCollection() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericCollection() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericMap() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericMap() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals("foo", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
- }
-
- protected Embeddable getResolvedTargetEmbeddable(ElementCollectionMapping2_0 mapping) {
- return (Embeddable) ReflectionTools.executeMethod(mapping, "getResolvedTargetEmbeddable");
- }
-
- public void testResolvedTargetEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target embeddable not in the persistence unit
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //add target embeddable to the persistence unit, now target embeddable should resolve
- createTestTargetEmbeddableAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testResolvedTargetEmbeddableWithBasicType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target is a basic type, so resolved target embeddable is null
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the context model
- elementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKey(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- elementCollectionMapping.setNoMapKey(true);
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("Address");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("String");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClass);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClass.setValue("myMapKeyClass");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKeyClass", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClass.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClass.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClass.getValue());
-
- mapKeyClass.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) elementCollectionMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testGetValueColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getName());
- assertEquals(TYPE_NAME + "_id", elementCollectionMapping.getValueColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getValueColumn().getName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getDefaultName());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state.name");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME_ + "State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType persistentType = specifiedClassRefs.next().getJavaPersistentType();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("abbr", virtualAttributeOverride.getName());
-
- PersistentType statePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping abbrMapping = (BasicMapping) statePersistentType.getAttributeNamed("abbr").getMapping();
- abbrMapping.getColumn().setSpecifiedName("BLAH");
- abbrMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- abbrMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- abbrMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- abbrMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- abbrMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- abbrMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.state) attribute override to verify it is getting settings from the specified column on State.abbr
- virtualAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping()).getAttributeOverrideContainer().getOverrideNamed("abbr");
- assertEquals("abbr", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
- }
-
- public void testGetMapKeyColumn() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", elementCollectionMapping.getMapKeyColumn().getTable());//collection table name
-
- elementCollectionMapping.getCollectionTable().setSpecifiedName("MY_COLLECTION_TABLE");
- assertEquals("MY_COLLECTION_TABLE", elementCollectionMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- classRefs.next();
- Embeddable propertyInfoEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping parcelNumberMapping = (BasicMapping) propertyInfoEmbeddable.getPersistentType().getAttributeNamed("parcelNumber").getMapping();
- parcelNumberMapping.getColumn().setSpecifiedName("FOO1");
- parcelNumberMapping.getColumn().setSpecifiedTable("BAR1");
- parcelNumberMapping.getColumn().setColumnDefinition("COLUMN_DEF1");
- parcelNumberMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- parcelNumberMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- parcelNumberMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- parcelNumberMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("FOO1", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR1", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF1", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- parcelNumberMapping.getColumn().setSpecifiedName(null);
- parcelNumberMapping.getColumn().setSpecifiedTable(null);
- parcelNumberMapping.getColumn().setColumnDefinition(null);
- parcelNumberMapping.getColumn().setSpecifiedInsertable(null);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(null);
- parcelNumberMapping.getColumn().setSpecifiedUnique(null);
- parcelNumberMapping.getColumn().setSpecifiedNullable(null);
- parcelNumberMapping.getColumn().setSpecifiedLength(null);
- parcelNumberMapping.getColumn().setSpecifiedPrecision(null);
- parcelNumberMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(1, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(5, valueAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(6, valueAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(2, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.name");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, valueAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME_ + "PropertyInfo");
- addXmlClassRef(PACKAGE_NAME_ + "State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- valueOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- assertEquals("parcelNumber", valueOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(2, valueOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", mapKeyOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, mapKeyOverrideContainer.getVirtualOverridesSize());
-
- valueOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(overrideAnnotations.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = valueOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("parcelNumber", virtualAttributeOverrides.next().getName());
- assertEquals("size", virtualAttributeOverrides.next().getName());
- assertEquals("tax", virtualAttributeOverrides.next().getName());
- assertEquals(3, valueOverrideContainer.getVirtualOverridesSize());
-
- virtualAttributeOverrides = mapKeyOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<? extends AttributeOverride> specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertEquals("size", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- this.getJpaProject().synchronizeContextModel();
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
-
- resourceField.moveAnnotation(3, 2, AttributeOverrideAnnotation.ANNOTATION_NAME);
- this.getJpaProject().synchronizeContextModel();
- getJpaProject().synchronizeContextModel();
-
- overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSelfReferentialElementCollection() throws Exception {
- createSelfReferentialElementCollection();
- addXmlClassRef(PACKAGE_NAME + ".Foo");
-
- //If there is a StackOverflowError you will not be able to get the mapping
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("elementCollection").getMapping();
- assertFalse(elementCollectionMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(EnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- elementCollectionMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(TemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
- public void testSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- ListIterator<? extends JoinColumn> specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
-
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
- }
-
- public void testSpecifiedMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(0, elementCollectionMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, elementCollectionMapping.getSpecifiedMapKeyJoinColumnsSize());
- }
-
- public void testMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyElementCollectionMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(1, elementCollectionMapping.getMapKeyJoinColumnsSize());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionMapping.getMapKeyJoinColumnsSize());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, elementCollectionMapping.getMapKeyJoinColumnsSize());
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionMapping.getMapKeyJoinColumnsSize());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn2() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- elementCollectionMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
-
-
- elementCollectionMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("FOO");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAR");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(2, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testMapKeyJoinColumnIsDefault() throws Exception {
- createTestEntityWithEntityKeyElementCollectionMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertTrue(elementCollectionMapping.getDefaultMapKeyJoinColumn().isDefault());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- JoinColumn specifiedJoinColumn = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isDefault());
-
- assertNull(elementCollectionMapping.getDefaultMapKeyJoinColumn());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java
deleted file mode 100644
index a8557f089f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId").append(CR);
- sb.append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME +" myEmbeddedId;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
-
- public GenericJavaEmbeddedIdMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((JavaEmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java
deleted file mode 100644
index 194856a99c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java
+++ /dev/null
@@ -1,1608 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumn;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTable;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded").append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME + " myEmbedded;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createAddressEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Address {");
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public GenericJavaEmbeddedMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((JavaEmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof JavaEmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testDefaultEmbeddedMappingGenericEmbeddable() throws Exception {
- createTestEntityWithDefaultEmbeddedMapping();
- createTestGenericEmbeddable();
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Embeddable1");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbeddable");
- assertNotNull(persistentAttribute.getMapping());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- private void createTestEntityWithDefaultEmbeddedMapping() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 { ").append(CR);
- sb.append("private Embeddable1<Integer> myEmbeddable;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericEmbeddable() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class Embeddable1<T> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Embeddable1.java", sourceWriter);
- }
-
- private void createSelfReferentialEmbedded() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Foo embedded;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state");
- getJpaProject().synchronizeContextModel();
- assertEquals(0, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- VirtualJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("address_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaPersistentType javaEmbeddable = classRefs.next().getJavaPersistentType();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) javaEmbeddable.getAttributeNamed("address").getMapping();
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- Iterator<NestableAnnotation> associationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("addresses", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- Iterator<NestableAnnotation> associationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("addresses", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertEquals(2, CollectionTools.size(resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator()));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("addresses", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("addresses", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("addresses", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("addresses", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- ((AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceField.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceField.addAnnotation(2, JPA.ASSOCIATION_OVERRIDE)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.moveAnnotation(2, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.moveAnnotation(0, 1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
-
- public void testVirtualAssociationOverrideJoinTableDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- VirtualJoinTable joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals("AnnotationTestType_Address", joinTable.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- VirtualJoinColumn virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("AnnotationTestType_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- VirtualJoinColumn virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("addresses_id", virtualInverseJoinColumn.getName());
- assertEquals("id", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualInverseJoinColumn.getTable());
- assertEquals(null, virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(true, virtualInverseJoinColumn.isInsertable());
- assertEquals(true, virtualInverseJoinColumn.isUpdatable());
- assertEquals(false, virtualInverseJoinColumn.isUnique());
- assertEquals(true, virtualInverseJoinColumn.isNullable());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaPersistentType javaEmbeddable = classRefs.next().getJavaPersistentType();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) javaEmbeddable.getAttributeNamed("addresses").getMapping();
- JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableStrategy();
- joinTableStrategy.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = joinTableStrategy.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- JoinColumn inverseJoinColumn = joinTableStrategy.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("MY_INVERSE_JOIN_COLUMN");
- inverseJoinColumn.setSpecifiedReferencedColumnName("MY_INVERSE_REFERENCE_COLUMN");
- inverseJoinColumn.setSpecifiedTable("INVERSE_BAR");
- inverseJoinColumn.setColumnDefinition("INVERSE_COLUMN_DEF");
- inverseJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUnique(Boolean.TRUE);
- inverseJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- assertEquals("INVERSE_COLUMN_DEF", virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(false, virtualInverseJoinColumn.isInsertable());
- assertEquals(false, virtualInverseJoinColumn.isUpdatable());
- assertEquals(true, virtualInverseJoinColumn.isUnique());
- assertEquals(false, virtualInverseJoinColumn.isNullable());
-
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(5, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- JavaEmbeddedMapping nestedEmbeddedMapping = (JavaEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- JavaAttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((JavaEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((JavaEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((JavaEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
- virtualAttributeOverride = (VirtualAttributeOverride) ((JavaEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testSelfReferentialEmbeddedMapping() throws Exception {
- createSelfReferentialEmbedded();
- addXmlClassRef(PACKAGE_NAME + ".Foo");
-
- //If there is a StackOverflowError you will not be able to get the mapping
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("embedded").getMapping();
- assertFalse(embeddedMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java
deleted file mode 100644
index 7c9ee50303..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java
+++ /dev/null
@@ -1,2057 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.NamedQuery2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.NamedQuery2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public GenericJavaEntity2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@AssociationOverride(name=\"a\", joinTable=@JoinTable)");
- }
- });
- }
-
-
- private LockModeType2_0 lockModeOf(NamedQuery2_0Annotation resourceQuery) {
- return resourceQuery == null ? null : LockModeType2_0.fromJavaResourceModel(resourceQuery.getLockMode());
- }
-
- public void testAddNamedQuery2_0() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = this.getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(0);
- namedQuery1.setName("FOO");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- NamedQuery2_0Annotation queryAnnotation = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("FOO", queryAnnotation.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(queryAnnotation));
-
- NamedQuery2_0 namedQuery2 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.READ);
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- queryAnnotation = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", queryAnnotation.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(queryAnnotation));
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
-
- NamedQuery2_0 namedQuery3 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
- namedQuery3.setSpecifiedLockMode(LockModeType2_0.WRITE);
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals("BAR", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- queryAnnotation = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAZ", queryAnnotation.getName());
- assertEquals(LockModeType2_0.WRITE, this.lockModeOf(queryAnnotation));
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
-
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery1, namedQueries.next());
-
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("foo");
- }
-
- public void testRemoveNamedQuery2_0() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.READ);
-
- NamedQuery2_0 namedQuery2 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(2);
- namedQuery2.setName("BAZ");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- NamedQuery2_0Annotation annotation1 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", annotation1.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(annotation1));
-
- NamedQuery2_0Annotation annotation2 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAZ", annotation2.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation2));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- annotation2 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAZ", annotation2.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation2));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testMoveNamedQuery2_0() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
- entity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
-
- entity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- NamedQuery2_0Annotation annotation1 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", annotation1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation1));
- assertEquals("BAZ", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
-
-
- entity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals("BAZ", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- annotation1 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", annotation1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation1));
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedQueries2_0() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
-
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY)).setName("FOO");
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY)).setName("BAR");
- NamedQuery2_0Annotation annotation1 = (NamedQuery2_0Annotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- annotation1.setName("BAZ");
- annotation1.setLockMode(org.eclipse.jpt.jpa.core.jpa2.resource.java.LockModeType_2_0.OPTIMISTIC);
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAR", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.moveAnnotation(2, 0, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.moveAnnotation(0, 1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.removeAnnotation(1, JPA.NAMED_QUERY);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(1, JPA.NAMED_QUERY);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(0, JPA.NAMED_QUERY);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testNamedQueries2_0Size() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getQueryContainer().getNamedQueriesSize());
-
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY)).setName("FOO");
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY)).setName("BAR");
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(2, JPA.NAMED_QUERY)).setName("BAZ");
-
- this.getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getQueryContainer().getNamedQueriesSize());
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- ListIterator<? extends AttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testVirtualAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- JavaEntity superclass = (JavaEntity) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(3, CollectionTools.size(resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator()));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> attributeOverrideResources = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAttributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals(3, CollectionTools.size(javaAttributeOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- }
-//
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE)).setName("FOO");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE)).setName("BAR");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
-
- public void testOverridableAssociations() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociationsMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<? extends AssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AssociationOverrideContainer overrideContainer = javaEntity.getAssociationOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-
- //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
- //idMapping.getColumn().setSpecifiedName("FOO");
- //idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- //idMapping.getColumn().setSpecifiedName(null);
- //idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(2, CollectionTools.size(resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator()));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- Iterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(2, JPA.ASSOCIATION_OVERRIDE)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer associationOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, associationOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = associationOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer associationOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, associationOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = associationOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getJavaResourceType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(true)", cu);
-
- cacheableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- getJavaPersistentType().getJavaResourceType().removeAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- assertEquals(SharedCacheMode.UNSPECIFIED, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testInheritedIsDefaultCacheable() throws Exception {
- createTestEntity();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity().getParentEntity()).getCacheable();
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- //This is a test for bug 301892
- public void testAssociationOverrideJoinTableUpdate() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverride associationOverride = getJavaEntity().getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
-
- AssociationOverride2_0Annotation annotation = (AssociationOverride2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.getJoinTable().setName("FOO");
- annotation.getJoinTable().addInverseJoinColumn(0).setName("BAR");
-
- getJpaProject().synchronizeContextModel();
-
- associationOverride = getJavaEntity().getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
- JoinTable joinTable = ((JavaOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("BAR", joinTable.getInverseJoinColumns().iterator().next().getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java
deleted file mode 100644
index 263c0dde49..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaIdMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
- public GenericJavaIdMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));//OneToOne with Id annotation is valid in JPA 2.0
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));//ManyToOne with Id annotation is valid in JPA 2.0
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java
deleted file mode 100644
index 7abad6b13f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,1953 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaManyToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaManyToManyMapping2_0Tests(String name) {
- super(name);
- }
-
-
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<AnnotationTestType> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEntityKeyManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKey(null);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKey.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("Address");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("String");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
- JavaPersistentType printQueuePersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintQueue");
- ManyToManyMapping jobsMapping = (ManyToManyMapping) printQueuePersistentType.getAttributeNamed("jobs").getMapping();
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ManyToManyMapping queuesMapping = (ManyToManyMapping) printJobPersistentType.getAttributeNamed("queues").getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable()); //the join table name
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumn() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name
-
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
- manyToManyMapping.getRelationship().setStrategyToMappedBy();
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employees");
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address_" + TYPE_NAME, manyToManyMapping.getMapKeyColumn().getTable());//join table name of owning many-to-many
-
- PersistentType persistentType = getPersistenceUnit().getPersistentType("test.Address");
- ManyToManyMapping owningManyToManyMapping = (ManyToManyMapping) persistentType.getAttributeNamed("employees").getMapping();
- ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name
-
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- manyToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(TemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((TemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((TemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((TemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((TemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- ListIterator<? extends JoinColumn> specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
-
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
- }
-
- public void testSpecifiedMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(0, manyToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, manyToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
- }
-
- public void testMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(1, manyToManyMapping.getMapKeyJoinColumnsSize());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyMapping.getMapKeyJoinColumnsSize());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, manyToManyMapping.getMapKeyJoinColumnsSize());
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyMapping.getMapKeyJoinColumnsSize());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn2() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- manyToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
-
-
- manyToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("FOO");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAR");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(2, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testMapKeyJoinColumnIsDefault() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertTrue(manyToManyMapping.getDefaultMapKeyJoinColumn().isDefault());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- JoinColumn specifiedJoinColumn = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isDefault());
-
- assertNull(manyToManyMapping.getDefaultMapKeyJoinColumn());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
deleted file mode 100644
index 8d38365920..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,682 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaManyToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaManyToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestEntityWithManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.addAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaIdMapping);
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaManyToOneMapping2_0);
-
- contextAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaBasicMapping);
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java
deleted file mode 100644
index bf70de9c6a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,2214 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaOneToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaOneToManyMapping2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(orphanRemoval=false)").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private AnnotationTestType employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEntityKeyOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employee", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employee", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY));
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToMany.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
-
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKey(null);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping2_0 = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping2_0 = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- oneToManyMapping2_0.setSpecifiedTargetEntity("Address");
- mapKeyNames = oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- oneToManyMapping2_0.setSpecifiedTargetEntity("String");
- mapKeyNames = oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", oneToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", oneToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) getJavaPersistentType().getAttributeNamed("jobs").getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- oneToManyMapping.getRelationship().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employee");
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//owing entity table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", oneToManyMapping.getMapKeyColumn().getTable());//join table name
-
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
-
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- oneToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(TemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((TemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((TemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((TemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((TemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- ListIterator<? extends JoinColumn> specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
-
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
- }
-
- public void testSpecifiedMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(0, oneToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, oneToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
- }
-
- public void testMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(1, oneToManyMapping.getMapKeyJoinColumnsSize());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyMapping.getMapKeyJoinColumnsSize());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, oneToManyMapping.getMapKeyJoinColumnsSize());
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyMapping.getMapKeyJoinColumnsSize());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn2() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- oneToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
-
-
- oneToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("FOO");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAR");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(2, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testMapKeyJoinColumnIsDefault() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertTrue(oneToManyMapping.getDefaultMapKeyJoinColumn().isDefault());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- JoinColumn specifiedJoinColumn = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isDefault());
-
- assertNull(oneToManyMapping.getDefaultMapKeyJoinColumn());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
deleted file mode 100644
index bd18b5f42f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,1141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaOneToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaOneToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestEntity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(orphanRemoval=false)");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
-
- ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(Boolean.FALSE, this.getOrphanRemovalOf(oneToOneMapping).getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE));
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToOne.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToOneMapping, persistentAttribute.getMapping());
-
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java
deleted file mode 100644
index 024ecacb5f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentAttribute2_0Tests extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestEntityForDerivedId() throws Exception {
- return createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntitySpecifiedAccessField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.BASIC, JPA.TRANSIENT, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.FIELD)");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("transient");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestEntitySpecifiedAccessProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.BASIC, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Access(AccessType.FIELD)");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public GenericJavaPersistentAttribute2_0Tests(String name) {
- super(name);
- }
-
- public void testGetAccessField() throws Exception {
- createTestEntitySpecifiedAccessField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute namePersistentAttribute = getJavaPersistentType().getAttributeNamed("name");
- assertEquals(AccessType.FIELD, namePersistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, namePersistentAttribute.getDefaultAccess());
- assertEquals(null, namePersistentAttribute.getSpecifiedAccess());
-
- PersistentAttribute idPersistentAttribute = getJavaPersistentType().getAttributeNamed("id");
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, idPersistentAttribute.getMappingKey());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getDefaultAccess());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getSpecifiedAccess());
- }
-
- public void testGetAccessProperty() throws Exception {
- createTestEntitySpecifiedAccessProperty();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute namePersistentAttribute = getJavaPersistentType().getAttributeNamed("name");
- assertEquals(AccessType.FIELD, namePersistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, namePersistentAttribute.getDefaultAccess());
- assertEquals(AccessType.FIELD, namePersistentAttribute.getSpecifiedAccess());
-
- PersistentAttribute idPersistentAttribute = getJavaPersistentType().getAttributeNamed("id");
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, idPersistentAttribute.getMappingKey());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getDefaultAccess());
- assertEquals(null, idPersistentAttribute.getSpecifiedAccess());
- }
-
- public void testDerivedIdMappingInitialization() throws Exception {
- createTestEntityForDerivedId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaPersistentAttribute id = getJavaPersistentType().getAttributeNamed("id");
- assertEquals(id.getMappingKey(), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().addAnnotation(JPA.ONE_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(id.getResourceAttribute().getAnnotation(JPA.ID));
-
- id.getResourceAttribute().removeAnnotation(JPA.ONE_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().addAnnotation(JPA.MANY_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(id.getResourceAttribute().getAnnotation(JPA.ID));
-
- id.getResourceAttribute().removeAnnotation(JPA.MANY_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java
deleted file mode 100644
index 37bff06833..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java
+++ /dev/null
@@ -1,863 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.context.java.FieldAccessor;
-import org.eclipse.jpt.jpa.core.internal.context.java.PropertyAccessor;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentType2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldAndMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Access(AccessType.PROPERTY)");
- }
-
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedPropertyFieldSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestSubTypeWithFieldAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeWithMethodAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypePersistentExtendsNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild2.java", "AnnotationTestTypeChild2", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends AnnotationTestTypeChild ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public GenericJavaPersistentType2_0Tests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, getJavaPersistentType().getName());
- }
-
- public void testGetAccessNothingAnnotated() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessField() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessProperty() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
- }
-
- public void testAccessFieldAndMethodAnnotated() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessFieldAnnotatedPropertySpecified() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute javaPersistentAttribute = attributes.next();
- assertEquals("name", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMapping().getKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- assertFalse(attributes.hasNext());
- }
-
- public void testAccessPropertyAnnotatedFieldSpecified() throws Exception {
- createTestEntityAnnotatedPropertyFieldSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("name", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- assertFalse(attributes.hasNext());
-
- attributes = getJavaPersistentType().getAttributes().iterator();
- attributes.next().getResourceAttribute().setPrimaryAnnotation(TransientAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- attributes = getJavaPersistentType().getAttributes().iterator();
- javaPersistentAttribute = attributes.next();
-
- javaPersistentAttribute = attributes.next();
- assertEquals("name", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
- assertFalse(attributes.hasNext());
- }
-
- public void testAccessInheritance() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance2() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance3() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubTypeWithMethodAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance4() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inherited class having annotations set wins over the default access set on persistence-unit-defaults
- public void testAccessInheritancePersistenceUnitDefaultAccess() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlNoAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
-
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityPropertyAccessAndFieldAnnotations() throws Exception {
- //xml access set to property, field annotations, JavaPersistentType access is field
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityFieldAccessAndPropertyAnnotations() throws Exception {
- //xml access set to field, property annotations, JavaPersistentType access is property
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessFieldAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inheritance wins over entity-mappings specified access
- public void testAccessXmlEntityMappingsAccessWithInheritance() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childEntityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- createTestEntityAnnotatedMethod();
- createTestSubType();
- JavaPersistentType childJavaPersistentType = childEntityPersistentType.getJavaPersistentType();
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, entityPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.PROPERTY, childJavaPersistentType.getAccess());
- }
-
- public void testAccessXmlMetadataCompleteFieldAnnotations() throws Exception {
- //xml access set to property, java has field annotations so the access should be field
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY);
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- }
-
- public void testAccessNoXmlAccessXmlMetdataCompletePropertyAnnotations() throws Exception {
- //xml access not set, metadata complete set. JavaPersistentType access is property because properties are annotated
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testSuperPersistentType() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testSuperPersistentType2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- //super is not added to the getPersistenceUnit, but it should still be found
- //as the superPersistentType because of impliedClassRefs and changes for bug 190317
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType javaPersistentType = classRefs.next().getJavaPersistentType();
-
- assertNotNull(javaPersistentType.getSuperPersistentType());
- }
-
- //Entity extends Non-Entity extends Entity
- public void testSuperPersistentType3() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testInheritanceHierarchy() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testInheritanceHierarchy2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testGetMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testMappingKeyNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EmbeddableAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EntityAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testIsMapped() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(getJavaPersistentType().isMapped());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertFalse(getJavaPersistentType().isMapped());
- }
-
- public void testAttributes() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- assertEquals("id", attributes.next().getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributes2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- JavaPersistentAttribute attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("name", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof PropertyAccessor);
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributesSize() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(1, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributesSize2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributeNamed() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("id");
-
- assertEquals("id", attribute.getName());
- assertNull(getJavaPersistentType().getAttributeNamed("name"));
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testAttributeNamed2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("name");
-
- assertEquals("name", attribute.getName());
-
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testRenameAttribute() throws Exception {
- ICompilationUnit testType = createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute idAttribute = attributes.next();
- JavaPersistentAttribute nameAttribute = attributes.next();
-
-
- assertEquals("id", idAttribute.getName());
- assertEquals("name", nameAttribute.getName());
-
- IField idField = testType.findPrimaryType().getField("id");
- idField.rename("id2", false, null);
-
- attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute nameAttribute2 = attributes.next();
- JavaPersistentAttribute id2Attribute = attributes.next();
-
- assertNotSame(idAttribute, id2Attribute);
- assertEquals("id2", id2Attribute.getName());
- assertEquals(nameAttribute, nameAttribute2);
- assertEquals("name", nameAttribute2.getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testSuperPersistentTypeGeneric() throws Exception {
- createTestGenericEntity();
- createTestGenericMappedSuperclass();
-
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Entity2");
-
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- assertEquals("test.Entity1", javaPersistentType.getName());
- assertNotNull(javaPersistentType.getSuperPersistentType());
-
- assertEquals("test.Entity2", javaPersistentType.getSuperPersistentType().getName());
- }
-
- private void createTestGenericEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 ");
- sb.append("extends Entity2<Integer> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericMappedSuperclass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class Entity2<K> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity2.java", sourceWriter);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java
deleted file mode 100644
index 2632244b86..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.jpa2.context.SequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-/**
- * GenericJavaSequenceGenerator2_0Tests
- */
-@SuppressWarnings("nls")
-public class GenericJavaSequenceGenerator2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String SEQUENCE_GENERATOR_NAME = "TEST_SEQUENCE_GENERATOR";
-
- public GenericJavaSequenceGenerator2_0Tests(String name) {
- super(name);
- }
-
- // ********** catalog **********
-
- public void testGetCatalog() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getCatalog());
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- annotation.setCatalog("testCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("testCatalog", sequenceGenerator.getCatalog());
- assertEquals("testCatalog", sequenceGenerator.getSpecifiedCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getDefaultCatalog());
-
- sequenceGenerator.setSpecifiedCatalog("testCatalog");
-
- assertNull(sequenceGenerator.getDefaultCatalog());
- assertEquals("testCatalog", sequenceGenerator.getSpecifiedCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- sequenceGenerator.setSpecifiedCatalog("testCatalog");
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals("testCatalog", annotation.getCatalog());
-
- sequenceGenerator.setSpecifiedCatalog(null);
- assertNull(annotation.getCatalog());
- }
-
- // ********** schema **********
-
- public void testGetSchema() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) this.getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getSchema());
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- annotation.setSchema("testSchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("testSchema", sequenceGenerator.getSchema());
- assertEquals("testSchema", sequenceGenerator.getSpecifiedSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getDefaultSchema());
-
- sequenceGenerator.setSpecifiedSchema("testSchema");
-
- assertNull(sequenceGenerator.getDefaultSchema());
- assertEquals("testSchema", sequenceGenerator.getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntityWithSequenceGenerator();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- IdMapping idMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getDefaultSchema());
-
- this.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", sequenceGenerator.getDefaultSchema());
-
- this.getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", sequenceGenerator.getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", sequenceGenerator.getDefaultSchema());
-
- this.getEntityMappings().removePersistentType(0);
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
- assertEquals("FOO", sequenceGenerator.getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- sequenceGenerator.setSpecifiedSchema("testSchema");
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals("testSchema", annotation.getSchema());
-
- sequenceGenerator.setSpecifiedSchema(null);
- assertNull(annotation.getSchema());
- }
-
- // ********** utility **********
-
- protected ICompilationUnit createTestEntityWithSequenceGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SEQUENCE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@SequenceGenerator(name=\"" + SEQUENCE_GENERATOR_NAME + "\")");
- }
- });
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java
deleted file mode 100644
index 5fd0a4ff32..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaVersionMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
- public GenericJavaVersionMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java
deleted file mode 100644
index afbf7de334..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class Generic2_0OrmContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(Generic2_0OrmContextModelTests.class.getPackage().getName());
- suite.addTestSuite(GenericOrmAssociationOverride2_0Tests.class);
- suite.addTestSuite(GenericOrmCascade2_0Tests.class);
- suite.addTestSuite(GenericOrmCollectionTable2_0Tests.class);
- suite.addTestSuite(GenericOrmElementCollectionMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmEntity2_0Tests.class);
- suite.addTestSuite(GenericOrmEmbeddedMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmManyToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmManyToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmOneToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmOneToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmPersistentAttribute2_0Tests.class);
- suite.addTestSuite(GenericOrmPersistentType2_0Tests.class);
- suite.addTestSuite(GenericOrmSequenceGenerator2_0Tests.class);
- return suite;
- }
-
- private Generic2_0OrmContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java
deleted file mode 100644
index 3f9f71532c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTable;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.OverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(CR);
- sb.append(" private AnnotationTestTypeChild address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- sb.append(CR);
- sb.append(" private java.util.Collection<AnnotationTestTypeChild> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public GenericOrmAssociationOverride2_0Tests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormVirtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormVirtualAssociationOverride.getName());
-
- ormVirtualAssociationOverride.convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertEquals("address", ormAssociationOverride.getName());
- assertEquals("address", xmlAssociationOverride.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAssociationOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- //set name to null in the resource model
- xmlAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertEquals("address", specifiedAssociationOverride.getName());
- assertEquals("address", xmlAssociationOverride.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAssociationOverrides().isEmpty());
-
- //set name in the context model, verify resource model modified
- specifiedAssociationOverride.setName("foo");
- assertEquals("foo", specifiedAssociationOverride.getName());
- assertEquals("foo", xmlAssociationOverride.getName());
-
- //set name to null in the context model
- specifiedAssociationOverride.setName(null);
- assertNull(specifiedAssociationOverride.getName());
- xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- assertNull(xmlAssociationOverride.getName());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
-
- JoinColumn joinColumn = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- AssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- assertEquals(1, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, xmlAssociationOverride.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, xmlAssociationOverride.getJoinColumns().size());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- JoinColumn joinColumn = joinColumns.next();
- assertEquals("address_id", joinColumn.getSpecifiedName());
- assertEquals("id", joinColumn.getSpecifiedReferencedColumnName());
-
- xmlAssociationOverride.getJoinColumns().add(0, OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(1, OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(2, OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- xmlAssociationOverride.getJoinColumns().get(0).setName("FOO");
- xmlAssociationOverride.getJoinColumns().get(1).setName("BAR");
- xmlAssociationOverride.getJoinColumns().get(2).setName("BAZ");
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(2, 0);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(0);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("address_id", joinColumns.next().getName());
-
- xmlAssociationOverride.getJoinColumns().remove(0);
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals("AnnotationTestTypeChild", ormEntity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(associationOverride.isVirtual());
- }
-
-
- public void testSetJoinTableName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- OrmVirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- OrmAssociationOverride associationOverride = virtualOverride.convertToSpecified();
- ((OverrideRelationship2_0) associationOverride.getRelationship()).setStrategyToJoinTable();
- JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
-
- JoinTable joinTable = joiningStrategy.getJoinTable();
- joinTable.setSpecifiedName("FOO");
-
- assertEquals("FOO", xmlAssociationOverride.getJoinTable().getName());
- }
-
- public void testUpdateJoinTable() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- OrmVirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- OrmAssociationOverride associationOverride = virtualOverride.convertToSpecified();
- ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).setStrategyToJoinTable();
- OrmJoinTableRelationshipStrategy joiningStrategy = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- xmlAssociationOverride.getJoinTable().setName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", joiningStrategy.getJoinTable().getSpecifiedName());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinTable().getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinTable().getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().get(0).setName("FOO");
- xmlAssociationOverride.getJoinTable().getJoinColumns().get(1).setName("BAR");
- xmlAssociationOverride.getJoinTable().getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().move(2, 0);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().move(0, 1);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().remove(0);
- assertFalse(joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testDefaultJoinTableName() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
-
- VirtualJoinTable joinTable = joiningStrategy.getJoinTable();
-
- assertEquals("AnnotationTestTypeChild_AnnotationTestTypeChild", joinTable.getName());
-
-
- ormEntity.getTable().setSpecifiedName("FOO");
- assertEquals("FOO_FOO", joinTable.getName());
-
- PersistentType mappedSuperclass = ormPersistentType.getSuperPersistentType();
- ((OrmReadOnlyPersistentAttribute) mappedSuperclass.getAttributeNamed("address")).convertToSpecified();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) mappedSuperclass.getAttributeNamed("address").getMapping();
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("BAR");
- assertEquals("BAR", manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java
deleted file mode 100644
index ccec4fbb81..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmCascade2_0Tests extends Generic2_0ContextModelTestCase
-{
- public GenericOrmCascade2_0Tests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateCascadeDetach() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isDetach());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isDetach());
- assertNotNull(oneToOne.getCascade());
-
- //set detach in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeDetach(true);
- assertEquals(true, cascade.isDetach());
- assertEquals(true, oneToOne.getCascade().isCascadeDetach());
-
- //set detach to false in the resource model
- oneToOne.getCascade().setCascadeDetach(false);
- assertEquals(false, cascade.isDetach());
- assertEquals(false, oneToOne.getCascade().isCascadeDetach());
- }
-
- public void testModifyCascadeDetach() throws Exception {
- 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();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isDetach());
- assertNull(oneToOne.getCascade());
-
- //set detach in the context model, verify resource model updated
- cascade.setDetach(true);
- assertEquals(true, cascade.isDetach());
- assertEquals(true, oneToOne.getCascade().isCascadeDetach());
-
- //set detach to false in the context model
- cascade.setDetach(false);
- assertEquals(false, cascade.isDetach());
- assertNull(oneToOne.getCascade());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java
deleted file mode 100644
index f80cb1439a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java
+++ /dev/null
@@ -1,753 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmCollectionTable2_0Tests extends Generic2_0ContextModelTestCase
-{
- public GenericOrmCollectionTable2_0Tests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- sb.append("@Id").append(CR);
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
-
- //set name in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the resource model
- resourceElementCollection.getCollectionTable().setName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set name in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedName("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedName());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the context model
- ormCollectionTable.setSpecifiedName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testVirtualCollectionTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(TYPE_NAME + "_projects", virtualCollectionTable.getName());
- assertNull(virtualCollectionTable.getSpecifiedCatalog());
- assertNull(virtualCollectionTable.getSpecifiedSchema());
- assertEquals(0, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualCollectionTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
-
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) javaPersistentAttribute.getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping.getCollectionTable();
- javaCollectionTable.setSpecifiedName("FOO");
- javaCollectionTable.setSpecifiedCatalog("CATALOG");
- javaCollectionTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaCollectionTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
-
- assertEquals("FOO", virtualCollectionTable.getSpecifiedName());
- assertEquals("CATALOG", virtualCollectionTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualCollectionTable.getSpecifiedSchema());
- assertEquals(1, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- virtualJoinColumn = virtualCollectionTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "projects");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- assertEquals(TYPE_NAME + "_projects", ormCollectionTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).setSpecifiedName("Foo");
- assertEquals("Foo_projects", ormCollectionTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).setSpecifiedName("Bar");
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
-
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove element collection mapping from the orm.xml file
- ormPersistentAttribute.convertToVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
- assertTrue(ormPersistentAttribute2.isVirtual());
- assertEquals("JAVA_COLLECTION_TABLE", virtualCollectionTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName(null);
- assertEquals("Bar_projects", virtualCollectionTable.getName());
- assertEquals("Bar_projects", virtualCollectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set schema in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the resource model
- resourceElementCollection.getCollectionTable().setSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Schema in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the context model
- ormCollectionTable.setSpecifiedSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the resource model
- resourceElementCollection.getCollectionTable().setCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the context model
- ormCollectionTable.setSpecifiedCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- OrmJoinColumn joinColumn = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormCollectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, resourceCollectionTable.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
- }
-
-
- public void testUpdateJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- resourceCollectionTable.getJoinColumns().get(0).setName("FOO");
- resourceCollectionTable.getJoinColumns().get(1).setName("BAR");
- resourceCollectionTable.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(2, 0);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(0);
- assertFalse(ormCollectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testUniqueConstraints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- assertEquals(0, ormCollectionTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormCollectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
- ormCollectionTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(1);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(0);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
-
- ormCollectionTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormCollectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributes().iterator().next();
- assertTrue(virtualAttribute.isVirtual());
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) virtualAttribute.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- ListIterator<? extends UniqueConstraint> uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping2_0 = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping2_0.getCollectionTable();
-
- javaCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- virtualAttribute.convertToSpecified();
-
- virtualElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributes().iterator().next().getMapping();
- assertEquals(0, virtualElementCollectionMapping.getCollectionTable().getUniqueConstraintsSize());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java
deleted file mode 100644
index afb0daa0cc..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java
+++ /dev/null
@@ -1,1711 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmElementCollectionMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public GenericOrmElementCollectionMapping2_0Tests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection(targetClass=String.class, fetch=FetchType.EAGER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("oneToOneMapping", ormElementCollectionMapping.getName());
- assertEquals("oneToOneMapping", elementCollection.getName());
-
- //set name in the resource model, verify context model updated
- elementCollection.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the resource model
- elementCollection.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("oneToOneMapping", ormElementCollectionMapping.getName());
- assertEquals("oneToOneMapping", elementCollection.getName());
-
- //set name in the context model, verify resource model updated
- ormElementCollectionMapping.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the context model
- ormElementCollectionMapping.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", virtualElementCollectionMapping.getName());
- assertEquals(FetchType.EAGER, virtualElementCollectionMapping.getSpecifiedFetch());
- assertEquals("String", virtualElementCollectionMapping.getSpecifiedTargetClass());
-
- ormPersistentAttribute = ormPersistentAttribute.convertToSpecified();
- OrmElementCollectionMapping2_0 specifiedElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", specifiedElementCollectionMapping.getName());
- assertEquals(null, specifiedElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, specifiedElementCollectionMapping.getDefaultFetch());
- assertEquals(null, specifiedElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals(PACKAGE_NAME + ".Address", specifiedElementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.convertToSpecified(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormElementCollectionMapping.getName());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormElementCollectionMapping.getName());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
-
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormElementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollection.getFetch());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedTargetClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollection.setTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the resource model
- elementCollection.setTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- ormElementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeEntity() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("test.Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNotNull(oneToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKey().setName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
-
- oneToMany.getMapKey().setName("myMapKey");
- oneToMany.setMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKey());
- assertNull(virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertTrue(virtualElementCollectionMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setPkMapKey(true);
- assertEquals(null, virtualElementCollectionMapping.getMapKey());//no primary key on an embeddable
- assertTrue(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setCustomMapKey(true);
- javaElementCollectionMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("city", virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertTrue(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- 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();
- XmlOneToMany xmlOneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(xmlOneToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", xmlOneToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertTrue(ormOneToManyMapping.isPkMapKey());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").convertToSpecified();
- virtualElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- virtualElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- virtualElementCollectionMapping.setSpecifiedTargetClass("String");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- elementCollection.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNotNull(elementCollection.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- elementCollection.getMapKeyClass().setClassName("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- elementCollection.getMapKeyClass().setClassName(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass().getClassName());
-
- elementCollection.getMapKeyClass().setClassName("String");
- elementCollection.setMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", virtualElementCollectionMapping.getMapKeyClass());
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualElementCollectionMapping.getMapKeyClass());
- assertEquals("Integer", virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormElementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 virtualCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- orderable = (Orderable2_0) virtualCollectionMapping.getOrderable();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("addresses_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
- public void testVirtualValueColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attrubte in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
- assertEquals("addresses", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- OrmColumn ormColumn = addressesVirtualMapping.getValueColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualValueColumnTable() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getValueColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, elementCollectionResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testElementCollectionMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType persistentType3 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends ReadOnlyAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- ReadOnlyAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<? extends ReadOnlyAttributeOverride> virtualOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- attributeOverride = virtualOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaElementCollectionMapping.getValueAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType3.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("addresses").convertToSpecified();
- elementCollectionMapping = (OrmElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getDefaultTable());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", attributeOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
-
- public void testSelfReferentialElementCollectionMapping() throws Exception {
- createSelfReferentialElementCollection();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Foo");
-
- ElementCollectionMapping2_0 mapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("elementCollection").getMapping();
- assertFalse(mapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
-
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- elementCollectionResource.setMapKeyEnumerated(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, elementCollectionResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- elementCollectionResource.setMapKeyTemporal(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(TemporalConverter.class);
- ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyTemporal());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- JoinColumn joinColumn = ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, elementCollectionResource.getMapKeyJoinColumns().size());
-
- ormElementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, elementCollectionResource.getMapKeyJoinColumns().size());
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
-
- ormElementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionResource.getMapKeyJoinColumns().size());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
-
- ormElementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, elementCollectionResource.getMapKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, elementCollectionResource.getMapKeyJoinColumns().size());
-
-
- ormElementCollectionMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(2).getName());
-
-
- ormElementCollectionMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdateMapKeyJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- elementCollectionResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- elementCollectionResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- elementCollectionResource.getMapKeyJoinColumns().get(0).setName("FOO");
- elementCollectionResource.getMapKeyJoinColumns().get(1).setName("BAR");
- elementCollectionResource.getMapKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<? extends JoinColumn> joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().move(2, 0);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().move(0, 1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().remove(0);
- assertFalse(ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator().hasNext());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java
deleted file mode 100644
index 0a82a030a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java
+++ /dev/null
@@ -1,1734 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumn;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.EmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ReadOnlyOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- private static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- private static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- public GenericOrmEmbeddedMapping2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityEmbeddedMappingAttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
- private ICompilationUnit createTestEntityWithEmbeddedMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded").append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME + " myEmbedded;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createAddressEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Address {");
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress2() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- private void createSelfReferentialEmbedded() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Foo embedded;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the resource model, verify context model updated
- embeddedResource.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the resource model
- embeddedResource.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("embeddedMapping", ormEmbeddedMapping.getName());
- assertEquals("embeddedMapping", embeddedResource.getName());
-
- //set name in the context model, verify resource model updated
- ormEmbeddedMapping.setName("newName");
- assertEquals("newName", ormEmbeddedMapping.getName());
- assertEquals("newName", embeddedResource.getName());
-
- //set name to null in the context model
- ormEmbeddedMapping.setName(null);
- assertNull(ormEmbeddedMapping.getName());
- assertNull(embeddedResource.getName());
- }
-
-// public void testAddSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
-// OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-// XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-//
-// OrmAttributeOverride attributeOverride = ormEmbeddedMapping.addSpecifiedAttributeOverride(0);
-// attributeOverride.setName("FOO");
-//
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(0).getName());
-//
-// OrmAttributeOverride attributeOverride2 = ormEmbeddedMapping.addSpecifiedAttributeOverride(0);
-// attributeOverride2.setName("BAR");
-//
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(1).getName());
-//
-// OrmAttributeOverride attributeOverride3 = ormEmbeddedMapping.addSpecifiedAttributeOverride(1);
-// attributeOverride3.setName("BAZ");
-//
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-//
-// ListIterator<OrmAttributeOverride> attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-// assertEquals(attributeOverride2, attributeOverrides.next());
-// assertEquals(attributeOverride3, attributeOverrides.next());
-// assertEquals(attributeOverride, attributeOverrides.next());
-//
-// attributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
-// OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-// XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-//
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// ormEmbeddedMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedResource.getAttributeOverrides().size());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(2, embeddedResource.getAttributeOverrides().size());
-// assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(1, embeddedResource.getAttributeOverrides().size());
-// assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
-//
-// ormEmbeddedMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(0, embeddedResource.getAttributeOverrides().size());
-// }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping");
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
-
- assertEquals("foo", ormEmbeddedMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("address");
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends ReadOnlyAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- ReadOnlyAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<? extends ReadOnlyAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaEmbeddedMapping javaEmbeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType2.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").convertToSpecified();
- embeddedMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping();
- attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- assertEquals("city", virtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME, virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, virtualOverride.getColumn().getDefaultTable());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("id", attributeOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- EmbeddedMapping virtualEmbeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = virtualEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals("address", virtualEmbeddedMapping.getName());
-
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends ReadOnlyAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- ReadOnlyAttributeOverride override = specifiedAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, override.getName());
- ReadOnlyColumn column = override.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getSpecifiedName());
-
- ListIterator<? extends ReadOnlyAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- override = virtualAttributeOverrides.next();
- assertEquals("id", override.getName());
- column = override.getColumn();
- assertEquals("id", column.getName());
-
- override = virtualAttributeOverrides.next();
- assertEquals("state", override.getName());
- column = override.getColumn();
- assertEquals("A_STATE", column.getName());
-
- override = virtualAttributeOverrides.next();
- assertEquals("zip", override.getName());
- column = override.getColumn();
- assertEquals("zip", column.getName());
-
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- EmbeddedMapping virtualEmbeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", virtualEmbeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedMapping.getName());
-
- assertEquals(0, ormEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-
- public void testEmbeddedMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedIdMapping) ormPersistentAttribute.getMapping()).getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded");
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("embedded", ormPersistentAttribute.getMapping().getName());
- }
-
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
-
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(associationOverride);
- associationOverride.setName("FOO");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(1, associationOverride);
- associationOverride.setName("BAR");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(0, associationOverride);
- associationOverride.setName("BAZ");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- embeddedResource.getAssociationOverrides().move(1, 0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- embeddedResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- VirtualJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("address_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
-
- JavaPersistentType javaEmbeddable = getPersistenceUnit().getSpecifiedClassRefs().iterator().next().getJavaPersistentType();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) javaEmbeddable.getAttributeNamed("address").getMapping();
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(associationOverride);
- associationOverride.setName("FOO");
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(0, associationOverride);
- associationOverride.setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(associationOverride);
- associationOverride.setName("bar");
- assertEquals(3, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("address", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", embeddedResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals(1, embeddedResource.getAssociationOverrides().size());
-
- Iterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, embeddedResource.getAssociationOverrides().size());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", embeddedResource.getAssociationOverrides().get(1).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("addresses", associationOverrides.next().getName());
-
- assertEquals("address", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(1).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(0, associationOverride);
- associationOverride.setName("FOO");
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(1, associationOverride);
- associationOverride.setName("BAR");
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(2, associationOverride);
- associationOverride.setName("BAZ");
-
- ListIterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideJoinTableDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME_ + "Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "myEmbedded");
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- ReadOnlyJoinTable joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals("AnnotationTestType_Address", joinTable.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- ReadOnlyJoinColumn virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("AnnotationTestType_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- ReadOnlyJoinColumn virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("addresses_id", virtualInverseJoinColumn.getName());
- assertEquals("id", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualInverseJoinColumn.getTable());
- assertEquals(null, virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(true, virtualInverseJoinColumn.isInsertable());
- assertEquals(true, virtualInverseJoinColumn.isUpdatable());
- assertEquals(false, virtualInverseJoinColumn.isUnique());
- assertEquals(true, virtualInverseJoinColumn.isNullable());
-
- JavaPersistentType javaEmbeddable = getPersistenceUnit().getSpecifiedClassRefs().iterator().next().getJavaPersistentType();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) javaEmbeddable.getAttributeNamed("addresses").getMapping();
- JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableStrategy();
- joinTableStrategy.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = joinTableStrategy.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- JoinColumn inverseJoinColumn = joinTableStrategy.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("MY_INVERSE_JOIN_COLUMN");
- inverseJoinColumn.setSpecifiedReferencedColumnName("MY_INVERSE_REFERENCE_COLUMN");
- inverseJoinColumn.setSpecifiedTable("INVERSE_BAR");
- inverseJoinColumn.setColumnDefinition("INVERSE_COLUMN_DEF");
- inverseJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUnique(Boolean.TRUE);
- inverseJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- assertEquals("INVERSE_COLUMN_DEF", virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(false, virtualInverseJoinColumn.isInsertable());
- assertEquals(false, virtualInverseJoinColumn.isUpdatable());
- assertEquals(true, virtualInverseJoinColumn.isUnique());
- assertEquals(false, virtualInverseJoinColumn.isNullable());
-
-
- //add the java association override and make sure the settings are not used in determining the association override defaults in the specified orm embedded mapping
- JavaEmbeddedMapping2_0 javaEmbeddedMapping = (JavaEmbeddedMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- ListIterator<JavaReadOnlyAssociationOverride> javaAssociationOverrides = javaEmbeddedMapping.getAssociationOverrideContainer().getOverrides().iterator();
- javaAssociationOverrides.next();
- JavaAssociationOverride javaAssociationOverride = ((JavaVirtualAssociationOverride) javaAssociationOverrides.next()).convertToSpecified();
- assertEquals("addresses", javaAssociationOverride.getName());
- JavaJoinTable javaJoinTable = ((JavaOverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("JAVA_FOO");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("JAVA_JOIN_COLUMN_NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("JAVA_JOIN_COLUMN_REFERENCED_NAME");
- JavaJoinColumn javaInverseJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- javaInverseJoinColumn.setSpecifiedName("JAVA_INVERSE_JOIN_COLUMN_NAME");
- javaInverseJoinColumn.setSpecifiedReferencedColumnName("JAVA_INVERSE_JOIN_COLUMN_REFERENCED_NAME");
-
-
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
-
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- assertEquals("INVERSE_COLUMN_DEF", virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(false, virtualInverseJoinColumn.isInsertable());
- assertEquals(false, virtualInverseJoinColumn.isUpdatable());
- assertEquals(true, virtualInverseJoinColumn.isUnique());
- assertEquals(false, virtualInverseJoinColumn.isNullable());
-
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
-
- ormPersistentAttribute.convertToVirtual();
- EmbeddedMapping2_0 virtualEmbeddedMapping = (EmbeddedMapping2_0) ormPersistentType.getAttributeNamed("myEmbedded").getMapping();
- overrideContainer = virtualEmbeddedMapping.getAssociationOverrideContainer();
- AssociationOverride associationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("addresses", associationOverride.getName());
- ReadOnlyJoinTableRelationshipStrategy strategy = ((ReadOnlyOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = strategy.getJoinTable();
- assertEquals("JAVA_FOO", joinTable.getName());
- assertEquals(2, joinTable.getJoinColumnsSize());
- ListIterator<? extends ReadOnlyJoinColumn> joinColumns = joinTable.getJoinColumns().iterator();
- virtualJoinColumn = joinColumns.next();
- assertEquals("JAVA_JOIN_COLUMN_NAME", virtualJoinColumn.getName());
- assertEquals("JAVA_JOIN_COLUMN_REFERENCED_NAME", virtualJoinColumn.getReferencedColumnName());
- assertEquals("JAVA_FOO", virtualJoinColumn.getTable());
- virtualJoinColumn = joinColumns.next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
-
- assertEquals(2, joinTable.getInverseJoinColumnsSize());
- ListIterator<? extends ReadOnlyJoinColumn> inverseJoinColumns = joinTable.getInverseJoinColumns().iterator();
- virtualInverseJoinColumn = inverseJoinColumns.next();
- assertEquals("JAVA_INVERSE_JOIN_COLUMN_NAME", virtualInverseJoinColumn.getName());
- assertEquals("JAVA_INVERSE_JOIN_COLUMN_REFERENCED_NAME", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("JAVA_FOO", virtualInverseJoinColumn.getTable());
- virtualInverseJoinColumn = inverseJoinColumns.next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress2();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- customerPersistentType.getAttributeNamed("address").convertToSpecified();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(5, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- addressPersistentType.getAttributeNamed("zipCode").convertToSpecified();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- zipCodePersistentType.getAttributeNamed("plusfour").convertToSpecified();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
- virtualAttributeOverride = (VirtualAttributeOverride) ((EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testSelfReferentialEmbeddedMapping() throws Exception {
- createSelfReferentialEmbedded();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Foo");
-
- EmbeddedMapping2_0 embeddedMapping = (EmbeddedMapping2_0) persistentType.getAttributeNamed("embedded").getMapping();
- assertFalse(embeddedMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java
deleted file mode 100644
index 559fef408e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java
+++ /dev/null
@@ -1,1972 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmNamedQuery2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlAssociationOverride_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmEntity2_0Tests extends Generic2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public GenericOrmEntity2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- private LockModeType2_0 lockModeOf(XmlNamedQuery resourceQuery) {
- return resourceQuery == null ? null : LockModeType2_0.fromOrmResourceModel(resourceQuery.getLockMode());
- }
-
- public void testAddNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmNamedQuery2_0 namedQuery = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery.setName("FOO");
- namedQuery.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- XmlNamedQuery resourceQuery = entityResource.getNamedQueries().get(0);
- assertEquals("FOO", resourceQuery.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(resourceQuery));
-
- OrmNamedQuery2_0 namedQuery2 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.READ);
-
- resourceQuery = entityResource.getNamedQueries().get(0);
- assertEquals("BAR", resourceQuery.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(resourceQuery));
- assertEquals("FOO", entityResource.getNamedQueries().get(1).getName());
-
- OrmNamedQuery2_0 namedQuery3 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
- namedQuery3.setSpecifiedLockMode(LockModeType2_0.WRITE);
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- resourceQuery = entityResource.getNamedQueries().get(1);
- assertEquals("BAZ", resourceQuery.getName());
- assertEquals(LockModeType2_0.WRITE, this.lockModeOf(resourceQuery));
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- OrmNamedQuery2_0 namedQuery1 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.READ);
-
- OrmNamedQuery2_0 namedQuery2 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(2);
- namedQuery2.setName("BAZ");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(2, entityResource.getNamedQueries().size());
- XmlNamedQuery xmlQuery0 = entityResource.getNamedQueries().get(0);
- assertEquals("BAR", xmlQuery0.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(xmlQuery0));
-
- XmlNamedQuery xmlQuery1 = entityResource.getNamedQueries().get(1);
- assertEquals("BAZ", xmlQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery1));
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(1, entityResource.getNamedQueries().size());
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
- xmlQuery0 = entityResource.getNamedQueries().get(0);
- assertEquals("BAZ", xmlQuery0.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery0));
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(0, entityResource.getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- OrmNamedQuery2_0 namedQuery1 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
- ormEntity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- XmlNamedQuery xmlQuery0 = entityResource.getNamedQueries().get(0);
- assertEquals("BAR", xmlQuery0.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery0));
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
- XmlNamedQuery xmlQuery1 = entityResource.getNamedQueries().get(1);
- assertEquals("BAR", xmlQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery1));
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().get(0).setName("FOO");
- entityResource.getNamedQueries().get(1).setName("BAR");
- XmlNamedQuery xmlQuery = entityResource.getNamedQueries().get(2);
- xmlQuery.setName("BAZ");
- xmlQuery.setLockMode(org.eclipse.jpt.jpa.core.resource.orm.v2_0.LockModeType_2_0.OPTIMISTIC);
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- OrmNamedQuery2_0 namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().move(2, 0);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().move(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(0);
- assertFalse(ormEntity.getQueryContainer().getNamedQueries().iterator().hasNext());
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
- }
-
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-//TODO
-// public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-// getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// Iterator<PersistentAttribute> overridableAttributes = getJavaEntity().allOverridableAttributes();
-// assertEquals("id", overridableAttributes.next().getName());
-// assertEquals("name", overridableAttributes.next().getName());
-// assertEquals("foo", overridableAttributes.next().getName());
-// assertFalse(overridableAttributes.hasNext());
-// }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAZ");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().move(1, 0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testDefaultAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) ormEntity.getPersistentType().getSuperPersistentType().getMapping();
-
- mappedSuperclass.getPersistentType().getAttributeNamed("id").convertToSpecified();
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testDefaultAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmEntity superclass = (OrmEntity) ormEntity.getParentEntity();
-
- superclass.getPersistentType().getAttributeNamed("id").convertToSpecified();
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("bar");
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
-
- Iterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals(1, entityResource.getAttributeOverrides().size());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAttributeOverrides().size());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().add(2, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = entity.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociations() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("FOO");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(1, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAR");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAZ");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().move(1, 0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testDefaultAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(FULLY_QUALIFIED_SUB_TYPE_NAME, entityResource.getClassName());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-//
-// //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-// //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
-// //idMapping.getColumn().setSpecifiedName("FOO");
-// //idMapping.getColumn().setSpecifiedTable("BAR");
-//
-// assertEquals(SUB_TYPE_NAME, entityResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-// //idMapping.getColumn().setSpecifiedName(null);
-// //idMapping.getColumn().setSpecifiedTable(null);
-// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("bar");
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals(1, entityResource.getAssociationOverrides().size());
-
- Iterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAssociationOverrides().size());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(1, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().add(2, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").convertToSpecified();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").convertToSpecified();
- OrmAttributeOverride specifiedAttributeOverride = ((OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").convertToSpecified();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").convertToSpecified();
- OrmAttributeOverride specifiedAttributeOverride = ((OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer overrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- cacheable.setSpecifiedCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- entityResource.setCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- assertEquals(SharedCacheMode.UNSPECIFIED, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromSuperType() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromJava() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
-
- Cacheable2_0 javaCacheable = ((CacheableHolder2_0) ormPersistentType.getJavaPersistentType().getMapping()).getCacheable();
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- //This is a test for bug 301892
- public void testAssociationOverrideJoinTableUpdate() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- XmlEntity resourceEntity = getXmlEntityMappings().getEntities().get(0);
-
- XmlAssociationOverride_2_0 resourceAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- resourceEntity.getAssociationOverrides().add((XmlAssociationOverride) resourceAssociationOverride);
- ((XmlAssociationOverride) resourceAssociationOverride).setName("a");
-
- OrmAssociationOverride associationOverride = entity.getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
-
- XmlJoinTable resourceJoinTable = OrmFactory.eINSTANCE.createXmlJoinTable();
- resourceAssociationOverride.setJoinTable(resourceJoinTable);
- resourceJoinTable.setName("FOO");
- XmlJoinColumn resourceJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumn();
- resourceJoinTable.getInverseJoinColumns().add(resourceJoinColumn);
- resourceJoinColumn.setName("BAR");
-
- associationOverride = entity.getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
- JoinTable joinTable = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("BAR", joinTable.getInverseJoinColumns().iterator().next().getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java
deleted file mode 100644
index 43ac4cf2c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,1197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.NullOrmConverter;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmManyToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmManyToManyMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, JPA2_0.MAP_KEY_ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @MapKeyEnumerated(EnumType.STRING)").append(CR);
- sb.append(" private java.util.Map<String, Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNotNull(manyToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKey().setName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
-
- manyToMany.getMapKey().setName("myMapKey");
- manyToMany.setMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualManyToManyMapping.getSpecifiedMapKey());
- assertNull(virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertTrue(virtualManyToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualManyToManyMapping.getMapKey());
- assertTrue(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setCustomMapKey(true);
- javaManyToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualManyToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertTrue(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- 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();
- XmlManyToMany xmlManyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(xmlManyToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", xmlManyToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(xmlManyToMany.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").convertToSpecified();
- virtualManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- virtualManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- virtualManyToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(manyToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKeyClass().setClassName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass().getClassName());
-
- manyToMany.getMapKeyClass().setClassName("String");
- manyToMany.setMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping2_0 virtualManyToManyMapping = (ManyToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", virtualManyToManyMapping.getMapKeyClass());
- assertNull(virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualManyToManyMapping.getMapKeyClass());
- assertEquals("Integer", virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- 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().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");
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
-
- jobsOrderable.setOrderColumnOrdering(true);
- jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderable.setOrderColumnOrdering(true);
- queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- 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();
-
- OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "queues");
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- JavaManyToManyMapping javaJobsManyToManyMapping = (JavaManyToManyMapping) jobsPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- jobsPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute jobsPersistentAttribute2 = printQueuePersistentType.getAttributeNamed("jobs");
- ManyToManyMapping virtualJobsMapping = (ManyToManyMapping) jobsPersistentAttribute2.getMapping();
- jobsOrderable = ((Orderable2_0) virtualJobsMapping.getOrderable());
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(false, jobsOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", jobsOrderable.getOrderColumn().getName());
- queuesPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute queuesPersistentAttribute2 = printJobPersistentType.getAttributeNamed("queues");
- ManyToManyMapping virtualQueuesMapping = (ManyToManyMapping) queuesPersistentAttribute2.getMapping();
- queuesOrderable = ((Orderable2_0) virtualQueuesMapping.getOrderable());
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(false, queuesOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- JavaManyToManyMapping javaQueuesManyToManyMapping = (JavaManyToManyMapping) queuesPersistentAttribute.getJavaPersistentAttribute().getMapping();
- javaQueuesManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE");
- assertEquals("JOIN_TABLE", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("JOIN_TABLE", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", ormColumn.getName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertTrue(ormColumn.isInsertable());
- assertTrue(ormColumn.isUpdatable());
- assertTrue(ormColumn.isNullable());
- assertFalse(ormColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getScale());
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", ormColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), ormColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmManyToManyMapping2_0 addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column column = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", column.getTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", column.getTable());
-
- //set Column table element in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", column.getTable());
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", column.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- column = addressesVirtualMapping.getMapKeyColumn();
- assertNull(column.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", column.getDefaultTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToManyMapping2_0 virtualManyToManyMapping = (ManyToManyMapping2_0) virtualAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) virtualManyToManyMapping.getMapKeyConverter()).getEnumType());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
- virtualPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(ormManyToManyMapping.getMapKeyConverter() instanceof NullOrmConverter);
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
-
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- manyToManyResource.setMapKeyEnumerated(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "ManyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyEnumerated());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "ManyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, manyToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- manyToManyResource.setMapKeyTemporal(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "ManyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(TemporalConverter.class);
- ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyTemporal());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- JoinColumn joinColumn = ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToManyResource.getMapKeyJoinColumns().size());
-
- ormManyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, manyToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- ormManyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- ormManyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, manyToManyResource.getMapKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToManyResource.getMapKeyJoinColumns().size());
-
-
- ormManyToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(2).getName());
-
-
- ormManyToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdateMapKeyJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- manyToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- manyToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- manyToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- manyToManyResource.getMapKeyJoinColumns().get(0).setName("FOO");
- manyToManyResource.getMapKeyJoinColumns().get(1).setName("BAR");
- manyToManyResource.getMapKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<? extends JoinColumn> joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().move(2, 0);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().move(0, 1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().remove(0);
- assertFalse(ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java
deleted file mode 100644
index d178847a00..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,673 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmManyToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmManyToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEntityWithManyToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId("foo");
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(Boolean.TRUE);
- assertNotNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("manyToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- resourceManyToOne.setMapsId("foo");
- assertNull(resourceManyToOne.getId());
- assertFalse(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceManyToOne.getMapsId());
- assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertNull(resourceOneToOne.getId());
- assertFalse(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceOneToOne.getMapsId());
- assertEquals("foo", ((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- assertNull(resourceManyToOne.getId());
- assertFalse(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceManyToOne.getMapsId());
- assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 javaManyToOneMapping = ((JavaManyToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", virtualJoinTable.getName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
- JoinColumn virtualInverseJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualInverseJoinColumn.getDefaultTable());
- assertEquals("address_id", virtualInverseJoinColumn.getDefaultName());
- assertEquals("id", virtualInverseJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- virtualJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- virtualInverseJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", virtualInverseJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", virtualInverseJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- OrmJoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaManyToOneMapping2_0 javaManyToOneMapping = (JavaManyToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.convertToVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) virtualPersistentAttribute.getMapping();
- 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()).getJoinTableStrategy().removeStrategy();
- virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable);
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable.getSpecifiedName());
- assertEquals("BAR_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToOneMapping virtualManyToOneMapping = (ManyToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java
deleted file mode 100644
index ff0785e334..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,1486 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.NullOrmConverter;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmOneToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmOneToManyMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithValidOneToManyMapping() throws Exception {
- this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, JPA2_0.MAP_KEY_ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @MapKeyEnumerated(EnumType.STRING)").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.name");
- assertEquals("name", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.name");
- assertEquals("name", stateFooMapping.getName());
- }
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
-
- oneToManyResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testUpdateMapKey() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNotNull(oneToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKey().setName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
-
- oneToMany.getMapKey().setName("myMapKey");
- oneToMany.setMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToManyMapping.getMapKey());
- assertFalse(oneToManyMapping.isPkMapKey());
- assertFalse(oneToManyMapping.isCustomMapKey());
- assertTrue(oneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", oneToManyMapping.getMapKey());
- assertTrue(oneToManyMapping.isPkMapKey());
- assertFalse(oneToManyMapping.isCustomMapKey());
- assertFalse(oneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", oneToManyMapping.getMapKey());
- assertFalse(oneToManyMapping.isPkMapKey());
- assertTrue(oneToManyMapping.isCustomMapKey());
- assertFalse(oneToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").convertToSpecified();
- oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(oneToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKeyClass().setClassName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass().getClassName());
-
- oneToMany.getMapKeyClass().setClassName("String");
- oneToMany.setMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", oneToManyMapping.getMapKeyClass());
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", oneToManyMapping.getMapKeyClass());
- assertEquals("Integer", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- 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().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queue");
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- OrmPersistentType printJobPersistentType = (OrmPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "jobs");
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("jobs");
- oneToManyMapping = (OneToManyMapping) ormPersistentAttribute2.getMapping();
- orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualAddressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = virtualAddressesMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getName());
- assertEquals("FOO_TABLE", virtualColumn.getTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertFalse(virtualColumn.isInsertable());
- assertFalse(virtualColumn.isUpdatable());
- assertFalse(virtualColumn.isNullable());
- assertTrue(virtualColumn.isUnique());
- assertEquals(45, virtualColumn.getLength());
- assertEquals(46, virtualColumn.getPrecision());
- assertEquals(47, virtualColumn.getScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmOneToManyMapping2_0 addressesVirtualMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- OneToManyMapping2_0 virtualAddressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = virtualAddressesMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertNull(virtualColumn.getSpecifiedTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", virtualColumn.getTable());
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
- OneToManyMapping2_0 specifiedAddressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column specifiedColumn = specifiedAddressesMapping.getMapKeyColumn();
- assertNull(specifiedColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", specifiedColumn.getDefaultTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 contextMapping = (OrmOneToManyMapping2_0) contextAttribute.getMapping();
- OrmOneToManyRelationship2_0 rel = (OrmOneToManyRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 contextMapping = (OrmOneToManyMapping2_0) contextAttribute.getMapping();
- OrmOneToManyRelationship2_0 rel = (OrmOneToManyRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- 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.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.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.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- 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.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship();
- rr.setStrategyToJoinColumn();
-
- JoinColumn joinColumn = rr.getJoinColumnStrategy().getJoinColumns().iterator().next();
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.convertToSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship();
- assertFalse(rr.strategyIsJoinColumn());
-
- rr.setStrategyToJoinColumn();
- joinColumn = rr.getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertFalse(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship();
- rr.setStrategyToJoinColumn();
-
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.convertToSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship();
- assertFalse(rr.strategyIsJoinColumn());
-
- rr.setStrategyToJoinColumn();
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- oneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("FOO", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship();
- rr.setStrategyToJoinColumn();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
-
- //override the mapping in orm.xml
- persistentAttribute.convertToSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship();
- assertFalse(rr.strategyIsJoinColumn());
-
- rr.setStrategyToJoinColumn();
- assertFalse(((Orderable2_0) oneToManyMapping.getOrderable()).isOrderColumnOrdering());
- ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) virtualOneToManyMapping.getMapKeyConverter()).getEnumType());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch());
- assertEquals("test.Address", ormOneToManyMapping.getTargetEntity());
- assertNull(ormOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(ormOneToManyMapping.getMapKeyConverter() instanceof NullOrmConverter);
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertFalse(((OrmOrphanRemovalHolder2_0) ormOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
-
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- oneToManyResource.setMapKeyEnumerated(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyEnumerated());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, oneToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- oneToManyResource.setMapKeyTemporal(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(TemporalConverter.class);
- ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyTemporal());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- JoinColumn joinColumn = ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToManyResource.getMapKeyJoinColumns().size());
-
- ormOneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, oneToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- ormOneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- ormOneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, oneToManyResource.getMapKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedMapKeyJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToManyResource.getMapKeyJoinColumns().size());
-
-
- ormOneToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(2).getName());
-
-
- ormOneToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdateMapKeyJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- oneToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- oneToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- oneToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- oneToManyResource.getMapKeyJoinColumns().get(0).setName("FOO");
- oneToManyResource.getMapKeyJoinColumns().get(1).setName("BAR");
- oneToManyResource.getMapKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<? extends JoinColumn> joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().move(2, 0);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().move(0, 1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().remove(0);
- assertFalse(ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java
deleted file mode 100644
index d90195fd20..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,990 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmOneToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmOneToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(Boolean.TRUE);
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId("foo");
- assertNotNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(null);
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("oneToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- resourceOneToOne.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceOneToOne.getId());
- assertTrue(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceOneToOne.getMapsId());
- assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- assertEquals(Boolean.TRUE, resourceManyToOne.getId());
- assertTrue(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceManyToOne.getMapsId());
- assertNull(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertEquals(Boolean.TRUE, resourceOneToOne.getId());
- assertTrue(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceOneToOne.getMapsId());
- assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames = oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToOneResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
-
- oneToOneResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 javaOneToOneMapping = ((JavaOneToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- JavaOneToOneMapping2_0 virtualOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertNull(virtualJoinTable.getSpecifiedName());
- assertEquals(TYPE_NAME + "_Address", virtualJoinTable.getDefaultName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn ormJoinColumn = virtualJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", ormJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", ormJoinColumn.getDefaultName());
- assertEquals("id", ormJoinColumn.getDefaultReferencedColumnName());
- JoinColumn inverseOrmJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", inverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", inverseOrmJoinColumn.getDefaultName());
- assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- ormJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", inverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", inverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaOneToOneMapping2_0 javaOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.convertToVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributeNamed("address");
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) virtualAttribute.getMapping();
- 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()).getJoinTableStrategy().removeStrategy();
- virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable);
- ((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());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn virtualJoinColumn =
- virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OneToOneMapping2_0 ormOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertFalse(((OrmOrphanRemovalHolder2_0) ormOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java
deleted file mode 100644
index d0bf3e8f57..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java
+++ /dev/null
@@ -1,565 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentAttribute2_0Tests
- extends Generic2_0ContextModelTestCase
-{
-
- public GenericOrmPersistentAttribute2_0Tests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMappingPropertyAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
-
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedWithAccess() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = CollectionTools.get(ormPersistentType.getVirtualAttributes(), 1);
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertEquals(null, ormPersistentAttribute.getJavaPersistentAttribute().getSpecifiedAccess());
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertEquals(null, specifiedOrmPersistentAttribute.getSpecifiedAccess());
- assertEquals(AccessType.PROPERTY, specifiedOrmPersistentAttribute.getAccess());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, specifiedOrmPersistentAttribute.getAccess());
- assertEquals(null, specifiedOrmPersistentAttribute.getSpecifiedAccess());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, specifiedOrmPersistentAttribute.getSpecifiedAccess());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertTrue(ormPersistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- ormPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getVirtualAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertTrue(javaResourceAttribute.getKind() == Kind.FIELD);
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).convertToVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-
- public void testGetJavaPersistentAttributeMixedAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute ormPropertyAttribute = attributes.next();
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertEquals(AccessType.FIELD, ormFieldAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getOwningPersistentType().getAccess());
- assertTrue(ormFieldAttribute.isVirtual());
- assertTrue(ormPropertyAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormFieldAttribute.getMappingKey());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPropertyAttribute.getMappingKey());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
-
- ormPropertyAttribute.convertToSpecified();
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
- ((OrmPersistentAttribute) ormPropertyAttribute).setSpecifiedAccess(AccessType.FIELD);
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPropertyAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccessPropertyInJava() throws Exception {
- createTestEntityIdMappingPropertyAccess();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
- }
-
- public void testGetAccessPropertyInJava2() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- OrmReadOnlyPersistentAttribute nameOrmPersistentAttribute = ormPersistentType.getAttributeNamed("name");
- JavaPersistentAttribute nameJavaPersistentAttribute = javaPersistentType.getAttributeNamed("name");
-
- assertTrue(nameOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getAccess());
- assertTrue(nameOrmPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, nameJavaPersistentAttribute.getAccess());
- assertTrue(nameJavaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
- nameOrmPersistentAttribute.convertToSpecified();
- nameOrmPersistentAttribute = ormPersistentType.getAttributeNamed("name");
- assertFalse(nameOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertTrue(nameOrmPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, nameJavaPersistentAttribute.getAccess());
- assertTrue(nameJavaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(nameJavaPersistentAttribute, nameOrmPersistentAttribute.getJavaPersistentAttribute());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
- assertFalse(nameOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, nameOrmPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, nameJavaPersistentAttribute.getAccess());
- assertTrue(nameJavaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java
deleted file mode 100644
index a32aa28c65..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentType2_0Tests
- extends Generic2_0ContextModelTestCase
-{
-
- public GenericOrmPersistentType2_0Tests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
-
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityFieldSpecifiedPropertyAnnotated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- public void testGetAccessWithJavaAnnotations() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.convertToSpecified();
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testGetAccessWithJavaAnnotationsProperty() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.convertToSpecified();
- assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testVirtualAttributes() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
- }
-
- public void testVirtualAttributes2() throws Exception {
- createTestEntityPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
- }
-
- public void testVirtualAttributes3() throws Exception {
- createTestEntityFieldSpecifiedPropertyAnnotated();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- assertEquals(AccessType.PROPERTY, virtualAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
-
- virtualAttribute.convertToSpecified();
-
- virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
-
- OrmPersistentAttribute specifiedAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedAttribute.getName());
- assertEquals(AccessType.PROPERTY, specifiedAttribute.getSpecifiedAccess());
-
-
- virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- virtualAttributes.next();
- virtualAttributes.next().convertToSpecified();
- virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
- }
-
- public void testGetDefaultAccess() throws Exception {
- createTestEntityPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- javaPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- javaPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java
deleted file mode 100644
index 527e131e50..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.SequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-/**
- * Generic2_0OrmSequenceGenerator2_0Tests
- */
-@SuppressWarnings("nls")
-public class GenericOrmSequenceGenerator2_0Tests
- extends Generic2_0ContextModelTestCase
-{
-
- public GenericOrmSequenceGenerator2_0Tests(String name) {
- super(name);
- }
-
- // ********** catalog **********
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setCatalog("FOO");
- assertEquals("FOO", sequenceGenerator.getSpecifiedCatalog());
- assertEquals("FOO", sequenceGeneratorResource.getCatalog());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setCatalog(null);
- assertNull(sequenceGenerator.getSpecifiedCatalog());
- assertNull(sequenceGeneratorResource.getCatalog());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedCatalog("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getCatalog());
- assertEquals("FOO", sequenceGenerator.getSpecifiedCatalog());
-
- //set name to null in the context model
- sequenceGenerator.setSpecifiedCatalog(null);
- assertNull(sequenceGeneratorResource.getCatalog());
- assertNull(sequenceGenerator.getSpecifiedCatalog());
- }
-
- // ********** schema **********
-
- public void testUpdateSpecifiedSchema() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setSchema("FOO");
- assertEquals("FOO", sequenceGenerator.getSpecifiedSchema());
- assertEquals("FOO", sequenceGeneratorResource.getSchema());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setSchema(null);
- assertNull(sequenceGenerator.getSpecifiedSchema());
- assertNull(sequenceGeneratorResource.getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedSchema("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getSchema());
- assertEquals("FOO", sequenceGenerator.getSpecifiedSchema());
-
- //set name to null in the context model
- sequenceGenerator.setSpecifiedSchema(null);
- assertNull(sequenceGeneratorResource.getSchema());
- assertNull(sequenceGenerator.getSpecifiedSchema());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java
deleted file mode 100644
index a913b9e229..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-
-/**
- * GenericConnection2_0Tests
- */
-@SuppressWarnings("nls")
-public class Generic2_0ConnectionTests extends Generic2_0PersistenceUnitTests
-{
- private JpaConnection2_0 connection;
-
- public static final String DRIVER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_DRIVER;
- public static final String DRIVER_TEST_VALUE = "test";
- public static final String DRIVER_TEST_VALUE_2 = "test_2";
-
- public static final String URL_KEY = JpaConnection2_0.PERSISTENCE_JDBC_URL;
- public static final String URL_TEST_VALUE = "test";
- public static final String URL_TEST_VALUE_2 = "test_2";
-
- public static final String USER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_USER;
- public static final String USER_TEST_VALUE = "test";
- public static final String USER_TEST_VALUE_2 = "test_2";
-
- public static final String PASSWORD_KEY = JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD;
- public static final String PASSWORD_TEST_VALUE = "test";
- public static final String PASSWORD_TEST_VALUE_2 = "test_2";
-
- // ********** constructors **********
- public Generic2_0ConnectionTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.connection = (JpaConnection2_0) this.subject.getConnection();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.connection.addPropertyChangeListener(JpaConnection2_0.DRIVER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(JpaConnection2_0.URL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(JpaConnection2_0.USER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(JpaConnection2_0.PASSWORD_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 4; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(DRIVER_KEY, DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(URL_KEY, URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(USER_KEY, USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(PASSWORD_KEY, PASSWORD_TEST_VALUE.toString());
-
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.connection;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(JpaConnection2_0.DRIVER_PROPERTY))
- modelValue = this.connection.getDriver();
- else if (propertyName.equals(JpaConnection2_0.URL_PROPERTY))
- modelValue = this.connection.getUrl();
- else if (propertyName.equals(JpaConnection2_0.USER_PROPERTY))
- modelValue = this.connection.getUser();
- else if (propertyName.equals(JpaConnection2_0.PASSWORD_PROPERTY))
- modelValue = this.connection.getPassword();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(JpaConnection2_0.DRIVER_PROPERTY))
- this.connection.setDriver((String) newValue);
- else if (propertyName.equals(JpaConnection2_0.URL_PROPERTY))
- this.connection.setUrl((String) newValue);
- else if (propertyName.equals(JpaConnection2_0.USER_PROPERTY))
- this.connection.setUser((String) newValue);
- else if (propertyName.equals(JpaConnection2_0.PASSWORD_PROPERTY))
- this.connection.setPassword((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- // ********** Driver tests **********
- public void testSetDriver() throws Exception {
- this.verifyModelInitialized(
- DRIVER_KEY,
- DRIVER_TEST_VALUE);
- this.verifySetProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- public void testAddRemoveDriver() throws Exception {
- this.verifyAddRemoveProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- // ********** Url tests **********
- public void testSetUrl() throws Exception {
- this.verifyModelInitialized(
- URL_KEY,
- URL_TEST_VALUE);
- this.verifySetProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- public void testAddRemoveUrl() throws Exception {
- this.verifyAddRemoveProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- // ********** User tests **********
- public void testSetUser() throws Exception {
- this.verifyModelInitialized(
- USER_KEY,
- USER_TEST_VALUE);
- this.verifySetProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- public void testAddRemoveUser() throws Exception {
- this.verifyAddRemoveProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- // ********** Password tests **********
- public void testSetPassword() throws Exception {
- this.verifyModelInitialized(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE);
- this.verifySetProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
- public void testAddRemovePassword() throws Exception {
- this.verifyAddRemoveProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java
deleted file mode 100644
index 10ea07e67f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-
-/**
- * GenericOptions2_0Tests
- */
-@SuppressWarnings("nls")
-public class Generic2_0OptionsTests extends Generic2_0PersistenceUnitTests
-{
- private JpaOptions2_0 options;
- private ListChangeEvent prePersistEvent;
- private ListChangeEvent preUpdateEvent;
- private ListChangeEvent preRemoveEvent;
-
- public static final String LOCK_TIMEOUT_KEY = JpaOptions2_0.PERSISTENCE_LOCK_TIMEOUT;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE = 100;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String QUERY_TIMEOUT_KEY = JpaOptions2_0.PERSISTENCE_QUERY_TIMEOUT;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE = 100;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String VALIDATION_GROUP_PRE_PERSIST_KEY = JpaOptions2_0.PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST;
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE = "test_pre-persist_group";
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2 = "test_2_pre-persist_group";
-
- public static final String VALIDATION_GROUP_PRE_UPDATE_KEY = JpaOptions2_0.PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE;
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE = "test_pre-update_group";
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2 = "test_2_pre-update_group";
-
- public static final String VALIDATION_GROUP_PRE_REMOVE_KEY = JpaOptions2_0.PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE;
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE = "test_pre-remove_group";
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2 = "test_2_pre-remove_group";
-
- // ********** constructors **********
- public Generic2_0OptionsTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = (JpaOptions2_0) this.subject.getOptions();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.options.addPropertyChangeListener(JpaOptions2_0.LOCK_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.QUERY_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY, propertyChangeListener);
-
- ListChangeListener validationGroupListChangeListener = this.buildValidationGroupListChangeListener();
- this.options.addListChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_LIST, validationGroupListChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 5; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty(LOCK_TIMEOUT_KEY, LOCK_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(QUERY_TIMEOUT_KEY, QUERY_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
-
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_PERSIST_KEY, VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_UPDATE_KEY, VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_REMOVE_KEY, VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(JpaOptions2_0.LOCK_TIMEOUT_PROPERTY))
- modelValue = this.options.getLockTimeout();
- else if (propertyName.equals(JpaOptions2_0.QUERY_TIMEOUT_PROPERTY))
- modelValue = this.options.getQueryTimeout();
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPrePersists().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreUpdates().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreRemoves().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(JpaOptions2_0.LOCK_TIMEOUT_PROPERTY))
- this.options.setLockTimeout((Integer) newValue);
- else if (propertyName.equals(JpaOptions2_0.QUERY_TIMEOUT_PROPERTY))
- this.options.setQueryTimeout((Integer) newValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist((String) newValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate((String) newValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- // ********** LockTimeout tests **********
- public void testSetLockTimeout() throws Exception {
- this.verifyModelInitialized(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveLockTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** QueryTimeout tests **********
- public void testSetQueryTimeout() throws Exception {
- this.verifyModelInitialized(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveQueryTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPrePersist tests **********
- public void testSetValidationGroupPrePersist() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPrePersist() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreUpdate tests **********
- public void testSetValidationGroupPreUpdate() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreUpdate() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreRemove tests **********
- public void testSetValidationGroupPreRemove() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreRemove() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroups list **********
- public void testValidationGroupsList() throws Exception {
- this.verifyListEvents(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2,
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_LIST);
-
- this.verifyListEvents(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2,
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_LIST);
-
- this.verifyListEvents(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2,
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_LIST);
- }
-
- // ********** override **********
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.prePersistEvent = null;
- this.preUpdateEvent = null;
- this.preRemoveEvent = null;
- }
-
- // ****** convenience methods *******
-
- // ********** verify ValidationGroup property **********
- protected void verifySetValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2, true);
- this.propertiesTotal++;
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- @SuppressWarnings("unused")
- protected void verifyAddRemoveValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- assertTrue(this.validationGroupValueExists(propertyName, (String)testValue1));
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key, (String)testValue1);
- assertFalse(this.validationGroupValueExists(propertyName, (String)testValue1));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1, true);
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- protected void verifyAddCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue2));
-
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) != -1);
- }
-
- protected void verifyRemoveCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue2));
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) == -1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue1);
- assertEquals(this.getValidationGroupSize(propertyName), 0);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue1));
-
- assertNull(this.getPersistenceUnit().getProperty(key));
- }
-
- protected void verifyListEvents(String propertyName, String testValue, String listName) throws Exception {
- // add
- this.clearEvent();
- this.addValidationGroupValue(propertyName, testValue);
-
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
-
- // remove
- this.clearEvent();
-
- this.removeValidationGroupValue(propertyName, testValue);
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
- }
-
- protected void verifyPutValidationGroupProperty(String propertyName, Object expectedValue) throws Exception {
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event value
- assertTrue(this.validationGroupValueExists(propertyName, (String) expectedValue));
- return;
- }
-
- // ********** internal method **********
-
- private ListChangeListener buildValidationGroupListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
-
- Generic2_0OptionsTests.this.validationGroupChanged(e);
- }
- };
- }
-
- private void validationGroupChanged(ListChangeEvent e) {
- String listName = e.getListName();
-
- if (listName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_LIST))
- this.prePersistEvent = e;
- else if (listName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_LIST))
- this.preUpdateEvent = e;
- else if (listName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_LIST))
- this.preRemoveEvent = e;
- else
- this.throwUnsupportedOperationException(e);
- }
-
- private void addValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("addValidationGroupValue", propertyName);
- }
-
- private void removeValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.removeValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.removeValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.removeValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("removeValidationGroupValue", propertyName);
- }
-
- private boolean validationGroupValueExists(String propertyName, String propertyValue) throws NoSuchFieldException {
- boolean result = false;
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.validationGroupPrePersistExists(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.validationGroupPreUpdateExists(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.validationGroupPreRemoveExists(propertyValue);
- else
- this.throwMissingDefinition("verifyValidationGroupValueExists", propertyName);
- return result;
- }
-
- private int getValidationGroupSize(String propertyName) throws NoSuchFieldException {
- int result = 0;
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.getValidationGroupPrePersistsSize();
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.getValidationGroupPreUpdatesSize();
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.getValidationGroupPreRemovesSize();
- else
- this.throwMissingDefinition("verifyValidationGroupSize", propertyName);
- return result;
- }
-
- private ListChangeEvent getEventFor(String propertyName) throws NoSuchFieldException {
- ListChangeEvent event = null;
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- event = this.prePersistEvent;
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- event = this.preUpdateEvent;
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- event = this.preRemoveEvent;
- else
- this.throwMissingDefinition("getEventFor", propertyName);
- return event;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java
deleted file mode 100644
index 9d8602147f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class Generic2_0PersistenceContextModelTests
- extends TestCase
-{
-
- public static Test suite() {
- TestSuite suite = new TestSuite(Generic2_0ConnectionTests.class.getPackage().getName());
- suite.addTestSuite(Generic2_0OptionsTests.class);
- return suite;
- }
-
- private Generic2_0PersistenceContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java
deleted file mode 100644
index b1158a47d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * GenericPersistenceUnit2_0Tests
- */
-public abstract class Generic2_0PersistenceUnitTests extends PersistenceUnitTestCase
-{
- protected PersistenceUnit2_0 subject;
-
- protected PropertyValueModel<PersistenceUnit2_0> subjectHolder;
-
- // ********** constructors **********
- protected Generic2_0PersistenceUnitTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject = this.getPersistenceUnit();
- this.subjectHolder = new SimplePropertyValueModel<PersistenceUnit2_0>(this.subject);
- this.populatePu();
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_2_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, GenericPlatform.VERSION_2_0);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected PersistenceUnit2_0 getPersistenceUnit() {
- return (PersistenceUnit2_0) super.getPersistenceUnit();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java
deleted file mode 100644
index 49e5095a15..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.AccessType;
-
-@SuppressWarnings("nls")
-public class Access2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public Access2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAccessOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestAccessOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Access(AccessType.FIELD)");
- }
- });
- }
-
- private ICompilationUnit createTestAccessOnProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- public void testGetAccessOnType() throws Exception {
- ICompilationUnit cu = this.createTestAccessOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceType.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
- assertEquals(AccessType.PROPERTY, access.getValue());
- }
-
- public void testSetAccessOnType() throws Exception {
- ICompilationUnit cu = this.createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceType.getAnnotation(JPA2_0.ACCESS);
- assertNull(access);
-
- resourceType.addAnnotation(JPA2_0.ACCESS);
- assertSourceContains("@Access", cu);
-
- access = (Access2_0Annotation) resourceType.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
-
- access.setValue(AccessType.FIELD);
- assertEquals(AccessType.FIELD, access.getValue());
- assertSourceContains("@Access(FIELD)", cu);
-
- access.setValue(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, access.getValue());
- assertSourceContains("@Access(PROPERTY)", cu);
-
- access.setValue(null);
- assertSourceDoesNotContain("@Access(", cu);
- }
-
- public void testGetAccessOnField() throws Exception {
- ICompilationUnit cu = this.createTestAccessOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceField.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
- assertEquals(AccessType.FIELD, access.getValue());
- }
-
- public void testSetAccessOnField() throws Exception {
- ICompilationUnit cu = this.createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceField.getAnnotation(JPA2_0.ACCESS);
- assertNull(access);
-
- resourceField.addAnnotation(JPA2_0.ACCESS);
- assertSourceContains("@Access", cu);
-
- access = (Access2_0Annotation) resourceField.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
-
- access.setValue(AccessType.FIELD);
- assertEquals(AccessType.FIELD, access.getValue());
- assertSourceContains("@Access(FIELD)", cu);
-
- access.setValue(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, access.getValue());
- assertSourceContains("@Access(PROPERTY)", cu);
-
- access.setValue(null);
- assertSourceDoesNotContain("@Access(", cu);
- }
-
- public void testGetAccessOnProperty() throws Exception {
- ICompilationUnit cu = this.createTestAccessOnProperty();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = CollectionTools.get(resourceType.getMethods(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceMethod.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
- assertEquals(AccessType.PROPERTY, access.getValue());
- }
-
- public void testSetAccessOnProperty() throws Exception {
- ICompilationUnit cu = this.createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = CollectionTools.get(resourceType.getMethods(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceMethod.getAnnotation(JPA2_0.ACCESS);
- assertNull(access);
-
- resourceMethod.addAnnotation(JPA2_0.ACCESS);
- assertSourceContains("@Access", cu);
-
- access = (Access2_0Annotation) resourceMethod.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
-
- access.setValue(AccessType.FIELD);
- assertEquals(AccessType.FIELD, access.getValue());
- assertSourceContains("@Access(FIELD)", cu);
-
- access.setValue(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, access.getValue());
- assertSourceContains("@Access(PROPERTY)", cu);
-
- access.setValue(null);
- assertSourceDoesNotContain("@Access(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java
deleted file mode 100644
index c1b5eaca0c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java
+++ /dev/null
@@ -1,861 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverride2_0Tests extends JavaResourceModel2_0TestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
- private static final String JOIN_TABLE_NAME = "MY_JOIN_TABLE";
- private static final String CATALOG_NAME = "MY_CATALOG";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
-
- public AssociationOverride2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"" + JOIN_TABLE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(catalog = \"" + CATALOG_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(schema = \"" + SCHEMA_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithInverseJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private AssociationOverride2_0Annotation associationOverrideAt(int index, JavaResourceMember resourceMember) {
- return (AssociationOverride2_0Annotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverride(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- }
-
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertNull(associationOverride.joinColumnAt(2).getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn)", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@AssociationOverride(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-
- public void testGetNullJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNotNull(associationOverride);
- assertNull(joinTable);
- }
-
- public void testJoinTableGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
- }
-
- public void testJoinTableSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
-
- joinTable.setName("Foo");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"Foo\"))", cu);
-
- joinTable.setName(null);
- assertNull(associationOverride.getJoinTable().getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testAddJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
-
- associationOverride.addJoinTable();
- joinTable = associationOverride.getJoinTable();
- assertNotNull(joinTable);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testRemoveJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
- }
-
- public void testJoinTableGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testJoinTableSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", catalog = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testJoinTableSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", schema = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint}))", cu);
- }
-
- public void testJoinTableRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"})))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})}))", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})}))", cu);
- }
-
- public void testJoinTableJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = @JoinColumn))", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testJoinTableSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableInverseJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addInverseJoinColumn(0);
- table.addInverseJoinColumn(1);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testJoinTableInverseJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testAddInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addInverseJoinColumn(0).setName("FOO");
- table.addInverseJoinColumn(1);
- table.addInverseJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", table.inverseJoinColumnAt(1).getName());
- assertNull(table.inverseJoinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", inverseJoinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(2).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(1);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = @JoinColumn(name = \"FOO\")))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(1).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(0, 2);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn, @JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableSetInverseJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.inverseJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java
deleted file mode 100644
index 4e0600d561..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java
+++ /dev/null
@@ -1,949 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
- private static final String JOIN_TABLE_NAME = "MY_JOIN_TABLE";
- private static final String CATALOG_NAME = "MY_CATALOG";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
-
- public AssociationOverrides2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"" + JOIN_TABLE_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(catalog = \"" + CATALOG_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(schema = \"" + SCHEMA_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithInverseJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})))");
- }
- });
- }
-
-
- private AssociationOverride2_0Annotation associationOverrideAt(int index, JavaResourceMember resourceMember) {
- return (AssociationOverride2_0Annotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- assertSourceContains("@AssociationOverrides", cu);
- }
-
- public void testAddAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testAddAssociationOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"BAZ\"),";
- expected3 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")), @AssociationOverride(name = \"BAR\") })";
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
-
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("BAZ", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("FOO", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("BAR", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testRemoveAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))";
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- assertSourceContains(expected2, cu);
- assertSourceDoesNotContain("@AssociationOverrides", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn))", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@AssociationOverride(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
- public void testGetNullJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNotNull(associationOverride);
- assertNull(joinTable);
- }
-
- public void testJoinTableGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
- }
-
- public void testJoinTableSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
-
- joinTable.setName("Foo");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"Foo\"))", cu);
-
- joinTable.setName(null);
- assertNull(associationOverride.getJoinTable().getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testAddJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
-
- associationOverride.addJoinTable();
- joinTable = associationOverride.getJoinTable();
- assertNotNull(joinTable);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testRemoveJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
- }
-
- public void testJoinTableGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testJoinTableSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", catalog = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testJoinTableSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", schema = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint}))", cu);
- }
-
- public void testJoinTableRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"})))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})}))", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})}))", cu);
- }
-
- public void testJoinTableJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = @JoinColumn))", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testJoinTableSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableInverseJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addInverseJoinColumn(0);
- table.addInverseJoinColumn(1);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testJoinTableInverseJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testAddInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addInverseJoinColumn(0).setName("FOO");
- table.addInverseJoinColumn(1);
- table.addInverseJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", table.inverseJoinColumnAt(1).getName());
- assertNull(table.inverseJoinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", inverseJoinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(2).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(1);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = @JoinColumn(name = \"FOO\")))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(1).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(0, 2);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn, @JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableSetInverseJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.inverseJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java
deleted file mode 100644
index 018be5caf0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-
-@SuppressWarnings("nls")
-public class Cacheable2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public Cacheable2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCacheable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.CACHEABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cacheable");
- }
- });
- }
-
- private ICompilationUnit createTestCacheableWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.CACHEABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cacheable(value=true)");
- }
- });
- }
-
-
-
- public void testCacheableAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestCacheable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertNotNull(resourceType.getAnnotation(JPA2_0.CACHEABLE));
-
- resourceType.removeAnnotation(JPA2_0.CACHEABLE);
- assertNull(resourceType.getAnnotation(JPA2_0.CACHEABLE));
-
- resourceType.addAnnotation(JPA2_0.CACHEABLE);
- assertNotNull(resourceType.getAnnotation(JPA2_0.CACHEABLE));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestCacheableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) resourceType.getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestCacheableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) resourceType.getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
-
- assertSourceContains("@Cacheable(value=false)", cu);
-
- cacheableAnnotation.setValue(null);
- cacheableAnnotation.setValue(Boolean.FALSE);
- assertSourceContains("@Cacheable(false)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) resourceType.getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
-
- cacheableAnnotation.setValue(null);
- assertNull(cacheableAnnotation.getValue());
-
- assertSourceContains("@Cacheable", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java
deleted file mode 100644
index 69cdd9cedb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class CollectionTable2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public CollectionTable2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCollectionTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@CollectionTable(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@CollectionTable(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@CollectionTable(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@CollectionTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = @JoinColumn)", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java
deleted file mode 100644
index 92f96531e7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class ElementCollection2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public ElementCollection2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection");
- }
- });
- }
-
- private ICompilationUnit createTestElementCollectionWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestElementCollectionWithTargetClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection(targetClass = AnnotationTestType.class)");
- }
- });
- }
-
- public void testElementCollection() throws Exception {
- ICompilationUnit cu = this.createTestElementCollection();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertNotNull(elementCollection);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FetchType.EAGER, elementCollection.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, elementCollection.getFetch());
-
- assertSourceContains("@ElementCollection(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(null);
- assertNull(elementCollection.getFetch());
-
- assertSourceContains("@ElementCollection", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetClass() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(TYPE_NAME, elementCollection.getTargetClass());
- }
-
- public void testSetTargetClass() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(TYPE_NAME, elementCollection.getTargetClass());
-
- elementCollection.setTargetClass("Foo");
-
- assertSourceContains("@ElementCollection(targetClass = Foo.class)", cu);
- }
-
- public void testSetTargetClassNull() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(TYPE_NAME, elementCollection.getTargetClass());
-
- elementCollection.setTargetClass(null);
-
- assertSourceContains("@ElementCollection", cu);
- assertSourceDoesNotContain("targetClass", cu);
- }
-
-
- public void testGetFullyQualifiedTargetClass() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, elementCollection.getFullyQualifiedTargetClassName());
-
- elementCollection.setTargetClass("Foo");
-
- assertSourceContains("@ElementCollection(targetClass = Foo.class)", cu);
-
- assertEquals("Foo", elementCollection.getTargetClass());
-
- assertEquals("Foo", elementCollection.getFullyQualifiedTargetClassName()); //bug 196200 changed this
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java
deleted file mode 100644
index bd74f43e5c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JavaResource2_0Tests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JavaResource2_0Tests.class.getPackage().getName());
-
- suite.addTestSuite(Access2_0AnnotationTests.class);
- suite.addTestSuite(AssociationOverride2_0Tests.class);
- suite.addTestSuite(AssociationOverrides2_0Tests.class);
- suite.addTestSuite(Cacheable2_0AnnotationTests.class);
- suite.addTestSuite(CollectionTable2_0AnnotationTests.class);
- suite.addTestSuite(ElementCollection2_0AnnotationTests.class);
- suite.addTestSuite(ManyToMany2_0AnnotationTests.class);
- suite.addTestSuite(ManyToOne2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyClass2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyColumn2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyEnumerated2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyJoinColumn2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyJoinColumns2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyTemporal2_0AnnotationTests.class);
- suite.addTestSuite(MapsId2_0AnnotationTests.class);
- suite.addTestSuite(OneToMany2_0AnnotationTests.class);
- suite.addTestSuite(OneToOne2_0AnnotationTests.class);
- suite.addTestSuite(OrderColumn2_0AnnotationTests.class);
- suite.addTestSuite(SequenceGenerator2_0AnnotationTests.class);
-
- return suite;
- }
-
- private JavaResource2_0Tests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java
deleted file mode 100644
index 933d5c1f27..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-
-public class JavaResourceModel2_0TestCase extends JpaJavaResourceModelTestCase
-{
-
- public JavaResourceModel2_0TestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java
deleted file mode 100644
index 58efc38818..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToMany2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public ManyToMany2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToMany() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNotNull(manyToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(null);
- assertNull(manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity(null);
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToMany.getFullyQualifiedTargetEntityClassName());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToMany.getTargetEntity());
-
- assertEquals("Foo", manyToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(null, manyToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNull(manyToMany.getMappedBy());
- manyToMany.setMappedBy("bar");
- assertEquals("bar", manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
-
- manyToMany.setMappedBy(null);
- assertNull(manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertSourceContains("@ManyToMany(cascade = ALL)", cu);
-
- assertTrue(manyToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(true);
- assertSourceContains("@ManyToMany(cascade = MERGE)", cu);
-
- assertTrue(manyToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadePersist());
-
- manyToMany.setCascadePersist(true);
- assertSourceContains("@ManyToMany(cascade = PERSIST)", cu);
-
- assertTrue(manyToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeRemove(true);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- assertTrue(manyToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRefresh());
-
- manyToMany.setCascadeRefresh(true);
- assertSourceContains("@ManyToMany(cascade = REFRESH)", cu);
-
- assertTrue(manyToMany.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToMany2_0Annotation manyToMany = (ManyToMany2_0Annotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeDetach());
-
- manyToMany.setCascadeDetach(true);
- assertSourceContains("@ManyToMany(cascade = DETACH)", cu);
-
- assertTrue(manyToMany.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertTrue(manyToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToMany(cascade = CascadeType.ALL)", cu);
-
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false); //TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false);
- assertFalse(manyToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
- assertTrue(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeMerge(false);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- manyToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java
deleted file mode 100644
index 8120a1a7ce..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToOne2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public ManyToOne2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToOne() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertNotNull(manyToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(null);
- assertNull(manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity(null);
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToOne.getFullyQualifiedTargetEntityClassName());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToOne.getTargetEntity());
-
- assertEquals("Foo", manyToOne.getFullyQualifiedTargetEntityClassName());//bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(null);
- assertNull(manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertSourceContains("@ManyToOne(cascade = ALL)", cu);
-
- assertTrue(manyToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(true);
- assertSourceContains("@ManyToOne(cascade = MERGE)", cu);
-
- assertTrue(manyToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadePersist());
-
- manyToOne.setCascadePersist(true);
- assertSourceContains("@ManyToOne(cascade = PERSIST)", cu);
-
- assertTrue(manyToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeRemove(true);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- assertTrue(manyToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRefresh());
-
- manyToOne.setCascadeRefresh(true);
- assertSourceContains("@ManyToOne(cascade = REFRESH)", cu);
-
- assertTrue(manyToOne.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOne2_0Annotation manyToOne = (ManyToOne2_0Annotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeDetach());
-
- manyToOne.setCascadeDetach(true);
- assertSourceContains("@ManyToOne(cascade = DETACH)", cu);
-
- assertTrue(manyToOne.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertTrue(manyToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToOne(cascade = CascadeType.ALL)", cu);
-
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);
- assertFalse(manyToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
- assertTrue(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeMerge(false);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- manyToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java
deleted file mode 100644
index 8d64639bdb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyClass2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String MAP_KEY_CLASS_VALUE = "MyClass";
-
- public MapKeyClass2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKeyClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_CLASS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyClass");
- }
- });
- }
-
- private ICompilationUnit createTestMapKeyClassWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_CLASS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyClass(" + MAP_KEY_CLASS_VALUE + ".class)");
- }
- });
- }
-
- public void testMapKeyClass() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertNotNull(mapKeyClass);
- assertNull(mapKeyClass.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertEquals(MAP_KEY_CLASS_VALUE, mapKeyClass.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertEquals(MAP_KEY_CLASS_VALUE, mapKeyClass.getValue());
-
- mapKeyClass.setValue("foo");
- assertEquals("foo", mapKeyClass.getValue());
-
- assertSourceContains("@MapKeyClass(foo.class)", cu);
-
- mapKeyClass.setValue(null);
-
- assertSourceDoesNotContain("@MapKeyClass(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertNotNull(mapKeyClass.getValue());
- assertEquals("MyClass", mapKeyClass.getFullyQualifiedClassName()); //bug 196200 changed this
-
-
- mapKeyClass.setValue(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, mapKeyClass.getFullyQualifiedClassName());
- assertSourceContains("@MapKeyClass(" + TYPE_NAME + ".class)", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java
deleted file mode 100644
index cf6cae8309..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyColumn2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public MapKeyColumn2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(" + intElement + " = 5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@MapKeyColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@MapKeyColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@MapKeyColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@MapKeyColumn(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@MapKeyColumn(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@MapKeyColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@MapKeyColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@MapKeyColumn(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("precision");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getPrecision());
- }
-
- public void testSetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertEquals(null, column.getPrecision());
-
- column.setPrecision(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getPrecision());
-
- assertSourceContains("@MapKeyColumn(precision = 5)", cu);
-
- column.setPrecision(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("scale");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getScale());
- }
-
- public void testSetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getScale());
-
- column.setScale(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getScale());
-
- assertSourceContains("@MapKeyColumn(scale = 5)", cu);
-
- column.setScale(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java
deleted file mode 100644
index efd68d8ec6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.EnumType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class MapKeyEnumerated2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public MapKeyEnumerated2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKeyEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_ENUMERATED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyEnumerated");
- }
- });
- }
-
- private ICompilationUnit createTestMapKeyEnumeratedWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyEnumerated(EnumType.ORDINAL)");
- }
- });
- }
-
- public void testMapKeyEnumerated() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_ENUMERATED);
- assertNotNull(enumerated);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyEnumeratedWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_ENUMERATED);
- assertEquals(EnumType.ORDINAL, enumerated.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_ENUMERATED);
-
- enumerated.setValue(EnumType.STRING);
-
- assertSourceContains("@MapKeyEnumerated(STRING)", cu);
-
- enumerated.setValue(null);
-
- assertSourceDoesNotContain("@MapKeyEnumerated(", cu);
- assertSourceContains("@MapKeyEnumerated", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java
deleted file mode 100644
index 17b702d78d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyJoinColumn2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public MapKeyJoinColumn2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- private MapKeyJoinColumn2_0Annotation mapKeyJoinColumnAt(int index, JavaResourceMember resourceMember) {
- return (MapKeyJoinColumn2_0Annotation) resourceMember.getAnnotation(index, JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@MapKeyJoinColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@MapKeyJoinColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@MapKeyJoinColumn(referencedColumnName = \"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@MapKeyJoinColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@MapKeyJoinColumn(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@MapKeyJoinColumn(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@MapKeyJoinColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@MapKeyJoinColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java
deleted file mode 100644
index 1a808db599..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyJoinColumns2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public MapKeyJoinColumns2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(table = \"" + COLUMN_TABLE + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(" + booleanElement + " = true))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")");
- }
- });
- }
-
- private MapKeyJoinColumn2_0Annotation mapKeyJoinColumnAt(int index, JavaResourceMember resourceMember) {
- return (MapKeyJoinColumn2_0Annotation) resourceMember.getAnnotation(index, JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(table = \"Foo\"))", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(referencedColumnName = \"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(columnDefinition = \"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getUnique().booleanValue());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertFalse(column.getUnique().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(unique = false))", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getNullable().booleanValue());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertFalse(column.getNullable().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(nullable = false))", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getInsertable().booleanValue());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertFalse(column.getInsertable().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(insertable = false))", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getUpdatable().booleanValue());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertFalse(column.getUpdatable().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(updatable = false))", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
-
- public void testAddJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@MapKeyJoinColumns({";
- String expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@MapKeyJoinColumn(name = \"FOO\") })";
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMNS));
- assertNotNull(resourceField.getAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertEquals(2, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
- }
-
- public void testAddJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@MapKeyJoinColumns({";
- String expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@MapKeyJoinColumn(name = \"FOO\") })";
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@MapKeyJoinColumn(name = \"BAZ\"),";
- expected3 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @MapKeyJoinColumn(name = \"FOO\") })";
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumns.next()).getName());
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMNS));
- assertNotNull(resourceField.getAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
- }
-
-
- public void testRemoveJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@MapKeyJoinColumns({";
- String expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@MapKeyJoinColumn(name = \"FOO\") })";
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")";
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- assertSourceContains(expected2, cu);
- assertSourceDoesNotContain("@MapKeyJoinColumns", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java
deleted file mode 100644
index eb24ff354d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalType;
-
-@SuppressWarnings("nls")
-public class MapKeyTemporal2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public MapKeyTemporal2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_TEMPORAL);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyTemporal");
- }
- });
- }
-
- private ICompilationUnit createTestTemporalWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyTemporal(TemporalType.DATE)");
- }
- });
- }
-
- public void testTemporal() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_TEMPORAL);
- assertNotNull(temporal);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporalWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_TEMPORAL);
- assertEquals(TemporalType.DATE, temporal.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_TEMPORAL);
-
- temporal.setValue(TemporalType.TIME);
-
- assertSourceContains("@MapKeyTemporal(TIME)", cu);
-
- temporal.setValue(null);
-
- assertSourceDoesNotContain("@MapKeyTemporal(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java
deleted file mode 100644
index ea19e54fb6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapsId2_0AnnotationTests
- extends JavaResourceModel2_0TestCase
-{
- public MapsId2_0AnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMapsId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAPS_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapsId");
- }
- });
- }
-
- private ICompilationUnit createTestMapsIdWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAPS_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapsId(\"foo\")");
- }
- });
- }
-
- public void testMapsId() throws Exception {
- ICompilationUnit cu = this.createTestMapsId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapsIdWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertEquals("foo", annotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapsId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- assertSourceContains("@MapsId(\"foo\")", cu);
-
- annotation.setValue(null);
- assertSourceContains("@MapsId", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java
deleted file mode 100644
index 9f45b12f7b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToMany2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public OneToMany2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToMany() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNotNull(oneToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToMany.getFetch());
-
- assertSourceContains("@OneToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(null);
- assertNull(oneToMany.getFetch());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity(null);
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToMany.getFullyQualifiedTargetEntityClassName());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToMany.getTargetEntity());
-
- assertEquals("Foo", oneToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
- }
-
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(null, oneToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNull(oneToMany.getMappedBy());
- oneToMany.setMappedBy("bar");
- assertEquals("bar", oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
-
- oneToMany.setMappedBy(null);
- assertNull(oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertSourceContains("@OneToMany(cascade = ALL)", cu);
-
- assertTrue(oneToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(true);
- assertSourceContains("@OneToMany(cascade = MERGE)", cu);
-
- assertTrue(oneToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadePersist());
-
- oneToMany.setCascadePersist(true);
- assertSourceContains("@OneToMany(cascade = PERSIST)", cu);
-
- assertTrue(oneToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeRemove(true);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- assertTrue(oneToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRefresh());
-
- oneToMany.setCascadeRefresh(true);
- assertSourceContains("@OneToMany(cascade = REFRESH)", cu);
-
- assertTrue(oneToMany.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeDetach());
-
- oneToMany.setCascadeDetach(true);
- assertSourceContains("@OneToMany(cascade = DETACH)", cu);
-
- assertTrue(oneToMany.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertTrue(oneToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToMany(cascade = CascadeType.ALL)", cu);
-
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);
- assertFalse(oneToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
- assertTrue(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeMerge(false);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- oneToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java
deleted file mode 100644
index 28b8bedbd7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java
+++ /dev/null
@@ -1,463 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToOne2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public OneToOne2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToOne() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNotNull(oneToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOne.getFetch());
-
- assertSourceContains("@OneToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(null);
- assertNull(oneToOne.getFetch());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity(null);
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToOne.getFullyQualifiedTargetEntityClassName());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToOne.getTargetEntity());
-
- assertEquals("Foo", oneToOne.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
- assertSourceContains("@OneToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(null);
- assertNull(oneToOne.getOptional());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(null, oneToOne.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNull(oneToOne.getMappedBy());
- oneToOne.setMappedBy("bar");
- assertEquals("bar", oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
-
- oneToOne.setMappedBy(null);
- assertNull(oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertSourceContains("@OneToOne(cascade = ALL)", cu);
-
- assertTrue(oneToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(true);
- assertSourceContains("@OneToOne(cascade = MERGE)", cu);
-
- assertTrue(oneToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadePersist());
-
- oneToOne.setCascadePersist(true);
- assertSourceContains("@OneToOne(cascade = PERSIST)", cu);
-
- assertTrue(oneToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeRemove(true);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- assertTrue(oneToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRefresh());
-
- oneToOne.setCascadeRefresh(true);
- assertSourceContains("@OneToOne(cascade = REFRESH)", cu);
-
- assertTrue(oneToOne.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeDetach());
-
- oneToOne.setCascadeDetach(true);
- assertSourceContains("@OneToOne(cascade = DETACH)", cu);
-
- assertTrue(oneToOne.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertTrue(oneToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToOne(cascade = CascadeType.ALL)", cu);
-
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);
- assertFalse(oneToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
- assertTrue(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeMerge(false);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- oneToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java
deleted file mode 100644
index 68aaca4c4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OrderColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class OrderColumn2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public OrderColumn2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOrderColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn");
- }
- });
- }
-
- private ICompilationUnit createTestOrderColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestOrderColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestOrderColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUpdatable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@OrderColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@OrderColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@OrderColumn(nullable = false)", cu);
-
- column.setNullable(null);
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@OrderColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@OrderColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
-
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java
deleted file mode 100644
index 971b31af4d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-/**
- * SequenceGenerator2_0Tests
- */
-@SuppressWarnings("nls")
-public class SequenceGenerator2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String GENERATOR_CATALOG = "TEST_CATALOG";
- private static final String GENERATOR_SCHEMA = "TEST_SCHEMA";
-
- public SequenceGenerator2_0AnnotationTests(String name) {
- super(name);
- }
-
- // ********** catalog **********
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithCatalog();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, sequenceGenerator.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithCatalog();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, sequenceGenerator.getCatalog());
-
- sequenceGenerator.setCatalog("foo");
- assertEquals("foo", sequenceGenerator.getCatalog());
-
- assertSourceContains("@SequenceGenerator(catalog = \"foo\")", cu);
-
- sequenceGenerator.setCatalog(null);
- assertNull(sequenceGenerator.getCatalog());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- // ********** schema **********
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSchema();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, sequenceGenerator.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSchema();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, sequenceGenerator.getSchema());
-
- sequenceGenerator.setSchema("foo");
- assertEquals("foo", sequenceGenerator.getSchema());
-
- assertSourceContains("@SequenceGenerator(schema = \"foo\")", cu);
-
- sequenceGenerator.setSchema(null);
- assertNull(sequenceGenerator.getSchema());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- // ********** utility **********
-
- protected ICompilationUnit createTestSequenceGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithCatalog() throws Exception {
- return this.createTestSequenceGeneratorWithStringElement("catalog", GENERATOR_CATALOG);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithSchema() throws Exception {
- return this.createTestSequenceGeneratorWithStringElement("schema", GENERATOR_SCHEMA);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java
deleted file mode 100644
index ea45687534..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.model;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import junit.framework.TestCase;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestFacetedProject;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestPlatformProject;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class JpaProjectManagerTests extends TestCase {
-
- /** carriage return */
- public static final String CR = System.getProperty("line.separator");
-
- protected TestFacetedProject testProject;
- public JpaProjectManagerTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- if (this.debug()) {
- this.printName();
- }
- this.testProject = this.buildTestProject();
- }
-
- private boolean debug() {
- Boolean debug = (Boolean) ReflectionTools.getStaticFieldValue(this.getGenericJpaProjectManagerClass(), "DEBUG");
- return debug.booleanValue();
- }
-
- // GenericJpaProjectManager is package-private
- private Class<?> getGenericJpaProjectManagerClass() {
- return JptJpaCorePlugin.getJpaProjectManager().getClass();
- }
-
- private void printName() {
- String name = this.getName();
- System.out.println();
- System.out.println();
- this.printNameBorder(name);
- System.out.println(name);
- this.printNameBorder(name);
- }
-
- private void printNameBorder(String name) {
- for (int i = name.length(); i-- > 0; ) {
- System.out.print('=');
- }
- System.out.println();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.testProject.getProject().delete(true, true, null);
- this.testProject = null;
- super.tearDown();
- }
-
- /**
- * Builds a project with the java and utility facets installed, and with
- * pre-existing entities added.
- */
- private TestFacetedProject buildTestProject() throws Exception {
- TestJavaProject tjp = TestJavaProject.buildJavaProject(this.getClass().getSimpleName(), true);
- tjp.createCompilationUnit("test.pkg", "TestEntity.java", "@Entity public class TestEntity {}");
- tjp.createCompilationUnit("test.pkg", "TestEntity2.java", "@Entity public class TestEntity2 {}");
- return tjp;
- }
-
- private IFile getFile(TestPlatformProject p, String path) {
- return p.getProject().getFile(new Path(path));
- }
-
- /**
- * make sure the DEBUG constants are 'false' before checking in the code
- */
- public void testDEBUG() {
- this.verifyDEBUG(this.getGenericJpaProjectManagerClass());
- }
-
- private void verifyDEBUG(Class<?> clazz) {
- assertFalse("Recompile with \"DEBUG = false\": " + clazz.getName(),
- ((Boolean) ReflectionTools.getStaticFieldValue(clazz, "DEBUG")).booleanValue());
- }
-
- public void testJpaProjectManager() {
- assertNotNull(JptJpaCorePlugin.getJpaProjectManager());
- }
-
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = DataModelFactory.createDataModel(new JpaFacetInstallDataModelProvider());
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- public void testProjectCloseReopen() throws Exception {
- this.testProject.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- JpaProject jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
-
- this.testProject.getProject().close(null);
- assertFalse("Project is not closed", this.testProject.getProject().isOpen());
- jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull("JpaProject is not null", jpaProject);
-
- this.testProject.getProject().open(null);
- assertTrue(this.testProject.getProject().isOpen());
- jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull("JpaProject is null", jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
-
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
- }
-
- public void testProjectDeleteReimport() throws Exception {
- this.testProject.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- JpaProject jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
- assertEquals(1, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
-
- this.testProject.getProject().delete(false, true, null);
- jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull(jpaProject);
- assertEquals(0, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
- assertEquals(0, ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(this.testProject.getProject().getName());
- project.create(null);
- assertEquals(1, ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
- project.open(null);
-
- assertTrue(project.isOpen());
- assertTrue(JpaFacet.isInstalled(project));
- jpaProject = JptJpaCorePlugin.getJpaProject(project);
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
- }
-
- public void testFacetInstallUninstall() throws Exception {
- assertNull(JptJpaCorePlugin.getJpaProject(this.testProject.getProject()));
-
- this.testProject.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- assertEquals(1, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
- JpaProject jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
-
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
-
- this.testProject.uninstallFacet(JpaFacet.ID, "1.0");
- assertEquals(0, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
- jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull(jpaProject);
- }
-
- public void testEditFacetSettingsFileAddThenRemoveJpaFacet() throws Exception {
- assertNull(JptJpaCorePlugin.getJpaProject(this.testProject.getProject()));
-
- // add the JPA facet by modifying the facet settings file directly
- IFile facetSettingsFile = this.getFile(this.testProject, ".settings/org.eclipse.wst.common.project.facet.core.xml");
- InputStream inStream = new BufferedInputStream(facetSettingsFile.getContents());
- int fileSize = inStream.available();
- byte[] buf = new byte[fileSize];
- inStream.read(buf);
- inStream.close();
-
- String oldDocument = new String(buf);
- String oldString = "<installed facet=\"java\" version=\"1.5\"/>";
- String newString = oldString + CR + " " + "<installed facet=\"jpt.jpa\" version=\"1.0\"/>";
- String newDocument = oldDocument.replaceAll(oldString, newString);
-
- facetSettingsFile.setContents(new ByteArrayInputStream(newDocument.getBytes()), false, false, null);
-
- assertEquals(1, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
- JpaProject jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
- // persistence.xml and orm.xml do not get created in this situation (?)
- assertEquals(2, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
-// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
-// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
-
-
- // now remove the JPA facet
- facetSettingsFile.setContents(new ByteArrayInputStream(oldDocument.getBytes()), false, false, null);
- assertEquals(0, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
- jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull(jpaProject);
- }
-
- public void testEditFacetSettingsFileRemoveThenAddJpaFacet() throws Exception {
- this.testProject.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- JpaProject jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
-
- // remove the JPA facet by modifying the facet settings file directly
- IFile facetSettingsFile = this.getFile(this.testProject, ".settings/org.eclipse.wst.common.project.facet.core.xml");
- InputStream inStream = new BufferedInputStream(facetSettingsFile.getContents());
- int fileSize = inStream.available();
- byte[] buf = new byte[fileSize];
- inStream.read(buf);
- inStream.close();
-
- String oldDocument = new String(buf);
- String oldString = "<installed facet=\"java\" version=\"1.5\"/>" + CR + " " + "<installed facet=\"jpt.jpa\" version=\"1.0\"/>";
- String newString = "<installed facet=\"java\" version=\"1.5\"/>";
- String newDocument = oldDocument.replaceAll(oldString, newString);
-
- facetSettingsFile.setContents(new ByteArrayInputStream(newDocument.getBytes()), false, false, null);
- assertEquals(0, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
- jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNull(jpaProject);
-
- // now add the JPA facet back
- facetSettingsFile.setContents(new ByteArrayInputStream(oldDocument.getBytes()), false, false, null);
- assertEquals(1, JptJpaCorePlugin.getJpaProjectManager().getJpaProjectsSize());
- jpaProject = JptJpaCorePlugin.getJpaProject(this.testProject.getProject());
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/test/pkg/TestEntity2.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java
deleted file mode 100644
index 706de29305..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.model;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptJpaCoreModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreModelTests.class.getPackage().getName());
- suite.addTestSuite(JpaProjectManagerTests.class);
- return suite;
- }
-
- private JptJpaCoreModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java
deleted file mode 100644
index a22c358b8a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-
-@SuppressWarnings("nls")
-public class BaseJpaPlatformTests extends TestCase
-{
- protected TestJpaProject jpaProject;
-
- protected static final String PROJECT_NAME = "PlatformTestProject";
- protected static final String PACKAGE_NAME = "platform.test";
- protected static final String PERSISTENCE_XML_LOCATION = "src/META-INF/persistence.xml";
- protected static final String ORM_XML_LOCATION = "src/META-INF/orm.xml";
-
-
- public BaseJpaPlatformTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.jpaProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.jpaProject.getProject().delete(true, true, null);
- this.jpaProject = null;
- super.tearDown();
- }
-
-// public void testPersistentTypes() throws CoreException, IOException {
-// IFile persistenceXmlIFile = jpaProject.getProject().getFile(PERSISTENCE_XML_LOCATION);
-// IJpaFile persistenceXmlJpaFile = jpaProject.getJpaProject().getJpaFile(persistenceXmlIFile);
-// PersistenceXmlRootContentNode persistenceRoot = (PersistenceXmlRootContentNode) persistenceXmlJpaFile.getContent();
-// XmlPersistence persistence = persistenceRoot.getPersistence();
-//
-// IFile ormXmlIFile = jpaProject.getProject().getFile(ORM_XML_LOCATION);
-// IJpaFile ormXmlJpaFile = jpaProject.getJpaProject().getJpaFile(ormXmlIFile);
-// XmlRootContentNode ormRoot = (XmlRootContentNode) ormXmlJpaFile.getContent();
-// EntityMappingsInternal entityMappings = ormRoot.getEntityMappings();
-//
-// // add xml persistent type
-// XmlEntityInternal xmlEntity = OrmFactory.eINSTANCE.createXmlEntityInternal();
-// xmlEntity.setSpecifiedName("XmlEntity");
-// entityMappings.getTypeMappings().add(xmlEntity);
-// entityMappings.eResource().save(null);
-// assertEquals(1, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
-//
-// // add java persistent type
-// jpaProject.createType(PACKAGE_NAME, "JavaEntity.java",
-// "@Entity public class JavaEntity {}"
-// );
-// XmlJavaClassRef javaClassRef = PersistenceFactory.eINSTANCE.createJavaClassRef();
-// javaClassRef.setJavaClass(PACKAGE_NAME + ".JavaEntity");
-// persistence.getPersistenceUnits().get(0).getClasses().add(javaClassRef);
-// persistence.eResource().save(null);
-//
-// assertEquals(2, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
-// }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java
deleted file mode 100644
index b387c46c0e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.platform;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-@SuppressWarnings("nls")
-public class JpaPlatformExtensionTests extends ContextModelTestCase
-{
- public static final String TEST_PLATFORM_ID = TestJpaPlatformProvider.ID;
- public static final JpaPlatformDescription TEST_PLATFORM_DESC =
- JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(TEST_PLATFORM_ID);
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- protected TestJpaProject testProject;
-
- public JpaPlatformExtensionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- verifyExtensionTestProjectExists();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return super.buildJpaProject(PROJECT_NAME, autoBuild, this.buildConfig());
- }
-
- protected IDataModel buildConfig() throws Exception {
- IActionConfigFactory configFactory = new JpaFacetInstallDataModelProvider();
- IDataModel config = (IDataModel) configFactory.create();
- config.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_1_0.getVersionString());
- config.setProperty(JpaFacetDataModelProperties.PLATFORM, TEST_PLATFORM_DESC);
- return config;
- }
-
- public static void verifyExtensionTestProjectExists() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint =
- registry.getExtensionPoint(JptJpaCorePlugin.PLUGIN_ID, "jpaPlatform");
- IExtension[] extensions = extensionPoint.getExtensions();
- boolean extensionFound = false;
- for (IExtension extension : extensions) {
- if (extension.getContributor().getName().equals(ExtensionTestPlugin.PLUGIN_ID)) {
- extensionFound = true;
- }
- }
- if (!extensionFound) {
- throw new RuntimeException("Missing Extension " + TEST_PLATFORM_ID + ". The ExtensionTestProject plugin must be in your testing workspace.");
- }
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testAllJpaPlatformIds() {
- assertTrue(CollectionTools.size(JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatforms()) >= 2);
- }
-
- public void testJpaPlatformLabel() {
- assertEquals(TEST_PLATFORM_LABEL, JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(TEST_PLATFORM_ID).getLabel());
- }
-
- public void testJpaPlatform() {
- assertNotNull(JptJpaCorePlugin.getJpaPlatformManager().buildJpaPlatformImplementation(this.testProject.getProject()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java
deleted file mode 100644
index 3766cc134f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.platform;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestAttributeMapping;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestTypeMapping;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJavaBasicMapping;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJavaEntity;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaFactory;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-@SuppressWarnings("nls")
-public class JpaPlatformTests
- extends ContextModelTestCase
-{
- protected TestJpaProject testProject;
-
- public static final String TEST_PLUGIN_CLASS = ExtensionTestPlugin.class.getName();
- public static final String TEST_PLUGIN_ID = "org.eclipse.jpt.jpa.core.tests.extension.resource";
-
- public static final String TEST_PLATFORM_CLASS_NAME = TestJpaPlatformProvider.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
- public static final String TEST_JPA_FACTORY = TestJpaFactory.class.getName();
- public static final String TEST_TYPE_MAPPING_PROVIDER_CLASS = JavaTestTypeMappingDefinition.class.getName();
- public static final String TEST_ATTRIBUTE_MAPPING_PROVIDER_CLASS = JavaTestAttributeMappingDefinition.class.getName();
-
- public JpaPlatformTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- JpaPlatformExtensionTests.verifyExtensionTestProjectExists();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return super.buildJpaProject(PROJECT_NAME, autoBuild, this.buildConfig());
- }
-
- protected IDataModel buildConfig() throws Exception {
- IActionConfigFactory configFactory = new JpaFacetInstallDataModelProvider();
- IDataModel config = (IDataModel) configFactory.create();
- config.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_1_0.getVersionString());
- config.setProperty(
- JpaFacetDataModelProperties.PLATFORM,
- JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(TestJpaPlatformProvider.ID));
- return config;
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
-
- protected JpaPlatform jpaPlatform() {
- return this.getJpaProject().getJpaPlatform();
- }
-
- public void testJpaFactory() {
- assertTrue(jpaPlatform().getJpaFactory().getClass().getName().equals(TEST_JPA_FACTORY));
- }
-
- public void testBuildJavaTypeMappingFromMappingKey() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- this.getJavaPersistentType().setMappingKey(JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY);
- JavaTypeMapping mapping = this.getJavaPersistentType().getMapping();
- assertTrue(mapping instanceof JavaTestTypeMapping);
-
- this.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- mapping = this.getJavaPersistentType().getMapping();
- assertTrue(mapping instanceof TestJavaEntity);
- }
-
- public void testBuildJavaAttributeMappingFromMappingKey() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaPersistentAttribute javaAttribute = this.getJavaPersistentType().getAttributeNamed("name");
- javaAttribute.setMappingKey(JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY);
- JavaAttributeMapping mapping = javaAttribute.getMapping();
- assertTrue(mapping instanceof JavaTestAttributeMapping);
-
- javaAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- mapping = javaAttribute.getMapping();
- assertTrue(mapping instanceof TestJavaBasicMapping);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java
deleted file mode 100644
index 32ec238dc5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.internal.synchronizers.CallbackSynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.internal.synchronizers.SynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * This builds and holds a "JPA" project.
- * Support for adding packages and types.
- *
- * The JPA project's settings (platform, database connection, etc.) can be
- * controlled by building a data model and passing it into the constructor.
- */
-@SuppressWarnings("nls")
-public class TestJpaProject extends TestJavaProject {
- final JpaProject jpaProject;
-
- public static final String JPA_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar";
- public static final String ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.eclipselink.jar";
-
-
- // ********** builders **********
-
- public static TestJpaProject buildJpaProject(String baseProjectName, boolean autoBuild, IDataModel jpaConfig)
- throws CoreException {
- return new TestJpaProject(baseProjectName, autoBuild, jpaConfig);
- }
-
- public static TestJpaProject buildJpaProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return buildJpaProject(baseProjectName, autoBuild, null);
- }
-
- // ********** constructors/initialization **********
-
- public TestJpaProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJpaProject(String projectName, boolean autoBuild) throws CoreException {
- this(projectName, autoBuild, null);
- }
-
- public TestJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws CoreException {
- super(projectName, autoBuild);
- String jpaFacetVersion = JpaFacet.VERSION_1_0.getVersionString();
- if (jpaConfig != null) {
- jpaFacetVersion = jpaConfig.getStringProperty(IFacetDataModelProperties.FACET_VERSION_STR);
- }
- this.installFacet("jst.utility", "1.0");
- this.installFacet(JpaFacet.ID, jpaFacetVersion, jpaConfig);
- this.addJar(jpaJarName());
- if (eclipseLinkJarName() != null) {
- this.addJar(eclipseLinkJarName());
- }
- this.jpaProject = JptJpaCorePlugin.getJpaProject(this.getProject());
- this.jpaProject.setDiscoversAnnotatedClasses(true);
- this.jpaProject.setContextModelSynchronizer(this.buildSynchronousContextModelSynchronizer());
- this.jpaProject.setUpdateSynchronizer(this.buildSynchronousUpdateSynchronizer());
- }
-
- protected Synchronizer buildSynchronousContextModelSynchronizer() {
- return new SynchronousSynchronizer(this.buildSynchronousContextModelSynchronizerCommand());
- }
-
- protected Command buildSynchronousContextModelSynchronizerCommand() {
- return new SynchronousContextModelSynchronizerCommand();
- }
-
- protected class SynchronousContextModelSynchronizerCommand implements Command {
- public void execute() {
- TestJpaProject.this.jpaProject.synchronizeContextModel(new NullProgressMonitor());
- }
- }
-
- protected CallbackSynchronizer buildSynchronousUpdateSynchronizer() {
- return new CallbackSynchronousSynchronizer(this.buildSynchronousUpdateSynchronizerCommand());
- }
-
- protected Command buildSynchronousUpdateSynchronizerCommand() {
- return new SynchronousUpdateSynchronizerCommand();
- }
-
- protected class SynchronousUpdateSynchronizerCommand implements Command {
- public void execute() {
- TestJpaProject.this.jpaProject.update(new NullProgressMonitor());
- }
- }
-
- public static String jpaJarName() {
- return getSystemProperty(JPA_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- public static String eclipseLinkJarName() {
- return getSystemProperty(ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
-
- // ********** public methods **********
-
- public JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java
deleted file mode 100644
index 856925d1f3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.JptJpaCoreTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java.JavaResource2_0Tests;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JptJavaResourceTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- */
-public class JptJpaCoreResourceModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreResourceModelTests.class.getPackage().getName());
-
- if (JptJpaCoreTests.requiredJarsExists()) {
- suite.addTest(JptJavaResourceTests.suite());
- suite.addTest(JavaResource2_0Tests.suite());
- } else {
- suite.addTest(TestSuite.warning(JptJpaCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java
deleted file mode 100644
index fb8831a64f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverrideTests extends JpaJavaResourceModelTestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
-
- public AssociationOverrideTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- private AssociationOverrideAnnotation getAssociationOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AssociationOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverride(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- }
-
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertNull(associationOverride.joinColumnAt(2).getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn)", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java
deleted file mode 100644
index 10434abf8f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverridesTests extends JpaJavaResourceModelTestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
-
- public AssociationOverridesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))");
- }
- });
- }
-
- private AssociationOverrideAnnotation getAssociationOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AssociationOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- assertSourceContains("@AssociationOverrides", cu);
- }
-
- public void testAddAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testAddAssociationOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"BAZ\"),";
- expected3 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")), @AssociationOverride(name = \"BAR\") })";
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("BAZ", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("FOO", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("BAR", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testRemoveAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))";
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- assertSourceContains(expected2, cu);
- assertSourceDoesNotContain("@AssociationOverrides", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn))", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java
deleted file mode 100644
index eec0cf1f62..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class AttributeOverrideTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE";
-
- public AttributeOverrideTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private AttributeOverrideAnnotation getAttributeOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AttributeOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ATTRIBUTE_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
- }
-
- public void testGetNullColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNotNull(attributeOverride);
- assertNull(column);
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName("Foo");
- assertEquals("Foo", attributeOverride.getName());
- assertSourceContains("@AttributeOverride(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName(null);
- assertNull(attributeOverride.getName());
-
- assertSourceDoesNotContain("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AttributeOverride", cu);
- }
-
- public void testColumnGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName("Foo");
-
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"Foo\"))", cu);
-
- column.setName(null);
- assertNull(attributeOverride.getColumn().getName());
- attributeOverride.removeColumn();
- assertNull(attributeOverride.getColumn());
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- }
-
- public void testAddColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNull(column);
-
- attributeOverride.addColumn();
- column = attributeOverride.getColumn();
- assertNotNull(column);
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column)", cu);
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNull(column);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java
deleted file mode 100644
index 2331276d19..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class AttributeOverridesTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE";
-
- public AttributeOverridesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverrides(@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverrides(@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"" + COLUMN_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1))");
- }
- });
- }
-
- private AttributeOverrideAnnotation getAttributeOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AttributeOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ATTRIBUTE_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
- }
-
- public void testGetNullColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNotNull(attributeOverride);
- assertNull(column);
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName("Foo");
- assertEquals("Foo", attributeOverride.getName());
- assertSourceContains("@AttributeOverrides(@AttributeOverride(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName(null);
- assertNull(attributeOverride.getName());
-
- assertSourceDoesNotContain("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AttributeOverride", cu);
- assertSourceContains("@AttributeOverrides", cu);
- }
-
- public void testColumnGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- ColumnAnnotation column = attributeOverride.getColumn();
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName("Foo");
-
- assertSourceContains("@AttributeOverrides(@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"Foo\")))", cu);
-
- column.setName(null);
- assertNull(attributeOverride.getColumn().getName());
- attributeOverride.removeColumn();
- assertNull(attributeOverride.getColumn());
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- }
-
- public void testAddAttributeOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AttributeOverrides({";
- String expected2 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),";
- String expected3 = "@AttributeOverride(name = \"BAR\") })";
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testAddAttributeOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AttributeOverrides({";
- String expected2 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),";
- String expected3 = "@AttributeOverride(name = \"BAR\") })";
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AttributeOverride(name = \"BAZ\"),";
- expected3 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)), @AttributeOverride(name = \"BAR\") })";
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("BAZ", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("FOO", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("BAR", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testRemoveAttributeOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AttributeOverrides({";
- String expected2 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),";
- String expected3 = "@AttributeOverride(name = \"BAR\") })";
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1))";
- resourceType.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@AttributeOverrides", cu);
- }
- //not sure i want to test this api, how can we keep ContainerAnnotation.add, move, remove from being public?
- //users should go throught AbstractJavapersistenceResource. this gets confusing because you would handle it differently
- //for non top-level annotations
-// public void testAdd() throws Exception {
-// ICompilationUnit cu = this.createTestType();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-// assertNull(attributeOverrides);
-//
-// attributeResource.addAnnotation(JPA.ATTRIBUTE_OVERRIDES);
-// attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-// assertNotNull(attributeOverrides);
-//
-// assertSourceContains("@AttributeOverrides");
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(0);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"Foo\"))");
-//
-// AttributeOverride barAttributeOverride = attributeOverrides.add(0);
-// barAttributeOverride.setName("Bar");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"Bar\"), @AttributeOverride(name=\"Foo\")})");
-//
-// }
-//
-// public void testMove() throws Exception {
-// ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(1);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\"), @AttributeOverride(name=\"Foo\")})");
-//
-// attributeOverrides.move(0, 1);
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"Foo\"), @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")})");
-// }
-//
-// public void testRemove() throws Exception {
-// ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(1);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\"), @AttributeOverride(name=\"Foo\")})");
-//
-// attributeOverrides.remove(0);
-//
-// assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"Foo\"))");
-//
-// attributeOverrides.remove(0);
-//
-// assertSourceContains("@AttributeOverrides()");
-//
-// }
-
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java
deleted file mode 100644
index e90df300fb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class BasicTests extends JpaJavaResourceModelTestCase {
-
- public BasicTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- }
- });
- }
-
- private ICompilationUnit createTestBasicWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestBasicWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch = FetchType.EAGER)");
- }
- });
- }
-
- public void testBasic() throws Exception {
- ICompilationUnit cu = this.createTestBasic();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertNotNull(basic);
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(Boolean.TRUE, basic.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(Boolean.TRUE, basic.getOptional());
-
- basic.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, basic.getOptional());
-
- assertSourceContains("@Basic(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(Boolean.TRUE, basic.getOptional());
-
- basic.setOptional(null);
- assertNull(basic.getOptional());
-
- assertSourceContains("@Basic", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
-
- basic.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, basic.getFetch());
-
- assertSourceContains("@Basic(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
-
- basic.setFetch(null);
- assertNull(basic.getFetch());
-
- assertSourceContains("@Basic", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java
deleted file mode 100644
index 06ba8be96f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class ColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public ColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(" + intElement + " = 5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@Column(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@Column(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("table", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@Column(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("columnDefinition", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@Column(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("unique", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@Column(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("nullable", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@Column(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("insertable", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@Column(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("updatable", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@Column(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("length", cu);
- }
-
- public void testGetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("precision");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getPrecision());
- }
-
- public void testSetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertEquals(null, column.getPrecision());
-
- column.setPrecision(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getPrecision());
-
- assertSourceContains("@Column(precision = 5)", cu);
-
- column.setPrecision(null);
- assertSourceDoesNotContain("precision", cu);
- }
-
- public void testGetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("scale");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getScale());
- }
-
- public void testSetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getScale());
-
- column.setScale(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getScale());
-
- assertSourceContains("@Column(scale = 5)", cu);
-
- column.setScale(null);
- assertSourceDoesNotContain("scale", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java
deleted file mode 100644
index efbde613b9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class DiscriminatorColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public DiscriminatorColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithDiscriminatorType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN, JPA.DISCRIMINATOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(discriminatorType = DiscriminatorType.CHAR)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(" + intElement + " = 5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getDiscriminatorType());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@DiscriminatorColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@DiscriminatorColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("(columnDefinition", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@DiscriminatorColumn(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("(length", cu);
- }
-
- public void testGetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithDiscriminatorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertEquals(DiscriminatorType.CHAR, column.getDiscriminatorType());
- }
-
- public void testSetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNull(column.getDiscriminatorType());
-
- column.setDiscriminatorType(DiscriminatorType.INTEGER);
- assertEquals(DiscriminatorType.INTEGER, column.getDiscriminatorType());
-
- assertSourceContains("@DiscriminatorColumn(discriminatorType = INTEGER)", cu);
-
- column.setDiscriminatorType(null);
- assertSourceDoesNotContain("(discriminatorType", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java
deleted file mode 100644
index fdacd1b956..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class DiscriminatorValueTests extends JpaJavaResourceModelTestCase {
-
- public DiscriminatorValueTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestDiscriminatorValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorValue");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorValueWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorValue(value = \"discriminator\")");
- }
- });
- }
-
- public void testDiscriminatorValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_VALUE);
- assertNotNull(discriminatorValue);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValueWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_VALUE);
- assertEquals("discriminator", discriminatorValue.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_VALUE);
-
- discriminatorValue.setValue("foo");
-
- assertSourceContains("@DiscriminatorValue(\"foo\")", cu);
-
- discriminatorValue.setValue(null);
-
- assertSourceDoesNotContain("@DiscriminatorValue(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java
deleted file mode 100644
index 21eee17559..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EmbeddableTests extends JpaJavaResourceModelTestCase {
-
- public EmbeddableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Embeddable");
- }
- });
- }
-
- public void testEmbeddable() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddableAnnotation);
- }
-
- public void testEmbeddableAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddableAndEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddableAnnotation);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertNotNull(entity);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java
deleted file mode 100644
index 12317ee4a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EmbeddedIdTests extends JpaJavaResourceModelTestCase {
-
- public EmbeddedIdTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddedId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId");
- }
- });
- }
-
- public void testEmbeddedId() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddedId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddedIdAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java
deleted file mode 100644
index 2335e75954..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EmbeddedTests extends JpaJavaResourceModelTestCase {
-
- public EmbeddedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbedded() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- }
- });
- }
-
- public void testEmbedded() throws Exception {
- ICompilationUnit cu = this.createTestEmbedded();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddedAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java
deleted file mode 100644
index a1d9de6f4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-
-@SuppressWarnings("nls")
-public class EntityTests extends JpaJavaResourceModelTestCase {
-
- private static final String ENTITY_NAME = "Foo";
-
- public EntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name = \"" + ENTITY_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- sb.append("@Entity");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertTrue(entity != null);
- assertEquals(ENTITY_NAME, entity.getName());
- }
-
- public void testGetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertTrue(entity != null);
- assertNull(entity.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertNull(entity.getName());
- entity.setName("Foo");
- assertEquals("Foo", entity.getName());
-
- assertSourceContains("@Entity(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertEquals(ENTITY_NAME, entity.getName());
-
- entity.setName(null);
- assertNull(entity.getName());
-
- assertSourceContains("@Entity", cu);
- assertSourceDoesNotContain("@Entity(name = \"Foo\")", cu);
- }
-
- public void testMappedSuperclassAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclassAndEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation mappingAnnotation = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertNotNull(mappingAnnotation);
-
- MappedSuperclassAnnotation mappedSuperclass = (MappedSuperclassAnnotation) resourceType.getAnnotation(JPA.MAPPED_SUPERCLASS);
- assertNotNull(mappedSuperclass);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java
deleted file mode 100644
index 7a6f8d44df..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EnumType;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EnumeratedTests extends JpaJavaResourceModelTestCase {
-
- public EnumeratedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENUMERATED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated");
- }
- });
- }
-
- private ICompilationUnit createTestEnumeratedWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated(EnumType.ORDINAL)");
- }
- });
- }
-
- public void testEnumerated() throws Exception {
- ICompilationUnit cu = this.createTestEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(JPA.ENUMERATED);
- assertNotNull(enumerated);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestEnumeratedWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(JPA.ENUMERATED);
- assertEquals(EnumType.ORDINAL, enumerated.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(JPA.ENUMERATED);
-
- enumerated.setValue(EnumType.STRING);
-
- assertSourceContains("@Enumerated(STRING)", cu);
-
- enumerated.setValue(null);
-
- assertSourceDoesNotContain("@Enumerated(", cu);
- assertSourceContains("@Enumerated", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java
deleted file mode 100644
index ee536a2732..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GenerationType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class GeneratedValueTests extends JpaJavaResourceModelTestCase {
-
- private static final String GENERATOR = "MY_GENERATOR";
- public GeneratedValueTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue");
- }
- });
- }
-
- private ICompilationUnit createTestGeneratedValueWithGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue(generator = \"" + GENERATOR + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestGeneratedValueWithStrategy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue(strategy = GenerationType.SEQUENCE)");
- }
- });
- }
-
- public void testGeneratedValue() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertNotNull(generatedValue);
- }
-
- public void testGetGenerator() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithGenerator();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GENERATOR, generatedValue.getGenerator());
- }
-
- public void testSetGenerator() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithGenerator();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GENERATOR, generatedValue.getGenerator());
-
- generatedValue.setGenerator("foo");
- assertEquals("foo", generatedValue.getGenerator());
-
- assertSourceContains("@GeneratedValue(generator = \"foo\")", cu);
-
- generatedValue.setGenerator(null);
- assertNull(generatedValue.getGenerator());
-
- assertSourceDoesNotContain("generator", cu);
- assertSourceContains("@GeneratedValue", cu);
- }
-
- public void testGetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithStrategy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GenerationType.SEQUENCE, generatedValue.getStrategy());
- }
-
- public void testSetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithStrategy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GenerationType.SEQUENCE, generatedValue.getStrategy());
-
- generatedValue.setStrategy(GenerationType.TABLE);
- assertEquals(GenerationType.TABLE, generatedValue.getStrategy());
-
- assertSourceContains("@GeneratedValue(strategy = TABLE)", cu);
-
- generatedValue.setStrategy(null);
- assertNull(generatedValue.getStrategy());
- assertSourceDoesNotContain("strategy", cu);
- assertSourceContains("@GeneratedValue", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java
deleted file mode 100644
index ced5111f8f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class IdClassTests extends JpaJavaResourceModelTestCase {
-
- private static final String ID_CLASS_VALUE = "MyClass";
-
- public IdClassTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestIdClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID_CLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@IdClass");
- }
- });
- }
-
- private ICompilationUnit createTestIdClassWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID_CLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@IdClass(" + ID_CLASS_VALUE + ".class)");
- }
- });
- }
-
- public void testIdClass() throws Exception {
- ICompilationUnit cu = this.createTestIdClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertNotNull(idClass);
- assertNull(idClass.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertEquals(ID_CLASS_VALUE, idClass.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertEquals(ID_CLASS_VALUE, idClass.getValue());
-
- idClass.setValue("foo");
- assertEquals("foo", idClass.getValue());
-
- assertSourceContains("@IdClass(foo.class)", cu);
-
- idClass.setValue(null);
-
- assertSourceDoesNotContain("@IdClass(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertNotNull(idClass.getValue());
- assertEquals("MyClass", idClass.getFullyQualifiedClassName()); //bug 196200 changed this
-
-
- idClass.setValue(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, idClass.getFullyQualifiedClassName());
- assertSourceContains("@IdClass(" + TYPE_NAME + ".class)", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java
deleted file mode 100644
index 26fc303f9d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class IdTests extends JpaJavaResourceModelTestCase {
-
- public IdTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testId() throws Exception {
- ICompilationUnit cu = this.createTestId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof IdAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java
deleted file mode 100644
index a4e7beed25..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class InheritanceTests extends JpaJavaResourceModelTestCase {
-
- public InheritanceTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestInheritance() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.INHERITANCE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Inheritance");
- }
- });
- }
-
- private ICompilationUnit createTestInheritanceWithStrategy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Inheritance(strategy = InheritanceType.JOINED)");
- }
- });
- }
-
- public void testInheritance() throws Exception {
- ICompilationUnit cu = this.createTestInheritance();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(JPA.INHERITANCE);
- assertNotNull(inheritance);
- }
-
- public void testGetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestInheritanceWithStrategy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(JPA.INHERITANCE);
- assertEquals(InheritanceType.JOINED, inheritance.getStrategy());
- }
-
- public void testSetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestInheritance();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(JPA.INHERITANCE);
- inheritance.setStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertSourceContains("@Inheritance(strategy = TABLE_PER_CLASS)", cu);
-
- inheritance.setStrategy(null);
-
- assertSourceDoesNotContain("strategy", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java
deleted file mode 100644
index 7598f87526..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.FieldAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JPTToolsTests extends JpaJavaResourceModelTestCase {
-
- public JPTToolsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTypeFieldWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " String foo;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- protected FieldAttribute fooField(ICompilationUnit cu) {
- return this.buildField("foo", cu);
- }
-
-
- private ICompilationUnit createTestTypeGetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " int getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeInvalidMethodName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int foo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeConstructor() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public " + TYPE_NAME + "() {").append(CR);
- sb.append(" super();").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeVoidMethodReturnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public void getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeInvalidMethodReturnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("com.foo.Foo");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public Foo getFoo() {").append(CR);
- sb.append(" return null;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(Foo id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public boolean isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(boolean id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsMethodReturnInt() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsAndGetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " boolean isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" " + modifier + " boolean getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(boolean id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeSetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" " + modifier + " void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithMemberTypes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" public static class FooStatic {}").append(CR);
- sb.append(CR);
- sb.append(" public class FooNotStatic {}").append(CR);
- sb.append(CR);
- sb.append(" public @interface MyAnnotation {}").append(CR);
- sb.append(CR);
- sb.append(" public enum MyEnum {}").append(CR);
- }
- });
- }
-
- protected MethodAttribute fooMethod(ICompilationUnit cu) {
- return this.buildMethod("getFoo", cu);
- }
-
- //private String foo; - persistable
- public void testFieldIsPersistable1() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private");
- FieldAttribute fieldAttribute = fooField(cu);
- assertTrue(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private static String foo; - not persistable
- public void testFieldIsPersistable2() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private static");
- FieldAttribute fieldAttribute = fooField(cu);
- assertFalse(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private transient String foo; - not persistable
- public void testFieldIsPersistable3() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private transient");
- FieldAttribute fieldAttribute = fooField(cu);
- assertFalse(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private final String foo; - persistable
- public void testFieldIsPersistable4() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private final");
- FieldAttribute fieldAttribute = fooField(cu);
- assertTrue(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public String foo; - persistable
- public void testFieldIsPersistable5() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("public");
- FieldAttribute fieldAttribute = fooField(cu);
- assertTrue(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
-
- //public int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter01() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //protected int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter02() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("protected");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter03() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter04() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("private");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public static int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter05() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public static");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertFalse(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public final int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter06() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public final");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter07() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //protected void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter08() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("protected");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter09() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter10() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("private");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public static void setFoo(int foo) {} - not persistable
- public void testMethodIsPersistablePropertyGetter11() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public static");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertFalse(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public final void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter12() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public final");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public boolean isFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter13() throws Exception {
- ICompilationUnit cu = createTestTypeIsMethod();
- MethodAttribute methodAttribute = this.buildMethod("isFoo", cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public int isFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter14() throws Exception {
- ICompilationUnit cu = createTestTypeIsMethodReturnInt();
- MethodAttribute methodAttribute = this.buildMethod("isFoo", cu);
- assertFalse(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public int isFoo() {} - persistable
- //public int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter15() throws Exception {
- ICompilationUnit cu = createTestTypeIsAndGetMethodWithModifier("public");
- MethodAttribute isFooMethod = this.buildMethod("isFoo", cu);
- MethodAttribute getFooMethod = this.buildMethod("getFoo", cu);
-
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(isFooMethod.isPersistable(astRoot));
- assertFalse(getFooMethod.isPersistable(astRoot));
- }
-
- //public int foo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter16() throws Exception {
- ICompilationUnit cu = createTestTypeInvalidMethodName();
- MethodAttribute fooMethod = this.buildMethod("foo", cu);
- assertFalse(fooMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public void getFoo() {} - not persistable - void return type
- public void testMethodIsPersistablePropertyGetter17() throws Exception {
- ICompilationUnit cu = createTestTypeVoidMethodReturnType();
- MethodAttribute fooMethod = this.buildMethod("getFoo", cu);
- assertFalse(fooMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public Foo getFoo() {} - persistable??? - Foo does not resolve
- public void testMethodIsPersistablePropertyGetter18() throws Exception {
- ICompilationUnit cu = createTestTypeInvalidMethodReturnType();
- MethodAttribute getFooMethod = this.buildMethod("getFoo", cu);
- assertTrue(getFooMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //method with parameters - not persistable
- public void testMethodIsPersistablePropertyGetter19() throws Exception {
- ICompilationUnit cu = createTestType();
- MethodAttribute setIdMethod = idSetMethod(cu);
- assertFalse(setIdMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //constructor - not persistable
- public void testMethodIsPersistablePropertyGetter20() throws Exception {
- ICompilationUnit cu = createTestTypeConstructor();
- MethodAttribute constructor = buildMethod(TYPE_NAME, cu);
- assertFalse(constructor.isPersistable(this.buildASTRoot(cu)));
- }
-
- //no corresponding set method - not persistable
- public void testMethodIsPersistablePropertyGetter21() throws Exception {
- ICompilationUnit cu = createTestType();
- MethodAttribute getNameMethod = nameGetMethod(cu);
- assertFalse(getNameMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public class AnnotationTestType
- public void testTypeIsPersistable1() throws Exception {
- ICompilationUnit cu = createTestType();
- Type type = testType(cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(type.isPersistable(astRoot));
- }
-
- //public final class MyFinal
- public void testTypeIsPersistable2() throws Exception {
- ICompilationUnit cu = this.javaProject.createCompilationUnit("finals", "MyFinal.java", "public final class MyFinal { }");
- Type type = buildType("MyFinal", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(type.isPersistable(astRoot));
- }
-
- //public interface MyInterface
- public void testTypeIsPersistable3() throws Exception {
- ICompilationUnit cu = this.javaProject.createCompilationUnit("interfaces", "MyInterface.java", "public interface MyInterface { }");
- Type type = buildType("MyInterface", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertFalse(type.isPersistable(astRoot));
- }
-
- //enum not persistable
- public void testTypeIsPersistable4() throws Exception {
- ICompilationUnit cu = this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- Type type = buildType("TestEnum", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertFalse(type.isPersistable(astRoot));
- }
-
- //annotation not persistable
- public void testTypeIsPersistable5() throws Exception {
- ICompilationUnit cu = this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
- Type type = buildType("TestAnnotation", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertFalse(type.isPersistable(astRoot));
- }
-
- //public static member type is persistable
- public void testTypeIsPersistable6() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithMemberTypes();
- Type testType = this.testType(cu);
- Type memberType = this.buildType(testType, "FooStatic", 1, cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(memberType.isPersistable(astRoot));
- }
-
- //non-static member type is persistable, handled with validation
- public void testTypeIsPersistable7() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithMemberTypes();
- Type testType = this.testType(cu);
- Type memberType = this.buildType(testType, "FooNotStatic", 1, cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(memberType.isPersistable(astRoot));
- }
- //TODO still need to test typeIsPersistable() returns false for local and anonymous classes
-
-
-}
-
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java
deleted file mode 100644
index 1ec05fdc56..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java
+++ /dev/null
@@ -1,718 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement.Editor;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceOneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class JavaResourceAttributeTests extends JpaJavaResourceModelTestCase {
-
- public JavaResourceAttributeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonResolvingField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityMultipleVariableDeclarationsPerLine() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" ");
- sb.append("@Id");
- sb.append(CR);
- sb.append(" ");
- sb.append("@Column(name = \"baz\")");
- sb.append(" private String foo, bar;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdAndBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append("@Basic");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append(" ");
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name = \"FOO\", table = \"MY_TABLE\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdColumnGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN, JPA.ID, JPA.GENERATED_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append("@Column");
- sb.append(CR);
- sb.append("@GeneratedValue");
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityMultipleColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name = \"FOO\")");
- sb.append(CR);
- sb.append("@Column(name = \"BAR\")");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddedWithAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverride(name = \"FOO\")");
- }
- });
- }
- private ICompilationUnit createTestEmbeddedWithAttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides(@AttributeOverride(name = \"FOO\"))");
- }
- });
- }
- private ICompilationUnit createTestEmbeddedWithAttributeOverridesEmpty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides()");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddedWith2AttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\")})");
- }
- });
- }
-
- private ICompilationUnit createTestTypePublicAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public String foo;");
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypePackageAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" String foo;");
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeFinalAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public final String foo;");
- sb.append(CR);
- }
- });
- }
-
- public void testJavaAttributeAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertEquals(1, resourceAttribute.getAnnotationsSize());
- }
-
- public void testJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertNotNull(resourceAttribute.getAnnotation(JPA.COLUMN));
- }
-
- public void testJavaAttributeAnnotationNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertNull(resourceAttribute.getAnnotation(JPA.TABLE));
- }
-
- //This will result in a compilation error, but we assume the first column found
- public void testDuplicateAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityMultipleColumns();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- ColumnAnnotation columnResource = (ColumnAnnotation) resourceAttribute.getAnnotation(JPA.COLUMN);
- assertEquals("FOO", columnResource.getName());
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- resourceAttribute.removeAnnotation(JPA.COLUMN);
-
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testRemoveColumnName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- ColumnAnnotation columnResource = (ColumnAnnotation) resourceAttribute.getAnnotation(JPA.COLUMN);
- columnResource.setTable(null);
- assertSourceContains("@Column(name = \"FOO\")", cu);
-
- columnResource.setName(null);
- assertSourceDoesNotContain("(name", cu);
- assertSourceDoesNotContain("@Column(", cu);
- }
-
- public void testMultipleAttributeMappings() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithIdAndBasic();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(2, resourceAttribute.getAnnotationsSize());
- assertNotNull(resourceAttribute.getAnnotation(JPA.BASIC));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
-
- JavaResourceNode javaAttributeMappingAnnotation = resourceAttribute.getAnnotation(BasicAnnotation.ANNOTATION_NAME);
- assertTrue(javaAttributeMappingAnnotation instanceof BasicAnnotation);
- assertSourceContains("@Basic", cu);
- assertSourceContains("@Id", cu);
-
- resourceAttribute.setPrimaryAnnotation(JPA.ONE_TO_MANY, EmptyIterable.<String>instance());
- assertEquals(1, resourceAttribute.getAnnotationsSize());
- javaAttributeMappingAnnotation = resourceAttribute.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertTrue(javaAttributeMappingAnnotation instanceof OneToManyAnnotation);
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("@Basic", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation() throws Exception {
- ICompilationUnit cu = createTestType();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertEquals(0, resourceAttribute.getAnnotationsSize());
-
- resourceAttribute.setPrimaryAnnotation(JPA.ID, EmptyIterable.<String>instance());
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
- assertSourceContains("@Id", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertEquals(1, resourceAttribute.getAnnotationsSize());
-
- resourceAttribute.setPrimaryAnnotation(JPA.ID, Collections.singleton(ColumnAnnotation.ANNOTATION_NAME));
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
-
- assertSourceContains("@Id", cu);
- assertSourceContains("@Column", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation3() throws Exception {
- ICompilationUnit cu = createTestEntityWithIdColumnGeneratedValue();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
-
- resourceAttribute.setPrimaryAnnotation(
- JPA.BASIC,
- Arrays.asList(new String[] {
- ColumnAnnotation.ANNOTATION_NAME,
- GeneratedValueAnnotation.ANNOTATION_NAME}));
- assertTrue(resourceAttribute.getAnnotation(BasicAnnotation.ANNOTATION_NAME) instanceof BasicAnnotation);
-
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@GeneratedValue", cu); //not supported by Basic
- assertSourceContains("@Column", cu); //common between Id and Basic
- }
-
- public void testSetJavaAttributeMappingAnnotationNull() throws Exception {
- ICompilationUnit cu = createTestEntityWithIdColumnGeneratedValue();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
-
- resourceAttribute.setPrimaryAnnotation(
- null,
- Arrays.asList(new String[] {
- ColumnAnnotation.ANNOTATION_NAME,
- GeneratedValueAnnotation.ANNOTATION_NAME}));
-
- assertEquals(2, resourceAttribute.getAnnotationsSize());
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@GeneratedValue", cu); //not supported by Basic
- assertSourceContains("@Column", cu); //common between Id and Basic
- }
-
- public void testAddJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
-
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertSourceDoesNotContain("@Column", cu);
- resourceAttribute.addAnnotation(JPA.COLUMN);
- assertSourceContains("@Column", cu);
- }
-
- public void testRemoveJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedField();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertSourceContains("@Column", cu);
- resourceAttribute.removeAnnotation(JPA.COLUMN);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- //update source code to change from @Id to @OneToOne and make sure @Column is not removed
- public void testChangeAttributeMappingInSource() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedField();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- final JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- idField(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceIdAnnotation.DECLARATION_ANNOTATION_ADAPTER.removeAnnotation(declaration);
- }
- });
-
- cu.createImport("javax.persistence.OneToOne", null, new NullProgressMonitor());
-
- idField(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceOneToOneAnnotation.DECLARATION_ANNOTATION_ADAPTER.newMarkerAnnotation(declaration);
- }
- });
-
- assertNotNull(resourceAttribute.getAnnotation(JPA.COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ONE_TO_ONE));
- assertSourceContains("@Column", cu);
- }
-
- public void testJavaAttributeAnnotationsNestable() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(1, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator().next();
-
- assertEquals("FOO", attributeOverride.getName());
- }
-
- public void testJavaAttributeAnnotationsNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(0, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testJavaAttributeAnnotationsContainerNoNestable() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverridesEmpty();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(0, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- // -->> @AttributeOverride(name="FOO")
- public void testAddJavaAttributeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- assertSourceContains("@AttributeOverride(name = \"FOO\")", cu);
- }
-
- // @Embedded -->> @Embedded
- // @AttributeOverride(name="FOO") @AttributeOverrides({@AttributeOverride(name="FOO"), @AttributeOverride(name="BAR")})
- public void testAddJavaAttributeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({ @AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\") })", cu);
-
- assertNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceAttribute.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- // @Embedded
- // @AttributeOverrides(@AttributeOverride(name="FOO"))
- // ||
- // \/
- // @Embedded
- // @AttributeOverrides({@AttributeOverride(name="FOO"), @AttributeOverride(name="BAR")})
- public void testAddJavaAttributeAnnotationNestableContainer3() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"),@AttributeOverride(name = \"BAR\")})", cu);
-
- assertNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceAttribute.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testAddJavaAttributeAnnotationNestableContainer5() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"BAR\"),@AttributeOverride(name = \"FOO\")})", cu);
-
- assertNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceAttribute.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- //@Entity
- //@AttributeOverride(name="FOO")
- public void testRemoveJavaAttributeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- resourceAttribute.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertSourceDoesNotContain("@AttributeOverride", cu);
- }
-
- //@Embedded
- //@AttributeOverrides(@AttributeOverride(name = \"FOO\"))
- public void testRemoveJavaAttributeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- resourceAttribute.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertSourceDoesNotContain("@AttributeOverride(name = \"FOO\")", cu);
- assertSourceContains("@AttributeOverrides", cu);
- }
-
- public void testRemoveJavaAttributeAnnotationIndex() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- resourceAttribute.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertSourceDoesNotContain("@AttributeOverride(name = \"FOO\"", cu);
- assertSourceContains("@AttributeOverride(name = \"BAR\"", cu);
- assertSourceDoesNotContain("@AttributeOverrides", cu);
- }
-
- public void testRemoveJavaAttributeAnnotationIndex2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation)resourceAttribute.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
-
- resourceAttribute.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAZ\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation)resourceAttribute.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
-
-
- resourceAttribute.moveAnnotation(0, 2, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"BAZ\"), @AttributeOverride(name = \"FOO\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAR\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
-
- resourceAttribute.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"BAR\"), @AttributeOverride(name = \"FOO\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
- }
-
- public void testGetTypeName() throws Exception {
- ICompilationUnit cu = createTestEntityWithNonResolvingField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
-
- assertEquals("foo", resourceAttribute.getName());
- assertEquals("test.Foo", resourceAttribute.getTypeName()); //bug 196200 changed this
-
- this.javaProject.createCompilationUnit("test", "Foo.java", "public class Foo {}");
-
- assertEquals("test.Foo", resourceAttribute.getTypeName());
- }
-
- //this tests that we handle mutliple variable declarations in one line.
- //The annotations should apply to all fields defined. This is not really a useful
- //thing to do with JPA beyond the most basic things that use default column names
- public void testMultipleVariableDeclarationsPerLine() throws Exception {
- ICompilationUnit cu = createTestEntityMultipleVariableDeclarationsPerLine();
- JavaResourceType typeResource = buildJavaResourceType(cu);
-
- assertEquals(4, CollectionTools.size(typeResource.getFields()));
- Iterator<JavaResourceField> fields = typeResource.getFields().iterator();
- JavaResourceField resourceField = fields.next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals("baz", column.getName());
-
- resourceField = fields.next();
- column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals("baz", column.getName());
- }
-
- public void testIsPublic() throws Exception {
- ICompilationUnit cu = createTestTypePublicAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertTrue(Modifier.isPublic(attribute.getModifiers()));
- }
-
- public void testIsPublicFalse() throws Exception {
- ICompilationUnit cu = createTestTypePackageAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertFalse(Modifier.isPublic(attribute.getModifiers()));
- }
-
- public void testIsFinal() throws Exception {
- ICompilationUnit cu = createTestTypeFinalAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertTrue(Modifier.isFinal(attribute.getModifiers()));
- }
-
- public void testIsFinalFalse() throws Exception {
- ICompilationUnit cu = createTestTypePackageAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertFalse(Modifier.isFinal(attribute.getModifiers()));
- }
-
- //TODO add tests for JPTTools static methods
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java
deleted file mode 100644
index 3573fa84e0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NullAnnotationEditFormatter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-
-
-@SuppressWarnings("nls")
-public class JavaResourceModelTestCase
- extends AnnotationTestCase {
-
- private JavaElementChangeListener javaElementChangeListener;
- protected JavaResourceCompilationUnit javaResourceCompilationUnit;
-
-
- public JavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaElementChangeListener = new JavaElementChangeListener();
- JavaCore.addElementChangedListener(this.javaElementChangeListener);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- this.javaElementChangeListener = null;
- }
-
- private class JavaElementChangeListener
- implements IElementChangedListener {
-
- JavaElementChangeListener() {
- super();
- }
-
- public void elementChanged(ElementChangedEvent event) {
- JavaResourceModelTestCase.this.javaElementChanged(event);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void javaElementChanged(ElementChangedEvent event) {
- if (this.javaResourceCompilationUnit == null) {
- return;
- }
- this.syncWithJavaDelta(event.getDelta());
- }
-
- /**
- * NB: this is copied from GenericJpaProject, so it might need to be
- * kept in synch with that code if it changes... yech...
- */
- protected void syncWithJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- case IJavaElement.JAVA_PROJECT :
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- case IJavaElement.PACKAGE_FRAGMENT :
- this.syncWithJavaDeltaChildren(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- this.javaCompilationUnitChanged(delta);
- break;
- default :
- break; // ignore the elements inside a compilation unit
- }
- }
-
- protected void syncWithJavaDeltaChildren(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.syncWithJavaDelta(child); // recurse
- }
- }
-
- protected void javaCompilationUnitChanged(IJavaElementDelta delta) {
- if (this.deltaIsRelevant(delta)) {
- this.javaResourceCompilationUnit.synchronizeWithJavaSource();
- }
- }
-
- protected boolean deltaIsRelevant(IJavaElementDelta delta) {
- if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
- return false;
- }
- return delta.getKind() == IJavaElementDelta.CHANGED;
- }
-
- protected ICompilationUnit createAnnotationAndMembers(String packageName, String annotationName, String annotationBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- protected ICompilationUnit createEnumAndMembers(String packageName, String enumName, String enumBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- protected JavaResourcePackage buildJavaResourcePackage(ICompilationUnit cu) {
- JavaResourcePackageInfoCompilationUnit pkgCu =
- new SourcePackageInfoCompilationUnit(
- cu,
- this.buildAnnotationProvider(),
- NullAnnotationEditFormatter.instance(),
- CommandExecutor.Default.instance());
- this.javaResourceCompilationUnit = pkgCu;
- return pkgCu.getPackage();
- }
-
- protected JavaResourceType buildJavaResourceType(ICompilationUnit cu) {
- this.javaResourceCompilationUnit = this.buildJavaResourceCompilationUnit(cu);
- this.javaResourceCompilationUnit.resolveTypes();
- return this.hackJavaResourceType();
- }
-
- protected JavaResourceType hackJavaResourceType() {
- return (JavaResourceType) ReflectionTools.getFieldValue(this.javaResourceCompilationUnit, "primaryType");
- }
-
- protected JavaResourceCompilationUnit buildJavaResourceCompilationUnit(ICompilationUnit cu) {
- if (this.javaResourceCompilationUnit != null) {
- throw new IllegalStateException();
- }
- return new SourceTypeCompilationUnit(
- cu,
- this.buildAnnotationProvider(),
- NullAnnotationEditFormatter.instance(),
- CommandExecutor.Default.instance()
- );
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(this.annotationDefinitionProvider());
- }
-
- protected JpaAnnotationDefinitionProvider annotationDefinitionProvider() {
- return GenericJpaAnnotationDefinitionProvider.instance();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java
deleted file mode 100644
index f32ee74085..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java
+++ /dev/null
@@ -1,679 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement.Editor;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaResourceTypeTests extends JpaJavaResourceModelTestCase {
-
- public JavaResourceTypeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestInvalidAnnotations() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("javax.persistence.Foo");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Foo");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Foo");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMemberEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" @Embeddable");
- sb.append(CR);
- sb.append(" public static class Foo { }").append(CR);
-
- }
- });
- }
-
- private ICompilationUnit createTestEntityDuplicates() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name = \"FirstEntity\")").append(CR);
- sb.append("@Entity(name = \"SecondEntity\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Embeddable");
- }
- });
- }
-
-
-// private ICompilationUnit createTestEntityLarge(final int i) throws Exception {
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY + i);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity" + i);
-// sb.append(CR);
-// }
-// @Override
-// public String typeName() {
-// return TYPE_NAME + i;
-// }
-// });
-// }
-//
-// public void testLarge() throws Exception {
-// for (int i = START; i <= END; i++) {
-// this.createAnnotationAndMembers("Entity" +i, "String name();");
-// }
-//
-// List<ICompilationUnit> cus = new ArrayList<ICompilationUnit>();
-// for (int i = START; i <= END; i++) {
-// cus.add(createTestEntityLarge(i));
-// }
-// long start = System.currentTimeMillis();
-// List<JavaPersistentresourceType> resourceTypes = new ArrayList<JavaPersistentresourceType>();
-// for (int i = 0; i < END; i++) {
-// resourceTypes.add(buildJavaresourceType(cus.get(i)));
-// }
-// long end = System.currentTimeMillis();
-//
-// System.out.println(end-start + "ms");
-// for (int i = 0; i < END; i++) {
-// assertEquals(1, CollectionTools.size(resourceTypes.get(i).javaTypeMappingAnnotations()));
-// assertNotNull(resourceTypes.get(i).javaTypeMappingAnnotation(JPA.ENTITY + (i+1)));
-// }
-//
-//
-//// assertEquals(0, CollectionTools.size(resourceType.javaTypeAnnotations()));
-// }
-
-
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Table(name = \"FOO\", schema = \"BAR\")");
- }
- });
- }
-
-// private ICompilationUnit createTestEntityWithTableAndIdClass() throws Exception {
-// createEntityAnnotation();
-// this.createAnnotationAndMembers("Table", "String name(); String schema();");
-// this.createAnnotationAndMembers("IdClass", "Class value();");
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE, JPA.ID_CLASS);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append(CR);
-// sb.append("@Table");
-// sb.append(CR);
-// sb.append("@IdClass");
-// }
-// });
-// }
-//
-
- private ICompilationUnit createTestEntityMultipleTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Table(name = \"FOO\")");
- sb.append(CR);
- sb.append("@Table(name = \"BAR\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTable(name = \"FOO\")");
- }
- });
- }
- private ICompilationUnit createTestEntityWithEmptySecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables()");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables(@SecondaryTable(name = \"FOO\"))");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWith2SecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\")})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMemberTypes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" static class FooStatic {}").append(CR);
- sb.append(CR);
- sb.append(" class FooNotStatic {}").append(CR);
- sb.append(CR);
- sb.append(" @interface MyAnnotation {}").append(CR);
- sb.append(CR);
- sb.append(" enum MyEnum {}").append(CR);
- }
- });
- }
-
- public void testJavaTypeAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertEquals(2, resourceType.getAnnotationsSize());
- }
-
- public void testJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertNotNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- public void testJavaTypeAnnotationNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- //This will result in a compilation error, but we assume the first table found
- public void testDuplicateAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityMultipleTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation tableResource = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals("FOO", tableResource.getName());
- }
-
- public void testRemoveTable() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- resourceType.removeAnnotation(JPA.TABLE);
-
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testRemoveTableName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- tableAnnotation.setSchema(null);
- assertSourceContains("@Table(name = \"FOO\")", cu);
-
- tableAnnotation.setName(null);
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testMultipleTypeMappings() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithEmbeddable();
-
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(2, resourceType.getAnnotationsSize());
- assertNotNull(resourceType.getAnnotation(JPA.EMBEDDABLE));
- assertNotNull(resourceType.getAnnotation(JPA.ENTITY));
-
- JavaResourceNode javaTypeMappingAnnotation = resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME);
- assertTrue(javaTypeMappingAnnotation instanceof EmbeddableAnnotation);
- assertSourceContains("@Entity", cu);
- assertSourceContains("@Embeddable", cu);
-
- resourceType.setPrimaryAnnotation(JPA.MAPPED_SUPERCLASS, EmptyIterable.<String>instance());
- assertEquals(1, resourceType.getAnnotationsSize());
- javaTypeMappingAnnotation = resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME);
- assertTrue(javaTypeMappingAnnotation instanceof MappedSuperclassAnnotation);
- assertSourceDoesNotContain("@Entity", cu);
- assertSourceContains("@MappedSuperclass", cu);
- assertSourceDoesNotContain("@Embeddable", cu);
- }
-
- public void testSetJavaTypeMappingAnnotation() throws Exception {
- ICompilationUnit cu = createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertEquals(0, resourceType.getAnnotationsSize());
-
- resourceType.setPrimaryAnnotation(JPA.ENTITY, EmptyIterable.<String>instance());
- assertTrue(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME) instanceof EntityAnnotation);
- assertSourceContains("@Entity", cu);
- }
-
- public void testAddJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertSourceDoesNotContain("@Table", cu);
- resourceType.addAnnotation(JPA.TABLE);
-
- assertSourceContains("@Table", cu);
- }
-
- public void testRemoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertSourceContains("@Table", cu);
- resourceType.removeAnnotation(JPA.TABLE);
- assertSourceDoesNotContain("@Table", cu);
- }
-
- //update source code to change from @Entity to @Embeddable and make sure @Table is not removed
- public void testChangeTypeMappingInSource() throws Exception {
- ICompilationUnit cu = createTestEntityWithTable();
- final JavaResourceType resourceType = buildJavaResourceType(cu);
-
- testType(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceEntityAnnotation.DECLARATION_ANNOTATION_ADAPTER.removeAnnotation(declaration);
- }
- });
-
- cu.createImport("javax.persistence.Embeddable", null, new NullProgressMonitor());
-
- this.testType(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceEmbeddableAnnotation.DECLARATION_ANNOTATION_ADAPTER.newMarkerAnnotation(declaration);
- }
- });
-
- assertNotNull(resourceType.getAnnotation(JPA.TABLE));
- assertNull(resourceType.getAnnotation(JPA.ENTITY));
- assertNotNull(resourceType.getAnnotation(JPA.EMBEDDABLE));
- assertSourceContains("@Table", cu);
- }
-
- public void testJavaTypeAnnotationsNestable() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(1, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator().next();
-
- assertEquals("FOO", secondaryTableResource.getName());
- }
-
- public void testJavaTypeAnnotationsNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(0, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testJavaTypeAnnotationsContainerNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntityWithEmptySecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(0, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO")
- public void testAddJavaTypeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("FOO");
- assertSourceContains("@SecondaryTable(name = \"FOO\")", cu);
- }
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO") @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddJavaTypeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({ @SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\") })", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- // @Entity
- // @SecondaryTables(@SecondaryTable(name="FOO"))
- // ||
- // \/
- // @Entity
- // @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddJavaTypeAnnotationNestableContainer3() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"),@SecondaryTable(name = \"BAR\")})", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testAddJavaTypeAnnotationNestableContainer5() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAR\"),@SecondaryTable(name = \"FOO\")})", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testAddJavaTypeAnnotationNestableContainer6() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAR\"),@SecondaryTable(name = \"FOO\")})", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
-
- secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAZ\"),@SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"FOO\")})", cu);
-
- assertEquals(3, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
-
- //@Entity
- //@SecondaryTable(name="FOO")
- public void testRemoveJavaTypeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
-
- //@Entity
- //@SecondaryTables(@SecondaryTable(name="FOO"))
- public void testRemoveJavaTypeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertSourceDoesNotContain("@SecondaryTable(name = \"FOO\")", cu);
- assertSourceContains("@SecondaryTables", cu);
- }
-
- public void testRemoveJavaTypeAnnotationIndex() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertSourceDoesNotContain("@SecondaryTable(name = \"FOO\"", cu);
- assertSourceContains("@SecondaryTable(name = \"BAR\"", cu);
- assertSourceDoesNotContain("@SecondaryTables", cu);
- }
-
- public void testRemoveJavaTypeAnnotationIndex2() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)resourceType.addAnnotation(2, JPA.SECONDARY_TABLE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ", cu);
-
- resourceType.removeAnnotation(1, JPA.SECONDARY_TABLE);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAZ\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)resourceType.addAnnotation(2, JPA.SECONDARY_TABLE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ\")})", cu);
-
- resourceType.moveAnnotation(0, 2, JPA.SECONDARY_TABLE);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAZ\"), @SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)resourceType.addAnnotation(2, JPA.SECONDARY_TABLE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ\")})", cu);
-
- resourceType.moveAnnotation(2, 0, JPA.SECONDARY_TABLE);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ\"), @SecondaryTable(name = \"FOO\")})", cu);
- }
-
- public void testNestedTypes() throws Exception {
- ICompilationUnit cu = createTestEntityWithMemberTypes();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals("only not classes and interfaces should be returned by #getTypes()", 2, CollectionTools.size(resourceType.getTypes()));
- assertEquals("only enums should be returned by #getEnums()", 1, CollectionTools.size(resourceType.getEnums()));
- }
-
- public void testDuplicateEntityAnnotations() throws Exception {
- ICompilationUnit cu = createTestEntityDuplicates();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation javaTypeMappingAnnotation = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertEquals("FirstEntity", javaTypeMappingAnnotation.getName());
-
- assertEquals(1, resourceType.getAnnotationsSize());
-
- javaTypeMappingAnnotation = (EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME);
- assertEquals("FirstEntity", javaTypeMappingAnnotation.getName());
-
- }
-
-
- public void testAttributes() throws Exception {
- // TODO
- }
-
- public void testFields() throws Exception {
- // TODO
- }
-
- public void testProperties() throws Exception {
- // TODO
- }
-
-
- //TODO more tests here with superclasses other than Object.
- //1. Test where the superclass does not resolve
- //2. Test a superclass that does resolve
- //3. What about a superclass that is a class file in a jar??
- //4.
- public void testGetSuperclassQualifiedName() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals("java.lang.Object", resourceType.getSuperclassQualifiedName());
-
- }
-
- public void testIsAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertTrue(resourceType.isAnnotated());
-
- resourceType.removeAnnotation(JPA.ENTITY);
- assertFalse(resourceType.isAnnotated());
-
- resourceType.addAnnotation(JPA.TABLE);
- assertTrue(resourceType.isAnnotated());
- }
-
- public void testAnnotatedMemberType() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithMemberEmbeddable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertNotNull(resourceType.getAnnotation(JPA.ENTITY));
- assertNull(resourceType.getAnnotation(JPA.EMBEDDABLE));
-
- JavaResourceType nestedType = resourceType.getTypes().iterator().next();
- assertNull(nestedType.getAnnotation(JPA.ENTITY));
- assertNotNull(nestedType.getAnnotation(JPA.EMBEDDABLE));
- }
-
- public void testInvalidAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestInvalidAnnotations();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertEquals(0, resourceType.getAnnotationsSize());
- assertEquals(0, resourceType.getAnnotationsSize());
-
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals(0, resourceField.getAnnotationsSize());
- assertEquals(0, resourceField.getAnnotationsSize());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java
deleted file mode 100644
index a570ab8bfe..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class JoinColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public JoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@JoinColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@JoinColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("(table", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@JoinColumn(referencedColumnName = \"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@JoinColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("(columnDefinition", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@JoinColumn(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@JoinColumn(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@JoinColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@JoinColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java
deleted file mode 100644
index 8c568a50fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class JoinColumnsTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public JoinColumnsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(table = \"" + COLUMN_TABLE + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(" + booleanElement + " = true))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")");
- }
- });
- }
-
- private JoinColumnAnnotation joinColumnAt(JavaResourceMember resourceMember, int index) {
- return (JoinColumnAnnotation) CollectionTools.get(resourceMember.getAnnotations(JPA.JOIN_COLUMN), index);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@JoinColumns(@JoinColumn(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@JoinColumns(@JoinColumn(table = \"Foo\"))", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@JoinColumns(@JoinColumn(referencedColumnName = \"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@JoinColumns(@JoinColumn(columnDefinition = \"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getUnique().booleanValue());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertFalse(column.getUnique().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(unique = false))", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getNullable().booleanValue());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertFalse(column.getNullable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(nullable = false))", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getInsertable().booleanValue());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertFalse(column.getInsertable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(insertable = false))", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getUpdatable().booleanValue());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertFalse(column.getUpdatable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(updatable = false))", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
-
- public void testAddJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@JoinColumn(name = \"FOO\") })";
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertEquals(2, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
- }
-
- public void testAddJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@JoinColumn(name = \"FOO\") })";
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@JoinColumn(name = \"BAZ\"),";
- expected3 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn(name = \"FOO\") })";
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumns.next()).getName());
-
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertEquals(3, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
- }
-
-
- public void testRemoveJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@JoinColumn(name = \"FOO\") })";
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")";
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@JoinColumns", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java
deleted file mode 100644
index 6bfb8ac293..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-@SuppressWarnings("nls")
-public class JoinTableTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public JoinTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithInverseJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@JoinTable(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@JoinTable(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@JoinTable(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@JoinTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = @JoinColumn)", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-
- public void testInverseJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
-
- table.addInverseJoinColumn(0);
- table.addInverseJoinColumn(1);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testAddInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- table.addInverseJoinColumn(0).setName("FOO");
- table.addInverseJoinColumn(1);
- table.addInverseJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", table.inverseJoinColumnAt(1).getName());
- assertNull(table.inverseJoinColumnAt(2).getName());
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(2).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(1);
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")})", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceContains("@JoinTable(inverseJoinColumns = @JoinColumn(name = \"FOO\"))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testMoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveInverseJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(1).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(0, 2);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn, @JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testSetInverseJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.inverseJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java
deleted file mode 100644
index 18e758ca5f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-
-public class JpaJavaResourceModelTestCase
- extends JavaResourceModelTestCase {
-
- public static final String JAVAX_PERSISTENCE_PACKAGE_NAME = "javax.persistence"; //$NON-NLS-1$
-
-
- public JpaJavaResourceModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject.addJar(TestJpaProject.jpaJarName());
- if (TestJpaProject.eclipseLinkJarName() != null) {
- this.javaProject.addJar(TestJpaProject.eclipseLinkJarName());
- }
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- // nothing as of yet
- }
-
- protected ICompilationUnit createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- return createAnnotationAndMembers(JAVAX_PERSISTENCE_PACKAGE_NAME, annotationName, annotationBody);
- }
-
- protected ICompilationUnit createEnumAndMembers(String enumName, String enumBody) throws Exception {
- return createEnumAndMembers(JAVAX_PERSISTENCE_PACKAGE_NAME, enumName, enumBody);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java
deleted file mode 100644
index cb7d7cc80c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptJavaResourceTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJavaResourceTests.class.getPackage().getName());
- suite.addTestSuite(JavaResourceTypeTests.class);
- suite.addTestSuite(JavaResourceAttributeTests.class);
- suite.addTestSuite(JPTToolsTests.class);
-
- suite.addTestSuite(AssociationOverrideTests.class);
- suite.addTestSuite(AssociationOverridesTests.class);
- suite.addTestSuite(AttributeOverrideTests.class);
- suite.addTestSuite(AttributeOverridesTests.class);
- suite.addTestSuite(BasicTests.class);
- suite.addTestSuite(ColumnTests.class);
- suite.addTestSuite(DiscriminatorValueTests.class);
- suite.addTestSuite(DiscriminatorColumnTests.class);
- suite.addTestSuite(EmbeddableTests.class);
- suite.addTestSuite(EmbeddedTests.class);
- suite.addTestSuite(EmbeddedIdTests.class);
- suite.addTestSuite(EntityTests.class);
- suite.addTestSuite(EnumeratedTests.class);
- suite.addTestSuite(GeneratedValueTests.class);
- suite.addTestSuite(IdClassTests.class);
- suite.addTestSuite(IdTests.class);
- suite.addTestSuite(InheritanceTests.class);
- suite.addTestSuite(JoinColumnTests.class);
- suite.addTestSuite(JoinColumnsTests.class);
- suite.addTestSuite(JoinTableTests.class);
- suite.addTestSuite(LobTests.class);
- suite.addTestSuite(ManyToManyTests.class);
- suite.addTestSuite(ManyToOneTests.class);
- suite.addTestSuite(MapKeyTests.class);
- suite.addTestSuite(MappedSuperclassTests.class);
- suite.addTestSuite(NamedNativeQueryTests.class);
- suite.addTestSuite(NamedNativeQueriesTests.class);
- suite.addTestSuite(NamedQueryTests.class);
- suite.addTestSuite(NamedQueriesTests.class);
- suite.addTestSuite(OneToManyTests.class);
- suite.addTestSuite(OneToOneTests.class);
- suite.addTestSuite(OrderByTests.class);
- suite.addTestSuite(PrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(PrimaryKeyJoinColumnsTests.class);
- suite.addTestSuite(QueryHintTests.class);
- suite.addTestSuite(SecondaryTableTests.class);
- suite.addTestSuite(SecondaryTablesTests.class);
- suite.addTestSuite(SequenceGeneratorTests.class);
- suite.addTestSuite(TableGeneratorTests.class);
- suite.addTestSuite(TableTests.class);
- suite.addTestSuite(TemporalTests.class);
- suite.addTestSuite(TransientTests.class);
- suite.addTestSuite(VersionTests.class);
-
- return suite;
- }
-
- private JptJavaResourceTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java
deleted file mode 100644
index d660c8103b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-
-@SuppressWarnings("nls")
-public class LobTests extends JpaJavaResourceModelTestCase {
-
- public LobTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestLob() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.LOB);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Lob");
- }
- });
- }
-
- public void testLob() throws Exception {
- ICompilationUnit cu = this.createTestLob();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- LobAnnotation lob = (LobAnnotation) resourceField.getAnnotation(JPA.LOB);
- assertNotNull(lob);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java
deleted file mode 100644
index fae22f1be4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToManyTests extends JpaJavaResourceModelTestCase {
-
- public ManyToManyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToMany() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNotNull(manyToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(null);
- assertNull(manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity(null);
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToMany.getFullyQualifiedTargetEntityClassName());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToMany.getTargetEntity());
-
- assertEquals("Foo", manyToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(null, manyToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNull(manyToMany.getMappedBy());
- manyToMany.setMappedBy("bar");
- assertEquals("bar", manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
-
- manyToMany.setMappedBy(null);
- assertNull(manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertSourceContains("@ManyToMany(cascade = ALL)", cu);
-
- assertTrue(manyToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(true);
- assertSourceContains("@ManyToMany(cascade = MERGE)", cu);
-
- assertTrue(manyToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadePersist());
-
- manyToMany.setCascadePersist(true);
- assertSourceContains("@ManyToMany(cascade = PERSIST)", cu);
-
- assertTrue(manyToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeRemove(true);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- assertTrue(manyToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRefresh());
-
- manyToMany.setCascadeRefresh(true);
- assertSourceContains("@ManyToMany(cascade = REFRESH)", cu);
-
- assertTrue(manyToMany.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertTrue(manyToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToMany(cascade = CascadeType.ALL)", cu);
-
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false); //TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false);
- assertFalse(manyToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
- assertTrue(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeMerge(false);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- manyToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java
deleted file mode 100644
index d221a7a029..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToOneTests extends JpaJavaResourceModelTestCase {
-
- public ManyToOneTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToOne() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertNotNull(manyToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(null);
- assertNull(manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity(null);
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToOne.getFullyQualifiedTargetEntityClassName());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToOne.getTargetEntity());
-
- assertEquals("Foo", manyToOne.getFullyQualifiedTargetEntityClassName());//bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(null);
- assertNull(manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertSourceContains("@ManyToOne(cascade = ALL)", cu);
-
- assertTrue(manyToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(true);
- assertSourceContains("@ManyToOne(cascade = MERGE)", cu);
-
- assertTrue(manyToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadePersist());
-
- manyToOne.setCascadePersist(true);
- assertSourceContains("@ManyToOne(cascade = PERSIST)", cu);
-
- assertTrue(manyToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeRemove(true);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- assertTrue(manyToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRefresh());
-
- manyToOne.setCascadeRefresh(true);
- assertSourceContains("@ManyToOne(cascade = REFRESH)", cu);
-
- assertTrue(manyToOne.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertTrue(manyToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToOne(cascade = CascadeType.ALL)", cu);
-
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);
- assertFalse(manyToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
- assertTrue(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeMerge(false);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- manyToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java
deleted file mode 100644
index 0ef74ab3ea..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-
-@SuppressWarnings("nls")
-public class MapKeyTests extends JpaJavaResourceModelTestCase {
-
- public MapKeyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKey() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAP_KEY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKey");
- }
- });
- }
-
- private ICompilationUnit createTestMapKeyWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAP_KEY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKey(name = \"key\")");
- }
- });
- }
-
- public void testMapKey() throws Exception {
- ICompilationUnit cu = this.createTestMapKey();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(JPA.MAP_KEY);
- assertNotNull(mapKey);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(JPA.MAP_KEY);
- assertEquals("key", mapKey.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestMapKey();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(JPA.MAP_KEY);
-
- mapKey.setName("foo");
-
- assertSourceContains("@MapKey(name = \"foo\")", cu);
-
- mapKey.setName(null);
-
- assertSourceContains("@MapKey", cu);
- assertSourceDoesNotContain("@MapKey(name = \"foo\")", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java
deleted file mode 100644
index 03d08f6a39..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-
-@SuppressWarnings("nls")
-public class MappedSuperclassTests extends JpaJavaResourceModelTestCase {
-
- public MappedSuperclassTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- sb.append("@Entity");
- }
- });
- }
-
- public void testMappedSuperclass() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof MappedSuperclassAnnotation);
- }
-
- public void testMappedSuperclassAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclassAndEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EntityAnnotation);
-
- MappedSuperclassAnnotation mappedSuperclass = (MappedSuperclassAnnotation) resourceType.getAnnotation(JPA.MAPPED_SUPERCLASS);
- assertNotNull(mappedSuperclass);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java
deleted file mode 100644
index f8e60be450..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedNativeQueriesTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
- private static final String QUERY_RESULT_CLASS = "Result";
- private static final String QUERY_RESULT_SET_MAPPING = "resultSetMapping";
-
- public NamedNativeQueriesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedNativeQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithName() throws Exception {
- return createTestNamedNativeQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQuery() throws Exception {
- return createTestNamedNativeQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultSetMapping() throws Exception {
- return createTestNamedNativeQueryWithStringElement("resultSetMapping", QUERY_RESULT_SET_MAPPING);
- }
-
-
- private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(" + elementName + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(resultClass = " + QUERY_RESULT_CLASS + ".class))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint}))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\")");
- }
- });
- }
-
- public void testNamedNativeQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedNativeQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedNativeQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
- }
-
- public void testSetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
-
- namedQuery.setResultClass("foo");
- assertEquals("foo", namedQuery.getResultClass());
-
- assertSourceContains("@NamedNativeQuery(resultClass = foo.class)", cu);
-
- namedQuery.setResultClass(null);
- assertNull(namedQuery.getResultClass());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery.getResultClass());
- assertEquals("Result", namedQuery.getFullyQualifiedResultClassName());//bug 196200 changed this
-
- namedQuery.setResultClass(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, namedQuery.getFullyQualifiedResultClassName());
- assertSourceContains("@NamedNativeQuery(resultClass = " + TYPE_NAME + ".class)", cu);
- }
-
- public void testGetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
- }
-
- public void testSetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
-
- namedQuery.setResultSetMapping("foo");
- assertEquals("foo", namedQuery.getResultSetMapping());
-
- assertSourceContains("@NamedNativeQuery(resultSetMapping = \"foo\")", cu);
-
- namedQuery.setResultSetMapping(null);
- assertNull(namedQuery.getResultSetMapping());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\")))", cu);
-
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")}))", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
- }
-
- public void testAddNamedNativeQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedNativeQueries({";
- String expected2 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),";
- String expected3 = "@NamedNativeQuery(name = \"BAR\") })";
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.NAMED_NATIVE_QUERY));
- }
-
- public void testAddNamedNativeQueryToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedNativeQueries({";
- String expected2 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),";
- String expected3 = "@NamedNativeQuery(name = \"BAR\") })";
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@NamedNativeQuery(name = \"BAZ\"),";
- expected3 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"), @NamedNativeQuery(name = \"BAR\") })";
- namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> namedQueries = resourceType.getAnnotations(JPA.NAMED_NATIVE_QUERY).iterator();
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
- assertEquals("foo", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
- assertEquals("BAR", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.NAMED_NATIVE_QUERY));
- }
-
- public void testRemoveNamedNativeQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedNativeQueries({";
- String expected2 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),";
- String expected3 = "@NamedNativeQuery(name = \"BAR\") })";
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\")";
- resourceType.removeAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@NamedNativeQueries", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java
deleted file mode 100644
index e8fa64dd6e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedNativeQueryTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
- private static final String QUERY_RESULT_CLASS = "Result";
- private static final String QUERY_RESULT_SET_MAPPING = "resultSetMapping";
-
- public NamedNativeQueryTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithName() throws Exception {
- return createTestNamedNativeQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQuery() throws Exception {
- return createTestNamedNativeQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultSetMapping() throws Exception {
- return createTestNamedNativeQueryWithStringElement("resultSetMapping", QUERY_RESULT_SET_MAPPING);
- }
-
-
- private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(resultClass = " + QUERY_RESULT_CLASS + ".class)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint})");
- }
- });
- }
-
- public void testNamedNativeQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedNativeQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedNativeQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
- }
-
- public void testSetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
-
- namedQuery.setResultClass("foo");
- assertEquals("foo", namedQuery.getResultClass());
-
- assertSourceContains("@NamedNativeQuery(resultClass = foo.class)", cu);
-
- namedQuery.setResultClass(null);
- assertNull(namedQuery.getResultClass());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery.getResultClass());
- assertEquals("Result", namedQuery.getFullyQualifiedResultClassName());//bug 196200 changed this
-
- namedQuery.setResultClass(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, namedQuery.getFullyQualifiedResultClassName());
- assertSourceContains("@NamedNativeQuery(resultClass = " + TYPE_NAME + ".class)", cu);
- }
-
- public void testGetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
- }
-
- public void testSetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
-
- namedQuery.setResultSetMapping("foo");
- assertEquals("foo", namedQuery.getResultSetMapping());
-
- assertSourceContains("@NamedNativeQuery(resultSetMapping = \"foo\")", cu);
-
- namedQuery.setResultSetMapping(null);
- assertNull(namedQuery.getResultSetMapping());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\"))", cu);
-
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")})", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java
deleted file mode 100644
index 91a9a27ec1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedQueriesTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
-
- public NamedQueriesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithName() throws Exception {
- return createTestNamedQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedQueryWithQuery() throws Exception {
- return createTestNamedQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery(" + elementName + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint}))");
- }
- });
- }
-
-
- private ICompilationUnit createTestNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"))");
- }
- });
- }
-
- public void testNamedQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
-
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\")))", cu);
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")}))", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
- }
-
- public void testAddNamedQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedQueries({";
- String expected2 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")),";
- String expected3 = "@NamedQuery(name = \"BAR\") })";
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_QUERY));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.NAMED_QUERY));
- }
-
- public void testAddNamedQueryToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedQueries({";
- String expected2 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")),";
- String expected3 = "@NamedQuery(name = \"BAR\") })";
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
-
- expected2 = "@NamedQuery(name = \"BAZ\"),";
- expected3 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")), @NamedQuery(name = \"BAR\") })";
- namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> namedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals("BAZ", ((NamedQueryAnnotation) namedQueries.next()).getName());
- assertEquals("foo", ((NamedQueryAnnotation) namedQueries.next()).getName());
- assertEquals("BAR", ((NamedQueryAnnotation) namedQueries.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_QUERY));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.NAMED_QUERY));
- }
-
- public void testRemoveNamedQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedQueries({";
- String expected2 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")),";
- String expected3 = "@NamedQuery(name = \"BAR\") })";
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"))";
- resourceType.removeAnnotation(1, JPA.NAMED_QUERY);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@NamedNativeQueries", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java
deleted file mode 100644
index 6a1491711c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedQueryTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
-
- public NamedQueryTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithName() throws Exception {
- return createTestNamedQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedQueryWithQuery() throws Exception {
- return createTestNamedQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint})");
- }
- });
- }
-
- public void testNamedQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
-
- ListIterator<QueryHintAnnotation> iterator = namedQuery.getHints().iterator();
- assertEquals("BAR", iterator.next().getName());
- assertNull(iterator.next().getName());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- QueryHintAnnotation queryHint = namedQuery.addHint(0);
- queryHint.setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\"))", cu);
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")})", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java
deleted file mode 100644
index 88e6f08235..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToManyTests extends JpaJavaResourceModelTestCase {
-
- public OneToManyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToMany() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNotNull(oneToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToMany.getFetch());
-
- assertSourceContains("@OneToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(null);
- assertNull(oneToMany.getFetch());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity(null);
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToMany.getFullyQualifiedTargetEntityClassName());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToMany.getTargetEntity());
-
- assertEquals("Foo", oneToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
- }
-
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(null, oneToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNull(oneToMany.getMappedBy());
- oneToMany.setMappedBy("bar");
- assertEquals("bar", oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
-
- oneToMany.setMappedBy(null);
- assertNull(oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertSourceContains("@OneToMany(cascade = ALL)", cu);
-
- assertTrue(oneToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(true);
- assertSourceContains("@OneToMany(cascade = MERGE)", cu);
-
- assertTrue(oneToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadePersist());
-
- oneToMany.setCascadePersist(true);
- assertSourceContains("@OneToMany(cascade = PERSIST)", cu);
-
- assertTrue(oneToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeRemove(true);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- assertTrue(oneToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRefresh());
-
- oneToMany.setCascadeRefresh(true);
- assertSourceContains("@OneToMany(cascade = REFRESH)", cu);
-
- assertTrue(oneToMany.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertTrue(oneToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToMany(cascade = CascadeType.ALL)", cu);
-
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);
- assertFalse(oneToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
- assertTrue(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeMerge(false);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- oneToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java
deleted file mode 100644
index fe0f567469..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToOneTests extends JpaJavaResourceModelTestCase {
-
- public OneToOneTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToOne() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNotNull(oneToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOne.getFetch());
-
- assertSourceContains("@OneToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(null);
- assertNull(oneToOne.getFetch());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity(null);
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToOne.getFullyQualifiedTargetEntityClassName());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToOne.getTargetEntity());
-
- assertEquals("Foo", oneToOne.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
- assertSourceContains("@OneToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(null);
- assertNull(oneToOne.getOptional());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(null, oneToOne.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNull(oneToOne.getMappedBy());
- oneToOne.setMappedBy("bar");
- assertEquals("bar", oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
-
- oneToOne.setMappedBy(null);
- assertNull(oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertSourceContains("@OneToOne(cascade = ALL)", cu);
-
- assertTrue(oneToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(true);
- assertSourceContains("@OneToOne(cascade = MERGE)", cu);
-
- assertTrue(oneToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadePersist());
-
- oneToOne.setCascadePersist(true);
- assertSourceContains("@OneToOne(cascade = PERSIST)", cu);
-
- assertTrue(oneToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeRemove(true);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- assertTrue(oneToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRefresh());
-
- oneToOne.setCascadeRefresh(true);
- assertSourceContains("@OneToOne(cascade = REFRESH)", cu);
-
- assertTrue(oneToOne.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertTrue(oneToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToOne(cascade = CascadeType.ALL)", cu);
-
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);
- assertFalse(oneToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
- assertTrue(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeMerge(false);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- oneToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java
deleted file mode 100644
index 45af210208..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-
-@SuppressWarnings("nls")
-public class OrderByTests extends JpaJavaResourceModelTestCase {
-
- public OrderByTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOrderBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ORDER_BY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderBy");
- }
- });
- }
-
- private ICompilationUnit createTestOrderByWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ORDER_BY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderBy(value = \"key\")");
- }
- });
- }
-
- public void testOrderBy() throws Exception {
- ICompilationUnit cu = this.createTestOrderBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(JPA.ORDER_BY);
- assertNotNull(orderBy);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestOrderByWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(JPA.ORDER_BY);
- assertEquals("key", orderBy.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestOrderBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(JPA.ORDER_BY);
-
- orderBy.setValue("foo");
-
- assertSourceContains("@OrderBy(\"foo\")", cu);
-
- orderBy.setValue(null);
-
- assertSourceContains("@OrderBy", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
deleted file mode 100644
index ac65d38137..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class PrimaryKeyJoinColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public PrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@PrimaryKeyJoinColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
-
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@PrimaryKeyJoinColumn(referencedColumnName = \"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@PrimaryKeyJoinColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
deleted file mode 100644
index cfa0bb6714..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class PrimaryKeyJoinColumnsTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public PrimaryKeyJoinColumnsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(referencedColumnName = \"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(columnDefinition = \"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
-
- public void testAddPrimaryKeyJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@PrimaryKeyJoinColumns({";
- String expected2 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),";
- String expected3 = "@PrimaryKeyJoinColumn(name = \"FOO\") })";
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertEquals(2, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
- }
- public void testAddPrimaryKeyJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@PrimaryKeyJoinColumns({";
- String expected2 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),";
- String expected3 = "@PrimaryKeyJoinColumn(name = \"FOO\") })";
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@PrimaryKeyJoinColumn(name = \"BAZ\"),";
- expected3 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"), @PrimaryKeyJoinColumn(name = \"FOO\") })";
- joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> pkJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
-
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertEquals(3, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
- }
-
- public void testRemovePrimaryKeyJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@PrimaryKeyJoinColumns({";
- String expected2 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),";
- String expected3 = "@PrimaryKeyJoinColumn(name = \"FOO\") })";
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\")";
- resourceField.removeAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumns", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java
deleted file mode 100644
index 8a07427449..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-
-@SuppressWarnings("nls")
-public class QueryHintTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_HINT_NAME = "myHint";
- private static final String QUERY_HINT_VALUE = "myValue";
-
- public QueryHintTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(hints = {@QueryHint(name = \"" + QUERY_HINT_NAME + "\", value = \"" + QUERY_HINT_VALUE + "\"), @QueryHint})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- QueryHintAnnotation queryHint = namedQuery.hintAt(0);
- assertEquals(QUERY_HINT_NAME, queryHint.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- QueryHintAnnotation queryHint = namedQuery.hintAt(0);
- assertEquals(QUERY_HINT_NAME, queryHint.getName());
-
- queryHint.setName("foo");
- assertEquals("foo", queryHint.getName());
-
- assertSourceContains("@QueryHint(name = \"foo\", value = \"" + QUERY_HINT_VALUE + "\")", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java
deleted file mode 100644
index d8d4ed5122..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-@SuppressWarnings("nls")
-public class SecondaryTableTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public SecondaryTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithPkJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@SecondaryTable(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@SecondaryTable(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@SecondaryTable(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.removeUniqueConstraint(1);
- Iterator<UniqueConstraintAnnotation> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- assertSourceContains("@SecondaryTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
-
- secondaryTable.moveUniqueConstraint(2, 0);
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
-
- secondaryTable.moveUniqueConstraint(0, 2);
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
-
- public void testPkJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(1);
-
- assertEquals(2, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
- }
-
- public void testAddPkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
-
- table.addPkJoinColumn(0).setName("FOO");
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(0).setName("BAR");//test adding a pkJoinColumn in front of 2 other joinColumns
-
- assertEquals("BAR", table.pkJoinColumnAt(0).getName());
- assertNull(table.pkJoinColumnAt(1).getName());
- assertEquals("FOO", table.pkJoinColumnAt(2).getName());
-
- assertEquals(3, table.getPkJoinColumnsSize());
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"),@PrimaryKeyJoinColumn, @PrimaryKeyJoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testRemovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.removePkJoinColumn(1);
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"BAZ\")})", cu);
-
- table.removePkJoinColumn(0);
- assertSourceContains("@SecondaryTable(pkJoinColumns = @PrimaryKeyJoinColumn(name = \"BAZ\"))", cu);
-
-
- table.removePkJoinColumn(0);
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(2, 0);
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\")})", cu);
- }
-
- public void testMovePkJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(0, 2);
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\"), @PrimaryKeyJoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testSetPkJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"foo\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java
deleted file mode 100644
index af866a8313..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-
-@SuppressWarnings("nls")
-public class SecondaryTablesTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public SecondaryTablesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable)");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(name = \"" + TABLE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(schema = \"" + SCHEMA_NAME + "\"))");
- }
- });
- }
- private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(catalog = \"" + CATALOG_NAME + "\"))");
- }
- });
- }
-
-
- private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint}))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = {\"BAR\"}))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTablesWithPkJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLES, JPA.SECONDARY_TABLE, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")}))");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Annotation secondaryTables = resourceType.getAnnotation(JPA.SECONDARY_TABLES);
- assertNotNull(secondaryTables);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(TABLE_NAME, secondaryTable.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNull(secondaryTable.getName());
- assertNull(secondaryTable.getCatalog());
- assertNull(secondaryTable.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertNull(secondaryTable.getName());
-
- secondaryTable.setName("Foo");
- assertEquals("Foo", secondaryTable.getName());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(TABLE_NAME, secondaryTable.getName());
-
- secondaryTable.setName(null);
- assertNull(secondaryTable.getName());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(CATALOG_NAME, secondaryTable.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNull(secondaryTable.getCatalog());
-
- secondaryTable.setCatalog("Foo");
- assertEquals("Foo", secondaryTable.getCatalog());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(catalog = \"Foo\"))", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(CATALOG_NAME, secondaryTable.getCatalog());
-
- secondaryTable.setCatalog(null);
- assertNull(secondaryTable.getCatalog());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(secondaryTable);
- assertEquals(SCHEMA_NAME, secondaryTable.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNull(secondaryTable.getSchema());
-
- secondaryTable.setSchema("Foo");
- assertEquals("Foo", secondaryTable.getSchema());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(schema = \"Foo\"))", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(SCHEMA_NAME, secondaryTable.getSchema());
-
- secondaryTable.setSchema(null);
- assertNull(secondaryTable.getSchema());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- secondaryTable.addUniqueConstraint(0);
- secondaryTable.addUniqueConstraint(1);
-
- assertEquals(2, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(2, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
- secondaryTable.addUniqueConstraint(1);
- secondaryTable.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint}))", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- secondaryTable.removeUniqueConstraint(2);
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
-
- secondaryTable.removeUniqueConstraint(0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAR\"}))", cu);
-
- secondaryTable.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(2).getColumnNamesSize());
-
- secondaryTable.moveUniqueConstraint(2, 0);
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(1).getColumnNamesSize());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint, @UniqueConstraint(columnNames = \"FOO\")}))", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(2).getColumnNamesSize());
-
- secondaryTable.moveUniqueConstraint(0, 2);
- assertEquals(0, secondaryTable.uniqueConstraintAt(0).getColumnNamesSize());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint, @UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint(columnNames = {\"BAR\"})}))", cu);
- }
-
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO") @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddSecondaryTableCopyExisting() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@SecondaryTables({";
- String expected2 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })),";
- String expected3 = "@SecondaryTable(name = \"BAR\") })";
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testAddSecondaryTable() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@SecondaryTables({";
- String expected2 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })),";
- String expected3 = "@SecondaryTable(name = \"BAR\") })";
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@SecondaryTable(name = \"BAZ\"),";
- expected3 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })), @SecondaryTable(name = \"BAR\") })";
- secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> secondaryTables = resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator();
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testRemoveSecondaryTableCopyExisting() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@SecondaryTables({";
- String expected2 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })),";
- String expected3 = "@SecondaryTable(name = \"BAR\") })";
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" }))";
- resourceType.removeAnnotation(1, JPA.SECONDARY_TABLE);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@SecondaryTables", cu);
- }
-
-
- public void testPkJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(1);
-
- assertEquals(2, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
- }
-
- public void testAddPkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addPkJoinColumn(0).setName("FOO");
- table.addPkJoinColumn(1);
- table.addPkJoinColumn(0).setName("BAR");
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"),@PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn}))", cu);
- }
-
- public void testRemovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.removePkJoinColumn(1);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"BAZ\")}))", cu);
-
- table.removePkJoinColumn(0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = @PrimaryKeyJoinColumn(name = \"BAZ\")))", cu);
-
- table.removePkJoinColumn(0);
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(2, 0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\")}))", cu);
- }
-
- public void testMovePkJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(0, 2);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\"), @PrimaryKeyJoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testSetPkJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"foo\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")}))", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java
deleted file mode 100644
index 8e99caf5bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-
-@SuppressWarnings("nls")
-public class SequenceGeneratorTests extends JpaJavaResourceModelTestCase {
-
- private static final String GENERATOR_NAME = "MY_GENERATOR";
- private static final String GENERATOR_SEQUENCE_NAME = "MY_SEQUENCE";
- private static final Integer GENERATOR_ALLOCATION_SIZE = Integer.valueOf(5);
- private static final Integer GENERATOR_INITIAL_VALUE = Integer.valueOf(5);
-
- public SequenceGeneratorTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSequenceGeneratorOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithName() throws Exception {
- return createTestSequenceGeneratorWithStringElement("name", GENERATOR_NAME);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithSequenceName() throws Exception {
- return createTestSequenceGeneratorWithStringElement("sequenceName", GENERATOR_SEQUENCE_NAME);
- }
-
- protected ICompilationUnit createTestSequenceGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithAllocationSize() throws Exception {
- return createTestSequenceGeneratorWithIntElement("allocationSize", GENERATOR_ALLOCATION_SIZE.intValue());
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithInitialValue() throws Exception {
- return createTestSequenceGeneratorWithIntElement("initialValue", GENERATOR_INITIAL_VALUE.intValue());
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + " = " + value + ")");
- }
- });
- }
-
- public void testSequenceGeneratorOnField() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNotNull(sequenceGenerator);
- }
-
- public void testSequenceGeneratorOnType() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceType.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNotNull(sequenceGenerator);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_NAME, sequenceGenerator.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_NAME, sequenceGenerator.getName());
-
- sequenceGenerator.setName("foo");
- assertEquals("foo", sequenceGenerator.getName());
-
- assertSourceContains("@SequenceGenerator(name = \"foo\")", cu);
-
- sequenceGenerator.setName(null);
- assertNull(sequenceGenerator.getName());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- public void testGetSequenceName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSequenceName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SEQUENCE_NAME, sequenceGenerator.getSequenceName());
- }
-
- public void testSetSequenceName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSequenceName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SEQUENCE_NAME, sequenceGenerator.getSequenceName());
-
- sequenceGenerator.setSequenceName("foo");
- assertEquals("foo", sequenceGenerator.getSequenceName());
-
- assertSourceContains("@SequenceGenerator(sequenceName = \"foo\")", cu);
-
- sequenceGenerator.setSequenceName(null);
- assertNull(sequenceGenerator.getSequenceName());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- public void testGetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, sequenceGenerator.getAllocationSize());
- }
-
- public void testSetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, sequenceGenerator.getAllocationSize());
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), sequenceGenerator.getAllocationSize());
-
- assertSourceContains("@SequenceGenerator(allocationSize = 500)", cu);
-
- sequenceGenerator.setAllocationSize(null);
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(0));
- assertSourceContains("@SequenceGenerator(allocationSize = 0)", cu);
- }
-
- public void testGetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, sequenceGenerator.getInitialValue());
- }
-
- public void testSetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, sequenceGenerator.getInitialValue());
-
- sequenceGenerator.setInitialValue(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), sequenceGenerator.getInitialValue());
-
- assertSourceContains("@SequenceGenerator(initialValue = 500)", cu);
-
- sequenceGenerator.setInitialValue(null);
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
-
- sequenceGenerator.setInitialValue(Integer.valueOf(0));
- assertSourceContains("@SequenceGenerator(initialValue = 0)", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java
deleted file mode 100644
index cf2ec06bbf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-
-@SuppressWarnings("nls")
-public class TableGeneratorTests extends JpaJavaResourceModelTestCase {
-
- private static final String GENERATOR_NAME = "MY_GENERATOR";
- private static final String GENERATOR_TABLE = "MY_TABLE";
- private static final String GENERATOR_CATALOG = "MY_CATALOG";
- private static final String GENERATOR_SCHEMA = "MY_SCHEMA";
- private static final String GENERATOR_PK_COLUMN_NAME = "MY_PK_COLUMN_NAME";
- private static final String GENERATOR_VALUE_COLUMN_NAME = "MY_VALUE_COLUMN_NAME";
- private static final String GENERATOR_PK_COLUMN_VALUE = "MY_PK_COLUMN_VALUE";
- private static final Integer GENERATOR_ALLOCATION_SIZE = Integer.valueOf(5);
- private static final Integer GENERATOR_INITIAL_VALUE = Integer.valueOf(5);
-
- public TableGeneratorTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTableGeneratorOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithName() throws Exception {
- return createTestTableGeneratorWithStringElement("name", GENERATOR_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithTable() throws Exception {
- return createTestTableGeneratorWithStringElement("table", GENERATOR_TABLE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithCatalog() throws Exception {
- return createTestTableGeneratorWithStringElement("catalog", GENERATOR_CATALOG);
- }
-
- private ICompilationUnit createTestTableGeneratorWithSchema() throws Exception {
- return createTestTableGeneratorWithStringElement("schema", GENERATOR_SCHEMA);
- }
- private ICompilationUnit createTestTableGeneratorWithPkColumnName() throws Exception {
- return createTestTableGeneratorWithStringElement("pkColumnName", GENERATOR_PK_COLUMN_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithValueColumnName() throws Exception {
- return createTestTableGeneratorWithStringElement("valueColumnName", GENERATOR_VALUE_COLUMN_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithPkColumnValue() throws Exception {
- return createTestTableGeneratorWithStringElement("pkColumnValue", GENERATOR_PK_COLUMN_VALUE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithAllocationSize() throws Exception {
- return createTestTableGeneratorWithIntElement("allocationSize", GENERATOR_ALLOCATION_SIZE.intValue());
- }
-
- private ICompilationUnit createTestTableGeneratorWithInitialValue() throws Exception {
- return createTestTableGeneratorWithIntElement("initialValue", GENERATOR_INITIAL_VALUE.intValue());
- }
-
- private ICompilationUnit createTestTableGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(" + elementName + " = " + value + ")");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- public void testTableGeneratorOnField() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertNotNull(tableGenerator);
- }
-
- public void testTableGeneratorOnType() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceType.getAnnotation(JPA.TABLE_GENERATOR);
- assertNotNull(tableGenerator);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_NAME, tableGenerator.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_NAME, tableGenerator.getName());
-
- tableGenerator.setName("foo");
- assertEquals("foo", tableGenerator.getName());
-
- assertSourceContains("@TableGenerator(name = \"foo\")", cu);
-
- tableGenerator.setName(null);
- assertNull(tableGenerator.getName());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_TABLE, tableGenerator.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_TABLE, tableGenerator.getTable());
-
- tableGenerator.setTable("foo");
- assertEquals("foo", tableGenerator.getTable());
-
- assertSourceContains("@TableGenerator(table = \"foo\")", cu);
-
- tableGenerator.setTable(null);
- assertNull(tableGenerator.getTable());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, tableGenerator.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, tableGenerator.getCatalog());
-
- tableGenerator.setCatalog("foo");
- assertEquals("foo", tableGenerator.getCatalog());
-
- assertSourceContains("@TableGenerator(catalog = \"foo\")", cu);
-
- tableGenerator.setCatalog(null);
- assertNull(tableGenerator.getCatalog());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, tableGenerator.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, tableGenerator.getSchema());
-
- tableGenerator.setSchema("foo");
- assertEquals("foo", tableGenerator.getSchema());
-
- assertSourceContains("@TableGenerator(schema = \"foo\")", cu);
-
- tableGenerator.setSchema(null);
- assertNull(tableGenerator.getSchema());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetPkColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_NAME, tableGenerator.getPkColumnName());
- }
-
- public void testSetPkColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_NAME, tableGenerator.getPkColumnName());
-
- tableGenerator.setPkColumnName("foo");
- assertEquals("foo", tableGenerator.getPkColumnName());
-
- assertSourceContains("@TableGenerator(pkColumnName = \"foo\")", cu);
-
- tableGenerator.setPkColumnName(null);
- assertNull(tableGenerator.getPkColumnName());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetValueColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithValueColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_VALUE_COLUMN_NAME, tableGenerator.getValueColumnName());
- }
-
- public void testSetValueColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithValueColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_VALUE_COLUMN_NAME, tableGenerator.getValueColumnName());
-
- tableGenerator.setValueColumnName("foo");
- assertEquals("foo", tableGenerator.getValueColumnName());
-
- assertSourceContains("@TableGenerator(valueColumnName = \"foo\")", cu);
-
- tableGenerator.setValueColumnName(null);
- assertNull(tableGenerator.getValueColumnName());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetPkColumnValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_VALUE, tableGenerator.getPkColumnValue());
- }
-
- public void testSetPkColumnValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_VALUE, tableGenerator.getPkColumnValue());
-
- tableGenerator.setPkColumnValue("foo");
- assertEquals("foo", tableGenerator.getPkColumnValue());
-
- assertSourceContains("@TableGenerator(pkColumnValue = \"foo\")", cu);
-
- tableGenerator.setPkColumnValue(null);
- assertNull(tableGenerator.getPkColumnValue());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, tableGenerator.getAllocationSize());
- }
-
- public void testSetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, tableGenerator.getAllocationSize());
-
- tableGenerator.setAllocationSize(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), tableGenerator.getAllocationSize());
-
- assertSourceContains("@TableGenerator(allocationSize = 500)", cu);
-
- tableGenerator.setAllocationSize(null);
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
-
- tableGenerator.setAllocationSize(Integer.valueOf(0));
- assertSourceContains("@TableGenerator(allocationSize = 0)", cu);
- }
-
- public void testGetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, tableGenerator.getInitialValue());
- }
-
- public void testSetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, tableGenerator.getInitialValue());
-
- tableGenerator.setInitialValue(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), tableGenerator.getInitialValue());
-
- assertSourceContains("@TableGenerator(initialValue = 500)", cu);
-
- tableGenerator.setInitialValue(null);
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
-
- tableGenerator.setInitialValue(Integer.valueOf(0));
- assertSourceContains("@TableGenerator(initialValue = 0)", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(0, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.addUniqueConstraint(0);
- tableGenerator.addUniqueConstraint(1);
-
- assertEquals(2, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.addUniqueConstraint(0).addColumnName("FOO");
- tableGenerator.addUniqueConstraint(1);
- tableGenerator.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", tableGenerator.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", tableGenerator.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, tableGenerator.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertEquals(3, tableGenerator.getUniqueConstraintsSize());
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.removeUniqueConstraint(1);
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- tableGenerator.removeUniqueConstraint(0);
- assertSourceContains("@TableGenerator(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- tableGenerator.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.moveUniqueConstraint(2, 0);
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.moveUniqueConstraint(0, 2);
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java
deleted file mode 100644
index f14a6b4aba..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-
-@SuppressWarnings("nls")
-public class TableTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public TableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@Table(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@Table(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@Table(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.uniqueConstraintAt(1).addColumnName("BAZ");
-
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint,@UniqueConstraint(columnNames = { \"BAR\", \"BAZ\" }), @UniqueConstraint(columnNames = \"FOO\")})", cu);
-
- assertEquals("FOO", table.uniqueConstraintAt(2).columnNameAt(0));
- ListIterator<String> columnNames = table.uniqueConstraintAt(1).getColumnNames().iterator();
- assertEquals("BAR", columnNames.next());
- assertEquals("BAZ", columnNames.next());
- }
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.removeUniqueConstraint(1);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testRemoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.addUniqueConstraint(2).addColumnName("BAZ");
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"),@UniqueConstraint(columnNames = \"BAR\"), @UniqueConstraint(columnNames = \"BAZ\")})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"BAZ\")})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints = @UniqueConstraint(columnNames = \"BAZ\"))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testRemoveUniqueConstraint3() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.addUniqueConstraint(2).addColumnName("BAZ");
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"),@UniqueConstraint(columnNames = \"BAR\"), @UniqueConstraint(columnNames = \"BAZ\")})", cu);
-
- table.removeUniqueConstraint(2);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"),@UniqueConstraint(columnNames = \"BAR\")})", cu);
-
- table.removeUniqueConstraint(1);
- assertSourceContains("@Table(uniqueConstraints = @UniqueConstraint(columnNames = \"FOO\"))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java
deleted file mode 100644
index 61953901d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalType;
-
-@SuppressWarnings("nls")
-public class TemporalTests extends JpaJavaResourceModelTestCase {
-
- public TemporalTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TEMPORAL);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal");
- }
- });
- }
-
- private ICompilationUnit createTestTemporalWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal(TemporalType.DATE)");
- }
- });
- }
-
- public void testTemporal() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(JPA.TEMPORAL);
- assertNotNull(temporal);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporalWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(JPA.TEMPORAL);
- assertEquals(TemporalType.DATE, temporal.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(JPA.TEMPORAL);
-
- temporal.setValue(TemporalType.TIME);
-
- assertSourceContains("@Temporal(TIME)", cu);
-
- temporal.setValue(null);
-
- assertSourceDoesNotContain("@Temporal(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java
deleted file mode 100644
index 8815516a87..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-
-@SuppressWarnings("nls")
-public class TransientTests extends JpaJavaResourceModelTestCase {
-
- public TransientTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTransient() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TRANSIENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient");
- }
- });
- }
-
- public void testTransient() throws Exception {
- ICompilationUnit cu = this.createTestTransient();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof TransientAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java
deleted file mode 100644
index 2f045e7a63..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-
-@SuppressWarnings("nls")
-public class VersionTests extends JpaJavaResourceModelTestCase {
-
- public VersionTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestVersion() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.VERSION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version");
- }
- });
- }
-
- public void testVersion() throws Exception {
- ICompilationUnit cu = this.createTestVersion();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof VersionAnnotation);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml
deleted file mode 100644
index 18b64a4abe..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?> <!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jpa.core.tests"/> <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.core.tests.internal.model.JptJpaCoreModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> </ant> </target> <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.core.tests.internal.resource.JptJpaCoreResourceModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar}"/> </ant> </target> <target name="suite3"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.core.tests.internal.context.JptJpaCoreContextModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar}"/> </ant> </target>
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, suite3, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath
deleted file mode 100644
index 5c128f330d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.project
deleted file mode 100644
index fdaecf7d3c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.db.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 486063b88e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:49 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 1d7938bd9e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.db.tests
-Bundle-Version: 2.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.db.tests.internal.JptJpaDbTestsPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.datatools.connectivity;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.datatools.connectivity.sqm.core;bundle-version="1.0.1",
- org.eclipse.datatools.modelbase.sql;bundle-version="1.0.0",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.jpa.db.tests.internal;x-internal:=true,
- org.eclipse.jpt.jpa.db.tests.internal.platforms;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties
deleted file mode 100644
index d27ab8f407..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-################################################################################
-# Copyright (c) 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.properties
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties
deleted file mode 100644
index 242d156070..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional for Derby
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/derby/lib/derby.jar
-jars =
-
-# the JDBC URL is required for Derby
-# url = jdbc:derby:C:/derby/data/testdb;create=true
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties
deleted file mode 100644
index d6407deb25..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/mysql/mysql-connector-java-5.0.6-bin.jar
-jars =
-
-# the JDBC URL is optional for MySQL
-# url = jdbc:mysql://localhost:3306
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties
deleted file mode 100644
index 4b911b44e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc5.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:testdb
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties
deleted file mode 100644
index e67c01a28e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc5.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:XE
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties
deleted file mode 100644
index 4b911b44e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc5.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:testdb
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties
deleted file mode 100644
index 32fafe463b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/postgresql/jdbc/postgresql-8.2-505.jdbc3.jar
-jars =
-
-# the JDBC URL is optional for PostgreSQL
-# url = jdbc:postgresql
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties
deleted file mode 100644
index f72b645c52..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/sqlserver/lib/sqljdbc.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:sqlserver://localhost:1433
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties
deleted file mode 100644
index 493d5d4ad9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/sybase/lib/jconn3.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:sybase:Tds:localhost:5000
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties
deleted file mode 100644
index 2c98779595..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = JPA DB Tests
-providerName = Eclipse.org
-
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java
deleted file mode 100644
index 9d2efa4996..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-
-import junit.framework.TestCase;
-
-/**
- * These aren't tests. They are just an easy way to dump JDBC metadata to the
- * console.
- */
-@SuppressWarnings("nls")
-public class JDBCTests extends TestCase {
-
- public JDBCTests(String name) {
- super(name);
- }
-
- public void testDerby() throws Exception {
- this.dumpMetaData(DERBY);
- }
-
- public void testMySQL() throws Exception {
- this.dumpMetaData(MYSQL);
- }
-
- public void testOracle() throws Exception {
- this.dumpMetaData(ORACLE);
- }
-
- public void testPostgreSQL() throws Exception {
- this.dumpMetaData(POSTGRESQL);
- }
-
- public void testSybase() throws Exception {
- this.dumpMetaData(SYBASE);
- }
-
- protected void dumpMetaData(ConnectionConfig config) throws Exception {
- System.out.println("***** PLATFORM: " + config.platformName + " *****");
- System.out.println();
- Class.forName(config.driverClassName);
- Connection connection = DriverManager.getConnection(this.buildURL(config), config.user, config.password);
- System.out.println("CATALOGS:");
- JDBCTools.dump(connection.getMetaData().getCatalogs());
- System.out.println();
- System.out.println("SCHEMATA:");
- JDBCTools.dump(connection.getMetaData().getSchemas());
- connection.close();
- System.out.println();
- }
-
- protected String buildURL(ConnectionConfig config) {
- return "jdbc:" + config.databaseURL;
- }
-
- protected static final ConnectionConfig DERBY =
- new ConnectionConfig(
- "Derby",
- "org.apache.derby.jdbc.EmbeddedDriver",
- "derby:C:/derby/data/test",
- null,
- null
- );
-
- protected static final ConnectionConfig MYSQL =
- new ConnectionConfig(
- "MySQL",
- "com.mysql.jdbc.Driver",
- "mysql://localhost:3306",
- "root",
- "oracle"
- );
-
- protected static final ConnectionConfig ORACLE =
- new ConnectionConfig(
- "Oracle",
- "oracle.jdbc.OracleDriver",
- "oracle:thin:@localhost:1521:orcl",
- "scott",
- "tiger"
- );
-
- protected static final ConnectionConfig POSTGRESQL =
- new ConnectionConfig(
- "PostgreSQL",
- "org.postgresql.Driver",
- "postgresql:postgres",
- "postgres",
- "oracle"
- );
-
- // the Sybase server must be configured explicitly to "localhost"
- // in the config file [SYBASE]/ini/sql.ini
- protected static final ConnectionConfig SYBASE =
- new ConnectionConfig(
- "Sybase",
- "com.sybase.jdbc3.jdbc.SybDriver",
- "sybase:Tds:localhost:5000",
- "sa",
- "oracle"
- );
-
- protected static class ConnectionConfig {
- protected final String platformName;
- protected final String driverClassName;
- protected final String databaseURL;
- protected final String user;
- protected final String password;
- protected ConnectionConfig(
- String platformName,
- String driverClassName,
- String databaseURL,
- String user,
- String password
- ) {
- super();
- this.platformName = platformName;
- this.driverClassName = driverClassName;
- this.databaseURL = databaseURL;
- this.user = user;
- this.password = password;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java
deleted file mode 100644
index 4f8d879705..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jpt.common.utility.internal.iterators.ResultSetIterator;
-
-@SuppressWarnings("nls")
-public class JDBCTools {
-
- public static void dump(Connection connection, String sql) throws SQLException {
- dump(execute(connection, sql));
- }
-
- public static void dump(ResultSet resultSet) throws SQLException {
- PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- dumpOn(resultSet, pw);
- }
- pw.flush();
- }
-
- public static void dumpOn(ResultSet resultSet, PrintWriter pw) throws SQLException {
- ArrayList<HashMap<String, Object>> maps = convertToMaps(resultSet);
- for (Iterator<HashMap<String, Object>> mapStream = maps.iterator(); mapStream.hasNext(); ) {
- for (Iterator<Map.Entry<String, Object>> entryStream = mapStream.next().entrySet().iterator(); entryStream.hasNext(); ) {
- Map.Entry<String, Object> entry = entryStream.next();
- pw.print(entry.getKey());
- pw.print(" = ");
- pw.print(entry.getValue());
- pw.println();
- }
- if (mapStream.hasNext()) {
- pw.println();
- }
- }
- pw.println("total rows: " + maps.size());
- }
-
- public static ArrayList<HashMap<String, Object>> convertToMaps(Connection connection, String sql) throws SQLException {
- return convertToMaps(execute(connection, sql));
- }
-
- public static ResultSet execute(Connection connection, String sql) throws SQLException {
- Statement statement = connection.createStatement();
- statement.execute(sql);
- ResultSet resultSet = statement.getResultSet();
- statement.close();
- return resultSet;
- }
-
- public static ArrayList<HashMap<String, Object>> convertToMaps(ResultSet resultSet) throws SQLException {
- ArrayList<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
- for (Iterator<HashMap<String, Object>> stream = buildMapIterator(resultSet); stream.hasNext(); ) {
- rows.add(stream.next());
- }
- return rows;
- }
-
- public static Iterator<HashMap<String, Object>> buildMapIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<HashMap<String, Object>>(resultSet, new MapResultSetIteratorAdapter(buildColumnNames(resultSet)));
- }
-
- public static String[] buildColumnNames(ResultSet resultSet) throws SQLException {
- String[] names = new String[resultSet.getMetaData().getColumnCount()];
- for (int i = 0; i < names.length; i++) {
- names[i] = resultSet.getMetaData().getColumnName(i + 1); // NB: ResultSet index/subscript is 1-based
- }
- return names;
- }
-
- public static class MapResultSetIteratorAdapter implements ResultSetIterator.Adapter<HashMap<String, Object>> {
- private final String[] columnNames;
- public MapResultSetIteratorAdapter(String[] columnNames) {
- super();
- this.columnNames = columnNames;
- }
- public HashMap<String, Object> buildNext(ResultSet rs) throws SQLException {
- HashMap<String, Object> map = new HashMap<String, Object>(this.columnNames.length);
- for (int i = 0; i < this.columnNames.length; i++) {
- map.put(this.columnNames[i], rs.getObject(i + 1)); // NB: ResultSet index/subscript is 1-based
- }
- return map;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java
deleted file mode 100644
index 937b8c2b8c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.db.tests.internal.platforms.AllPlatformTests;
-
-/**
- * JPT DB Tests
- */
-public class JptJpaDbTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaDbTests.class.getPackage().getName());
-
- suite.addTest( AllPlatformTests.suite());
-
- return suite;
- }
-
- private JptJpaDbTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java
deleted file mode 100644
index f42832e95f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * JptJpaDbTestsPlugin
- */
-public class JptJpaDbTestsPlugin extends Plugin {
-
- // The shared instance
- private static JptJpaDbTestsPlugin INSTANCE;
-
- public static final String BUNDLE_ID = "org.eclipse.jpt.jpa.db.tests"; //$NON-NLS-1$
-
- /**
- * Returns the shared instance
- */
- public static JptJpaDbTestsPlugin instance() {
- return INSTANCE;
- }
-
- /**
- * The constructor
- */
- public JptJpaDbTestsPlugin() {
- super();
- INSTANCE = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java
deleted file mode 100644
index 042e954e6a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllPlatformTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(AllPlatformTests.class.getPackage().getName());
-
- suite.addTestSuite(DerbyTests.class);
- suite.addTestSuite(MySQLTests.class);
- suite.addTestSuite(Oracle10gTests.class);
-// suite.addTestSuite(Oracle10gXETests.class);
-// suite.addTestSuite(Oracle9iTests.class);
- suite.addTestSuite(PostgreSQLTests.class);
-// suite.addTestSuite(SQLServerTests.class);
- suite.addTestSuite(SybaseTests.class);
-
- return suite;
- }
-
- private AllPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java
deleted file mode 100644
index 6cb7b60962..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java
+++ /dev/null
@@ -1,1030 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.net.URL;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.datatools.connectivity.ConnectionProfileException;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
-import org.eclipse.datatools.connectivity.drivers.IPropertySet;
-import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
-import org.eclipse.datatools.connectivity.drivers.XMLFileManager;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.common.utility.IndentingPrintWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ResultSetIterator;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ConnectionProfileFactory;
-import org.eclipse.jpt.jpa.db.ConnectionProfileListener;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.db.tests.internal.JptJpaDbTestsPlugin;
-
-/**
- * Base class for testing DTP wrappers on various databases.
- */
-@SuppressWarnings("nls")
-public abstract class DTPPlatformTests extends TestCase {
-
- /**
- * The platform properties are loaded from a Java properties file in the
- * 'org.eclipse.jpt.jpa.db.tests/config' directory. Each database platform has
- * its own properties file (e.g. 'derby.properties').
- */
- private Properties platformProperties;
-
- /**
- * This is the Dali connection profile wrapper.
- */
- protected ConnectionProfile connectionProfile;
-
-
- // ********** constants **********
-
- private static final String PLATFORM_CONFIG_DIRECTORY = "config";
-
- private static final String DB_USER_ID_PROPERTY = "userID";
- private static final String DB_USER_ID_DEFAULT = "user";
-
- private static final String DB_PASSWORD_PROPERTY = "password";
- private static final String DB_PASSWORD_DEFAULT = "";
-
- private static final String DB_DRIVER_JARS_PROPERTY = "jars";
- // required - no default
-
- private static final String DB_URL_PROPERTY = "url";
- // required - no default
-
-
-
- // ********** constructor **********
-
- protected DTPPlatformTests(String name) {
- super(name);
- }
-
-
- // ********** set-up/tear-down **********
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.platformProperties = this.loadPlatformProperties();
- this.buildDTPDriverDefinitionFile();
- this.buildDTPConnectionProfile();
- this.connectionProfile = this.getConnectionProfileFactory().buildConnectionProfile(this.getProfileName(), DatabaseIdentifierAdapter.Default.instance());
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.connectionProfile = null;
- this.platformProperties = null;
-
- super.tearDown();
- }
-
- // ***** platform properties file
- private Properties loadPlatformProperties() throws IOException {
- Properties p = new Properties();
- p.load(this.buildPlatformPropertiesFileURL().openStream());
- return p;
- }
-
- private URL buildPlatformPropertiesFileURL() {
- return Platform.getBundle(this.getTestPluginBundleID()).getEntry(this.getPlatformPropertiesFilePath());
- }
-
- private String getTestPluginBundleID() {
- return JptJpaDbTestsPlugin.BUNDLE_ID;
- }
-
- private String getPlatformPropertiesFilePath() {
- return this.getPlatformPropertiesDirectoryName() + '/' + this.getPlatformPropertiesFileName();
- }
-
- private String getPlatformPropertiesDirectoryName() {
- return PLATFORM_CONFIG_DIRECTORY;
- }
-
- /**
- * Each database platform has a separate properties file in the 'config'
- * directory that must be customized by whomever is executing the tests.
- */
- protected abstract String getPlatformPropertiesFileName();
-
- // ***** driver definition file
- private void buildDTPDriverDefinitionFile() throws CoreException {
- XMLFileManager.setStorageLocation(this.getDTPDriverDefinitionLocation());
- XMLFileManager.setFileName(this.getDTPDriverFileName());
-
- IPropertySet[] sets = XMLFileManager.loadPropertySets();
- for (IPropertySet set : sets) {
- if (set.getID().equals(this.getDriverDefinitionID())) {
- return; // property sets live across tests
- }
- }
-
- XMLFileManager.saveNamedPropertySet(this.buildDTPDriverDefinitionPropertySets());
-
- // verify the file was created:
- File driverDefinitioneFile = this.getDTPDriverDefinitionLocation().append(this.getDTPDriverFileName()).toFile();
- assertTrue(driverDefinitioneFile.exists());
- }
-
- private IPath getDTPDriverDefinitionLocation() {
- return ConnectivityPlugin.getDefault().getStateLocation();
- }
-
- private String getDTPDriverFileName() {
- return IDriverMgmtConstants.DRIVER_FILE;
- }
-
- private IPropertySet[] buildDTPDriverDefinitionPropertySets() {
- IPropertySet[] propertySets = new IPropertySet[1];
- PropertySetImpl propertySet = new PropertySetImpl(this.getDriverName(), this.getDriverDefinitionID());
- propertySet.setProperties(this.getDriverDefinitionID(), this.buildDTPDriverDefinitionProperties());
- propertySets[0] = propertySet;
- return propertySets;
- }
-
- protected abstract String getDriverName();
-
- protected abstract String getDriverDefinitionID();
-
- private Properties buildDTPDriverDefinitionProperties() {
- Properties p = new Properties();
- p.setProperty(ConnectionProfile.DRIVER_DEFINITION_TYPE_PROP_ID, this.getDriverDefinitionType());
- p.setProperty(ConnectionProfile.DRIVER_JAR_LIST_PROP_ID, this.getJDBCDriverJarList());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.getDatabaseVendor());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.getDatabaseVersion());
- p.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.getDriverClass());
- p.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, this.getJDBCURL());
- p.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, this.getUserID());
- p.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, this.getPassword());
- return p;
- }
-
- protected abstract String getDriverDefinitionType();
-
- /**
- * The JAR list is workspace-specific and is set in the properties file.
- */
- private String getJDBCDriverJarList() {
- return this.getRequiredPlatformProperty(DB_DRIVER_JARS_PROPERTY);
- }
-
- protected abstract String getDatabaseVendor();
-
- protected abstract String getDatabaseVersion();
-
- protected abstract String getDriverClass();
-
- /**
- * The database URL is workspace-specific and is set in the properties file
- * for some databases.
- */
- private String getJDBCURL() {
- return this.platformProperties.getProperty(DB_URL_PROPERTY, this.getDefaultJDBCURL());
- }
-
- protected String getDefaultJDBCURL() {
- return "";
- }
-
- /**
- * The user ID is optional and can be set in the properties file.
- */
- protected String getUserID() {
- return this.platformProperties.getProperty(DB_USER_ID_PROPERTY, DB_USER_ID_DEFAULT);
- }
-
- /**
- * The password is optional and can be set in the properties file.
- */
- private String getPassword() {
- return this.platformProperties.getProperty(DB_PASSWORD_PROPERTY, DB_PASSWORD_DEFAULT);
- }
-
- // ***** DTP connection profile
- private void buildDTPConnectionProfile() throws ConnectionProfileException {
- if (this.getDTPProfileManager().getProfileByName(this.getProfileName()) != null) {
- return; // profiles live across tests
- }
- this.createProfile(this.getProfileName());
- assertNotNull(this.getDTPProfileManager().getProfileByName(this.getProfileName()));
- }
-
- protected void createProfile(String profileName) throws ConnectionProfileException {
- this.getDTPProfileManager().createProfile(
- profileName,
- this.getProfileDescription(),
- this.getProviderID(),
- this.buildDTPConnectionProfileProperties()
- );
- }
-
- protected abstract String getProfileName();
-
- protected abstract String getProfileDescription();
-
- protected String getProviderID() {
- return ConnectionProfile.CONNECTION_PROFILE_TYPE;
- }
-
- protected Properties buildDTPConnectionProfileProperties() {
- Properties p = new Properties();
- p.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, this.getUserID());
- p.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, this.getPassword());
- p.setProperty(ConnectionProfile.DRIVER_DEFINITION_PROP_ID, this.getDriverDefinitionID());
-
- p.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.getDriverClass());
- p.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, this.getJDBCURL());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.getDatabaseVendor());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.getDatabaseVersion());
-
- p.setProperty(ConnectionProfile.DATABASE_SAVE_PWD_PROP_ID, this.passwordIsSaved());
- return p;
- }
-
- private String passwordIsSaved() {
- return "true";
- }
-
-
- // ********** tests **********
-
- public void testConnectionProfileListener() throws ConnectionProfileException {
- TestConnectionProfileListener listener = new TestConnectionProfileListener();
- this.getConnectionProfileFactory().addConnectionProfileListener(listener);
-
- String cpName1 = this.getProfileName() + "1";
- this.createProfile(cpName1);
- IConnectionProfile dtpCP = this.getDTPProfileManager().getProfileByName(cpName1);
- assertNotNull(dtpCP);
-
- assertEquals(cpName1, listener.addedName);
- listener.clear();
-
- String cpName2 = this.getProfileName() + "2";
- this.getDTPProfileManager().modifyProfile(dtpCP, cpName2, null);
- assertEquals(cpName1, listener.renamedOldName);
- assertEquals(cpName2, listener.renamedNewName);
- listener.clear();
-
- ConnectionProfile cp = this.getConnectionProfileFactory().buildConnectionProfile(cpName2);
- assertNotNull(cp);
-
- this.getDTPProfileManager().deleteProfile(dtpCP);
- assertEquals(cpName2, listener.removedName);
- listener.clear();
-
- cp = this.getConnectionProfileFactory().buildConnectionProfile(cpName2);
- assertNull(cp);
-
- this.getConnectionProfileFactory().removeConnectionProfileListener(listener);
- }
-
- public void testName() {
- assertEquals(this.getProfileName(), this.connectionProfile.getName());
- }
-
- public void testConnection() throws Exception {
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- this.connectionProfile.connect();
- assertTrue(this.connectionProfile.isActive());
- assertTrue(this.connectionProfile.isConnected());
-
- this.verifyDatabaseVersionNumber();
- this.verifyDatabaseVendor();
- this.verifyDatabaseContent();
-
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- }
-
- private void verifyDatabaseVersionNumber() {
- Database database = this.connectionProfile.getDatabase();
- assertNotNull(database);
-
- String actual = database.getVersion();
- String expected = this.getDatabaseVersion();
- String errorMessage = "expected: " + expected + " - actual: " + actual;
- // partial match is good enough
- assertTrue(errorMessage, actual.indexOf(expected) != -1);
- }
-
- private void verifyDatabaseVendor() {
- Database database = this.connectionProfile.getDatabase();
- String actual = database.getVendorName();
- String expected = this.getDatabaseVendor();
- assertEquals(expected, actual);
- }
-
- private void verifyDatabaseContent() {
- Database database = this.connectionProfile.getDatabase();
- assertTrue(database.getSchemataSize() >= 0);
-
- Schema schema = database.getDefaultSchema();
- if (schema != null) {
- if (schema.getTablesSize() > 0) {
- Table table = schema.getTables().iterator().next();
- assertTrue(table.getColumnsSize() >= 0);
- assertTrue(table.getPrimaryKeyColumnsSize() >= 0);
- assertTrue(table.getForeignKeysSize() >= 0);
- }
- }
- }
-
- protected abstract boolean executeOfflineTests();
-
- public final void testOffline() {
- if ( ! this.executeOfflineTests()) {
- return;
- }
- if ( ! this.connectionProfile.supportsWorkOfflineMode()) {
- return;
- }
-
- this.prepareForOfflineWork();
-
- IStatus status = this.connectionProfile.workOffline();
- assertTrue(status.isOK());
- assertTrue(this.connectionProfile.isActive());
- assertTrue(this.connectionProfile.isWorkingOffline());
-
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- }
-
- protected void prepareForOfflineWork() {
- if ( ! this.connectionProfile.canWorkOffline()) {
- this.connectionProfile.connect();
- IStatus status = this.connectionProfile.saveWorkOfflineData();
- assertTrue(status.isOK());
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.canWorkOffline());
- }
- }
-
- public void testConnectionListenerConnect() {
- assertTrue(this.connectionProfileHasNoListeners());
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
- assertTrue(this.connectionProfileHasAnyListeners());
-
- this.connectionProfile.connect();
- assertSame(this.connectionProfile, listener.openedProfile);
- listener.clear();
-
- this.connectionProfile.disconnect();
- assertSame(this.connectionProfile, listener.okToCloseProfile);
- assertSame(this.connectionProfile, listener.aboutToCloseProfile);
- assertSame(this.connectionProfile, listener.closedProfile);
-
- this.connectionProfile.removeConnectionListener(listener);
- assertTrue(this.connectionProfileHasNoListeners());
- }
-
- public final void testConnectionListenerOffline() {
- if ( ! this.executeOfflineTests()) {
- return;
- }
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.prepareForOfflineWork();
- listener.clear();
-
- this.connectionProfile.workOffline();
- assertSame(this.connectionProfile, listener.openedProfile);
- listener.clear();
-
- this.connectionProfile.disconnect();
- assertSame(this.connectionProfile, listener.okToCloseProfile);
- assertSame(this.connectionProfile, listener.aboutToCloseProfile);
- assertSame(this.connectionProfile, listener.closedProfile);
- listener.clear();
-
- this.connectionProfile.removeConnectionListener(listener);
- }
-
- public void testConnectionListenerDatabase() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.connectionProfile.getDatabase(), listener.changedDatabase);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testConnectionListenerCatalog() {
- this.connectionProfile.connect();
- if ( ! this.connectionProfile.getDatabase().supportsCatalogs()) {
- this.connectionProfile.disconnect();
- return;
- }
-
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // take the first catalog
- org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog = this.getFirstDTPCatalog();
- Catalog catalog = this.getCatalogNamed(dtpCatalog.getName());
- ((ICatalogObject) dtpCatalog).refresh();
- assertSame(catalog, listener.changedCatalog);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testConnectionListenerSchema() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.getDTPCatalogs();
- org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog = null;
- org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema = null;
- Schema schema = null;
- if (this.connectionProfile.getDatabase().supportsCatalogs()) {
- dtpCatalog = dtpCatalogs.get(0);
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) dtpCatalog.getSchemas().get(0);
- schema = this.getCatalogNamed(dtpCatalog.getName()).getSchemaNamed(dtpSchema.getName());
- } else {
- if (dtpCatalogs.isEmpty()) {
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) this.getDTPDatabase().getSchemas().get(0);
- schema = this.connectionProfile.getDatabase().getSchemaNamed(dtpSchema.getName());
- } else {
- dtpCatalog = dtpCatalogs.get(0); // should be the "virtual" catalog
- assertEquals("", dtpCatalog.getName());
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) dtpCatalog.getSchemas().get(0);
- // the schemata are held directly by the database in this situation
- schema = this.getDatabase().getSchemaNamed(dtpSchema.getName());
- }
- }
- assertTrue(schema.getTablesSize() >= 0); // force tables to be loaded
- ((ICatalogObject) dtpSchema).refresh();
- assertSame(schema, listener.changedSchema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSupportsCatalogs() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- boolean supportsCatalogs = this.supportsCatalogs();
- assertEquals(supportsCatalogs, this.connectionProfile.getDatabase().supportsCatalogs());
- if (supportsCatalogs) {
- assertTrue(this.connectionProfile.getDatabase().getCatalogsSize() > 0);
- assertEquals(0, this.connectionProfile.getDatabase().getSchemataSize());
- } else {
- assertEquals(0, this.connectionProfile.getDatabase().getCatalogsSize());
- assertTrue(this.connectionProfile.getDatabase().getSchemataSize() > 0);
- }
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- protected abstract boolean supportsCatalogs();
-
-// public void testDEBUG() throws Exception {
-// this.connectionProfile.connect();
-// this.dumpJDBCCatalogs();
-// this.dumpJDBCSchemata();
-// this.dumpDatabaseContainers();
-// this.connectionProfile.disconnect();
-// }
-
-
- // ********** convenience methods **********
-
- protected ConnectionProfileFactory getConnectionProfileFactory() {
- return JptJpaDbPlugin.getConnectionProfileFactory();
- }
-
- protected ConnectionProfile getConnectionProfile() {
- return this.connectionProfile;
- }
-
- protected Database getDatabase() {
- return this.connectionProfile.getDatabase();
- }
-
- protected Catalog getDefaultCatalog() {
- return this.getDatabase().getDefaultCatalog();
- }
-
- /**
- * only valid on databases that do not support catalogs
- */
- protected Schema getDefaultSchema() {
- return this.getDatabase().getDefaultSchema();
- }
-
- protected Catalog getCatalogNamed(String catalogName) {
- return this.connectionProfile.getDatabase().getCatalogNamed(catalogName);
- }
-
- protected String getRequiredPlatformProperty(String propertyKey) {
- String propertyValue = this.platformProperties.getProperty(propertyKey);
- if (StringTools.stringIsEmpty(propertyValue)) {
- throw new IllegalArgumentException("The database platform properties file '" + this.getPlatformPropertiesFilePath()
- + "' is missing a value for the property '" + propertyKey + "'.");
- }
- return propertyValue;
- }
-
- protected boolean connectionProfileHasAnyListeners() {
- return connectionProfileHasAnyListeners(this.connectionProfile);
- }
-
- protected static boolean connectionProfileHasAnyListeners(ConnectionProfile cp) {
- return ((Boolean) ReflectionTools.executeMethod(cp, "hasAnyListeners")).booleanValue();
- }
-
- protected boolean connectionProfileHasNoListeners() {
- return connectionProfileHasNoListeners(this.connectionProfile);
- }
-
- protected static boolean connectionProfileHasNoListeners(ConnectionProfile cp) {
- return ((Boolean) ReflectionTools.executeMethod(cp, "hasNoListeners")).booleanValue();
- }
-
-
- // ********** DTP model **********
-
- protected ProfileManager getDTPProfileManager() {
- return ProfileManager.getInstance();
- }
-
- protected IConnectionProfile getDTPConnectionProfile() {
- return getDTPConnectionProfile(this.connectionProfile);
- }
-
- protected static IConnectionProfile getDTPConnectionProfile(ConnectionProfile cp) {
- return (IConnectionProfile) ReflectionTools.getFieldValue(cp, "dtpConnectionProfile");
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase() {
- return getDTPDatabase(this.connectionProfile.getDatabase());
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase(Database database) {
- return (org.eclipse.datatools.modelbase.sql.schema.Database) ReflectionTools.getFieldValue(database, "dtpDatabase");
- }
-
- @SuppressWarnings("unchecked")
- protected List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.getDTPDatabase().getCatalogs();
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Catalog getFirstDTPCatalog() {
- return this.getDTPCatalogs().get(0);
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Catalog getDTPCatalogNamed(String name) {
- return getDTPCatalog(this.getDatabase().getCatalogNamed(name));
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Catalog getDTPCatalog(Catalog catalog) {
- return (org.eclipse.datatools.modelbase.sql.schema.Catalog) ReflectionTools.getFieldValue(catalog, "dtpCatalog");
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Schema getDTPSchemaNamed(String name) {
- return getDTPSchema(this.getDatabase().getSchemaNamed(name));
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Schema getDTPSchema(Schema schema) {
- return (org.eclipse.datatools.modelbase.sql.schema.Schema) ReflectionTools.getFieldValue(schema, "dtpSchema");
- }
-
-
- // ********** execute SQL **********
-
- /**
- * ignore any errors (useful for dropping database objects that might
- * not be there)
- */
- protected void executeUpdateIgnoreErrors(String sql) {
- try {
- this.executeUpdate(sql);
- } catch (Exception ex) {
-// System.err.println("SQL: " + sql);
-// ex.printStackTrace();
- }
- }
-
- protected void executeUpdate(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- try {
- jdbcStatement.executeUpdate(sql);
- } finally {
- jdbcStatement.close();
- }
- }
-
- protected void dump(String sql) throws SQLException {
- this.dump(sql, 30);
- }
-
- protected void dump(String sql, int columnWidth) throws SQLException {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpOn(sql, pw, columnWidth);
- }
- pw.flush();
- }
-
- protected void dumpOn(String sql, IndentingPrintWriter pw, int columnWidth) throws SQLException {
- pw.println(sql);
- for (HashMap<String, Object> row : this.execute(sql)) {
- for (Map.Entry<String, Object> field : row.entrySet()) {
- StringTools.padOrTruncateOn(String.valueOf(field.getKey()), columnWidth/2, pw);
- pw.print('=');
- StringTools.padOrTruncateOn(String.valueOf(field.getValue()), columnWidth/2, pw);
- pw.print(' ');
- }
- pw.println();
- }
- }
-
- protected ArrayList<HashMap<String, Object>> execute(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- jdbcStatement.execute(sql);
- ArrayList<HashMap<String, Object>> rows = this.buildRows(jdbcStatement.getResultSet());
- jdbcStatement.close();
- return rows;
- }
-
- protected ArrayList<HashMap<String, Object>> buildRows(ResultSet resultSet) throws SQLException {
- ArrayList<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
- CollectionTools.addAll(rows, this.buildResultSetIterator(resultSet));
- return rows;
- }
-
- protected Iterator<HashMap<String, Object>> buildResultSetIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<HashMap<String, Object>>(resultSet, new MapResultSetIteratorAdapter(resultSet.getMetaData()));
- }
-
- public static class MapResultSetIteratorAdapter
- implements ResultSetIterator.Adapter<HashMap<String, Object>>
- {
- private final int columnCount;
- private final String[] columnNames;
- public MapResultSetIteratorAdapter(ResultSetMetaData rsMetaData) throws SQLException {
- super();
- this.columnCount = rsMetaData.getColumnCount();
- this.columnNames = new String[this.columnCount + 1]; // leave zero slot empty
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- this.columnNames[i] = rsMetaData.getColumnName(i);
- }
- }
- public HashMap<String, Object> buildNext(ResultSet rs) throws SQLException {
- HashMap<String, Object> row = new HashMap<String, Object>(this.columnCount);
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- row.put(this.columnNames[i], rs.getObject(i));
- }
- return row;
- }
- }
-
- protected Statement createJDBCStatement() throws SQLException {
- return this.getJDBCConnection().createStatement();
- }
-
- protected Connection getJDBCConnection() {
- return this.connectionProfile.getJDBCConnection();
- }
-
- protected DatabaseMetaData getDatabaseMetaData() throws SQLException {
- return this.getJDBCConnection().getMetaData();
- }
-
-
- // ********** dump DTP metadata **********
-
- /**
- * dump all the database metadata to the console
- */
- protected void dumpDatabase() {
- this.dumpDatabase(true);
- }
-
- /**
- * dump the database catalogs and schemata to the console
- */
- protected void dumpDatabaseContainers() {
- this.dumpDatabase(false);
- }
-
- protected void dumpDatabase(boolean deep) {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpDatabaseOn(pw, deep);
- }
- pw.flush();
- }
-
- protected void dumpDatabaseOn(IndentingPrintWriter pw, boolean deep) {
- Database database = this.connectionProfile.getDatabase();
- pw.print("database: ");
- pw.println(database.getName());
- if (database.supportsCatalogs()) {
- for (Catalog catalog : database.getCatalogs()) {
- this.dumpCatalogOn(catalog, pw, deep);
- }
- } else {
- this.dumpSchemaContainerOn(database, pw, deep);
- }
- }
-
- protected void dumpCatalogOn(Catalog catalog, IndentingPrintWriter pw, boolean deep) {
- pw.print("catalog: ");
- pw.println(catalog.getName());
- pw.indent();
- this.dumpSchemaContainerOn(catalog, pw, deep);
- pw.undent();
- }
-
- protected void dumpSchemaContainerOn(SchemaContainer schemaContainer, IndentingPrintWriter pw, boolean deep) {
- for (Schema schema : schemaContainer.getSchemata()) {
- this.dumpSchemaOn(schema, pw, deep);
- }
- }
-
- protected void dumpSchema(Schema schema) {
- this.dumpSchema(schema, true);
- }
-
- protected void dumpSchema(Schema schema, boolean deep) {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpSchemaOn(schema, pw, deep);
- }
- pw.flush();
- }
-
- protected void dumpSchemaOn(Schema schema, IndentingPrintWriter pw, boolean deep) {
- pw.print("schema: ");
- pw.println(schema.getName());
- if (deep) {
- pw.indent();
- for (Table table : schema.getTables()) {
- this.dumpTableOn(table, pw);
- }
- for (Sequence sequence : schema.getSequences()) {
- this.dumpSequenceOn(sequence, pw);
- }
- pw.undent();
- }
- }
-
- protected void dumpTableOn(Table table, IndentingPrintWriter pw) {
- pw.print("table: ");
- pw.println(table.getName());
- pw.indent();
- for (Column column : table.getColumns()) {
- this.dumpColumnOn(column, pw);
- }
- for (ForeignKey foreignKey : table.getForeignKeys()) {
- this.dumpForeignKeyOn(foreignKey, pw);
- }
- pw.undent();
- }
-
- protected void dumpColumnOn(Column column, IndentingPrintWriter pw) {
- pw.print("column: ");
- pw.print(column.getName());
- pw.print(" : ");
- pw.print(column.getDataTypeName());
- if (column.isPartOfPrimaryKey()) {
- pw.print(" [primary key]");
- }
- pw.println();
- }
-
- protected void dumpForeignKeyOn(ForeignKey foreignKey, IndentingPrintWriter pw) {
- pw.print("foreign key: ");
- pw.print(foreignKey.getName());
- pw.print("=>");
- pw.print(foreignKey.getReferencedTable().getName());
- pw.print(" (");
- for (Iterator<ForeignKey.ColumnPair> stream = foreignKey.getColumnPairs().iterator(); stream.hasNext(); ) {
- ForeignKey.ColumnPair cp = stream.next();
- pw.print(cp.getBaseColumn().getName());
- pw.print("=>");
- pw.print(cp.getReferencedColumn().getName());
- if (stream.hasNext()) {
- pw.print(", ");
- }
- }
- pw.print(')');
- pw.println();
- }
-
- protected void dumpSequenceOn(Sequence sequence, IndentingPrintWriter pw) {
- pw.print("sequence: ");
- pw.println(sequence.getName());
- }
-
-
- // ********** dump JDBC metadata **********
-
- protected void dumpJDBCCatalogs() throws SQLException {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpJDBCCatalogsOn(pw);
- }
- pw.flush();
- }
-
- protected void dumpJDBCCatalogsOn(IndentingPrintWriter pw) throws SQLException {
- pw.println("JDBC catalogs: ");
- pw.indent();
- ArrayList<HashMap<String, Object>> rows = this.buildRows(this.getDatabaseMetaData().getCatalogs());
- for (Iterator<HashMap<String, Object>> stream = rows.iterator(); stream.hasNext(); ) {
- HashMap<String, Object> row = stream.next();
- pw.println(row.get("TABLE_CAT"));
- }
- pw.undent();
- }
-
- protected void dumpJDBCSchemata() throws SQLException {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpJDBCSchemataOn(pw);
- }
- pw.flush();
- }
-
- protected void dumpJDBCSchemataOn(IndentingPrintWriter pw) throws SQLException {
- pw.println("JDBC schemata: ");
- pw.indent();
- ArrayList<HashMap<String, Object>> rows = this.buildRows(this.getDatabaseMetaData().getSchemas());
- for (HashMap<String, Object> row : rows) {
- if (row.size() == 2) { // catalogs were added in jdk 1.4
- Object catalog = row.get("TABLE_CATALOG");
- pw.print(catalog);
- pw.print('.');
- }
- Object schema = row.get("TABLE_SCHEM");
- pw.println(schema);
- }
- pw.undent();
- }
-
-
- // ********** connection profile listener **********
-
- protected static class TestConnectionProfileListener implements ConnectionProfileListener {
- public String addedName;
- public String removedName;
- public String renamedOldName;
- public String renamedNewName;
-
- public void connectionProfileAdded(String name) {
- this.addedName = name;
- }
- public void connectionProfileRemoved(String name) {
- this.removedName = name;
- }
- public void connectionProfileRenamed(String oldName, String newName) {
- this.renamedOldName = oldName;
- this.renamedNewName = newName;
- }
- public void clear() {
- this.addedName = null;
- this.removedName = null;
- this.renamedOldName = null;
- this.renamedNewName = null;
- }
- }
-
-
- // ********** connection listener **********
-
- protected static class TestConnectionListener implements ConnectionListener {
- public ConnectionProfile openedProfile;
- public ConnectionProfile modifiedProfile;
- public ConnectionProfile okToCloseProfile;
- public ConnectionProfile aboutToCloseProfile;
- public ConnectionProfile closedProfile;
- public Database changedDatabase;
- public Catalog changedCatalog;
- public Schema changedSchema;
- public Sequence changedSequence;
- public Table changedTable;
- public Column changedColumn;
- public ForeignKey changedForeignKey;
-
- public void opened(ConnectionProfile profile) {
- this.openedProfile = profile;
- }
- public void modified(ConnectionProfile profile) {
- this.modifiedProfile = profile;
- }
- public boolean okToClose(ConnectionProfile profile) {
- this.okToCloseProfile = profile;
- return true;
- }
- public void aboutToClose(ConnectionProfile profile) {
- this.aboutToCloseProfile = profile;
- }
- public void closed(ConnectionProfile profile) {
- this.closedProfile = profile;
- }
- public void databaseChanged(ConnectionProfile profile, Database database) {
- this.changedDatabase = database;
- }
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- this.changedCatalog = catalog;
- }
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- this.changedSchema = schema;
- }
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- this.changedSequence = sequence;
- }
- public void tableChanged(ConnectionProfile profile, Table table) {
- this.changedTable = table;
- }
- public void columnChanged(ConnectionProfile profile, Column column) {
- this.changedColumn = column;
- }
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- this.changedForeignKey = foreignKey;
- }
- public void clear() {
- this.openedProfile = null;
- this.modifiedProfile = null;
- this.okToCloseProfile = null;
- this.aboutToCloseProfile = null;
- this.closedProfile = null;
- this.changedDatabase = null;
- this.changedCatalog = null;
- this.changedSchema = null;
- this.changedSequence = null;
- this.changedTable = null;
- this.changedColumn = null;
- this.changedForeignKey = null;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java
deleted file mode 100644
index 4dd8792c63..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class DerbyTests extends DTPPlatformTests {
-
- public DerbyTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "derby.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.derby101.genericDriverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Derby";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10.1";
- }
-
- @Override
- protected String getDriverClass() {
- return "org.apache.derby.jdbc.EmbeddedDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Derby_10.1_Embedded";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Derby 10.1 Embedded JDBC Profile [Test]";
- }
-
- @Override
- protected String getProviderID() {
- return "org.eclipse.datatools.connectivity.db.derby.embedded.connectionProfile";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- return true;
- }
-
- public void testSchema() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("TEST1");
- this.dropSchema("TEST2");
-
- this.executeUpdate("CREATE SCHEMA TEST1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema1 = this.getDatabase().getSchemaNamed("TEST1");
- assertNotNull(schema1);
-
- this.executeUpdate("CREATE SCHEMA TEST2");
- Schema schema2 = this.getDatabase().getSchemaNamed("TEST2");
- assertNull(schema2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- schema2 = this.getDatabase().getSchemaNamed("TEST2");
- assertNotNull(schema2);
- assertNotSame(schema1, this.getDatabase().getSchemaNamed("TEST1")); // we should have a new schema after the refresh
-
- this.dropSchema("TEST2");
- this.dropSchema("TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- this.executeUpdate("CREATE SCHEMA LOOKUP_TEST");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNotNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("LOOKUP_TEST");
-
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNotNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("\"lookup_TEST\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaIdentifier() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA lookup_test"); // this gets folded to uppercase
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST");
- assertEquals("LOOKUP_TEST", schema.getIdentifier());
- assertEquals("LOOKUP_TEST", schema.getIdentifier("LookupTest"));
- assertNull(schema.getIdentifier("Lookup_Test"));
-
- schema = this.getDatabase().getSchemaForIdentifier("lookup_test");
- assertEquals("LOOKUP_TEST", schema.getIdentifier());
-
- schema = this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\"");
- assertEquals("\"lookup_TEST\"", schema.getIdentifier());
- assertEquals("\"lookup_TEST\"", schema.getIdentifier("lookup_TEST"));
-
- this.dropSchema("\"lookup_TEST\"");
- this.dropSchema("LOOKUP_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET SCHEMA = TABLE_TEST");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaNamed("TABLE_TEST");
-
- // FOO
- Table fooTable = schema.getTableNamed("FOO");
- assertEquals(4, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("ID", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("ID");
- assertSame(pkColumn, idColumn);
- assertEquals("INTEGER", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("NAME");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertEquals(20, nameColumn.getLength());
- assertFalse(nameColumn.isPartOfPrimaryKey());
- assertFalse(nameColumn.isNumeric());
- assertTrue(nameColumn.isNullable());
-
- Column barColumn = fooTable.getColumnNamed("BAR_ID");
- assertEquals("INTEGER", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- Column salaryColumn = fooTable.getColumnNamed("SALARY");
- assertEquals("DECIMAL", salaryColumn.getDataTypeName());
- assertTrue(salaryColumn.isNullable());
- assertTrue(salaryColumn.isNumeric());
- assertEquals(11, salaryColumn.getPrecision());
- assertEquals(2, salaryColumn.getScale());
- assertEquals(-1, salaryColumn.getLength());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("BAR", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("BAR");
- assertEquals(3, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("ID", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
-
- Column id2Column = barTable.getColumnNamed("ID2");
- assertEquals("INTEGER", id2Column.getDataTypeName());
-// assertTrue(id2Column.isPartOfUniqueConstraint()); // doesn't work(?)
- assertFalse(id2Column.isNullable());
- assertTrue(id2Column.isNumeric());
- assertEquals(0, id2Column.getPrecision()); // not sure what to expect here...
- assertEquals(0, id2Column.getScale()); // not sure what to expect here either...
- assertEquals("BLOB", barTable.getColumnNamed("CHUNK").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnNamed("CHUNK").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnNamed("CHUNK").isLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // BAZ
- Table bazTable = schema.getTableNamed("BAZ");
- Column nicknameColumn = bazTable.getColumnNamed("NICKNAME");
- assertEquals(20, nicknameColumn.getLength());
-// assertTrue(nicknameColumn.isPartOfUniqueConstraint()); // doesn't work(?)
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("FOO_BAZ");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("FOO_ID").isPartOfForeignKey());
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAR (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" ID2 INT UNIQUE NOT NULL,").append(CR);
- sb.append(" CHUNK BLOB(100K)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" NAME VARCHAR(20),").append(CR);
- sb.append(" SALARY DECIMAL(11, 2),").append(CR);
- sb.append(" BAR_ID INT REFERENCES BAR(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAZ (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" NICKNAME VARCHAR(20) NOT NULL UNIQUE").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO_BAZ (").append(CR);
- sb.append(" FOO_ID INT REFERENCES FOO(ID),").append(CR);
- sb.append(" BAZ_ID INT REFERENCES BAZ(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("COLUMN_TEST", "test");
- this.dropSchema("COLUMN_TEST");
-
- this.executeUpdate("CREATE SCHEMA COLUMN_TEST");
- this.executeUpdate("SET SCHEMA = COLUMN_TEST");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id INTEGER, name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID INTEGER, NAME VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id INTEGER, Name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" INTEGER, \"Name\" VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("COLUMN_TEST", "test");
- this.dropSchema("COLUMN_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST1");
- this.executeUpdate("SET SCHEMA = XREF_TEST1");
- this.executeUpdate("CREATE TABLE ORG (ID INTEGER PRIMARY KEY, NAME VARCHAR(20))");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST2");
- this.executeUpdate("SET SCHEMA = XREF_TEST2");
- this.executeUpdate("CREATE TABLE EMP (ID INTEGER PRIMARY KEY, NAME VARCHAR(20), " +
- "ORG_ID INTEGER REFERENCES XREF_TEST1.ORG(ID))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Schema schema1 = this.getDatabase().getSchemaNamed("XREF_TEST1");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("ORG");
- assertNotNull(orgTable);
-
- Schema schema2 = this.getDatabase().getSchemaNamed("XREF_TEST2");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("EMP");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("ORG", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("ORG_ID", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("ID", refColumn.getName());
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.getDatabase().getSchemaForIdentifier(schemaName);
- if (schema != null) {
- if (schema.getTableForIdentifier(tableName) != null) {
- this.executeUpdate("DROP TABLE " + schemaName + '.' + tableName);
- }
- }
- }
-
- /**
- * NB: A Derby schema must be empty before it can be dropped.
- */
- private void dropSchema(String name) throws Exception {
- if (this.getDatabase().getSchemaForIdentifier(name) != null) {
- this.executeUpdate("DROP SCHEMA " + name + " RESTRICT");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java
deleted file mode 100644
index e35b7e7fca..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * MySQL
- *
- * Notes:<ul>
- * <li>We can only get database objects from the database associated with our
- * connection profile.
- * <li>We can reference objects across multiple databases, so they are sorta like
- * schemas....
- * <li>Foreign keys must be defined as table-level constraints; they cannot be
- * defined as part of the column clause.
- * <li>Case-sensitivity and -folding is whacked on MySQL....
- * </ul>
- */
-@SuppressWarnings("nls")
-public class MySQLTests extends DTPPlatformTests {
-
- public MySQLTests( String name) {
- super(name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "mysql.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "MySQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.MySQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.mysql.4_1.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "MySql";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "4.1";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.mysql.jdbc.Driver";
- }
-
- @Override
- protected String getDefaultJDBCURL() {
- return "jdbc:mysql://localhost:3306";
- }
-
- @Override
- protected String getProfileName() {
- return "MySQL_4.1";
- }
-
- @Override
- protected String getProfileDescription() {
- return "MySQL 4.1 JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected Properties buildDTPConnectionProfileProperties() {
- Properties p = super.buildDTPConnectionProfileProperties();
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.getDatabaseName());
- return p;
- }
-
- private String getDatabaseName() {
- return this.getUserID(); // by convention...
- }
-
- @Override
- protected boolean executeOfflineTests() {
- return true; // seems to work...
- }
-
- public void testDatabase() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // DTP: MySQL has a single schema with the same name as the database
- Schema schema = this.getDatabase().getSchemaNamed(this.getDatabaseName());
- assertNotNull(schema);
- assertSame(this.getDefaultSchema(), schema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableNamed("foo");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- // if the tables are created with MyISAM as the backing store
- // there will be no foreign keys
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("id");
- assertSame(pkColumn, idColumn);
- assertEquals("INT", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("name");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPartOfPrimaryKey());
-
- Column barColumn = fooTable.getColumnNamed("bar_id");
- assertEquals("INT", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("bar");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BLOB", barTable.getColumnNamed("chunk").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnNamed("chunk").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnNamed("chunk").isLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("foo_baz");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("foo_id").isPartOfForeignKey());
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator");
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE bar (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" chunk BLOB").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR(20),").append(CR);
- sb.append(" bar_id INTEGER,").append(CR);
- sb.append(" CONSTRAINT BAR FOREIGN KEY (bar_id) REFERENCES bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE baz (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo_baz (").append(CR);
- sb.append(" foo_id INT,").append(CR);
- sb.append(" baz_id INT,").append(CR);
- sb.append(" FOREIGN KEY (foo_id) REFERENCES foo(id),").append(CR);
- sb.append(" FOREIGN KEY (baz_id) REFERENCES baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- /**
- * On Windows, table names get folded to lowercase by default;
- * even if the name is delimited (apparently).
- */
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("`TEST3`");
-
- this.executeUpdate("CREATE TABLE test1 (id INTEGER, name VARCHAR(20))");
- this.executeUpdate("CREATE TABLE TEST2 (id INTEGER, name VARCHAR(20))");
- this.executeUpdate("CREATE TABLE `TEST3` (id INTEGER, name VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- Table test1Table = schema.getTableForIdentifier("test1");
- assertNotNull(test1Table);
-
- // if 'lctn' is 0 (UNIX), the table name is case-sensitive
- int lctn = this.getLowerCaseTableNamesFromDatabase();
-
- String test2Identifier = (lctn == 0) ? "TEST2" : "test2";
- Table test2Table = schema.getTableForIdentifier(test2Identifier);
- assertNotNull(test2Table);
-
- String test3Identifier = (lctn == 0) ? "`TEST3`" : "`test3`";
- Table test3Table = schema.getTableForIdentifier(test3Identifier);
- assertNotNull(test3Table);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("`TEST3`");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- protected int getLowerCaseTableNamesFromDatabase() throws SQLException {
- // the underscore is a wild character on MySQL, so we need to escape it
- ArrayList<HashMap<String, Object>> rows = this.execute("show variables like 'lower\\_case\\_table\\_names'");
- Map<String, Object> row = rows.get(0);
- return Integer.valueOf((String) row.get("Value")).intValue();
- }
-
- /**
- * MySQL preserves the case of column names, delimited or not;
- * but they are <em>not</em> case-sensitive when used in SQL.
- * Delimiters are useful for reserved identifiers and special characters.
- */
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable("test");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id INTEGER, name VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- Table table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("id"));
- assertNotNull(table.getColumnNamed("name"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID INTEGER, NAME VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("ID"));
- assertNotNull(table.getColumnNamed("NAME"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id INTEGER, Name VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("Id"));
- assertNotNull(table.getColumnNamed("Name"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (`Id` INTEGER, `Name` VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("Id"));
- assertNotNull(table.getColumnNamed("Name"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- boolean quotes = this.getANSIQuotesFromDatabase();
- assertNotNull(table.getColumnForIdentifier("`Id`"));
- if (quotes) {
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- }
-
- assertNotNull(table.getColumnForIdentifier("`Name`"));
- if (quotes) {
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
- }
-
- this.dropTable("test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- protected boolean getANSIQuotesFromDatabase() throws SQLException {
- ArrayList<HashMap<String, Object>> rows = this.execute("SELECT @@SESSION.sql_mode");
- Map<String, Object> row = rows.get(0);
- String sql_mode = (String) row.get("@@SESSION.sql_mode");
- String[] modes = sql_mode.split(",");
- return Boolean.valueOf(ArrayTools.contains(modes, "ANSI_QUOTES")).booleanValue();
- }
-
- private void dropTable(String tableName) throws Exception {
- this.executeUpdate("DROP TABLE IF EXISTS " + tableName);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java
deleted file mode 100644
index c4711e8830..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import java.sql.SQLException;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class Oracle10gTests extends DTPPlatformTests {
-
- public Oracle10gTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle10g.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle10g_10.1.0.4";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle10g (10.1.0.4) JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
- public void testDatabase() throws Exception {
- if (this.connectionProfile.getUserName().toUpperCase().equals("SYS")) {
- System.out.println("skipped test: " + this.getClass() + '.' + this.getName());
- return; // SYS does not have a schema
- }
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // Oracle should have a schema with the same name as the user
- Schema schema = this.getDatabase().getSchemaForIdentifier(this.getUserID());
- assertNotNull(schema);
- assertSame(this.getDefaultSchema(), schema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableForIdentifier("foo");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("ID", pkColumn.getName());
- Column idColumn = fooTable.getColumnForIdentifier("id");
- assertSame(pkColumn, idColumn);
- assertEquals("NUMBER", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("java.math.BigDecimal", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnForIdentifier("name");
- assertEquals("VARCHAR2", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPartOfPrimaryKey());
-
- Column barColumn = fooTable.getColumnForIdentifier("bar_id");
- assertEquals("NUMBER", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("BAR", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableForIdentifier("bar");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("ID", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BLOB", barTable.getColumnForIdentifier("chunk").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnForIdentifier("chunk").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnForIdentifier("chunk").isLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableForIdentifier("foo_baz");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnForIdentifier("foo_id").isPartOfForeignKey());
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE bar (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" chunk BLOB").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR2(20),").append(CR);
- sb.append(" bar_id REFERENCES bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE baz (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR2(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo_baz (").append(CR);
- sb.append(" foo_id NUMBER(10) REFERENCES foo(id),").append(CR);
- sb.append(" baz_id NUMBER(10) REFERENCES baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("\"test3\"");
-
- this.executeUpdate("CREATE TABLE test1 (id NUMBER(10), name VARCHAR2(20))");
- this.executeUpdate("CREATE TABLE TEST2 (id NUMBER(10), name VARCHAR2(20))");
- this.executeUpdate("CREATE TABLE \"test3\" (id NUMBER(10), name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- Table test1Table = schema.getTableForIdentifier("test1");
- assertNotNull(test1Table);
- test1Table = schema.getTableForIdentifier("TEST1");
- assertNotNull(test1Table);
-
- Table test2Table = schema.getTableForIdentifier("test2");
- assertNotNull(test2Table);
- test2Table = schema.getTableForIdentifier("TEST2");
- assertNotNull(test2Table);
-
- Table test3Table = schema.getTableForIdentifier("\"test3\"");
- assertNotNull(test3Table);
- test3Table = schema.getTableForIdentifier("test3");
- assertNull(test3Table);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("\"test3\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("test");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id NUMBER(10), name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID NUMBER(10), NAME VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id NUMBER(10), Name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" NUMBER(10), \"Name\" VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- if ( ! this.connectionProfile.getUserName().toUpperCase().equals("SYS")) {
- System.out.println("skipped test: " + this.getClass() + '.' + this.getName());
- return; // SYS does not have a schema
- }
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.executeUpdateIgnoreErrors("DROP USER XREF_TEST2 CASCADE");
- this.executeUpdateIgnoreErrors("DROP USER XREF_TEST1 CASCADE");
-
- this.executeUpdate("CREATE USER XREF_TEST1 IDENTIFIED BY foo");
- this.executeUpdate("ALTER USER XREF_TEST1 QUOTA UNLIMITED ON USERS");
- this.executeUpdate("CREATE TABLE XREF_TEST1.ORG (ID NUMBER(10) PRIMARY KEY, NAME VARCHAR2(20))");
-
- this.executeUpdate("CREATE USER XREF_TEST2 IDENTIFIED BY foo");
- this.executeUpdate("ALTER USER XREF_TEST2 QUOTA UNLIMITED ON USERS");
- this.executeUpdate("GRANT ALL ON XREF_TEST1.ORG TO XREF_TEST2");
- this.executeUpdate("CREATE TABLE XREF_TEST2.EMP (ID NUMBER(10) PRIMARY KEY, NAME VARCHAR2(20), " +
- "ORG_ID NUMBER(10) REFERENCES XREF_TEST1.ORG(ID))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Schema schema1 = this.getDatabase().getSchemaNamed("XREF_TEST1");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("ORG");
- assertNotNull(orgTable);
-
- Schema schema2 = this.getDatabase().getSchemaNamed("XREF_TEST2");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("EMP");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("ORG", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("ORG_ID", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("ID", refColumn.getName());
-
- this.executeUpdate("DROP USER XREF_TEST2 CASCADE");
- this.executeUpdate("DROP USER XREF_TEST1 CASCADE");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String tableName) throws Exception {
- this.executeUpdateIgnoreErrors("DROP TABLE " + tableName + " CASCADE CONSTRAINTS");
- }
-
-// need Oracle enablement plug-in
-// public void testSequence() throws Exception {
-// this.connectionProfile.connect();
-// TestConnectionListener listener = new TestConnectionListener();
-// this.connectionProfile.addConnectionListener(listener);
-//
-// this.dropSequence("FOO_SEQ");
-//
-// this.executeUpdate("CREATE SEQUENCE FOO_SEQ");
-// ((ICatalogObject) this.getDTPDatabase()).refresh();
-//
-// Sequence sequence = this.getDatabase().getDefaultSchema().getSequenceForIdentifier("FOO");
-// assertNotNull(sequence);
-// assertEquals("FOO_SEQ", sequence.getName());
-//
-// this.dropSequence("FOO_SEQ");
-//
-// this.connectionProfile.removeConnectionListener(listener);
-// this.connectionProfile.disconnect();
-// }
-//
-// private void dropSequence(String sequenceName) throws Exception {
-// this.executeUpdateIgnoreErrors("DROP SEQUENCE " + sequenceName);
-// }
-//
- protected void dumpUserObjects() throws SQLException {
- this.dump("select * from user_objects");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java
deleted file mode 100644
index d966a9a14b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class Oracle10gXETests extends DTPPlatformTests {
-
- public Oracle10gXETests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle10gXE.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle10g_XE";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle10g XE Release 2 (10.2) JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java
deleted file mode 100644
index 102e91970d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-
-/**
- * Oracle 9i Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class Oracle9iTests extends DTPPlatformTests {
-
- public Oracle9iTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle9i.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 9i Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.9.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "9";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle9i";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle9i JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java
deleted file mode 100644
index 6e501a7942..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java
+++ /dev/null
@@ -1,486 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class PostgreSQLTests extends DTPPlatformTests {
-
- public PostgreSQLTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "postgresql.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.postgresql.postgresqlDriverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "postgres";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "8.x";
- }
-
- @Override
- protected String getDriverClass() {
- return "org.postgresql.Driver";
- }
-
- @Override
- protected String getDefaultJDBCURL() {
- // using this URL will result in the DTP database containing a single
- // catalog named "" - which, unfortunately, resembles the pseudo-catalog
- // generated by DTP for databases that do not return any catalogs via
- // JDBC metadata calls...
- return "jdbc:postgresql";
- }
-
- @Override
- protected String getProfileName() {
- return "PostgreSQL";
- }
-
- @Override
- protected String getProfileDescription() {
- return "PostgreSQL 8.2 JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // DTP does not support PostgreSQL off-line - see 226704/241558
- return false;
- }
-
- public void testSchema() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("TEST1");
- this.dropSchema("TEST2");
-
- this.executeUpdate("CREATE SCHEMA TEST1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema1 = this.getDefaultCatalog().getSchemaForIdentifier("TEST1");
- assertNotNull(schema1);
-
- this.executeUpdate("CREATE SCHEMA TEST2");
- Schema schema2 = this.getDefaultCatalog().getSchemaForIdentifier("TEST2");
- assertNull(schema2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- schema2 = this.getDefaultCatalog().getSchemaForIdentifier("TEST2");
- assertNotNull(schema2);
- assertNotSame(schema1, this.getDefaultCatalog().getSchemaForIdentifier("TEST1")); // we should have a new schema after the refresh
-
- this.dropSchema("TEST2");
- this.dropSchema("TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA LOOKUP_TEST");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("LOOKUP_TEST"));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNotNull(this.getDefaultCatalog().getSchemaNamed("lookup_test"));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_test"));
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("lookup_TEST"));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_TEST"));
-
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_test\""));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_TEST\""));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("\"LOOKUP_TEST\""));
-
- this.dropSchema("LOOKUP_TEST");
-
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("LOOKUP_TEST"));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("lookup_test"));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_test"));
-
- assertNotNull(this.getDefaultCatalog().getSchemaNamed("lookup_TEST"));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_TEST"));
-
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("\"lookup_TEST\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaIdentifier() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA lookup_test"); // this gets folded to lowercase
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultCatalog().getSchemaForIdentifier("LOOKUP_TEST");
- assertEquals("lookup_test", schema.getIdentifier());
- assertEquals("lookup_test", schema.getIdentifier("LookupTest"));
- assertNull(schema.getIdentifier("Lookup_Test"));
-
- schema = this.getDefaultCatalog().getSchemaNamed("lookup_test");
- assertEquals("lookup_test", schema.getIdentifier());
-
- schema = this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_TEST\"");
- assertEquals("\"lookup_TEST\"", schema.getIdentifier());
- assertEquals("\"lookup_TEST\"", schema.getIdentifier("lookup_TEST"));
-
- this.dropSchema("\"lookup_TEST\"");
- this.dropSchema("LOOKUP_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET search_path TO TABLE_TEST");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST");
-
- // FOO
- Table fooTable = schema.getTableForIdentifier("FOO");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnForIdentifier("ID");
- assertSame(pkColumn, idColumn);
- assertEquals("INT4", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("java.lang.Integer", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnForIdentifier("NAME");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPartOfPrimaryKey());
-
- Column barColumn = fooTable.getColumnForIdentifier("BAR_ID");
- assertEquals("INT4", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableForIdentifier("BAR");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BYTEA", barTable.getColumnForIdentifier("CHUNK").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnForIdentifier("CHUNK").getJavaTypeDeclaration());
- // assertTrue(barTable.getColumnForIdentifier("CHUNK").dataTypeIsLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableForIdentifier("FOO_BAZ");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnForIdentifier("FOO_ID").isPartOfForeignKey());
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAR (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" CHUNK bytea").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" NAME varchar(20),").append(CR);
- sb.append(" BAR_ID integer REFERENCES BAR(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAZ (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" NAME varchar(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO_BAZ (").append(CR);
- sb.append(" FOO_ID int REFERENCES FOO(ID),").append(CR);
- sb.append(" BAZ_ID int REFERENCES BAZ(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "test");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET search_path TO TABLE_TEST");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id int, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID int, NAME varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id int, Name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" int, \"Name\" varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("TABLE_TEST", "test");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST1");
- this.executeUpdate("SET search_path TO XREF_TEST1");
- this.executeUpdate("CREATE TABLE ORG (ID integer PRIMARY KEY, NAME varchar(20))");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST2");
- this.executeUpdate("SET search_path TO XREF_TEST2");
- this.executeUpdate("CREATE TABLE EMP (ID integer PRIMARY KEY, NAME varchar(20), " +
- "ORG_ID integer REFERENCES XREF_TEST1.ORG(ID))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Schema schema1 = this.getDefaultCatalog().getSchemaNamed("xref_test1");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("org");
- assertNotNull(orgTable);
-
- Schema schema2 = this.getDefaultCatalog().getSchemaNamed("xref_test2");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("emp");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("org", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("org_id", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("id", refColumn.getName());
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.getDefaultCatalog().getSchemaForIdentifier(schemaName);
- if (schema != null) {
- if (schema.getTableForIdentifier(tableName) != null) {
- this.executeUpdate("DROP TABLE " + schemaName + '.' + tableName);
- }
- }
- }
-
- private void dropSchema(String name) throws Exception {
- if (this.getDefaultCatalog().getSchemaForIdentifier(name) != null) {
- this.executeUpdate("DROP SCHEMA " + name + " CASCADE");
- }
- }
-
-// see 241578/241557
-// public void testSequence() throws Exception {
-// this.connectionProfile.connect();
-// TestConnectionListener listener = new TestConnectionListener();
-// this.connectionProfile.addConnectionListener(listener);
-//
-// this.dropSequence("SEQUENCE_TEST", "FOO");
-// this.dropSchema("SEQUENCE_TEST");
-//
-// this.executeUpdate("CREATE SCHEMA SEQUENCE_TEST");
-// this.executeUpdate("SET search_path TO SEQUENCE_TEST");
-//
-// this.executeUpdate(this.buildBarDDL());
-// this.executeUpdate("CREATE SEQUENCE FOO START 1");
-//// List<Object[]> list = this.execute("SELECT nextval('foo')");
-//// System.out.println(list);
-// ((ICatalogObject) this.getDTPDatabase()).refresh();
-//
-// Schema schema = this.getDefaultCatalog().getSchemaNamed("SEQUENCE_TEST");
-// Sequence sequence = schema.getSequenceNamed("FOO");
-// assertNotNull(sequence);
-// assertEquals("foo_seq", sequence.getName());
-//
-// this.dropSequence("SEQUENCE_TEST", "FOO");
-// this.dropSchema("SEQUENCE_TEST");
-//
-// this.connectionProfile.removeConnectionListener(listener);
-// this.connectionProfile.disconnect();
-// }
-//
-// private void dropSequence(String schemaName, String sequenceName) throws Exception {
-// Schema schema= this.getDefaultCatalog().getSchemaNamed(schemaName);
-// if (schema != null) {
-// if (schema.getSequenceNamed(sequenceName) != null) {
-// this.executeUpdate("DROP SEQUENCE " + schemaName + '.' + sequenceName);
-// }
-// }
-// }
-//
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java
deleted file mode 100644
index 346583f282..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-
-/**
- * SQL Server 2005 Driver Test
- */
-@SuppressWarnings("nls")
-public class SQLServerTests extends DTPPlatformTests {
-
- public SQLServerTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "sqlserver.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "SQLServer";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "2005";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "SQLServer_2005";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Microsoft SQL Server 2005 JDBC Profile [Test]";
- }
-
- @Override
- protected String getProviderID() {
- return "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- return true; // haven't actually tried this yet...
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java
deleted file mode 100644
index ef91d7ab57..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class SybaseTests extends DTPPlatformTests {
-
- public SybaseTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "sybase.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Sybase JDBC Driver for Sybase ASE 15.x";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Sybase JDBC Driver for Sybase ASE 15.x";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.sybase.ase.genericDriverTemplate_15";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Sybase_ASE";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "15.x";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.sybase.jdbc3.jdbc.SybDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Sybase_15";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Sybase ASE 15 jConnect JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
- /**
- * Sybase "databases" become DTP "catalogs"
- */
- public void testCatalog() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database test1");
- this.executeUpdateIgnoreErrors("drop database test2");
-
- this.executeUpdate("create database test1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Catalog catalog1 = this.getDatabase().getCatalogNamed("test1");
- assertNotNull(catalog1);
- Schema schema1 = catalog1.getSchemaNamed("dbo");
- assertNotNull(schema1);
- assertSame(schema1, catalog1.getDefaultSchema());
-
- this.executeUpdate("create database test2");
- Catalog catalog2 = this.getDatabase().getCatalogNamed("test2");
- assertNull(catalog2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- catalog2 = this.getDatabase().getCatalogNamed("test2");
- assertNotNull(catalog2);
- Schema schema2 = catalog2.getDefaultSchema();
- assertNotNull(schema2);
-
- assertNotSame(catalog1, this.getDatabase().getCatalogNamed("test1")); // we should have a new catalog after the refresh
- assertNotSame(schema1, this.getDatabase().getCatalogNamed("test1").getDefaultSchema()); // we should have a new schema after the refresh
-
- this.executeUpdate("drop database test2");
- this.executeUpdate("drop database test1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database table_test");
- this.executeUpdate("create database table_test");
- this.getJDBCConnection().setCatalog("table_test");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getCatalogNamed("table_test").getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableNamed("foo");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("id");
- assertSame(fooTable, idColumn.getTable());
- assertSame(pkColumn, idColumn);
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertTrue(idColumn.isPartOfUniqueConstraint());
- assertFalse(idColumn.isNullable());
-
- assertEquals("INT", idColumn.getDataTypeName());
- assertTrue(idColumn.isNumeric());
- assertEquals(0, idColumn.getPrecision());
- assertEquals(0, idColumn.getScale());
- assertEquals(-1, idColumn.getLength());
- assertFalse(idColumn.isLOB());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("name");
- assertFalse(nameColumn.isPartOfPrimaryKey());
- assertFalse(nameColumn.isPartOfForeignKey());
- assertTrue(nameColumn.isPartOfUniqueConstraint());
- assertFalse(nameColumn.isNullable()); // implied "NOT NULL" ?
-
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertFalse(nameColumn.isNumeric());
- assertEquals(-1, nameColumn.getPrecision());
- assertEquals(-1, nameColumn.getScale());
- assertEquals(20, nameColumn.getLength());
- assertFalse(nameColumn.isLOB());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
-
- Column barColumn = fooTable.getColumnNamed("bar_id");
- assertEquals("INT", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("bar");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- Column chunkColumn = barTable.getColumnNamed("chunk");
- assertEquals("IMAGE", chunkColumn.getDataTypeName());
- assertFalse(chunkColumn.isNumeric());
- assertTrue(chunkColumn.isLOB());
- assertEquals("byte[]", chunkColumn.getJavaTypeDeclaration());
- assertSame(barTable, barFK.getReferencedTable());
-
- // BAZ
- Table bazTable = schema.getTableNamed("baz");
- assertEquals(4, bazTable.getColumnsSize());
- assertEquals(1, bazTable.getPrimaryKeyColumnsSize());
- assertEquals(0, bazTable.getForeignKeysSize());
-
- Column nicknameColumn = bazTable.getColumnNamed("nickname");
- assertTrue(nicknameColumn.isNullable());
-
- Column songColumn = bazTable.getColumnNamed("song");
- assertFalse(songColumn.isNullable());
-
- Column salaryColumn = bazTable.getColumnNamed("salary");
- assertFalse(salaryColumn.isPartOfUniqueConstraint());
- assertEquals("DECIMAL", salaryColumn.getDataTypeName());
- assertTrue(salaryColumn.isNumeric());
- assertEquals(10, salaryColumn.getPrecision());
- assertEquals(2, salaryColumn.getScale());
- assertEquals(-1, salaryColumn.getLength());
- assertFalse(salaryColumn.isLOB());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("foo_baz");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("foo_id").isPartOfForeignKey());
-
- this.executeUpdate("drop table foo_baz");
- this.executeUpdate("drop table baz");
- this.executeUpdate("drop table foo");
- this.executeUpdate("drop table bar");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database table_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table bar (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" chunk image").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table foo (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" name varchar(20) unique,").append(CR);
- sb.append(" bar_id integer references bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table baz (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" nickname varchar(20) null,").append(CR);
- sb.append(" song varchar(20) not null,").append(CR);
- sb.append(" salary decimal(10, 2)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table foo_baz (").append(CR);
- sb.append(" foo_id integer references foo(id),").append(CR);
- sb.append(" baz_id integer references baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database table_lookup_test");
- this.executeUpdate("create database table_lookup_test");
- this.getJDBCConnection().setCatalog("table_lookup_test");
-
- this.executeUpdate("create table test1 (id integer, name varchar(20))");
- this.executeUpdate("create table TEST2 (id integer, name varchar(20))");
- this.executeUpdate("create table [Test3] (id integer, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getCatalogNamed("table_lookup_test").getDefaultSchema();
-
- assertNotNull(schema.getTableNamed("test1"));
- assertNotNull(schema.getTableForIdentifier("test1"));
-
- assertNotNull(schema.getTableNamed("TEST2"));
- assertNotNull(schema.getTableForIdentifier("TEST2"));
-
- assertNotNull(schema.getTableForIdentifier("[Test3]"));
-
- this.executeUpdate("drop table [Test3]");
- this.executeUpdate("drop table TEST2");
- this.executeUpdate("drop table test1");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database table_lookup_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database column_lookup_test");
- this.executeUpdate("create database column_lookup_test");
- this.getJDBCConnection().setCatalog("column_lookup_test");
-
- // lowercase
- this.executeUpdate("create table test (id integer, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("id"));
- assertNotNull(table.getColumnNamed("name"));
-
- this.executeUpdate("drop table test");
-
- // uppercase
- this.executeUpdate("create table test (ID integer, NAME varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.executeUpdate("drop table test");
-
- // mixed case
- this.executeUpdate("create table test (Id integer, Name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.executeUpdate("drop table test");
-
- // delimited
- this.executeUpdate("create table test ([Id] integer, [Name] varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("[Id]"));
- assertNotNull(table.getColumnForIdentifier("[Name]"));
-
- this.executeUpdate("drop table test");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database column_lookup_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database xref_test2");
- this.executeUpdateIgnoreErrors("drop database xref_test1");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("create database xref_test1");
- this.getJDBCConnection().setCatalog("xref_test1");
- this.executeUpdate("create table org (id integer primary key, name varchar(20))");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("create database xref_test2");
- this.getJDBCConnection().setCatalog("xref_test2");
- this.executeUpdate("create table emp (id integer primary key, name varchar(20), " +
- "org_id integer references xref_test1..org(id))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Catalog catalog1 = this.getDatabase().getCatalogNamed("xref_test1");
- assertNotNull(catalog1);
- Schema schema1 = catalog1.getSchemaNamed("dbo");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("org");
- assertNotNull(orgTable);
-
- Catalog catalog2 = this.getDatabase().getCatalogNamed("xref_test2");
- assertNotNull(catalog2);
- Schema schema2 = catalog2.getSchemaNamed("dbo");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("emp");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("org", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("org_id", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("id", refColumn.getName());
-
- this.getJDBCConnection().setCatalog("xref_test2");
- this.executeUpdate("drop table emp");
- this.getJDBCConnection().setCatalog("xref_test1");
- this.executeUpdate("drop table org");
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database xref_test2");
- this.executeUpdate("drop database xref_test1");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath
deleted file mode 100644
index 3fbf40ae96..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project
deleted file mode 100644
index 0dcf45fd19..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4034685449..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:13 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index ea9d255543..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.core.tests
-Bundle-Version: 2.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.commands;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.eclipselink.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.core.tests;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.201,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.201,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.jpa.eclipselink.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties
deleted file mode 100644
index 82227ce10a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties
deleted file mode 100644
index 5b9cfcd182..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - EclipseLink Support - Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java
deleted file mode 100644
index d64454a021..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal;
-
-import java.io.File;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.JptJpaEclipseLinkCoreContextModelTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.JptJpaEclipselinkCoreResourceModelTests;
-
-/**
- * decentralize test creation code
- *
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-@SuppressWarnings("nls")
-public class JptJpaEclipseLinkCoreTests
-{
- private static final String JPA_JAR_PROPERTY = TestJpaProject.JPA_JAR_NAME_SYSTEM_PROPERTY;
- private static final String ECLIPSELINK_JAR_PROPERTY = TestJpaProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY;
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaEclipseLinkCoreTests.class.getPackage().getName());
- suite.addTest(JptJpaEclipselinkCoreResourceModelTests.suite());
- suite.addTest(JptJpaEclipseLinkCoreContextModelTests.suite());
- return suite;
- }
-
- public static boolean requiredJarsExists() {
- return jpaJarPropertyExists()
- && jpaJarFileExists()
- && eclipselinkJarPropertyExists()
- && eclipselinkJarFileExists();
- }
-
- public static boolean jpaJarPropertyExists() {
- return getSystemProperty(JPA_JAR_PROPERTY) != null;
- }
-
- public static boolean jpaJarFileExists() {
- return (new File(getSystemProperty(JPA_JAR_PROPERTY))).exists();
- }
-
- public static boolean eclipselinkJarPropertyExists() {
- return getSystemProperty(ECLIPSELINK_JAR_PROPERTY) != null;
- }
-
- public static boolean eclipselinkJarFileExists() {
- return (new File(getSystemProperty(ECLIPSELINK_JAR_PROPERTY))).exists();
- }
-
- public static String buildMissingJarErrorMessage() {
- if( ! jpaJarPropertyExists()) {
- return errorMissingProperty(JPA_JAR_PROPERTY);
- }
- else if( ! jpaJarFileExists()) {
- return errorJarFileDoesNotExist(getSystemProperty(JPA_JAR_PROPERTY));
- }
- else if( ! eclipselinkJarPropertyExists()) {
- return errorMissingProperty(ECLIPSELINK_JAR_PROPERTY);
- }
- return errorJarFileDoesNotExist(getSystemProperty(ECLIPSELINK_JAR_PROPERTY));
- }
-
- /*********** private **********/
-
- private static String errorMissingProperty(String propertyName) {
- return "missing Java system property: \"" + propertyName + "\"";
- }
-
- private static String errorJarFileDoesNotExist(String propertyValue) {
- return "JAR file doesn't exist: \"" + propertyValue + "\"";
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
- private JptJpaEclipseLinkCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java
deleted file mode 100644
index ecfe5cb6ec..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-
-public abstract class EclipseLink1_1ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- public static final String JPA_ANNOTATIONS_PACKAGE_NAME = "javax.persistence"; //$NON-NLS-1$
-
- protected EclipseLink1_1ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_1;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink1_1.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java
deleted file mode 100644
index 939a527af0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1JpaProjectTests
- extends ContextModelTestCase
-{
-
- public EclipseLink1_1JpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_1;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the orm.xml file with eclipselink 1.1 orm content type
- createDefaultOrmXmlFileWithEclipseLink1_1ContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file with eclipselink orm content type
- createDefaultOrmXmlFileWithEclipseLinkContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file this time with orm content type
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetDefaultEclipseLinkOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.1 file
- createDefaultEclipseLink1_1OrmXmlFile();
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME,
- JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLink1_1ContentType() throws Exception {
- createEclipseLink1_1OrmXmlFile(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createDefaultEclipseLink1_1OrmXmlFile() throws Exception {
- createEclipseLink1_1OrmXmlFile(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createEclipseLink1_1OrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.setProperty(JpaFileCreationDataModelProperties.VERSION, EclipseLink1_1.SCHEMA_VERSION);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.1 file
- createDefaultEclipseLink1_1OrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLink1_1OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLink1_1OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java
deleted file mode 100644
index 19d0fd251c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-
-public abstract class EclipseLink1_2ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- public static final String JPA_ANNOTATIONS_PACKAGE_NAME = "javax.persistence"; //$NON-NLS-1$
-
- protected EclipseLink1_2ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_2;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java
deleted file mode 100644
index 67272257d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_2JpaProjectTests
- extends ContextModelTestCase
-{
-
- public EclipseLink1_2JpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_2;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the orm.xml file with eclipselink 1.2 orm content type
- createDefaultOrmXmlFileWithEclipseLink1_2ContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file with eclipselink orm content type
- createDefaultOrmXmlFileWithEclipseLinkContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file this time with orm content type
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetDefaultEclipseLinkOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.2 file
- createDefaultEclipseLink1_2OrmXmlFile();
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME,
- JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLink1_2ContentType() throws Exception {
- createEclipseLink1_2OrmXmlFile(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createDefaultEclipseLink1_2OrmXmlFile() throws Exception {
- createEclipseLink1_2OrmXmlFile(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createEclipseLink1_2OrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.setProperty(JpaFileCreationDataModelProperties.VERSION, EclipseLink1_2.SCHEMA_VERSION);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.2 file
- createDefaultEclipseLink1_2OrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLink1_2OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLink1_2OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java
deleted file mode 100644
index e2967967c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-
-public abstract class EclipseLink2_0ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- protected EclipseLink2_0ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_2_0;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink2_0.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java
deleted file mode 100644
index dd6efe8e3c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-
-public abstract class EclipseLink2_3ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- protected EclipseLink2_3ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_2_3;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink2_3.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java
deleted file mode 100644
index cb38368220..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationOperation;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class EclipseLinkContextModelTestCase
- extends ContextModelTestCase
-{
- protected JpaXmlResource eclipseLinkOrmXmlResource;
-
- protected EclipseLinkContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.eclipseLinkOrmXmlResource = getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.eclipseLinkOrmXmlResource = null;
- super.tearDown();
- }
-
- @Override
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws Exception {
- TestJpaProject testJpaProject = super.buildJpaProject(projectName, autoBuild, jpaConfig);
-
- if (createEclipseLinkOrmXml()) {
- EclipseLinkOrmFileCreationOperation operation =
- new EclipseLinkOrmFileCreationOperation(buildEclipseLinkOrmConfig(testJpaProject));
- operation.execute(null, null);
- }
-
- return testJpaProject;
- }
-
- @Override
- protected boolean createOrmXml() {
- return false;
- }
-
- protected boolean createEclipseLinkOrmXml() {
- return true;
- }
-
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- testJpaProject.getProject().getFolder("src/META-INF").getFullPath()); //$NON-NLS-1$
- dataModel.setProperty(JpaFileCreationDataModelProperties.VERSION, this.getEclipseLinkSchemaVersion());
- dataModel.setProperty(OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT, Boolean.TRUE);
- return dataModel;
- }
-
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink.SCHEMA_VERSION;
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_0;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- @Override
- protected JavaEclipseLinkEntity getJavaEntity() {
- return (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- }
-
- @Override
- protected JpaXmlResource getOrmXmlResource() {
- return this.eclipseLinkOrmXmlResource;
- }
-
- @Override
- protected XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) super.getXmlEntityMappings();
- }
-
- @Override
- protected EclipseLinkEntityMappings getEntityMappings() {
- return (EclipseLinkEntityMappings) super.getEntityMappings();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java
deleted file mode 100644
index b9d5154465..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJpaProjectTests
- extends ContextModelTestCase
-{
-
- public EclipseLinkJpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected boolean createOrmXml() {
- return true;
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_0;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the orm.xml file with eclipselink orm content type
- createDefaultOrmXmlFileWithEclipseLinkContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file this time with orm content type
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetDefaultEclipseLinkOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
-
- //add the eclipselink-orm.xml file
- createDefaultEclipseLinkOrmXmlFile();
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- createEclipseLinkOrmXmlFile(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createDefaultEclipseLinkOrmXmlFile() throws Exception {
- createEclipseLinkOrmXmlFile(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createEclipseLinkOrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml file
- createDefaultEclipseLinkOrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLinkOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLinkOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java
deleted file mode 100644
index c0071318c1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.JptJpaEclipseLinkCoreTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java.JptEclipseLinkCoreJavaContextModelTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm.JptEclipseLinkCoreOrmContextModelTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence.JptEclipseLinkCorePersistenceContextModelTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-public class JptJpaEclipseLinkCoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaEclipseLinkCoreContextModelTests.class.getName());
- if(JptJpaEclipseLinkCoreTests.requiredJarsExists()) {
- suite.addTestSuite(EclipseLinkJpaProjectTests.class);
- suite.addTestSuite(EclipseLink1_1JpaProjectTests.class);
- suite.addTestSuite(EclipseLink1_2JpaProjectTests.class);
- suite.addTest(JptEclipseLinkCorePersistenceContextModelTests.suite());
- suite.addTest(JptEclipseLinkCoreJavaContextModelTests.suite());
- suite.addTest(JptEclipseLinkCoreOrmContextModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JptJpaEclipseLinkCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaEclipseLinkCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java
deleted file mode 100644
index 8ed576a31d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaCollectionTableTests extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaCollectionTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- }
- });
- }
-
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable);
-
-
- //set name in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- //set name to null in the resource model
- resourceCollectionTable.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable.getName());
-
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable3);
-
- //set name in the context model, verify resource model modified
- collectionTable.setSpecifiedName("foo");
- resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedName());
- assertEquals("foo", resourceCollectionTable3.getName());
-
- //set name to null in the context model
- collectionTable.setSpecifiedName(null);
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //add the collection table annotation, verify default collection table name is the same
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
- assertNotNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //set the entity name, verify default collection table name updates
- getJavaEntity().setSpecifiedName("Foo");
- assertEquals("Foo_projects", collectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
-
- //set schema in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- //set schema to null in the resource model
- resourceCollectionTable.setSchema(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable.getSchema());
-
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
- //set schema in the context model, verify resource model modified
- collectionTable.setSpecifiedSchema("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceCollectionTable.getSchema());
-
- //set schema to null in the context model
- collectionTable.setSpecifiedSchema(null);
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
-
- //set catalog in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the resource model
- resourceCollectionTable.setCatalog(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable.getCatalog());
-
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
- //set catalog in the context model, verify resource model modified
- collectionTable.setSpecifiedCatalog("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the context model
- collectionTable.setSpecifiedCatalog(null);
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn joinColumn = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = collectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.getJoinColumnsSize());
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.getJoinColumnsSize());
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
-
- collectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
-
- collectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableResource.addJoinColumn(0);
- joinTableResource.addJoinColumn(1);
- joinTableResource.addJoinColumn(2);
-
- joinTableResource.joinColumnAt(0).setName("FOO");
- joinTableResource.joinColumnAt(1).setName("BAR");
- joinTableResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(collectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetDefaultJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.addSpecifiedJoinColumn(0);
- assertEquals(1, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testgetUniqueConstraintsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, collectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
- collectionTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
-
- collectionTable.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- collectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java
deleted file mode 100644
index e1c0709875..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java
+++ /dev/null
@@ -1,2280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaElementCollectionMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public static final String EMBEDDABLE_TYPE_NAME = "Address";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithElementCollectionMappingWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithGenericEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddablePropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public EclipseLink2_0JavaElementCollectionMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollectionAnnotation = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollectionAnnotation.setTargetClass("newTargetClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollectionAnnotation.getTargetClass());
-
- //set target class to null in the resource model
- elementCollectionAnnotation.setTargetClass(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testDefaultTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Embeddable, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericCollection() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericCollection() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericMap() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericMap() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals("foo", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
- }
-
- protected Embeddable getResolvedTargetEmbeddable(ElementCollectionMapping2_0 mapping) {
- return (Embeddable) ReflectionTools.executeMethod(mapping, "getResolvedTargetEmbeddable");
- }
-
- public void testResolvedTargetEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target embeddable not in the persistence unit
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //add target embeddable to the persistence unit, now target embeddable should resolve
- createTestTargetEmbeddableAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testResolvedTargetEmbeddableWithBasicType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target is a basic type, so resolved target embeddable is null
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the context model
- elementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKey(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("Address");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("String");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) elementCollectionMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testGetValueColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getValueColumn().getName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getDefaultName());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state.name");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType persistentType = specifiedClassRefs.next().getJavaPersistentType();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("abbr", virtualAttributeOverride.getName());
-
- PersistentType statePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping abbrMapping = (BasicMapping) statePersistentType.getAttributeNamed("abbr").getMapping();
- abbrMapping.getColumn().setSpecifiedName("BLAH");
- abbrMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- abbrMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- abbrMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- abbrMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- abbrMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- abbrMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.state) attribute override to verify it is getting settings from the specified column on State.abbr
- virtualAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping()).getAttributeOverrideContainer().getOverrideNamed("abbr");
- assertEquals("abbr", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
- }
-
- public void testGetMapKeyColumn() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", elementCollectionMapping.getMapKeyColumn().getTable());//collection table name
-
- elementCollectionMapping.getCollectionTable().setSpecifiedName("MY_COLLECTION_TABLE");
- assertEquals("MY_COLLECTION_TABLE", elementCollectionMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- classRefs.next();
- Embeddable propertyInfoEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping parcelNumberMapping = (BasicMapping) propertyInfoEmbeddable.getPersistentType().getAttributeNamed("parcelNumber").getMapping();
- parcelNumberMapping.getColumn().setSpecifiedName("FOO1");
- parcelNumberMapping.getColumn().setSpecifiedTable("BAR1");
- parcelNumberMapping.getColumn().setColumnDefinition("COLUMN_DEF1");
- parcelNumberMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- parcelNumberMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- parcelNumberMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- parcelNumberMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("FOO1", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR1", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF1", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- parcelNumberMapping.getColumn().setSpecifiedName(null);
- parcelNumberMapping.getColumn().setSpecifiedTable(null);
- parcelNumberMapping.getColumn().setColumnDefinition(null);
- parcelNumberMapping.getColumn().setSpecifiedInsertable(null);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(null);
- parcelNumberMapping.getColumn().setSpecifiedUnique(null);
- parcelNumberMapping.getColumn().setSpecifiedNullable(null);
- parcelNumberMapping.getColumn().setSpecifiedLength(null);
- parcelNumberMapping.getColumn().setSpecifiedPrecision(null);
- parcelNumberMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(1, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(5, valueAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(6, valueAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(2, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.name");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, valueAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- valueAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("parcelNumber", valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(2, valueAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- valueAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = valueAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("parcelNumber", virtualAttributeOverrides.next().getName());
- assertEquals("size", virtualAttributeOverrides.next().getName());
- assertEquals("tax", virtualAttributeOverrides.next().getName());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<? extends AttributeOverride> specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertEquals("size", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
-
- resourceField.moveAnnotation(3, 2, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSelfReferentialElementCollection() throws Exception {
- createSelfReferentialElementCollection();
- addXmlClassRef(PACKAGE_NAME + ".Foo");
-
- //If there is a StackOverflowError you will not be able to get the mapping
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("elementCollection").getMapping();
- assertFalse(elementCollectionMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(EnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- elementCollectionMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(TemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((TemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
-
- public void testGetConvert() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, elementCollectionMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithElementCollectionMappingWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, elementCollectionMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) elementCollectionMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getConverter().getType());
-
- elementCollectionMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) elementCollectionMapping.getConverter()).setSpecifiedConverterName("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation eclipselinkConvert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
-
- assertEquals("foo", eclipselinkConvert.getValue());
-
- elementCollectionMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, elementCollectionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) elementCollectionMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getConverter().getType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java
deleted file mode 100644
index a19846c3e6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java
+++ /dev/null
@@ -1,1804 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaEntityTests extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_0JavaEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testDefaultAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testDefaultAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- JavaEntity superclass = (JavaEntity) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(3, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaAttributeOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- }
-//
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(2, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
-
- public void testOverridableAssociations() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociationsMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AssociationOverrideContainer overrideContainer = javaEntity.getAssociationOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-
- //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
- //idMapping.getColumn().setSpecifiedName("FOO");
- //idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- //idMapping.getColumn().setSpecifiedName(null);
- //idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(2, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(2, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getJavaResourceType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(true)", cu);
-
- cacheableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- getJavaPersistentType().getJavaResourceType().removeAnnotation(JPA2_0.CACHEABLE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- PersistenceUnit2_0 persistenceUnit = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testInheritedIsDefaultCacheable() throws Exception {
- createTestEntity();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity().getParentEntity()).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java
deleted file mode 100644
index 13bba73165..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,1411 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaManyToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaManyToManyMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithJoinFetchManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<AnnotationTestType> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKey(null);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKey.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("Address");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("String");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
- JavaPersistentType printQueuePersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintQueue");
- ManyToManyMapping jobsMapping = (ManyToManyMapping) printQueuePersistentType.getAttributeNamed("jobs").getMapping();
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ManyToManyMapping queuesMapping = (ManyToManyMapping) printJobPersistentType.getAttributeNamed("queues").getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable()); //the join table name
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
- manyToManyMapping.getRelationship().setStrategyToMappedBy();
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employees");
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address_" + TYPE_NAME, manyToManyMapping.getMapKeyColumn().getTable());//join table name of owning many-to-many
-
- PersistentType persistentType = getPersistenceUnit().getPersistentType("test.Address");
- ManyToManyMapping owningManyToManyMapping = (ManyToManyMapping) persistentType.getAttributeNamed("employees").getMapping();
- ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name
-
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- manyToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(TemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((TemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((TemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((TemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((TemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java
deleted file mode 100644
index 86bbce0773..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaManyToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaManyToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
-
- ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java
deleted file mode 100644
index 6dafe46d33..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,529 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaMappedSuperclassTests extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestMappedSuperclassWithReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@ReadOnly").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- public EclipseLink2_0JavaMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- public void testGetReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
- }
-
- public void testGetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- //TODO test inheriting a default readonly from you superclass
- public void testGetDefaultReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(false, readOnly.isDefaultReadOnly());
- }
-
- public void testSetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
-
- readOnly.setSpecifiedReadOnly(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(null, readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
-
- readOnly.setSpecifiedReadOnly(Boolean.TRUE);
- assertNotNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(null, readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
- }
-
- public void testSpecifiedReadOnlyUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(null, readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- resourceType.addAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- public void testGetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = mappedSuperclass.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
-
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
-
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-
-
- public void testSetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getJavaResourceType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(true)", cu);
-
- cacheableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- getJavaPersistentType().getJavaResourceType().removeAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testInheritedIsDefaultCacheable() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getSuperPersistentType().getMapping()).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java
deleted file mode 100644
index b0f79862c9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,1531 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-/**
- * EclipseLink2_0JavaOneToManyMappingTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaOneToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaOneToManyMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private AnnotationTestType employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
- private ICompilationUnit createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(orphanRemoval=false)").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY));
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToMany.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
-
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKey(null);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKey.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.String", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.String", oneToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) getJavaPersistentType().getAttributeNamed("jobs").getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- oneToManyMapping.getRelationship().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employee");
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//owing entity table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", oneToManyMapping.getMapKeyColumn().getTable());//join table name
-
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
-
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- oneToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((EnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(TemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((TemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((TemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((TemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((TemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java
deleted file mode 100644
index 093a7208a9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,814 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaOneToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaOneToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(orphanRemoval=false)");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- // this is no longer supported (it was a bit of a testing hack anyway...)
- // contextAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- // the *real* test is whether the Id annotation still results in a 1:1 mapping...
- contextAttribute.setMappingKey(null); // clear any mapping annotation
- resourceField.addAnnotation(JPA.ID); // add Id annotation
- this.getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaOneToOneMapping2_0);
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaManyToOneMapping2_0);
-
- contextAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaBasicMapping);
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(Boolean.FALSE, this.getOrphanRemovalOf(oneToOneMapping).getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE));
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToOne.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToOneMapping, persistentAttribute.getMapping());
-
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java
deleted file mode 100644
index a75b5ce43e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_3ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_3JavaMultitenancyTests extends EclipseLink2_3ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_3JavaMultitenancyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMultitenant() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.MULTITENANT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Multitenant");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTenantDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.MULTITENANT, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTenantDiscriminatorColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.MULTITENANT, EclipseLink.TENANT_DISCRIMINATOR_COLUMN, EclipseLink.TENANT_DISCRIMINATOR_COLUMNS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TenantDiscriminatorColumns({@TenantDiscriminatorColumn(name=\"foo\"), @TenantDiscriminatorColumn(name=\"bar\")})");
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"MS_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantRootEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.ENTITY,
- JPA.INHERITANCE,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritenace").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"ROOT_ENTITY_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public JavaEclipseLinkMultitenancy2_3 getJavaMultitenancy() {
- return getJavaEntity().getMultitenancy();
- }
-
- public void testGetTypeNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaMultitenancy().getType());
- }
-
- public void testGetType() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, getJavaMultitenancy().getType());
- }
-
- public void testGetSpecifiedType() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaMultitenancy().getSpecifiedType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
-
- multitenant.setValue(MultitenantType2_3.SINGLE_TABLE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, getJavaMultitenancy().getSpecifiedType());
-
- multitenant.setValue(MultitenantType2_3.TABLE_PER_TENANT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, getJavaMultitenancy().getSpecifiedType());
-
- multitenant.setValue(MultitenantType2_3.VPD);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkMultitenantType2_3.VPD, getJavaMultitenancy().getSpecifiedType());
-
- multitenant.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaMultitenancy().getSpecifiedType());
- }
-
- public void testSetSpecifiedType() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(null, getJavaMultitenancy().getSpecifiedType());
-
- getJavaMultitenancy().setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
-
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, getJavaMultitenancy().getSpecifiedType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
- assertEquals(MultitenantType2_3.SINGLE_TABLE, multitenant.getValue());
-
-
- getJavaMultitenancy().setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
-
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, getJavaMultitenancy().getSpecifiedType());
- assertEquals(MultitenantType2_3.TABLE_PER_TENANT, multitenant.getValue());
-
- getJavaMultitenancy().setSpecifiedType(EclipseLinkMultitenantType2_3.VPD);
-
- assertEquals(EclipseLinkMultitenantType2_3.VPD, getJavaMultitenancy().getSpecifiedType());
- assertEquals(MultitenantType2_3.VPD, multitenant.getValue());
- }
-//
-// public void testIsIncludeCriteria() throws Exception {
-// createTestEntityWithMultitenant();
-// addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-//
-// assertEquals(true, getJavaMultitenancy().isIncludeCriteria());
-//
-// getJavaMultitenancy().setSpecifiedIncludeCriteria(Boolean.FALSE);
-// assertEquals(false, getJavaMultitenancy().isIncludeCriteria());
-// }
-//
-// public void testGetSpecifiedIncludeCriteria() throws Exception {
-// createTestEntityWithMultitenant();
-// addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-//
-// assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
-//
-// JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
-// multitenant.setIncludeCriteria(Boolean.FALSE);
-// getJpaProject().synchronizeContextModel();
-//
-// assertEquals(Boolean.FALSE, getJavaMultitenancy().getSpecifiedIncludeCriteria());
-//
-// multitenant.setIncludeCriteria(Boolean.TRUE);
-// getJpaProject().synchronizeContextModel();
-//
-// assertEquals(Boolean.TRUE, getJavaMultitenancy().getSpecifiedIncludeCriteria());
-//
-// multitenant.setIncludeCriteria(null);
-// getJpaProject().synchronizeContextModel();
-//
-// assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
-// multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
-// assertNotNull(multitenant);
-// }
-//
-// public void testSetSpecifiedIncludeCriteria() throws Exception {
-// createTestEntityWithMultitenant();
-// addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-//
-// assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
-//
-// JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
-//
-// assertNull(multitenant.getIncludeCriteria());
-//
-// getJavaMultitenancy().setSpecifiedIncludeCriteria(Boolean.TRUE);
-// assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-//
-// getJavaMultitenancy().setSpecifiedIncludeCriteria(null);
-// multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
-// assertNull(multitenant.getIncludeCriteria());
-// assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
-// }
-
- public void testSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithTenantDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenandDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
-
- assertTrue(tenandDiscriminatorColumns.hasNext());
- assertEquals("foo", tenandDiscriminatorColumns.next().getName());
- assertFalse(tenandDiscriminatorColumns.hasNext());
- }
-
- public void testSpecifiedTenantDiscriminatorColumnsSize() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = getJavaMultitenancy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, javaMultitenancy.getSpecifiedTenantDiscriminatorColumnsSize());
-
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("FOO");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAR");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(2, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, javaMultitenancy.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public void testSpecifiedTenantDiscriminatorColumns() throws Exception {
- createTestEntityWithTenantDiscriminatorColumns();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenandDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
-
- assertTrue(tenandDiscriminatorColumns.hasNext());
- assertEquals("foo", tenandDiscriminatorColumns.next().getName());
- assertEquals("bar", tenandDiscriminatorColumns.next().getName());
- assertFalse(tenandDiscriminatorColumns.hasNext());
- }
-
- public void testAddSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("BAR");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> tenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
- }
-
- public void testAddSpecifiedTenantDiscriminatorColumn2() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> tenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
- }
-
- public void testRemoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(3, resourceType.getAnnotationsSize(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME));
-
- getJavaMultitenancy().removeSpecifiedTenantDiscriminatorColumn(1);
-
- Iterator<NestableAnnotation> tenantDiscriminatorColumnAnnotations = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumnAnnotations.next()).getName());
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumnAnnotations.next()).getName());
- assertFalse(tenantDiscriminatorColumnAnnotations.hasNext());
-
- Iterator<JavaTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
-
- getJavaMultitenancy().removeSpecifiedTenantDiscriminatorColumn(1);
- tenantDiscriminatorColumnAnnotations = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumnAnnotations.next()).getName());
- assertFalse(tenantDiscriminatorColumnAnnotations.hasNext());
-
- tenantDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
-
- getJavaMultitenancy().removeSpecifiedTenantDiscriminatorColumn(0);
- tenantDiscriminatorColumnAnnotations = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertFalse(tenantDiscriminatorColumnAnnotations.hasNext());
- tenantDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- assertNull(resourceType.getAnnotation(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = getJavaMultitenancy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- javaMultitenancy.addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- javaMultitenancy.addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- javaMultitenancy.addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- Iterator<NestableAnnotation> javaTenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaTenantDiscriminatorColumns));
-
-
- javaMultitenancy.moveSpecifiedTenantDiscriminatorColumn(2, 0);
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getSpecifiedName());
-
- javaTenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
-
-
- javaMultitenancy.moveSpecifiedTenantDiscriminatorColumn(0, 1);
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getSpecifiedName());
-
- javaTenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedTenantDiscriminatorColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = getJavaMultitenancy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("FOO");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAR");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(2, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.moveAnnotation(2, 0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.moveAnnotation(0, 1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.removeAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.removeAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.removeAnnotation(0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertFalse(tenantDiscriminatorColumns.hasNext());
- }
-
- //MappedSuperclass specifies multitenancy, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithMappedSuperclass() throws Exception {
- createTestMultitenantMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("MS_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if the java entity specifies multitenant, then it does not get the tenant discriminator columns from the mapped superclass
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- //Root entity specifies multitenancy and SINGLE_TABLE inheritance, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithInheritance() throws Exception {
- createTestMultitenantRootEntity();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- getJavaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- getJavaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //get the default tenant discriminator column from the persistence unit defaults instead of the root entity since inheritance strategy is table per class
- multitenancy.setSpecifiedMultitenant(true);
- assertTrue(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("CHILD_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- getJavaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- public void testTenantDiscriminatorColumnsWithPersistenceUnitDefaults() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if there are specified tenant discriminator columns then there should not be any default ones
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("ENTITY_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals(0, multitenancy.getDefaultTenantDiscriminatorColumnsSize());
- assertEquals("ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if java entity is not multitenant than there are no tenant discriminator columns
- getJavaMultitenancy().setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
- }
-
- public void testTenantDiscriminatorColumnsWithEntityMappingsDefaults() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntityMappings entityMappings = (EclipseLinkEntityMappings) getMappingFile().getRoot();
- entityMappings.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("EM_TENANT_ID");
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //entity is not listed in the orm.xml file, so does not get default from entity mappings
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- OrmPersistentType persistentType = entityMappings.addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- multitenancy = ((JavaEclipseLinkEntity) persistentType.getJavaPersistentType().getMapping()).getMultitenancy();
-
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if java entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //if java entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- entityMappings.removePersistentType(0);
- multitenancy = getJavaMultitenancy();
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java
deleted file mode 100644
index 76947b8b84..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaBasicMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.MUTABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append("@Mutable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableBasicDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkJavaBasicMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetConvert() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
-
- basicMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- mutableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, mutable.getSpecifiedMutable());
-
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- resourceField.addAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
- }
-
- public void testSetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
- }
-
- public void testIsDefaultMutableForDate() throws Exception {
- createTestEntityWithMutableBasicDate();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertFalse(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertFalse(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertTrue(mutable.isDefaultMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertFalse(mutable.isDefaultMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertFalse(mutable.isDefaultMutable());
- }
-
- public void testIsMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java
deleted file mode 100644
index bad747da6c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java
+++ /dev/null
@@ -1,742 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaCachingTests extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkJavaCachingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- public void testSetSpecifiedShared() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedShared());
- assertEquals(false, entity.getCaching().isShared());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getShared());
- }
-
- public void testSetSpecifiedSharedFalseUnsetsOtherCacheSettings() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- caching.setSpecifiedSize(Integer.valueOf(500));
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.FALSE);
- caching.setSpecifiedDisableHits(Boolean.FALSE);
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- caching.setExistenceChecking(true);
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.CHECK_CACHE);
- caching.setExpiry(Integer.valueOf(8000));
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(null, caching.getSpecifiedType());
- assertEquals(null, caching.getSpecifiedSize());
- assertEquals(null, caching.getSpecifiedAlwaysRefresh());
- assertEquals(null, caching.getSpecifiedRefreshOnlyIfNewer());
- assertEquals(null, caching.getSpecifiedDisableHits());
- assertEquals(null, caching.getSpecifiedCoordinationType());
- assertEquals(null, caching.getExpiry());
-
-
- //existence checking is the only thing that isn't unset when shared is set to false
- assertTrue(caching.isExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getSpecifiedExistenceType());
-
- caching.setSpecifiedShared(null);
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
- timeOfDayExpiry.setHour(Integer.valueOf(5));
-
- caching.setSpecifiedShared(Boolean.FALSE);
- assertNull(caching.getExpiryTimeOfDay());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getShared());
- assertNull(cacheAnnotation.getExpiryTimeOfDay());
- }
-
- public void testGetDefaultShared() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertTrue(caching.isDefaultShared());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT, "false");
-
- assertFalse(caching.isDefaultShared());
- }
-
- public void testGetSpecifiedShared() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setShared(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getShared());
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedShared());
- assertEquals(false, entity.getCaching().isShared());
- }
-
- public void testSetSpecifiedType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
-
-
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getSpecifiedType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK, cacheAnnotation.getType());
-
-
- //set specified type to the same as the default, verify it is not set to default
- caching.setSpecifiedType(EclipseLinkCacheType.SOFT_WEAK);
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getSpecifiedType());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.SOFT_WEAK, cacheAnnotation.getType());
-
- caching.setSpecifiedType(null);
- assertNull(caching.getSpecifiedType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
- }
-
- public void testGetDefaultType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getDefaultType());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT, EclipseLinkCacheType.FULL.toString());
-
- assertEquals(EclipseLinkCacheType.FULL, caching.getDefaultType());
- }
-
- public void testGetSpecifiedType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setType(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK, cacheAnnotation.getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getSpecifiedType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getType());
- }
-
- public void testSetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedAlwaysRefresh());
- assertEquals(false, entity.getCaching().isAlwaysRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getAlwaysRefresh());
- }
-
- public void testGetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setAlwaysRefresh(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getAlwaysRefresh());
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedAlwaysRefresh());
- assertEquals(true, entity.getCaching().isAlwaysRefresh());
- }
-
- public void testSetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedRefreshOnlyIfNewer());
- assertEquals(true, entity.getCaching().isRefreshOnlyIfNewer());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getRefreshOnlyIfNewer());
- }
-
- public void testGetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setRefreshOnlyIfNewer(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedRefreshOnlyIfNewer());
- assertEquals(true, entity.getCaching().isRefreshOnlyIfNewer());
- }
-
- public void testSetSpecifiedDisableHits() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- caching.setSpecifiedDisableHits(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedDisableHits());
- assertEquals(true, entity.getCaching().isDisableHits());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getDisableHits());
- }
-
- public void testGetSpecifiedDisableHits() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setDisableHits(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getDisableHits());
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedDisableHits());
- assertEquals(true, entity.getCaching().isDisableHits());
- }
-
- public void testSetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
-
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
-
-
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getCoordinationType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cacheAnnotation.getCoordinationType());
-
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES);
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getSpecifiedCoordinationType());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.SEND_OBJECT_CHANGES, cacheAnnotation.getCoordinationType());
-
- caching.setSpecifiedCoordinationType(null);
- assertNull(caching.getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
- }
-
- public void testGetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cacheAnnotation.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getCoordinationType());
- }
-
- public void testHasExistenceChecking() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isExistenceChecking());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(EclipseLink.EXISTENCE_CHECKING);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, caching.isExistenceChecking());
-
- resourceType.removeAnnotation(EclipseLink.EXISTENCE_CHECKING);
- getJpaProject().synchronizeContextModel();
- assertEquals(false, caching.isExistenceChecking());
- }
-
- public void testSetExistenceChecking() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(false, caching.isExistenceChecking());
- assertNull(resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING));
-
- caching.setExistenceChecking(true);
-
- assertEquals(true, caching.isExistenceChecking());
- assertNotNull(resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING));
- }
-
- public void testGetDefaultExistenceType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getDefaultExistenceType());
-
- caching.setExistenceChecking(true);
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getDefaultExistenceType());
- }
-
- public void testGetSpecifiedExistenceType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getExistenceType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkExistenceCheckingAnnotation existenceCheckingAnnotation = (EclipseLinkExistenceCheckingAnnotation) resourceType.addAnnotation(EclipseLink.EXISTENCE_CHECKING);
- existenceCheckingAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE, existenceCheckingAnnotation.getValue());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getSpecifiedExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getExistenceType());
- }
-
- public void testSetSpecifiedExistenceType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getExistenceType());
-
- caching.setExistenceChecking(true);
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
-
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getSpecifiedExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getExistenceType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkExistenceCheckingAnnotation existenceCheckingAnnotation = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE, existenceCheckingAnnotation.getValue());
-
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.CHECK_DATABASE);
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getSpecifiedExistenceType());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.CHECK_DATABASE, existenceCheckingAnnotation.getValue());
-
- caching.setSpecifiedExistenceType(null);
- assertNull(caching.getSpecifiedExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getExistenceType());
- }
-
- public void testGetExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
-
- assertNull(entity.getCaching().getExpiry());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- assertNull(entity.getCaching().getExpiry());
-
- cacheAnnotation.setExpiry(Integer.valueOf(57));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(57), entity.getCaching().getExpiry());
-
- resourceType.removeAnnotation(EclipseLink.CACHE);
- getJpaProject().synchronizeContextModel();
- assertNull(entity.getCaching().getExpiry());
- }
-
- public void testSetExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- caching.setExpiry(Integer.valueOf(58));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(58), cacheAnnotation.getExpiry());
-
-
- caching.setExpiry(null);
- cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cacheAnnotation.getExpiry());
- }
-
- public void testSetExpiryUnsetsExpiryTimeOfDay() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- caching.addExpiryTimeOfDay();
- caching.getExpiryTimeOfDay().setHour(Integer.valueOf(5));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(5), cacheAnnotation.getExpiryTimeOfDay().getHour());
-
- caching.setExpiry(Integer.valueOf(900));
-
- assertNull(caching.getExpiryTimeOfDay());
- assertNull(cacheAnnotation.getExpiryTimeOfDay());
- assertEquals(Integer.valueOf(900), cacheAnnotation.getExpiry());
- assertEquals(Integer.valueOf(900), caching.getExpiry());
- }
-
- public void testGetTimeOfDayExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
-
- cacheAnnotation.addExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNotNull(cacheAnnotation.getExpiryTimeOfDay());
- assertNotNull(caching.getExpiryTimeOfDay());
- assertEquals(timeOfDayExpiry, caching.getExpiryTimeOfDay());
- }
-
- public void testRemoveTimeOfDayExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.addExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(caching.getExpiryTimeOfDay());
-
- caching.removeExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
- assertNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiryUnsetsExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- caching.setExpiry(Integer.valueOf(800));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(800), cacheAnnotation.getExpiry());
-
-
- caching.addExpiryTimeOfDay();
-
-
- assertNull(caching.getExpiry());
- assertNull(cacheAnnotation.getExpiry());
- assertNotNull(cacheAnnotation.getExpiryTimeOfDay());
- }
-
-
- public void testSetSpecifiedSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- caching.setSpecifiedSize(new Integer(50));
-
-
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(new Integer(50), cacheAnnotation.getSize());
- }
-
- public void testGetDefaultSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getDefaultSize());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT, "333");
-
- assertEquals(333, caching.getDefaultSize());
- }
-
- public void testGetSpecifiedSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setSize(new Integer(50));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(new Integer(50), cacheAnnotation.getSize());
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
- }
-
- public void testSetSpecifiedIsolation() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
-
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.PROTECTED);
-
-
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getIsolation());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED, cacheAnnotation.getIsolation());
-
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.SHARED);
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getSpecifiedIsolation());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.SHARED, cacheAnnotation.getIsolation());
-
- caching.setSpecifiedIsolation(null);
- assertNull(caching.getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- }
-
- public void testGetSpecifiedIsolation() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(caching.getSpecifiedIsolation());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setIsolation(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED, cacheAnnotation.getIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getIsolation());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java
deleted file mode 100644
index fb8fed8f3d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaConvertTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"class-instance\")").append(CR);
- sb.append(" @TypeConverter");
- }
- });
- }
-
- public EclipseLinkJavaConvertTests(String name) {
- super(name);
- }
-
-
- public void testGetConverterName() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(EclipseLinkConvert.NO_CONVERTER, eclipseLinkConvert.getConverterName());
- assertEquals(EclipseLinkConvert.NO_CONVERTER, eclipseLinkConvert.getDefaultConverterName());
- assertEquals(null, eclipseLinkConvert.getSpecifiedConverterName());
- }
-
- public void testGetConvertName2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, eclipseLinkConvert.getConverterName());
- }
-
- public void testSetSpecifiedConverterName() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- basicMapping.setConverter(EclipseLinkConvert.class);
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- assertEquals(null, eclipseLinkConvert.getSpecifiedConverterName());
-
- eclipseLinkConvert.setSpecifiedConverterName("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convertAnnotation = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
-
- assertEquals("foo", convertAnnotation.getValue());
-
- eclipseLinkConvert.setSpecifiedConverterName(null);
- convertAnnotation = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- assertNotNull(convertAnnotation);
- assertEquals(null, convertAnnotation.getValue());
- }
-
- public void testGetConverterNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-
-
- public void testGetConverter() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(EclipseLinkTypeConverter.class, eclipseLinkConvert.getConverter().getType());
- }
-
- public void testSetConverter() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- eclipseLinkConvert.setConverter(EclipseLinkTypeConverter.class);
- assertEquals(EclipseLinkTypeConverter.class, eclipseLinkConvert.getConverter().getType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNotNull(resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
-
- eclipseLinkConvert.setConverter(EclipseLinkStructConverter.class);
- assertEquals(EclipseLinkStructConverter.class, eclipseLinkConvert.getConverter().getType());
- assertNotNull(resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
-
- eclipseLinkConvert.setConverter(null);
- assertEquals(null, eclipseLinkConvert.getConverter());
- assertNull(resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
-
- eclipseLinkConvert.setConverter(EclipseLinkStructConverter.class);
- assertEquals(EclipseLinkStructConverter.class, eclipseLinkConvert.getConverter().getType());
- assertNotNull(resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
-
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME));
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java
deleted file mode 100644
index 3cab20039e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaConverterTests extends EclipseLinkContextModelTestCase
-{
-
-
- private ICompilationUnit createTestEntityWithConvertAndConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @Converter(name=\"foo\"");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndConverterClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @Converter(converterClass=Foo.class");
- }
- });
- }
-
- public EclipseLinkJavaConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.addAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", eclipseLinkConvert.getConverter().getName());
- }
-
-
- public void testGetConverterClass() throws Exception {
- createTestEntityWithConvertAndConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getConverterClass());
- }
-
- public void testSetConverterClass() throws Exception {
- createTestEntityWithConvertAndConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverterClass());
-
-
- converter.setConverterClass(null);
- assertEquals(null, converter.getConverterClass());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getConverterClass());
-
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverterClass());
- }
-
- public void testGetConverterClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setConverterClass("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getConverterClass());
-
- resourceField.removeAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.addAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setConverterClass("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", ((EclipseLinkCustomConverter) eclipseLinkConvert.getConverter()).getConverterClass());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java
deleted file mode 100644
index 5ab3f6f0a6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaEmbeddableTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEmbeddableWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaEmbeddableTests(String name) {
- super(name);
- }
-
-
- public void testGetCustomizerClass() throws Exception {
- createTestEmbeddableWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEmbeddable) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestEmbeddableWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEmbeddable) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestEmbeddableWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkEmbeddable embeddable = (EclipseLinkEmbeddable) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = embeddable.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestEmbeddableWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEmbeddable embeddable = (EclipseLinkEmbeddable) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = embeddable.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestEmbeddableWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEmbeddable embeddable = (EclipseLinkEmbeddable) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = embeddable.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java
deleted file mode 100644
index 0c279ea185..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaEntityTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@ReadOnly").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaEntityTests(String name) {
- super(name);
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- }
-
-
- public void testGetCustomizerClass() throws Exception {
- createTestEntityWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEntity) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestEntityWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEntity) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkEntity entity = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = entity.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestEntityWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity entity = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = entity.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
-
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
-
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestEntityWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity entity = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = entity.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-
- public void testGetReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
- }
-
- public void testGetSpecifiedReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- //TODO test inheriting a default readonly from you superclass
- public void testGetDefaultReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(false, readOnly.isDefaultReadOnly());
- }
-
- public void testSetSpecifiedReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
-
- readOnly.setSpecifiedReadOnly(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
-
- readOnly.setSpecifiedReadOnly(Boolean.TRUE);
- assertNotNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
- }
-
- public void testSpecifiedReadOnlyUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- resourceType.addAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java
deleted file mode 100644
index b8489d5983..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaIdMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.MUTABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Mutable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableIdDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkJavaIdMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetConvert() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, idMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, idMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) idMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getConverter().getType());
-
- idMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- idMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, idMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) idMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(idMapping.getConverter().getType());
- assertFalse(idMapping.isDefault());
- assertSame(idMapping, persistentAttribute.getMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- mutableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, mutable.getSpecifiedMutable());
-
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- resourceField.addAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
- }
-
- public void testSetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
- }
-
- public void testIsDefaultMutableForDate() throws Exception {
- createTestEntityWithMutableIdDate();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertFalse(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertFalse(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.TRUE);
- assertTrue(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertFalse(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(null);
- assertFalse(mutable.isDefaultMutable());
- }
-
- public void testIsMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java
deleted file mode 100644
index 6f7cab9b99..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaManyToManyMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithJoinFetchManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaManyToManyMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java
deleted file mode 100644
index 9a346e8dcd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaManyToOneMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithJoinFetchManyToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaManyToOneMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java
deleted file mode 100644
index a994c249f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaMappedSuperclassTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestMappedSuperclassWithReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@ReadOnly").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- public void testGetReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
- }
-
- public void testGetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- //TODO test inheriting a default readonly from you superclass
- public void testGetDefaultReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(false, readOnly.isDefaultReadOnly());
- }
-
- public void testSetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
-
- readOnly.setSpecifiedReadOnly(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
-
- readOnly.setSpecifiedReadOnly(Boolean.TRUE);
- assertNotNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
- }
-
- public void testSpecifiedReadOnlyUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- resourceType.addAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- public void testGetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = mappedSuperclass.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
-
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
-
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java
deleted file mode 100644
index 438cb97e98..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaObjectTypeConverterTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithConvertAndObjectTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(name=\"foo\", defaultObjectValue=\"bar\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(dataType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(objectType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndObjectTypeConverterConversionValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(name=\"foo\", defaultObjectValue=\"bar\", conversionValues = @ConversionValue(dataValue=\"f\", objectValue=\"female\"))");
- }
- });
- }
-
- public EclipseLinkJavaObjectTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", eclipseLinkConvert.getConverter().getName());
- }
-
- public void testGetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
-
-
- converter.setDataType(null);
- assertEquals(null, converter.getDataType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDataType());
-
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
- }
-
- public void testGetDataTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDataType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getDataType());
-
- resourceField.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setDataType("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", ((EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter()).getDataType());
- }
-
- public void testGetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
-
-
- converter.setObjectType(null);
- assertEquals(null, converter.getObjectType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getObjectType());
-
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
- }
-
- public void testGetObjectTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setObjectType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getObjectType());
-
- resourceField.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setObjectType("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", ((EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter()).getObjectType());
- }
-
-
- public void testAddConversionValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- EclipseLinkConversionValue conversionValue = converter.addConversionValue(0);
- conversionValue.setDataValue("F");
- conversionValue.setObjectValue("female");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- EclipseLinkConversionValueAnnotation resourceConversionValue = resourceConversionValues.next();
- assertEquals("F", resourceConversionValue.getDataValue());
- assertEquals("female", resourceConversionValue.getObjectValue());
-
- EclipseLinkConversionValue conversionValue2 = converter.addConversionValue(0);
- conversionValue2.setDataValue("M");
- conversionValue2.setObjectValue("male");
-
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("M", resourceConversionValue.getDataValue());
- assertEquals("male", resourceConversionValue.getObjectValue());
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("F", resourceConversionValue.getDataValue());
- assertEquals("female", resourceConversionValue.getObjectValue());
-
- EclipseLinkConversionValue conversionValue3 = converter.addConversionValue(1);
- conversionValue3.setDataValue("O");
- conversionValue3.setObjectValue("male");
-
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("M", resourceConversionValue.getDataValue());
- assertEquals("male", resourceConversionValue.getObjectValue());
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("O", resourceConversionValue.getDataValue());
- assertEquals("male", resourceConversionValue.getObjectValue());
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("F", resourceConversionValue.getDataValue());
- assertEquals("female", resourceConversionValue.getObjectValue());
-
- ListIterator<? extends EclipseLinkConversionValue> conversionValues = converter.getConversionValues().iterator();
- assertEquals(conversionValue2, conversionValues.next());
- assertEquals(conversionValue3, conversionValues.next());
- assertEquals(conversionValue, conversionValues.next());
-
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- }
-
- public void testRemoveConversionValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converter.addConversionValue(0).setDataValue("F");
- converter.addConversionValue(1).setDataValue("M");
- converter.addConversionValue(2).setDataValue("O");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(2, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("O", resourceConversionValues.next().getDataValue());
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(1, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("O", resourceConversionValues.next().getDataValue());
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(0, CollectionTools.size(resourceConversionValues));
- }
-
- public void testMoveConversionValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converter.addConversionValue(0).setDataValue("F");
- converter.addConversionValue(1).setDataValue("M");
- converter.addConversionValue(2).setDataValue("O");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
-
- converter.moveConversionValue(2,0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("O", resourceConversionValues.next().getDataValue());
- assertEquals("F", resourceConversionValues.next().getDataValue());
-
- converter.moveConversionValue(0,1);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("O", resourceConversionValues.next().getDataValue());
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("F", resourceConversionValues.next().getDataValue());
- }
-
- public void testUpdateConversionValues() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converterAnnotation.addConversionValue(0).setDataValue("F");
- converterAnnotation.addConversionValue(1).setDataValue("M");
- converterAnnotation.addConversionValue(2).setDataValue("O");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends EclipseLinkConversionValue> conversionValues = converter.getConversionValues().iterator();
- assertEquals("F", conversionValues.next().getDataValue());
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("O", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.moveConversionValue(2, 0);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.moveConversionValue(0, 1);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(1);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(1);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("O", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(0);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertFalse(conversionValues.hasNext());
- }
-
- public void testConversionValuesSize() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, converter.getConversionValuesSize());
-
- converterAnnotation.addConversionValue(0).setDataValue("F");
- converterAnnotation.addConversionValue(1).setDataValue("M");
- converterAnnotation.addConversionValue(2).setDataValue("O");
-
- this.getJpaProject().synchronizeContextModel();
- assertEquals(3, converter.getConversionValuesSize());
- }
-
-
- public void testGetDefaultObjectValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("bar", converter.getDefaultObjectValue());
- }
-
- public void testSetDefaultObjectValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
- assertEquals("bar", converter.getDefaultObjectValue());
-
- converter.setDefaultObjectValue("baz");
- assertEquals("baz", converter.getDefaultObjectValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("baz", converterAnnotation.getDefaultObjectValue());
-
-
- converter.setDefaultObjectValue(null);
- assertEquals(null, converter.getDefaultObjectValue());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDefaultObjectValue());
-
-
- converter.setDefaultObjectValue("bar");
- assertEquals("bar", converter.getDefaultObjectValue());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getDefaultObjectValue());
- }
-
- public void testGetDefaultObjectValueUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("bar", converter.getDefaultObjectValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDefaultObjectValue("baz");
- getJpaProject().synchronizeContextModel();
- assertEquals("baz", converter.getDefaultObjectValue());
-
- resourceField.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setDefaultObjectValue("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", ((EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter()).getDefaultObjectValue());
- }
-
- public void testInitializeConversionValues() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverterConversionValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals(1, converter.getConversionValuesSize());
- assertEquals("f", converter.getConversionValues().iterator().next().getDataValue());
- assertEquals("female", converter.getConversionValues().iterator().next().getObjectValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java
deleted file mode 100644
index 791423d1d1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaOneToManyMappingTests extends EclipseLinkContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithPrivateOwnedOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- sb.append("@PrivateOwned").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithJoinFetchOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDefaultOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
-
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("implements java.io.Serializable");
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private java.util.Collection<" + TYPE_NAME + "> myTypes;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- public EclipseLinkJavaOneToManyMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testSetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(false);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(true);
- assertNotNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testPrivateOwnedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- resourceField.addAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping mapping = (EclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping mapping = (EclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testDefaultOneToMany() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, attributes.next().getDefaultMappingKey());
- }
-
- public void testDefaultOneToManySetFetch() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(FetchType.LAZY, specifiedOneToManyMapping.getFetch());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, annotation.getFetch());
- }
-
- public void testDefaultOneToManySetTargetEntity() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedTargetEntity("Foo");
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToManyMapping.getSpecifiedTargetEntity());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getTargetEntity());
- }
-
- public void testDefaultOneToManySetMappedBy() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("Foo");
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getMappedBy());
- }
-
- public void testDefaultOneToManySetCascadeAll() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setAll(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isAll());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeAll());
- }
-
- public void testDefaultOneToManySetCascadeMerge() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setMerge(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isMerge());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeMerge());
- }
-
- public void testDefaultOneToManySetCascadePersist() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setPersist(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isPersist());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadePersist());
- }
-
- public void testDefaultOneToManySetCascadeRefresh() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setRefresh(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertEquals(true, annotation.isCascadeRefresh());
- }
-
- public void testDefaultOneToManySetCascadeRemove() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setRemove(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isRemove());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRemove());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java
deleted file mode 100644
index 2ad25364c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaOneToOneMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithPrivateOwnedOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- sb.append("@PrivateOwned").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithJoinFetchOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDefaultOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
-
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("implements java.io.Serializable");
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private " + TYPE_NAME + " myType;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- public EclipseLinkJavaOneToOneMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testSetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(false);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(true);
- assertNotNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testPrivateOwnedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- resourceField.addAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-
- public void testDefaultOneToOne() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, attributes.next().getDefaultMappingKey());
- }
-
- public void testDefaultOneToOneSetFetch() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(FetchType.LAZY, specifiedOneToOneMapping.getFetch());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, annotation.getFetch());
- }
-
- public void testDefaultOneToOneSetTargetEntity() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.setSpecifiedTargetEntity("Foo");
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToOneMapping.getSpecifiedTargetEntity());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getTargetEntity());
- }
-
- public void testDefaultOneToOneSetMappedBy() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("Foo");
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getMappedBy());
- }
-
- public void testDefaultOneToOneSetCascadeAll() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setAll(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isAll());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeAll());
- }
-
- public void testDefaultOneToOneSetCascadeMerge() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setMerge(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isMerge());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeMerge());
- }
-
- public void testDefaultOneToOneSetCascadePersist() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setPersist(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isPersist());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadePersist());
- }
-
- public void testDefaultOneToOneSetCascadeRefresh() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setRefresh(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRefresh());
- }
-
- public void testDefaultOneToOneSetCascadeRemove() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setRemove(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isRemove());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRemove());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java
deleted file mode 100644
index d14387694b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaStructConverterTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithConvertAndStructConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @StructConverter(name=\"foo\"");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndStructConverterClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @StructConverter(converter=\"Foo\"");
- }
- });
- }
-
- public EclipseLinkJavaStructConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndStructConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndStructConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndStructConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.addAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", eclipseLinkConvert.getConverter().getName());
- }
-
-
- public void testGetConverterClass() throws Exception {
- createTestEntityWithConvertAndStructConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getConverterClass());
- }
-
- public void testSetConverterClass() throws Exception {
- createTestEntityWithConvertAndStructConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverter());
-
-
- converter.setConverterClass(null);
- assertEquals(null, converter.getConverterClass());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getConverter());
-
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverter());
- }
-
- public void testGetConverterClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndStructConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setConverter("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getConverterClass());
-
- resourceField.removeAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.addAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setConverter("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", ((EclipseLinkStructConverter) eclipseLinkConvert.getConverter()).getConverterClass());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java
deleted file mode 100644
index dfc77b52a0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaTypeConverterTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithConvertAndTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @TypeConverter(name=\"foo\"");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @TypeConverter(dataType=Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @TypeConverter(objectType=Foo.class");
- }
- });
- }
-
- public EclipseLinkJavaTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.addAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", eclipseLinkConvert.getConverter().getName());
- }
-
- public void testGetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
-
-
- converter.setDataType(null);
- assertEquals(null, converter.getDataType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDataType());
-
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
- }
-
- public void testGetDataTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDataType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getDataType());
-
- resourceField.removeAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.addAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setDataType("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", ((EclipseLinkTypeConverter) eclipseLinkConvert.getConverter()).getDataType());
- }
-
- public void testGetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
-
-
- converter.setObjectType(null);
- assertEquals(null, converter.getObjectType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getObjectType());
-
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
- }
-
- public void testGetObjectTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setObjectType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getObjectType());
-
- resourceField.removeAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.addAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNotNull(eclipseLinkConvert.getConverter());
-
- converterAnnotation.setObjectType("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", ((EclipseLinkTypeConverter) eclipseLinkConvert.getConverter()).getObjectType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java
deleted file mode 100644
index 256d201535..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaVersionMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableVersion() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.MUTABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Mutable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableVersionDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkJavaVersionMappingTests(String name) {
- super(name);
- }
-
- public void testGetConvert() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, versionMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, versionMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) versionMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertNull(versionMapping.getConverter().getType());
-
- versionMapping.setConverter(TemporalConverter.class);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- versionMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertNull(versionMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, versionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) versionMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(versionMapping.getConverter().getType());
- assertFalse(versionMapping.isDefault());
- assertSame(versionMapping, persistentAttribute.getMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- mutableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, mutable.getSpecifiedMutable());
-
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- resourceField.addAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
- }
-
- public void testSetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
- }
-
- public void testIsDefaultMutableForDate() throws Exception {
- createTestEntityWithMutableVersionDate();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertFalse(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertFalse(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.TRUE);
- assertTrue(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertFalse(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(null);
- assertFalse(mutable.isDefaultMutable());
- }
-
- public void testIsMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java
deleted file mode 100644
index 663c02dfbb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCoreJavaContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCoreJavaContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkJavaBasicMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaCachingTests.class);
- suite.addTestSuite(EclipseLinkJavaConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaConvertTests.class);
- suite.addTestSuite(EclipseLinkJavaEmbeddableTests.class);
- suite.addTestSuite(EclipseLinkJavaEntityTests.class);
- suite.addTestSuite(EclipseLinkJavaIdMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLinkJavaObjectTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaOneToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaOneToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaStructConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaVersionMappingTests.class);
- suite.addTestSuite(EclipseLink2_3JavaMultitenancyTests.class);
- suite.addTestSuite(EclipseLink2_0JavaCollectionTableTests.class);
- suite.addTestSuite(EclipseLink2_0JavaElementCollectionMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaEntityTests.class);
- suite.addTestSuite(EclipseLink2_0JavaManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLink2_0JavaOneToManyMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaOneToOneMappingTests.class);
- return suite;
- }
-
- private JptEclipseLinkCoreJavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java
deleted file mode 100644
index e2889597dd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink1_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmPersistentAttributeTests
- extends EclipseLink1_1ContextModelTestCase
-{
- public EclipseLink1_1OrmPersistentAttributeTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMappingPropertyAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNull(ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getVirtualAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertTrue(javaResourceAttribute instanceof JavaResourceField);
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).convertToVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-
- public void testGetJavaPersistentAttributeMixedAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute ormPropertyAttribute = attributes.next();
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertEquals(AccessType.FIELD, ormFieldAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getOwningPersistentType().getAccess());
- assertTrue(ormFieldAttribute.isVirtual());
- assertTrue(ormPropertyAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormFieldAttribute.getMappingKey());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPropertyAttribute.getMappingKey());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
-
- ormPropertyAttribute.convertToSpecified();
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
- ((OrmPersistentAttribute) ormPropertyAttribute).setSpecifiedAccess(AccessType.FIELD);
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPropertyAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccessPropertyInJava() throws Exception {
- createTestEntityIdMappingPropertyAccess();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java
deleted file mode 100644
index cc59e8b794..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink1_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmPersistentTypeTests
- extends EclipseLink1_1ContextModelTestCase
-{
- public EclipseLink1_1OrmPersistentTypeTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-//
-// private void createAccessTypeEnum() throws Exception {
-// this.createEnumAndMembers(JPA_ANNOTATIONS_PACKAGE_NAME, "AccessType", "FIELD, PROPERTY;");
-// }
-//
-// private void createAccessAnnotation() throws Exception {
-// this.createAnnotationAndMembers(JPA_ANNOTATIONS_PACKAGE_NAME, "Access", "AccessType value();");
-// createAccessTypeEnum();
-// }
-//
-// private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
-// createAccessAnnotation();
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA.ACCESS, JPA.ACCESS_TYPE);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append("@Access(AccessType.PROPERTY)");
-// }
-//
-// @Override
-// public void appendNameFieldAnnotationTo(StringBuilder sb) {
-// sb.append("@Basic");
-// sb.append("@Access(AccessType.FIELD)");
-// }
-//
-// @Override
-// public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
-// sb.append("@Id");
-// }
-// });
-// }
-//
-// private ICompilationUnit createTestEntityFieldSpecifiedPropertyAnnotated() throws Exception {
-// createAccessAnnotation();
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA.ACCESS, JPA.ACCESS_TYPE);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append("@Access(AccessType.FIELD)");
-// }
-//
-// @Override
-// public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
-// sb.append("@Id");
-// sb.append("@Access(AccessType.PROPERTY)");
-// }
-// });
-// }
-//
-// private ICompilationUnit createTestEntityPropertySpecified() throws Exception {
-// createAccessAnnotation();
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.ACCESS, JPA.ACCESS_TYPE);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append("@Access(AccessType.PROPERTY)");
-// }
-// });
-// }
-
- public void testGetAccessWithJavaAnnotations() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.convertToSpecified();
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
-//TODO Access annotation test
-// public void testGetAccessWithJavaAnnotationsProperty() throws Exception {
-// createTestEntityAnnotatedFieldPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-//
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-//
-//
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-// ormPersistentAttribute.makeSpecified();
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
-// }
-//
-// public void testVirtualAttributes() throws Exception {
-// createTestEntityAnnotatedFieldPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// ListIterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
-// OrmPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-// }
-//
-// public void testVirtualAttributes2() throws Exception {
-// createTestEntityPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// ListIterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
-// OrmPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-// }
-//
-// public void testVirtualAttributes3() throws Exception {
-// createTestEntityFieldSpecifiedPropertyAnnotated();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// ListIterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
-// OrmPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-//
-// ormPersistentAttribute.makeSpecified();
-//
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-//
-// OrmPersistentAttribute specifiedPersistentAttribute = ormPersistentType.specifiedAttributes().next();
-// assertEquals("id", specifiedPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, specifiedPersistentAttribute.getSpecifiedAccess());
-//
-//
-// ormPersistentType.virtualAttributes().next().makeSpecified();
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-// }
-//
-// public void testGetDefaultAccess() throws Exception {
-// createTestEntityPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-//
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-//
-// javaPersistentType.setSpecifiedAccess(AccessType.FIELD);
-// assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-//
-// javaPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-//
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-// }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java
deleted file mode 100644
index c466c4c8cd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink1_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmTransientMappingTests
- extends EclipseLink1_1ContextModelTestCase
-{
- public EclipseLink1_1OrmTransientMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient").append(CR);
- }
- });
- }
-
- public void testCreateTransientMapping() throws Exception {
- createTestEntityWithTransientMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertTrue(persistentAttribute.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "id");
-
- persistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(persistentAttribute.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMapping().getKey());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java
deleted file mode 100644
index 7bca4a74cf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java
+++ /dev/null
@@ -1,753 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmCollectionTableTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmCollectionTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- sb.append("@Id").append(CR);
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
-
- //set name in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the resource model
- resourceElementCollection.getCollectionTable().setName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set name in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedName("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedName());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the context model
- ormCollectionTable.setSpecifiedName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testVirtualCollectionTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(TYPE_NAME + "_projects", virtualCollectionTable.getName());
- assertNull(virtualCollectionTable.getSpecifiedCatalog());
- assertNull(virtualCollectionTable.getSpecifiedSchema());
- assertEquals(0, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualCollectionTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
-
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) javaPersistentAttribute.getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping.getCollectionTable();
- javaCollectionTable.setSpecifiedName("FOO");
- javaCollectionTable.setSpecifiedCatalog("CATALOG");
- javaCollectionTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaCollectionTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
-
- assertEquals("FOO", virtualCollectionTable.getSpecifiedName());
- assertEquals("CATALOG", virtualCollectionTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualCollectionTable.getSpecifiedSchema());
- assertEquals(1, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- virtualJoinColumn = virtualCollectionTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "projects");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- assertEquals(TYPE_NAME + "_projects", ormCollectionTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).setSpecifiedName("Foo");
- assertEquals("Foo_projects", ormCollectionTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).setSpecifiedName("Bar");
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
-
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove element collection mapping from the orm.xml file
- ormPersistentAttribute.convertToVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
- assertTrue(ormPersistentAttribute2.isVirtual());
- assertEquals("JAVA_COLLECTION_TABLE", virtualCollectionTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName(null);
- assertNull(virtualCollectionTable.getSpecifiedName());
- assertEquals("Bar_projects", virtualCollectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set schema in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the resource model
- resourceElementCollection.getCollectionTable().setSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Schema in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the context model
- ormCollectionTable.setSpecifiedSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the resource model
- resourceElementCollection.getCollectionTable().setCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the context model
- ormCollectionTable.setSpecifiedCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- OrmJoinColumn joinColumn = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormCollectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, resourceCollectionTable.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
- }
-
-
- public void testUpdateJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- resourceCollectionTable.getJoinColumns().get(0).setName("FOO");
- resourceCollectionTable.getJoinColumns().get(1).setName("BAR");
- resourceCollectionTable.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(2, 0);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(0);
- assertFalse(ormCollectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testUniqueConstraints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- assertEquals(0, ormCollectionTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormCollectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
- ormCollectionTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(1);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(0);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
-
- ormCollectionTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormCollectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributes().iterator().next().getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormPersistentType.getAttributes().iterator().next().isVirtual());
-
- ListIterator<? extends UniqueConstraint> uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping2_0 = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping2_0.getCollectionTable();
-
- javaCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- ormPersistentType.getAttributes().iterator().next().convertToSpecified();
-
- virtualElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributes().iterator().next().getMapping();
- assertEquals(0, virtualElementCollectionMapping.getCollectionTable().getUniqueConstraintsSize());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java
deleted file mode 100644
index cb0bb4ec03..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java
+++ /dev/null
@@ -1,1639 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmElementCollectionMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public EclipseLink2_0OrmElementCollectionMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection(targetClass=String.class, fetch=FetchType.EAGER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("oneToOneMapping", ormElementCollectionMapping.getName());
- assertEquals("oneToOneMapping", elementCollection.getName());
-
- //set name in the resource model, verify context model updated
- elementCollection.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the resource model
- elementCollection.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("oneToOneMapping", ormElementCollectionMapping.getName());
- assertEquals("oneToOneMapping", elementCollection.getName());
-
- //set name in the context model, verify resource model updated
- ormElementCollectionMapping.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the context model
- ormElementCollectionMapping.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", virtualElementCollectionMapping.getName());
- assertEquals(FetchType.EAGER, virtualElementCollectionMapping.getSpecifiedFetch());
- assertEquals("String", virtualElementCollectionMapping.getSpecifiedTargetClass());
-
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormElementCollectionMapping.getName());
- assertEquals(null, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getDefaultFetch());
- assertEquals(null, ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals(PACKAGE_NAME + ".Address", ormElementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.convertToSpecified(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormElementCollectionMapping.getName());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormElementCollectionMapping.getName());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testMorphToIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToTransientMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToBasicMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOne");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
-
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormElementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollection.getFetch());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedTargetClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollection.setTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the resource model
- elementCollection.setTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- ormElementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeEntity() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("test.Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- 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();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNotNull(oneToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKey().setName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
-
- oneToMany.getMapKey().setName("myMapKey");
- oneToMany.setMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKey());
- assertNull(virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertTrue(virtualElementCollectionMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setPkMapKey(true);
- assertEquals(null, virtualElementCollectionMapping.getMapKey());//no primary key on an embeddable
- assertTrue(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setCustomMapKey(true);
- javaElementCollectionMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("city", virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertTrue(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- 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();
- XmlOneToMany xmlOneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(xmlOneToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", xmlOneToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(xmlOneToMany.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- OrmReadOnlyPersistentAttribute attribute = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) attribute.getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- attribute.convertToSpecified();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = ormElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormElementCollectionMapping.setSpecifiedTargetClass("String");
- mapKeyNames = ormElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- elementCollection.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNotNull(elementCollection.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- elementCollection.getMapKeyClass().setClassName("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- elementCollection.getMapKeyClass().setClassName(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass().getClassName());
-
- elementCollection.getMapKeyClass().setClassName("String");
- elementCollection.setMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualElementCollectionMapping.getMapKeyClass());
- assertEquals("Integer", virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormElementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- orderable = (Orderable2_0) virtualElementCollectionMapping.getOrderable();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("addresses_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
- public void testVirtualValueColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attrubte in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
- assertEquals("addresses", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- OrmColumn ormColumn = addressesVirtualMapping.getValueColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualValueColumnTable() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getValueColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, elementCollectionResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testElementCollectionMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "foo");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType persistentType3 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends AttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- ReadOnlyAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaElementCollectionMapping.getValueAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType3.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("addresses").convertToSpecified();
- elementCollectionMapping = (OrmElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getDefaultTable());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", attributeOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
- }
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
-
- public void testSelfReferentialElementCollectionMapping() throws Exception {
- createSelfReferentialElementCollection();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Foo");
-
- ElementCollectionMapping2_0 mapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("elementCollection").getMapping();
- assertFalse(mapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
-
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- elementCollectionResource.setMapKeyEnumerated(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, elementCollectionResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- elementCollectionResource.setMapKeyTemporal(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(TemporalConverter.class);
- ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyTemporal());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "address");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlConvertibleMapping elementCollectionResource = (XmlConvertibleMapping) getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- elementCollectionResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormElementCollectionMapping.getConverter().getType());
- assertEquals("myConvert", elementCollectionResource.getConvert());
-
- //set lob to null in the resource model
- elementCollectionResource.setConvert(null);
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
-
- javaElementCollectionMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address");
- EclipseLinkElementCollectionMapping2_0 virtualElementCollectionMapping = (EclipseLinkElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualElementCollectionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualElementCollectionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, elementCollectionResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualElementCollectionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualElementCollectionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, elementCollectionResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
- javaElementCollectionMapping.setConverter(null);
- assertNull(virtualElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
- assertNull(javaElementCollectionMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlConvertibleMapping elementCollectionResource = (XmlConvertibleMapping) getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormElementCollectionMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", elementCollectionResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormElementCollectionMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormElementCollectionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", elementCollectionResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormElementCollectionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormElementCollectionMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
- //set lob to false in the context model
- ormElementCollectionMapping.setConverter(null);
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java
deleted file mode 100644
index 89f08d3939..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java
+++ /dev/null
@@ -1,1807 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmEntityTests
- extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_0OrmEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-//TODO
-// public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-// getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// Iterator<PersistentAttribute> overridableAttributes = getJavaEntity().allOverridableAttributes();
-// assertEquals("id", overridableAttributes.next().getName());
-// assertEquals("name", overridableAttributes.next().getName());
-// assertEquals("foo", overridableAttributes.next().getName());
-// assertFalse(overridableAttributes.hasNext());
-// }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAZ");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().move(1, 0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testDefaultAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) ormEntity.getPersistentType().getSuperPersistentType().getMapping();
-
- mappedSuperclass.getPersistentType().getAttributeNamed("id").convertToSpecified();
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testDefaultAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmEntity superclass = (OrmEntity) ormEntity.getParentEntity();
-
- superclass.getPersistentType().getAttributeNamed("id").convertToSpecified();
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("bar");
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
-
- Iterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals(1, entityResource.getAttributeOverrides().size());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAttributeOverrides().size());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().add(2, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = entity.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociations() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("FOO");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(1, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAR");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAZ");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().move(1, 0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testDefaultAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(FULLY_QUALIFIED_SUB_TYPE_NAME, entityResource.getClassName());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- OrmVirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-//
-// //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-// //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
-// //idMapping.getColumn().setSpecifiedName("FOO");
-// //idMapping.getColumn().setSpecifiedTable("BAR");
-//
-// assertEquals(SUB_TYPE_NAME, entityResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-// //idMapping.getColumn().setSpecifiedName(null);
-// //idMapping.getColumn().setSpecifiedTable(null);
-// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("bar");
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals(1, entityResource.getAssociationOverrides().size());
-
- Iterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAssociationOverrides().size());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(1, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().add(2, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").convertToSpecified();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").convertToSpecified();
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- customerPersistentType.getJavaPersistentType().getAttributeNamed("address").setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").convertToSpecified();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").convertToSpecified();
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable2_0 = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(null);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- entityResource.setCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromSuperType() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity subEntity = (EclipseLinkEntity) subOrmPersistentType.getMapping();
- EclipseLinkEntity entity = (EclipseLinkEntity) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subEntity).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) entity).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromJava() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
-
- Cacheable2_0 javaCacheable = ((CacheableHolder2_0) ormPersistentType.getJavaPersistentType().getMapping()).getCacheable();
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromMappedSuperClass() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity subEntity = (EclipseLinkEntity) subOrmPersistentType.getMapping();
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subEntity).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) mappedSuperclass).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java
deleted file mode 100644
index 0fed64a658..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,1070 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmManyToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmManyToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNotNull(manyToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKey().setName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
-
- manyToMany.getMapKey().setName("myMapKey");
- manyToMany.setMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualManyToManyMapping.getSpecifiedMapKey());
- assertNull(virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertTrue(virtualManyToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualManyToManyMapping.getMapKey());
- assertTrue(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setCustomMapKey(true);
- javaManyToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualManyToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertTrue(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- 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();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").convertToSpecified();
- OrmManyToManyMapping specifiedManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(manyToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKeyClass().setClassName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass().getClassName());
-
- manyToMany.getMapKeyClass().setClassName("String");
- manyToMany.setMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping2_0 virtualManyToManyMapping = (ManyToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", virtualManyToManyMapping.getMapKeyClass());
- assertNull(virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualManyToManyMapping.getMapKeyClass());
- assertEquals("Integer", virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- 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().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");
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- getOrmXmlResource().save(null);
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
-
- jobsOrderable.setOrderColumnOrdering(true);
- jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderable.setOrderColumnOrdering(true);
- queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- 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();
-
- OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "queues");
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- JavaManyToManyMapping javaJobsManyToManyMapping = (JavaManyToManyMapping) jobsPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- jobsPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute jobsPersistentAttribute2 = printQueuePersistentType.getAttributeNamed("jobs");
- ManyToManyMapping virtualJobsMapping = (ManyToManyMapping) jobsPersistentAttribute2.getMapping();
- jobsOrderable = ((Orderable2_0) virtualJobsMapping.getOrderable());
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(false, jobsOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", jobsOrderable.getOrderColumn().getName());
- queuesPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute queuesPersistentAttribute2 = printJobPersistentType.getAttributeNamed("queues");
- ManyToManyMapping virtualQueuesMapping = (ManyToManyMapping) queuesPersistentAttribute2.getMapping();
- queuesOrderable = ((Orderable2_0) virtualQueuesMapping.getOrderable());
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(false, queuesOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- JavaManyToManyMapping javaQueuesManyToManyMapping = (JavaManyToManyMapping) queuesPersistentAttribute2.getJavaPersistentAttribute().getMapping();
- javaQueuesManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE");
- assertEquals("JOIN_TABLE", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("JOIN_TABLE", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //becomes a 1-m by default
- OneToManyMapping2_0 addressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesMapping.getMapKeyColumn();
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
-
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmManyToManyMapping2_0 addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", ormColumn.getTable());
-
- //set Column table element in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", ormColumn.getTable());
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", ormColumn.getDefaultTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToManyMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(null, ormManyToManyMapping.getJoinFetch().getValue());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "elementCollectionMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
-
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- manyToManyResource.setMapKeyEnumerated(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "ManyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyEnumerated());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "ManyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, manyToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- manyToManyResource.setMapKeyTemporal(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "ManyToManyMapping");
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(TemporalConverter.class);
- ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyTemporal());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java
deleted file mode 100644
index dacdba0ed8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmManyToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmManyToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithManyToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("manyToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- resourceManyToOne.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceManyToOne.getId());
- assertTrue(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceManyToOne.getMapsId());
- assertNull(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertEquals(Boolean.TRUE, resourceOneToOne.getId());
- assertTrue(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceOneToOne.getMapsId());
- assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceManyToOne.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceManyToOne.getId());
- assertTrue(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceManyToOne.getMapsId());
- assertNull(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 javaManyToOneMapping = ((JavaManyToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, ormJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getName());
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertEquals(0, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn ormJoinColumn = ormJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", ormJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", ormJoinColumn.getDefaultName());
- assertEquals("id", ormJoinColumn.getDefaultReferencedColumnName());
- JoinColumn inverseOrmJoinColumn = ormJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", inverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", inverseOrmJoinColumn.getDefaultName());
- assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("CATALOG", ormJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", ormJoinTable.getSpecifiedSchema());
- assertEquals(1, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- ormJoinColumn = ormJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", inverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", inverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaManyToOneMapping2_0 javaManyToOneMapping = (JavaManyToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.convertToVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address");
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute2.getMapping();
- 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()).getJoinTableStrategy().removeStrategy();
- ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(ormJoinTable);
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("BAR_FOO", ormJoinTable.getName());
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", ormJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", ormJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToOneMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertEquals(null, ((EclipseLinkJoinFetchMapping) ormManyToOneMapping).getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java
deleted file mode 100644
index fdae3b9339..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,2377 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmMappedSuperclassTests
- extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
- public EclipseLink2_0OrmMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMappedSuperclassForReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private void createTestMappedSuperclassSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestMappedSuperclassForConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- public void testUpdateReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to true, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to false, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testModifyReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to true, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to false, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to null, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(null);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceMappedSuperclass.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceMappedSuperclass.getCustomizer().setClassName(null);
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceMappedSuperclass.setCustomizer(null);
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceMappedSuperclass.setChangeTracking(null);
- javaContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCacheType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedType(EclipseLinkCacheType.WEAK);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set context cache type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getSpecifiedType());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
- }
-
- public void testUpdateCacheCoordinationType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheCoordinationType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context cache coordination type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context coordination type to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- }
-
-
- public void testUpdateCacheSize() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass xmlMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, xmlMappedSuperclass.getCache());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set xml cache, check defaults
- xmlMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, xmlMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set xml cache size, check settings
- xmlMappedSuperclass.getCache().setSize(new Integer(105));
- assertEquals(new Integer(105), xmlMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedSize(new Integer(50));
-
- assertEquals(new Integer(105), xmlMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
- // clear xml cache size, check defaults
- xmlMappedSuperclass.getCache().setSize(null);
-
- assertEquals(null, xmlMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // clear xml cache, check defaults
- xmlMappedSuperclass.setCache(null);
-
- assertEquals(null, xmlMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, xmlMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheSize() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(new Integer(50));
- assertEquals(new Integer(50), resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(50), ormContextCaching.getSpecifiedSize());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- }
-
- public void testUpdateCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set xml cache always refresh, check settings
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set java cache always refresh, check defaults
-
- javaContextCaching.setSpecifiedAlwaysRefresh(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testModifyCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testUpdateCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testModifyCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testUpdateCacheDisableHits() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedDisableHits(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedDisableHits());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testModifyCacheDisableHits() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testUpdateCacheShared() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setShared(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedShared());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testModifyCacheShared() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testUpdateExistenceChecking() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set xml existence checking, check settings
- resourceMappedSuperclass.setExistenceChecking(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
-
- // set java cache existence checking, check defaults
-
- javaContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // clear xml existence checking, check defaults
- resourceMappedSuperclass.setExistenceChecking(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyExistenceChecking() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set context cache existence checking, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // set context existence checking to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
- }
- public void testUpdateCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable2_0 = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlMappedSuperclass mappedSuperclassResource = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(null);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlMappedSuperclass mappedSuperclassResource = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
-
- mappedSuperclassResource.setCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getCacheable());
-
- mappedSuperclassResource.setCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getCacheable());
-
- mappedSuperclassResource.setCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromSuperType() throws Exception {
- createTestMappedSuperclass();
- createTestMappedSuperclassSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass subMappedSuperclass = (EclipseLinkMappedSuperclass) subOrmPersistentType.getMapping();
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subMappedSuperclass).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) mappedSuperclass).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromJava() throws Exception {
- createTestMappedSuperclass();
- createTestMappedSuperclassSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
-
- Cacheable2_0 javaCacheable = ((CacheableHolder2_0) ormPersistentType.getJavaPersistentType().getMapping()).getCacheable();
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromMappedSuperClass() throws Exception {
- createTestMappedSuperclass();
- createTestMappedSuperclassSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass subMappedSuperclass = (EclipseLinkMappedSuperclass) subOrmPersistentType.getMapping();
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subMappedSuperclass).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) mappedSuperclass).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java
deleted file mode 100644
index be00bbaa49..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,1186 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.EnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.TemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-/**
- * EclipseLink2_0OrmOneToManyMappingTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmOneToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmOneToManyMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithValidOneToManyMapping() throws Exception {
- this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 oneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
-
- oneToManyResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 oneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualOneToManyMapping.getSpecifiedMapKey());
- assertNull(virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertTrue(virtualOneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualOneToManyMapping.getMapKey());
- assertTrue(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualOneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertTrue(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
-
- //set metadata complete and verify that the orm model ignores the java annotations
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- assertEquals(null, virtualOneToManyMapping.getSpecifiedMapKey());
- assertEquals(null, virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertTrue(virtualOneToManyMapping.isNoMapKey());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").convertToSpecified();
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(oneToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKeyClass().setClassName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass().getClassName());
-
- oneToMany.getMapKeyClass().setClassName("String");
- oneToMany.setMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualOneToManyMapping.getMapKeyClass());
- assertEquals("Integer", virtualOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getDefaultMapKeyClass());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualOneToManyMapping = (OneToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- assertEquals(null, virtualOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- 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().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queue");
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- OrmPersistentType printJobPersistentType = (OrmPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- 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();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("jobs");
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentAttribute2.getMapping();
- orderable = ((Orderable2_0) virtualOneToManyMapping.getOrderable());
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- OneToManyMapping2_0 addressesVirtualMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", ormColumn.getName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertTrue(ormColumn.isInsertable());
- assertTrue(ormColumn.isUpdatable());
- assertTrue(ormColumn.isNullable());
- assertFalse(ormColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getScale());
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", ormColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), ormColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- OneToManyMapping2_0 addressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesMapping.getMapKeyColumn();
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
-
- assertEquals("addresses_KEY", ormColumn.getName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertTrue(ormColumn.isInsertable());
- assertTrue(ormColumn.isUpdatable());
- assertTrue(ormColumn.isNullable());
- assertFalse(ormColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getScale());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
-
- OrmOneToManyMapping2_0 addressesVirtualMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- OneToManyMapping2_0 addressesVirtualMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", ormColumn.getTable());
-
- //set Column table element in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", ormColumn.getTable());
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
- OrmOneToManyMapping2_0 addressesMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesMapping.getMapKeyColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", ormColumn.getDefaultTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- 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.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.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.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- 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.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- JoinColumn joinColumn = ((OneToManyRelationship2_0) virtualOneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.convertToSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn());
-
- ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- joinColumn = ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertFalse(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_KEY", virtualOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", virtualOneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", virtualOneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", virtualOneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", virtualOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", virtualOneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", virtualOneToManyMapping.getMapKeyColumn().getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.convertToSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn());
-
- ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- assertEquals("addresses_KEY", ormOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", ormOneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_KEY", ormOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", ormOneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- ormOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- assertEquals("addresses_KEY", ormOneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("FOO", ormOneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", ormOneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) virtualOneToManyMapping.getOrderable()).getOrderColumn();
-
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
-
- //override the mapping in orm.xml
- persistentAttribute.convertToSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn());
-
- ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- assertFalse(((Orderable2_0) ormOneToManyMapping.getOrderable()).isOrderColumnOrdering());
- ((Orderable2_0) ormOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- orderColumn = ((Orderable2_0) ormOneToManyMapping.getOrderable()).getOrderColumn();
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- assertEquals(EclipseLinkJoinFetchType.INNER, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToManyMapping.getFetch());
- assertEquals("test.Address", virtualOneToManyMapping.getTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertFalse(((OrphanRemovalHolder2_0) virtualOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- assertEquals(null, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
-
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- oneToManyResource.setMapKeyEnumerated(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(EnumeratedConverter.class);
- ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((EnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyEnumerated());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, oneToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- oneToManyResource.setMapKeyTemporal(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(TemporalConverter.class);
- ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((TemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyTemporal());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java
deleted file mode 100644
index 1ca159cdcd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,910 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmOneToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmOneToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" @PrivateOwned)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("oneToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- resourceOneToOne.setMapsId("foo");
- assertNull(resourceOneToOne.getId());
- assertFalse(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceOneToOne.getMapsId());
- assertEquals("foo", ((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- assertNull(resourceManyToOne.getId());
- assertFalse(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceManyToOne.getMapsId());
- assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertNull(resourceOneToOne.getId());
- assertFalse(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceOneToOne.getMapsId());
- assertEquals("foo", ((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToOneResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
-
- oneToOneResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping");
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 javaOneToOneMapping = ((JavaOneToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", virtualJoinTable.getName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
- JoinColumn virtualInverseOrmJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualInverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", virtualInverseOrmJoinColumn.getDefaultName());
- assertEquals("id", virtualInverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- virtualJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- virtualInverseOrmJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", virtualInverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", virtualInverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaOneToOneMapping2_0 javaOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.convertToVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address");
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute2.getMapping();
- 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()).getJoinTableStrategy().removeStrategy();
- virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable);
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("BAR_FOO", virtualJoinTable.getName());
- assertEquals("BAR_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- EclipseLinkOneToOneMapping2_0 virtualOneToOneMapping = (EclipseLinkOneToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn ormJoinColumn =
- virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", ormJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", ormJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", ormJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, virtualOneToOneMapping.getJoinFetch().getValue());
- assertTrue(virtualOneToOneMapping.getPrivateOwned().isPrivateOwned());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- EclipseLinkOneToOneMapping2_0 ormOneToOneMapping = (EclipseLinkOneToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertEquals(null, ormOneToOneMapping.getJoinFetch().getValue());
- assertFalse(ormOneToOneMapping.getPrivateOwned().isPrivateOwned());
-
- assertFalse(((OrphanRemovalHolder2_0) ormOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java
deleted file mode 100644
index 8a943a6d6c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_3ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_3OrmMultitenancyTests
- extends EclipseLink2_3ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_3OrmMultitenancyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"MS_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantRootEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.ENTITY,
- JPA.INHERITANCE,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritenace").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"ROOT_ENTITY_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
-
- //set type in the resource model, verify context model updated
- multitenantResource.setType(MultitenantType.SINGLE_TABLE);
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.SINGLE_TABLE, multitenantResource.getType());
-
- //set type to null in the resource model
- multitenantResource.setType(null);
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
-
- multitenantResource.setType(MultitenantType.TABLE_PER_TENANT);
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.TABLE_PER_TENANT, multitenantResource.getType());
-
- multitenantResource.setType(MultitenantType.VPD);
- assertEquals(EclipseLinkMultitenantType2_3.VPD, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.VPD, multitenantResource.getType());
-
- multitenantHolder.setMultitenant(null);
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(ormMultitenancy.getType());
- assertNull(multitenantHolder.getMultitenant());
- }
-
- public void testModifySpecifiedType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
-
- //set type in the context model, verify resource model modified
- ormMultitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.SINGLE_TABLE, multitenantResource.getType());
-
- ormMultitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.VPD);
- assertEquals(EclipseLinkMultitenantType2_3.VPD, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.VPD, multitenantResource.getType());
-
- ormMultitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.TABLE_PER_TENANT, multitenantResource.getType());
-
- //set type to null in the context model
- ormMultitenancy.setSpecifiedType(null);
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
- }
-
-// public void testUpdateSpecifiedIncludeCriteria() throws Exception {
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
-// XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
-// multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-//
-// OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
-// XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-//
-// assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
-// assertNull(multitenantResource.getIncludeCriteria());
-//
-// //set enumerated in the resource model, verify context model updated
-// multitenantResource.setIncludeCriteria(Boolean.TRUE);
-// assertEquals(Boolean.TRUE, ormMultitenancy.getSpecifiedIncludeCriteria());
-// assertEquals(Boolean.TRUE, multitenantResource.getIncludeCriteria());
-//
-// multitenantResource.setIncludeCriteria(Boolean.FALSE);
-// assertEquals(Boolean.FALSE, ormMultitenancy.getSpecifiedIncludeCriteria());
-// assertEquals(Boolean.FALSE, multitenantResource.getIncludeCriteria());
-//
-// //set enumerated to null in the resource model
-// multitenantResource.setIncludeCriteria(null);
-// assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
-// assertNull(multitenantResource.getIncludeCriteria());
-// }
-//
-// public void testModifySpecifiedIncludeCriteria() throws Exception {
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
-// XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
-// multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-//
-// OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
-// XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-//
-// assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
-// assertNull(multitenantResource.getIncludeCriteria());
-//
-// //set enumerated in the context model, verify resource model updated
-// ormMultitenancy.setSpecifiedIncludeCriteria(Boolean.TRUE);
-// assertEquals(Boolean.TRUE, multitenantResource.getIncludeCriteria());
-// assertEquals(Boolean.TRUE, ormMultitenancy.getSpecifiedIncludeCriteria());
-//
-// ormMultitenancy.setSpecifiedIncludeCriteria(Boolean.FALSE);
-// assertEquals(Boolean.FALSE, multitenantResource.getIncludeCriteria());
-// assertEquals(Boolean.FALSE, ormMultitenancy.getSpecifiedIncludeCriteria());
-//
-// //set enumerated to null in the context model
-// ormMultitenancy.setSpecifiedIncludeCriteria(null);
-// assertNull(multitenantResource.getIncludeCriteria());
-// assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
-// }
-
- public void testAddSpecifiedTenantDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn = ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0);
- tenantDiscriminatorColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
-
- OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn2 = ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0);
- tenantDiscriminatorColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
-
- OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn3 = ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(1);
- tenantDiscriminatorColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(2).getName());
-
- ListIterator<OrmTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals(tenantDiscriminatorColumn2, tenantDiscriminatorColumns.next());
- assertEquals(tenantDiscriminatorColumn3, tenantDiscriminatorColumns.next());
- assertEquals(tenantDiscriminatorColumn, tenantDiscriminatorColumns.next());
-
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- }
-
- public void testRemoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, multitenantResource.getTenantDiscriminatorColumns().size());
-
- ormMultitenancy.removeSpecifiedTenantDiscriminatorColumn(0);
- assertEquals(2, multitenantResource.getTenantDiscriminatorColumns().size());
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
-
- ormMultitenancy.removeSpecifiedTenantDiscriminatorColumn(0);
- assertEquals(1, multitenantResource.getTenantDiscriminatorColumns().size());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
-
- ormMultitenancy.removeSpecifiedTenantDiscriminatorColumn(0);
- assertEquals(0, multitenantResource.getTenantDiscriminatorColumns().size());
- }
-
- public void testMoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, multitenantResource.getTenantDiscriminatorColumns().size());
-
-
- ormMultitenancy.moveSpecifiedTenantDiscriminatorColumn(2, 0);
- ListIterator<OrmTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
-
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(2).getName());
-
-
- ormMultitenancy.moveSpecifiedTenantDiscriminatorColumn(0, 1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
-
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(2).getName());
- }
-
- public void testUpdateTenantDiscriminatorColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- multitenantResource.getTenantDiscriminatorColumns().add(EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn());
- multitenantResource.getTenantDiscriminatorColumns().add(EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn());
- multitenantResource.getTenantDiscriminatorColumns().add(EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn());
-
- multitenantResource.getTenantDiscriminatorColumns().get(0).setName("FOO");
- multitenantResource.getTenantDiscriminatorColumns().get(1).setName("BAR");
- multitenantResource.getTenantDiscriminatorColumns().get(2).setName("BAZ");
-
- ListIterator<OrmTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().move(2, 0);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().move(0, 1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().remove(1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().remove(1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().remove(0);
- assertFalse(ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator().hasNext());
- }
-
- //MappedSuperclass specifies multitenancy, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithMappedSuperclass() throws Exception {
- createTestMultitenantMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormPersistentType2 = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType2.getMapping()).getMultitenancy();
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("MS_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if the entity specifies multitenant, then it does not get the tenant discriminator columns from the mapped superclass
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
-
- multitenancy.setSpecifiedMultitenant(false);
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- OrmEclipseLinkMultitenancy2_3 mappedSuperclassMultitenancy = ((OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping()).getMultitenancy();
- mappedSuperclassMultitenancy.setSpecifiedMultitenant(true);
- mappedSuperclassMultitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("MS_TENANT_ID");
-
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("MS_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- //Root entity specifies multitenancy and SINGLE_TABLE inheritance, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithInheritance() throws Exception {
- createTestMultitenantRootEntity();
- createTestSubType();
-
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //get the default tenant discriminator column from the persistence unit defaults instead of the root entity since inheritance strategy is table per class
- multitenancy.setSpecifiedMultitenant(true);
- assertTrue(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("CHILD_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- public void testTenantDiscriminatorColumnsWithPersistenceUnitDefaults() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if there are specified tenant discriminator columns then there should not be any default ones
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("ENTITY_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals(0, multitenancy.getDefaultTenantDiscriminatorColumnsSize());
- assertEquals("ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
- }
-
- public void testTenantDiscriminatorColumnsWithEntityMappingsDefaults() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntityMappings entityMappings = (EclipseLinkEntityMappings) getMappingFile().getRoot();
- entityMappings.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("EM_TENANT_ID");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //if entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- public void testTenantDiscriminatorColumnsWithJavaMultitenant() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ((EclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getMultitenancy().setSpecifiedMultitenant(true);
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertTrue(multitenancy.isMultitenant()); //isMultitenant is true because the java entity specifies @Multitenant
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- EclipseLinkEntityMappings entityMappings = (EclipseLinkEntityMappings) getMappingFile().getRoot();
- entityMappings.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("EM_TENANT_ID");
-
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
-
- OrmPersistenceUnitMetadata persistenceUnitMetadata = (OrmPersistenceUnitMetadata) getMappingFile().getRoot().getPersistenceUnitMetadata();
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java
deleted file mode 100644
index 4560c5a451..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java
+++ /dev/null
@@ -1,677 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkEntityMappingsTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkEntityMappingsTests(String name) {
- super(name);
- }
-
-
- public void testUpdateCustomConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntityMappings.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntityMappings.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals("Foo", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceEntityMappings.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals("Foo", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceEntityMappings.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntityMappings.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntityMappings.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceEntityMappings.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceEntityMappings.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntityMappings.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntityMappings.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntityMappings.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntityMappings.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntityMappings.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntityMappings.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceEntityMappings.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceEntityMappings.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java
deleted file mode 100644
index 6e10f4f023..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmBasicMappingTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableBasicDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkOrmBasicMappingTests(String name) {
- super(name);
- }
-
-
- public void testUpdateMutable() throws Exception {
- createTestEntityWithBasicMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmEclipseLinkBasicMapping contextBasic =
- (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlBasic resourceBasic =
- (XmlBasic) resourceEntity.getAttributes().getBasics().get(0);
- EclipseLinkBasicMapping javaBasicMapping = (EclipseLinkBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- // check defaults
-
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceBasic.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceBasic.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceBasic.setMutable(null);
-
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // TODO - test defaults for java serializable and date/time types,
- // with and without persistence property
-
- // set mutable on java basic mapping
-
- javaBasicMapping.getMutable().setSpecifiedMutable(Boolean.FALSE);
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
- assertFalse(javaBasicMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceBasic.getMutable());
- assertTrue(virtualContextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, virtualContextBasic.getMutable().getSpecifiedMutable());
- assertFalse(virtualContextBasic.getMutable().isMutable());
- assertFalse(javaBasicMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceBasic.getMutable());
- assertTrue(virtualContextBasic.getMutable().isDefaultMutable());
- assertNull(virtualContextBasic.getMutable().getSpecifiedMutable());
- assertTrue(virtualContextBasic.getMutable().isMutable());
- assertFalse(javaBasicMapping.getMutable().isMutable());
- }
-
- public void testUpdateMutableDate() throws Exception {
- createTestEntityWithMutableBasicDate();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "myDate");
- OrmEclipseLinkBasicMapping contextBasic =
- (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlBasic resourceBasic =
- (XmlBasic) resourceEntity.getAttributes().getBasics().get(0);
- EclipseLinkBasicMapping javaBasicMapping = (EclipseLinkBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("myDate").getMapping();
-
- // check defaults
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceBasic.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceBasic.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceBasic.setMutable(null);
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set mutable on java basic mapping
-
- javaBasicMapping.getMutable().setSpecifiedMutable(Boolean.TRUE);
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
- assertTrue(javaBasicMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkBasicMapping virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceBasic.getMutable());
- assertFalse(virtualContextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, virtualContextBasic.getMutable().getSpecifiedMutable());
- assertTrue(virtualContextBasic.getMutable().isMutable());
- assertTrue(javaBasicMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceBasic.getMutable());
- assertFalse(virtualContextBasic.getMutable().isDefaultMutable());
- assertNull(virtualContextBasic.getMutable().getSpecifiedMutable());
- assertFalse(virtualContextBasic.getMutable().isMutable());
- assertTrue(javaBasicMapping.getMutable().isMutable());
- }
-
- public void testModifyMutable() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic");
- OrmEclipseLinkBasicMapping contextBasic =
- (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlBasic resourceBasic =
- (XmlBasic) resourceEntity.getAttributes().getBasics().get(0);
-
- // check defaults
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set context mutable to true, check resource
-
- contextBasic.getMutable().setSpecifiedMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // set context mutable to false, check resource
-
- contextBasic.getMutable().setSpecifiedMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set context mutable to null, check resource
-
- contextBasic.getMutable().setSpecifiedMutable(null);
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = (XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormBasicMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaBasicMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping virtualBasicMapping = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualBasicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaBasicMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualBasicMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
- javaBasicMapping.setConverter(null);
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertNull(javaBasicMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = (XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormBasicMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormBasicMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormBasicMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob to false in the context model
- ormBasicMapping.setConverter(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java
deleted file mode 100644
index 868065b582..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmCachingTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- public EclipseLinkOrmCachingTests(String name) {
- super(name);
- }
-
- public void testSetSpecifiedShared() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedShared());
- assertEquals(false, entity.getCaching().isShared());
-
-
- }
-
- public void testSetSpecifiedSharedFalseUnsetsOtherCacheSettings() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- caching.setSpecifiedSize(Integer.valueOf(500));
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.FALSE);
- caching.setSpecifiedDisableHits(Boolean.FALSE);
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.CHECK_CACHE);
- caching.setExpiry(Integer.valueOf(8000));
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(null, caching.getSpecifiedType());
- assertEquals(null, caching.getSpecifiedSize());
- assertEquals(null, caching.getSpecifiedAlwaysRefresh());
- assertEquals(null, caching.getSpecifiedRefreshOnlyIfNewer());
- assertEquals(null, caching.getSpecifiedDisableHits());
- assertEquals(null, caching.getSpecifiedCoordinationType());
- assertEquals(null, caching.getExpiry());
-
-
- //existence checking is the only thing that isn't unset when shared is set to false
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getSpecifiedExistenceType());
-
- caching.setSpecifiedShared(null);
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
- timeOfDayExpiry.setHour(Integer.valueOf(5));
-
- caching.setSpecifiedShared(Boolean.FALSE);
- assertNull(caching.getExpiryTimeOfDay());
-
- }
-
- public void testGetDefaultShared() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertTrue(caching.isDefaultShared());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT, "false");
-
- assertFalse(caching.isDefaultShared());
- }
-
- public void testGetSpecifiedShared() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- }
-
- public void testSetSpecifiedType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
-
-
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getSpecifiedType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getType());
-
- caching.setSpecifiedType(EclipseLinkCacheType.SOFT_WEAK);
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getSpecifiedType());
-
- caching.setSpecifiedType(null);
- assertNull(caching.getSpecifiedType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
- }
-
- public void testGetDefaultType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getDefaultType());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT, EclipseLinkCacheType.FULL.toString());
-
- assertEquals(EclipseLinkCacheType.FULL, caching.getDefaultType());
- }
-
- public void testGetSpecifiedType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- }
-
- public void testSetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedAlwaysRefresh());
- assertEquals(false, entity.getCaching().isAlwaysRefresh());
-
- }
-
- public void testGetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- }
-
- public void testSetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedRefreshOnlyIfNewer());
- assertEquals(true, entity.getCaching().isRefreshOnlyIfNewer());
-
- }
-
- public void testGetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- }
-
- public void testSetSpecifiedDisableHits() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- caching.setSpecifiedDisableHits(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedDisableHits());
- assertEquals(true, entity.getCaching().isDisableHits());
-
- }
-
- public void testGetSpecifiedDisableHits() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- }
-
- public void testSetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
-
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
-
-
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getCoordinationType());
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES);
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getSpecifiedCoordinationType());
-
- caching.setSpecifiedCoordinationType(null);
- assertNull(caching.getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
- }
-
- public void testGetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
- }
-
- public void testGetExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
-
- assertNull(entity.getCaching().getExpiry());
-
- }
-
- public void testSetExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.setExpiry(Integer.valueOf(58));
- assertEquals(Integer.valueOf(58), caching.getExpiry());
-
-
- caching.setExpiry(null);
- assertNull(caching.getExpiry());
- }
-
- public void testSetExpiryUnsetsExpiryTimeOfDay() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.addExpiryTimeOfDay();
- caching.getExpiryTimeOfDay().setHour(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), caching.getExpiryTimeOfDay().getHour());
-
- caching.setExpiry(Integer.valueOf(900));
-
- assertNull(caching.getExpiryTimeOfDay());
- assertEquals(Integer.valueOf(900), caching.getExpiry());
- }
-
- public void testGetTimeOfDayExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
-
- assertNotNull(caching.getExpiryTimeOfDay());
- assertEquals(timeOfDayExpiry, caching.getExpiryTimeOfDay());
- }
-
- public void testRemoveTimeOfDayExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiryUnsetsExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.setExpiry(Integer.valueOf(800));
- assertEquals(Integer.valueOf(800), caching.getExpiry());
-
- caching.addExpiryTimeOfDay();
-
- assertNull(caching.getExpiry());
- assertNotNull(caching.getExpiryTimeOfDay());
- }
-
-
- public void testSetSpecifiedSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- caching.setSpecifiedSize(new Integer(50));
-
-
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
- }
-
- public void testGetDefaultSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getDefaultSize());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT, "333");
-
- assertEquals(333, caching.getDefaultSize());
- }
-
- public void testGetSpecifiedSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- caching.setSpecifiedSize(new Integer(50));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
- }
-
- public void testSetSpecifiedIsolation() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
- XmlCache xmlCache = entity.getXmlTypeMapping().getCache();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(xmlCache);
-
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.PROTECTED);
- xmlCache = entity.getXmlTypeMapping().getCache();
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getIsolation());
- assertEquals(CacheIsolationType.PROTECTED, xmlCache.getIsolation());
-
- //set specified isolation to the same as the default, verify it is not set to default
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.SHARED);
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertEquals(CacheIsolationType.SHARED, xmlCache.getIsolation());
-
- caching.setSpecifiedIsolation(null);
- xmlCache = entity.getXmlTypeMapping().getCache();
- assertNull(caching.getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(xmlCache);
- }
-
- public void testGetSpecifiedIsolation() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
- XmlCache xmlCache = entity.getXmlTypeMapping().getCache();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(xmlCache);
-
- entity.getXmlTypeMapping().setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- xmlCache = entity.getXmlTypeMapping().getCache();
- xmlCache.setIsolation(CacheIsolationType.ISOLATED);
- assertEquals(EclipseLinkCacheIsolationType2_2.ISOLATED, caching.getIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.ISOLATED, caching.getSpecifiedIsolation());
-
- xmlCache.setIsolation(CacheIsolationType.PROTECTED);
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, caching.getIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, caching.getSpecifiedIsolation());
-
- xmlCache.setIsolation(null);
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(caching.getSpecifiedIsolation());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java
deleted file mode 100644
index 5eb33082fd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @Converter");
- }
- });
- }
-
-
- public EclipseLinkOrmConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateConverterClass() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkCustomConverter.class);
- OrmEclipseLinkCustomConverter ormConverter = (OrmEclipseLinkCustomConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setClassName("myConvert");
- assertEquals("myConvert", ormConverter.getConverterClass());
- assertEquals("myConvert", converterResource.getClassName());
-
- //set converter class name to null in the resource model
- converterResource.setClassName(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- EclipseLinkCustomConverter virtualConverter = (EclipseLinkCustomConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkCustomConverter javaConverter = ((EclipseLinkCustomConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setConverterClass("bar");
-
- assertNull(virtualConverter);
- assertEquals("bar", javaConverter.getConverterClass());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getConverterClass());
- }
-
- public void testModifyConverterClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkCustomConverter.class);
- OrmEclipseLinkCustomConverter ormConverter = (OrmEclipseLinkCustomConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverter();
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setConverterClass("foo");
- assertEquals("foo", ormConverter.getConverterClass());
- assertEquals("foo", converterResource.getClassName());
-
- ormConverter.setConverterClass(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkCustomConverter.class);
- OrmEclipseLinkCustomConverter ormConverter = (OrmEclipseLinkCustomConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- EclipseLinkCustomConverter virtualConverter = (EclipseLinkCustomConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkCustomConverter javaConverter = ((EclipseLinkCustomConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
-
- assertNull(virtualConverter);
- assertEquals("bar", javaConverter.getName());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkCustomConverter.class);
- OrmEclipseLinkCustomConverter ormConverter = (OrmEclipseLinkCustomConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverter();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java
deleted file mode 100644
index 1c1310d299..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java
+++ /dev/null
@@ -1,1037 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmEmbeddableTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmEmbeddableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddableForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CUSTOMIZER);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForCustomConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestEmbeddableForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEmbeddable javaContextEmbeddable = (JavaEclipseLinkEmbeddable) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
-
- // check defaults
-
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceEmbeddable.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceEmbeddable.getCustomizer().getClassName());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceEmbeddable.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEmbeddable.getCustomizer().getClassName());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceEmbeddable.getCustomizer().setClassName(null);
- javaContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("bar", javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("bar", javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceEmbeddable.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("bar", javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceEmbeddable.setCustomizer(null);
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestEmbeddableForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- // check defaults
-
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestEmbeddableForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEmbeddable javaContextEmbeddable = (JavaEclipseLinkEmbeddable) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- // check defaults
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceEmbeddable.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceEmbeddable.setChangeTracking(null);
- javaContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(null);
- resourceEmbeddable.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestEmbeddableForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- // check defaults
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCustomConverters() throws Exception {
- createTestEmbeddableForCustomConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEmbeddable.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEmbeddable.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestEmbeddableForCustomConverters();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEmbeddable.getConverters().size());
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals("Foo", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceEmbeddable.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals("Foo", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceEmbeddable.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
-
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestEmbeddableForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEmbeddable.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEmbeddable.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestEmbeddableForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceEmbeddable.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceEmbeddable.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestEmbeddableForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEmbeddable.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEmbeddable.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestEmbeddableForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceEmbeddable.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEmbeddable.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestEmbeddableForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEmbeddable.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEmbeddable.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestEmbeddableForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceEmbeddable.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceEmbeddable.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java
deleted file mode 100644
index 403a9d184b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java
+++ /dev/null
@@ -1,2395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmEntityTests
- extends EclipseLinkContextModelTestCase
-{
-
- public EclipseLinkOrmEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityForReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForCaching() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- public void testUpdateReadOnly() throws Exception {
- createTestEntityForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEntity javaContextEntity = (JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceEntity.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceEntity.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to true, check defaults
-
- resourceEntity.setReadOnly(null);
- javaContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertNull(resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- // set xml read only to false, check override
-
- resourceEntity.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceEntity.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to false, check defaults
-
- resourceEntity.setReadOnly(null);
- javaContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
-
-
- // set xml read only to false, check override
-
- resourceEntity.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceEntity.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testModifyReadOnly() throws Exception {
- createTestEntityForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to true, check resource
-
- ormContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to false, check resource
-
- ormContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to null, check resource
-
- ormContextEntity.getReadOnly().setSpecifiedReadOnly(null);
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
- }
-
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestEntityForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEntity javaContextEntity = (JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertNull(resourceEntity.getCustomizer());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceEntity.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceEntity.getCustomizer().getClassName());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceEntity.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEntity.getCustomizer().getClassName());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceEntity.getCustomizer().setClassName(null);
- javaContextEntity.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceEntity.getCustomizer().getClassName());
- assertEquals("bar", javaContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEntity.getCustomizer().getClassName());
- assertEquals("bar", javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceEntity.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEntity.getCustomizer().getClassName());
- assertEquals("bar", javaContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextEntity.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceEntity.setCustomizer(null);
- assertNull(resourceEntity.getCustomizer());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestEntityForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getCustomizer());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextEntity.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceEntity.getCustomizer().getClassName());
- assertEquals("foo", ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextEntity.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceEntity.getCustomizer());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestEntityForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEntity javaContextEntity = (JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceEntity.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceEntity.setChangeTracking(null);
- javaContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- resourceEntity.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestEntityForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCacheType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set xml cache type, check settings
- resourceEntity.getCache().setType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedType(EclipseLinkCacheType.WEAK);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
- // clear xml cache type, check defaults
- resourceEntity.getCache().setType(null);
-
- assertEquals(null, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set context cache type, check resource
-
- ormContextEntity.getCaching().setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getSpecifiedType());
-
- // set context customizer to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedType(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
- }
-
- public void testUpdateCacheCoordinationType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set xml cache type, check settings
- resourceEntity.getCache().setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
- // clear xml cache type, check defaults
- resourceEntity.getCache().setCoordinationType(null);
-
- assertEquals(null, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheCoordinationType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context cache coordination type, check resource
-
- ormContextEntity.getCaching().setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context coordination type to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedCoordinationType(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- }
-
-
- public void testUpdateCacheSize() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity xmlEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, xmlEntity.getCache());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set xml cache, check defaults
- xmlEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, xmlEntity.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set xml cache size, check settings
- xmlEntity.getCache().setSize(new Integer(105));
- assertEquals(new Integer(105), xmlEntity.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedSize(new Integer(50));
-
- assertEquals(new Integer(105), xmlEntity.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
- // clear xml cache size, check defaults
- xmlEntity.getCache().setSize(null);
-
- assertEquals(null, xmlEntity.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // clear xml cache, check defaults
- xmlEntity.setCache(null);
-
- assertEquals(null, xmlEntity.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, xmlEntity.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheSize() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedSize(new Integer(50));
- assertEquals(new Integer(50), resourceEntity.getCache().getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(50), ormContextCaching.getSpecifiedSize());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedSize(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- }
-
- public void testUpdateCacheAlwaysRefresh() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set xml cache always refresh, check settings
- resourceEntity.getCache().setAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set java cache always refresh, check defaults
-
- javaContextCaching.setSpecifiedAlwaysRefresh(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setAlwaysRefresh(null);
-
- assertEquals(null, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testModifyCacheAlwaysRefresh() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedAlwaysRefresh(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testUpdateCacheRefreshOnlyIfNewer() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set xml cache size, check settings
- resourceEntity.getCache().setRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testModifyCacheRefreshOnlyIfNewer() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testUpdateCacheDisableHits() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set xml cache size, check settings
- resourceEntity.getCache().setDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedDisableHits(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedDisableHits());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setDisableHits(null);
-
- assertEquals(null, resourceEntity.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testModifyCacheDisableHits() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedDisableHits(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testUpdateCacheShared() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set xml cache size, check settings
- resourceEntity.getCache().setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setShared(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedShared());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setShared(null);
-
- assertEquals(null, resourceEntity.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testModifyCacheShared() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedShared(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
- public void testSetSpecifiedSharedFalseUnsetsOtherCacheSettings() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- ormContextCaching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- ormContextCaching.setSpecifiedSize(Integer.valueOf(500));
- ormContextCaching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
- ormContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.FALSE);
- ormContextCaching.setSpecifiedDisableHits(Boolean.FALSE);
- ormContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- ormContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
- ormContextCaching.setExpiry(Integer.valueOf(8000));
-
- ormContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(null, ormContextCaching.getSpecifiedType());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- //existence checking is the only thing that isn't unset when shared is set to false
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextCaching.setSpecifiedShared(null);
- EclipseLinkTimeOfDay timeOfDayExpiry = ormContextCaching.addExpiryTimeOfDay();
- timeOfDayExpiry.setHour(Integer.valueOf(5));
-
- ormContextCaching.setSpecifiedShared(Boolean.FALSE);
- assertNull(ormContextCaching.getExpiryTimeOfDay());
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertNull(resourceEntity.getCache().getExpiryTimeOfDay());
- }
-
- public void testUpdateExistenceChecking() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set xml existence checking, check settings
- resourceEntity.setExistenceChecking(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
-
- // set java cache existence checking, check defaults
-
- javaContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // clear xml existence checking, check defaults
- resourceEntity.setExistenceChecking(null);
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyExistenceChecking() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set context cache existence checking, check resource
-
- ormContextEntity.getCaching().setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // set context existence checking to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedExistenceType(null);
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
- }
-
- public void testUpdateCacheExpiry() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getExpiry());
- assertEquals(null, javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // set xml cache expiry, check settings
- resourceEntity.getCache().setExpiry(new Integer(45));
- assertEquals(new Integer(45), resourceEntity.getCache().getExpiry());
- assertEquals(null, javaContextCaching.getExpiry());
- assertEquals(new Integer(45), ormContextCaching.getExpiry());
-
-
- // set java cache expiry, check defaults
-
- javaContextCaching.setExpiry(new Integer(55));
-
- assertEquals(new Integer(45), resourceEntity.getCache().getExpiry());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(new Integer(45), ormContextCaching.getExpiry());
-
- // clear xml cache expiry to null, check defaults
- resourceEntity.getCache().setExpiry(null);
-
- assertEquals(null, resourceEntity.getCache().getExpiry());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
- }
-
- public void testModifyCacheExpiry() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiry());
-
- // set context cache expiry, check resource
-
- ormContextEntity.getCaching().setExpiry(new Integer(60));
- assertEquals(new Integer(60), resourceEntity.getCache().getExpiry());
- assertEquals(new Integer(60), ormContextCaching.getExpiry());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setExpiry(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiry());
- }
-
- public void testUpdateCacheExpiryTimeOfDay() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, javaContextCaching.getExpiryTimeOfDay());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getExpiryTimeOfDay());
- assertEquals(null, javaContextCaching.getExpiryTimeOfDay());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // set xml cache expiry, check settings
- resourceEntity.getCache().setExpiryTimeOfDay(EclipseLinkOrmFactory.eINSTANCE.createXmlTimeOfDay());
- resourceEntity.getCache().getExpiryTimeOfDay().setHour(new Integer(10));
- assertEquals(new Integer(10), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(null, javaContextCaching.getExpiryTimeOfDay());
- assertEquals(new Integer(10), ormContextCaching.getExpiryTimeOfDay().getHour());
-
-
- // set java cache expiry, check defaults
-
- javaContextCaching.addExpiryTimeOfDay();
- javaContextCaching.getExpiryTimeOfDay().setHour(new Integer(12));
-
- assertEquals(new Integer(10), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(10), ormContextCaching.getExpiryTimeOfDay().getHour());
-
- // clear xml cache expiry to null, check defaults
- resourceEntity.getCache().setExpiryTimeOfDay(null);
-
- assertEquals(null, resourceEntity.getCache().getExpiryTimeOfDay());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
- }
-
- public void testModifyCacheExpiryTimeOfDay() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
- // set context cache expiry, check resource
-
- ormContextEntity.getCaching().addExpiryTimeOfDay().setHour(new Integer(12));
- assertEquals(new Integer(12), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(12), ormContextCaching.getExpiryTimeOfDay().getHour());
-
- // set context expiry time of day minute, check resource
-
- ormContextEntity.getCaching().getExpiryTimeOfDay().setMinute(new Integer(35));
-
- assertEquals(new Integer(12), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(12), ormContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(35), resourceEntity.getCache().getExpiryTimeOfDay().getMinute());
- assertEquals(new Integer(35), ormContextCaching.getExpiryTimeOfDay().getMinute());
-
- // set context expiry time of day null, check resource
-
- ormContextEntity.getCaching().removeExpiryTimeOfDay();
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
- }
-
- public void testUpdateCustomConverters() throws Exception {
- createTestEntityForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntity.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntity.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestEntityForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals("Foo", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntity.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals("Foo2", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntity.getConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceEntity.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals("Foo", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntity.getConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceEntity.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals("Foo2", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntity.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestEntityForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntity.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntity.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestEntityForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals("Foo", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceEntity.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals("Foo", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceEntity.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestEntityForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntity.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntity.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestEntityForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntity.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntity.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestEntityForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntity.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntity.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestEntityForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals("Foo", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntity.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals("Foo2", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntity.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceEntity.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals("Foo", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntity.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceEntity.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals("Foo2", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntity.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java
deleted file mode 100644
index 10d438bc29..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmIdMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmIdMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableIdDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public void testUpdateMutable() throws Exception {
- createTestEntityWithIdMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
- OrmEclipseLinkIdMapping contextId =
- (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlId resourceId =
- (XmlId) resourceEntity.getAttributes().getIds().get(0);
- EclipseLinkIdMapping javaIdMapping = (EclipseLinkIdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- // check defaults
-
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceId.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceId.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceId.setMutable(null);
-
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // TODO - test defaults for java serializable and date/time types,
- // with and without persistence property
-
- // set mutable on java basic mapping
-
- javaIdMapping.getMutable().setSpecifiedMutable(Boolean.FALSE);
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
- assertFalse(javaIdMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkIdMapping virtualIdMapping = (EclipseLinkIdMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceId.getMutable());
- assertTrue(virtualIdMapping.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, virtualIdMapping.getMutable().getSpecifiedMutable());
- assertFalse(virtualIdMapping.getMutable().isMutable());
- assertFalse(javaIdMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping virtualBasicMapping = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceId.getMutable());
- assertTrue(virtualBasicMapping.getMutable().isDefaultMutable());
- assertNull(virtualBasicMapping.getMutable().getSpecifiedMutable());
- assertTrue(virtualBasicMapping.getMutable().isMutable());
- assertFalse(javaIdMapping.getMutable().isMutable());
- }
-
- public void testUpdateMutableDate() throws Exception {
- createTestEntityWithMutableIdDate();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "myDate");
- OrmEclipseLinkIdMapping contextId =
- (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlId resourceId =
- (XmlId) resourceEntity.getAttributes().getIds().get(0);
- EclipseLinkIdMapping javaIdMapping = (EclipseLinkIdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("myDate").getMapping();
-
- // check defaults
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceId.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceId.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceId.setMutable(null);
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set mutable on java id mapping
-
- javaIdMapping.getMutable().setSpecifiedMutable(Boolean.TRUE);
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
- assertTrue(javaIdMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkIdMapping virtualIdMapping = (EclipseLinkIdMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceId.getMutable());
- assertFalse(virtualIdMapping.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, virtualIdMapping.getMutable().getSpecifiedMutable());
- assertTrue(virtualIdMapping.getMutable().isMutable());
- assertTrue(javaIdMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkBasicMapping virtualBasicMapping = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceId.getMutable());
- assertFalse(virtualBasicMapping.getMutable().isDefaultMutable());
- assertNull(virtualBasicMapping.getMutable().getSpecifiedMutable());
- assertFalse(virtualBasicMapping.getMutable().isMutable());
- assertTrue(javaIdMapping.getMutable().isMutable());
- }
-
- public void testModifyMutable() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "basic");
- OrmEclipseLinkIdMapping contextId =
- (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlId resourceId =
- (XmlId) resourceEntity.getAttributes().getIds().get(0);
-
- // check defaults
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set context mutable to true, check resource
-
- contextId.getMutable().setSpecifiedMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // set context mutable to false, check resource
-
- contextId.getMutable().setSpecifiedMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set context read only to null, check resource
-
- contextId.getMutable().setSpecifiedMutable(null);
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId basicResource = (XmlId) getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- JavaIdMapping javaIdMapping = (JavaIdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormIdMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertNull(ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaIdMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaIdMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- IdMapping virtualIdMapping = (IdMapping) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualIdMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualIdMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaIdMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualIdMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualIdMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
- javaIdMapping.setConverter(null);
- assertNull(virtualIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- assertNull(javaIdMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId basicResource = (XmlId) getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormIdMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormIdMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormIdMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormIdMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormIdMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormIdMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
-
- //set lob to false in the context model
- ormIdMapping.setConverter(null);
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java
deleted file mode 100644
index f2cf0ca09a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmManyToManyMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmManyToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Collection;");
- sb.append(CR);
- sb.append("import ").append(JPA.MANY_TO_MANY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_TABLE).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_COLUMN).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @JoinTable(name=\"DEP_EMP\", joinColumns=@JoinColumn(name=\"DEPT_ID\"), inverseJoinColumns=@JoinColumn(name=\"EMP_ID\"))").append(CR);
- sb.append(" private Collection<Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- public void testUpdateJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
- EclipseLinkRelationshipMapping contextManyToMany =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlManyToMany resourceManyToMany =
- (XmlManyToMany) resourceEntity.getAttributes().getManyToManys().get(0);
-
- // check defaults
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceManyToMany.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToMany.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceManyToMany.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToMany.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceManyToMany.setJoinFetch(null);
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany");
- EclipseLinkRelationshipMapping contextManyToMany =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlManyToMany resourceManyToMany =
- (XmlManyToMany) resourceEntity.getAttributes().getManyToManys().get(0);
-
- // check defaults
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextManyToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToMany.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextManyToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToMany.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextManyToMany.getJoinFetch().setValue(null);
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefault() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkRelationshipMapping manyToMany = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertNull(manyToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- EclipseLinkOneToManyMapping oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertNull(oneToMany.getJoinFetch().getValue());
-
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employees").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- assertNull(oneToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- manyToMany = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, manyToMany.getJoinFetch().getValue());
- }
-
- public void testDefaultJoinTable() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- OrmReadOnlyPersistentAttribute attribute = departmentPersistentType.getAttributeNamed("employees");
- ManyToManyMapping manyToMany = (ManyToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- JoinTable ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
- //set metadata-complete and verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- departmentPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
- attribute = departmentPersistentType.getAttributeNamed("employees");
- OneToManyMapping oneToMany = (OneToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
-
- //set metadata-complete to false, add mapping to orm.xml verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- manyToMany = (ManyToManyMapping) attribute.getMapping();
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
-
- departmentPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "employees");
- attribute = departmentPersistentType.getAttributeNamed("employees");
- manyToMany = (ManyToManyMapping) attribute.getMapping();
- assertEquals(false, attribute.isVirtual());
- ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals(0, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals(0, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToManyMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- OrmPersistentAttribute ormPersistentAttribute = virtualPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(null, ormManyToManyMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java
deleted file mode 100644
index 0af5072c07..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmManyToOneMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmManyToOneMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ").append(JPA.MANY_TO_ONE).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Employee employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- public void testUpdateJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOne");
- EclipseLinkRelationshipMapping contextManyToOne =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlManyToOne resourceManyToOne =
- (XmlManyToOne) resourceEntity.getAttributes().getManyToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceManyToOne.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToOne.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceManyToOne.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToOne.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceManyToOne.setJoinFetch(null);
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOne");
- EclipseLinkRelationshipMapping contextManyToOne =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlManyToOne resourceManyToOne =
- (XmlManyToOne) resourceEntity.getAttributes().getManyToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextManyToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToOne.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextManyToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToOne.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextManyToOne.getJoinFetch().setValue(null);
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefaultFromJava() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkRelationshipMapping manyToOneMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
-
- assertNull(manyToOneMapping.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- EclipseLinkOneToOneMapping oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertNull(oneToOne.getJoinFetch().getValue());
-
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employee").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- manyToOneMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertNull(manyToOneMapping.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- manyToOneMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, manyToOneMapping.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- ManyToOneMapping virtualManyToOneMapping = (ManyToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade cascade = virtualManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToOneMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualPersistentAttribute.convertToSpecified(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OrmEclipseLinkManyToOneMapping ormManyToOneMapping = (OrmEclipseLinkManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertEquals(null, ormManyToOneMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java
deleted file mode 100644
index dd364be549..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmMappedSuperclassTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMappedSuperclassForReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForCaching() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- public void testUpdateReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to true, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to false, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testModifyReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to true, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to false, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to null, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(null);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceMappedSuperclass.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceMappedSuperclass.getCustomizer().setClassName(null);
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceMappedSuperclass.setCustomizer(null);
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceMappedSuperclass.setChangeTracking(null);
- javaContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCacheType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedType(EclipseLinkCacheType.WEAK);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set context cache type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getSpecifiedType());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
- }
-
- public void testUpdateCacheCoordinationType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheCoordinationType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context cache coordination type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context coordination type to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- }
-
-
- public void testUpdateCacheSize() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setSize(new Integer(105));
- assertEquals(new Integer(105), resourceMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedSize(new Integer(50));
-
- assertEquals(new Integer(105), resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
- // clear xml cache size, check defaults
- resourceMappedSuperclass.getCache().setSize(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheSize() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(new Integer(50));
- assertEquals(new Integer(50), resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(50), ormContextCaching.getSpecifiedSize());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- }
-
- public void testUpdateCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set xml cache always refresh, check settings
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set java cache always refresh, check defaults
-
- javaContextCaching.setSpecifiedAlwaysRefresh(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testModifyCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testUpdateCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testModifyCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testUpdateCacheDisableHits() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedDisableHits(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedDisableHits());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testModifyCacheDisableHits() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testUpdateCacheShared() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setShared(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedShared());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testModifyCacheShared() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testUpdateExistenceChecking() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set xml existence checking, check settings
- resourceMappedSuperclass.setExistenceChecking(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
-
- // set java cache existence checking, check defaults
-
- javaContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // clear xml existence checking, check defaults
- resourceMappedSuperclass.setExistenceChecking(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyExistenceChecking() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set context cache existence checking, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // set context existence checking to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
- }
- public void testUpdateCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java
deleted file mode 100644
index c94ffd136d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java
+++ /dev/null
@@ -1,530 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmObjectTypeConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter");
- }
- });
- }
-
-
- public EclipseLinkOrmObjectTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateDataType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setDataType("myConvert");
- assertEquals("myConvert", ormConverter.getDataType());
- assertEquals("myConvert", converterResource.getDataType());
-
- //set converter class name to null in the resource model
- converterResource.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setDataType("bar");
-
- assertNull(ormConverter);
- assertEquals("bar", javaConverter.getDataType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getDataType());
- }
-
- public void testModifyDataType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setDataType("foo");
- assertEquals("foo", ormConverter.getDataType());
- assertEquals("foo", converterResource.getDataType());
-
- ormConverter.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
- }
-
- public void testUpdateObjectType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setObjectType("myConvert");
- assertEquals("myConvert", ormConverter.getObjectType());
- assertEquals("myConvert", converterResource.getObjectType());
-
- //set converter class name to null in the resource model
- converterResource.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setObjectType("bar");
-
- assertNull(ormConverter);
- assertEquals("bar", javaConverter.getObjectType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getObjectType());
- }
-
- public void testModifyObjectType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setObjectType("foo");
- assertEquals("foo", ormConverter.getObjectType());
- assertEquals("foo", converterResource.getObjectType());
-
- ormConverter.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- OrmEclipseLinkObjectTypeConverter ormConverter = (OrmEclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- EclipseLinkObjectTypeConverter virtualConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
-
- assertNull(virtualConverter);
- assertEquals("bar", javaConverter.getName());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- OrmEclipseLinkObjectTypeConverter ormConverter = (OrmEclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-
- public void testUpdateDefaultObjectValue() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setDefaultObjectValue("myConvert");
- assertEquals("myConvert", ormConverter.getDefaultObjectValue());
- assertEquals("myConvert", converterResource.getDefaultObjectValue());
-
- //set converter class name to null in the resource model
- converterResource.setDefaultObjectValue(null);
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
-
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setDefaultObjectValue("bar");
-
- assertNull(ormConverter);
- assertEquals("bar", javaConverter.getDefaultObjectValue());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getDefaultObjectValue());
- }
-
- public void testModifyDefaultObjectValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
-
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setDefaultObjectValue("foo");
- assertEquals("foo", ormConverter.getDefaultObjectValue());
- assertEquals("foo", converterResource.getDefaultObjectValue());
-
- ormConverter.setDefaultObjectValue(null);
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
- }
-
-
- public void testUpdateConversionValues() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
-
- //add conversion value to resource model, check context model
- XmlConversionValue resourceConversionValue = EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValue();
- converterResource.getConversionValues().add(resourceConversionValue);
- resourceConversionValue.setDataValue("foo");
- resourceConversionValue.setObjectValue("bar");
-
- assertEquals(1, ormConverter.getConversionValuesSize());
- ListIterator<? extends EclipseLinkConversionValue> contextConversionValues = ormConverter.getConversionValues().iterator();
- EclipseLinkConversionValue contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
-
- //add a conversion to the beginning of the resource model list
- XmlConversionValue xmlConversionValue2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValue();
- converterResource.getConversionValues().add(0, xmlConversionValue2);
- xmlConversionValue2.setDataValue("foo2");
- xmlConversionValue2.setObjectValue("bar2");
-
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(1).getObjectValue());
-
- //move a conversion value in the resource model list
-
- converterResource.getConversionValues().move(0, 1);
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo2", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(1).getObjectValue());
-
- //remove a conversion value from the resource model list
-
- converterResource.getConversionValues().remove(0);
- assertEquals(1, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
-
- //clear the conversion value resource model list
- converterResource.getConversionValues().clear();
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
-
- //add conversion value to java context model, verify does not affect orm context model
-
- EclipseLinkObjectTypeConverter javaConverter = (EclipseLinkObjectTypeConverter) ((JavaEclipseLinkConvert) javaBasicMapping.getConverter()).getConverter();
- EclipseLinkConversionValue javaConversionValue = javaConverter.addConversionValue();
- javaConversionValue.setDataValue("baz");
-
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
- assertEquals(1, javaConverter.getConversionValuesSize());
-
- //remove orm attribute mapping, verify virtual mapping has conversion values from java
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
-
- assertNull(ormConverter);
- assertEquals(1, javaConverter.getConversionValuesSize());
-
- //set metadata-complete to true, verify virtual mapping ignores the conversion values from java
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- }
-
- public void testModifyConversionValues() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkObjectTypeConverter.class);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
-
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
-
- //add conversion value to context model, check resource model
- EclipseLinkConversionValue contextConversionValue = ormConverter.addConversionValue();
- contextConversionValue.setDataValue("foo");
- contextConversionValue.setObjectValue("bar");
-
- assertEquals(1, ormConverter.getConversionValuesSize());
- ListIterator<? extends EclipseLinkConversionValue> contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
-
- //add a conversion to the beginning of the context model list
- EclipseLinkConversionValue contextConversionValue2 = ormConverter.addConversionValue(0);
- contextConversionValue2.setDataValue("foo2");
- contextConversionValue2.setObjectValue("bar2");
-
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(1).getObjectValue());
-
- //move a conversion value in the context model list
-
- ormConverter.moveConversionValue(0, 1);
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo2", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(1).getObjectValue());
-
- //remove a conversion value from the context model list
-
- ormConverter.removeConversionValue(0);
- assertEquals(1, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
-
- //clear the conversion value resource model list
- ormConverter.removeConversionValue(0);
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java
deleted file mode 100644
index 4be0ae3e78..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,747 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmOneToManyMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmOneToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Collection;");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_TABLE).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_COLUMN).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @JoinTable(name=\"DEP_EMP\", joinColumns=@JoinColumn(name=\"DEPT_ID\"), inverseJoinColumns=@JoinColumn(name=\"EMP_ID\"))").append(CR);
- sb.append(" private Collection<Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToManyMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.convertToSpecified();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdatePrivateOwned() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned to true, check context
-
- resourceOneToMany.setPrivateOwned(true);
-
- assertTrue(resourceOneToMany.isPrivateOwned());
- assertTrue(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned back to false, check context
-
- resourceOneToMany.setPrivateOwned(false);
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
- }
-
- public void testModifyPrivateOwned() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set context private owned to true, check resource
-
- contextOneToMany.getPrivateOwned().setPrivateOwned(true);
-
- assertTrue(resourceOneToMany.isPrivateOwned());
- assertTrue(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set context private owned back to false, check resource
-
- contextOneToMany.getPrivateOwned().setPrivateOwned(false);
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
- }
-
- public void testUpdateJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceOneToMany.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToMany.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceOneToMany.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToMany.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceOneToMany.setJoinFetch(null);
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany");
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextOneToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToMany.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextOneToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToMany.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextOneToMany.getJoinFetch().setValue(null);
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefault() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkOneToManyMapping oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertNull(oneToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertNull(oneToMany.getJoinFetch().getValue());
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employees").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- assertNull(oneToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, oneToMany.getJoinFetch().getValue());
- }
-
- public void testDefaultJoinTable() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- OrmReadOnlyPersistentAttribute attribute = departmentPersistentType.getAttributeNamed("employees");
- OneToManyMapping oneToMany = (OneToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- JoinTable ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
- //set metadata-complete and verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- departmentPersistentType.addSpecifiedAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id");
- attribute = departmentPersistentType.getAttributeNamed("employees");
- oneToMany = (OneToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
-
- //set metadata-complete to false, add mapping to orm.xml verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- oneToMany = (OneToManyMapping) attribute.getMapping();
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
-
- departmentPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "employees");
- attribute = departmentPersistentType.getAttributeNamed("employees");
- oneToMany = (OneToManyMapping) attribute.getMapping();
- assertEquals(false, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals(0, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals(0, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(ormOneToManyMapping.getMapKey());
- assertFalse(ormOneToManyMapping.isPkMapKey());
- assertFalse(ormOneToManyMapping.isCustomMapKey());
- assertTrue(ormOneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", ormOneToManyMapping.getMapKey());
- assertTrue(ormOneToManyMapping.isPkMapKey());
- assertFalse(ormOneToManyMapping.isCustomMapKey());
- assertFalse(ormOneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", ormOneToManyMapping.getMapKey());
- assertFalse(ormOneToManyMapping.isPkMapKey());
- assertTrue(ormOneToManyMapping.isCustomMapKey());
- assertFalse(ormOneToManyMapping.isNoMapKey());
-
- //set metadata complete and verify that the orm model ignores the java annotations
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- assertEquals(null, ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals(null, ormOneToManyMapping.getMapKey());
- assertFalse(ormOneToManyMapping.isPkMapKey());
- assertFalse(ormOneToManyMapping.isCustomMapKey());
- assertTrue(ormOneToManyMapping.isNoMapKey());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").convertToSpecified();
- ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- 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.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.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.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- 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.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToManyMapping.getFetch());
- assertEquals("test.Address", virtualOneToManyMapping.getTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(null, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java
deleted file mode 100644
index 36f155ea40..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmOneToOneMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmOneToOneMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ").append(JPA.ONE_TO_ONE).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Employee employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" @PrivateOwned)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- public void testUpdatePrivateOwned() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToOne.isPrivateOwned());
- assertFalse(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned to true, check context
-
- resourceOneToOne.setPrivateOwned(true);
-
- assertTrue(resourceOneToOne.isPrivateOwned());
- assertTrue(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned back to false, check context
-
- resourceOneToOne.setPrivateOwned(false);
-
- assertFalse(resourceOneToOne.isPrivateOwned());
- assertFalse(contextOneToOne.getPrivateOwned().isPrivateOwned());
- }
-
- public void testModifyPrivateOwned() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToOne.isPrivateOwned());
- assertFalse(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set context private owned to true, check resource
-
- contextOneToOne.getPrivateOwned().setPrivateOwned(true);
-
- assertTrue(resourceOneToOne.isPrivateOwned());
- assertTrue(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set context private owned back to false, check resource
-
- contextOneToOne.getPrivateOwned().setPrivateOwned(false);
- }
-
- public void testUpdateJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceOneToOne.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToOne.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceOneToOne.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToOne.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceOneToOne.setJoinFetch(null);
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne");
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextOneToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToOne.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextOneToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToOne.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextOneToOne.getJoinFetch().setValue(null);
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefaultFromJava() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkOneToOneMapping oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
-
- assertNull(oneToOne.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertNull(oneToOne.getJoinFetch().getValue());
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employee").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- assertNull(oneToOne.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, oneToOne.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
-
- OneToOneMapping virtualOneToOneMapping = (OneToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn virtualJoinColumn =
- virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade cascade = virtualOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualOneToOneMapping).getJoinFetch().getValue());
- assertTrue(((EclipseLinkOneToOneMapping) virtualOneToOneMapping).getPrivateOwned().isPrivateOwned());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- EclipseLinkOneToOneMapping ormOneToOneMapping = (EclipseLinkOneToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertEquals(null, ormOneToOneMapping.getJoinFetch().getValue());
- assertFalse(ormOneToOneMapping.getPrivateOwned().isPrivateOwned());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address");
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEclipseLinkOneToOneMapping ormOneToOneMapping = (OrmEclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormOneToOneMapping.getName());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- 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().getJoinColumnStrategy().getJoinColumnsSize() > 0);
-
- //TODO default join columns for specified xmlOneToOne mapping
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertEquals(null, ormOneToOneMapping.getJoinFetch().getValue());
- assertFalse(ormOneToOneMapping.getPrivateOwned().isPrivateOwned());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java
deleted file mode 100644
index 2188b2738b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmPersistentAttributeTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmPersistentAttributeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getVirtualAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertTrue(ormPersistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- ormPersistentAttribute.convertToSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertEquals(specifiedOrmPersistentAttribute.getMappingKey(), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkOneToOneMapping);
-
- ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- ormPersistentAttribute.convertToSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
- assertEquals(0, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getVirtualAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getVirtualAttributesSize());
-
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
- ormPersistentType.getVirtualAttributes().iterator().next().convertToSpecified();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.convertToVirtual();
- assertEquals(1, ormPersistentType.getVirtualAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getVirtualAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getVirtualAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertTrue(javaResourceAttribute.getKind() == Kind.FIELD);
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).convertToVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.convertToSpecified();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java
deleted file mode 100644
index 5247d8aad8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmStructConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @StructConverter");
- }
- });
- }
-
-
- public EclipseLinkOrmStructConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateConverter() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkStructConverter.class);
- EclipseLinkStructConverter ormConverter = (EclipseLinkStructConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setConverter("myConvert");
- assertEquals("myConvert", ormConverter.getConverterClass());
- assertEquals("myConvert", converterResource.getConverter());
-
- //set converter class name to null in the resource model
- converterResource.setConverter(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- ormConverter = (EclipseLinkStructConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkStructConverter javaConverter = ((EclipseLinkStructConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setConverterClass("bar");
-
- assertNull(ormConverter);
- assertEquals("bar", javaConverter.getConverterClass());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getConverterClass());
- }
-
- public void testModifyConverter() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkStructConverter.class);
- EclipseLinkStructConverter ormConverter = (EclipseLinkStructConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverter();
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setConverterClass("foo");
- assertEquals("foo", ormConverter.getConverterClass());
- assertEquals("foo", converterResource.getConverter());
-
- ormConverter.setConverterClass(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkStructConverter.class);
- OrmEclipseLinkStructConverter ormConverter = (OrmEclipseLinkStructConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- EclipseLinkStructConverter virtualConverter = (EclipseLinkStructConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkStructConverter javaConverter = ((EclipseLinkStructConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
-
- assertNull(virtualConverter);
- assertEquals("bar", javaConverter.getName());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getVirtualAttributes().iterator().next();
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkStructConverter.class);
- OrmEclipseLinkStructConverter ormConverter = (OrmEclipseLinkStructConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverter();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java
deleted file mode 100644
index 51c094b3fa..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmTransientMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmTransientMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient").append(CR);
- }
- });
- }
-
- public void testCreateTransientMapping() throws Exception {
- createTestEntityWithTransientMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertTrue(persistentAttribute.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- OrmPersistentAttribute persistentAttribute2 = persistentAttribute.convertToSpecified(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertFalse(persistentAttribute2.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute2.getMappingKey());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute2.getMapping().getKey());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java
deleted file mode 100644
index 4fcfead81e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmTypeConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @TypeConverter");
- }
- });
- }
-
-
- public EclipseLinkOrmTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateDataType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkTypeConverter.class);
- EclipseLinkTypeConverter ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setDataType("myConvert");
- assertEquals("myConvert", ormConverter.getDataType());
- assertEquals("myConvert", converterResource.getDataType());
-
- //set converter class name to null in the resource model
- converterResource.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkTypeConverter javaConverter = ((EclipseLinkTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setDataType("bar");
-
- assertNull(ormConverter);
- assertEquals("bar", javaConverter.getDataType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getDataType());
- }
-
- public void testModifyDataType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkTypeConverter.class);
- EclipseLinkTypeConverter ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverter();
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setDataType("foo");
- assertEquals("foo", ormConverter.getDataType());
- assertEquals("foo", converterResource.getDataType());
-
- ormConverter.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
- }
-
- public void testUpdateObjectType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkTypeConverter.class);
- EclipseLinkTypeConverter ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setObjectType("myConvert");
- assertEquals("myConvert", ormConverter.getObjectType());
- assertEquals("myConvert", converterResource.getObjectType());
-
- //set converter class name to null in the resource model
- converterResource.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkTypeConverter javaConverter = ((EclipseLinkTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setObjectType("bar");
-
- assertNull(ormConverter);
- assertEquals("bar", javaConverter.getObjectType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getObjectType());
- }
-
- public void testModifyObjectType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkTypeConverter.class);
- EclipseLinkTypeConverter ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverter();
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setObjectType("foo");
- assertEquals("foo", ormConverter.getObjectType());
- assertEquals("foo", converterResource.getObjectType());
-
- ormConverter.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkTypeConverter.class);
- OrmEclipseLinkTypeConverter ormConverter = (OrmEclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverter();
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //remove the specified persistent attribute, test virtual mapping
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- BasicMapping virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
- EclipseLinkTypeConverter virtualConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getConverter();
- EclipseLinkTypeConverter javaConverter = ((EclipseLinkTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
-
- assertNull(virtualConverter);
- assertEquals("bar", javaConverter.getName());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getVirtualAttributes().iterator().next();
- virtualBasicMapping = (BasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals("bar", javaConverter.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmBasicMapping ormBasicMapping = ((OrmBasicMapping) ormPersistentAttribute.getMapping());
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkTypeConverter.class);
- OrmEclipseLinkTypeConverter ormConverter = (OrmEclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverter();
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java
deleted file mode 100644
index c2b954e9f3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmVersionMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmVersionMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableVersionDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public void testUpdateMutable() throws Exception {
- createTestEntityWithVersionMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "id");
- OrmEclipseLinkVersionMapping contextVersion =
- (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlVersion resourceVersion =
- (XmlVersion) resourceEntity.getAttributes().getVersions().get(0);
- EclipseLinkVersionMapping javaVersionMapping = (EclipseLinkVersionMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- // check defaults
-
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceVersion.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceVersion.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceVersion.setMutable(null);
-
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // TODO - test defaults for java serializable and date/time types,
- // with and without persistence property
-
- // set mutable on java basic mapping
-
- javaVersionMapping.getMutable().setSpecifiedMutable(Boolean.FALSE);
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
- assertFalse(javaVersionMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkVersionMapping virtualContextVersion = (EclipseLinkVersionMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceVersion.getMutable());
- assertTrue(virtualContextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, virtualContextVersion.getMutable().getSpecifiedMutable());
- assertFalse(virtualContextVersion.getMutable().isMutable());
- assertFalse(javaVersionMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping contextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceVersion.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
- assertFalse(javaVersionMapping.getMutable().isMutable());
- }
-
- public void testUpdateMutableDate() throws Exception {
- createTestEntityWithMutableVersionDate();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "myDate");
- OrmEclipseLinkVersionMapping contextVersion =
- (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlVersion resourceVersion =
- (XmlVersion) resourceEntity.getAttributes().getVersions().get(0);
- EclipseLinkVersionMapping javaVersionMapping = (EclipseLinkVersionMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("myDate").getMapping();
-
- // check defaults
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceVersion.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceVersion.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceVersion.setMutable(null);
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set mutable on java version mapping
-
- javaVersionMapping.getMutable().setSpecifiedMutable(Boolean.TRUE);
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
- assertTrue(javaVersionMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkVersionMapping virtualContextVersion = (EclipseLinkVersionMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceVersion.getMutable());
- assertFalse(virtualContextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, virtualContextVersion.getMutable().getSpecifiedMutable());
- assertTrue(virtualContextVersion.getMutable().isMutable());
- assertTrue(javaVersionMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkBasicMapping contextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceVersion.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
- assertTrue(javaVersionMapping.getMutable().isMutable());
- }
-
- public void testModifyMutable() throws Exception {
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "basic");
- OrmEclipseLinkVersionMapping contextVersion =
- (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlVersion resourceVersion =
- (XmlVersion) resourceEntity.getAttributes().getVersions().get(0);
-
- // check defaults
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set context mutable to true, check resource
-
- contextVersion.getMutable().setSpecifiedMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // set context mutable to false, check resource
-
- contextVersion.getMutable().setSpecifiedMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set context read only to null, check resource
-
- contextVersion.getMutable().setSpecifiedMutable(null);
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithVersionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "id");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion basicResource = (XmlVersion) getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
- JavaVersionMapping javaVersionMapping = (JavaVersionMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormVersionMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaVersionMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaVersionMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.convertToVirtual();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- VersionMapping virtualVersionMapping = (VersionMapping) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualVersionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualVersionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaVersionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualVersionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualVersionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
- javaVersionMapping.setConverter(null);
- assertNull(virtualVersionMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- assertNull(javaVersionMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "basicMapping");
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion basicResource = (XmlVersion) getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormVersionMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormVersionMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormVersionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormVersionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormVersionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormVersionMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob to false in the context model
- ormVersionMapping.setConverter(null);
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java
deleted file mode 100644
index 3e659b5d89..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPersistenceUnitDefaultsTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkPersistenceUnitDefaultsTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitDefaults persistenceUnitDefaults() {
- return getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- XmlPersistenceUnitMetadata persistenceUnitMetadata = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- XmlPersistenceUnitDefaults persistenceUnitDefaultsResource = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- persistenceUnitMetadata.setPersistenceUnitDefaults(persistenceUnitDefaultsResource);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(true);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(false);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
- }
-
- public void testUpdateSchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifySchema2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCatalog2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the resource model, persistence-unit-defaults tag not removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCascadePersist2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-
- public void testUpdateAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyAccess2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java
deleted file mode 100644
index ae3984ff89..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-public class EclipseLinkPersistenceUnitMetadataTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkPersistenceUnitMetadataTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitMetadata persistenceUnitMetadata() {
- return getEntityMappings().getPersistenceUnitMetadata();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- XmlPersistenceUnitMetadata persistenceUnitMetadata = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertFalse(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- assertFalse(persistenceUnitMetadata.isUnset());
- }
-
- public void testUpdateXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-
- public void testModifyXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyXmlMappingMetadataComplete2() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- //set another element on the persistence-unit-metadata element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java
deleted file mode 100644
index 2c70ba8d93..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCoreOrmContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCoreOrmContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkEntityMappingsTests.class);
- suite.addTestSuite(EclipseLinkPersistenceUnitMetadataTests.class);
- suite.addTestSuite(EclipseLinkPersistenceUnitDefaultsTests.class);
- suite.addTestSuite(EclipseLinkOrmEmbeddableTests.class);
- suite.addTestSuite(EclipseLinkOrmEntityTests.class);
- suite.addTestSuite(EclipseLinkOrmMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLinkOrmBasicMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmIdMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmOneToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmOneToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmPersistentAttributeTests.class);
- suite.addTestSuite(EclipseLinkOrmVersionMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmTransientMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmObjectTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmStructConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmCachingTests.class);
- suite.addTestSuite(EclipseLink2_3OrmMultitenancyTests.class);
- suite.addTestSuite(EclipseLink1_1OrmPersistentAttributeTests.class);
- suite.addTestSuite(EclipseLink1_1OrmPersistentTypeTests.class);
- suite.addTestSuite(EclipseLink1_1OrmTransientMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmCollectionTableTests.class);
- suite.addTestSuite(EclipseLink2_0OrmElementCollectionMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmEntityTests.class);
- suite.addTestSuite(EclipseLink2_0OrmManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLink2_0OrmOneToOneMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmOneToManyMappingTests.class);
- return suite;
- }
-
-
- private JptEclipseLinkCoreOrmContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java
deleted file mode 100644
index 533f3ee33c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.FlushClearCache;
-
-/**
- * Tests the update of model objects by the Caching adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class CachingAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Caching caching;
- private ListEvent entitiesEvent;
-
- public static final String ENTITY_TEST = "Employee";
- public static final String ENTITY_TEST_2 = "Address";
-
- public static final String CACHE_TYPE_DEFAULT_KEY = Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT;
- public static final CacheType CACHE_TYPE_DEFAULT_TEST_VALUE = CacheType.soft_weak;
- public static final CacheType CACHE_TYPE_DEFAULT_TEST_VALUE_2 = CacheType.full;
-
- public static final String CACHE_SIZE_DEFAULT_KEY = Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT;
- public static final Integer CACHE_SIZE_DEFAULT_TEST_VALUE = 12345;
- public static final Integer CACHE_SIZE_DEFAULT_TEST_VALUE_2 = 67890;
-
- public static final String SHARED_CACHE_DEFAULT_KEY = Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT;
- public static final Boolean SHARED_CACHE_DEFAULT_TEST_VALUE = false;
- public static final Boolean SHARED_CACHE_DEFAULT_TEST_VALUE_2 = true;
-
- public static final String CACHE_TYPE_KEY = Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_TEST;
- public static final CacheType CACHE_TYPE_TEST_VALUE = CacheType.soft_weak;
- public static final CacheType CACHE_TYPE_TEST_VALUE_2 = CacheType.full;
-
- public static final String SHARED_CACHE_KEY = Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_TEST;
- public static final Boolean SHARED_CACHE_TEST_VALUE = false;
- public static final Boolean SHARED_CACHE_TEST_VALUE_2 = true;
-
- public static final String CACHE_SIZE_KEY = Caching.ECLIPSELINK_CACHE_SIZE + ENTITY_TEST;
- public static final Integer CACHE_SIZE_TEST_VALUE = 12345;
- public static final Integer CACHE_SIZE_TEST_VALUE_2 = 67890;
-
- public static final String FLUSH_CLEAR_CACHE_KEY = Caching.ECLIPSELINK_FLUSH_CLEAR_CACHE;
- public static final FlushClearCache FLUSH_CLEAR_CACHE_TEST_VALUE = FlushClearCache.drop;
- public static final FlushClearCache FLUSH_CLEAR_CACHE_TEST_VALUE_2 = FlushClearCache.merge;
-
- public CachingAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.caching = this.getPersistenceUnit().getCaching();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.caching.addPropertyChangeListener(Caching.CACHE_TYPE_DEFAULT_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Caching.CACHE_SIZE_DEFAULT_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Caching.SHARED_CACHE_DEFAULT_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(CachingEntity.CACHE_TYPE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(CachingEntity.CACHE_SIZE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(CachingEntity.SHARED_CACHE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Caching.FLUSH_CLEAR_CACHE_PROPERTY, propertyChangeListener);
-
- ListChangeListener entitiesChangeListener = this.buildEntitiesChangeListener();
- this.caching.addListChangeListener(Caching.ENTITIES_LIST, entitiesChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 7;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(CACHE_TYPE_DEFAULT_KEY, CACHE_TYPE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty(CACHE_SIZE_DEFAULT_KEY, CACHE_SIZE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty(SHARED_CACHE_DEFAULT_KEY, SHARED_CACHE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(CACHE_SIZE_KEY, CACHE_SIZE_TEST_VALUE);
- this.persistenceUnitSetProperty(CACHE_TYPE_KEY, CACHE_TYPE_TEST_VALUE);
- this.persistenceUnitSetProperty(SHARED_CACHE_KEY, SHARED_CACHE_TEST_VALUE);
- this.persistenceUnitSetProperty(FLUSH_CLEAR_CACHE_KEY, FLUSH_CLEAR_CACHE_TEST_VALUE);
- return;
- }
-
- // ********** Listeners **********
- private ListChangeListener buildEntitiesChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- CachingAdapterTests.this.entityAdded(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- CachingAdapterTests.this.entityRemoved(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
- };
- }
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.entitiesEvent = null;
- }
-
- void entityAdded(ListAddEvent e) {
- this.entitiesEvent = e;
- }
-
- void entityRemoved(ListRemoveEvent e) {
- this.entitiesEvent = e;
- }
-
- // ********** entities list **********
- public void testEntitiesList() throws Exception {
- // add
- this.clearEvent();
- int originalNumberOfEntities = this.caching.getEntitiesSize();
-
- this.caching.addEntity(ENTITY_TEST_2);
- assertEquals("Entity not added", this.caching.getEntitiesSize(), originalNumberOfEntities + 1);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Caching.ENTITIES_LIST);
-
- // remove
- this.clearEvent();
- this.caching.removeEntity(ENTITY_TEST_2);
- assertEquals("Entity not removed", this.caching.getEntitiesSize(), originalNumberOfEntities);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Caching.ENTITIES_LIST);
- }
-
- // ********** CacheTypeDefault **********
- /**
- * Tests the update of CacheTypeDefault property by the Caching adapter when
- * the PU or the model changes.
- */
- public void testSetCacheTypeDefault() throws Exception {
- this.verifyModelInitialized(
- CACHE_TYPE_DEFAULT_KEY,
- CACHE_TYPE_DEFAULT_TEST_VALUE);
- this.verifySetProperty(
- CACHE_TYPE_DEFAULT_KEY,
- CACHE_TYPE_DEFAULT_TEST_VALUE,
- CACHE_TYPE_DEFAULT_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheTypeDefault() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_TYPE_DEFAULT_KEY,
- CACHE_TYPE_DEFAULT_TEST_VALUE,
- CACHE_TYPE_DEFAULT_TEST_VALUE_2);
- }
-
- // ********** CacheSizeDefault **********
- /**
- * Tests the update of CacheSizeDefault property by the Caching adapter when
- * the PU or the model changes.
- */
- public void testSetCacheSizeDefault() throws Exception {
- this.verifyModelInitialized(
- CACHE_SIZE_DEFAULT_KEY,
- CACHE_SIZE_DEFAULT_TEST_VALUE);
- this.verifySetProperty(
- CACHE_SIZE_DEFAULT_KEY,
- CACHE_SIZE_DEFAULT_TEST_VALUE,
- CACHE_SIZE_DEFAULT_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheSizeDefault() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_SIZE_DEFAULT_KEY,
- CACHE_SIZE_DEFAULT_TEST_VALUE,
- CACHE_SIZE_DEFAULT_TEST_VALUE_2);
- }
-
- // ********** SharedCacheDefault **********
- public void testSetSharedCacheDefault() throws Exception {
- this.verifyModelInitialized(
- SHARED_CACHE_DEFAULT_KEY,
- SHARED_CACHE_DEFAULT_TEST_VALUE);
- this.verifySetProperty(
- SHARED_CACHE_DEFAULT_KEY,
- SHARED_CACHE_DEFAULT_TEST_VALUE,
- SHARED_CACHE_DEFAULT_TEST_VALUE_2);
- }
-
- public void testAddRemoveSharedCacheDefault() throws Exception {
- this.verifyAddRemoveProperty(
- SHARED_CACHE_DEFAULT_KEY,
- SHARED_CACHE_DEFAULT_TEST_VALUE,
- SHARED_CACHE_DEFAULT_TEST_VALUE_2);
- }
-
- // ********** CacheType **********
- /**
- * Tests the update of CacheType property by the Caching adapter when the PU
- * or the model changes.
- */
- public void testSetCacheType() throws Exception {
- this.verifyModelInitialized(
- CACHE_TYPE_KEY,
- CACHE_TYPE_TEST_VALUE);
- this.verifySetCachingProperty(
- CachingEntity.CACHE_TYPE_PROPERTY,
- CACHE_TYPE_KEY,
- CACHE_TYPE_TEST_VALUE,
- CACHE_TYPE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheType() throws Exception {
- this.verifyAddRemoveCachingProperty(
- CachingEntity.CACHE_TYPE_PROPERTY,
- CACHE_TYPE_KEY,
- CACHE_TYPE_TEST_VALUE,
- CACHE_TYPE_TEST_VALUE_2);
- }
-
- // ********** CacheSize **********
- /**
- * Tests the update of CacheSize property by the Caching adapter when the PU
- * or the model changes.
- */
- public void testSetCacheSize() throws Exception {
- this.verifyModelInitialized(
- CACHE_SIZE_KEY,
- CACHE_SIZE_TEST_VALUE);
- this.verifySetCachingProperty(
- CachingEntity.CACHE_SIZE_PROPERTY,
- CACHE_SIZE_KEY,
- CACHE_SIZE_TEST_VALUE,
- CACHE_SIZE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheSize() throws Exception {
- this.verifyAddRemoveCachingProperty(
- CachingEntity.CACHE_SIZE_PROPERTY,
- CACHE_SIZE_KEY,
- CACHE_SIZE_TEST_VALUE,
- CACHE_SIZE_TEST_VALUE_2);
- }
-
- // ********** SharedCache **********
- /**
- * Tests the update of SharedCache property by the Caching adapter when the
- * PU or the model changes.
- */
- public void testSetSharedCache() throws Exception {
- this.verifyModelInitialized(
- SHARED_CACHE_KEY,
- SHARED_CACHE_TEST_VALUE);
- this.verifySetCachingProperty(
- CachingEntity.SHARED_CACHE_PROPERTY,
- SHARED_CACHE_KEY,
- SHARED_CACHE_TEST_VALUE,
- SHARED_CACHE_TEST_VALUE_2);
- }
-
- public void testAddRemoveSharedCache() throws Exception {
- this.verifyAddRemoveCachingProperty(
- CachingEntity.SHARED_CACHE_PROPERTY,
- SHARED_CACHE_KEY,
- SHARED_CACHE_TEST_VALUE,
- SHARED_CACHE_TEST_VALUE_2);
- }
-
- // ********** FlushClearCache tests **********
- public void testSetFlushClearCache() throws Exception {
- this.verifyModelInitialized(
- FLUSH_CLEAR_CACHE_KEY,
- FLUSH_CLEAR_CACHE_TEST_VALUE);
- this.verifySetProperty(
- FLUSH_CLEAR_CACHE_KEY,
- FLUSH_CLEAR_CACHE_TEST_VALUE,
- FLUSH_CLEAR_CACHE_TEST_VALUE_2);
- }
-
- public void testAddRemoveFlushClearCache() throws Exception {
- this.verifyAddRemoveProperty(
- FLUSH_CLEAR_CACHE_KEY,
- FLUSH_CLEAR_CACHE_TEST_VALUE,
- FLUSH_CLEAR_CACHE_TEST_VALUE_2);
- }
-
- // ****** convenience methods *******
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.caching;
- }
-
- protected void verifySetCachingProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue2);
-
- // Replace by setting model object
- this.clearEvent();
- this.setCachingProperty(propertyName, ENTITY_TEST, testValue1);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue1);
- }
-
- protected void verifyAddRemoveCachingProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key);
- assertNull(this.getPersistenceUnit().getProperty(key));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, null);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue1);
-
- // Set to null
- this.persistenceUnitSetProperty(key, null);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, null);
-
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue2);
- }
-
- protected void verifyPutCachingProperty(String propertyName, String entityName, Object expectedValue) throws Exception {
- this.verifyEvent(propertyName);
- this.verifyCachingEvent(propertyName, entityName, expectedValue);
- }
-
- protected void verifyCachingEvent(String propertyName, String entityName, Object expectedValue) throws Exception {
- // verify event value
- CachingEntity entity = (CachingEntity) this.propertyChangedEvent.getNewValue();
- if (propertyName.equals(CachingEntity.CACHE_TYPE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getCacheTypeOf(entityName));
- assertEquals(expectedValue, this.caching.getCacheTypeOf(entityName));
- }
- else if (propertyName.equals(CachingEntity.CACHE_SIZE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getCacheSizeOf(entityName));
- assertEquals(expectedValue, this.caching.getCacheSizeOf(entityName));
- }
- else if (propertyName.equals(CachingEntity.SHARED_CACHE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getSharedCacheOf(entityName));
- assertEquals(expectedValue, this.caching.getSharedCacheOf(entityName));
- }
- else {
- this.throwMissingDefinition("verifyCachingEvent", propertyName);
- }
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Caching.CACHE_TYPE_DEFAULT_PROPERTY))
- this.caching.setCacheTypeDefault((CacheType) newValue);
- else if (propertyName.equals(Caching.CACHE_SIZE_DEFAULT_PROPERTY))
- this.caching.setCacheSizeDefault((Integer) newValue);
- else if (propertyName.equals(Caching.SHARED_CACHE_DEFAULT_PROPERTY))
- this.caching.setSharedCacheDefault((Boolean) newValue);
- else if (propertyName.equals(Caching.FLUSH_CLEAR_CACHE_PROPERTY))
- this.caching.setFlushClearCache((FlushClearCache) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- protected void setCachingProperty(String propertyName, String entityName, Object newValue) throws NoSuchFieldException {
- if (propertyName.equals(CachingEntity.CACHE_TYPE_PROPERTY))
- this.caching.setCacheTypeOf(entityName, (CacheType) newValue);
- else if (propertyName.equals(CachingEntity.CACHE_SIZE_PROPERTY))
- this.caching.setCacheSizeOf(entityName, (Integer) newValue);
- else if (propertyName.equals(CachingEntity.SHARED_CACHE_PROPERTY))
- this.caching.setSharedCacheOf(entityName, (Boolean) newValue);
- else
- this.throwMissingDefinition("setCachingProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Caching.CACHE_TYPE_DEFAULT_PROPERTY))
- modelValue = this.caching.getCacheTypeDefault();
- else if (propertyName.equals(Caching.CACHE_SIZE_DEFAULT_PROPERTY))
- modelValue = this.caching.getCacheSizeDefault();
- else if (propertyName.equals(Caching.SHARED_CACHE_DEFAULT_PROPERTY))
- modelValue = this.caching.getSharedCacheDefault();
- else if (propertyName.equals(CachingEntity.CACHE_SIZE_PROPERTY))
- modelValue = this.caching.getCacheSizeOf(ENTITY_TEST);
- else if (propertyName.equals(CachingEntity.CACHE_TYPE_PROPERTY))
- modelValue = this.caching.getCacheTypeOf(ENTITY_TEST);
- else if (propertyName.equals(CachingEntity.SHARED_CACHE_PROPERTY))
- modelValue = this.caching.getSharedCacheOf(ENTITY_TEST);
- else if (propertyName.equals(Caching.FLUSH_CLEAR_CACHE_PROPERTY))
- modelValue = this.caching.getFlushClearCache();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java
deleted file mode 100644
index 1239480591..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-
-/**
- * CachingValueModelTests
- */
-@SuppressWarnings("nls")
-public class CachingValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Caching caching;
- private PropertyValueModel<Caching> cachingHolder;
-
- private WritablePropertyValueModel<CacheType> cacheTypeHolder;
- private PropertyChangeListener cacheTypeListener;
- private PropertyChangeEvent cacheTypeEvent;
-
- private WritablePropertyValueModel<Boolean> sharedCacheHolder;
- private PropertyChangeListener sharedCacheListener;
- private PropertyChangeEvent sharedCacheEvent;
-
- private WritablePropertyValueModel<CacheType> cacheTypeDefaultHolder;
- private PropertyChangeListener cacheTypeDefaultListener;
- private PropertyChangeEvent cacheTypeDefaultEvent;
-
- private WritablePropertyValueModel<Boolean> sharedCacheDefaultHolder;
- private PropertyChangeListener sharedCacheDefaultListener;
- private PropertyChangeEvent sharedCacheDefaultEvent;
-
- public static final String ENTITY_NAME_TEST_VALUE = "Employee";
- public static final CacheType CACHE_TYPE_TEST_VALUE = CacheType.hard_weak;
- public static final Boolean SHARED_CACHE_TEST_VALUE = Boolean.FALSE;
- public static final CacheType CACHE_TYPE_DEFAULT_TEST_VALUE = CacheType.weak;
- public static final Boolean SHARED_CACHE_DEFAULT_TEST_VALUE = Boolean.FALSE;
-
- public CachingValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.caching = this.subject.getCaching(); // Subject
- this.cachingHolder = new SimplePropertyValueModel<Caching>(this.caching);
-
- this.cacheTypeHolder = this.buildCacheTypeAA(this.cachingHolder);
- this.cacheTypeListener = this.buildCacheTypeChangeListener();
- this.cacheTypeHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeListener);
- this.cacheTypeEvent = null;
-
- this.sharedCacheHolder = this.buildSharedCacheAA(this.cachingHolder);
- this.sharedCacheListener = this.buildSharedCacheChangeListener();
- this.sharedCacheHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheListener);
- this.sharedCacheEvent = null;
-
- this.cacheTypeDefaultHolder = this.buildCacheTypeDefaultAA(this.cachingHolder);
- this.cacheTypeDefaultListener = this.buildCacheTypeDefaultChangeListener();
- this.cacheTypeDefaultHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeDefaultListener);
- this.cacheTypeDefaultEvent = null;
-
- this.sharedCacheDefaultHolder = this.buildSharedCacheDefaultAA(this.cachingHolder);
- this.sharedCacheDefaultListener = this.buildSharedCacheDefaultChangeListener();
- this.sharedCacheDefaultHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheDefaultListener);
- this.sharedCacheDefaultEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectCaching = (AbstractModel) this.caching; // Subject
- PropertyAspectAdapter<Caching, CacheType> cacheTypeAA =
- (PropertyAspectAdapter<Caching, CacheType>) this.cacheTypeHolder;
- assertTrue(cacheTypeAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_PROPERTY));
-
- cacheTypeAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_PROPERTY));
- assertFalse(cacheTypeAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyAspectAdapter<Caching, Boolean> sharedCacheAA =
- (PropertyAspectAdapter<Caching, Boolean>) this.sharedCacheHolder;
- assertTrue(sharedCacheAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_PROPERTY));
-
- sharedCacheAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_PROPERTY));
- assertFalse(sharedCacheAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyAspectAdapter<Caching, CacheType> cacheTypeDefaultAA =
- (PropertyAspectAdapter<Caching, CacheType>) this.cacheTypeDefaultHolder;
- assertTrue(cacheTypeDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_DEFAULT_PROPERTY));
-
- cacheTypeDefaultAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeDefaultListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_DEFAULT_PROPERTY));
- assertFalse(cacheTypeDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyAspectAdapter<Caching, Boolean> sharedCacheDefaultAA =
- (PropertyAspectAdapter<Caching, Boolean>) this.sharedCacheDefaultHolder;
- assertTrue(sharedCacheDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_DEFAULT_PROPERTY));
-
- sharedCacheDefaultAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheDefaultListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_DEFAULT_PROPERTY));
- assertFalse(sharedCacheDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_NAME_TEST_VALUE,
- CACHE_TYPE_TEST_VALUE);
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_NAME_TEST_VALUE,
- SHARED_CACHE_TEST_VALUE);
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT,
- CACHE_TYPE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT,
- SHARED_CACHE_DEFAULT_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.caching;
- }
-
- /** ****** CacheType ******* */
- private WritablePropertyValueModel<CacheType> buildCacheTypeAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, CacheType>(subjectHolder, Caching.CACHE_TYPE_PROPERTY) {
- @Override
- protected CacheType buildValue_() {
- return this.subject.getCacheTypeOf(ENTITY_NAME_TEST_VALUE);
- }
-
- @Override
- protected void setValue_(CacheType enumValue) {
- this.subject.setCacheTypeOf(ENTITY_NAME_TEST_VALUE, enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildCacheTypeChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.cacheTypeEvent = e;
- }
- };
- }
-
- /** ****** SharedCache ******* */
- private WritablePropertyValueModel<Boolean> buildSharedCacheAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, Boolean>(subjectHolder, Caching.SHARED_CACHE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSharedCacheOf(ENTITY_NAME_TEST_VALUE);
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setSharedCacheOf(ENTITY_NAME_TEST_VALUE, enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildSharedCacheChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.sharedCacheEvent = e;
- }
- };
- }
-
- /** ****** CacheTypeDefault ******* */
- private WritablePropertyValueModel<CacheType> buildCacheTypeDefaultAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, CacheType>(subjectHolder, Caching.CACHE_TYPE_DEFAULT_PROPERTY) {
- @Override
- protected CacheType buildValue_() {
- return this.subject.getCacheTypeDefault();
- }
-
- @Override
- protected void setValue_(CacheType enumValue) {
- this.subject.setCacheTypeDefault(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildCacheTypeDefaultChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.cacheTypeDefaultEvent = e;
- }
- };
- }
-
- /** ****** SharedCacheDefault ******* */
- private WritablePropertyValueModel<Boolean> buildSharedCacheDefaultAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, Boolean>(subjectHolder, Caching.SHARED_CACHE_DEFAULT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSharedCacheDefault();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setSharedCacheDefault(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildSharedCacheDefaultChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.sharedCacheDefaultEvent = e;
- }
- };
- }
-
- /** ****** Basic Entity's Properties Tests ******* */
-
- public void testClone() {
- CachingEntity entity = this.buildEntity("TestEntity", CacheType.full, 100, true);
-
- this.verifyClone(entity, entity.clone());
- }
-
- public void testEquals() {
- CachingEntity entity1 = this.buildEntity("TestEntityA", CacheType.full, 100, true);
- CachingEntity entity2 = this.buildEntity("TestEntityB", CacheType.full, 100, true);
- assertEquals(entity1, entity2);
- CachingEntity entity3 = this.buildEntity("TestEntityC", CacheType.full, 100, true);
- assertEquals(entity1, entity3);
- assertEquals(entity2, entity3);
- }
-
- public void testIsEmpty() {
- CachingEntity entity = this.buildEntity("TestEntity");
- assertTrue(entity.isEmpty());
- this.caching.setCacheSizeOf(entity.getName(), 100);
- assertFalse(entity.isEmpty());
- }
-
- private void verifyClone(CachingEntity original, CachingEntity clone) {
- assertNotSame(original, clone);
- assertEquals(original, original);
- assertEquals(original, clone);
- }
-
- private CachingEntity buildEntity(String name) {
- return this.caching.addEntity(name);
- }
-
- private CachingEntity buildEntity(String name, CacheType cacheType, Integer size, Boolean isShared) {
- CachingEntity entity = this.caching.addEntity(name);
- this.caching.setCacheTypeOf(entity.getName(), cacheType);
- this.caching.setCacheSizeOf(entity.getName(), size);
- this.caching.setSharedCacheOf(entity.getName(), isShared);
- return entity;
- }
-
- /** ****** Caching Tests ******* */
- public void testValue() {
- /** ****** CacheType - defaults for entity level caching are equal to the persistence unit settings ******* */
- this.verifyCacheTypeAAValue(CACHE_TYPE_TEST_VALUE);
- assertEquals(this.caching.getCacheTypeDefault(), this.caching.getDefaultCacheType());
- /** ****** SharedCache - defaults for entity level caching are equal to the persistence unit settings ******* */
- this.verifySharedCacheAAValue(SHARED_CACHE_TEST_VALUE);
- assertEquals(this.caching.getSharedCacheDefault(), this.caching.getDefaultSharedCache());
- /** ****** CacheTypeDefault ******* */
- this.verifyCacheTypeDefaultAAValue(CACHE_TYPE_DEFAULT_TEST_VALUE);
- assertEquals(Caching.DEFAULT_CACHE_TYPE_DEFAULT, this.caching.getDefaultCacheTypeDefault());
- /** ****** SharedCacheDefault ******* */
- this.verifySharedCacheDefaultAAValue(SHARED_CACHE_DEFAULT_TEST_VALUE);
- assertEquals(Caching.DEFAULT_SHARED_CACHE_DEFAULT, this.caching.getDefaultSharedCacheDefault());
- }
-
- public void testSetValue() throws Exception {
- /** ****** CacheType ******* */
- this.cacheTypeEvent = null;
- this.verifyHasListeners(this.cacheTypeHolder, PropertyValueModel.VALUE);
- CacheType newCacheType = CacheType.full;
- // Modify the property holder
- this.cacheTypeHolder.setValue(newCacheType);
- this.verifyCacheTypeAAValue(newCacheType);
- assertNotNull(this.cacheTypeEvent);
- /** ****** SharedCache ******* */
- this.sharedCacheEvent = null;
- this.verifyHasListeners(this.sharedCacheHolder, PropertyValueModel.VALUE);
- Boolean newSharedCache = !SHARED_CACHE_TEST_VALUE;
- // Modify the property holder
- this.sharedCacheHolder.setValue(newSharedCache);
- this.verifySharedCacheAAValue(newSharedCache);
- assertNotNull(this.sharedCacheEvent);
- /** ****** CacheTypeDefault ******* */
- this.cacheTypeDefaultEvent = null;
- this.verifyHasListeners(this.cacheTypeDefaultHolder, PropertyValueModel.VALUE);
- CacheType newCacheTypeDefault = CacheType.none;
- // Modify the property holder
- this.cacheTypeDefaultHolder.setValue(newCacheTypeDefault);
- this.verifyCacheTypeDefaultAAValue(newCacheTypeDefault);
- assertNotNull(this.cacheTypeDefaultEvent);
- /** ****** SharedCacheDefault ******* */
- this.sharedCacheDefaultEvent = null;
- this.verifyHasListeners(this.sharedCacheDefaultHolder, PropertyValueModel.VALUE);
- Boolean newSharedCacheDefault = !SHARED_CACHE_DEFAULT_TEST_VALUE;
- // Modify the property holder
- this.sharedCacheDefaultHolder.setValue(newSharedCacheDefault);
- this.verifySharedCacheDefaultAAValue(newSharedCacheDefault);
- assertNotNull(this.sharedCacheDefaultEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- /** ****** CacheType ******* */
- this.cacheTypeEvent = null;
- // Setting the property holder
- this.cacheTypeHolder.setValue(null);
- // testing Holder
- this.verifyCacheTypeAAValue(null);
- assertNotNull(this.cacheTypeEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_NAME_TEST_VALUE, notDeleted);
- /** ****** SharedCache ******* */
- this.sharedCacheEvent = null;
- // Setting the property holder
- this.sharedCacheHolder.setValue(null);
- // testing Holder
- this.verifySharedCacheAAValue(null);
- assertNotNull(this.sharedCacheEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_NAME_TEST_VALUE, notDeleted);
- /** ****** CacheTypeDefault ******* */
- this.cacheTypeDefaultEvent = null;
- // Setting the property holder
- this.cacheTypeDefaultHolder.setValue(null);
- // testing Holder
- this.verifyCacheTypeDefaultAAValue(null);
- assertNotNull(this.cacheTypeDefaultEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT, notDeleted);
- /** ****** SharedCacheDefault ******* */
- this.sharedCacheDefaultEvent = null;
- // Setting the property holder
- this.sharedCacheDefaultHolder.setValue(null);
- // testing Holder
- this.verifySharedCacheDefaultAAValue(null);
- assertNotNull(this.sharedCacheDefaultEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT, notDeleted);
- }
-
- /** ****** convenience methods ******* */
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyCacheTypeAAValue(CacheType testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getCacheTypeOf(ENTITY_NAME_TEST_VALUE),
- this.cacheTypeHolder,
- Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_NAME_TEST_VALUE);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifySharedCacheAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getSharedCacheOf(ENTITY_NAME_TEST_VALUE),
- this.sharedCacheHolder,
- Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_NAME_TEST_VALUE);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyCacheTypeDefaultAAValue(CacheType testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getCacheTypeDefault(),
- this.cacheTypeDefaultHolder,
- Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifySharedCacheDefaultAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getSharedCacheDefault(),
- this.sharedCacheDefaultHolder,
- Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT);
- }
-
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java
deleted file mode 100644
index 9b9fefea27..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-
-/**
- * CustomizationValueModelTests
- */
-@SuppressWarnings("nls")
-public class CustomizationValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Customization customization;
-
- private WritablePropertyValueModel<Boolean> throwExceptionsHolder;
- private PropertyChangeListener throwExceptionsListener;
- private PropertyChangeEvent throwExceptionsEvent;
-
- public static final String ENTITY_NAME_TEST_VALUE = "Employee";
- public static final Boolean THROW_EXCEPTIONS_TEST_VALUE = Boolean.FALSE;
- public static final String CUSTOMIZER_TEST_VALUE = "acme.sessions.Customizer";
-
- public CustomizationValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.customization = this.subject.getCustomization(); // Subject
- PropertyValueModel<Customization> customizationHolder = new SimplePropertyValueModel<Customization>(this.customization);
-
- this.throwExceptionsHolder = this.buildThrowExceptionsAA(customizationHolder);
- this.throwExceptionsListener = this.buildThrowExceptionsChangeListener();
- this.throwExceptionsHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.throwExceptionsListener);
- this.throwExceptionsEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectCustomization = (AbstractModel) this.customization; // Subject
-
- PropertyAspectAdapter<Customization, Boolean> throwExceptionsAA =
- (PropertyAspectAdapter<Customization, Boolean>) this.throwExceptionsHolder;
- assertTrue(throwExceptionsAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCustomization.hasAnyPropertyChangeListeners(Customization.THROW_EXCEPTIONS_PROPERTY));
-
- throwExceptionsAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.throwExceptionsListener);
- assertFalse(subjectCustomization.hasAnyPropertyChangeListeners(Customization.THROW_EXCEPTIONS_PROPERTY));
- assertFalse(throwExceptionsAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Customization.ECLIPSELINK_THROW_EXCEPTIONS,
- THROW_EXCEPTIONS_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.customization;
- }
-
- // ****** ThrowExceptions *******
- private WritablePropertyValueModel<Boolean> buildThrowExceptionsAA(PropertyValueModel<Customization> subjectHolder) {
- return new PropertyAspectAdapter<Customization, Boolean>(subjectHolder, Customization.THROW_EXCEPTIONS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getThrowExceptions();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setThrowExceptions(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildThrowExceptionsChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CustomizationValueModelTests.this.throwExceptionsEvent = e;
- }
- };
- }
-
- /** ****** Basic Entity's Properties Tests ******* */
-
- public void testClone() {
- CustomizationEntity entity = this.buildEntity("TestEntity", CUSTOMIZER_TEST_VALUE);
-
- this.verifyClone(entity, entity.clone());
- }
-
- public void testEquals() {
- CustomizationEntity entity1 = this.buildEntity("TestEntityA", CUSTOMIZER_TEST_VALUE);
- CustomizationEntity entity2 = this.buildEntity("TestEntityB", CUSTOMIZER_TEST_VALUE);
- assertEquals(entity1, entity2);
- CustomizationEntity entity3 = this.buildEntity("TestEntityC", CUSTOMIZER_TEST_VALUE);
- assertEquals(entity1, entity3);
- assertEquals(entity2, entity3);
- }
-
- public void testIsEmpty() {
- CustomizationEntity entity = this.buildEntity("TestEntity");
- assertTrue(entity.isEmpty());
- this.customization.setDescriptorCustomizerOf(entity.getName(), CUSTOMIZER_TEST_VALUE);
- assertFalse(entity.isEmpty());
- }
-
- private void verifyClone(CustomizationEntity original, CustomizationEntity clone) {
- assertNotSame(original, clone);
- assertEquals(original, original);
- assertEquals(original, clone);
- }
-
- private CustomizationEntity buildEntity(String name) {
- return this.customization.addEntity(name);
- }
-
- private CustomizationEntity buildEntity(String name, String aClassName) {
- CustomizationEntity entity = this.customization.addEntity(name);
- this.customization.setDescriptorCustomizerOf(entity.getName(), aClassName);
- return entity;
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** ThrowExceptions *******
- this.verifyThrowExceptionsAAValue(THROW_EXCEPTIONS_TEST_VALUE);
- assertEquals(Customization.DEFAULT_THROW_EXCEPTIONS, this.customization.getDefaultThrowExceptions());
- }
-
- public void testSetValue() throws Exception {
- // ****** ThrowExceptions *******
- this.throwExceptionsEvent = null;
- this.verifyHasListeners(this.throwExceptionsHolder, PropertyValueModel.VALUE);
- Boolean newThrowExceptions = !THROW_EXCEPTIONS_TEST_VALUE;
- // Modify the property holder
- this.throwExceptionsHolder.setValue(newThrowExceptions);
- this.verifyThrowExceptionsAAValue(newThrowExceptions);
- assertNotNull(this.throwExceptionsEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** ThrowExceptions *******
- this.throwExceptionsEvent = null;
- // Setting the property holder
- this.throwExceptionsHolder.setValue(null);
- // testing Holder
- this.verifyThrowExceptionsAAValue(null);
- assertNotNull(this.throwExceptionsEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Customization.ECLIPSELINK_THROW_EXCEPTIONS, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyThrowExceptionsAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.customization.getThrowExceptions(),
- this.throwExceptionsHolder,
- Customization.ECLIPSELINK_THROW_EXCEPTIONS);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java
deleted file mode 100644
index 1b9dea60c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection2_0;
-
-/**
- * EclipseLink2_0ConnectionTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0ConnectionTests extends EclipseLink2_0PersistenceUnitTestCase
-{
- private Connection2_0 connection;
-
- public static final String NATIVE_SQL_KEY = Connection.ECLIPSELINK_NATIVE_SQL;
- public static final Boolean NATIVE_SQL_TEST_VALUE = false;
- public static final Boolean NATIVE_SQL_TEST_VALUE_2 = ! NATIVE_SQL_TEST_VALUE;
-
- public static final String DRIVER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_DRIVER;
- public static final String DRIVER_TEST_VALUE = "connection.driver";
- public static final String DRIVER_TEST_VALUE_2 = "connection.driver.2";
- public static final String LEGACY_DRIVER_KEY = Connection.ECLIPSELINK_DRIVER;
- public static final String LEGACY_DRIVER_TEST_VALUE = "legacy.connection.driver";
-
- public static final String URL_KEY = JpaConnection2_0.PERSISTENCE_JDBC_URL;
- public static final String URL_TEST_VALUE = "test";
- public static final String URL_TEST_VALUE_2 = "test_2";
- public static final String LEGACY_URL_KEY = Connection.ECLIPSELINK_URL;
- public static final String LEGACY_URL_TEST_VALUE = "legacy.connection.url";
-
- public static final String USER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_USER;
- public static final String USER_TEST_VALUE = "test";
- public static final String USER_TEST_VALUE_2 = "test_2";
- public static final String LEGACY_USER_KEY = Connection.ECLIPSELINK_USER;
- public static final String LEGACY_USER_TEST_VALUE = "legacy.connection.user";
-
- public static final String PASSWORD_KEY = JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD;
- public static final String PASSWORD_TEST_VALUE = "test";
- public static final String PASSWORD_TEST_VALUE_2 = "test_2";
- public static final String LEGACY_PASSWORD_KEY = Connection.ECLIPSELINK_PASSWORD;
- public static final String LEGACY_PASSWORD_TEST_VALUE = "legacy.connection.password";
-
- public EclipseLink2_0ConnectionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.connection = (Connection2_0) this.subject.getConnection();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.connection.addPropertyChangeListener(Connection.DRIVER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.URL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.USER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.PASSWORD_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 8; // EclipseLink properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes EclipseLink properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(LEGACY_DRIVER_KEY, LEGACY_DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(DRIVER_KEY, DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(LEGACY_URL_KEY, LEGACY_URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(URL_KEY, URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(LEGACY_USER_KEY, LEGACY_USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(USER_KEY, USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(LEGACY_PASSWORD_KEY, LEGACY_PASSWORD_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(PASSWORD_KEY, PASSWORD_TEST_VALUE.toString());
-
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.connection;
- }
-
- // ********** get/set property **********
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
-
- if (propertyName.equals(Connection.DRIVER_PROPERTY))
- modelValue = this.connection.getDriver();
- else if (propertyName.equals(Connection.URL_PROPERTY))
- modelValue = this.connection.getUrl();
- else if (propertyName.equals(Connection.USER_PROPERTY))
- modelValue = this.connection.getUser();
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- modelValue = this.connection.getPassword();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Connection.DRIVER_PROPERTY))
- this.connection.setDriver((String) newValue);
- else if (propertyName.equals(Connection.URL_PROPERTY))
- this.connection.setUrl((String) newValue);
- else if (propertyName.equals(Connection.USER_PROPERTY))
- this.connection.setUser((String) newValue);
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- this.connection.setPassword((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
-
- // ********** Properties Name Migration tests **********
- public void testDriverPropertyNameMigration() throws Exception {
-
- // Verify legacy driver exists
- assertTrue("Legacy driver not exists", this.propertyValueEquals(LEGACY_DRIVER_KEY, LEGACY_DRIVER_TEST_VALUE));
-
- // Verify driver read in
- assertEquals("Incorrect driver read", this.connection.getDriver(), DRIVER_TEST_VALUE);
-
- // Change driver value
- this.connection.setDriver(DRIVER_TEST_VALUE_2);
- // Verify driver value changed
- assertEquals("Driver not set", this.connection.getDriver(), DRIVER_TEST_VALUE_2);
- assertTrue("PersistenceUnit property not set", this.propertyValueEquals(DRIVER_KEY, DRIVER_TEST_VALUE_2));
-
- // Verify legacy entry has been deleted
- this.verifyPuHasNotProperty(LEGACY_DRIVER_KEY, "Legacy property has not been deleted");
- }
-
- public void testPropertiesNamesMigration() throws Exception {
- // connection.initializeProperties() occurred before test.puPopulate() therefore
- // we cannot test the case where there are legacy properties only exist in the xml
- // Verify that User & Password exist in both forms
- this.verifyPuHasProperty(USER_KEY, "Property not exists");
- this.verifyPuHasProperty(PASSWORD_KEY, "Property not exists");
- this.verifyPuHasProperty(LEGACY_USER_KEY, "Legacy property not exists");
- this.verifyPuHasProperty(LEGACY_PASSWORD_KEY, "Legacy property not exists");
-
- // Change a property value to trigger migration routine
- this.connection.setNativeSql(NATIVE_SQL_TEST_VALUE);
-
- // Verify that all legacy entry has been deleted
- this.verifyPuHasNotProperty(LEGACY_DRIVER_KEY, "Legacy property has not been deleted");
- this.verifyPuHasNotProperty(LEGACY_URL_KEY, "Legacy property has not been deleted");
- this.verifyPuHasNotProperty(LEGACY_USER_KEY, "Legacy property has not been deleted");
- this.verifyPuHasNotProperty(LEGACY_PASSWORD_KEY, "Legacy property has not been deleted");
- }
-
-
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java
deleted file mode 100644
index 48a59dde32..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-
-/**
- * EclipseLink2_0LoggingTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0LoggingTests extends EclipseLink2_0PersistenceUnitTestCase
-{
- private Logging2_0 logging;
-
- public static final String SQL_LOGGING_KEY = Logging2_0.ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel SQL_LOGGING_TEST_VALUE = LoggingLevel.off;
- public static final LoggingLevel SQL_LOGGING_TEST_VALUE_2 = LoggingLevel.severe;
-
- public static final String TRANSACTION_LOGGING_KEY = Logging2_0.ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel TRANSACTION_LOGGING_TEST_VALUE = LoggingLevel.warning;
- public static final LoggingLevel TRANSACTION_LOGGING_TEST_VALUE_2 = LoggingLevel.info;
-
- public static final String EVENT_LOGGING_KEY = Logging2_0.ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel EVENT_LOGGING_TEST_VALUE = LoggingLevel.config;
- public static final LoggingLevel EVENT_LOGGING_TEST_VALUE_2 = LoggingLevel.fine;
-
- public static final String CONNECTION_LOGGING_KEY = Logging2_0.ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel CONNECTION_LOGGING_TEST_VALUE = LoggingLevel.finer;
- public static final LoggingLevel CONNECTION_LOGGING_TEST_VALUE_2 = LoggingLevel.finest;
-
- public static final String QUERY_LOGGING_KEY = Logging2_0.ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel QUERY_LOGGING_TEST_VALUE = LoggingLevel.all;
- public static final LoggingLevel QUERY_LOGGING_TEST_VALUE_2 = LoggingLevel.off;
-
- public static final String CACHE_LOGGING_KEY = Logging2_0.ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel CACHE_LOGGING_TEST_VALUE = LoggingLevel.severe;
- public static final LoggingLevel CACHE_LOGGING_TEST_VALUE_2 = LoggingLevel.warning;
-
- public static final String PROPAGATION_LOGGING_KEY = Logging2_0.ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel PROPAGATION_LOGGING_TEST_VALUE = LoggingLevel.info;
- public static final LoggingLevel PROPAGATION_LOGGING_TEST_VALUE_2 = LoggingLevel.config;
-
- public static final String SEQUENCING_LOGGING_KEY = Logging2_0.ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel SEQUENCING_LOGGING_TEST_VALUE = LoggingLevel.fine;
- public static final LoggingLevel SEQUENCING_LOGGING_TEST_VALUE_2 = LoggingLevel.finer;
-
- public static final String EJB_LOGGING_KEY = Logging2_0.ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel EJB_LOGGING_TEST_VALUE = LoggingLevel.finest;
- public static final LoggingLevel EJB_LOGGING_TEST_VALUE_2 = LoggingLevel.all;
-
- public static final String DMS_LOGGING_KEY = Logging2_0.ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel DMS_LOGGING_TEST_VALUE = LoggingLevel.off;
- public static final LoggingLevel DMS_LOGGING_TEST_VALUE_2 = LoggingLevel.severe;
-
- public static final String EJB_OR_METADATA_LOGGING_KEY = Logging2_0.ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel EJB_OR_METADATA_LOGGING_TEST_VALUE = LoggingLevel.warning;
- public static final LoggingLevel EJB_OR_METADATA_LOGGING_TEST_VALUE_2 = LoggingLevel.info;
-
- public static final String METAMODEL_LOGGING_KEY = Logging2_0.ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel METAMODEL_LOGGING_TEST_VALUE = LoggingLevel.config;
- public static final LoggingLevel METAMODEL_LOGGING_TEST_VALUE_2 = LoggingLevel.fine;
-
- public static final String WEAVER_LOGGING_KEY = Logging2_0.ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel WEAVER_LOGGING_TEST_VALUE = LoggingLevel.finer;
- public static final LoggingLevel WEAVER_LOGGING_TEST_VALUE_2 = LoggingLevel.finest;
-
- public static final String PROPERTIES_LOGGING_KEY = Logging2_0.ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel PROPERTIES_LOGGING_TEST_VALUE = LoggingLevel.all;
- public static final LoggingLevel PROPERTIES_LOGGING_TEST_VALUE_2 = LoggingLevel.off;
-
- public static final String SERVER_LOGGING_KEY = Logging2_0.ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel SERVER_LOGGING_TEST_VALUE = LoggingLevel.severe;
- public static final LoggingLevel SERVER_LOGGING_TEST_VALUE_2 = LoggingLevel.warning;
-
- // ********** constructors **********
- public EclipseLink2_0LoggingTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.logging = (Logging2_0) this.subject.getLogging();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.logging.addPropertyChangeListener(Logging2_0.SQL_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.TRANSACTION_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.EVENT_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.CONNECTION_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.QUERY_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.CACHE_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.PROPAGATION_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.SEQUENCING_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.EJB_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.DMS_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.METAMODEL_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.WEAVER_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.PROPERTIES_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.SERVER_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 15; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(SQL_LOGGING_KEY, SQL_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(TRANSACTION_LOGGING_KEY, TRANSACTION_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(EVENT_LOGGING_KEY, EVENT_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(CONNECTION_LOGGING_KEY, CONNECTION_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(QUERY_LOGGING_KEY, QUERY_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(CACHE_LOGGING_KEY, CACHE_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(PROPAGATION_LOGGING_KEY, PROPAGATION_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(SEQUENCING_LOGGING_KEY, SEQUENCING_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(EJB_LOGGING_KEY, EJB_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(DMS_LOGGING_KEY, DMS_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(EJB_OR_METADATA_LOGGING_KEY, EJB_OR_METADATA_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(METAMODEL_LOGGING_KEY, METAMODEL_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(WEAVER_LOGGING_KEY, WEAVER_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(PROPERTIES_LOGGING_KEY, PROPERTIES_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(SERVER_LOGGING_KEY, SERVER_LOGGING_TEST_VALUE);
-
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.logging;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
-
- return this.logging.getLevel(propertyName);
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
-
- this.logging.setLevel(propertyName, (LoggingLevel) newValue);
- }
-
- // ********** Sql Level tests **********
- public void testSetSqlLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- SQL_LOGGING_KEY,
- SQL_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- SQL_LOGGING_KEY,
- SQL_LOGGING_TEST_VALUE,
- SQL_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveSqlLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- SQL_LOGGING_KEY,
- SQL_LOGGING_TEST_VALUE,
- SQL_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Transaction Level tests **********
- public void testSetTransactionLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- TRANSACTION_LOGGING_KEY,
- TRANSACTION_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- TRANSACTION_LOGGING_KEY,
- TRANSACTION_LOGGING_TEST_VALUE,
- TRANSACTION_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveTransactionLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- TRANSACTION_LOGGING_KEY,
- TRANSACTION_LOGGING_TEST_VALUE,
- TRANSACTION_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Event Level tests **********
- public void testSetEventLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- EVENT_LOGGING_KEY,
- EVENT_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- EVENT_LOGGING_KEY,
- EVENT_LOGGING_TEST_VALUE,
- EVENT_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveEventLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- EVENT_LOGGING_KEY,
- EVENT_LOGGING_TEST_VALUE,
- EVENT_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Connection Level tests **********
- public void testSetConnectionLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- CONNECTION_LOGGING_KEY,
- CONNECTION_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- CONNECTION_LOGGING_KEY,
- CONNECTION_LOGGING_TEST_VALUE,
- CONNECTION_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveConnectionLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- CONNECTION_LOGGING_KEY,
- CONNECTION_LOGGING_TEST_VALUE,
- CONNECTION_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Query Level tests **********
- public void testSetQueryLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- QUERY_LOGGING_KEY,
- QUERY_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- QUERY_LOGGING_KEY,
- QUERY_LOGGING_TEST_VALUE,
- QUERY_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveQueryLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- QUERY_LOGGING_KEY,
- QUERY_LOGGING_TEST_VALUE,
- QUERY_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Cache Level tests **********
- public void testSetCacheLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- CACHE_LOGGING_KEY,
- CACHE_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- CACHE_LOGGING_KEY,
- CACHE_LOGGING_TEST_VALUE,
- CACHE_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_LOGGING_KEY,
- CACHE_LOGGING_TEST_VALUE,
- CACHE_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Propagation Level tests **********
- public void testSetPropagationLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- PROPAGATION_LOGGING_KEY,
- PROPAGATION_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- PROPAGATION_LOGGING_KEY,
- PROPAGATION_LOGGING_TEST_VALUE,
- PROPAGATION_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemovePropagationLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- PROPAGATION_LOGGING_KEY,
- PROPAGATION_LOGGING_TEST_VALUE,
- PROPAGATION_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Sequencing Level tests **********
- public void testSetSequencingLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- SEQUENCING_LOGGING_KEY,
- SEQUENCING_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- SEQUENCING_LOGGING_KEY,
- SEQUENCING_LOGGING_TEST_VALUE,
- SEQUENCING_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveSequencingLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- SEQUENCING_LOGGING_KEY,
- SEQUENCING_LOGGING_TEST_VALUE,
- SEQUENCING_LOGGING_TEST_VALUE_2);
- }
-
- // ********** EJB Level tests **********
- public void testSetEJBLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- EJB_LOGGING_KEY,
- EJB_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- EJB_LOGGING_KEY,
- EJB_LOGGING_TEST_VALUE,
- EJB_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveEJBLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- EJB_LOGGING_KEY,
- EJB_LOGGING_TEST_VALUE,
- EJB_LOGGING_TEST_VALUE_2);
- }
-
- // ********** DMS Level tests **********
- public void testSetDMSLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- DMS_LOGGING_KEY,
- DMS_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- DMS_LOGGING_KEY,
- DMS_LOGGING_TEST_VALUE,
- DMS_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveDMSLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- DMS_LOGGING_KEY,
- DMS_LOGGING_TEST_VALUE,
- DMS_LOGGING_TEST_VALUE_2);
- }
-
- // ********** EJB or Metadata Level tests **********
- public void testSetEJBOrMetadataLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- EJB_OR_METADATA_LOGGING_KEY,
- EJB_OR_METADATA_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- EJB_OR_METADATA_LOGGING_KEY,
- EJB_OR_METADATA_LOGGING_TEST_VALUE,
- EJB_OR_METADATA_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveEJBOrMetadataLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- EJB_OR_METADATA_LOGGING_KEY,
- EJB_OR_METADATA_LOGGING_TEST_VALUE,
- EJB_OR_METADATA_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Metamodel Level tests **********
- public void testSetMetamodelLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- METAMODEL_LOGGING_KEY,
- METAMODEL_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- METAMODEL_LOGGING_KEY,
- METAMODEL_LOGGING_TEST_VALUE,
- METAMODEL_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveMetamodelLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- METAMODEL_LOGGING_KEY,
- METAMODEL_LOGGING_TEST_VALUE,
- METAMODEL_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Weaver Level tests **********
- public void testSetWeaverLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- WEAVER_LOGGING_KEY,
- WEAVER_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- WEAVER_LOGGING_KEY,
- WEAVER_LOGGING_TEST_VALUE,
- WEAVER_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeaverLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVER_LOGGING_KEY,
- WEAVER_LOGGING_TEST_VALUE,
- WEAVER_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Properties Level tests **********
- public void testSetPropertiesLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- PROPERTIES_LOGGING_KEY,
- PROPERTIES_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- PROPERTIES_LOGGING_KEY,
- PROPERTIES_LOGGING_TEST_VALUE,
- PROPERTIES_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemovePropertiesLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- PROPERTIES_LOGGING_KEY,
- PROPERTIES_LOGGING_TEST_VALUE,
- PROPERTIES_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Server Level tests **********
- public void testSetServerLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- SERVER_LOGGING_KEY,
- SERVER_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- SERVER_LOGGING_KEY,
- SERVER_LOGGING_TEST_VALUE,
- SERVER_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveServerLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- SERVER_LOGGING_KEY,
- SERVER_LOGGING_TEST_VALUE,
- SERVER_LOGGING_TEST_VALUE_2);
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java
deleted file mode 100644
index 3c724aee0b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-
-/**
- * EclipseLinkOptions2_0Tests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0OptionsTests extends EclipseLink2_0PersistenceUnitTestCase
-{
- private Options2_0 options;
- private ListChangeEvent prePersistEvent;
- private ListChangeEvent preUpdateEvent;
- private ListChangeEvent preRemoveEvent;
-
- public static final String LOCK_TIMEOUT_KEY = Options2_0.PERSISTENCE_LOCK_TIMEOUT;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE = 100;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String QUERY_TIMEOUT_KEY = Options2_0.PERSISTENCE_QUERY_TIMEOUT;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE = 100;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String VALIDATION_GROUP_PRE_PERSIST_KEY = Options2_0.PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST;
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE = "test_pre-persist_group";
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2 = "test_2_pre-persist_group";
-
- public static final String VALIDATION_GROUP_PRE_UPDATE_KEY = Options2_0.PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE;
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE = "test_pre-update_group";
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2 = "test_2_pre-update_group";
-
- public static final String VALIDATION_GROUP_PRE_REMOVE_KEY = Options2_0.PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE;
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE = "test_pre-remove_group";
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2 = "test_2_pre-remove_group";
-
- // ********** constructors **********
- public EclipseLink2_0OptionsTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = (Options2_0) this.subject.getOptions();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.options.addPropertyChangeListener(Options2_0.LOCK_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.QUERY_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY, propertyChangeListener);
-
- ListChangeListener validationGroupListChangeListener = this.buildValidationGroupListChangeListener();
- this.options.addListChangeListener(Options2_0.VALIDATION_GROUP_PRE_PERSIST_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(Options2_0.VALIDATION_GROUP_PRE_UPDATE_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(Options2_0.VALIDATION_GROUP_PRE_REMOVE_LIST, validationGroupListChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 5; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty(LOCK_TIMEOUT_KEY, LOCK_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(QUERY_TIMEOUT_KEY, QUERY_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
-
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_PERSIST_KEY, VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_UPDATE_KEY, VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_REMOVE_KEY, VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Options2_0.LOCK_TIMEOUT_PROPERTY))
- modelValue = this.options.getLockTimeout();
- else if (propertyName.equals(Options2_0.QUERY_TIMEOUT_PROPERTY))
- modelValue = this.options.getQueryTimeout();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPrePersists().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreUpdates().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreRemoves().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Options2_0.LOCK_TIMEOUT_PROPERTY))
- this.options.setLockTimeout((Integer) newValue);
- else if (propertyName.equals(Options2_0.QUERY_TIMEOUT_PROPERTY))
- this.options.setQueryTimeout((Integer) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist((String) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate((String) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- // ********** LockTimeout tests **********
- public void testSetLockTimeout() throws Exception {
- this.verifyModelInitialized(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveLockTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** QueryTimeout tests **********
- public void testSetQueryTimeout() throws Exception {
- this.verifyModelInitialized(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveQueryTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPrePersist tests **********
- public void testSetValidationGroupPrePersist() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPrePersist() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreUpdate tests **********
- public void testSetValidationGroupPreUpdate() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreUpdate() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreRemove tests **********
- public void testSetValidationGroupPreRemove() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreRemove() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroups list **********
- public void testValidationGroupsList() throws Exception {
- this.verifyListEvents(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2,
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_LIST);
-
- this.verifyListEvents(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2,
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_LIST);
-
- this.verifyListEvents(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2,
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_LIST);
- }
-
- // ********** override **********
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.prePersistEvent = null;
- this.preUpdateEvent = null;
- this.preRemoveEvent = null;
- }
-
- // ****** convenience methods *******
-
- // ********** verify ValidationGroup property **********
- protected void verifySetValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2, true);
- this.propertiesTotal++;
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- @SuppressWarnings("unused")
- protected void verifyAddRemoveValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- assertTrue(this.validationGroupValueExists(propertyName, (String)testValue1));
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key, (String)testValue1);
- assertFalse(this.validationGroupValueExists(propertyName, (String)testValue1));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1, true);
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- protected void verifyAddCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue2));
-
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) != -1);
- }
-
- protected void verifyRemoveCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue2));
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) == -1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue1);
- assertEquals(this.getValidationGroupSize(propertyName), 0);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue1));
-
- assertNull(this.getPersistenceUnit().getProperty(key));
- }
-
- protected void verifyListEvents(String propertyName, String testValue, String listName) throws Exception {
- // add
- this.clearEvent();
- this.addValidationGroupValue(propertyName, testValue);
-
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
-
- // remove
- this.clearEvent();
-
- this.removeValidationGroupValue(propertyName, testValue);
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
- }
-
- protected void verifyPutValidationGroupProperty(String propertyName, Object expectedValue) throws Exception {
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event value
- assertTrue(this.validationGroupValueExists(propertyName, (String) expectedValue));
- return;
- }
-
- // ********** internal method **********
-
- private ListChangeListener buildValidationGroupListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
-
- EclipseLink2_0OptionsTests.this.validationGroupChanged(e);
- }
- };
- }
-
- private void validationGroupChanged(ListChangeEvent e) {
- String listName = e.getListName();
-
- if (listName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_LIST))
- this.prePersistEvent = e;
- else if (listName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_LIST))
- this.preUpdateEvent = e;
- else if (listName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_LIST))
- this.preRemoveEvent = e;
- else
- this.throwUnsupportedOperationException(e);
- }
-
- private void addValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("addValidationGroupValue", propertyName);
- }
-
- private void removeValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.removeValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.removeValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.removeValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("removeValidationGroupValue", propertyName);
- }
-
- private boolean validationGroupValueExists(String propertyName, String propertyValue) throws NoSuchFieldException {
- boolean result = false;
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.validationGroupPrePersistExists(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.validationGroupPreUpdateExists(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.validationGroupPreRemoveExists(propertyValue);
- else
- this.throwMissingDefinition("verifyValidationGroupValueExists", propertyName);
- return result;
- }
-
- private int getValidationGroupSize(String propertyName) throws NoSuchFieldException {
- int result = 0;
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.getValidationGroupPrePersistsSize();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.getValidationGroupPreUpdatesSize();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.getValidationGroupPreRemovesSize();
- else
- this.throwMissingDefinition("verifyValidationGroupSize", propertyName);
- return result;
- }
-
- private ListChangeEvent getEventFor(String propertyName) throws NoSuchFieldException {
- ListChangeEvent event = null;
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- event = this.prePersistEvent;
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- event = this.preUpdateEvent;
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- event = this.preRemoveEvent;
- else
- this.throwMissingDefinition("getEventFor", propertyName);
- return event;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java
deleted file mode 100644
index 55a6479832..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * EclipseLink2_0PersistenceUnitTestCase
- */
-public abstract class EclipseLink2_0PersistenceUnitTestCase extends PersistenceUnitTestCase
-{
- protected EclipseLinkPersistenceUnit subject;
-
- protected PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder;
-
- // ********** constructors **********
- protected EclipseLink2_0PersistenceUnitTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject = this.getPersistenceUnit();
- this.subjectHolder = new SimplePropertyValueModel<EclipseLinkPersistenceUnit>(this.subject);
- this.populatePu();
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_2_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, EclipseLinkPlatform.VERSION_2_0);
- return dataModel;
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java
deleted file mode 100644
index e5a43a7d4c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java
+++ /dev/null
@@ -1,541 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.BatchWriting;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.ExclusiveConnectionMode;
-
-/**
- * ConnectionAdapterTests
- */
-@SuppressWarnings("nls")
-public class EclipseLinkConnectionTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Connection connection;
-
- public static final PersistenceUnitTransactionType TRANSACTION_TYPE_TEST_VALUE = PersistenceUnitTransactionType.RESOURCE_LOCAL;
- public static final PersistenceUnitTransactionType TRANSACTION_TYPE_TEST_VALUE_2 = PersistenceUnitTransactionType.JTA;
-
- public static final String JTA_DATA_SOURCE_TEST_VALUE = "Test_JTA";
- public static final String JTA_DATA_SOURCE_TEST_VALUE_2 = "Test_JTA_2";
-
- public static final String NON_JTA_DATA_SOURCE_TEST_VALUE = "Test_Non_JTA";
- public static final String NON_JTA_DATA_SOURCE_TEST_VALUE_2 = "Test_Non_JTA_2";
-
- public static final String NATIVE_SQL_KEY = Connection.ECLIPSELINK_NATIVE_SQL;
- public static final Boolean NATIVE_SQL_TEST_VALUE = false;
- public static final Boolean NATIVE_SQL_TEST_VALUE_2 = ! NATIVE_SQL_TEST_VALUE;
-
- public static final String BATCH_WRITING_KEY = Connection.ECLIPSELINK_BATCH_WRITING;
- public static final BatchWriting BATCH_WRITING_TEST_VALUE = BatchWriting.oracle_jdbc;
- public static final BatchWriting BATCH_WRITING_TEST_VALUE_2 = BatchWriting.buffered;
-
- public static final String CACHE_STATEMENTS_KEY = Connection.ECLIPSELINK_CACHE_STATEMENTS;
- public static final Boolean CACHE_STATEMENTS_TEST_VALUE = false;
- public static final Boolean CACHE_STATEMENTS_TEST_VALUE_2 = ! CACHE_STATEMENTS_TEST_VALUE;
-
- public static final String CACHE_STATEMENTS_SIZE_KEY = Connection.ECLIPSELINK_CACHE_STATEMENTS_SIZE;
- public static final Integer CACHE_STATEMENTS_SIZE_TEST_VALUE = 100;
- public static final Integer CACHE_STATEMENTS_SIZE_TEST_VALUE_2 = 200;
-
- public static final String DRIVER_KEY = Connection.ECLIPSELINK_DRIVER;
- public static final String DRIVER_TEST_VALUE = "connection.driver";
- public static final String DRIVER_TEST_VALUE_2 = "connection.driver.2";
-
- public static final String URL_KEY = Connection.ECLIPSELINK_URL;
- public static final String URL_TEST_VALUE = "test";
- public static final String URL_TEST_VALUE_2 = "test_2";
-
- public static final String USER_KEY = Connection.ECLIPSELINK_USER;
- public static final String USER_TEST_VALUE = "test";
- public static final String USER_TEST_VALUE_2 = "test_2";
-
- public static final String PASSWORD_KEY = Connection.ECLIPSELINK_PASSWORD;
- public static final String PASSWORD_TEST_VALUE = "test";
- public static final String PASSWORD_TEST_VALUE_2 = "test_2";
-
- public static final String BIND_PARAMETERS_KEY = Connection.ECLIPSELINK_BIND_PARAMETERS;
- public static final Boolean BIND_PARAMETERS_TEST_VALUE = false;
- public static final Boolean BIND_PARAMETERS_TEST_VALUE_2 = ! BIND_PARAMETERS_TEST_VALUE;
-
- public static final String READ_CONNECTIONS_SHARED_KEY = Connection.ECLIPSELINK_READ_CONNECTIONS_SHARED;
- public static final Boolean READ_CONNECTIONS_SHARED_TEST_VALUE = false;
- public static final Boolean READ_CONNECTIONS_SHARED_TEST_VALUE_2 = ! READ_CONNECTIONS_SHARED_TEST_VALUE;
-
- public static final String READ_CONNECTIONS_MIN_KEY = Connection.ECLIPSELINK_READ_CONNECTIONS_MIN;
- public static final Integer READ_CONNECTIONS_MIN_TEST_VALUE = 100;
- public static final Integer READ_CONNECTIONS_MIN_TEST_VALUE_2 = 200;
-
- public static final String READ_CONNECTIONS_MAX_KEY = Connection.ECLIPSELINK_READ_CONNECTIONS_MAX;
- public static final Integer READ_CONNECTIONS_MAX_TEST_VALUE = 100;
- public static final Integer READ_CONNECTIONS_MAX_TEST_VALUE_2 = 200;
-
- public static final String WRITE_CONNECTIONS_MIN_KEY = Connection.ECLIPSELINK_WRITE_CONNECTIONS_MIN;
- public static final Integer WRITE_CONNECTIONS_MIN_TEST_VALUE = 100;
- public static final Integer WRITE_CONNECTIONS_MIN_TEST_VALUE_2 = 200;
-
- public static final String WRITE_CONNECTIONS_MAX_KEY = Connection.ECLIPSELINK_WRITE_CONNECTIONS_MAX;
- public static final Integer WRITE_CONNECTIONS_MAX_TEST_VALUE = 100;
- public static final Integer WRITE_CONNECTIONS_MAX_TEST_VALUE_2 = 200;
-
- public static final String EXCLUSIVE_CONNECTION_MODE_KEY = Connection.ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE;
- public static final ExclusiveConnectionMode EXCLUSIVE_CONNECTION_MODE_TEST_VALUE = ExclusiveConnectionMode.always;
- public static final ExclusiveConnectionMode EXCLUSIVE_CONNECTION_MODE_TEST_VALUE_2 = ExclusiveConnectionMode.isolated;
-
- public static final String LAZY_CONNECTION_KEY = Connection.ECLIPSELINK_LAZY_CONNECTION;
- public static final Boolean LAZY_CONNECTION_TEST_VALUE = false;
- public static final Boolean LAZY_CONNECTION_TEST_VALUE_2 = ! LAZY_CONNECTION_TEST_VALUE;
-
- // ********** constructors **********
- public EclipseLinkConnectionTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.connection = this.subject.getConnection();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.connection.addPropertyChangeListener(Connection.NATIVE_SQL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.BATCH_WRITING_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.CACHE_STATEMENTS_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.CACHE_STATEMENTS_SIZE_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.DRIVER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.URL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.USER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.PASSWORD_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.BIND_PARAMETERS_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.READ_CONNECTIONS_SHARED_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.READ_CONNECTIONS_MIN_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.READ_CONNECTIONS_MAX_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.WRITE_CONNECTIONS_MIN_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.WRITE_CONNECTIONS_MAX_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.LAZY_CONNECTION_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 16; // EclipseLink properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes EclipseLink properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(NATIVE_SQL_KEY, NATIVE_SQL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(BATCH_WRITING_KEY, BATCH_WRITING_TEST_VALUE);
- this.persistenceUnitSetProperty(CACHE_STATEMENTS_KEY, CACHE_STATEMENTS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(CACHE_STATEMENTS_SIZE_KEY, CACHE_STATEMENTS_SIZE_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(DRIVER_KEY, DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(URL_KEY, URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(USER_KEY, USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(PASSWORD_KEY, PASSWORD_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(BIND_PARAMETERS_KEY, BIND_PARAMETERS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty(READ_CONNECTIONS_SHARED_KEY, READ_CONNECTIONS_SHARED_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(READ_CONNECTIONS_MIN_KEY, READ_CONNECTIONS_MIN_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(READ_CONNECTIONS_MAX_KEY, READ_CONNECTIONS_MAX_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WRITE_CONNECTIONS_MIN_KEY, WRITE_CONNECTIONS_MIN_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WRITE_CONNECTIONS_MAX_KEY, WRITE_CONNECTIONS_MAX_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(EXCLUSIVE_CONNECTION_MODE_KEY, EXCLUSIVE_CONNECTION_MODE_TEST_VALUE);
- this.persistenceUnitSetProperty(LAZY_CONNECTION_KEY, LAZY_CONNECTION_TEST_VALUE.toString());
-
- // Initializes PU elements
- this.getPersistenceUnit().setSpecifiedTransactionType(TRANSACTION_TYPE_TEST_VALUE);
- this.getPersistenceUnit().setJtaDataSource(JTA_DATA_SOURCE_TEST_VALUE);
- this.getPersistenceUnit().setNonJtaDataSource(NON_JTA_DATA_SOURCE_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.connection;
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Connection.NATIVE_SQL_PROPERTY))
- this.connection.setNativeSql((Boolean) newValue);
- else if (propertyName.equals(Connection.BATCH_WRITING_PROPERTY))
- this.connection.setBatchWriting((BatchWriting) newValue);
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_PROPERTY))
- this.connection.setCacheStatements((Boolean) newValue);
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_SIZE_PROPERTY))
- this.connection.setCacheStatementsSize((Integer) newValue);
- else if (propertyName.equals(Connection.DRIVER_PROPERTY))
- this.connection.setDriver((String) newValue);
- else if (propertyName.equals(Connection.URL_PROPERTY))
- this.connection.setUrl((String) newValue);
- else if (propertyName.equals(Connection.USER_PROPERTY))
- this.connection.setUser((String) newValue);
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- this.connection.setPassword((String) newValue);
- else if (propertyName.equals(Connection.BIND_PARAMETERS_PROPERTY))
- this.connection.setBindParameters((Boolean) newValue);
- else if (propertyName.equals(Connection.READ_CONNECTIONS_SHARED_PROPERTY))
- this.connection.setReadConnectionsShared((Boolean) newValue);
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MIN_PROPERTY))
- this.connection.setReadConnectionsMin((Integer) newValue);
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MAX_PROPERTY))
- this.connection.setReadConnectionsMax((Integer) newValue);
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MIN_PROPERTY))
- this.connection.setWriteConnectionsMin((Integer) newValue);
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MAX_PROPERTY))
- this.connection.setWriteConnectionsMax((Integer) newValue);
- else if (propertyName.equals(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY))
- this.connection.setExclusiveConnectionMode((ExclusiveConnectionMode) newValue);
- else if (propertyName.equals(Connection.LAZY_CONNECTION_PROPERTY))
- this.connection.setLazyConnection((Boolean) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Connection.NATIVE_SQL_PROPERTY))
- modelValue = this.connection.getNativeSql();
- else if (propertyName.equals(Connection.BATCH_WRITING_PROPERTY))
- modelValue = this.connection.getBatchWriting();
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_PROPERTY))
- modelValue = this.connection.getCacheStatements();
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_SIZE_PROPERTY))
- modelValue = this.connection.getCacheStatementsSize();
- else if (propertyName.equals(Connection.DRIVER_PROPERTY))
- modelValue = this.connection.getDriver();
- else if (propertyName.equals(Connection.URL_PROPERTY))
- modelValue = this.connection.getUrl();
- else if (propertyName.equals(Connection.USER_PROPERTY))
- modelValue = this.connection.getUser();
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- modelValue = this.connection.getPassword();
- else if (propertyName.equals(Connection.BIND_PARAMETERS_PROPERTY))
- modelValue = this.connection.getBindParameters();
- else if (propertyName.equals(Connection.READ_CONNECTIONS_SHARED_PROPERTY))
- modelValue = this.connection.getReadConnectionsShared();
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MIN_PROPERTY))
- modelValue = this.connection.getReadConnectionsMin();
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MAX_PROPERTY))
- modelValue = this.connection.getReadConnectionsMax();
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MIN_PROPERTY))
- modelValue = this.connection.getWriteConnectionsMin();
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MAX_PROPERTY))
- modelValue = this.connection.getWriteConnectionsMax();
- else if (propertyName.equals(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY))
- modelValue = this.connection.getExclusiveConnectionMode();
- else if (propertyName.equals(Connection.LAZY_CONNECTION_PROPERTY))
- modelValue = this.connection.getLazyConnection();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- // ********** NativeSql tests **********
- public void testSetNativeSql() throws Exception {
- this.verifyModelInitialized(
- NATIVE_SQL_KEY,
- NATIVE_SQL_TEST_VALUE);
- this.verifySetProperty(
- NATIVE_SQL_KEY,
- NATIVE_SQL_TEST_VALUE,
- NATIVE_SQL_TEST_VALUE_2);
- }
-
- public void testAddRemoveNativeSql() throws Exception {
- this.verifyAddRemoveProperty(
- NATIVE_SQL_KEY,
- NATIVE_SQL_TEST_VALUE,
- NATIVE_SQL_TEST_VALUE_2);
- }
-
- // ********** BatchWriting tests **********
- public void testSetBatchWriting() throws Exception {
- this.verifyModelInitialized(
- BATCH_WRITING_KEY,
- BATCH_WRITING_TEST_VALUE);
- this.verifySetProperty(
- BATCH_WRITING_KEY,
- BATCH_WRITING_TEST_VALUE,
- BATCH_WRITING_TEST_VALUE_2);
- }
-
- public void testAddRemoveBatchWriting() throws Exception {
- this.verifyAddRemoveProperty(
- BATCH_WRITING_KEY,
- BATCH_WRITING_TEST_VALUE,
- BATCH_WRITING_TEST_VALUE_2);
- }
-
- // ********** CacheStatements tests **********
- public void testSetCacheStatements() throws Exception {
- this.verifyModelInitialized(
- CACHE_STATEMENTS_KEY,
- CACHE_STATEMENTS_TEST_VALUE);
- this.verifySetProperty(
- CACHE_STATEMENTS_KEY,
- CACHE_STATEMENTS_TEST_VALUE,
- CACHE_STATEMENTS_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheStatements() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_STATEMENTS_KEY,
- CACHE_STATEMENTS_TEST_VALUE,
- CACHE_STATEMENTS_TEST_VALUE_2);
- }
-
- // ********** CacheStatementsSize tests **********
- public void testSetCacheStatementsSize() throws Exception {
- this.verifyModelInitialized(
- CACHE_STATEMENTS_SIZE_KEY,
- CACHE_STATEMENTS_SIZE_TEST_VALUE);
- this.verifySetProperty(
- CACHE_STATEMENTS_SIZE_KEY,
- CACHE_STATEMENTS_SIZE_TEST_VALUE,
- CACHE_STATEMENTS_SIZE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheStatementsSize() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_STATEMENTS_SIZE_KEY,
- CACHE_STATEMENTS_SIZE_TEST_VALUE,
- CACHE_STATEMENTS_SIZE_TEST_VALUE_2);
- }
-
- // ********** Driver tests **********
- public void testSetDriver() throws Exception {
- this.verifyModelInitialized(
- DRIVER_KEY,
- DRIVER_TEST_VALUE);
- this.verifySetProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- public void testAddRemoveDriver() throws Exception {
- this.verifyAddRemoveProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- // ********** Url tests **********
- public void testSetUrl() throws Exception {
- this.verifyModelInitialized(
- URL_KEY,
- URL_TEST_VALUE);
- this.verifySetProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- public void testAddRemoveUrl() throws Exception {
- this.verifyAddRemoveProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- // ********** User tests **********
- public void testSetUser() throws Exception {
- this.verifyModelInitialized(
- USER_KEY,
- USER_TEST_VALUE);
- this.verifySetProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- public void testAddRemoveUser() throws Exception {
- this.verifyAddRemoveProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- // ********** Password tests **********
- public void testSetPassword() throws Exception {
- this.verifyModelInitialized(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE);
- this.verifySetProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
- public void testAddRemovePassword() throws Exception {
- this.verifyAddRemoveProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
- // ********** BindParameters tests **********
- public void testSetBindParameters() throws Exception {
- this.verifyModelInitialized(
- BIND_PARAMETERS_KEY,
- BIND_PARAMETERS_TEST_VALUE);
- this.verifySetProperty(
- BIND_PARAMETERS_KEY,
- BIND_PARAMETERS_TEST_VALUE,
- BIND_PARAMETERS_TEST_VALUE_2);
- }
-
- public void testAddRemoveBindParameters() throws Exception {
- this.verifyAddRemoveProperty(
- BIND_PARAMETERS_KEY,
- BIND_PARAMETERS_TEST_VALUE,
- BIND_PARAMETERS_TEST_VALUE_2);
- }
-
- // ********** ReadConnectionsShared tests **********
- public void testSetReadConnectionsShared() throws Exception {
- this.verifyModelInitialized(
- READ_CONNECTIONS_SHARED_KEY,
- READ_CONNECTIONS_SHARED_TEST_VALUE);
- this.verifySetProperty(
- READ_CONNECTIONS_SHARED_KEY,
- READ_CONNECTIONS_SHARED_TEST_VALUE,
- READ_CONNECTIONS_SHARED_TEST_VALUE_2);
- }
-
- public void testAddRemoveReadConnectionsShared() throws Exception {
- this.verifyAddRemoveProperty(
- READ_CONNECTIONS_SHARED_KEY,
- READ_CONNECTIONS_SHARED_TEST_VALUE,
- READ_CONNECTIONS_SHARED_TEST_VALUE_2);
- }
-
- // ********** ReadConnectionsMin tests **********
- public void testSetReadConnectionsMin() throws Exception {
- this.verifyModelInitialized(
- READ_CONNECTIONS_MIN_KEY,
- READ_CONNECTIONS_MIN_TEST_VALUE);
- this.verifySetProperty(
- READ_CONNECTIONS_MIN_KEY,
- READ_CONNECTIONS_MIN_TEST_VALUE,
- READ_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- public void testAddRemoveReadConnectionsMin() throws Exception {
- this.verifyAddRemoveProperty(
- READ_CONNECTIONS_MIN_KEY,
- READ_CONNECTIONS_MIN_TEST_VALUE,
- READ_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- // ********** ReadConnectionsMax tests **********
- public void testSetReadConnectionsMax() throws Exception {
- this.verifyModelInitialized(
- READ_CONNECTIONS_MAX_KEY,
- READ_CONNECTIONS_MAX_TEST_VALUE);
- this.verifySetProperty(
- READ_CONNECTIONS_MAX_KEY,
- READ_CONNECTIONS_MAX_TEST_VALUE,
- READ_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- public void testAddRemoveReadConnectionsMax() throws Exception {
- this.verifyAddRemoveProperty(
- READ_CONNECTIONS_MAX_KEY,
- READ_CONNECTIONS_MAX_TEST_VALUE,
- READ_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- // ********** WriteConnectionsMin tests **********
- public void testSetWriteConnectionsMin() throws Exception {
- this.verifyModelInitialized(
- WRITE_CONNECTIONS_MIN_KEY,
- WRITE_CONNECTIONS_MIN_TEST_VALUE);
- this.verifySetProperty(
- WRITE_CONNECTIONS_MIN_KEY,
- WRITE_CONNECTIONS_MIN_TEST_VALUE,
- WRITE_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- public void testAddRemoveWriteConnectionsMin() throws Exception {
- this.verifyAddRemoveProperty(
- WRITE_CONNECTIONS_MIN_KEY,
- WRITE_CONNECTIONS_MIN_TEST_VALUE,
- WRITE_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- // ********** WriteConnectionsMax tests **********
- public void testSetWriteConnectionsMax() throws Exception {
- this.verifyModelInitialized(
- WRITE_CONNECTIONS_MAX_KEY,
- WRITE_CONNECTIONS_MAX_TEST_VALUE);
- this.verifySetProperty(
- WRITE_CONNECTIONS_MAX_KEY,
- WRITE_CONNECTIONS_MAX_TEST_VALUE,
- WRITE_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- public void testAddRemoveWriteConnectionsMax() throws Exception {
- this.verifyAddRemoveProperty(
- WRITE_CONNECTIONS_MAX_KEY,
- WRITE_CONNECTIONS_MAX_TEST_VALUE,
- WRITE_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- // ********** ExclusiveConnectionMode tests **********
- public void testSetExclusiveConnectionMode() throws Exception {
- this.verifyModelInitialized(
- EXCLUSIVE_CONNECTION_MODE_KEY,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE);
- this.verifySetProperty(
- EXCLUSIVE_CONNECTION_MODE_KEY,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE_2);
- }
-
- public void testAddRemoveExclusiveConnectionMode() throws Exception {
- this.verifyAddRemoveProperty(
- EXCLUSIVE_CONNECTION_MODE_KEY,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE_2);
- }
-
- // ********** LazyConnection tests **********
- public void testSetLazyConnection() throws Exception {
- this.verifyModelInitialized(
- LAZY_CONNECTION_KEY,
- LAZY_CONNECTION_TEST_VALUE);
- this.verifySetProperty(
- LAZY_CONNECTION_KEY,
- LAZY_CONNECTION_TEST_VALUE,
- LAZY_CONNECTION_TEST_VALUE_2);
- }
-
- public void testAddRemoveLazyConnection() throws Exception {
- this.verifyAddRemoveProperty(
- LAZY_CONNECTION_KEY,
- LAZY_CONNECTION_TEST_VALUE,
- LAZY_CONNECTION_TEST_VALUE_2);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java
deleted file mode 100644
index 0640c90007..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java
+++ /dev/null
@@ -1,760 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Profiler;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Weaving;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkCustomization;
-
-/**
- * Tests the update of model objects by the Customization adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class EclipseLinkCustomizationTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Customization customization;
- private ListEvent entitiesEvent;
- private ListEvent sessionCustomizersEvent;
-
- public static final String ENTITY_TEST = "Employee";
- public static final String ENTITY_TEST_2 = "Address";
-
- public static final String THROW_EXCEPTIONS_KEY = Customization.ECLIPSELINK_THROW_EXCEPTIONS;
- public static final Boolean THROW_EXCEPTIONS_TEST_VALUE = false;
- public static final Boolean THROW_EXCEPTIONS_TEST_VALUE_2 = ! THROW_EXCEPTIONS_TEST_VALUE;
-
- public static final String WEAVING_LAZY_KEY = Customization.ECLIPSELINK_WEAVING_LAZY;
- public static final Boolean WEAVING_LAZY_TEST_VALUE = false;
- public static final Boolean WEAVING_LAZY_TEST_VALUE_2 = ! WEAVING_LAZY_TEST_VALUE;
-
- public static final String WEAVING_CHANGE_TRACKING_KEY = Customization.ECLIPSELINK_WEAVING_CHANGE_TRACKING;
- public static final Boolean WEAVING_CHANGE_TRACKING_TEST_VALUE = false;
- public static final Boolean WEAVING_CHANGE_TRACKING_TEST_VALUE_2 = ! WEAVING_CHANGE_TRACKING_TEST_VALUE;
-
- public static final String WEAVING_FETCH_GROUPS_KEY = Customization.ECLIPSELINK_WEAVING_FETCH_GROUPS;
- public static final Boolean WEAVING_FETCH_GROUPS_TEST_VALUE = false;
- public static final Boolean WEAVING_FETCH_GROUPS_TEST_VALUE_2 = ! WEAVING_FETCH_GROUPS_TEST_VALUE;
-
- public static final String WEAVING_INTERNAL_KEY = Customization.ECLIPSELINK_WEAVING_INTERNAL;
- public static final Boolean WEAVING_INTERNAL_TEST_VALUE = false;
- public static final Boolean WEAVING_INTERNAL_TEST_VALUE_2 = ! WEAVING_INTERNAL_TEST_VALUE;
-
- public static final String WEAVING_EAGER_KEY = Customization.ECLIPSELINK_WEAVING_EAGER;
- public static final Boolean WEAVING_EAGER_TEST_VALUE = true;
- public static final Boolean WEAVING_EAGER_TEST_VALUE_2 = ! WEAVING_EAGER_TEST_VALUE;
-
- public static final String VALIDATION_ONLY_KEY = Customization.ECLIPSELINK_VALIDATION_ONLY;
- public static final Boolean VALIDATION_ONLY_TEST_VALUE = false;
- public static final Boolean VALIDATION_ONLY_TEST_VALUE_2 = ! VALIDATION_ONLY_TEST_VALUE;
-
- public static final String VALIDATE_SCHEMA_KEY = Customization.ECLIPSELINK_VALIDATE_SCHEMA;
- public static final Boolean VALIDATE_SCHEMA_TEST_VALUE = true;
- public static final Boolean VALIDATE_SCHEMA_TEST_VALUE_2 = ! VALIDATE_SCHEMA_TEST_VALUE;
-
- private static final String SESSION_CUSTOMIZER_KEY = Customization.ECLIPSELINK_SESSION_CUSTOMIZER;
- private static final String SESSION_CUSTOMIZER_TEST_VALUE = "java.lang.String";
- private static final String SESSION_CUSTOMIZER_TEST_VALUE_2 = "java.lang.Boolean";
-
- public static final String WEAVING_KEY = Customization.ECLIPSELINK_WEAVING;
- public static final Weaving WEAVING_TEST_VALUE = Weaving.false_;
- public static final Weaving WEAVING_TEST_VALUE_2 = Weaving.static_;
-
- public static final String CUSTOMIZER_KEY = Customization.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER + ENTITY_TEST;
- public static final String CUSTOMIZER_TEST_VALUE = "acme.sessions.DescriptorCustomizer";
- public static final String CUSTOMIZER_TEST_VALUE_2 = "acme.sessions.Customizer";
-
- private static final String PROFILER_KEY = Customization.ECLIPSELINK_PROFILER;
- private static final Profiler PROFILER_TEST_VALUE = Profiler.query_monitor;
- private static final String PROFILER_TEST_VALUE_2 = "custom.profiler.test";
-
- public static final String EXCEPTION_HANDLER_KEY = Customization.ECLIPSELINK_EXCEPTION_HANDLER;
- public static final String EXCEPTION_HANDLER_TEST_VALUE = "acme.CustomSessionEventListener";
- public static final String EXCEPTION_HANDLER_TEST_VALUE_2 = "oracle.sessions.CustomSessionEventListener";
-
- // ********** constructors **********
- public EclipseLinkCustomizationTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.customization = this.subject.getCustomization();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.customization.addPropertyChangeListener(Customization.THROW_EXCEPTIONS_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_LAZY_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_CHANGE_TRACKING_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_FETCH_GROUPS_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_INTERNAL_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_EAGER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.VALIDATION_ONLY_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.VALIDATE_SCHEMA_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.SESSION_CUSTOMIZER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.PROFILER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.EXCEPTION_HANDLER_PROPERTY, propertyChangeListener);
-
- ListChangeListener sessionCustomizersChangeListener = this.buildSessionCustomizersChangeListener();
- this.customization.addListChangeListener(Customization.SESSION_CUSTOMIZER_LIST, sessionCustomizersChangeListener);
-
- ListChangeListener entitiesChangeListener = this.buildEntitiesChangeListener();
- this.customization.addListChangeListener(Customization.ENTITIES_LIST, entitiesChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 13;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(THROW_EXCEPTIONS_KEY, THROW_EXCEPTIONS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_LAZY_KEY, WEAVING_LAZY_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_CHANGE_TRACKING_KEY, WEAVING_CHANGE_TRACKING_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_FETCH_GROUPS_KEY, WEAVING_FETCH_GROUPS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_INTERNAL_KEY, WEAVING_INTERNAL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_EAGER_KEY, WEAVING_EAGER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(VALIDATION_ONLY_KEY, VALIDATION_ONLY_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(VALIDATE_SCHEMA_KEY, VALIDATE_SCHEMA_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty(SESSION_CUSTOMIZER_KEY, SESSION_CUSTOMIZER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_KEY, WEAVING_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(CUSTOMIZER_KEY, CUSTOMIZER_TEST_VALUE);
- this.persistenceUnitSetProperty(PROFILER_KEY, PROFILER_TEST_VALUE);
- this.persistenceUnitSetProperty(EXCEPTION_HANDLER_KEY, EXCEPTION_HANDLER_TEST_VALUE);
- return;
- }
-
- // ********** Listeners **********
- private ListChangeListener buildEntitiesChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- EclipseLinkCustomizationTests.this.entityAdded(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLinkCustomizationTests.this.entityRemoved(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
- };
- }
-
- private ListChangeListener buildSessionCustomizersChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerAdded(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerRemoved(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerReplaced(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerListCleared(e);
- }
-
- public void listChanged(ListChangeEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
- };
- }
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.entitiesEvent = null;
- this.sessionCustomizersEvent = null;
- }
-
- void entityAdded(ListAddEvent e) {
- this.entitiesEvent = e;
- }
-
- void entityRemoved(ListRemoveEvent e) {
- this.entitiesEvent = e;
- }
-
- void sessionCustomizerAdded(ListAddEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- void sessionCustomizerRemoved(ListRemoveEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- void sessionCustomizerReplaced(ListReplaceEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- void sessionCustomizerListCleared(ListClearEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Customization.THROW_EXCEPTIONS_PROPERTY))
- this.customization.setThrowExceptions((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_LAZY_PROPERTY))
- this.customization.setWeavingLazy((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_CHANGE_TRACKING_PROPERTY))
- this.customization.setWeavingChangeTracking((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_FETCH_GROUPS_PROPERTY))
- this.customization.setWeavingFetchGroups((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_INTERNAL_PROPERTY))
- this.customization.setWeavingInternal((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_EAGER_PROPERTY))
- this.customization.setWeavingEager((Boolean) newValue);
- else if (propertyName.equals(Customization.VALIDATION_ONLY_PROPERTY))
- this.customization.setValidationOnly((Boolean) newValue);
- else if (propertyName.equals(Customization.VALIDATE_SCHEMA_PROPERTY))
- this.customization.setValidateSchema((Boolean) newValue);
- else if (propertyName.equals(Customization.EXCEPTION_HANDLER_PROPERTY))
- this.customization.setExceptionHandler((String) newValue);
- else if (propertyName.equals(Customization.SESSION_CUSTOMIZER_PROPERTY))
- this.customization.addSessionCustomizer((String) newValue);
- else if (propertyName.equals(Customization.WEAVING_PROPERTY))
- this.customization.setWeaving((Weaving) newValue);
- else if (propertyName.equals(Customization.PROFILER_PROPERTY)) {
- if (newValue.getClass().isEnum())
- this.customization.setProfiler((Profiler) newValue);
- else
- this.customization.setProfiler((String) newValue);
- }
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Customization.THROW_EXCEPTIONS_PROPERTY))
- modelValue = this.customization.getThrowExceptions();
- else if (propertyName.equals(Customization.WEAVING_PROPERTY))
- modelValue = this.customization.getWeaving();
- else if (propertyName.equals(Customization.WEAVING_LAZY_PROPERTY))
- modelValue = this.customization.getWeavingLazy();
- else if (propertyName.equals(Customization.WEAVING_CHANGE_TRACKING_PROPERTY))
- modelValue = this.customization.getWeavingChangeTracking();
- else if (propertyName.equals(Customization.WEAVING_FETCH_GROUPS_PROPERTY))
- modelValue = this.customization.getWeavingFetchGroups();
- else if (propertyName.equals(Customization.WEAVING_INTERNAL_PROPERTY))
- modelValue = this.customization.getWeavingInternal();
- else if (propertyName.equals(Customization.WEAVING_EAGER_PROPERTY))
- modelValue = this.customization.getWeavingEager();
- else if (propertyName.equals(Customization.VALIDATION_ONLY_PROPERTY))
- modelValue = this.customization.getValidationOnly();
- else if (propertyName.equals(Customization.VALIDATE_SCHEMA_PROPERTY))
- modelValue = this.customization.getValidateSchema();
- else if (propertyName.equals(Customization.EXCEPTION_HANDLER_PROPERTY))
- modelValue = this.customization.getExceptionHandler();
- else if (propertyName.equals(Customization.PROFILER_PROPERTY))
- modelValue = this.customization.getProfiler();
- else if (propertyName.equals(Customization.SESSION_CUSTOMIZER_PROPERTY)) {
- ListIterator<String> iterator = this.customization.getSessionCustomizers().iterator();
- if(iterator.hasNext()) {
- modelValue = iterator.next();
- }
- }
- else if (propertyName.equals(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY))
- modelValue = this.customization.getDescriptorCustomizerOf(ENTITY_TEST);
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
- Object expectedValue_ = expectedValue;
- if (propertyName.equals(Customization.PROFILER_PROPERTY)) {
-
- expectedValue_ = (expectedValue != null && expectedValue.getClass().isEnum()) ?
- this.getPropertyStringValueOf(PROFILER_TEST_VALUE) : // model is storing EclipseLinkStringValue
- expectedValue;
- }
- super.verifyPutProperty(propertyName, expectedValue_);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.customization;
- }
-
- // ********** entities list **********
- public void testEntitiesList() throws Exception {
- // add
- this.clearEvent();
- this.customization.addEntity(ENTITY_TEST_2);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Customization.ENTITIES_LIST);
-
- // remove
- this.clearEvent();
- this.customization.removeEntity(ENTITY_TEST_2);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Customization.ENTITIES_LIST);
- }
-
- // ********** sessionCustomizers list **********
- public void testSessionCustomizersList() throws Exception {
- // add
- this.clearEvent();
- String className = this.customization.addSessionCustomizer(SESSION_CUSTOMIZER_TEST_VALUE_2);
-
- // verify event received
- assertNotNull("No Event Fired.", this.sessionCustomizersEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.sessionCustomizersEvent.getListName(), Customization.SESSION_CUSTOMIZER_LIST);
-
- // remove
- this.clearEvent();
-
- this.customization.removeSessionCustomizer(className);
- // verify event received
- assertNotNull("No Event Fired.", this.sessionCustomizersEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.sessionCustomizersEvent.getListName(), Customization.SESSION_CUSTOMIZER_LIST);
- }
-
- // ********** ThrowExceptions tests **********
- public void testSetThrowExceptions() throws Exception {
- this.verifyModelInitialized(
- THROW_EXCEPTIONS_KEY,
- THROW_EXCEPTIONS_TEST_VALUE);
- this.verifySetProperty(
- THROW_EXCEPTIONS_KEY,
- THROW_EXCEPTIONS_TEST_VALUE,
- THROW_EXCEPTIONS_TEST_VALUE_2);
- }
-
- public void testAddRemoveThrowExceptions() throws Exception {
- this.verifyAddRemoveProperty(
- THROW_EXCEPTIONS_KEY,
- THROW_EXCEPTIONS_TEST_VALUE,
- THROW_EXCEPTIONS_TEST_VALUE_2);
- }
-
- // ********** WeavingLazy tests **********
- public void testSetWeavingLazy() throws Exception {
- this.verifyModelInitialized(
- WEAVING_LAZY_KEY,
- WEAVING_LAZY_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_LAZY_KEY,
- WEAVING_LAZY_TEST_VALUE,
- WEAVING_LAZY_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingLazy() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_LAZY_KEY,
- WEAVING_LAZY_TEST_VALUE,
- WEAVING_LAZY_TEST_VALUE_2);
- }
-
- // ********** WeavingChangeTracking tests **********
- public void testSetWeavingChangeTracking() throws Exception {
- this.verifyModelInitialized(
- WEAVING_CHANGE_TRACKING_KEY,
- WEAVING_CHANGE_TRACKING_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_CHANGE_TRACKING_KEY,
- WEAVING_CHANGE_TRACKING_TEST_VALUE,
- WEAVING_CHANGE_TRACKING_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingChangeTracking() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_CHANGE_TRACKING_KEY,
- WEAVING_CHANGE_TRACKING_TEST_VALUE,
- WEAVING_CHANGE_TRACKING_TEST_VALUE_2);
- }
-
- // ********** WeavingFetchGroups tests **********
- public void testSetWeavingFetchGroups() throws Exception {
- this.verifyModelInitialized(
- WEAVING_FETCH_GROUPS_KEY,
- WEAVING_FETCH_GROUPS_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_FETCH_GROUPS_KEY,
- WEAVING_FETCH_GROUPS_TEST_VALUE,
- WEAVING_FETCH_GROUPS_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingFetchGroups() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_FETCH_GROUPS_KEY,
- WEAVING_FETCH_GROUPS_TEST_VALUE,
- WEAVING_FETCH_GROUPS_TEST_VALUE_2);
- }
-
- // ********** WeavingInternal tests **********
- public void testSetWeavingInternal() throws Exception {
- this.verifyModelInitialized(
- WEAVING_INTERNAL_KEY,
- WEAVING_INTERNAL_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_INTERNAL_KEY,
- WEAVING_INTERNAL_TEST_VALUE,
- WEAVING_INTERNAL_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingInternal() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_INTERNAL_KEY,
- WEAVING_INTERNAL_TEST_VALUE,
- WEAVING_INTERNAL_TEST_VALUE_2);
- }
-
- // ********** WeavingEager tests **********
- public void testSetWeavingEager() throws Exception {
- this.verifyModelInitialized(
- WEAVING_EAGER_KEY,
- WEAVING_EAGER_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_EAGER_KEY,
- WEAVING_EAGER_TEST_VALUE,
- WEAVING_EAGER_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingEager() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_EAGER_KEY,
- WEAVING_EAGER_TEST_VALUE,
- WEAVING_EAGER_TEST_VALUE_2);
- }
-
- // ********** SessionCustomizer tests **********
- public void testSetSessionCustomizer() throws Exception {
- this.verifyModelInitialized(
- SESSION_CUSTOMIZER_KEY,
- SESSION_CUSTOMIZER_TEST_VALUE);
- this.verifySetSessionCustomizationProperty(
- Customization.SESSION_CUSTOMIZER_PROPERTY,
- SESSION_CUSTOMIZER_KEY,
- SESSION_CUSTOMIZER_TEST_VALUE,
- SESSION_CUSTOMIZER_TEST_VALUE_2);
- }
-
- public void testAddRemoveSessionCustomizer() throws Exception {
- this.verifyAddRemoveSessionCustomizationProperty(
- Customization.SESSION_CUSTOMIZER_PROPERTY,
- SESSION_CUSTOMIZER_KEY,
- SESSION_CUSTOMIZER_TEST_VALUE,
- SESSION_CUSTOMIZER_TEST_VALUE_2);
- }
-
- // ********** Weaving tests **********
- /**
- * Tests the update of Weaving property by the Customization adapter when
- * the PU or the model changes.
- */
- public void testSetWeaving() throws Exception {
- this.verifyModelInitialized(
- WEAVING_KEY,
- WEAVING_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_KEY,
- WEAVING_TEST_VALUE,
- WEAVING_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeaving() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_KEY,
- WEAVING_TEST_VALUE,
- WEAVING_TEST_VALUE_2);
- }
-
- // ********** ValidationOnly tests **********
- public void testSetValidationOnly() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_ONLY_KEY,
- VALIDATION_ONLY_TEST_VALUE);
- this.verifySetProperty(
- VALIDATION_ONLY_KEY,
- VALIDATION_ONLY_TEST_VALUE,
- VALIDATION_ONLY_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationOnly() throws Exception {
- this.verifyAddRemoveProperty(
- VALIDATION_ONLY_KEY,
- VALIDATION_ONLY_TEST_VALUE,
- VALIDATION_ONLY_TEST_VALUE_2);
- }
-
- // ********** ValidateSchema tests **********
- public void testSetValidateSchema() throws Exception {
- this.verifyModelInitialized(
- VALIDATE_SCHEMA_KEY,
- VALIDATE_SCHEMA_TEST_VALUE);
- this.verifySetProperty(
- VALIDATE_SCHEMA_KEY,
- VALIDATE_SCHEMA_TEST_VALUE,
- VALIDATE_SCHEMA_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidateSchema() throws Exception {
- this.verifyAddRemoveProperty(
- VALIDATE_SCHEMA_KEY,
- VALIDATE_SCHEMA_TEST_VALUE,
- VALIDATE_SCHEMA_TEST_VALUE_2);
- }
-
- // ********** ExceptionHandler tests **********
- public void testSetExceptionHandler() throws Exception {
- this.verifyModelInitialized(
- EXCEPTION_HANDLER_KEY,
- EXCEPTION_HANDLER_TEST_VALUE);
- this.verifySetProperty(
- EXCEPTION_HANDLER_KEY,
- EXCEPTION_HANDLER_TEST_VALUE,
- EXCEPTION_HANDLER_TEST_VALUE_2);
- }
-
- public void testAddRemoveExceptionHandler() throws Exception {
- this.verifyAddRemoveProperty(
- EXCEPTION_HANDLER_KEY,
- EXCEPTION_HANDLER_TEST_VALUE,
- EXCEPTION_HANDLER_TEST_VALUE_2);
- }
-
- // ********** Customization class **********
- /**
- * Tests the update of Customization property by the Customization adapter when the
- * PU or the model changes.
- */
- public void testSetCustomization() throws Exception {
- this.verifyModelInitialized(
- CUSTOMIZER_KEY,
- CUSTOMIZER_TEST_VALUE);
- this.verifySetCustomizationProperty(
- CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY,
- CUSTOMIZER_KEY,
- CUSTOMIZER_TEST_VALUE,
- CUSTOMIZER_TEST_VALUE_2);
- }
-
- public void testAddRemoveCustomization() throws Exception {
- this.verifyAddRemoveCustomizationProperty(
- CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY,
- CUSTOMIZER_KEY,
- CUSTOMIZER_TEST_VALUE,
- CUSTOMIZER_TEST_VALUE_2);
- }
-
- // ********** Profiler tests **********
- public void testSetProfiler() throws Exception {
- this.verifyModelInitialized(
- PROFILER_KEY,
- this.getPropertyStringValueOf(PROFILER_TEST_VALUE)); // model is storing EclipseLinkStringValue
- // verify set enum value
- this.verifySetProperty(
- PROFILER_KEY,
- PROFILER_TEST_VALUE,
- PROFILER_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetProfiler(
- PROFILER_KEY,
- PROFILER_TEST_VALUE,
- PROFILER_TEST_VALUE_2);
- }
-
- public void testAddRemoveProfiler() throws Exception {
- this.verifyAddRemoveProperty(
- PROFILER_KEY,
- PROFILER_TEST_VALUE,
- PROFILER_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom profiler and literals.
- */
- protected void verifySetProfiler(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom profiler.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (Profiler) null
- this.clearEvent();
- this.customization.setProfiler((Profiler) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.customization.setProfiler((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
-
-
- // ****** convenience methods *******
-
- // ********** verify SessionCustomizer property **********
- protected void verifySetSessionCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2, true);
- this.propertiesTotal++;
- this.verifyPutSessionCustomizerProperty(propertyName, testValue1);
- }
-
- @SuppressWarnings("unused")
- protected void verifyAddRemoveSessionCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key, (String) testValue1);
- assertFalse(this.customization.sessionCustomizerExists(key));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1, true);
- this.verifyPutSessionCustomizerProperty(propertyName, testValue1);
- }
-
- protected void verifyPutSessionCustomizerProperty(String propertyName, Object expectedValue) throws Exception {
- // verify event received
- assertNotNull("No Event Fired.", this.sessionCustomizersEvent);
- this.verifySessionCustomizerEvent(propertyName, expectedValue);
- }
-
- @SuppressWarnings("unused")
- protected void verifySessionCustomizerEvent(String propertyName, Object expectedValue) throws Exception {
- // verify event value
- EclipseLinkCustomization customization = (EclipseLinkCustomization) this.sessionCustomizersEvent.getSource();
- assertTrue(customization.sessionCustomizerExists((String) expectedValue));
- return;
- }
-
- // ********** verify entity property **********
- protected void verifySetCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue2);
-
- // Replace by setting model object
- this.clearEvent();
- this.setCustomizationProperty(propertyName, ENTITY_TEST, testValue1);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue1);
- }
-
- protected void verifyAddRemoveCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key);
- assertNull(this.getPersistenceUnit().getProperty(key));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, null);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue1);
-
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue2);
- }
-
- protected void verifyPutCustomizationProperty(String propertyName, String entityName, Object expectedValue) throws Exception {
- this.verifyEvent(propertyName);
- this.verifyCustomizationEvent(propertyName, entityName, expectedValue);
- }
-
- protected void verifyCustomizationEvent(String propertyName, String entityName, Object expectedValue) throws Exception {
- // verify event value
- CustomizationEntity entity = (CustomizationEntity) this.propertyChangedEvent.getNewValue();
- if (propertyName.equals(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getDescriptorCustomizerOf(entityName));
- assertEquals(expectedValue, this.customization.getDescriptorCustomizerOf(entityName));
- }
- else {
- this.throwMissingDefinition("verifyCustomizationEvent", propertyName);
- }
- }
-
- protected void setCustomizationProperty(String propertyName, String entityName, Object newValue) throws NoSuchFieldException {
- if (propertyName.equals(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY))
- this.customization.setDescriptorCustomizerOf(entityName, (String) newValue);
- else
- this.throwMissingDefinition("setCustomizationProperty", propertyName);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java
deleted file mode 100644
index d6ca4d10f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * PersistenceUnitTestCase
- */
-public abstract class EclipseLinkPersistenceUnitTestCase extends PersistenceUnitTestCase
-{
- protected EclipseLinkPersistenceUnit subject;
-
- protected PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder;
-
- // ********** constructors **********
- protected EclipseLinkPersistenceUnitTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject = this.getPersistenceUnit();
- this.subjectHolder = new SimplePropertyValueModel<EclipseLinkPersistenceUnit>(this.subject);
- this.populatePu();
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, EclipseLinkPlatform.VERSION_1_0);
- return dataModel;
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java
deleted file mode 100644
index f39bd0a27a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPersistenceUnitTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkPersistenceUnitTests(String name) {
- super(name);
- }
-
- @Override
- protected boolean createOrmXml() {
- return true;
- }
-
- @Override
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- testJpaProject.getProject().getFolder("src/META-INF").getFullPath());
- dataModel.setProperty(OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT, Boolean.FALSE);
- return dataModel;
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- public void testUpdateEclipseLinkImpliedMappingFileRef1() throws Exception {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource eclipseLinkOrmResource = getOrmXmlResource();
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNotNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
-
- // remove eclipselink-orm.xml
- deleteResource(eclipseLinkOrmResource);
-
- assertFalse(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
- }
-
- public void testUpdateEclipseLinkImpliedMappingFileRef2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource eclipseLinkOrmResource = getOrmXmlResource();
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNotNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
-
- // add specified eclipselink-orm.xml
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("META-INF/eclipselink-orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.getSpecifiedMappingFileRefs()));
-
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
- }
-
- public void testUpdateEclipseLinkImpliedMappingFileRef3() {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource eclipseLinkOrmResource = getOrmXmlResource();
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNotNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
-
- // ignore in persistence unit
- persistenceUnit.getGeneralProperties().setExcludeEclipselinkOrm(Boolean.TRUE);
-
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
- }
-
- public void testMappingFileRefs() {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = persistenceUnit.getMappingFileRefs().iterator();
-
- assertEquals(persistenceUnit.getImpliedMappingFileRef(), mappingFileRefs.next().getMappingFile().getParent());
- assertEquals(persistenceUnit.getImpliedEclipseLinkMappingFileRef(), mappingFileRefs.next().getMappingFile().getParent());
- }
-
- public void testMappingFileRefsSize() {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- assertEquals(2, persistenceUnit.getMappingFileRefsSize());
- }
-
- public void testPersistentType() throws Exception {
- getJpaProject().setDiscoversAnnotatedClasses(false);
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- createTestEntity();
-
- //persistentType not listed in persistence.xml and discoverAnnotatedClasses is false
- //still find the persistentType because of changes for bug 190317
- assertFalse(getJpaProject().discoversAnnotatedClasses());
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType not listed in persistence.xml, discover annotated classes set to true
- getJpaProject().setDiscoversAnnotatedClasses(true);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType list as class in persistence.xml
- getJpaProject().setDiscoversAnnotatedClasses(false);
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- getXmlPersistenceUnit().getClasses().add(classRef);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
-
- //test persistentType from orm.xml file that is specified in the persistence.xml
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- assertEquals(ormPersistentType, persistenceUnit.getPersistentType("model.Foo"));
-
- //test persistentType from eclipselink-orm.xml file that is implied(not specified) in the persistence.xml
- getXmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java
deleted file mode 100644
index 40d0e2f66f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.GeneralProperties;
-
-/**
- * GeneralAdapterTests
- */
-@SuppressWarnings("nls")
-public class GeneralPropertiesAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private GeneralProperties generalProperties;
-
- public static final String EXCLUDE_ECLIPSELINK_ORM_KEY = GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM;
- public static final Boolean EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE = false;
- public static final Boolean EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE_2 = ! EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE;
-
-
- public GeneralPropertiesAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.generalProperties = this.subject.getGeneralProperties();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.generalProperties.addPropertyChangeListener(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 1;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 2; // misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(EXCLUDE_ECLIPSELINK_ORM_KEY, EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
-
- return;
- }
-
-
- // ********** ExcludeEclipselinkOrm tests **********
- public void testSetExcludeEclipselinkOrm() throws Exception {
- this.verifyModelInitialized(
- EXCLUDE_ECLIPSELINK_ORM_KEY,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE);
- this.verifySetProperty(
- EXCLUDE_ECLIPSELINK_ORM_KEY,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE_2);
- }
-
- public void testAddRemoveExcludeEclipselinkOrm() throws Exception {
- this.verifyAddRemoveProperty(
- EXCLUDE_ECLIPSELINK_ORM_KEY,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE_2);
- }
-
-
-
- // ********** get/set property **********
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY))
- modelValue = this.generalProperties.getExcludeEclipselinkOrm();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY))
- this.generalProperties.setExcludeEclipselinkOrm((Boolean) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.generalProperties;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java
deleted file mode 100644
index 950356677b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.GeneralProperties;
-
-/**
- * GeneralPropertyValueModelTests
- */
-@SuppressWarnings("nls")
-public class GeneralPropertiesValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private GeneralProperties generalProperty;
-
- private WritablePropertyValueModel<Boolean> excludeEclipselinkOrmHolder;
- private PropertyChangeListener excludeEclipselinkOrmListener;
- private PropertyChangeEvent excludeEclipselinkOrmEvent;
-
- public static final Boolean EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE = Boolean.FALSE;
-
- public GeneralPropertiesValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.generalProperty = this.subject.getGeneralProperties(); // Subject
- PropertyValueModel<GeneralProperties> generalPropertyHolder = new SimplePropertyValueModel<GeneralProperties>(this.generalProperty);
-
- this.excludeEclipselinkOrmHolder = this.buildExcludeEclipselinkOrmAA(generalPropertyHolder);
- this.excludeEclipselinkOrmListener = this.buildExcludeEclipselinkOrmChangeListener();
- this.excludeEclipselinkOrmHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.excludeEclipselinkOrmListener);
- this.excludeEclipselinkOrmEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectGeneralProperty = (AbstractModel) this.generalProperty; // Subject
-
- PropertyAspectAdapter<GeneralProperties, Boolean> excludeEclipselinkOrmAA =
- (PropertyAspectAdapter<GeneralProperties, Boolean>) this.excludeEclipselinkOrmHolder;
- assertTrue(excludeEclipselinkOrmAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectGeneralProperty.hasAnyPropertyChangeListeners(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY));
-
- excludeEclipselinkOrmAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.excludeEclipselinkOrmListener);
- assertFalse(subjectGeneralProperty.hasAnyPropertyChangeListeners(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY));
- assertFalse(excludeEclipselinkOrmAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.generalProperty;
- }
-
- // ****** ExcludeEclipselinkOrm *******
- private WritablePropertyValueModel<Boolean> buildExcludeEclipselinkOrmAA(PropertyValueModel<GeneralProperties> subjectHolder) {
- return new PropertyAspectAdapter<GeneralProperties, Boolean>(subjectHolder, GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getExcludeEclipselinkOrm();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setExcludeEclipselinkOrm(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildExcludeEclipselinkOrmChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- GeneralPropertiesValueModelTests.this.excludeEclipselinkOrmEvent = e;
- }
- };
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** ExcludeEclipselinkOrm *******
- this.verifyExcludeEclipselinkOrmAAValue(EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE);
- assertEquals(GeneralProperties.DEFAULT_EXCLUDE_ECLIPSELINK_ORM, this.generalProperty.getDefaultExcludeEclipselinkOrm());
- }
-
- public void testSetValue() throws Exception {
- // ****** ExcludeEclipselinkOrm *******
- this.excludeEclipselinkOrmEvent = null;
- this.verifyHasListeners(this.excludeEclipselinkOrmHolder, PropertyValueModel.VALUE);
- Boolean newExcludeEclipselinkOrm = !EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE;
- // Modify the property holder
- this.excludeEclipselinkOrmHolder.setValue(newExcludeEclipselinkOrm);
- this.verifyExcludeEclipselinkOrmAAValue(newExcludeEclipselinkOrm);
- assertNotNull(this.excludeEclipselinkOrmEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** ExcludeEclipselinkOrm *******
- this.excludeEclipselinkOrmEvent = null;
- // Setting the property holder
- this.excludeEclipselinkOrmHolder.setValue(null);
- // testing Holder
- this.verifyExcludeEclipselinkOrmAAValue(null);
- assertNotNull(this.excludeEclipselinkOrmEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyExcludeEclipselinkOrmAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.generalProperty.getExcludeEclipselinkOrm(),
- this.excludeEclipselinkOrmHolder,
- GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java
deleted file mode 100644
index d8dcdd54f2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCorePersistenceContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCorePersistenceContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkPersistenceUnitTests.class);
- suite.addTestSuite(GeneralPropertiesValueModelTests.class);
- suite.addTestSuite(GeneralPropertiesAdapterTests.class);
-// suite.addTestSuite(ConnectionValueModelTests.class);
- suite.addTestSuite(EclipseLinkConnectionTests.class);
- suite.addTestSuite(CustomizationValueModelTests.class);
- suite.addTestSuite(EclipseLinkCustomizationTests.class);
- suite.addTestSuite(CachingValueModelTests.class);
- suite.addTestSuite(CachingAdapterTests.class);
- suite.addTestSuite(LoggingValueModelTests.class);
- suite.addTestSuite(LoggingAdapterTests.class);
- suite.addTestSuite(OptionsValueModelTests.class);
- suite.addTestSuite(OptionsAdapterTests.class);
- suite.addTestSuite(SchemaGenerationValueModelTests.class);
- suite.addTestSuite(SchemaGenerationBasicAdapterTests.class);
- suite.addTestSuite(SchemaGenerationAdapterTests.class);
- suite.addTestSuite(EclipseLink2_0ConnectionTests.class);
- suite.addTestSuite(EclipseLink2_0LoggingTests.class);
- suite.addTestSuite(EclipseLink2_0OptionsTests.class);
- return suite;
- }
-
- private JptEclipseLinkCorePersistenceContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java
deleted file mode 100644
index 2b73639acd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logger;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-
-/**
- * Tests the update of model objects by the Logging adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class LoggingAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Logging logging;
-
- public static final String LEVEL_KEY = Logging.ECLIPSELINK_LEVEL;
- public static final LoggingLevel LEVEL_TEST_VALUE = LoggingLevel.fine;
- public static final LoggingLevel LEVEL_TEST_VALUE_2 = LoggingLevel.finest;
-
- public static final String TIMESTAMP_KEY = Logging.ECLIPSELINK_TIMESTAMP;
- public static final Boolean TIMESTAMP_TEST_VALUE = false;
- public static final Boolean TIMESTAMP_TEST_VALUE_2 = ! TIMESTAMP_TEST_VALUE;
-
- public static final String THREAD_KEY = Logging.ECLIPSELINK_THREAD;
- public static final Boolean THREAD_TEST_VALUE = false;
- public static final Boolean THREAD_TEST_VALUE_2 = ! THREAD_TEST_VALUE;
-
- public static final String SESSION_KEY = Logging.ECLIPSELINK_SESSION;
- public static final Boolean SESSION_TEST_VALUE = false;
- public static final Boolean SESSION_TEST_VALUE_2 = ! SESSION_TEST_VALUE;
-
- public static final String EXCEPTIONS_KEY = Logging.ECLIPSELINK_EXCEPTIONS;
- public static final Boolean EXCEPTIONS_TEST_VALUE = false;
- public static final Boolean EXCEPTIONS_TEST_VALUE_2 = ! EXCEPTIONS_TEST_VALUE;
-
- private static final String LOG_FILE_LOCATION_KEY = Logging.ECLIPSELINK_LOG_FILE_LOCATION;
- private static final String LOG_FILE_LOCATION_TEST_VALUE = "C:/temp";
- private static final String LOG_FILE_LOCATION_TEST_VALUE_2 = "C:/tmp";
-
- private static final String LOGGER_KEY = Logging.ECLIPSELINK_LOGGER;
- private static final Logger LOGGER_TEST_VALUE = Logger.java_logger;
- private static final String LOGGER_TEST_VALUE_2 = "custom.logger.test";
-
- public LoggingAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.logging = this.subject.getLogging();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.logging.addPropertyChangeListener(Logging.LEVEL_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.TIMESTAMP_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.THREAD_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.SESSION_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.EXCEPTIONS_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.LOG_FILE_LOCATION_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.LOGGER_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 7;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(TIMESTAMP_KEY, TIMESTAMP_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty(LEVEL_KEY, LEVEL_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty(THREAD_KEY, THREAD_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(SESSION_KEY, SESSION_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(EXCEPTIONS_KEY, EXCEPTIONS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(LOG_FILE_LOCATION_KEY, LOG_FILE_LOCATION_TEST_VALUE);
- this.persistenceUnitSetProperty(LOGGER_KEY, LOGGER_TEST_VALUE);
- return;
- }
-
- // ********** Level tests **********
- public void testSetLevel() throws Exception {
- this.verifyModelInitialized(
- LEVEL_KEY,
- LEVEL_TEST_VALUE);
- this.verifySetProperty(
- LEVEL_KEY,
- LEVEL_TEST_VALUE,
- LEVEL_TEST_VALUE_2);
- }
-
- public void testAddRemoveLevel() throws Exception {
- this.verifyAddRemoveProperty(
- LEVEL_KEY,
- LEVEL_TEST_VALUE,
- LEVEL_TEST_VALUE_2);
- }
-
- // ********** Timestamp tests **********
- public void testSetTimestamp() throws Exception {
- this.verifyModelInitialized(
- TIMESTAMP_KEY,
- TIMESTAMP_TEST_VALUE);
- this.verifySetProperty(
- TIMESTAMP_KEY,
- TIMESTAMP_TEST_VALUE,
- TIMESTAMP_TEST_VALUE_2);
- }
-
- public void testAddRemoveTimestamp() throws Exception {
- this.verifyAddRemoveProperty(
- TIMESTAMP_KEY,
- TIMESTAMP_TEST_VALUE,
- TIMESTAMP_TEST_VALUE_2);
- }
-
- // ********** Thread tests **********
- public void testSetThread() throws Exception {
- this.verifyModelInitialized(
- THREAD_KEY,
- THREAD_TEST_VALUE);
- this.verifySetProperty(
- THREAD_KEY,
- THREAD_TEST_VALUE,
- THREAD_TEST_VALUE_2);
- }
-
- public void testAddRemoveThread() throws Exception {
- this.verifyAddRemoveProperty(
- THREAD_KEY,
- THREAD_TEST_VALUE,
- THREAD_TEST_VALUE_2);
- }
-
- // ********** Session tests **********
- public void testSetSession() throws Exception {
- this.verifyModelInitialized(
- SESSION_KEY,
- SESSION_TEST_VALUE);
- this.verifySetProperty(
- SESSION_KEY,
- SESSION_TEST_VALUE,
- SESSION_TEST_VALUE_2);
- }
-
- public void testAddRemoveSession() throws Exception {
- this.verifyAddRemoveProperty(
- SESSION_KEY,
- SESSION_TEST_VALUE,
- SESSION_TEST_VALUE_2);
- }
-
- // ********** Exceptions tests **********
- public void testSetExceptions() throws Exception {
- this.verifyModelInitialized(
- EXCEPTIONS_KEY,
- EXCEPTIONS_TEST_VALUE);
- this.verifySetProperty(
- EXCEPTIONS_KEY,
- EXCEPTIONS_TEST_VALUE,
- EXCEPTIONS_TEST_VALUE_2);
- }
-
- public void testAddRemoveExceptions() throws Exception {
- this.verifyAddRemoveProperty(
- EXCEPTIONS_KEY,
- EXCEPTIONS_TEST_VALUE,
- EXCEPTIONS_TEST_VALUE_2);
- }
-
- // ********** LogFileLocation **********
- public void testSetLogFileLocation() throws Exception {
- this.verifyModelInitialized(
- LOG_FILE_LOCATION_KEY,
- LOG_FILE_LOCATION_TEST_VALUE);
- this.verifySetProperty(
- LOG_FILE_LOCATION_KEY,
- LOG_FILE_LOCATION_TEST_VALUE,
- LOG_FILE_LOCATION_TEST_VALUE_2);
- }
-
- public void testAddRemoveLogFileLocation() throws Exception {
- this.verifyAddRemoveProperty(
- LOG_FILE_LOCATION_KEY,
- LOG_FILE_LOCATION_TEST_VALUE,
- LOG_FILE_LOCATION_TEST_VALUE_2);
- }
-
- public void testSetEmptyFileLocation() throws Exception {
- String puKey = LOG_FILE_LOCATION_KEY;
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Set FileLocation to "" & verify that the property is deleted
- this.verifyPuHasProperty(puKey, "persistenceUnit.properties doesn't contains: ");
- this.setProperty(propertyName, "");
-
- this.verifyPuHasNotProperty(puKey, "Property was not deleted");
- this.verifyPutProperty(propertyName, null);
- assertNull(this.getPersistenceUnit().getProperty(puKey));
- }
-
- // ********** Logger tests **********
- public void testSetLogger() throws Exception {
- this.verifyModelInitialized(
- LOGGER_KEY,
- this.getPropertyStringValueOf(LOGGER_TEST_VALUE)); // model is storing EclipseLinkStringValue
- // verify set enum value
- this.verifySetProperty(
- LOGGER_KEY,
- LOGGER_TEST_VALUE,
- LOGGER_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetLogger(
- LOGGER_KEY,
- LOGGER_TEST_VALUE,
- LOGGER_TEST_VALUE_2);
- }
-
- public void testAddRemoveLogger() throws Exception {
- this.verifyAddRemoveProperty(
- LOGGER_KEY,
- LOGGER_TEST_VALUE,
- LOGGER_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom logger and literals.
- */
- protected void verifySetLogger(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom logger.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (Logger) null
- this.clearEvent();
- this.logging.setLogger((Logger) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.logging.setLogger((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Logging.LEVEL_PROPERTY))
- this.logging.setLevel((LoggingLevel) newValue);
- else if (propertyName.equals(Logging.TIMESTAMP_PROPERTY))
- this.logging.setTimestamp((Boolean) newValue);
- else if (propertyName.equals(Logging.THREAD_PROPERTY))
- this.logging.setThread((Boolean) newValue);
- else if (propertyName.equals(Logging.SESSION_PROPERTY))
- this.logging.setSession((Boolean) newValue);
- else if (propertyName.equals(Logging.EXCEPTIONS_PROPERTY))
- this.logging.setExceptions((Boolean) newValue);
- else if (propertyName.equals(Logging.LOG_FILE_LOCATION_PROPERTY))
- this.logging.setLogFileLocation((String) newValue);
- else if (propertyName.equals(Logging.LOGGER_PROPERTY)) {
- if (newValue.getClass().isEnum())
- this.logging.setLogger((Logger) newValue);
- else
- this.logging.setLogger((String) newValue);
- }
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Logging.LEVEL_PROPERTY))
- modelValue = this.logging.getLevel();
- else if (propertyName.equals(Logging.TIMESTAMP_PROPERTY))
- modelValue = this.logging.getTimestamp();
- else if (propertyName.equals(Logging.THREAD_PROPERTY))
- modelValue = this.logging.getThread();
- else if (propertyName.equals(Logging.SESSION_PROPERTY))
- modelValue = this.logging.getSession();
- else if (propertyName.equals(Logging.EXCEPTIONS_PROPERTY))
- modelValue = this.logging.getExceptions();
- else if (propertyName.equals(Logging.LOG_FILE_LOCATION_PROPERTY))
- modelValue = this.logging.getLogFileLocation();
- else if (propertyName.equals(Logging.LOGGER_PROPERTY))
- modelValue = this.logging.getLogger();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
- Object expectedValue_ = expectedValue;
- if (propertyName.equals(Logging.LOGGER_PROPERTY)) {
-
- expectedValue_ = (expectedValue != null && expectedValue.getClass().isEnum()) ?
- this.getPropertyStringValueOf(LOGGER_TEST_VALUE) : // model is storing EclipseLinkStringValue
- expectedValue;
- }
- super.verifyPutProperty(propertyName, expectedValue_);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.logging;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java
deleted file mode 100644
index 1f740cb6b6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-
-/**
- * LoggingValueModelTests
- */
-@SuppressWarnings("nls")
-public class LoggingValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Logging logging;
-
- private WritablePropertyValueModel<Boolean> timestampHolder;
- private PropertyChangeListener timestampListener;
- private PropertyChangeEvent timestampEvent;
-
- public static final Boolean TIMESTAMP_TEST_VALUE = Boolean.FALSE;
-
- public LoggingValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.logging = this.subject.getLogging(); // Subject
- PropertyValueModel<Logging> loggingHolder = new SimplePropertyValueModel<Logging>(this.logging);
-
- this.timestampHolder = this.buildTimestampAA(loggingHolder);
- this.timestampListener = this.buildTimestampChangeListener();
- this.timestampHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.timestampListener);
- this.timestampEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectLogging = (AbstractModel) this.logging; // Subject
-
- PropertyAspectAdapter<Logging, Boolean> timestampAA =
- (PropertyAspectAdapter<Logging, Boolean>) this.timestampHolder;
- assertTrue(timestampAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectLogging.hasAnyPropertyChangeListeners(Logging.TIMESTAMP_PROPERTY));
-
- timestampAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.timestampListener);
- assertFalse(subjectLogging.hasAnyPropertyChangeListeners(Logging.TIMESTAMP_PROPERTY));
- assertFalse(timestampAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Logging.ECLIPSELINK_TIMESTAMP,
- TIMESTAMP_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.logging;
- }
-
- // ****** Timestamp *******
- private WritablePropertyValueModel<Boolean> buildTimestampAA(PropertyValueModel<Logging> subjectHolder) {
- return new PropertyAspectAdapter<Logging, Boolean>(subjectHolder, Logging.TIMESTAMP_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getTimestamp();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setTimestamp(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildTimestampChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- LoggingValueModelTests.this.timestampEvent = e;
- }
- };
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** Timestamp *******
- this.verifyTimestampAAValue(TIMESTAMP_TEST_VALUE);
- assertEquals(Logging.DEFAULT_TIMESTAMP, this.logging.getDefaultTimestamp());
- }
-
- public void testSetValue() throws Exception {
- // ****** Timestamp *******
- this.timestampEvent = null;
- this.verifyHasListeners(this.timestampHolder, PropertyValueModel.VALUE);
- Boolean newTimestamp = !TIMESTAMP_TEST_VALUE;
- // Modify the property holder
- this.timestampHolder.setValue(newTimestamp);
- this.verifyTimestampAAValue(newTimestamp);
- assertNotNull(this.timestampEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** Timestamp *******
- this.timestampEvent = null;
- // Setting the property holder
- this.timestampHolder.setValue(null);
- // testing Holder
- this.verifyTimestampAAValue(null);
- assertNotNull(this.timestampEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Logging.ECLIPSELINK_TIMESTAMP, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyTimestampAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.logging.getTimestamp(),
- this.timestampHolder,
- Logging.ECLIPSELINK_TIMESTAMP);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java
deleted file mode 100644
index 6f4f33c3f3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetServer;
-
-/**
- * Tests the update of model objects by the Option adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class OptionsAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Options options;
-
- private static final String SESSION_NAME_KEY = Options.ECLIPSELINK_SESSION_NAME;
- private static final String SESSION_NAME_TEST_VALUE = "session-name.test";
- private static final String SESSION_NAME_TEST_VALUE_2 = "session-name-2.test";
-
- private static final String SESSIONS_XML_KEY = Options.ECLIPSELINK_SESSIONS_XML;
- private static final String SESSIONS_XML_TEST_VALUE = "sessions-xml.test";
- private static final String SESSIONS_XML_TEST_VALUE_2 = "sessions-xml-2.test";
-
- public static final String TARGET_DATABASE_KEY = Options.ECLIPSELINK_TARGET_DATABASE;
- public static final TargetDatabase TARGET_DATABASE_TEST_VALUE = TargetDatabase.cloudscape;
- public static final String TARGET_DATABASE_TEST_VALUE_2 = "custom.targetDatabase.test";
-
- private static final String TARGET_SERVER_KEY = Options.ECLIPSELINK_TARGET_SERVER;
- private static final TargetServer TARGET_SERVER_TEST_VALUE = TargetServer.weblogic_9;
- private static final String TARGET_SERVER_TEST_VALUE_2 = "custom.targetServer.test";
-
- public static final String INCLUDE_DESCRIPTOR_QUERIES_KEY = Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES;
- public static final Boolean INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE = false;
- public static final Boolean INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE_2 = ! INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE;
-
- public static final String SESSION_EVENT_LISTENER_KEY = Options.ECLIPSELINK_SESSION_EVENT_LISTENER;
- public static final String SESSION_EVENT_LISTENER_TEST_VALUE = "acme.CustomSessionEventListener";
- public static final String SESSION_EVENT_LISTENER_TEST_VALUE_2 = "oracle.sessions.CustomSessionEventListener";
-
- public static final String TEMPORAL_MUTABLE_KEY = Options.ECLIPSELINK_TEMPORAL_MUTABLE;
- public static final Boolean TEMPORAL_MUTABLE_TEST_VALUE = true;
- public static final Boolean TEMPORAL_MUTABLE_TEST_VALUE_2 = ! TEMPORAL_MUTABLE_TEST_VALUE;
-
- public OptionsAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = this.subject.getOptions();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.options.addPropertyChangeListener(Options.SESSION_NAME_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.SESSIONS_XML_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.TARGET_DATABASE_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.TARGET_SERVER_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.SESSION_EVENT_LISTENER_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(
- Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.TEMPORAL_MUTABLE_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 7;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty(SESSION_NAME_KEY, SESSION_NAME_TEST_VALUE);
- this.persistenceUnitSetProperty(SESSIONS_XML_KEY, SESSIONS_XML_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(INCLUDE_DESCRIPTOR_QUERIES_KEY, INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty(TARGET_DATABASE_KEY, TARGET_DATABASE_TEST_VALUE);
- this.persistenceUnitSetProperty(TARGET_SERVER_KEY, TARGET_SERVER_TEST_VALUE);
- this.persistenceUnitSetProperty(SESSION_EVENT_LISTENER_KEY, SESSION_EVENT_LISTENER_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(TEMPORAL_MUTABLE_KEY, TEMPORAL_MUTABLE_TEST_VALUE.toString());
- return;
- }
-
- // ********** Listeners **********
-
- // ********** SessionName tests **********
- public void testSetSessionName() throws Exception {
- this.verifyModelInitialized(
- SESSION_NAME_KEY,
- SESSION_NAME_TEST_VALUE);
- this.verifySetProperty(
- SESSION_NAME_KEY,
- SESSION_NAME_TEST_VALUE,
- SESSION_NAME_TEST_VALUE_2);
- }
-
- public void testAddRemoveSessionName() throws Exception {
- this.verifyAddRemoveProperty(
- SESSION_NAME_KEY,
- SESSION_NAME_TEST_VALUE,
- SESSION_NAME_TEST_VALUE_2);
- }
-
- // ********** SessionsXml tests **********
- public void testSetSessionsXml() throws Exception {
- this.verifyModelInitialized(
- SESSIONS_XML_KEY,
- SESSIONS_XML_TEST_VALUE);
- this.verifySetProperty(
- SESSIONS_XML_KEY,
- SESSIONS_XML_TEST_VALUE,
- SESSIONS_XML_TEST_VALUE_2);
- }
-
- public void testAddRemoveSessionsXml() throws Exception {
- this.verifyAddRemoveProperty(
- SESSIONS_XML_KEY,
- SESSIONS_XML_TEST_VALUE,
- SESSIONS_XML_TEST_VALUE_2);
- }
-
- // ********** IncludeDescriptorQueries tests **********
- public void testSetIncludeDescriptorQueries() throws Exception {
- this.verifyModelInitialized(
- INCLUDE_DESCRIPTOR_QUERIES_KEY,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE);
- this.verifySetProperty(
- INCLUDE_DESCRIPTOR_QUERIES_KEY,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE_2);
- }
-
- public void testAddRemoveIncludeDescriptorQueries() throws Exception {
- this.verifyAddRemoveProperty(
- INCLUDE_DESCRIPTOR_QUERIES_KEY,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE_2);
- }
-
- // ********** TargetDatabase tests **********
- public void testSetTargetDatabase() throws Exception {
- this.verifyModelInitialized(
- TARGET_DATABASE_KEY,
- this.getPropertyStringValueOf(TARGET_DATABASE_TEST_VALUE)); // model is storing EclipseLinkStringValue
- this.verifySetProperty(
- TARGET_DATABASE_KEY,
- TARGET_DATABASE_TEST_VALUE,
- TARGET_DATABASE_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetTargetDatabase(
- TARGET_DATABASE_KEY,
- TARGET_DATABASE_TEST_VALUE,
- TARGET_DATABASE_TEST_VALUE_2);
- }
-
- public void testAddRemoveTargetDatabase() throws Exception {
- this.verifyAddRemoveProperty(
- TARGET_DATABASE_KEY,
- TARGET_DATABASE_TEST_VALUE,
- TARGET_DATABASE_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom targetDatabase and literals.
- */
- protected void verifySetTargetDatabase(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom targetDatabase.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (TargetDatabase) null
- this.clearEvent();
- this.options.setTargetDatabase((TargetDatabase) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.options.setTargetDatabase((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
- // ********** TargetServer tests **********
- public void testSetTargetServer() throws Exception {
- this.verifyModelInitialized(
- TARGET_SERVER_KEY,
- this.getPropertyStringValueOf(TARGET_SERVER_TEST_VALUE)); // model is storing EclipseLinkStringValue
- // verify set enum value
- this.verifySetProperty(
- TARGET_SERVER_KEY,
- TARGET_SERVER_TEST_VALUE,
- TARGET_SERVER_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetTargetServer(
- TARGET_SERVER_KEY,
- TARGET_SERVER_TEST_VALUE,
- TARGET_SERVER_TEST_VALUE_2);
- }
-
- public void testAddRemoveTargetServer() throws Exception {
- this.verifyAddRemoveProperty(
- TARGET_SERVER_KEY,
- TARGET_SERVER_TEST_VALUE,
- TARGET_SERVER_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom targetServer and literals.
- */
- protected void verifySetTargetServer(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom targetServer.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (TargetServer) null
- this.clearEvent();
- this.options.setTargetServer((TargetServer) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.options.setTargetServer((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
- // ********** EventListener tests **********
- public void testSetEventListener() throws Exception {
- this.verifyModelInitialized(
- SESSION_EVENT_LISTENER_KEY,
- SESSION_EVENT_LISTENER_TEST_VALUE);
- this.verifySetProperty(
- SESSION_EVENT_LISTENER_KEY,
- SESSION_EVENT_LISTENER_TEST_VALUE,
- SESSION_EVENT_LISTENER_TEST_VALUE_2);
- }
-
- public void testAddRemoveEventListener() throws Exception {
- this.verifyAddRemoveProperty(
- SESSION_EVENT_LISTENER_KEY,
- SESSION_EVENT_LISTENER_TEST_VALUE,
- SESSION_EVENT_LISTENER_TEST_VALUE_2);
- }
-
- // ********** TemporalMutable tests **********
- public void testSetTemporalMutable() throws Exception {
- this.verifyModelInitialized(
- TEMPORAL_MUTABLE_KEY,
- TEMPORAL_MUTABLE_TEST_VALUE);
- this.verifySetProperty(
- TEMPORAL_MUTABLE_KEY,
- TEMPORAL_MUTABLE_TEST_VALUE,
- TEMPORAL_MUTABLE_TEST_VALUE_2);
- }
-
- public void testAddRemoveTemporalMutable() throws Exception {
- this.verifyAddRemoveProperty(
- TEMPORAL_MUTABLE_KEY,
- TEMPORAL_MUTABLE_TEST_VALUE,
- TEMPORAL_MUTABLE_TEST_VALUE_2);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Options.SESSION_NAME_PROPERTY))
- this.options.setSessionName((String) newValue);
- else if (propertyName.equals(Options.SESSIONS_XML_PROPERTY))
- this.options.setSessionsXml((String) newValue);
- else if (propertyName.equals(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY))
- this.options.setIncludeDescriptorQueries((Boolean) newValue);
- else if (propertyName.equals(Options.TARGET_DATABASE_PROPERTY))
- this.setTargetDatabaseProperty(newValue);
- else if (propertyName.equals(Options.TARGET_SERVER_PROPERTY))
- this.setTargetServerProperty(newValue);
- else if (propertyName.equals(Options.SESSION_EVENT_LISTENER_PROPERTY))
- this.options.setEventListener((String) newValue);
- else if (propertyName.equals(Options.TEMPORAL_MUTABLE_PROPERTY))
- this.options.setTemporalMutable((Boolean) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- private void setTargetDatabaseProperty(Object newValue) {
- if (newValue.getClass().isEnum())
- this.options.setTargetDatabase((TargetDatabase) newValue);
- else
- this.options.setTargetDatabase((String) newValue);
- }
-
- private void setTargetServerProperty(Object newValue) {
- if (newValue.getClass().isEnum())
- this.options.setTargetServer((TargetServer) newValue);
- else
- this.options.setTargetServer((String) newValue);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Options.SESSION_NAME_PROPERTY))
- modelValue = this.options.getSessionName();
- else if (propertyName.equals(Options.SESSIONS_XML_PROPERTY))
- modelValue = this.options.getSessionsXml();
- else if (propertyName.equals(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY))
- modelValue = this.options.getIncludeDescriptorQueries();
- else if (propertyName.equals(Options.TARGET_DATABASE_PROPERTY))
- modelValue = this.options.getTargetDatabase();
- else if (propertyName.equals(Options.TARGET_SERVER_PROPERTY))
- modelValue = this.options.getTargetServer();
- else if (propertyName.equals(Options.SESSION_EVENT_LISTENER_PROPERTY))
- modelValue = this.options.getEventListener();
- else if (propertyName.equals(Options.TEMPORAL_MUTABLE_PROPERTY))
- modelValue = this.options.getTemporalMutable();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
- Object expectedValue_ = expectedValue;
- if (propertyName.equals(Options.TARGET_DATABASE_PROPERTY) ||
- propertyName.equals(Options.TARGET_SERVER_PROPERTY)) {
-
- expectedValue_ = this.convertToEclipseLinkStringValue(expectedValue);
- }
-
- super.verifyPutProperty(propertyName, expectedValue_);
- }
-
- private String convertToEclipseLinkStringValue(Object expectedValue) {
- return (String) ((expectedValue != null && expectedValue.getClass().isEnum()) ?
- this.getPropertyStringValueOf(expectedValue) : // model is storing EclipseLinkStringValue
- expectedValue); // already a EclipseLinkStringValue
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java
deleted file mode 100644
index a5e18381ce..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-
-/**
- * OptionsValueModelTests
- */
-public class OptionsValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Options options;
-
- private WritablePropertyValueModel<Boolean> includeDescriptorQueriesHolder;
- private PropertyChangeListener includeDescriptorQueriesListener;
- private PropertyChangeEvent includeDescriptorQueriesEvent;
-
- public static final Boolean INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE = Boolean.FALSE;
-
- public OptionsValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = this.subject.getOptions(); // Subject
- PropertyValueModel<Options> optionsHolder = new SimplePropertyValueModel<Options>(this.options);
-
- this.includeDescriptorQueriesHolder = this.buildIncludeDescriptorQueriesAA(optionsHolder);
- this.includeDescriptorQueriesListener = this.buildIncludeDescriptorQueriesChangeListener();
- this.includeDescriptorQueriesHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.includeDescriptorQueriesListener);
- this.includeDescriptorQueriesEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectOptions = (AbstractModel) this.options; // Subject
-
- PropertyAspectAdapter<Options, Boolean> includeDescriptorQueriesAA =
- (PropertyAspectAdapter<Options, Boolean>) this.includeDescriptorQueriesHolder;
- assertTrue(includeDescriptorQueriesAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectOptions.hasAnyPropertyChangeListeners(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY));
-
- includeDescriptorQueriesAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.includeDescriptorQueriesListener);
- assertFalse(subjectOptions.hasAnyPropertyChangeListeners(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY));
- assertFalse(includeDescriptorQueriesAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-
- // ****** IncludeDescriptorQueries *******
- private WritablePropertyValueModel<Boolean> buildIncludeDescriptorQueriesAA(PropertyValueModel<Options> subjectHolder) {
- return new PropertyAspectAdapter<Options, Boolean>(subjectHolder, Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getIncludeDescriptorQueries();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setIncludeDescriptorQueries(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildIncludeDescriptorQueriesChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- OptionsValueModelTests.this.includeDescriptorQueriesEvent = e;
- }
- };
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** IncludeDescriptorQueries *******
- this.verifyIncludeDescriptorQueriesAAValue(INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE);
- assertEquals(Options.DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES, this.options.getDefaultIncludeDescriptorQueries());
- }
-
- public void testSetValue() throws Exception {
- // ****** IncludeDescriptorQueries *******
- this.includeDescriptorQueriesEvent = null;
- this.verifyHasListeners(this.includeDescriptorQueriesHolder, PropertyValueModel.VALUE);
- Boolean newIncludeDescriptorQueries = !INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE;
- // Modify the property holder
- this.includeDescriptorQueriesHolder.setValue(newIncludeDescriptorQueries);
- this.verifyIncludeDescriptorQueriesAAValue(newIncludeDescriptorQueries);
- assertNotNull(this.includeDescriptorQueriesEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** IncludeDescriptorQueries *******
- this.includeDescriptorQueriesEvent = null;
- // Setting the property holder
- this.includeDescriptorQueriesHolder.setValue(null);
- // testing Holder
- this.verifyIncludeDescriptorQueriesAAValue(null);
- assertNotNull(this.includeDescriptorQueriesEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyIncludeDescriptorQueriesAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.options.getIncludeDescriptorQueries(),
- this.includeDescriptorQueriesHolder,
- Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java
deleted file mode 100644
index 6a666ce545..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * Tests the update of OutputMode model object by the SchemaGeneration adapter
- * when the PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class SchemaGenerationAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private SchemaGeneration schemaGeneration;
-
- public static final String DDL_GENERATION_TYPE_KEY = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE;
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE = DdlGenerationType.drop_and_create_tables;
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE_2 = DdlGenerationType.none;
-
- public static final String OUTPUT_MODE_KEY = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE = OutputMode.sql_script;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE_2 = OutputMode.database;
-
- private static final String CREATE_FILE_NAME_KEY = SchemaGeneration.ECLIPSELINK_CREATE_FILE_NAME;
- private static final String CREATE_FILE_NAME_TEST_VALUE = "create-file-name.test";
- private static final String CREATE_FILE_NAME_TEST_VALUE_2 = "create-file-name-2.test";
-
- private static final String DROP_FILE_NAME_KEY = SchemaGeneration.ECLIPSELINK_DROP_FILE_NAME;
- private static final String DROP_FILE_NAME_TEST_VALUE = "drop-file-name.test";
- private static final String DROP_FILE_NAME_TEST_VALUE_2 = "drop-file-name-2.test";
-
- private static final String APPLICATION_LOCATION_KEY = SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION;
- private static final String APPLICATION_LOCATION_TEST_VALUE = "C:/temp";
- private static final String APPLICATION_LOCATION_TEST_VALUE_2 = "C:/tmp";
-
- public SchemaGenerationAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.schemaGeneration = this.subject.getSchemaGeneration();
-
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.OUTPUT_MODE_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.CREATE_FILE_NAME_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.DROP_FILE_NAME_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.APPLICATION_LOCATION_PROPERTY, propertyChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- @Override
- protected void populatePu() {
- this.propertiesTotal = 9;
- this.modelPropertiesSizeOriginal = 5;
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("property.0", "value.0");
- this.persistenceUnitSetProperty(OUTPUT_MODE_KEY, this.getPropertyStringValueOf(OUTPUT_MODE_TEST_VALUE));
- this.persistenceUnitSetProperty("property.2", "value.2");
- this.persistenceUnitSetProperty("property.3", "value.3");
- this.persistenceUnitSetProperty("property.4", "value.4");
- this.persistenceUnitSetProperty(DDL_GENERATION_TYPE_KEY, this.getPropertyStringValueOf(DDL_GENERATION_TYPE_TEST_VALUE));
- this.persistenceUnitSetProperty(CREATE_FILE_NAME_KEY, CREATE_FILE_NAME_TEST_VALUE);
- this.persistenceUnitSetProperty(DROP_FILE_NAME_KEY, DROP_FILE_NAME_TEST_VALUE);
- this.persistenceUnitSetProperty(APPLICATION_LOCATION_KEY, APPLICATION_LOCATION_TEST_VALUE);
- return;
- }
-
- // ********** CreateFileName **********
- /**
- * Tests the update of CreateFileName property by the SchemaGeneration
- * adapter when the PU or the model changes.
- */
- public void testSetCreateFileName() throws Exception {
- this.verifyModelInitialized(
- CREATE_FILE_NAME_KEY,
- CREATE_FILE_NAME_TEST_VALUE);
- this.verifySetProperty(
- CREATE_FILE_NAME_KEY,
- CREATE_FILE_NAME_TEST_VALUE,
- CREATE_FILE_NAME_TEST_VALUE_2);
- }
-
- public void testAddRemoveCreateFileName() throws Exception {
- this.verifyAddRemoveProperty(
- CREATE_FILE_NAME_KEY,
- CREATE_FILE_NAME_TEST_VALUE,
- CREATE_FILE_NAME_TEST_VALUE_2);
- }
-
- // ********** DropFileName **********
- /**
- * Tests the update of DropFileName property by the SchemaGeneration adapter
- * when the PU or the model changes.
- */
- public void testSetDropFileName() throws Exception {
- this.verifyModelInitialized(
- DROP_FILE_NAME_KEY,
- DROP_FILE_NAME_TEST_VALUE);
- this.verifySetProperty(
- DROP_FILE_NAME_KEY,
- DROP_FILE_NAME_TEST_VALUE,
- DROP_FILE_NAME_TEST_VALUE_2);
- }
-
- public void testAddRemoveDropFileName() throws Exception {
- this.verifyAddRemoveProperty(
- DROP_FILE_NAME_KEY,
- DROP_FILE_NAME_TEST_VALUE,
- DROP_FILE_NAME_TEST_VALUE_2);
- }
-
- // ********** ApplicationLocation **********
- /**
- * Tests the update of ApplicationLocation property by the SchemaGeneration
- * adapter when the PU or the model changes.
- */
- public void testSetApplicationLocation() throws Exception {
- this.verifyModelInitialized(
- APPLICATION_LOCATION_KEY,
- APPLICATION_LOCATION_TEST_VALUE);
- this.verifySetProperty(
- APPLICATION_LOCATION_KEY,
- APPLICATION_LOCATION_TEST_VALUE,
- APPLICATION_LOCATION_TEST_VALUE_2);
- }
-
- public void testAddRemoveApplicationLocation() throws Exception {
- this.verifyAddRemoveProperty(
- APPLICATION_LOCATION_KEY,
- APPLICATION_LOCATION_TEST_VALUE,
- APPLICATION_LOCATION_TEST_VALUE_2);
- }
-
- public void testSetEmptyApplicationLocation() throws Exception {
- String puKey = APPLICATION_LOCATION_KEY;
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Set ApplicationLocation to "" & verify that the property is deleted
- this.verifyPuHasProperty(puKey, "persistenceUnit.properties doesn't contains: ");
- this.setProperty(propertyName, "");
-
- this.verifyPuHasNotProperty(puKey, "Property was not deleted");
- this.verifyPutProperty(propertyName, null);
- assertNull(this.getPersistenceUnit().getProperty(puKey));
- }
-
- // ********** OutputMode **********
- /**
- * Tests the update of OutputMode property by the SchemaGeneration adapter
- * when the PU or the model changes.
- */
- public void testSetOutputMode() throws Exception {
- this.verifyModelInitialized(
- OUTPUT_MODE_KEY,
- OUTPUT_MODE_TEST_VALUE);
- this.verifySetProperty(
- OUTPUT_MODE_KEY,
- OUTPUT_MODE_TEST_VALUE,
- OUTPUT_MODE_TEST_VALUE_2);
- }
-
- public void testAddRemoveOutputMode() throws Exception {
- this.verifyAddRemoveProperty(
- OUTPUT_MODE_KEY,
- OUTPUT_MODE_TEST_VALUE,
- OUTPUT_MODE_TEST_VALUE_2);
- }
-
- // ********** DdlGenerationType **********
- /**
- * Tests the update of DdlGenerationType property by the SchemaGeneration
- * adapter when the PU or the model changes.
- */
- public void testSetDdlGenerationType() throws Exception {
- this.verifyModelInitialized(
- DDL_GENERATION_TYPE_KEY,
- DDL_GENERATION_TYPE_TEST_VALUE);
- this.verifySetProperty(
- DDL_GENERATION_TYPE_KEY,
- DDL_GENERATION_TYPE_TEST_VALUE,
- DDL_GENERATION_TYPE_TEST_VALUE_2);
- }
-
- public void testAddRemoveDdlGenerationType() throws Exception {
- this.verifyAddRemoveProperty(
- DDL_GENERATION_TYPE_KEY,
- DDL_GENERATION_TYPE_TEST_VALUE,
- DDL_GENERATION_TYPE_TEST_VALUE_2);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws NoSuchFieldException {
- if (propertyName.equals(SchemaGeneration.OUTPUT_MODE_PROPERTY))
- this.schemaGeneration.setOutputMode((OutputMode) newValue);
- // else if( propertyName.equals( Caching.CACHE_SIZE_PROPERTY))
- // TODO
- else if (propertyName.equals(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY))
- this.schemaGeneration.setDdlGenerationType((DdlGenerationType) newValue);
- else if (propertyName.equals(SchemaGeneration.APPLICATION_LOCATION_PROPERTY))
- this.schemaGeneration.setApplicationLocation((String) newValue);
- else if (propertyName.equals(SchemaGeneration.CREATE_FILE_NAME_PROPERTY))
- this.schemaGeneration.setCreateFileName((String) newValue);
- else if (propertyName.equals(SchemaGeneration.DROP_FILE_NAME_PROPERTY))
- this.schemaGeneration.setDropFileName((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(SchemaGeneration.OUTPUT_MODE_PROPERTY))
- modelValue = this.schemaGeneration.getOutputMode();
- else if (propertyName.equals(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY))
- modelValue = this.schemaGeneration.getDdlGenerationType();
- else if (propertyName.equals(SchemaGeneration.APPLICATION_LOCATION_PROPERTY))
- modelValue = this.schemaGeneration.getApplicationLocation();
- else if (propertyName.equals(SchemaGeneration.CREATE_FILE_NAME_PROPERTY))
- modelValue = this.schemaGeneration.getCreateFileName();
- else if (propertyName.equals(SchemaGeneration.DROP_FILE_NAME_PROPERTY))
- modelValue = this.schemaGeneration.getDropFileName();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.schemaGeneration;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java
deleted file mode 100644
index 9638330836..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * Tests the update of OutputMode model object by the SchemaGeneration adapter
- * when the PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class SchemaGenerationBasicAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private SchemaGeneration schemaGeneration;
-
- public static final String outputModeKey = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE;
- public static final String ddlGenTypeKey = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE;
-
- public static final OutputMode OUTPUT_MODE_TEST_VALUE = OutputMode.sql_script;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE_2 = OutputMode.database;
-
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE = DdlGenerationType.drop_and_create_tables;
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE_2 = DdlGenerationType.none;
-
- public SchemaGenerationBasicAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.schemaGeneration = this.subject.getSchemaGeneration();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.OUTPUT_MODE_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY, propertyChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- @Override
- protected void populatePu() {
- this.propertiesTotal = 6;
- this.modelPropertiesSizeOriginal = 2;
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("property.0", "value.0");
- this.persistenceUnitSetProperty(outputModeKey, this.getPropertyStringValueOf(OUTPUT_MODE_TEST_VALUE));
- this.persistenceUnitSetProperty("property.2", "value.2");
- this.persistenceUnitSetProperty("property.3", "value.3");
- this.persistenceUnitSetProperty("property.4", "value.4");
- this.persistenceUnitSetProperty(ddlGenTypeKey, this.getPropertyStringValueOf(DDL_GENERATION_TYPE_TEST_VALUE));
- return;
- }
-
- /** ****** test methods ******* */
-
- /**
- * Tests the update of OutputMode property by the SchemaGeneration adapter
- * when the PU changes.
- */
- public void testOutputModeUpdate() throws Exception {
- ListValueModel<PersistenceUnit.Property> propertiesAdapter = this.buildPropertiesAdapter(this.subjectHolder);
- ListValueModel<PersistenceUnit.Property> propertyListAdapter = new ItemPropertyListValueModelAdapter<PersistenceUnit.Property>(propertiesAdapter, PersistenceUnit.Property.VALUE_PROPERTY);
-
- this.verifyHasListeners(this.schemaGeneration, SchemaGeneration.OUTPUT_MODE_PROPERTY);
-
- // Basic
- assertTrue(schemaGeneration.itemIsProperty(this.getPersistenceUnit().getProperty(outputModeKey)));
- assertEquals(OUTPUT_MODE_TEST_VALUE, this.schemaGeneration.getOutputMode());
-
- // Replace
- this.persistenceUnitSetProperty(outputModeKey, OUTPUT_MODE_TEST_VALUE_2);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE_2, this.schemaGeneration.getOutputMode());
-
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(outputModeKey);
- assertNull(this.getPersistenceUnit().getProperty(outputModeKey));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- assertNotNull(this.propertyChangedEvent);
- assertNull(this.propertyChangedEvent.getNewValue());
-
- // Add original OutputMode
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(outputModeKey, OUTPUT_MODE_TEST_VALUE);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE, this.schemaGeneration.getOutputMode());
-
- // Replace again
- this.persistenceUnitSetProperty(outputModeKey, OUTPUT_MODE_TEST_VALUE_2);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE_2, this.schemaGeneration.getOutputMode());
-
- // Replace by setting model object
- this.clearEvent();
- this.schemaGeneration.setOutputMode(OUTPUT_MODE_TEST_VALUE);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE, this.schemaGeneration.getOutputMode());
- }
-
- // ****** convenience methods *******
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.schemaGeneration;
- }
-
- private ListValueModel<PersistenceUnit.Property> buildPropertiesAdapter(PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new ListAspectAdapter<EclipseLinkPersistenceUnit, PersistenceUnit.Property>(subjectHolder, PersistenceUnit.PROPERTIES_LIST) {
- @Override
- protected ListIterable<PersistenceUnit.Property> getListIterable() {
- return this.subject.getProperties();
- }
-
- @Override
- protected int size_() {
- return this.subject.getPropertiesSize();
- }
- };
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java
deleted file mode 100644
index f58e2bdbb5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * SchemaGenerationValueModelTests
- *
- * Tests the PropertyValueModel of SchemaGeneration model and the update of the
- * PersistenceUnit.
- */
-public class SchemaGenerationValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private SchemaGeneration schemaGen;
- private PropertyValueModel<SchemaGeneration> schemaGenHolder;
-
- private WritablePropertyValueModel<DdlGenerationType> ddlGenerationTypeHolder;
- private PropertyChangeEvent ddlGenerationTypeEvent;
-
- private WritablePropertyValueModel<OutputMode> outputModeHolder;
- private PropertyChangeEvent outputModeEvent;
-
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE = DdlGenerationType.drop_and_create_tables;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE = OutputMode.sql_script;
-
- public SchemaGenerationValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.schemaGen = this.subject.getSchemaGeneration(); // Subject
- this.schemaGenHolder = new SimplePropertyValueModel<SchemaGeneration>(this.schemaGen);
-
- this.ddlGenerationTypeHolder = this.buildDdlGenerationTypeAA(this.schemaGenHolder);
- PropertyChangeListener ddlGenerationTypeListener = this.buildDdlGenerationTypeChangeListener();
- this.ddlGenerationTypeHolder.addPropertyChangeListener(PropertyValueModel.VALUE, ddlGenerationTypeListener);
- this.ddlGenerationTypeEvent = null;
-
- this.outputModeHolder = this.buildOutputModeAA(this.schemaGenHolder);
- PropertyChangeListener outputModeListener = this.buildOutputModeChangeListener();
- this.outputModeHolder.addPropertyChangeListener(PropertyValueModel.VALUE, outputModeListener);
- this.outputModeEvent = null;
- }
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE,
- DDL_GENERATION_TYPE_TEST_VALUE);
- this.persistenceUnitSetProperty(
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE,
- OUTPUT_MODE_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.schemaGen;
- }
-
- /** ****** DdlGenerationType ******* */
- private WritablePropertyValueModel<DdlGenerationType> buildDdlGenerationTypeAA(PropertyValueModel<SchemaGeneration> subjectHolder) {
- return new PropertyAspectAdapter<SchemaGeneration, DdlGenerationType>(subjectHolder, SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY) {
- @Override
- protected DdlGenerationType buildValue_() {
- return this.subject.getDdlGenerationType();
- }
-
- @Override
- protected void setValue_(DdlGenerationType enumValue) {
- this.subject.setDdlGenerationType(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildDdlGenerationTypeChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- SchemaGenerationValueModelTests.this.ddlGenerationTypeEvent = e;
- }
- };
- }
-
- /** ****** OutputMode ******* */
- private WritablePropertyValueModel<OutputMode> buildOutputModeAA(PropertyValueModel<SchemaGeneration> subjectHolder) {
- return new PropertyAspectAdapter<SchemaGeneration, OutputMode>(subjectHolder, SchemaGeneration.OUTPUT_MODE_PROPERTY) {
- @Override
- protected OutputMode buildValue_() {
- return this.subject.getOutputMode();
- }
-
- @Override
- protected void setValue_(OutputMode enumValue) {
- this.subject.setOutputMode(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildOutputModeChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- SchemaGenerationValueModelTests.this.outputModeEvent = e;
- }
- };
- }
-
- public void testValue() {
- /** ****** DdlGenerationType ******* */
- this.verifyDdlGenerationTypeAAValue(DDL_GENERATION_TYPE_TEST_VALUE);
- assertEquals(
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE,
- this.schemaGen.getDefaultDdlGenerationType());
- /** ****** OutputMode ******* */
- this.verifyOutputModeAAValue(OUTPUT_MODE_TEST_VALUE);
- assertEquals(
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE,
- this.schemaGen.getDefaultOutputMode());
- }
-
- public void testSetValue() throws Exception {
- /** ****** DdlGenerationType ******* */
- this.ddlGenerationTypeEvent = null;
- this.verifyHasListeners(this.ddlGenerationTypeHolder, PropertyValueModel.VALUE);
- DdlGenerationType newDdlGenerationType = DdlGenerationType.create_tables;
- // Modify the persistenceUnit directly
- this.subject.setProperty(
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE,
- this.getPropertyStringValueOf(newDdlGenerationType),
- false);
- this.verifyDdlGenerationTypeAAValue(newDdlGenerationType);
- assertNotNull(this.ddlGenerationTypeEvent);
-
- /** ****** OutputMode ******* */
- this.outputModeEvent = null;
- this.verifyHasListeners(this.outputModeHolder, PropertyValueModel.VALUE);
- OutputMode newOutputMode = OutputMode.database;
- // Modify the property holder
- this.outputModeHolder.setValue(newOutputMode);
- this.verifyOutputModeAAValue(newOutputMode);
- assertNotNull(this.outputModeEvent);
- }
-
- public void testSetNullValue() {
- /** ****** DdlGenerationType ******* */
- this.ddlGenerationTypeEvent = null;
- // Setting the persistenceUnit directly
- this.subject.setProperty(SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE, null, false);
- this.ddlGenerationTypeHolder.setValue(null);
- // testing Holder
- this.verifyDdlGenerationTypeAAValue(null);
- assertNotNull(this.ddlGenerationTypeEvent);
- // testing PU properties
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE);
- assertNull(property);
-
- /** ****** OutputMode ******* */
- this.outputModeEvent = null;
- // Setting the property holder
- this.outputModeHolder.setValue(null);
- // testing Holder
- this.verifyOutputModeAAValue(null);
- assertNotNull(this.outputModeEvent);
- // testing PU properties
- property = this.getPersistenceUnit().getProperty(SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE);
- assertNull(property);
- }
-
- /** ****** convenience methods ******* */
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyDdlGenerationTypeAAValue(DdlGenerationType testValue) {
- this.verifyAAValue(
- testValue,
- this.schemaGen.getDdlGenerationType(),
- this.ddlGenerationTypeHolder,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyOutputModeAAValue(OutputMode testValue) {
- this.verifyAAValue(
- testValue,
- this.schemaGen.getOutputMode(),
- this.outputModeHolder,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java
deleted file mode 100644
index 8f5954ced6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.JptJpaEclipseLinkCoreTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java.JptEclipseLinkCoreJavaResourceModelTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-public class JptJpaEclipselinkCoreResourceModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaEclipselinkCoreResourceModelTests.class.getName());
- if(JptJpaEclipseLinkCoreTests.requiredJarsExists()) {
- suite.addTest(JptEclipseLinkCoreJavaResourceModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JptJpaEclipseLinkCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaEclipselinkCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java
deleted file mode 100644
index 6124345bd1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-@SuppressWarnings("nls")
-public class CacheTests extends EclipseLinkJavaResourceModelTestCase {
-
- public CacheTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCache() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithCacheType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(type = CacheType.SOFT)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithSize() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(size = 50)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithExpiry() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiry = 50)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithExpiryTimeOfDay() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithShared() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(shared=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithAlwaysRefresh() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(alwaysRefresh=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithRefreshOnlyIfNewer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(refreshOnlyIfNewer=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithDisableHits() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(disableHits=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithCoordinationType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_COORDINATION_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(coordinationType = CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithIsolation() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_ISOLATION_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(isolation = CacheIsolationType.ISOLATED)");
- }
- });
- }
-
- public void testCache() throws Exception {
- ICompilationUnit cu = this.createTestCache();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNotNull(cache);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCacheType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheType.SOFT, cache.getType());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCacheType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheType.SOFT, cache.getType());
-
- cache.setType(CacheType.WEAK);
- assertEquals(CacheType.WEAK, cache.getType());
-
- assertSourceContains("@Cache(type = WEAK)", cu);
-
- cache.setType(null);
- assertNull(cache.getType());
-
- assertSourceDoesNotContain("(type = WEAK)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetSize() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getSize());
- }
-
- public void testSetSize() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getSize());
-
- cache.setSize(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), cache.getSize());
-
- assertSourceContains("@Cache(size = 80)", cu);
-
- cache.setSize(null);
- assertNull(cache.getSize());
-
- assertSourceDoesNotContain("(size = 80)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetShared() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithShared();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
- }
-
- public void testSetShared() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithShared();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
-
- cache.setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getShared());
-
- assertSourceContains("@Cache(shared=false)", cu);
- }
-
- public void testSetSharedNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithShared();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
-
- cache.setShared(null);
-
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetExpiry() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiry();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getExpiry());
- }
-
- public void testSetExpiry() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiry();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getExpiry());
-
- cache.setExpiry(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), cache.getExpiry());
-
- assertSourceContains("@Cache(expiry = 80)", cu);
-
- cache.setExpiry(null);
- assertNull(cache.getExpiry());
-
- assertSourceDoesNotContain("(expiry = 80)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiryTimeOfDay();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertNotNull(timeOfDay);
- }
-
- public void testAddExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCache();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- cache.addExpiryTimeOfDay();
-
- assertNotNull(cache.getExpiryTimeOfDay());
-
- assertSourceContains("@Cache(expiryTimeOfDay = @TimeOfDay)", cu);
- }
-
- public void testRemoveExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiryTimeOfDay();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertNotNull(cache.getExpiryTimeOfDay());
-
- cache.removeExpiryTimeOfDay();
- assertNull(cache.getExpiryTimeOfDay());
- assertSourceDoesNotContain("@Cache(expiryTimeOfDay = @TimeOfDay)", cu);
- }
-
- public void testGetAlwaysRefresh() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithAlwaysRefresh();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
- }
-
- public void testSetAlwaysRefresh() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithAlwaysRefresh();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
-
- cache.setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getAlwaysRefresh());
-
- assertSourceContains("@Cache(alwaysRefresh=false)", cu);
- }
-
- public void testSetAlwaysRefreshNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithAlwaysRefresh();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
-
- cache.setAlwaysRefresh(null);
- cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cache.getAlwaysRefresh());
-
- assertSourceContains("@Cache", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetRefreshOnlyIfNewer() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
- }
-
- public void testSetRefreshOnlyIfNewer() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
-
- cache.setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getRefreshOnlyIfNewer());
-
- assertSourceContains("@Cache(refreshOnlyIfNewer=false)", cu);
- }
-
- public void testSetRefreshOnlyIfNewerNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
-
- cache.setRefreshOnlyIfNewer(null);
- cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cache.getRefreshOnlyIfNewer());
- assertSourceContains("@Cache", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetDisableHits() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
- }
-
- public void testSetDisableHits() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
-
- cache.setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getDisableHits());
-
- assertSourceContains("@Cache(disableHits=false)", cu);
- }
-
- public void testSetDisableHitsNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
-
- cache.setDisableHits(null);
- cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cache.getDisableHits());
- assertSourceContains("@Cache", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
-
- public void testGetCoordinationType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCoordinationType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cache.getCoordinationType());
- }
-
- public void testSetCoordinationType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCoordinationType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cache.getCoordinationType());
-
- cache.setCoordinationType(CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, cache.getCoordinationType());
-
- assertSourceContains("@Cache(coordinationType = SEND_NEW_OBJECTS_WITH_CHANGES)", cu);
-
- cache.setCoordinationType(null);
- assertNull(cache.getCoordinationType());
-
- assertSourceDoesNotContain("(coordinationType = SEND_NEW_OBJECTS_WITH_CHANGES)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetIsolation() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithIsolation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheIsolationType2_2.ISOLATED, cache.getIsolation());
- }
-
- public void testSetIsolation() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithIsolation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheIsolationType2_2.ISOLATED, cache.getIsolation());
-
- cache.setIsolation(CacheIsolationType2_2.SHARED);
- assertEquals(CacheIsolationType2_2.SHARED, cache.getIsolation());
-
- assertSourceContains("@Cache(isolation = SHARED)", cu);
-
- cache.setIsolation(CacheIsolationType2_2.PROTECTED);
- assertEquals(CacheIsolationType2_2.PROTECTED, cache.getIsolation());
-
- assertSourceContains("@Cache(isolation = PROTECTED)", cu);
-
- cache.setIsolation(null);
- assertNull(cache.getIsolation());
-
- assertSourceDoesNotContain("(isolation = SHARED)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java
deleted file mode 100644
index 9f4c306b62..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-@SuppressWarnings("nls")
-public class ChangeTrackingTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ChangeTrackingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CHANGE_TRACKING, EclipseLink.CHANGE_TRACKING_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ChangeTracking");
- }
- });
- }
-
- private ICompilationUnit createTestChangeTrackingWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CHANGE_TRACKING, EclipseLink.CHANGE_TRACKING_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ChangeTracking(ChangeTrackingType.DEFERRED)");
- }
- });
- }
-
- public void testChangeTracking() throws Exception {
- ICompilationUnit cu = this.createTestChangeTracking();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertNotNull(existenceChecking);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestChangeTrackingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertEquals(ChangeTrackingType.DEFERRED, existenceChecking.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestChangeTrackingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertEquals(ChangeTrackingType.DEFERRED, existenceChecking.getValue());
-
- existenceChecking.setValue(ChangeTrackingType.ATTRIBUTE);
- assertEquals(ChangeTrackingType.ATTRIBUTE, existenceChecking.getValue());
-
- assertSourceContains("@ChangeTracking(ATTRIBUTE)", cu);
-
- existenceChecking.setValue(null);
- assertNull(existenceChecking.getValue());
-
- assertSourceDoesNotContain("(ATTRIBUTE)", cu);
- assertSourceContains("@ChangeTracking", cu);
- assertSourceDoesNotContain("@ChangeTracking(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java
deleted file mode 100644
index 916fd44957..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class ConversionValueAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ConversionValueAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestObjectTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithConversionValues() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})");
- }
- });
- }
-
-
- public void testGetDataValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("F", converter.conversionValueAt(0).getDataValue());
- }
-
- public void testSetDataValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("F", converter.conversionValueAt(0).getDataValue());
-
- converter.conversionValueAt(0).setDataValue("FOO");
- assertEquals("FOO", converter.conversionValueAt(0).getDataValue());
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"FOO\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
- }
-
- public void testSetDataValueNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals(0, converter.getConversionValuesSize());
-
- converter.addConversionValue(0).setDataValue("FOO");
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue(dataValue = \"FOO\"))", cu);
-
- converter.conversionValueAt(0).setDataValue(null);
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue)", cu);
- assertEquals(1, converter.getConversionValuesSize());
- }
-
- public void testGetObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Female", converter.conversionValueAt(0).getObjectValue());
- }
-
- public void testSetObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Female", converter.conversionValueAt(0).getObjectValue());
-
- converter.conversionValueAt(0).setObjectValue("FOO");
- assertEquals("FOO", converter.conversionValueAt(0).getObjectValue());
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"FOO\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
- }
-
- public void testSetObjectValueNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals(0, converter.getConversionValuesSize());
-
- converter.addConversionValue(0).setObjectValue("FOO");
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue(objectValue = \"FOO\"))", cu);
-
- converter.conversionValueAt(0).setObjectValue(null);
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue)", cu);
- assertEquals(1, converter.getConversionValuesSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java
deleted file mode 100644
index 42c050d3c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-@SuppressWarnings("nls")
-public class ConvertAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ConvertAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(value=\"myConverter\")");
- }
- });
- }
-
- public void testConvertAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestConvert();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.CONVERT));
-
- resourceField.removeAnnotation(EclipseLink.CONVERT);
- assertNull(resourceField.getAnnotation(EclipseLink.CONVERT));
-
- resourceField.addAnnotation(EclipseLink.CONVERT);
- assertNotNull(resourceField.getAnnotation(EclipseLink.CONVERT));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLink.CONVERT);
- assertEquals("myConverter", convert.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLink.CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue("Bar");
- assertEquals("Bar", convert.getValue());
-
- assertSourceContains("@Convert(value=\"Bar\")", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLink.CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue(null);
- assertNull(convert.getValue());
-
- assertSourceContains("@Convert", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java
deleted file mode 100644
index 4b9cafe50e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class ConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Converter");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithConverterClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Converter(converterClass=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Converter(name=\"bar\")");
- }
- });
- }
-
- public void testConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.CONVERTER));
-
- resourceField.removeAnnotation(EclipseLink.CONVERTER);
- assertNull(resourceField.getAnnotation(EclipseLink.CONVERTER));
-
- resourceField.addAnnotation(EclipseLink.CONVERTER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.CONVERTER));
- }
-
- public void testGetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("Foo", converter.getConverterClass());
- }
-
- public void testSetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
-
- assertSourceContains("@Converter(converterClass=Bar.class)", cu);
- }
-
- public void testSetConverterClassNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass(null);
- assertNull(converter.getConverterClass());
-
- assertSourceContains("@Converter", cu);
- assertSourceDoesNotContain("converterClass", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@Converter(name=\"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@Converter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
deleted file mode 100644
index d28a256c02..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-@SuppressWarnings("nls")
-public class CustomizerAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public CustomizerAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Customizer");
- }
- });
- }
-
- private ICompilationUnit createTestCustomizerWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Customizer(Foo.class)");
- }
- });
- }
-
- public void testCustomizerAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestCustomizer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertNotNull(resourceType.getAnnotation(EclipseLink.CUSTOMIZER));
-
- resourceType.removeAnnotation(EclipseLink.CUSTOMIZER);
- assertNull(resourceType.getAnnotation(EclipseLink.CUSTOMIZER));
-
- resourceType.addAnnotation(EclipseLink.CUSTOMIZER);
- assertNotNull(resourceType.getAnnotation(EclipseLink.CUSTOMIZER));
- }
-
- public void testGetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLink.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
- }
-
- public void testSetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLink.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
-
- converter.setValue("Bar");
- assertEquals("Bar", converter.getValue());
-
- assertSourceContains("@Customizer(Bar.class)", cu);
- }
-
- public void testSetConverterClassNull() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLink.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
-
- converter.setValue(null);
- assertNull(converter.getValue());
-
- assertSourceContains("@Customizer", cu);
- assertSourceDoesNotContain("Foo.class", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java
deleted file mode 100644
index e521e0b6f8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaAnnotationDefinitionProvider;
-
-public class EclipseLink2_0JavaResourceModelTestCase extends JpaJavaResourceModelTestCase
-{
-
- public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
-
- public EclipseLink2_0JavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_0JpaAnnotationDefinitionProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java
deleted file mode 100644
index 299511293c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaAnnotationDefinitionProvider;
-
-public class EclipseLink2_3JavaResourceModelTestCase extends JpaJavaResourceModelTestCase
-{
-
- public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
-
- public EclipseLink2_3JavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_3JpaAnnotationDefinitionProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
deleted file mode 100644
index bd5fc19678..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaAnnotationDefinitionProvider;
-
-public class EclipseLinkJavaResourceModelTestCase extends JpaJavaResourceModelTestCase
-{
-
- public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
-
- public EclipseLinkJavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java
deleted file mode 100644
index f7781fb560..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPrimaryKeyAnnotationTests
- extends EclipseLinkJavaResourceModelTestCase
-{
- public EclipseLinkPrimaryKeyAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestTypeWithPrimaryKeyAnnotation() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.PRIMARY_KEY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKey");
- }
- });
- }
-
-
- public void testAddRemoveAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithPrimaryKeyAnnotation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertNotNull(resourceType.getAnnotation(EclipseLink.PRIMARY_KEY));
-
- resourceType.removeAnnotation(EclipseLink.PRIMARY_KEY);
- assertNull(resourceType.getAnnotation(EclipseLink.PRIMARY_KEY));
-
- resourceType.addAnnotation(EclipseLink.PRIMARY_KEY);
- assertNotNull(resourceType.getAnnotation(EclipseLink.PRIMARY_KEY));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java
deleted file mode 100644
index d7c44fbc50..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-@SuppressWarnings("nls")
-public class EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests extends EclipseLink2_3JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_CONTEXT_PROPERTY = "eclipselink.foo-id";
- private static final String COLUMN_TABLE = "MY_TABLE";
-
- public EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithContextProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(contextProperty = \"" + COLUMN_CONTEXT_PROPERTY + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenenatDiscriminatorColumnWithDiscriminatorType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN, JPA.DISCRIMINATOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(discriminatorType = DiscriminatorType.CHAR)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(" + intElement + " = 5)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getDiscriminatorType());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@TenantDiscriminatorColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@TenantDiscriminatorColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("(columnDefinition", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@TenantDiscriminatorColumn(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("(length", cu);
- }
-
- public void testGetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestTenenatDiscriminatorColumnWithDiscriminatorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(DiscriminatorType.CHAR, column.getDiscriminatorType());
- }
-
- public void testSetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNull(column.getDiscriminatorType());
-
- column.setDiscriminatorType(DiscriminatorType.INTEGER);
- assertEquals(DiscriminatorType.INTEGER, column.getDiscriminatorType());
-
- assertSourceContains("@TenantDiscriminatorColumn(discriminatorType = INTEGER)", cu);
-
- column.setDiscriminatorType(null);
- assertSourceDoesNotContain("(discriminatorType", cu);
- }
-
- public void testGetContextProperty() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithContextProperty();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_CONTEXT_PROPERTY, column.getContextProperty());
- }
-
- public void testSetContextProperty() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getContextProperty());
-
- column.setContextProperty("Foo");
- assertEquals("Foo", column.getContextProperty());
-
- assertSourceContains("@TenantDiscriminatorColumn(contextProperty = \"Foo\")", cu);
-
-
- column.setContextProperty(null);
- assertSourceDoesNotContain("(contextProperty", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@TenantDiscriminatorColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("(table", cu);
- }
-
- public void testGetPrimaryKey() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("primaryKey");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getPrimaryKey());
- }
-
- public void testSetPrimaryKey() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getPrimaryKey());
-
- column.setPrimaryKey(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getPrimaryKey());
-
- assertSourceContains("@TenantDiscriminatorColumn(primaryKey = false)", cu);
-
- column.setPrimaryKey(null);
- assertSourceDoesNotContain("primaryKey", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java
deleted file mode 100644
index 390048d533..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-@SuppressWarnings("nls")
-public class EclipselinkMultitenantAnnotation2_3Tests extends EclipseLink2_3JavaResourceModelTestCase {
-
- public EclipselinkMultitenantAnnotation2_3Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMultitenant() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MULTITENANT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Multitenant");
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MULTITENANT, EclipseLink.MULTITENANT_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Multitenant(MultitenantType.SINGLE_TABLE)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithIncludeCriteria() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MULTITENANT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Multitenant(includeCriteria=true)");
- }
- });
- }
-
- public void testMultitenant() throws Exception {
- ICompilationUnit cu = this.createTestMultitenant();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
- assertNotNull(multitenant);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMultitenantWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
- assertEquals(MultitenantType2_3.SINGLE_TABLE, multitenant.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMultitenantWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
- assertEquals(MultitenantType2_3.SINGLE_TABLE, multitenant.getValue());
-
- multitenant.setValue(MultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(MultitenantType2_3.TABLE_PER_TENANT, multitenant.getValue());
-
- assertSourceContains("@Multitenant(TABLE_PER_TENANT)", cu);
-
- multitenant.setValue(null);
- assertNull(multitenant.getValue());
-
- assertSourceDoesNotContain("(TABLE_PER_TENANT)", cu);
- assertSourceContains("@Multitenant", cu);
- assertSourceDoesNotContain("@Multitenant(", cu);
- }
-
-//
-// public void testGetIncludeCriteria() throws Exception {
-// ICompilationUnit cu = this.createTestCacheWithIncludeCriteria();
-// JavaResourceType resourceType = buildJavaResourceType(cu);
-//
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-// }
-//
-// public void testSetIncludeCriteria() throws Exception {
-// ICompilationUnit cu = this.createTestCacheWithIncludeCriteria();
-// JavaResourceType resourceType = buildJavaResourceType(cu);
-//
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-//
-// multitenant.setIncludeCriteria(Boolean.FALSE);
-// assertEquals(Boolean.FALSE, multitenant.getIncludeCriteria());
-//
-// assertSourceContains("@Multitenant(includeCriteria=false)", cu);
-// }
-//
-// public void testSetIncludeCriteriaNull() throws Exception {
-// ICompilationUnit cu = this.createTestCacheWithIncludeCriteria();
-// JavaResourceType resourceType = buildJavaResourceType(cu);
-//
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-//
-// multitenant.setIncludeCriteria(null);
-// multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertNull(multitenant.getIncludeCriteria());
-//
-// assertSourceContains("@Multitenant", cu);
-// assertSourceDoesNotContain("@Multitenant(", cu);
-// }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java
deleted file mode 100644
index 13fd742caa..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType;
-
-@SuppressWarnings("nls")
-public class ExistenceCheckingTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ExistenceCheckingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestExistenceChecking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.EXISTENCE_CHECKING, EclipseLink.EXISTENCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ExistenceChecking");
- }
- });
- }
-
- private ICompilationUnit createTestExistenceCheckingWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.EXISTENCE_CHECKING, EclipseLink.EXISTENCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ExistenceChecking(ExistenceType.ASSUME_EXISTENCE)");
- }
- });
- }
-
- public void testExistenceChecking() throws Exception {
- ICompilationUnit cu = this.createTestExistenceChecking();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertNotNull(existenceChecking);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertEquals(ExistenceType.ASSUME_EXISTENCE, existenceChecking.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertEquals(ExistenceType.ASSUME_EXISTENCE, existenceChecking.getValue());
-
- existenceChecking.setValue(ExistenceType.ASSUME_NON_EXISTENCE);
- assertEquals(ExistenceType.ASSUME_NON_EXISTENCE, existenceChecking.getValue());
-
- assertSourceContains("@ExistenceChecking(ASSUME_NON_EXISTENCE)", cu);
-
- existenceChecking.setValue(null);
- assertNull(existenceChecking.getValue());
-
- assertSourceDoesNotContain("(ASSUME_NON_EXISTENCE)", cu);
- assertSourceContains("@ExistenceChecking", cu);
- assertSourceDoesNotContain("@ExistenceChecking(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java
deleted file mode 100644
index e4609cc581..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-@SuppressWarnings("nls")
-public class JoinFetchTests extends EclipseLinkJavaResourceModelTestCase {
-
- public JoinFetchTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinFetch");
- }
- });
- }
-
- private ICompilationUnit createTestJoinFetchWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinFetch(JoinFetchType.OUTER)");
- }
- });
- }
-
- public void testJoinFetch() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLink.JOIN_FETCH);
- assertNotNull(joinFetch);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetchWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLink.JOIN_FETCH);
- assertEquals(JoinFetchType.OUTER, joinFetch.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetchWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLink.JOIN_FETCH);
- assertEquals(JoinFetchType.OUTER, joinFetch.getValue());
-
- joinFetch.setValue(JoinFetchType.INNER);
- assertEquals(JoinFetchType.INNER, joinFetch.getValue());
-
- assertSourceContains("@JoinFetch(INNER)", cu);
-
- joinFetch.setValue(null);
- assertNull(joinFetch.getValue());
-
- assertSourceDoesNotContain("(INNER)", cu);
- assertSourceContains("@JoinFetch", cu);
- assertSourceDoesNotContain("@JoinFetch(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java
deleted file mode 100644
index 17d5d04489..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCoreJavaResourceModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCoreJavaResourceModelTests.class.getName());
- suite.addTestSuite(CacheTests.class);
- suite.addTestSuite(ChangeTrackingTests.class);
- suite.addTestSuite(ConversionValueAnnotationTests.class);
- suite.addTestSuite(ConvertAnnotationTests.class);
- suite.addTestSuite(ConverterAnnotationTests.class);
- suite.addTestSuite(CustomizerAnnotationTests.class);
- suite.addTestSuite(ExistenceCheckingTests.class);
- suite.addTestSuite(JoinFetchTests.class);
- suite.addTestSuite(MutableAnnotationTests.class);
- suite.addTestSuite(ObjectTypeConverterAnnotationTests.class);
- suite.addTestSuite(EclipseLinkPrimaryKeyAnnotationTests.class);
- suite.addTestSuite(PrivateOwnedTests.class);
- suite.addTestSuite(ReadOnlyTests.class);
- suite.addTestSuite(ReadTransformerAnnotationTests.class);
- suite.addTestSuite(StructConverterAnnotationTests.class);
- suite.addTestSuite(TimeOfDayTests.class);
- suite.addTestSuite(TransformationAnnotationTests.class);
- suite.addTestSuite(TypeConverterAnnotationTests.class);
- suite.addTestSuite(WriteTransformerAnnotationTests.class);
- suite.addTestSuite(MapKeyConvertAnnotation2_0Tests.class);
- suite.addTestSuite(EclipselinkMultitenantAnnotation2_3Tests.class);
- suite.addTestSuite(EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.class);
-
- return suite;
- }
-
- private JptEclipseLinkCoreJavaResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java
deleted file mode 100644
index cca6380195..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-@SuppressWarnings("nls")
-public class MapKeyConvertAnnotation2_0Tests extends EclipseLink2_0JavaResourceModelTestCase {
-
- public MapKeyConvertAnnotation2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKeyConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MAP_KEY_CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyConvert");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MAP_KEY_CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyConvert(value=\"myConverter\")");
- }
- });
- }
-
- public void testMapKeyConvertAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyConvert();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT));
-
- resourceField.removeAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertNull(resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT));
-
- resourceField.addAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertNotNull(resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMapKeyConvertAnnotation2_0 convert = (EclipseLinkMapKeyConvertAnnotation2_0) resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertEquals("myConverter", convert.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMapKeyConvertAnnotation2_0 convert = (EclipseLinkMapKeyConvertAnnotation2_0) resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue("Bar");
- assertEquals("Bar", convert.getValue());
-
- assertSourceContains("@MapKeyConvert(value=\"Bar\")", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMapKeyConvertAnnotation2_0 convert = (EclipseLinkMapKeyConvertAnnotation2_0) resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue(null);
- assertNull(convert.getValue());
-
- assertSourceContains("@MapKeyConvert", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java
deleted file mode 100644
index 71d4f0ad7d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-@SuppressWarnings("nls")
-public class MutableAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public MutableAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMutable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MUTABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Mutable");
- }
- });
- }
-
- private ICompilationUnit createTestMutableWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MUTABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Mutable(value=true)");
- }
- });
- }
-
-
-
- public void testMutableAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestMutable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.MUTABLE));
-
- resourceField.removeAnnotation(EclipseLink.MUTABLE);
- assertNull(resourceField.getAnnotation(EclipseLink.MUTABLE));
-
- resourceField.addAnnotation(EclipseLink.MUTABLE);
- assertNotNull(resourceField.getAnnotation(EclipseLink.MUTABLE));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLink.MUTABLE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLink.MUTABLE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- assertSourceContains("@Mutable(value=false)", cu);
-
- mutableAnnotation.setValue(null);
- mutableAnnotation.setValue(Boolean.FALSE);
- assertSourceContains("@Mutable(false)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLink.MUTABLE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
-
- mutableAnnotation.setValue(null);
- assertNull(mutableAnnotation.getValue());
-
- assertSourceContains("@Mutable", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java
deleted file mode 100644
index 38e6e08654..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class ObjectTypeConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ObjectTypeConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestObjectTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(dataType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(objectType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(name = \"bar\")");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithDefaultObjectValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(defaultObjectValue = \"f\")");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithConversionValues() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})");
- }
- });
- }
-
- public void testObjectTypeConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER));
-
- resourceField.removeAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertNull(resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER));
-
- resourceField.addAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER));
- }
-
- public void testGetDataType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- assertSourceContains("@ObjectTypeConverter(dataType=Bar.class)", cu);
-
- converter.setDataType("int");
- assertEquals("int", converter.getDataType());
- assertSourceContains("@ObjectTypeConverter(dataType=int.class)", cu);
- }
-
- public void testSetDataTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType(null);
- assertNull(converter.getDataType());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("dataType", cu);
- }
-
- public void testGetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- assertSourceContains("@ObjectTypeConverter(objectType=Bar.class)", cu);
-
- converter.setObjectType("int");
- assertEquals("int", converter.getObjectType());
- assertSourceContains("@ObjectTypeConverter(objectType=int.class)", cu);
- }
-
- public void testSetObjectTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType(null);
- assertNull(converter.getObjectType());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("objectType", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@ObjectTypeConverter(name = \"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-
-
- public void testGetDefaultObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDefaultObjectValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("f", converter.getDefaultObjectValue());
- }
-
- public void testSetDefaultObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDefaultObjectValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("f", converter.getDefaultObjectValue());
-
- converter.setDefaultObjectValue("foo");
- assertEquals("foo", converter.getDefaultObjectValue());
-
- assertSourceContains("@ObjectTypeConverter(defaultObjectValue = \"foo\")", cu);
- }
-
- public void testSetDefaultObjectValueNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDefaultObjectValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("f", converter.getDefaultObjectValue());
-
- converter.setDefaultObjectValue(null);
- assertNull(converter.getDefaultObjectValue());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("defaultObjectValue", cu);
- }
-
- public void testConversionValues() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
-
- assertEquals(0, converter.getConversionValuesSize());
- assertFalse(converter.getConversionValues().iterator().hasNext());
- }
-
- public void testConversionValues2() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
-
-
- converter.addConversionValue(0);
- converter.addConversionValue(1);
-
- assertEquals(2, converter.getConversionValuesSize());
- ListIterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.getConversionValues().iterator();
- assertTrue(conversionValues.hasNext());
- assertNotNull(conversionValues.next());
- assertNotNull(conversionValues.next());
- assertFalse(conversionValues.hasNext());
- }
-
- public void testConversionValues3() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
-
- assertEquals(2, converter.getConversionValuesSize());
- ListIterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.getConversionValues().iterator();
- EclipseLinkConversionValueAnnotation conversionValue = conversionValues.next();
- assertEquals("F", conversionValue.getDataValue());
- assertEquals("Female", conversionValue.getObjectValue());
- conversionValue = conversionValues.next();
- assertEquals("M", conversionValue.getDataValue());
- assertEquals("Male", conversionValue.getObjectValue());
- assertFalse(conversionValues.hasNext());
- }
-
- public void testAddConversionValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
-
- converter.addConversionValue(0).setObjectValue("FOO");
- converter.addConversionValue(1);
- converter.addConversionValue(0).setDataValue("BAR");
-
- assertEquals("BAR", converter.conversionValueAt(0).getDataValue());
- assertNull(converter.conversionValueAt(0).getObjectValue());
- assertEquals("FOO", converter.conversionValueAt(1).getObjectValue());
- assertNull(converter.conversionValueAt(1).getDataValue());
- assertNull(converter.conversionValueAt(2).getDataValue());
- assertNull(converter.conversionValueAt(2).getObjectValue());
-
- assertSourceContains("@ObjectTypeConverter(name = \"bar\", conversionValues = {@ConversionValue(dataValue = \"BAR\"),@ConversionValue(objectValue = \"FOO\"), @ConversionValue})", cu);
- }
-
- public void testRemoveConversionValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- converter.addConversionValue(0).setObjectValue("FOO");
-
- Iterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.getConversionValues().iterator();
- assertEquals("FOO", conversionValues.next().getObjectValue());
- assertEquals("Female", conversionValues.next().getObjectValue());
- assertEquals("Male", conversionValues.next().getObjectValue());
- assertFalse(conversionValues.hasNext());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.removeConversionValue(1);
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("FOO", conversionValues.next().getObjectValue());
- assertEquals("Male", conversionValues.next().getObjectValue());
- assertFalse(conversionValues.hasNext());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.removeConversionValue(0);
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("Male", conversionValues.next().getObjectValue());
- assertFalse(conversionValues.hasNext());
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue(dataValue = \"M\", objectValue = \"Male\"))", cu);
-
-
- converter.removeConversionValue(0);
- assertSourceDoesNotContain("@conversionValues", cu);
- assertSourceContains("@ObjectTypeConverter", cu);
- }
-
- public void testMoveConversionValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- converter.addConversionValue(0).setObjectValue("FOO");
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.moveConversionValue(2, 0);
- assertEquals("Female", converter.conversionValueAt(0).getObjectValue());
- assertEquals("F", converter.conversionValueAt(0).getDataValue());
- assertEquals("Male", converter.conversionValueAt(1).getObjectValue());
- assertEquals("M", converter.conversionValueAt(1).getDataValue());
- assertEquals("FOO", converter.conversionValueAt(2).getObjectValue());
- assertEquals(null, converter.conversionValueAt(2).getDataValue());
- assertEquals(3, converter.getConversionValuesSize());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\"), @ConversionValue(objectValue = \"FOO\")})", cu);
- }
-
- public void testMoveConversionValue2() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- converter.addConversionValue(0).setObjectValue("FOO");
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.moveConversionValue(0, 2);
- assertEquals("Male", converter.conversionValueAt(0).getObjectValue());
- assertEquals("M", converter.conversionValueAt(0).getDataValue());
- assertEquals("FOO", converter.conversionValueAt(1).getObjectValue());
- assertEquals(null, converter.conversionValueAt(1).getDataValue());
- assertEquals("Female", converter.conversionValueAt(2).getObjectValue());
- assertEquals("F", converter.conversionValueAt(2).getDataValue());
- assertEquals(3, converter.getConversionValuesSize());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"M\", objectValue = \"Male\"), @ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\")})", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java
deleted file mode 100644
index 7d8c6e83de..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-@SuppressWarnings("nls")
-public class PrivateOwnedTests extends EclipseLinkJavaResourceModelTestCase {
-
- public PrivateOwnedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrivateOwned() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrivateOwned");
- }
- });
- }
-
- public void testPrivateOwned() throws Exception {
- ICompilationUnit cu = this.createTestPrivateOwned();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkPrivateOwnedAnnotation privateOwned = (EclipseLinkPrivateOwnedAnnotation) resourceField.getAnnotation(EclipseLink.PRIVATE_OWNED);
- assertNotNull(privateOwned);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java
deleted file mode 100644
index 891f59cad2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-@SuppressWarnings("nls")
-public class ReadOnlyTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ReadOnlyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ReadOnly");
- }
- });
- }
-
- public void testReadOnly() throws Exception {
- ICompilationUnit cu = this.createTestReadOnly();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkReadOnlyAnnotation readOnly = (EclipseLinkReadOnlyAnnotation) resourceType.getAnnotation(EclipseLink.READ_ONLY);
- assertNotNull(readOnly);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java
deleted file mode 100644
index eab652b39a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-@SuppressWarnings("nls")
-public class ReadTransformerAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ReadTransformerAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestReadTransformer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ReadTransformer");
- }
- });
- }
-
- private ICompilationUnit createTestReadTransformerWithTransformerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ReadTransformer(transformerClass=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestReadTransformerWithMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ReadTransformer(method=\"transformerMethod\")");
- }
- });
- }
-
- public void testReadTransformerAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER));
-
- resourceField.removeAnnotation(EclipseLink.READ_TRANSFORMER) ;
- assertNull(resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER));
-
- resourceField.addAnnotation(EclipseLink.READ_TRANSFORMER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER));
- }
-
- public void testGetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("Foo", readTransformer.getTransformerClass());
- }
-
- public void testSetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("Foo", readTransformer.getTransformerClass());
-
- readTransformer.setTransformerClass("Bar");
- assertEquals("Bar", readTransformer.getTransformerClass());
-
- assertSourceContains("@ReadTransformer(transformerClass=Bar.class)", cu);
- }
-
- public void testSetTransformerClassNull() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("Foo", readTransformer.getTransformerClass());
-
- readTransformer.setTransformerClass(null);
- assertNull(readTransformer.getTransformerClass());
-
- assertSourceContains("@ReadTransformer", cu);
- assertSourceDoesNotContain("transformerClass", cu);
- }
-
- public void testGetMethod() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("transformerMethod", readTransformer.getMethod());
- }
-
- public void testSetMethod() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("transformerMethod", readTransformer.getMethod());
-
- readTransformer.setMethod("foo");
- assertEquals("foo", readTransformer.getMethod());
-
- assertSourceContains("@ReadTransformer(method=\"foo\")", cu);
- }
-
- public void testSetMethodNull() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("transformerMethod", readTransformer.getMethod());
-
- readTransformer.setMethod(null);
- assertNull(readTransformer.getMethod());
-
- assertSourceContains("@ReadTransformer", cu);
- assertSourceDoesNotContain("method", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java
deleted file mode 100644
index b365466604..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class StructConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public StructConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestStructConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@StructConverter");
- }
- });
- }
-
- private ICompilationUnit createTestStructConverterWithConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@StructConverter(converter=\"Foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestStructConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@StructConverter(name=\"bar\")");
- }
- });
- }
-
- public void testStructConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestStructConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER));
-
- resourceField.removeAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertNull(resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER));
-
- resourceField.addAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER));
- }
-
- public void testGetConverter() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("Foo", converter.getConverter());
- }
-
- public void testSetConverter() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("Foo", converter.getConverter());
-
- converter.setConverter("Bar");
- assertEquals("Bar", converter.getConverter());
-
- assertSourceContains("@StructConverter(converter=\"Bar\")", cu);
- }
-
- public void testSetConverterNull() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("Foo", converter.getConverter());
-
- converter.setConverter(null);
- assertNull(converter.getConverter());
-
- assertSourceContains("@StructConverter", cu);
- assertSourceDoesNotContain("converter", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@StructConverter(name=\"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@StructConverter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java
deleted file mode 100644
index 6df2ccd4c1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-@SuppressWarnings("nls")
-public class TimeOfDayTests extends EclipseLinkJavaResourceModelTestCase {
-
- public TimeOfDayTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTimeOfDay() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay)");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithHour() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(hour=5))");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithMinute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(minute=5))");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithSecond() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(second=5))");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithMillisecond() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(millisecond=5))");
- }
- });
- }
-
- public void testExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDay();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
-
- assertNotNull(timeOfDay);
- }
-
- public void testGetHour() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithHour();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getHour());
- }
-
- public void testSetHour() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithHour();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getHour());
-
- timeOfDay.setHour(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getHour());
-
- assertSourceContains("@TimeOfDay(hour=80)", cu);
-
- timeOfDay.setHour(null);
- assertNull(timeOfDay.getHour());
-
- assertSourceDoesNotContain("(hour=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
- public void testGetMinute() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMinute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMinute());
- }
-
- public void testSetMinute() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMinute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMinute());
-
- timeOfDay.setMinute(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getMinute());
-
- assertSourceContains("@TimeOfDay(minute=80)", cu);
-
- timeOfDay.setMinute(null);
- assertNull(timeOfDay.getMinute());
-
- assertSourceDoesNotContain("(minute=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
- public void testGetSecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithSecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getSecond());
- }
-
- public void testSetSecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithSecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getSecond());
-
- timeOfDay.setSecond(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getSecond());
-
- assertSourceContains("@TimeOfDay(second=80)", cu);
-
- timeOfDay.setSecond(null);
- assertNull(timeOfDay.getSecond());
-
- assertSourceDoesNotContain("(second=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
- public void testGetMillisecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMillisecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMillisecond());
- }
-
- public void testSetMillisecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMillisecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMillisecond());
-
- timeOfDay.setMillisecond(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getMillisecond());
-
- assertSourceContains("@TimeOfDay(millisecond=80)", cu);
-
- timeOfDay.setMillisecond(null);
- assertNull(timeOfDay.getMillisecond());
-
- assertSourceDoesNotContain("(millisecond=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java
deleted file mode 100644
index 9d34d0fd95..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-@SuppressWarnings("nls")
-public class TransformationAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public TransformationAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTransformation() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TRANSFORMATION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transformation");
- }
- });
- }
-
- private ICompilationUnit createTestTransformationWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TRANSFORMATION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transformation(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestTransformationWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TRANSFORMATION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transformation(fetch = FetchType.EAGER)");
- }
- });
- }
-
- public void testTransformationAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestTransformation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.TRANSFORMATION));
-
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- assertNull(resourceField.getAnnotation(EclipseLink.TRANSFORMATION));
-
- resourceField.setPrimaryAnnotation(EclipseLink.TRANSFORMATION, EmptyIterable.<String>instance());
- assertNotNull(resourceField.getAnnotation(EclipseLink.TRANSFORMATION));
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(Boolean.TRUE, transformation.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(Boolean.TRUE, transformation.getOptional());
-
- transformation.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, transformation.getOptional());
-
- assertSourceContains("@Transformation(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(Boolean.TRUE, transformation.getOptional());
-
- transformation.setOptional(null);
- assertNull(transformation.getOptional());
-
- assertSourceContains("@Transformation", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(FetchType.EAGER, transformation.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(FetchType.EAGER, transformation.getFetch());
-
- transformation.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, transformation.getFetch());
-
- assertSourceContains("@Transformation(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(FetchType.EAGER, transformation.getFetch());
-
- transformation.setFetch(null);
- assertNull(transformation.getFetch());
-
- assertSourceContains("@Transformation", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java
deleted file mode 100644
index 301a42d29b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class TypeConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public TypeConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter");
- }
- });
- }
-
- private ICompilationUnit createTestTypeConverterWithDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter(dataType = Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestTypeConverterWithObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter(objectType = Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestTypeConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter(name = \"bar\")");
- }
- });
- }
-
- public void testTypeConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER));
-
- resourceField.removeAnnotation(EclipseLink.TYPE_CONVERTER);
- assertNull(resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER));
-
- resourceField.addAnnotation(EclipseLink.TYPE_CONVERTER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER));
- }
-
- public void testGetTypeDataType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- assertSourceContains("@TypeConverter(dataType = Bar.class)", cu);
-
- converter.setDataType("int");
- assertEquals("int", converter.getDataType());
- assertSourceContains("@TypeConverter(dataType = int.class)", cu);
- }
-
- public void testSetDataTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType(null);
- assertNull(converter.getDataType());
-
- assertSourceContains("@TypeConverter", cu);
- assertSourceDoesNotContain("dataType", cu);
- }
-
- public void testGetTypeObjectType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- assertSourceContains("@TypeConverter(objectType = Bar.class)", cu);
-
- converter.setObjectType("int");
- assertEquals("int", converter.getObjectType());
- assertSourceContains("@TypeConverter(objectType = int.class)", cu);
- }
-
- public void testSetObjectTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType(null);
- assertNull(converter.getObjectType());
-
- assertSourceContains("@TypeConverter", cu);
- assertSourceDoesNotContain("objectType", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@TypeConverter(name = \"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@TypeConverter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java
deleted file mode 100644
index e82c8f54f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-@SuppressWarnings("nls")
-public class WriteTransformerAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public WriteTransformerAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestWriteTransformer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer");
- }
- });
- }
-
- private ICompilationUnit createTestWriteTransformerWithTransformerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer(transformerClass = Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestWriteTransformerWithMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer(method = \"transformerMethod\")");
- }
- });
- }
-
- private ICompilationUnit createTestWriteTransformerWithColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer(column = @Column(name = \"FOO\"))");
- }
- });
- }
-
-
- public void testWriteTransformerAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
-
- resourceField.removeAnnotation(EclipseLink.WRITE_TRANSFORMER) ;
- assertNull(resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
-
- resourceField.addAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
- }
-
- public void testGetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("Foo", writeTransformer.getTransformerClass());
- }
-
- public void testSetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("Foo", writeTransformer.getTransformerClass());
-
- writeTransformer.setTransformerClass("Bar");
- assertEquals("Bar", writeTransformer.getTransformerClass());
-
- assertSourceContains("@WriteTransformer(transformerClass = Bar.class)", cu);
- }
-
- public void testSetTransformerClassNull() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("Foo", writeTransformer.getTransformerClass());
-
- writeTransformer.setTransformerClass(null);
- assertNull(writeTransformer.getTransformerClass());
-
- assertSourceContains("@WriteTransformer", cu);
- assertSourceDoesNotContain("transformerClass", cu);
- }
-
- public void testGetMethod() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("transformerMethod", writeTransformer.getMethod());
- }
-
- public void testSetMethod() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("transformerMethod", writeTransformer.getMethod());
-
- writeTransformer.setMethod("foo");
- assertEquals("foo", writeTransformer.getMethod());
-
- assertSourceContains("@WriteTransformer(method = \"foo\")", cu);
- }
-
- public void testSetMethodNull() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("transformerMethod", writeTransformer.getMethod());
-
- writeTransformer.setMethod(null);
- assertNull(writeTransformer.getMethod());
-
- assertSourceContains("@WriteTransformer", cu);
- assertSourceDoesNotContain("method", cu);
- }
-
-
- public void testGetColumn() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(writeTransformer.getColumn());
- assertEquals("FOO", writeTransformer.getColumn().getName());
- }
-
- public void testAddColumn() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNull(writeTransformer.getColumn());
-
- writeTransformer.addColumn();
-
- assertNotNull(writeTransformer.getColumn());
- assertSourceContains("@WriteTransformer(method = \"transformerMethod\", column = @Column)", cu);
-
- writeTransformer.getColumn().setName("BAR");
- assertSourceContains("@WriteTransformer(method = \"transformerMethod\", column = @Column(name = \"BAR\"))", cu);
-
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(writeTransformer.getColumn());
- assertEquals("FOO", writeTransformer.getColumn().getName());
-
- writeTransformer.removeColumn();
- assertNull(writeTransformer.getColumn());
-
- assertSourceContains("@WriteTransformer", cu);
- assertSourceDoesNotContain("column", cu);
- }
-
- public void getNonNullColumn() throws Exception {
-
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml
deleted file mode 100644
index 9b3b5db533..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?> <!--
- Copyright (c) 2008, 2010 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jpa.eclipselink.core.tests"/>
- <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1">
- <property file="${testRoot}/testServer.properties"/>
- <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/>
- <delete dir="${jpt-folder}" quiet="true"/>
-
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jpt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.JptJpaEclipselinkCoreResourceModelTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
- </ant>
- </target>
- <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.JptJpaEclipseLinkCoreContextModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/> </ant> </target>
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath
deleted file mode 100644
index a6a514e2d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/gen/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project
deleted file mode 100644
index b68577b671..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.gen.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 58eaebea70..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:38 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index fc42d0ad57..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.gen.tests
-Bundle-Version: 3.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.4.0",
- org.eclipse.jdt.core;bundle-version="3.4.0",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.gen;bundle-version="[2.0.0,3.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.jpa.gen.tests.internal;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties
deleted file mode 100644
index 0473587c2b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties
deleted file mode 100644
index f81a674adc..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Java Persistence Tools Entity Generation Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java
deleted file mode 100644
index 25e870f97a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.tests.internal;
-
-import java.util.HashSet;
-import org.eclipse.jpt.jpa.gen.internal.util.EntityGenTools;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-@SuppressWarnings("nls")
-public class EntityGenToolsTests extends TestCase {
-
- public EntityGenToolsTests(String name) {
- super(name);
- }
-
- public void testConvertToUniqueJavaStyleClassName1() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5oo", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName2() {
- HashSet<String> names = new HashSet<String>();
- names.add("Foo");
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName3() {
- HashSet<String> names = new HashSet<String>();
- names.add("foo");
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName4() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FooBar", names));
- assertEquals("Foo_bar", EntityGenTools.convertToUniqueJavaStyleClassName("foo_bar", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO_BAR", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_", names));
- assertEquals("FooBar_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleClassName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName5() {
- HashSet<String> names = new HashSet<String>();
- names.add("FooBar");
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FooBar", names));
- assertEquals("Foo_bar", EntityGenTools.convertToUniqueJavaStyleClassName("foo_bar", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO_BAR", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_", names));
- assertEquals("FooBar_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleClassName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName1() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5oo", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName2() {
- HashSet<String> names = new HashSet<String>();
- names.add("Foo");
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName3() {
- HashSet<String> names = new HashSet<String>();
- names.add("foo");
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName4() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FooBar", names));
- assertEquals("foo_bar", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo_bar", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO_BAR", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_", names));
- assertEquals("fooBar_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName5() {
- HashSet<String> names = new HashSet<String>();
- names.add("FooBar");
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FooBar", names));
- assertEquals("foo_bar", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo_bar", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO_BAR", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_", names));
- assertEquals("fooBar_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("4FOO_BAR", names));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java
deleted file mode 100644
index 530dd84d72..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.gen.tests.internal.EntityGenToolsTests;
-
-/**
- *
- */
-public class JptJpaGenTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("JPT Entity Generation Tests"); //$NON-NLS-1$
- suite.addTestSuite(EntityGenToolsTests.class);
- return suite;
- }
-
- private JptJpaGenTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml
deleted file mode 100644
index 40a027f14a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2008, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jpa.gen.tests"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="gen-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.jpa.gen.tests.internal.JptJpaGenTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value=""/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath
deleted file mode 100644
index 516ebfb5b7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project
deleted file mode 100644
index 9b0ee1fe12..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.ui.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index bde70d36e8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:52 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 34bfa32e63..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.ui.tests
-Bundle-Version: 2.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle:
- org.junit;bundle-version="4.3.1",
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jface,
- org.eclipse.jpt.common.core.tests,
- org.eclipse.jpt.jpa.core.tests,
- org.eclipse.jpt.jpa.core.tests.extension.resource,
- org.eclipse.jpt.common.utility,
- org.eclipse.jpt.jpa.core,
- org.eclipse.jpt.jpa.ui,
- org.eclipse.ui.navigator;bundle-version="3.4.0",
- org.eclipse.ui.forms;bundle-version="3.3.100",
- org.eclipse.ui.workbench;bundle-version="3.4.0"
-Export-Package: org.eclipse.jpt.jpa.ui.tests;x-internal:=true,
- org.eclipse.jpt.jpa.ui.tests.internal.platform;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties
deleted file mode 100644
index 50f0aa3fd9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties
deleted file mode 100644
index ac887adeab..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - UI Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java
deleted file mode 100644
index d52779117a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.ui.tests.internal.platform.JptUiPlatformTests;
-
-/**
- * Runs all JPT UI Tests
- */
-public class JptUiTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiTests.class.getPackage().getName());
- suite.addTest(JptUiPlatformTests.suite());
- return suite;
- }
-
- private JptUiTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
deleted file mode 100644
index ea60afa47f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.internal.platform.JpaPlatformManagerImpl;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-
-@SuppressWarnings("nls")
-public class JpaPlatformUiExtensionTests extends TestCase
-{
- protected TestJpaProject testProject;
-
- protected static final String PROJECT_NAME = "ExtensionTestProject";
- protected static final String PACKAGE_NAME = "extension.test";
-
- public static final String TEST_PLUGIN_CLASS = ExtensionTestPlugin.class.getName();
- public static final String TEST_PLUGIN_ID = ExtensionTestPlugin.PLUGIN_ID;
-
- public static final String TEST_PLATFORM_ID = TestJpaPlatformProvider.ID;
- public static final String TEST_PLATFORM_CLASS = TestJpaPlatformProvider.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- public static final String TEST_UI_PLATFORM_ID = TEST_PLATFORM_ID;
-
- public JpaPlatformUiExtensionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.testProject.getProject().delete(true, true, null);
- this.testProject = null;
- super.tearDown();
- }
-
- protected JpaProject jpaProject() {
- return this.testProject.getJpaProject();
- }
-
- public void testJpaPlatform() {
- assertNotNull(JpaPlatformManagerImpl.instance().buildJpaPlatformImplementation(this.testProject.getProject()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java
deleted file mode 100644
index abd6960a2c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.tests.internal.platform;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUiPlatformTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiPlatformTests.class.getPackage().getName());
- suite.addTestSuite(JpaPlatformUiExtensionTests.class);
- return suite;
- }
-
- private JptUiPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.project b/jpa/tests/org.eclipse.jpt.ui.tests/.project
deleted file mode 100644
index ab9bd7f596..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.ui.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.ui.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.project b/jpa/tests/org.eclipse.jpt.utility.tests/.project
deleted file mode 100644
index c371e9a48f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility.tests</name>
- <comment>renamed to org.eclipse.jpt.common.utility.tests and moved to common component</comment>
-</projectDescription>
diff --git a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/.project b/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/.project
deleted file mode 100644
index 6e0c0bbbf5..0000000000
--- a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/.project
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.releng</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/pom.xml b/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/pom.xml
deleted file mode 100644
index fea3540353..0000000000
--- a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.releng/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.eclipse.jpt.jpadiagrameditor</groupId>
- <artifactId>org.eclipse.jpt.jpadiagrameditor_parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <properties>
- <tycho-version>0.9.0</tycho-version>
- </properties>
-
- <modules>
- <module>../../plugins/org.eclipse.jpt.jpadiagrameditor.ui</module>
- <!-- module>../../tests/org.eclipse.jpt.jpadiagrameditor.tests</module -->
- <module>../../features/org.eclipse.jpt.jpadiagrameditor.feature</module>
- <module>../org.eclipse.jpt.jpadiagrameditor.repository</module>
- </modules>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>tycho-maven-plugin</artifactId>
- <version>${tycho-version}</version>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <resolver>p2</resolver>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>indigo</id>
- <url>http://download.eclipse.org/releases/staging/</url>
- <layout>p2</layout>
- </repository>
- <repository>
- <id>Juno</id>
- <url>http://build.eclipse.org/webtools/committers/wtp-R3.4.0-I/20110805150738/I-3.4.0-20110805150738/repository/</url>
- <layout>p2</layout>
- </repository>
- <repository>
- <id>Graphiti</id>
- <url>http://download.eclipse.org/graphiti/updates/milestones/</url>
- <layout>p2</layout>
- </repository>
-
- </repositories>
-
-</project> \ No newline at end of file
diff --git a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/.project b/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/.project
deleted file mode 100644
index 42ea5b1b49..0000000000
--- a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.repository</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.UpdateSiteBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.UpdateSiteNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/pom.xml b/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/pom.xml
deleted file mode 100644
index 338dcc4f6c..0000000000
--- a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/pom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>org.eclipse.jpt.jpadiagrameditor_parent</artifactId>
- <groupId>org.eclipse.jpt.jpadiagrameditor</groupId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>../org.eclipse.jpt.jpadiagrameditor.releng/pom.xml</relativePath>
- </parent>
-
- <artifactId>org.eclipse.jpt.jpadiagrameditor.repository</artifactId>
- <packaging>eclipse-update-site</packaging>
- <name>JPA Editor Update Site</name>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>maven-osgi-packaging-plugin</artifactId>
- <configuration>
- <archiveSite>true</archiveSite>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project> \ No newline at end of file
diff --git a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/site.xml b/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/site.xml
deleted file mode 100644
index a13eae758c..0000000000
--- a/jpa_diagram_editor/development/org.eclipse.jpt.jpadiagrameditor.repository/site.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<site>
- <feature url="features/org.eclipse.jpt.jpadiagrameditor.feature_1.1.0.qualifier.jar" id="org.eclipse.jpt.jpadiagrameditor.feature" version="1.1.0.qualifier">
- <category name="jpa_diagram_editor"/>
- </feature>
- <category-def name="jpa_diagram_editor" label="JPA Diagram Editor"/>
-</site>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.cvsignore b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.project b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.project
deleted file mode 100644
index 71d6b758e9..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/build.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/build.properties
deleted file mode 100644
index 9c242a160d..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2010 SAP AG.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Stefan Dimov - initial API, implementation and documentation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties \ No newline at end of file
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/eclipse_update_120.jpg b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.properties
deleted file mode 100644
index 00f089939e..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 SAP AG.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Stefan Dimov - initial API, implementation and documentation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Diagram Editor
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - JPA Diagram Editor
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2011 SAP AG.\
-All rights reserved. This program and the accompanying materials\
-are made available under the terms of the Eclipse Public License v1.0\
-which accompanies this distribution, and is available at\
-http://www.eclipse.org/legal/epl-v10.html\
-\n\
-Contributors:\n\
- Stefan Dimov - initial API, implementation and documentation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.xml b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.xml
deleted file mode 100644
index ccb89d8c78..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/feature.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpadiagrameditor.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jpadiagrameditor.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.graphiti.feature" version="0.8.0" match="greaterOrEqual"/>
- <import feature="org.eclipse.jpt.jpa.feature" version="3.0.0" match="greaterOrEqual"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpadiagrameditor.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpadiagrameditor.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpadiagrameditor.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/pom.xml b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/pom.xml
deleted file mode 100644
index c0ed14dc7a..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/pom.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>org.eclipse.jpt.jpadiagrameditor_parent</artifactId>
- <groupId>org.eclipse.jpt.jpadiagrameditor</groupId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>../../development/org.eclipse.jpt.jpadiagrameditor.releng/pom.xml</relativePath>
- </parent>
-
- <artifactId>org.eclipse.jpt.jpadiagrameditor.feature</artifactId>
- <packaging>eclipse-feature</packaging>
- <name>JPA Diagram Editor Feature</name>
-
-</project> \ No newline at end of file
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.html b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.ini b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.mappings b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index c783c4bcaa..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - JPA Diagram Editor Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/build.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 8f483248c6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.gif b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.png b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/epl-v10.html b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/license.html b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/plugin.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index fbb0d969c1..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-pluginName = Dali Java Persistence Tools - JPA Diagram Editor
-providerName = Eclipse Web Tools Platform
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/build.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 1393aa075a..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/feature.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 123c8ff10d..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Diagram Editor
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools Diagram Editor
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2011 SAP AG.\
-All rights reserved. This program and the accompanying materials\
-are made available under the terms of the Eclipse Public License v1.0\
-which accompanies this distribution, and is available at\
-http://www.eclipse.org/legal/epl-v10.html\
-\n\
-Contributors:\n\
- Stefan Dimov - initial API, implementation and documentation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.html b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.ini b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.mappings b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 6c105a7eba..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - JPA Diagram Editor Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/build.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 8f483248c6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.gif b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.png b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/epl-v10.html b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/license.html b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/plugin.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 7cd5e1f99a..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-
-pluginName = Dali Java Persistence Tools - JPA Diagram Editor
-providerName = Eclipse Web Tools Platform
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.cvsignore b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.cvsignore
deleted file mode 100644
index 19bfc7accc..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-.settings
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.project b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.project
deleted file mode 100644
index f2a045942f..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/build.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/eclipse_update_120.jpg b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.properties
deleted file mode 100644
index 855dcb9070..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2011 SAP AG.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Stefan Dimov - initial API, implementation and documentation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Diagram Editor JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools JPA Diagram Editor JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2011 SAP AG.\
-All rights reserved. This program and the accompanying materials\
-are made available under the terms of the Eclipse Public License v1.0\
-which accompanies this distribution, and is available at\
-http://www.eclipse.org/legal/epl-v10.html\
-\n\
-Contributors:\n\
- Stefan Dimov - initial API, implementation and documentation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.xml b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.xml
deleted file mode 100644
index 1fb940f61a..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor.tests.feature/feature.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpadiagrameditor.tests.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import plugin="org.easymock" version="2.4.0" match="compatible"/>
- <import feature="org.eclipse.graphiti.feature" version="0.8.0" match="greaterOrEqual"/>
- <import feature="org.eclipse.jpt.jpa.feature" version="3.0.0" match="greaterOrEqual"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpadiagrameditor.ui.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.cvsignore b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.project b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.project
deleted file mode 100644
index 342401f728..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/build.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/build.properties
deleted file mode 100644
index 06599fb47f..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jpadiagrameditor.feature.source=org.eclipse.jpt.jpadiagrameditor.feature
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/eclipse_update_120.jpg b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.properties b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.properties
deleted file mode 100644
index c4cc127e9a..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2011 SAP AG.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Stefan Dimov - initial API, implementation and documentation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Diagram Editor
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - JPA Diagram Editor
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2005, 2010 SAP AG.\
-All rights reserved. This program and the accompanying materials\
-are made available under the terms of the Eclipse Public License v1.0\
-which accompanies this distribution, and is available at\
-http://www.eclipse.org/legal/epl-v10.html\
-\n\
-Contributors:\n\
- Stefan Dimov - initial API, implementation and documentation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.xml b/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.xml
deleted file mode 100644
index 3b4fe6e148..0000000000
--- a/jpa_diagram_editor/features/org.eclipse.jpt.jpadiagrameditor_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpadiagrameditor_sdk.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jpadiagrameditor.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpadiagrameditor.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.cvsignore b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.project b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.project
deleted file mode 100644
index f8a805f398..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/META-INF/MANIFEST.MF b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 5f1ed49371..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jpadiagrameditor.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.ini b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.ini
deleted file mode 100644
index b820d7f4ae..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.ini
+++ /dev/null
@@ -1,33 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.mappings b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.properties
deleted file mode 100644
index 0e4294d3f6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/about.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - JPA Diagram Editor\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/build.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/build.properties
deleted file mode 100644
index fbf9849d0a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties,\
- component.xml
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/component.xml b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/component.xml
deleted file mode 100644
index eec5142f03..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/component.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpadiagrameditor.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jpadiagrameditor.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpadiagrameditor.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/icons/WTP_icon_x32_v2.png b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/plugin.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/plugin.properties
deleted file mode 100644
index fbb0d969c1..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.branding/plugin.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-pluginName = Dali Java Persistence Tools - JPA Diagram Editor
-providerName = Eclipse Web Tools Platform
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/.project b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/.project
deleted file mode 100644
index a3843373af..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/META-INF/MANIFEST.MF b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 66fc9f83ed..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpadiagrameditor.doc.user; singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.help;bundle-version="[3.3.100,4.0.0)"
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/about.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/about.html
deleted file mode 100644
index 45d8d709be..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2009</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/build.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/build.properties
deleted file mode 100644
index 64f61190a1..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = .,\
- META-INF/,\
- img/,\
- about.html,\
- plugin.properties,\
- plugin.xml,\
- html/,\
- *.xml
-generateSourceBundle=false
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/getting_started.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/getting_started.html
deleted file mode 100644
index 78b9f045d3..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/getting_started.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Getting started</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h1>Getting started</h1>
- <p>The Eclipse IDE provides a JPA diagram editor tool that allows
- you to create, edit, and display the application data model (entities
- and their relationships) in a graphical environment.</p>
- <p>You can use only one JPA diagram per project, and you cannot
- visualize entities from different projects in one JPA diagram.</p>
- <div>
- <p>
- <b>Example:</b>
- </p>
- <p>The following JPA diagram represents the data model of
- employees participating in various projects, that is, two entities
- with a bidirectional many-to-many relationship:</p>
- <div>
- <p>
- <img src="../img/jpa_diagram_editor.gif"
- alt="This graphic is explained in the accompanying text."
- title="This graphic is explained in the accompanying text." />
- </p>
- <br />
- </div>
- </div>
- <div>
- <h2>Features</h2>
- <p>The JPA diagram editor comprises the following general
- features:</p>
- <div>
- <ul>
- <li><p>Ability to create entities and define relationships
- between them.</p></li>
- <li><p>Ability to import existing entities together with
- their relationships.</p></li>
- <li><p>Full synchronization with the underlying
- application code, that is, whenever you apply a change to any of
- the objects on the diagram, the corresponding application code
- updates automatically, and the opposite.</p></li>
- <li><p>
- Error and warning markers with informative quick info text. You
- can view details on the marked errors and warnings in the <i>Problems</i>
- view.
- </p></li>
- <li><p>
- Integration with the <i>JPA Details</i> view and the <i>Miniature
- View</i>.
- </p></li>
- </ul>
- </div>
- </div>
- </div>
-</body>
-</html>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/reference_project_page.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/reference_project_page.html
deleted file mode 100644
index 4651f3b8d2..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/reference_project_page.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Property page &ndash; JPA Diagram Editor Options</title>
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Property page &ndash; JPA Diagram Editor Options</h1>
-<p>This table lists the properties available in the <span class="gui-object-title">JPA Diagram Editor settings page</span>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the JPA Diagram Editor Properties page." summary="This table describes the options on the JPA Diagram Editor Properties page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t37">Property</th>
-<th align="left" valign="bottom" id="r1c2-t37">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t37" headers="r1c1-t37"><a id="sthref277" name="sthref277"></a><a id="sthref278" name="sthref278"></a><a id="sthref279" name="sthref279"></a><a id="sthref280" name="sthref280"></a>Folder for diagrams</td>
-<td align="left" headers="r2c1-t37 r1c2-t37">Specify the folder where the diagram.xmi file will be created.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t37" headers="r1c1-t37">Default Java Package</td>
-<td align="left" headers="r3c1-t37 r1c2-t37">Specify the java package where the entities will be created by default.
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t37" headers="r1c1-t37">Default table name prefix</td>
-<td align="left" headers="r3c1-t37 r1c2-t37">Specify the prefix with which the tables will be created by default.
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t37" headers="r1c1-t37">Editing entity name</td>
-<td align="left" headers="r4c1-t37 r1c2-t37">Determine if the editing of the entity name in the diagram should affect the class name in the source file.
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t37" headers="r1c1-t37">Entity access type</td>
-<td align="left" headers="r3c1-t37 r1c2-t37">Select an entity access type.
-<p>To add annotations on the field level choose <span><b>Field-based</b></span>.</p>
-<p>To add annotations on the property level choose <span><b>Property-based</b></span>.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t37" headers="r1c1-t37">Default collection type</td>
-<td align="left" headers="r3c1-t37 r1c2-t37">Select a collection type of which the relation attributes to be created by default:
-<p>Choose <span><b>java.util.Collection</b></span>, so that the relation attributes to be of type Collection.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t37" headers="r1c1-t37">One-to-Many unidirectional old style relationship</td>
-<td align="left" headers="r4c1-t37 r1c2-t37">Specify if the old style One-to-Many unidirectional relationship (supported by JPA 1.0) to be used.
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-</div>
-</body>
-</html>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_20_support.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_20_support.html
deleted file mode 100644
index 0a63e72189..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_20_support.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA diagram editor partial support for JPA 2.0</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h1>JPA diagram editor partial support for JPA 2.0</h1>
- <td><div>
- <ul>
- <li><p>
- The JPA diagram editor supports the new style <i>One-to-Many</i>
- unidirectional relationship. It means that in JPA 2.0 projects
- the corresponding relationship attribute will be created with
- additional
- <tt title="Output">@JoinColumns(s)</tt>
- annotation, so that the corresponding DB schema will be created
- without additional join table.
- </p>
- </li>
- </ul>
- </div>
- <div>
- <p>
- <b>Note:</b>
- </p>
- <p>
- This behavior is optional. You may choose from the editor
- preference page or project property page to create this
- relationship (in JPA 2.0 projects) compliant with JPA 1.0
- specification, i.e. - without the additional
- <tt title="Output">@JoinColumns(s)</tt>
- annotation.
- </p>
- </div></td>
- </div>
-</body>
-</html>
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_configuring_editor.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_configuring_editor.html
deleted file mode 100644
index 4fe6a34147..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_configuring_editor.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Configuring the JPA diagram editor</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h1>Configuring the JPA diagram editor</h1>
- <td><div>
- <ul>
- <li><p>Configure the global default settings of the JPA
- diagram editor</p>
- <div>
- <ol>
- <li>Choose <span><i>Window</i> -&gt; <i>Preferences</i> </span> in
- the main menu.</li>
- <li><p>
- Select <span><i>General</i> -&gt; <i>Editors</i> -&gt; <i>JPA Diagram Editor</i> </span> in the
- properties tree.
- </p></li>
- <li><p>
- Specify the JPA diagram editor settings. To restore the global
- predefined values, choose <i>Restore Defaults</i>.
- </p></li>
- <li><p>
- Choose <i>Apply</i>, then choose <i>OK</i>.
- </p></li>
- </ol>
- </div>
- </li>
- <li><p>Configure the JPA diagram editor per project</p>
- <div>
- <ol>
- <li><p>
- In the context menu of the project in the <i>Project
- Explorer</i>, choose <i>Properties</i>.
- </p></li>
- <li><p>
- Select <span><i>JPA</i> -&gt; <i>JPA Diagram Editor</i> </span>.
- </p></li>
- <li><p>
- Specify the JPA diagram editor settings. To restore the global
- default settings, choose <i>Restore Defaults</i>.
- </p></li>
- <li><p>
- Choose <i>Apply</i>, then choose <i>OK</i>.
- </p></li>
- </ol>
- </div>
- </li>
- </ul>
- </div>
- </td>
- </div>
-</body>
-</html>
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_manage_entities.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_manage_entities.html
deleted file mode 100644
index c88450ea07..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_manage_entities.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Managing entities</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h1>Managing entities</h1>
- <td><p>You can perform the following operations on a
- particular entity graphical model:</p>
- <div>
- <ul>
- <li><p>Rename entities</p>
- <p>
- In terms of source code, this operation changes the
- <tt title="Output">name</tt>
- attribute of the
- <tt title="Output">@Entity</tt>
- annotation only.
- </p>
- </li>
- <li><p>Add, rename, or remove attributes</p>
- <div>
- <p>
- <b>Note:</b>
- </p>
- <p>
- The Eclipse IDE automatically generates getter and setter
- methods for new attributes. The default data type for new
- attributes is
- <tt title="Output">java.lang.String</tt>
- .
- </p>
- <p>In terms of source code, renaming attributes changes the
- field names of entities, together with the fields' getter and
- setter methods.</p>
- <p>Removing attributes removes them from the data model also.</p>
- <div>End of the note.</div>
- </div>
- </li>
- <li><p>Collapse or expand entities or attribute groups</p></li>
- <li><p>Save or discard your changes</p></li>
- <li><p>Save or discard your changes and remove the entity
- from the diagram without removing it from the application data
- model</p></li>
- <li><p>Remove the entity from the diagram and delete it
- from the application data model</p></li>
- </ul>
- </div>
- <p>To perform the actions described above, follow the steps:</p>
- <div>
- <ol>
- <li><p>Position the mouse cursor over the entity you want
- to manage.</p>
- <p>A button bar appears by the entity.</p>
- <div>
- <p>
- <img src="../img/jpa_diagram_entity_operations.gif"
- alt="This graphic is explained in the accompanying text."
- title="This graphic is explained in the accompanying text." />
- </p>
- <br />
- </div>
- </li>
- <li><p>Choose the relevant pushbutton. Each button has an
- informative tooltip that describes the relevant operation.</p></li>
- <li><p>
- To rename an entity or an attribute, double-click the title of an
- entity or the attribute, change the name, and choose
- <kbd title="Keyboard button">ENTER</kbd>
- .
- </p></li>
- <li><p>
- To remove an attribute, click the attribute and choose
- <kbd title="Keyboard button">DELETE</kbd>
- or choose <i>Delete</i> in the context menu.
- </p>
- <p>
- You can also remove an attribute by positioning the mouse cursor
- over the attribute and choosing the <i>Delete Attribute</i>
- pushbutton.
- </p>
- <div>
- <p>
- <img src="../img/jpa_diagram_delete_attribute.gif"
- alt="This graphic is explained in the accompanying text."
- title="This graphic is explained in the accompanying text." />
- </p>
- <p />
- </div>
- </li>
- </ol>
- </div>
- </td>
- </div>
-</body>
-</html>
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_diagram.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_diagram.html
deleted file mode 100644
index f319e6ea9d..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_diagram.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Open JPA Diagram, create and display entities</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h2>Opening JPA Diagram Editor</h2>
- <td><div>
- <ol>
- <li><p>
- In the <i>Project Explorer</i>, select the project that you are
- using or want to use for your entities.
- </p>
- </li>
- <li><p>
- In the context menu, choose <span title="Navigation path">
- <i>JPA Tools</i> -&grt; <i>Open Diagram</i>
- </span>.
- </p>
- </li>
- </ol>
- </div></td>
- <h2>Creating new entities</h2>
- <td><p>
- In the <i>Entities</i> list of the <i>Palette</i>, choose <span><img
- src="../img/jpaeditor_entity.gif" alt="Entity" title="Entity" /> (<i
- title="Quick info">Entity</i>)</span>, then click the diagram area.
- </p>
- <p>The Eclipse IDE creates the new entity with a predefined name
- and a primary key.</p></td>
- <h2>Displaying existing entities (if any) within a project on the
- diagram</h2>
- <td><div>
- <ul>
- <li><p>
- To display a single entity, copy the entity using drag and drop
- from the <i>Project Explorer</i> to the JPA diagram.
- </p>
- </li>
- <li><p>
- To display all entities, click the JPA diagram with the secondary
- mouse button and choose <i>Show All Entities</i>, or copy the <i>JPA
- Content</i> node from the project in the <i>Project Explorer</i> to
- the JPA diagram, using drag and drop.
- </p>
- </li>
- </ul>
- </div></td>
- </div>
-</body>
-</html>
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_miniature_view.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_miniature_view.html
deleted file mode 100644
index 88b01f8714..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_open_miniature_view.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Opening the Miniature view or the JPA Details view</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h2>Opening the Miniature view or the JPA Details view</h2>
- <td><div>
- <ol>
- <li><p>Click the JPA diagram with the secondary mouse
- button.</p></li>
- <li><p>
- Choose <i>Open Miniature View</i> or <i>Open JPA Details View</i>,
- respectively.
- </p></li>
- <li><p>
- To save the diagram as an image, choose <i>Save as Image</i>.
- </p></li>
- </ol>
- </div>
- <div>
- <p>
- <img src="../img/jpa_miniature_view.gif"
- alt="JPA Editor Miniature view."
- title="JPA Editor Miniature view." />
- </p>
- <br />
- </div>
- </td>
- </div>
-</body>
-</html>
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_refactor_entities.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_refactor_entities.html
deleted file mode 100644
index 4f52fd2296..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_refactor_entities.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Refactor, view, edit and remove entities and their
- attributes</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h2>Refactoring entities and attribute types</h2>
- <td><div>
- <p>
- <b>Caution:</b>
- </p>
- <div>
- <ul>
- <li><p>
- If you rename or move an entity using a different approach (for
- example, via the <i>Project Explorer</i>), the entity disappears
- from the JPA diagram.
- </p>
- </li>
- <li><p>When you refactor an attribute type, any existing
- business logic within the attribute's access methods is deleted.</p>
- </li>
- </ul>
- </div>
- </div>
- <p>Using the JPA diagram editor, you can perform the following
- refactoring operations:</p>
- <div>
- <ul>
- <li><p>
- Rename the entity class - in the context menu of the entity name,
- choose <span><i>Refactor Entity Class</i> -&gt; <i>Rename</i>
- </span>, then complete the wizard.
- </p>
- </li>
- <li><p>
- Move the entity to another source package - in the context menu
- of the entity name, choose <span><i>Refactor Entity
- Class</i> -&gt; <i>Move</i>
- </span>, then complete the wizard.
- </p>
- </li>
- <li><p>
- Refactor an attribute type - in the context menu of an attribute,
- choose <i>Refactor Attribute Type</i>, change the type, and
- choose <i>OK</i>.
- </p>
- </li>
- </ul>
- </div></td>
-
- <h2>Viewing and editing entities' source code</h2>
- <td><p>To view and edit the source code of a particular
- entity, double-click the title of the corresponding entity block on
- the diagram.</p>
- <p>The Eclipse IDE opens the entity class in the standard source
- code editor.</p>
- <p>When you apply changes to the source code, they are
- automatically synchronized with the diagram.</p></td>
-
- <h2>Removing all entities from the diagram</h2>
- <td><div>
- <p>
- <b>Note:</b>
- </p>
- <p>This operation removes the entities from the JPA diagram
- only, that is, they are not removed from the underlying application
- data model.</p>
- </div>
- <div>
- <ol>
- <li><p>Click the JPA diagram with the secondary mouse
- button.</p>
- </li>
- <li><p>
- To save any unsaved changes to the application data model, and
- remove all entities from the diagram, choose <span> <i>Remove
- All Entities from Diagram</i> -&gt; <i>...and Save Changes</i>
- </span>
- </p>
- </li>
- <li><p>
- To remove all entities from the diagram without saving any
- unsaved changes to the data model, choose <span><i>Remove
- All Entities from Diagram</i> -&gt; <i>...and Discard Changes</i>
- </span>.
- </p>
- </li>
- </ol>
- </div></td>
- </div>
-</body>
-</html>
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_remove_entities.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_remove_entities.html
deleted file mode 100644
index 1b560bbfff..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/task_remove_entities.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Defining and removing relationships between entities</title>
-
-<!-- contents -->
-</head>
-<body>
-
- <div class="sect1">
- <!-- infolevel="all" infotype="General" -->
- <h1>Defining and removing relationships between entities</h1>
- <td><div>
- <ol>
- <li><p>
- In the <i>Relations</i> list of the <i>Palette</i>, choose a
- relationship type.
- </p>
- </li>
- <li><p>
- Click the source entity of the relationship with the primary
- mouse button or choose
- <kbd title="Keyboard button">ESCAPE</kbd>
- to cancel.
- </p>
- </li>
- <li><p>
- Click the target entity of the relationship with the primary
- mouse button or choose
- <kbd title="Keyboard button">ESCAPE</kbd>
- to cancel.
- </p>
- <p>The Eclipse IDE creates and visualizes the relationship, as
- well as the relevant relationship attributes of the entities,
- depending on the type of relation.</p></li>
- <li><p>
- To remove a particular relationship, select the relation on the
- JPA diagram and choose
- <kbd title="Keyboard button">DELETE</kbd>
- , or choose <i>Delete</i> in the context menu.
- </p>
- <div>
- <p>Removing a relationship via the JPA diagram also removes
- it from the application data model and deletes the relationship
- attributes of the two related entities.</p>
- </div></li>
- </ol>
- </div></td>
- </div>
-</body>
-</html>
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/toc.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/toc.html
deleted file mode 100644
index 59b9631b7c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/html/toc.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Table of Contents</title>
-</head>
-
-<body>
- <h1>Table of Contents</h1>
- Please enter your text here.
-</body>
-</html> \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_delete_attribute.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_delete_attribute.gif
deleted file mode 100644
index fdb53f11db..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_delete_attribute.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_editor.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_editor.gif
deleted file mode 100644
index f6c95e656b..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_editor.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_entity_operations.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_entity_operations.gif
deleted file mode 100644
index d800a1b8f1..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_diagram_entity_operations.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_miniature_view.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_miniature_view.gif
deleted file mode 100644
index fd3e2547a2..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpa_miniature_view.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpaeditor_entity.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpaeditor_entity.gif
deleted file mode 100644
index 9c495ff163..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/img/jpaeditor_entity.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.properties
deleted file mode 100644
index 3260a3f582..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName=Dali Java Persistence Tools - Documentation
-providerName = Eclipse Web Tools Platform
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.xml b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.xml
deleted file mode 100644
index 145c6ac998..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/plugin.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
- <!-- =========== -->
- <!-- Define TOC -->
- <!-- =========== -->
- <extension
- point="org.eclipse.help.toc">
- <toc
- file="toc.xml"
- primary="true">
- </toc>
- </extension>
-
-</plugin>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/toc.xml b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/toc.xml
deleted file mode 100644
index 5abbf62374..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.doc.user/toc.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-
-<toc label="JPA Diagram Editor Project User Guide">
-
- <topic label="Getting started" href="html/getting_started.html"/>
-
- <topic label="Tasks">
- <topic href="PLUGINS_ROOT/org.eclipse.jpt.doc.user/getting_started003.htm" label="Create new JPA project">
- </topic>
- <topic href="html/task_configuring_editor.html" label="Configuring the JPA diagram editor">
- </topic>
- <topic href="html/task_open_diagram.html" label="Open JPA Diagram, create and display entities">
- </topic>
- <topic href="html/task_remove_entities.html" label="Defining and removing relationships between entities">
- </topic>
- <topic href="html/task_manage_entities.html" label="Managing entities">
- </topic>
- <topic href="html/task_refactor_entities.html" label="Refactor, view, edit and remove entities and their attributes">
- </topic>
- <topic href="html/task_open_miniature_view.html" label="Opening the Miniature view or the JPA Details view">
- </topic>
- <topic href="html/task_20_support.html" label="JPA diagram editor partial support for JPA 2.0">
- </topic>
- </topic>
- <topic label="Reference">
- <topic href="html/reference_project_page.html" label="Property page - JPA Diagram Editor Options">
- </topic>
- </topic>
-
-</toc>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.classpath b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.classpath
deleted file mode 100644
index e1f2c35125..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5" />
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins" />
- <classpathentry kind="src" path="src" />
- <classpathentry kind="output" path="bin" />
-</classpath>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.cvsignore b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.project b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.project
deleted file mode 100644
index e79949589c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.settings/org.eclipse.jdt.core.prefs b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d3cad09797..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:57 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/META-INF/MANIFEST.MF b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 847814eaa4..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,44 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpadiagrameditor.ui;singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Activator: org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)",
- org.eclipse.emf.transaction;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gef;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.graphiti;bundle-version="[0.8.0,1.0.0)",
- org.eclipse.graphiti.mm;bundle-version="[0.8.0,1.0.0)",
- org.eclipse.graphiti.pattern;bundle-version="[0.8.0,1.0.0)",
- org.eclipse.graphiti.ui;bundle-version="[0.8.0,1.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.ui;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.core.filesystem;bundle-version="1.3.100"
-Export-Package: org.eclipse.jpt.jpadiagrameditor.ui.internal;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.dialog;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.facade;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.propertytester;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.internal.util;x-internal:=true
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/about.html b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/about.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H2>About This Content</H2>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/build.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/build.properties
deleted file mode 100644
index e418f5df89..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2011 SAP AG. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Stefan Dimov - initial API, implementation and documentation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- icons/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = . \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/component.xml b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/component.xml
deleted file mode 100644
index 86072a50e3..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpadiagrameditor.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpadiagrameditor.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/CompoundKey.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/CompoundKey.gif
deleted file mode 100644
index a98d13d59b..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/CompoundKey.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/EJB_15x16.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/EJB_15x16.gif
deleted file mode 100644
index 22fef05077..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/EJB_15x16.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/cmpEntity_obj.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/cmpEntity_obj.gif
deleted file mode 100644
index 20ed1f9a44..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/cmpEntity_obj.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_attribute.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_attribute.gif
deleted file mode 100644
index 8d1a4c19a7..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_attribute.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_entity.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_entity.gif
deleted file mode 100644
index 09783846b4..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/add_entity.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/basic.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/basic.gif
deleted file mode 100644
index a547d743e7..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/basic.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embeddable.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embeddable.gif
deleted file mode 100644
index 8856f78874..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embeddable.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded-id.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded-id.gif
deleted file mode 100644
index c1c8e210e7..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded-id.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded.gif
deleted file mode 100644
index c2ae66497a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/embedded.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity-mappings.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity-mappings.gif
deleted file mode 100644
index c349c962e2..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity-mappings.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity.gif
deleted file mode 100644
index d606f482e2..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/entity.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/id.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/id.gif
deleted file mode 100644
index a205ec38ab..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/id.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-content.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-content.gif
deleted file mode 100644
index c0ab917511..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-content.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-file.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-file.gif
deleted file mode 100644
index b4e9f4724b..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/jpa-file.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-1-dir.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-1-dir.gif
deleted file mode 100644
index 89cac007d6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-1-dir.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-2-dir.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-2-dir.gif
deleted file mode 100644
index 07b3d1486f..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many-2-dir.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many.gif
deleted file mode 100644
index 48885b21fe..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-many.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-1-dir.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-1-dir.gif
deleted file mode 100644
index aa4e2cafd5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-1-dir.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-2-dir.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-2-dir.gif
deleted file mode 100644
index 1828007882..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one-2-dir.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one.gif
deleted file mode 100644
index 2e1e2b9387..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/many-to-one.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/mapped-superclass.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/mapped-superclass.gif
deleted file mode 100644
index 8cc37645c0..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/mapped-superclass.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-attribute-mapping.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-attribute-mapping.gif
deleted file mode 100644
index 70a9c23541..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-attribute-mapping.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-type-mapping.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-type-mapping.gif
deleted file mode 100644
index 6279478c51..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/null-type-mapping.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many-1-dir.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many-1-dir.gif
deleted file mode 100644
index 392ef48c6c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many-1-dir.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many.gif
deleted file mode 100644
index 1e90027861..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-many.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-1-dir.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-1-dir.gif
deleted file mode 100644
index 9193acf554..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-1-dir.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-2-dir.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-2-dir.gif
deleted file mode 100644
index 354a9af469..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one-2-dir.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one.gif
deleted file mode 100644
index 578ec36aa3..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/one-to-one.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence-unit.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence-unit.gif
deleted file mode 100644
index 9cc45f6945..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence-unit.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence.gif
deleted file mode 100644
index d1f616d64f..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/persistence.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/remove_attribute.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/remove_attribute.gif
deleted file mode 100644
index 40166b33be..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/remove_attribute.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/transient.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/transient.gif
deleted file mode 100644
index cc5d83db20..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/transient.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/version.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/version.gif
deleted file mode 100644
index 202a8104f4..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/version.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/warning.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/warning.gif
deleted file mode 100644
index 14009e9974..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/ent/warning.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/restore.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/restore.gif
deleted file mode 100644
index c081984da0..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/restore.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save.gif
deleted file mode 100644
index 1e0851aacf..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save_and_remove.gif b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save_and_remove.gif
deleted file mode 100644
index 271d231aab..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/icons/save_and_remove.gif
+++ /dev/null
Binary files differ
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.properties
deleted file mode 100644
index b7c55a19e5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2010 SAP AG.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Stefan Dimov - initial API, implementation and documentation
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName=Dali Java Persistence Tools - JPA Diagram Editor
-providerName = Eclipse Web Tools Platform
-
-diagrameditor.name = JPA Diagram Editor
-diagrameditor.opendiagram.menu.label = Open Diagram
-diagrameditor.opendiagram.action.label = Open Diagram
-diagrameditor.opendiagram.project.menu.label = Open Diagram
-diagrameditor.opendiagram.action.project.label = Open Diagram
-diagrameditor.prefpage = JPA Diagram Editor \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.xml b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.xml
deleted file mode 100644
index aed3594d4f..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/plugin.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<!--
- <copyright>
-
- Copyright (c) 2005, 2010 SAP AG.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Stefan Dimov - initial API, implementation and documentation
-
- </copyright>
-
- -->
-<plugin>
- <extension point="org.eclipse.ui.editors">
- <editor
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor"
- default="true"
- icon="icons/ent/entity.gif"
- id="org.eclipse.jpt.jpadiagrameditor.ui"
- matchingStrategy="org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.JPAEditorMatchingStrategy"
- name="%diagrameditor.name">
- </editor>
- </extension>
-
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- adaptable="false"
- id="org.eclipse.jpt.jpadiagrameditor.ui.openDiagramJpa"
- nameFilter="*"
- objectClass="org.eclipse.jpt.jpa.core.JpaNode">
-
- <enablement>
- <test property="org.eclipse.jpt.jpadiagrameditor.ui.jpaProjectFacet" value="jpt.jpa"/>
- </enablement>
- <menu
- id="org.eclipse.jpt.jpadiagrameditor.ui.openDiagramJpaMenu"
- label="%diagrameditor.opendiagram.menu.label">
- </menu>
- <action
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.OpenJpaDiagramActionDelegate"
- enablesFor="1"
- id="org.eclipse.jpt.jpadiagrameditor.ui.openDiagramJpaAction"
- label="%diagrameditor.opendiagram.action.label">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="true"
- id="org.eclipse.jpt.jpadiagrameditor.ui.openDiagramOnJpaProject"
- nameFilter="*"
- objectClass="org.eclipse.core.resources.IProject">
- <enablement>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa"/>
- </enablement>
- <action
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.OpenJpaDiagramActionDelegate"
- enablesFor="1"
- id="org.eclipse.jpt.jpadiagrameditor.ui.openDiagramOnJpaProjectAction"
- label="%diagrameditor.opendiagram.action.project.label"
- menubarPath="org.eclipse.jpt.jpa.ui.menu.JpaTools/content">
- </action>
- </objectContribution>
- </extension>
-<extension point="org.eclipse.ui.preferencePages">
- <page
- category="org.eclipse.ui.preferencePages.Editors"
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferencesPage"
- id="org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferencesPage"
- name="%diagrameditor.prefpage">
- </page>
-</extension>
-<extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferenceInitializer">
- </initializer>
-</extension>
-<extension
- point="org.eclipse.ui.propertyPages">
- <page
- category="org.eclipse.jpt.jpa.ui.jpaProjectProperties"
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage"
- id="org.eclipse.jpt.jpadiagrameditor.ui.propertypage"
- name="%diagrameditor.prefpage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa:1.0">
- </test>
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa:2.0">
- </test>
- </or>
- </adapt>
- </enabledWhen>
- </page>
-</extension>
-<extension
- point="org.eclipse.graphiti.ui.diagramTypeProviders">
- <diagramTypeProvider
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorDiagramTypeProvider"
- id="org.eclipse.jpt.jpadiagrameditor.ui.provider.JPAEditorDiagramTypeProvider"
- name="org.eclipse.jpt.jpadiagrameditor.ui.provider.JPAEditorDiagramTypeProvider">
- <diagramType
- id="org.eclipse.jpt.jpadiagrameditor.ui.JPAEditorDiagramType">
- </diagramType>
- <imageProvider
- id="org.eclipse.jpt.jpadiagrameditor.ui.provider.JPAEditorImageProvider">
- </imageProvider>
- </diagramTypeProvider>
-</extension>
-<extension
- point="org.eclipse.graphiti.ui.diagramTypes">
- <diagramType
- description="This is the diagram type for the JPA editor"
- id="org.eclipse.jpt.jpadiagrameditor.ui.JPAEditorDiagramType"
- name="JPA editor diagram type"
- type="JPA Diagram">
- </diagramType>
-</extension>
-<extension
- point="org.eclipse.graphiti.ui.imageProviders">
- <imageProvider
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider"
- id="org.eclipse.jpt.jpadiagrameditor.ui.provider.JPAEditorImageProvider">
- </imageProvider>
-</extension>
-
-<extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- id="org.eclipse.jpt.jpadiagrameditor.ui.propertytester.JpaProjectFacetVersionPropertyTester"
- type="org.eclipse.jpt.jpa.core.JpaNode"
- namespace="org.eclipse.jpt.jpadiagrameditor.ui"
- properties="jpaProjectFacet"
- class="org.eclipse.jpt.jpadiagrameditor.ui.internal.propertytester.JpaProjectFacetVersionPropertyTester">
- </propertyTester>
-</extension>
-
-</plugin>
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/pom.xml b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/pom.xml
deleted file mode 100644
index b0b1cff07c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/pom.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <version>1.0.100-SNAPSHOT</version>
-
- <parent>
- <artifactId>org.eclipse.jpt.jpadiagrameditor_parent</artifactId>
- <groupId>org.eclipse.jpt.jpadiagrameditor</groupId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>../../development/org.eclipse.jpt.jpadiagrameditor.releng/pom.xml</relativePath>
- </parent>
-
- <artifactId>org.eclipse.jpt.jpadiagrameditor.ui</artifactId>
- <packaging>eclipse-plugin</packaging>
- <name>JPA Diagram Editor Plug-in</name>
-</project> \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java
deleted file mode 100644
index 095a8d7845..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.ui.editor.DiagramEditor;
-import org.eclipse.graphiti.ui.internal.parts.ConnectionEditPart;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.selection.DefaultJpaSelection;
-import org.eclipse.jpt.jpa.ui.internal.selection.JpaSelectionManager;
-import org.eclipse.jpt.jpa.ui.internal.selection.SelectionManagerFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.JPADiagramEditorInput;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorContextMenuProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorDiagramTypeProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.EntitiesCoordinatesXML;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPACheckSum;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.Wrp;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-
-
-@SuppressWarnings("restriction")
-public class JPADiagramEditor extends DiagramEditor {
-
- public final static String ID = "org.eclipse.jpt.jpadiagrameditor.ui"; //$NON-NLS-1$
- private DefaultEditDomain editDomain;
-
- private JavaPersistentType inputJptType;
- private ISelectionManagerFactory jpaSelectionManagerFactory;
-
- public JPADiagramEditor() {
- this(new SelectionManagerFactoryImpl());
- editDomain = new DefaultEditDomain(this);
- }
-
- public JPADiagramEditor(ISelectionManagerFactory jpaSelectionManagerFactory) {
- super();
- this.jpaSelectionManagerFactory = jpaSelectionManagerFactory;
- editDomain = new DefaultEditDomain(this);
- }
-
- @Override
- public JPAEditorDiagramTypeProvider getDiagramTypeProvider() {
- return (JPAEditorDiagramTypeProvider) super.getDiagramTypeProvider();
- }
-
- public IFeatureProvider getFeatureProvider() {
- return getDiagramTypeProvider().getFeatureProvider();
- }
-
-
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class type) {
- if(IPropertySheetPage.class.equals(type))
- return null;
-
- return super.getAdapter(type);
- }
-
- public void saveWithoutEntities(IProgressMonitor monitor) {
- final Diagram d = getDiagramTypeProvider().getDiagram();
- final Wrp wrp = new Wrp();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(d);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- JPACheckSum.INSTANCE().assignEntityShapesMD5Strings(d, ModelIntegrationUtil.getProjectByDiagram(d.getName()));
- List<Shape> children = d.getChildren();
- Iterator<Shape> chIt = children.iterator();
- boolean save = true;
- while (chIt.hasNext()) {
- ContainerShape sh = (ContainerShape)chIt.next();
- JavaPersistentType jpt = (JavaPersistentType) getFeatureProvider()
- .getBusinessObjectForPictogramElement(sh);
- String entName = JPAEditorUtil.getText(jpt);
- ICompilationUnit cu = JPAEditorUtil.getCompilationUnit(jpt);
- try {
- if (cu.hasUnsavedChanges()) {
- entName = "* " + entName; //$NON-NLS-1$
- save = false;
- }
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Problem with compilation unit", e); //$NON-NLS-1$
- }
- GraphicsUpdater.updateHeader(sh, entName);
- }
- wrp.setObj(new Boolean(save));
- }
- });
- if ((Boolean)wrp.getObj())
- super.doSave(monitor);
- }
-
- @Override
- public void doSave(final IProgressMonitor monitor) {
- final Diagram d = getDiagramTypeProvider().getDiagram();
- //IJPAEditorFeatureProvider fp = (IJPAEditorFeatureProvider)getFeatureProvider();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(d);
- if ((d == null) || (ted == null)) {
- JPADiagramEditorPlugin.logError((d == null) ? "Diagram is null" : "TransactionalEditingDomain is null", new Exception()); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- JPACheckSum.INSTANCE().assignEntityShapesMD5Strings(d, ModelIntegrationUtil.getProjectByDiagram(d.getName()));
- List<Shape> children = d.getChildren();
- Iterator<Shape> chIt = children.iterator();
- while (chIt.hasNext()) {
- Shape sh = chIt.next();
- JavaPersistentType jpt = (JavaPersistentType) getFeatureProvider()
- .getBusinessObjectForPictogramElement(sh);
- if (jpt != null)
- JpaArtifactFactory.instance().forceSaveEntityClass(jpt, (IJPAEditorFeatureProvider) getFeatureProvider());
- }
- /*
- Resource res = ModelIntegrationUtil.getResourceByDiagram(d);
-
- try {
- //doSave(monitor);
- res.save(null);
- } catch (IOException e) {
- System.err.println("Can't save the diagram"); //$NON-NLS-1$
- e.printStackTrace();
- }
- */
-
- }
- });
-
- //IProject project = ModelIntegrationUtil.getProjectByDiagram().getProject();
- EntitiesCoordinatesXML xml = new EntitiesCoordinatesXML(d.getName());
- xml.store();
- xml.close();
-
- super.doSave(monitor);
- }
-
- @Override
- protected ContextMenuProvider createContextMenuProvider() {
- return new JPAEditorContextMenuProvider(getGraphicalViewer(),
- getActionRegistry(),
- getConfigurationProvider());
- }
-
- private void initWithFileEditorInput(final IEditorSite site,
- final IFile entityFile) {
- Diagram diagram = null;
- try {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(site
- .getShell());
- dialog.run(true, false, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
- monitor.beginTask(
- JPAEditorMessages.JPADiagramEditor_waitingForMoin,
- IProgressMonitor.UNKNOWN);
- monitor.done();
- }
- });
-
- inputJptType = JPAEditorUtil.getJPType(JavaCore
- .createCompilationUnitFrom(entityFile));
- setPartProperty(
- JPAEditorConstants.OPEN_WHOLE_PERSISTENCE_UNIT_EDITOR_PROPERTY,
- inputJptType.getName());
- PersistenceUnit persistenceUnit = inputJptType.getPersistenceUnit();
- String diagramURI = ModelIntegrationUtil.createDiagramPath(persistenceUnit).toString();
- TransactionalEditingDomain defaultTransEditDomain = (TransactionalEditingDomain)inputJptType.
- getJpaProject().getProject().getAdapter(TransactionalEditingDomain.class);
- diagram = ModelIntegrationUtil.createDiagram(persistenceUnit, 10, true);
- JPADiagramEditorInput diagramInput = new JPADiagramEditorInput(diagram,
- diagramURI,
- defaultTransEditDomain,
- JPAEditorDiagramTypeProvider.ID,
- false);
- //ModelIntegrationUtil.mapDiagramToProject(diagram, persistenceUnit
- // .getJpaProject());
- super.init(site, diagramInput);
- } catch (CoreException e) {
- JPADiagramEditorPlugin.getDefault().getLog().log(e.getStatus());
- //ModelIntegrationUtil.removeDiagramProjectMapping(diagram);
- } catch (InvocationTargetException e) {
- IStatus status = new Status(IStatus.ERROR,
- JPADiagramEditorPlugin.PLUGIN_ID, e.getMessage(), e);
- JPADiagramEditorPlugin.getDefault().getLog().log(status);
- //ModelIntegrationUtil.removeDiagramProjectMapping(diagram);
- } catch (InterruptedException e) {
- IStatus status = new Status(IStatus.ERROR,
- JPADiagramEditorPlugin.PLUGIN_ID, e.getMessage(), e);
- JPADiagramEditorPlugin.getDefault().getLog().log(status);
- //ModelIntegrationUtil.removeDiagramProjectMapping(diagram);
- }
- }
-
- public void init(IEditorSite site, IEditorInput input)
- throws PartInitException {
- IFile entityFile = (IFile) input.getAdapter(IFile.class);
-
- if (entityFile != null && entityFile.getFileExtension().equals("java")) { //$NON-NLS-1$
- initWithFileEditorInput(site, entityFile);
- } else
- super.init(site, input);
- }
-
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- super.selectionChanged(part, selection);
- if (!(selection instanceof IStructuredSelection))
- return;
- IStructuredSelection structSel = (IStructuredSelection)selection;
- @SuppressWarnings("unchecked")
- Iterator<IStructuredSelection> iter = structSel.iterator();
- while(iter.hasNext()){
- Object object = iter.next();
- if(object instanceof EditPart){
- EditPart editPart = (EditPart) object;
- if(editPart instanceof ConnectionEditPart){
- ConnectionEditPart connectionEditPart = (ConnectionEditPart) (editPart);
- connectionEditPart.removeEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE);
- }
- }
- }
-
- Object o = ((IStructuredSelection) selection).getFirstElement();
- if (o instanceof EditPart) {
- JpaSelectionManager selectionManager = getJpaSelectionManager(part);
- Object m = ((EditPart) o).getModel();
- if (m == null)
- return;
- if (m instanceof PictogramElement) {
- Object bo = getFeatureProvider()
- .getBusinessObjectForPictogramElement(
- (PictogramElement) m);
- if ((bo == null) || (!(bo instanceof JpaStructureNode)))
- return;
- selectionManager.select(new DefaultJpaSelection(
- (JpaStructureNode) bo), null);
- return;
- }
- }
- }
-
- private JpaSelectionManager getJpaSelectionManager(IWorkbenchPart part) {
- return jpaSelectionManagerFactory.getSelectionManager(part.getSite()
- .getWorkbenchWindow());
- }
-
- public static interface ISelectionManagerFactory {
- public JpaSelectionManager getSelectionManager(IWorkbenchWindow window);
- }
-
- private static class SelectionManagerFactoryImpl implements
- ISelectionManagerFactory {
-
- public JpaSelectionManager getSelectionManager(IWorkbenchWindow window) {
- return SelectionManagerFactory.getSelectionManager(window);
- }
-
- }
-
- @Override
- public DefaultEditDomain getEditDomain() {
- return editDomain;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditorPlugin.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditorPlugin.java
deleted file mode 100644
index 8cd63461ca..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditorPlugin.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal;
-
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.facade.EclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.ResourceChangeListener;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-@SuppressWarnings("restriction")
-public class JPADiagramEditorPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpadiagrameditor.ui"; //$NON-NLS-1$
-
- // The shared instance
- private static JPADiagramEditorPlugin plugin;
-
- private IResourceChangeListener changeListener;
-
- /**
- * The constructor
- */
- public JPADiagramEditorPlugin() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
-
- OptionalMessageDialog.setDialogEnabled(JPAEditorConstants.JPA_SUPPORT_DIALOG_ID, true);
- changeListener = new ResourceChangeListener();
- EclipseFacade.INSTANCE.getWorkspace().addResourceChangeListener(changeListener, IResourceChangeEvent.POST_CHANGE);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- EclipseFacade.INSTANCE.getWorkspace().removeResourceChangeListener(changeListener);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static JPADiagramEditorPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-
- /**
- * Log the specified message.
- */
- public static void logError(String msg) {
- logError(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void logError(Throwable throwable) {
- logError(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void logError(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- plugin.getLog().log(status);
- }
-
-
- /**
- * Log the specified message and exception or error.
- */
- public static void logInfo(String msg) {
- log(new Status(IStatus.INFO, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/dialog/SelectTypeDialog.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/dialog/SelectTypeDialog.java
deleted file mode 100644
index 5d85e97333..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/dialog/SelectTypeDialog.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.dialog;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.bindings.keys.ParseException;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.IContentProposalProvider;
-import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
-import org.eclipse.jface.fieldassist.TextContentAdapter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.forms.IMessage;
-import org.eclipse.ui.progress.IProgressService;
-
-
-@SuppressWarnings("restriction")
-public class SelectTypeDialog extends TitleAreaDialog {
-
- protected String title;
- protected String message;
- protected Label label;
- protected Text text;
- protected String type;
- protected Button browseButton;
- protected ContentProposalAdapter contentProposalAdapter;
-
-
- protected static KeyStroke ks = null;
- static {
- try {
- ks = KeyStroke.getInstance("Ctrl+Space"); //$NON-NLS-1$
- } catch (ParseException e1) {
- JPADiagramEditorPlugin.logError("Can't create keystroke object", e1); //$NON-NLS-1$
- }
- }
-
- public SelectTypeDialog(String message,
- String initialType) {
- super(PlatformUI.getWorkbench().getDisplay().getActiveShell());
- this.title = JPAEditorMessages.SelectTypeDialog_chooseAttributeTypeDialogTitle;
- this.message = message;
- this.type = initialType;
- }
-
- protected Control createContents(Composite parent) {
- Control contents = super.createContents(parent);
- initializeControls();
- validatePage();
- return contents;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(JPAEditorMessages.SelectTypeDialog_chooseAttributeTypeDialogWindowTitle);
- }
-
-
- protected Point getInitialSize() {
- return new Point(convertHorizontalDLUsToPixels(320),
- convertVerticalDLUsToPixels(120));
- }
-
- public String getTypeName() {
- return type;
- }
-
- protected void buttonPressed(int buttonId) {
- type = text.getText().trim();
- super.buttonPressed(buttonId);
- }
-
- protected boolean isResizable() {
- return true;
- }
-
- private void createLabel(Composite composite) {
- label = new Label(composite, SWT.LEFT);
- label.setText(JPAEditorMessages.SelectTypeDialog_typeLabel);
- }
-
- private void createTextField(Composite composite) {
- text = new Text(composite, SWT.SINGLE | SWT.BORDER);
- }
-
- private void createBrowseBtn(Composite composite) {
- browseButton = new Button(composite, SWT.PUSH);
- browseButton.setText(JPAEditorMessages.SelectTypeDialog_browseBtnTxt);
- browseButton.setToolTipText(JPAEditorMessages.SelectTypeDialog_browseBtnDesc);
- browseButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- IJavaSearchScope scope= SearchEngine.createWorkspaceScope();
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog d = null;
- try {
- d = JavaUI.createTypeDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_ALL_TYPES,
- false,
- text.getText().trim());
- } catch (JavaModelException e1) {
- JPADiagramEditorPlugin.logError("Can't create type selaction dialog instance", e1); //$NON-NLS-1$
- }
- d.open();
- Object[] res = d.getResult();
- if (res == null)
- return;
- Object[] obj = d.getResult();
- if (obj == null)
- return;
- IType tp = (IType) obj[0];
- text.setText(tp.getFullyQualifiedName());
- text.setSelection(0, tp.getFullyQualifiedName().length());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- private IContentProposalProvider createContentProposalProvider() {
- SimpleContentProposalProvider contProvider = new SimpleContentProposalProvider(JPAEditorConstants.PRIMITIVE_TYPES_AND_WRAPPERS);
- contProvider.setFiltering(true);
-
- contentProposalAdapter = new ContentProposalAdapter(
- text,
- new TextContentAdapter(),
- contProvider,
- ks,
- new char[] {'b', 'c', 'd', 'i', 'f', 'l', 's', 'j', 'B', 'C', 'D', 'I', 'F', 'L', 'S', 'J'});
- contentProposalAdapter.setEnabled(true);
- contentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
- return contProvider;
- }
-
- @Override
- public Control createDialogArea(Composite parent) {
- Composite parentComposite = (Composite) super.createDialogArea(parent);
- GridLayout rowLayout = new GridLayout(3, false);
- Composite composite = new Composite(parentComposite, SWT.NONE);
-
- GridData d = new GridData(GridData.FILL_BOTH);
- d.grabExcessHorizontalSpace = true;
- d.heightHint = 400;
- composite.setLayoutData(d);
-
- rowLayout.marginLeft = 5;
- rowLayout.marginTop = 5;
- rowLayout.marginRight = 5;
- rowLayout.marginBottom = 30;
-
- composite.setLayout(rowLayout);
- createLabel(composite);
- GridData data = new GridData(40,20);
- data.verticalAlignment = SWT.CENTER;
- data.horizontalAlignment = SWT.BEGINNING;
- label.setLayoutData(data);
- createTextField(composite);
- data = new GridData(300, 17);
- data.horizontalAlignment = SWT.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = SWT.CENTER;
- text.setLayoutData(data);
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- setDialogComplete(validatePage());
- }
- });
- createBrowseBtn(composite);
- data = new GridData(100, 25);
- data.verticalAlignment = SWT.TOP;
- data.horizontalAlignment = SWT.LEFT;
- data.minimumWidth = 80;
- browseButton.setLayoutData(data);
- createContentProposalProvider();
- return parentComposite;
- }
-
- private void initializeControls() {
- setTitle(title);
- setMessage(message);
- text.setText(type);
- text.setSelection(0, type.length());
- setDialogComplete(validatePage());
- }
-
- protected void setDialogComplete(boolean value) {
- this.getButton(IDialogConstants.OK_ID).setEnabled(value);
- }
-
- private boolean validatePage() {
- String type = text.getText().trim();
- if (StringTools.stringIsEmpty(type)) {
- setErrorMessage(JPAEditorMessages.SelectTypeDialog_emptyTypeErrorText);
- return false;
- }
- IStatus stat = getStatus();
- if (stat.isOK()) {
- setErrorMessage(null);
- setMessage(message, IMessage.NONE);
- } else {
- setMessage(stat.getMessage(), IMessage.ERROR);
- }
- return (stat.getSeverity() != IStatus.ERROR);
- }
-
- private IStatus getStatus() {
- String type = text.getText().trim();
- String[] types = type.split("[<>\\[\\],]"); //$NON-NLS-1$
- for (int i = 0; i < types.length; i++) {
- type = types[i].trim();
- IStatus stat = JavaConventions.validateJavaTypeName(type, JavaCore.VERSION_1_6, JavaCore.VERSION_1_6);
- boolean isPrimitive = JPAEditorConstants.PRIMITIVE_TYPES_AND_WRAPPERS_SET.contains(type);
- if (isPrimitive || (stat.getSeverity() != IStatus.ERROR))
- continue;
- return stat;
- }
- return Status.OK_STATUS;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/DisplayFacade.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/DisplayFacade.java
deleted file mode 100644
index d6c1b85fd7..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/DisplayFacade.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.facade;
-
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IDisplayFacade;
-import org.eclipse.swt.widgets.Display;
-
-public class DisplayFacade implements IDisplayFacade {
-
- public void asyncExec(Runnable runnable) {
- Display.getDefault().asyncExec(runnable);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/EclipseFacade.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/EclipseFacade.java
deleted file mode 100644
index 941de0f448..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/EclipseFacade.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.facade;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IDisplayFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJavaCoreFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IStaticIDE;
-
-public class EclipseFacade implements IEclipseFacade {
-
- public static EclipseFacade INSTANCE = new EclipseFacade();
-
- private EclipseFacade() {
- }
-
- public IJavaCoreFacade getJavaCore() {
- return new JavaCoreFacade();
- }
-
- public IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public IDisplayFacade getDisplay() {
- return new DisplayFacade();
- }
-
- public IStaticIDE getIDE() {
- return new StaticIDE();
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/JavaCoreFacade.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/JavaCoreFacade.java
deleted file mode 100644
index 4ec068e942..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/JavaCoreFacade.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.facade;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJavaCoreFacade;
-
-public class JavaCoreFacade implements IJavaCoreFacade {
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/StaticIDE.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/StaticIDE.java
deleted file mode 100644
index 16b3254eda..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/facade/StaticIDE.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.facade;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IStaticIDE;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-public class StaticIDE implements IStaticIDE {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jpt.jpadiagrameditor.ui.provider.IStaticIDE#openEditor(org.eclipse
- * .core.resources.IFile)
- */
- public void openEditor(IFile file) throws PartInitException {
- IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getActivePage(), file);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAllEntitiesFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAllEntitiesFeature.java
deleted file mode 100644
index ec3cb7e3b1..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAllEntitiesFeature.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.graphiti.datatypes.IDimension;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-
-
-public class AddAllEntitiesFeature extends AbstractCustomFeature implements IAddFeature {
-
- int[] lowerEdges = new int[200];
- int numInARow;
- private final static int DIST_FROM_EDGE_H = 50;
- private final static int DIST_FROM_EDGE_V = 50;
- private final static int DIST_H = 100;
- private final static int DIST_V = 100;
-
- public AddAllEntitiesFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean isAvailable(IContext ctx) {
- return true;
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- @SuppressWarnings("restriction")
- public void execute(ICustomContext context) {
- Diagram d = getDiagram();
- JpaProject project = getTargetJPAProject();
- PersistenceUnit unit = project.getRootContextNode().getPersistenceXml().
- getPersistence().getPersistenceUnits().iterator().next();
-
-
- Point lowestRightestPointOfExistingDiagram = getLowestRightestPoint(d);
-
- for (int i = 0; i < 200; i++) {
- lowerEdges[i] = lowestRightestPointOfExistingDiagram.y +
- (((i % 2 == 0) ? 1 : 2) *
- ((lowestRightestPointOfExistingDiagram.y == 0) ?
- DIST_FROM_EDGE_V :
- DIST_V));
- }
- IDimension dim = getFeatureProvider().getDiagramTypeProvider().getDiagramEditor().getCurrentSize();
- int dWidth = dim.getWidth();
- numInARow = (dWidth - DIST_FROM_EDGE_H - 20 + JPAEditorConstants.ENTITY_WIDTH)/(JPAEditorConstants.ENTITY_WIDTH + DIST_H);
- numInARow = (numInARow > 0) ? numInARow : 1;
-
- lowerEdges[0] = lowestRightestPointOfExistingDiagram.y + ((lowestRightestPointOfExistingDiagram.y == 0) ? DIST_FROM_EDGE_V : DIST_V);
-
- for (ClassRef classRef : unit.getClassRefs()) {
- if (classRef.getJavaPersistentType() != null) { // null if
- JavaPersistentType jpt = classRef.getJavaPersistentType();
- if (jpt.getMappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- PictogramElement pe = getFeatureProvider().getPictogramElementForBusinessObject(jpt);
- if (pe != null)
- continue;
-
- final AddContext ctx = new AddContext();
- ctx.setTargetContainer(d);
- ctx.setNewObject(jpt);
-
- IndexAndLowerEdge ie = getMinLowerEdge();
-
- int x = DIST_FROM_EDGE_H + ie.index * (JPAEditorConstants.ENTITY_WIDTH + DIST_H);
- ctx.setLocation(x, ie.lowerEdge);
- final AddJPAEntityFeature ft = new AddJPAEntityFeature(getFeatureProvider());
-
- final Diagram targetDiagram = (Diagram) ctx.getTargetContainer();
- TransactionalEditingDomain ted = ModelIntegrationUtil.getTransactionalEditingDomain(targetDiagram);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- ft.add(ctx);
- }
- });
- ContainerShape entityShape = (ContainerShape)getFeatureProvider().getPictogramElementForBusinessObject(jpt);
- lowerEdges[ie.index] = entityShape.getGraphicsAlgorithm().getY() + entityShape.getGraphicsAlgorithm().getHeight() + DIST_V;
- }
- }
- }
- }
-
- private IndexAndLowerEdge getMinLowerEdge() {
- IndexAndLowerEdge res = new IndexAndLowerEdge();
- res.lowerEdge = 10000000;
- for (int i = 0; i < numInARow; i++) {
- if (lowerEdges[i] < res.lowerEdge) {
- res.lowerEdge = lowerEdges[i];
- res.index = i;
- }
- }
- return res;
- }
-
- private JpaProject getTargetJPAProject() {
- return ModelIntegrationUtil.getProjectByDiagram(getDiagram().getName());
- }
-
- public static Point getLowestRightestPoint(Diagram d) {
- List<Shape> shapes = d.getChildren();
- Iterator<Shape> it = shapes.iterator();
- int x = 0;
- int y = 0;
- while (it.hasNext()) {
- Shape sh = it.next();
- int rightEdge = sh.getGraphicsAlgorithm().getX() +
- sh.getGraphicsAlgorithm().getWidth();
- x = Math.max(x, rightEdge);
- int lowerEdge = sh.getGraphicsAlgorithm().getY() +
- sh.getGraphicsAlgorithm().getHeight();
- y = Math.max(y, lowerEdge);
- }
- x = Math.max(x, 3 * (DIST_H + JPAEditorConstants.ENTITY_WIDTH));
- return new Point(x, y);
- }
-
- public PictogramElement add(IAddContext context) {
- this.execute(new CustomContext());
- return null;
- }
-
- public boolean canAdd(IAddContext context) {
- return true;
- }
-
- private class IndexAndLowerEdge {
- int index;
- int lowerEdge;
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_showAllTheEntities;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java
deleted file mode 100644
index 32dd9e9fb0..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.IDirectEditingInfo;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.Wrp;
-
-
-public class AddAttributeFeature extends AbstractAddShapeFeature {
-
- private IAddFeature graphicalAdd;
-
- private ICustomFeature expandCompartmentFeature;
-
- public AddAttributeFeature(IFeatureProvider fp) {
- this(fp, new GraphicalAddAttributeFeature(fp), new ExpandCompartmentShapeFeature(fp));
- }
-
- public AddAttributeFeature(IFeatureProvider fp, IAddFeature graphicalAdd, ICustomFeature expandFeature) {
- super(fp);
- this.graphicalAdd = graphicalAdd;
- expandCompartmentFeature = expandFeature;
- }
-
- public PictogramElement add(final IAddContext context) {
- Object o = context.getNewObject();
- if (!(o instanceof JavaPersistentAttribute)) {
- return null;
- }
- final JavaPersistentAttribute newAttr = (JavaPersistentAttribute) o;
-// JpaArtifactFactory.instance().refreshEntityModel(getFeatureProvider(), (JavaPersistentType)newAttr.getParent());
-
- getFeatureProvider().putKeyToBusinessObject(getFeatureProvider().getKeyForBusinessObject(newAttr), newAttr);
- PictogramElement pe = getFeatureProvider().getPictogramElementForBusinessObject(newAttr);
- if (pe != null)
- return pe;
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(context.getTargetContainer());
- final Wrp wrp = new Wrp();
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- ContainerShape textShape = graphicalAdd(context.getTargetContainer(), newAttr);
- expand(newAttr);
- enableDirectAfterAdding(textShape);
- wrp.setObj(textShape);
- }
- });
- return (PictogramElement)wrp.getObj();
- }
-
- private void expand(JavaPersistentAttribute jpa) {
- ContainerShape attributeShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(jpa);
-
- ICustomContext customContext = new CustomContext(new PictogramElement[] { attributeShape.getContainer() });
- expandCompartmentFeature.execute(customContext);
- }
-
- private ContainerShape graphicalAdd(ContainerShape entityShape, JavaPersistentAttribute newAttr) {
- AddContext context = new AddContext();
- context.setNewObject(newAttr);
- context.setTargetContainer(entityShape);
- ContainerShape textShape = (ContainerShape) graphicalAdd.add(context);
- return textShape;
- }
-
- private void enableDirectAfterAdding(ContainerShape textShape) {
- GraphicsAlgorithm ga = textShape.getGraphicsAlgorithm();
- final GraphicsAlgorithm graphicsAlgorithm = ga.getGraphicsAlgorithmChildren().get(0);
- if (graphicsAlgorithm instanceof Text) {
- Text text = (Text) graphicsAlgorithm;
- IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo();
- directEditingInfo.setMainPictogramElement(textShape);
- directEditingInfo.setPictogramElement(textShape);
- directEditingInfo.setGraphicsAlgorithm(text);
- }
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- public boolean canAdd(IAddContext context) {
- Object o = context.getNewObject();
- return o instanceof JavaPersistentAttribute;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java
deleted file mode 100644
index 2da00febd6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.context.impl.CreateContext;
-import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.LineStyle;
-import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.util.IPredefinedRenderingStyle;
-import org.eclipse.graphiti.util.PredefinedColoredAreas;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IPackageDeclaration;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.SourceType;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IAddEntityContext;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants.ShapeType;
-
-
-@SuppressWarnings({ "restriction" })
-public class AddJPAEntityFeature extends AbstractAddShapeFeature {
-
- private IPeUtilFacade facade;
- private static ContainerShape primaryShape;
- private static ContainerShape relationShape;
- private static ContainerShape basicShape;
-
-
- public AddJPAEntityFeature(IFeatureProvider fp) {
- super(fp);
- facade = new PeUtilFacade();
- }
-
- public AddJPAEntityFeature(IFeatureProvider fp, IPeUtilFacade facade) {
- super(fp);
- this.facade = facade;
- }
-
- public boolean canAdd(IAddContext context) {
- Object newObj = context.getNewObject();
-
- if (newObj instanceof JavaPersistentType) {
- if (context.getTargetContainer() instanceof Diagram) {
- JavaPersistentType jpt = (JavaPersistentType) newObj;
- return checkJPTForAdding(jpt);
- }
- } else if (newObj instanceof ICompilationUnit) {
- if (context.getTargetContainer() instanceof Diagram) {
- ICompilationUnit cu = (ICompilationUnit) newObj;
- JavaPersistentType jpt = JPAEditorUtil.getJPType(cu);
- return checkJPTForAdding(jpt);
- }
- } if (newObj instanceof SourceType) {
- if (context.getTargetContainer() instanceof Diagram) {
- ICompilationUnit cu = ((SourceType)newObj).getCompilationUnit();
- JavaPersistentType jpt = JPAEditorUtil.getJPType(cu);
- return checkJPTForAdding(jpt);
- }
- }
- return false;
- }
-
- private boolean checkJPTForAdding(JavaPersistentType jpt) {
- if (jpt == null)
- return false;
-
- PictogramElement[] pictograms = getFeatureProvider()
- .getAllPictogramElementsForBusinessObject(jpt);
- JpaProject proj = ModelIntegrationUtil.getProjectByDiagram(getDiagram().getName());
- if (proj != null)
- if (proj != jpt.getJpaProject())
- return false;
- return (pictograms == null) || (pictograms.length == 0);
- }
-
- @Override
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- public PictogramElement add(IAddContext context) {
- IJPAEditorFeatureProvider fp = getFeatureProvider();
- Object newObj = context.getNewObject();
- JavaPersistentType jpt = null;
- if (newObj instanceof JavaPersistentType) {
- jpt = (JavaPersistentType) newObj;
- if (jpt.getMapping() instanceof JavaMappedSuperclass) {
- jpt = createEntityFromExistingMappedSuperclass(fp, jpt);
- }
- } else if (newObj instanceof ICompilationUnit) {
- ICompilationUnit cu = (ICompilationUnit) newObj;
- jpt = JPAEditorUtil.getJPType(cu);
- if (jpt.getMapping() instanceof JavaMappedSuperclass) {
- jpt = createEntityFromExistingMappedSuperclass(fp, jpt);
- }
-
- } else if (newObj instanceof SourceType) {
- ICompilationUnit cu = ((SourceType)newObj).getCompilationUnit();
- jpt = JPAEditorUtil.getJPType(cu);
- }
- final Diagram targetDiagram = (Diagram) context.getTargetContainer();
-
- ContainerShape entityShape = facade.createContainerShape(targetDiagram, true);
-
- createEntityRectangle(context, entityShape,
- this.getFeatureProvider().getDiagramTypeProvider().getDiagram());
- link(entityShape, jpt);
- Shape shape = Graphiti.getPeService().createShape(entityShape, false);
- Polyline headerBottomLine = Graphiti.getGaService().createPolyline(shape, new int[] { 0,
- 30, JPAEditorConstants.ENTITY_WIDTH, 30 });
- headerBottomLine
- .setForeground(manageColor(JPAEditorConstants.ENTITY_BORDER_COLOR));
- headerBottomLine.setLineWidth(JPAEditorConstants.ENTITY_BORDER_WIDTH);
-
- addHeader(jpt, entityShape, JPAEditorConstants.ENTITY_WIDTH);
-
- createCompartments(context, jpt, entityShape);
- fillCompartments(jpt,entityShape);
-
- String key = fp.getKeyForBusinessObject(jpt);
- if (fp.getBusinessObjectForKey(key) == null)
- fp.putKeyToBusinessObject(key, jpt);
-
- Graphiti.getPeService().createChopboxAnchor(entityShape);
- entityShape.setVisible(true);
- layoutPictogramElement(entityShape);
-
- UpdateAttributeFeature updateFeature = new UpdateAttributeFeature(fp);
- updateFeature.reconnect(jpt);
-
- return entityShape;
- }
-
- private JavaPersistentType createEntityFromExistingMappedSuperclass(
- IJPAEditorFeatureProvider fp, JavaPersistentType jpt) {
- ICreateContext cont = new CreateContext();
- String packageName = null;
- try {
- packageName = getMappedSuperclassPackageDeclaration(fp, jpt,
- packageName);
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError(e);
- }
-
- boolean hasPrimaryKey = hasMappedSuperclassPrimaryKeyAttribute(jpt);
-
- CreateJPAEntityFeature createFeature = new CreateJPAEntityFeature(fp,
- true, jpt.getName(), packageName, hasPrimaryKey);
- Object[] objects = createFeature.create(cont);
- if (objects.length != 0) {
- Object obj = objects[0];
- if (obj instanceof JavaPersistentType) {
- jpt = (JavaPersistentType) obj;
- }
- }
- return jpt;
- }
-
- private boolean hasMappedSuperclassPrimaryKeyAttribute(
- JavaPersistentType jpt) {
-
- for (AttributeMapping map : ((JavaMappedSuperclass) jpt.getMapping()).getAllAttributeMappings()) {
- if (map.getPrimaryKeyColumnName() != null) {
- return true;
- }
- }
- return false;
- }
-
- private String getMappedSuperclassPackageDeclaration(
- IJPAEditorFeatureProvider fp, JavaPersistentType jpt,
- String packageName) throws JavaModelException {
- IPackageDeclaration[] packages = fp.getCompilationUnit(jpt)
- .getPackageDeclarations();
- if (packages.length > 0) {
- IPackageDeclaration packageDecl = packages[0];
- packageName = packageDecl.getElementName();
- }
- return packageName;
- }
-
- private void createCompartments(IAddContext context, JavaPersistentType jpt,
- ContainerShape entityShape) {
- primaryShape = createCompartmentRectangle(entityShape, JPAEditorConstants.ENTITY_MIN_HEIGHT, JPAEditorMessages.AddJPAEntityFeature_primaryKeysShape);
- relationShape = createCompartmentRectangle(entityShape, GraphicsUpdater.getNextCompartmentY(primaryShape) + JPAEditorConstants.SEPARATOR_HEIGHT,
- JPAEditorMessages.AddJPAEntityFeature_relationAttributesShapes);
- basicShape = createCompartmentRectangle(entityShape, GraphicsUpdater.getNextCompartmentY(relationShape) + JPAEditorConstants.SEPARATOR_HEIGHT, JPAEditorMessages.AddJPAEntityFeature_basicAttributesShapes);
- if (IAddEntityContext.class.isInstance(context)) {
- IAddEntityContext entityContext = (IAddEntityContext) context;
- GraphicsUpdater.setCollapsed(primaryShape, entityContext.isPrimaryCollapsed());
- GraphicsUpdater.setCollapsed(basicShape, entityContext.isBasicCollapsed());
- GraphicsUpdater.setCollapsed(relationShape, entityContext.isRelationCollapsed());
- } else {
- GraphicsUpdater.setCollapsed(primaryShape, false);
- GraphicsUpdater.setCollapsed(basicShape, false);
- GraphicsUpdater.setCollapsed(relationShape, false);
- }
- }
-
- private void fillCompartments(JavaPersistentType jpt, ContainerShape entityShape) {
- String[] primaryKeyAnnotations = new String[] {JPAEditorConstants.ANNOTATION_ID, JPAEditorConstants.ANNOTATION_EMBEDDED_ID};
- for(String annotation : primaryKeyAnnotations){
- addCompartmentChildren(primaryShape, jpt, annotation);
- }
- String[] relationAnnotations = new String[] {JPAEditorConstants.ANNOTATION_MANY_TO_MANY,
- JPAEditorConstants.ANNOTATION_MANY_TO_ONE, JPAEditorConstants.ANNOTATION_ONE_TO_MANY,
- JPAEditorConstants.ANNOTATION_ONE_TO_ONE};
- for(String annotation : relationAnnotations){
- addCompartmentChildren(relationShape, jpt, annotation);
- }
- addBasicAttributes(basicShape, jpt);
- GraphicsUpdater.updateEntityShape(entityShape);
- }
-
- private ContainerShape createCompartmentRectangle(
- ContainerShape entityShape, int y, String attribTxt) {
- int width = entityShape.getGraphicsAlgorithm().getWidth();
- ContainerShape containerShape = Graphiti.getPeService().createContainerShape(
- entityShape, false);
- Graphiti.getPeService().setPropertyValue(containerShape,
- JPAEditorConstants.PROP_SHAPE_TYPE, ShapeType.COMPARTMENT
- .toString());
- Rectangle rect = addCompartmentRectangle(y, width, containerShape);
-
- addCompartmentHeaderText(attribTxt, width, rect);
-
- UpdateAttributeFeature updateFeature = new UpdateAttributeFeature(getFeatureProvider());
-
- updateFeature.addSeparatorsToShape(containerShape);
-
- return containerShape;
- }
-
- private Rectangle addCompartmentRectangle(int y, int width,
- ContainerShape containerShape) {
- Rectangle rect = Graphiti.getGaService().createRectangle(containerShape);
- rect.setFilled(false);
- rect.setLineVisible(false);
- rect.setHeight(0);
- rect.setWidth(width);
- rect.setX(0);
- rect.setY(y);
- containerShape.setActive(true);
- return rect;
- }
-
- private void addCompartmentHeaderText(String attribTxt, int width,
- Rectangle rect) {
- IJPAEditorFeatureProvider fp = getFeatureProvider();
- Text text = UpdateAttributeFeature.addText(fp, rect, attribTxt);
- text.getFont().setSize(7);
- text.getFont().setItalic(true);
- text.getFont().setBold(false);
- Graphiti.getGaService().setWidth(text, width);
- Graphiti.getGaService().setLocationAndSize(text, 0, 2, width,
- 13);
- text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
- text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
- }
-
- private void addCompartmentChildren(
- ContainerShape containerShape, JavaPersistentType jpt,
- String attributeAnnotations) {
- List<JavaPersistentAttribute> attributes = new ArrayList<JavaPersistentAttribute>();
-
- for (JavaPersistentAttribute attribute : jpt.getAttributes()) {
- HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(attribute);
- if (annotations.contains(attributeAnnotations)) {
- attributes.add(attribute);
- }
- }
- addAttributes(containerShape, attributes);
- }
-
- private void addBasicAttributes(ContainerShape containerShape, JavaPersistentType jpt){
- List<JavaPersistentAttribute> attributes = new ArrayList<JavaPersistentAttribute>();
-
- for (JavaPersistentAttribute attribute : jpt.getAttributes()){
- HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(attribute);
- if(!(annotations.contains(JPAEditorConstants.ANNOTATION_ID))&& !(annotations.contains(JPAEditorConstants.ANNOTATION_EMBEDDED_ID)) && !(annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)) &&
- !(annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) && !(annotations.contains(JPAEditorConstants.ANNOTATION_ONE_TO_MANY))&&
- !(annotations.contains(JPAEditorConstants.ANNOTATION_ONE_TO_ONE)) || annotations.isEmpty()){
- attributes.add(attribute);
- }
- }
- addAttributes(containerShape, attributes);
- }
-
- private void addAttributes(ContainerShape entityShape,
- List<JavaPersistentAttribute> attributes) {
- for (int i = 0; i < attributes.size(); i++) {
- JavaPersistentAttribute jpa = attributes.get(i);
- addAttribute(jpa, entityShape);
- }
- }
-
- public interface IPeUtilFacade {
- public ContainerShape createContainerShape(Diagram diagram, boolean b);
- }
-
- public static RoundedRectangle createEntityRectangle(IAddContext context,
- ContainerShape entityShape, Diagram diagram) {
-
- RoundedRectangle entityRectangle = Graphiti.getGaService().createRoundedRectangle(
- entityShape, JPAEditorConstants.ENTITY_CORNER_WIDTH,
- JPAEditorConstants.ENTITY_CORNER_HEIGHT);
- entityRectangle
- .setForeground(Graphiti.getGaService().manageColor(diagram, JPAEditorConstants.ENTITY_BORDER_COLOR));
- entityRectangle
- .setBackground(Graphiti.getGaService().manageColor(diagram, JPAEditorConstants.ENTITY_BACKGROUND));
- Graphiti.getGaService().setRenderingStyle(entityRectangle.getPictogramElement().getGraphicsAlgorithm(),
- PredefinedColoredAreas.getAdaptedGradientColoredAreas(IPredefinedRenderingStyle.BLUE_WHITE_GLOSS_ID));
- entityRectangle.setLineWidth(JPAEditorConstants.ENTITY_BORDER_WIDTH);
- entityRectangle.setLineStyle(LineStyle.SOLID);
- Graphiti.getGaService().setLocationAndSize(entityRectangle, context
- .getX(), context.getY(),
- (context.getWidth() == -1) ? JPAEditorConstants.ENTITY_WIDTH
- : context.getWidth(),
- (context.getHeight() == -1) ? JPAEditorConstants.ENTITY_HEIGHT
- : context.getHeight());
- return entityRectangle;
- }
-
- private static class PeUtilFacade implements IPeUtilFacade {
- public ContainerShape createContainerShape(Diagram diagram, boolean b) {
- return Graphiti.getPeService().createContainerShape(diagram, true);
- }
- }
-
- private ContainerShape addHeader(JavaPersistentType addedWrapper,
- ContainerShape entityShape, int width) {
-
- ContainerShape headerIconShape = Graphiti.getPeService().createContainerShape(
- entityShape, false);
- Rectangle iconRect = Graphiti.getGaService().createRectangle(headerIconShape);
- iconRect.setFilled(false);
- iconRect.setLineVisible(false);
- iconRect.setHeight(JPAEditorConstants.ICON_RECT_HEIGHT);
- iconRect.setX(0);
- iconRect.setWidth(JPAEditorConstants.HEADER_ICON_RECT_WIDTH);
- iconRect.setHeight(JPAEditorConstants.HEADER_ICON_RECT_HEIGHT);
- iconRect.setY(0);
- Image headerIcon = Graphiti.getGaService().createImage(iconRect,
- JPAEditorImageProvider.JPA_ENTITY);
- Graphiti.getGaService().setLocationAndSize(headerIcon,
- JPAEditorConstants.ICON_HEADER_X,
- JPAEditorConstants.ICON_HEADER_Y,
- JPAEditorConstants.ICON_WIDTH,
- JPAEditorConstants.ICON_HEIGHT);
- Graphiti.getPeService().setPropertyValue(headerIconShape,
- JPAEditorConstants.PROP_SHAPE_TYPE, ShapeType.ICON.toString());
-
- ContainerShape entityHeaderTextShape = Graphiti.getPeService().createContainerShape(entityShape, false);
- Graphiti.getPeService()
- .setPropertyValue(entityHeaderTextShape,
- JPAEditorConstants.PROP_SHAPE_TYPE, ShapeType.HEADER
- .toString());
- Rectangle headerRect = Graphiti.getGaService().createRectangle(entityHeaderTextShape);
- headerRect.setFilled(false);
- headerRect.setLineVisible(false);
- headerRect.setWidth(width - JPAEditorConstants.HEADER_TEXT_RECT_WIDTH_REDUCER);
- headerRect.setHeight(JPAEditorConstants.HEADER_TEXT_RECT_HEIGHT);
- headerRect.setY(2);
- headerRect.setX(JPAEditorConstants.HEADER_TEXT_RECT_X);
-
- String headerTextString = JPAEditorUtil.getText(addedWrapper);
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit(addedWrapper);
- JPAEditorUtil.becomeWorkingCopy(cu);
- headerTextString = JPAEditorUtil.returnSimpleName(headerTextString);
- try {
- if (cu.hasUnsavedChanges()) {
- headerTextString = JPAEditorConstants.HEADER_PREFIX_DIRTY + headerTextString;
- }
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot check compilation unit for unsaved changes", e); //$NON-NLS-1$
- }
- Text headerTextObj = Graphiti.getGaService().createDefaultText(getDiagram(), headerRect,
- headerTextString);
- headerTextObj
- .setForeground(manageColor(JPAEditorConstants.ENTITY_TEXT_FOREGROUND));
- headerTextObj.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
- headerTextObj.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
- headerTextObj.getFont().setBold(true);
- Graphiti.getGaService().setLocationAndSize(headerTextObj, 1, 2,
- width, 20);
-
- return entityHeaderTextShape;
-
- }
-
- @SuppressWarnings("deprecation")
- private void addAttribute(JavaPersistentAttribute pa,
- ContainerShape compartmentShape) {
- IJPAEditorFeatureProvider fp = getFeatureProvider();
- fp.putKeyToBusinessObject(fp.getKeyForBusinessObject(pa), pa);
- JavaPersistentType jpt = (JavaPersistentType)pa.getParent();
- String key = fp.getKeyForBusinessObject(jpt);
- if (fp.getBusinessObjectForKey(key) == null)
- fp.putKeyToBusinessObject(key, jpt);
- UpdateAttributeFeature updateFeature = new UpdateAttributeFeature(fp);
- updateFeature.addAttributes(compartmentShape.getContainer(), pa);
- updateFeature = null;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java
deleted file mode 100644
index c8c62db78c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import static org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelDir.UNI;
-import static org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType.MANY_TO_MANY;
-import static org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType.MANY_TO_ONE;
-import static org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType.ONE_TO_MANY;
-import static org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType.ONE_TO_ONE;
-
-import java.util.List;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IAddBendpointFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddConnectionContext;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.impl.AddBendpointContext;
-import org.eclipse.graphiti.features.impl.AbstractAddFeature;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorImageCreator;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageCreator;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelDir;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtilImpl;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.Wrp;
-import org.eclipse.swt.graphics.Point;
-
-
-public class AddRelationFeature extends AbstractAddFeature {
-
- private static final double START_COEFFICIENT = 0.1;
-
- private IJPAEditorImageCreator imageCreator;
- private IJPAEditorUtil jpaEditorUtil;
-
- public AddRelationFeature(IFeatureProvider fp) {
- this(fp, new JPAEditorImageCreator(), new JPAEditorUtilImpl());
- }
-
- public AddRelationFeature(IFeatureProvider fp,
- IJPAEditorImageCreator imageCreator,
- IJPAEditorUtil jpaEditorUtil) {
- super(fp);
- this.imageCreator = imageCreator;
- this.jpaEditorUtil = jpaEditorUtil;
- }
-
- public PictogramElement add(IAddContext context) {
- final IAddConnectionContext addConContext = (IAddConnectionContext) context;
- final IRelation relation = (IRelation) context.getNewObject();
- final Diagram diagram = getDiagram();
- final Wrp wrp = new Wrp();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(diagram);
- RecordingCommand rc = new RecordingCommand(ted) {
- protected void doExecute() {
- FreeFormConnection connection = createConnection(addConContext, relation, diagram);
- imageCreator.createConnectionLine(diagram, connection);
- getFeatureProvider().putKeyToBusinessObject(relation.getId(), relation);
- link(connection, relation);
- layoutPictogramElement(connection);
- wrp.setObj(connection);
- }
- };
- try {
- ted.getCommandStack().execute(rc);
- } catch (Exception e){
-
- }
-
- return (PictogramElement)wrp.getObj();
- }
-
- private FreeFormConnection createConnection(IAddConnectionContext addConContext, IRelation relation,
- final Diagram diagram) {
- FreeFormConnection connection = getFeatureProvider().getPeUtil().createFreeFormConnection(diagram);
- connection.setStart(addConContext.getSourceAnchor());
- connection.setEnd(addConContext.getTargetAnchor());
- connection.setVisible(true);
- connection.setActive(true);
- List<Point> points = jpaEditorUtil.createBendPointList(connection, relation.getOwner() == relation.getInverse());
- for (int i = 0; i < points.size(); i++) {
- Point p = points.get(i);
- AddBendpointContext ctx = new AddBendpointContext(connection, p.x, p.y, i);
- IAddBendpointFeature ft =getFeatureProvider().getAddBendpointFeature(ctx);
- ft.addBendpoint(ctx);
- }
- addDecorators(connection, relation);
- addTextDecorators(connection, relation);
- return connection;
- }
-
- private void addDecorators(FreeFormConnection connection, IRelation relation) {
- RelDir direction = relation.getRelDir();
- RelType type = relation.getRelType();
- if (ONE_TO_ONE.equals(type)) {
- addOneToOneDecorator(connection, direction, relation);
- } else if (ONE_TO_MANY.equals(type) && UNI.equals(direction)) {
- addOneToManyDecorator(connection, relation);
- } else if (MANY_TO_ONE.equals(type)) {
- addManyToOneDecorator(connection, direction, relation);
- } else if (MANY_TO_MANY.equals(type)) {
- addManyToManyDecorator(connection, direction, relation);
- }
- }
-
- private void addTextDecorators(FreeFormConnection connection, IRelation relation) {
- RelDir direction = relation.getRelDir();
- RelType type = relation.getRelType();
- if (ONE_TO_ONE.equals(type)) {
- addOneToOneTextDecorator(connection, direction, relation);
- } else if (ONE_TO_MANY.equals(type) && UNI.equals(direction)) {
- addOneToManyTextDecorator(connection, relation);
- } else if (MANY_TO_ONE.equals(type)) {
- addManyToOneTextDecorator(connection, direction, relation);
- } else if (MANY_TO_MANY.equals(type)) {
- addManyToManyTextDecorator(connection, direction, relation);
- }
- }
-
-
- private void addOneToOneDecorator(FreeFormConnection c, RelDir direction, IRelation rel) {
- double startCoefficient = START_COEFFICIENT;
- double endCoefficient = 1.0 - startCoefficient;
- int len = JPAEditorUtil.calcConnectionLength(c);
- if (UNI.equals(direction)) {
- ConnectionDecorator d = imageCreator.createArrowConnectionDecorator(c, endCoefficient);
- Graphiti.getGaService().setLocation(d.getGraphicsAlgorithm(),Math.round(-len/10), 0);
- }
- }
-
- private void addOneToManyDecorator(FreeFormConnection c, IRelation rel) {
- double startCoefficient = START_COEFFICIENT;
- double endCoefficient = 1.0 - startCoefficient;
- int len = JPAEditorUtil.calcConnectionLength(c);
- ConnectionDecorator d = imageCreator.createManyEndWithArrowDecorator(c, endCoefficient);
- Graphiti.getGaService().setLocation(d.getGraphicsAlgorithm(),Math.round(-len/10), 0);
- }
-
- private void addManyToOneDecorator(FreeFormConnection c, RelDir direction, IRelation rel) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getOwner());
- double startCoefficient = START_COEFFICIENT;
- double endCoefficient = 1.0 - startCoefficient;
- int len = JPAEditorUtil.calcConnectionLength(c);
- ConnectionDecorator d1 = imageCreator.createManyStartDecorator(c, startCoefficient);
- Graphiti.getGaService().setLocation(d1.getGraphicsAlgorithm(),Math.round(len/10), 0);
- if (UNI.equals(direction)) {
- ConnectionDecorator d2 = imageCreator.createArrowConnectionDecorator(c, endCoefficient);
- Graphiti.getGaService().setLocation(d2.getGraphicsAlgorithm(),Math.round(-len/10), 0);
- }
- }
-
- private void addManyToManyDecorator(FreeFormConnection c, RelDir direction, IRelation rel) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getOwner());
- double startCoefficient = START_COEFFICIENT;
- double endCoefficient = 1.0 - startCoefficient;
- int len = JPAEditorUtil.calcConnectionLength(c);
- ConnectionDecorator d1 = imageCreator.createManyStartDecorator(c, startCoefficient);
- Graphiti.getGaService().setLocation(d1.getGraphicsAlgorithm(),Math.round(len/10), 0);
- if (UNI.equals(direction)) {
- ConnectionDecorator d = imageCreator.createManyEndWithArrowDecorator(c, endCoefficient);
- Graphiti.getGaService().setLocation(d.getGraphicsAlgorithm(),Math.round(-len/10), 0);
- } else {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getInverse());
- ConnectionDecorator d = imageCreator.createManyEndDecorator(c, endCoefficient);
- Graphiti.getGaService().setLocation(d.getGraphicsAlgorithm(),Math.round(-len/10), 0);
- }
- }
-
-
-
-
-
-
- private void addOneToOneTextDecorator(FreeFormConnection c, RelDir direction, IRelation rel) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getOwner());
- OneToOneAnnotation a = null;
- Boolean optional;
- boolean isOptional = false;
- if (RelDir.UNI.equals(direction)) {
- isOptional = true;
- } else {
- JavaPersistentAttribute inverse = rel.getInverse().getAttributeNamed(rel.getInverseAttributeName());
- JpaArtifactFactory.instance().refreshEntityModel(null, (JavaPersistentType)inverse.getParent());
- JavaAttributeMapping mapping = inverse.getMapping();
- a = (OneToOneAnnotation)mapping.getMappingAnnotation();
- if (a != null) {
- optional = a.getOptional();
- isOptional = (optional == null) ? true : optional.booleanValue();
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, isOptional ? JPAEditorConstants.CARDINALITY_ZERO_ONE : JPAEditorConstants.CARDINALITY_ONE, 0.0);
- }
- }
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getOwner());
- JavaPersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName());
- owner.update();
- JavaAttributeMapping mapping = owner.getMapping();
- a = (OneToOneAnnotation)mapping.getMappingAnnotation();
- if (a == null)
- return;
- optional = a.getOptional();
- isOptional = (optional == null) ? true : optional.booleanValue();
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, isOptional ? JPAEditorConstants.CARDINALITY_ZERO_ONE : JPAEditorConstants.CARDINALITY_ONE, 1.0);
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getOwnerAttributeName(), 0.0);
- if (!UNI.equals(direction)) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getInverse());
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getInverseAttributeName(), 1.0);
- }
- }
-
- private void addOneToManyTextDecorator(FreeFormConnection c, IRelation rel) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getOwner());
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, JPAEditorConstants.CARDINALITY_ZERO_ONE, 0.0);
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, JPAEditorConstants.CARDINALITY_ZERO_N, 1.0);
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getOwnerAttributeName(), 0.0);
- }
-
- private void addManyToOneTextDecorator(FreeFormConnection c, RelDir direction, IRelation rel) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getOwner());
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, JPAEditorConstants.CARDINALITY_ZERO_N, 0.0);
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getOwnerAttributeName(), 0.0);
- JavaPersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName());
- JavaAttributeMapping mapping = owner.getMapping();
- ManyToOneAnnotation a = (ManyToOneAnnotation)mapping.getMappingAnnotation();
- if (a == null)
- return;
- Boolean optional = a.getOptional();
- boolean isOptional = (optional == null) ? true : optional.booleanValue();
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, isOptional ?
- JPAEditorConstants.CARDINALITY_ZERO_ONE :
- JPAEditorConstants.CARDINALITY_ONE, 1.0);
- if (!UNI.equals(direction)) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getInverse());
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getInverseAttributeName(), 1.0);
- }
- }
-
- private void addManyToManyTextDecorator(FreeFormConnection c, RelDir direction, IRelation rel) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getOwner());
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, JPAEditorConstants.CARDINALITY_ZERO_N, 0.0);
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, JPAEditorConstants.CARDINALITY_ZERO_N, 1.0);
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getOwnerAttributeName(), 0.0);
- if (!UNI.equals(direction)) {
- JpaArtifactFactory.instance().refreshEntityModel(null, rel.getInverse());
- imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getInverseAttributeName(), 1.0);
- }
- }
-
-
-
-
-
-
- public boolean canAdd(IAddContext context) {
- if (context instanceof IAddConnectionContext && context.getNewObject() instanceof IRelation) {
- return true;
- }
- return false;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-}
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java
deleted file mode 100644
index c8779ccdda..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-
-
-public class ClickAddAttributeButtonFeature extends AbstractCreateFeature {
-
- public ClickAddAttributeButtonFeature(IFeatureProvider provider) {
- super(provider, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public boolean canExecute(IContext context) {
- return true;
- }
-
- public boolean canUndo(IContext context) {
- return false;
- }
-
- public boolean canCreate(ICreateContext context) {
- return true;
- }
-
- public Object[] create(ICreateContext context) {
- ContainerShape entityShape = context.getTargetContainer();
- JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(entityShape);
- String newAttrName = JpaArtifactFactory.instance().createNewAttribute(jpt, false, getFeatureProvider());
- JpaArtifactFactory.instance().refreshEntityModel(getFeatureProvider(), jpt);
- JavaPersistentAttribute newAttr = jpt.getAttributeNamed(newAttrName);
- int cnt = 0;
- while ((newAttr == null) && (cnt < 25)) {
- newAttr = jpt.getAttributeNamed(newAttrName);
- if (newAttr == null) {
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Thread sleep interrupted", e); //$NON-NLS-1$
- }
- }
- cnt++;
- }
- getFeatureProvider().addAddIgnore((JavaPersistentType)newAttr.getParent(), newAttr.getName());
- addGraphicalRepresentation(context, newAttr);
- getFeatureProvider().getDirectEditingInfo().setActive(true);
-
- IWorkbenchSite ws = ((IEditorPart)getDiagramEditor()).getSite();
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit(jpt);
- getFeatureProvider().getJPAEditorUtil().formatCode(cu, ws);
-
- return new Object[] {newAttr};
- }
-
- public boolean isAvailable(IContext context) {
- return true;
- }
-
- public String getName() {
- return JPAEditorMessages.ClickAddAttributeButtonFeature_createAttributeButtonLabel;
- }
-
- public String getDescription() {
- return JPAEditorMessages.ClickAddAttributeButtonFeature_createAttributeButtonDescription;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java
deleted file mode 100644
index 5f117af542..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.text.MessageFormat;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.internal.features.context.impl.base.PictogramElementContext;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-
-@SuppressWarnings("restriction")
-public class ClickRemoveAttributeButtonFeature extends DefaultDeleteFeature {
-
- private String attrName = ""; //$NON-NLS-1$
-
- public ClickRemoveAttributeButtonFeature(IFeatureProvider provider) {
- super(provider);
- }
-
- protected String getQuestionToUser() {
- return MessageFormat.format(JPAEditorMessages.ClickRemoveAttributeButtonFeature_deleteAttributeQuestion, new Object[] {attrName});
- }
-
-
- public boolean canUndo(IContext context) {
- return false;
- }
-
- private String getAttrName(ContainerShape textShape) {
- String txt = ((Text)(textShape.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0))).getValue();
- String attrName = txt.substring(txt.indexOf(':') + 1);
- attrName = attrName.trim();
- return attrName;
- }
-
- private void deleteAttribute(ContainerShape pe, String attrName) {
- JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(pe.getContainer().getContainer());
- JpaArtifactFactory.instance().deleteAttribute(jpt, attrName, getFeatureProvider());
- }
-
- public void delete(IDeleteContext context) {
- delete(context, true);
- }
-
- @Override
- public void preDelete(IDeleteContext context) {
- super.preDelete(context);
- }
-
- public void delete(IDeleteContext context, boolean haveToAsk) {
- PictogramElementContext ctx = (PictogramElementContext)context;
- ContainerShape textShape = (ContainerShape)ctx.getPictogramElement();
- if ((textShape == null) || textShape.getGraphicsAlgorithm() == null)
- return;
- String attrName = getAttrName(textShape);
- this.attrName = attrName;
- if (haveToAsk) {
- if (!getUserDecision(context)) {
- return;
- }
- }
-
- preDelete(context);
- if (textShape.getGraphicsAlgorithm() == null){
- return;
- }
- deleteAttribute(textShape, attrName);
- }
-
-
- protected void deleteBusinessObjects(Object[] businessObjects) {
- if (businessObjects != null) {
- for (Object bo : businessObjects) {
- deleteBusinessObject(bo);
- }
- }
- }
-
- public boolean isAvailable(IContext context) {
- return true;
- }
-
- public String getName() {
- return JPAEditorMessages.ClickRemoveAttributeButtonFeature_createAttributeButtonlabel;
- }
-
- public String getDescription() {
- return JPAEditorMessages.ClickRemoveAttributeButtonFeature_createAttributeButtonDescription;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseAllEntitiesFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseAllEntitiesFeature.java
deleted file mode 100644
index 15bbd93ea9..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseAllEntitiesFeature.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class CollapseAllEntitiesFeature extends AbstractCustomFeature implements ICustomFeature{
-
- public CollapseAllEntitiesFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- Diagram diagram = getFeatureProvider().getDiagramTypeProvider().getDiagram();
- final EList<Shape> entShapes = diagram.getChildren();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(diagram);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- for (final PictogramElement el : entShapes) {
- String collapseFeatures = Graphiti.getPeService().getPropertyValue(el, JPAEditorConstants.COLLAPSE_FEATURES);
- if (collapseFeatures == null) {
- GraphicsAlgorithm algo = el.getGraphicsAlgorithm();
- algo.setHeight(JPAEditorConstants.ENTITY_MIN_HEIGHT);
- Graphiti.getPeService().setPropertyValue(el, JPAEditorConstants.COLLAPSE_FEATURES, String.valueOf(JPAEditorConstants.ENTITY_MIN_HEIGHT));
- JPAEditorUtil.rearrangeAllConnections((ContainerShape) el, getFeatureProvider(), false);
- }
- }
- }
- });
-
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @Override
- public boolean isAvailable(IContext context) {
- return true;
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseAllEntitiesMenuItem;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseCompartmentShapeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseCompartmentShapeFeature.java
deleted file mode 100644
index c0fb9c44d8..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseCompartmentShapeFeature.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class CollapseCompartmentShapeFeature extends AbstractCustomFeature{
-
- public CollapseCompartmentShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- PictogramElement el = context.getPictogramElements()[0];
-
- final ContainerShape containerShape = (ContainerShape) el;
- final ContainerShape entityShape = containerShape.getContainer();
-
- final GraphicsAlgorithm algo = el.getGraphicsAlgorithm();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(algo);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- algo.setHeight(JPAEditorConstants.COMPARTMENT_MIN_HEIGHT);
- GraphicsUpdater.updateEntityShape(entityShape);
- GraphicsUpdater.setCollapsed(containerShape, true);
- JPAEditorUtil.rearrangeAllConnections(entityShape, getFeatureProvider(), false);
- }
- });
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @Override
- public boolean isAvailable(IContext context) {
- boolean ret = false;
- if (context instanceof ICustomContext) {
- PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
- if (pes != null && pes.length > 0) {
- boolean collapsePossible = false;
- for (int i = 0; i < pes.length; i++) {
- PictogramElement pe = pes[i];
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (bo != null) {
- return false;
- }
- if (!collapsePossible) {
- if(!GraphicsUpdater.isCollapsed((ContainerShape)pe)) {
- collapsePossible = true;
- }
- }
- }
- if (collapsePossible) {
- return true;
- }
- }
- }
- return ret;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseEntityFeature.java
deleted file mode 100644
index ac695dde29..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CollapseEntityFeature.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class CollapseEntityFeature extends AbstractCustomFeature implements ICustomFeature{
-
- public CollapseEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- final PictogramElement el = context.getPictogramElements()[0];
-
- final GraphicsAlgorithm algo = el.getGraphicsAlgorithm();
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(algo);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- algo.setHeight(JPAEditorConstants.ENTITY_MIN_HEIGHT);
- Graphiti.getPeService().setPropertyValue(el, JPAEditorConstants.COLLAPSE_FEATURES, String.valueOf(JPAEditorConstants.ENTITY_MIN_HEIGHT));
- JPAEditorUtil.rearrangeAllConnections((ContainerShape) el, getFeatureProvider(), false);
- }
- });
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @Override
- public boolean isAvailable(IContext context) {
- boolean ret = false;
- if (context instanceof ICustomContext) {
- PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
- if (pes != null && pes.length > 0) {
- boolean collapsePossible = false;
- for (int i = 0; i < pes.length; i++) {
- PictogramElement pe = pes[i];
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (!(bo instanceof JavaPersistentType)) {
- return false;
- }
- if (!collapsePossible) {
- Property property = Graphiti.getPeService().getProperty(pe, JPAEditorConstants.COLLAPSE_FEATURES);
- if (property == null) {
- collapsePossible = true;
- }
- }
- }
- if (collapsePossible) {
- return true;
- }
- }
- }
- return ret;
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseEntityMenuItem;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFeature.java
deleted file mode 100644
index 284219f0f5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFeature.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-
-
-public class CreateJPAEntityFeature extends AbstractCreateFeature {
-
- private IPreferenceStore jpaPreferenceStore = JPADiagramEditorPlugin.getDefault().getPreferenceStore();
- private boolean isMappedSuperclassChild;
- private String mappedSuperclassName;
- private String mappedSuperclassPackage;
- private boolean hasPrimarykey;
-
-
- public CreateJPAEntityFeature(IFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateJPAEntityFeature_jpaEntityFeatureName, JPAEditorMessages.CreateJPAEntityFeature_jpaEntityFeatureDescription);
- }
-
- public CreateJPAEntityFeature(IFeatureProvider fp,
- boolean isMappedSuperclassChild, String mappedSuperclassName,
- String mappedSuperClassPackage) {
- this(fp, isMappedSuperclassChild, mappedSuperclassName,
- mappedSuperClassPackage, false);
- }
-
- public CreateJPAEntityFeature(IFeatureProvider fp,
- boolean isMappedSuperclassChild, String mappedSuperclassName) {
- this(fp, isMappedSuperclassChild, mappedSuperclassName, null, false);
- }
-
- public CreateJPAEntityFeature(IFeatureProvider fp,
- boolean isMappedSuperclassChild, String mappedSuperclassName,
- String mappedSuperClassPackage, boolean hasPrimaryKey) {
- this(fp);
- this.isMappedSuperclassChild = isMappedSuperclassChild;
- this.mappedSuperclassName = mappedSuperclassName;
- this.mappedSuperclassPackage = mappedSuperClassPackage;
- this.hasPrimarykey = hasPrimaryKey;
- }
-
-
- public boolean canCreate(ICreateContext context) {
- return context.getTargetContainer() instanceof Diagram;
- }
-
- @SuppressWarnings("restriction")
- public Object[] create(ICreateContext context) {
- List<Shape> shapes = this.getFeatureProvider().getDiagramTypeProvider().getDiagram().getChildren();
- IProject targetProject = null;
- JpaProject jpaProject = null;
- if ((shapes == null) || (shapes.size() == 0)) {
- jpaProject = getTargetJPAProject();
- targetProject = jpaProject.getProject();
- } else {
- Shape sh = shapes.get(0);
- JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(sh);
- if (jpt == null)
- return new Object[] {};
- jpaProject = jpt.getJpaProject();
- targetProject = jpaProject.getProject();
- }
- String entityName = getFeatureProvider().getJPAEditorUtil().
- generateUniqueEntityName(jpaProject,
- JPADiagramPropertyPage.getDefaultPackage(jpaProject.getProject()),
- getFeatureProvider());
-
- if(!JPAEditorUtil.checkIsSetPersistenceProviderLibrary(jpaProject)){
- Shell shell = JPADiagramEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- IStatus status = new Status(IStatus.ERROR, JPADiagramEditor.ID, JPAEditorMessages.CreateJPAEntityFeature_createEntityErrorStatusMsg);
- ErrorDialog.openError(shell, JPAEditorMessages.CreateJPAEntityFeature_createEntityErrorMsgTitle,
- JPAEditorMessages.CreateJPAEntityFeature_createEntityErrorMsg, status);
- return new Object[] {};
- }
-
- if (!JptJpaCorePlugin.discoverAnnotatedClasses(targetProject)) {
- JPAEditorUtil.createRegisterEntityInXMLJob(jpaProject, entityName);
- }
-
- try {
- this.getFeatureProvider().getJPAEditorUtil().createEntityInProject(targetProject, entityName, jpaPreferenceStore, isMappedSuperclassChild, mappedSuperclassName, mappedSuperclassPackage, hasPrimarykey);
- } catch (Exception e1) {
- JPADiagramEditorPlugin.logError("Cannot create an entity in the project " + targetProject.getName(), e1); //$NON-NLS-1$
- }
-
-
- try {
- jpaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- } catch (CoreException e1) {
- JPADiagramEditorPlugin.logError("Cannot refresh the project", e1); //$NON-NLS-1$
- }
-
- ListIterator<PersistenceUnit> lit = jpaProject.getRootContextNode().getPersistenceXml().getPersistence().getPersistenceUnits().iterator();
- PersistenceUnit pu = lit.next();
- JavaPersistentType jpt = (JavaPersistentType)pu.getPersistentType(entityName);
-
- int cnt = 0;
- while ((jpt == null) && (cnt < 25)) {
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Thread sleep interrupted", e); //$NON-NLS-1$
- }
- jpt = (JavaPersistentType)pu.getPersistentType(entityName);
- cnt++;
- }
-
- if (jpt != null) {
- addGraphicalRepresentation(context, jpt);
- IWorkbenchSite ws = ((IEditorPart)getDiagramEditor()).getSite();
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit(jpt);
- getFeatureProvider().getJPAEditorUtil().formatCode(cu, ws);
- return new Object[] { jpt };
- } else {
- JPADiagramEditorPlugin.logError("The JPA entity " + entityName + " could not be created", new Exception()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return new Object[] {};
- }
-
- @Override
- public String getCreateImageId() {
- return JPAEditorImageProvider.ADD_JPA_ENTITY;
- }
-
- @Override
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- private JpaProject getTargetJPAProject() {
- return getFeatureProvider().getMoinIntegrationUtil().getProjectByDiagram(getDiagram());
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFromMappedSuperclassFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFromMappedSuperclassFeature.java
deleted file mode 100644
index 620654b971..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateJPAEntityFromMappedSuperclassFeature.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-
-public class CreateJPAEntityFromMappedSuperclassFeature extends
- AbstractCreateFeature {
- private IPreferenceStore jpaPreferenceStore = JPADiagramEditorPlugin
- .getDefault().getPreferenceStore();
-
- public CreateJPAEntityFromMappedSuperclassFeature(IFeatureProvider fp) {
- super(
- fp,
- JPAEditorMessages.CreateJPAEntityFromMappedSuperclassFeature_createInheritedEntityFeatureName,
- JPAEditorMessages.CreateJPAEntityFromMappedSuperclassFeature_createInheritedEntityFeatureDescription);
- }
-
- public boolean canCreate(ICreateContext context) {
- return context.getTargetContainer() instanceof Diagram;
- }
-
- public Object[] create(ICreateContext context) {
- List<Shape> shapes = this.getFeatureProvider().getDiagramTypeProvider()
- .getDiagram().getChildren();
- IProject targetProject = null;
- JpaProject jpaProject = null;
- if ((shapes == null) || (shapes.size() == 0)) {
- jpaProject = getTargetJPAProject();
- targetProject = jpaProject.getProject();
- } else {
- Shape sh = shapes.get(0);
- JavaPersistentType jpt = (JavaPersistentType) getFeatureProvider()
- .getBusinessObjectForPictogramElement(sh);
- if (jpt == null)
- return new Object[] {};
- jpaProject = jpt.getJpaProject();
- targetProject = jpaProject.getProject();
- }
-
- String mappedSuperclassName = getFeatureProvider()
- .getJPAEditorUtil()
- .generateUniqueMappedSuperclassName(
- jpaProject,
- JPADiagramPropertyPage.getDefaultPackage(jpaProject.getProject()),
- getFeatureProvider());
-
- if (!JptJpaCorePlugin.discoverAnnotatedClasses(jpaProject.getProject())) {
- JPAEditorUtil.createRegisterEntityInXMLJob(jpaProject, mappedSuperclassName);
- }
-
-
- try {
- this.getFeatureProvider()
- .getJPAEditorUtil()
- .createEntityFromMappedSuperclassInProject(targetProject,
- mappedSuperclassName, jpaPreferenceStore);
- } catch (Exception e1) {
- JPADiagramEditorPlugin.logError("Cannot create an entity in the project " + targetProject.getName(), e1); //$NON-NLS-1$
- }
-
- CreateJPAEntityFeature createEntityFeature = new CreateJPAEntityFeature(
- getFeatureProvider(), true, mappedSuperclassName);
- return createEntityFeature.create(context);
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ADD_INHERITED_ENTITY;
- }
-
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- private JpaProject getTargetJPAProject() {
- return getFeatureProvider().getMoinIntegrationUtil()
- .getProjectByDiagram(getDiagram());
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyBiDirRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyBiDirRelationFeature.java
deleted file mode 100644
index 6e44389998..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyBiDirRelationFeature.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class CreateManyToManyBiDirRelationFeature extends
- CreateManyToManyRelationFeature {
-
- public CreateManyToManyBiDirRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateManyToManyBiDirRelationFeature_manyToManyBiDirFeatureName,
- JPAEditorMessages.CreateManyToManyBiDirRelationFeature_manyToManyUniDirFeatureDescription);
- }
-
- @Override
- public ManyToManyBiDirRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source, PictogramElement target) {
- JavaPersistentType owner = (JavaPersistentType)(getBusinessObjectForPictogramElement(source));
- JavaPersistentType inverse = (JavaPersistentType)(getBusinessObjectForPictogramElement(target));
-
- String ownerAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = ownerAttributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner))
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(ownerAttributeName);
- String ownerAttributeText = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
-
- String inverseAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(owner));
- String nameWithNonCapitalLetter2 = inverseAttributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(inverse))
- nameWithNonCapitalLetter2 = JPAEditorUtil.produceValidAttributeName(inverseAttributeName);
- String inverseAttributeText = JPAEditorUtil.produceUniqueAttributeName(inverse, ownerAttributeText, nameWithNonCapitalLetter2);
-
- ManyToManyBiDirRelation rel = new ManyToManyBiDirRelation(fp, owner, inverse, ownerAttributeText, inverseAttributeText, true,
- getFeatureProvider().getCompilationUnit(owner),
- getFeatureProvider().getCompilationUnit(inverse));
- return rel;
-
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ICON_MANY_TO_MANY_2_DIR;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyRelationFeature.java
deleted file mode 100644
index 79d040fb7b..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyRelationFeature.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-
-
-abstract class CreateManyToManyRelationFeature
- extends CreateRelationFeature {
-
- public CreateManyToManyRelationFeature(IJPAEditorFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyUniDirRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyUniDirRelationFeature.java
deleted file mode 100644
index 1e58fd51f1..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToManyUniDirRelationFeature.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class CreateManyToManyUniDirRelationFeature extends
- CreateManyToManyRelationFeature {
-
- public CreateManyToManyUniDirRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateManyToManyUniDirRelationFeature_manyToManyUniDirFeatureName,
- JPAEditorMessages.CreateManyToManyUniDirRelationFeature_manyToManyUniDirFeatureDescription);
- }
-
- @Override
- public ManyToManyUniDirRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source, PictogramElement target) {
- JavaPersistentType owner = (JavaPersistentType)(getBusinessObjectForPictogramElement(source));
- JavaPersistentType inverse = (JavaPersistentType)(getBusinessObjectForPictogramElement(target));
-
- String attributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = attributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner))
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(attributeName);
- String attributeText = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- ManyToManyUniDirRelation relation = new ManyToManyUniDirRelation(fp, owner, inverse, attributeText, true,
- getFeatureProvider().getCompilationUnit(owner),
- getFeatureProvider().getCompilationUnit(inverse));
- return relation;
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ICON_MANY_TO_MANY_1_DIR;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneBiDirRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneBiDirRelationFeature.java
deleted file mode 100644
index ceeb529747..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneBiDirRelationFeature.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class CreateManyToOneBiDirRelationFeature extends
- CreateManyToOneRelationFeature {
-
- public CreateManyToOneBiDirRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateManyToOneBiDirRelationFeature_manyToOneBiDirFeatureName,
- JPAEditorMessages.CreateManyToOneBiDirRelationFeature_manyToOneBiDirFeatureDescription);
- }
-
- @Override
- public ManyToOneBiDirRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source,
- PictogramElement target) {
- JavaPersistentType owner = (JavaPersistentType)(getBusinessObjectForPictogramElement(source));
- JavaPersistentType inverse = (JavaPersistentType)(getBusinessObjectForPictogramElement(target));
-
- String ownerAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = ownerAttributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner))
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(ownerAttributeName);
- String ownerAttributeText = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
-
- String inverseAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(owner));
- String nameWithNonCapitalLetter2 = inverseAttributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(inverse))
- nameWithNonCapitalLetter2 = JPAEditorUtil.produceValidAttributeName(inverseAttributeName);
- String inverseAttributeText = JPAEditorUtil.produceUniqueAttributeName(inverse, ownerAttributeText, nameWithNonCapitalLetter2);
-
- ManyToOneBiDirRelation rel = new ManyToOneBiDirRelation(fp, owner, inverse, ownerAttributeText, inverseAttributeText, true,
- getFeatureProvider().getCompilationUnit(owner),
- getFeatureProvider().getCompilationUnit(inverse));
- return rel;
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ICON_MANY_TO_ONE_2_DIR;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneRelationFeature.java
deleted file mode 100644
index 1f1c9eca1c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneRelationFeature.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-
-abstract class CreateManyToOneRelationFeature
- extends CreateRelationFeature {
-
- public CreateManyToOneRelationFeature(IJPAEditorFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneUniDirRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneUniDirRelationFeature.java
deleted file mode 100644
index fafc150fd4..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateManyToOneUniDirRelationFeature.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class CreateManyToOneUniDirRelationFeature extends
- CreateManyToOneRelationFeature {
-
- public CreateManyToOneUniDirRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateManyToOneUniDirRelationFeature_manyToOneUniDirFeatureName,
- JPAEditorMessages.CreateManyToOneUniDirRelationFeature_manyToOneUniDirFeatureDescription);
- }
-
- @Override
- public ManyToOneUniDirRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source, PictogramElement target) {
- JavaPersistentType owner = (JavaPersistentType)(getBusinessObjectForPictogramElement(source));
- JavaPersistentType inverse = (JavaPersistentType)(getBusinessObjectForPictogramElement(target));
-
- String attributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = attributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner))
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(attributeName);
- String attributeText = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- ManyToOneUniDirRelation relation = new ManyToOneUniDirRelation(fp, owner, inverse, attributeText, true,
- getFeatureProvider().getCompilationUnit(owner),
- getFeatureProvider().getCompilationUnit(inverse));
- return relation;
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ICON_MANY_TO_ONE_1_DIR;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyRelationFeature.java
deleted file mode 100644
index c3ec2d1aac..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyRelationFeature.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-
-abstract class CreateOneToManyRelationFeature
- extends CreateRelationFeature {
-
- public CreateOneToManyRelationFeature(IJPAEditorFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyUniDirRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyUniDirRelationFeature.java
deleted file mode 100644
index 2eb3367f5a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToManyUniDirRelationFeature.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class CreateOneToManyUniDirRelationFeature extends
- CreateOneToManyRelationFeature {
-
- public CreateOneToManyUniDirRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateOneToManyUniDirRelationFeature_oneToManyUniDirFeatureName,
- JPAEditorMessages.CreateOneToManyUniDirRelationFeature_oneToManyUniDirFeatureDescription);
- }
-
- @Override
- public OneToManyUniDirRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source,
- PictogramElement target) {
- JavaPersistentType owner = (JavaPersistentType)(getBusinessObjectForPictogramElement(source));
- JavaPersistentType inverse = (JavaPersistentType)(getBusinessObjectForPictogramElement(target));
-
- String attributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = attributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner))
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(attributeName);
-
- String attributeText = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- OneToManyUniDirRelation relation = new OneToManyUniDirRelation(fp, owner, inverse, attributeText, true,
- getFeatureProvider().getCompilationUnit(owner),
- getFeatureProvider().getCompilationUnit(inverse));
- return relation;
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ICON_ONE_TO_MANY_1_DIR;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneBiDirRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneBiDirRelationFeature.java
deleted file mode 100644
index 3a65a5dbcf..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneBiDirRelationFeature.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class CreateOneToOneBiDirRelationFeature extends CreateOneToOneRelationFeature {
-
- public CreateOneToOneBiDirRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateOneToOneBiDirRelationFeature_oneToOneBiDirFeatureName,
- JPAEditorMessages.CreateOneToOneBiDirRelationFeature_oneToOneBiDirFeatureDescription);
- }
-
- @Override
- public OneToOneBiDirRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source,
- PictogramElement target) {
- JavaPersistentType owner = (JavaPersistentType)(getBusinessObjectForPictogramElement(source));
- JavaPersistentType inverse = (JavaPersistentType)(getBusinessObjectForPictogramElement(target));
-
- String ownerAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = ownerAttributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner))
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(ownerAttributeName);
- String ownerAttributeText = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
-
- String inverseAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(owner));
- String nameWithNonCapitalLetter2 = inverseAttributeName;
- if (JpaArtifactFactory.instance().isMethodAnnotated(inverse))
- nameWithNonCapitalLetter2 = JPAEditorUtil.produceValidAttributeName(inverseAttributeName);
- String inverseAttributeText = JPAEditorUtil.produceUniqueAttributeName(inverse, ownerAttributeText, nameWithNonCapitalLetter2);
-
- OneToOneBiDirRelation rel = new OneToOneBiDirRelation(fp, owner, inverse, ownerAttributeText, inverseAttributeText, true,
- getFeatureProvider().getCompilationUnit(owner),
- getFeatureProvider().getCompilationUnit(inverse));
- return rel;
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ICON_ONE_TO_ONE_2_DIR;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneRelationFeature.java
deleted file mode 100644
index f4b9fea728..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneRelationFeature.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-
-abstract class CreateOneToOneRelationFeature
- extends CreateRelationFeature {
-
- public CreateOneToOneRelationFeature(IJPAEditorFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneUniDirRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneUniDirRelationFeature.java
deleted file mode 100644
index dae132dc57..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateOneToOneUniDirRelationFeature.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-
-public class CreateOneToOneUniDirRelationFeature extends CreateOneToOneRelationFeature {
-
- public CreateOneToOneUniDirRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp, JPAEditorMessages.CreateOneToOneUniDirRelationFeature_oneToOneUniDirFeatureName,
- JPAEditorMessages.CreateOneToOneUniDirRelationFeature_oneToOneUniDirFeatureDescription);
- }
-
- @Override
- public OneToOneUniDirRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source,
- PictogramElement target) {
-
- JavaPersistentType owner = (JavaPersistentType)(getBusinessObjectForPictogramElement(source));
- JavaPersistentType inverse = (JavaPersistentType)(getBusinessObjectForPictogramElement(target));
-
- String name = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = name;
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner))
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- String attribTxt = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- OneToOneUniDirRelation res = new OneToOneUniDirRelation(fp, owner, inverse, attribTxt, true,
- getFeatureProvider().getCompilationUnit(owner),
- getFeatureProvider().getCompilationUnit(inverse));
- return res;
- }
-
- public String getCreateImageId() {
- return JPAEditorImageProvider.ICON_ONE_TO_ONE_1_DIR;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateRelationFeature.java
deleted file mode 100644
index 752b5bc4c6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateRelationFeature.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.context.ICreateConnectionContext;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.features.impl.AbstractCreateConnectionFeature;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-
-
-abstract public class CreateRelationFeature extends AbstractCreateConnectionFeature {
-
- public CreateRelationFeature(IJPAEditorFeatureProvider fp, String name, String description) {
- super(fp, name, description);
- }
-
- public boolean canCreate(ICreateConnectionContext context) {
- JavaPersistentType source = (JavaPersistentType)getPersistentType(context.getSourceAnchor());
- JavaPersistentType target = (JavaPersistentType)getPersistentType(context.getTargetAnchor());
- if (source != null && target != null) {
- return true;
- }
- return false;
- }
-
- public boolean canStartConnection(ICreateConnectionContext context) {
- if (getPersistentType(context.getSourceAnchor()) != null)
- return true;
- return false;
- }
-
- public Connection create(ICreateConnectionContext context) {
- Connection newConnection = null;
- PersistentType source = getPersistentType(context.getSourceAnchor());
- PersistentType target = getPersistentType(context.getTargetAnchor());
- if (source != null && target != null) {
- AbstractRelation rel = createRelation(getFeatureProvider(), context.getSourceAnchor().getParent(),
- context.getTargetAnchor().getParent());
- AddConnectionContext addContext =
- new AddConnectionContext(context.getSourceAnchor(), context
- .getTargetAnchor());
- addContext.setNewObject(rel);
- newConnection =
- (Connection) getFeatureProvider().addIfPossible(addContext);
- }
- return newConnection;
- }
-
- /**
- * Returns the PersistentType class belonging to the anchor, or null if not available.
- */
- protected PersistentType getPersistentType(Anchor anchor) {
- if (anchor != null) {
- Object refObject =
- getBusinessObjectForPictogramElement(anchor.getParent());
- if (refObject instanceof PersistentType) {
- return (PersistentType) refObject;
- }
- }
- return null;
- }
-
-
- /**
- * Creates a new OneToOneRelation between two PersistentType classes.
- */
- abstract protected AbstractRelation createRelation(IJPAEditorFeatureProvider fp, PictogramElement source,
- PictogramElement target);
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteJPAEntityFeature.java
deleted file mode 100644
index 7b81077a2b..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteJPAEntityFeature.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.text.MessageFormat;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.context.IMultiDeleteInfo;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.ui.PlatformUI;
-
-
-public class DeleteJPAEntityFeature extends DefaultDeleteFeature {
-
- private String entityClassName = null;
- private String entityName = null;
- public DeleteJPAEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void delete(final IDeleteContext context) {
- PictogramElement pe = context.getPictogramElement();
-
- JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- entityClassName = jpt.getName();
- entityName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(jpt));
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(pe);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- deleteEl(context);
- }
- });
-
- }
-
- public void deleteEl(IDeleteContext context){
- super.delete(context);
- }
-
- protected void deleteBusinessObject(Object bo) {
- JavaPersistentType jpt = null;
- if (bo instanceof JavaPersistentType) {
- jpt = (JavaPersistentType) bo;
-
-
- JpaProject jpaProject = jpt.getJpaProject();
- String name = jpt.getName();
-
-
- JpaArtifactFactory.instance().forceSaveEntityClass(jpt, getFeatureProvider());
- JpaArtifactFactory.instance().deleteEntityClass(jpt, getFeatureProvider());
- if (!JptJpaCorePlugin.discoverAnnotatedClasses(jpt.getJpaProject().getProject())) {
- JPAEditorUtil.createUnregisterEntityFromXMLJob(jpaProject, name);
- }
-
- }
- }
-
- public String getQuestionToUser() {
- return MessageFormat.format(JPAEditorMessages.DeleteJPAEntityFeature_deleteJPAEntityQuestion, entityName, entityClassName);
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- protected boolean getUserDecision(IDeleteContext context) {
- String msg = ""; //$NON-NLS-1$
- IMultiDeleteInfo multiDeleteInfo = context.getMultiDeleteInfo();
- if (multiDeleteInfo != null) {
- msg = JPAEditorMessages.DeleteJPAEntityFeature_deleteJPAEntitiesQuestion;
- } else {
- if (entityClassName != null && entityClassName.length() > 0) {
- msg = MessageFormat.format(JPAEditorMessages.DeleteJPAEntityFeature_deleteJPAEntityQuestion, entityName, entityClassName);
- }
- }
- return MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- JPAEditorMessages.DeleteFeature_deleteConfirm, msg);
- }
-
-
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java
deleted file mode 100644
index 89e18ce7a1..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.context.impl.DeleteContext;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.BidirectionalRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.UnidirectionalRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-
-
-public class DeleteRelationFeature extends DefaultDeleteFeature{
-
- private static IJPAEditorUtil ut = null;
-
- public DeleteRelationFeature(IJPAEditorFeatureProvider fp) {
- super(fp);
- ut = fp.getJPAEditorUtil();
- }
-
- public boolean canDelete(IDeleteContext context) {
- return true;
- }
-
- public boolean isAvailable(IContext context) {
- return true;
- }
-
- public boolean canExecute(IContext context) {
- return true;
- }
-
- protected String getQuestionToUser() {
- return JPAEditorMessages.DeleteRelationFeature_deleteRelationQuestion;
- }
-
- public void delete(IDeleteContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object businessObjectForPictogramElement = getBusinessObjectForPictogramElement(pe);
- if (businessObjectForPictogramElement != null) {
- if (!getUserDecision(context)) {
- return;
- }
- }
-
- preDelete(context);
- AbstractRelation rel = (AbstractRelation)businessObjectForPictogramElement;
-
- if (rel instanceof UnidirectionalRelation) {
- UnidirectionalRelation relation = (UnidirectionalRelation)rel;
- ClickRemoveAttributeButtonFeature feat = new ClickRemoveAttributeButtonFeature(getFeatureProvider());
- JavaPersistentAttribute attribute = relation.getAnnotatedAttribute();
- PictogramElement textShape = getFeatureProvider().getPictogramElementForBusinessObject(attribute);
- IDeleteContext delCtx = new DeleteContext(textShape);
- feat.delete(delCtx, false);
- }
-
- if (rel instanceof BidirectionalRelation) {
- BidirectionalRelation relation = (BidirectionalRelation)(rel);
- ClickRemoveAttributeButtonFeature feat = new ClickRemoveAttributeButtonFeature(getFeatureProvider());
-
- JavaPersistentAttribute ownerAttribute = relation.getOwnerAnnotatedAttribute();
- PictogramElement ownerAttributeTextShape = getFeatureProvider().getPictogramElementForBusinessObject(ownerAttribute);
- IDeleteContext deleteOwnerAttributeContext = new DeleteContext(ownerAttributeTextShape);
- feat.delete(deleteOwnerAttributeContext, false);
-
- JavaPersistentAttribute inverseAttribute = relation.getInverseAnnotatedAttribute();
- PictogramElement inverseAttributeTextShape = getFeatureProvider().getPictogramElementForBusinessObject(inverseAttribute);
- IDeleteContext deleteInverseAttributeContext = new DeleteContext(inverseAttributeTextShape);
- feat.delete(deleteInverseAttributeContext, false);
- }
-
- postDelete(context);
-
- /*
- IRemoveContext rc = new RemoveContext(pe);
- IFeatureProvider featureProvider = getFeatureProvider();
- IRemoveFeature removeFeature = featureProvider.getRemoveFeature(rc);
- if (removeFeature != null) {
- removeFeature.remove(rc);
- }
- */
-
-
- }
-
- public void postDelete(IDeleteContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object businessObjectForPictogramElement = getBusinessObjectForPictogramElement(pe);
- IRelation rel = (IRelation)businessObjectForPictogramElement;
- IWorkbenchSite ws = ((IEditorPart)getDiagramEditor()).getSite();
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit(rel.getOwner());
- ut.organizeImports(cu, ws);
- if (rel instanceof BidirectionalRelation) {
- cu = getFeatureProvider().getCompilationUnit(rel.getInverse());
- ut.organizeImports(cu, ws);
- }
- }
-
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- protected boolean getUserDecision(IDeleteContext context) {
- return MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- JPAEditorMessages.DeleteFeature_deleteConfirm, JPAEditorMessages.DeleteRelationFeature_deleteRelationQuestion);
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java
deleted file mode 100644
index bd0b3850a5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.BidirectionalRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class DirectEditAttributeFeature extends AbstractDirectEditingFeature {
-
- private boolean isMethodAnnotated = false;
-
- public DirectEditAttributeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public int getEditingType() {
- return TYPE_TEXT;
- }
-
- @Override
- public boolean canDirectEdit(IDirectEditingContext context) {
- return true;
- }
-
- public String getInitialValue(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)getFeatureProvider().
- getBusinessObjectForPictogramElement(pe);
- isMethodAnnotated = JpaArtifactFactory.instance().isMethodAnnotated(jpa);
- Text txt = (Text) pe.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0);
- String value = txt.getValue();
- if (isMethodAnnotated)
- value = JPAEditorUtil.produceValidAttributeName(value);
- return value;
- }
-
- @Override
- public String checkValueValid(String value, IDirectEditingContext context) {
- if (isMethodAnnotated)
- value = JPAEditorUtil.produceValidAttributeName(value);
- IStatus status = JavaConventions.validateFieldName(value, JavaCore.VERSION_1_5, JavaCore.VERSION_1_5);
- if (!status.isOK())
- return status.getMessage();
- status = checkDuplicateAttribute(value, context);
- if (!status.isOK())
- return status.getMessage();
- return null;
- }
-
- private IStatus checkDuplicateAttribute(String value, IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- JavaPersistentAttribute oldAt = (JavaPersistentAttribute) getBusinessObjectForPictogramElement(pe);
- JavaPersistentAttribute newAl = (JavaPersistentAttribute)((JavaPersistentType)oldAt.getParent()).getAttributeNamed(value);
- if (newAl != null && !newAl.equals(oldAt)) {
- String message = MessageFormat.format(JPAEditorMessages.DirectEditAttributeFeature_attributeExists, value);
- return new Status(IStatus.ERROR, JPADiagramEditorPlugin.PLUGIN_ID, message);
- }
- return Status.OK_STATUS;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- public void setValue(String value, IDirectEditingContext context) {
- if (isMethodAnnotated)
- value = JPAEditorUtil.produceValidAttributeName(value);
- PictogramElement pe = context.getPictogramElement();
- JavaPersistentAttribute oldAt = (JavaPersistentAttribute) getBusinessObjectForPictogramElement(pe);
-
- IRelation rel = getFeatureProvider().getRelationRelatedToAttribute(oldAt);
- String inverseJPTName = null;
- if (BidirectionalRelation.class.isInstance(rel))
- inverseJPTName = rel.getInverse().getName();
- if (oldAt.getName().equals(value))
- return;
- try {
- JpaArtifactFactory.instance().renameAttribute(oldAt, value, inverseJPTName, getFeatureProvider());
- } catch (InterruptedException e) {
- return;
- }
-
- if (pe.getGraphicsAlgorithm() == null)
- return;
- final GraphicsAlgorithm alg = pe.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0);
- final String newValue = value;
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(alg);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- ((Text) alg).setValue(newValue);
- }
- });
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java
deleted file mode 100644
index cd6e455357..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.text.MessageFormat;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.impl.AbstractDirectEditingFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-
-public class DirectEditJPAEntityFeature extends AbstractDirectEditingFeature {
-
- private static String allowed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_"; //$NON-NLS-1$
-
- public DirectEditJPAEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public int getEditingType() {
- return TYPE_TEXT;
- }
-
- @Override
- public boolean canDirectEdit(IDirectEditingContext context) {
- return true;
- }
-
- public String getInitialValue(IDirectEditingContext context) {
- Shape sh = (Shape)context.getPictogramElement();
- ContainerShape csh = sh.getContainer();
- JavaPersistentType jpt = (JavaPersistentType)getBusinessObjectForPictogramElement(csh);
- return JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(jpt));
- }
-
- @Override
- public String checkValueValid(String value, IDirectEditingContext context) {
- //CSN #1305664 2010
- PictogramElement pe = context.getPictogramElement();
- ContainerShape csh = ((Shape)pe).getContainer();
- JavaPersistentType jpt = (JavaPersistentType) getFeatureProvider().getBusinessObjectForPictogramElement(csh);
- String packageName = Signature.getQualifier(jpt.getName());
- PersistenceUnit unit = jpt.getPersistenceUnit();
-
- for(ClassRef classRef : unit.getClassRefs()) {
- if(classRef.getClassName().equals(packageName + Signature.C_DOT + value) && !(JPAEditorUtil.getText(jpt).equals(value))){
- return MessageFormat.format(JPAEditorMessages.DirectEditJPAEntityFeature_duplicateEntityName, packageName+value);
-
- }
- }
-
- if (value.length() < 1)
- return JPAEditorMessages.DirectEditJPAEntityFeature_classNameMsg;
- if (value.contains(" ")) //$NON-NLS-1$
- return JPAEditorMessages.DirectEditJPAEntityFeature_scpacesNotAllowedMsg;
- if (value.contains("\n")) //$NON-NLS-1$
- return JPAEditorMessages.DirectEditJPAEntityFeature_lineBreaksNotAllowedMsg;
- if(value.contains("{") || value.contains("}")) //$NON-NLS-1$ //$NON-NLS-2$
- return JPAEditorMessages.DirectEditJPAEntityFeature_bracesNotAllowedMsg;
- for (int i = 0; i < value.length(); i++) {
- if (allowed.indexOf(value.charAt(i)) < 0)
- return MessageFormat.format(JPAEditorMessages.DirectEditJPAEntityFeature_invalidSymbolsMsg, value);
- }
- return null;
- }
-
- @Override
- public void setValue(final String value, IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- ContainerShape csh = ((Shape)pe).getContainer();
- JavaPersistentType jpt = (JavaPersistentType)getBusinessObjectForPictogramElement(csh);
- Properties props = JPADiagramPropertyPage.loadProperties(jpt.getJpaProject().getProject());
-
- String specifiedEntityMappingName = JpaArtifactFactory.instance().getSpecifiedEntityName(jpt);
- if(specifiedEntityMappingName == null){
- RenameEntityWithoutUIFeature ft = new RenameEntityWithoutUIFeature(getFeatureProvider(), value);
- ft.execute(jpt);
- return;
- } else {
-
- JpaArtifactFactory.instance().renameEntity(jpt, value);
-// Properties props = JPADiagramPropertyPage.loadProperties(jpt.getJpaProject().getProject());
- if (JPADiagramPropertyPage.doesDirecteEditingAffectClassNameByDefault(jpt.getJpaProject().getProject(), props)) {
- RenameEntityWithoutUIFeature ft = new RenameEntityWithoutUIFeature(getFeatureProvider(), value);
- ft.execute(jpt);
- return;
- }
- }
-
- final GraphicsAlgorithm alg = pe.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0);
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(alg);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- ((Text) alg).setValue(value);
- }
- });
-
- Set<JavaPersistentAttribute> ats = JpaArtifactFactory.instance().getRelatedAttributes(jpt);
- Iterator<JavaPersistentAttribute> it = ats.iterator();
- while (it.hasNext()) {
- JavaPersistentAttribute at = it.next();
- PictogramElement pel = getFeatureProvider().getPictogramElementForBusinessObject(at);
- String newAtName = JPAEditorUtil.decapitalizeFirstLetter(value);
- if (JpaArtifactFactory.instance().isMethodAnnotated(at))
- newAtName = JPAEditorUtil.produceValidAttributeName(newAtName);
- try {
- newAtName = JpaArtifactFactory.instance().renameAttribute(at, newAtName, jpt.getName(), getFeatureProvider()).getName();
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError(e);
- }
-
- final GraphicsAlgorithm algo = pel.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0);
- final String attName = newAtName;
- TransactionalEditingDomain tedit = TransactionUtil.getEditingDomain(algo);
- tedit.getCommandStack().execute(new RecordingCommand(tedit) {
- @Override
- protected void doExecute() {
- ((Text) algo).setValue(attName);
- }
- });
- }
- }
-
- @Override
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DiscardAndRemoveAllEntitiesFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DiscardAndRemoveAllEntitiesFeature.java
deleted file mode 100644
index 90b7b10085..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DiscardAndRemoveAllEntitiesFeature.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Iterator;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.swt.widgets.Display;
-
-
-public class DiscardAndRemoveAllEntitiesFeature extends RemoveAllEntitiesFeature {
-
- public DiscardAndRemoveAllEntitiesFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public String getConfirmationText() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndDiscardAllEntitiesConfirmation;
- }
-
- public void execute(ICustomContext context) {
- MessageDialog dlg = new MessageDialog(Display.getCurrent().getShells()[0],
- JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAllEntitiesMenu,
- null, getConfirmationText(), 0,
- new String[] {JPAEditorMessages.BTN_OK, JPAEditorMessages.BTN_CANCEL}, Dialog.CANCEL);
- if (dlg.open() != Dialog.OK)
- return;
- Iterator<Shape> it = this.getDiagram().getChildren().iterator();
- while (it.hasNext()) {
- Shape sh = it.next();
- RestoreEntityFeature ft = new RestoreEntityFeature(getFeatureProvider());
- ICustomContext ctx = new CustomContext(new PictogramElement[] { sh });
- ft.execute(ctx);
- allShapes.add(sh);
- }
- super.execute(context);
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.DiscardAndRemoveAllEntitiesFeature_ContextMenuOperationDescription;
-
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandAllEntitiesFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandAllEntitiesFeature.java
deleted file mode 100644
index b801b68e6c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandAllEntitiesFeature.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class ExpandAllEntitiesFeature extends AbstractCustomFeature{
-
- public ExpandAllEntitiesFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- final Diagram diagram = getFeatureProvider().getDiagramTypeProvider().getDiagram();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(diagram);
-
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- EList<Shape> shapes = diagram.getChildren();
- for (PictogramElement el : shapes) {
- String collapseFeatures = Graphiti.getPeService().getPropertyValue(el, JPAEditorConstants.COLLAPSE_FEATURES);
- if (collapseFeatures != null) {
- Object bo = getBusinessObjectForPictogramElement(el);
- if(bo instanceof JavaPersistentType){
- ContainerShape containerShape = (ContainerShape) el;
- GraphicsUpdater.updateEntityShape(containerShape);
- GraphicsUpdater.updateEntityHeigth(containerShape);
- Graphiti.getPeService().removeProperty(el, JPAEditorConstants.COLLAPSE_FEATURES);
- JPAEditorUtil.rearrangeAllConnections(containerShape, getFeatureProvider(), false);
- }
- }
- }
- }
- });
-
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- @Override
- public boolean isAvailable(IContext context) {
- return true;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_expandAllEntitiesMenuItem;
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandCompartmentShapeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandCompartmentShapeFeature.java
deleted file mode 100644
index e27e43029a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandCompartmentShapeFeature.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class ExpandCompartmentShapeFeature extends AbstractCustomFeature{
-
- public ExpandCompartmentShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- PictogramElement el = context.getPictogramElements()[0];
-
- Object ob = getFeatureProvider().getBusinessObjectForPictogramElement(el);
- int pictogramHeight = JPAEditorConstants.COMPARTMENT_MIN_HEIGHT;
- int newHeight = JPAEditorConstants.COMPARTMENT_BUTTOM_OFFSET;
- final ContainerShape containerShape = (ContainerShape) el;
- if(ob == null)
- newHeight = GraphicsUpdater.increaseCompartmentHeigth(containerShape, newHeight);
- final int pictHeight = pictogramHeight + newHeight;
- final GraphicsAlgorithm algo = el.getGraphicsAlgorithm();
- final ContainerShape entityShape = containerShape.getContainer();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(algo);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- algo.setHeight(pictHeight);
- int height = GraphicsUpdater.getPrimaryShape(entityShape).getGraphicsAlgorithm().getHeight() +
- GraphicsUpdater.getRelationShape(entityShape).getGraphicsAlgorithm().getHeight() +
- GraphicsUpdater.getBasicShape(entityShape).getGraphicsAlgorithm().getHeight() + JPAEditorConstants.ENTITY_MIN_HEIGHT;
-
- if(height>entityShape.getGraphicsAlgorithm().getHeight()){
- ICustomContext cont = new CustomContext(new PictogramElement[] {entityShape});
- ICustomFeature expandEntity = new ExpandEntityFeature(getFeatureProvider());
- expandEntity.execute(cont);
- }
- GraphicsUpdater.updateEntityShape(entityShape);
- GraphicsUpdater.setCollapsed(containerShape, false);
- JPAEditorUtil.rearrangeAllConnections(entityShape, getFeatureProvider(), false);
- }
- });
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
-
- @Override
- public boolean isAvailable(IContext context) {
- boolean ret = false;
- if (context instanceof ICustomContext) {
- PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
- if (pes != null && pes.length > 0) {
- boolean expandPossible = false;
- for (int i = 0; i < pes.length; i++) {
- PictogramElement pe = pes[i];
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (bo != null) {
- expandPossible = false;
- return false;
- }
- if (!expandPossible) {
- if (GraphicsUpdater.isCollapsed((ContainerShape)pe)) {
- expandPossible = true;
- }
- }
- }
- if (expandPossible) {
- return true;
- }
- }
- }
-
- return ret;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandEntityFeature.java
deleted file mode 100644
index 8c52d27ee6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ExpandEntityFeature.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class ExpandEntityFeature extends AbstractCustomFeature{
-
- public ExpandEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- final PictogramElement el = context.getPictogramElements()[0];
-
- Object bo = getBusinessObjectForPictogramElement(el);
- if(bo instanceof JavaPersistentType){
- final ContainerShape containerShape = (ContainerShape) el;
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(containerShape);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
-
- GraphicsUpdater.updateEntityShape(containerShape);
- GraphicsUpdater.updateEntityHeigth(containerShape);
- Graphiti.getPeService().removeProperty(el, JPAEditorConstants.COLLAPSE_FEATURES);
-
- JPAEditorUtil.rearrangeAllConnections(containerShape, getFeatureProvider(), false);
- }
- });
- }
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- @Override
- public boolean isAvailable(IContext context) {
- boolean ret = false;
- if (context instanceof ICustomContext) {
- PictogramElement[] pes = ((ICustomContext) context).getPictogramElements();
- if (pes != null && pes.length > 0) {
- boolean expandPossible = false;
- for (int i = 0; i < pes.length; i++) {
- PictogramElement pe = pes[i];
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (!(bo instanceof JavaPersistentType)) {
- return false;
- }
- if (!expandPossible) {
- Property property = Graphiti.getPeService().getProperty(pe, JPAEditorConstants.COLLAPSE_FEATURES);
- if (property != null) {
- expandPossible = true;
- }
- }
- }
- if (expandPossible) {
- return true;
- }
- }
- }
-
- return ret;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_expandEntityMenuItem;
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java
deleted file mode 100644
index 755d3e88ff..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.HashSet;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.Wrp;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants.ShapeType;
-
-
-public class GraphicalAddAttributeFeature extends AbstractAddShapeFeature {
-
- public GraphicalAddAttributeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public PictogramElement add(final IAddContext context) {
- final ContainerShape entityShape = context.getTargetContainer();
- final Wrp wrp = new Wrp();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(entityShape);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- JavaPersistentAttribute newAttr = (JavaPersistentAttribute) context.getNewObject();
- String txt = JPAEditorUtil.getText(newAttr);
- HashSet<String> annots = JpaArtifactFactory.instance().getAnnotationNames(newAttr);
- ContainerShape textShape = null;
- ContainerShape primaryShape = GraphicsUpdater.getPrimaryShape(entityShape);
- ContainerShape relationShape = GraphicsUpdater.getRelationShape(entityShape);
- ContainerShape basicShape = GraphicsUpdater.getBasicShape(entityShape);
- textShape = addAttributeToProperlyShape(entityShape, txt, annots, primaryShape, relationShape, basicShape);
- link(textShape, newAttr);
- layoutPictogramElement(entityShape);
- wrp.setObj(textShape);
- }
-
- });
- return (PictogramElement)wrp.getObj();
- }
-
- private ContainerShape addAttributeToProperlyShape(ContainerShape entityShape, String txt, HashSet<String> annots,
- ContainerShape primaryShape, ContainerShape relationShape, ContainerShape basicShape) {
- ContainerShape textShape = null;
- if (annots.contains(JPAEditorConstants.ANNOTATION_ID) || annots.contains(JPAEditorConstants.ANNOTATION_EMBEDDED_ID)) {
- textShape = addAttributeToShape(entityShape, txt, annots, primaryShape);
- } else if (annots.contains(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)
- || annots.contains(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)
- || annots.contains(JPAEditorConstants.ANNOTATION_ONE_TO_MANY)
- || annots.contains(JPAEditorConstants.ANNOTATION_ONE_TO_ONE)) {
- textShape = addAttributeToShape(entityShape, txt, annots, relationShape);
- } else {
- textShape = addAttributeToShape(entityShape, txt, annots, basicShape);
- }
- return textShape;
- }
-
- private ContainerShape addAttributeToShape(ContainerShape entityShape, String txt, HashSet<String> annots,
- ContainerShape containerShape) {
- ContainerShape textShape = null;
- int childrenSizeBefore = containerShape.getChildren().size();
- int containerHeightBefore = containerShape.getGraphicsAlgorithm().getHeight();
- textShape = addAttribute(getFeatureProvider(), containerShape, txt, annots);
-
- GraphicsUpdater.updateContainer(containerShape, childrenSizeBefore, containerHeightBefore);
- GraphicsUpdater.updateEntityShape(entityShape);
-
- return textShape;
- }
-
- private static ContainerShape addAttribute(IJPAEditorFeatureProvider fp, ContainerShape containerShape,
- String attribTxt, HashSet<String> annotations) {
-
- int width = containerShape.getContainer().getGraphicsAlgorithm().getWidth();
- ContainerShape iconShape = Graphiti.getPeService().createContainerShape(containerShape, false);
- Graphiti.getPeService().setPropertyValue(iconShape, JPAEditorConstants.PROP_SHAPE_TYPE, ShapeType.ICON.toString());
- int attribIndex = fp.getAttribsNum(containerShape);
- Rectangle iconRect = UpdateAttributeFeature.addRectangleForIcon(iconShape, attribIndex);
- Image icon = null;
- Object ob = fp.getBusinessObjectForPictogramElement(containerShape.getContainer());
- JavaPersistentType jpt = (JavaPersistentType)ob;
- boolean isMethodAnnotated = JpaArtifactFactory.instance().isMethodAnnotated(jpt);
- boolean isCollection = isMethodAnnotated ?
- JpaArtifactFactory.instance().isGetterMethodReturnTypeCollection(containerShape.getContainer(), fp, attribTxt) :
- JpaArtifactFactory.instance().isCollection(containerShape.getContainer(), fp, attribTxt);
- if (isCollection && annotations.isEmpty()) {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_UNMAPPED);
- } else{
- icon = JPAEditorUtil.createAttributeIcon(iconRect, annotations);
- }
- Graphiti.getGaService().setLocationAndSize(icon, JPAEditorConstants.ICON_X, JPAEditorConstants.ICON_Y,
- JPAEditorConstants.ICON_WIDTH, JPAEditorConstants.ICON_HEIGHT);
- ContainerShape textShape = Graphiti.getPeService().createContainerShape(containerShape, false);
- Graphiti.getPeService().setPropertyValue(textShape, JPAEditorConstants.PROP_SHAPE_TYPE, ShapeType.ATTRIBUTE.toString());
- Rectangle textRectangle = UpdateAttributeFeature.addRectangleForText(textShape, attribIndex, width);
- textShape.setActive(true);
- Text text = UpdateAttributeFeature.addText(fp, textRectangle, attribTxt);
- Graphiti.getGaService().setWidth(text, width - JPAEditorConstants.ATTRIBUTE_TEXT_RECT_WIDTH_REDUCER);
- Graphiti.getGaService().setLocationAndSize(text, 1, -2, width
- - JPAEditorConstants.ATTRIBUTE_TEXT_RECT_WIDTH_REDUCER, JPAEditorConstants.ATTRIBUTE_RECT_HEIGHT);
- fp.increaseAttribsNum(containerShape);
- return textShape;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- public boolean canAdd(IAddContext context) {
- return false;
- }
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java
deleted file mode 100644
index c8d8cdffb8..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-class GraphicalRemoveAttributeFeature extends AbstractCustomFeature {
-
- public GraphicalRemoveAttributeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- final PictogramElement pe = context.getInnerPictogramElement();
- if (pe == null)
- return;
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(pe);
- if (ted == null)
- return;
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- Shape sh = (Shape) pe;
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(sh);
- if ((bo == null) || (!JavaPersistentType.class.isInstance(bo)))
- return;
- ContainerShape entityShape = (ContainerShape) pe;
- ContainerShape primShape = GraphicsUpdater.getPrimaryShape(entityShape);
- ContainerShape relationShape = GraphicsUpdater.getRelationShape(entityShape);
- ContainerShape basicShape = GraphicsUpdater.getBasicShape(entityShape);
-
- removeCompartmentChildren(primShape);
- removeCompartmentChildren(relationShape);
- removeCompartmentChildren(basicShape);
-
- readdCompartmentsChildren((JavaPersistentType) bo, entityShape, primShape, relationShape, basicShape);
-
- layoutPictogramElement(entityShape);
- reconnect((JavaPersistentType) bo);
- }
- });
-
- }
-
- public void reconnect(JavaPersistentType jpt) {
- IJPAEditorFeatureProvider fp = getFeatureProvider();
- Collection<IRelation> rels = JpaArtifactFactory.instance().produceAllRelations(jpt, fp);
- JpaArtifactFactory.instance().refreshEntityModel(fp, jpt);
- Iterator<IRelation> it = rels.iterator();
- while (it.hasNext()) {
- IRelation rel = it.next();
- AddRelationFeature relF = new AddRelationFeature(fp);
- AnchorContainer acSource = (AnchorContainer) fp.getPictogramElementForBusinessObject(rel.getOwner());
- AnchorContainer acTarget = (AnchorContainer) fp.getPictogramElementForBusinessObject(rel.getInverse());
- AddConnectionContext ctx = new AddConnectionContext(acSource.getAnchors().iterator().next(), acTarget
- .getAnchors().iterator().next());
- ctx.setNewObject(rel);
- relF.add(ctx);
-// JpaArtifactFactory.instance().refreshEntityModel(fp, jpt);
- }
- }
-
- @SuppressWarnings("deprecation")
- private void readdCompartmentsChildren(JavaPersistentType javaPersistentType, ContainerShape entityShape,
- ContainerShape primaryShape, ContainerShape relationShape, ContainerShape basicShape) {
-
- UpdateAttributeFeature updateFeature = new UpdateAttributeFeature(getFeatureProvider());
- updateFeature.addSeparatorsToShape(primaryShape);
- updateFeature.addSeparatorsToShape(relationShape);
- updateFeature.addSeparatorsToShape(basicShape);
-
- for (JavaPersistentAttribute attribute : javaPersistentType.getAttributes()) {
- updateFeature.addAttributes(entityShape, attribute);
-
- getFeatureProvider().renewAttributeJoiningStrategyPropertyListener(attribute);
- getFeatureProvider().addJPTForUpdate(javaPersistentType.getName());
- }
- }
-
- private void removeCompartmentChildren(ContainerShape compartmentShape) {
- int y = 0;
- List<Shape> children = compartmentShape.getChildren();
- for (int i = 0; i < new ArrayList<Shape>(compartmentShape.getChildren()).size(); i++) {
- Shape shape = compartmentShape.getChildren().get(i);
- y = shape.getGraphicsAlgorithm().getY();
- Graphiti.getPeService().deletePictogramElement(shape);
- }
- for (int i = getFeatureProvider().getAttribsNum(compartmentShape); i > 0; i--) {
- Shape shape = compartmentShape.getChildren().get(i);
- y = shape.getGraphicsAlgorithm().getY();
- Graphiti.getPeService().deletePictogramElement(shape);
- getFeatureProvider().decreaseAttribsNum(compartmentShape);
- }
- children = compartmentShape.getChildren();
- shiftUpLowerAttribs(y, children);
- compartmentShape.getGraphicsAlgorithm().setHeight(0);
- }
-
- @Override
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- private void shiftUpLowerAttribs(int y, List<Shape> children) {
- for (int i = 0; i < children.size(); i++) {
- Shape shp = children.get(i);
- if (shp != null) {
- int grY = children.get(i).getGraphicsAlgorithm().getY();
- if (grY > y) {
- children.get(i).getGraphicsAlgorithm().setY(grY - JPAEditorConstants.ATTRIBUTES_PLACEMENT_STEP);
- }
- children.get(i).setVisible(false);
- Graphiti.getPeService().deletePictogramElement(children.get(i));
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/JPAMoveConnectionDecoratorFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/JPAMoveConnectionDecoratorFeature.java
deleted file mode 100644
index 2180e95041..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/JPAMoveConnectionDecoratorFeature.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IMoveConnectionDecoratorContext;
-import org.eclipse.graphiti.features.impl.DefaultMoveConnectionDecoratorFeature;
-
-public class JPAMoveConnectionDecoratorFeature extends
- DefaultMoveConnectionDecoratorFeature {
-
- public JPAMoveConnectionDecoratorFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canExecute(IContext context) {
- return false;
- }
-
- @Override
- public boolean canMoveConnectionDecorator(
- IMoveConnectionDecoratorContext context) {
- return false;
- }
-
- @Override
- public boolean isAvailable(IContext context) {
- return false;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/LayoutJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/LayoutJPAEntityFeature.java
deleted file mode 100644
index b9eae4f056..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/LayoutJPAEntityFeature.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.graphiti.datatypes.IDimension;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.features.impl.AbstractLayoutFeature;
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.Point;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IGraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IPeServiceUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-
-
-public class LayoutJPAEntityFeature extends AbstractLayoutFeature {
-
- private IPeServiceUtil peUtil = null;
-
- public LayoutJPAEntityFeature(IJPAEditorFeatureProvider fp) {
- super(fp);
- peUtil = fp.getPeUtil();
- }
-
- public boolean canLayout(ILayoutContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- return (bo instanceof JavaPersistentType);
- }
-
- public boolean layout(ILayoutContext context) {
- boolean anythingChanged = false;
- ContainerShape containerShape = (ContainerShape) context
- .getPictogramElement();
- GraphicsAlgorithm containerGa = containerShape.getGraphicsAlgorithm();
-
- if(containerGa.getHeight() < JPAEditorConstants.ENTITY_MIN_HEIGHT){
- containerGa.setHeight(JPAEditorConstants.ENTITY_MIN_HEIGHT);
- }
-
- configureEntityCollapseExpandProperty(containerShape, containerGa);
-
- if (containerGa.getWidth() < JPAEditorConstants.ENTITY_MIN_WIDTH) {
- containerGa.setWidth(JPAEditorConstants.ENTITY_MIN_WIDTH);
- anythingChanged = true;
- }
- int containerWidth = containerGa.getWidth();
- Iterator<Shape> iter = containerShape.getChildren().iterator();
- while (iter.hasNext()) {
- Shape shape = iter.next();
- anythingChanged = layoutContainerEntityChildren(anythingChanged,
- containerWidth, shape);
-
- }
- Property property = peUtil.getProperty(containerShape, JPAEditorConstants.COLLAPSE_FEATURES);
- if (property == null) {
- IGraphicsUpdater gu = getFeatureProvider().getGraphicsUpdater();
- gu.updateEntityHeigth(containerShape);
- }
-
- return anythingChanged;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- private void configureEntityCollapseExpandProperty(
- ContainerShape containerShape, GraphicsAlgorithm containerGa) {
- if(containerGa.getHeight() == JPAEditorConstants.ENTITY_MIN_HEIGHT){
- peUtil.setPropertyValue(containerShape, JPAEditorConstants.COLLAPSE_FEATURES, String.valueOf(JPAEditorConstants.ENTITY_MIN_HEIGHT));
- }
- else if(containerGa.getHeight()>JPAEditorConstants.ENTITY_MIN_HEIGHT){
- peUtil.removeProperty(containerShape, JPAEditorConstants.COLLAPSE_FEATURES);
- }
- }
-
- private boolean layoutContainerEntityChildren(boolean anythingChanged,
- int containerWidth, Shape shape) {
- GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm();
- IDimension size = Graphiti.getGaService().calculateSize(graphicsAlgorithm);
- if (containerWidth != size.getWidth()) {
- if (graphicsAlgorithm instanceof Polyline) {
- anythingChanged = layoutPolyline(containerWidth,
- graphicsAlgorithm);
- } else if (graphicsAlgorithm instanceof Rectangle) {
-
- Rectangle rect = (Rectangle) graphicsAlgorithm;
- List<GraphicsAlgorithm> gra = rect.getGraphicsAlgorithmChildren();
- Iterator<GraphicsAlgorithm> it = gra.iterator();
- while (it.hasNext()) {
- GraphicsAlgorithm gr = it.next();
- if (gr instanceof Image){
- layoutHeaderIcon(shape, graphicsAlgorithm);
- }
- else if (gr instanceof Text) {
- Text txt = (Text) gr;
- if(!txt.getFont().isItalic()){
- layoutHeaderText(containerWidth, graphicsAlgorithm, gr);
- }else{
- layoutAttributesGroups(anythingChanged, gr, containerWidth);
- }
- }
- }
- anythingChanged = true;
- }
- }
- return anythingChanged;
- }
-
- private void layoutHeaderText(int containerWidth,
- GraphicsAlgorithm graphicsAlgorithm, GraphicsAlgorithm gr) {
- Graphiti.getGaService().setWidth(graphicsAlgorithm,
- containerWidth - JPAEditorConstants.HEADER_TEXT_RECT_WIDTH_REDUCER);
- Graphiti.getGaService().setWidth(gr, containerWidth - JPAEditorConstants.HEADER_TEXT_RECT_WIDTH_REDUCER);
- }
-
- private void layoutHeaderIcon(Shape shape,
- GraphicsAlgorithm graphicsAlgorithm) {
- GraphicsAlgorithm headerIconGraphicsAlg = shape
- .getGraphicsAlgorithm();
- Graphiti.getGaService().setWidth(graphicsAlgorithm, JPAEditorConstants.HEADER_ICON_RECT_WIDTH);
- Graphiti.getGaService().setWidth(headerIconGraphicsAlg, JPAEditorConstants.HEADER_ICON_RECT_HEIGHT);
- }
-
- private boolean layoutPolyline(int containerWidth,
- GraphicsAlgorithm graphicsAlgorithm) {
- boolean anythingChanged;
- Polyline headerBottomLine = (Polyline) graphicsAlgorithm;
- Point secondPoint = headerBottomLine.getPoints().get(1);
- Point newSecondPoint = Graphiti.getGaService().createPoint(/* headerBottomLine, */
- containerWidth, secondPoint.getY());
- headerBottomLine.getPoints().set(1, newSecondPoint);
- anythingChanged = true;
- return anythingChanged;
- }
-
- private void layoutAttributesGroups(boolean anythingChanged, GraphicsAlgorithm graphicsAlgorithm,
- int containerWidth) {
- ContainerShape containerShape = (ContainerShape) Graphiti.getPeService().getActiveContainerPe(graphicsAlgorithm);
- layoutConcreteCompartmentShape(anythingChanged, containerShape, containerWidth);
- }
-
- private void layoutConcreteCompartmentShape(boolean anythingChanged, ContainerShape containerShape,
- int containerWidth) {
-
- layoutCompartmentShape(containerShape, containerWidth);
-
- Iterator<Shape> iter = containerShape.getChildren().iterator();
- while(iter.hasNext()) {
- Shape shape = iter.next();
- GraphicsAlgorithm graphicsAlgorithm = shape.getGraphicsAlgorithm();
- if (graphicsAlgorithm instanceof Rectangle) {
- Rectangle rect = (Rectangle) graphicsAlgorithm;
- List<GraphicsAlgorithm> gra = rect.getGraphicsAlgorithmChildren();
- if(gra.isEmpty()){
- Graphiti.getGaService().setWidth(graphicsAlgorithm, containerWidth);
- }
- Iterator<GraphicsAlgorithm> it = gra.iterator();
- while (it.hasNext()) {
- GraphicsAlgorithm gr = it.next();
- if (gr instanceof Image) {
- layoutAttributeIcon(shape, graphicsAlgorithm);
- }
- if (gr instanceof Text) {
- layoutAttributeText(containerWidth, graphicsAlgorithm, gr);
- }
- }
- anythingChanged = true;
- }
- }
- }
-
- private void layoutAttributeText(int containerWidth,
- GraphicsAlgorithm graphicsAlgorithm, GraphicsAlgorithm gr) {
- Graphiti.getGaService().setWidth(graphicsAlgorithm,
- containerWidth - JPAEditorConstants.ATTRIBUTE_TEXT_RECT_WIDTH_REDUCER);
- Graphiti.getGaService().setWidth(gr,
- containerWidth - JPAEditorConstants.ATTRIBUTE_TEXT_RECT_WIDTH_REDUCER);
- }
-
- private void layoutAttributeIcon(Shape shape,
- GraphicsAlgorithm graphicsAlgorithm) {
- GraphicsAlgorithm headerIconGraphicsAlg = shape.getGraphicsAlgorithm();
- Graphiti.getGaService().setWidth(graphicsAlgorithm,JPAEditorConstants.ICON_RECT_WIDTH);
- Graphiti.getGaService().setWidth(headerIconGraphicsAlg, JPAEditorConstants.ICON_RECT_WIDTH);
- }
-
- private void layoutCompartmentShape(ContainerShape containerShape,
- int containerWidth) {
- GraphicsAlgorithm graphic = containerShape.getGraphicsAlgorithm();
- List<GraphicsAlgorithm> graphics = graphic.getGraphicsAlgorithmChildren();
- Iterator<GraphicsAlgorithm> iterator = graphics.iterator();
- while (iterator.hasNext()) {
- GraphicsAlgorithm graphicsAlgorithm = iterator.next();
- Graphiti.getGaService().setWidth(graphic, containerWidth);
- Graphiti.getGaService().setWidth(graphicsAlgorithm, containerWidth);
- }
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveAttributeFeature.java
deleted file mode 100644
index fd9e639f1a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveAttributeFeature.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
-
-/*
- * The attribute shapes (residing within the entity shapes)
- * are NOT supposed to be moveable (at least - not by
- * drag-and-drop). The only purpose of this class is to
- * disable this ability
- *
- */
-
-public class MoveAttributeFeature extends DefaultMoveShapeFeature {
- public MoveAttributeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public boolean canMoveShape(IMoveShapeContext context) {
- return false;
- }
-
-
- public boolean canExecute(IContext context) {
- return false;
- }
-
-
- public boolean isAvailable(IContext context) {
- return false;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityFeature.java
deleted file mode 100644
index 9fbf3ca1e5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityFeature.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgMoveAction;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-
-@SuppressWarnings("restriction")
-public class MoveEntityFeature extends RefactorEntityFeature {
-
- public MoveEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit(jpt);
- IWorkbenchSite ws = ((IEditorPart)getDiagramEditor()).getSite();
- ReorgMoveAction action = new ReorgMoveAction(ws);
- execute(context, action, cu);
- }
-
-
- @Override
- public String getName() {
- return JPAEditorMessages.MoveEntityFeature_ContextMenuOperationDescription;
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityShapeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityShapeFeature.java
deleted file mode 100644
index 4d167a7bc4..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/MoveEntityShapeFeature.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultMoveShapeFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class MoveEntityShapeFeature extends DefaultMoveShapeFeature {
-
- public MoveEntityShapeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- protected void moveAllBendpoints(IMoveShapeContext context) {
- }
-
- protected void postMoveShape(IMoveShapeContext context) {
- ContainerShape cs = (ContainerShape)context.getShape();
- JPAEditorUtil.rearrangeAllConnections(cs, getFeatureProvider(), false);
- Collection<ContainerShape> css = JPAEditorUtil.getRelatedShapes(cs);
- Iterator<ContainerShape> csIt = css.iterator();
- while (csIt.hasNext()) {
- ContainerShape cs1 = csIt.next();
- JPAEditorUtil.rearrangeAllConnections(cs1, getFeatureProvider(), true);
- }
- }
-
- @Override
- protected void internalMove(final IMoveShapeContext context) {
- PictogramElement el = context.getPictogramElement();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(el);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- move(context);
- }
- });
- }
-
- public void move(IMoveShapeContext context){
- super.internalMove(context);
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenJPADetailsViewFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenJPADetailsViewFeature.java
deleted file mode 100644
index e6f881c9c6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenJPADetailsViewFeature.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-
-public class OpenJPADetailsViewFeature extends AbstractCustomFeature {
-
- public OpenJPADetailsViewFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public void execute(ICustomContext context) {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().
- showView(JPAEditorConstants.ID_VIEW_JPA_DETAILS);
- } catch (PartInitException e) {
- JPADiagramEditorPlugin.logError("Can't open JPA Details view", e); //$NON-NLS-1$
- }
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_openJPADetailsView;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenMiniatureViewFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenMiniatureViewFeature.java
deleted file mode 100644
index bcd7856b51..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/OpenMiniatureViewFeature.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-
-public class OpenMiniatureViewFeature extends AbstractCustomFeature {
-
- public OpenMiniatureViewFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public void execute(ICustomContext context) {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().
- showView(JPAEditorConstants.ID_VIEW_MINIATURE);
- } catch (PartInitException e) {
- JPADiagramEditorPlugin.logError("Can't open Miniature view", e); //$NON-NLS-1$
- }
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_openMiniatureView;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java
deleted file mode 100644
index c5c4387291..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.text.MessageFormat;
-import java.util.List;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.dialog.SelectTypeDialog;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-
-
-public class RefactorAttributeTypeFeature extends AbstractCustomFeature {
-
- //private static final TracerI tracer = TracingManager.getTracer(RefactorAttributeTypeFeature.class);
-
- public RefactorAttributeTypeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
-
- public void execute(ICustomContext context) {
- PictogramElement pe = context.getPictogramElements()[0];
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- if ((bo == null) || (!(bo instanceof JavaPersistentAttribute)))
- return;
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)bo;
- String typeName = JPAEditorUtil.getAttributeTypeNameWithGenerics(jpa);
- String msg = MessageFormat.format(JPAEditorMessages.SelectTypeDialog_chooseAttributeTypeDialogText,
- jpa.getName(), JPAEditorUtil.returnSimpleName(((PersistentType)jpa.getParent()).getName()));
- SelectTypeDialog d = new SelectTypeDialog(msg, typeName);
- if (d.open() != IDialogConstants.OK_ID)
- return;
- String newTypeName = d.getTypeName();
- String[] attributeTypeTypeNames = JPAEditorUtil.getGenericsElementTypes(newTypeName);
- if (attributeTypeTypeNames != null)
- newTypeName = newTypeName.substring(0, newTypeName.indexOf('<')).trim();
-
- getFeatureProvider().addAddIgnore((JavaPersistentType)jpa.getParent(), jpa.getName());
- JavaResourceAttribute jra = jpa.getResourceAttribute();
- getFeatureProvider().addRemoveIgnore((JavaPersistentType)jpa.getParent(), jra.getName());
- boolean isMethodAnnotated = jra.getKind() == Kind.METHOD;
-
- List<String> annotations = JpaArtifactFactory.instance().getAnnotationStrings(jpa);
- JpaArtifactFactory.instance().deleteAttribute((JavaPersistentType)jpa.getParent(), jpa.getName(),
- getFeatureProvider());
- JavaPersistentAttribute newAt = JpaArtifactFactory.instance().createANewAttribute((JavaPersistentType)jpa.getParent(),
- jpa.getName(), newTypeName, attributeTypeTypeNames, jpa.getName(), annotations,
- false, isMethodAnnotated, getFeatureProvider());
- getFeatureProvider().replaceAttribute(jpa, newAt);
- IWorkbenchSite ws = ((IEditorPart)getDiagramEditor()).getSite();
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit((JavaPersistentType)newAt.getParent());
- getFeatureProvider().getJPAEditorUtil().formatCode(cu, ws);
- JpaArtifactFactory.instance().remakeRelations(getFeatureProvider(),
- ((Shape)pe).getContainer(), (JavaPersistentType)newAt.getParent());
- }
-
- @Override
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.RefactorAttributeTypeFeature_ContextMenuOperationDescription;
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java
deleted file mode 100644
index ea7ca502ac..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.AddEntityContext;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPASolver;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-
-
-public abstract class RefactorEntityFeature extends AbstractCustomFeature {
-
- protected JavaPersistentType jpt = null;
- protected Set<JavaPersistentAttribute> ats = null;
- protected boolean hasNameAnnotation = false;
-
- public RefactorEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean isAvailable(IContext context) {
- if (!(context instanceof ICustomContext))
- return false;
- ICustomContext ctx = (ICustomContext)context;
- PictogramElement pe = ctx.getInnerPictogramElement();
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- if (bo instanceof JavaPersistentType) {
- jpt = (JavaPersistentType)bo;
- hasNameAnnotation = JpaArtifactFactory.instance().hasNameAnnotation(jpt);
- return true;
- }
- if (pe instanceof Shape) {
- ContainerShape cs = ((Shape)pe).getContainer();
- if (cs == null)
- return false;
- bo = getFeatureProvider().getBusinessObjectForPictogramElement(cs);
- if (bo instanceof JavaPersistentType) {
- jpt = (JavaPersistentType)bo;
- hasNameAnnotation = JpaArtifactFactory.instance().hasNameAnnotation(jpt);
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public void execute(ICustomContext context, SelectionDispatchAction action, ICompilationUnit cu) {
- StructuredSelection sel = new StructuredSelection(cu);
- final Shape pict = (Shape)getFeatureProvider().getPictogramElementForBusinessObject(jpt);
- JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().
- getBusinessObjectForPictogramElement(pict);
- final PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpt);
- final Semaphore s = new Semaphore(0);
- final JPAProjectListener lsnr = new JPAProjectListener(s);
- jpt.getJpaProject().addCollectionChangeListener(JpaProject.JPA_FILES_COLLECTION, lsnr);
- ShowBusy showBusy = new ShowBusy(s);
- JPASolver.ignoreEvents = true;
- final String oldName = jpt.getName();
-
- try {
- action.run(sel);
- } catch (Exception e) {}
- BusyIndicator.showWhile(Display.getCurrent(), showBusy);
- jpt.getJpaProject().removeCollectionChangeListener(JpaProject.JPA_FILES_COLLECTION, lsnr);
- JPASolver.ignoreEvents = false;
- final boolean rename = RenameEntityFeature.class.isInstance(this);
-
- if (!showBusy.isMoved())
- return;
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(pict);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- remapEntity(oldName, pict, pu, rename, lsnr, getFeatureProvider());
- }
- });
- }
-
- public void execute(ICustomContext context, String newName, ICompilationUnit cu, JavaPersistentType jpt) {
- final String oldName = jpt.getName();
- final Shape pict = (Shape)getFeatureProvider().getPictogramElementForBusinessObject(jpt);
- jpt = (JavaPersistentType)getFeatureProvider().
- getBusinessObjectForPictogramElement(pict);
- final PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpt);
- final Semaphore s = new Semaphore(0);
- final JPAProjectListener lsnr = new JPAProjectListener(s);
- jpt.getJpaProject().addCollectionChangeListener(JpaProject.JPA_FILES_COLLECTION, lsnr);
- ShowBusy showBusy = new ShowBusy(s);
- JPASolver.ignoreEvents = true;
- JpaArtifactFactory.instance().renameEntityClass(jpt, newName, getFeatureProvider());
- BusyIndicator.showWhile(Display.getCurrent(), showBusy);
- jpt.getJpaProject().removeCollectionChangeListener(JpaProject.JPA_FILES_COLLECTION, lsnr);
- JPASolver.ignoreEvents = false;
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(pict);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- remapEntity(oldName, pict, pu, true, lsnr, getFeatureProvider());
- }
- });
- }
-
- public static void remapEntity(final String oldName,
- final Shape pict,
- final PersistenceUnit pu,
- final boolean rename,
- final JPAProjectListener lsnr,
- final IJPAEditorFeatureProvider fp) {
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- pu.getJpaProject().updateAndWait();
- final int x = pict.getGraphicsAlgorithm().getX();
- final int y = pict.getGraphicsAlgorithm().getY();
- final int width = pict.getGraphicsAlgorithm().getWidth();
- final int height = pict.getGraphicsAlgorithm().getHeight();
-
- final ContainerShape cs = Graphiti.getPeService().createContainerShape(fp.getDiagramTypeProvider().getDiagram(),
- true);
- cs.setVisible(true);
-
- AddContext cont = new AddContext();
- cont.setX(x);
- cont.setY(y);
- cont.setWidth(width);
- cont.setHeight(height);
- RoundedRectangle rect = AddJPAEntityFeature.createEntityRectangle(cont, cs, fp.getDiagramTypeProvider().getDiagram());
- rect.setFilled(true);
-
- IRemoveContext ctx = new RemoveContext(pict);
- RemoveJPAEntityFeature ft = new RemoveJPAEntityFeature(fp);
-
- boolean primaryCollapsed = JPAEditorConstants.TRUE_STRING.equals(Graphiti.getPeService().getPropertyValue(pict, JPAEditorConstants.PRIMARY_COLLAPSED));
- boolean relationCollapsed = JPAEditorConstants.TRUE_STRING.equals(Graphiti.getPeService().getPropertyValue(pict, JPAEditorConstants.RELATION_COLLAPSED));
- boolean basicCollapsed = JPAEditorConstants.TRUE_STRING.equals(Graphiti.getPeService().getPropertyValue(pict, JPAEditorConstants.BASIC_COLLAPSED));
-
- AddEntityContext addCtx = new AddEntityContext(primaryCollapsed, relationCollapsed, basicCollapsed);
- String newJPTName = lsnr.getNewJPTName();
-
- JavaPersistentType newJPT = JpaArtifactFactory.instance().getJPT(newJPTName, pu);
- if (!JptJpaCorePlugin.discoverAnnotatedClasses(newJPT.getJpaProject().getProject())) {
- JPAEditorUtil.createUnregisterEntityFromXMLJob(newJPT.getJpaProject(), oldName);
- }
- if (rename) {
- String tableName = JPAEditorUtil.formTableName(newJPT);
- JpaArtifactFactory.instance().setTableName(newJPT, tableName);
- }
- addCtx.setNewObject(newJPT);
- addCtx.setTargetContainer(fp.getDiagramTypeProvider().getDiagram());
- addCtx.setX(x);
- addCtx.setY(y);
- addCtx.setWidth(width);
- addCtx.setHeight(height);
- AddJPAEntityFeature ft1 = new AddJPAEntityFeature(fp);
- ft.remove(ctx);
- ft1.add(addCtx);
- PictogramElement pe = fp.getPictogramElementForBusinessObject(newJPT);
- fp.getDiagramTypeProvider().getDiagramEditor().setPictogramElementForSelection(pe);
- Graphiti.getPeService().deletePictogramElement(cs);
-
- JpaArtifactFactory.instance().refreshEntityModel(fp, newJPT);
- if (!JptJpaCorePlugin.discoverAnnotatedClasses(newJPT.getJpaProject().getProject())) {
- JPAEditorUtil.createRegisterEntityInXMLJob(newJPT.getJpaProject(), newJPTName);
- }
- }
- });
-
- }
-
-
-
- @Override
- protected Diagram getDiagram() {
- return getFeatureProvider().getDiagramTypeProvider().getDiagram();
- }
-
- @Override
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- class ShowBusy implements Runnable {
- private Semaphore s;
- boolean moved = false;
- ShowBusy(Semaphore s) {
- this.s = s;
- }
-
- public void run() {
- try {
- moved = s.tryAcquire(2, 4, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Thread interrupted", e); //$NON-NLS-1$
- }
- }
-
- boolean isMoved() {
- return moved;
- }
- }
-
- public class JPAProjectListener implements CollectionChangeListener {
- private Semaphore s = null;
- private String newJptName = null;
-
- public JPAProjectListener(Semaphore s) {
- this.s = s;
- }
-
- public void itemsAdded(CollectionAddEvent event) {
- Iterator<?> it = event.getItems().iterator();
- Object o = it.next();
- JpaFile jpaFile = (JpaFile)o;
-
- JptResourceModel rm = jpaFile.getResourceModel();
- if (rm == null)
- return;
- if (!JavaResourceCompilationUnit.class.isInstance(rm))
- return;
- JavaResourceCompilationUnit jrcu = (JavaResourceCompilationUnit)rm;
- JavaResourceAbstractType jrt = jrcu.getPrimaryType();
- newJptName = jrt.getQualifiedName();
- s.release();
- if ((ats == null) || hasNameAnnotation)
- return;
- final Iterator<JavaPersistentAttribute> iter = ats.iterator();
- Runnable r = new Runnable() {
- public void run() {
- Hashtable<String, String> atOldToNewName = new Hashtable<String, String>();
- Set<JavaPersistentAttribute> newSelfAts = new HashSet<JavaPersistentAttribute>();
- while (iter.hasNext()) {
- JavaPersistentAttribute at = iter.next();
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit((JavaPersistentType) at.getParent());
- if (!cu.exists()) {
- at = (JavaPersistentAttribute)at.getPersistenceUnit().getPersistentType(newJptName).getAttributeNamed(at.getName());
- JavaPersistentAttribute newAt = null;
- try {
- newAt = JpaArtifactFactory.instance().renameAttribute(at, JPAEditorUtil.returnSimpleName(newJptName), newJptName, getFeatureProvider());
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError(e);
- }
- atOldToNewName.put(at.getName(), newAt.getName());
- newSelfAts.add(newAt);
- } else {
- try {
- JpaArtifactFactory.instance().renameAttribute(at, JPAEditorUtil.returnSimpleName(newJptName), newJptName, getFeatureProvider());
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError(e);
- }
- }
- }
- Iterator<JavaPersistentAttribute> itr = newSelfAts.iterator();
- while (itr.hasNext()) {
- JavaPersistentAttribute at = itr.next();
- JpaArtifactFactory.instance().refreshEntityModel(null, (JavaPersistentType)at.getParent());
- JavaAttributeMapping m = at.getMapping();
- Annotation mappingAnnotation = m.getMappingAnnotation();
-
- if(mappingAnnotation == null){
- JpaArtifactFactory.instance().refreshEntityModel(getFeatureProvider(), (JavaPersistentType)at.getParent());
- mappingAnnotation = m.getMappingAnnotation();
- }
- if (mappingAnnotation == null)
- return;
- if (OwnableRelationshipMappingAnnotation.class.isInstance(mappingAnnotation)) {
- OwnableRelationshipMappingAnnotation ownableMappingAnnotation = (OwnableRelationshipMappingAnnotation)mappingAnnotation;
- String oldMappedBy = ownableMappingAnnotation.getMappedBy();
- if (oldMappedBy != null) {
- String newMappedBy = atOldToNewName.get(oldMappedBy);
- if (newMappedBy != null)
- ownableMappingAnnotation.setMappedBy(newMappedBy);
- }
- }
- }
-
- }
- };
- Display.getDefault().asyncExec(r);
- }
-
- public void itemsRemoved(CollectionRemoveEvent arg0) {
- s.release();
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- }
-
- public void collectionCleared(CollectionClearEvent arg0) {}
-
- public String getNewJPTName() {
- return newJptName;
- }
-
-
- };
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAllEntitiesFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAllEntitiesFeature.java
deleted file mode 100644
index f1225ab4c6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAllEntitiesFeature.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-
-public abstract class RemoveAllEntitiesFeature extends AbstractCustomFeature {
-
- protected Set<Shape> allShapes = new HashSet<Shape>();
-
- public RemoveAllEntitiesFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public abstract String getConfirmationText();
-
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public void execute(ICustomContext context) {
- Iterator<Shape> it = allShapes.iterator();
- while (it.hasNext()) {
- Shape sh = it.next();
- final RemoveJPAEntityFeature ft = new RemoveJPAEntityFeature(this.getFeatureProvider());
- final IRemoveContext ctx = new RemoveContext(sh);
- PictogramElement pe = ctx.getPictogramElement();
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(pe);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- ft.remove(ctx);
- }
- });
- }
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java
deleted file mode 100644
index b70aaa5289..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-
-
-
-public class RemoveAndSaveEntityFeature extends DefaultRemoveFeature {
-
- public RemoveAndSaveEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void preRemove(IRemoveContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- Set<Shape> shapesForDeletion = new HashSet<Shape>();
- if (bo instanceof PersistentType) {
- IFeatureProvider fp = getFeatureProvider();
- List<Shape> lst = ((ContainerShape)pe).getChildren();
- for (int i = lst.size() - 1; i >= 0; i--) {
- Shape textShape = lst.get(i);
- Object o = fp.getBusinessObjectForPictogramElement(textShape);
- if ((o != null) && (o instanceof JavaPersistentAttribute)) {
- shapesForDeletion.add(textShape);
- }
- }
- Iterator<Shape> it = shapesForDeletion.iterator();
- while(it.hasNext()) {
- RemoveAttributeFeature f = new RemoveAttributeFeature(fp, false, true);
- IRemoveContext ctx = new RemoveContext(it.next());
- f.remove(ctx);
- }
- getFeatureProvider().remove(((PersistentType)bo).getName(), true);
- }
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java
deleted file mode 100644
index 055d602afb..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class RemoveAttributeFeature extends DefaultRemoveFeature {
-
- private boolean skipRemoveRelations = false;
- private boolean skipCreateRelations = false;
- private JavaPersistentType jpt = null;
- private ICustomFeature graphicalRemove;
-
- public RemoveAttributeFeature(IFeatureProvider fp) {
- this(fp, new GraphicalRemoveAttributeFeature(fp));
- }
-
- public RemoveAttributeFeature(IFeatureProvider fp, boolean skipRemoveRelations, boolean skipCreateRelations) {
- this(fp);
- this.skipRemoveRelations = skipRemoveRelations;
- this.skipCreateRelations = skipCreateRelations;
- }
-
- public RemoveAttributeFeature(IFeatureProvider fp, ICustomFeature graphicalRemove) {
- super(fp);
- this.graphicalRemove = graphicalRemove;
- }
-
- public void setKey(String key) {
- }
-
- public boolean isAvailable(IContext context) {
- return false;
- }
-
- public boolean canExecute(IContext context) {
- return false;
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- public void preRemove(IRemoveContext context) {
- final PictogramElement pe = context.getPictogramElement();
- if (pe == null) {
- JPADiagramEditorPlugin.logError("PictogramElement is null\n", new Exception()); //$NON-NLS-1$
- return;
- }
- IJPAEditorFeatureProvider fp = getFeatureProvider();
- Object bo = fp.getBusinessObjectForPictogramElement(pe);
- if(bo == null)
- return;
-
- if (bo instanceof JavaPersistentAttribute) {
- JavaPersistentAttribute jpa = (JavaPersistentAttribute) bo;
-
- HashSet<String> ignores = ((JPAEditorFeatureProvider) getFeatureProvider()).getAddIgnore();
- if (!ignores.isEmpty()) {
- Iterator<String> iter = ignores.iterator();
- if (iter.hasNext()) {
- String iterStr = iter.next();
- if (iterStr.endsWith(jpa.getName())) {
- ignores.remove(iterStr);
- }
- }
- }
-
- jpt = (JavaPersistentType)jpa.getParent();
- fp.remove(fp.getKeyForBusinessObject(bo));
- if (!skipRemoveRelations) {
- IRelation rel = fp.getRelationRelatedToAttribute(jpa);
- removeRelation(rel);
- }
- }
-
- ContainerShape entityShape = ((ContainerShape) pe).getContainer().getContainer();
- try{
- graphicalRemoveAttribute(entityShape);
- } catch (Exception e){
- JPADiagramEditorPlugin.logError(e);
- }
- }
-
- private void graphicalRemoveAttribute(PictogramElement pe) {
- CustomContext customContext = new CustomContext();
- customContext.setInnerPictogramElement(pe);
- graphicalRemove.execute(customContext);
- }
-
- private void removeRelation(IRelation rel) {
- if (rel == null)
- return;
- Connection conn = (Connection) getFeatureProvider().getPictogramElementForBusinessObject(rel);
- RemoveContext ctx = new RemoveContext(conn);
- RemoveRelationFeature ft = new RemoveRelationFeature(getFeatureProvider());
- ft.remove(ctx);
- }
-
- public void postRemove(IRemoveContext context) {
- if (skipCreateRelations)
- return;
- if (jpt == null)
- return;
- JpaArtifactFactory.instance().refreshEntityModel(getFeatureProvider(), jpt);
-
- Collection<IRelation> rels = JpaArtifactFactory.instance()
- .produceAllRelations(jpt, getFeatureProvider());
- Iterator<IRelation> iter = rels.iterator();
- while (iter.hasNext()) {
- IRelation rel = iter.next();
- ContainerShape ownerShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(
- rel.getOwner());
- ContainerShape inverseShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(
- rel.getInverse());
- AddConnectionContext cntx = new AddConnectionContext(JPAEditorUtil.getAnchor(ownerShape), JPAEditorUtil
- .getAnchor(inverseShape));
- cntx.setNewObject(rel);
- AddRelationFeature ft = new AddRelationFeature(getFeatureProvider());
- ft.add(cntx);
-// JpaArtifactFactory.instance().refreshEntityModel(getFeatureProvider(), jpt);
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java
deleted file mode 100644
index e188f0705e..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.PlatformUI;
-
-
-public class RemoveJPAEntityFeature extends DefaultRemoveFeature {
-
-
- public RemoveJPAEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void preRemove(IRemoveContext context) {
- PictogramElement pe = context.getPictogramElement();
-
-// RestoreEntityFeature ft = new RestoreEntityFeature(getFeatureProvider());
-// ICustomContext customContext = new CustomContext(new PictogramElement[] { pe });
-// ft.execute(customContext);
-
- final Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- Set<Shape> shapesForDeletion = new HashSet<Shape>();
- if (bo instanceof JavaPersistentType) {
- JavaPersistentType jpt = (JavaPersistentType)bo;
- JpaArtifactFactory.instance().restoreEntityClass(jpt, getFeatureProvider());
- IFeatureProvider fp = getFeatureProvider();
- List<Shape> lst = ((ContainerShape)pe).getChildren();
- for (int i = lst.size() - 1; i >= 0; i--) {
- Shape textShape = lst.get(i);
- Object o = fp.getBusinessObjectForPictogramElement(textShape);
- if ((o != null) && (o instanceof JavaPersistentAttribute)) {
- shapesForDeletion.add(textShape);
- }
- }
- Iterator<Shape> it = shapesForDeletion.iterator();
- while(it.hasNext()) {
- RemoveAttributeFeature f = new RemoveAttributeFeature(fp, false, true);
- IRemoveContext ctx = new RemoveContext(it.next());
- f.remove(ctx);
- }
- //---------------------------------------------------------------------
- //--Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=281345
- //Job job = new Job("Remove JPA entity") { //$NON-NLS-1$
- // protected IStatus run(IProgressMonitor monitor) {
- String name = ((PersistentType)bo).getName();
- getFeatureProvider().remove(name, true);
- //return new Status(IStatus.OK,
- // JPADiagramEditorPlugin.PLUGIN_ID,
- // name + " is removed"); //$NON-NLS-1$
-
- // }
- //};
- //job.schedule();
- //---------------------------------------------------------------------
- }
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-
- public void execute(IContext ctx) {
- if (!IRemoveContext.class.isInstance(ctx))
- return;
- IRemoveContext context = (IRemoveContext)ctx;
- PictogramElement pe = context.getPictogramElement();
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- if (!JavaPersistentType.class.isInstance(bo))
- return;
- JavaPersistentType jpt = (JavaPersistentType)bo;
- if (JPAEditorUtil.isEntityOpenElsewhere(jpt, true)) {
- String shortEntName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(jpt));
- String message = NLS.bind(JPAEditorMessages.RemoveJPAEntityFeature_discardWarningMsg, shortEntName);
- MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- JPAEditorMessages.JPASolver_closeEditors, null, message,
- MessageDialog.WARNING, new String[]{JPAEditorMessages.BTN_OK, JPAEditorMessages.BTN_CANCEL}, 0) {
- protected int getShellStyle() {
- return SWT.CLOSE
- | SWT.TITLE | SWT.BORDER
- | SWT.APPLICATION_MODAL
- | getDefaultOrientation();}};
- if (dialog.open() != 0)
- return;
- }
- super.execute(context);
- }
-
-
-
-
-
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveRelationFeature.java
deleted file mode 100644
index 6f73e1dc16..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveRelationFeature.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.features.impl.AbstractFeature;
-import org.eclipse.graphiti.internal.Messages;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-
-
-@SuppressWarnings("restriction")
-public class RemoveRelationFeature extends AbstractFeature implements IRemoveFeature {
-
- private static final String NAME = Messages.DefaultRemoveFeature_0_xfld;
-
- public RemoveRelationFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public boolean isAvailable(IContext context) {
- return true;
- }
-
- public boolean canRemove(IRemoveContext context) {
- return true;
- }
-
- public boolean canExecute(IContext context) {
- return true;
- }
-
- public void preRemove(IRemoveContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- if (bo instanceof AbstractRelation) {
- AbstractRelation rel = (AbstractRelation)bo;
- getFeatureProvider().remove(rel.getId());
- }
- }
-
- public final void remove(final IRemoveContext context) {
- if (!getUserDecision()) {
- return;
- }
- preRemove(context);
- final PictogramElement pe = context.getPictogramElement();
- if (pe == null)
- return;
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(pe);
- RecordingCommand rc = new RecordingCommand(ted) {
- protected void doExecute() {
- if (pe instanceof Shape) {
- Shape shape = (Shape) pe;
- removeAllConnections(shape);
- }
- Graphiti.getPeService().deletePictogramElement(pe);
- postRemove(context);
- }
- };
- ted.getCommandStack().execute(rc);
- }
-
- protected void removeAllConnections(Shape shape) {
- IFeatureProvider featureProvider = getFeatureProvider();
- for (Iterator<Anchor> iter = shape.getAnchors().iterator(); iter.hasNext();) {
- Anchor anchor = iter.next();
- for (Iterator<Connection> iterator = Graphiti.getPeService().getAllConnections(anchor).iterator(); iterator.hasNext();) {
- Connection connection = iterator.next();
- if (connection.eResource() != null) {
- IRemoveContext rc = new RemoveContext(connection);
- IRemoveFeature removeFeature = featureProvider.getRemoveFeature(rc);
- if (removeFeature != null) {
- ConnectionDecorator decorators[] = connection.getConnectionDecorators().toArray(new ConnectionDecorator[0]);
- for (ConnectionDecorator decorator : decorators) {
- if (decorator != null && (decorator.eResource() != null)) {
- EcoreUtil.delete(decorator, true);
- }
- }
- removeFeature.remove(rc);
- }
- }
- }
- }
- }
-
- public void postRemove(IRemoveContext context) {
- }
-
- @Override
- public String getName() {
- return NAME;
- }
-
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-
- public void execute(IContext context) {
- if (context instanceof IRemoveContext) {
- remove((IRemoveContext)context);
- }
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityFeature.java
deleted file mode 100644
index 1258cfa79d..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityFeature.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.ui.actions.RenameAction;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchSite;
-
-
-
-public class RenameEntityFeature extends RefactorEntityFeature {
-
- public RenameEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void execute(ICustomContext context) {
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit(jpt);
- IWorkbenchSite ws = ((IEditorPart)getDiagramEditor()).getSite();
- RenameAction action = new RenameAction(ws);
- ats = JpaArtifactFactory.instance().getRelatedAttributes(jpt);
- execute(context, action, cu);
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.RenameEntityFeature_ContextMenuOperationDescription;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityWithoutUIFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityWithoutUIFeature.java
deleted file mode 100644
index 928be7c13f..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RenameEntityWithoutUIFeature.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class RenameEntityWithoutUIFeature extends RefactorEntityFeature {
-
- private String newName = null;
-
- public RenameEntityWithoutUIFeature(IFeatureProvider fp, String newName) {
- super(fp);
- this.newName = newName;
- }
-
- public void execute(JavaPersistentType jpt) {
- ICompilationUnit cu = getFeatureProvider().getCompilationUnit(jpt);
- ats = JpaArtifactFactory.instance().getRelatedAttributes(jpt);
- execute(new CustomContext(), newName, cu, jpt);
- }
-
- public void execute(ICustomContext context) {
- // not used
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeAttributeFeature.java
deleted file mode 100644
index 22308ab9f5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeAttributeFeature.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IContext;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-
-
-public class ResizeAttributeFeature extends DefaultResizeShapeFeature {
-
- public ResizeAttributeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public boolean canResizeShape(IResizeShapeContext context) {
- return false;
- }
-
-
- public boolean canExecute(IContext context) {
- return false;
- }
-
-
- public boolean isAvailable(IContext context) {
- return false;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeJPAEntityFeature.java
deleted file mode 100644
index cbf59b93d2..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ResizeJPAEntityFeature.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-
-
-public class ResizeJPAEntityFeature extends DefaultResizeShapeFeature {
-
- public ResizeJPAEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- @Override
- public boolean canResizeShape(IResizeShapeContext context) {
- boolean canResize = super.canResizeShape(context);
- if (canResize) {
- Shape shape = context.getShape();
- Object bo = getBusinessObjectForPictogramElement(shape);
- if (bo == null) return false;
- if (bo instanceof PersistentType) {
- PersistentType c = (PersistentType) bo;
- if (c.getName() != null &&
- c.getName().length() == 1) {
- canResize = false;
- }
- }
- }
- return canResize;
- }
-
- private void resizeContainerShape(IResizeShapeContext context) {
- super.resizeShape(context);
- }
-
- public void resizeShape(final IResizeShapeContext context) {
- final ContainerShape entityShape = (ContainerShape) context.getShape();
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(entityShape);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- resizeContainerShape(context);
- JPAEditorUtil.rearrangeAllConnections(entityShape,
- getFeatureProvider(), false);
- }
- });
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RestoreEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RestoreEntityFeature.java
deleted file mode 100644
index 60b67473b9..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RestoreEntityFeature.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.PlatformUI;
-
-
-public class RestoreEntityFeature extends AbstractCustomFeature {
-
- public RestoreEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public void execute(ICustomContext context) {
- JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(context.getPictogramElements()[0]);
- if (JPAEditorUtil.isEntityOpenElsewhere(jpt, true)) {
- String shortEntName = JPAEditorUtil
- .returnSimpleName(JpaArtifactFactory.instance()
- .getEntityName(jpt));
- String message = NLS.bind(
- JPAEditorMessages.JPASolver_closeWarningMsg, shortEntName);
- MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getShell(),
- JPAEditorMessages.JPASolver_closeEditors, null, message,
- MessageDialog.WARNING,
- new String[] { JPAEditorMessages.BTN_OK }, 0) {
- protected int getShellStyle() {
- return SWT.CLOSE | SWT.TITLE | SWT.BORDER
- | SWT.APPLICATION_MODAL | getDefaultOrientation();
- }
- };
- dialog.open();
- return;
- }
- JpaArtifactFactory.instance().restoreEntityClass(jpt, getFeatureProvider());
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_discardChangesMenuItem;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveAndRemoveAllEntitiesFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveAndRemoveAllEntitiesFeature.java
deleted file mode 100644
index 9665d519e5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveAndRemoveAllEntitiesFeature.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Iterator;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.swt.widgets.Display;
-
-
-public class SaveAndRemoveAllEntitiesFeature extends RemoveAllEntitiesFeature {
-
- public SaveAndRemoveAllEntitiesFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public String getConfirmationText() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndSaveAllEntitiesConfirmation;
- }
-
-
- public void execute(ICustomContext context) {
- MessageDialog dlg = new MessageDialog(Display.getCurrent().getShells()[0],
- JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAllEntitiesMenu,
- null, getConfirmationText(), 0,
- new String[] {JPAEditorMessages.BTN_OK, JPAEditorMessages.BTN_CANCEL}, Dialog.CANCEL);
- if (dlg.open() != Dialog.OK)
- return;
- Iterator<Shape> it = this.getDiagram().getChildren().iterator();
- while (it.hasNext()) {
- Shape sh = it.next();
- SaveEntityFeature ft = new SaveEntityFeature(getFeatureProvider());
- ICustomContext ctx = new CustomContext(new PictogramElement[] { sh });
- ft.execute(ctx);
- allShapes.add(sh);
- }
- super.execute(context);
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.SaveAndRemoveAllEntitiesFeature_ContextMenuOperationDescription;
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveEntityFeature.java
deleted file mode 100644
index 0189647cbf..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/SaveEntityFeature.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class SaveEntityFeature extends AbstractCustomFeature {
-
- public SaveEntityFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public boolean canExecute(ICustomContext context) {
- return true;
- }
-
- public void execute(ICustomContext context) {
- JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(context.getPictogramElements()[0]);
- JpaArtifactFactory.instance().forceSaveEntityClass(jpt, getFeatureProvider());
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @Override
- public String getName() {
- return JPAEditorMessages.JPAEditorToolBehaviorProvider_saveMenuItem;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/UpdateAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/UpdateAttributeFeature.java
deleted file mode 100644
index 853f916909..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/UpdateAttributeFeature.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.feature;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.custom.AbstractCustomFeature;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.Color;
-import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
-import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class UpdateAttributeFeature extends AbstractCustomFeature {
-
- public UpdateAttributeFeature(IFeatureProvider fp) {
- super(fp);
- }
-
- public void reconnect(JavaPersistentType jpt) {
- IJPAEditorFeatureProvider fp = getFeatureProvider();
- Collection<IRelation> rels = JpaArtifactFactory.instance().produceAllRelations(jpt, fp);
- JpaArtifactFactory.instance().refreshEntityModel(fp, jpt);
-
- Iterator<IRelation> it = rels.iterator();
- while (it.hasNext()) {
- IRelation rel = it.next();
- AddRelationFeature relF = new AddRelationFeature(fp);
- AnchorContainer acSource = (AnchorContainer) fp.getPictogramElementForBusinessObject(rel.getOwner());
- AnchorContainer acTarget = (AnchorContainer) fp.getPictogramElementForBusinessObject(rel.getInverse());
- if ((acSource != null) && (acTarget != null)) {
- AddConnectionContext ctx = new AddConnectionContext(acSource.getAnchors().iterator().next(), acTarget
- .getAnchors().iterator().next());
- ctx.setNewObject(rel);
- relF.add(ctx);
- }
- }
- }
-
- /**
- * @deprecated use the {@link GraphicalRemoveAttributeFeature}
- */
- public void execute(ICustomContext context) {
- GraphicalRemoveAttributeFeature remove = new GraphicalRemoveAttributeFeature(getFeatureProvider());
- remove.execute(context);
- }
-
- /**
- * @deprecated Use GraphicalAddAttributeFeature
- * @param entityShape
- * @param newAttr
- * @return
- */
- public ContainerShape addAttributes(ContainerShape entityShape, JavaPersistentAttribute newAttr) {
- AddContext context = new AddContext();
- context.setNewObject(newAttr);
- context.setTargetContainer(entityShape);
- GraphicalAddAttributeFeature feature = new GraphicalAddAttributeFeature(getFeatureProvider());
- return (ContainerShape) feature.add(context);
- }
-
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return (IJPAEditorFeatureProvider) super.getFeatureProvider();
- }
-
- public static Text addText(IFeatureProvider fp, Rectangle textRectangle, String txt) {
- Text text = Graphiti.getGaService().createDefaultText(fp.getDiagramTypeProvider().getDiagram(), textRectangle, txt);
- Color color = Graphiti.getGaService().manageColor(fp.getDiagramTypeProvider().getDiagram(),
- JPAEditorConstants.ENTITY_TEXT_FOREGROUND);
- text.setForeground(color);
- text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
- text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
- text.getFont().setBold(true);
- return text;
- }
-
- public static Rectangle addRectangleForText(ContainerShape cs, int attribIndex, int width) {
- Rectangle rect = Graphiti.getGaService().createRectangle(cs);
- rect.setFilled(false);
- rect.setLineVisible(false);
- rect.setHeight(JPAEditorConstants.ATTRIBUTE_RECT_HEIGHT);
- rect.setWidth(width - JPAEditorConstants.ATTRIBUTE_TEXT_RECT_WIDTH_REDUCER);
- rect.setX(JPAEditorConstants.ATTRIBUTE_TEXT_RECT_X);
- rect
- .setY(JPAEditorConstants.ATTRIBUTES_TOP_OFFSET + attribIndex
- * JPAEditorConstants.ATTRIBUTES_PLACEMENT_STEP);
- return rect;
- }
-
- public static Rectangle addRectangleForIcon(ContainerShape cs, int attribIndex) {
- Rectangle rect = Graphiti.getGaService().createRectangle(cs);
- rect.setFilled(false);
- rect.setLineVisible(false);
- rect.setHeight(JPAEditorConstants.ICON_RECT_HEIGHT);
- rect.setX(JPAEditorConstants.ICON_RECT_LEFT_OFFSET);
- rect.setWidth(JPAEditorConstants.ICON_RECT_WIDTH);
- rect
- .setY(JPAEditorConstants.ATTRIBUTES_TOP_OFFSET + attribIndex
- * JPAEditorConstants.ATTRIBUTES_PLACEMENT_STEP);
- return rect;
- }
-
- public void addSeparatorsToShape(ContainerShape compartmentShape) {
- addSeparatorToCollection(compartmentShape, 0);
- addSeparatorToCollection(compartmentShape, JPAEditorConstants.COMPARTMENT_MIN_HEIGHT);
- }
-
- private Shape addSeparatorToCollection(ContainerShape containerShape, int y) {
- final int width = containerShape.getGraphicsAlgorithm().getWidth();
- Shape shape = Graphiti.getPeService().createShape(containerShape, false);
- Rectangle rectangle = Graphiti.getGaService().createRectangle(shape);
- rectangle.setForeground(manageColor(JPAEditorConstants.ENTITY_BACKGROUND));
- rectangle.setBackground(manageColor(JPAEditorConstants.ENTITY_BORDER_COLOR));
- rectangle.setLineVisible(false);
- Graphiti.getGaService().setSize(rectangle, width, JPAEditorConstants.SEPARATOR_HEIGHT);
- Graphiti.getGaService().setLocationAndSize(rectangle, 0, y, width, JPAEditorConstants.SEPARATOR_HEIGHT);
- return shape;
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/JPAEditorMessages.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/JPAEditorMessages.java
deleted file mode 100644
index 14afdf1c89..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/JPAEditorMessages.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JPAEditorMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.messages"; //$NON-NLS-1$
-
- public static String AddJPAEntityFeature_basicAttributesShapes;
-
- public static String AddJPAEntityFeature_primaryKeysShape;
-
- public static String AddJPAEntityFeature_relationAttributesShapes;
-
- public static String ClickAddAttributeButtonFeature_createAttributeButtonDescription;
- public static String ClickAddAttributeButtonFeature_createAttributeButtonLabel;
-
- public static String ClickRemoveAttributeButtonFeature_createAttributeButtonDescription;
- public static String ClickRemoveAttributeButtonFeature_createAttributeButtonlabel;
- public static String ClickRemoveAttributeButtonFeature_deleteAttributeQuestion;
-
- public static String CreateDiagramJob_createDiagramJobName;
- public static String CreateDiagramJob_getJPADiagramMonitorTaskName;
-
- public static String CreateJPAEntityFeature_createEntityErrorMsg;
-
- public static String CreateJPAEntityFeature_createEntityErrorMsgTitle;
-
- public static String CreateJPAEntityFeature_createEntityErrorStatusMsg;
-
- public static String CreateJPAEntityFeature_jpaEntityFeatureDescription;
- public static String CreateJPAEntityFeature_jpaEntityFeatureName;
- public static String CreateJPAEntityFeature_jpaProjectSelectionDialogDescription;
- public static String CreateJPAEntityFeature_jpaProjectSelectionDialogTitle;
- public static String CreateJPAEntityFromMappedSuperclassFeature_createInheritedEntityFeatureDescription;
- public static String CreateJPAEntityFromMappedSuperclassFeature_createInheritedEntityFeatureName;
-
- public static String CreateManyToManyBiDirRelationFeature_manyToManyBiDirFeatureName;
- public static String CreateManyToManyBiDirRelationFeature_manyToManyUniDirFeatureDescription;
-
- public static String CreateManyToManyUniDirRelationFeature_manyToManyUniDirFeatureDescription;
- public static String CreateManyToManyUniDirRelationFeature_manyToManyUniDirFeatureName;
-
- public static String CreateManyToOneBiDirRelationFeature_manyToOneBiDirFeatureDescription;
- public static String CreateManyToOneBiDirRelationFeature_manyToOneBiDirFeatureName;
-
- public static String CreateManyToOneUniDirRelationFeature_manyToOneUniDirFeatureDescription;
- public static String CreateManyToOneUniDirRelationFeature_manyToOneUniDirFeatureName;
-
- public static String CreateOneToManyUniDirRelationFeature_oneToManyUniDirFeatureDescription;
- public static String CreateOneToManyUniDirRelationFeature_oneToManyUniDirFeatureName;
-
- public static String CreateOneToOneBiDirRelationFeature_oneToOneBiDirFeatureDescription;
- public static String CreateOneToOneBiDirRelationFeature_oneToOneBiDirFeatureName;
-
- public static String CreateOneToOneUniDirRelationFeature_oneToOneUniDirFeatureDescription;
- public static String CreateOneToOneUniDirRelationFeature_oneToOneUniDirFeatureName;
-
- public static String DeleteFeature_deleteConfirm;
-
- public static String DeleteJPAEntityFeature_deleteJPAEntityQuestion;
- public static String DeleteJPAEntityFeature_deleteJPAEntitiesQuestion;
-
- public static String DeleteRelationFeature_deleteRelationQuestion;
-
- public static String DirectEditAttributeFeature_attributeExists;
-
- public static String DirectEditAttributeFeature_classNameMsg;
- public static String DirectEditJPAEntityFeature_bracesNotAllowedMsg;
-
- public static String DirectEditJPAEntityFeature_duplicateEntityName;
- public static String DirectEditAttributeFeature_lineBreaksNotAllowedMsg;
- public static String DirectEditAttributeFeature_spacesNotAllowedMsg;
-
- public static String DirectEditJPAEntityFeature_classNameMsg;
- public static String DirectEditJPAEntityFeature_lineBreaksNotAllowedMsg;
- public static String DirectEditJPAEntityFeature_scpacesNotAllowedMsg;
- public static String DirectEditJPAEntityFeature_invalidSymbolsMsg;
-
- public static String DiscardAndRemoveAllEntitiesFeature_ContextMenuOperationDescription;
-
- public static String JpaArtifactFactory_CanNotCheckReturnType;
-
- public static String JPADiagramEditor_waitingForMoin;
-
- public static String JPADiagramPropertyPage_errSavePropsMsgTitle;
- public static String JPADiagramPropertyPage_errSavePropsMsgText;
-
- public static String JPAEditorPreferencesPage_pageDescription;
- public static String JPAEditorPreferencesPage_DefaultCollectionTypeSectionDescription;
-
- public static String JPAEditorPreferencesPage_DefaultCollectionTypeSectionTittle;
-
- public static String JPAEditorPreferencesPage_DefaultPackageMsg;
- public static String JPAEditorPreferencesPage_DefaultTableNamePrefixMsg;
- public static String JPAEditorPreferencesPage_DefaultTableNameLabel;
- public static String JPAEditorPreferencesPage_DefaultPackageToUse;
- public static String JPAEditorPreferencesPage_invalidPackage;
- public static String JPAEditorPreferencesPage_invalidTableNamePrefix;
- public static String JPAEditorPreferencesPage_directEditAffectsClass;
- public static String JPAEditorPreferencesPage_directEditAffectsClassTooltip;
- public static String JPAEditorPreferencesPage_entityAccessTypeButtonGroupTooltip;
- public static String JPAEditorPreferencesPage_entityAccessTypeButtonGroupLabel;
- public static String JPAEditorPreferencesPage_entityFieldBasedAccessButtonLabel;
- public static String JPAEditorPreferencesPage_entityPropertyBasedAccessButtonLabel;
- public static String JPAEditorPreferencesPage_defaultFolderControlTooltip;
- public static String JPAEditorPreferencesPage_defaultFolderControlLabel;
- public static String JPAEditorPreferencesPage_invalidFolder;
- public static String JPAEditorPreferencesPage_emptyFolder;
- public static String JPAEditorPreferencesPage_oneToManyOldStyle;
- public static String JPAEditorPreferencesPage_oneToManyOldStyleTooltip;
-
- public static String JPAEditorPropertyPage_oneToManyOldStyle;
- public static String JPAEditorPropertyPage_oneToManyOldStyleTooltip;
-
- public static String JPAEditorToolBehaviorProvider_collapseAttrGroupMenuItem;
-
- public static String JPAEditorToolBehaviorProvider_collapseAttrGroupMenuItemDescr;
- public static String JPAEditorToolBehaviorProvider_collapseCompartToolTip;
-
- public static String JPAEditorToolBehaviorProvider_collapseEntityMenuItem;
- public static String JPAEditorToolBehaviorProvider_collapseEntityMenuItemDescr;
- public static String JPAEditorToolBehaviorProvider_collapseAllEntitiesMenuItem;
- public static String JPAEditorToolBehaviorProvider_collapseAllEntitiesMenuItemDescr;
-
- public static String JPAEditorToolBehaviorProvider_createAttributeButtonDescription;
- public static String JPAEditorToolBehaviorProvider_createAttributeButtonlabel;
- public static String JPAEditorToolBehaviorProvider_customSubMenuDescription;
- public static String JPAEditorToolBehaviorProvider_customSubMenuText;
- public static String JPAEditorToolBehaviorProvider_deleteAttributeButtonDescription;
- public static String JPAEditorToolBehaviorProvider_deleteAttributeButtonlabel;
- public static String JPAEditorToolBehaviorProvider_deleteEntityFromModelButtonDescription;
- public static String JPAEditorToolBehaviorProvider_deleteEntityFromModelButtonLabel;
-
- public static String JPAEditorToolBehaviorProvider_discardChangesMenuItem;
-
- public static String JPAEditorToolBehaviorProvider_discardChangesMenuItemDescr;
- public static String JPAEditorToolBehaviorProvider_removeEntityFromDiagramButtonDescription;
- public static String JPAEditorToolBehaviorProvider_removeEntityFromDiagramButtonLabel;
- public static String JPAEditorToolBehaviorProvider_saveButtonText;
- public static String JPAEditorToolBehaviorProvider_saveButtonDescription;
-
- public static String JPAEditorToolBehaviorProvider_saveMenuItem;
-
- public static String JPAEditorToolBehaviorProvider_saveMenuItemDescr;
- public static String JPAEditorToolBehaviorProvider_restoreButtonText;
- public static String JPAEditorToolBehaviorProvider_restoreButtonDescription;
- public static String JPAEditorToolBehaviorProvider_removeAndSaveButtonText;
- public static String JPAEditorToolBehaviorProvider_removeAndSaveButtonDescription;
- public static String JPAEditorToolBehaviorProvider_showAllTheEntities;
- public static String JPAEditorToolBehaviorProvider_showAllTheEntitiesDesc;
- public static String JPAEditorToolBehaviorProvider_refactorSubMenu;
- public static String JPAEditorToolBehaviorProvider_renameEntityClass;
- public static String JPAEditorToolBehaviorProvider_moveEntityClass;
- public static String JPAEditorToolBehaviorProvider_openJPADetailsView;
- public static String JPAEditorToolBehaviorProvider_openJPADetailsViewDesc;
- public static String JPAEditorToolBehaviorProvider_openMiniatureView;
- public static String JPAEditorToolBehaviorProvider_openMiniatureViewDesc;
- public static String JPAEditorToolBehaviorProvider_applyPattern;
- public static String JPAEditorToolBehaviorProvider_applyPatternDesc;
- public static String JPAEditorToolBehaviorProvider_expandAttrMenuItem;
-
- public static String JPAEditorToolBehaviorProvider_expandAttrMenuItemDescr;
- public static String JPAEditorToolBehaviorProvider_expandCompartToolTip;
-
- public static String JPAEditorToolBehaviorProvider_expandEntityMenuItem;
- public static String JPAEditorToolBehaviorProvider_expandEntitymenuItemDescr;
-
- public static String JPAEditorToolBehaviorProvider_expandAllEntitiesMenuItem;
- public static String JPAEditorToolBehaviorProvider_expandAllEntitiesMenuItemDescr;
-
- public static String JPAEditorToolBehaviorProvider_refactorAttributeType;
- public static String JPAEditorToolBehaviorProvider_refactorAttributeTypeDesc;
- public static String JPAEditorToolBehaviorProvider_removeAllEntitiesMenu;
- public static String JPAEditorToolBehaviorProvider_removeAndSaveAllEntitiesAction;
- public static String JPAEditorToolBehaviorProvider_removeAndDiscardAllEntitiesAction;
- public static String JPAEditorToolBehaviorProvider_removeAndSaveAllEntitiesConfirmation;
- public static String JPAEditorToolBehaviorProvider_removeAndDiscardAllEntitiesConfirmation;
-
- public static String JPAEditorDiagramTypeProvider_cantMakeDiagramWritableTitle;
- public static String JPAEditorDiagramTypeProvider_cantMakeDiagramWritableMsg;
- public static String JPAEditorDiagramTypeProvider_JPADiagramReadOnlyTitle;
- public static String JPAEditorDiagramTypeProvider_JPADiagramReadOnlyMsg;
- public static String JPAEditorDiagramTypeProvider_JPADiagramReadOnlyHasToAddMsg;
-
- public static String OpenJpaDiagramActionDelegate_openJPADiagramErrorMsgTitle;
- public static String OpenJpaDiagramActionDelegate_openJPADiagramErrorMsg;
- public static String OpenJpaDiagramActionDelegate_jpaSupportWarningTitle;
- public static String OpenJpaDiagramActionDelegate_jpaSupportWarningMsg;
- public static String OpenJpaDiagramActionDelegate_noPersistenceUnitTitle;
- public static String OpenJpaDiagramActionDelegate_noPersistenceUnitMsg;
-
-
- public static String SaveAndRemoveAllEntitiesFeature_ContextMenuOperationDescription;
-
- public static String SelectTypeDialog_chooseAttributeTypeDialogText;
- public static String SelectTypeDialog_browseBtnTxt;
- public static String SelectTypeDialog_browseBtnDesc;
- public static String SelectTypeDialog_typeLabel;
- public static String SelectTypeDialog_chooseAttributeTypeDialogWindowTitle;
- public static String SelectTypeDialog_chooseAttributeTypeDialogTitle;
- public static String SelectTypeDialog_invalidTypeMsgTitle;
- public static String SelectTypeDialog_invalidTypeMsgText;
- public static String SelectTypeDialog_emptyTypeErrorText;
-
-
- public static String JPAEditorUtil_fullnameTooltipText;
- public static String JPAEditorUtil_typeTooltipText;
- public static String JPAEditorUtil_applyChangesJobName;
- public static String JPAEditorUtil_inheritTypeTooltipText;
-
-
- public static String PaletteCompartment_Connections;
- public static String PaletteCompartment_Objects;
-
- public static String JPASolver_closeWarningMsg;
- public static String JPASolver_closeEditors;
-
- public static String RefactorAttributeTypeFeature_ContextMenuOperationDescription;
-
- public static String RemoveJPAEntityFeature_discardWarningMsg;
-
- public static String RenameEntityFeature_ContextMenuOperationDescription;
-
- public static String BTN_OK;
- public static String BTN_CANCEL;
-
- public static String MoveEntityFeature_ContextMenuOperationDescription;
-
- public static String EntitiesCoordinatesXML_CannotCloseFileStreamErrorMSG;
-
- public static String EntitiesCoordinatesXML_CannotCreateDOMFileErrorMSG;
-
- public static String EntitiesCoordinatesXML_CannotFindFileErrorMSG;
-
- public static String EntitiesCoordinatesXML_CannotObtainProjectErrorMSG;
-
- public static String EntitiesCoordinatesXML_CannotParseFileErrorMSG;
-
- public static String EntitiesCoordinatesXML_CannotReadFileErrorMSG;
-
- public static String EntitiesCoordinatesXML_CannotRefrfreshFile;
-
- public static String ModelIntegrationUtil_CannotSetFileContentErrorMSG;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JPAEditorMessages.class);
- }
-
- private JPAEditorMessages() {
- }
-}
-
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/messages.properties b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/messages.properties
deleted file mode 100644
index 1a9895f849..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/i18n/messages.properties
+++ /dev/null
@@ -1,215 +0,0 @@
-################################################################################
-# <copyright>
-#
-# Copyright (c) 2005, 2010 SAP AG.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Petya Sabeva - initial API, implementation and documentation
-#
-# </copyright>
-#
-################################################################################
-AddJPAEntityFeature_basicAttributesShapes=Other Attributes
-AddJPAEntityFeature_primaryKeysShape=Primary Key
-AddJPAEntityFeature_relationAttributesShapes=Relation Attributes
-ClickAddAttributeButtonFeature_createAttributeButtonDescription=Create a new attribute of this entity.
-ClickAddAttributeButtonFeature_createAttributeButtonLabel=Create Attribute
-
-ClickRemoveAttributeButtonFeature_createAttributeButtonDescription=Create a new attribute of this entity.
-ClickRemoveAttributeButtonFeature_createAttributeButtonlabel=Create Attribute
-ClickRemoveAttributeButtonFeature_deleteAttributeQuestion=Do you want to delete attribute "{0}"?
-
-CreateDiagramJob_createDiagramJobName=Creating diagram for: {0}...
-CreateDiagramJob_getJPADiagramMonitorTaskName=Get JPA Diagram
-CreateJPAEntityFeature_createEntityErrorMsg=Entity could not be created.
-CreateJPAEntityFeature_createEntityErrorMsgTitle=Cannot Create Entity
-CreateJPAEntityFeature_createEntityErrorStatusMsg=Persistence API library is not into the project's classpath.
-CreateJPAEntityFeature_jpaEntityFeatureDescription=Create a new JPA entity.
-CreateJPAEntityFeature_jpaEntityFeatureName=Java Entity
-CreateJPAEntityFeature_jpaProjectSelectionDialogDescription=Select a JPA project to contain the entity.
-CreateJPAEntityFeature_jpaProjectSelectionDialogTitle=Select JPA Project
-CreateJPAEntityFromMappedSuperclassFeature_createInheritedEntityFeatureDescription=Create a new JPA entity that will inherit a new Mapped Superclass.
-CreateJPAEntityFromMappedSuperclassFeature_createInheritedEntityFeatureName=Inherited Entity
-
-CreateManyToManyBiDirRelationFeature_manyToManyBiDirFeatureName=Many-to-Many
-CreateManyToManyBiDirRelationFeature_manyToManyUniDirFeatureDescription=Create new bidirectional many-to-many relation.
-
-CreateManyToManyUniDirRelationFeature_manyToManyUniDirFeatureDescription=Create new unidirectional many-to-many relation.
-CreateManyToManyUniDirRelationFeature_manyToManyUniDirFeatureName=Many-to-Many
-
-CreateManyToOneBiDirRelationFeature_manyToOneBiDirFeatureDescription=Create new bidirectional many-to-one relation.
-CreateManyToOneBiDirRelationFeature_manyToOneBiDirFeatureName=Many-to-One
-
-CreateManyToOneUniDirRelationFeature_manyToOneUniDirFeatureDescription=Create new unidirectional many-to-one relation.
-CreateManyToOneUniDirRelationFeature_manyToOneUniDirFeatureName=Many-to-One
-
-CreateOneToManyUniDirRelationFeature_oneToManyUniDirFeatureDescription=Create new unidirectional one-to-many relation.
-CreateOneToManyUniDirRelationFeature_oneToManyUniDirFeatureName=One-to-Many
-
-CreateOneToOneBiDirRelationFeature_oneToOneBiDirFeatureDescription=Create new bidirectional one-to-one relation.
-CreateOneToOneBiDirRelationFeature_oneToOneBiDirFeatureName=One-to-One
-
-CreateOneToOneUniDirRelationFeature_oneToOneUniDirFeatureDescription=Create new unidirectional one-to-one relation.
-CreateOneToOneUniDirRelationFeature_oneToOneUniDirFeatureName=One-to-One
-
-DeleteFeature_deleteConfirm=Confirm Delete
-DeleteJPAEntityFeature_deleteJPAEntityQuestion=Do you want to remove the entity "{0}" from the diagram and delete the corresponding Java resource "{1}"?
-DeleteJPAEntityFeature_deleteJPAEntitiesQuestion=Do you want to remove the selected entities from the diagram and delete the corresponding Java resources?
-
-DeleteRelationFeature_deleteRelationQuestion=Do you want to remove this relation from the diagram and update the corresponding Java resources?
-
-DirectEditAttributeFeature_attributeExists=Attribute with name "{0}" already exists.
-DirectEditAttributeFeature_classNameMsg=Enter an attribute name.
-DirectEditAttributeFeature_lineBreaksNotAllowedMsg=You cannot use line breaks in attribute names.
-DirectEditAttributeFeature_spacesNotAllowedMsg=You cannot use spaces in attribute names.
-
-DirectEditJPAEntityFeature_bracesNotAllowedMsg=You cannot use braces in entity names.
-DirectEditJPAEntityFeature_classNameMsg=Enter an entity name.
-DirectEditJPAEntityFeature_duplicateEntityName=Entity with name "{0}" already exists.
-DirectEditJPAEntityFeature_lineBreaksNotAllowedMsg=You cannot use line breaks in entity names.
-DirectEditJPAEntityFeature_scpacesNotAllowedMsg=You cannot use spaces in entity names.
-DirectEditJPAEntityFeature_invalidSymbolsMsg="{0}" is not a valid entity name.
-DiscardAndRemoveAllEntitiesFeature_ContextMenuOperationDescription=Remove All Entities From Diagram and Discard Changes
-
-JpaArtifactFactory_CanNotCheckReturnType=Cannot check the return type
-
-JPADiagramEditor_waitingForMoin=Waiting for MOIN connection initialization...
-
-JPADiagramPropertyPage_errSavePropsMsgTitle=Cannot Save Properties
-JPADiagramPropertyPage_errSavePropsMsgText=The JPA diagram properties could not be saved
-
-JPAEditorPreferencesPage_pageDescription=Default settings for the JPA diagram editor:
-JPAEditorPreferencesPage_DefaultCollectionTypeSectionDescription=Relation attributes, which you generate using the JPA editor,\nare automatically created to be of the specified collection type.
-JPAEditorPreferencesPage_DefaultCollectionTypeSectionTittle=Default Collection Type
-JPAEditorPreferencesPage_DefaultPackageMsg=Entities, which you generate using the JPA editor palette,\nare automatically created in the specified package.
-JPAEditorPreferencesPage_DefaultTableNamePrefixMsg=Entities, which you have created, using the JPA editor palette, are automatically\nannotated with @Table(name=...), where the name of the table is a result of\nconcatenation of the given prefix and the name of the entity. If you set\na blank prefix, the newly created entities are not annotated with @Table.
-JPAEditorPreferencesPage_DefaultTableNameLabel=Default &table name prefix:
-JPAEditorPreferencesPage_DefaultPackageToUse=Default &Java package for new entities:
-JPAEditorPreferencesPage_invalidPackage="{0}" is not a valid Java identifier.
-JPAEditorPreferencesPage_invalidTableNamePrefix=Table name prefix may contain letters, digits and underscores only, and must not start with a digit.
-JPAEditorPreferencesPage_directEditAffectsClass=&Editing the entity name in the diagram affects the class name in the source file
-JPAEditorPreferencesPage_directEditAffectsClassTooltip=If this option is checked and the entity name is appointed\nby the @Entity annotation, direct entity name editing will\naffect the annotation and will cause class name refactoring.\nIf this option is unchecked, direct editing will affect the\nannotation only. If the entity name is not appointed by the\n@Entity annotation, direct editing will cause class name\nrefactoring regardless this option is checked or not.
-JPAEditorPreferencesPage_entityAccessTypeButtonGroupTooltip=Entities, which you generate using the JPA editor palette,\nare automatically created with the specified access.
-JPAEditorPreferencesPage_entityAccessTypeButtonGroupLabel=Entity access type
-JPAEditorPreferencesPage_entityFieldBasedAccessButtonLabel=&Field-based
-JPAEditorPreferencesPage_entityPropertyBasedAccessButtonLabel=&Property-based
-JPAEditorPreferencesPage_defaultFolderControlTooltip=The newly created diagram file(s) will be stored in this folder
-JPAEditorPreferencesPage_defaultFolderControlLabel=Folder for &diagrams:
-JPAEditorPreferencesPage_invalidFolder=The folder name must be preceded by "{0}".
-JPAEditorPreferencesPage_emptyFolder=The folder name for diagrams must not be empty.
-JPAEditorPreferencesPage_oneToManyOldStyle=&One-to-Many unidirectional old (JPA 1.0) style relations in JPA 2.0 projects
-JPAEditorPreferencesPage_oneToManyOldStyleTooltip=If this option is checked, the newly created One-to-Many\nunidirectional relations in JPA 2.0 projects will be old\n(JPA 1.0) style. I.e., the corresponding attributes will\nbe created without @JoinColumn(s) annotation.
-
-JPAEditorPropertyPage_oneToManyOldStyle=&One-to-Many unidirectional old (JPA 1.0) style relations
-JPAEditorPropertyPage_oneToManyOldStyleTooltip=If this option is checked, the newly created One-to-Many\nunidirectional relations will be old (JPA 1.0) style.\nI.e., the corresponding attributes will be created without\n@JoinColumn(s) annotation.
-
-JPAEditorToolBehaviorProvider_collapseAttrGroupMenuItem=Collapse Attributes Group
-JPAEditorToolBehaviorProvider_collapseAttrGroupMenuItemDescr=Collapse the attributes group.
-JPAEditorToolBehaviorProvider_collapseCompartToolTip=Double click to collapse "{0}" attributes group.
-JPAEditorToolBehaviorProvider_collapseEntityMenuItem=Collapse Entity
-JPAEditorToolBehaviorProvider_collapseEntityMenuItemDescr=Collapse entity.
-JPAEditorToolBehaviorProvider_collapseAllEntitiesMenuItem=Collapse All
-JPAEditorToolBehaviorProvider_collapseAllEntitiesMenuItemDescr=Collapse all entities
-JPAEditorToolBehaviorProvider_createAttributeButtonDescription=Create new attribute of this entity.
-JPAEditorToolBehaviorProvider_createAttributeButtonlabel=Create Attribute
-JPAEditorToolBehaviorProvider_customSubMenuDescription=Custom features submenu
-JPAEditorToolBehaviorProvider_customSubMenuText=Custom
-JPAEditorToolBehaviorProvider_deleteAttributeButtonDescription=Delete this attribute from the model.
-JPAEditorToolBehaviorProvider_deleteAttributeButtonlabel=Delete Attribute
-JPAEditorToolBehaviorProvider_deleteEntityFromModelButtonDescription=Remove this JPA entity from the diagram and delete it from the JPA model.
-JPAEditorToolBehaviorProvider_deleteEntityFromModelButtonLabel=Delete
-JPAEditorToolBehaviorProvider_discardChangesMenuItem=Discard Changes
-JPAEditorToolBehaviorProvider_discardChangesMenuItemDescr=Discard all changes made to this JPA entity after the last saving.
-JPAEditorToolBehaviorProvider_removeEntityFromDiagramButtonDescription=Discard all changes made to this JPA entity after the last saving and remove it from the diagram.
-JPAEditorToolBehaviorProvider_removeEntityFromDiagramButtonLabel=Discard Changes and Remove
-JPAEditorToolBehaviorProvider_saveButtonText=Save
-JPAEditorToolBehaviorProvider_saveButtonDescription=Save all changes made to this JPA entity.
-JPAEditorToolBehaviorProvider_saveMenuItem=Save
-JPAEditorToolBehaviorProvider_saveMenuItemDescr=Save all changes made to this JPA entity.
-JPAEditorToolBehaviorProvider_restoreButtonText=Discard Changes
-JPAEditorToolBehaviorProvider_restoreButtonDescription=Discard all changes made to this JPA entity after the last saving.
-JPAEditorToolBehaviorProvider_removeAndSaveButtonText=Save And Remove
-JPAEditorToolBehaviorProvider_removeAndSaveButtonDescription=Save all changes made to this entity and remove it from the diagram.
-JPAEditorToolBehaviorProvider_showAllTheEntities=Show All Entities
-JPAEditorToolBehaviorProvider_showAllTheEntitiesDesc=Show all entities within the project on the diagram.
-JPAEditorToolBehaviorProvider_refactorSubMenu=Refactor Entity Class
-JPAEditorToolBehaviorProvider_renameEntityClass=Rename...
-JPAEditorToolBehaviorProvider_moveEntityClass=Move...
-JPAEditorToolBehaviorProvider_openJPADetailsView=Open JPA Details View
-JPAEditorToolBehaviorProvider_openJPADetailsViewDesc=Open the JPA Details view to view/modify the details of the selected persistent object.
-JPAEditorToolBehaviorProvider_openMiniatureView=Open Miniature View
-JPAEditorToolBehaviorProvider_openMiniatureViewDesc=Open the Miniature view to display the diagram in a larger scale.
-JPAEditorToolBehaviorProvider_applyPattern=Apply Template...
-JPAEditorToolBehaviorProvider_applyPatternDesc=Apply Template
-JPAEditorToolBehaviorProvider_expandAttrMenuItem=Expand Attributes Group
-JPAEditorToolBehaviorProvider_expandAttrMenuItemDescr=Expand the attributes group.
-JPAEditorToolBehaviorProvider_expandCompartToolTip=Double click to expand "{0}" attributes group.
-JPAEditorToolBehaviorProvider_expandEntityMenuItem=Expand Entity
-JPAEditorToolBehaviorProvider_expandEntitymenuItemDescr=Expand entity.
-JPAEditorToolBehaviorProvider_expandAllEntitiesMenuItem=Expand All
-JPAEditorToolBehaviorProvider_expandAllEntitiesMenuItemDescr=Expand all entities.
-JPAEditorToolBehaviorProvider_refactorAttributeType=Refactor Attribute Type...
-JPAEditorToolBehaviorProvider_refactorAttributeTypeDesc=Change the type of the selected attribute.
-JPAEditorToolBehaviorProvider_removeAllEntitiesMenu=Remove All Entities From Diagram
-JPAEditorToolBehaviorProvider_removeAndSaveAllEntitiesAction=...and Save Changes
-JPAEditorToolBehaviorProvider_removeAndDiscardAllEntitiesAction=...and Discard Changes
-JPAEditorToolBehaviorProvider_removeAndSaveAllEntitiesConfirmation=Do you want to save the changes and remove all entities from the diagram?
-JPAEditorToolBehaviorProvider_removeAndDiscardAllEntitiesConfirmation=Do you want to discard the changes and remove all entities from the diagram?
-
-JPAEditorDiagramTypeProvider_cantMakeDiagramWritableTitle=Can't Make Diagram Writable
-JPAEditorDiagramTypeProvider_cantMakeDiagramWritableMsg=Cannot make the JPA diagram file writable:\n\n{0}
-JPAEditorDiagramTypeProvider_JPADiagramReadOnlyTitle=JPA Diagram Read-Only
-JPAEditorDiagramTypeProvider_JPADiagramReadOnlyMsg=The JPA diagram file is read-only and cannot be synchronized with the model. In order to open the diagram, the JPA editor must make this file writable.
-JPAEditorDiagramTypeProvider_JPADiagramReadOnlyHasToAddMsg=Cannot show the selected entity in the JPA diagram, because the diagram file is read-only. In order to show the entity, the JPA editor must make this file writable.
-
-OpenJpaDiagramActionDelegate_openJPADiagramErrorMsgTitle=Cannot Open Diagram
-OpenJpaDiagramActionDelegate_openJPADiagramErrorMsg=Cannot open the JPA diagram editor
-OpenJpaDiagramActionDelegate_jpaSupportWarningTitle=JPA Support
-OpenJpaDiagramActionDelegate_jpaSupportWarningMsg=JPA Diagram Editor has partial JPA 2.0 support only. When you use it with JPA 2.0 enabled projects you should visualize JPA 1.0 compliant entities only. Otherwise, the editor behavior will become erratic.
-OpenJpaDiagramActionDelegate_noPersistenceUnitTitle=No Persistence Unit
-OpenJpaDiagramActionDelegate_noPersistenceUnitMsg=The JPA Diagram Editor can not be open, because the persistence unit does not exist or is corrupted.
-
-JPAEditorUtil_fullnameTooltipText=\ Class Name: {0}
-JPAEditorUtil_typeTooltipText=\ Type: {0}
-JPAEditorUtil_applyChangesJobName=Apply changes to persistence.xml.
-JPAEditorUtil_inheritTypeTooltipText=\ Class Name: {0} \n This entity inherits {1}
-
-PaletteCompartment_Connections=Relations
-PaletteCompartment_Objects=Entities
-
-BTN_OK=OK
-BTN_CANCEL=Cancel
-EntitiesCoordinatesXML_CannotCloseFileStreamErrorMSG=Cannot close the stream
-EntitiesCoordinatesXML_CannotCreateDOMFileErrorMSG=Cannot create DOM file.
-EntitiesCoordinatesXML_CannotFindFileErrorMSG=Cannot find file.
-EntitiesCoordinatesXML_CannotObtainProjectErrorMSG=Cannot obtain project.
-EntitiesCoordinatesXML_CannotParseFileErrorMSG=Cannot parse file.
-EntitiesCoordinatesXML_CannotReadFileErrorMSG=Cannot read file.
-EntitiesCoordinatesXML_CannotRefrfreshFile=Cannot refresh the diagram xml file.
-
-SelectTypeDialog_chooseAttributeTypeDialogText=Select a primitive type for the attribute "{0}" of the entity "{1}" or choose the "Browse" button to select a class type.
-SelectTypeDialog_browseBtnTxt=&Browse...
-SelectTypeDialog_browseBtnDesc=Browse to select a class.
-SelectTypeDialog_typeLabel=&Type:
-SelectTypeDialog_chooseAttributeTypeDialogWindowTitle=Select Type
-SelectTypeDialog_chooseAttributeTypeDialogTitle=Select New Attribute Type
-SelectTypeDialog_invalidTypeMsgTitle=Invalid Type
-SelectTypeDialog_invalidTypeMsgText="{0}" is not valid java type or primitive.
-SelectTypeDialog_emptyTypeErrorText=The new type name must not be empty
-
-JPASolver_closeWarningMsg=The entity "{0}" is open elsewhere with identical changes. Using this button will not lose those changes. Close the other editor(s), where the entity "{0}" is open and try again!
-JPASolver_closeEditors=Close Editors
-MoveEntityFeature_ContextMenuOperationDescription=Move Entity Class
-
-RefactorAttributeTypeFeature_ContextMenuOperationDescription=Refactor Attribute Type
-ModelIntegrationUtil_CannotSetFileContentErrorMSG=Cannot set file content.
-
-RemoveJPAEntityFeature_discardWarningMsg=The entity "{0}" is open elsewhere with identical changes. Using this button will remove the entity from the diagram, but will not lose those changes. In order to lose the changes you need first to close the other editor(s), where the entity "{0}" is open and try again!\n\nDo you want to continue with removing anyway?
-
-RenameEntityFeature_ContextMenuOperationDescription=Rename Entity Class
-
-SaveAndRemoveAllEntitiesFeature_ContextMenuOperationDescription=Remove All Entities From Diagram and Save Changes
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPADiagramEditorInput.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPADiagramEditorInput.java
deleted file mode 100644
index d73728f58b..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPADiagramEditorInput.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPADiagramEditorInput;
-
-
-public class JPADiagramEditorInput extends DiagramEditorInput
- implements IJPADiagramEditorInput {
-
- private Diagram diagram;
- private String projectName;
-
-
- public JPADiagramEditorInput(Diagram diagram,
- String diagramUriString,
- TransactionalEditingDomain domain,
- String providerId,
- boolean disposeEditingDomain) {
-
- super(diagramUriString, domain, providerId, disposeEditingDomain);
- this.diagram = diagram;
- this.projectName = ModelIntegrationUtil.getProjectByDiagram(diagram.getName()).getName();
- }
-
- public JPADiagramEditorInput(Diagram diagram,
- URI diagramUri,
- TransactionalEditingDomain domain,
- String providerId,
- boolean disposeEditingDomain) {
-
- super(diagramUri, domain, providerId, disposeEditingDomain);
- this.diagram = diagram;
- this.projectName = ModelIntegrationUtil.getProjectByDiagram(diagram.getName()).getName();
- }
-
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter) {
- if (adapter.equals(EObject.class)) {
- return getDiagram();
- }
- if (adapter.equals(Diagram.class)) {
- return getDiagram();
- }
- if (adapter.equals(TransactionalEditingDomain.class))
- return ModelIntegrationUtil.getTransactionalEditingDomain(diagram);
- if (adapter.equals(IFile.class)) {
- Resource eResource = diagram.eResource();
- URI eUri = eResource.getURI();
- if (eUri.isPlatformResource()) {
- String platformString = eUri.toPlatformString(true);
- return ResourcesPlugin.getWorkspace().getRoot()
- .findMember(platformString);
- } else {
- IProject project = ModelIntegrationUtil.getProjectByDiagram(
- diagram.getName()).getProject();
- return findXMLFile(project);
- }
- }
- return null;
- }
-
- private IFile findXMLFile(IProject project){
- try {
- IResource[] resources = project.members();
- for (IResource res : resources) {
- if (res instanceof IFolder) {
- IFile existingXMLFile = ((IFolder) res)
- .getFile(diagram.getName()
- + "." + ModelIntegrationUtil.DIAGRAM_XML_FILE_EXTENSION); //$NON-NLS-1$
- if (existingXMLFile != null && existingXMLFile.exists()) {
- return existingXMLFile;
- }
- }
- }
- } catch (CoreException e) {
- JPADiagramEditorPlugin
- .logError(
- JPAEditorMessages.EntitiesCoordinatesXML_CannotObtainProjectErrorMSG,
- e);
- }
- IFile existingXMLFile = project.getFile(ModelIntegrationUtil
- .getDiagramsXMLFolderPath(project)
- .append(diagram.getName())
- .addFileExtension(
- ModelIntegrationUtil.DIAGRAM_XML_FILE_EXTENSION));
- if (existingXMLFile != null && existingXMLFile.exists()) {
- return existingXMLFile;
- }
- return null;
- }
-
- public Diagram getDiagram() {
- return diagram;
- }
-
- public static JPADiagramEditorInput createEditorInput(Diagram diagram, TransactionalEditingDomain domain, String providerId,
- boolean disposeEditingDomain) {
- final Resource resource = diagram.eResource();
- if (resource == null) {
- throw new IllegalArgumentException();
- }
- final String fragment = resource.getURIFragment(diagram);
- final URI fragmentUri = resource.getURI().appendFragment(fragment);
- JPADiagramEditorInput diagramEditorInput;
- diagramEditorInput = new JPADiagramEditorInput(diagram, fragmentUri, domain, providerId, disposeEditingDomain);
- return diagramEditorInput;
- }
-
-
- public String getProjectName() {
- return projectName;
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPAEditorMatchingStrategy.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPAEditorMatchingStrategy.java
deleted file mode 100644
index 68c0979430..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/JPAEditorMatchingStrategy.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.IModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPADiagramEditorInput;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorMatchingStrategy;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PartInitException;
-
-
-public class JPAEditorMatchingStrategy implements IEditorMatchingStrategy {
-
- private IJPAEditorFeatureProvider fp = null;
-
- private static final String CODE_GENERATED = "CODE_GENERATED"; //$NON-NLS-1$
- public static final String DOUBLE_CLICK = "DOUBLE_CLICK"; //$NON-NLS-1$
-
-
- public JPAEditorMatchingStrategy() {}
-
- /**
- * This constructor is intended solely for the test purposes
- *
- * @param fp the feature provider
- */
- public JPAEditorMatchingStrategy(IJPAEditorFeatureProvider fp) {
- this.fp = fp;
- }
-
- public boolean matches(IEditorReference editorRef, IEditorInput input) {
- if (input instanceof IFileEditorInput) {
- IFileEditorInput fileInput = (IFileEditorInput) input;
- IFile entityFile = fileInput.getFile();
- if(!entityFile.getName().endsWith(".java")){ //$NON-NLS-1$
- return false;
- }
- try {
- QualifiedName qn = new QualifiedName(null, DOUBLE_CLICK);
- if ("true".equals(entityFile.getSessionProperty(qn))) { //$NON-NLS-1$
- entityFile.setSessionProperty(qn, null);
- return false;
- }
- } catch (CoreException e1) {
- JPADiagramEditorPlugin.logError("Cannot get session property DOUBLE_CLICK", e1); //$NON-NLS-1$
- }
- JavaPersistentType inputJptType = null;
-
- if (fp == null) {
- inputJptType = JPAEditorUtil.getJPType(JavaCore.createCompilationUnitFrom(entityFile));
- } else {
- inputJptType = fp.getJPAEditorUtil().getJPType(JavaCore.createCompilationUnitFrom(entityFile));
- }
- if (inputJptType == null)
- return false;
- PersistenceUnit persistenceUnit = inputJptType.getPersistenceUnit();
- JpaProject jpaProject = persistenceUnit.getJpaProject();
-
- try {
- IEditorInput editorInput = editorRef.getEditorInput();
- if (editorInput instanceof IJPADiagramEditorInput) {
- IJPADiagramEditorInput jpInput = (IJPADiagramEditorInput) editorInput;
- Diagram diagram = jpInput.getDiagram();
- if (diagram != null) {
-
- IJPAEditorFeatureProvider featureProvider = null;
- IDiagramTypeProvider diagramProvider = null;
- if (fp != null) {
- featureProvider = this.fp;
- diagramProvider = featureProvider.getDiagramTypeProvider();
- } else {
- diagramProvider = ModelIntegrationUtil.getProviderByDiagram(diagram.getName());
- featureProvider = (IJPAEditorFeatureProvider)diagramProvider.getFeatureProvider();
- }
- IModelIntegrationUtil moinIntegrationUtil = featureProvider.getMoinIntegrationUtil();
- JpaProject jpaProjectFromEditor = moinIntegrationUtil.getProjectByDiagram(diagram);
- if (jpaProject.equals(jpaProjectFromEditor)) {
- if (fileInput.getName() != CODE_GENERATED)
- return false;
- PictogramElement pe = featureProvider.getPictogramElementForBusinessObject(inputJptType);
- if (pe != null) {
- diagramProvider.getDiagramEditor().setPictogramElementForSelection(pe);
- return true;
- }
-
- ICustomFeature feature = featureProvider.getAddAllEntitiesFeature();
- CustomContext context = new CustomContext();
- feature.execute(context);
- return true;
- }
- }
- }
- } catch (PartInitException e) {
- JPADiagramEditorPlugin.getDefault().getLog().log(e.getStatus());
- }
- } else if (input instanceof IJPADiagramEditorInput) {
- return editorRef.getPartName().equals(((IJPADiagramEditorInput) input).getProjectName());
- }
- return false;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/OpenJpaDiagramActionDelegate.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/OpenJpaDiagramActionDelegate.java
deleted file mode 100644
index a629d3dc93..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/ui/OpenJpaDiagramActionDelegate.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui;
-
-import java.lang.ref.WeakReference;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.platform.IDiagramEditor;
-import org.eclipse.graphiti.ui.editor.DiagramEditorInput;
-import org.eclipse.graphiti.ui.internal.Messages;
-import org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IconAndMessageDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.CreateDiagramJob;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorDiagramTypeProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.Wrp;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchListener;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-
-@SuppressWarnings({ "unused", "restriction" })
-public class OpenJpaDiagramActionDelegate implements IObjectActionDelegate {
-
- private class OpenEditorRunnable implements Runnable {
- private Diagram diagram;
-
- private OpenEditorRunnable(Diagram diagram) {
- this.diagram = diagram;
- }
-
- public void run() {
- //ModelIntegrationUtil.mapDiagramToProject(diagram, jpaProject);
- openDiagramEditor(diagram);
- }
- }
-
- public static IDiagramEditor openDiagramEditor(Diagram diagram) {
-
- String diagramName = diagram.getName();
- JpaProject jpaProject = ModelIntegrationUtil.getProjectByDiagram(diagramName);
- if (!JPAEditorUtil.checkJPAFacetVersion(jpaProject, "1.0") && !ModelIntegrationUtil.isDiagramOpen(diagramName)) { //$NON-NLS-1$
- boolean wasEnabled = OptionalMessageDialog.isDialogEnabled(JPAEditorConstants.JPA_SUPPORT_DIALOG_ID);
- int btnIndex = OptionalMessageDialog.open(JPAEditorConstants.JPA_SUPPORT_DIALOG_ID,
- Display.getDefault().getShells()[0],
- JPAEditorMessages.OpenJpaDiagramActionDelegate_jpaSupportWarningTitle,
- Display.getDefault().getSystemImage(SWT.ICON_WARNING),
- JPAEditorMessages.OpenJpaDiagramActionDelegate_jpaSupportWarningMsg,
- 0,
- new String[] {JPAEditorMessages.BTN_OK},
- 0);
- }
-
- TransactionalEditingDomain defaultTransEditDomain = TransactionUtil.getEditingDomain((diagram.eResource().getResourceSet()));
- final JPADiagramEditorInput diagramEditorInput = JPADiagramEditorInput.createEditorInput(diagram, defaultTransEditDomain, JPAEditorDiagramTypeProvider.ID, false);
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- final IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- final Wrp wrp = new Wrp();
- try {
- final IEditorPart editorPart = IDE.openEditor(workbenchPage, diagramEditorInput, JPADiagramEditor.ID);
- if (editorPart instanceof JPADiagramEditor) {
- JPADiagramEditor ret = (JPADiagramEditor) editorPart;
- wrp.setObj(ret);
- PlatformUI.getWorkbench().addWorkbenchListener( new IWorkbenchListener() {
- public boolean preShutdown( IWorkbench workbench, boolean forced ) {
- workbenchPage.closeEditor( editorPart, true);
- return true;
- }
-
- public void postShutdown( IWorkbench workbench ){
-
- }
- });
- //CSN #1305850 2010
- //if(ret.isDirty())
- // ret.doSave(new NullProgressMonitor());
- }
- } catch (PartInitException e) {
- JPADiagramEditorPlugin.logError("Can't open JPA editor", e); //$NON-NLS-1$
- }
- return (JPADiagramEditor)wrp.getObj();
- }
-
-
- private static final String ERROR_OPENING_DIAGRAM = JPAEditorMessages.OpenJpaDiagramActionDelegate_openJPADiagramErrorMsg;
- private JpaProject jpaProject;
- private Shell shell;
- private WeakReference<ISelection> selectionRef = new WeakReference<ISelection>(null);
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- shell = targetPart.getSite().getShell();
- }
-
- public void run(IAction action) {
- PersistenceUnit persistenceUnit = null;
- try {
- persistenceUnit = obtainJpaProjectAndPersistenceUnit(selectionRef.get());
- } catch (Exception e) {
- handleException(e);
- return;
- }
- if (persistenceUnit == null) {
- MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- JPAEditorMessages.OpenJpaDiagramActionDelegate_noPersistenceUnitTitle,
- JPAEditorMessages.OpenJpaDiagramActionDelegate_noPersistenceUnitMsg);
- return;
- }
- final CreateDiagramJob createDiagramRunnable = new CreateDiagramJob(persistenceUnit, 10, true);
- createDiagramRunnable.setRule(ResourcesPlugin.getWorkspace().getRoot());
- createDiagramRunnable.addJobChangeListener(new JobChangeAdapter(){
- public void done(IJobChangeEvent event) {
- shell.getDisplay().syncExec(new OpenEditorRunnable(createDiagramRunnable.getDiagram()));
- }
- });
- createDiagramRunnable.setUser(true);
- createDiagramRunnable.schedule();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- selectionRef = new WeakReference<ISelection>(selection);
- }
-
- protected PersistenceUnit obtainJpaProjectAndPersistenceUnit(ISelection selection) throws CoreException {
- Object firstElement = ((IStructuredSelection) selection).getFirstElement();
- if (firstElement instanceof JpaNode) {
- jpaProject = ((JpaNode)firstElement).getJpaProject();
- } else if (firstElement instanceof IProject) {
- jpaProject = JpaArtifactFactory.instance().getJpaProject((IProject)firstElement);
- }
- return JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- }
-
-
- private void handleException(Exception e) {
- JPADiagramEditorPlugin.logError(ERROR_OPENING_DIAGRAM, e);;
- IStatus status = new ErrStatus(IStatus.ERROR, JPADiagramEditor.ID, e.toString(), e);
- ErrorDialog.openError(shell, JPAEditorMessages.OpenJpaDiagramActionDelegate_openJPADiagramErrorMsgTitle,
- ERROR_OPENING_DIAGRAM, status);
- }
-
- private class ErrStatus extends Status {
-
- public ErrStatus(int severity, String pluginId, String message, Throwable exception) {
- super(severity, message, message, exception);
- }
-
- public IStatus[] getChildren() {
- StackTraceElement[] st = getException().getStackTrace();
- IStatus[] res = new IStatus[st == null ? 0 : st.length];
- for (int i = 0; i < st.length; i++)
- res[i] = new Status(IStatus.ERROR, JPADiagramEditor.ID, st[i].toString());
- return res;
- }
- }
-
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/CreateDiagramJob.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/CreateDiagramJob.java
deleted file mode 100644
index e2ea8f112d..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/CreateDiagramJob.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-
-
-public class CreateDiagramJob extends Job {
-
- //private Connection moinConnection = null;
- private PersistenceUnit persistenceUnit;
- private Diagram diagram;
- private int grid;
- private boolean snap;
-
- /*
- public Connection getMoinConnection() {
- return moinConnection;
- }
- */
-
- public Diagram getDiagram() {
- return diagram;
- }
-
- public CreateDiagramJob(PersistenceUnit persistenceUnit, int grid, boolean snap) {
- super(MessageFormat.format(JPAEditorMessages.CreateDiagramJob_createDiagramJobName, new Object[] { persistenceUnit.getJpaProject().getName()}));
- this.persistenceUnit = persistenceUnit;
- this.grid = grid;
- this.snap = snap;
- }
-
- public IStatus run(IProgressMonitor monitor) {
- //IProject project = persistenceUnit.getJpaProject().getProject();
- try{
- monitor.beginTask(JPAEditorMessages.CreateDiagramJob_getJPADiagramMonitorTaskName, 3);
- monitor.worked(1);
- //moinConnection = ConnectionManager.getInstance().createConnection(project);
- monitor.worked(1);
- diagram = ModelIntegrationUtil.createDiagram(persistenceUnit, grid, snap);
- monitor.worked(1);
- } catch (CoreException e) {
- return e.getStatus();
- }
- return Status.OK_STATUS;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/IModelIntegrationUtil.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/IModelIntegrationUtil.java
deleted file mode 100644
index 6e8c6ce775..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/IModelIntegrationUtil.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util;
-
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-public interface IModelIntegrationUtil {
- public JpaProject getProjectByDiagram(Diagram diagram);
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtil.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtil.java
deleted file mode 100644
index 2196274861..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtil.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.ref.WeakReference;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.WeakHashMap;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.filesystem.IFileSystem;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.editor.DiagramEditorFactory;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorDiagramTypeProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-
-public class ModelIntegrationUtil {
-
- public static final String DIAGRAM_FILE_EXTENSION = "xmi"; //$NON-NLS-1$
- public static final String DIAGRAM_XML_FILE_EXTENSION = "xml"; //$NON-NLS-1$
- public static final String JPA_DIAGRAM_TYPE = "JPA Diagram"; //$NON-NLS-1$
- public static final String DEFAULT_RES_FOLDER = "src"; //$NON-NLS-1$
-
- private static boolean xmiExists = false;
- private static WeakHashMap<IProject, WeakReference<Diagram>> projectToDiagram = new WeakHashMap<IProject, WeakReference<Diagram>>();
-
- public static IPath createDiagramPath(PersistenceUnit persistenceUnit) throws CoreException {
- IProject project = persistenceUnit.getJpaProject().getProject();
- String diagramName = persistenceUnit.getJpaProject().getName();
- IPath newXMIFilePath = getDiagramsFolderPath(project).append(diagramName).addFileExtension(DIAGRAM_FILE_EXTENSION);
- IFileSystem fileSystem = EFS.getLocalFileSystem();
- IFileStore newXMIFile = fileSystem.getStore(newXMIFilePath);
-
- IPath folderPath = copyExistingXMIContentAndDeleteFile(project, diagramName, newXMIFile);
- if(folderPath != null){
- IPath path = new Path(folderPath.segment(0));
- for (int i = 1; i < folderPath.segmentCount(); i++) {
- path = path.append(folderPath.segment(i));
- IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
- if (!folder.exists())
- folder.create(true, true, null);
- }
- IFile diagramXMLFile = ResourcesPlugin.getWorkspace().getRoot().getFile(folderPath.append(diagramName).addFileExtension(DIAGRAM_XML_FILE_EXTENSION));
- String content = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"+ //$NON-NLS-1$
- "<entities>\n"+ //$NON-NLS-1$
- "</entities>\n"; //$NON-NLS-1$
- if(diagramXMLFile == null || !diagramXMLFile.exists()){
- InputStream source = new ByteArrayInputStream(content.getBytes());
- diagramXMLFile.create(source, true, new NullProgressMonitor());
- } else
- try {
- if(diagramXMLFile.getContents().read() == -1){
- diagramXMLFile.setContents(new ByteArrayInputStream(content.getBytes()), true, false, new NullProgressMonitor());
- }
- } catch (IOException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.ModelIntegrationUtil_CannotSetFileContentErrorMSG, e);
- }
- }
-
- return newXMIFilePath;
- }
-
- private static IPath copyExistingXMIContent(IContainer container,
- String xmiFileName, IFileStore newXMIFile) throws JavaModelException, CoreException {
- IPath folderPath = null;
- IResource[] resources = container.members();
- for(IResource res : resources){
- if(res instanceof IFolder) {
- folderPath = ((IFolder)res).getFullPath();
- IFile existingXMIFile =((IFolder)res).getFile(xmiFileName); //$NON-NLS-1$
- if(existingXMIFile != null && existingXMIFile.exists()){
- IFileStore folder = EFS.getLocalFileSystem().getStore(existingXMIFile.getLocationURI());
- folder.copy(newXMIFile, EFS.OVERWRITE, null);
- existingXMIFile.delete(true, new NullProgressMonitor());
- setXmiExists(true);
- return folderPath;
- }
- }
- if(res instanceof IContainer)
- copyExistingXMIContent((IContainer)res,
- xmiFileName, newXMIFile);
- }
- return null;
- }
-
- public static IPath copyExistingXMIContentAndDeleteFile(IProject project,
- String diagramName, IFileStore newXMIFile) throws JavaModelException, CoreException {
- String xmiFileName = diagramName + "." + DIAGRAM_FILE_EXTENSION; //$NON-NLS-1$
- IPath folderPath = copyExistingXMIContent(project, xmiFileName, newXMIFile);
- if (folderPath != null)
- return folderPath;
- IPath projectPath = project.getFullPath();
- folderPath = projectPath.append(getDiagramsXMLFolderPath(project));
- return folderPath;
- }
-
- public static Diagram createDiagram(PersistenceUnit persistenceUnit,
- int grid,
- boolean snap) throws CoreException {
- IPath path = createDiagramPath(persistenceUnit);
- Diagram d = createDiagram(persistenceUnit.getJpaProject().getProject(), path, persistenceUnit.getJpaProject().getName(), grid, snap);
- return d;
- }
-
- public static TransactionalEditingDomain getTransactionalEditingDomain(Diagram diagram) {
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(diagram);
- return editingDomain;
- }
-
- public static ResourceSet getResourceSet(Diagram diagram) {
- JpaProject jpaProject = getProjectByDiagram(diagram.getName());
- if (jpaProject == null)
- return null;
- TransactionalEditingDomain defaultTransEditDomain = (TransactionalEditingDomain)jpaProject.getProject().getAdapter(TransactionalEditingDomain.class);
- ResourceSet resourceSet = defaultTransEditDomain.getResourceSet();
- return resourceSet;
- }
-
- private static class Wrp {
- private Object o;
- public Object getObject() {
- return o;
- }
-
- public void setObject(Object o) {
- this.o = o;
- }
- }
-
- public static Diagram createDiagram(IProject project,
- IPath diagramFileName,
- String diagramName,
- int grid,
- boolean snap) {
-
- Diagram diagram = getDiagramByProject(project);
- if (diagram != null)
- return diagram;
- TransactionalEditingDomain defaultTransEditDomain = DiagramEditorFactory.createResourceSetAndEditingDomain();
- ResourceSet resourceSet = defaultTransEditDomain.getResourceSet();
-
- String pathName = diagramFileName.toString();
- URI resourceURI = URI.createFileURI(pathName);
- final Resource resource = resourceSet.createResource(resourceURI);
- //resource.setTrackingModification(false);
- //(ResourceSetManager.getProjectForResourceSet(resourceSet));
- defaultTransEditDomain.getCommandStack().execute(new RecordingCommand(defaultTransEditDomain) {
- @Override
- protected void doExecute() {
- try {
- resource.load(null);
- } catch (IOException e) {
- JPADiagramEditorPlugin.logInfo("The diagram file does not exist. It will be created"); //$NON-NLS-1$
- JPADiagramEditorPlugin.logInfo(e.getLocalizedMessage());
- }
- }
- });
-
- if (!resource.isLoaded())
- return createNewDiagram(project, defaultTransEditDomain, resourceSet, resource, diagramName, grid, snap);
-
- EList<EObject> objs = resource.getContents();
- if (objs == null)
- return createNewDiagram(project, defaultTransEditDomain, resourceSet, resource, diagramName, grid, snap);
- Iterator<EObject> it = objs.iterator();
- while (it.hasNext()) {
- EObject obj = it.next();
- if ((obj == null) && !Diagram.class.isInstance(obj))
- continue;
- diagram = (Diagram)obj;
- //diagramsToResources.put(diagram, resource);
- defaultTransEditDomain.getCommandStack().flush();
- return diagram;
- }
- return createNewDiagram(project, defaultTransEditDomain, resourceSet, resource, diagramName, grid, snap);
- }
-
- private static Diagram createNewDiagram(final IProject project,
- TransactionalEditingDomain editingDomain,
- ResourceSet resourceSet,
- final Resource resource,
- final String diagramName,
- final int grid,
- final boolean snap) {
- final Wrp wrp = new Wrp();
- editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
- @Override
- protected void doExecute() {
- Diagram diagram = Graphiti.getPeService().createDiagram(JPA_DIAGRAM_TYPE, diagramName, grid, snap);
- projectToDiagram.put(project, new WeakReference<Diagram>(diagram));
- wrp.setObject(diagram);
- resource.getContents().add(diagram);
- try {
- resource.save(Collections.EMPTY_MAP);
- } catch (IOException e) {
- JPADiagramEditorPlugin.logError("Cannot create new diagram", e); //$NON-NLS-1$
- }
- }
- });
- editingDomain.getCommandStack().flush();
- //mapDiagramToProject((Diagram)wrp.getObject(), resource);
- return (Diagram)wrp.getObject();
- }
-
- public static IPath getResourceFolderPath(IProject project) {
- return getEMFResourceFolderPath(project);
- }
-
- public static IPath getEMFResourceFolderPath(IProject project) {
- return project.getProjectRelativePath().append(DEFAULT_RES_FOLDER);
- }
-
- public static IPath getDiagramsXMLFolderPath(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return new Path(JPADiagramPropertyPage.getDefaultFolder(project, props));
- }
-
- public static IPath getDiagramsFolderPath(IProject project){
- return JPADiagramEditorPlugin.getDefault().getStateLocation();
- }
-
- public static JpaProject getProjectByDiagram(String diagramName) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(diagramName);
- try {
- return JpaArtifactFactory.instance().getJpaProject(project);
- } catch (CoreException e) {
- return null;
- }
- }
-
- public static boolean isDiagramOpen(String diagramName) {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- IEditorReference[] editorRefs = workbenchPage.getEditorReferences();
- for (IEditorReference editorRef : editorRefs) {
- if(!JPADiagramEditorPlugin.PLUGIN_ID.equals(editorRef.getId()))
- continue;
- JPADiagramEditor editor = (JPADiagramEditor)editorRef.getEditor(false);
- if (editor == null)
- continue;
- JPAEditorDiagramTypeProvider diagramProvider = editor.getDiagramTypeProvider();
- Diagram d = diagramProvider.getDiagram();
- if (diagramName.equals(d.getName()))
- return true;
- }
- return false;
- }
-
-
- public static JPAEditorDiagramTypeProvider getProviderByDiagram(String diagramName) {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- IEditorReference[] editorRefs = workbenchPage.getEditorReferences();
- for (IEditorReference editorRef : editorRefs) {
- if(!JPADiagramEditorPlugin.PLUGIN_ID.equals(editorRef.getId()))
- continue;
- JPADiagramEditor editor = (JPADiagramEditor)editorRef.getEditor(false);
- if (editor == null)
- continue;
- JPAEditorDiagramTypeProvider diagramProvider = editor.getDiagramTypeProvider();
- Diagram d = diagramProvider.getDiagram();
- if (diagramName.equals(d.getName()))
- return diagramProvider;
- }
- return null;
- }
-
- public static boolean xmiExists() {
- return xmiExists;
- }
-
- public static void setXmiExists(boolean xmiExists) {
- ModelIntegrationUtil.xmiExists = xmiExists;
- }
-
- public static IPath getDiagramXMLFullPath(String diagramName) {
- if (diagramName == null)
- return null;
- JpaProject jpaProject = getProjectByDiagram(diagramName);
- if (jpaProject == null)
- return null;
- IProject project = jpaProject.getProject();
- return project.getFile(ModelIntegrationUtil
- .getDiagramsXMLFolderPath(project)
- .append(diagramName)
- .addFileExtension(
- ModelIntegrationUtil.DIAGRAM_XML_FILE_EXTENSION)).getFullPath();
- }
-
- synchronized public static void putProjectToDiagram(IProject project, Diagram d) {
- projectToDiagram.put(project, new WeakReference<Diagram>(d));
- }
-
- synchronized public static Diagram getDiagramByProject(IProject project) {
- if (project == null)
- return null;
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage workbenchPage = null;
- try {
- workbenchPage = workbenchWindow.getActivePage();
- IEditorReference[] editorRefs = workbenchPage.getEditorReferences();
- for (IEditorReference editorRef : editorRefs) {
- if(!JPADiagramEditorPlugin.PLUGIN_ID.equals(editorRef.getId()))
- continue;
- JPADiagramEditor editor = (JPADiagramEditor)editorRef.getEditor(false);
- if (editor == null)
- continue;
- JPAEditorDiagramTypeProvider diagramProvider = editor.getDiagramTypeProvider();
- Diagram d = diagramProvider.getDiagram();
- if (d.getName().equals(project.getName()))
- return d;
- }
- } catch (NullPointerException e) {
- // ignore
- }
- WeakReference<Diagram> ref = projectToDiagram.get(project);
- if (ref != null)
- return ref.get();
- return null;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtilImpl.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtilImpl.java
deleted file mode 100644
index 5167fe423e..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/modelintegration/util/ModelIntegrationUtilImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util;
-
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-public class ModelIntegrationUtilImpl implements IModelIntegrationUtil {
-
- public JpaProject getProjectByDiagram(Diagram diagram) {
- return ModelIntegrationUtil.getProjectByDiagram(diagram.getName());
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferenceInitializer.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferenceInitializer.java
deleted file mode 100644
index 6c2d88dd7e..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferenceInitializer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-
-public class JPAEditorPreferenceInitializer extends
- AbstractPreferenceInitializer {
-
- public static final String PROPERTY_DIAGRAM_FOLDER = "org.eclipse.jpt.jpadiagrameditor.ui.diagramfolder"; //$NON-NLS-1$
- public static final String PROPERTY_ENTITY_PACKAGE = "org.eclipse.jpt.jpadiagrameditor.ui.entity.defaultPackage"; //$NON-NLS-1$
- public static final String PROPERTY_TABLE_NAME_PREFIX = "org.eclipse.jpt.jpadiagrameditor.ui.entity.defaultTableNamePrefix"; //$NON-NLS-1$
- public static final String PROPERTY_DIRECT_EDIT_CLASS_NAME = "org.eclipse.jpt.jpadiagrameditor.ui.entity.defaultDirectEditClassName"; //$NON-NLS-1$
- public static final String PROPERTY_ENTITY_ACCESS_TYPE = "org.eclipse.jpt.jpadiagrameditor.ui.entity.defaultEntityAccessType"; //$NON-NLS-1$
- public static final String PROPERTY_DEFAULT_COLLECTION_TYPE = "org.eclipse.jpt.jpadiagrameditor.ui.entity.defaultCollectionType"; //$NON-NLS-1$
- public static final String PROPERTY_ONE_TO_MANY_OLD_STYLE = "org.eclipse.jpt.jpadiagrameditor.ui.entity.defaultOneToManyOldStyle"; //$NON-NLS-1$
-
-
-
-
- public static final String PROPERTY_VAL_DIAGRAM_FOLDER = "diagrams"; //$NON-NLS-1$
- public static final String PROPERTY_VAL_ENTITY_PACKAGE = "org.persistence"; //$NON-NLS-1$
- public static final String PROPERTY_VAL_PREFIX = "T_"; //$NON-NLS-1$
- public static final String PROPERTY_VAL_ACCESS_FIELD_BASED = "field"; //$NON-NLS-1$
- public static final String PROPERTY_VAL_ACCESS_PROPERTY_BASED = "property"; //$NON-NLS-1$
-
- public static final String PROPERTY_VAL_COLLECTION_TYPE = "collection"; //$NON-NLS-1$
- public static final String PROPERTY_VAL_LIST_TYPE = "list"; //$NON-NLS-1$
- public static final String PROPERTY_VAL_SET_TYPE = "set"; //$NON-NLS-1$
- public static final String PROPERTY_VAL_MAP_TYPE = "map"; //$NON-NLS-1$
-
-
-
- private IPreferenceStore store;
-
- public JPAEditorPreferenceInitializer() {
- store = JPADiagramEditorPlugin.getDefault()
- .getPreferenceStore();
- }
-
- public JPAEditorPreferenceInitializer(IPreferenceStore store) {
- this.store = store;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
- * initializeDefaultPreferences()
- */
- @Override
- public void initializeDefaultPreferences() {
- store.setDefault(PROPERTY_DIAGRAM_FOLDER, PROPERTY_VAL_DIAGRAM_FOLDER);
- store.setDefault(PROPERTY_ENTITY_PACKAGE, PROPERTY_VAL_ENTITY_PACKAGE);
- store.setDefault(PROPERTY_TABLE_NAME_PREFIX, PROPERTY_VAL_PREFIX);
- store.setDefault(PROPERTY_DIRECT_EDIT_CLASS_NAME, true);
- store.setDefault(PROPERTY_ENTITY_ACCESS_TYPE, PROPERTY_VAL_ACCESS_FIELD_BASED);
- store.setDefault(PROPERTY_DEFAULT_COLLECTION_TYPE, PROPERTY_VAL_COLLECTION_TYPE);
- store.setDefault(PROPERTY_ONE_TO_MANY_OLD_STYLE, false);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferencesPage.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferencesPage.java
deleted file mode 100644
index 2753c5e9d6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/preferences/JPAEditorPreferencesPage.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-@SuppressWarnings("restriction")
-public class JPAEditorPreferencesPage extends FieldEditorPreferencePage
- implements IWorkbenchPreferencePage {
-
- private static final String FICTIVE_PROJECT_NAME = "PROJECT NAME"; //$NON-NLS-1$
- private static final String COLLECTIION_TYPE = "java.util.Collection"; //$NON-NLS-1$
- private static final String LIST_TYPE = "java.util.List"; //$NON-NLS-1$
- private static final String SET_TYPE = "java.util.Set"; //$NON-NLS-1$
- private static final String MAP_TYPE = "java.util.Map"; //$NON-NLS-1$
-
- private StringFieldEditor fDefaultDiagramFolderField;
- private StringFieldEditor fDefaultEntityPackageField;
- private StringFieldEditor fDefaultTableNamePrefix;
- private JPABooleanFieldEditor directEditAffectsClass;
- private RadioGroupFieldEditor entityAccessTypeChooser;
- private RadioGroupFieldEditor defaultCollectionTypeChooser;
- private JPABooleanFieldEditor oneToManyOldStyle;
-
- public JPAEditorPreferencesPage() {
- super(GRID);
- setPreferenceStore(JPADiagramEditorPlugin.getDefault()
- .getPreferenceStore());
- setDescription(JPAEditorMessages.JPAEditorPreferencesPage_pageDescription);
- }
-
- public void init(IWorkbench workbench) {
- }
-
- @Override
- protected void createFieldEditors() {
- Composite parent = getFieldEditorParent();
- createFolderField(parent);
- createEntityPackageField(parent);
- createTableNameField(parent);
-
- directEditAffectsClass = new JPABooleanFieldEditor("", //$NON-NLS-1$
- JPAEditorMessages.JPAEditorPreferencesPage_directEditAffectsClass,
- BooleanFieldEditor.DEFAULT, parent);
- directEditAffectsClass.setPreferenceName(JPAEditorPreferenceInitializer.PROPERTY_DIRECT_EDIT_CLASS_NAME);
- directEditAffectsClass.getCheckBox(parent).setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_directEditAffectsClassTooltip);
- addField(directEditAffectsClass);
- entityAccessTypeChooser = new RadioGroupFieldEditor(
- JPAEditorPreferenceInitializer.PROPERTY_ENTITY_ACCESS_TYPE,
- JPAEditorMessages.JPAEditorPreferencesPage_entityAccessTypeButtonGroupLabel,
- 1,
- new String[][] {
- {JPAEditorMessages.JPAEditorPreferencesPage_entityFieldBasedAccessButtonLabel, JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_FIELD_BASED},
- {JPAEditorMessages.JPAEditorPreferencesPage_entityPropertyBasedAccessButtonLabel, JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_PROPERTY_BASED}},
- parent, true);
- entityAccessTypeChooser.setPreferenceStore(getPreferenceStore());
- entityAccessTypeChooser.getRadioBoxControl(parent).setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_entityAccessTypeButtonGroupTooltip);
- addField(entityAccessTypeChooser);
-
-
-
- defaultCollectionTypeChooser = new RadioGroupFieldEditor(
- JPAEditorPreferenceInitializer.PROPERTY_DEFAULT_COLLECTION_TYPE,
- JPAEditorMessages.JPAEditorPreferencesPage_DefaultCollectionTypeSectionTittle,
- 1,
- new String[][] {
- {COLLECTIION_TYPE, JPAEditorPreferenceInitializer.PROPERTY_VAL_COLLECTION_TYPE},
- {LIST_TYPE, JPAEditorPreferenceInitializer.PROPERTY_VAL_LIST_TYPE},
- {SET_TYPE, JPAEditorPreferenceInitializer.PROPERTY_VAL_SET_TYPE},
- {MAP_TYPE, JPAEditorPreferenceInitializer.PROPERTY_VAL_MAP_TYPE}},
- parent, true);
- defaultCollectionTypeChooser.setPreferenceStore(getPreferenceStore());
- defaultCollectionTypeChooser.getRadioBoxControl(parent).setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultCollectionTypeSectionDescription);
- addField(defaultCollectionTypeChooser);
-
- oneToManyOldStyle = new JPABooleanFieldEditor("", //$NON-NLS-1$
- JPAEditorMessages.JPAEditorPreferencesPage_oneToManyOldStyle,
- BooleanFieldEditor.DEFAULT, parent);
- oneToManyOldStyle.setPreferenceName(JPAEditorPreferenceInitializer.PROPERTY_ONE_TO_MANY_OLD_STYLE);
- oneToManyOldStyle.getCheckBox(parent).setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_oneToManyOldStyleTooltip);
- addField(oneToManyOldStyle);
- }
-
- protected void createFolderField(Composite parent) {
- fDefaultDiagramFolderField = new CustomStringFieldEditor(
- JPAEditorPreferenceInitializer.PROPERTY_DIAGRAM_FOLDER,
- JPAEditorMessages.JPAEditorPreferencesPage_defaultFolderControlLabel, getFieldEditorParent()) {
- protected IStatus validateValue() {
- return validateDefaultFolder(IPath.SEPARATOR + FICTIVE_PROJECT_NAME + IPath.SEPARATOR
- + fDefaultDiagramFolderField.getStringValue().trim(), FICTIVE_PROJECT_NAME);
- }
- };
-
- fDefaultDiagramFolderField.getTextControl(parent).addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validatePage();
- }
- });
-
- fDefaultDiagramFolderField.getLabelControl(parent).
- setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_defaultFolderControlTooltip);
- addField(fDefaultDiagramFolderField);
-
-
- fDefaultEntityPackageField = new CustomStringFieldEditor(
- JPAEditorPreferenceInitializer.PROPERTY_ENTITY_PACKAGE,
- JPAEditorMessages.JPAEditorPreferencesPage_DefaultPackageToUse, getFieldEditorParent()) {
- protected IStatus validateValue() {
- return validateDefaultPackage(fDefaultEntityPackageField.getStringValue().trim());
- }
- };
- }
-
- protected void createEntityPackageField(Composite parent) {
- fDefaultEntityPackageField.getTextControl(parent).addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validatePage();
- }
- });
-
- fDefaultEntityPackageField.getLabelControl(parent).
- setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultPackageMsg);
- addField(fDefaultEntityPackageField);
- }
-
- protected void createTableNameField(Composite parent) {
- fDefaultTableNamePrefix = new CustomStringFieldEditor(
- JPAEditorPreferenceInitializer.PROPERTY_TABLE_NAME_PREFIX,
- JPAEditorMessages.JPAEditorPreferencesPage_DefaultTableNameLabel, getFieldEditorParent()) {
- protected IStatus validateValue() {
- return validateTableNamePrefix(fDefaultTableNamePrefix.getStringValue().trim());
- }
- };
- fDefaultTableNamePrefix.getTextControl(parent).addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validatePage();
- }
- });
-
- fDefaultTableNamePrefix.getLabelControl(parent).
- setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultTableNamePrefixMsg);
- addField(fDefaultTableNamePrefix);
-
-
-
- fDefaultTableNamePrefix.getTextControl(parent).
- setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultTableNamePrefixMsg);
- }
-
-
-
-
- public static IStatus validateDefaultFolder(String defaultFolder, String projectName) {
- defaultFolder = defaultFolder.trim();
- if (StringTools.stringIsEmpty(defaultFolder))
- return new Status(IStatus.ERROR,
- JPADiagramEditorPlugin.PLUGIN_ID,
- JPAEditorMessages.JPAEditorPreferencesPage_emptyFolder);
- defaultFolder = IPath.SEPARATOR + projectName + IPath.SEPARATOR + defaultFolder;
- if (!defaultFolder.startsWith(IPath.SEPARATOR + projectName + IPath.SEPARATOR))
- return new Status(IStatus.ERROR,
- JPADiagramEditorPlugin.PLUGIN_ID,
- MessageFormat.format(JPAEditorMessages.JPAEditorPreferencesPage_invalidFolder,
- IPath.SEPARATOR + projectName + IPath.SEPARATOR));
- IStatus res = ResourcesPlugin.getWorkspace().validatePath(defaultFolder, IResource.FOLDER);
- return res;
- }
-
- public static IStatus validateDefaultPackage(String defaultPackage) {
- IStatus validateDefaultPackageStatus = JavaConventions
- .validatePackageName(defaultPackage, JavaCore.VERSION_1_5,
- JavaCore.VERSION_1_5);
- if (validateDefaultPackageStatus.getSeverity() != IStatus.OK)
- return validateDefaultPackageStatus;
- return new Status(IStatus.OK, JPADiagramEditor.ID, null);
- }
-
- public static IStatus validateTableNamePrefix(String tableNamePrefix) {
- String s = tableNamePrefix;
- if (StringTools.stringIsEmpty(s))
- return new Status(IStatus.OK, JPADiagramEditor.ID, null);
- if (Character.isDigit(s.charAt(0))) {
- String message = MessageFormat.format(JPAEditorMessages.JPAEditorPreferencesPage_invalidTableNamePrefix,
- tableNamePrefix);
- return new Status(IStatus.ERROR, JPADiagramEditor.ID, message);
- }
- for (int i = 0; i < s.length(); i++) {
- char ch = s.charAt(i);
- if (!Character.isLetterOrDigit(ch) && (ch != '_')) {
- String message = MessageFormat.format(JPAEditorMessages.JPAEditorPreferencesPage_invalidTableNamePrefix,
- tableNamePrefix);
- return new Status(IStatus.ERROR, JPADiagramEditor.ID, message);
- }
- }
- return new Status(IStatus.OK, JPADiagramEditor.ID, null);
- }
-
- public abstract class CustomStringFieldEditor extends StringFieldEditor {
- public CustomStringFieldEditor(String propertyName,
- String labelName,
- Composite fieldEditorParent) {
-
- super(propertyName, labelName, fieldEditorParent);
- }
-
- String msg;
- String prefixMsg;
-
- protected boolean checkState() {
- IStatus stat = validateValue();
- if (stat.getSeverity() == IStatus.ERROR) {
- return false;
- }
- if (stat.getSeverity() == IStatus.WARNING) {
- return true;
- }
- return true;
- }
-
- protected boolean doCheckState() {
- return true;
- }
-
- abstract protected IStatus validateValue();
- }
-
-
- public class JPABooleanFieldEditor extends BooleanFieldEditor {
- public JPABooleanFieldEditor(String name, String labelText, int style, Composite parent) {
- super(name, labelText, style, parent);
- }
-
- public Button getCheckBox(Composite parent) {
- return getChangeControl(parent);
- }
- }
-
- synchronized protected void validatePage() {
-
- IStatus statFolder = JPAEditorPreferencesPage.
- validateDefaultFolder(fDefaultDiagramFolderField.getTextControl(getFieldEditorParent()).getText().trim(),
- FICTIVE_PROJECT_NAME);
- IStatus statPack = JPAEditorPreferencesPage.
- validateDefaultPackage(fDefaultEntityPackageField.getTextControl(getFieldEditorParent()).getText().trim());
-
- IStatus statPref = JPAEditorPreferencesPage.
- validateTableNamePrefix(fDefaultTableNamePrefix.getTextControl(getFieldEditorParent()).getText().trim());
-
- if (statFolder.getSeverity() == IStatus.ERROR) {
- setErrorMessage(statFolder.getMessage());
- setValid(false);
- return;
- }
- if (statPack.getSeverity() == IStatus.ERROR) {
- setErrorMessage(statPack.getMessage());
- setValid(false);
- return;
- }
- if (statPref.getSeverity() == IStatus.ERROR) {
- setErrorMessage(statPref.getMessage());
- setValid(false);
- return;
- }
- setErrorMessage(null);
- setValid(true);
- if (statPack.getSeverity() == IStatus.WARNING) {
- setMessage(statPack.getMessage(), IMessageProvider.WARNING);
- return;
- }
- if (statPref.getSeverity() == IStatus.WARNING) {
- setMessage(statPref.getMessage(), IMessageProvider.WARNING);
- return;
- }
- setMessage(null, IMessageProvider.NONE);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertypage/JPADiagramPropertyPage.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertypage/JPADiagramPropertyPage.java
deleted file mode 100644
index 56f0bee90a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertypage/JPADiagramPropertyPage.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferenceInitializer;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferencesPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class JPADiagramPropertyPage extends PropertyPage {
-
- public static final String PROJECT_SETTINGS_PATH = "/.settings/org.eclipse.jpt.jpadiagrameditor.ui"; //$NON-NLS-1$;
- protected IProject project = null;
- protected boolean isJPA10Project = false; //$NON-NLS-1$;
-
- private Properties editorProps;
-
- private Text txtDefaultFolderField;
- private Text txtDefaultEntityPackageField;
- private Text txtDefaultTableNamePrefix;
- private Button checkDirectEditAffectsClass;
- private Group groupAccessType;
- private Group groupCollectionType;
- private Button btnFieldBasedAccess;
- private Button btnPropertyBasedAccess;
- private Button btnCollectionType;
- private Button btnListType;
- private Button btnSetType;
- private Button btnMapType;
- private Button checkOneToManyOldStyle;
-
- private boolean propsModified = false;
-
- static private final String QUALIFIER = "org.eclipse.jpt.jpadiagrameditor.ui"; //$NON-NLS-1$
- static public final QualifiedName PROP_DEFAULT_DIAGRAM_FOLDER = new QualifiedName(QUALIFIER, "diagramFolder"); //$NON-NLS-1$;
- static public final QualifiedName PROP_DEFAULT_PACKAGE = new QualifiedName(QUALIFIER, "defaultPackage"); //$NON-NLS-1$
- static public final QualifiedName PROP_DEFAULT_TABLE_NAME_PREFIX = new QualifiedName(QUALIFIER, "defaultTableNamePrefix"); //$NON-NLS-1$;
- static public final QualifiedName PROP_DIRECT_EDIT_AFFECTS_CLASS = new QualifiedName(QUALIFIER, "directEditAffectsClass"); //$NON-NLS-1$;
- static public final QualifiedName PROP_ACCESS_TYPE = new QualifiedName(QUALIFIER, "accessType"); //$NON-NLS-1$;
- static public final QualifiedName PROP_COLLECTION_TYPE = new QualifiedName(QUALIFIER, "collectionType"); //$NON-NLS-1$;
- static public final QualifiedName PROP_ONE_TO_MANY_OLD_STYLE = new QualifiedName(QUALIFIER, "oneToManyOldStyle"); //$NON-NLS-1$;
-
-
- public static final String COLLECTION_TYPE = "java.util.Collection"; //$NON-NLS-1$
- public static final String LIST_TYPE = "java.util.List"; //$NON-NLS-1$
- public static final String SET_TYPE = "java.util.Set"; //$NON-NLS-1$
- public static final String MAP_TYPE = "java.util.Map"; //$NON-NLS-1$
-
-
- private IPreferenceStore store = JPADiagramEditorPlugin.getDefault().getPreferenceStore();
-
- @Override
- protected Control createContents(Composite parent) {
- final Composite composite = createCompositeContainer(parent);
- project = (IProject)getElement().getAdapter(IProject.class);
- isJPA10Project = JPAEditorUtil.checkJPAFacetVersion(project, "1.0"); //$NON-NLS-1$;
- loadProperties();
- createDefaultFolderControl(composite);
- createDefaultPackageControl(composite);
- createDefaultTableNamePrefixControl(composite);
- createDirectEditAffectsClassControl(composite);
- createAccessTypeControl(composite);
- createDefaultCollectionTypeControl(composite);
- if (!isJPA10Project)
- createOneToManyOldStyleControl(composite);
- Dialog.applyDialogFont(composite);
- validatePage();
- return composite;
- }
-
- private Composite createCompositeContainer(Composite parent) {
- final Composite composite= new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- composite.setLayout(gl);
- return composite;
- }
-
- private void createDefaultFolderControl(Composite composite) {
- Label lblDefaultFolder = new Label(composite, SWT.FILL);
- lblDefaultFolder.setText(JPAEditorMessages.JPAEditorPreferencesPage_defaultFolderControlLabel);
- lblDefaultFolder.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_defaultFolderControlTooltip);
- GridData gd = new GridData();
- lblDefaultFolder.setLayoutData(gd);
- txtDefaultFolderField = new Text(composite, SWT.FLAT | SWT.BORDER | SWT.FILL);
- lblDefaultFolder.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_defaultFolderControlTooltip);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.grabExcessHorizontalSpace = true;
- txtDefaultFolderField.setLayoutData(gd);
-
- String defaultFolder = editorProps.getProperty(PROP_DEFAULT_DIAGRAM_FOLDER.getLocalName());
- txtDefaultFolderField.setText(defaultFolder);
- txtDefaultFolderField.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_defaultFolderControlTooltip);
- txtDefaultFolderField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validatePage();
- propsModified = true;
- }
- });
- }
-
-
- private void createDefaultPackageControl(Composite composite) {
- Label lblDefaultPackage = new Label(composite, SWT.FILL);
- lblDefaultPackage.setText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultPackageToUse);
- lblDefaultPackage.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultPackageMsg);
- GridData gd = new GridData();
- lblDefaultPackage.setLayoutData(gd);
- txtDefaultEntityPackageField = new Text(composite, SWT.FLAT | SWT.BORDER | SWT.FILL);
- lblDefaultPackage.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultPackageMsg);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.grabExcessHorizontalSpace = true;
- txtDefaultEntityPackageField.setLayoutData(gd);
-
- String defaultPackageName = editorProps.getProperty(PROP_DEFAULT_PACKAGE.getLocalName());
- txtDefaultEntityPackageField.setText(defaultPackageName);
- txtDefaultEntityPackageField.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultPackageMsg);
- txtDefaultEntityPackageField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validatePage();
- propsModified = true;
- }
- });
- }
-
- private void createDefaultTableNamePrefixControl(Composite composite) {
- Label lblDefaultTableNamePrfix = new Label(composite, SWT.FILL);
- lblDefaultTableNamePrfix.setText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultTableNameLabel);
- lblDefaultTableNamePrfix.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultTableNamePrefixMsg);
- GridData gd = new GridData();
- lblDefaultTableNamePrfix.setLayoutData(gd);
- txtDefaultTableNamePrefix = new Text(composite, SWT.FLAT | SWT.BORDER);
- lblDefaultTableNamePrfix.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultTableNamePrefixMsg);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.grabExcessHorizontalSpace = true;
- txtDefaultTableNamePrefix.setLayoutData(gd);
-
- String defaultTableNamePrefix = editorProps.getProperty(PROP_DEFAULT_TABLE_NAME_PREFIX.getLocalName());
- txtDefaultTableNamePrefix.setText(defaultTableNamePrefix);
- txtDefaultTableNamePrefix.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultTableNamePrefixMsg);
- txtDefaultTableNamePrefix.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validatePage();
- propsModified = true;
- }
- });
- }
-
- private void createDirectEditAffectsClassControl(Composite composite) {
- checkDirectEditAffectsClass = new Button(composite, SWT.FLAT | SWT.CHECK);
- checkDirectEditAffectsClass.setText(JPAEditorMessages.JPAEditorPreferencesPage_directEditAffectsClass);
- checkDirectEditAffectsClass.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_directEditAffectsClassTooltip);
- checkDirectEditAffectsClass.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1));
-
- boolean defaultDirectEditAffectsClass = Boolean.parseBoolean(editorProps.getProperty(PROP_DIRECT_EDIT_AFFECTS_CLASS.getLocalName()));
- checkDirectEditAffectsClass.setSelection(defaultDirectEditAffectsClass);
- checkDirectEditAffectsClass.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- private void createOneToManyOldStyleControl(Composite composite) {
- checkOneToManyOldStyle = new Button(composite, SWT.FLAT | SWT.CHECK);
- checkOneToManyOldStyle.setText(JPAEditorMessages.JPAEditorPropertyPage_oneToManyOldStyle);
- checkOneToManyOldStyle.setToolTipText(JPAEditorMessages.JPAEditorPropertyPage_oneToManyOldStyleTooltip);
- checkOneToManyOldStyle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1));
-
- boolean defaultDirectEditAffectsClass = Boolean.parseBoolean(editorProps.getProperty(PROP_ONE_TO_MANY_OLD_STYLE.getLocalName()));
- checkOneToManyOldStyle.setSelection(defaultDirectEditAffectsClass);
- checkOneToManyOldStyle.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
-
-
- private void createDefaultCollectionTypeControl(Composite composite) {
- groupCollectionType = new Group(composite, 0);
- groupCollectionType.setText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultCollectionTypeSectionTittle);
- groupCollectionType.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_DefaultCollectionTypeSectionDescription);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalSpan = 2;
- groupCollectionType.setLayoutData(gd);
-
- GridLayout gl = new GridLayout();
- gl.numColumns = 1;
- groupCollectionType.setLayout(gl);
-
- String defaultCollectionType = editorProps.getProperty(PROP_COLLECTION_TYPE.getLocalName());
-
- createCollectionTypeButton(composite, gd, defaultCollectionType);
- createListTypeButton(composite, gd, defaultCollectionType);
- createSetTypeButton(composite, gd, defaultCollectionType);
- createMapTypeButton(composite, gd, defaultCollectionType);
-
- }
-
- private void createAccessTypeControl(Composite composite) {
- groupAccessType = new Group(composite, 0);
- groupAccessType.setText(JPAEditorMessages.JPAEditorPreferencesPage_entityAccessTypeButtonGroupLabel);
- groupAccessType.setToolTipText(JPAEditorMessages.JPAEditorPreferencesPage_entityAccessTypeButtonGroupTooltip);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.grabExcessHorizontalSpace = true;
- gd.horizontalSpan = 2;
- groupAccessType.setLayoutData(gd);
-
- GridLayout gl = new GridLayout();
- gl.numColumns = 1;
- groupAccessType.setLayout(gl);
-
- String defaultAccessType = editorProps.getProperty(PROP_ACCESS_TYPE.getLocalName());
-
- createFieldAccessButton(composite, gd, defaultAccessType);
- createPropertyAccessButton(composite, gd, defaultAccessType);
- }
-
- private void createCollectionTypeButton(Composite composite, GridData gd, String defaultCollectionType) {
- btnCollectionType = new Button(groupCollectionType, SWT.RADIO | SWT.FLAT);
- btnCollectionType.setText(COLLECTION_TYPE);
- gd = new GridData();
- btnCollectionType.setLayoutData(gd);
- btnCollectionType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_COLLECTION_TYPE));
- btnCollectionType.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- private void createListTypeButton(Composite composite, GridData gd, String defaultCollectionType) {
- btnListType = new Button(groupCollectionType, SWT.RADIO | SWT.FLAT);
- btnListType.setText(LIST_TYPE);
- gd = new GridData();
- btnListType.setLayoutData(gd);
- btnListType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_LIST_TYPE));
- btnListType.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- private void createSetTypeButton(Composite composite, GridData gd, String defaultCollectionType) {
- btnSetType = new Button(groupCollectionType, SWT.RADIO | SWT.FLAT);
- btnSetType.setText(SET_TYPE);
- gd = new GridData();
- btnSetType.setLayoutData(gd);
- btnSetType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_SET_TYPE));
- btnSetType.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- private void createMapTypeButton(Composite composite, GridData gd, String defaultCollectionType) {
- btnMapType = new Button(groupCollectionType, SWT.RADIO | SWT.FLAT);
- btnMapType.setText(MAP_TYPE);
- gd = new GridData();
- btnMapType.setLayoutData(gd);
- btnMapType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_MAP_TYPE));
- btnMapType.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- private void createFieldAccessButton(Composite composite, GridData gd, String defaultAccessType) {
- btnFieldBasedAccess = new Button(groupAccessType, SWT.RADIO | SWT.FLAT);
- btnFieldBasedAccess.setText(JPAEditorMessages.JPAEditorPreferencesPage_entityFieldBasedAccessButtonLabel);
- gd = new GridData();
- btnFieldBasedAccess.setLayoutData(gd);
- btnFieldBasedAccess.setSelection(defaultAccessType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_FIELD_BASED));
- btnFieldBasedAccess.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- private void createPropertyAccessButton(Composite composite, GridData gd, String defaultAccessType) {
- btnPropertyBasedAccess = new Button(groupAccessType, SWT.RADIO | SWT.FLAT);
- btnPropertyBasedAccess.setText(JPAEditorMessages.JPAEditorPreferencesPage_entityPropertyBasedAccessButtonLabel);
- gd = new GridData();
- btnPropertyBasedAccess.setLayoutData(gd);
- btnPropertyBasedAccess.setSelection(defaultAccessType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_PROPERTY_BASED));
- btnPropertyBasedAccess.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- propsModified = true;
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
- protected void performDefaults() {
- String defaultFolder = store.getString(JPAEditorPreferenceInitializer.PROPERTY_DIAGRAM_FOLDER);
- txtDefaultFolderField.setText(defaultFolder);
- String defaultPackageName = store.getString(JPAEditorPreferenceInitializer.PROPERTY_ENTITY_PACKAGE);
- txtDefaultEntityPackageField.setText(defaultPackageName);
- String defaultTableNamePrefix = store.getString(JPAEditorPreferenceInitializer.PROPERTY_TABLE_NAME_PREFIX);
- txtDefaultTableNamePrefix.setText(defaultTableNamePrefix);
- boolean defaultDirectEditAffectsClass = store.getBoolean(JPAEditorPreferenceInitializer.PROPERTY_DIRECT_EDIT_CLASS_NAME);
- checkDirectEditAffectsClass.setSelection(defaultDirectEditAffectsClass);
- String defaultAccessType = store.getString(JPAEditorPreferenceInitializer.PROPERTY_ENTITY_ACCESS_TYPE);
- btnFieldBasedAccess.setSelection(defaultAccessType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_FIELD_BASED));
- btnPropertyBasedAccess.setSelection(defaultAccessType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_PROPERTY_BASED));
- String defaultCollectionType = store.getString(JPAEditorPreferenceInitializer.PROPERTY_DEFAULT_COLLECTION_TYPE);
- btnCollectionType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_COLLECTION_TYPE));
- btnListType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_LIST_TYPE));
- btnSetType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_SET_TYPE));
- btnMapType.setSelection(defaultCollectionType.equals(JPAEditorPreferenceInitializer.PROPERTY_VAL_MAP_TYPE));
- boolean defaultOneToManyOldStyle = store.getBoolean(JPAEditorPreferenceInitializer.PROPERTY_ONE_TO_MANY_OLD_STYLE);
- if (!isJPA10Project)
- checkOneToManyOldStyle.setSelection(defaultOneToManyOldStyle);
- super.performDefaults();
- }
-
- synchronized protected void validatePage() {
- IStatus statFolder = JPAEditorPreferencesPage.validateDefaultFolder(txtDefaultFolderField.getText().trim(),
- project.getName());
- IStatus statPack = JPAEditorPreferencesPage.validateDefaultPackage(txtDefaultEntityPackageField.getText().trim());
- IStatus statPref = JPAEditorPreferencesPage.validateTableNamePrefix(txtDefaultTableNamePrefix.getText().trim());
- if (statFolder.getSeverity() == IStatus.ERROR) {
- setErrorMessage(statFolder.getMessage());
- setValid(false);
- return;
- }
- if (statPack.getSeverity() == IStatus.ERROR) {
- setErrorMessage(statPack.getMessage());
- setValid(false);
- return;
- }
- if (statPref.getSeverity() == IStatus.ERROR) {
- setErrorMessage(statPref.getMessage());
- setValid(false);
- return;
- }
- setErrorMessage(null);
- setValid(true);
- if (statPack.getSeverity() == IStatus.WARNING) {
- setMessage(statPack.getMessage(), IMessageProvider.WARNING);
- return;
- }
- if (statPref.getSeverity() == IStatus.WARNING) {
- setMessage(statPref.getMessage(), IMessageProvider.WARNING);
- return;
- }
- setMessage(null, IMessageProvider.NONE);
- }
-
- protected void performApply() {
- saveSettingsIfModified();
- }
-
- public boolean performOk() {
- return saveSettingsIfModified();
- }
-
- private boolean saveSettingsIfModified() {
- if (propsModified) {
- boolean saved = saveSettings();
- propsModified = !saved;
- return saved;
- }
- return true;
- }
-
- private boolean saveSettings() {
- putNewValsInProps();
- IProject project = (IProject)getElement().getAdapter(IProject.class);
- Path path = new Path(PROJECT_SETTINGS_PATH);
- IFile quartzDataXMLFile = project.getFile(path);
- File file = new File(quartzDataXMLFile.getLocation().toOSString());
- OutputStream os = null;
- try {
- os = new FileOutputStream(file);
- editorProps.store(os, "This file contains JPA Diagram Editor settings"); //$NON-NLS-1$;
- os.close();
- return true;
- } catch (IOException e) {
- MessageDialog.openError(Display.getCurrent().getActiveShell(),
- JPAEditorMessages.JPADiagramPropertyPage_errSavePropsMsgTitle,
- JPAEditorMessages.JPADiagramPropertyPage_errSavePropsMsgText);
- return false;
- }
- }
-
- private void putNewValsInProps() {
- editorProps.put(PROP_DEFAULT_DIAGRAM_FOLDER.getLocalName(), txtDefaultFolderField.getText().trim());
- editorProps.put(PROP_DEFAULT_PACKAGE.getLocalName(), txtDefaultEntityPackageField.getText().trim());
- editorProps.put(PROP_DEFAULT_TABLE_NAME_PREFIX.getLocalName(), txtDefaultTableNamePrefix.getText().trim());
- editorProps.put(PROP_DIRECT_EDIT_AFFECTS_CLASS.getLocalName(), "" + checkDirectEditAffectsClass.getSelection()); //$NON-NLS-1$;
- editorProps.put(PROP_ACCESS_TYPE.getLocalName(), btnFieldBasedAccess.getSelection() ? JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_FIELD_BASED : JPAEditorPreferenceInitializer.PROPERTY_VAL_ACCESS_PROPERTY_BASED);
- editorProps.put(PROP_COLLECTION_TYPE.getLocalName(), getCollectionProperty());
- if (!isJPA10Project)
- editorProps.put(PROP_ONE_TO_MANY_OLD_STYLE.getLocalName(), "" + checkOneToManyOldStyle.getSelection()); //$NON-NLS-1$;
- }
-
-
- private String getCollectionProperty(){
- if (btnCollectionType.getSelection())
- return JPAEditorPreferenceInitializer.PROPERTY_VAL_COLLECTION_TYPE;
- else if (btnListType.getSelection())
- return JPAEditorPreferenceInitializer.PROPERTY_VAL_LIST_TYPE;
- else if (btnSetType.getSelection())
- return JPAEditorPreferenceInitializer.PROPERTY_VAL_SET_TYPE;
- else if (btnMapType.getSelection())
- return JPAEditorPreferenceInitializer.PROPERTY_VAL_MAP_TYPE;
- return null;
- }
-
- private Properties createDefaultProps() {
- return createDefaultProps(store);
- }
-
- static private Properties createDefaultProps(IPreferenceStore store) {
- Properties editorDefaultProps = new Properties();
- editorDefaultProps.setProperty(PROP_DEFAULT_DIAGRAM_FOLDER.getLocalName(), store.getString(JPAEditorPreferenceInitializer.PROPERTY_DIAGRAM_FOLDER));
- editorDefaultProps.setProperty(PROP_DEFAULT_PACKAGE.getLocalName(), store.getString(JPAEditorPreferenceInitializer.PROPERTY_ENTITY_PACKAGE));
- editorDefaultProps.setProperty(PROP_DEFAULT_TABLE_NAME_PREFIX.getLocalName(), store.getString(JPAEditorPreferenceInitializer.PROPERTY_TABLE_NAME_PREFIX));
- editorDefaultProps.setProperty(PROP_DIRECT_EDIT_AFFECTS_CLASS.getLocalName(), "" + store.getBoolean(JPAEditorPreferenceInitializer.PROPERTY_DIRECT_EDIT_CLASS_NAME)); //$NON-NLS-1$;
- editorDefaultProps.setProperty(PROP_ACCESS_TYPE.getLocalName(), store.getString(JPAEditorPreferenceInitializer.PROPERTY_ENTITY_ACCESS_TYPE));
- editorDefaultProps.setProperty(PROP_COLLECTION_TYPE.getLocalName(), store.getString(JPAEditorPreferenceInitializer.PROPERTY_DEFAULT_COLLECTION_TYPE));
- editorDefaultProps.setProperty(PROP_ONE_TO_MANY_OLD_STYLE.getLocalName(), "" + store.getBoolean(JPAEditorPreferenceInitializer.PROPERTY_ONE_TO_MANY_OLD_STYLE)); //$NON-NLS-1$;
-
-
- return editorDefaultProps;
- }
-
-
- private void loadProperties() {
- Properties defaultProps = createDefaultProps();
- editorProps = new Properties(defaultProps);
-
- IProject project = (IProject)getElement().getAdapter(IProject.class);
- Path path = new Path(PROJECT_SETTINGS_PATH);
- IFile editorProjectProperties = project.getFile(path);
-
- File propertiesFile = new File(editorProjectProperties.getLocation().toOSString());
- if (propertiesFile.exists()) {
- InputStream is = null;
- try {
- is = new FileInputStream(propertiesFile);
- editorProps.load(is);
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
- static public Properties loadProperties(IProject project) {
- IPreferenceStore store = JPADiagramEditorPlugin.getDefault().getPreferenceStore();
- Properties defaultProps = createDefaultProps(store);
- Properties editorProps = new Properties(defaultProps);
-
- Path path = new Path(PROJECT_SETTINGS_PATH);
- IFile editorProjectProperties = project.getFile(path);
-
- File propertiesFile = new File(editorProjectProperties.getLocation().toOSString());
- if (propertiesFile.exists()) {
- InputStream is = null;
- try {
- is = new FileInputStream(propertiesFile);
- editorProps.load(is);
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- return editorProps;
- }
-
- public static String getDefaultFolder(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return getDefaultFolder(project, props);
- }
-
- public static String getDefaultPackage(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return getDefaultPackage(project, props);
- }
-
- public static String getDefaultTablePrefixName(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return getDefaultTablePrefixName(project, props);
- }
-
- public static boolean doesDirecteEditingAffectClassNameByDefault(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return doesDirecteEditingAffectClassNameByDefault(project, props);
- }
-
- public static boolean isAccessFieldBased(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return isAccessFieldBased(project, props);
- }
-
- public static boolean isCollectionType(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return isCollectionType(project, props);
- }
-
- public static boolean isListType(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return isListType(project, props);
- }
-
- public static boolean isSetType(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return isSetType(project, props);
- }
-
- public static boolean isMapType(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return isMapType(project, props);
- }
-
- public static boolean shouldOneToManyUnidirBeOldStyle(IProject project) {
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- return shouldOneToManyUnidirBeOldStyle(project, props);
- }
-
-//---------------------------------------------------------------------------------------------------
-
- public static String getDefaultFolder(IProject project, Properties props) {
- return props.getProperty(PROP_DEFAULT_DIAGRAM_FOLDER.getLocalName());
- }
-
- public static String getDefaultPackage(IProject project, Properties props) {
- return props.getProperty(PROP_DEFAULT_PACKAGE.getLocalName());
- }
-
- public static String getDefaultTablePrefixName(IProject project, Properties props) {
- return props.getProperty(PROP_DEFAULT_TABLE_NAME_PREFIX.getLocalName());
- }
-
- public static boolean doesDirecteEditingAffectClassNameByDefault(IProject project, Properties props) {
- return Boolean.parseBoolean(props.getProperty(PROP_DIRECT_EDIT_AFFECTS_CLASS.getLocalName()));
- }
-
- public static boolean isAccessFieldBased(IProject project, Properties props) {
- String accessType = props.getProperty(PROP_ACCESS_TYPE.getLocalName());
- return accessType.equals("field"); //$NON-NLS-1$;
- }
-
- public static boolean isCollectionType(IProject project, Properties props) {
- String accessType = props.getProperty(PROP_COLLECTION_TYPE.getLocalName());
- return accessType.equals("collection"); //$NON-NLS-1$;
- }
-
- public static boolean isListType(IProject project, Properties props) {
- String accessType = props.getProperty(PROP_COLLECTION_TYPE.getLocalName());
- return accessType.equals("list"); //$NON-NLS-1$;
- }
-
- public static boolean isSetType(IProject project, Properties props) {
- String accessType = props.getProperty(PROP_COLLECTION_TYPE.getLocalName());
- return accessType.equals("set"); //$NON-NLS-1$;
- }
-
- public static boolean isMapType(IProject project, Properties props) {
- String accessType = props.getProperty(PROP_COLLECTION_TYPE.getLocalName());
- return accessType.equals("map"); //$NON-NLS-1$;
- }
-
- public static boolean shouldOneToManyUnidirBeOldStyle(IProject project, Properties props) {
- return Boolean.parseBoolean(props.getProperty(PROP_ONE_TO_MANY_OLD_STYLE.getLocalName()));
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertytester/JpaProjectFacetVersionPropertyTester.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertytester/JpaProjectFacetVersionPropertyTester.java
deleted file mode 100644
index 86a00f2e4d..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/propertytester/JpaProjectFacetVersionPropertyTester.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.propertytester;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class JpaProjectFacetVersionPropertyTester extends PropertyTester{
-
- public static final String ID = "jpt.jpa"; //$NON-NLS-1$
- public static final IProjectFacet FACET = ProjectFacetsManager.getProjectFacet(ID);
-
- public boolean test(Object receiver, String property, Object[] args,
- Object value) {
-
- String[] subValues = ((String) value).split(":"); //$NON-NLS-1$
- String receiverId = subValues[0];
-
- if (receiver instanceof JpaNode) {
- if(receiverId.equals(ID)){
- return true;
- }
- }
- return false;
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/AddEntityContext.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/AddEntityContext.java
deleted file mode 100644
index 4974d9aa02..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/AddEntityContext.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import org.eclipse.graphiti.features.context.impl.AddContext;
-
-public class AddEntityContext extends AddContext implements IAddEntityContext{
- private boolean primaryCollapsed;
- private boolean relationCollapsed;
- private boolean basicCollapsed;
-
- public boolean isPrimaryCollapsed() {
- return primaryCollapsed;
- }
- public void setPrimaryCollapsed(boolean primaryCollapsed) {
- this.primaryCollapsed = primaryCollapsed;
- }
-
- public boolean isRelationCollapsed() {
- return relationCollapsed;
- }
- public void setRelationCollapsed(boolean relationCollapsed) {
- this.relationCollapsed = relationCollapsed;
- }
-
- public AddEntityContext(boolean primaryCollapsed,
- boolean relationCollapsed, boolean basicCollapsed) {
- super();
- this.primaryCollapsed = primaryCollapsed;
- this.relationCollapsed = relationCollapsed;
- this.basicCollapsed = basicCollapsed;
- }
-
- public boolean isBasicCollapsed() {
- return basicCollapsed;
- }
- public void setBasicCollapsed(boolean basicCollapsed) {
- this.basicCollapsed = basicCollapsed;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IAddEntityContext.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IAddEntityContext.java
deleted file mode 100644
index c6d17c51a5..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IAddEntityContext.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Petya Sabeva - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-public interface IAddEntityContext {
-
- public abstract boolean isPrimaryCollapsed();
-
- public abstract boolean isRelationCollapsed();
-
- public abstract boolean isBasicCollapsed();
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java
deleted file mode 100644
index 995bbc2bdb..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.IModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelDir;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IGraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IPeServiceUtil;
-
-
-public interface IJPAEditorFeatureProvider extends IFeatureProvider{
-
- public ICompilationUnit getCompilationUnit(JavaPersistentType jpt);
-
- public boolean hasObjectWithName(String name);
-
- public String getKeyForBusinessObject(Object bo);
-
- public Object remove(String key);
-
- public Object remove(String key, boolean save);
-
- public IRelation getRelationRelatedToAttribute(JavaPersistentAttribute jpa);
-
- public boolean existsRelation(JavaPersistentType jpt1, JavaPersistentType jpt2);
-
- public Object getBusinessObjectForKey(String key);
-
- public void addJPTForUpdate(String jptName);
-
- public boolean doesRelationExist(JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- RelType relType,
- RelDir relDir);
-
- public void restoreEntity(JavaPersistentType jpt);
-
- public void addRemoveIgnore(JavaPersistentType jpt, String atName);
-
- public void addAddIgnore(JavaPersistentType jpt, String atName);
-
- public void putKeyToBusinessObject(String key, Object bo);
-
- public int getAttribsNum(Shape sh);
-
- public int increaseAttribsNum(Shape sh);
-
- public int decreaseAttribsNum(Shape sh);
-
- public void replaceAttribute(JavaPersistentAttribute oldAt, JavaPersistentAttribute newAt);
-
- public void renewAttributeJoiningStrategyPropertyListener(JavaPersistentAttribute jpa);
-
- public IPeServiceUtil getPeUtil();
-
- public IJPAEditorUtil getJPAEditorUtil();
-
- public IDeleteFeature getDeleteFeature(IDeleteContext context);
-
- public ICustomFeature getAddAllEntitiesFeature();
-
- public IModelIntegrationUtil getMoinIntegrationUtil();
-
- public IGraphicsUpdater getGraphicsUpdater();
-
- public void addAttribForUpdate(PersistenceUnit pu, String entAtMappedBy);
-
- public TransactionalEditingDomain getTransactionalEditingDomain();
-
- public Properties loadProperties(IProject project);
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorImageCreator.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorImageCreator.java
deleted file mode 100644
index 625d575b27..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorImageCreator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-
-public interface IJPAEditorImageCreator {
-
- static public enum RelEndDir {
- UP,
- LEFT,
- RIGHT,
- DOWN
- }
-
- public Polyline createConnectionLine(Diagram d, Connection connection);
-
- //public ConnectionDecorator createTextConnectionDecorator(Connection connection, String text, double location);
-
- public ConnectionDecorator createArrowConnectionDecorator(Connection connection, double location);
-
- public ConnectionDecorator createManyEndWithArrowDecorator(Connection connection, double location);
-
- public ConnectionDecorator createManyStartDecorator(Connection connection, double location);
-
- public ConnectionDecorator createManyEndDecorator(Connection connection, double location);
-
- public ConnectionDecorator createIconConnectionDecorator(Connection connection, String iconId, double location);
-
- public ConnectionDecorator createCardinalityConnectionDecorator(Diagram d, Connection c, String text, double location);
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorContextMenuProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorContextMenuProvider.java
deleted file mode 100644
index 3b15f9ba17..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorContextMenuProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.graphiti.ui.editor.DiagramEditorContextMenuProvider;
-import org.eclipse.graphiti.ui.internal.config.IConfigurationProvider;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.swt.graphics.Point;
-
-@SuppressWarnings("restriction")
-public class JPAEditorContextMenuProvider extends DiagramEditorContextMenuProvider {
- public JPAEditorContextMenuProvider(EditPartViewer viewer,
- ActionRegistry registry,
- IConfigurationProvider configurationProvider) {
- super(viewer, registry, configurationProvider);
- }
-
-
- protected void addDefaultMenuGroupEdit(IMenuManager manager, Point menuLocation) {
- }
-
- protected void addActionToMenuIfAvailable(IMenuManager manager, String actionId, String menuGroup) {
- if (actionId.equals("predefined remove action") || //$NON-NLS-1$
- actionId.equals("predefined update action")) //$NON-NLS-1$
- return;
- super.addActionToMenuIfAvailable(manager, actionId, menuGroup);
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorDiagramTypeProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorDiagramTypeProvider.java
deleted file mode 100644
index d89265d328..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorDiagramTypeProvider.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.dt.AbstractDiagramTypeProvider;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.platform.IDiagramEditor;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.tb.IToolBehaviorProvider;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.facade.EclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.EntitiesCoordinatesXML;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPACheckSum;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPASolver;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.SizePosition;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-
-public class JPAEditorDiagramTypeProvider extends AbstractDiagramTypeProvider {
-
- private IToolBehaviorProvider[] toolBehaviorProviders;
- public final static String ID = "org.eclipse.jpt.jpadiagrameditor.ui.provider.JPAEditorDiagramTypeProvider"; //$NON-NLS-1$
- boolean isDisposed = false;
- boolean readOnly = false;
-
- public JPAEditorDiagramTypeProvider() {
- IFeatureProvider fp = new JPAEditorFeatureProvider(this, new JPASolver());
- setFeatureProvider(fp);
- }
-
- @Override
- public void init(Diagram diagram, IDiagramEditor diagramEditor) {
- super.init(diagram, diagramEditor);
- if (getTargetJPAProject() == null)
- closeEditor();
- JPAEditorDiagramTypeProvider provider = ModelIntegrationUtil.getProviderByDiagram(diagram.getName());
- if ((provider != null) && provider.isAlive())
- provider.getDiagramEditor().getSite().getWorkbenchWindow().getActivePage().closeEditor(provider.getDiagramEditor(), true);
- }
-
-
- @Override
- public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() {
- if (toolBehaviorProviders == null) {
- toolBehaviorProviders =
- new IToolBehaviorProvider[] { new JPAEditorToolBehaviorProvider(this, EclipseFacade.INSTANCE) };
- }
- return toolBehaviorProviders;
- }
-
- @Override
- public JPAEditorFeatureProvider getFeatureProvider() {
- return (JPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @SuppressWarnings("restriction")
- public boolean hasToAdd() {
- JpaProject project = getTargetJPAProject();
- PersistenceUnit unit = project.getRootContextNode().getPersistenceXml().
- getPersistence().getPersistenceUnits().iterator().next();
-
- for (ClassRef classRef : unit.getClassRefs()) {
- if (classRef.getJavaPersistentType() != null) {
- JavaPersistentType jpt = classRef.getJavaPersistentType();
- if (jpt.getMappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- PictogramElement pe = getFeatureProvider().getPictogramElementForBusinessObject(jpt);
- if (pe == null)
- return true;
- }
- }
- }
- return false;
- }
-
-
- @Override
- public void postInit() {
- final String jptName = getDiagramEditor().getPartProperty(JPAEditorConstants.OPEN_WHOLE_PERSISTENCE_UNIT_EDITOR_PROPERTY);
- if (jptName != null) {
- boolean hasToAdd = hasToAdd();
- boolean readOnly = openPersistedDiagram(hasToAdd);
- if (hasToAdd && !readOnly)
- addRemainingEntities();
- } else
- try {
- openPersistedDiagram(false);
- } catch (NullPointerException e) {
- return;
- }
- }
-
- private void addRemainingEntities() {
- final AddAllEntitiesFeature feature = new AddAllEntitiesFeature(getFeatureProvider());
- final CustomContext context = new CustomContext();
- TransactionalEditingDomain ted = ModelIntegrationUtil.getTransactionalEditingDomain(feature.getFeatureProvider().getDiagramTypeProvider().getDiagram());
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- feature.execute(context);
- }
- });
- }
-
- private void closeEditor() {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- page.closeEditor(getDiagramEditor(), false);
- }
- });
- }
-
- private boolean openPersistedDiagram(boolean hasToAdd) {
- final JpaProject proj = getTargetJPAProject();
- IProject project = proj.getProject();
- final Diagram diagram = getDiagram();
- ModelIntegrationUtil.putProjectToDiagram(project, diagram);
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(proj);
- String diagramName = pu.getName();
- IPath path = ModelIntegrationUtil.getDiagramsFolderPath(project).append(diagramName).addFileExtension(ModelIntegrationUtil.DIAGRAM_FILE_EXTENSION);
- final IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- boolean readOnly = (f != null) && f.exists() && f.isReadOnly();
- if (readOnly) {
- if (JPACheckSum.INSTANCE().isModelDifferentFromDiagram(diagram, proj) || hasToAdd) {
- String message = hasToAdd ? JPAEditorMessages.JPAEditorDiagramTypeProvider_JPADiagramReadOnlyHasToAddMsg :
- JPAEditorMessages.JPAEditorDiagramTypeProvider_JPADiagramReadOnlyMsg;
- MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- JPAEditorMessages.JPAEditorDiagramTypeProvider_JPADiagramReadOnlyTitle, null, message,
- MessageDialog.INFORMATION, new String[] {JPAEditorMessages.BTN_OK, JPAEditorMessages.BTN_CANCEL}, 0) {
- @Override
- protected int getShellStyle() {
- return SWT.TITLE | SWT.BORDER
- | SWT.APPLICATION_MODAL
- | getDefaultOrientation();
- }
- };
- if (dialog.open() == 1) {
- closeEditor();
- return true;
- } else {
- IStatus stat = ResourcesPlugin.getWorkspace().validateEdit(new IFile[]{f}, null);
- if (!stat.isOK()) {
- message = NLS.bind(JPAEditorMessages.JPAEditorDiagramTypeProvider_cantMakeDiagramWritableMsg,
- stat.getMessage());;
- dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- JPAEditorMessages.JPAEditorDiagramTypeProvider_cantMakeDiagramWritableTitle, null, message,
- MessageDialog.CANCEL, new String[] {JPAEditorMessages.BTN_OK}, 0) {
- @Override
- protected int getShellStyle() {
- return SWT.CLOSE | SWT.TITLE | SWT.BORDER
- | SWT.APPLICATION_MODAL
- | getDefaultOrientation();
- }
- };
- dialog.open();
- closeEditor();
- return true;
- } else {
- readOnly = false;
- }
- }
- } else {
- return readOnly;
- }
- }
-
- removeConnections();
-
- final Hashtable<String, SizePosition> marks = new Hashtable<String, SizePosition>();
- EntitiesCoordinatesXML xml = new EntitiesCoordinatesXML(project.getName());
- xml.load(marks);
- xml.clean();
-
- List<Shape> picts = diagram.getChildren();
- Iterator<Shape> it = picts.iterator();
- HashSet<Shape> toDelete = new HashSet<Shape>();
- // collecting data from the saved pictograms
- while (it.hasNext()) {
- Shape pict = it.next();
- toDelete.add(pict);
- }
-
- final Iterator<Shape> iter = toDelete.iterator();
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(diagram);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- while (iter.hasNext())
- Graphiti.getPeService().deletePictogramElement(iter.next());
- Collection<Connection> cns = diagram.getConnections();
- Iterator<Connection> itera = cns.iterator();
- Set<Connection> toDel = new HashSet<Connection>();
- while (itera.hasNext())
- toDel.add(itera.next());
- itera = toDel.iterator();
- while (itera.hasNext())
- Graphiti.getPeService().deletePictogramElement(itera.next());
-
- Enumeration<String> itr = marks.keys();
-
- // create new pictograms
- while (itr.hasMoreElements()) {
- String entityName = itr.nextElement();
- JavaPersistentType jpt = JpaArtifactFactory.instance().getContextPersistentType(proj, entityName);
- if (jpt != null) {
- SizePosition sp = marks.get(entityName);
- AddContext ctx = new AddEntityContext(sp.primaryCollapsed,
- sp.relationCollapsed, sp.basicCollapsed);
- ctx.setNewObject(jpt);
- ctx.setTargetContainer(getDiagram());
- ctx.setWidth(sp.getWidth());
- ctx.setHeight(sp.getHeight());
- ctx.setX(sp.getX());
- ctx.setY(sp.getY());
- AddJPAEntityFeature ft = new AddJPAEntityFeature(getFeatureProvider());
- ft.add(ctx);
- }
- }
- }
- });
- getDiagramEditor().saveWithoutEntities(new NullProgressMonitor());
-
- // delete old pictograms
- return false;
- }
-
- private void removeConnections() {
- Collection<org.eclipse.graphiti.mm.pictograms.Connection> cons = getDiagram().getConnections();
- Iterator<org.eclipse.graphiti.mm.pictograms.Connection> consIt = cons.iterator();
- Collection<org.eclipse.graphiti.mm.pictograms.Connection> allCons = new HashSet<org.eclipse.graphiti.mm.pictograms.Connection>();
- while (consIt.hasNext()) {
- org.eclipse.graphiti.mm.pictograms.Connection con = consIt.next();
- allCons.add(con);
- }
- consIt = allCons.iterator();
- while (consIt.hasNext()) {
- org.eclipse.graphiti.mm.pictograms.Connection con = consIt.next();
- RemoveContext ctx = new RemoveContext(con);
- RemoveRelationFeature ft = new RemoveRelationFeature(getFeatureProvider());
- ft.remove(ctx);
- }
- }
-
- @Override
- public JPADiagramEditor getDiagramEditor() {
- return (JPADiagramEditor)super.getDiagramEditor();
- }
-
- private JpaProject getTargetJPAProject() {
- return ModelIntegrationUtil.getProjectByDiagram(getDiagram().getName());
- }
-
- public boolean isAlive() {
- return !isDisposed;
- }
-
- @Override
- public void dispose() {
- super.dispose();
- setFeatureProvider(null);
- isDisposed = true;
- }
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java
deleted file mode 100644
index bc94dccfee..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.ICreateConnectionFeature;
-import org.eclipse.graphiti.features.ICreateFeature;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.ILayoutFeature;
-import org.eclipse.graphiti.features.IMoveConnectionDecoratorFeature;
-import org.eclipse.graphiti.features.IMoveShapeFeature;
-import org.eclipse.graphiti.features.IReason;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.IResizeShapeFeature;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.features.context.IMoveConnectionDecoratorContext;
-import org.eclipse.graphiti.features.context.IMoveShapeContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.IResizeShapeContext;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.features.impl.Reason;
-import org.eclipse.graphiti.internal.services.GraphitiInternal;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.ui.features.DefaultFeatureProvider;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.internal.core.CompilationUnit;
-import org.eclipse.jdt.internal.core.SourceType;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ClickAddAttributeButtonFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ClickRemoveAttributeButtonFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CollapseAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CollapseCompartmentShapeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CollapseEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateJPAEntityFromMappedSuperclassFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToManyBiDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToManyUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToOneBiDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToOneUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateOneToManyUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateOneToOneBiDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateOneToOneUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DeleteJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DeleteRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DirectEditAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DirectEditJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ExpandCompartmentShapeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ExpandEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.JPAMoveConnectionDecoratorFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.LayoutJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.MoveAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.MoveEntityShapeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ResizeAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ResizeJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.IModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtilImpl;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelDir;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdaterImpl;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IGraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJpaSolver;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IPeServiceUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtilImpl;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPASolver;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.PeServiceUtilImpl;
-import org.eclipse.ui.PlatformUI;
-
-
-@SuppressWarnings("restriction")
-public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements IJPAEditorFeatureProvider {
-
- private ClickAddAttributeButtonFeature clickAddAttBtnFeat = null;
- private ClickRemoveAttributeButtonFeature clickRemoveAttBtnFeat = null;
- private IPeServiceUtil peUtil = new PeServiceUtilImpl();
- private IJPAEditorUtil jpaEditorUtil = new JPAEditorUtilImpl();
- private IModelIntegrationUtil moinIntegrationUtil = new ModelIntegrationUtilImpl();
- private IGraphicsUpdater graphicsUpdater = new GraphicsUpdaterImpl();
-
- public JPAEditorFeatureProvider(IDiagramTypeProvider dtp, IJpaSolver is) {
- super(dtp);
- is.setFeatureProvider(this);
- this.setIndependenceSolver(is);
- }
-
- public void stopThread() {
- if (getIndependenceSolver() != null)
- ((JPASolver)getIndependenceSolver()).stopThread();
- }
-
- public void addJPTForUpdate(String jptName) {
- ((JPASolver)getIndependenceSolver()).addJPTForUpdate(jptName);
- }
-
-
- public void addRemoveIgnore(JavaPersistentType jpt, String atName) {
- ((JPASolver)getIndependenceSolver()).addRemoveIgnore(jpt.getName() + "." + atName); //$NON-NLS-1$
- }
-
- public void addAddIgnore(JavaPersistentType jpt, String atName) {
- ((JPASolver)getIndependenceSolver()).addAddIgnore(jpt.getName() + "." + atName); //$NON-NLS-1$
- }
-
- public HashSet<String> getAddIgnore() {
- return ((JPASolver)getIndependenceSolver()).getAddIgnore();
- }
-
-
- public void addAttribForUpdate(PersistenceUnit pu, String entAtMappedBy) {
- ((JPASolver)getIndependenceSolver()).addAttribForUpdate(pu, entAtMappedBy);
- }
-
- public boolean existsRelation(JavaPersistentType jpt1, JavaPersistentType jpt2) {
- return ((JPASolver)getIndependenceSolver()).existsRelation(jpt1, jpt2);
- }
-
- @Override
- public IAddFeature getAddFeature(IAddContext context) {
- Object newObj = context.getNewObject();
- if (newObj instanceof JavaPersistentType) {
- return new AddJPAEntityFeature(this);
- } else if (newObj instanceof AbstractRelation) {
- return new AddRelationFeature(this);
- } else if (newObj instanceof PersistentAttribute) {
- if (Diagram.class.isInstance(context.getTargetContainer())) {
- return null;
- } else {
- return new AddAttributeFeature(this);
- }
- } else if (newObj instanceof CompilationUnit) {
- CompilationUnit cu = (CompilationUnit)newObj;
- JavaPersistentType jpt = JPAEditorUtil.getJPType(cu);
- if (jpt != null) return new AddJPAEntityFeature(this);
- } else if ((newObj instanceof JpaNode)) {
- return new AddAllEntitiesFeature(this);
- } else if (newObj instanceof SourceType) {
- return new AddJPAEntityFeature(this);
- }
- return super.getAddFeature(context);
- }
-
-
- @Override
- public ICreateFeature[] getCreateFeatures() {
- return new ICreateFeature[] { new CreateJPAEntityFeature(this), new CreateJPAEntityFromMappedSuperclassFeature(this) };
- }
-
- @Override
- public IDeleteFeature getDeleteFeature(IDeleteContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (bo instanceof JavaPersistentType) {
- return new DeleteJPAEntityFeature(this);
- } else if (bo instanceof AbstractRelation) {
- return new DeleteRelationFeature(this);
- } else if (bo instanceof JavaPersistentAttribute) {
- return new ClickRemoveAttributeButtonFeature(this);
- }
- return null;
- }
-
- @Override
- public ICustomFeature[] getCustomFeatures(ICustomContext context) {
- ICustomFeature[] ret = super.getCustomFeatures(context);
- List<ICustomFeature> retList = new ArrayList<ICustomFeature>();
- for (int i = 0; i < ret.length; i++) {
- retList.add(ret[i]);
- }
-
- retList.add(new CollapseAllEntitiesFeature(this));
-
- retList.add(new CollapseEntityFeature(this));
- retList.add(new ExpandEntityFeature(this));
-
- retList.add(new CollapseCompartmentShapeFeature(this));
- retList.add(new ExpandCompartmentShapeFeature(this));
-
- ret = retList.toArray(ret);
- return ret;
- }
-
-
- @Override
- public IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context) {
- PictogramElement pe = context.getPictogramElement();
- if (getBusinessObjectForPictogramElement(pe) instanceof JavaPersistentType) {
- return new ResizeJPAEntityFeature(this);
- }
- GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
- if (ga == null)
- return super.getResizeShapeFeature(context);
- List<GraphicsAlgorithm> ch = ga.getGraphicsAlgorithmChildren();
- if ((ch != null) && (ch.size() > 0) && (ch.get(0) instanceof Text)) {
- return new ResizeAttributeFeature(this);
- }
-
- return super.getResizeShapeFeature(context);
- }
-
-
-
-
- @Override
- public ILayoutFeature getLayoutFeature(ILayoutContext context) {
- PictogramElement pictogramElement = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pictogramElement);
- if (bo instanceof JavaPersistentType) {
- return new LayoutJPAEntityFeature(this);
- }
- return super.getLayoutFeature(context);
- }
-
-
- @Override
- public IRemoveFeature getRemoveFeature(IRemoveContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (bo == null)
- super.getRemoveFeature(context);
- if (bo instanceof JavaPersistentType) {
- return new RemoveJPAEntityFeature(this);
- } else if (bo instanceof AbstractRelation) {
- return new RemoveRelationFeature(this);
- }
- GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
- if (ga == null)
- return super.getRemoveFeature(context);
- List<GraphicsAlgorithm> ch = ga.getGraphicsAlgorithmChildren();
- if ((ch != null) && (ch.size() > 0) && (ch.get(0) instanceof Text)) {
- return new RemoveAttributeFeature(this);
- }
- return super.getRemoveFeature(context);
- }
-
- @Override
- public ICreateConnectionFeature[] getCreateConnectionFeatures() {
- return new ICreateConnectionFeature[] {
- new CreateOneToOneUniDirRelationFeature(this),
- new CreateOneToOneBiDirRelationFeature(this),
- new CreateOneToManyUniDirRelationFeature(this),
- new CreateManyToOneUniDirRelationFeature(this),
- new CreateManyToOneBiDirRelationFeature(this),
- new CreateManyToManyUniDirRelationFeature(this),
- new CreateManyToManyBiDirRelationFeature(this)
- };
- }
-
- @Override
- public IReason canAdd(IAddContext context) {
- return Reason.createTrueReason();
- }
-
- public ICustomFeature getAddAllEntitiesFeature() {
- return new AddAllEntitiesFeature(this);
- }
-
- @Override
- public IMoveShapeFeature getMoveShapeFeature(IMoveShapeContext context) {
- PictogramElement pe = context.getPictogramElement();
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (JavaPersistentType.class.isInstance(bo)) {
- return new MoveEntityShapeFeature(this);
- }
- if(bo == null){
- return new MoveAttributeFeature(this);
- }
- GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
- if (ga == null)
- return super.getMoveShapeFeature(context);
- List<GraphicsAlgorithm> ch = ga.getGraphicsAlgorithmChildren();
- if ((ch != null) && (ch.size() > 0) && (ch.get(0) instanceof Text)) {
- return new MoveAttributeFeature(this);
- }
- return super.getMoveShapeFeature(context);
- }
-
-
- @Override
- public IDirectEditingFeature getDirectEditingFeature(IDirectEditingContext context) {
- PictogramElement pe = context.getPictogramElement();
- GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
- if (!(ga instanceof Rectangle))
- return super.getDirectEditingFeature(context);
- List<GraphicsAlgorithm> ch = ga.getGraphicsAlgorithmChildren();
- if ((ch == null) || (ch.size() == 0))
- return super.getDirectEditingFeature(context);
- ga = ch.get(0);
- if (!(ga instanceof Text))
- return super.getDirectEditingFeature(context);
- if(((Text)ga).getFont().isItalic())
- return super.getDirectEditingFeature(context);
- Object bo = getBusinessObjectForPictogramElement(pe);
- if (bo != null) {
- if (bo instanceof JavaPersistentAttribute) {
- return new DirectEditAttributeFeature(this);
- }
- }
- if (!(pe instanceof Shape))
- return super.getDirectEditingFeature(context);
- Shape sh = (Shape)pe;
- ContainerShape csh = sh.getContainer();
- if (csh == null)
- return super.getDirectEditingFeature(context);
- bo = getBusinessObjectForPictogramElement(csh);
- if (bo instanceof JavaPersistentType){
- return new DirectEditJPAEntityFeature(this);
- }
- return super.getDirectEditingFeature(context);
- }
-
- public void addMissingRelations(JavaPersistentType newEntity, ContainerShape newShape) {
- Collection<PictogramElement> allContainedPictogramElements = Graphiti.getPeService()
- .getAllContainedPictogramElements(getDiagramTypeProvider().getDiagram());
-
- for (PictogramElement pe : allContainedPictogramElements) {
- if ((pe != newShape) && (pe instanceof ContainerShape)) {
- JavaPersistentType entity = (JavaPersistentType)getBusinessObjectForPictogramElement(pe);
- AbstractRelation newRel = produceNecessaryRelation(newEntity, entity);
- if (newRel != null) {
- JavaPersistentType owner = newRel.getOwner();
- JavaPersistentType inverse = newRel.getInverse();
- ContainerShape ownerShape = (ContainerShape)getPictogramElementForBusinessObject(owner);
- ContainerShape inverseShape = (ContainerShape)getPictogramElementForBusinessObject(inverse);
- AddRelationFeature f = new AddRelationFeature(this);
- AddConnectionContext ctx =
- new AddConnectionContext(JPAEditorUtil.getAnchor(ownerShape), JPAEditorUtil.getAnchor(inverseShape));
- f.add(ctx);
- }
- }
- }
- }
-
- public void renewAttributeJoiningStrategyPropertyListener(JavaPersistentAttribute jpa) {
- ((JPASolver)getIndependenceSolver()).renewAttributeJoiningStrategyPropertyListener(jpa);
- }
-
- private AbstractRelation produceNecessaryRelation(JavaPersistentType ent1, JavaPersistentType ent2) {
- return null;
- }
-
- public String produceKeyForRel(JavaPersistentType jpt, String attributeName) {
- return ((JPASolver)getIndependenceSolver()).produceKeyForRel(jpt, attributeName);
- }
-
-
- public ClickAddAttributeButtonFeature getClickAddAttributeButtonFeature() {
- if (clickAddAttBtnFeat == null) {
- clickAddAttBtnFeat = new ClickAddAttributeButtonFeature(this);
- }
- return clickAddAttBtnFeat;
- }
-
- public ClickRemoveAttributeButtonFeature getClickRemoveAttributeButtonFeature() {
- if (clickRemoveAttBtnFeat == null) {
- clickRemoveAttBtnFeat = new ClickRemoveAttributeButtonFeature(this);
- }
- return clickRemoveAttBtnFeat;
- }
-
- @Override
- public IMoveConnectionDecoratorFeature getMoveConnectionDecoratorFeature(
- IMoveConnectionDecoratorContext context) {
- return new JPAMoveConnectionDecoratorFeature(this);
- }
-
- public Object getBusinessObjectForKey(String key) {
- return getIndependenceSolver().getBusinessObjectForKey(key);
- }
-
- public String getKeyForBusinessObject(Object bo) {
- return getIndependenceSolver().getKeyForBusinessObject(bo);
- }
-
- public void putKeyToBusinessObject(String key, Object bo) {
- ((JPASolver)getIndependenceSolver()).addKeyBusinessObject(key, bo);
- }
-
- public Object remove(String key) {
- return remove(key, false);
- }
-
- public Object remove(String key, boolean save) {
- Object res = getBusinessObjectForKey(key);
- if (res instanceof JavaPersistentType) {
- final JavaPersistentType jpt = (JavaPersistentType)res;
- if (save)
- JpaArtifactFactory.instance().forceSaveEntityClass(jpt, this);
- if(!(jpt.getMapping() instanceof JavaEntity)){
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- public void run() {
- removeFromDiagramIfNotEntity(jpt);
- }});
- }
-
- }
- return ((JPASolver)getIndependenceSolver()).remove(key);
- }
-
-
- protected void removeAllConnections(Shape shape) {
- for (Iterator<Anchor> iter = shape.getAnchors().iterator(); iter.hasNext();) {
- Anchor anchor = iter.next();
- for (Iterator<Connection> iterator = Graphiti.getPeService().getAllConnections(anchor).iterator(); iterator.hasNext();) {
- Connection connection = iterator.next();
- if (GraphitiInternal.getEmfService().isObjectAlive(connection)) {
- Object ob = getBusinessObjectForPictogramElement(connection);
- if(ob instanceof AbstractRelation){
- String key = getKeyForBusinessObject(ob);
- ((JPASolver)getIndependenceSolver()).remove(key);
- }
- Graphiti.getPeService().deletePictogramElement(connection);
- }
- }
- }
- }
-
-
- private void removeFromDiagramIfNotEntity(final JavaPersistentType jpt) {
- final PictogramElement cs = this.getPictogramElementForBusinessObject(jpt);
- if (cs != null) {
- final Shape shape = (Shape) cs;
- TransactionalEditingDomain ted = ModelIntegrationUtil.getTransactionalEditingDomain(this
- .getDiagramTypeProvider().getDiagram());
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- removeAllConnections(shape);
- Graphiti.getPeService().deletePictogramElement(cs);
- }
- });
- }
- }
-
-
-
- public boolean hasObjectWithName(String name) {
- return ((JPASolver)getIndependenceSolver()).containsKey(name);
- }
-
- public void replaceAttribute(final JavaPersistentAttribute oldAt, final JavaPersistentAttribute newAt) {
- final PictogramElement pe = this.getPictogramElementForBusinessObject(oldAt);
- if (pe == null) {
- //System.err.println("PictogramElement is null\n");
- throw new RuntimeException();
- //return;
- }
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(pe);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- protected void doExecute() {
- JPASolver solver = (JPASolver)getIndependenceSolver();
- solver.remove(solver.getKeyForBusinessObject(oldAt));
- solver.addKeyBusinessObject(solver.getKeyForBusinessObject(newAt), newAt);
- if (newAt == null) {
- JPADiagramEditorPlugin.logError("New attribute is null\n", new Exception()); //$NON-NLS-1$
- return;
- }
- link(pe, newAt);
- GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
- if (ga == null)
- return;
- List<GraphicsAlgorithm> ch = ga.getGraphicsAlgorithmChildren();
- ((Text)ch.get(0)).setValue(newAt.getName());
- }
- });
- }
-
- public boolean doesRelationExist(JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- RelType relType,
- RelDir relDir) {
-
- String id = AbstractRelation.generateId(owner, inverse, ownerAttributeName, relType, relDir);
- return (getBusinessObjectForKey(id) != null);
- }
-
- public boolean isRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
- return ((JPASolver)getIndependenceSolver()).isRelationRelatedToAttribute(jpa);
- }
-
- public IRelation getRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
- return ((JPASolver)getIndependenceSolver()).getRelationRelatedToAttribute(jpa);
- }
-
- public ICompilationUnit getCompilationUnit(JavaPersistentType jpt) {
- return ((JPASolver)getIndependenceSolver()).getCompilationUnit(jpt);
- }
-
- public void restoreEntity(JavaPersistentType jpt) {
- ((JPASolver)getIndependenceSolver()).restoreEntity(jpt);
- }
-
- public int getAttribsNum(Shape sh) {
- String s = Graphiti.getPeService().getPropertyValue(sh, JPAEditorConstants.PROP_ATTRIBS_NUM);
- int res = 0;
- if (s == null) {
- setAttribsNum(0, sh);
- } else {
- res = Integer.parseInt(s);
- }
- return res;
- }
-
- public int increaseAttribsNum(Shape sh) {
- int attribsNum = getAttribsNum(sh);
- attribsNum++;
- setAttribsNum(attribsNum, sh);
- return attribsNum;
- }
-
- public int decreaseAttribsNum(Shape sh) {
- int attribsNum = getAttribsNum(sh);
- attribsNum--;
- setAttribsNum(attribsNum, sh);
- return attribsNum;
- }
-
- public void setAttribsNum(int newAttribsNum, Shape sh) {
- Graphiti.getPeService().setPropertyValue(sh, JPAEditorConstants.PROP_ATTRIBS_NUM, "" + newAttribsNum); //$NON-NLS-1$
- }
-
- /*
- public Collection<ResourceOperation> getAffectedPartitionsForModification() {
- return new HashSet<ResourceOperation>();
- }
- */
-
- public void dispose() {
- stopThread();
- ((JPASolver)getIndependenceSolver()).dispose();
- setIndependenceSolver(null);
- }
-
-
- public IPeServiceUtil getPeUtil() {
- return peUtil;
- }
-
- public IJPAEditorUtil getJPAEditorUtil() {
- return this.jpaEditorUtil;
- }
-
- public IModelIntegrationUtil getMoinIntegrationUtil() {
- return moinIntegrationUtil;
- }
-
- public IGraphicsUpdater getGraphicsUpdater() {
- return graphicsUpdater;
- }
-
- public TransactionalEditingDomain getTransactionalEditingDomain() {
- Diagram diagram = getDiagramTypeProvider().getDiagram();
- return TransactionUtil.getEditingDomain(diagram);
- }
-
- public PictogramElement getPictogramElementForBusinessObject(Object businessObject) {
- PictogramElement pe = super.getPictogramElementForBusinessObject(businessObject);
- /*
- int cnt = 0;
- while ((pe == null) && (cnt < 20)) {
- //System.out.println("loop");
- try {
- Thread.sleep(250);
- } catch (InterruptedException e) {
- }
- System.out.println("loop; hc:" + businessObject.hashCode());
- pe = super.getPictogramElementForBusinessObject(businessObject);
- cnt++;
- }
- if (pe == null) {
- System.out.println("FP - PE is null; hc:" + businessObject.hashCode());
- }
- */
- return pe;
- }
-
- public Properties loadProperties(IProject project) {
- return JPADiagramPropertyPage.loadProperties(project);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageCreator.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageCreator.java
deleted file mode 100644
index eb3198065a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageCreator.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.util.IColorConstant;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.swt.graphics.Point;
-
-public class JPAEditorImageCreator implements IJPAEditorImageCreator {
-
- public Polyline createConnectionLine(Diagram d, Connection connection) {
- Polyline polyline = Graphiti.getGaService().createPolyline(connection);
- polyline.setForeground(Graphiti.getGaService().manageColor(d, JPAEditorConstants.CONNECTION_LINE_COLOR));
- polyline.setLineWidth(JPAEditorConstants.CONNECTION_LINE_WIDTH);
- return polyline;
- }
-
- /*
- public ConnectionDecorator createTextConnectionDecorator(Connection connection, String text, double location) {
- ConnectionDecorator textDecorator = Graphiti.getPeService().createConnectionDecorator(connection, true, 0.5, true);
- Text txt = Graphiti.getGaService().createDefaultText(textDecorator);
- txt.setLineWidth(JPAEditorConstants.CONNECTION_LINE_WIDTH);
- txt.setValue(text);
- Graphiti.getGaService().manageColor(connection.getParent(), IColorConstant.BLACK);
- Graphiti.getGaService().setLocation(txt, 5, -20);
- return textDecorator;
- }
- */
-
- public ConnectionDecorator createCardinalityConnectionDecorator(Diagram d, Connection c, String text, double location) {
- ConnectionDecorator textDecorator = Graphiti.getPeService().createConnectionDecorator(c, true, location, true);
- Text txt = Graphiti.getGaService().createDefaultText(d, textDecorator);
- txt.setLineWidth(JPAEditorConstants.CONNECTION_LINE_WIDTH);
- txt.setValue(text);
- Graphiti.getGaService().manageColor(c.getParent(), IColorConstant.BLACK);
- Point pt = JPAEditorUtil.recalcTextDecoratorPosition((FreeFormConnection)c, textDecorator);
- Graphiti.getGaService().setLocation(txt, pt.x, pt.y, false);
- return textDecorator;
- }
-
- public ConnectionDecorator createArrowConnectionDecorator(Connection connection, double location) {
- ConnectionDecorator cd = Graphiti.getPeService().createConnectionDecorator(connection, false, location, true);
- Polyline arrow = null;
- arrow = Graphiti.getGaService().createPolyline(cd, new int[] { 11, 3, 0, 0, 11, -3, 11, 3});
- arrow.setForeground(Graphiti.getGaService().manageColor(connection.getParent(), JPAEditorConstants.CONNECTION_LINE_COLOR));
- arrow.setLineWidth(JPAEditorConstants.CONNECTION_LINE_WIDTH);
- return cd;
- }
-
- public ConnectionDecorator createManyEndWithArrowDecorator(Connection connection, double location) {
- ConnectionDecorator cd = Graphiti.getPeService().createConnectionDecorator(connection, false, location, true);
- Polyline arrow = null;
- arrow = Graphiti.getGaService().createPolyline(cd, new int[] { -2, 7, 6, 0, -2, -7, 6, 0, 20, 3, 20, -3, 7, 0});
- arrow.setForeground(Graphiti.getGaService().manageColor(connection.getParent(), JPAEditorConstants.CONNECTION_LINE_COLOR));
- arrow.setLineWidth(JPAEditorConstants.CONNECTION_LINE_WIDTH);
- return cd;
- }
-
- public ConnectionDecorator createManyEndDecorator(Connection connection, double location) {
- ConnectionDecorator cd = Graphiti.getPeService().createConnectionDecorator(connection, false, location, true);
- Polyline arrow = null;
- arrow = Graphiti.getGaService().createPolyline(cd, new int[] { 0, 7,
- 8, 0,
- 0, -7 });
- arrow.setForeground(Graphiti.getGaService().manageColor(connection.getParent(), JPAEditorConstants.CONNECTION_LINE_COLOR));
- arrow.setLineWidth(JPAEditorConstants.CONNECTION_LINE_WIDTH);
- return cd;
- }
-
- public ConnectionDecorator createManyStartDecorator(Connection connection, double location) {
- ConnectionDecorator cd = Graphiti.getPeService().createConnectionDecorator(connection, false, location, true);
- Polyline arrow = null;
- arrow = Graphiti.getGaService().createPolyline(cd, new int[] {0, 7,
- -8, 0,
- 0, -7 });
- arrow.setForeground(Graphiti.getGaService().manageColor(connection.getParent(), JPAEditorConstants.CONNECTION_LINE_COLOR));
- arrow.setLineWidth(JPAEditorConstants.CONNECTION_LINE_WIDTH);
- return cd;
- }
-
- public ConnectionDecorator createIconConnectionDecorator(Connection connection, String iconId, double location) {
- ConnectionDecorator iconDecorator = Graphiti.getPeService().createConnectionDecorator(connection, true, location, true);
- Image icon = Graphiti.getGaService().createImage(connection, iconId);
- Graphiti.getGaService().setLocation(icon, 5, -20);
- return iconDecorator;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageProvider.java
deleted file mode 100644
index 46905aeafd..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorImageProvider.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import org.eclipse.graphiti.ui.platform.AbstractImageProvider;
-
-public class JPAEditorImageProvider extends AbstractImageProvider {
-
- public final static String ID = "org.eclipse.jpt.jpadiagrameditor.ui.JPAEditorImageProvider"; //$NON-NLS-1$
- static final String PRE = "org.eclipse.jpt.jpadiagrameditor.ui."; //$NON-NLS-1$
- public static final String JPA_ENTITY = PRE + "entity"; //$NON-NLS-1$
- public static final String ADD_JPA_ENTITY = PRE + "add_entity"; //$NON-NLS-1$
- public static final String ADD_INHERITED_ENTITY = PRE + "mapped_superclass"; //$NON-NLS-1$
- public static final String PRIMARY_KEY = PRE + "pk"; //$NON-NLS-1$
- public static final String ICON_BASIC = PRE + "field"; //$NON-NLS-1$
- public static final String ADD_ATTRIBUTE = PRE + "add_attribute"; //$NON-NLS-1$
- public static final String REMOVE_ATTRIBUTE = PRE + "remove_attribute"; //$NON-NLS-1$
- public static final String ICON_ONE_TO_ONE = PRE + "one_to_one_relation"; //$NON-NLS-1$
- public static final String ICON_ONE_TO_MANY = PRE + "one_to_many_relation"; //$NON-NLS-1$
- public static final String ICON_MANY_TO_ONE = PRE + "many_to_one_relation"; //$NON-NLS-1$
- public static final String ICON_MANY_TO_MANY = PRE + "many_to_many_relation"; //$NON-NLS-1$
- public static final String ICON_EMBEDDED_ID = PRE + "embedded_id"; //$NON-NLS-1$
- public static final String ICON_VERSION = PRE + "version"; //$NON-NLS-1$
- public static final String ICON_TRANSIENT = PRE + "transient"; //$NON-NLS-1$
- public static final String ICON_EMBEDDED = PRE + "embedded"; //$NON-NLS-1$
- public static final String ICON_UNMAPPED = PRE + "unmapped"; //$NON-NLS-1$
-
-
- public static final String ICON_ONE_TO_ONE_1_DIR = PRE + "one_to_one_1_dir_relation"; //$NON-NLS-1$
- public static final String ICON_ONE_TO_MANY_1_DIR = PRE + "one_to_many_1_dir_relation"; //$NON-NLS-1$
- public static final String ICON_MANY_TO_ONE_1_DIR = PRE + "many_to_one_1_dir_relation"; //$NON-NLS-1$
- public static final String ICON_MANY_TO_MANY_1_DIR = PRE + "many_to_many_1_dir_relation"; //$NON-NLS-1$
-
- public static final String ICON_ONE_TO_ONE_2_DIR = PRE + "one_to_one_2_dir_relation"; //$NON-NLS-1$
- public static final String ICON_MANY_TO_ONE_2_DIR = PRE + "many_to_one_2_dir_relation"; //$NON-NLS-1$
- public static final String ICON_MANY_TO_MANY_2_DIR = PRE + "many_to_many_2_dir_relation"; //$NON-NLS-1$
-
-
- public static final String ICON_SAVE = PRE + "save"; //$NON-NLS-1$
- public static final String ICON_RESTORE = PRE + "restore"; //$NON-NLS-1$
- public static final String ICON_SAVE_AND_REMOVE = PRE + "save_and_remove"; //$NON-NLS-1$
-
- private static final String ROOT_FOLDER_FOR_IMG = "icons/"; //$NON-NLS-1$
-
- public JPAEditorImageProvider() {
- super();
- }
-
- @Override
- protected void addAvailableImages() {
- addImageFilePath(ICON_BASIC, ROOT_FOLDER_FOR_IMG + "ent/basic.gif"); //$NON-NLS-1$
- addImageFilePath(JPA_ENTITY, ROOT_FOLDER_FOR_IMG + "ent/entity.gif"); //$NON-NLS-1$
- addImageFilePath(ADD_JPA_ENTITY, ROOT_FOLDER_FOR_IMG + "ent/add_entity.gif"); //$NON-NLS-1$
- addImageFilePath(ADD_INHERITED_ENTITY, ROOT_FOLDER_FOR_IMG + "ent/mapped-superclass.gif"); //$NON-NLS-1$
- addImageFilePath(PRIMARY_KEY, ROOT_FOLDER_FOR_IMG + "ent/id.gif"); //$NON-NLS-1$
- addImageFilePath(ADD_ATTRIBUTE, ROOT_FOLDER_FOR_IMG + "ent/add_attribute.gif"); //$NON-NLS-1$
- addImageFilePath(REMOVE_ATTRIBUTE, ROOT_FOLDER_FOR_IMG + "ent/remove_attribute.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_ONE_TO_ONE, ROOT_FOLDER_FOR_IMG + "ent/one-to-one.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_ONE_TO_MANY, ROOT_FOLDER_FOR_IMG + "ent/one-to-many.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_MANY_TO_ONE, ROOT_FOLDER_FOR_IMG + "ent/many-to-one.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_MANY_TO_MANY, ROOT_FOLDER_FOR_IMG + "ent/many-to-many.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_EMBEDDED_ID, ROOT_FOLDER_FOR_IMG + "ent/embedded-id.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_VERSION, ROOT_FOLDER_FOR_IMG + "ent/version.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_TRANSIENT, ROOT_FOLDER_FOR_IMG + "ent/transient.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_EMBEDDED, ROOT_FOLDER_FOR_IMG + "ent/embedded.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_UNMAPPED, ROOT_FOLDER_FOR_IMG + "ent/null-attribute-mapping.gif"); //$NON-NLS-1$
-
- addImageFilePath(ICON_ONE_TO_ONE_1_DIR, ROOT_FOLDER_FOR_IMG + "ent/one-to-one-1-dir.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_ONE_TO_MANY_1_DIR, ROOT_FOLDER_FOR_IMG + "ent/one-to-many-1-dir.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_MANY_TO_ONE_1_DIR, ROOT_FOLDER_FOR_IMG + "ent/many-to-one-1-dir.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_MANY_TO_MANY_1_DIR, ROOT_FOLDER_FOR_IMG + "ent/many-to-many-1-dir.gif"); //$NON-NLS-1$
-
- addImageFilePath(ICON_ONE_TO_ONE_2_DIR, ROOT_FOLDER_FOR_IMG + "ent/one-to-one-2-dir.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_MANY_TO_ONE_2_DIR, ROOT_FOLDER_FOR_IMG + "ent/many-to-one-2-dir.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_MANY_TO_MANY_2_DIR, ROOT_FOLDER_FOR_IMG + "ent/many-to-many-2-dir.gif"); //$NON-NLS-1$
-
- addImageFilePath(ICON_SAVE, ROOT_FOLDER_FOR_IMG + "save.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_RESTORE, ROOT_FOLDER_FOR_IMG + "restore.gif"); //$NON-NLS-1$
- addImageFilePath(ICON_SAVE_AND_REMOVE, ROOT_FOLDER_FOR_IMG + "save_and_remove.gif"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java
deleted file mode 100644
index d70eed4756..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java
+++ /dev/null
@@ -1,619 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.provider;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.IDoubleClickContext;
-import org.eclipse.graphiti.features.context.IPictogramElementContext;
-import org.eclipse.graphiti.features.context.impl.CreateContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.context.impl.DeleteContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.internal.features.context.impl.base.PictogramElementContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.Font;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.palette.IPaletteCompartmentEntry;
-import org.eclipse.graphiti.palette.IToolEntry;
-import org.eclipse.graphiti.palette.impl.PaletteCompartmentEntry;
-import org.eclipse.graphiti.platform.IPlatformImageConstants;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.graphiti.tb.ContextButtonEntry;
-import org.eclipse.graphiti.tb.ContextEntryHelper;
-import org.eclipse.graphiti.tb.ContextMenuEntry;
-import org.eclipse.graphiti.tb.DefaultToolBehaviorProvider;
-import org.eclipse.graphiti.tb.IContextButtonEntry;
-import org.eclipse.graphiti.tb.IContextButtonPadData;
-import org.eclipse.graphiti.tb.IContextMenuEntry;
-import org.eclipse.graphiti.tb.IDecorator;
-import org.eclipse.graphiti.tb.ImageDecorator;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.facade.EclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ClickAddAttributeButtonFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ClickRemoveAttributeButtonFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CollapseAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CollapseCompartmentShapeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CollapseEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DeleteJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DiscardAndRemoveAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ExpandAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ExpandCompartmentShapeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ExpandEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.MoveEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.OpenJPADetailsViewFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.OpenMiniatureViewFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RefactorAttributeTypeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveAndSaveEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RenameEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RestoreEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.SaveAndRemoveAllEntitiesFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.SaveEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.JPAEditorMatchingStrategy;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants.ShapeType;
-import org.eclipse.ui.PartInitException;
-
-@SuppressWarnings("restriction")
-public class JPAEditorToolBehaviorProvider extends DefaultToolBehaviorProvider {
-
- private IEclipseFacade facade;
-
- public JPAEditorToolBehaviorProvider(IDiagramTypeProvider dtp) {
- this(dtp, EclipseFacade.INSTANCE);
- }
-
- public JPAEditorToolBehaviorProvider(IDiagramTypeProvider dtp, IEclipseFacade eclipseFacade) {
- super(dtp);
- this.facade = eclipseFacade;
- }
-
- @Override
- public IContextButtonPadData getContextButtonPad(IPictogramElementContext context) {
- IContextButtonPadData data = super.getContextButtonPad(context);
- ContainerShape cs = null;
- PictogramElement pe = ((PictogramElementContext) context).getPictogramElement();
- Object ob = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- if (ob == null){
- return null;
- }
- if (pe instanceof ContainerShape) {
- cs = (ContainerShape)pe;
- GraphicsAlgorithm ga = cs.getGraphicsAlgorithm();
- if (ga instanceof Rectangle) {
- List<GraphicsAlgorithm> gas = ((Rectangle)ga).getGraphicsAlgorithmChildren();
- if ((gas.size() > 0) && (gas.get(0) instanceof Text)) {
- setGenericContextButtons(data, pe, 0);
- ClickRemoveAttributeButtonFeature feat = getConcreteFeatureProvider()
- .getClickRemoveAttributeButtonFeature();
- DeleteContext delCtx = new DeleteContext(cs);
- ContextButtonEntry btn = new ContextButtonEntry(feat, delCtx);
- btn.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_deleteAttributeButtonlabel);
- btn.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_deleteAttributeButtonDescription);
- btn.setIconId(IPlatformImageConstants.IMG_EDIT_DELETE);
- data.getDomainSpecificContextButtons().add(btn);
- return data;
- }
- }
- } else {
- return data;
- }
-
- setGenericContextButtons(data, pe, CONTEXT_BUTTON_DELETE
- | CONTEXT_BUTTON_REMOVE);
- List<IContextButtonEntry> buttons = data.getGenericContextButtons();
- Iterator<IContextButtonEntry> btnsIt = buttons.iterator();
- while (btnsIt.hasNext()) {
- IContextButtonEntry button = btnsIt.next();
- if (button.getFeature() instanceof RemoveJPAEntityFeature) {
- button.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeEntityFromDiagramButtonLabel);
- button.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeEntityFromDiagramButtonDescription);
- } else if (button.getFeature() instanceof DeleteJPAEntityFeature) {
- button.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_deleteEntityFromModelButtonLabel);
- button.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_deleteEntityFromModelButtonDescription);
- }
- }
-
- ContextButtonEntry button = null;
- if (context instanceof PictogramElementContext) {
-
- ClickAddAttributeButtonFeature feature = getConcreteFeatureProvider().getClickAddAttributeButtonFeature();
- CreateContext createCtx = new CreateContext();
- createCtx.setTargetContainer(cs);
- button = new ContextButtonEntry(feature, createCtx);
- button.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_createAttributeButtonlabel);
- button.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_createAttributeButtonDescription);
- button.setIconId(JPAEditorImageProvider.ADD_ATTRIBUTE);
- data.getDomainSpecificContextButtons().add(button);
-
- PictogramElementContext c = (PictogramElementContext) context;
- RemoveAndSaveEntityFeature ft2 = new RemoveAndSaveEntityFeature(getFeatureProvider());
- RemoveContext remCtx = new RemoveContext(c.getPictogramElement());
- button = new ContextButtonEntry(ft2, remCtx);
- button.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndSaveButtonText);
- button.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndSaveButtonDescription);
- button.setIconId(JPAEditorImageProvider.ICON_SAVE_AND_REMOVE);
- data.getDomainSpecificContextButtons().add(button);
-
- SaveEntityFeature ft = new SaveEntityFeature(getConcreteFeatureProvider());
- CustomContext ctx = new CustomContext();
- ctx.setPictogramElements(new PictogramElement[] { c.getPictogramElement() });
- button = new ContextButtonEntry(ft, ctx);
- button.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_saveButtonText);
- button.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_saveButtonDescription);
- button.setIconId(JPAEditorImageProvider.ICON_SAVE);
- data.getDomainSpecificContextButtons().add(button);
-
- RestoreEntityFeature ft1 = new RestoreEntityFeature(getConcreteFeatureProvider());
- ctx = new CustomContext();
- ctx.setPictogramElements(new PictogramElement[] { c.getPictogramElement() });
- button = new ContextButtonEntry(ft1, ctx);
- button.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_restoreButtonText);
- button.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_restoreButtonDescription);
- button.setIconId(JPAEditorImageProvider.ICON_RESTORE);
- data.getDomainSpecificContextButtons().add(button);
-
- ctx = new CustomContext(new PictogramElement[] { pe });
- IFeatureProvider featureProvider = getFeatureProvider();
- ICustomFeature[] customFeatures = featureProvider.getCustomFeatures(ctx);
- int featureCount = customFeatures.length;
- for (int i = 0; i < featureCount; i++) {
- ICustomFeature customFeature = customFeatures[i];
- if (customFeature.isAvailable(ctx)) {
- if ((customFeature instanceof CollapseEntityFeature)) {
- IContextButtonEntry contextButton = ContextEntryHelper
- .createCollapseContextButton(true, customFeature, ctx);
- data.setCollapseContextButton(contextButton);
- } else if ((customFeature instanceof ExpandEntityFeature)) {
- IContextButtonEntry contextButton = ContextEntryHelper
- .createCollapseContextButton(false, customFeature, ctx);
- data.setCollapseContextButton(contextButton);
- }
- }
- }
- }
-
- return data;
- }
-
-
- @Override
- public IPaletteCompartmentEntry[] getPalette() {
- List<IPaletteCompartmentEntry> ret =
- new ArrayList<IPaletteCompartmentEntry>();
- IPaletteCompartmentEntry[] superCompartments =
- super.getPalette();
- for (int i = 0; i < superCompartments.length; i++) {
- String newLabel = (superCompartments[i].getLabel().equals("Objects") ? //$NON-NLS-1$
- JPAEditorMessages.PaletteCompartment_Objects :
- JPAEditorMessages.PaletteCompartment_Connections);
- PaletteCompartmentEntry entry = new PaletteCompartmentEntry(newLabel, superCompartments[i].getIconId());
- List<IToolEntry> lst = superCompartments[i].getToolEntries();
- Iterator<IToolEntry> it = lst.iterator();
- while(it.hasNext()) {
- entry.addToolEntry(it.next());
- }
- ret.add(entry);
- }
- IPaletteCompartmentEntry en = ret.get(0);
- ret.set(0, ret.get(1));
- ret.set(1, en);
- return ret.toArray(new IPaletteCompartmentEntry[ret.size()]);
- }
-
- @Override
- public IDecorator[] getDecorators(PictogramElement pe) {
- IFeatureProvider featureProvider = getFeatureProvider();
- Object bo = featureProvider.getBusinessObjectForPictogramElement(pe);
-
- if (bo instanceof JavaPersistentType) {
- JavaPersistentType persistentType = (JavaPersistentType) bo;
- IFile file = (IFile) persistentType.getResource();
- if(!file.exists()){
- return new IDecorator[0];
- }
- IMarker[] markers = new IMarker[0];
- try {
- markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
- IDecorator[] result = new IDecorator[1];
- if (markers.length == 0)
- return super.getDecorators(pe);
- IMarker marker = getHighestPrioMarker(markers);
- ImageDecorator imageRenderingDecorator = createDecoratorFromMarker(marker);
- if (imageRenderingDecorator != null) {
- imageRenderingDecorator.setX(5 * (pe.getGraphicsAlgorithm().getWidth() / 6));
- imageRenderingDecorator.setY(5 * (pe.getGraphicsAlgorithm().getHeight() / 6));
- result[0] = imageRenderingDecorator;
- }
- if (result[0] != null)
- return result;
- } catch (CoreException e) {
- JPADiagramEditorPlugin.getDefault().getLog().log(e.getStatus());
- }
- }
- return super.getDecorators(pe);
- }
-
- private IMarker getHighestPrioMarker(IMarker[] markers) {
- IMarker result = markers[0];
- for (IMarker marker : markers) {
- try {
- final Integer resultSeverity = (Integer) result.getAttribute(IMarker.SEVERITY);
- if (resultSeverity == null)
- continue;
- if (IMarker.SEVERITY_ERROR == resultSeverity)
- // return the first error marker
- break;
- Integer markerSeverity = (Integer) marker.getAttribute(IMarker.SEVERITY);
- if ((markerSeverity != null) && (markerSeverity > resultSeverity))
- result = marker;
- } catch (CoreException e) {
- JPADiagramEditorPlugin.getDefault().getLog().log(e.getStatus());
- continue;
- }
- }
- return result;
- }
-
- private ImageDecorator createDecoratorFromMarker(IMarker marker) {
- try {
- Integer severity = (Integer) marker.getAttribute(IMarker.SEVERITY);
- String decoratorType = IPlatformImageConstants.IMG_ECLIPSE_INFORMATION_TSK;
- if (severity != null) {
- switch (severity) {
- case 0:
- decoratorType = IPlatformImageConstants.IMG_ECLIPSE_INFORMATION_TSK;
- case 1:
- decoratorType = IPlatformImageConstants.IMG_ECLIPSE_WARNING_TSK;
- break;
- case 2:
- decoratorType = IPlatformImageConstants.IMG_ECLIPSE_ERROR_TSK;
- break;
- }
- ImageDecorator imageRenderingDecorator = new ImageDecorator(decoratorType);
- imageRenderingDecorator.setMessage((String) marker.getAttribute(IMarker.MESSAGE));
- return imageRenderingDecorator;
- }
- return null;
- } catch (CoreException e) {
- JPADiagramEditorPlugin.getDefault().getLog().log(e.getStatus());
- return null;
- }
- }
-
- public String getToolTip(GraphicsAlgorithm ga) {
- PictogramElement pe = ga.getPictogramElement();
- if (!(ga instanceof Rectangle))
- return null;
- List<GraphicsAlgorithm> ch = ga.getGraphicsAlgorithmChildren();
- if ((ch == null) || (ch.size() == 0))
- return null;
- ga = ch.get(0);
- if (!(ga instanceof Text))
- return null;
- Font f = ((Text)ga).getFont();
- if (f == null)
- return ""; //$NON-NLS-1$
- if(f.isItalic()){
- return getToolTipForCompartmentShape(ga);
- }
-
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- if (bo != null) {
- if (bo instanceof JavaPersistentType) {
- String superPersistentTypeName = null;
- if (((JavaPersistentType) bo).getSuperPersistentType() != null) {
- superPersistentTypeName = ((JavaPersistentType) bo).getSuperPersistentType().getName();
- }
- return JPAEditorUtil.getTooltipText((JavaPersistentType)bo, superPersistentTypeName);
- } else {
- if (bo instanceof JavaPersistentAttribute) {
- return JPAEditorUtil.getTooltipText((JavaPersistentAttribute)bo);
- }
- }
- }
- if (!(pe instanceof Shape))
- return null;
- Shape sh = (Shape)pe;
- ContainerShape csh = sh.getContainer();
- if (csh == null)
- return null;
- bo = getFeatureProvider().getBusinessObjectForPictogramElement(csh);
- if (bo instanceof JavaPersistentType) {
- String superPersistentTypeName = null;
- if (((JavaPersistentType) bo).getSuperPersistentType() != null) {
- superPersistentTypeName = ((JavaPersistentType) bo)
- .getSuperPersistentType().getName();
- }
- return JPAEditorUtil.getTooltipText((JavaPersistentType) bo,
- superPersistentTypeName);
- }
- return null;
- }
-
- private String getToolTipForCompartmentShape(GraphicsAlgorithm ga) {
- Text txt = (Text) ga;
- ContainerShape shape = (ContainerShape) Graphiti.getPeService().getActiveContainerPe(ga);
- if(GraphicsUpdater.isCollapsed(shape))
- return MessageFormat.format(JPAEditorMessages.JPAEditorToolBehaviorProvider_expandCompartToolTip, txt.getValue());
- return MessageFormat.format(JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseCompartToolTip, txt.getValue());
- }
-
- protected JPAEditorFeatureProvider getConcreteFeatureProvider() {
- return (JPAEditorFeatureProvider)super.getFeatureProvider();
- }
-
- @Override
- public IContextMenuEntry[] getContextMenu(ICustomContext context) {
- ICustomContext customContext = (ICustomContext)context;
- PictogramElement[] pictEls = customContext.getPictogramElements();
-
- ICustomFeature saveEntityFeature = new SaveEntityFeature(getFeatureProvider());
- ContextMenuEntry saveEntityMenuItem = new ContextMenuEntry(saveEntityFeature, context);
- saveEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_saveMenuItem);
- saveEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_saveMenuItemDescr);
- saveEntityMenuItem.setSubmenu(false);
-
- ICustomFeature restoreEntityFeature = new RestoreEntityFeature(getFeatureProvider());
- ContextMenuEntry restoreEntityMenuItem = new ContextMenuEntry(restoreEntityFeature, context);
- restoreEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_discardChangesMenuItem);
- restoreEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_discardChangesMenuItemDescr);
- restoreEntityMenuItem.setSubmenu(false);
-
- ICustomFeature collapseFeature = new CollapseEntityFeature(getFeatureProvider());
- ContextMenuEntry collapseEntityMenuItem = new ContextMenuEntry(collapseFeature, context);
- collapseEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseEntityMenuItem);
- collapseEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseEntityMenuItemDescr);
- collapseEntityMenuItem.setSubmenu(false);
-
- ICustomFeature collapseAllFeature = new CollapseAllEntitiesFeature(getFeatureProvider());
- ContextMenuEntry collapseAllMenuItem = new ContextMenuEntry(collapseAllFeature, context);
- collapseAllMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseAllEntitiesMenuItem);
- collapseAllMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseAllEntitiesMenuItemDescr);
- collapseAllMenuItem.setSubmenu(false);
-
- ICustomFeature expandFeature = new ExpandEntityFeature(getFeatureProvider());
- ContextMenuEntry expandEntityMenuItem= new ContextMenuEntry(expandFeature, context);
- expandEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_expandEntityMenuItem);
- expandEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_expandEntitymenuItemDescr);
- expandEntityMenuItem.setSubmenu(false);
-
- ICustomFeature expandAllFeature = new ExpandAllEntitiesFeature(getFeatureProvider());
- ContextMenuEntry expandAllMenuItem= new ContextMenuEntry(expandAllFeature, context);
- expandAllMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_expandAllEntitiesMenuItem);
- expandAllMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_expandAllEntitiesMenuItemDescr);
- expandAllMenuItem.setSubmenu(false);
-
- ICustomFeature openJPADetailsViewFeature = new OpenJPADetailsViewFeature(getFeatureProvider());
- ContextMenuEntry openJPADetailsViewMenuItem = new ContextMenuEntry(openJPADetailsViewFeature, context);
- openJPADetailsViewMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_openJPADetailsView);
- openJPADetailsViewMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_openJPADetailsViewDesc);
- openJPADetailsViewMenuItem.setSubmenu(false);
-
- ICustomFeature openMiniatureViewFeature = new OpenMiniatureViewFeature(getFeatureProvider());
- ContextMenuEntry openMiniatureViewMenuItem = new ContextMenuEntry(openMiniatureViewFeature, context);
- openMiniatureViewMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_openMiniatureView);
- openMiniatureViewMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_openMiniatureViewDesc);
- openMiniatureViewMenuItem.setSubmenu(false);
-
- boolean isEmpty = true;
- ContextMenuEntry removeAllEntitiesSubmenu = null;
- if(getDiagramTypeProvider().getDiagram().getChildren().size()!=0){
- isEmpty = false;
- removeAllEntitiesSubmenu = new ContextMenuEntry(null, null);
- removeAllEntitiesSubmenu.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAllEntitiesMenu);
- removeAllEntitiesSubmenu.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAllEntitiesMenu);
- removeAllEntitiesSubmenu.setSubmenu(true);
-
- ICustomFeature customFeature = new SaveAndRemoveAllEntitiesFeature(getFeatureProvider());
- ContextMenuEntry saveAndRemovEntityMenuItem = new ContextMenuEntry(customFeature, context);
- saveAndRemovEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndSaveAllEntitiesAction);
- saveAndRemovEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndSaveAllEntitiesAction);
- saveAndRemovEntityMenuItem.setSubmenu(false);
-
- customFeature = new DiscardAndRemoveAllEntitiesFeature(getFeatureProvider());
- ContextMenuEntry discardAndRemovEntityMenuItem = new ContextMenuEntry(customFeature, context);
- discardAndRemovEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndDiscardAllEntitiesAction);
- discardAndRemovEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_removeAndDiscardAllEntitiesAction);
- discardAndRemovEntityMenuItem.setSubmenu(false);
-
- removeAllEntitiesSubmenu.add(saveAndRemovEntityMenuItem);
- removeAllEntitiesSubmenu.add(discardAndRemovEntityMenuItem);
-
- }
-
-
- if ((pictEls == null) || (pictEls.length == 0))
- return new IContextMenuEntry[] { openJPADetailsViewMenuItem };
- if (pictEls[0] instanceof ContainerShape) {
- Object ob = getFeatureProvider().getBusinessObjectForPictogramElement(pictEls[0]);
- if (pictEls[0] instanceof Diagram) {
- ICustomFeature customFeature = new AddAllEntitiesFeature(getFeatureProvider());
- ContextMenuEntry showAllEntsMenuItem = new ContextMenuEntry(customFeature, context);
- showAllEntsMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_showAllTheEntities);
- showAllEntsMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_showAllTheEntitiesDesc);
- showAllEntsMenuItem.setSubmenu(false);
- if(isEmpty){
- return new IContextMenuEntry[] { showAllEntsMenuItem,
- collapseAllMenuItem,
- expandAllMenuItem,
- openJPADetailsViewMenuItem,
- openMiniatureViewMenuItem};
- } else {
- return new IContextMenuEntry[] { showAllEntsMenuItem,
- removeAllEntitiesSubmenu,
- collapseAllMenuItem,
- expandAllMenuItem,
- openJPADetailsViewMenuItem,
- openMiniatureViewMenuItem};
- }
- }
- if((ob == null) && (pictEls[0].getGraphicsAlgorithm() instanceof Rectangle)){
- ICustomFeature collapseCompartmentFeature = new CollapseCompartmentShapeFeature(getFeatureProvider());
- ContextMenuEntry collapseCompartmentMenuItem = new ContextMenuEntry(collapseCompartmentFeature, context);
- collapseCompartmentMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseAttrGroupMenuItem);
- collapseCompartmentMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_collapseAttrGroupMenuItemDescr);
- collapseCompartmentMenuItem.setSubmenu(false);
-
- ICustomFeature expandCompartmentFeature = new ExpandCompartmentShapeFeature(getFeatureProvider());
- ContextMenuEntry expandCompartmentMenuItem= new ContextMenuEntry(expandCompartmentFeature, context);
- expandCompartmentMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_expandAttrMenuItem);
- expandCompartmentMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_expandAttrMenuItemDescr);
- expandCompartmentMenuItem.setSubmenu(false);
- return new IContextMenuEntry[] {collapseCompartmentMenuItem, expandCompartmentMenuItem};
- }
-
- /*
- //Apply Pattern menu
-
- ICustomFeature applyPatternFeature = new ApplyPatternFeature(getFeatureProvider());
- ContextMenuEntry applyPatternMenuItem = new ContextMenuEntry(applyPatternFeature, context);
- applyPatternMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_applyPattern);
- applyPatternMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_applyPatternDesc);
- applyPatternMenuItem.setSubmenu(false);
- //Apply Pattern menu
- */
-
- ContextMenuEntry refactorClassSubmenu = new ContextMenuEntry(null, null);
- refactorClassSubmenu.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_refactorSubMenu);
- refactorClassSubmenu.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_refactorSubMenu);
- refactorClassSubmenu.setSubmenu(true);
-
-
- ICustomFeature customFeature = new RenameEntityFeature(getFeatureProvider());
- ContextMenuEntry renameEntityMenuItem = new ContextMenuEntry(customFeature, context);
- renameEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_renameEntityClass);
- renameEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_renameEntityClass);
- renameEntityMenuItem.setSubmenu(false);
-
- customFeature = new MoveEntityFeature(getFeatureProvider());
- ContextMenuEntry moveEntityMenuItem = new ContextMenuEntry(customFeature, context);
- moveEntityMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_moveEntityClass);
- moveEntityMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_moveEntityClass);
- moveEntityMenuItem.setSubmenu(false);
-
- refactorClassSubmenu.add(renameEntityMenuItem);
- refactorClassSubmenu.add(moveEntityMenuItem);
-
- String shapeType = Graphiti.getPeService().getPropertyValue(pictEls[0], JPAEditorConstants.PROP_SHAPE_TYPE);
-
- if ((shapeType == null) || !shapeType.equals(ShapeType.ATTRIBUTE.toString()))
- return new IContextMenuEntry[] { saveEntityMenuItem,
- refactorClassSubmenu,
- collapseEntityMenuItem,
- collapseAllMenuItem,
- expandEntityMenuItem,
- expandAllMenuItem,
- restoreEntityMenuItem,
- //applyPatternMenuItem,
- removeAllEntitiesSubmenu,
- openJPADetailsViewMenuItem,
- openMiniatureViewMenuItem};
-
- customFeature = new RefactorAttributeTypeFeature(getFeatureProvider());
- ContextMenuEntry refactorAttributeTypeMenuItem = new ContextMenuEntry(customFeature, context);
- refactorAttributeTypeMenuItem.setText(JPAEditorMessages.JPAEditorToolBehaviorProvider_refactorAttributeType);
- refactorAttributeTypeMenuItem.setDescription(JPAEditorMessages.JPAEditorToolBehaviorProvider_refactorAttributeTypeDesc);
- refactorAttributeTypeMenuItem.setSubmenu(false);
-
- return new IContextMenuEntry[] { refactorClassSubmenu,
- refactorAttributeTypeMenuItem,
- collapseAllMenuItem,
- expandAllMenuItem,
- //applyPatternMenuItem,
- openJPADetailsViewMenuItem,
- openMiniatureViewMenuItem};
- }
- return new IContextMenuEntry[] { removeAllEntitiesSubmenu,
- collapseAllMenuItem,
- expandAllMenuItem,
- openJPADetailsViewMenuItem,
- openMiniatureViewMenuItem};
- }
-
- @Override
- public ICustomFeature getDoubleClickFeature(IDoubleClickContext context) {
- PictogramElement pe = context.getPictogramElements()[0];
- Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(
- pe);
- if (bo instanceof JavaPersistentAttribute) {
- JavaPersistentAttribute jpa = (JavaPersistentAttribute) bo;
- IFile file = (IFile) jpa.getResource();
- try {
- file.setSessionProperty(new QualifiedName(null, JPAEditorMatchingStrategy.DOUBLE_CLICK), "true"); //$NON-NLS-1$
- facade.getIDE().openEditor(file);
- } catch (PartInitException e) {
- JPADiagramEditorPlugin.logError("Cannot open editor", e); //$NON-NLS-1$
- } catch (CoreException e) {
- JPADiagramEditorPlugin.logError("Cannot open editor", e); //$NON-NLS-1$
- }
- }
- if (bo instanceof JavaPersistentType) {
- JavaPersistentType jpt = (JavaPersistentType) bo;
- IFile file = (IFile) jpt.getResource();
- try {
- file.setSessionProperty(new QualifiedName(null, JPAEditorMatchingStrategy.DOUBLE_CLICK), "true"); //$NON-NLS-1$
- facade.getIDE().openEditor(file);
- } catch (PartInitException e) {
- JPADiagramEditorPlugin.logError("Cannot open editor", e); //$NON-NLS-1$
- } catch (CoreException e) {
- JPADiagramEditorPlugin.logError("Cannot open editor", e); //$NON-NLS-1$
- }
- }
- if ((bo == null) && (pe.getGraphicsAlgorithm() instanceof Rectangle)) {
- ICustomContext cont = new CustomContext(
- new PictogramElement[] { pe });
- ContainerShape containerShape = (ContainerShape) pe;
- if (GraphicsUpdater.isCollapsed(containerShape)) {
- ExpandCompartmentShapeFeature feature = new ExpandCompartmentShapeFeature(
- getFeatureProvider());
- feature.execute(cont);
- } else {
- CollapseCompartmentShapeFeature feature = new CollapseCompartmentShapeFeature(
- getFeatureProvider());
- feature.execute(cont);
- }
-
- }
- return super.getDoubleClickFeature(context);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java
deleted file mode 100644
index 1af1f3ec38..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import java.util.Hashtable;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-abstract public class AbstractRelation implements IRelation {
- protected final static String SEPARATOR = ";"; //$NON-NLS-1$
- protected JavaPersistentType owner;
- protected JavaPersistentType inverse;
- protected JavaPersistentAttribute ownerAnnotatedAttribute;
- protected JavaPersistentAttribute inverseAnnotatedAttribute;
-
- protected String ownerAttributeName;
- protected String inverseAttributeName;
-
-
- public final static Hashtable<RelType, String> relTypeToIdPart = new Hashtable<RelType, String>();
- public final static Hashtable<RelDir, String> relDirToIdPart = new Hashtable<RelDir, String>();
-
- static {
- relTypeToIdPart.put(RelType.ONE_TO_ONE, "1-1"); //$NON-NLS-1$
- relTypeToIdPart.put(RelType.ONE_TO_MANY, "1-N"); //$NON-NLS-1$
- relTypeToIdPart.put(RelType.MANY_TO_ONE, "N-1"); //$NON-NLS-1$
- relTypeToIdPart.put(RelType.MANY_TO_MANY, "N-N"); //$NON-NLS-1$
-
- relDirToIdPart.put(RelDir.UNI, "->"); //$NON-NLS-1$
- relDirToIdPart.put(RelDir.BI, "<->"); //$NON-NLS-1$
- }
-
- public AbstractRelation(JavaPersistentType owner, JavaPersistentType inverse) {
- this.owner = owner;
- this.inverse = inverse;
- }
-
- public String getId() {
- return generateId(owner, inverse, getOwnerAttributeName(), getRelType(), getRelDir());
- }
-
- public JavaPersistentType getOwner() {
- return owner;
- }
-
- public JavaPersistentType getInverse() {
- return inverse;
- }
-
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
- return inverseAnnotatedAttribute;
- }
-
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setOwnerAnnotatedAttribute(
- JavaPersistentAttribute ownerAnnotatedAttribute) {
- this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
- }
-
- public void setInverseAnnotatedAttribute(
- JavaPersistentAttribute inverseAnnotatedAttribute) {
- this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
- }
-
- public void setOwnerAttributeName(String ownerAttributeName) {
- this.ownerAttributeName = ownerAttributeName;
- }
-
- public String getOwnerAttributeName() {
- if (this.ownerAnnotatedAttribute != null)
- return ownerAnnotatedAttribute.getName();
- return ownerAttributeName;
- }
-
- public void setInverseAttributeName(String inverseAttributeName) {
- this.inverseAttributeName = inverseAttributeName;
- }
-
- public String getInverseAttributeName() {
- if (this.inverseAnnotatedAttribute != null)
- return inverseAnnotatedAttribute.getName();
- return inverseAttributeName;
- }
-
- public int hashCode() {
- return getId().hashCode();
- }
-
- public boolean equals(Object otherRel) {
- if (!IRelation.class.isInstance(otherRel))
- return false;
- return getId().equals(((IRelation)otherRel).getId());
- }
-
- public abstract RelType getRelType();
-
- public abstract RelDir getRelDir();
-
- public static String generateId(JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- RelType relType,
- RelDir relDir) {
- String id = owner.getName() + "-" + inverse.getName() + SEPARATOR + //$NON-NLS-1$
- relTypeToIdPart.get(relType) + SEPARATOR +
- relDirToIdPart.get(relDir) + SEPARATOR + ownerAttributeName;
- return id;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/BidirectionalRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/BidirectionalRelation.java
deleted file mode 100644
index 26fbc1f61a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/BidirectionalRelation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-
-public interface BidirectionalRelation extends IRelation {
-
- public abstract JavaPersistentAttribute getOwnerAnnotatedAttribute();
-
- public abstract JavaPersistentAttribute getInverseAnnotatedAttribute();
-
- public abstract void setOwnerAnnotatedAttribute(JavaPersistentAttribute ownerAnnotatedAttribute);
-
- public abstract void setInverseAnnotatedAttribute(JavaPersistentAttribute inverseAnnotatedAttribute);
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java
deleted file mode 100644
index 0556846f29..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-public interface IRelation {
-
- public static enum RelType {
- ONE_TO_ONE, ONE_TO_MANY, MANY_TO_ONE, MANY_TO_MANY
- }
-
- public static enum RelDir {
- UNI, BI
- }
-
- public abstract String getId();
-
- public abstract JavaPersistentType getOwner();
-
- public abstract JavaPersistentType getInverse();
-
- public void setOwnerAnnotatedAttribute(JavaPersistentAttribute ownerAnnotatedAttribute);
-
- public JavaPersistentAttribute getOwnerAnnotatedAttribute();
-
- public void setInverseAnnotatedAttribute(JavaPersistentAttribute inverseAnnotatedAttribute);
-
- public void setOwnerAttributeName(String ownerAttributeName);
-
- public void setInverseAttributeName(String inverseAttributeName);
-
- public abstract JavaPersistentAttribute getInverseAnnotatedAttribute();
-
- public abstract String getOwnerAttributeName();
-
- public abstract String getInverseAttributeName();
-
- public abstract RelType getRelType();
-
- public abstract RelDir getRelDir();
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java
deleted file mode 100644
index 41d9e2c234..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class ManyToManyBiDirRelation extends ManyToManyRelation implements BidirectionalRelation {
-
- public ManyToManyBiDirRelation(IJPAEditorFeatureProvider fp, JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- String inverseAttributeName,
- boolean createAttribs,
- ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- super(owner, inverse);
- this.ownerAttributeName = ownerAttributeName;
- this.inverseAttributeName = inverseAttributeName;
- if (createAttribs)
- createRelation(fp, ownerCU, inverseCU);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jpt.jpadiagrameditor.ui.relations.BidirectionalRelation#getOwnerAnnotatedAttribute()
- */
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setOwnerAnnotatedAttribute(
- JavaPersistentAttribute ownerAnnotatedAttribute) {
- this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jpt.jpadiagrameditor.ui.relations.BidirectionalRelation#getInverseAnnotatedAttribute()
- */
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
- return inverseAnnotatedAttribute;
- }
-
- public void setInverseAnnotatedAttribute(
- JavaPersistentAttribute inverseAnnotatedAttribute) {
- this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
- }
-
- private void createRelation(IJPAEditorFeatureProvider fp, ICompilationUnit ownerCU, ICompilationUnit inverseCU) {
- String inverseAttributeName = JPAEditorUtil.returnSimpleName(inverse.getName());
- String actInverseAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
-
- String nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(inverseAttributeName);
- String actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actInverseAttributeName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(inverseAttributeName);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actInverseAttributeName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, actNameWithNonCapitalLetter);
-
- ownerAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, owner, inverse,
- JPADiagramPropertyPage.isMapType(owner.getJpaProject().getProject()) ? JpaArtifactFactory.instance().getIdType(inverse) : null,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter,
- true,
- ownerCU,
- inverseCU);
-
- String ownerAttributeName = JPAEditorUtil.returnSimpleName(owner.getName());
- String actOwnerAttributeName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(owner));
- nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(ownerAttributeName);
- actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actOwnerAttributeName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(inverse)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(ownerAttributeName);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actOwnerAttributeName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(inverse, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(inverse, actNameWithNonCapitalLetter);
- boolean isMap = JPADiagramPropertyPage.isMapType(owner.getJpaProject().getProject());
- inverseAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, inverse, owner,
- isMap ? JpaArtifactFactory.instance().getIdType(owner) : null,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter,
- true,
- inverseCU,
- ownerCU);
-
- JpaArtifactFactory.instance().addManyToManyBidirectionalRelation(fp, owner, ownerAnnotatedAttribute, inverse, inverseAnnotatedAttribute, isMap);
- }
-
- public RelDir getRelDir() {
- return RelDir.BI;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyRelation.java
deleted file mode 100644
index 16833b4f0c..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyRelation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-public abstract class ManyToManyRelation extends AbstractRelation {
-
- public ManyToManyRelation(JavaPersistentType owner, JavaPersistentType inverse) {
- super(owner, inverse);
- }
-
- public RelType getRelType() {
- return RelType.MANY_TO_MANY;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java
deleted file mode 100644
index 790c23c61f..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class ManyToManyUniDirRelation extends ManyToManyRelation implements UnidirectionalRelation {
-
- public ManyToManyUniDirRelation(IJPAEditorFeatureProvider fp, JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- boolean createAttribs,
- ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- super(owner, inverse);
- this.ownerAttributeName = ownerAttributeName;
- if (createAttribs)
- createRelation(fp, ownerCU, inverseCU);
- }
-
- public JavaPersistentAttribute getAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
- this.ownerAnnotatedAttribute = annotatedAttribute;
- }
-
- private void createRelation(IJPAEditorFeatureProvider fp, ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- String name = JPAEditorUtil.returnSimpleName(inverse.getName());
- String actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
-
- String nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- String actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, actNameWithNonCapitalLetter);
- boolean isMap = JPADiagramPropertyPage.isMapType(owner.getJpaProject().getProject());
- ownerAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, owner, inverse,
- isMap ? JpaArtifactFactory.instance().getIdType(inverse) : null,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter,
- true,
- ownerCU,
- inverseCU);
- JpaArtifactFactory.instance().addManyToManyUnidirectionalRelation(fp, owner, ownerAnnotatedAttribute, isMap);
-
- }
-
- public RelDir getRelDir() {
- return RelDir.UNI;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java
deleted file mode 100644
index 3442c507f8..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class ManyToOneBiDirRelation extends ManyToOneRelation implements BidirectionalRelation{
-
- public ManyToOneBiDirRelation(IJPAEditorFeatureProvider fp, JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- String inverseAttributeName,
- boolean createAttribs,
- ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- super(owner, inverse);
- this.ownerAttributeName = ownerAttributeName;
- this.inverseAttributeName = inverseAttributeName;
- if (createAttribs)
- createRelation(fp, ownerCU, inverseCU);
-
- }
-
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setOwnerAnnotatedAttribute( JavaPersistentAttribute ownerAnnotatedAttribute) {
- this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
- }
-
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
- return inverseAnnotatedAttribute;
- }
-
- public void setInverseAnnotatedAttribute(JavaPersistentAttribute inverseAnnotatedAttribute) {
- this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
- }
-
- private void createRelation(IJPAEditorFeatureProvider fp, ICompilationUnit ownerCU, ICompilationUnit inverseCU) {
- String name = JPAEditorUtil.returnSimpleName(inverse.getName());
- String actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- String actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, actNameWithNonCapitalLetter);
-
- ownerAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, owner, inverse,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter, false,
- ownerCU,
- inverseCU);
-
- name = JPAEditorUtil.returnSimpleName(owner.getName());
- actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(owner));
- nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(inverse)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(inverse, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(inverse, actNameWithNonCapitalLetter);
- boolean isMap = JPADiagramPropertyPage.isMapType(owner.getJpaProject().getProject());
- inverseAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, inverse, owner,
- isMap ? JpaArtifactFactory.instance().getIdType(owner) : null,
- nameWithNonCapitalLetter, actNameWithNonCapitalLetter,
- true,
- inverseCU,
- ownerCU);
-
- JpaArtifactFactory.instance().addManyToOneBidirectionalRelation(fp, owner, ownerAnnotatedAttribute, inverse, inverseAnnotatedAttribute, isMap);
- }
-
- public RelDir getRelDir() {
- return RelDir.BI;
- }
-
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneRelation.java
deleted file mode 100644
index f0df131185..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneRelation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-abstract public class ManyToOneRelation extends AbstractRelation{
-
- public ManyToOneRelation(JavaPersistentType owner, JavaPersistentType inverse) {
- super(owner, inverse);
- }
-
- public RelType getRelType() {
- return RelType.MANY_TO_ONE;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java
deleted file mode 100644
index 099eb292bd..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class ManyToOneUniDirRelation extends ManyToOneRelation implements UnidirectionalRelation {
-
- public ManyToOneUniDirRelation(IJPAEditorFeatureProvider fp, JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- boolean createAttribs,
- ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- super(owner, inverse);
- this.ownerAttributeName = ownerAttributeName;
- if (createAttribs)
- createRelation(fp, ownerCU, inverseCU);
- }
-
- public JavaPersistentAttribute getAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
- this.ownerAnnotatedAttribute = annotatedAttribute;
- }
-
- private void createRelation(IJPAEditorFeatureProvider fp, ICompilationUnit ownerCU, ICompilationUnit inverseCU) {
- String name = JPAEditorUtil.returnSimpleName(inverse.getName());
- String actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
- String nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- String actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, actNameWithNonCapitalLetter);
-
- //fp.addAddIgnore(owner, actNameWithNonCapitalLetter);
-
- ownerAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, owner, inverse,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter, false,
- ownerCU,
- inverseCU);
- JpaArtifactFactory.instance().addManyToOneUnidirectionalRelation(fp, owner, ownerAnnotatedAttribute);
-
- }
-
- public RelDir getRelDir() {
- return RelDir.UNI;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyRelation.java
deleted file mode 100644
index d35e713acc..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyRelation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-public abstract class OneToManyRelation extends AbstractRelation {
-
- public OneToManyRelation(JavaPersistentType owner, JavaPersistentType inverse) {
- super(owner, inverse);
- }
-
- public RelType getRelType() {
- return RelType.ONE_TO_MANY;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java
deleted file mode 100644
index 7af06377c6..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class OneToManyUniDirRelation extends OneToManyRelation implements UnidirectionalRelation {
-
- public OneToManyUniDirRelation(IJPAEditorFeatureProvider fp, JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- boolean createAttribs,
- ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- super(owner, inverse);
- this.ownerAttributeName = ownerAttributeName;
- if (createAttribs)
- createRelation(fp, ownerCU, inverseCU);
- }
-
- public JavaPersistentAttribute getAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
- this.ownerAnnotatedAttribute = annotatedAttribute;
- }
-
- private void createRelation(IJPAEditorFeatureProvider fp, ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- String name = JPAEditorUtil.returnSimpleName(inverse.getName());
- String actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
-
- String nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- String actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, actNameWithNonCapitalLetter);
- boolean isMap = JPADiagramPropertyPage.isMapType(owner.getJpaProject().getProject());
- ownerAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, owner, inverse,
- isMap ? JpaArtifactFactory.instance().getIdType(inverse) : null,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter, true,
- ownerCU,
- inverseCU);
- JpaArtifactFactory.instance().addOneToManyUnidirectionalRelation(fp, owner, ownerAnnotatedAttribute, isMap);
- }
-
- public RelDir getRelDir() {
- return RelDir.UNI;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java
deleted file mode 100644
index eae7ccccc9..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class OneToOneBiDirRelation extends OneToOneRelation implements BidirectionalRelation{
- public OneToOneBiDirRelation(IJPAEditorFeatureProvider fp, JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- String inverseAttributeName,
- boolean createAttribs,
- ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- super(owner, inverse);
- this.ownerAttributeName = ownerAttributeName;
- this.inverseAttributeName = inverseAttributeName;
- if (createAttribs)
- createRelation(fp, ownerCU, inverseCU);
- }
-
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setOwnerAnnotatedAttribute(
- JavaPersistentAttribute ownerAnnotatedAttribute) {
- this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
- }
-
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
- return inverseAnnotatedAttribute;
- }
-
- public void setInverseAnnotatedAttribute(
- JavaPersistentAttribute inverseAnnotatedAttribute) {
- this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
- }
-
- private void createRelation(IJPAEditorFeatureProvider fp, ICompilationUnit ownerCU, ICompilationUnit inverseCU) {
- String name = JPAEditorUtil.returnSimpleName(inverse.getName());
- String actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
-
- String nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- String actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, actNameWithNonCapitalLetter);
-
- ownerAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, owner, inverse,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter, false,
- ownerCU,
- inverseCU);
-
- name = JPAEditorUtil.returnSimpleName(owner.getName());
- actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(owner));
- nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(inverse)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(inverse, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(inverse, actNameWithNonCapitalLetter);
- inverseAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, inverse, owner,
- nameWithNonCapitalLetter, actNameWithNonCapitalLetter,
- false,
- inverseCU,
- ownerCU);
-
- JpaArtifactFactory.instance().addOneToOneBidirectionalRelation(fp, owner, ownerAnnotatedAttribute, inverse, inverseAnnotatedAttribute);
- }
-
- public RelDir getRelDir() {
- return RelDir.BI;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneRelation.java
deleted file mode 100644
index 12119f3008..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneRelation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-abstract public class OneToOneRelation extends AbstractRelation {
-
- public OneToOneRelation(JavaPersistentType owner,
- JavaPersistentType inverse) {
- super(owner, inverse);
- }
-
- public RelType getRelType() {
- return RelType.ONE_TO_ONE;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java
deleted file mode 100644
index b429068394..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-
-
-public class OneToOneUniDirRelation extends OneToOneRelation implements UnidirectionalRelation {
-
- public OneToOneUniDirRelation(IJPAEditorFeatureProvider fp, JavaPersistentType owner,
- JavaPersistentType inverse,
- String ownerAttributeName,
- boolean createAttribs,
- ICompilationUnit ownerCU,
- ICompilationUnit inverseCU) {
- super(owner, inverse);
- this.ownerAttributeName = ownerAttributeName;
- if (createAttribs)
- createRelation(fp, ownerCU, inverseCU);
- }
-
- public JavaPersistentAttribute getAnnotatedAttribute() {
- return ownerAnnotatedAttribute;
- }
-
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
- this.ownerAnnotatedAttribute = annotatedAttribute;
- }
-
- private void createRelation(IJPAEditorFeatureProvider fp, ICompilationUnit ownerCU, ICompilationUnit inverseCU) {
- String name = JPAEditorUtil.returnSimpleName(inverse.getName());
- String actName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(inverse));
-
- String nameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(name);
- String actNameWithNonCapitalLetter = JPAEditorUtil.decapitalizeFirstLetter(actName);
-
- if (JpaArtifactFactory.instance().isMethodAnnotated(owner)) {
- nameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(name);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceValidAttributeName(actName);
- }
- nameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, nameWithNonCapitalLetter);
- actNameWithNonCapitalLetter = JPAEditorUtil.produceUniqueAttributeName(owner, actNameWithNonCapitalLetter);
-
- ownerAnnotatedAttribute = JpaArtifactFactory.instance().addAttribute(fp, owner, inverse,
- nameWithNonCapitalLetter,
- actNameWithNonCapitalLetter, false,
- ownerCU,
- inverseCU);
- JpaArtifactFactory.instance().addOneToOneUnidirectionalRelation(fp, owner, ownerAnnotatedAttribute);
-
- }
-
- public RelDir getRelDir() {
- return RelDir.UNI;
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/UnidirectionalRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/UnidirectionalRelation.java
deleted file mode 100644
index 7ffb85a51e..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/UnidirectionalRelation.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-
-public interface UnidirectionalRelation extends IRelation {
-
- public abstract JavaPersistentAttribute getAnnotatedAttribute();
-
- public abstract void setAnnotatedAttribute(JavaPersistentAttribute at);
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntitiesCoordinatesXML.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntitiesCoordinatesXML.java
deleted file mode 100644
index db7b402e6f..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntitiesCoordinatesXML.java
+++ /dev/null
@@ -1,243 +0,0 @@
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.xml.sax.SAXException;
-
-public class EntitiesCoordinatesXML {
-
- private Document document;
- private Element rootElement;
- private String projectName;
-
- public static final String XML_ELEMENT_POSITION = "\n\t\t"; //$NON-NLS-1$
-
- public EntitiesCoordinatesXML(String projectName){
- this.projectName = projectName;
- DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- InputStream is = null;
- try {
- DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
- is = (InputStream)findXMLFile(true);
- document = documentBuilder.parse(is);
- rootElement = document.getDocumentElement();
- } catch (ParserConfigurationException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.EntitiesCoordinatesXML_CannotParseFileErrorMSG, e);
- } catch (SAXException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.EntitiesCoordinatesXML_CannotParseFileErrorMSG, e);
- } catch (IOException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.EntitiesCoordinatesXML_CannotReadFileErrorMSG, e);
- } finally {
- if (is != null)
- try {
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
-
- private Closeable findXMLFile(boolean inputStream) throws FileNotFoundException{
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- try {
- IResource[] resources = project.members();
- for (IResource res : resources) {
- if (res instanceof IFolder) {
- IFile existingXMLFile = ((IFolder) res).getFile(projectName + "." + ModelIntegrationUtil.DIAGRAM_XML_FILE_EXTENSION); //$NON-NLS-1$
- if (existingXMLFile != null && existingXMLFile.exists()) {
- return inputStream ?
- new FileInputStream(new File(existingXMLFile.getLocationURI())) :
- new FileOutputStream(new File(existingXMLFile.getLocationURI()));
- }
- }
- }
- } catch (CoreException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.EntitiesCoordinatesXML_CannotObtainProjectErrorMSG, e);
- }
- IFile existingXMLFile = project.getFile(ModelIntegrationUtil.getDiagramsXMLFolderPath(project).append(projectName).addFileExtension(ModelIntegrationUtil.DIAGRAM_XML_FILE_EXTENSION));
- return inputStream ? new FileInputStream(new File(existingXMLFile.getLocationURI())) :
- new FileOutputStream(new File(existingXMLFile.getLocationURI()));
- }
-
- synchronized public void store() {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- Diagram diagram = ModelIntegrationUtil.getDiagramByProject(project);
- List<Shape> picts = diagram.getChildren();
- Iterator<Shape> it = picts.iterator();
- // collecting data from the saved pictograms
- document.removeChild(rootElement);
- rootElement = document.createElement("entities"); //$NON-NLS-1$
- document.appendChild(rootElement);
-
- while (it.hasNext()) {
- Shape pict = it.next();
- String name = Graphiti.getPeService().getPropertyValue(pict, JPAEditorConstants.PROP_ENTITY_CLASS_NAME);
-
- RoundedRectangle rect = (RoundedRectangle) pict.getGraphicsAlgorithm();
-
- boolean isPrimaryCollapsed = JPAEditorConstants.TRUE_STRING.equals(Graphiti.getPeService().getPropertyValue(pict,
- JPAEditorConstants.PRIMARY_COLLAPSED));
- boolean isRelationCollapsed = JPAEditorConstants.TRUE_STRING.equals(Graphiti.getPeService().getPropertyValue(pict,
- JPAEditorConstants.RELATION_COLLAPSED));
- boolean isBasicCollapsed = JPAEditorConstants.TRUE_STRING.equals(Graphiti.getPeService().getPropertyValue(pict,
- JPAEditorConstants.BASIC_COLLAPSED));
-
- Element entity = createEntityElementTag(document, rootElement, JPAEditorConstants.ENTITY_XML_TAG, XML_ELEMENT_POSITION);
- Text nameText = document.createTextNode(name);
- Element entityName = document.createElement(JPAEditorConstants.ENTITY_NAME_TAG);
- createChildElementTag(document, nameText, entityName, entity, XML_ELEMENT_POSITION);
-
- Text width = document.createTextNode(String.valueOf(rect.getWidth()));
- Element entityWidth = document.createElement(JPAEditorConstants.ENTITY_WIDTH_TAG);
- createChildElementTag(document, width, entityWidth, entity, XML_ELEMENT_POSITION);
-
- Text height = document.createTextNode(String.valueOf(rect.getHeight()));
- Element entityHeight = document.createElement(JPAEditorConstants.ENTITY_HEIGHT_TAG);
- createChildElementTag(document, height, entityHeight, entity, XML_ELEMENT_POSITION);
-
- Text xCoordinate = document.createTextNode(String.valueOf(rect.getX()));
- Element entityXCoordinate = document.createElement(JPAEditorConstants.ENTITY_X_COORDINATE_TAG);
- createChildElementTag(document, xCoordinate, entityXCoordinate, entity, XML_ELEMENT_POSITION);
-
- Text yCoordinate = document.createTextNode(String.valueOf(rect.getY()));
- Element entityYCoordinate = document.createElement(JPAEditorConstants.ENTITY_Y_COORDINATE_TAG);
- createChildElementTag(document, yCoordinate, entityYCoordinate, entity, XML_ELEMENT_POSITION);
-
- Text primaryCollapsed = document.createTextNode(String.valueOf(isPrimaryCollapsed));
- Element entityPrimaryCollapsed = document.createElement(JPAEditorConstants.ENTITY_PRIMARY_SECTION_STATE_TAG);
- createChildElementTag(document, primaryCollapsed, entityPrimaryCollapsed, entity, XML_ELEMENT_POSITION);
-
- Text relationCollapsed = document.createTextNode(String.valueOf(isRelationCollapsed));
- Element entityRelationCollapsed = document.createElement(JPAEditorConstants.ENTITY_RELATION_SECTION_STATE_TAG);
- createChildElementTag(document, relationCollapsed, entityRelationCollapsed, entity, XML_ELEMENT_POSITION);
-
- Text basicCollapsed = document.createTextNode(String.valueOf(isBasicCollapsed));
- Element entityBasicCollapsed = document.createElement(JPAEditorConstants.ENTITY_BASIC_SECTION_STATE_TAG);
- createChildElementTag(document, basicCollapsed, entityBasicCollapsed, entity, "\n\t"); //$NON-NLS-1$
-
- rootElement.appendChild(document.createTextNode("\n")); //$NON-NLS-1$
-
- }
- ModelIntegrationUtil.setXmiExists(false);
- }
-
- synchronized public void load(Hashtable<String, SizePosition> marks){
- if(rootElement.getChildNodes().getLength()<=1){
- if(ModelIntegrationUtil.xmiExists()){
- store();
- save();
- }
- }
-
- NodeList nodeList = rootElement.getElementsByTagName(JPAEditorConstants.ENTITY_XML_TAG);
- for(int i=0; i<nodeList.getLength();i++){
- Element node = (Element) nodeList.item(i);
- String entityName = node.getElementsByTagName(JPAEditorConstants.ENTITY_NAME_TAG).item(0).getTextContent();
- int width = Integer.parseInt(node.getElementsByTagName(JPAEditorConstants.ENTITY_WIDTH_TAG).item(0).getTextContent());
- int height = Integer.parseInt(node.getElementsByTagName(JPAEditorConstants.ENTITY_HEIGHT_TAG).item(0).getTextContent());
- int xCoordinate = Integer.parseInt(node.getElementsByTagName(JPAEditorConstants.ENTITY_X_COORDINATE_TAG).item(0).getTextContent());
- int yCoordinate = Integer.parseInt(node.getElementsByTagName(JPAEditorConstants.ENTITY_Y_COORDINATE_TAG).item(0).getTextContent());
- boolean isPrimaryCollapsed = Boolean.parseBoolean(node.getElementsByTagName(JPAEditorConstants.ENTITY_PRIMARY_SECTION_STATE_TAG).item(0).getTextContent());
- boolean isRelationCollapsed = Boolean.parseBoolean(node.getElementsByTagName(JPAEditorConstants.ENTITY_RELATION_SECTION_STATE_TAG).item(0).getTextContent());
- boolean isBasicCollapsed = Boolean.parseBoolean(node.getElementsByTagName(JPAEditorConstants.ENTITY_BASIC_SECTION_STATE_TAG).item(0).getTextContent());
-
- SizePosition rectSP = new SizePosition(width, height, xCoordinate, yCoordinate);
- rectSP.primaryCollapsed = isPrimaryCollapsed;
- rectSP.relationCollapsed = isRelationCollapsed;
- rectSP.basicCollapsed = isBasicCollapsed;
-
- marks.put(entityName, rectSP);
- }
-
- }
-
- private Element createEntityElementTag(Document document, Element scheduleElement, String descr, String position) {
- Element job = document.createElement(descr);
- scheduleElement.appendChild(document.createTextNode("\n\t")); //$NON-NLS-1$
- scheduleElement.appendChild(job);
- job.appendChild(document.createTextNode(position));
-
- return job;
- }
-
- private void createChildElementTag(Document document, Text nameText, Element nameEl, Element parentElement, String position) {
- parentElement.appendChild(nameEl);
- nameEl.appendChild(nameText);
- parentElement.appendChild(document.createTextNode(position));
- }
-
- public void save() {
- OutputStream os = null;
- try {
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
- Transformer transformer = transformerFactory.newTransformer();
- os = (OutputStream)findXMLFile(false);
- transformer.transform(new DOMSource(document), new StreamResult(os));
- os.flush();
- } catch (Exception e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.EntitiesCoordinatesXML_CannotCreateDOMFileErrorMSG, e);
- } finally {
- try {
- os.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
-
- synchronized public void close() {
- save();
- clean();
- }
-
- synchronized public void clean() {
- try {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- } catch (CoreException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.EntitiesCoordinatesXML_CannotRefrfreshFile, e);
- }
- document = null;
- rootElement = null;
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java
deleted file mode 100644
index 71e401a6c4..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationship;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveAndSaveEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.swt.widgets.Display;
-
-
-@SuppressWarnings("restriction")
-public class EntityChangeListener extends Thread {
-
- private final static int PAUSE_DURATION = 250;
- private boolean goOn = true;
- private JPASolver solver;
- private IJPAEditorFeatureProvider featureProvider;
- private Set<String> jptsToUpdate = new HashSet<String>();
- private Hashtable<String, PersistenceUnit> attribsToUpdate = new Hashtable<String, PersistenceUnit>();
- public final static String SEPARATOR = ";"; //$NON-NLS-1$
-
- EntityChangeListener(JPASolver solver) {
- this.solver = solver;
- }
-
- public void setFeatureProvider(IJPAEditorFeatureProvider featureProvider) {
- this.featureProvider = featureProvider;
- }
-
- @Override
- public void run() {
- UpdateFromModel taskClass = new UpdateFromModel();
- while (goOn) {
- try {
- Thread.sleep(PAUSE_DURATION);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Thread sleep interruprted", e); //$NON-NLS-1$
- }
- Display.getDefault().asyncExec(taskClass);
- }
- solver = null;
- featureProvider = null;
- }
-
- public void stopThread() {
- goOn = false;
- }
-
- public void addJPTForUpdate(String jptName) {
- synchronized (jptsToUpdate) {
- jptsToUpdate.add(jptName);
- }
- }
-
- public void addAttribForUpdate(PersistenceUnit pu, String entAtMappedBy) {
- synchronized (attribsToUpdate) {
- attribsToUpdate.put(entAtMappedBy, pu);
- }
- }
-
- private class UpdateFromModel implements Runnable {
- public void run() {
- exec();
- }
-
-
- private void exec() {
- try {
- synchronized (jptsToUpdate) {
- Iterator<String> itr = jptsToUpdate.iterator();
- if (itr.hasNext()) {
- String jptName = itr.next();
- JavaPersistentType jpt = (JavaPersistentType)featureProvider.getBusinessObjectForKey(jptName);
- try {
- JpaArtifactFactory.instance().remakeRelations(featureProvider, null, jpt);
- jptsToUpdate.remove(jptName);
- } catch (RuntimeException e) {}
- }
- }
- Collection<Object> vals = solver.getVisualizedObjects();
- Iterator<Object> it = vals.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (o instanceof JavaPersistentType) {
- JavaPersistentType jpt = (JavaPersistentType)o;
- final ContainerShape entShape = (ContainerShape)featureProvider.getPictogramElementForBusinessObject(o);
- if (entShape == null)
- continue;
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpt);
- PersistentType pt = pu.getPersistentType(jpt.getName());
-
- if ((pt == null) || !JpaArtifactFactory.instance().hasEntityAnnotation(jpt)) {
-
- JpaArtifactFactory.instance().forceSaveEntityClass(jpt, featureProvider);
-
- if(jpt.getMapping() == null || (jpt.getMapping() instanceof JavaNullTypeMapping)) {
- if (!JptJpaCorePlugin.discoverAnnotatedClasses(jpt.getJpaProject().getProject())) {
- JPAEditorUtil.createUnregisterEntityFromXMLJob(jpt.getJpaProject(), jpt.getName());
- }
- }
-
- RemoveContext ctx = new RemoveContext(entShape);
- RemoveAndSaveEntityFeature ft = new RemoveAndSaveEntityFeature(featureProvider);
- ft.remove(ctx);
- break;
- } else {
-
- ICompilationUnit cu = featureProvider.getCompilationUnit(jpt);
- String entName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(jpt));
- try {
- final String newHeader = (cu.hasUnsavedChanges() ? "* " : "") + entName; //$NON-NLS-1$ //$NON-NLS-2$
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- GraphicsUpdater.updateHeader(entShape, newHeader);
- }
- });
-
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot check compilation unit for unsaved changes", e); //$NON-NLS-1$
- }
- }
- }
- }
- synchronized (attribsToUpdate) {
- Set<String> atSet = attribsToUpdate.keySet();
- Iterator<String> iter = atSet.iterator();
- while (iter.hasNext()) {
- String jptAtMB = iter.next();
- String[] jptAndAttrib = jptAtMB.split(SEPARATOR);
- PersistenceUnit pu = attribsToUpdate.get(jptAtMB);
- String entityName = jptAndAttrib[0];
- String attribName = jptAndAttrib[1];
- String mappedBy = jptAndAttrib[2];
- JavaPersistentType jpt = (JavaPersistentType)pu.getPersistentType(entityName);
- if (jpt != null) {
- JavaPersistentAttribute jpa = jpt.getAttributeNamed(attribName);
- JpaArtifactFactory.instance().refreshEntityModel(null, jpt);
- if (jpa != null) {
- JavaAttributeMapping mapping = jpa.getMapping();
- Annotation a = mapping.getMappingAnnotation();
- if(a == null){
- JpaArtifactFactory.instance().refreshEntityModel(featureProvider, jpt);
- mapping = jpa.getMapping();
- a = mapping.getMappingAnnotation();
- }
- if (a == null)
- return;
- if (OwnableRelationshipMappingAnnotation.class.isInstance(mapping.getMappingAnnotation())) {
- JavaRelationshipMapping relationshipMapping = (JavaRelationshipMapping)mapping;
- MappedByRelationship ownableRef = (MappedByRelationship)relationshipMapping.getRelationship();
- if (!ownableRef.strategyIsMappedBy()) {
- ownableRef.setStrategyToMappedBy();
- }
- ownableRef.getMappedByStrategy().setMappedByAttribute(mappedBy);
- attribsToUpdate.remove(jptAtMB);
- }
- }
- }
- }
- }
- } catch(Exception e) {
- //$NON-NLS-1$
- }
- }
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdater.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdater.java
deleted file mode 100644
index dbd7c252f4..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdater.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants.ShapeType;
-
-
-public class GraphicsUpdater {
-
- private static final int PRIMARY_SHAPE_INDEX = 3;
- private static final int RELATION_SHAPE_CONSTANT = 4;
- private static final int BASIC_SHAPE_INDEX = 5;
-
- public static int increaseCompartmentHeigth(ContainerShape containerShape,
- int height) {
- for(Shape shape : containerShape.getChildren()){
- Iterator<GraphicsAlgorithm> iterator = shape.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().iterator();
- while(iterator.hasNext()){
- if(iterator.next() instanceof Text)
- height = height + JPAEditorConstants.ATTRIBUTES_PLACEMENT_STEP;
- }
- }
- return height;
- }
-
- public static void updateContainer(ContainerShape containerShape,
- int childrenSizeBefore, int containerHeightBefore){
- int childrenSizeAfter = containerShape.getChildren().size();
- int containerHeightAfter = 0;
- if(childrenSizeBefore == 2){
- containerHeightBefore = JPAEditorConstants.COMPARTMENT_MIN_HEIGHT + JPAEditorConstants.COMPARTMENT_BUTTOM_OFFSET;
- }
- containerHeightAfter = containerHeightBefore + (((childrenSizeAfter - childrenSizeBefore)/2)*JPAEditorConstants.ATTRIBUTES_PLACEMENT_STEP);
-
- if(!isCollapsed(containerShape))
- containerShape.getGraphicsAlgorithm().setHeight(containerHeightAfter);
- else
- containerShape.getGraphicsAlgorithm().setHeight(JPAEditorConstants.COMPARTMENT_MIN_HEIGHT);
- }
-
-
- public static void updateEntityShape(ContainerShape entityShape){
- ContainerShape primaryShape = getPrimaryShape(entityShape);
- ContainerShape relationShape = getRelationShape(entityShape);
- ContainerShape basicShape = getBasicShape(entityShape);
-
- primaryShape.setVisible(!isEmptyCompartment(primaryShape));
- basicShape.setVisible(!isEmptyCompartment(basicShape));
- relationShape.setVisible(!isEmptyCompartment(relationShape));
-
- relationShape.getGraphicsAlgorithm().setY(getNextCompartmentY(primaryShape));
- basicShape.getGraphicsAlgorithm().setY(getNextCompartmentY(relationShape));
- }
-
- private static boolean isEmptyCompartment(ContainerShape primaryShape) {
- return primaryShape.getChildren().size() <= 2;
- }
-
- public static void updateEntityHeigth(ContainerShape entityShape){
- ContainerShape primaryShape = GraphicsUpdater.getPrimaryShape(entityShape);
- ContainerShape relationShape = GraphicsUpdater.getRelationShape(entityShape);
- ContainerShape basicShape = GraphicsUpdater.getBasicShape(entityShape);
-
- entityShape.getGraphicsAlgorithm().setHeight(JPAEditorConstants.ENTITY_MIN_HEIGHT +
- primaryShape.getGraphicsAlgorithm().getHeight() + relationShape.getGraphicsAlgorithm().getHeight()
- + basicShape.getGraphicsAlgorithm().getHeight() + 2);
- }
-
- public static int getNextCompartmentY(ContainerShape compartmentShape){
- if(isEmptyCompartment(compartmentShape))
- return compartmentShape.getGraphicsAlgorithm().getY();
- return compartmentShape.getGraphicsAlgorithm().getY() + compartmentShape.getGraphicsAlgorithm().getHeight();
- }
-
- public static ContainerShape getPrimaryShape(ContainerShape entityShape){
- List<Shape> children = entityShape.getChildren();
- if(children.size() < PRIMARY_SHAPE_INDEX+1)
- return null;
- GraphicsAlgorithm alg = children.get(PRIMARY_SHAPE_INDEX).getGraphicsAlgorithm();
- ContainerShape primaryShape = (ContainerShape)Graphiti.getPeService().getActiveContainerPe(alg);
- return primaryShape;
- }
-
- public static ContainerShape getCompartmentSeparatorShape(ContainerShape compartmentShape){
- GraphicsAlgorithm alg = compartmentShape.getChildren().get(0).getGraphicsAlgorithm();
- ContainerShape primarySeparatorShape = (ContainerShape) Graphiti.getPeService().getActiveContainerPe(alg);
- return primarySeparatorShape;
- }
-
- public static ContainerShape getRelationShape(ContainerShape entityShape){
- List<Shape> children = entityShape.getChildren();
- if(children.size()<RELATION_SHAPE_CONSTANT+1)
- return null;
- GraphicsAlgorithm alg = children.get(RELATION_SHAPE_CONSTANT).getGraphicsAlgorithm();
- ContainerShape relationShape = (ContainerShape) Graphiti.getPeService().getActiveContainerPe(alg);
- return relationShape;
- }
-
- public static ContainerShape getBasicShape(ContainerShape entityShape){
- List<Shape> children = entityShape.getChildren();
- if(children.size() < BASIC_SHAPE_INDEX+1)
- return null;
- GraphicsAlgorithm alg = children.get(BASIC_SHAPE_INDEX).getGraphicsAlgorithm();
- ContainerShape basicShape = (ContainerShape) Graphiti.getPeService().getActiveContainerPe(alg);
- return basicShape;
- }
-
- public static boolean isCollapsed(ContainerShape compartmentShape) {
- ContainerShape container = compartmentShape.getContainer();
- String result = null;
- if(compartmentShape.equals(GraphicsUpdater.getPrimaryShape(container)))
- result = Graphiti.getPeService().getPropertyValue(container, JPAEditorConstants.PRIMARY_COLLAPSED);
- else if(compartmentShape.equals(GraphicsUpdater.getBasicShape(container)))
- result = Graphiti.getPeService().getPropertyValue(container, JPAEditorConstants.BASIC_COLLAPSED);
- else if(compartmentShape.equals(GraphicsUpdater.getRelationShape(container)))
- result = Graphiti.getPeService().getPropertyValue(container, JPAEditorConstants.RELATION_COLLAPSED);
- if(Boolean.toString(true).equals(result))
- return true;
- return false;
- }
-
- /**
- * @param compartmentShape
- * @param collapsed
- * @return true if successful
- */
- public static boolean setCollapsed(ContainerShape compartmentShape, boolean collapsed) {
- ContainerShape container = compartmentShape.getContainer();
- if(compartmentShape.equals(GraphicsUpdater.getPrimaryShape(container))) {
- Graphiti.getPeService().setPropertyValue(container, JPAEditorConstants.PRIMARY_COLLAPSED, Boolean.toString(collapsed));
- return true;
- }
- else if(compartmentShape.equals(GraphicsUpdater.getBasicShape(container))) {
- Graphiti.getPeService().setPropertyValue(container, JPAEditorConstants.BASIC_COLLAPSED, Boolean.toString(collapsed));
- return true;
- }
- else if(compartmentShape.equals(GraphicsUpdater.getRelationShape(container))) {
- Graphiti.getPeService().setPropertyValue(container, JPAEditorConstants.RELATION_COLLAPSED, Boolean.toString(collapsed));
- return true;
- }
- return false;
- }
-
- public static void updateHeader(ContainerShape entityShape, final String newHeader) {
- if(entityShape == null)
- return;
-
- List<Shape> shapes = entityShape.getChildren();
- Iterator<Shape> shIt = shapes.iterator();
- Shape headerShape = null;;
- while (shIt.hasNext()) {
- headerShape = shIt.next();
- String shapeType = Graphiti.getPeService().getPropertyValue(headerShape, JPAEditorConstants.PROP_SHAPE_TYPE);
- if (ShapeType.HEADER.toString().equals(shapeType))
- break;
- headerShape = null;
- }
- if (headerShape == null)
- return;
- GraphicsAlgorithm ga = headerShape.getGraphicsAlgorithm();
- if (ga == null)
- return;
- final Text txt = (Text)ga.getGraphicsAlgorithmChildren().get(0);
- if (!JPAEditorUtil.areHeadersEqual(txt.getValue(), newHeader)) {
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(txt);
- RecordingCommand rc = new RecordingCommand(ted) {
- protected void doExecute() {
- txt.setValue(newHeader);
- }
- };
- ted.getCommandStack().execute(rc);
- }
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdaterImpl.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdaterImpl.java
deleted file mode 100644
index c0788a9f7f..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/GraphicsUpdaterImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public class GraphicsUpdaterImpl implements IGraphicsUpdater {
-
- public void updateEntityHeigth(ContainerShape entityShape) {
- GraphicsUpdater.updateEntityHeigth(entityShape);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IDisplayFacade.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IDisplayFacade.java
deleted file mode 100644
index 0fed6dee9a..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IDisplayFacade.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-public interface IDisplayFacade {
-
- public void asyncExec(Runnable runnable);
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IEclipseFacade.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IEclipseFacade.java
deleted file mode 100644
index 4357166634..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IEclipseFacade.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.core.resources.IWorkspace;
-
-public interface IEclipseFacade {
-
- public IWorkspace getWorkspace();
-
- public IJavaCoreFacade getJavaCore();
-
- public IDisplayFacade getDisplay();
-
- public IStaticIDE getIDE();
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IGraphicsUpdater.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IGraphicsUpdater.java
deleted file mode 100644
index d3b4844e72..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IGraphicsUpdater.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-
-public interface IGraphicsUpdater {
-
- public void updateEntityHeigth(ContainerShape entityShape);
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPADiagramEditorInput.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPADiagramEditorInput.java
deleted file mode 100644
index 73409bbb30..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPADiagramEditorInput.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.ui.IEditorInput;
-
-public interface IJPADiagramEditorInput extends IEditorInput {
-
- public Diagram getDiagram();
-
- public String getProjectName();
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPAEditorUtil.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPAEditorUtil.java
deleted file mode 100644
index 02d2478b46..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJPAEditorUtil.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorImageCreator.RelEndDir;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IWorkbenchSite;
-
-
-public interface IJPAEditorUtil {
-
- public List<Point> createBendPointList(FreeFormConnection c, int cnt, int connectionsNum, boolean selfRelation);
-
- public List<Point> createBendPointList(FreeFormConnection c, boolean selfRelation);
-
- public int calcConnectionLength(FreeFormConnection c);
-
- public RelEndDir getConnectionStartDir(FreeFormConnection c);
-
- public RelEndDir getConnectionEndDir(FreeFormConnection c);
-
- public JavaPersistentType getJPType(ICompilationUnit cu);
-
- public void organizeImports(ICompilationUnit cu, IWorkbenchSite ws);
-
- public ICompilationUnit getCompilationUnit(JavaPersistentType jpt);
-
- public void formatCode(ICompilationUnit cu, IWorkbenchSite ws);
-
- public String generateUniqueEntityName(JpaProject jpaProject,
- String pack,
- IJPAEditorFeatureProvider fp);
-
- public String generateUniqueMappedSuperclassName(JpaProject jpaProject,
- String pack, IJPAEditorFeatureProvider fp);
-
- public IFile createEntityInProject(IProject project,
- String entityName,
- IPreferenceStore jpaPreferenceStore,
- boolean isMappedSuperClassChild,
- String mappedSuperclassName,
- String mappedSuperclassPackage,
- boolean hasPrimaryKey) throws Exception;
-
- public IFile createEntityFromMappedSuperclassInProject(IProject project,
- String mappedSuperclassName, IPreferenceStore jpaPreferenceStore) throws Exception;
-
- public boolean isCardinalityDecorator(ConnectionDecorator cd);
-
- public void discardWorkingCopyOnce(ICompilationUnit cu);
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJavaCoreFacade.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJavaCoreFacade.java
deleted file mode 100644
index 5831693848..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJavaCoreFacade.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-
-public interface IJavaCoreFacade {
-
- public ICompilationUnit createCompilationUnitFrom(IFile file);
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJpaSolver.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJpaSolver.java
deleted file mode 100644
index 918d01e7e9..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IJpaSolver.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.graphiti.features.impl.IIndependenceSolver;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-
-
-public interface IJpaSolver extends IIndependenceSolver {
-
- public abstract void setFeatureProvider(
- IJPAEditorFeatureProvider featureProvider);
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IPeServiceUtil.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IPeServiceUtil.java
deleted file mode 100644
index f45a0c95f7..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IPeServiceUtil.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.PropertyContainer;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-
-public interface IPeServiceUtil {
-
- public FreeFormConnection createFreeFormConnection(Diagram diagram);
-
- public String getPropertyValue(PropertyContainer propertyContainer, String key);
-
- public Property getProperty(PropertyContainer propertyContainer, String key);
-
- public boolean removeProperty(PropertyContainer propertyContainer, String key);
-
- public void setPropertyValue(PropertyContainer propertyContainer, String key, String value);
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IStaticIDE.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IStaticIDE.java
deleted file mode 100644
index 9d4ee0e074..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/IStaticIDE.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.PartInitException;
-
-public interface IStaticIDE {
-
- public void openEditor(IFile file) throws PartInitException;
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPACheckSum.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPACheckSum.java
deleted file mode 100644
index c01c6e508e..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPACheckSum.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-
-public class JPACheckSum {
-
- private static JPACheckSum instance = null;
- private static MessageDigest md5 = null;
-
- public static synchronized JPACheckSum INSTANCE() {
- if (instance == null) {
- try {
- md5 = MessageDigest.getInstance("MD5"); //$NON-NLS-1$
- } catch (NoSuchAlgorithmException e) {
- JPADiagramEditorPlugin.logError("Couldn't create instance of MD5", e); //$NON-NLS-1$
- return null;
- }
- instance = new JPACheckSum();
- }
- return instance;
- }
-
- public String getSavedShapeMD5(Shape sh) {
- String checkSumString = Graphiti.getPeService().getPropertyValue(sh, JPAEditorConstants.PROP_ENTITY_CHECKSUM);
- if (checkSumString == null)
- return ""; //$NON-NLS-1$
- return checkSumString;
- }
-
- public void assignEntityShapesMD5Strings(Diagram d, JpaProject jpaProject) {
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- List<Shape> picts = d.getChildren();
- if (picts.size() == 0)
- return;
- Iterator<Shape> it = picts.iterator();
- while (it.hasNext()) {
- Shape pict = it.next();
- String name = Graphiti.getPeService().getPropertyValue(pict, JPAEditorConstants.PROP_ENTITY_CLASS_NAME);
- JavaPersistentType jpt = JpaArtifactFactory.instance().getJPT(name, pu);
- String hash = ""; //$NON-NLS-1$
- if (jpt != null) {
- ICompilationUnit cu = JPAEditorUtil.getCompilationUnit(jpt);
- hash = generateCompilationUnitMD5String(cu);
- }
- Graphiti.getPeService().setPropertyValue(pict, JPAEditorConstants.PROP_ENTITY_CHECKSUM, hash);
- }
- }
-
-
- public String generateCompilationUnitMD5String(ICompilationUnit cu) {
- String src = null;
- try {
- src = cu.getSource();
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Can't get the source of the compilation unit", e); //$NON-NLS-1$
- return null;
- }
- byte[] res = md5.digest(src.getBytes());
- StringBuilder sb = new StringBuilder();
- for (byte b : res)
- sb.append(Byte.toString(b));
- return sb.toString();
- }
-
- public boolean isEntityModelChanged(Shape sh, JpaProject jpaProject) {
- if (sh == null)
- return true;
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- String name = Graphiti.getPeService().getPropertyValue(sh, JPAEditorConstants.PROP_ENTITY_CLASS_NAME);
- JavaPersistentType jpt = JpaArtifactFactory.instance().getJPT(name, pu);
- String savedMD5 = getSavedShapeMD5(sh);
- String actualMD5 = ""; //$NON-NLS-1$
- if (jpt != null) {
- ICompilationUnit cu = JPAEditorUtil.getCompilationUnit(jpt);
- actualMD5 = generateCompilationUnitMD5String(cu);
- }
- return !savedMD5.equals(actualMD5);
- }
-
- public boolean isModelDifferentFromDiagram(Diagram d, JpaProject jpaProject) {
- List<Shape> picts = d.getChildren();
- if (picts.size() == 0)
- return false;
- Iterator<Shape> it = picts.iterator();
- while (it.hasNext()) {
- Shape pict = it.next();
- if (isEntityModelChanged(pict, jpaProject))
- return true;
- }
- return false;
- }
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorConstants.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorConstants.java
deleted file mode 100644
index 52e14edfd1..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorConstants.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Set;
-
-import org.eclipse.graphiti.util.ColorConstant;
-import org.eclipse.graphiti.util.IColorConstant;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-
-public class JPAEditorConstants {
-
- public static final String HEADER_PREFIX_DIRTY = "* "; //$NON-NLS-1$
-
- public static Hashtable<String, String> PRIMITIVE_TO_WRAPPER = new Hashtable<String,String>();
-
- public static HashSet<String> WRAPPER_SIMPLE_NAMES = new HashSet<String>();
-
- public static Hashtable<String, String> ANNOTATION_NAME_TO_KEY = new Hashtable<String, String>();
- public static Set<String> CARDINALITY_LABELS = new HashSet<String>();
-
- public final static String COLLAPSE_FEATURES = "collapseFeatures"; //$NON-NLS-1$
-
- public static final IColorConstant ENTITY_TEXT_FOREGROUND =
- new ColorConstant(0, 0, 51);
-
- public static final IColorConstant ENTITY_BACKGROUND =
- new ColorConstant(212, 231, 248);
-
- public static final IColorConstant CONNECTION_LINE_COLOR =
- new ColorConstant(98, 131,167);
-
- public static final IColorConstant ENTITY_BORDER_COLOR =
- new ColorConstant(98, 131,167);
-
- public final static String TRUE_STRING = Boolean.toString(true);
-
- public final static int CONNECTION_LINE_WIDTH = 2;
- public final static int ENTITY_BORDER_WIDTH = 2;
-
- public final static int ENTITY_CORNER_WIDTH = 6;
- public final static int ENTITY_CORNER_HEIGHT = 6;
-
- public static final int ENTITY_MIN_HEIGHT = 30;
- public static final int ENTITY_MIN_WIDTH = 50;
-
- public final static int ENTITY_WIDTH = 120;
- public final static int ENTITY_HEIGHT = 70;
-
- public final static int ATTRIBUTE_RECT_HEIGHT = 30;
- public final static int ATTRIBUTES_TOP_OFFSET = 15;
- public final static int ATTRIBUTES_PLACEMENT_STEP = 20;
- public final static int ATTRIBUTE_TEXT_RECT_X = 21;
- public final static int ATTRIBUTE_TEXT_RECT_WIDTH_REDUCER = 21;
-
- public final static int ICON_RECT_LEFT_OFFSET = 0;
-
- public final static int ICON_HEADER_X = 7;
- public final static int ICON_HEADER_Y = 7;
- public final static int HEADER_ICON_RECT_WIDTH = 24;
- public final static int HEADER_ICON_RECT_HEIGHT = 24;
- public final static int HEADER_TEXT_RECT_HEIGHT = 21;
- public final static int HEADER_TEXT_RECT_X = 25;
- public final static int HEADER_TEXT_RECT_WIDTH_REDUCER = 25;
-
- public final static int ICON_X = 4;
- public final static int ICON_Y = 4;
- public final static int ICON_WIDTH = 16;
- public final static int ICON_HEIGHT = 16;
- public final static int ICON_RECT_WIDTH = 20;
- public final static int ICON_RECT_HEIGHT = 20;
-
- public final static int SEPARATOR_HEIGHT = 2;
- public final static int COMPARTMENT_MIN_HEIGHT = 13;
- public final static int COMPARTMENT_BUTTOM_OFFSET = 5;
-
- public final static String ANNOTATION_BASIC = "Basic"; //$NON-NLS-1$
- public final static String ANNOTATION_ID = "Id"; //$NON-NLS-1$
- public final static String ANNOTATION_ONE_TO_ONE = "OneToOne"; //$NON-NLS-1$
- public final static String ANNOTATION_ONE_TO_MANY = "OneToMany"; //$NON-NLS-1$
- public final static String ANNOTATION_MANY_TO_ONE = "ManyToOne"; //$NON-NLS-1$
- public final static String ANNOTATION_MANY_TO_MANY = "ManyToMany"; //$NON-NLS-1$
- public final static String ANNOTATION_VERSION = "Version"; //$NON-NLS-1$
- public final static String ANNOTATION_EMBEDDED = "Embedded"; //$NON-NLS-1$
- public final static String ANNOTATION_EMBEDDED_ID = "EmbeddedId"; //$NON-NLS-1$
- public final static String ANNOTATION_TRANSIENT = "Transient"; //$NON-NLS-1$
-
- public static final int RELATION_TYPE_UNIDIRECTIONAL = 1;
- public static final int RELATION_TYPE_BIDIRECTIONAL = 2;
-
- public static HashSet<String> RELATION_ANNOTATIONS = new HashSet<String>();
-
- public static String PROP_ENTITY_CLASS_NAME = "prop_entity_class_name"; //$NON-NLS-1$
- public static String PROP_SHAPE_TYPE = "prop_shape_type"; //$NON-NLS-1$
- public static String PROP_ATTRIBS_NUM = "prop_attribs_num"; //$NON-NLS-1$
- public static String PROP_SPECIFIED_NAME = "specifiedName"; //$NON-NLS-1$
-
- public static enum DecoratorType {
- CARDINALITY,
- ASSOCIATION
- }
-
- //public static String PROP_CON_DIR_START = "prop_con_dir_start"; //$NON-NLS-1$
- //public static String PROP_CON_DIR_END = "prop_con_dir_end"; //$NON-NLS-1$
-
- public static String ID_VIEW_JPA_DETAILS = "org.eclipse.jpt.ui.jpaDetailsView"; //$NON-NLS-1$
- public static String ID_VIEW_MINIATURE = "org.eclipse.graphiti.ui.internal.editor.thumbnailview"; //$NON-NLS-1$
-
- public static String CARDINALITY_ZERO_ONE = "0..1"; //$NON-NLS-1$
- public static String CARDINALITY_ONE = "1"; //$NON-NLS-1$
- public static String CARDINALITY_ZERO_N = "0..N"; //$NON-NLS-1$
-
- public static enum ShapeType {ICON, HEADER, ATTRIBUTE, COMPARTMENT};
-
- static {
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_BASIC, MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_ID, MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_ONE_TO_ONE, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_ONE_TO_MANY, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_MANY_TO_ONE, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_MANY_TO_MANY, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_VERSION, MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_EMBEDDED, MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_EMBEDDED_ID, MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- ANNOTATION_NAME_TO_KEY.put(ANNOTATION_TRANSIENT, MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- RELATION_ANNOTATIONS.add(JPAEditorConstants.ANNOTATION_ONE_TO_ONE);
- RELATION_ANNOTATIONS.add(JPAEditorConstants.ANNOTATION_ONE_TO_MANY);
- RELATION_ANNOTATIONS.add(JPAEditorConstants.ANNOTATION_MANY_TO_ONE);
- RELATION_ANNOTATIONS.add(JPAEditorConstants.ANNOTATION_MANY_TO_MANY);
-
- CARDINALITY_LABELS.add(CARDINALITY_ZERO_ONE);
- CARDINALITY_LABELS.add(CARDINALITY_ONE);
- CARDINALITY_LABELS.add(CARDINALITY_ZERO_N);
-
- PRIMITIVE_TO_WRAPPER.put("int", Integer.class.getName()); //$NON-NLS-1$
- PRIMITIVE_TO_WRAPPER.put("long", Long.class.getName()); //$NON-NLS-1$
- PRIMITIVE_TO_WRAPPER.put("double", Double.class.getName()); //$NON-NLS-1$
- PRIMITIVE_TO_WRAPPER.put("float", Float.class.getName() ); //$NON-NLS-1$
- PRIMITIVE_TO_WRAPPER.put("boolean", Boolean.class.getName()); //$NON-NLS-1$
- PRIMITIVE_TO_WRAPPER.put("char", Character.class.getName()); //$NON-NLS-1$
- PRIMITIVE_TO_WRAPPER.put("byte", Byte.class.getName()); //$NON-NLS-1$
- PRIMITIVE_TO_WRAPPER.put("short", Short.class.getName()); //$NON-NLS-1$
-
- WRAPPER_SIMPLE_NAMES.add("Integer"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("Long"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("Double"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("Float"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("Boolean"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("Character"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("Byte"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("Short"); //$NON-NLS-1$
- WRAPPER_SIMPLE_NAMES.add("String"); //$NON-NLS-1$
- }
-
- public final static String[] PRIMITIVE_TYPES_AND_WRAPPERS = {"int", //$NON-NLS-1$
- "Integer", //$NON-NLS-1$
- "long", //$NON-NLS-1$
- "Long", //$NON-NLS-1$
- "short", //$NON-NLS-1$
- "Short", //$NON-NLS-1$
- "char", //$NON-NLS-1$
- "Character", //$NON-NLS-1$
- "boolean", //$NON-NLS-1$
- "Boolean", //$NON-NLS-1$
- "byte", //$NON-NLS-1$
- "Byte", //$NON-NLS-1$
- "double", //$NON-NLS-1$
- "Double", //$NON-NLS-1$
- "float", //$NON-NLS-1$
- "Float", //$NON-NLS-1$
- "String"}; //$NON-NLS-1$
-
- public final static HashSet<String> PRIMITIVE_TYPES_AND_WRAPPERS_SET = new HashSet<String>();
-
- static {
- for (String type : PRIMITIVE_TYPES_AND_WRAPPERS)
- PRIMITIVE_TYPES_AND_WRAPPERS_SET.add(type);
- }
-
- public static final String OPEN_WHOLE_PERSISTENCE_UNIT_EDITOR_PROPERTY = "JPADiagramEditor_openWholePersistenceUnit"; //$NON-NLS-1$
-
- public static final String PRIMARY_COLLAPSED = "primary collapsed"; //$NON-NLS-1$
-
- public static final String BASIC_COLLAPSED = "basic collapsed";//$NON-NLS-1$
-
- public static final String RELATION_COLLAPSED = "relation collapsed";//$NON-NLS-1$
-
- public static final String PROP_ENTITY_CHECKSUM = "diagram.checksum"; //$NON-NLS-1$
-
- public static final String JPA_SUPPORT_DIALOG_ID = "jpa_support_warning"; //$NON-NLS-1$
-
- public static final String ENTITY_XML_TAG = "entity"; //$NON-NLS-1$
-
- public static final String ENTITY_NAME_TAG = "entity-name"; //$NON-NLS-1$
-
- public static final String ENTITY_WIDTH_TAG = "entity-width"; //$NON-NLS-1$
-
- public static final String ENTITY_HEIGHT_TAG = "entity-height"; //$NON-NLS-1$
-
- public static final String ENTITY_X_COORDINATE_TAG = "entity-X-Coordinate"; //$NON-NLS-1$
-
- public static final String ENTITY_Y_COORDINATE_TAG = "entity-Y-Coordinate"; //$NON-NLS-1$
-
- public static final String ENTITY_PRIMARY_SECTION_STATE_TAG = "primary-collapsed"; //$NON-NLS-1$
-
- public static final String ENTITY_RELATION_SECTION_STATE_TAG = "relation-collapsed"; //$NON-NLS-1$
-
- public static final String ENTITY_BASIC_SECTION_STATE_TAG = "basic-collapsed"; //$NON-NLS-1$
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java
deleted file mode 100644
index fac5383172..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java
+++ /dev/null
@@ -1,1486 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IImportDeclaration;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.internal.core.search.JavaSearchScope;
-import org.eclipse.jdt.ui.actions.FormatAllAction;
-import org.eclipse.jdt.ui.actions.OrganizeImportsAction;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.facade.EclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorImageCreator.RelEndDir;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants.ShapeType;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-
-@SuppressWarnings("restriction")
-public class JPAEditorUtil {
-
-
- private static IPeServiceUtil peUtil = null;
- private final static String PERSISTENCE_PROVIDER_LIBRARY_STRING = "javax/persistence/"; //$NON-NLS-1$
-
- public static String capitalizeFirstLetter(String s) {
- if (s.length() == 0) return s;
- String res = s.substring(0, 1).toUpperCase(Locale.ENGLISH) + s.substring(1);
- return res;
- }
-
- public static String decapitalizeFirstLetter(String s) {
- if (s.length() == 0) return s;
- String res = s.substring(0, 1).toLowerCase(Locale.ENGLISH) + s.substring(1);
- return res;
- }
-
- public static String revertFirstLetterCase(String s) {
- if ((s == null) || (s.length() == 0))
- return s;
- return (Character.isLowerCase(s.charAt(0)) ?
- s.substring(0, 1).toUpperCase(Locale.ENGLISH) :
- s.substring(0, 1).toLowerCase(Locale.ENGLISH)) +
- s.substring(1);
- }
-
- synchronized public static IPeServiceUtil getPeUtil() {
- if (peUtil == null)
- peUtil = new PeServiceUtilImpl();
- return peUtil;
- }
-
- public static boolean equalsIgnoreFirstLetterCase(String s1, String s2) {
- if ((s1 == null) && (s2 == null))
- return true;
- if ((s1 == null) || (s2 == null))
- return false;
- if (s1.length() != s2.length())
- return false;
- if (s1.length() == 0)
- return true;
- return s1.substring(0, 1).equalsIgnoreCase(s2.substring(0, 1)) &&
- s1.substring(1).equals(s2.substring(1));
- }
-
- public static Anchor getAnchor(ContainerShape cs) {
- Collection<Anchor> anchors = cs.getAnchors();
- return anchors.iterator().next();
- }
-
- public static Anchor getAnchor(JavaPersistentType jpt, IFeatureProvider fp) {
- PictogramElement pe = fp.getPictogramElementForBusinessObject(jpt);
- if ((pe == null) || (!(pe instanceof ContainerShape)))
- return null;
- return getAnchor((ContainerShape)pe);
- }
-
- public static String getText(JavaPersistentAttribute at) {
- return at.getName();
- }
-
- public static String returnSimpleName(String s) {
- return s.substring(s.lastIndexOf('.') + 1);
- }
-
- public static String stripQuotes(String s) {
- if ((s.startsWith("\"")) && (s.endsWith("\""))) //$NON-NLS-1$ //$NON-NLS-2$
- return s.substring(1, s.length() - 1);
- return s;
- }
-
- public static String getTooltipText(JavaPersistentType jpt,
- String superPersistentTypeName) {
- String res = jpt.getName();
- if (superPersistentTypeName != null) {
- return MessageFormat.format(JPAEditorMessages.JPAEditorUtil_inheritTypeTooltipText,
- new Object[] { res, superPersistentTypeName });
- }
- return MessageFormat.format(JPAEditorMessages.JPAEditorUtil_fullnameTooltipText,
- new Object[] { res });
- }
-
-
- public static String getAttributeTypeName(JavaPersistentAttribute at) {
- return getAttributeTypeName(at.getResourceAttribute());
- }
-
- public static String getAttributeTypeName(JavaResourceAttribute at) {
- return at.getTypeName();
- }
-
- public static List<String> getAttributeTypeTypeNames(JavaResourceAttribute at) {
- ListIterator<String> tt = at.getTypeTypeArgumentNames().iterator();
- if ((tt == null) || !tt.hasNext())
- return null;
- LinkedList<String> res = new LinkedList<String>();
- while (tt.hasNext())
- res.add(tt.next());
- return res;
- }
-
- public static String getAttributeTypeNameWithGenerics(JavaPersistentAttribute at) {
- return getAttributeTypeNameWithGenerics(at.getResourceAttribute());
- }
-
-
- public static String getAttributeTypeNameWithGenerics(JavaResourceAttribute at) {
- StringBuilder res = new StringBuilder(getAttributeTypeName(at));
- ListIterator<String> it = at.getTypeTypeArgumentNames().iterator();
- if ((it != null) && it.hasNext()) {
- res.append('<');
- res.append(createCommaSeparatedListOfFullTypeNames(it));
- res.append('>');
- }
- return res.toString();
- }
-
-
- public static String[] getGenericsElementTypes(String typeName) {
- if (typeName.indexOf("<") == -1) //$NON-NLS-1$
- return null;
- String types = typeName.substring(typeName.indexOf("<") + 1, typeName.lastIndexOf(">")); //$NON-NLS-1$ //$NON-NLS-2$
- String[] typeNames = types.split(","); //$NON-NLS-1$
- for (int i = 0; i < typeNames.length; i++) {
- typeNames[i] = typeNames[i].trim();
- }
- return typeNames;
- }
-
- public static String createCommaSeparatedListOfSimpleTypeNames(String[] strings) {
- if ((strings == null) || (strings.length == 0))
- return null;
- StringBuilder res = new StringBuilder(JPAEditorUtil.returnSimpleName(strings[0]));
- for (int i = 1; i < strings.length; i++) {
- res.append(", "); //$NON-NLS-1$
- res.append(JPAEditorUtil.returnSimpleName(strings[i]));
- }
- return res.toString();
- }
-
- public static String createCommaSeparatedListOfSimpleTypeNames(ListIterator<String> strIt) {
- if ((strIt == null) || !strIt.hasNext())
- return null;
- StringBuilder res = new StringBuilder(JPAEditorUtil.returnSimpleName(strIt.next()));
- while (strIt.hasNext()) {
- res.append(", "); //$NON-NLS-1$
- res.append(JPAEditorUtil.returnSimpleName(strIt.next()));
- }
- return res.toString();
- }
-
- public static String createCommaSeparatedListOfFullTypeNames(ListIterator<String> strIt) {
- if ((strIt == null) || !strIt.hasNext())
- return null;
- StringBuilder res = new StringBuilder(strIt.next());
- while (strIt.hasNext()) {
- res.append(", "); //$NON-NLS-1$
- res.append(strIt.next());
- }
- return res.toString();
- }
-
-
- public static String getText(JavaPersistentType jpt) {
- return JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(jpt));
- }
-
- public static String getTooltipText(JavaPersistentType jpt) {
- String res = jpt.getName();
- return MessageFormat.format(JPAEditorMessages.JPAEditorUtil_fullnameTooltipText, new Object[] { res });
- }
-
- public static JavaPersistentType getJPType(ICompilationUnit cu) {
- String name = cu.getElementName();
- if (!name.endsWith(".java")) //$NON-NLS-1$
- return null;
- IType tp = cu.findPrimaryType();
- if (tp == null)
- return null;;
- name = tp.getFullyQualifiedName();
- IJavaProject jp = cu.getJavaProject();
- JpaProject proj = null;
- try {
- proj = JpaArtifactFactory.instance().getJpaProject(jp.getProject());
- } catch (CoreException e) {
- JPADiagramEditorPlugin.logError("Cannot obtain the JPA project.", e); //$NON-NLS-1$
- }
- if (proj == null)
- return null;
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(proj);
- PersistentType pt = pu.getPersistentType(name);
- if ((pt == null) || (!(pt instanceof JavaPersistentType)))
- return null;
- return (JavaPersistentType)pt;
- }
-
- public static String getNameFromShape(Shape sh) {
- ContainerShape csh = (ContainerShape)sh;
- List<Shape> shapes = csh.getChildren();
- Iterator<Shape> it = shapes.iterator();
- while (it.hasNext()) {
- Shape shape = it.next();
- GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
- if (ga instanceof Rectangle) {
- Rectangle rect = (Rectangle)ga;
- if (rect.getY() == 0) {
- List<GraphicsAlgorithm> gas = rect.getGraphicsAlgorithmChildren();
- if (gas.size() > 0) {
- GraphicsAlgorithm gra = gas.get(0);
- if (gra instanceof Text)
- return ((Text)gra).getValue();
- }
- }
- }
- }
- return null;
- }
-
- public static void setNameOfShape(Shape sh, String name) {
- ContainerShape csh = (ContainerShape)sh;
- List<Shape> shapes = csh.getChildren();
- Iterator<Shape> it = shapes.iterator();
- while (it.hasNext()) {
- Shape shape = it.next();
- GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
- if (ga instanceof Rectangle) {
- Rectangle rect = (Rectangle)ga;
- if (rect.getY() == 0) {
- List<GraphicsAlgorithm> gas = rect.getGraphicsAlgorithmChildren();
- if (gas.size() > 0) {
- GraphicsAlgorithm gra = gas.get(0);
- if (gra instanceof Text) {
- ((Text)gra).setValue(name);
- return;
- }
- }
- }
- }
- };
- }
-
- public static void setJPTNameInShape(ContainerShape cs, String newName) {
- setJPTNameInShape(cs, newName, getPeUtil());
- }
-
- public static void setJPTNameInShape(ContainerShape cs, String newName, IPeServiceUtil peUtil) {
- List<Shape> shapes = cs.getChildren();
- Iterator<Shape> it = shapes.iterator();
- while (it.hasNext()) {
- Shape sh = it.next();
- String propShapeType = peUtil.getPropertyValue(sh, JPAEditorConstants.PROP_SHAPE_TYPE);
- if (!ShapeType.HEADER.toString().equals(propShapeType))
- continue;
- Text txt = (Text)sh.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0);
- txt.setValue(newName);
- return;
- }
- }
-
-
- public static String produceValidAttributeName(String name) {
- if ((name == null) || (name.length() == 0))
- return ""; //$NON-NLS-1$
- if (name.length() == 1)
- return name.toLowerCase(Locale.ENGLISH);
- String secondSymbol = name.substring(1, 2);
- if (secondSymbol.toLowerCase(Locale.ENGLISH).equals(secondSymbol.toUpperCase(Locale.ENGLISH)))
- return decapitalizeFirstLetter(name);
- return (isUpperCase(secondSymbol)) ?
- capitalizeFirstLetter(name) :
- decapitalizeFirstLetter(name);
- }
-
- public static boolean isUpperCase(String s) {
- if ((s == null) || (s.length() == 0) || (s.length() > 1))
- throw new IllegalArgumentException("The given string has to contain one symbol exactly"); //$NON-NLS-1$
- return s.toUpperCase(Locale.ENGLISH).equals(s);
- }
-
-
- public static void createRegisterEntityInXMLJob(final JpaProject jpaProject, final String classFQN) {
- final JpaXmlResource resource = jpaProject.getPersistenceXmlResource();
- resource.modify(new Runnable() {
- public void run() {
- XmlPersistence xmlPersistence = (XmlPersistence) resource.getRootObject();
- EList<XmlPersistenceUnit> persistenceUnits = xmlPersistence.getPersistenceUnits();
- XmlPersistenceUnit persistenceUnit = persistenceUnits.get(0); // Multiply persistence unit support
- boolean registered = false;
- Iterator<XmlJavaClassRef> it = persistenceUnit.getClasses().iterator();
- while (it.hasNext()) {
- String className = it.next().getJavaClass();
- if (classFQN.equals(className)) {
- registered = true;
- break;
- }
- }
- if (!registered) {
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(classFQN);
- persistenceUnit.getClasses().add(classRef);
- }
- }
- });
- }
-
- public static void createUnregisterEntityFromXMLJob(final JpaProject jpaProject, final String classFQN) {
- final JpaXmlResource resource = jpaProject.getPersistenceXmlResource();
-
- resource.modify(new Runnable() {
- public void run() {
- XmlPersistence xmlPersistence = (XmlPersistence) resource.getRootObject();
- EList<XmlPersistenceUnit> persistenceUnits = xmlPersistence.getPersistenceUnits();
- XmlPersistenceUnit persistenceUnit = persistenceUnits.get(0);// Multiply persistence unit support
- EList<XmlJavaClassRef> cRefs = persistenceUnit.getClasses();
- for (XmlJavaClassRef cRef : cRefs)
- if (cRef.getJavaClass().equals(classFQN)) {
- cRefs.remove(cRef);
- break;
- }
- }
- });
- }
-
- public static void createImports(ICompilationUnit cu, String typeFQN) {
- if (typeFQN == null)
- return;
- typeFQN = typeFQN.trim();
- String[] typeFQNs = getAllTypes(typeFQN);
- createImports(cu, typeFQNs);
- }
-
- public static String[] getAllTypes(String typeFQN){
- typeFQN = typeFQN.replace('[', ',');
- typeFQN = typeFQN.replace(']', ',');
- typeFQN = typeFQN.replace('<', ',');
- typeFQN = typeFQN.replace('>', ',');
- String[] res = typeFQN.trim().split(","); //$NON-NLS-1$
- for (int i = 0; i < res.length; i++)
- res[i] = res[i].trim();
- return res;
- }
-
- public static void createImports(ICompilationUnit cu, String[] typeFQNs) {
- NullProgressMonitor npm = new NullProgressMonitor();
- for (String typeFQN : typeFQNs) {
- if (typeFQN.startsWith("java.lang.") || !typeFQN.contains(".")) //$NON-NLS-1$ //$NON-NLS-2$
- continue;
- try {
- cu.createImport(typeFQN, null, npm);
- } catch (JavaModelException e) {}
- }
- }
-
- public static String createImport(ICompilationUnit cu, String typeFQN) {
- if (typeFQN.startsWith("java.lang.") || !typeFQN.contains(".")) //$NON-NLS-1$ //$NON-NLS-2$
- return returnSimpleName(typeFQN);
-
- NullProgressMonitor npm = new NullProgressMonitor();
- String simpleName = returnSimpleName(typeFQN);
- IImportDeclaration[] ids = new IImportDeclaration[0];
- try {
- ids = cu.getImports();
- } catch (JavaModelException e) {}
- for (IImportDeclaration id : ids) {
- String impName = id.getElementName();
- if (impName.endsWith("*")) //$NON-NLS-1$
- continue;
- if (impName.endsWith("." + simpleName)) //$NON-NLS-1$
- return typeFQN;
- if (JPAEditorConstants.WRAPPER_SIMPLE_NAMES.contains(simpleName))
- return typeFQN;
- }
- try {
- cu.createImport(typeFQN, null, npm);
- return returnSimpleName(typeFQN);
- } catch (JavaModelException e) {}
- return typeFQN;
- }
-
- public static Image createAttributeIcon(Rectangle iconRect, Set<String> annotations) {
- Image icon = null;
- if ((annotations == null) || (annotations.size() == 0) || annotations.contains(JPAEditorConstants.ANNOTATION_BASIC)) {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_BASIC);
- } else if (annotations.contains(JPAEditorConstants.ANNOTATION_ID)) {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.PRIMARY_KEY);
- } else if (annotations.contains(JPAEditorConstants.ANNOTATION_ONE_TO_ONE)) {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_ONE_TO_ONE);
- } else if (annotations.contains(JPAEditorConstants.ANNOTATION_ONE_TO_MANY)) {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_ONE_TO_MANY);
- } else if (annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_MANY_TO_ONE);
- } else if (annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)) {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_MANY_TO_MANY);
- } else if(annotations.contains(JPAEditorConstants.ANNOTATION_EMBEDDED_ID)){
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_EMBEDDED_ID);
- } else if(annotations.contains(JPAEditorConstants.ANNOTATION_VERSION)){
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_VERSION);
- } else if(annotations.contains(JPAEditorConstants.ANNOTATION_TRANSIENT)){
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_TRANSIENT);
- } else if(annotations.contains(JPAEditorConstants.ANNOTATION_EMBEDDED)){
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_EMBEDDED);
- } else {
- icon = Graphiti.getGaService().createImage(iconRect, JPAEditorImageProvider.ICON_BASIC);
- }
- return icon;
- }
-
- public static Shape getIconShape(Shape attributeShape) {
- int y = attributeShape.getGraphicsAlgorithm().getY();
- ContainerShape cs = attributeShape.getContainer();
- Iterator<Shape> it = cs.getChildren().iterator();
- while (it.hasNext()) {
- Shape shp = it.next();
- GraphicsAlgorithm ga = shp.getGraphicsAlgorithm();
- if ((ga != null) && (ga.getY() == y) &&
- (ShapeType.ICON.toString().
- equals(Graphiti.getPeService().getPropertyValue(shp,
- JPAEditorConstants.PROP_SHAPE_TYPE))))
- return shp;
- }
- return null;
- }
-
- public static Collection<ContainerShape> getRelatedShapes(ContainerShape cs) {
- Collection<ContainerShape> res = new HashSet<ContainerShape>();
- Collection<Connection> cons = new HashSet<Connection>();
- Iterator<Anchor> ansIt = cs.getAnchors().iterator();
- while (ansIt.hasNext()) {
- Anchor an = ansIt.next();
- cons.addAll(an.getIncomingConnections());
- cons.addAll(an.getOutgoingConnections());
- }
- Iterator<Connection> consIt = cons.iterator();
- while (consIt.hasNext()) {
- Connection con = consIt.next();
- ContainerShape cs1 = (ContainerShape)con.getStart().getParent();
- if (cs1 != cs)
- res.add(cs1);
- cs1 = (ContainerShape)con.getEnd().getParent();
- if (cs1 != cs)
- res.add(cs1);
- }
- return res;
- }
-
- public static int calcConnectionLength(FreeFormConnection c) {
- List<org.eclipse.graphiti.mm.algorithms.styles.Point> pts = c.getBendpoints();
- int len = 0;
- for (int i = 0; i < pts.size() - 1; i++) {
- len = len + ((pts.get(i).getX() == pts.get(i + 1).getX()) ?
- Math.abs(pts.get(i).getY() - pts.get(i + 1).getY()) :
- Math.abs(pts.get(i).getX() - pts.get(i + 1).getX()));
- }
- return len;
- }
-
- public static List<Point> createBendPointList(FreeFormConnection c, boolean selfRelation) {
- int cnt = getNumberOfConnectionsWithSameEndsAs(c);
- return createBendPointList(c, cnt - 1, cnt, selfRelation);
- }
-
- public static List<Point> createBendPointList(FreeFormConnection c, int cnt, int connectionsNum, boolean selfRelation) {
- return selfRelation ?
- createBendPointListForSelfRelation(c, cnt, connectionsNum) :
- createBendPointListForNonSelfRelation(c, cnt, connectionsNum);
- }
-
- private static List<Point> createBendPointListForSelfRelation(FreeFormConnection c, int cnt, int connectionsNum) {
- final int ABS_SHIFT = 15;
-
- int emptiestQuadrant = getEmptiestQuadrant(c);
- boolean evenQuadrant = (emptiestQuadrant == 2) || (emptiestQuadrant == 4);
-
- RoundedRectangle rect = (RoundedRectangle)c.getStart().getParent().getGraphicsAlgorithm();
-
- float halfWidth = rect.getWidth() / 2.0f;
- float halfHeight = rect.getHeight() / 2.0f;
-
- int centerX = Math.round(halfWidth + rect.getX());
- int centerY = Math.round(halfHeight + rect.getY());
-
- boolean startHorizontal = false;
- boolean endHorizontal = !startHorizontal;
-
-
- int startDirection = ((emptiestQuadrant == 2) || (emptiestQuadrant == 3)) ? 1 : -1; // 1 or -1; 1 for RIGHT/DOWN; -1 for LEFT/UP
- int endDirection = ((emptiestQuadrant == 1) || (emptiestQuadrant == 2)) ? 1 : -1;
-
- int x;
- int y;
-
-
- if (endHorizontal) {
- x = centerX + Math.round(halfWidth * endDirection);
- y = centerY;
- } else {
- x = centerX;
- y = centerY + Math.round(halfHeight * endDirection);
- }
- int SHIFT = evenQuadrant ? -ABS_SHIFT * endDirection : ABS_SHIFT * endDirection;
- Point endPoint = new Point(x + (endHorizontal ? 0 : (cnt * SHIFT)), y + (endHorizontal ? (cnt * SHIFT) : 0));
-
-
- if (startHorizontal) {
- x = centerX + Math.round(halfWidth * startDirection);
- y = centerY;
- } else {
- x = centerX;
- y = centerY + Math.round(halfHeight * startDirection);
- }
- SHIFT = evenQuadrant ? -ABS_SHIFT * startDirection : ABS_SHIFT * startDirection;
- Point startPoint = new Point(x + (startHorizontal ? 0 : (cnt * SHIFT)), y + (startHorizontal ? (cnt * SHIFT) : 0));
-
- // second point
- List<Point> res = new LinkedList<Point>();
- res.add(startPoint);
- if (startHorizontal) {
- x = startPoint.x + startDirection * 50 + ((evenQuadrant ? - cnt : cnt) * SHIFT);
- y = startPoint.y;
- } else {
- x = startPoint.x;
- y = startPoint.y + startDirection * 50 + ((evenQuadrant ? - cnt : cnt) * SHIFT);
- }
- res.add(new Point(x, y));
-
- // middle point
- SHIFT = ABS_SHIFT * endDirection;
- if (startHorizontal) {
- y = y + Math.round(halfHeight + 50) * endDirection + (2 *cnt * SHIFT);
- } else {
- x = x + Math.round(halfWidth + 50) * endDirection + (2 * cnt * SHIFT);
- }
- res.add(new Point(x, y));
-
- // fourth point
- if (startHorizontal) {
- x = endPoint.x;
- } else {
- y = endPoint.y;
- }
- res.add(new Point(x, y));
-
-
- res.add(endPoint);
-
- //------------------
- return res;
- }
-
- private static int getEmptiestQuadrant(FreeFormConnection selfRel) {
- Anchor anchor = selfRel.getStart();
- RoundedRectangle primRect = (RoundedRectangle)anchor.getParent().getGraphicsAlgorithm();
- Collection<Connection> cons = new HashSet<Connection>();
- cons.addAll(anchor.getIncomingConnections());
- cons.addAll(anchor.getOutgoingConnections());
- Iterator<Connection> it = cons.iterator();
- Collection<Anchor> anchors = new HashSet<Anchor>();
- while (it.hasNext()) {
- Connection c = it.next();
- Anchor a = c.getStart();
- if (a != anchor)
- anchors.add(a);
- a = c.getEnd();
- if (a != anchor)
- anchors.add(a);
- }
- Iterator<Anchor> itAnchors = anchors.iterator();
- float[] quadrantHabitat = new float[5];
- while (itAnchors.hasNext()) {
- Anchor a = itAnchors.next();
- RoundedRectangle rect = (RoundedRectangle)a.getParent().getGraphicsAlgorithm();
- int q = getQuadrant(primRect, rect);
- quadrantHabitat[q] += 1.5f;
- if (q == 1) {
- quadrantHabitat[4] = quadrantHabitat[4] + 0.5f;
- } else if (q == 4) {
- quadrantHabitat[1] += 0.5f;
- }
- if (q < 4) {
- quadrantHabitat[q + 1] += 0.5f;
- }
- if (q > 1) {
- quadrantHabitat[q - 1] += 0.5f;
- }
- }
- float minHabitat = Float.MAX_VALUE;
- int emptiestQuadrant = 0;
- for (int i = 1; i < 5; i++) {
- if (quadrantHabitat[i] < minHabitat) {
- emptiestQuadrant = i;
- minHabitat = quadrantHabitat[i];
- }
- }
- return emptiestQuadrant;
- }
-
- private static int getQuadrant(RoundedRectangle primRect, RoundedRectangle rect) {
- int primCenterX = primRect.getX() + Math.round(primRect.getWidth() / 2.0f);
- int primCenterY = primRect.getY() + Math.round(primRect.getHeight() / 2.0f);
- int centerX = rect.getX() + Math.round(rect.getWidth() / 2.0f);
- int centerY = rect.getY() + Math.round(rect.getHeight() / 2.0f);
- if (primCenterX < centerX)
- if (primCenterY > centerY)
- return 1;
- else
- return 2;
- else
- if (primCenterY > centerY)
- return 4;
- else
- return 3;
- }
-
- private static List<Point> createBendPointListForNonSelfRelation(FreeFormConnection c, int cnt, int connectionsNum) {
- final int ABS_SHIFT = 15;
- RoundedRectangle rectStart = (RoundedRectangle)c.getStart().getParent().getGraphicsAlgorithm();
- RoundedRectangle rectEnd = (RoundedRectangle)c.getEnd().getParent().getGraphicsAlgorithm();
-
- float startHalfWidth = rectStart.getWidth() / 2.0f;
- float startHalfHeight = rectStart.getHeight() / 2.0f;
- float endHalfWidth = rectEnd.getWidth() / 2.0f;
- float endHalfHeight = rectEnd.getHeight() / 2.0f;
-
-
- int startCenterX = Math.round(startHalfWidth + rectStart.getX());
- int startCenterY = Math.round(startHalfHeight + rectStart.getY());
- int endCenterX = Math.round(endHalfWidth + rectEnd.getX());
- int endCenterY = Math.round(endHalfHeight + rectEnd.getY());
- int xDelta = endCenterX - startCenterX;
- int yDelta = endCenterY - startCenterY;
-
- boolean startHorizontal = true;
- int x;
- int y;
-
- if (xDelta != 0) {
- x = startCenterX + Math.round(startHalfWidth * Math.signum(xDelta));
- y = startCenterY + Math.round(Math.abs(startHalfWidth / xDelta) * yDelta);
- } else {
- x = startCenterX + Math.round(Math.abs(startHalfHeight / yDelta) * xDelta);
- y = startCenterY + Math.round(startHalfHeight * Math.signum(yDelta));
- }
-
- if (Math.abs(y - startCenterY) + 0.1 > startHalfHeight) {
- startHorizontal = false;;
- x = startCenterX + Math.round(Math.abs(startHalfHeight / yDelta) * xDelta);
- y = startCenterY + Math.round(startHalfHeight * Math.signum(yDelta));
- }
- int SHIFT;
- if (startHorizontal) {
- SHIFT = (y < startCenterY) ? ABS_SHIFT : -ABS_SHIFT;
- } else {
- SHIFT = (x < startCenterX) ? ABS_SHIFT : -ABS_SHIFT;
- }
-
-
- Point startPoint = new Point(x + (startHorizontal ? 0 : (cnt * SHIFT)), y + (startHorizontal ? (cnt * SHIFT) : 0));
- List<Point> res = new LinkedList<Point>();
-
- xDelta = startCenterX - endCenterX;
- yDelta = startCenterY - endCenterY;
-
- boolean straight = (xDelta == 0) || (yDelta == 0);
-
- res.add(startPoint);
-
- boolean endHorizontal = true;
-
- if (xDelta != 0) {
- x = endCenterX + Math.round(endHalfWidth * Math.signum(xDelta));
- y = endCenterY + Math.round(Math.abs(endHalfWidth / xDelta) * yDelta);
- } else {
- x = endCenterX + Math.round(Math.abs(endHalfHeight / yDelta) * xDelta);
- y = endCenterY + Math.round(endHalfHeight * Math.signum(yDelta));
- }
- if (Math.abs(y - endCenterY) + 0.1 > endHalfHeight) {
- endHorizontal = false;
- x = endCenterX + Math.round(Math.abs(endHalfHeight / yDelta) * xDelta);
- y = endCenterY + Math.round(endHalfHeight * Math.signum(yDelta));
- }
-
- if (endHorizontal) {
- SHIFT = (y < endCenterY) ? ABS_SHIFT : -ABS_SHIFT;
- } else {
- SHIFT = (x < endCenterX) ? ABS_SHIFT : -ABS_SHIFT;
- }
- Point endPoint = new Point(x + (endHorizontal ? 0 : (cnt * SHIFT)), y + (endHorizontal ? (cnt * SHIFT) : 0));
-
- if (!straight) {
- if (startHorizontal && endHorizontal) {
- if (startPoint.y != endPoint.y) {
- x = startPoint.x + Math.round((endPoint.x - startPoint.x) / 2.0f) + cnt * ABS_SHIFT;
- Point p = new Point(x, startPoint.y);
- res.add(p);
- p = new Point(x, endPoint.y);
- res.add(p);
- }
- } else if (!startHorizontal && !endHorizontal) {
- if (startPoint.x != endPoint.x) {
- y = startPoint.y + Math.round((endPoint.y - startPoint.y) / 2.0f) + cnt * ABS_SHIFT /** (int)Math.signum(yDelta)*/;
- Point p = new Point(startPoint.x, y);
- res.add(p);
- p = new Point(endPoint.x, y);
- res.add(p);
- }
- } else if (startHorizontal) {
- Point p = new Point(endPoint.x, startPoint.y);
- res.add(p);
- } else if (endHorizontal) {
- Point p = new Point(startPoint.x, endPoint.y);
- res.add(p);
- }
- }
-
- res.add(endPoint);
- return res;
- }
-
- static public void rearrangeAllConnections(final ContainerShape cs,
- final IJPAEditorFeatureProvider fp,
- final boolean selfOnly) {
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(cs);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- List<Anchor> anchorsFrom = getAnchors(cs);
- for (Anchor anchorFrom : anchorsFrom) {
- Collection<Connection> outgoingConnections = anchorFrom.getOutgoingConnections();
- Collection<Connection> incomingConnections = anchorFrom.getIncomingConnections();
-
- Set<Set<Connection>> sets = new HashSet<Set<Connection>>();
- Iterator<Connection> it = outgoingConnections.iterator();
- while (it.hasNext())
- addConnection(sets, it.next(), selfOnly);
- it = incomingConnections.iterator();
- while (it.hasNext())
- addConnection(sets, it.next(), selfOnly);
-
- Iterator<Set<Connection>> setsIter = sets.iterator();
- while (setsIter.hasNext()) {
- Set<Connection> set = setsIter.next();
- int cnt = 0;
- int setSize = set.size();
- Iterator<Connection> cIter = set.iterator();
- while (cIter.hasNext()) {
- Connection c = cIter.next();
- IRelation rel = (IRelation)fp.getBusinessObjectForPictogramElement(c);
- rearrangeConnection(c, cnt, setSize, rel.getOwner() == rel.getInverse());
- cnt++;
- }
- }
- }
- }
- });
- }
-
- static public boolean areConnectionsWithIdenticalEnds(Connection c1, Connection c2) {
- return ((c1.getStart() == c2.getStart()) && (c1.getEnd() == c2.getEnd())) ||
- ((c1.getStart() == c2.getEnd()) && (c1.getEnd() == c2.getStart()));
- }
-
- static public boolean connectionBelongsToSet(Connection c, Set<Connection> s) {
- if (s.isEmpty())
- return false;
- Connection example = s.iterator().next();
- return areConnectionsWithIdenticalEnds(c, example);
- }
-
- static public int getNumberOfConnectionsWithSameEndsAs(Connection c) {
- Anchor from = c.getStart();
- Anchor to = c.getEnd();
- Collection<Connection> cs1 = from.getOutgoingConnections();
- Collection<Connection> cs2 = to.getOutgoingConnections();
- int cnt = 0;
- Iterator<Connection> it = cs1.iterator();
- while (it.hasNext()) {
- Connection con = it.next();
- if (con.getEnd() == to)
- cnt++;
- }
- if (from == to)
- return cnt;
- it = cs2.iterator();
- while (it.hasNext()) {
- Connection con = it.next();
- if (con.getEnd() == from)
- cnt++;
- }
- return cnt;
- }
-
- static void addConnection(Set<Set<Connection>> sets, Connection c, boolean selfOnly) {
- if (sets == null)
- throw new NullPointerException("'sets' parameter should not be null"); //$NON-NLS-1$
- if (selfOnly && (c.getStart() != c.getEnd()))
- return;
- Iterator<Set<Connection>> setsIter = sets.iterator();
- while (setsIter.hasNext()) {
- Set<Connection> set = setsIter.next();
- if (connectionBelongsToSet(c, set)) {
- sets.remove(set);
- set.add(c);
- sets.add(set);
- return;
- }
- }
- Set<Connection> newSet = new HashSet<Connection>();
- newSet.add(c);
- sets.add(newSet);
- }
-
- static public void rearrangeConnection(Connection connection, int cnt, int connectionsNum, boolean selfRelation) {
- FreeFormConnection c = (FreeFormConnection)connection;
- rearrangeConnectionBendPoints(c, cnt, connectionsNum, selfRelation);
- rearrangeConnectionDecoratorsLocation(c, cnt, connectionsNum);
- }
-
- static public void rearrangeConnectionBendPoints(FreeFormConnection c, int cnt, int connectionsNum, boolean selfRelation) {
- List<org.eclipse.graphiti.mm.algorithms.styles.Point> oldPts = c.getBendpoints();
- List<org.eclipse.swt.graphics.Point> newPts = JPAEditorUtil.createBendPointList(c, cnt, connectionsNum, selfRelation);
- if (newPts == null)
- return;
-
- for (int i = 0; i < Math.min(oldPts.size(), newPts.size()); i++) {
- oldPts.set(i, Graphiti.getGaService().createPoint(/*c, */newPts.get(i).x, newPts.get(i).y));
- }
- int diff = oldPts.size() - newPts.size();
- if (diff > 0) {
- for (int i = oldPts.size() - 1; i >= newPts.size(); i--)
- oldPts.remove(i);
- } else if (diff < 0) {
- for (int i = oldPts.size(); i < newPts.size(); i++)
- oldPts.add(Graphiti.getGaService().createPoint(/*c, */newPts.get(i).x, newPts.get(i).y));
- }
- }
-
- static public void rearrangeConnectionDecoratorsLocation(FreeFormConnection c, int cnt, int connectionsNum) {
- Collection<ConnectionDecorator> dcrs = c.getConnectionDecorators();
- int len = JPAEditorUtil.calcConnectionLength(c);
- for (ConnectionDecorator dcr : dcrs) {
- GraphicsAlgorithm ga = dcr.getGraphicsAlgorithm();
- if (ga instanceof Text) {
- if (Math.abs(dcr.getLocation() - 0.5) < 0.0001)
- continue;
- Point pt = recalcTextDecoratorPosition(c, dcr);
- Graphiti.getGaService().setLocation(ga, pt.x, pt.y, false);
- continue;
- }
- if (dcr.getLocation() < 0.5) {
- Graphiti.getGaService().setLocation(dcr.getGraphicsAlgorithm(),
- Math.round(len /10) , 0);
- }
- else {
- Graphiti.getGaService().setLocation(dcr.getGraphicsAlgorithm(),
- Math.round(-len /10) , 0);
- }
- }
- }
-
-
- public static Point recalcTextDecoratorPosition(FreeFormConnection c,
- ConnectionDecorator dcr) {
- int CORR = 5;
- int TXT_HEIGHT = 8;
- double location = dcr.getLocation();
- RelEndDir relEndDir = (location < 0.5) ?
- JPAEditorUtil.getConnectionStartDir(c) :
- JPAEditorUtil.getConnectionEndDir(c);
- Text txt = (Text)dcr.getGraphicsAlgorithm();
- int TXT_WIDTH = txt.getValue().length() * 6;
- boolean isCardinality = JPAEditorConstants.CARDINALITY_LABELS.contains(txt.getValue());
- int x = 0;
- int y = 0;
- if (relEndDir.equals(RelEndDir.LEFT)) {
- x = CORR + (isCardinality ? 2 : 12);
- y = isCardinality ? (-CORR - 3 - TXT_HEIGHT) : CORR - 3;
- } else if (relEndDir.equals(RelEndDir.RIGHT)) {
- x = - TXT_WIDTH;
- y = isCardinality ? (-CORR - 3 - TXT_HEIGHT) : CORR - 3;
- } else if (relEndDir.equals(RelEndDir.UP)) {
- x = isCardinality ? (-CORR - TXT_WIDTH) : CORR;
- y = isCardinality ? CORR : CORR + TXT_HEIGHT + 2;
- } else if (relEndDir.equals(RelEndDir.DOWN)) {
- x = isCardinality ? (-CORR - TXT_WIDTH) : CORR;
- y = -CORR - (isCardinality ? TXT_HEIGHT : (TXT_HEIGHT + 2) * 2);
- }
- return new Point(x, y);
- }
-
- public static String formTableName(JavaPersistentType jpt) {
- IProject project = jpt.getJpaProject().getProject();
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- String tableNamePrefix = JPADiagramPropertyPage.getDefaultTablePrefixName(project, props);
- String shortEntityName = JPAEditorUtil.returnSimpleName(JpaArtifactFactory.instance().getEntityName(jpt));
- if (tableNamePrefix.length() == 0)
- return shortEntityName;
- return tableNamePrefix + shortEntityName.toUpperCase(Locale.ENGLISH);
- }
-
- static private List<Anchor> getAnchors(ContainerShape containerShape) {
- List<Anchor> ret = new ArrayList<Anchor>();
- ret.addAll(containerShape.getAnchors());
-
- List<Shape> children = containerShape.getChildren();
- for (Shape shape : children) {
- if (shape instanceof ContainerShape) {
- ret.addAll(getAnchors((ContainerShape) shape));
- } else {
- ret.addAll(shape.getAnchors());
- }
- }
- return ret;
- }
-
- static public RelEndDir getConnectionStartDir(FreeFormConnection c) {
- EList<org.eclipse.graphiti.mm.algorithms.styles.Point> pts = c.getBendpoints();
- return getConnectionEndDir(pts.get(0), pts.get(1));
- }
-
- static public RelEndDir getConnectionEndDir(FreeFormConnection c) {
- List<org.eclipse.graphiti.mm.algorithms.styles.Point> pts = c.getBendpoints();
- return getConnectionEndDir(pts.get(pts.size() - 1), pts.get(pts.size() - 2));
- }
-
- static private RelEndDir getConnectionEndDir(org.eclipse.graphiti.mm.algorithms.styles.Point ptEnd,
- org.eclipse.graphiti.mm.algorithms.styles.Point ptNextToEnd) {
- if (ptEnd.getX() == ptNextToEnd.getX()) {
- return (ptNextToEnd.getY() > ptEnd.getY()) ? RelEndDir.UP : RelEndDir.DOWN;
- } else {
- return (ptNextToEnd.getX() > ptEnd.getX()) ? RelEndDir.LEFT : RelEndDir.RIGHT;
- }
- }
-
- static public void organizeImports(ICompilationUnit cu, IWorkbenchSite ws) {
- OrganizeImportsAction action = new OrganizeImportsAction(ws);
- action.run(cu);
- }
-
- static public void formatCode(ICompilationUnit cu, IWorkbenchSite ws) {
- FormatAllAction action = new FormatAllAction(ws);
- action.run(new StructuredSelection(cu));
- }
-
- static public String generateUniqueEntityName(JpaProject jpaProject,
- String pack,
- IJPAEditorFeatureProvider fp) {
- String NAME = pack + ".Entity"; //$NON-NLS-1$
- String name = null;
-
- HashSet<String> JPAProjectEntityNames = getEntityNames(jpaProject);
- HashSet<String> JPAProjectEntitySimpleNames = getEntitySimpleNames(jpaProject);
-
- for (int i = 1; i < 100000000; i++) {
- name = NAME + i;
- if ((!fp.hasObjectWithName(name)) &&
- !JPAProjectEntityNames.contains(name.toLowerCase(Locale.ENGLISH)) &&
- !JPAProjectEntitySimpleNames.contains(JPAEditorUtil.returnSimpleName(name).toLowerCase(Locale.ENGLISH)) &&
- !isJavaFileInProject(jpaProject.getProject(), name, pack))
- break;
- }
- return name;
- }
-
-
- static public String generateUniqueMappedSuperclassName(
- JpaProject jpaProject, String pack, IJPAEditorFeatureProvider fp) {
- String NAME = pack + ".MappedSuperclass"; //$NON-NLS-1$
- String name = null;
-
- HashSet<String> JPAProjectEntityNames = getEntityNames(jpaProject);
- HashSet<String> JPAProjectEntitySimpleNames = getEntitySimpleNames(jpaProject);
-
- for (int i = 1; i < 100000000; i++) {
- name = NAME + i;
- if ((!fp.hasObjectWithName(name)) && !JPAProjectEntityNames.contains(name
- .toLowerCase(Locale.ENGLISH)) && !JPAProjectEntitySimpleNames.contains(JPAEditorUtil
- .returnSimpleName(name).toLowerCase(Locale.ENGLISH))
- && !isJavaFileInProject(jpaProject.getProject(), name, pack))
- break;
- }
- return name;
- }
-
-
-
- static public IFile createEntityInProject(IProject project,
- String entityName, IPreferenceStore jpaPreferenceStore,
- boolean isMappedSuperclassChild, String mappedSuperclassName,
- String mappedSuperclassPackage, boolean hasPrimaryKey)
- throws Exception {
- IFolder folder = getPackageFolder(project);
- return createEntity(project, folder, entityName,
- isMappedSuperclassChild, mappedSuperclassName,
- mappedSuperclassPackage, hasPrimaryKey);
- }
-
-
- static public IFile createEntityFromMappedSuperclassInProject(
- IProject project, String mappedSuperclassName,
- IPreferenceStore jpaPreferenceStore) throws Exception {
- IFolder folder = getPackageFolder(project);
- createMappedSuperclass(project, folder, mappedSuperclassName);
- return createMappedSuperclass(project, folder, mappedSuperclassName);
- }
-
- @SuppressWarnings("deprecation")
- private static IFolder getPackageFolder(IProject project) throws JavaModelException {
-
- IJavaProject javaProject = JavaCore.create(project);
- IPackageFragmentRoot[] packageFragmentRoots = new IPackageFragmentRoot[0];
- final IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
- for (IClasspathEntry classpathEntry : classpathEntries) {
- if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- packageFragmentRoots = javaProject.getPackageFragmentRoots(classpathEntry);
- break;
- }
- }
-
- IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[0];
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- IPackageFragment packageFragment = packageFragmentRoot.getPackageFragment(JPADiagramPropertyPage.getDefaultPackage(project, props));
- if(packageFragment.exists() == false) {
- packageFragment = packageFragmentRoot.createPackageFragment(JPADiagramPropertyPage.getDefaultPackage(project, props), true, new NullProgressMonitor());
- }
- IFolder folder = (IFolder) packageFragment.getCorrespondingResource();
- return folder;
-
- }
-
- static private IFile createMappedSuperclass(IProject project,
- IFolder folder, String mappedSuperclassName) throws Exception {
-
- String mappedSuperclassShortName = mappedSuperclassName
- .substring(mappedSuperclassName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- folder.create(true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(mappedSuperclassShortName + ".java"); //$NON-NLS-1$
-
- if (!file.exists()) {
- String content = "package " + JPADiagramPropertyPage.getDefaultPackage(project) + ";\n\n" //$NON-NLS-1$ //$NON-NLS-2$
- + "import javax.persistence.*;\n\n" //$NON-NLS-1$
- + "@MappedSuperclass \n" //$NON-NLS-1$
- + "public class " + mappedSuperclassShortName + " {\n\n" //$NON-NLS-1$ //$NON-NLS-2$
- + "}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()),
- true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
-
- @SuppressWarnings("deprecation")
- static public boolean isJavaFileInProject(IProject project,
- String entityName,
- String defaultEntityPacakage) {
- IJavaProject javaProject = JavaCore.create(project);
- IPackageFragmentRoot[] packageFragmentRoots = new IPackageFragmentRoot[0];
- IClasspathEntry[] classpathEntries = null;
- try {
- classpathEntries = javaProject.getRawClasspath();
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot obtain the classpath", e); //$NON-NLS-1$
- return false;
- }
- for (IClasspathEntry classpathEntry : classpathEntries) {
- if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- packageFragmentRoots = javaProject.getPackageFragmentRoots(classpathEntry);
- break;
- }
- }
-
- IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[0];
- IPackageFragment packageFragment = packageFragmentRoot.getPackageFragment(JPADiagramPropertyPage.getDefaultPackage(project));
- if(!packageFragment.exists())
- return false;
- IFolder folder = null;
- try {
- folder = (IFolder) packageFragment.getCorrespondingResource();
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot obtain the folder", e); //$NON-NLS-1$
- return false;
- }
- if (!folder.exists())
- return false;
- String entityShortName = entityName.substring(entityName
- .lastIndexOf('.') + 1);
- IFile file = folder.getFile(entityShortName + ".java"); //$NON-NLS-1$
- return file.exists();
- }
-
-
- static public String produceUniqueAttributeName(JavaPersistentType jpt,
- String attributeNameCandidate) {
- String name = attributeNameCandidate;
- for (int i = 1; i < 100000000; i++) {
- if (jpt.getAttributeNamed(name) == null)
- return name;
- name = attributeNameCandidate + "_" + i; //$NON-NLS-1$
- }
- return name;
- }
-
- static public String produceUniqueAttributeName(JavaPersistentType jpt, String forbiddenName, String attributeNameCandidate) {
- String name = attributeNameCandidate;
- for (int i = 1; i < 100000000; i++) {
- if ((jpt.getAttributeNamed(name) == null) && !name.equals(forbiddenName))
- return name;
- name = attributeNameCandidate + "_" + i; //$NON-NLS-1$
- }
- return name;
- }
-
-
- public static boolean isEntityOpenElsewhere(JavaPersistentType jpt, boolean checkDirty) {
- IEditorReference[] edRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
- for (int i = 0; i < edRefs.length; i++) {
- IEditorPart ed = edRefs[i].getEditor(false);
- if (ed == null)
- continue;
- if (checkDirty && !ed.isDirty())
- continue;
- IEditorInput edInp = ed.getEditorInput();
- if (FileEditorInput.class.isInstance(edInp)) {
- FileEditorInput fedInput = (FileEditorInput)edInp;
- if (fedInput.getFile().equals(jpt.getResource())) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static ICompilationUnit getCompilationUnit(JavaPersistentType jpt) {
- return getCompilationUnit((IFile) jpt.getResource());
- }
-
- public static ICompilationUnit getCompilationUnit(IFile file) {
- return EclipseFacade.INSTANCE.getJavaCore().createCompilationUnitFrom(file);
- }
-
- public static void becomeWorkingCopy(ICompilationUnit cu) {
- try {
- cu.becomeWorkingCopy(new NullProgressMonitor());
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Can't discard the working copy", e); //$NON-NLS-1$
- }
- }
-
- public static void discardWorkingCopy(ICompilationUnit cu) {
- while (cu.isWorkingCopy())
- try {
- cu.discardWorkingCopy();
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Can't discard the working copy", e); //$NON-NLS-1$
- }
- }
-
- public static void discardWorkingCopyOnce(ICompilationUnit cu) {
- if (cu.isWorkingCopy())
- try {
- cu.discardWorkingCopy();
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Can't discard the working copy", e); //$NON-NLS-1$
- }
- }
-
- static private IFile createEntity(IProject project, IFolder folder, String entityName, boolean isMappedSuperclassChild,
- String mappedSuperclassName, String mappedSuperclassPackage, boolean hasPrimaryKey) throws Exception {
-
-
-
- String entityShortName = entityName.substring(entityName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- folder.create(true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(entityShortName + ".java"); //$NON-NLS-1$
- Properties props = JPADiagramPropertyPage.loadProperties(project);
- String tableNamePrefix = JPADiagramPropertyPage.getDefaultTablePrefixName(project, props);
- String tableName = (tableNamePrefix.length() > 0) ? (tableNamePrefix + entityShortName.toUpperCase(Locale.ENGLISH)) : ""; //$NON-NLS-1$
- boolean fieldBasedAccess = JPADiagramPropertyPage.isAccessFieldBased(project, props);
-
- String classDeclarationStringContent = null;
- if (isMappedSuperclassChild) {
- String mappedSuperclassShortName = mappedSuperclassName.substring(mappedSuperclassName.lastIndexOf('.') + 1);
- classDeclarationStringContent = "public class " + entityShortName + " extends " + mappedSuperclassShortName + " {\n\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else {
- classDeclarationStringContent = "public class " + entityShortName + " {\n\n"; //$NON-NLS-1$ //$NON-NLS-2$
-
- }
-
- String packageImport = ""; //$NON-NLS-1$
- if (mappedSuperclassPackage != null
- && !mappedSuperclassPackage.equals("") && !(JPADiagramPropertyPage.getDefaultPackage(project, props).equals(mappedSuperclassPackage))) { //$NON-NLS-1$
- packageImport = "import " + mappedSuperclassPackage + ".*;"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- String primaryKeyDeclaration = ""; //$NON-NLS-1$
- if (!hasPrimaryKey) {
- primaryKeyDeclaration = (fieldBasedAccess ? " @Id \n" : "") //$NON-NLS-1$ //$NON-NLS-2$
- + " private long id;\n\n" //$NON-NLS-1$
- + (fieldBasedAccess ? "" : " @Id \n") //$NON-NLS-1$ //$NON-NLS-2$
- + " public long getId() {\n" //$NON-NLS-1$
- + " return id;\n" //$NON-NLS-1$
- + " }\n\n" //$NON-NLS-1$
- + " public void setId(long id) {\n" //$NON-NLS-1$
- + " this.id = id;\n" //$NON-NLS-1$
- + " }\n\n"; //$NON-NLS-1$
- }
-
-
- if (!file.exists()) {
- String content = "package " + JPADiagramPropertyPage.getDefaultPackage(project, props) + ";\n\n" //$NON-NLS-1$ //$NON-NLS-2$
- + "import javax.persistence.*;\n" //$NON-NLS-1$
- + packageImport+"\n\n" //$NON-NLS-1$
- + "@Entity \n" //$NON-NLS-1$
- + ((tableName.length() > 0) ? ("@Table(name=\"" + tableName + "\")\n") : "") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- + classDeclarationStringContent
- + primaryKeyDeclaration
- +"}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()), true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
- static private HashSet<String> getEntityNames(JpaProject jpaProject) {
- HashSet<String> names = new HashSet<String>();
- ListIterator<PersistenceUnit> lit = jpaProject.getRootContextNode().getPersistenceXml().
- getPersistence().getPersistenceUnits().iterator();
- PersistenceUnit pu = lit.next();
- for (ClassRef cf : pu.getClassRefs()) {
- names.add(cf.getClassName());
- }
- return names;
- }
-
- static private HashSet<String> getEntitySimpleNames(JpaProject jpaProject) {
- HashSet<String> names = new HashSet<String>();
- ListIterator<PersistenceUnit> lit = jpaProject.getRootContextNode().getPersistenceXml().
- getPersistence().getPersistenceUnits().iterator();
- PersistenceUnit pu = lit.next();
- for (ClassRef cf : pu.getClassRefs()) {
- names.add(JPAEditorUtil.returnSimpleName(cf.getClassName()).toLowerCase(Locale.ENGLISH));
- }
- return names;
- }
-
- public static boolean isCardinalityDecorator(ConnectionDecorator cd) {
- GraphicsAlgorithm ga = cd.getGraphicsAlgorithm();
- if (!Text.class.isInstance(ga))
- return false;
- Text txt = (Text)ga;
- return JPAEditorConstants.CARDINALITY_LABELS.contains(txt.getValue());
- }
-
-
- public static String getTooltipText(JavaPersistentAttribute at) {
- String res = getAttributeTypeName(at);
- return MessageFormat.format(JPAEditorMessages.JPAEditorUtil_typeTooltipText, new Object[] { res });
- }
-
- static public boolean checkJPAFacetVersion(JpaProject jpaProject, String version) {
- return checkJPAFacetVersion(jpaProject.getProject(), version);
- }
-
-
- static public boolean checkJPAFacetVersion(IProject project, String version) {
- IFacetedProject fproj = null;
- try {
- fproj = ProjectFacetsManager.create(project);
- } catch (CoreException e) {
- JPADiagramEditorPlugin.logError("Could not create faceted project from " + project.getName(), e); //$NON-NLS-1$
- }
- Set<IProjectFacetVersion> projFacets = fproj.getProjectFacets();
- Iterator<IProjectFacetVersion> it = projFacets.iterator();
- while (it.hasNext()) {
- IProjectFacetVersion fv = it.next();
- if (fv.getProjectFacet().getId().equals("jpt.jpa")) { //$NON-NLS-1$
- return fv.getVersionString().equals(version);
- }
- }
- return false;
- }
-
- static public String getPrimitiveWrapper(String primitive) {
- return JPAEditorConstants.PRIMITIVE_TO_WRAPPER.get(primitive);
- }
-
- static private File getFile(IPath classPathEntry) {
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile f = root.getFile(classPathEntry);
- if ((f != null) && f.exists()) {
- URI uri = f.getLocationURI();
- if (uri == null)
- return new File(classPathEntry.toOSString());
- File file = new File(uri);
- return file;
- } else {
- return new File(classPathEntry.toOSString());
- }
-
- }
-
- static public boolean isPersistenceProviderLibraryInClasspath(IPath classPathEntry) {
- try {
- File f = getFile(classPathEntry);
- if ((f == null) || !f.exists())
- return false;
- JarFile jar = new JarFile(f);
- Enumeration<JarEntry> entries = jar.entries();
-
- while (entries.hasMoreElements()) {
- JarEntry entry = entries.nextElement();
- if (entry.getName().equals(PERSISTENCE_PROVIDER_LIBRARY_STRING)) {
- return true;
- }
- }
-
- } catch (IOException e) {
- JPADiagramEditorPlugin.logError(e);
- }
- return false;
- }
-
- static public boolean checkIsSetPersistenceProviderLibrary(JpaProject jpaProject) {
- IJavaProject javaProject = JavaCore.create(jpaProject.getProject());
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- JavaSearchScope scope = (JavaSearchScope) SearchEngine.createJavaSearchScope(elements);
- boolean isAdded = false;
-
- IPath[] paths = scope.enclosingProjectsAndJars();
- for (int i = 1; i < paths.length; i++) {
- IPath path = paths[i];
- if (isPersistenceProviderLibraryInClasspath(path)) {
- isAdded = true;
- break;
- }
- }
- return isAdded;
- }
-
- public static String cutOffStringPrefix(String s, String prefix) {
- if (s.startsWith(prefix))
- return s.substring(prefix.length());
- return s;
- }
-
- public static String cutOffHeaderDirtyPrefix(String header) {
- return cutOffStringPrefix(header, JPAEditorConstants.HEADER_PREFIX_DIRTY);
- }
-
- public static boolean areHeadersEqual(String h1, String h2) {
- h1 = cutOffHeaderDirtyPrefix(h1);
- h2 = cutOffHeaderDirtyPrefix(h2);
- return h1.equals(h2);
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtilImpl.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtilImpl.java
deleted file mode 100644
index 861ad0d2c9..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtilImpl.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorImageCreator.RelEndDir;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IWorkbenchSite;
-
-
-public class JPAEditorUtilImpl implements IJPAEditorUtil {
-
- public int calcConnectionLength(FreeFormConnection c) {
- return JPAEditorUtil.calcConnectionLength(c);
- }
-
- public List<Point> createBendPointList(FreeFormConnection c, int cnt, int connectionsNum, boolean selfRelation) {
- return JPAEditorUtil.createBendPointList(c, cnt, connectionsNum, selfRelation);
- }
-
- public List<Point> createBendPointList(FreeFormConnection c, boolean selfRelation) {
- return JPAEditorUtil.createBendPointList(c, selfRelation);
- }
-
- public RelEndDir getConnectionStartDir(FreeFormConnection c) {
- return JPAEditorUtil.getConnectionStartDir(c);
-
- }
-
- public RelEndDir getConnectionEndDir(FreeFormConnection c) {
- return JPAEditorUtil.getConnectionEndDir(c);
- }
-
- public JavaPersistentType getJPType(ICompilationUnit cu) {
- return JPAEditorUtil.getJPType(cu);
- }
-
- public void organizeImports(ICompilationUnit cu, IWorkbenchSite ws) {
- JPAEditorUtil.organizeImports(cu, ws);
- }
-
- public void formatCode(ICompilationUnit cu, IWorkbenchSite ws) {
- JPAEditorUtil.formatCode(cu, ws);
- }
-
- public String generateUniqueEntityName(JpaProject jpaProject,
- String pack,
- IJPAEditorFeatureProvider fp) {
- return JPAEditorUtil.generateUniqueEntityName(jpaProject, pack, fp);
- }
-
- public String generateUniqueMappedSuperclassName(JpaProject jpaProject, String pack, IJPAEditorFeatureProvider fp) {
- return JPAEditorUtil.generateUniqueMappedSuperclassName(jpaProject, pack, fp);
- }
-
-
- public IFile createEntityInProject(IProject project, String entityName, IPreferenceStore jpaPreferenceStore,
- boolean isMappedSuperclassChild, String mappedSuperclassName, String mappedSuperclassPackage, boolean hasPrimaryKey) throws Exception {
- return JPAEditorUtil.createEntityInProject(project, entityName, jpaPreferenceStore, isMappedSuperclassChild,
- mappedSuperclassName, mappedSuperclassPackage, hasPrimaryKey);
- }
-
-
- public ICompilationUnit getCompilationUnit(JavaPersistentType jpt) {
- return JPAEditorUtil.getCompilationUnit(jpt);
- }
-
- public boolean isCardinalityDecorator(ConnectionDecorator dc) {
- return JPAEditorUtil.isCardinalityDecorator(dc);
- }
-
- public void discardWorkingCopyOnce(ICompilationUnit cu) {
- JPAEditorUtil.discardWorkingCopyOnce(cu);
- }
-
- public IFile createEntityFromMappedSuperclassInProject(IProject project,
- String mappedSuperclassName, IPreferenceStore jpaPreferenceStore) throws Exception {
- return JPAEditorUtil.createEntityFromMappedSuperclassInProject(project, mappedSuperclassName, jpaPreferenceStore);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java
deleted file mode 100644
index bb5afb2e22..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java
+++ /dev/null
@@ -1,1473 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.WeakHashMap;
-import org.eclipse.core.internal.resources.File;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.context.impl.CustomContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.PackageFragmentRoot;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OptionalMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.jpt.jpa.core.context.Relationship;
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-import org.eclipse.jpt.jpa.core.context.RelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.facade.EclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.UpdateAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorDiagramTypeProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.BidirectionalRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-
-@SuppressWarnings("restriction")
-public class JPASolver implements IResourceChangeListener, IJpaSolver {
-
- private static Set<JPASolver> solversSet = new HashSet<JPASolver>();
-
- private static WorkingCopyChangeListener wclsnr = null;
-
- private Hashtable<String, Object> keyToBO;
- private WeakHashMap<JpaProject, WeakReference<CollectionChangeListener>> projectToEntityListener;
- private WeakHashMap<JavaPersistentType, WeakReference<PropertyChangeListener>> entityToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributePropertyChangeListener>> attributeToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>> attributeMappingOptionalityToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>> attributeJoiningStrategyToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>> attributeRelationshipReferenceToPropListener;
- private WeakHashMap<JavaPersistentType, WeakReference<ListChangeListener>> entityToAtListener;
- private WeakHashMap<JavaPersistentType, WeakReference<StateChangeListener>> entityToStateListener;
- private EntityChangeListener entityNameListener;
- private IJPAEditorFeatureProvider featureProvider;
- private HashSet<String> removeIgnore = new HashSet<String>();
- private HashSet<String> removeRelIgnore = new HashSet<String>();
-
- private HashSet<String> addIgnore = new HashSet<String>();
- private Hashtable<String, IRelation> attribToRel = new Hashtable<String, IRelation>();
- private static final String SEPARATOR = "-"; //$NON-NLS-1$
-
- private IEclipseFacade eclipseFacade;
- private IJPAEditorUtil util = null;
-
- /**
- * Provides the unique key for the given business object.
- *
- * @param bo
- * the given business object
- *
- * @return unique key
- */
- public JPASolver() {
- this(EclipseFacade.INSTANCE, new JPAEditorUtilImpl());
- synchronized (JPASolver.class) {
- if (wclsnr == null) {
- wclsnr = new WorkingCopyChangeListener();
- JavaCore.addElementChangedListener(wclsnr, ElementChangedEvent.POST_CHANGE | ElementChangedEvent.POST_RECONCILE);
- }
- }
- solversSet.add(this);
- }
-
- public JPASolver(IEclipseFacade eclipseFacade, IJPAEditorUtil util) {
- this.eclipseFacade = eclipseFacade;
- eclipseFacade.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.POST_BUILD);
- keyToBO = new Hashtable<String, Object>();
- projectToEntityListener = new WeakHashMap<JpaProject, WeakReference<CollectionChangeListener>>();
- entityToPropListener = new WeakHashMap<JavaPersistentType, WeakReference<PropertyChangeListener>>();
- attributeToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributePropertyChangeListener>>();
- attributeMappingOptionalityToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>>();
- attributeJoiningStrategyToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>>();
- attributeRelationshipReferenceToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>>();
- entityToAtListener = new WeakHashMap<JavaPersistentType, WeakReference<ListChangeListener>>();
- entityToStateListener = new WeakHashMap<JavaPersistentType, WeakReference<StateChangeListener>>();
- entityNameListener = new EntityChangeListener(this);
- entityNameListener.setName("Entity Name Change Listener"); //$NON-NLS-1$
- this.util = util;
- }
-
- public void resourceChanged(IResourceChangeEvent event) {
-
- closeDiagramEditorIfProjectIsDeleted(event);
-
- unregisterDeltedEntity(event);
-
- IMarkerDelta[] markerDeltas = event.findMarkerDeltas(null, true);
- Set<IFile> filesToUpdate = new HashSet<IFile>();
- for (IMarkerDelta delta : markerDeltas) {
- if (delta.getResource().getType() != IResource.FILE)
- continue;
- filesToUpdate.add((IFile) delta.getResource());
- }
-
- // update is made to the whole editor. Find if there is at least on pe
- // to be update and break the iteration
- boolean updateEditor = false;
- FILE: for (IFile file : filesToUpdate) {
- for (JavaPersistentType jpt : entityToPropListener.keySet()) {
- if (jpt.getResource().equals(file)) {
- final PictogramElement element = featureProvider.getPictogramElementForBusinessObject(jpt);
- if (element == null)
- break;
- else {
- updateEditor = true;
- break FILE;
- }
- }
- }
- }
- if (updateEditor) {
- eclipseFacade.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if(featureProvider != null)
- featureProvider.getDiagramTypeProvider().getDiagramEditor().refresh();
- }
- });
-
- }
- }
-
- public void addRemoveIgnore(String atName) {
- removeIgnore.add(atName);
- }
-
- public void addRemoveRelIgnore(String atName) {
- removeRelIgnore.add(atName);
- }
-
- public void addJPTForUpdate(String jptName) {
- entityNameListener.addJPTForUpdate(jptName);
- }
-
- public void addAddIgnore(String atName) {
- addIgnore.add(atName);
- }
-
- public HashSet<String> getAddIgnore(){
- return addIgnore;
- }
-
-
- public void stopThread() {
- entityNameListener.stopThread();
- entityNameListener = null;
- }
-
- synchronized public EntityChangeListener getMonitor() {
- if (entityNameListener == null) {
- entityNameListener = new EntityChangeListener(this);
- entityNameListener.setName("Entity Name Change Listener"); //$NON-NLS-1$
- }
- return entityNameListener;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jpt.jpadiagrameditor.ui.util.IJpaSolver#setFeatureProvider(org.eclipse.jpt.jpadiagrameditor.ui.provider.IJPAEditorFeatureProvider)
- */
- public void setFeatureProvider(IJPAEditorFeatureProvider featureProvider) {
- this.featureProvider = featureProvider;
- entityNameListener.setFeatureProvider(featureProvider);
- entityNameListener.setDaemon(true);
- entityNameListener.start();
- }
-
- public String getKeyForBusinessObject(Object bo) {
- if (bo == null)
- return ""; //$NON-NLS-1$
- if (bo instanceof JavaPersistentType) {
- JavaPersistentType jpt = (JavaPersistentType) bo;
- String name = jpt.getName();
- return name;
- } else if (bo instanceof AbstractRelation) {
- return ((AbstractRelation) bo).getId();
- } else if (bo instanceof JavaPersistentAttribute) {
- JavaPersistentAttribute at = (JavaPersistentAttribute) bo;
- return (((PersistentType)at.getParent()).getName() + "-" + at.getName()); //$NON-NLS-1$
- }
- return bo.toString();
- }
-
- /**
- * Provides the business object for the given key.
- *
- * @param key
- * the unique key
- *
- * @return the business object
- */
- public Object getBusinessObjectForKey(String key) {
- if (key == null)
- return null;
- return keyToBO.get(key);
- }
-
- protected String produceOwnerKeyForRel(AbstractRelation rel) {
- return produceKeyForRel(rel.getOwner(), rel.getOwnerAttributeName());
- }
-
- protected String produceInverseKeyForRel(AbstractRelation rel) {
- return produceKeyForRel(rel.getInverse(), rel.getInverseAttributeName());
- }
-
- public String produceKeyForRel(JavaPersistentType jpt, String attributeName) {
- return jpt.getName() + SEPARATOR + attributeName;
- }
-
- public void addKeyBusinessObject(String key, Object bo) {
- keyToBO.put(key, bo);
- if (bo instanceof JavaPersistentType) {
- JavaPersistentType jpt = (JavaPersistentType) bo;
- JpaProject proj = jpt.getJpaProject();
- addListenersToProject(proj);
- addListenersToEntity(jpt);
- PictogramElement pe = featureProvider.getPictogramElementForBusinessObject(jpt);
- Graphiti.getPeService().setPropertyValue(pe, JPAEditorConstants.PROP_ENTITY_CLASS_NAME, jpt.getName());
- } else if (bo instanceof AbstractRelation) {
- AbstractRelation rel = (AbstractRelation) bo;
- attribToRel.put(produceOwnerKeyForRel(rel), rel);
- if (rel instanceof BidirectionalRelation) {
- attribToRel.put(produceInverseKeyForRel(rel), rel);
- }
- } else if (bo instanceof JavaPersistentAttribute) {
- addPropertiesListenerToAttribute((JavaPersistentAttribute)bo);
- }
- }
-
- public Object remove(String key) {
- if (key == null)
- return null;
- Object o = keyToBO.remove(key);
- if (o instanceof JavaPersistentType) {
- JavaPersistentType jpt = (JavaPersistentType) o;
- for (JavaPersistentAttribute at : jpt.getAttributes()) {
- String k = getKeyForBusinessObject(at);
- remove(k);
- }
-
- removeListenersFromEntity(jpt);
- Diagram d = featureProvider.getDiagramTypeProvider().getDiagram();
- if (d.getChildren().size() == 1) {
- WeakReference<CollectionChangeListener> ref = projectToEntityListener.remove(jpt.getJpaProject());
- if (ref != null) {
- CollectionChangeListener ch = ref.get();
- if (ch != null)
- jpt.getJpaProject().removeCollectionChangeListener(JpaProject.JPA_FILES_COLLECTION, ch);
- }
- }
-
- ICompilationUnit cu = getCompilationUnit(jpt);
- JPAEditorUtil.discardWorkingCopyOnce(cu);
- } else if (o instanceof AbstractRelation) {
- AbstractRelation rel = (AbstractRelation) o;
- attribToRel.remove(produceOwnerKeyForRel(rel));
- if (rel instanceof BidirectionalRelation)
- attribToRel.remove(produceInverseKeyForRel(rel));
- } else if (o instanceof JavaPersistentAttribute) {
- removeListenersFromAttribute((JavaPersistentAttribute)o);
- }
- return o;
- }
-
- public ICompilationUnit getCompilationUnit(JavaPersistentType jpt) {
- return util.getCompilationUnit(jpt);
- }
-
- public boolean isRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
- String key = produceKeyForRel((JavaPersistentType)jpa.getParent(), jpa.getName());
- return attribToRel.containsKey(key);
- }
-
- public IRelation getRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
- String key = produceKeyForRel((JavaPersistentType)jpa.getParent(), jpa.getName());
- return attribToRel.get(key);
- }
-
- public Set<IRelation> getRelationsRelatedToEntity(JavaPersistentType jpt) {
- HashSet<IRelation> res = new HashSet<IRelation>();
- for (JavaPersistentAttribute at : jpt.getAttributes()) {
- IRelation rel = getRelationRelatedToAttribute(at);
- if (rel != null)
- res.add(rel);
- }
- return res;
- }
-
-
- public boolean existsRelation(JavaPersistentType jpt1, JavaPersistentType jpt2) {
- Set<IRelation> rels = getRelationsRelatedToEntity(jpt1);
- if (existsRelation(jpt1, jpt2, rels))
- return true;
- rels = getRelationsRelatedToEntity(jpt2);
- return existsRelation(jpt1, jpt2, rels);
- }
-
- public boolean existsRelation(JavaPersistentType jpt1,
- JavaPersistentType jpt2,
- Set<IRelation> rels) {
- Iterator<IRelation> it = rels.iterator();
- while (it.hasNext()) {
- IRelation rel = it.next();
- if ((jpt1.equals(rel.getOwner()) && jpt2.equals(rel.getInverse())) ||
- ((jpt2.equals(rel.getOwner()) && jpt1.equals(rel.getInverse()))))
- return true;
- }
- return false;
- }
-
- public Collection<Object> getVisualizedObjects() {
- return keyToBO.values();
- }
-
- public void renewAttributeMappingPropListener(JavaPersistentAttribute jpa) {
- renewAttributeJoiningStrategyPropertyListener(jpa);
- renewAttributeMappingOptPropListener(jpa);
- }
-
- public void renewAttributeJoiningStrategyPropertyListener(JavaPersistentAttribute jpa) {
- AttributeJoiningStrategyPropertyChangeListener lsn = null;
- if (attributeJoiningStrategyToPropListener == null)
- return;
- WeakReference<AttributeJoiningStrategyPropertyChangeListener> ref = attributeJoiningStrategyToPropListener.remove(jpa);
- if (ref != null)
- lsn = ref.get();
-
- JavaAttributeMapping jam = jpa.getMapping();
- if ((jam == null) || !RelationshipMapping.class.isInstance(jam))
- return;
- Relationship rr = ((RelationshipMapping) jam).getRelationship();
- if (rr == null)
- return;
- RelationshipStrategy js = rr.getStrategy();
- if ((js == null) || !MappedByRelationshipStrategy.class.isInstance(js))
- return;
- try {
- if (lsn != null)
- js.removePropertyChangeListener(MappedByRelationshipStrategy.MAPPED_BY_ATTRIBUTE_PROPERTY, lsn);
- } catch (Exception e) {
- //$NON-NLS-1$
- }
- lsn = new AttributeJoiningStrategyPropertyChangeListener();
- js.addPropertyChangeListener(MappedByRelationshipStrategy.MAPPED_BY_ATTRIBUTE_PROPERTY, lsn);
- ref = new WeakReference<AttributeJoiningStrategyPropertyChangeListener>(lsn);
- attributeJoiningStrategyToPropListener.put(jpa, ref);
-
- }
-
- public void renewAttributeMappingOptPropListener(JavaPersistentAttribute jpa) {
- AttributeMappingOptionalityChangeListener lsn = null;
- WeakReference<AttributeMappingOptionalityChangeListener> ref = attributeMappingOptionalityToPropListener.remove(jpa);
- if (ref != null)
- lsn = ref.get();
- JavaAttributeMapping jam = jpa.getMapping();
- if (jam == null)
- return;
- if (!ManyToOneMapping.class.isInstance(jam) && !OneToOneMapping.class.isInstance(jam))
- return;
-
- try {
- if (lsn != null)
- jam.removePropertyChangeListener(OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY, lsn);
- } catch (Exception e) {
- //$NON-NLS-1$
- }
- lsn = new AttributeMappingOptionalityChangeListener();
- jam.addPropertyChangeListener(OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY, lsn);
- ref = new WeakReference<AttributeMappingOptionalityChangeListener>(lsn);
- attributeMappingOptionalityToPropListener.put(jpa, ref);
- }
-
-
- private void addListenersToProject(JpaProject proj) {
- addEntitiesListenerToProject(proj);
- }
-
- private void addEntitiesListenerToProject(JpaProject proj) {
- WeakReference<CollectionChangeListener> lsnrRef = projectToEntityListener.get(proj);
- CollectionChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- /*
- if (!proj.getUpdater().getClass().isInstance(SynchronousJpaProjectUpdater.class))
- proj.setUpdater(new SynchronousJpaProjectUpdater(proj));
- */
- lsnr = new JPAProjectListener();
- proj.addCollectionChangeListener(JpaProject.JPA_FILES_COLLECTION, lsnr);
- lsnrRef = new WeakReference<CollectionChangeListener>(lsnr);
- projectToEntityListener.put(proj, lsnrRef);
- }
- }
-
- private void addListenersToEntity(JavaPersistentType jpt) {
- addAtListenerToEntity(jpt);
- addPropertiesListenerToEntity(jpt);
- addStateListenerToEntity(jpt);
- }
-
- private void addAtListenerToEntity(JavaPersistentType jpt) {
- WeakReference<ListChangeListener> lsnrRef = entityToAtListener.get(jpt);
- ListChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- lsnr = new EntityAttributesChangeListener();
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- lsnrRef = new WeakReference<ListChangeListener>(lsnr);
- entityToAtListener.put(jpt, lsnrRef);
- }
- }
-
- private void addPropertiesListenerToEntity(JavaPersistentType jpt) {
- WeakReference<PropertyChangeListener> lsnrRef = entityToPropListener.get(jpt);
- PropertyChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- lsnr = new EntityPropertyChangeListener();
- jpt.getMapping().addPropertyChangeListener(PersistentType.NAME_PROPERTY, lsnr);
- lsnrRef = new WeakReference<PropertyChangeListener>(lsnr);
- entityToPropListener.put(jpt, lsnrRef);
- }
- }
-
- private void addPropertiesListenerToAttribute(JavaPersistentAttribute jpa) {
- addPropertiesListenerToAttributeItself(jpa);
- addPropertiesListenerToJoiningStrategy(jpa);
- addPropertiesListenerToRelationshipReference(jpa);
- addOptPropListenerToAttributeMapping(jpa);
- }
-
- private void addPropertiesListenerToAttributeItself(JavaPersistentAttribute jpa) {
- WeakReference<AttributePropertyChangeListener> lsnrRef = attributeToPropListener.get(jpa);
- AttributePropertyChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- lsnr = new AttributePropertyChangeListener();
- jpa.addPropertyChangeListener(PersistentAttribute.MAPPING_PROPERTY, lsnr);
- lsnrRef = new WeakReference<AttributePropertyChangeListener>(lsnr);
- attributeToPropListener.put(jpa, lsnrRef);
- }
- }
-
- private void addOptPropListenerToAttributeMapping(JavaPersistentAttribute jpa) {
- WeakReference<AttributeMappingOptionalityChangeListener> lsnrRef = attributeMappingOptionalityToPropListener.get(jpa);
- AttributeMappingOptionalityChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- lsnr = new AttributeMappingOptionalityChangeListener();
- JavaAttributeMapping jam = jpa.getMapping();
- if (jam == null)
- return;
- if (!JavaManyToOneMapping.class.isInstance(jam) &&
- !JavaOneToOneMapping.class.isInstance(jam))
- return;
- jam.addPropertyChangeListener(OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY, lsnr);
- lsnrRef = new WeakReference<AttributeMappingOptionalityChangeListener>(lsnr);
- attributeMappingOptionalityToPropListener.put(jpa, lsnrRef);
- }
- }
-
-
- private void addPropertiesListenerToJoiningStrategy(JavaPersistentAttribute jpa) {
-
- WeakReference<AttributeJoiningStrategyPropertyChangeListener> lsnrRef = attributeJoiningStrategyToPropListener.get(jpa);
- AttributeJoiningStrategyPropertyChangeListener lsnr = null;
- lsnrRef = attributeJoiningStrategyToPropListener.get(jpa);
- lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- lsnr = new AttributeJoiningStrategyPropertyChangeListener();
- JavaAttributeMapping jam = jpa.getMapping();
- if ((jam == null) || !RelationshipMapping.class.isInstance(jam))
- return;
- Relationship rr = ((RelationshipMapping) jam).getRelationship();
- if (rr == null)
- return;
- RelationshipStrategy js = rr.getStrategy();
- if ((js == null) || !MappedByRelationshipStrategy.class.isInstance(js))
- return;
- lsnrRef = new WeakReference<AttributeJoiningStrategyPropertyChangeListener>(lsnr);
- attributeJoiningStrategyToPropListener.put(jpa, lsnrRef);
- }
-
- }
-
-
- private void addPropertiesListenerToRelationshipReference(JavaPersistentAttribute jpa) {
-
- WeakReference<AttributeRelationshipReferencePropertyChangeListener> lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa);
- AttributeRelationshipReferencePropertyChangeListener lsnr = null;
- lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa);
- lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- lsnr = new AttributeRelationshipReferencePropertyChangeListener();
- JavaAttributeMapping jam = jpa.getMapping();
- if ((jam == null) || !RelationshipMapping.class.isInstance(jam))
- return;
- Relationship rr = ((RelationshipMapping) jam).getRelationship();
- if (rr == null)
- return;
- rr.addPropertyChangeListener(ReadOnlyRelationship.STRATEGY_PROPERTY, lsnr);
- rr.addPropertyChangeListener(OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY, new AttributeMappingOptionalityChangeListener());
- lsnrRef = new WeakReference<AttributeRelationshipReferencePropertyChangeListener>(lsnr);
- attributeRelationshipReferenceToPropListener.put(jpa, lsnrRef);
- }
-
- }
-
-
-
- private void addStateListenerToEntity(JavaPersistentType jpt) {
- WeakReference<StateChangeListener> lsnrRef = entityToStateListener.get(jpt);
- StateChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr == null) {
- lsnr = new EntityStateChangeListener();
- jpt.addStateChangeListener(lsnr);
- lsnrRef = new WeakReference<StateChangeListener>(lsnr);
- entityToStateListener.put(jpt, lsnrRef);
- }
- }
-
- private void removeListenersFromEntity(JavaPersistentType jpt) {
- removeAtListenerFromEntity(jpt);
- removePropListenerFromEntity(jpt);
- removeStateListenerFromEntity(jpt);
- }
-
- private void removeListenersFromAttribute(JavaPersistentAttribute jpa) {
- removePropListenerFromAttribute(jpa);
- }
-
- private void removeAtListenerFromEntity(JavaPersistentType jpt) {
- WeakReference<ListChangeListener> lsnrRef = entityToAtListener.get(jpt);
- ListChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr != null) {
- entityToAtListener.remove(jpt);
- jpt.removeListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- }
- }
-
- private void removePropListenerFromEntity(JavaPersistentType jpt) {
- WeakReference<PropertyChangeListener> lsnrRef = entityToPropListener.get(jpt);
- PropertyChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr != null) {
- entityToPropListener.remove(jpt);
- try {
- jpt.getMapping().removePropertyChangeListener(PersistentType.NAME_PROPERTY, lsnr);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
- }
-
- private void removePropListenerFromAttribute(JavaPersistentAttribute jpa) {
- removePropListenerFromAttributeItself(jpa);
- removePropListenerFromJoiningStrategy(jpa);
- removePropListenerFromRelationshipReference(jpa);
- removeOptPropListenerFromAttributeMapping(jpa);
- }
-
- private void removePropListenerFromAttributeItself(JavaPersistentAttribute jpa) {
- WeakReference<AttributePropertyChangeListener> lsnrRef = attributeToPropListener.get(jpa);
- PropertyChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr != null) {
- attributeToPropListener.remove(jpa);
- try {
- jpa.removePropertyChangeListener(PersistentAttribute.MAPPING_PROPERTY, lsnr);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
- }
-
- private void removePropListenerFromJoiningStrategy(JavaPersistentAttribute jpa) {
- WeakReference<AttributeJoiningStrategyPropertyChangeListener> lsnrRef = attributeJoiningStrategyToPropListener.get(jpa);
- PropertyChangeListener lsnr = null;
- lsnrRef = attributeJoiningStrategyToPropListener.get(jpa);
- lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr != null) {
- attributeJoiningStrategyToPropListener.remove(jpa);
- try {
- JavaAttributeMapping jam = jpa.getMapping();
- if ((jam == null) || !RelationshipMapping.class.isInstance(jam))
- return;
- Relationship rr = ((RelationshipMapping) jam).getRelationship();
- if (rr == null)
- return;
- RelationshipStrategy js = rr.getStrategy();
- if ((js == null) || !MappedByRelationshipStrategy.class.isInstance(js))
- return;
- js.removePropertyChangeListener(MappedByRelationshipStrategy.MAPPED_BY_ATTRIBUTE_PROPERTY, lsnr);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
-
- }
-
- private void removeOptPropListenerFromAttributeMapping(JavaPersistentAttribute jpa) {
- WeakReference<AttributeMappingOptionalityChangeListener> lsnrRef = attributeMappingOptionalityToPropListener.get(jpa);
- PropertyChangeListener lsnr = null;
- lsnrRef = attributeMappingOptionalityToPropListener.get(jpa);
- lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr != null) {
- attributeMappingOptionalityToPropListener.remove(jpa);
- try {
- JavaAttributeMapping jam = jpa.getMapping();
- if ((jam == null) || !RelationshipMapping.class.isInstance(jam))
- return;
- jam.removePropertyChangeListener(OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY, lsnr);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
- }
-
-
- private void removePropListenerFromRelationshipReference(JavaPersistentAttribute jpa) {
- WeakReference<AttributeRelationshipReferencePropertyChangeListener> lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa);
- PropertyChangeListener lsnr = null;
- lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa);
- lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr != null) {
- attributeRelationshipReferenceToPropListener.remove(jpa);
- try {
- JavaAttributeMapping jam = jpa.getMapping();
- if ((jam == null) || !RelationshipMapping.class.isInstance(jam))
- return;
- Relationship rr = ((RelationshipMapping) jam).getRelationship();
- if (rr == null)
- return;
- rr.removePropertyChangeListener(ReadOnlyRelationship.STRATEGY_PROPERTY, lsnr);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
- }
-
-
- private void removeStateListenerFromEntity(JavaPersistentType jpt) {
- WeakReference<StateChangeListener> lsnrRef = entityToStateListener.get(jpt);
- StateChangeListener lsnr = null;
- if (lsnrRef != null)
- lsnr = lsnrRef.get();
- if (lsnr != null) {
- entityToStateListener.remove(jpt);
- jpt.removeStateChangeListener(lsnr);
- }
- }
-
- //---------------
- private void removeEntityStateChangeListeners() {
- Iterator<JavaPersistentType> it = entityToStateListener.keySet().iterator();
- Set<JavaPersistentType> s = new HashSet<JavaPersistentType>();
- while(it.hasNext())
- s.add(it.next());
- it = s.iterator();
- while(it.hasNext()) {
- JavaPersistentType jpt = it.next();
- WeakReference<StateChangeListener> ref = entityToStateListener.remove(jpt);
- StateChangeListener lsn = ref.get();
- if (lsn != null)
- jpt.removeStateChangeListener(lsn);
- }
- entityToStateListener.clear();
- entityToStateListener = null;
- }
-
- private void removeEntityPropChangeListeners() {
- Iterator<JavaPersistentType> it = entityToPropListener.keySet().iterator();
- Set<JavaPersistentType> s = new HashSet<JavaPersistentType>();
- while(it.hasNext())
- s.add(it.next());
- it = s.iterator();
- while(it.hasNext()) {
- JavaPersistentType jpt = it.next();
- WeakReference<PropertyChangeListener> ref = entityToPropListener.remove(jpt);
- PropertyChangeListener lsn = ref.get();
- if (lsn != null)
- jpt.getMapping().removePropertyChangeListener(PersistentType.NAME_PROPERTY, lsn);
- }
- entityToPropListener.clear();
- entityToPropListener = null;
- }
-
- private void removeAttributePropChangeListeners() {
- Iterator<JavaPersistentAttribute> it = attributeToPropListener.keySet().iterator();
- Set<JavaPersistentAttribute> s = new HashSet<JavaPersistentAttribute>();
- while(it.hasNext())
- s.add(it.next());
- it = s.iterator();
- while(it.hasNext()) {
- JavaPersistentAttribute jpa = it.next();
- WeakReference<AttributePropertyChangeListener> ref = attributeToPropListener.remove(jpa);
- PropertyChangeListener lsn = ref.get();
- if (lsn != null)
- try {
- jpa.removePropertyChangeListener(PersistentAttribute.MAPPING_PROPERTY, lsn);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
- attributeToPropListener.clear();
- attributeToPropListener = null;
- }
-
- private void removeAttributeJoiningStrategyPropChangeListeners() {
- Iterator<JavaPersistentAttribute> it = attributeJoiningStrategyToPropListener.keySet().iterator();
- Set<JavaPersistentAttribute> s = new HashSet<JavaPersistentAttribute>();
- while(it.hasNext())
- s.add(it.next());
- it = s.iterator();
- while(it.hasNext()) {
- JavaPersistentAttribute jpa = it.next();
- WeakReference<AttributeJoiningStrategyPropertyChangeListener> ref = attributeJoiningStrategyToPropListener.remove(jpa);
- PropertyChangeListener lsn = ref.get();
- if (lsn != null)
- try {
- jpa.getMapping().removePropertyChangeListener(MappedByRelationshipStrategy.MAPPED_BY_ATTRIBUTE_PROPERTY, lsn);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
- attributeJoiningStrategyToPropListener.clear();
- attributeJoiningStrategyToPropListener = null;
- }
-
- private void removeOptPropListeners() {
- Iterator<JavaPersistentAttribute> it = this.attributeMappingOptionalityToPropListener.keySet().iterator();
- Set<JavaPersistentAttribute> s = new HashSet<JavaPersistentAttribute>();
- while(it.hasNext())
- s.add(it.next());
- it = s.iterator();
- while(it.hasNext()) {
- JavaPersistentAttribute jpa = it.next();
- WeakReference<AttributeMappingOptionalityChangeListener> ref = attributeMappingOptionalityToPropListener.remove(jpa);
- if (ref == null)
- continue;
- PropertyChangeListener lsn = ref.get();
- if (lsn == null)
- continue;
- JavaAttributeMapping jam = jpa.getMapping();
- if ((jam == null) || !RelationshipMapping.class.isInstance(jam))
- continue;
- try {
- jam.removePropertyChangeListener(OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY, lsn);
- } catch (IllegalArgumentException e) {
- //$NON-NLS-1$
- }
- }
- attributeRelationshipReferenceToPropListener.clear();
- attributeRelationshipReferenceToPropListener = null;
- }
-
- private void removeEntityAttributeChangeListeners() {
- Iterator<JavaPersistentType> it = entityToAtListener.keySet().iterator();
- Set<JavaPersistentType> s = new HashSet<JavaPersistentType>();
- while(it.hasNext())
- s.add(it.next());
- it = s.iterator();
- while(it.hasNext()) {
- JavaPersistentType jpt = it.next();
- WeakReference<ListChangeListener> ref = entityToAtListener.remove(jpt);
- ListChangeListener lsn = ref.get();
- if (lsn != null)
- jpt.removeListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsn);
- }
- entityToAtListener.clear();
- entityToAtListener = null;
- }
-
- private void removeProjectListeners() {
- Iterator<JpaProject> it = projectToEntityListener.keySet().iterator();
- Set<JpaProject> s = new HashSet<JpaProject>();
- while(it.hasNext())
- s.add(it.next());
- it = s.iterator();
- while(it.hasNext()) {
- JpaProject project = it.next();
- WeakReference<CollectionChangeListener> ref = projectToEntityListener.remove(project);
- CollectionChangeListener lsn = ref.get();
- if (lsn != null)
- project.removeCollectionChangeListener(JpaProject.JPA_FILES_COLLECTION, lsn);
- }
- projectToEntityListener.clear();
- projectToEntityListener = null;
- }
-
- private void removeAllListeners() {
- removeOptPropListeners();
- removeAttributeJoiningStrategyPropChangeListeners();
- removeAttributePropChangeListeners();
- removeEntityStateChangeListeners();
- removeEntityPropChangeListeners();
- removeEntityAttributeChangeListeners();
- removeProjectListeners();
- eclipseFacade.getWorkspace().removeResourceChangeListener(this);
- }
-
- public void dispose() {
- Iterator<Object> it = keyToBO.values().iterator();
- while (it.hasNext()) {
- Object bo = it.next();
- if (!JavaPersistentType.class.isInstance(bo))
- continue;
- ICompilationUnit cu = util.getCompilationUnit(((JavaPersistentType)bo));
- util.discardWorkingCopyOnce(cu);
- }
-
- util = null;
- keyToBO.clear();
- attribToRel.clear();
- keyToBO = null;
- attribToRel = null;
- removeAllListeners();
- featureProvider = null;
- synchronized (JPASolver.class) {
- solversSet.remove(this);
- if (solversSet.isEmpty()) {
- JavaCore.removeElementChangedListener(wclsnr);
- wclsnr = null;
- }
- }
- }
-
- public boolean containsKey(String key) {
- return keyToBO.containsKey(key);
- }
-
- public void restoreEntity(JavaPersistentType jpt) {
- if (jpt == null)
- return;
- ICompilationUnit cu = this.getCompilationUnit(jpt);
- JPAEditorUtil.discardWorkingCopyOnce(cu);
- JPAEditorUtil.becomeWorkingCopy(cu);
- }
-
- public static boolean ignoreEvents = false;
-
- public static class WorkingCopyChangeListener implements IElementChangedListener {
- synchronized public void elementChanged(ElementChangedEvent event) {
- Object o = event.getSource();
- if (!IJavaElementDelta.class.isInstance(o))
- return;
-
- IJavaElementDelta jed = (IJavaElementDelta)o;
- Set<ICompilationUnit> affectedCompilationUnits = getAffectedCompilationUnits(jed);
-
- for (ICompilationUnit cu : affectedCompilationUnits) {
- JavaPersistentType jpt = JPAEditorUtil.getJPType(cu);
- for (JPASolver solver : solversSet) {
- final ContainerShape cs = (ContainerShape)solver.featureProvider.getPictogramElementForBusinessObject(jpt);
- if (cs == null)
- return;
- String entName = JPAEditorUtil.getText(jpt);
- try {
- final String newHeader = (cu.hasUnsavedChanges() ? "* " : "") + entName; //$NON-NLS-1$ //$NON-NLS-2$
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- GraphicsUpdater.updateHeader(cs, newHeader);
- }
- });
-
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot check compilation unit for unsaved changes", e); //$NON-NLS-1$
- }
- }
-
- }
- }
-
- private Set<ICompilationUnit> getAffectedCompilationUnits(IJavaElementDelta delta) {
- Set<ICompilationUnit> res = new HashSet<ICompilationUnit>();
- IJavaElement el = delta.getElement();
- if (ICompilationUnit.class.isInstance(el))
- res.add((ICompilationUnit)el);
- IJavaElementDelta[] children = delta.getChangedChildren();
- for (IJavaElementDelta child : children) {
- Set<ICompilationUnit> cus = getAffectedCompilationUnits(child);
- res.addAll(cus);
- }
- return res;
- }
- }
-
- public class JPAProjectListener implements CollectionChangeListener {
-
- synchronized public void itemsRemoved(CollectionRemoveEvent event) {
- if (ignoreEvents)
- return;
-
- Iterator<?> it = event.getItems().iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (!(o instanceof JpaFile))
- continue;
- final JpaFile jpaFile = (JpaFile)o;
- JptResourceModel jrm = ((JpaFile)o).getResourceModel();
- if (!JavaResourceCompilationUnit.class.isInstance(jrm))
- continue;
- JavaResourceCompilationUnit jrcu = (JavaResourceCompilationUnit)jrm;
- JavaResourceAbstractType jrat = jrcu.getPrimaryType();
- String name = jrat.getQualifiedName();
-
- JpaProject jpaProject = jpaFile.getJpaProject();
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- if(pu == null)
- continue;
- JavaPersistentType jpt = (JavaPersistentType)pu.getPersistentType(name);
- final ContainerShape cs = (ContainerShape)featureProvider.getPictogramElementForBusinessObject(jpt);
- if (cs == null)
- return;
- final RemoveContext ctx = new RemoveContext(cs);
- final IRemoveFeature ft = featureProvider.getRemoveFeature(ctx);;
- Runnable r = new Runnable() {
- public void run() {
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(cs);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- ft.remove(ctx);
- }
- });
- }
- };
- Display.getDefault().syncExec(r);
- }
- }
-
- public void collectionCleared(CollectionClearEvent arg0) {}
-
- public void collectionChanged(CollectionChangeEvent event) {}
-
- public void itemsAdded(CollectionAddEvent event) {}
- };
-
- public class EntityStateChangeListener implements StateChangeListener {
- public void stateChanged(StateChangeEvent event) {
- }
- }
-
- public class EntityAttributesChangeListener implements ListChangeListener {
-
- public void itemsAdded(ListAddEvent event) {
- AddEntityAttributes task = new AddEntityAttributes(event);
- Display.getDefault().asyncExec(task);
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- RemoveEntityAttributes task = new RemoveEntityAttributes(event);
- Display.getDefault().asyncExec(task);
- }
-
- public void listChanged(ListChangeEvent event) {}
-
- public void itemsMoved(ListMoveEvent arg0) {}
-
- public void itemsReplaced(ListReplaceEvent arg0) {}
-
- public void listCleared(ListClearEvent arg0) {}
- };
-
- public class EntityPropertyChangeListener implements PropertyChangeListener {
- synchronized public void propertyChanged(PropertyChangeEvent event) {
- String propName = event.getPropertyName();
- if (propName.equals(JPAEditorConstants.PROP_SPECIFIED_NAME)) {
- final JavaEntity je = (JavaEntity)event.getSource();
- Runnable job = new Runnable() {
- public void run() {
- TransactionalEditingDomain ted = featureProvider.getTransactionalEditingDomain();
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- JavaPersistentType jpt = je.getPersistentType();
- updateJPTName(jpt);
- String tableName = JPAEditorUtil.formTableName(jpt);
- JpaArtifactFactory.instance().setTableName(jpt, tableName);
- }
- });
- }
- };
- Display.getDefault().syncExec(job);
- }
- }
- }
-
- public class AttributePropertyChangeListener implements
- PropertyChangeListener {
- synchronized public void propertyChanged(PropertyChangeEvent event) {
-
- Model source = event.getSource();
- if (!JavaPersistentAttribute.class.isInstance(source))
- return;
- PictogramElement pe = featureProvider
- .getPictogramElementForBusinessObject(((JavaPersistentAttribute) source)
- .getParent());
- final UpdateAttributeFeature ft = new UpdateAttributeFeature(
- featureProvider);
- final CustomContext ctx = new CustomContext();
- ctx.setInnerPictogramElement(pe);
- Runnable runnable = new Runnable() {
- @SuppressWarnings("deprecation")
- public void run() {
- ft.execute(ctx);
- }
- };
- Display.getDefault().asyncExec(runnable);
- String propName = event.getPropertyName();
- if (propName.equals(PersistentAttribute.MAPPING_PROPERTY)) {
- renewAttributeMappingPropListener((JavaPersistentAttribute) source);
- }
- }
- }
-
- /*
- * This listener listens when mappedBy has been changed
- */
- public class AttributeJoiningStrategyPropertyChangeListener implements PropertyChangeListener {
-
- synchronized public void propertyChanged(PropertyChangeEvent event) {
-
- Model m = event.getSource();
- if (!MappedByRelationshipStrategy.class.isInstance(m))
- return;
- MappedByRelationshipStrategy js = (MappedByRelationshipStrategy)m;
- JpaNode nd = js.getParent();
- if (nd == null)
- return;
- nd = nd.getParent();
- if (nd == null)
- return;
- nd = nd.getParent();
- if ((nd == null) || !JavaPersistentAttribute.class.isInstance(nd))
- return;
- JavaPersistentAttribute at = (JavaPersistentAttribute)nd;
- if (!at.getParent().getParent().getResource().exists())
- return;
- PictogramElement pe = featureProvider.getPictogramElementForBusinessObject(at.getParent());
- final UpdateAttributeFeature ft = new UpdateAttributeFeature(featureProvider);
- final CustomContext ctx = new CustomContext();
- ctx.setInnerPictogramElement(pe);
- Runnable runnable = new Runnable() {
- @SuppressWarnings("deprecation")
- public void run() {
- try {
- ft.execute(ctx);
- } catch (Exception e) {
- //$NON-NLS-1$
- }
- }
- };
- Display.getDefault().asyncExec(runnable);
- }
- }
-
-
- public class AttributeRelationshipReferencePropertyChangeListener implements PropertyChangeListener {
-
- synchronized public void propertyChanged(PropertyChangeEvent event) {
- Relationship rr = (Relationship)event.getSource();
- JpaNode p = rr.getParent();
- if (p == null)
- return;
- p = p.getParent();
- if (p == null)
- return;
- if (!JavaPersistentAttribute.class.isInstance(p))
- return;
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)p;
- renewAttributeJoiningStrategyPropertyListener(jpa);
- if (!jpa.getParent().getParent().getResource().exists())
- return;
- if (featureProvider == null)
- return;
- PictogramElement pe = featureProvider.getPictogramElementForBusinessObject(jpa.getParent());
- final UpdateAttributeFeature ft = new UpdateAttributeFeature(featureProvider);
- final CustomContext ctx = new CustomContext();
- ctx.setInnerPictogramElement(pe);
- Runnable runnable = new Runnable() {
- @SuppressWarnings("deprecation")
- public void run() {
- try {
- ft.execute(ctx);
- } catch (Exception e) {
- //$NON-NLS-1$
- }
- }
- };
- Display.getDefault().asyncExec(runnable);
- }
- }
-
- public class AttributeMappingOptionalityChangeListener implements PropertyChangeListener {
-
- synchronized public void propertyChanged(PropertyChangeEvent event) {
- Boolean optional = (Boolean)event.getNewValue();
- boolean isOptional = (optional == null) ? true : optional.booleanValue();
- OptionalMapping nm = (OptionalMapping)event.getSource();
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)nm.getParent();
- IRelation rel = featureProvider.getRelationRelatedToAttribute(jpa);
- boolean atBeginning = !rel.getOwner().equals(jpa.getParent()) ||
- !rel.getOwnerAttributeName().equals(jpa.getName());
- final Connection c = (Connection)featureProvider.getPictogramElementForBusinessObject(rel);
- Collection<ConnectionDecorator> conDecs = c.getConnectionDecorators();
- Iterator<ConnectionDecorator> it = conDecs.iterator();
- final String newLabelText = isOptional ?
- JPAEditorConstants.CARDINALITY_ZERO_ONE :
- JPAEditorConstants.CARDINALITY_ONE;
- while (it.hasNext()) {
- final ConnectionDecorator cd = it.next();
- if (!JPAEditorUtil.isCardinalityDecorator(cd))
- continue;
- double d = cd.getLocation();
- if ((atBeginning && d > 0.5) || (!atBeginning && d <= 0.5))
- continue;
-
- TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(cd);
- ted.getCommandStack().execute(new RecordingCommand(ted) {
- @Override
- protected void doExecute() {
- Text txt = (Text)cd.getGraphicsAlgorithm();
- txt.setValue(newLabelText);
-
- Point pt = JPAEditorUtil.recalcTextDecoratorPosition((FreeFormConnection)c, cd);
- Graphiti.getGaService().setLocation(txt, pt.x, pt.y, false);
- }
- });
- break;
- }
- }
- }
-
- public class RemoveEntityAttributes implements Runnable {
- ListRemoveEvent event = null;
-
- public RemoveEntityAttributes(ListRemoveEvent event) {
- this.event = event;
- }
-
- @SuppressWarnings("unchecked")
- synchronized public void run() {
- try {
- ArrayIterator<JavaPersistentAttribute> it = (ArrayIterator<JavaPersistentAttribute>) event.getItems().iterator();
- Set<Shape> shapesToRemove = new HashSet<Shape>();
- while (it.hasNext()) {
- JavaPersistentAttribute at = it.next();
- /*
- String key = getKeyForBusinessObject(at);
- remove(key);
- */
- if (removeIgnore.remove(((PersistentType)at.getParent()).getName() + "." + at.getName())) //$NON-NLS-1$
- continue;
- Shape atShape = (Shape) featureProvider.getPictogramElementForBusinessObject(at);
- if (atShape == null)
- continue;
-
-
- JavaPersistentType jpt = (JavaPersistentType)event.getSource();
- JavaPersistentAttribute newAt = jpt.getAttributeNamed(at.getName());
- if (newAt != null) {
- RemoveAttributeFeature ft = new RemoveAttributeFeature(featureProvider, true, true);
- RemoveContext c = new RemoveContext(atShape);
- try {
- ft.remove(c);
- } catch (Exception ee) {
- //$NON-NLS-1$
- }
- AddAttributeFeature ft1 = new AddAttributeFeature(featureProvider);
- AddContext c1 = new AddContext();
- c1.setNewObject(newAt);
- ft1.add(c1);
- return;
- }
-
- shapesToRemove.add(atShape);
- IRelation rel = featureProvider.getRelationRelatedToAttribute(at);
- if (rel == null)
- continue;
- Connection conn = (Connection) featureProvider.getPictogramElementForBusinessObject(rel);
- while (conn != null) {
- RemoveContext ctx = new RemoveContext(conn);
- RemoveRelationFeature ft = new RemoveRelationFeature(featureProvider);
- ft.remove(ctx);
- conn = (Connection) featureProvider.getPictogramElementForBusinessObject(rel);
- }
- }
- Iterator<Shape> itr = shapesToRemove.iterator();
- while (itr.hasNext()) {
- Shape atShape = itr.next();
- RemoveContext ctx = new RemoveContext(atShape);
- RemoveAttributeFeature ft = new RemoveAttributeFeature(featureProvider, true, true);
- ft.remove(ctx);
- }
- Collection<IRelation> rels = JpaArtifactFactory.instance().produceAllRelations(
- (JavaPersistentType) event.getSource(), featureProvider);
- Iterator<IRelation> iter = rels.iterator();
- while (iter.hasNext()) {
- IRelation rel = iter.next();
- ContainerShape ownerShape = (ContainerShape) featureProvider
- .getPictogramElementForBusinessObject(rel.getOwner());
- ContainerShape inverseShape = (ContainerShape) featureProvider
- .getPictogramElementForBusinessObject(rel.getInverse());
- AddConnectionContext cntx = new AddConnectionContext(JPAEditorUtil.getAnchor(ownerShape),
- JPAEditorUtil.getAnchor(inverseShape));
- cntx.setNewObject(rel);
- AddRelationFeature ft = new AddRelationFeature(featureProvider);
- ft.add(cntx);
- }
- } catch (Exception e) {
- //$NON-NLS-1$
- }
- }
-
- }
-
- public class AddEntityAttributes implements Runnable {
- ListAddEvent event = null;
-
- public AddEntityAttributes(ListAddEvent event) {
- this.event = event;
- }
-
- @SuppressWarnings("unchecked")
- synchronized public void run() {
- try {
- JavaPersistentType jpt = (JavaPersistentType) event.getSource();
- ContainerShape entShape = (ContainerShape)featureProvider.getPictogramElementForBusinessObject(jpt);
-
- // remove invalidated relations (if any)
- ArrayIterator<JavaPersistentAttribute> it = (ArrayIterator<JavaPersistentAttribute>) event.getItems().iterator();
- while (it.hasNext()) {
- JavaPersistentAttribute at = it.next();
- //Shape atShape = (Shape) featureProvider.getPictogramElementForBusinessObject(at);
- //if (atShape != null)
- // continue;
- if (addIgnore.remove(((PersistentType)at.getParent()).getName() + "." + at.getName())) //$NON-NLS-1$
- continue;
- AddContext ctx = new AddContext();
- ctx.setNewObject(at);
- ctx.setTargetContainer(entShape);
- AddAttributeFeature ft = new AddAttributeFeature(featureProvider);
- ft.add(ctx);
- }
- //JpaArtifactFactory.instance().remakeRelations((IJPAEditorFeatureProvider)featureProvider, entShape, jpt);
- featureProvider.addJPTForUpdate(jpt.getName());
-
- } catch (Exception e) {
- //$NON-NLS-1$
- }
- }
- }
-
- public void addAttribForUpdate(PersistenceUnit pu, String entAtMappedBy) {
- entityNameListener.addAttribForUpdate(pu, entAtMappedBy);
- }
-
-
- private void updateJPTName(JavaPersistentType jpt) {
- String entName = JpaArtifactFactory.instance().getEntityName(jpt);
- entName = JPAEditorUtil.returnSimpleName(entName);
- ContainerShape entShape = (ContainerShape)featureProvider.getPictogramElementForBusinessObject(jpt);
- JPAEditorUtil.setJPTNameInShape(entShape, entName);
- }
-
- private void closeDiagramEditorIfProjectIsDeleted(IResourceChangeEvent event) {
- final IResource resource = event.getResource();
- if (resource != null && !resource.exists() || event.getType() == IResourceChangeEvent.PRE_CLOSE || (event.getType() == IResourceChangeEvent.PRE_DELETE)) {
- if (resource instanceof IProject) {
- final IDiagramTypeProvider provider = featureProvider.getDiagramTypeProvider();
- if (provider instanceof JPAEditorDiagramTypeProvider) {
- final JPADiagramEditor diagramBySelectedProject = ((JPAEditorDiagramTypeProvider) provider).getDiagramEditor();
- final Diagram diagram = ((JPAEditorDiagramTypeProvider)provider).getDiagram();
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- if ((ModelIntegrationUtil.getProjectByDiagram(diagram.getName()).getProject()).equals(resource)) {
- page.closeEditor(diagramBySelectedProject, false);
- }
- }
- });
- }
-
- }
- }
- }
-
- private void unregisterDeltedEntity(IResourceChangeEvent event) {
- if((event.getType() == IResourceChangeEvent.PRE_CLOSE) || (event.getType() == IResourceChangeEvent.PRE_DELETE))
- return;
-
- IResourceDelta changedDelta = event.getDelta();
- IResourceDelta[] deltas = changedDelta.getAffectedChildren();
- for (IResourceDelta delta : deltas) {
- final IResource resource = delta.getResource();
- if (resource != null && resource.exists()) {
- if (resource instanceof IProject) {
- IProject project = (IProject) resource;
- for (IResourceDelta deltaResource : delta.getAffectedChildren()) {
- List<IResourceDelta> resources = new ArrayList<IResourceDelta>();
- resources = findDeletedResource(deltaResource, resources);
- for (IResourceDelta resourceDelta : resources) {
- if (resourceDelta.getResource() instanceof File) {
- IFile file = this.eclipseFacade.getWorkspace().getRoot().getFile(((File) resourceDelta.getResource()).getFullPath());
- if (!file.exists() && file.getFileExtension().equals("java")) { //$NON-NLS-1$
- try {
- JpaProject jpaProject = JpaArtifactFactory.instance().getJpaProject((IProject) resource);
- if (jpaProject != null) {
- IJavaProject javaProject = JavaCore.create(project);
- IPackageFragmentRoot[] fragmentRoots = javaProject.getAllPackageFragmentRoots();
- for (IPackageFragmentRoot fragmentRoot : fragmentRoots) {
- if ((fragmentRoot instanceof PackageFragmentRoot) && fragmentRoot.getKind() == PackageFragmentRoot.K_SOURCE) {
- PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) fragmentRoot;
- String sourcefolder = packageFragmentRoot.getResource().getName();
- String[] fq = file.getFullPath().toString().split(sourcefolder);
- String fqName = fq[1].replace("/", "."); //$NON-NLS-1$ //$NON-NLS-2$
- fqName = fqName.replaceFirst(".", "").replace(".java", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- //JPAEditorUtil.createUnregisterEntityFromXMLJob(jpaProject, fqName);
- }
- }
- }
- } catch (CoreException e) {
- JPADiagramEditorPlugin.logError(e);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
-
- private List<IResourceDelta> findDeletedResource(IResourceDelta delta, List<IResourceDelta> resources){
- IResourceDelta[] deltas = delta.getAffectedChildren();
- for (IResourceDelta del : deltas) {
- findDeletedResource(del, resources);
- if(del.getAffectedChildren().length==0)
- resources.add(del);
- }
- return resources;
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
deleted file mode 100644
index 6e68ace118..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
+++ /dev/null
@@ -1,2285 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.context.impl.AddConnectionContext;
-import org.eclipse.graphiti.features.context.impl.RemoveContext;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IImportDeclaration;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.ui.refactoring.RenameSupport;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.RelationshipMappingAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.UpdateAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.BidirectionalRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelDir;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.UnidirectionalRelation;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-@SuppressWarnings("restriction")
-public class JpaArtifactFactory {
-
- private static final JpaArtifactFactory INSTANCE = new JpaArtifactFactory();
-
- private static final int MAX_NUM_OF_ITERATIONS = 25;
- private static final int PAUSE_DURATION = 200;
-
- private static final String COLLECTION_TYPE = "java.util.Collection"; //$NON-NLS-1$
- private static final String LIST_TYPE = "java.util.List"; //$NON-NLS-1$
- private static final String SET_TYPE = "java.util.Set"; //$NON-NLS-1$
- private static final String MAP_TYPE = "java.util.Map"; //$NON-NLS-1$
-
- synchronized public static JpaArtifactFactory instance() {
- return INSTANCE;
- }
-
- public void addOneToOneUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentAttribute attribute) {
- addOneToOneRelation(fp, jpt, attribute, null, null,
- JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL);
- }
-
- public void addOneToOneBidirectionalRelation (IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2) {
-
- addOneToOneRelation(fp, jpt1, attribute1, jpt2, attribute2,
- JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL);
- }
-
- public void addOneToOneRelation(IFeatureProvider fp, JavaPersistentType ownerJPT,
- JavaPersistentAttribute ownerAttibute,
- JavaPersistentType referencedJPT,
- JavaPersistentAttribute referencedAttribute, int direction) {
-
- if(ownerJPT.getAttributeNamed(ownerAttibute.getName()) == null){
- refreshEntityModel(fp, ownerJPT);
- }
-
- JavaPersistentAttribute attr = (JavaPersistentAttribute) ownerJPT
- .resolveAttribute(ownerAttibute.getName());
- attr.getResourceAttribute().setPrimaryAnnotation("javax.persistence.OneToOne", new ArrayListIterable<String>()); //$NON-NLS-1$
- if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) {
- JpaArtifactFactory.instance().refreshEntityModel(null, referencedJPT);
- JavaPersistentAttribute attr2 = (JavaPersistentAttribute) referencedJPT.resolveAttribute(referencedAttribute.getName());
- attr2.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- attr2.getJpaProject().getRootContextNode().update();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) attr2.getMapping();
- OneToOneAnnotation annotation = mapping.getMappingAnnotation();
- if(annotation == null) {
- JpaArtifactFactory.instance().refreshEntityModel(null, referencedJPT);
- annotation = ((JavaOneToOneMapping) attr2.getMapping()).getMappingAnnotation();
- }
- annotation.setMappedBy(ownerAttibute.getName());
- }
-
- }
-
- public void addOneToManyUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentAttribute attribute, boolean isMap) {
-
- addOneToManyRelation(fp, jpt, attribute, null, null,
- JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, isMap);
- }
-
- public void addOneToManyBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2, boolean isMap) {
-
- addOneToManyRelation(fp, jpt1, attribute1, jpt2, attribute2,
- JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap);
- }
-
- public void addManyToOneBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2, boolean isMap) {
-
- addManyToOneRelation(fp, jpt1, attribute1, jpt2, attribute2,
- JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap);
- }
-
-
- public void addOneToManyRelation(IFeatureProvider fp, JavaPersistentType singleSideJPT,
- JavaPersistentAttribute singleSideAttibute,
- JavaPersistentType manySideJPT,
- JavaPersistentAttribute manySideAttribute, int direction, boolean isMap) {
-
- //if(singleSideJPT.getAttributeNamed(singleSideAttibute.getName()) == null){
- refreshEntityModel(fp, singleSideJPT);
- //}
-
- JavaPersistentAttribute resolvedSingleSideAttribute = (JavaPersistentAttribute) singleSideJPT
- .resolveAttribute(singleSideAttibute.getName());
- resolvedSingleSideAttribute
- .setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) {
- resolvedSingleSideAttribute.getJpaProject().getRootContextNode()
- .update();
- JpaArtifactFactory.instance().refreshEntityModel(null, singleSideJPT);
- JavaAttributeMapping mapping = resolvedSingleSideAttribute
- .getMapping();
- if (!mapping.getClass().isInstance(JavaOneToManyMapping.class))
- return;
- OneToManyAnnotation annotation = ((JavaOneToManyMapping)mapping).getMappingAnnotation();
- if (annotation == null) {
- JpaArtifactFactory.instance().refreshEntityModel(null, singleSideJPT);
- mapping = resolvedSingleSideAttribute.getMapping();
- annotation = ((JavaOneToManyMapping)mapping).getMappingAnnotation();
- }
-
- if(annotation == null){
- JpaArtifactFactory.instance().refreshEntityModel(null, singleSideJPT);
- annotation = ((JavaOneToManyMapping)resolvedSingleSideAttribute
- .getMapping()).getMappingAnnotation();
- }
- annotation.setMappedBy(manySideAttribute.getName());
-
- }
- if (isMap)
- singleSideAttibute.getResourceAttribute().addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) {
- if(manySideJPT.getAttributeNamed(manySideAttribute.getName()) == null){
- refreshEntityModel(fp, manySideJPT);
- }
-
- JavaPersistentAttribute resolvedManySideAttribute = (JavaPersistentAttribute) manySideJPT
- .resolveAttribute(manySideAttribute.getName());
- resolvedManySideAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- } else {
- addJoinColumnIfNecessary(resolvedSingleSideAttribute, singleSideJPT, fp);
- }
- }
-
- private void addJoinColumnIfNecessary(JavaPersistentAttribute jpa,
- JavaPersistentType jpt, IFeatureProvider fp) {
-
- if (JPAEditorUtil.checkJPAFacetVersion(jpa.getJpaProject(), "1.0") || //$NON-NLS-1$
- JPADiagramPropertyPage.shouldOneToManyUnidirBeOldStyle(jpa
- .getJpaProject().getProject()))
- return;
- JavaPersistentAttribute[] ids = getIds(jpt);
- if (ids.length == 0)
- return;
- final String tableName = getTableName(jpt);
- if (ids.length == 1) {
- if (isSimpleId(ids[0])) {
- JoinColumnAnnotation an = (JoinColumnAnnotation) jpa
- .getResourceAttribute().addAnnotation(0,
- JoinColumnAnnotation.ANNOTATION_NAME);
- String idColName = getColumnName(ids[0]);
- an.setName(tableName + "_" + idColName); //$NON-NLS-1$
- an.setReferencedColumnName(idColName);
- } else {
- Hashtable<String, String> atNameToColName = getOverriddenColNames(ids[0]);
- PersistenceUnit pu = getPersistenceUnit(jpt);
- String embeddableTypeName = ids[0].getTypeName();
- Embeddable emb = pu.getEmbeddable(embeddableTypeName);
- for (AttributeMapping am : emb.getAllAttributeMappings()) {
- JoinColumnAnnotation jc = (JoinColumnAnnotation) jpa.getResourceAttribute().addAnnotation(jpa.getResourceAttribute().getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME), JoinColumnAnnotation.ANNOTATION_NAME);
- JavaPersistentAttribute at = (JavaPersistentAttribute) am
- .getPersistentAttribute();
- String idColName = atNameToColName.get(at.getName());
- idColName = (idColName != null) ? idColName
- : getColumnName(at);
- jc.setName(tableName + "_" + idColName); //$NON-NLS-1$
- jc.setReferencedColumnName(idColName);
- }
- }
- } else {
- for (JavaPersistentAttribute idAt : ids) {
- JoinColumnAnnotation jc = (JoinColumnAnnotation) jpa.getResourceAttribute().addAnnotation( jpa.getResourceAttribute().getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME), JoinColumnAnnotation.ANNOTATION_NAME);
- String idColName = getColumnName(idAt);
- jc.setName(tableName + "_" + idColName); //$NON-NLS-1$
- jc.setReferencedColumnName(idColName);
- }
- }
- }
-
- private Hashtable<String, String> getOverriddenColNames(
- JavaPersistentAttribute embIdAt) {
- Hashtable<String, String> res = new Hashtable<String, String>();
- AttributeOverrideAnnotation aon = (AttributeOverrideAnnotation) embIdAt
- .getResourceAttribute().getAnnotation(0,
- AttributeOverrideAnnotation.ANNOTATION_NAME);
- if (aon != null) {
- ColumnAnnotation colAn = aon.getColumn();
- if (colAn == null)
- return res;
- String colName = colAn.getName();
- if (colName == null)
- return res;
- res.put(aon.getName(), colName);
- return res;
- }
- Iterable<AttributeOverrideAnnotation> it = new SubListIterableWrapper<NestableAnnotation, AttributeOverrideAnnotation>(
- embIdAt.getResourceAttribute().getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME));
- for (AttributeOverrideAnnotation an : it) {
- ColumnAnnotation colAn = an.getColumn();
- if (colAn == null)
- continue;
- String colName = colAn.getName();
- if (colName == null)
- continue;
- res.put(an.getName(), colName);
- }
- return res;
- }
-
-
- public void addManyToOneUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentAttribute attribute) {
-
- addManyToOneRelation(fp, jpt, attribute, null, null,
- JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, false);
- }
-
- public void addManyToOneRelation(IFeatureProvider fp, JavaPersistentType manySideJPT,
- JavaPersistentAttribute manySideAttribute,
- JavaPersistentType singleSideJPT,
- JavaPersistentAttribute singleSideAttibute,
- int direction, boolean isMap) {
-
- refreshEntityModel(fp, manySideJPT);
-
- JavaPersistentAttribute resolvedManySideAttribute = manySideJPT.getAttributeNamed(manySideAttribute.getName());
- resolvedManySideAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- if (direction == JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL)
- return;
-
- JavaPersistentAttribute resolvedSingleSideAttribute = singleSideJPT.getAttributeNamed(singleSideAttibute.getName());
- resolvedSingleSideAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- refreshEntityModel(fp, singleSideJPT);
- JavaOneToManyMapping mapping = (JavaOneToManyMapping)resolvedSingleSideAttribute.getMapping();
- OneToManyAnnotation a = mapping.getMappingAnnotation();
- if (a == null)
- return;
- a.setMappedBy(manySideAttribute.getName());
- if (isMap)
- singleSideAttibute.getResourceAttribute().addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- public void addManyToManyBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2, boolean isMap) {
-
- addManyToManyRelation(fp, jpt1, attribute1, jpt2, attribute2,
- JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap);
- }
-
- public void addManyToManyUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType annotatedJPT,
- JavaPersistentAttribute annotatedAttribute, boolean isMap) {
-
- addManyToManyRelation(fp, annotatedJPT, annotatedAttribute, null, null,
- JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, isMap);
- }
-
- public void addManyToManyRelation(IFeatureProvider fp, JavaPersistentType ownerSideJPT,
- JavaPersistentAttribute ownerSideAttribute,
- JavaPersistentType inverseSideJPT,
- JavaPersistentAttribute inverseSideAttibute, int direction, boolean isMap) {
-
- if(ownerSideJPT.getAttributeNamed(ownerSideAttribute.getName()) == null){
- refreshEntityModel(fp, ownerSideJPT);
- }
-
- JavaPersistentAttribute resolvedOwnerSideAttribute = (JavaPersistentAttribute) ownerSideJPT
- .resolveAttribute(ownerSideAttribute.getName());
- resolvedOwnerSideAttribute
- .setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- if (isMap)
- resolvedOwnerSideAttribute.getResourceAttribute().addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
-
- if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) {
- JpaArtifactFactory.instance().refreshEntityModel(null, inverseSideJPT);
- /*
- if(inverseSideJPT.getAttributeNamed(inverseSideAttibute.getName()) == null){
- refreshEntityModel(fp, inverseSideJPT);
- }
- */
-
- JavaPersistentAttribute resolvedInverseSideAttribute = (JavaPersistentAttribute) inverseSideJPT
- .resolveAttribute(inverseSideAttibute.getName());
- resolvedInverseSideAttribute
- .setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- resolvedInverseSideAttribute.getJpaProject().getRootContextNode()
- .update();
-
- JavaManyToManyMapping mapping = (JavaManyToManyMapping) resolvedInverseSideAttribute
- .getMapping();
- ManyToManyAnnotation a = mapping.getMappingAnnotation();
- if(mapping == null || a == null){
- JpaArtifactFactory.instance().refreshEntityModel(null, inverseSideJPT);
- mapping = (JavaManyToManyMapping) resolvedInverseSideAttribute
- .getMapping();
- a = mapping.getMappingAnnotation();
- }
- if (a == null)
- return;
- a.setMappedBy(ownerSideAttribute.getName());
- if (isMap)
- resolvedInverseSideAttribute.getResourceAttribute().addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- }
-
- public void restoreEntityClass(JavaPersistentType jpt,
- IJPAEditorFeatureProvider fp) {
- fp.restoreEntity(jpt);
- }
-
- public void forceSaveEntityClass(final JavaPersistentType jpt,
- IJPAEditorFeatureProvider fp) {
- final ICompilationUnit cu = fp.getCompilationUnit(jpt);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- if (cu.isWorkingCopy())
- cu.commitWorkingCopy(true, new NullProgressMonitor());
- cu.save(new NullProgressMonitor(), true);
- } catch (JavaModelException e) {
- if (cu.getResource().getProject().isAccessible() && cu.getResource().isAccessible())
- JPADiagramEditorPlugin.logError("Cannot save entity '" + jpt.getName() + "'", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- });
- }
-
- public boolean deleteEntityClass(JavaPersistentType jpt,
- IJPAEditorFeatureProvider fp) {
- ICompilationUnit cu = fp.getCompilationUnit(jpt);
- try {
- JpaProject jpaProject = jpt.getJpaProject();
- jpaProject.updateAndWait();
- JPAEditorUtil.discardWorkingCopy(cu);
- cu.delete(true, new NullProgressMonitor());
- return true;
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot delete the JPA entity class", e); //$NON-NLS-1$
- return false;
- }
- }
-
- public void deletePersistenceTypeResource(PersistentType type)
- throws CoreException {
- JpaProject proj = type.getJpaProject();
- String typeName = type.getName();
- IResource entityResource = type.getResource();
- //type.dispose();
- entityResource.delete(true, new NullProgressMonitor());
- int cnt = 0;
- JavaPersistentType jpt = getContextPersistentType(proj, typeName);
- while ((jpt != null) && (cnt < MAX_NUM_OF_ITERATIONS)) {
- try {
- Thread.sleep(PAUSE_DURATION);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Sleep interrupted", e); //$NON-NLS-1$
- }
- cnt++;
- }
- }
-
- public JavaPersistentType getContextPersistentType(JpaProject jpaProject,
- String fullyQualifiedTypeName) {
-
- PersistenceUnit unit = getPersistenceUnit(jpaProject);
- for (ClassRef ref : unit.getClassRefs()) {
- JavaPersistentType jpt = ref.getJavaPersistentType();
- if ((jpt != null) && jpt.getName().equals(fullyQualifiedTypeName)) {
- return ref.getJavaPersistentType();
- }
- }
- return null;
- }
-
- /*
- * Return name of the entity from @Entity(name="...").
- * If there is no such annotation, returns the
- * fully qualified name of the class
- */
- public String getEntityName(JavaPersistentType jpt) {
- if (jpt == null)
- return ""; //$NON-NLS-1$
- JavaResourceType jrpt = convertJPTToJRT(jpt);
- if (jrpt == null)
- return ""; //$NON-NLS-1$
-
- String name = null;
- JavaTypeMapping mapping = jpt.getMapping();
- if ((mapping != null) && JavaEntity.class.isInstance(mapping))
- name = ((JavaEntity)mapping).getSpecifiedName();
- if (name == null)
- name = jpt.getName();
- return name;
- }
-
- public boolean hasNameAnnotation(JavaPersistentType jpt) {
- if (jpt == null)
- return false;
- JavaResourceType jrpt = convertJPTToJRT(jpt);
- if (jrpt == null)
- return false;
- JavaEntity mapping = (JavaEntity) jpt.getMapping();
- if (mapping != null)
- return (mapping.getSpecifiedName() != null);
- return false;
- }
-
- /*
- @SuppressWarnings("unchecked")
- public String getAttributeName(JavaPersistentAttribute jpa) {
-
- JavaResourcePersistentType jrpt = jpa.getJpaProject()
- .getJavaResourcePersistentType(jpa.getName());
- ASTNode nd = jrpt.getMember().getModifiedDeclaration().getDeclaration();
- if (nd instanceof TypeDeclaration) {
- ListIterator<?> modfs = ((TypeDeclaration) nd).modifiers()
- .listIterator();
- while (modfs.hasNext()) {
- Object modf = modfs.next();
- if (modf instanceof NormalAnnotation) {
- NormalAnnotation an = (NormalAnnotation)modf;
- List<MemberValuePair> vals = an.values();
- if (vals != null) {
- for (int i = 0; i < vals.size(); i++) {
- MemberValuePair mvp = vals.get(i);
- if (mvp.getName().toString().equals("name")) ; //$NON-NLS-1$
- return JPAEditorUtil.stripQuotes(mvp.getValue()
- .toString());
-
- }
- }
- }
- }
- }
- return jpa.getName();
- }
- */
-
- public boolean hasEntityAnnotation(JavaPersistentType jpt) {
- return (jpt.getMapping() instanceof JavaEntity);
- }
-
- public String getSpecifiedEntityName(JavaPersistentType jpt){
- JavaEntity gje = (JavaEntity) jpt.getMapping();
- return gje.getSpecifiedName();
- }
-
- public void renameEntity(JavaPersistentType jpt, String newName) {
- JavaEntity gje = (JavaEntity)jpt.getMapping();
- gje.setSpecifiedName(newName);
- }
-
- public JavaPersistentAttribute addAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentType attributeType, String attributeName,
- String actName, boolean isCollection, ICompilationUnit cu1,
- ICompilationUnit cu2) {
-
- return addAttribute(fp, jpt, attributeType, null, attributeName,
- actName, isCollection, cu1, cu2);
- }
-
- public JavaPersistentAttribute addAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentType attributeType, String mapKeyType, String attributeName,
- String actName, boolean isCollection, ICompilationUnit cu1,
- ICompilationUnit cu2) {
- IType type = null;
- try {
- JPAEditorUtil.createImport(cu1, cu2.getType(attributeType.getName()).getElementName());
- type = cu1.findPrimaryType();
- refreshEntityModel(fp, jpt);
- if (doesAttributeExist(jpt, actName)) {
- return (JavaPersistentAttribute) jpt
- .resolveAttribute(attributeName);
- }
- if (isCollection) {
- IProject project = jpt.getJpaProject().getProject();
- Properties props = fp.loadProperties(project);
-
- if (JPADiagramPropertyPage.isCollectionType(project, props)) {
- createContentType(attributeType, actName, cu1, type, COLLECTION_TYPE);
- type.createMethod(genGetterWithAppropriateType(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, COLLECTION_TYPE), null, false,
- new NullProgressMonitor());
- type.createMethod(genSetterWithAppropriateType(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, COLLECTION_TYPE), null, false,
- new NullProgressMonitor());
- } else if (JPADiagramPropertyPage.isListType(project, props)) {
- createContentType(attributeType, actName, cu1, type, LIST_TYPE);
- type.createMethod(genGetterWithAppropriateType(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, LIST_TYPE), null, false,
- new NullProgressMonitor());
- type.createMethod(genSetterWithAppropriateType(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, LIST_TYPE), null, false,
- new NullProgressMonitor());
- } else if (JPADiagramPropertyPage.isSetType(project, props)) {
- createContentType(attributeType, actName, cu1, type, SET_TYPE);
- type.createMethod(genGetterWithAppropriateType(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, SET_TYPE), null, false,
- new NullProgressMonitor());
- type.createMethod(genSetterWithAppropriateType(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, SET_TYPE), null, false,
- new NullProgressMonitor());
- } else {
- mapKeyType = createContentType(mapKeyType, attributeType, actName, cu1, type, MAP_TYPE);
- type.createMethod(genGetterWithAppropriateType(attributeName, mapKeyType,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, MAP_TYPE), null, false,
- new NullProgressMonitor());
- type.createMethod(genSetterWithAppropriateType(attributeName, mapKeyType,
- JPAEditorUtil.returnSimpleName(attributeType.getName()),
- actName, MAP_TYPE), null, false,
- new NullProgressMonitor());
- }
- } else {
- type
- .createField(
- " private " + JPAEditorUtil.returnSimpleName(attributeType.getName()) + " " + JPAEditorUtil.decapitalizeFirstLetter(actName) + ";", null, false, new NullProgressMonitor()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- type.createMethod(genGetterContents(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()), null,
- actName, null, isCollection), null, false,
- new NullProgressMonitor());
- type.createMethod(genSetterContents(attributeName,
- JPAEditorUtil.returnSimpleName(attributeType.getName()), null,
- actName, isCollection), null, false,
- new NullProgressMonitor());
- }
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannnot create a new attribute with name " + attributeName, e); //$NON-NLS-1$
- }
-
- if(jpt.getAttributeNamed(attributeName) == null){
- refreshEntityModel(fp, jpt);
- }
-
- JavaPersistentAttribute res = getAttributeFromEntity(jpt, actName);
- return res;
- }
-
- private void createContentType(JavaPersistentType attributeType,
- String actName, ICompilationUnit cu1, IType type, String collectionType)
- throws JavaModelException {
- createContentType(null, attributeType,
- actName, cu1, type, collectionType);
- }
-
- private String createContentType(String mapKeyType, JavaPersistentType attributeType,
- String actName, ICompilationUnit cu1, IType type, String collectionType)
- throws JavaModelException {
-
- if (mapKeyType != null) {
- mapKeyType = JPAEditorUtil.createImport(cu1, mapKeyType);
- }
- JPAEditorUtil.createImport(cu1, collectionType);
- type.createField(
- " private " + JPAEditorUtil.returnSimpleName(collectionType) + "<" +//$NON-NLS-1$ //$NON-NLS-2$
- ((mapKeyType != null) ? (mapKeyType + ", ") : "") + //$NON-NLS-1$ //$NON-NLS-2$
- JPAEditorUtil.returnSimpleName(attributeType.getName()) + "> " + JPAEditorUtil.decapitalizeFirstLetter(actName) + //$NON-NLS-1$
- ";", null, false, new NullProgressMonitor()); //$NON-NLS-1$
- return mapKeyType;
- }
-
- public void refreshEntityModel(IFeatureProvider fp, JavaPersistentType jpt) {
- if(convertJPTToJRT(jpt) == null)
- return;
- if (fp == null) {
- jpt.update();
- return;
- }
- Shape el = (Shape) fp.getPictogramElementForBusinessObject(jpt);
- if(JPACheckSum.INSTANCE().isEntityModelChanged(el, jpt.getJpaProject())){
- try {
- jpt.update();
- } catch (ArrayIndexOutOfBoundsException e) {
-
- }
- }
- }
-
- public boolean isCollection(ContainerShape entityShape,
- IJPAEditorFeatureProvider fp, String attrTxt) {
- Object ob = fp.getBusinessObjectForPictogramElement(entityShape);
- if(ob instanceof JavaPersistentType){
- JavaPersistentType jpt = (JavaPersistentType) ob;
- ICompilationUnit cu = fp.getCompilationUnit(jpt);
- IType type = cu.getType(JPAEditorUtil.returnSimpleName(jpt.getName()));
- IField field = type.getField(attrTxt);
- int cnt = 0;
- while ((cnt < 20) && !field.exists()) {
- try {
- Thread.sleep(250);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Sleep interrupted", e); //$NON-NLS-1$
- }
- field = type.getField(attrTxt);
- cnt++;
- }
- if (field.exists()) {
- try {
- if(field.getTypeSignature().contains("List") || field.getTypeSignature().contains("Set") //$NON-NLS-1$ //$NON-NLS-2$
- || field.getTypeSignature().contains("Collection") || field.getTypeSignature().contains("Map") //$NON-NLS-1$ //$NON-NLS-2$
- || field.getTypeSignature().endsWith("[]")) //$NON-NLS-1$
- return true;
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.JpaArtifactFactory_CanNotCheckReturnType +
- " " + attrTxt + "\"", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- return false;
- }
-
- public boolean isGetterMethodReturnTypeCollection(
- ContainerShape entityShape, IJPAEditorFeatureProvider fp,
- String attrTxt) {
- Object ob = fp.getBusinessObjectForPictogramElement(entityShape);
- if(ob instanceof JavaPersistentType){
- JavaPersistentType jpt = (JavaPersistentType) ob;
- ICompilationUnit cu = fp.getCompilationUnit(jpt);
- IType type = cu.getType(JPAEditorUtil.returnSimpleName(jpt.getName()));
- String attrNameWithCapitalLetter = attrTxt.substring(0, 1)
- .toUpperCase(Locale.ENGLISH)
- + attrTxt.substring(1);
- String methodName = "get" + attrNameWithCapitalLetter; //$NON-NLS-1$
- IMethod method = type.getMethod(methodName, new String[0]);
- try {
- if(method.getReturnType().contains("List") || method.getReturnType().contains("Set") //$NON-NLS-1$ //$NON-NLS-2$
- || method.getReturnType().contains("Collection") || method.getReturnType().contains("Map") //$NON-NLS-1$ //$NON-NLS-2$
- || method.getReturnType().endsWith("[]")) //$NON-NLS-1$
- return true;
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError(JPAEditorMessages.JpaArtifactFactory_CanNotCheckReturnType +
- " " + attrTxt + "\"", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return false;
- }
-
- public String createNewAttribute(JavaPersistentType jpt,
- boolean isCollection, IJPAEditorFeatureProvider fp) {
-
- ICompilationUnit ijl = fp.getCompilationUnit(jpt);
- String attrTypeName = "java.lang.String"; //$NON-NLS-1$
- String newAttrName = genUniqueAttrName(jpt, attrTypeName, fp);
- return addNewAttribute(jpt, ijl, newAttrName, attrTypeName,
- "@Basic", newAttrName, isCollection, fp); //$NON-NLS-1$
- }
-
- /*
- * public String createNewAttribute(JavaPersistentType jpt, String attrName,
- * String attrTypeName, String annotation, String actName, boolean
- * isCollection, JPAEditorFeatureProvider fp) {
- *
- * ICompilationUnit ijl = fp.getCompilationUnit(jpt); return
- * addNewAttribute(jpt, ijl, attrName, attrTypeName, annotation, actName,
- * isCollection, fp); }
- */
-
- public JavaPersistentAttribute createANewAttribute(JavaPersistentType jpt,
- String attrName, String attrTypeName, String[] attrTypeElementNames,
- String actName, List<String> annotations, boolean isCollection,
- boolean isMethodAnnotated, IJPAEditorFeatureProvider fp) {
-
- ICompilationUnit ijl = fp.getCompilationUnit(jpt);
- return addANewAttribute(jpt, ijl, attrName, attrTypeName,
- attrTypeElementNames, actName, annotations, isCollection,
- isMethodAnnotated, fp);
- }
-
- private JavaPersistentAttribute addANewAttribute(JavaPersistentType jpt,
- ICompilationUnit cu, String attrName, String attrTypeName,
- String[] attrTypeElementNames, String actName,
- List<String> annotations, boolean isCollection,
- boolean isMethodAnnotated, IJPAEditorFeatureProvider fp) {
-
- JavaPersistentAttribute attr = null;
- try {
- attr = makeNewAttribute(fp, jpt, cu, attrName, attrTypeName,
- attrTypeElementNames, actName, annotations, isCollection,
- isMethodAnnotated);
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot create a new attribute with name " + attrName, e); //$NON-NLS-1$
- }
- return attr;
- }
-
- public String addNewAttribute(JavaPersistentType jpt, ICompilationUnit cu,
- String attrName, String attrTypeName, String annotation,
- String actName, boolean isCollection, IJPAEditorFeatureProvider fp) {
-
- try {
- List<String> annotations = new LinkedList<String>();
- annotations.add(annotation);
- boolean isMethodAnnotated = JpaArtifactFactory.instance()
- .isMethodAnnotated(jpt);
- makeNewAttribute(fp, jpt, cu, attrName, attrTypeName, null, actName,
- annotations, isCollection, isMethodAnnotated);
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot create a new attribute with name " + attrName, e); //$NON-NLS-1$
- }
- return attrName;
- }
-
- public JavaPersistentAttribute makeNewAttribute(IFeatureProvider fp, JavaPersistentType jpt,
- ICompilationUnit cu, String attrName, String attrTypeName,
- String[] attrTypes, String actName,
- List<String> annotations, boolean isCollection,
- boolean isMethodAnnotated) throws JavaModelException {
-
- IType type = cu.findPrimaryType();
- String contents = ""; //$NON-NLS-1$
- isMethodAnnotated = (annotations != null) && (!annotations.isEmpty()) ? isMethodAnnotated
- : JpaArtifactFactory.INSTANCE.isMethodAnnotated(jpt);
-
- if (!isMethodAnnotated) {
- if (annotations != null) {
- Iterator<String> it = annotations.iterator();
- while (it.hasNext()) {
- String an = it.next();
- contents += " " + an + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- if(annotations!=null && annotations.contains("@Basic")){ //$NON-NLS-1$
- if(!cu.getImport("javax.persistence.*").exists() && !cu.getImport("javax.persistence.Basic").exists()){ //$NON-NLS-1$ //$NON-NLS-2$
- JPAEditorUtil.createImports(cu, "javax.persistence.Basic"); //$NON-NLS-1$
- }
- }
-
- boolean shouldAddImport = true;
- IImportDeclaration[] importDeclarations = cu.getImports();
- String attrShortTypeName = JPAEditorUtil.returnSimpleName(attrTypeName);
- for(IImportDeclaration importDecl : importDeclarations){
- String importedDeclarationFQN = importDecl.getElementName();
- String importedDeclarationShortName = JPAEditorUtil.returnSimpleName(importedDeclarationFQN);
- if(attrShortTypeName.equals(importedDeclarationShortName) && !attrTypeName.equals(importedDeclarationFQN))
- shouldAddImport = false;
- }
-
- if(shouldAddImport){
- JPAEditorUtil.createImports(cu, attrTypeName);
- attrTypeName = JPAEditorUtil.returnSimpleName(attrTypeName);
- }
- if ((attrTypes != null) && (attrTypes.length > 0)) {
- JPAEditorUtil.createImports(cu, attrTypes);
- }
-
- contents += " private " + attrTypeName + //$NON-NLS-1$
- ((attrTypes == null) ? "" : ("<" + JPAEditorUtil.createCommaSeparatedListOfSimpleTypeNames(attrTypes) + ">")) + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- " " + attrName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-
- type.createMethod(
- genSetterContents(attrName, attrTypeName, attrTypes,
- actName, isCollection), null, false,
- new NullProgressMonitor());
- if (isMethodAnnotated) {
- type.createMethod(
- genGetterContents(attrName, attrTypeName,
- attrTypes, actName, annotations,
- isCollection), null, false,
- new NullProgressMonitor());
- type.createField(contents, null, false, new NullProgressMonitor());
- } else {
- type.createField(contents, null, false, new NullProgressMonitor());
- type.createMethod(
- genGetterContents(attrName, attrTypeName,
- attrTypes, actName, null, isCollection),
- null, false, new NullProgressMonitor());
- }
-
- int cnt = 0;
- refreshEntityModel(fp, jpt);
- JavaPersistentAttribute jpa = jpt.getAttributeNamed(attrName);
- while ((jpa == null) && (cnt < 25)) {
- try {
- Thread.sleep(250);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError(e);
- }
- jpa = jpt.getAttributeNamed(attrName);
- cnt++;
- }
-
- /*
- if(jpt.getAttributeNamed(attrName) == null){
- refreshEntityModel(fp, jpt);
- }
- */
-
- return getAttributeFromEntity(jpt, attrName);
- }
-
- public void deleteAttribute(JavaPersistentType jpt, String attributeName,
- IJPAEditorFeatureProvider fp) {
-
- String attrNameWithCapitalLetter = attributeName.substring(0, 1)
- .toUpperCase(Locale.ENGLISH)
- + attributeName.substring(1);
- ICompilationUnit compUnit = fp.getCompilationUnit(jpt);
- IType javaType = compUnit.findPrimaryType();
- String typeSignature = null;
- String getterPrefix = "get"; //$NON-NLS-1$
- String methodName = getterPrefix + attrNameWithCapitalLetter;
- IMethod getAttributeMethod = javaType.getMethod(methodName,
- new String[0]);
- if (!getAttributeMethod.exists()) {
- JavaPersistentAttribute jpa = jpt.getAttributeNamed(attributeName);
- String typeName = jpa.getResourceAttribute().getTypeName();
- if ("boolean".equals(typeName)) { //$NON-NLS-1$
- getterPrefix = "is"; //$NON-NLS-1$
- methodName = getterPrefix + attrNameWithCapitalLetter;
- getAttributeMethod = javaType.getMethod(methodName,
- new String[0]);
- }
- try {
- if ((getAttributeMethod != null) && getAttributeMethod.exists());
- typeSignature = getAttributeMethod.getReturnType();
- } catch (JavaModelException e1) {
- JPADiagramEditorPlugin.logError("Cannot obtain the type of the getter with name " + methodName + "()", e1); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (typeSignature == null)
- methodName = null;
-
- boolean isMethodAnnotated = JpaArtifactFactory.instance()
- .isMethodAnnotated(jpt);
- if (isMethodAnnotated) {
- try {
- IField attributeField = javaType.getField(attributeName);
-
- if ((attributeField != null) && !attributeField.exists())
- attributeField = javaType.getField(JPAEditorUtil.revertFirstLetterCase(attributeName));
- if ((attributeField != null) && attributeField.exists())
- attributeField.delete(true, new NullProgressMonitor());
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot remove the attribute field with name " + attributeName, e); //$NON-NLS-1$
- }
- try {
- methodName = getterPrefix + attrNameWithCapitalLetter; //$NON-NLS-1$
- if (getAttributeMethod != null) {
- typeSignature = getAttributeMethod.getReturnType();
- if (getAttributeMethod.exists())
- getAttributeMethod.delete(true, new NullProgressMonitor());
- }
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot remove the attribute getter with name " + methodName + "()", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else {
- try {
- methodName = getterPrefix + attrNameWithCapitalLetter; //$NON-NLS-1$
- if (getAttributeMethod.exists()) {
- typeSignature = getAttributeMethod.getReturnType();
- getAttributeMethod.delete(true, new NullProgressMonitor());
- }
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot remove the attribute getter with name " + methodName + "()", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- try {
- IField attributeField = javaType.getField(attributeName);
- if (attributeField != null)
- if (!attributeField.exists())
- attributeField = javaType.getField(JPAEditorUtil.revertFirstLetterCase(attributeName));
- if ((attributeField != null) && attributeField.exists())
- attributeField.delete(true, new NullProgressMonitor());
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot remove the attribute field with name " + attributeName, e); //$NON-NLS-1$
- }
- }
- try {
- methodName = "set" + attrNameWithCapitalLetter; //$NON-NLS-1$
- IMethod setAttributeMethod = javaType.getMethod(methodName,
- new String[] { typeSignature });
- if ((setAttributeMethod != null) && setAttributeMethod.exists())
- setAttributeMethod.delete(true, new NullProgressMonitor());
- } catch (Exception e) {
- JPADiagramEditorPlugin.logError("Cannot remove the attribute setter with name " + methodName + "(...)", e); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- refreshEntityModel(fp, jpt);
-
- ReadOnlyPersistentAttribute at = jpt.resolveAttribute(attributeName);
- int c = 0;
- while ((at != null) && (c < MAX_NUM_OF_ITERATIONS)) {
- try {
- Thread.sleep(PAUSE_DURATION);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Thread.sleep() interrupted", e); //$NON-NLS-1$
- }
- at = jpt.getAttributeNamed(attributeName);
- c++;
- }
- }
-
- private String genUniqueAttrName(JavaPersistentType jpt,
- String attrTypeName, IJPAEditorFeatureProvider fp) {
-
- ICompilationUnit ijl = fp.getCompilationUnit(jpt);
- IType type = null;
- type = ijl.findPrimaryType();
- Set<String> attrNames = new HashSet<String>();
- for (String name : jpt.getAttributeNames()) {
- attrNames.add(name);
- }
- String name = null;
- for (int i = 1; i < 10000000; i++) {
- name = "attribute" + i; //$NON-NLS-1$
- String attrNameWithCapitalLetter = JPAEditorUtil
- .capitalizeFirstLetter(name);
- String getterName = "get" + attrNameWithCapitalLetter; //$NON-NLS-1$
- String setterName = "set" + attrNameWithCapitalLetter; //$NON-NLS-1$
- if (!attrNames.contains(name)) {
- IField fld = type.getField(name);
- IMethod getter = type.getMethod(getterName, new String[] {});
- IMethod setter1 = type.getMethod(setterName,
- new String[] { attrTypeName });
- IMethod setter2 = type.getMethod(setterName,
- new String[] { "QSet<Q" + attrTypeName + ";>;" }); //$NON-NLS-1$ //$NON-NLS-2$
- IMethod setter3 = type
- .getMethod(
- setterName,
- new String[] { "QCollection<Q" + attrTypeName + ";>;" }); //$NON-NLS-1$ //$NON-NLS-2$
- IMethod setter4 = type.getMethod(setterName,
- new String[] { "QSet;" }); //$NON-NLS-1$
- IMethod setter5 = type.getMethod(setterName,
- new String[] { "QCollection;" }); //$NON-NLS-1$
- if (!fld.exists() && !getter.exists() && !setter1.exists()
- && !setter2.exists() && !setter3.exists()
- && !setter4.exists() && !setter5.exists())
- break;
- }
- }
- return name;
- }
-
- public Annotation[] getAnnotations(JavaPersistentAttribute persistentAttribite) {
- JavaResourceAttribute jrpt = persistentAttribite.getResourceAttribute();
- Annotation[] res = new Annotation[jrpt.getAnnotationsSize()];
- //mappingAnnotationsSize() + jrpt.supportingAnnotationsSize()];
- int c = 0;
- for (Annotation annotation : jrpt.getAnnotations()) {
- res[c] = annotation;
- c++;
- }
- /*
- it = jrpt.supportingAnnotations();
- while (it.hasNext()) {
- res[c] = it.next();
- c++;
- }
- */
- return res;
- }
-
- public HashSet<String> getAnnotationNames(
- JavaPersistentAttribute persistentAttribite) {
-
- JavaResourceAttribute jrpt = persistentAttribite.getResourceAttribute();
- HashSet<String> res = new HashSet<String>();
- for (Annotation annotation : jrpt.getAnnotations()) {
- res.add(JPAEditorUtil.returnSimpleName(annotation.getAnnotationName()));
- }
- /*
- it = jrpt.supportingAnnotations();
- while (it.hasNext())
- res.add(JPAEditorUtil.cutFromLastDot(it.next().getAnnotationName()));
- */
- return res;
- }
-
- public List<String> getAnnotationStrings(
- JavaPersistentAttribute persistentAttribite) {
-
- JavaPersistentType jpt = (JavaPersistentType)persistentAttribite.getParent();
- CompilationUnit jdtCU = jpt.getJavaResourceType().getJavaResourceCompilationUnit().buildASTRoot();
- JavaResourceAttribute jrpt = persistentAttribite.getResourceAttribute();
- List<String> res = new LinkedList<String>();
- for (Annotation an : jrpt.getAnnotations()) {
- org.eclipse.jdt.core.dom.Annotation jdtAn = an.getAstAnnotation(jdtCU);
- res.add(jdtAn.toString());
- }
- /*
- it = jrpt.supportingAnnotations();
- while (it.hasNext()) {
- Annotation an = it.next();
- org.eclipse.jdt.core.dom.Annotation jdtAn = an.getJdtAnnotation(jdtCU);
- res.add(jdtAn.toString());
- }
- */
- return res;
- }
-
- private boolean isNonOwner(JavaPersistentAttribute at) {
- JavaAttributeMapping jam = at.getMapping();
- //if (jam.getMappingAnnotation() == null) {
- JpaArtifactFactory.instance().refreshEntityModel(null, (JavaPersistentType)at.getParent());
- jam = at.getMapping();
- //}
- if (!(jam.getMappingAnnotation() instanceof OwnableRelationshipMappingAnnotation))
- return false;
- OwnableRelationshipMappingAnnotation nom = (OwnableRelationshipMappingAnnotation)jam.getMappingAnnotation();
- return nom.getMappedBy() != null;
- }
-
- public Collection<IRelation> produceAllRelations(
- JavaPersistentType newJPT, IJPAEditorFeatureProvider fp) {
-
- Collection<IRelation> res = produceRelations(newJPT, fp);
- Iterator<IRelation> it = res.iterator();
- HashSet<JavaPersistentType> checkedEntities = new HashSet<JavaPersistentType>();
- while (it.hasNext()) {
- IRelation rel = it.next();
- checkedEntities.add(rel.getOwner());
- checkedEntities.add(rel.getInverse());
- }
- List<Shape> shapes = fp.getDiagramTypeProvider().getDiagram()
- .getChildren();
- Iterator<Shape> iter = shapes.iterator();
- while (iter.hasNext()) {
- Shape sh = iter.next();
- JavaPersistentType jpt = (JavaPersistentType) fp
- .getBusinessObjectForPictogramElement(sh);
- if (jpt == null)
- continue;
- //if (!checkedEntities.contains(jpt)) {
- Collection<IRelation> rels = produceRelations(jpt, newJPT, fp);
- res.addAll(rels);
- //}
- }
- return res;
- }
-
- private Collection<IRelation> produceRelations(
- JavaPersistentType newJPT, IJPAEditorFeatureProvider fp) {
-
- HashSet<IRelation> res = new HashSet<IRelation>();
- for (JavaPersistentAttribute at : newJPT.getAttributes()) {
- IRelation rel = produceRelation(at, fp);
- if (rel != null)
- res.add(rel);
- }
- return res;
- }
-
- public boolean isRelationAnnotated(JavaPersistentAttribute jpa) {
-
- HashSet<String> anNames = getAnnotationNames(jpa);
- Iterator<String> it = anNames.iterator();
- while (it.hasNext()) {
- String anName = it.next();
- if (JPAEditorConstants.RELATION_ANNOTATIONS.contains(anName))
- return true;
- }
- return false;
- }
-
- public IRelation produceRelation(
- JavaPersistentAttribute persistentAttribite,
- IJPAEditorFeatureProvider fp) {
-
- JavaResourceAttribute jrpa = persistentAttribite
- .getResourceAttribute();
-
- IRelation res = null;
- Annotation[] ans = getAnnotations(persistentAttribite);
- for (Annotation an : ans) {
- String annotationName = JPAEditorUtil.returnSimpleName(an.getAnnotationName());
- if (JPAEditorConstants.RELATION_ANNOTATIONS.contains(annotationName)) {
- String relTypeName = getRelTypeName((RelationshipMappingAnnotation)an, jrpa);
- JavaPersistentType relJPT = (JavaPersistentType)fp.getBusinessObjectForKey(relTypeName);
- if (relJPT != null)
- res = produceRelation(persistentAttribite, an, relJPT, fp);
- return res;
- }
- }
- return res;
-
- }
-
- private Collection<IRelation> produceRelations(JavaPersistentType jpt1,
- JavaPersistentType jpt2, IJPAEditorFeatureProvider fp) {
-
- Collection<IRelation> resSet = new HashSet<IRelation>();
- IRelation res = null;
- for (JavaPersistentAttribute at : jpt1.getAttributes()) {
- IResource r = at.getParent().getResource();
- if (!r.exists())
- throw new RuntimeException();
- try {
- JavaResourceAttribute jrpa = at.getResourceAttribute();
- Annotation[] ans = this.getAnnotations(at);
- for (Annotation an : ans) {
- String annotationName = JPAEditorUtil.returnSimpleName(an.getAnnotationName());
- if (JPAEditorConstants.RELATION_ANNOTATIONS.contains(annotationName)) {
- String relTypeName = getRelTypeName((RelationshipMappingAnnotation)an, jrpa);
- if (!relTypeName.equals(jpt2.getName()))
- continue;
- JavaPersistentType relJPT = (JavaPersistentType) fp
- .getBusinessObjectForKey(jpt2.getName());
- res = produceRelation(at, an, relJPT, fp);
- if (res != null)
- resSet.add(res);
- }
-
- }
- } catch (Exception e) {
- throw new RuntimeException();
- }
-
- }
- return resSet;
- }
-
- /**
- * Returns the relation annotation of the given attribute if there is any. If not - returns null
- *
- * @param at
- * @return
- */
-
- /*
- private IAnnotation getRelationAnnotation(JavaPersistentAttribute at) {
- JavaResourcePersistentAttribute jrpa = at.getResourcePersistentAttribute();
- IAnnotatable m = getAttributeMember(at);
- IAnnotation[] ans = null;
- try {
- ans = m.getAnnotations();
- } catch (JavaModelException e) {
- tracer.error("", e);
- return null;
- }
- for (IAnnotation an : ans) {
- if (JPAEditorConstants.RELATION_ANNOTATIONS.contains(JPAEditorUtil.cutFromLastDot(an.getElementName()))) {
- return an;
- }
- }
- return null;
- }
- */
-
- /*
- public JavaPersistentAttribute getRelatedAttribute(JavaPersistentType jpt,
- JavaPersistentType relJPT) {
-
- ListIterator<JavaPersistentAttribute> it = relJPT.attributes();
- while (it.hasNext()) {
- JavaPersistentAttribute relEntityAt = it.next();
- JavaResourcePersistentAttribute jrpa = relEntityAt
- .getResourcePersistentAttribute();
- ASTNode nd = jrpa.getMember().getModifiedDeclaration()
- .getDeclaration();
- if ((nd instanceof MethodDeclaration)
- || (nd instanceof FieldDeclaration)) {
- ListIterator<?> modfs = ((BodyDeclaration) nd).modifiers()
- .listIterator();
- while (modfs.hasNext()) {
- Object modf = modfs.next();
- if (modf instanceof Annotation) {
- Annotation an = (Annotation) modf;
- String annotationName = an.getTypeName()
- .getFullyQualifiedName();
- annotationName = annotationName
- .substring(annotationName.lastIndexOf('.') + 1);
- if (JPAEditorConstants.RELATION_ANNOTATIONS
- .contains(annotationName)) {
- String ownerTypeName = getRelTypeName(an, jrpa);
- if (!ownerTypeName.equals(jpt.getName()))
- continue;
- return relEntityAt;
- }
- }
- }
- }
-
- }
- return null;
- }
- */
-
-
- /*
- * If the given attribute is relation annotated and points to some entity,
- * which is visualized in the diagram this method returns the pointed
- * entity. Otherwise - null
- */
-
- /*
- public JavaPersistentType getRelatedEntity(JavaPersistentAttribute jpa,
- IJPAEditorFeatureProvider fp) {
-
- JavaResourcePersistentAttribute jrpa = jpa
- .getResourcePersistentAttribute();
- IType t = jrpa.getJavaResourceCompilationUnit().getCompilationUnit().findPrimaryType();
- IAnnotatable m = getAttributeMember(jpa);
- IAnnotation[] ans = m.getAnnotations();
- for (IAnnotation an : ans) {
- String annotationName = an.getElementName();
- annotationName = JPAEditorUtil.cutFromLastDot(annotationName);
-
- if (JPAEditorConstants.RELATION_ANNOTATIONS
- .contains(annotationName)) {
- String relTypeName = getRelTypeName(an, jrpa);
- JavaPersistentType relJPT = (JavaPersistentType) jpa
- .getPersistentType().getPersistenceUnit()
- .getPersistentType(relTypeName);
- if (relJPT != null)
- if (fp.getPictogramElementForBusinessObject(relJPT) != null)
- return relJPT;
- }
-
-
- }
-
- if ((nd instanceof MethodDeclaration)
- || (nd instanceof FieldDeclaration)) {
- ListIterator<?> modfs = ((BodyDeclaration) nd).modifiers()
- .listIterator();
- while (modfs.hasNext()) {
- Object modf = modfs.next();
- if (modf instanceof Annotation) {
- Annotation an = (Annotation)modf;
- String annotationName = an.getTypeName()
- .getFullyQualifiedName();
- annotationName = annotationName.substring(annotationName
- .lastIndexOf('.') + 1);
- if (JPAEditorConstants.RELATION_ANNOTATIONS
- .contains(annotationName)) {
- String relTypeName = getRelTypeName(an, jrpa);
- JavaPersistentType relJPT = (JavaPersistentType) jpa
- .getPersistentType().getPersistenceUnit()
- .getPersistentType(relTypeName);
- if (relJPT != null)
- if (fp.getPictogramElementForBusinessObject(relJPT) != null)
- return relJPT;
- }
- }
- }
- }
- return null;
- }
- */
-
- public JavaPersistentType getJPT(String name, PersistenceUnit pu) {
- pu.getJpaProject().updateAndWait();
- JavaPersistentType jpt = (JavaPersistentType) pu.getPersistentType(name);
- int cnt = 0;
- while ((jpt == null) && (cnt < MAX_NUM_OF_ITERATIONS)) {
- try {
- Thread.sleep(PAUSE_DURATION);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Sleep interrupted", e); //$NON-NLS-1$
- }
- jpt = (JavaPersistentType)pu.getPersistentType(name);
- cnt++;
- }
- return jpt;
- }
-
- /*
- * Return all the attributes belonging to another entities and
- * involved in a relation with the entity given as parameter
- */
- public Set<JavaPersistentAttribute> getRelatedAttributes(JavaPersistentType jpt) {
- Set<JavaPersistentAttribute> res = new HashSet<JavaPersistentAttribute>();
- Iterator<JpaFile> it = jpt.getJpaProject().getJpaFiles().iterator();
- PersistenceUnit pu = JpaArtifactFactory.INSTANCE.getPersistenceUnit(jpt.getJpaProject());
- while (it.hasNext()) {
- JpaFile jpaFile = it.next();
- JptResourceModel rm = jpaFile.getResourceModel();
- if (rm == null)
- continue;
- if (!JavaResourceCompilationUnit.class.isInstance(rm))
- continue;
- JavaResourceCompilationUnit jrcu = (JavaResourceCompilationUnit)rm;
- //CSN #130859 2010
- JavaResourceAbstractType jrt = jrcu.getPrimaryType();
- if (jrt == null)
- continue;
- String name = jrt.getQualifiedName();
- JavaPersistentType jpt1 = (JavaPersistentType) pu
- .getPersistentType(name);
- if (jpt1 == null)
- continue;
- Set<JavaPersistentAttribute> relAts = getRelAttributes(jpt, jpt1);
- if (relAts != null)
- res.addAll(relAts);
- }
- return res;
- }
-
- /*
- * Return the attribute (if there is any) belonging to jpt1 and
- * involved in a relation with jpt
- */
-
- private Set<JavaPersistentAttribute> getRelAttributes(JavaPersistentType jpt,
- JavaPersistentType relJPT) {
-
- Set<JavaPersistentAttribute> res = new HashSet<JavaPersistentAttribute>();
- for (JavaPersistentAttribute at : relJPT.getAttributes()) {
- IResource r = at.getParent().getResource();
- if (!r.exists())
- throw new RuntimeException();
- Annotation[] ans = getAnnotations(at);
- String annotationName = null;
- for (Annotation an : ans) {
- annotationName = JPAEditorUtil.returnSimpleName(an.getAnnotationName());
- if (JPAEditorConstants.RELATION_ANNOTATIONS.contains(annotationName)) {
- String relTypeName = getRelTypeName((RelationshipMappingAnnotation)an, at.getResourceAttribute());
- if (!relTypeName.equals(jpt.getName()))
- continue;
- res.add(at);
- }
- }
- }
- return res;
- }
-
-
- public void renameEntityClass(JavaPersistentType jpt, String newEntityName, IJPAEditorFeatureProvider fp) {
- renameEntityClass(fp.getCompilationUnit(jpt), newEntityName);
- }
-
- private void renameEntityClass(ICompilationUnit cu, String newName) {
- IType javaType = cu.findPrimaryType();
- renameType(javaType, newName);
- }
-
- private void renameType(IType type, String newName) {
- if (!type.exists())
- return;
- String oldName = type.getElementName();
- try {
- RenameSupport s = RenameSupport.create(type, newName, RenameSupport.UPDATE_REFERENCES);
- IWorkbenchWindow ww = JPADiagramEditorPlugin.getDefault()
- .getWorkbench().getActiveWorkbenchWindow();
- Shell sh = ww.getShell();
- s.perform(sh, ww);
- } catch (Exception e1) {
- JPADiagramEditorPlugin.logError("Cannot rename the type " + oldName, e1); //$NON-NLS-1$
- }
- }
-
-
- public JavaPersistentAttribute renameAttribute(JavaPersistentType jpt,
- String oldName, String newName, String inverseEntityName,
- IJPAEditorFeatureProvider fp) throws InterruptedException {
- newName = JPAEditorUtil.decapitalizeFirstLetter(newName);
- if (JpaArtifactFactory.instance().isMethodAnnotated(jpt)) {
- newName = JPAEditorUtil.produceValidAttributeName(newName);
- }
- newName = JPAEditorUtil.produceUniqueAttributeName(jpt, newName);
- PersistenceUnit pu = null;
- JavaPersistentAttribute oldAt = jpt.getAttributeNamed(oldName);
- fp.addAddIgnore((JavaPersistentType)oldAt.getParent(), newName);
- JavaResourceAttribute jra = oldAt
- .getResourceAttribute();
- fp.addRemoveIgnore((JavaPersistentType)oldAt.getParent(), jra.getName());
- IRelation rel = fp.getRelationRelatedToAttribute(oldAt);
- String inverseJPAName = null;
- JavaPersistentType inverseJPT = null;
- if (BidirectionalRelation.class.isInstance(rel)) {
- inverseJPT = rel.getInverse();
- if (inverseJPT != oldAt.getParent()) {
- pu = JpaArtifactFactory.INSTANCE.getPersistenceUnit(jpt);
- inverseJPAName = rel.getInverseAttributeName();
- }
- }
- ICompilationUnit cu = fp.getCompilationUnit(jpt);
- renameAttribute(cu, oldName, newName, fp, this.isMethodAnnotated(jpt));
- refreshEntityModel(fp, jpt);
- JavaPersistentAttribute newAt = jpt.getAttributeNamed(newName);
- if (newAt == null)
- newAt = jpt.getAttributeNamed(JPAEditorUtil
- .revertFirstLetterCase(newName));
- int c = 0;
- while ((newAt == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- c++;
- try {
- Thread.sleep(PAUSE_DURATION);
- newAt = jpt.getAttributeNamed(newName);
- if (newAt == null)
- newAt = (JavaPersistentAttribute) jpt
- .resolveAttribute(JPAEditorUtil
- .revertFirstLetterCase(newName));
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Thread.sleep() interrupted", e); //$NON-NLS-1$
- return null;
- }
- }
- if (newAt == null) {
- JPADiagramEditorPlugin.logError("The attribute " + newName + " could not be resolved", new NullPointerException()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- fp.addRemoveIgnore(jpt, oldAt.getName());
- try {
- fp.replaceAttribute(oldAt, newAt);
- } catch (Exception e) {
- return newAt;
- }
- if (inverseJPAName != null) {
- fp.addAttribForUpdate(pu, inverseEntityName
- + EntityChangeListener.SEPARATOR + inverseJPAName
- + EntityChangeListener.SEPARATOR + newAt.getName());
- this.refreshEntityModel(fp, inverseJPT);
- Annotation a = rel.getInverseAnnotatedAttribute().getMapping().getMappingAnnotation();
- if (OwnableRelationshipMappingAnnotation.class.isInstance(a)) {
- boolean exce = true;
- int cnt = 0;
- while (exce && (cnt < 25)) {
- try {
- Thread.sleep(250);
- a = rel.getInverseAnnotatedAttribute().getMapping().getMappingAnnotation();
- ((OwnableRelationshipMappingAnnotation)a).setMappedBy(newAt.getName());
- exce = false;
- } catch (Exception e) {}
- cnt++;
- }
- }
- }
- if (rel != null)
- updateRelation(jpt, fp, rel);
-
- return newAt;
- }
-
- private void updateRelation(JavaPersistentType jpt,
- IJPAEditorFeatureProvider fp, IRelation rel) {
- UpdateAttributeFeature updateFeature = new UpdateAttributeFeature(fp);
- if (jpt.equals(rel.getInverse())) {
- updateFeature.reconnect(rel.getOwner());
- } else {
- updateFeature.reconnect(rel.getInverse());
- }
- }
-
- public JavaPersistentAttribute renameAttribute(JavaPersistentAttribute jpa,
- String newName, String newEntityName, IJPAEditorFeatureProvider fp) throws InterruptedException {
- return renameAttribute((JavaPersistentType)jpa.getParent(), jpa.getName(), newName,
- newEntityName, fp);
- }
-
- private void renameAttribute(ICompilationUnit cu, String oldName,
- String newName, IJPAEditorFeatureProvider fp, boolean isMethodAnnotated) throws InterruptedException {
- IType javaType = cu.findPrimaryType();
- if (javaType == null)
- return;
- IField attributeField = null;
- String typeSignature = null;
- if (isMethodAnnotated) {
- attributeField = javaType.getField(oldName);
- if (!attributeField.exists())
- attributeField = javaType.getField(JPAEditorUtil.revertFirstLetterCase(oldName));
- } else {
- attributeField = javaType.getField(oldName);
- }
- String getterPrefix = "get"; //$NON-NLS-1$
- String methodName = getterPrefix + JPAEditorUtil.capitalizeFirstLetter(oldName); //$NON-NLS-1$
- IMethod getter = javaType.getMethod(methodName, new String[0]);
- if (!getter.exists()) {
- getterPrefix = "is"; //$NON-NLS-1$
- }
- methodName = getterPrefix + JPAEditorUtil.capitalizeFirstLetter(oldName); //$NON-NLS-1$
- getter = javaType.getMethod(methodName, new String[0]);
-
- if (isMethodAnnotated) {
- try {
- typeSignature = getter.getReturnType();
- } catch (JavaModelException e1) {
- JPADiagramEditorPlugin.logError("Cannot obtain type signature of the getter of the attribute " + oldName, e1); //$NON-NLS-1$
- return;
- }
- if ((typeSignature == null) ||
- (!"Z".equals(typeSignature) && !getterPrefix.equals("get"))) { //$NON-NLS-1$ //$NON-NLS-2$
- JPADiagramEditorPlugin.logError("Cannot obtain type signature of the getter of the attribute " + oldName, new NullPointerException()); //$NON-NLS-1$
- return;
- }
- } else {
- try {
- typeSignature = attributeField.getTypeSignature();
- } catch (JavaModelException e) {
- JPADiagramEditorPlugin.logError("Cannot obtain type signature of the field of the attribute " + oldName, e); //$NON-NLS-1$
- return;
- }
- }
-
- methodName = "set" + JPAEditorUtil.capitalizeFirstLetter(oldName); //$NON-NLS-1$
- IMethod setter = javaType.getMethod(methodName,
- new String[] { typeSignature });
-
- if (setter.exists())
- renameSetter(setter, newName);
- if (isMethodAnnotated) {
- if (attributeField.exists())
- renameField(attributeField, newName, isMethodAnnotated);
- if (getter.exists())
- renameGetter(getter, newName);
- } else {
- if (getter.exists())
- renameGetter(getter, newName);
- if (attributeField.exists())
- renameField(attributeField, newName, isMethodAnnotated);
- }
-
- }
-
- private void renameField(IField field, String newName, boolean isMethodAnnotated) throws InterruptedException {
- if (!field.exists())
- return;
- String oldName = field.getElementName();
- if (oldName.equals(newName))
- return;
- try {
- RenameSupport s = RenameSupport.create(field,
- isMethodAnnotated ? JPAEditorUtil.decapitalizeFirstLetter(newName) : newName,
- RenameSupport.UPDATE_REFERENCES);
- try {
- IWorkbenchWindow ww = JPADiagramEditorPlugin.getDefault()
- .getWorkbench().getActiveWorkbenchWindow();
- Shell sh = ww.getShell();
- s.perform(sh, ww);
- } catch (InvocationTargetException e) {
- JPADiagramEditorPlugin.logError("Cannot rename the field of the attribute " + oldName, e); //$NON-NLS-1$
- }
- } catch (CoreException e1) {
- JPADiagramEditorPlugin.logError("Cannot rename the field of the attribute " + oldName, e1); //$NON-NLS-1$
- }
- }
-
- private void renameGetter(IMethod getter, String newName) throws InterruptedException {
- if (!getter.exists())
- return;
- String oldName = getter.getElementName();
- String getterType = null;
- try {
- getterType = getter.getReturnType();
- } catch (JavaModelException e2) {
- JPADiagramEditorPlugin.logError("Can't obtain getter type", e2); //$NON-NLS-1$
- }
- String newGetterName = ("Z".equals(getterType) ? "is" : "get") + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- JPAEditorUtil.capitalizeFirstLetter(newName);
- if (oldName.equals(newGetterName))
- return;
- try {
- RenameSupport s = RenameSupport.create(getter, newGetterName,
- RenameSupport.UPDATE_REFERENCES);
- try {
- IWorkbenchWindow ww = JPADiagramEditorPlugin.getDefault()
- .getWorkbench().getActiveWorkbenchWindow();
- Shell sh = ww.getShell();
- s.perform(sh, ww);
- } catch (InvocationTargetException e) {
- JPADiagramEditorPlugin.logError("Cannot rename the getter of the attribute " + oldName, e); //$NON-NLS-1$
- }
- } catch (CoreException e1) {
- JPADiagramEditorPlugin.logError("Cannot rename the getter of the attribute " + oldName, e1); //$NON-NLS-1$
- }
- }
-
- private void renameSetter(IMethod setter, String newName) throws InterruptedException {
- if (!setter.exists())
- return;
- String oldName = setter.getElementName();
- String newSetterName = "set" //$NON-NLS-1$
- + JPAEditorUtil.capitalizeFirstLetter(newName);
- if (oldName.equals(newSetterName))
- return;
- try {
- RenameSupport s = RenameSupport.create(setter, newSetterName,
- RenameSupport.UPDATE_REFERENCES);
- try {
- IWorkbenchWindow ww = JPADiagramEditorPlugin.getDefault()
- .getWorkbench().getActiveWorkbenchWindow();
- Shell sh = ww.getShell();
- s.perform(sh, ww);
- } catch (InvocationTargetException e) {
- JPADiagramEditorPlugin.logError("Cannot rename the setter of the attribute " + oldName, e); //$NON-NLS-1$
- }
- } catch (CoreException e1) {
- JPADiagramEditorPlugin.logError("Cannot rename the setter of the attribute " + oldName, e1); //$NON-NLS-1$
- }
- }
-
- private IRelation produceRelation(JavaPersistentAttribute persistentAttribite, Annotation an,
- JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) {
-
- Hashtable<JavaPersistentAttribute, Annotation> ht = getRelAttributeAnnotation(
- persistentAttribite, relJPT);
- if (ht == null) {
- return produceUniDirRelation((JavaPersistentType)persistentAttribite
- .getParent(), persistentAttribite, an, relJPT, fp);
- } else {
- JavaPersistentAttribute relAt = ht.keys().nextElement();
- Annotation relAn = ht.get(relAt);
- return produceBiDirRelation((JavaPersistentType)persistentAttribite
- .getParent(), persistentAttribite, an, relJPT,
- relAt, relAn, fp);
- }
-
- }
-
- private Hashtable<JavaPersistentAttribute, Annotation> getRelAttributeAnnotation(
- JavaPersistentAttribute jpa, JavaPersistentType relJPT) {
-
- JavaPersistentType jpt = (JavaPersistentType)jpa.getParent();
- JpaArtifactFactory.instance().refreshEntityModel(null, jpt);
- for (JavaPersistentAttribute relEntAt : relJPT.getAttributes()) {
- IResource r = relEntAt.getParent().getResource();
- if (!r.exists())
- throw new RuntimeException();
- JavaResourceAttribute relJRA = relEntAt.getResourceAttribute();
- Annotation[] ans = this.getAnnotations(relEntAt);
- for (Annotation an : ans) {
- String annotationName = JPAEditorUtil.returnSimpleName(an.getAnnotationName());
- if (JPAEditorConstants.RELATION_ANNOTATIONS.contains(annotationName)) {
- String relTypeName = getRelTypeName((RelationshipMappingAnnotation)an, relJRA);
- if (!relTypeName.equals(jpt.getName()))
- continue;
- JavaAttributeMapping mp = relEntAt.getMapping();
- if(mp.getMappingAnnotation() == null) {
- JpaArtifactFactory.instance().refreshEntityModel(null, (JavaPersistentType)relEntAt.getParent());
- mp = relEntAt.getMapping();
- }
- if (!OwnableRelationshipMappingAnnotation.class.isInstance(mp.getMappingAnnotation()))
- continue;
- String mappedBy = ((OwnableRelationshipMappingAnnotation)mp.getMappingAnnotation()).getMappedBy();
- if (!jpa.getName().equals(mappedBy))
- continue;
- Hashtable<JavaPersistentAttribute, Annotation> ht = new Hashtable<JavaPersistentAttribute, Annotation>();
- ht.put(relEntAt, an);
- return ht;
- }
- }
- }
- return null;
- }
-
-
- /*
- ASTNode nd = jrpa.getMember().getModifiedDeclaration()
- .getDeclaration();
- String annotationName = null;
- if ((nd instanceof MethodDeclaration)
- || (nd instanceof FieldDeclaration)) {
- ListIterator<?> modfs = ((BodyDeclaration) nd).modifiers()
- .listIterator();
- while (modfs.hasNext()) {
- Object modf = modfs.next();
- if (modf instanceof Annotation) {
- Annotation an = (Annotation)modf;
- annotationName = an.getTypeName()
- .getFullyQualifiedName();
- annotationName = annotationName
- .substring(annotationName.lastIndexOf('.') + 1);
- if (JPAEditorConstants.RELATION_ANNOTATIONS
- .contains(annotationName)) {
- String relTypeName = getRelTypeName(an, jrpa);
- if (!relTypeName.equals(jpt.getName()))
- continue;
- JavaAttributeMapping mp = at.getSpecifiedMapping();
- if (!OwnableRelationshipMappingAnnotation.class.isInstance(mp.getMappingAnnotation()))
- continue;
- String mappedBy = ((OwnableRelationshipMappingAnnotation)mp.getMappingAnnotation()).getMappedBy();
- if (!jpa.getName().equals(mappedBy))
- continue;
- Hashtable<JavaPersistentAttribute, Annotation> ht = new Hashtable<JavaPersistentAttribute, Annotation>();
- ht.put(at, an);
- return ht;
- }
- }
- }
- }
- */
-
- private UnidirectionalRelation produceUniDirRelation(
- JavaPersistentType jpt, JavaPersistentAttribute at, Annotation an,
- JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) {
-
- if (isNonOwner(at) || !JPAEditorUtil.getCompilationUnit((JavaPersistentType) at.getParent()).exists())
- return null;
- String annotationName = JPAEditorUtil.returnSimpleName(an.getAnnotationName());
- UnidirectionalRelation res = null;
- String attrName = at.getName();
- if (annotationName.equals(JPAEditorConstants.ANNOTATION_ONE_TO_ONE)) {
- if (!fp.doesRelationExist(jpt, relJPT, attrName, RelType.ONE_TO_ONE,
- RelDir.UNI))
- res = new OneToOneUniDirRelation(fp, jpt, relJPT, attrName, false,
- fp.getCompilationUnit(jpt), fp
- .getCompilationUnit(relJPT));
- } else if (annotationName
- .equals(JPAEditorConstants.ANNOTATION_ONE_TO_MANY)) {
- if (!fp.doesRelationExist(jpt, relJPT, attrName, RelType.ONE_TO_MANY,
- RelDir.UNI))
- res = new OneToManyUniDirRelation(fp, jpt, relJPT, attrName, false,
- fp.getCompilationUnit(jpt), fp
- .getCompilationUnit(relJPT));
- } else if (annotationName
- .equals(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) {
- if (!fp.doesRelationExist(jpt, relJPT, attrName, RelType.MANY_TO_ONE,
- RelDir.UNI))
- res = new ManyToOneUniDirRelation(fp, jpt, relJPT, attrName, false,
- fp.getCompilationUnit(jpt), fp
- .getCompilationUnit(relJPT));
- } else if (annotationName
- .equals(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)) {
- if (!fp.doesRelationExist(jpt, relJPT, attrName, RelType.MANY_TO_MANY,
- RelDir.UNI))
- res = new ManyToManyUniDirRelation(fp, jpt, relJPT, attrName,
- false, fp.getCompilationUnit(jpt), fp
- .getCompilationUnit(relJPT));
- }
- if (res != null)
- res.setAnnotatedAttribute(at);
- return res;
- }
-
- private BidirectionalRelation produceBiDirRelation(JavaPersistentType jpt,
- JavaPersistentAttribute at, Annotation an,
- JavaPersistentType relJPT, JavaPersistentAttribute relAt,
- Annotation relAn, IJPAEditorFeatureProvider fp) {
- JpaArtifactFactory.instance().refreshEntityModel(null, (JavaPersistentType)relAt.getParent());
- String annotationName = JPAEditorUtil.returnSimpleName(an.getAnnotationName());
- String relAnnotationName = JPAEditorUtil.returnSimpleName(relAn.getAnnotationName());
- if (!annotationNamesMatch(annotationName, relAnnotationName))
- return null;
- if (annotationName.equals(JPAEditorConstants.ANNOTATION_ONE_TO_MANY))
- return produceBiDirRelation(relJPT, relAt, relAn, jpt, at, an, fp);
- if (isNonOwner(at) && isNonOwner(relAt))
- return null;
- if (annotationName.equals(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) {
- if (isNonOwner(at) || !isNonOwner(relAt))
- return null;
- }
- if (annotationName.equals(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)) {
- if (!isNonOwner(at) && !isNonOwner(relAt))
- return null;
- if (isNonOwner(at))
- return produceBiDirRelation(relJPT, relAt, relAn, jpt, at, an,
- fp);
- }
- String ownerAttrName = at.getName();
- String inverseAttrName = relAt.getName();
-
- JavaAttributeMapping m = relAt.getMapping();
-
- if ((m != null)){
- if (m.getMappingAnnotation()==null) {
- JpaArtifactFactory.instance().refreshEntityModel(null, (JavaPersistentType)relAt.getParent());
- m = relAt.getMapping();
- }
- if(m.getMappingAnnotation() instanceof OwnableRelationshipMappingAnnotation) {
-
- String mappedBy = ((OwnableRelationshipMappingAnnotation)m.getMappingAnnotation()).getMappedBy();
- if (mappedBy == null)
- return null;
- if (!mappedBy.equals(ownerAttrName))
- return null;
- }
- }
-
- BidirectionalRelation res = null;
- if (annotationName.equals(JPAEditorConstants.ANNOTATION_ONE_TO_ONE)) {
- if (!fp.doesRelationExist(jpt, relJPT, ownerAttrName, RelType.ONE_TO_ONE,
- RelDir.BI))
- res = new OneToOneBiDirRelation(fp, jpt, relJPT, ownerAttrName,
- inverseAttrName, false, fp.getCompilationUnit(jpt), fp
- .getCompilationUnit(relJPT));
- } else if (annotationName
- .equals(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) {
- if (!fp.doesRelationExist(jpt, relJPT, ownerAttrName, RelType.MANY_TO_ONE,
- RelDir.BI))
- res = new ManyToOneBiDirRelation(fp, jpt, relJPT, ownerAttrName,
- inverseAttrName, false, fp.getCompilationUnit(jpt), fp
- .getCompilationUnit(relJPT));
- } else if (annotationName
- .equals(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)) {
- if (!fp.doesRelationExist(jpt, relJPT, ownerAttrName, RelType.MANY_TO_MANY,
- RelDir.BI))
- res = new ManyToManyBiDirRelation(fp, jpt, relJPT, ownerAttrName,
- inverseAttrName, false, fp.getCompilationUnit(jpt), fp
- .getCompilationUnit(relJPT));
- }
- if (res != null) {
- res.setOwnerAnnotatedAttribute(at);
- res.setInverseAnnotatedAttribute(relAt);
- }
- return res;
- }
-
- private boolean annotationNamesMatch(String an1Name, String an2Name) {
- if (an1Name.equals(JPAEditorConstants.ANNOTATION_ONE_TO_ONE)
- && an2Name.equals(JPAEditorConstants.ANNOTATION_ONE_TO_ONE)) {
- return true;
- } else if (an1Name.equals(JPAEditorConstants.ANNOTATION_ONE_TO_MANY)
- && an2Name.equals(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) {
- return true;
- } else if (an1Name.equals(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)
- && an2Name.equals(JPAEditorConstants.ANNOTATION_ONE_TO_MANY)) {
- return true;
- } else if (an1Name.equals(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)
- && an2Name.equals(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)) {
- return true;
- }
- return false;
- }
-
- private String genGetterContents(String attrName, String attrType,
- String[] attrTypeElementNames, String actName,
- List<String> annotations, boolean isCollection) {
-
- String attrNameWithCapitalA = actName.substring(0, 1).toUpperCase(Locale.ENGLISH)
- + actName.substring(1);
- String contents = ""; //$NON-NLS-1$
- if (annotations != null) {
- Iterator<String> it = annotations.iterator();
- while (it.hasNext()) {
- String an = it.next();
- contents += " " + an + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (isCollection) {
- contents += " public Collection<"+ attrType + "> get" + attrNameWithCapitalA + "() {\n" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- " return " //$NON-NLS-1$
- + JPAEditorUtil.decapitalizeFirstLetter(actName) + ";\n" + //$NON-NLS-1$
- " }\n"; //$NON-NLS-1$
- } else {
- contents += " public "+ attrType + //$NON-NLS-1$
- ((attrTypeElementNames == null)?"":("<" + JPAEditorUtil.createCommaSeparatedListOfSimpleTypeNames(attrTypeElementNames) + ">")) + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- (attrType.equals("boolean") ? " is" : " get") + attrNameWithCapitalA + "() {\n" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- " return " //$NON-NLS-1$
- + JPAEditorUtil.decapitalizeFirstLetter(actName) + ";\n" + //$NON-NLS-1$
- " }\n"; //$NON-NLS-1$
- }
- return contents;
- }
-
- private String genSetterContents(String attrName, String attrType,
- String[] attrTypeElementNames, String actName, boolean isCollection) {
-
- String attrNameWithCapitalA = actName.substring(0, 1).toUpperCase(Locale.ENGLISH)
- + actName.substring(1);
- String contents = ""; //$NON-NLS-1$
- if (isCollection) {
- contents = " public void set" + attrNameWithCapitalA + "(Collection<" + attrType + "> param) " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "{\n" + //$NON-NLS-1$
- " this." //$NON-NLS-1$
- + JPAEditorUtil.decapitalizeFirstLetter(actName)
- + " = param;\n" + //$NON-NLS-1$
- " }\n"; //$NON-NLS-1$
- } else {
- contents = " public void set" + attrNameWithCapitalA + "(" + attrType + //$NON-NLS-1$ //$NON-NLS-2$
- ((attrTypeElementNames == null)?"":("<" + JPAEditorUtil.createCommaSeparatedListOfSimpleTypeNames(attrTypeElementNames) + ">")) + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- " param) {\n" //$NON-NLS-1$
- +
- " this." //$NON-NLS-1$
- + JPAEditorUtil.decapitalizeFirstLetter(actName)
- + " = param;\n" + //$NON-NLS-1$
- " }\n"; //$NON-NLS-1$
- }
- return contents;
- }
-
- private String genGetterWithAppropriateType(String attrName, String attrType,
- String actName, String type) {
- return genGetterWithAppropriateType(attrName, null, attrType,
- actName, type);
- }
-
-
- private String genGetterWithAppropriateType(String attrName, String mapKeyType, String attrType,
- String actName, String type) {
-
- String attrNameWithCapitalA = actName.substring(0, 1).toUpperCase(
- Locale.ENGLISH)
- + actName.substring(1);
- String contents = " public " + JPAEditorUtil.returnSimpleName(type) + //$NON-NLS-1$
- "<" + ((mapKeyType != null) ? (mapKeyType + ", ") : "") + attrType + "> " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "get" + attrNameWithCapitalA + "() {\n" + //$NON-NLS-1$ //$NON-NLS-2$
- " return " //$NON-NLS-1$
- + JPAEditorUtil.decapitalizeFirstLetter(actName) + ";\n" + //$NON-NLS-1$
- " }\n"; //$NON-NLS-1$
- return contents;
- }
-
- private String genSetterWithAppropriateType(String attrName, String attrType,
- String actName, String type) {
- return genSetterWithAppropriateType(attrName, null, attrType,
- actName, type);
- }
-
- private String genSetterWithAppropriateType(String attrName, String mapKeyType, String attrType,
- String actName, String type) {
-
- String attrNameWithCapitalA = actName.substring(0, 1).toUpperCase(
- Locale.ENGLISH)
- + actName.substring(1);
- String contents = " public void set" + attrNameWithCapitalA + //$NON-NLS-1$
- "(" + JPAEditorUtil.returnSimpleName(type) + //$NON-NLS-1$
- "<" + ((mapKeyType != null) ? (mapKeyType + ", ") : "") + attrType + "> param) " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "{\n" + //$NON-NLS-1$
- " this." //$NON-NLS-1$
- + JPAEditorUtil.decapitalizeFirstLetter(actName)
- + " = param;\n" + //$NON-NLS-1$
- " }\n"; //$NON-NLS-1$
- return contents;
- }
-
- /*
- private String returnSimpleName(String input) {
- String name = input;
- if (name.lastIndexOf('.') != -1) {
- name = name.substring(name.lastIndexOf('.') + 1);
- }
- return name;
- }
- */
-
- private JavaPersistentAttribute getAttributeFromEntity(
- JavaPersistentType jpt, String attributeName) {
- this.refreshEntityModel(null, jpt);
- PersistentAttribute at = jpt.getAttributeNamed(attributeName);
- if (at == null) {
- jpt.getJavaResourceType().synchronizeWith(jpt.getJavaResourceType().getJavaResourceCompilationUnit().buildASTRoot());
- jpt.update();
- }
- int c = 0;
- while ((at == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- try {
- Thread.sleep(PAUSE_DURATION);
- } catch (InterruptedException e) {
- JPADiagramEditorPlugin.logError("Cannot get the attribute " + //$NON-NLS-1$
- attributeName + " from " + jpt.getName(), e); //$NON-NLS-1$
- }
- at = jpt.getAttributeNamed(attributeName);
- c++;
- }
- return (JavaPersistentAttribute)at;
- }
-
- private boolean doesAttributeExist(JavaPersistentType jpt, String name)
- throws JavaModelException {
- boolean exists = false;
- if (jpt.resolveAttribute(name) != null) {
- return true;
- }
- return exists;
- }
-
- public JavaResourceType convertJPTToJRT(JavaPersistentType jpt) {
- if (jpt == null)
- return null;
- return (JavaResourceType) jpt.getJpaProject().getJavaResourceType(jpt.getName(), Kind.TYPE);
- }
-
- public PersistenceUnit getPersistenceUnit(JpaFile jpaFile) {
- JpaProject jpaProject = jpaFile.getJpaProject();
- if (jpaProject == null)
- return null;
- return getPersistenceUnit(jpaProject);
- }
-
- public PersistenceUnit getPersistenceUnit(JpaProject project) {
- if(project.getRootContextNode().getPersistenceXml() == null)
- return null;
- return project.getRootContextNode().getPersistenceXml().getPersistence()
- .getPersistenceUnits().iterator().next();
- }
-
- public PersistenceUnit getPersistenceUnit(JavaPersistentType jpt) {
- return jpt.getPersistenceUnit();
- }
-
- public boolean isMethodAnnotated(JavaPersistentAttribute attr) {
- return attr.getResourceAttribute().getKind() == Kind.METHOD;
- }
-
- public boolean isMethodAnnotated(JavaPersistentType jpt) {
- ListIterator<JavaPersistentAttribute> li = jpt.getAttributes().iterator();
- if (!li.hasNext())
- return false;
- return (isMethodAnnotated(li.next()));
- }
-
- public void remakeRelations(IJPAEditorFeatureProvider fp,
- ContainerShape cs, JavaPersistentType jpt) {
- if (cs == null)
- cs = (ContainerShape)fp.getPictogramElementForBusinessObject(jpt);
- if (cs == null)
- return;
- removeOldRelations(fp, cs);
- addNewRelations(fp, jpt);
- }
-
- public String getTableName(JavaPersistentType jpt) {
- if (jpt == null)
- return null;
- JavaResourceType jrt = convertJPTToJRT(jpt);
- if (jrt == null)
- return null;
- TableAnnotation tan = (TableAnnotation)jrt.getAnnotation("javax.persistence.Table"); //$NON-NLS-1$
- String tableName = null;
- if (tan == null){
- tableName = JPAEditorUtil.returnSimpleName(jpt.getName());
- } else {
- tableName = tan.getName();
- }
- if (tableName == null)
- tableName = JPAEditorUtil.returnSimpleName(jpt.getName());
- return tableName;
- }
-
-
- public void setTableName(JavaPersistentType jpt, String tableName) {
- if (jpt == null)
- return;
- JavaResourceType jrt = convertJPTToJRT(jpt);
- if (jrt == null) {
- return;
- }
- TableAnnotation ta = (TableAnnotation)jrt.getAnnotation("javax.persistence.Table"); //$NON-NLS-1$
- if (ta != null)
- ta.setName(tableName);
- }
-
- /*
- private Object extractAnnotationMemberValue(Annotation an, String memberName) {
-
- an.
-
- IMemberValuePair[] mvps;
- try {
- mvps = an.getMemberValuePairs();
- } catch (JavaModelException e) {
- tracer.error("Can't get annotation members", e); //$NON-NLS-1$
- return null;
- }
- for (IMemberValuePair mvp : mvps) {
- if (mvp.getMemberName().equals(memberName)) {
- return mvp.getValue();
- }
- }
- return null;
- }
- */
-
- private void removeOldRelations(IJPAEditorFeatureProvider fp,
- ContainerShape cs) {
- Set<IRemoveContext> ctxs = new HashSet<IRemoveContext>();
- Iterator<Connection> iter = Graphiti.getPeService().getAllConnections(cs).iterator();
- while (iter.hasNext()) {
- Connection conn = iter.next();
- IRemoveContext ctx = new RemoveContext(conn);
- ctxs.add(ctx);
- }
- Iterator<IRemoveContext> itCtx = ctxs.iterator();
- while (itCtx.hasNext()) {
- IRemoveContext ctx = itCtx.next();
- RemoveRelationFeature ft = new RemoveRelationFeature(fp);
- ft.remove(ctx);
- }
- }
-
- private void addNewRelations(IJPAEditorFeatureProvider fp,
- JavaPersistentType jpt) {
-
- Collection<IRelation> selfRels = new HashSet<IRelation>();
- Collection<IRelation> newRels = JpaArtifactFactory.instance()
- .produceAllRelations(jpt, fp);
- Iterator<IRelation> relsIt = newRels.iterator();
- while (relsIt.hasNext()) {
- IRelation rel = relsIt.next();
- if (rel.getOwner() == rel.getInverse()) {
- selfRels.add(rel);
- continue;
- }
- addNewRelation(fp, rel);
- }
- relsIt = selfRels.iterator();
- while (relsIt.hasNext()) {
- IRelation rel = relsIt.next();
- addNewRelation(fp, rel);
- }
- }
-
- private void addNewRelation(IJPAEditorFeatureProvider fp, IRelation rel) {
- AddConnectionContext ctx = new AddConnectionContext(JPAEditorUtil
- .getAnchor(rel.getOwner(), fp), JPAEditorUtil.getAnchor(rel
- .getInverse(), fp));
- ctx.setNewObject(rel);
- ctx.setTargetContainer(fp.getDiagramTypeProvider().getDiagram());
- refreshEntityModel(fp, rel.getOwner());
- refreshEntityModel(fp, rel.getInverse());
- AddRelationFeature ft = new AddRelationFeature(fp);
- ft.add(ctx);
- }
-
- private String getRelTypeName(RelationshipMappingAnnotation an,
- JavaResourceAttribute jra) {
- String relTypeName = null;
- try {
- boolean isMap = jra.getTypeName().equals("java.util.Map"); //$NON-NLS-1$
- relTypeName = jra.getTypeTypeArgumentName(isMap ? 1 : 0);
- } catch (Exception e) {}
- if (relTypeName == null)
- relTypeName = an.getFullyQualifiedTargetEntityClassName();
- if (relTypeName == null)
- relTypeName = JPAEditorUtil.getAttributeTypeName(jra);
- return relTypeName;
- }
-
- public JpaProject getJpaProject(IProject project) throws CoreException {
- return JptJpaCorePlugin.getJpaProject(project);
- }
-
- public String getIdType(JavaPersistentType jpt) {
- IdClassAnnotation an = (IdClassAnnotation)jpt.getJavaResourceType().getAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- if (an != null)
- return an.getFullyQualifiedClassName();
- JavaPersistentAttribute[] ids = getIds(jpt);
- if (ids.length == 0)
- return null;
- String type = ids[0].getTypeName();
- String wrapper = JPAEditorUtil.getPrimitiveWrapper(type);
- return (wrapper != null) ? wrapper : type;
- }
-
- public JavaPersistentAttribute[] getIds(JavaPersistentType jpt) {
- ArrayList<JavaPersistentAttribute> res = new ArrayList<JavaPersistentAttribute>();
- for (JavaPersistentAttribute at : jpt.getAttributes()) {
- if (isId(at))
- res.add(at);
- }
- JavaPersistentAttribute[] ret = new JavaPersistentAttribute[res.size()];
- return res.toArray(ret);
- }
-
- public boolean isId(JavaPersistentAttribute jpa) {
- return isSimpleId(jpa) || isEmbeddedId(jpa);
- }
-
- public boolean isSimpleId(JavaPersistentAttribute jpa) {
- IdAnnotation an = (IdAnnotation)jpa.getResourceAttribute().getAnnotation(IdAnnotation.ANNOTATION_NAME);
- return (an != null);
- }
-
- public boolean isEmbeddedId(JavaPersistentAttribute jpa) {
- EmbeddedIdAnnotation an = (EmbeddedIdAnnotation)jpa.getResourceAttribute().getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME);
- return (an != null);
- }
-
- public String getColumnName(JavaPersistentAttribute jpa) {
- String columnName= null;
- ColumnAnnotation an = (ColumnAnnotation)jpa.
- getResourceAttribute().
- getAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- if (an != null)
- columnName = an.getName();
- if (columnName == null)
- columnName = jpa.getName();
- return columnName;
- }
-
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/PeServiceUtilImpl.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/PeServiceUtilImpl.java
deleted file mode 100644
index c9dc29cf42..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/PeServiceUtilImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.PropertyContainer;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.services.Graphiti;
-
-public class PeServiceUtilImpl implements IPeServiceUtil {
-
- public FreeFormConnection createFreeFormConnection(Diagram diagram) {
- return Graphiti.getPeService().createFreeFormConnection(diagram);
- }
-
- public String getPropertyValue(PropertyContainer propertyContainer, String key) {
- return Graphiti.getPeService().getPropertyValue(propertyContainer, key);
- }
-
- public Property getProperty(PropertyContainer propertyContainer, String key) {
- return Graphiti.getPeService().getProperty(propertyContainer, key);
- }
-
- public boolean removeProperty(PropertyContainer propertyContainer, String key) {
- return Graphiti.getPeService().removeProperty(propertyContainer, key);
- }
-
- public void setPropertyValue(PropertyContainer propertyContainer, String key, String value) {
- Graphiti.getPeService().setPropertyValue(propertyContainer, key, value);
- }
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/ResourceChangeListener.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/ResourceChangeListener.java
deleted file mode 100644
index 7e3482a80e..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/ResourceChangeListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-public class ResourceChangeListener implements IResourceChangeListener {
-
- public void resourceChanged(IResourceChangeEvent event) {
- IMarkerDelta[] markerDeltas = event.findMarkerDeltas(null, true);
-
- for (IMarkerDelta delta : markerDeltas) {
- if (delta.getResource().getType() != IResource.FILE)
- continue;
- if (delta.getKind() != IResourceDelta.REMOVED)
- continue;
- final IFile file = (IFile) delta.getResource();
- if (file.exists())
- continue;
- final IProject project = file.getProject();
- final String name = project.getName();
- if (file.getFullPath().equals(ModelIntegrationUtil.getDiagramXMLFullPath(name))) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- IWorkbenchPage workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorReference[] editorRefs = workbenchPage.getEditorReferences();
- for (IEditorReference editorRef : editorRefs) {
- if(!JPADiagramEditorPlugin.PLUGIN_ID.equals(editorRef.getId()))
- continue;
- if (name.equals(editorRef.getName()))
- continue;
- IEditorPart editor = editorRef.getEditor(false);
- if (editor == null)
- continue;
- workbenchPage.closeEditor(editor, false);
- break;
- }
- }
- });
-
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/SizePosition.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/SizePosition.java
deleted file mode 100644
index c97012cdc8..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/SizePosition.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-public class SizePosition {
-
- private int width;
- private int height;
- private int x;
- private int y;
-
- public boolean primaryCollapsed;
- public boolean basicCollapsed;
- public boolean relationCollapsed;
-
- public SizePosition(int width, int height, int x, int y) {
- this.width = width;
- this.height = height;
- this.x = x;
- this.y = y;
- }
-
- public int getWidth() {
- return width;
- }
-
- public int getHeight() {
- return height;
- }
-
- public int getX() {
- return x;
- }
-
- public int getY() {
- return y;
- }
-
-
-}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/Wrp.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/Wrp.java
deleted file mode 100644
index 16ffe816ca..0000000000
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/Wrp.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;
-
-public class Wrp {
- private Object obj;
-
- public Wrp() {}
-
- public void setObj(Object obj) {
- this.obj = obj;
- }
-
- public Object getObj() {
- return obj;
- }
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.classpath b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.classpath
deleted file mode 100644
index 4bf00ce327..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpadiagrameditor/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.cvsignore b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.project b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.project
deleted file mode 100644
index fd5f56209d..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpadiagrameditor.ui.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.settings/org.eclipse.jdt.core.prefs b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b7176b3cc1..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Wed Mar 09 10:22:22 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/META-INF/MANIFEST.MF b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 5c6885618e..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,39 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpadiagrameditor.ui.tests;singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Activator: org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPAEditorTestsActivator
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.easymock;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)",
- org.eclipse.emf.transaction;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gef;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.graphiti;bundle-version="[0.8.0,1.0.0)",
- org.eclipse.graphiti.ui;bundle-version="[0.8.0,1.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.ui;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpadiagrameditor.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.2.1,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.junit4;bundle-version="[4.8.1,5.0.0)",
- org.eclipse.core.filesystem;bundle-version="[1.3.1,2.0.0)"
-Export-Package: org.eclipse.jpt.jpadiagrameditor.ui.tests.internal;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.editor;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.listener;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.modelintegration.ui;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.modelintegration.util;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.preferences;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.provider;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.relation;x-internal:=true,
- org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util;x-internal:=true
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/about.html b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/build.properties b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/build.properties
deleted file mode 100644
index 59add7e2ec..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2011 SAP AG. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/plugin.properties b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/plugin.properties
deleted file mode 100644
index b5bcd87dcc..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/plugin.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - JPA Diagram Editor JUnit Tests
-providerName = Eclipse Web Tools Platform \ No newline at end of file
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/pom.xml b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/pom.xml
deleted file mode 100644
index 3acda23ff8..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>org.eclipse.jpt.jpadiagrameditor_parent</artifactId>
- <groupId>org.eclipse.jpt.jpadiagrameditor</groupId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>../../development/org.eclipse.jpt.jpadiagrameditor.releng/pom.xml</relativePath>
- </parent>
-
- <artifactId>org.eclipse.jpt.ui.diagrameditor.test</artifactId>
- <packaging>eclipse-test-plugin</packaging>
- <name>JPA Diagram Editor Test Plug-in</name>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>maven-osgi-test-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <testSuite>org.eclipse.jpt.jpadiagrameditor.tests</testSuite>
- <testClass>org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.AllJpaEditorTests</testClass>
- <useUIHarness>true</useUIHarness>
- <useUIThread>true</useUIThread>
- <argLine>-Xms128m -Xmx512m -XX:MaxPermSize=256m</argLine>
- <product>org.eclipse.sdk.ide</product>
- <application>org.eclipse.ui.ide.workbench</application>
- <dependencies>
- <dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.eclipse.sdk.ide</artifactId>
- <version>0.0.0</version>
- </dependency>
- </dependencies>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project> \ No newline at end of file
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/AllJpaEditorTests.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/AllJpaEditorTests.java
deleted file mode 100644
index 779e2d6388..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/AllJpaEditorTests.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal;
-
-import java.io.File;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.editor.CreateDiagramTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.editor.EditorTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature.AddAttributeFeatureTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature.AddJPAEntityFeatureTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature.AddRelationFeatureTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature.DeleteRelationFeatureTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature.DirectEditAttributeFeatureTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature.LayoutEntityFeatureTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.modelintegration.util.ModelIntegrationUtilTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.preferences.JPAEditorPreferenceInitializerTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.preferences.JPAEditorPreferencesPageTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.provider.JPAEditorToolBehaviorProviderTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util.JPAEditorUtilTest;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util.JPASolverTest;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-/**
- * AllJpaEditorTests
- *
- * Required Java system properties:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-
-@RunWith(Suite.class)
-@SuiteClasses( {
-// CreateDiagramTest.class,
- JPAEditorPreferenceInitializerTest.class,
- JPAEditorPreferencesPageTest.class,
- AddJPAEntityFeatureTest.class,
-// ClickAddFeatureTest.class,
-// CreateDeleteEntity.class,
- DirectEditAttributeFeatureTest.class,
- EditorTest.class,
- JPAEditorToolBehaviorProviderTest.class,
- JPAEditorUtilTest.class,
- JPASolverTest.class,
-// OpenMiniatureViewFeatureTest.class,
-// RefactorAttributeTypeFeatureTest.class,
-// SaveEntityFeatureTest.class,
- AddRelationFeatureTest.class,
- AddAttributeFeatureTest.class,
-// CreateDeleteOnlyAttributeTest.class,
-// JPAProjectListenerTest.class,
-// ModelIntegrationTest.class,
- ModelIntegrationUtilTest.class,
- LayoutEntityFeatureTest.class,
- DeleteRelationFeatureTest.class,
-// CreateRelationsTest.class
- })
-
-public class AllJpaEditorTests {
-
- /**
- * This check is necessary to abort the test suite in the build
- * when the environment is not setup properly.
- *
- * @throws NoSuchElementException
- */
- @BeforeClass
- public static void verifyRequiredJarsExists() throws NoSuchElementException {
- verifyJpaJarExists();
- verifyEclipseLinkJarExists();
- }
-
- private static void verifyJpaJarExists() throws NoSuchElementException {
- verifyRequiredPropertyExists(JPACreateFactory.JPA_JAR_NAME_SYSTEM_PROPERTY);
- verifyRequiredFileExists(JPACreateFactory.JPA_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- private static void verifyEclipseLinkJarExists() throws NoSuchElementException {
- verifyRequiredPropertyExists(JPACreateFactory.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- verifyRequiredFileExists(JPACreateFactory.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- private static void verifyRequiredPropertyExists(String propertyName) throws NoSuchElementException {
- if(JPACreateFactory.getSystemProperty(propertyName) == null) {
- throw new NoSuchElementException(errorMissingProperty(propertyName));
- }
- }
-
- private static void verifyRequiredFileExists(String propertyName) throws NoSuchElementException {
- String fileName = JPACreateFactory.getSystemProperty(propertyName);
- if( ! (new File(fileName)).exists()) {
- throw new NoSuchElementException(errorJarFileDoesNotExist(fileName));
- }
- }
-
- private static String errorMissingProperty(String propertyName) {
- return "Missing Java system property: \"" + propertyName + "\"";
- }
-
- private static String errorJarFileDoesNotExist(String fileName) {
- return "JAR file doesn't exist: \"" + fileName + "\"";
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java
deleted file mode 100644
index 2704eb6efd..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java
+++ /dev/null
@@ -1,633 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.StringTokenizer;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-@SuppressWarnings("restriction")
-public class JPACreateFactory {
-
- public static final String JPA_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar";
- public static final String ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.eclipselink.jar";
-
- private static JPACreateFactory factory = null;
- private IFacetedProject facetedProject;
- private IProject project;
- private IJavaProject javaProject;
- //private IPackageFragmentRoot sourceFolder;
- JpaProject jpaProject;
-
- public static synchronized JPACreateFactory instance() {
- if (factory == null)
- factory = new JPACreateFactory();
- return factory;
- }
-
- private IProject buildPlatformProject(String projectName) throws CoreException {
- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
- description.setAutoBuilding(true);
- ResourcesPlugin.getWorkspace().setDescription(description);
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- p.create(null);
- p.open(null);
- return p;
- }
-
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = DataModelFactory.createDataModel(new JpaFacetInstallDataModelProvider());
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, "1.0");
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, null /*GenericPlatform.VERSION_1_0.getId()*/);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- public JpaProject createJPAProject(String projectName) throws CoreException {
- return createJPAProject(projectName, null, "1.0");
- }
-
- public JpaProject createJPA20Project(String projectName) throws CoreException {
- return createJPAProject(projectName, null, "2.0");
- }
-
-
- public JpaProject createJPAProject(String projectName, IDataModel jpaConfig, String jpaFacetVersion) throws CoreException {
- project = buildPlatformProject(projectName);
- javaProject = createJavaProject(project, true);
- if (jpaConfig != null) {
- jpaFacetVersion = jpaConfig.getStringProperty(IFacetDataModelProperties.FACET_VERSION_STR);
- }
- installFacet(facetedProject, "jst.utility", "1.0");
- installFacet(facetedProject, "jpt.jpa", jpaFacetVersion, jpaConfig);
- addJar(javaProject, jpaJarName());
- if (eclipseLinkJarName() != null) {
- addJar(javaProject, eclipseLinkJarName());
- }
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- jpaProject = JptJpaCorePlugin.getJpaProject(project);
- int cnt = 0;
- while ((jpaProject == null) && (cnt < 1000)){
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- jpaProject = JptJpaCorePlugin.getJpaProject(project);
- cnt++;
- }
- jpaProject.setDiscoversAnnotatedClasses(true);
-// jpaProject.setUpdater(new SynchronousJpaProjectUpdater(jpaProject));
- return jpaProject;
- }
-
- public static String eclipseLinkJarName() {
- return getSystemProperty(ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- public void installFacet(IFacetedProject facetedProject,
- String facetName,
- String versionName) throws CoreException {
- installFacet(facetedProject, facetName, versionName, null);
- }
-
- public void uninstallFacet(IFacetedProject facetedProject,
- String facetName,
- String versionName) throws CoreException {
- uninstallFacet(facetedProject, facetName, versionName, null);
- }
-
- /**
- * if 'config' is null (and 'facetName' is "jpt.jpa"), the JPA project will be built with the defaults
- * defined in JpaFacetInstallDataModelProvider#getDefaultProperty(String)
- */
- public void installFacet(IFacetedProject facetedProject,
- String facetName,
- String versionName,
- IDataModel config) throws CoreException {
- facetedProject.installProjectFacet(this.facetVersion(facetName, versionName), config, null);
- }
-
- public void uninstallFacet(IFacetedProject facetedProject,
- String facetName,
- String versionName,
- IDataModel config) throws CoreException {
- facetedProject.uninstallProjectFacet(this.facetVersion(facetName, versionName), config, null);
- }
-
- private IProjectFacetVersion facetVersion(String facetName, String versionName) {
- return ProjectFacetsManager.getProjectFacet(facetName).getVersion(versionName);
- }
-
- protected static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
- public void addJar(IJavaProject javaProject, String jarPath) throws JavaModelException {
- this.addClasspathEntry(javaProject, JavaCore.newLibraryEntry(new Path(jarPath), null, null));
- }
-
- private void addClasspathEntry(IJavaProject javaProject, IClasspathEntry entry) throws JavaModelException {
- javaProject.setRawClasspath(ArrayTools.add(javaProject.getRawClasspath(), entry), null);
- }
-
- private IFacetedProject createFacetedProject(IProject project) throws CoreException {
- return ProjectFacetsManager.create(project, true, null); // true = "convert if necessary"
- }
-
- public IJavaProject createJavaProject(IProject project,
- boolean autoBuild) throws CoreException {
- facetedProject = createFacetedProject(project);
- installFacet(facetedProject, "jst.java", "5.0");
- javaProject = JavaCore.create(project);
- //sourceFolder = javaProject.getPackageFragmentRoot(project.getFolder("src"));
- return javaProject;
- }
-
- public static String jpaJarName() {
- return getSystemProperty(JPA_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- public IFile createEntity(JpaProject jpaProject, String fullyQualifiedName) throws Exception {
- StringTokenizer tokenizer = new StringTokenizer(fullyQualifiedName, ".");
- ArrayList<String> nameElements = new ArrayList<String>();
- while(tokenizer.hasMoreElements()){
- nameElements.add(tokenizer.nextToken());
- }
- ArrayList<String> packageFragments = new ArrayList<String>();
- for(int i=0;i<nameElements.size()-1;i++){
- packageFragments.add(nameElements.get(i));
- }
- String[] packageStrings = new String[packageFragments.size()];
- for(int i=0;i<packageFragments.size();i++){
- packageStrings[i] = packageFragments.get(i);
- }
- String name = nameElements.get(Math.max(0, nameElements.size()-1));
-// SynchronousJpaProjectUpdater updater = new SynchronousJpaProjectUpdater(jpaProject);
-// updater.start();
- JpaRootContextNode jpaProjectContent = jpaProject.getRootContextNode();
- PersistenceXml persXML = jpaProjectContent.getPersistenceXml();
- int cnt = 0;
- while ((persXML == null) && (cnt < 100)) {
- Thread.sleep(250);
- persXML = jpaProjectContent.getPersistenceXml();
- cnt++;
- }
- if (persXML == null)
- throw new NullPointerException("The persistence XML is not created");
-
- IFile entity1 = createEntityInProject(jpaProject.getProject(), packageStrings, name);
- JavaResourceAbstractType jrpt = jpaProject.getJavaResourceType(fullyQualifiedName);
- cnt = 0;
- while((jrpt == null) && (cnt < 100)) {
- try {
- Thread.sleep(250);
- } catch (Exception e) {}
- jrpt = jpaProject.getJavaResourceType(fullyQualifiedName);
- cnt++;
- }
- if (jrpt == null)
- throw new NullPointerException("The entity '" + fullyQualifiedName + "' could not be created");
- return entity1;
- }
-
- public IFile createEntityInProject(IProject project,
- String[] packageFragments,
- String entityName) throws IOException,
- CoreException,
- JavaModelException {
- String folderName = getFolderName(project, packageFragments);
- String packageName = packageFragments[0];
- for (int i = 1; i < packageFragments.length; i++) {
- packageName += "." + packageFragments[i];
- }
-
- IPath path = new Path(folderName);
- IFolder folder = project.getFolder(path);
- return createEntity(folder, packageName , entityName);
- }
-
- @SuppressWarnings("deprecation")
- private String getFolderName(IProject project, String[] packageFragments)
- throws JavaModelException {
- IJavaProject javaProject = JavaCore.create(project);
- IPackageFragmentRoot[] packageFragmentRoots = new IPackageFragmentRoot[0];
- final IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
- for (IClasspathEntry classpathEntry : classpathEntries) {
- if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- packageFragmentRoots = javaProject.getPackageFragmentRoots(classpathEntry);
- break;
- }
- }
-
- String folderName = packageFragmentRoots[0].getResource().getName();
- for (String fragment : packageFragments) {
- folderName += Path.SEPARATOR + fragment;
- }
- return folderName;
- }
-
- private IFile createEntity(IFolder folder, String packageName, String entityName) throws IOException, CoreException {
- String entityShortName = entityName.substring(entityName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- createDirectories(folder, true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(entityShortName + ".java");
- if (!file.exists()) {
- String content = "package " + packageName + ";\n\n"
- + "import javax.persistence.*;\n\n"
- + "@Entity \n"
- + "public class " + entityShortName + " {\n"
- + " private int id;\n"
- + " @Id \n"
- + " public int getId() {\n"
- + " return id;\n"
- + " }\n"
- + " public void setId(int id) {\n"
- + " this.id = id;\n"
- + " }\n"
- + "}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()), true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
- public IFile createEntityWithCompositePKInProject(IProject project,
- String[] packageFragments, String entityName) throws IOException,
- CoreException, JavaModelException {
- String folderName = getFolderName(project, packageFragments);
-
- String packageName = packageFragments[0];
- for (int i = 1; i < packageFragments.length; i++) {
- packageName += "." + packageFragments[i];
- }
-
- IPath path = new Path(folderName);
- IFolder folder = project.getFolder(path);
- return createEntityWithCompositePK(folder, packageName, entityName);
- }
-
- public IFile createIdClassInProject(IProject project,
- String[] packageFragments, String entityName) throws IOException,
- CoreException, JavaModelException {
- String folderName = getFolderName(project, packageFragments);
-
- String packageName = packageFragments[0];
- for (int i = 1; i < packageFragments.length; i++) {
- packageName += "." + packageFragments[i];
- }
-
- IPath path = new Path(folderName);
- IFolder folder = project.getFolder(path);
- return createIdClass(folder, packageName, entityName);
- }
-
- public IFile createEmbeddedClassInProject(IProject project,
- String[] packageFragments, String entityName) throws IOException,
- CoreException, JavaModelException {
- String folderName = getFolderName(project, packageFragments);
-
- String packageName = packageFragments[0];
- for (int i = 1; i < packageFragments.length; i++) {
- packageName += "." + packageFragments[i];
- }
-
- IPath path = new Path(folderName);
- IFolder folder = project.getFolder(path);
- return createEmbeddedClass(folder, packageName, entityName);
- }
-
- public IFile createEntityWithEmbeddedPKInProject(IProject project,
- String[] packageFragments, String entityName) throws IOException,
- CoreException, JavaModelException {
- String folderName = getFolderName(project, packageFragments);
-
- String packageName = packageFragments[0];
- for (int i = 1; i < packageFragments.length; i++) {
- packageName += "." + packageFragments[i];
- }
-
- IPath path = new Path(folderName);
- IFolder folder = project.getFolder(path);
- return createEntityWithEmbeddedPK(folder, packageName, entityName);
- }
-
-
-
- private IFile createEntityWithCompositePK(IFolder folder, String packageName, String entityName) throws IOException, CoreException{
- String entityShortName = entityName.substring(entityName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- createDirectories(folder, true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(entityShortName + ".java");
- if (!file.exists()) {
- String content = "package " + packageName + ";\n\n"
- + "import javax.persistence.*;\n\n"
- + "@Entity \n"
- + "@IdClass("+entityShortName+"Id.class)"
- + "public class " + entityShortName + " {\n"
- + " @Id \n"
- + " private String firstName;\n"
- + " @Id \n"
- + " private String lastName;\n"
- + " public "+entityShortName+"Id() {}\n"
- + " public "+entityShortName+"Id(String firstName, String lastName)\n{"
- + " this.firstName = firstName;\n"
- + " this.lastName = lastName;\n"
- + " }\n"
- + "}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()), true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
- private IFile createIdClass(IFolder folder, String packageName, String entityName) throws IOException, CoreException{
- String entityShortName = entityName.substring(entityName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- createDirectories(folder, true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(entityShortName + "Id.java");
- if (!file.exists()) {
- String content = "package " + packageName + ";\n\n"
- + "import javax.persistence.*;\n\n"
- +"import java.io.Serializable;"
- + "public class " + entityShortName + "Id {\n"
- + " private String firstName;\n"
- + " private String lastName;\n"
- + " public String getFirstName() {\n"
- + " return firstName;\n"
- + " }\n"
- + " public void setFirstName(String firstName) {\n"
- + " this.firstName = firstName;\n"
- + " }\n"
- + " public String getLastName() {\n"
- + " return lastName;\n"
- + " }\n"
- + " public void setLastName(String lastName) {\n"
- + " this.lastName = lastName;\n"
- + " }\n"
- + "}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()), true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
- private IFile createEntityWithEmbeddedPK(IFolder folder, String packageName, String entityName) throws IOException, CoreException{
- String entityShortName = entityName.substring(entityName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- createDirectories(folder, true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(entityShortName + ".java");
- if (!file.exists()) {
- String content = "package " + packageName + ";\n\n"
- + "import javax.persistence.*;\n\n"
- + "@Entity\n"
- + "public class " + entityShortName + " {\n"
- + "@EmbeddedId\n"
- + " private "+ entityShortName +"Id id;\n"
- + "public void setId(" + entityShortName+ "Id param) {\n"
- + " this.id = param;\n"
- + "}\n"
- + "public "+entityShortName+"Id getId() {\n"
- + "return id;\n"
- + "}\n"
- + "}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()), true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
- private IFile createEmbeddedClass(IFolder folder, String packageName, String entityName) throws IOException, CoreException{
- String entityShortName = entityName.substring(entityName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- createDirectories(folder, true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(entityShortName + ".java");
- if (!file.exists()) {
- String content = "package " + packageName + ";\n\n"
- + "import javax.persistence.*;\n"
- + "@Embeddable\n"
- + "public class " + entityShortName + " {\n"
- +"private String firstName;\n"
- +"public String getFirstName() {\n"
- + " return firstName;\n"
- + "}\n"
- + "public void setFirstName(String firstName) {\n"
- + "this.firstName = firstName;\n"
- + "}\n"
- + "}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()), true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
-
- private void createDirectories(IContainer container, boolean force,
- boolean local, IProgressMonitor monitor) throws CoreException {
- if (container != null && container instanceof IFolder) {
- IFolder folder = (IFolder) container;
- if (!folder.exists()) {
- // depth first
- IContainer parent = folder.getParent();
- createDirectories(parent, force, local, null);
- // own second
- folder.create(force, local, monitor);
- }
- }
- }
-
- public static ReadOnlyPersistentAttribute getPersistentAttribute(IFile entity, String attributeName){
- Set<ReadOnlyPersistentAttribute> result = getEntityFields(entity);
- for(ReadOnlyPersistentAttribute attribute : result){
- if(attributeName.equals(attribute.getName())){
- return attribute;
- }
- }
- return null;
- }
-
- public static PersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node : getRootNodes(jpaFile)) {
- PersistentType entity = (PersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public static Set<ReadOnlyPersistentAttribute> getEntityFields(IFile file){
- Set<ReadOnlyPersistentAttribute> result = new HashSet<ReadOnlyPersistentAttribute>();
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- if(jpaFile == null){
- return result;
- }
- for (JpaStructureNode node : getRootNodes(jpaFile)) {
- PersistentType entity = (PersistentType) node;
- for (ReadOnlyPersistentAttribute attribute : entity.getAllAttributes()) {
- result.add(attribute);
- }
- }
- return result;
- }
-
- public void addAttributes(IFile entity, String attName, String attType, String annotation, String attActName, boolean isCollection){
- JavaPersistentType javaPersistentType = (JavaPersistentType)getPersistentType(entity);
- int cnt = 0;
- while ((javaPersistentType == null) && (cnt < 100)) {
- try {
- Thread.sleep(250);
- } catch (InterruptedException e) {}
- javaPersistentType = (JavaPersistentType)getPersistentType(entity);
- cnt++;
- }
- if (javaPersistentType == null)
- throw new RuntimeException("The entity could not be created");
- ICompilationUnit compilationUnit = JavaCore.createCompilationUnitFrom(entity);
- JpaArtifactFactory.instance().addNewAttribute(javaPersistentType, compilationUnit, attName, attType, annotation, attActName, isCollection, null);
- }
-
- private IFile createFieldAnnotatedEntity(IFolder folder, String packageName, String entityName) throws IOException, CoreException {
- String entityShortName = entityName.substring(entityName.lastIndexOf('.') + 1);
- if (!folder.exists()) {
- createDirectories(folder, true, true, new NullProgressMonitor());
- }
- IFile file = folder.getFile(entityShortName + ".java");
- if (!file.exists()) {
- String content = "package " + packageName + ";\n\n"
- + "import javax.persistence.*;\n\n"
- + "@Entity \n"
- + "public class " + entityShortName + " {\n"
- + " @Id \n"
- + " private int id;\n"
- + " public int getId() {\n"
- + " return id;\n"
- + " }\n"
- + " public void setId(int id) {\n"
- + " this.id = id;\n"
- + " }\n"
- + "}"; //$NON-NLS-1$
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- try {
- stream.write(content.getBytes());
- stream.flush();
- file.create(new ByteArrayInputStream(stream.toByteArray()), true, new NullProgressMonitor());
- } finally {
- stream.close();
- }
- }
- return file;
- }
-
- public IFile createFieldAnnotatedEntityInProject(IProject project, String[] packageFragments, String entityName) throws IOException, CoreException, JavaModelException {
- String folderName = getFolderName(project, packageFragments);
- String packageName = packageFragments[0];
- for (int i = 1; i < packageFragments.length; i++) {
- packageName += "." + packageFragments[i];
- }
-
- IPath path = new Path(folderName);
- IFolder folder = project.getFolder(path);
- return createFieldAnnotatedEntity(folder, packageName , entityName);
- }
-
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPAEditorTestsActivator.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPAEditorTestsActivator.java
deleted file mode 100644
index 0986bff109..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPAEditorTestsActivator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-public class JPAEditorTestsActivator extends Plugin {
-
- /**
- *
- */
- public JPAEditorTestsActivator() {
- }
-
- // The shared instance
- private static JPAEditorTestsActivator plugin;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static JPAEditorTestsActivator getDefault() {
- return plugin;
- }
-
-
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/CreateDiagramTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/CreateDiagramTest.java
deleted file mode 100644
index e767ac1d53..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/CreateDiagramTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.editor;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.concurrent.Semaphore;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.CreateDiagramJob;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Test;
-
-public class CreateDiagramTest {
-
- @Test
- public void testCreateDiagramWhenPersistenceUnitHasDifferentNameFromTheProject() throws InterruptedException, CoreException {
- JPACreateFactory factory = JPACreateFactory.instance();
- JpaProject jpaProject = factory.createJPAProject("JPA_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- String persistenceUnitName = jpaProject.getName() + "_unit";
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- pu.setName(persistenceUnitName);
- assertEquals(persistenceUnitName, pu.getName());
-
-
- final CreateDiagramJob createDiagramRunnable = new CreateDiagramJob(pu, 10, true);
- createDiagramRunnable.setRule(ResourcesPlugin.getWorkspace().getRoot());
- final Semaphore s = new Semaphore(0);
- createDiagramRunnable.addJobChangeListener(new JobChangeAdapter(){
- public void done(IJobChangeEvent event) {
- s.release();
- }
- });
- createDiagramRunnable.setUser(true);
- createDiagramRunnable.schedule();
- s.acquire();
- Diagram d = createDiagramRunnable.getDiagram();
- assertEquals(jpaProject.getName(), d.getName());
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/EditorTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/EditorTest.java
deleted file mode 100644
index d16b031506..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/editor/EditorTest.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.editor;
-
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertNotNull;
-
-import org.easymock.EasyMock;
-import org.eclipse.gef.EditPart;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.internal.selection.JpaSelection;
-import org.eclipse.jpt.jpa.ui.internal.selection.JpaSelectionManager;
-import org.eclipse.jpt.jpa.ui.internal.selection.JpaSelectionParticipant;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditor;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleListener;
-
-@SuppressWarnings("restriction")
-public class EditorTest {
-
- @Test
- public void testJPADiagramEditorCreation() {
- JPADiagramEditor ed = new JPADiagramEditor();
- assertNotNull(ed);
- }
-
-
- @Test
- public void testJPADiagramEditorPlugin() {
- JPADiagramEditorPlugin plugin = new JPADiagramEditorPlugin();
- BundleContext bc = EasyMock.createMock(BundleContext.class);
- Bundle bundle = EasyMock.createMock(Bundle.class);
- EasyMock.expect(bundle.getSymbolicName()).andStubReturn("");
- EasyMock.expect(bc.getBundle()).andStubReturn(bundle);
- bc.addBundleListener(EasyMock.isA(BundleListener.class));
- bc.removeBundleListener(EasyMock.isA(BundleListener.class));
- EasyMock.replay(bc, bundle);
- try {
- plugin.start(bc);
- plugin.stop(bc);
- } catch (Exception e) {
- e.printStackTrace();
- }
- EasyMock.verify(bc);
- }
-
- @Test
- public void testSelectionChanged() {
- final IJPAEditorFeatureProvider provider = EasyMock
- .createMock(IJPAEditorFeatureProvider.class);
-
- IWorkbenchPart part = replayPart();
-
- PictogramElement pe = EasyMock.createMock(PictogramElement.class);
- replay(pe);
- EditPart editPart = EasyMock.createMock(EditPart.class);
- expect(editPart.getModel()).andReturn(pe);
- replay(editPart);
-
- JpaStructureNode jpaNodeToBeSelected = EasyMock
- .createMock(JpaStructureNode.class);
- expect(provider.getBusinessObjectForPictogramElement(pe)).andReturn(
- jpaNodeToBeSelected);
- replay(provider);
-
- // test
- JpaSelectionManager manager = EasyMock
- .createMock(JpaSelectionManager.class);
- manager.select(isA(JpaSelection.class),
- (JpaSelectionParticipant) eq(null));
- replay(manager);
-
- JPADiagramEditor.ISelectionManagerFactory factory = EasyMock
- .createMock(JPADiagramEditor.ISelectionManagerFactory.class);
- expect(factory.getSelectionManager(isA(IWorkbenchWindow.class)))
- .andReturn(manager);
- replay(factory);
- JPADiagramEditor editor = createEditor(provider, factory);
- // test
- editor.selectionChanged(part, new StructuredSelection(editPart));
- verify(manager);
- }
-
- private JPADiagramEditor createEditor(final IJPAEditorFeatureProvider provider,
- JPADiagramEditor.ISelectionManagerFactory factory) {
- IWorkbenchPage page = EasyMock.createMock(IWorkbenchPage.class);
- expect(page.isPartVisible(isA(IWorkbenchPart.class)))
- .andReturn(false);
- expect(page.getActiveEditor()).andStubReturn(null);
- replay(page);
- final IWorkbenchPartSite site = EasyMock
- .createMock(IWorkbenchPartSite.class);
- expect(site.getPage()).andStubReturn(page);
- replay(site);
-
- JPADiagramEditor editor = new JPADiagramEditor(factory) {
- @Override
- public IJPAEditorFeatureProvider getFeatureProvider() {
- return provider;
- }
-
- public IWorkbenchPartSite getSite() {
- return site;
- }
- };
- return editor;
- }
-
- private IWorkbenchPart replayPart() {
- IWorkbenchWindow window = EasyMock.createMock(IWorkbenchWindow.class);
- replay(window);
- IWorkbenchPage page = EasyMock.createMock(IWorkbenchPage.class);
- IWorkbenchPartSite site = EasyMock.createMock(IWorkbenchPartSite.class);
- expect(site.getWorkbenchWindow()).andReturn(window);
- expect(site.getPage()).andStubReturn(page);
- replay(site);
- IWorkbenchPart part = EasyMock.createMock(IWorkbenchPart.class);
- expect(part.getSite()).andStubReturn(site);
- expect(page.isPartVisible(isA(IWorkbenchPart.class)))
- .andReturn(false);
- expect(page.getActiveEditor()).andReturn(null);
- replay(page);
- replay(part);
- return part;
- }
-
- @Test
- public void testSelectionChangedTextSelection() {
- JPADiagramEditor editor = createEditor(null, null);
- editor.selectionChanged(null, new ISelection() {
- public boolean isEmpty() {
- return false;
- }
- });
- }
-
- @Test
- public void testSelectionChangedNotEditPart() {
- JPADiagramEditor editor = createEditor(null, null);
- editor.selectionChanged(null, new StructuredSelection(new Object()));
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java
deleted file mode 100644
index 67958b7e54..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-
-import java.util.Arrays;
-
-import org.easymock.EasyMock;
-import org.easymock.IArgumentMatcher;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.IDirectEditingInfo;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.impl.AddContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.junit.Before;
-import org.junit.Test;
-
-public class AddAttributeFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
-
- private AddContext context;
-
- private JavaPersistentAttribute jpa;
-
- private ContainerShape entityShape;
-
- private ICustomFeature expandFeature;
-
- private IAddFeature graphicalAdd;
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- jpa = EasyMock.createMock(JavaPersistentAttribute.class);
- context = new AddContext();
- context.setNewObject(jpa);
- context.setTargetContainer(entityShape);
- graphicalAdd = EasyMock.createMock(IAddFeature.class);
- expandFeature = EasyMock.createMock(ICustomFeature.class);
- }
-
- @Test
- public void testAddNotJPA() {
- context.setNewObject(new Object());
- assertNull(callAdd());
- }
-
-
- @SuppressWarnings("unused")
- private void confgirueAttributeShape(ContainerShape attributeContainer) {
- ContainerShape attributeShape = EasyMock.createMock(ContainerShape.class);
- expect(featureProvider.getPictogramElementForBusinessObject(jpa)).andReturn(attributeShape);
- expect(attributeShape.getContainer()).andReturn(attributeContainer);
- replay(attributeShape);
- }
-
- @SuppressWarnings({ "unchecked", "unused" })
- private ContainerShape replayTextShape(Text text) {
- EList<GraphicsAlgorithm> children = EasyMock.createMock(EList.class);
- children.add(text);
- GraphicsAlgorithm ga = EasyMock.createMock(GraphicsAlgorithm.class);
- expect(ga.getGraphicsAlgorithmChildren()).andReturn(children);
- replay(ga);
- ContainerShape textShape = EasyMock.createMock(ContainerShape.class);
- expect(textShape.getGraphicsAlgorithm()).andReturn(ga);
- replay(textShape);
- return textShape;
- }
-
- @SuppressWarnings("unused")
- private IDirectEditingInfo configureDirectEditing(Text text, ContainerShape textShape) {
- IDirectEditingInfo info = EasyMock.createMock(IDirectEditingInfo.class);
- info.setGraphicsAlgorithm(text);
- info.setMainPictogramElement(textShape);
- info.setPictogramElement(textShape);
- expect(featureProvider.getDirectEditingInfo()).andReturn(info);
- replay(info);
- return info;
- }
-
- @SuppressWarnings("unused")
- private ICustomContext createCustomContextMatcher(final PictogramElement[] elements) {
- EasyMock.reportMatcher(new IArgumentMatcher() {
- public void appendTo(StringBuffer buffer) {
- }
-
- public boolean matches(Object argument) {
- if (!ICustomContext.class.isInstance(argument))
- return false;
- ICustomContext context = (ICustomContext) argument;
- return Arrays.equals(context.getPictogramElements(), elements);
- }
- });
- return null;
- }
-
- @SuppressWarnings("unused")
- private IAddContext contextMatcher() {
- EasyMock.reportMatcher(new IArgumentMatcher() {
-
- public void appendTo(StringBuffer buffer) {
- }
-
- public boolean matches(Object argument) {
- if (!IAddContext.class.isInstance(argument))
- return false;
- IAddContext context = (IAddContext) argument;
- // compare by reference
- if (jpa != context.getNewObject())
- return false;
- if (entityShape != context.getTargetContainer())
- return false;
- return true;
-
- }
-
- });
- return null;
- }
-
- private PictogramElement callAdd() {
- IAddFeature fixture = createFeature();
- return fixture.add(context);
- }
-
- @Test
- public void testGetFeatureProvider() {
- assertSame(featureProvider, createFeature().getFeatureProvider());
- }
-
- @Test
- public void testCanAddObject() {
- context.setNewObject(new Object());
- // test
- assertEquals(false, callCanAdd());
- }
-
- @Test
- public void testCanAddJpt() {
- // test
- assertEquals(true, callCanAdd());
- }
-
- private boolean callCanAdd() {
- IAddFeature fixture = createFeature();
- boolean result = fixture.canAdd(context);
- return result;
- }
-
- private IAddFeature createFeature() {
- replay(featureProvider);
- replay(graphicalAdd);
- replay(expandFeature);
- return new AddAttributeFeature(featureProvider, graphicalAdd, expandFeature);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddJPAEntityFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddJPAEntityFeatureTest.java
deleted file mode 100644
index f586ba2321..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddJPAEntityFeatureTest.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-
-import org.easymock.EasyMock;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Image;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.algorithms.styles.Color;
-import org.eclipse.graphiti.mm.algorithms.styles.Font;
-import org.eclipse.graphiti.mm.algorithms.styles.Orientation;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramsPackage;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.UpdateAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.junit.Before;
-import org.junit.Test;
-
-public class AddJPAEntityFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
-
-
- @Before
- public void setUp() throws Exception {
- Thread.sleep(2000);
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getAttribsNum((Shape) EasyMock.anyObject())).andStubReturn(0);
- IDiagramTypeProvider idp = EasyMock.createMock(IDiagramTypeProvider.class);
- expect(featureProvider.getDiagramTypeProvider()).andStubReturn(idp);
- expect(featureProvider.increaseAttribsNum((Shape) EasyMock.anyObject())).andStubReturn(1);
- Diagram d = EasyMock.createMock(Diagram.class);
- expect(idp.getDiagram()).andStubReturn(d);
- Color c = EasyMock.createMock(Color.class);
- expect(c.getBlue()).andStubReturn(0);
- expect(c.getRed()).andStubReturn(0);
- expect(c.getGreen()).andStubReturn(0);
- EList<Color> col = new BasicInternalEList<Color>(Color.class);
- expect(d.getColors()).andStubReturn(col);
- Color c1 = EasyMock.createMock(Color.class);
- c1.setRed(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- c1.setGreen(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- c1.setBlue(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- EList<Font> fonts = new BasicInternalEList<Font>(Font.class);
- expect(d.getFonts()).andStubReturn(fonts);
- replay(d, c, c1, idp, featureProvider);
- }
-
-
- @Test
- public void testAddText() {
- Font f = EasyMock.createMock(Font.class);
- Text t = EasyMock.createMock(Text.class);
- t.setFont(f);
- EasyMock.expectLastCall().asStub();
- expect(t.getX()).andStubReturn(0);
- expect(t.getY()).andStubReturn(0);
-
- f.setName("Arial");
- EasyMock.expectLastCall().asStub();
- f.setSize(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- f.setItalic(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- f.setBold(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- t.setWidth(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- t.setHeight(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- t.setValue("abc");
- EasyMock.expectLastCall().asStub();
-
- t.setForeground((Color) EasyMock.anyObject());
- EasyMock.expectLastCall().asStub();
- t.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
- EasyMock.expectLastCall().asStub();
- t.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
- EasyMock.expectLastCall().asStub();
-
- Font f1 = EasyMock.createMock(Font.class);
- f1.setBold(true);
- EasyMock.expectLastCall().asStub();
- expect(t.getFont()).andStubReturn(f1);
-
- Rectangle textRectangle = EasyMock.createMock(Rectangle.class);
- EList<GraphicsAlgorithm> lst = new BasicInternalEList<GraphicsAlgorithm>(GraphicsAlgorithm.class);
- expect(textRectangle.getGraphicsAlgorithmChildren()).andStubReturn(lst);
-
- replay(f1, f, t, textRectangle);
- UpdateAttributeFeature.addText(featureProvider, textRectangle, "abc");
- }
-
- @Test
- public void testaddRectangleForIcon() {
- ContainerShape cs = EasyMock.createMock(ContainerShape.class);
- Rectangle rect = EasyMock.createMock(Rectangle.class);
- expect(rect.getX()).andStubReturn(0);
- expect(rect.getY()).andStubReturn(0);
- rect.setWidth(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- rect.setHeight(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- cs.setGraphicsAlgorithm(rect);
- EasyMock.expectLastCall().asStub();
- rect.setFilled(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- rect.setLineVisible(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- rect.setX(EasyMock.anyInt());
- rect.setLineVisible(EasyMock.anyBoolean());
- rect.setY(EasyMock.anyInt());
- rect.setLineVisible(EasyMock.anyBoolean());
- rect.setWidth(EasyMock.anyInt());
- rect.setLineVisible(EasyMock.anyBoolean());
- cs.setGraphicsAlgorithm(EasyMock.isA(Rectangle.class));
- EasyMock.expectLastCall().asStub();
- replay(rect, cs);
- UpdateAttributeFeature.addRectangleForIcon(cs, 0);
- }
-
- @Test
- public void testAddRectangleForText() {
- ContainerShape cs = EasyMock.createMock(ContainerShape.class);
- Rectangle rect = EasyMock.createMock(Rectangle.class);
- expect(rect.getX()).andStubReturn(0);
- expect(rect.getY()).andStubReturn(0);
- rect.setWidth(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- rect.setHeight(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- cs.setGraphicsAlgorithm(rect);
- EasyMock.expectLastCall().asStub();
- rect.setFilled(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- rect.setLineVisible(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- rect.setX(EasyMock.anyInt());
- rect.setLineVisible(EasyMock.anyBoolean());
- rect.setY(EasyMock.anyInt());
- rect.setLineVisible(EasyMock.anyBoolean());
- rect.setWidth(EasyMock.anyInt());
- rect.setLineVisible(EasyMock.anyBoolean());
- cs.setGraphicsAlgorithm(EasyMock.isA(Rectangle.class));
- EasyMock.expectLastCall().asStub();
- replay(rect, cs);
- UpdateAttributeFeature.addRectangleForText(cs, 0, 120);
- }
-
- @Test
- public void testAddAttribute() {
- GraphicsAlgorithm ga = EasyMock.createMock(GraphicsAlgorithm.class);
- expect(ga.getWidth()).andStubReturn(20);
- ContainerShape cs = EasyMock.createMock(ContainerShape.class);
- expect(cs.getGraphicsAlgorithm()).andStubReturn(ga);
- Rectangle rect = EasyMock.createMock(Rectangle.class);
- expect(rect.getX()).andStubReturn(0);
- expect(rect.getY()).andStubReturn(0);
- rect.setWidth(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- rect.setHeight(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- rect.setFilled(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- rect.setLineVisible(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- rect.setX(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- rect.setY(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
-
- EList<Property> props = new BasicInternalEList<Property>(Property.class);
- EList<Property> props1 = new BasicInternalEList<Property>(Property.class);
-
- expect(cs.getProperties()).andStubReturn(props);
-
- cs.setVisible(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- cs.setActive(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- cs.setContainer((ContainerShape) EasyMock.anyObject());
- EasyMock.expectLastCall().asStub();
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- expect(cs1.getProperties()).andStubReturn(props1);
- cs1.setVisible(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- cs1.setActive(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- cs1.setContainer((ContainerShape) EasyMock.anyObject());
- EasyMock.expectLastCall().asStub();
- PictogramsPackage p = EasyMock.createMock(PictogramsPackage.class);
- Property pr = EasyMock.createMock(Property.class);
- cs1.setGraphicsAlgorithm((GraphicsAlgorithm) EasyMock.anyObject());
- EasyMock.expectLastCall().asStub();
- Image img = EasyMock.createMock(Image.class);
- expect(img.getX()).andStubReturn(0);
- expect(img.getY()).andStubReturn(0);
- img.setWidth(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- img.setHeight(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- img.setX(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- img.setY(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- img.setId("org.eclisp.jpt.ui.diagrameditor.field");
- EasyMock.expectLastCall().asStub();
- img.setProportional(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- img.setStretchH(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- img.setStretchV(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- EList<GraphicsAlgorithm> ch = new BasicInternalEList<GraphicsAlgorithm>(GraphicsAlgorithm.class);
- expect(rect.getGraphicsAlgorithmChildren()).andStubReturn(ch);
- expect(pr.getKey()).andStubReturn("prop_shape_type");
- Text t = EasyMock.createMock(Text.class);
- expect(t.getX()).andStubReturn(0);
- expect(t.getY()).andStubReturn(0);
- t.setWidth(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- t.setX(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- t.setY(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- t.setHeight(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- t.setValue("");
- EasyMock.expectLastCall().asStub();
- Font f = EasyMock.createMock(Font.class);
- f.setName((String) EasyMock.anyObject());
- EasyMock.expectLastCall().asStub();
-
- f.setSize(EasyMock.anyInt());
- EasyMock.expectLastCall().asStub();
- f.setItalic(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- f.setBold(EasyMock.anyBoolean());
- EasyMock.expectLastCall().asStub();
- expect(t.getFont()).andStubReturn(f);
- t.setFont((Font) EasyMock.anyObject());
- EasyMock.expectLastCall().asStub();
- EasyMock.expectLastCall().asStub();
- t.setForeground((Color) EasyMock.anyObject());
- t.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
- t.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
- f.setBold(true);
- replay(rect, ga, img, cs, cs1, p, pr, t, f);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddRelationFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddRelationFeatureTest.java
deleted file mode 100644
index 242dedead9..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddRelationFeatureTest.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.aryEq;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.easymock.EasyMock;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.IAddBendpointFeature;
-import org.eclipse.graphiti.features.IAddFeature;
-import org.eclipse.graphiti.features.context.IAddBendpointContext;
-import org.eclipse.graphiti.features.context.IAddConnectionContext;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.mm.algorithms.Polyline;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.services.IGaService;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorImageCreator;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelDir;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IPeServiceUtil;
-import org.eclipse.swt.graphics.Point;
-import org.junit.Before;
-import org.junit.Test;
-
-public class AddRelationFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
-
- private IJPAEditorImageCreator imageCreator;
-
- private IJPAEditorUtil jpaEditorUtil;
-
- private IDiagramTypeProvider diagramProvider;
-
- private Diagram diagram;
-
- private IAddConnectionContext context;
-
- private IPeServiceUtil peUtil;
-
- private IGaService gaUtil;
-
- private IAddBendpointFeature ft;
-
- private Resource resource;
-
- private static String OWNER_AT_NAME = "ownerAttr"; //$NON-NLS-1$
-
- private static String INVERSE_AT_NAME = "inverseAttr"; //$NON-NLS-1$
-
- /**
- * @throws java.lang.Exception
- */
- @SuppressWarnings("unchecked")
- @Before
- public void setUp() throws Exception {
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- imageCreator = EasyMock.createMock(IJPAEditorImageCreator.class);
- jpaEditorUtil = EasyMock.createMock(IJPAEditorUtil.class);
- diagramProvider = EasyMock.createMock(IDiagramTypeProvider.class);
- diagram = EasyMock.createMock(Diagram.class);
- context = EasyMock.createMock(IAddConnectionContext.class);
- peUtil = EasyMock.createMock(IPeServiceUtil.class);
- gaUtil = EasyMock.createMock(IGaService.class);
- ft = EasyMock.createMock(IAddBendpointFeature.class);
-
-
- TransactionalEditingDomain defaultTransEditDomain = EasyMock.createMock(TransactionalEditingDomain.class);
- ResourceSet resourceSet = EasyMock.createMock(ResourceSet.class);
- expect(defaultTransEditDomain.getResourceSet()).andStubReturn(resourceSet);
- EList<Adapter> eAdapters = EasyMock.createMock(EList.class);
- expect(resourceSet.eAdapters()).andStubReturn(eAdapters);
- //IFile diagramFile = project.getFile(diagramFileName.removeFirstSegments(1));
- //IPath diagramFilePath = diagramFile.getFullPath();
-
- //String pathName = diagramFilePath.toString();
- //URI resourceURI = URI.createPlatformResourceURI(pathName, true);
- resource = EasyMock.createMock(Resource.class);
- expect(resourceSet.getResource(isA(URI.class), EasyMock.anyBoolean())).andStubReturn(resource);
-
- expect(resource.getResourceSet()).andStubReturn(resourceSet);
- replay(defaultTransEditDomain, resourceSet, resource);
-
- }
-
- @Test
- public void testCanAddNotAddConnectionContext() {
- IAddContext context = EasyMock.createMock(IAddContext.class);
- verifyCanAdd(context, false);
- }
-
- @Test
- public void testCanAddNoRelation() throws Exception {
- IAddConnectionContext context = EasyMock.createMock(IAddConnectionContext.class);
- Object notARelation = new Object();
- expect(context.getNewObject()).andReturn(notARelation);
- verifyCanAdd(context, false);
- }
-
- @Test
- public void testCanAdd() throws Exception {
- IAddConnectionContext context = EasyMock.createMock(IAddConnectionContext.class);
- IRelation relation = EasyMock.createMock(IRelation.class);
- replay(relation);
- expect(context.getNewObject()).andReturn(relation);
- verifyCanAdd(context, true);
- }
-
- @Test
- public void testGetFeatureProvider() {
- IAddFeature fixture = createFeature();
- assertSame(featureProvider, fixture.getFeatureProvider());
- }
-
- @SuppressWarnings("unused")
- private void expectManyEndDecorator(double location) {
- ConnectionDecorator d = EasyMock.createMock(ConnectionDecorator.class);
- Polyline pl = EasyMock.createMock(Polyline.class);
- expect(pl.getX()).andReturn(0);
- expect(pl.getY()).andReturn(0);
- expect(imageCreator.createManyEndDecorator(isA(Connection.class), eq(location))).andReturn(d);
- expect(d.getGraphicsAlgorithm()).andReturn(pl);
- replay(d, pl);
- }
-
- @SuppressWarnings("unused")
- private void expectManyStartDecorator(double location) {
- ConnectionDecorator d = EasyMock.createMock(ConnectionDecorator.class);
- Polyline pl = EasyMock.createMock(Polyline.class);
- expect(pl.getX()).andReturn(0);
- expect(pl.getY()).andReturn(0);
- expect(imageCreator.createManyStartDecorator(isA(Connection.class), eq(location))).andReturn(d);
- expect(d.getGraphicsAlgorithm()).andReturn(pl);
- replay(d, pl);
- }
-
- @SuppressWarnings("unused")
- private void expectManyEndWithArrow(final double location) {
- ConnectionDecorator d = EasyMock.createMock(ConnectionDecorator.class);
- Polyline pl = EasyMock.createMock(Polyline.class);
- expect(pl.getX()).andReturn(0);
- expect(pl.getY()).andReturn(0);
- expect(imageCreator.createManyEndWithArrowDecorator(isA(Connection.class), eq(location))).andReturn(d);
- expect(d.getGraphicsAlgorithm()).andReturn(pl);
- replay(d, pl);
- }
-
- @SuppressWarnings("unused")
- private void expectArrow(final double location) {
- ConnectionDecorator d = EasyMock.createMock(ConnectionDecorator.class);
- Polyline pl = EasyMock.createMock(Polyline.class);
- expect(pl.getX()).andReturn(0);
- expect(pl.getY()).andReturn(0);
- expect(imageCreator.createArrowConnectionDecorator(isA(Connection.class), eq(location))).andReturn(d);
- expect(d.getGraphicsAlgorithm()).andReturn(pl);
- replay(d, pl);
- }
-
- @SuppressWarnings("unused")
- private void expectTextConnectionDecorator(String text, double location) {
- expect(imageCreator.createCardinalityConnectionDecorator(diagram, isA(Connection.class), eq(text), eq(location))).andReturn(
- null);
- }
-
- @SuppressWarnings("unused")
- private void configureRelation(IRelation relation, final RelDir direction, final RelType type) {
- expect(relation.getOwnerAttributeName()).andStubReturn(OWNER_AT_NAME);
- expect(relation.getInverseAttributeName()).andStubReturn(INVERSE_AT_NAME);
- expect(relation.getRelDir()).andStubReturn(direction);
- expect(relation.getRelType()).andStubReturn(type);
- }
-
- private void configureProvidersForAdd(IRelation relation) {
- expect(diagramProvider.getDiagram()).andReturn(diagram);
- expect(featureProvider.getDiagramTypeProvider()).andReturn(diagramProvider);
- expect(featureProvider.getPeUtil()).andReturn(peUtil);
- expect(featureProvider.getAddBendpointFeature(isA(IAddBendpointContext.class))).andStubReturn(ft);
- expect(context.getNewObject()).andReturn(relation);
-
- }
-
- @SuppressWarnings("unused")
- private void verifyAdd(IRelation relation, boolean expectId) {
- FreeFormConnection connection = configureConnection(relation, expectId);
- replay(connection);
- PictogramElement result = callAdd();
- assertSame(connection, result);
- verify(context);
- verify(featureProvider);
- verify(imageCreator);
- verify(jpaEditorUtil);
- verify(diagram);
- verify(diagramProvider);
- verify(relation);
- }
-
- private PictogramElement callAdd() {
- IAddFeature fixture = createFeature();
- PictogramElement result = fixture.add(context);
- return result;
- }
-
- private FreeFormConnection configureConnection(IRelation relation, boolean expectId) {
- final String relationId = "someId"; //$NON-NLS-1$
- if (expectId)
- expect(relation.getId()).andStubReturn(relationId);
- replay(relation);
- configureProvidersForAdd(relation);
- Anchor startAnchor = replayAnchor();
- Anchor endAnchor = replayAnchor();
- expect(context.getSourceAnchor()).andReturn(startAnchor);
- expect(context.getTargetAnchor()).andReturn(endAnchor);
-
- gaUtil.setLocation(isA(Polyline.class), EasyMock.anyInt() , EasyMock.anyInt());
- gaUtil.setLocation(isA(Polyline.class), EasyMock.anyInt() , EasyMock.anyInt());
-
- FreeFormConnection connection = createConnection(startAnchor, endAnchor);
- expect(peUtil.createFreeFormConnection(diagram)).andReturn(connection);
- expect(imageCreator.createConnectionLine(diagram, connection)).andReturn(null);
- ft.addBendpoint(isA(IAddBendpointContext.class));
-
- List<Point> pts = new LinkedList<Point>();
- Point pt1 = new Point(100, 100);
- //Point pt2 = new Point(200, 200);
- pts.add(pt1);
- //pts.add(pt2);
- expect(jpaEditorUtil.createBendPointList(connection, false)).andReturn(pts);
- featureProvider.putKeyToBusinessObject(relationId, relation);
- featureProvider.link(eq(connection), aryEq(new IRelation[] { relation }));
- expect(featureProvider.layoutIfPossible(isA(ILayoutContext.class))).andReturn(null);
- return connection;
- }
-
- private Anchor replayAnchor() {
- Anchor startAnchor = EasyMock.createMock(Anchor.class);
- replay(startAnchor);
- return startAnchor;
- }
-
- private FreeFormConnection createConnection(Anchor startAnchor, Anchor endAnchor) {
- FreeFormConnection connection = EasyMock.createMock(FreeFormConnection.class);
- connection.setStart(startAnchor);
- connection.setEnd(endAnchor);
- connection.setVisible(true);
- connection.setActive(true);
-
- org.eclipse.graphiti.mm.algorithms.styles.Point pt = EasyMock.createMock(org.eclipse.graphiti.mm.algorithms.styles.Point.class);
- expect(pt.getX()).andStubReturn(100);
- expect(pt.getY()).andStubReturn(100);
-
- org.eclipse.graphiti.mm.algorithms.styles.Point pt1 = EasyMock.createMock(org.eclipse.graphiti.mm.algorithms.styles.Point.class);
- expect(pt1.getX()).andStubReturn(200);
- expect(pt1.getY()).andStubReturn(200);
-
-
- EList<org.eclipse.graphiti.mm.algorithms.styles.Point> pts1 = new BasicInternalEList<org.eclipse.graphiti.mm.algorithms.styles.Point>(org.eclipse.graphiti.mm.algorithms.styles.Point.class);
- pts1.add(pt);
- pts1.add(pt1);
- expect(connection.getBendpoints()).andStubReturn(pts1);
- replay(pt, pt1);
- return connection;
- }
-
- private void verifyCanAdd(IAddContext context, final boolean expected) {
- replay(context);
- boolean result = callCanAdd(context);
- assertEquals(expected, result);
- verify(context);
- }
-
- private boolean callCanAdd(IAddContext context) {
- IAddFeature fixture = createFeature();
- return fixture.canAdd(context);
- }
-
- private IAddFeature createFeature() {
- replay(featureProvider);
- replay(imageCreator);
- replay(jpaEditorUtil);
- replay(diagramProvider);
- replay(diagram);
- replay(context);
- replay(peUtil);
- replay(gaUtil);
- replay(ft);
- return new AddRelationFeature(featureProvider, imageCreator, jpaEditorUtil);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/ClickAddFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/ClickAddFeatureTest.java
deleted file mode 100644
index a700ef5c66..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/ClickAddFeatureTest.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertNotNull;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.IDirectEditingInfo;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ICreateContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ClickAddAttributeButtonFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util.IEditor;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ClickAddFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- private ICreateContext context;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- JavaPersistentType jpt = null;
- ICompilationUnit cu = null;
-
- @Before
- public void setUp() throws Exception {
- System.setProperty(JPACreateFactory.JPA_JAR_NAME_SYSTEM_PROPERTY, "C:\\lib\\persistence-api-1.0.jar");
- JptJpaCorePlugin.getJpaProjectManager();
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- IFile entity = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- ContainerShape cs = EasyMock.createMock(ContainerShape.class);
- context = EasyMock.createMock(ICreateContext.class);
- expect(context.getTargetContainer()).andStubReturn(cs);
- expect(context.getX()).andStubReturn(0);
- expect(context.getY()).andStubReturn(0);
- expect(context.getWidth()).andStubReturn(100);
- expect(context.getHeight()).andStubReturn(100);
- expect(context.getTargetConnection()).andStubReturn(null);
- IDirectEditingInfo dei = EasyMock.createMock(IDirectEditingInfo.class);
- dei.setActive(true);
- Thread.sleep(2000);
- jpt = (JavaPersistentType)JPACreateFactory.getPersistentType(entity);
- int cnt = 0;
- while ((cnt < 50) && (jpt == null)) {
- Thread.sleep(200);
- jpt = (JavaPersistentType)JPACreateFactory.getPersistentType(entity);
- cnt++;
- }
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs)).andStubReturn(jpt);
- expect(featureProvider.getPictogramElementForBusinessObject(jpt)).andStubReturn(null);
- cu = JavaCore.createCompilationUnitFrom(entity);
- cnt = 0;
- while ((cnt < 50) && (cu == null)) {
- Thread.sleep(200);
- cu = JavaCore.createCompilationUnitFrom(entity);
- cnt++;
- }
- expect(featureProvider.getCompilationUnit((JavaPersistentType) EasyMock.anyObject())).andReturn(cu).anyTimes();
- expect(featureProvider.addIfPossible(isA(IAddContext.class))).andStubReturn(null);
- expect(featureProvider.getDirectEditingInfo()).andStubReturn(dei);
-
- IJPAEditorUtil ut = EasyMock.createMock(IJPAEditorUtil.class);
- expect(featureProvider.getJPAEditorUtil()).andStubReturn(ut);
-
- IDiagramTypeProvider diagramTypeProvider = EasyMock.createMock(IDiagramTypeProvider.class);
- expect(featureProvider.getDiagramTypeProvider()).andStubReturn(diagramTypeProvider);
- IEditor ed = EasyMock.createMock(IEditor.class);
- expect(diagramTypeProvider.getDiagramEditor()).andStubReturn(ed);
- IWorkbenchPartSite ws = EasyMock.createMock(IWorkbenchPartSite.class);
- expect(ed.getSite()).andStubReturn(ws);
- ut.formatCode((ICompilationUnit)EasyMock.anyObject(), (IWorkbenchPartSite)EasyMock.anyObject());
-
- featureProvider.addAddIgnore(jpt, "attribute1");
-
- replay(featureProvider, cs, context, dei, diagramTypeProvider, ed, ws, ut);
- }
-
- @Test
- public void testClickAddAttributeButtonFeature(){
- if ((jpt == null) || (cu == null))
- return; // The test wasn't setup properly
- ClickAddAttributeButtonFeature feature = new ClickAddAttributeButtonFeature(featureProvider);
- Object[] created = feature.create(context);
- assertNotNull(created[0]);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateDeleteOnlyAttributeTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateDeleteOnlyAttributeTest.java
deleted file mode 100644
index 3ac34cc448..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateDeleteOnlyAttributeTest.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CreateDeleteOnlyAttributeTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- JavaPersistentType jpt = null;
-
- @Before
- public void setUp() throws Exception{
- JptJpaCorePlugin.getJpaProjectManager();
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- IFile entity = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- jpt = (JavaPersistentType)JPACreateFactory.getPersistentType(entity);
- int c = 0;
- while ((jpt == null) && (c < 100)) {
- try {
- Thread.sleep(250);
- } catch (Exception e) {}
- jpt = (JavaPersistentType)JPACreateFactory.getPersistentType(entity);
- c++;
- }
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(isA(ContainerShape.class))).andStubReturn(jpt);
- expect(featureProvider.getBusinessObjectForPictogramElement(null)).andReturn(JPACreateFactory.getPersistentType(entity));
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(JavaCore.createCompilationUnitFrom(entity)).anyTimes();
- expect(featureProvider.addIfPossible(isA(IAddContext.class))).andStubReturn(null);
- expect(featureProvider.getPictogramElementForBusinessObject(jpt)).andStubReturn(isA(ContainerShape.class));
- ICompilationUnit cu = JavaCore.createCompilationUnitFrom(entity);
- expect(featureProvider.getCompilationUnit(jpt)).andStubReturn(cu);
- replay(featureProvider);
- }
-
-
- @Test
- public void testCreatePropertyAnnotatedAttribute() throws Exception {
- EntityAttributesChangeTestListener lsnr = new EntityAttributesChangeTestListener(0, 1);
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- deleteAttribute("id");
- assertTrue(lsnr.waitForEvents());
- jpt.removeListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- lsnr = new EntityAttributesChangeTestListener(2, 0);
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- JpaArtifactFactory.instance().makeNewAttribute(featureProvider, jpt, featureProvider.getCompilationUnit(jpt), "aaa", "java.lang.String", null, "aaa", null, false, true);
- assertFalse(lsnr.waitForEvents());
- assertEquals(1, lsnr.incrementCounter);
- assertEquals(0, lsnr.decrementCounter);
- }
-
-
-
- @Test
- public void testCreateFieldAnnotatedAttribute() throws Exception {
- EntityAttributesChangeTestListener lsnr = new EntityAttributesChangeTestListener(0, 1);
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- deleteAttribute("id");
- assertTrue(lsnr.waitForEvents());
- jpt.removeListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- lsnr = new EntityAttributesChangeTestListener(2, 0);
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- JpaArtifactFactory.instance().makeNewAttribute(featureProvider, jpt, featureProvider.getCompilationUnit(jpt), "aaa", "java.lang.String", null, "aaa", null, false, false);
- assertFalse(lsnr.waitForEvents());
- assertEquals(1, lsnr.incrementCounter);
- assertEquals(0, lsnr.decrementCounter);
- }
-
-
- @Test
- public void testDeletePropertyAnnotatedAttribute() throws Exception {
- EntityAttributesChangeTestListener lsnr = new EntityAttributesChangeTestListener(0, 2);
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- deleteAttribute("id");
- assertFalse(lsnr.waitForEvents());
- assertEquals(0, lsnr.incrementCounter);
- assertEquals(1, lsnr.decrementCounter);
- }
-
-
- @Test
- public void testDeleteFieldAnnotatedAttribute() throws Exception {
- EntityAttributesChangeTestListener lsnr = new EntityAttributesChangeTestListener(1, 1);
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- deleteAttribute("id");
- JpaArtifactFactory.instance().makeNewAttribute(featureProvider, jpt, featureProvider.getCompilationUnit(jpt), "aaa", "java.lang.String", null, "aaa", null, false, false);
- assertTrue(lsnr.waitForEvents());
- jpt.removeListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- lsnr = new EntityAttributesChangeTestListener(0, 2);
- jpt.addListChangeListener(JavaPersistentType.ATTRIBUTES_LIST, lsnr);
- deleteAttribute("aaa");
- assertFalse(lsnr.waitForEvents());
- assertEquals(0, lsnr.incrementCounter);
- assertEquals(1, lsnr.decrementCounter);
- }
-
-
-
- private void deleteAttribute(String attrName) {
- JpaArtifactFactory.instance().deleteAttribute(jpt, attrName, featureProvider);
- }
-
-
- public static class EntityAttributesChangeTestListener implements ListChangeListener {
-
- private Semaphore sem = new Semaphore(1);
-
- private int toBeAdded;
- private int toBeRemove;
-
- public EntityAttributesChangeTestListener(int add, int remove) {
- this.toBeAdded = add;
- this.toBeRemove = remove;
- try {
- sem.acquire(1);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- public boolean waitForEvents() throws InterruptedException {
- return sem.tryAcquire(5, TimeUnit.SECONDS);
- }
-
- public int incrementCounter = 0;
- public int decrementCounter = 0;
-
- public void listChanged(ListChangeEvent event) {
- }
-
- public void itemsAdded(ListAddEvent arg0) {
- incrementCounter++;
- if(this.incrementCounter >= toBeAdded && this.decrementCounter>= toBeRemove ) {
- sem.release();
- }
- }
-
- public void itemsMoved(ListMoveEvent arg0) {
- }
-
- public void itemsRemoved(ListRemoveEvent arg0) {
- decrementCounter++;
- if(this.incrementCounter >= toBeAdded && this.decrementCounter>= toBeRemove ) {
- sem.release();
- }
- }
-
- public void itemsReplaced(ListReplaceEvent arg0) {
- }
-
- public void listCleared(ListClearEvent arg0) {
- }
- };
-
- @After
- public void tearDown() throws Exception {
- deleteAllProjects();
- }
-
- private void deleteAllProjects() throws Exception {
- IProgressMonitor monitor= new NullProgressMonitor();
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IProject project = jpaProject.getProject();
- project.close(monitor);
- project.close(monitor);
- project.delete(true, true, monitor);
- }
- } , monitor);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java
deleted file mode 100644
index 7ed4a57752..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java
+++ /dev/null
@@ -1,572 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.graphiti.features.context.ICreateConnectionContext;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToManyBiDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToManyUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToOneBiDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToOneUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateOneToManyUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateOneToOneBiDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateOneToOneUniDirRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelDir;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.IRelation.RelType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CreateRelationFeaturesTest {
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- IEclipseFacade eclipseFacade = null;
-
- @Before
- public void setUp() throws Exception {
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- Thread.sleep(2000);
- }
-
- @Test
- public void testCreateOneToOneUniDirRelationFeature() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateOneToOneUniDirRelationFeature ft = new CreateOneToOneUniDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- cu1.becomeWorkingCopy(new NullProgressMonitor());
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
- cu2.becomeWorkingCopy(new NullProgressMonitor());
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- OneToOneUniDirRelation rel = ft.createRelation(featureProvider, cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.ONE_TO_ONE, rel.getRelType());
- assertEquals(RelDir.UNI, rel.getRelDir());
- assertSame(rel.getOwner(), t1);
- assertSame(rel.getInverse(), t2);
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- assertTrue(JpaArtifactFactory.instance().isMethodAnnotated(t1));
- JavaPersistentAttribute jpa = t1.getAttributeNamed("id");
- assertFalse(JpaArtifactFactory.instance().isRelationAnnotated(jpa));
- jpa = t1.getAttributeNamed(rel.getOwnerAttributeName());
- assertTrue(JpaArtifactFactory.instance().isRelationAnnotated(jpa));
- }
-
- @Test
- public void testCreateOneToOneBiDirRelationFeature() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateOneToOneBiDirRelationFeature ft = new CreateOneToOneBiDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- OneToOneBiDirRelation rel = ft.createRelation(featureProvider, cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.ONE_TO_ONE, rel.getRelType());
- assertEquals(RelDir.BI, rel.getRelDir());
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- assertNotNull(t2.getAttributeNamed(rel.getInverseAttributeName()));
- }
-
-
- @Test
- public void testCreateManyToOneUniDirRelationFeature() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateManyToOneUniDirRelationFeature ft = new CreateManyToOneUniDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- ManyToOneUniDirRelation rel = ft.createRelation(featureProvider, cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.MANY_TO_ONE, rel.getRelType());
- assertEquals(RelDir.UNI, rel.getRelDir());
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- }
-
-
- @Test
- public void testCreateManyToOneBiDirRelationFeature() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateManyToOneBiDirRelationFeature ft = new CreateManyToOneBiDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- ManyToOneBiDirRelation rel = ft.createRelation(featureProvider, cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.MANY_TO_ONE, rel.getRelType());
- assertEquals(RelDir.BI, rel.getRelDir());
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- assertNotNull(t2.getAttributeNamed(rel.getInverseAttributeName()));
- }
-
- @Test
- public void testCreateOneToManyUniDirRelationFeature() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateOneToManyUniDirRelationFeature ft = new CreateOneToManyUniDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- OneToManyUniDirRelation rel = ft.createRelation(featureProvider, cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.ONE_TO_MANY, rel.getRelType());
- assertEquals(RelDir.UNI, rel.getRelDir());
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- }
-
- @Test
- public void testCreateManyToManyUniDirRelationFeature() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateManyToManyUniDirRelationFeature ft = new CreateManyToManyUniDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- ManyToManyUniDirRelation rel = ft.createRelation(featureProvider, cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.MANY_TO_MANY, rel.getRelType());
- assertEquals(RelDir.UNI, rel.getRelDir());
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- }
-
- @Test
- public void testCreateManyToManyBiDirRelationFeature() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateManyToManyBiDirRelationFeature ft = new CreateManyToManyBiDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- ManyToManyBiDirRelation rel = ft.createRelation(featureProvider, cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.MANY_TO_MANY, rel.getRelType());
- assertEquals(RelDir.BI, rel.getRelDir());
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- assertNotNull(t2.getAttributeNamed(rel.getInverseAttributeName()));
- }
-
-
- public static JavaPersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node : getRootNodes(jpaFile)) {
- JavaPersistentType entity = (JavaPersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DeleteRelationFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DeleteRelationFeatureTest.java
deleted file mode 100644
index b5548c9fd0..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DeleteRelationFeatureTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-
-import org.easymock.EasyMock;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DeleteRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.BidirectionalRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util.IEditor;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.junit.Test;
-
-public class DeleteRelationFeatureTest {
-
- @Test
- public void testPostDelete(){
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getRemoveFeature(isA(IRemoveContext.class))).andReturn(null);
- IJPAEditorUtil ut = EasyMock.createMock(IJPAEditorUtil.class);
- expect(featureProvider.getJPAEditorUtil()).andStubReturn(ut);
- IDeleteContext ctx = EasyMock.createMock(IDeleteContext.class);
- PictogramElement pe = EasyMock.createMock(PictogramElement.class);
- expect(ctx.getPictogramElement()).andStubReturn(pe);
- BidirectionalRelation rel = EasyMock.createMock(BidirectionalRelation.class);
- ICompilationUnit cu1 = EasyMock.createMock(ICompilationUnit.class);
- ICompilationUnit cu2 = EasyMock.createMock(ICompilationUnit.class);
- JavaPersistentType jpt1 = EasyMock.createMock(JavaPersistentType.class);
- JavaPersistentType jpt2 = EasyMock.createMock(JavaPersistentType.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(rel);
- expect(rel.getOwner()).andStubReturn(jpt1);
- expect(rel.getInverse()).andStubReturn(jpt2);
- expect(featureProvider.getCompilationUnit(jpt1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(jpt2)).andStubReturn(cu2);
-
- IWorkbenchPartSite ws = EasyMock.createMock(IWorkbenchPartSite.class);
-
- IDiagramTypeProvider p = EasyMock.createMock(IDiagramTypeProvider.class);
- IEditor e = EasyMock.createMock(IEditor.class);
- expect(featureProvider.getDiagramTypeProvider()).andStubReturn(p);
- expect(p.getDiagramEditor()).andStubReturn(e);
- expect(e.getSite()).andStubReturn(ws);
- ut.organizeImports(cu1, ws);
- ut.organizeImports(cu2, ws);
-
- replay(featureProvider, ctx, ut, rel, jpt1, jpt2, cu1, cu2, pe, p, e, ws);
-
- DeleteRelationFeature feature = new DeleteRelationFeature(featureProvider);
- feature.postDelete(ctx);
- }
-}
-
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java
deleted file mode 100644
index a48ee0dd5c..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertEquals;
-
-import java.text.MessageFormat;
-
-import org.easymock.EasyMock;
-import org.eclipse.graphiti.features.IDirectEditingFeature;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDirectEditingContext;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DirectEditAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.junit.Before;
-import org.junit.Test;
-
-public class DirectEditAttributeFeatureTest {
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- }
-
- @Test
- public void testCheckValueValidStringByJavaConventions() {
- JavaPersistentType jpt = EasyMock.createNiceMock(JavaPersistentType.class);
- JavaPersistentAttribute jpa = configureJpaForJpt(jpt);
- expect(jpt.getAttributeNamed(isA(String.class))).andStubReturn(jpa);
- replay(jpa, jpt);
-
- IFeatureProvider provider = replayJpaForNullPe(jpa);
- IDirectEditingContext context = replayNullPeContext();
-
- IDirectEditingFeature feature = new DirectEditAttributeFeature(provider);
- assertNotValidJavaConventionField(feature, context, "");
- assertNotValidJavaConventionField(feature, context, "1a");
- assertNotValidJavaConventionField(feature, context, "d d");
- assertValidField(feature, context, "$d");
- assertNotValidJavaConventionField(feature, context, "enum");
- }
-
- @Test
- public void testCheckValueValidStringDuplicateAttribute() {
- JavaPersistentAttribute otherJpa = EasyMock.createMock(JavaPersistentAttribute.class);
- JavaPersistentType jpt = EasyMock.createMock(JavaPersistentType.class);
- expect(jpt.getAttributeNamed("attrName")).andStubReturn(otherJpa);
-
- JavaPersistentAttribute jpa = configureJpaForJpt(jpt);
- replay(jpa, jpt, otherJpa);
-
- IFeatureProvider provider = replayJpaForNullPe(jpa);
- IDirectEditingContext context = replayNullPeContext();
-
- IDirectEditingFeature feature = new DirectEditAttributeFeature(provider);
-
- assertEquals(MessageFormat.format(JPAEditorMessages.DirectEditAttributeFeature_attributeExists, "attrName"), feature.checkValueValid("attrName", context));
- }
-
- private IFeatureProvider replayJpaForNullPe(JavaPersistentAttribute jpa) {
- IFeatureProvider provider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(provider.getBusinessObjectForPictogramElement(null)).andStubReturn(jpa);
- replay(provider);
- return provider;
- }
-
- private JavaPersistentAttribute configureJpaForJpt(JavaPersistentType jpt) {
- JavaPersistentAttribute jpa = EasyMock.createMock(JavaPersistentAttribute.class);
- expect(jpa.getParent()).andStubReturn(jpt);
- return jpa;
- }
-
- private IDirectEditingContext replayNullPeContext() {
- IDirectEditingContext context = EasyMock.createMock(IDirectEditingContext.class);
- expect(context.getPictogramElement()).andStubReturn(null);
- replay(context);
- return context;
- }
-
- private void assertValidField(IDirectEditingFeature feature, IDirectEditingContext context, String field) {
- assertEquals(null, feature.checkValueValid(field, context));
- }
-
- private void assertNotValidJavaConventionField(IDirectEditingFeature feature, IDirectEditingContext context,
- String field) {
- final String sourceLevel = "1.5";
- final String complianceLevel = "1.5";
- assertEquals(JavaConventions.validateFieldName(field, sourceLevel, complianceLevel).getMessage(), feature
- .checkValueValid(field, context));
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/LayoutEntityFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/LayoutEntityFeatureTest.java
deleted file mode 100644
index e9fbe8566b..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/LayoutEntityFeatureTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import org.easymock.EasyMock;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.graphiti.features.context.ILayoutContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.LayoutJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IGraphicsUpdater;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IPeServiceUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.junit.Test;
-
-public class LayoutEntityFeatureTest {
-
- @Test
- public void testIfNewlyAddedEntityShapeIsExpanded() {
- IJPAEditorFeatureProvider fp = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- ILayoutContext ctx = EasyMock.createMock(ILayoutContext.class);
- ContainerShape cs = EasyMock.createMock(ContainerShape.class);
- GraphicsAlgorithm ga = EasyMock.createMock(GraphicsAlgorithm.class);
- EasyMock.expect(cs.getGraphicsAlgorithm()).andStubReturn(ga);
- EasyMock.expect(ctx.getPictogramElement()).andStubReturn(cs);
- EasyMock.expect(ga.getHeight()).andStubReturn(80);
- EasyMock.expect(ga.getWidth()).andStubReturn(100);
- //EasyMock.expect(cs.is___Alive()).andStubReturn(true);
- EList<Shape> shList = new BasicInternalEList<Shape>(Shape.class);
- EasyMock.expect(cs.getChildren()).andStubReturn(shList);
- IPeServiceUtil peUtil = EasyMock.createMock(IPeServiceUtil.class);
- EasyMock.expect(fp.getPeUtil()).andStubReturn(peUtil);
- EasyMock.expect(peUtil.getProperty(cs, JPAEditorConstants.COLLAPSE_FEATURES)).andStubReturn(null);
- EasyMock.expect(peUtil.removeProperty(cs, JPAEditorConstants.COLLAPSE_FEATURES)).andStubReturn(false);
- IGraphicsUpdater gu = EasyMock.createMock(IGraphicsUpdater.class);
- EasyMock.expect(fp.getGraphicsUpdater()).andStubReturn(gu);
- gu.updateEntityHeigth(cs);
-
- EasyMock.replay(fp, ctx, cs, ga, peUtil, gu);
- LayoutJPAEntityFeature ft = new LayoutJPAEntityFeature(fp);
- ft.layout(ctx);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/OpenMiniatureViewFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/OpenMiniatureViewFeatureTest.java
deleted file mode 100644
index 80b95a5c7d..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/OpenMiniatureViewFeatureTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertNotNull;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.graphiti.features.context.IAddContext;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.OpenMiniatureViewFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class OpenMiniatureViewFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
-
- @Before
- public void setUp() throws Exception{
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- IFile entity = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- Thread.sleep(2000);
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(null)).andReturn(JPACreateFactory.getPersistentType(entity));
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(JavaCore.createCompilationUnitFrom(entity)).anyTimes();
- replay(featureProvider);
- }
-
- @Test
- public void testExecute() {
- OpenMiniatureViewFeature ft = new OpenMiniatureViewFeature(featureProvider);
- IAddContext ctx = EasyMock.createMock(IAddContext.class);
- ft.execute(ctx);
- }
-
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java
deleted file mode 100644
index 4f600313fb..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-import java.util.List;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RefactorAttributeTypeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class RefactorAttributeTypeFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- private ICustomContext context;
- final String TEST_PROJECT = "Test"+(new Date()).getTime();
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- private IFile entity;
-
- @Before
- public void setUp() throws Exception{
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- entity = factory.createEntity(jpaProject, "org.eclipse.Ent");
- Thread.sleep(2000);
- factory.addAttributes(entity, "att", "java.lang.String", "", "att", false);
-
- }
-
- @Test
- public void testRefactorAttributeTypeFeature(){
- PictogramElement[] elements = new PictogramElement[1];
- PictogramElement element = EasyMock.createNiceMock(PictogramElement.class);
- replay(element);
- elements[0] = element;
-
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(element)).andReturn(null);
- replay(featureProvider);
-
- context = EasyMock.createMock(ICustomContext.class);
- expect(context.getPictogramElements()).andReturn(elements);
- replay(context);
-
- RefactorAttributeTypeFeature feature = new RefactorAttributeTypeFeature(featureProvider);
- feature.execute(context);
- }
-
- @Test
- public void testAttributeUtils(){
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- JavaPersistentType jpt = (JavaPersistentType)pu.getPersistentType("org.eclipse.Ent");
- JavaPersistentAttribute at = jpt.getAttributeNamed("id");
- List<String> lst = JpaArtifactFactory.instance().getAnnotationStrings(at);
- assertEquals(1, lst.size());
- assertTrue(lst.contains("@Id"));
- String typeName1 = JPAEditorUtil.getAttributeTypeName(at);
- assertEquals("int", typeName1);
- String typeName2 = JPAEditorUtil.getAttributeTypeName(at.getResourceAttribute());
- assertEquals("int", typeName2);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java
deleted file mode 100644
index 31b46a400a..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Date;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.features.custom.ICustomFeature;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class RemoveAttributeFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- private IRemoveContext context;
- final String TEST_PROJECT = "Test"+(new Date()).getTime();
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- private IFile entity;
-
- @Before
- public void setUp() throws Exception{
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- entity = factory.createEntity(jpaProject, "org.eclipse.Ent");
- Thread.sleep(2000);
- factory.addAttributes(entity, "att", "java.lang.String", "", "att", false);
-
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testRemoveAttributeFeature() {
- GraphicsAlgorithm algorithm = EasyMock.createNiceMock(GraphicsAlgorithm.class);
- replay(algorithm);
-
- EList<Anchor> list = EasyMock.createMock(EList.class);
- Shape shape = EasyMock.createNiceMock(Shape.class);
-
- expect(shape.getGraphicsAlgorithm()).andReturn(algorithm);
- expect(shape.getAnchors()).andReturn(list);
- replay(shape);
-
- //EList<Shape> listShape = new BasicInternalEList<Shape>(Shape.class);
-
- ContainerShape pictogramElement = EasyMock.createMock(ContainerShape.class);
- Resource res = EasyMock.createMock(Resource.class);
- expect(pictogramElement.eResource()).andStubReturn(res);
-
- ResourceSet rs = EasyMock.createMock(ResourceSet.class);
- expect(res.getResourceSet()).andStubReturn(rs);
- EList<Adapter> ead = new BasicInternalEList<Adapter>(Adapter.class);
- expect(rs.eAdapters()).andStubReturn(ead);
-
- replay(pictogramElement, res, rs);
-
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(pictogramElement)).andReturn(JPACreateFactory.getPersistentAttribute(entity, "att"));
- expect(featureProvider.decreaseAttribsNum(pictogramElement)).andReturn(0);
- expect(featureProvider.getKeyForBusinessObject(isA(Object.class))).andReturn("");
- expect(featureProvider.remove("")).andReturn(null);
- expect(featureProvider.getRelationRelatedToAttribute(isA(JavaPersistentAttribute.class))).andReturn(null);
- replay(featureProvider);
-
- context = EasyMock.createMock(IRemoveContext.class);
- expect(context.getPictogramElement()).andReturn(pictogramElement);
- replay(context);
-
- ICustomFeature graphicalRemove = EasyMock.createMock(ICustomFeature.class);
- graphicalRemove.execute(isA(ICustomContext.class));
- replay(graphicalRemove);
-
- RemoveAttributeFeature feature = new RemoveAttributeFeature(featureProvider, graphicalRemove);
- feature.preRemove(context);
- }
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java
deleted file mode 100644
index 5367a27c13..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.SaveEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class SaveEntityFeatureTest {
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
-
- @Before
- public void setUp() throws Exception{
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- Thread.sleep(2000);
- }
-
- @Test
- public void testExecute() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- PictogramElement pe = EasyMock.createMock(PictogramElement.class);
-
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- int cnt = 0;
- while ((cnt < 25) && (t1 == null)) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- cnt++;
- }
- if (t1 == null)
- return;
- expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(t1);
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(createCompilationUnitFrom(customerFile)).anyTimes();
-
-
- SaveEntityFeature ft = new SaveEntityFeature(featureProvider);
- ICustomContext ctx = EasyMock.createMock(ICustomContext.class);
-
- PictogramElement[] pes = new PictogramElement[1];
- pes[0] = pe;
- expect(ctx.getPictogramElements()).andStubReturn(pes);
-
- replay(featureProvider, ctx, pe);
- ft.execute(ctx);
- }
-
- public static JavaPersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node : getRootNodes(jpaFile)) {
- JavaPersistentType entity = (JavaPersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/UpdateAttributeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/UpdateAttributeFeatureTest.java
deleted file mode 100644
index 792c7c31d3..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/UpdateAttributeFeatureTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Date;
-import java.util.Iterator;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.graphiti.features.context.ICustomContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.Rectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.UpdateAttributeFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class UpdateAttributeFeatureTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- private ICustomContext context;
- final String TEST_PROJECT = "Test"+(new Date()).getTime();
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- private IFile entity;
-
- @Before
- public void setUp() throws Exception {
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- entity = factory.createEntity(jpaProject, "org.eclipse.Ent");
- Thread.sleep(2000);
- factory.addAttributes(entity, "att", "java.lang.String", "", "att", false);
- }
-
-
- @SuppressWarnings({ "unchecked", "deprecation" })
- @Test
- public void testUpdateAttributeFeature(){
- Text text = EasyMock.createMock(Text.class);
- text.setValue(EasyMock.isA(java.lang.String.class));
- EasyMock.replay(text);
-
- EList<GraphicsAlgorithm> listChildren = new BasicInternalEList<GraphicsAlgorithm>(GraphicsAlgorithm.class);
-
-
- EasyMock.expect(listChildren.get(0)).andReturn(text);
- EasyMock.replay(listChildren);
-
-
- Rectangle rectangle = EasyMock.createMock(Rectangle.class);
- EasyMock.expect(rectangle.getGraphicsAlgorithmChildren()).andReturn(listChildren);
- EasyMock.expect(rectangle.getY()).andReturn(0).times(2);
- EasyMock.replay(rectangle);
-
- Iterator<Shape> iteratorShape = EasyMock.createNiceMock(Iterator.class);
- EasyMock.expect(iteratorShape.hasNext()).andReturn(false);
- EasyMock.replay(iteratorShape);
-
- EList<Shape> listShape = new BasicInternalEList<Shape>(Shape.class);
-
- ContainerShape containerShape = EasyMock.createMock(ContainerShape.class);
- EasyMock.expect(containerShape.getChildren()).andReturn(listShape);
- EasyMock.replay(containerShape);
-
- Shape shape = EasyMock.createMock(Shape.class);
- Resource res = EasyMock.createMock(Resource.class);
- ResourceSet rs = EasyMock.createMock(ResourceSet.class);
- EasyMock.expect(res.getResourceSet()).andStubReturn(rs);
- EList<Adapter> ads = new BasicInternalEList<Adapter>(Adapter.class);
- EasyMock.expect(rs.eAdapters()).andStubReturn(ads);
- EasyMock.expect(shape.eResource()).andStubReturn(res);
-
-
-
- EasyMock.expect(shape.getGraphicsAlgorithm()).andReturn(rectangle).times(3);
- EasyMock.expect(shape.getContainer()).andReturn(containerShape);
-
-
- EasyMock.replay(shape, res, rs);
-
- context = EasyMock.createMock(ICustomContext.class);
- EasyMock.expect(context.getInnerPictogramElement()).andReturn(shape);
- EasyMock.replay(context);
-
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- EasyMock.expect(featureProvider.getBusinessObjectForPictogramElement(shape)).andReturn(null);
- EasyMock.replay(featureProvider);
-
- UpdateAttributeFeature feature = new UpdateAttributeFeature(featureProvider);
- feature.execute(context);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/listener/JPAProjectListenerTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/listener/JPAProjectListenerTest.java
deleted file mode 100644
index 84b5695802..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/listener/JPAProjectListenerTest.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.listener;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertNotNull;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.features.IRemoveFeature;
-import org.eclipse.graphiti.features.context.IRemoveContext;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPASolver;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class JPAProjectListenerTest {
- private IJPAEditorFeatureProvider featureProvider;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- IEclipseFacade eclipseFacade = null;
-
- @Before
- public void setUp() throws Exception {
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- IFile entity = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- Thread.sleep(2000);
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(null)).andReturn(getPersistentType(entity));
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(JavaCore.createCompilationUnitFrom(entity)).anyTimes();
- }
-
- public static JavaPersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node : getRootNodes(jpaFile)) {
- JavaPersistentType entity = (JavaPersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
- @Test
- public void testJPAProjectListener() {
- JPASolver slv = new JPASolver();
- slv.setFeatureProvider(featureProvider);
- jpaProject.addCollectionChangeListener("mark", slv.new JPAProjectListener());
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- JavaPersistentType jpt = JpaArtifactFactory.instance().getJPT("org.eclipse.Entity1", pu);
- ContainerShape cs = EasyMock.createMock(ContainerShape.class);
- expect(featureProvider.getPictogramElementForBusinessObject(jpt)).andStubReturn(cs);
- IRemoveFeature ft = EasyMock.createMock(IRemoveFeature.class);
- expect(featureProvider.getRemoveFeature(isA(IRemoveContext.class))).andReturn(ft);
- // The remove method should be invoked exactly once
- ft.remove(isA(IRemoveContext.class));
- replay(ft, cs, featureProvider);
- JpaArtifactFactory.instance().deleteEntityClass(jpt, featureProvider);
- }
-
- @Test
- public void testJPAProjectListenerNoRemove() {
- JPASolver slv = new JPASolver();
- slv.setFeatureProvider(featureProvider);
- jpaProject.addCollectionChangeListener("mark", slv.new JPAProjectListener());
- PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject);
- JavaPersistentType jpt = JpaArtifactFactory.instance().getJPT("org.eclipse.Entity1", pu);
- expect(featureProvider.getPictogramElementForBusinessObject(jpt)).andStubReturn(null);
- IRemoveFeature ft = EasyMock.createMock(IRemoveFeature.class);
- expect(featureProvider.getRemoveFeature(isA(IRemoveContext.class))).andReturn(ft);
- replay(ft, featureProvider);
- // if the container shape is null the remove method of the feature should not be invoked
- JpaArtifactFactory.instance().deleteEntityClass(jpt, featureProvider);
- }
-
-
- @After
- public void tearDown() throws Exception {
- deleteAllProjects();
- }
-
- private void deleteAllProjects() throws Exception {
- IProgressMonitor monitor= new NullProgressMonitor();
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- try {
- IProject project = jpaProject.getProject();
- project.close(monitor);
- project.close(monitor);
- project.delete(true, true, monitor);
- } catch (Exception e) {
- //ignore
- }
- }
- } , monitor);
- }
-
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/ui/ModelIntegrationTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/ui/ModelIntegrationTest.java
deleted file mode 100644
index 80f7416c95..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/ui/ModelIntegrationTest.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.modelintegration.ui;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.mm.pictograms.Diagram;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.platform.IDiagramEditor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.JPAEditorMatchingStrategy;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.IModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPADiagramEditorInput;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PartInitException;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ModelIntegrationTest {
-
- private static final String CODE_GENERATED = "CODE_GENERATED";
- private IJPAEditorFeatureProvider featureProvider;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- IEclipseFacade eclipseFacade = null;
- private String testProjectName = TEST_PROJECT + "_" + System.currentTimeMillis();
- IFile entityFile = null;
-
- @Before
- public void setUp() throws Exception {
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(testProjectName);
- assertNotNull(jpaProject);
- entityFile = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- Thread.sleep(2000);
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(null)).andReturn(getPersistentType(entityFile));
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(JavaCore.createCompilationUnitFrom(entityFile)).anyTimes();
- }
-
- @Test
- public void testJPAEditorMatchingStrategyWithEntityFileEditorInputTrue() {
- IEditorReference editorRef = EasyMock.createMock(IEditorReference.class);
- IFileEditorInput input = EasyMock.createMock(IFileEditorInput.class);
- expect(input.getFile()).andStubReturn(entityFile);
- expect(input.getName()).andStubReturn(CODE_GENERATED);
- ICompilationUnit cu = createCompilationUnitFrom(entityFile);
-
- IJPAEditorUtil ut = EasyMock.createMock(IJPAEditorUtil.class);
- JavaPersistentType inputJptType = getPersistentType(entityFile);
- expect(ut.getJPType(cu)).andStubReturn(inputJptType);
- expect(featureProvider.getJPAEditorUtil()).andStubReturn(ut);
- Diagram d = EasyMock.createMock(Diagram.class);
- IJPADiagramEditorInput dEdInput = EasyMock.createMock(IJPADiagramEditorInput.class);
- try {
- expect(editorRef.getEditorInput()).andStubReturn(dEdInput);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- expect(dEdInput.getDiagram()).andStubReturn(d);
- IDiagramTypeProvider dtp = EasyMock.createMock(IDiagramTypeProvider.class);
- expect(featureProvider.getDiagramTypeProvider()).andStubReturn(dtp);
- IModelIntegrationUtil moinIntUtil = EasyMock.createMock(IModelIntegrationUtil.class);
- expect(featureProvider.getMoinIntegrationUtil()).andStubReturn(moinIntUtil);
- expect(moinIntUtil.getProjectByDiagram(d)).andStubReturn(jpaProject);
- PictogramElement pe = EasyMock.createMock(PictogramElement.class);
- expect(featureProvider.getPictogramElementForBusinessObject(inputJptType)).andStubReturn(pe);
- IDiagramEditor dEd = EasyMock.createMock(IDiagramEditor.class);
- expect(dtp.getDiagramEditor()).andStubReturn(dEd);
- dEd.setPictogramElementForSelection(pe);
-
- JPAEditorMatchingStrategy str = new JPAEditorMatchingStrategy(featureProvider);
-
- EasyMock.replay(editorRef, d, dtp, pe, dEd, moinIntUtil, dEdInput, ut, input, featureProvider);
- assertTrue(str.matches(editorRef, input));
- }
-
- @Test
- public void testJPAEditorMatchingStrategyWithEntityFileEditorInputFalse() {
- IEditorReference editorRef = EasyMock.createMock(IEditorReference.class);
- IFileEditorInput input = EasyMock.createMock(IFileEditorInput.class);
- expect(input.getFile()).andStubReturn(entityFile);
- expect(input.getName()).andStubReturn(CODE_GENERATED);
- ICompilationUnit cu = createCompilationUnitFrom(entityFile);
-
- IJPAEditorUtil ut = EasyMock.createMock(IJPAEditorUtil.class);
- JavaPersistentType inputJptType = getPersistentType(entityFile);
- expect(ut.getJPType(cu)).andStubReturn(inputJptType);
- expect(featureProvider.getJPAEditorUtil()).andStubReturn(ut);
- Diagram d = EasyMock.createMock(Diagram.class);
- IJPADiagramEditorInput dEdInput = EasyMock.createMock(IJPADiagramEditorInput.class);
- try {
- expect(editorRef.getEditorInput()).andStubReturn(dEdInput);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- expect(dEdInput.getDiagram()).andStubReturn(d);
- IDiagramTypeProvider dtp = EasyMock.createMock(IDiagramTypeProvider.class);
- expect(featureProvider.getDiagramTypeProvider()).andStubReturn(dtp);
- IModelIntegrationUtil moinIntUtil = EasyMock.createMock(IModelIntegrationUtil.class);
- expect(featureProvider.getMoinIntegrationUtil()).andStubReturn(moinIntUtil);
- JpaProject anotherJpaProject = EasyMock.createMock(JpaProject.class);
- expect(moinIntUtil.getProjectByDiagram(d)).andStubReturn(anotherJpaProject);
- PictogramElement pe = EasyMock.createMock(PictogramElement.class);
- expect(featureProvider.getPictogramElementForBusinessObject(inputJptType)).andStubReturn(pe);
- IDiagramEditor dEd = EasyMock.createMock(IDiagramEditor.class);
- expect(dtp.getDiagramEditor()).andStubReturn(dEd);
- dEd.setPictogramElementForSelection(pe);
-
- JPAEditorMatchingStrategy str = new JPAEditorMatchingStrategy(featureProvider);
-
- EasyMock.replay(editorRef, d, dtp, pe, dEd, moinIntUtil, anotherJpaProject, dEdInput, ut, input, featureProvider);
- assertFalse(str.matches(editorRef, input));
- }
-
- @Test
- public void testJPAEditorMatchingStrategyWithJPADiagramEditorInputTrue() {
- IEditorReference editorRef = EasyMock.createMock(IEditorReference.class);
- expect(editorRef.getPartName()).andStubReturn("ProjectName");
- IJPADiagramEditorInput input = EasyMock.createMock(IJPADiagramEditorInput.class);
- expect(input.getProjectName()).andStubReturn("ProjectName");
- JPAEditorMatchingStrategy str = new JPAEditorMatchingStrategy(featureProvider);
- EasyMock.replay(editorRef, input, featureProvider);
- assertTrue(str.matches(editorRef, input));
- }
-
- @Test
- public void testJPAEditorMatchingStrategyWithJPADiagramEditorInputFalse() {
- IEditorReference editorRef = EasyMock.createMock(IEditorReference.class);
- expect(editorRef.getPartName()).andStubReturn("ProjectName");
- IJPADiagramEditorInput input = EasyMock.createMock(IJPADiagramEditorInput.class);
- expect(input.getProjectName()).andStubReturn("DifferentProjectName");
- JPAEditorMatchingStrategy str = new JPAEditorMatchingStrategy(featureProvider);
- EasyMock.replay(editorRef, input, featureProvider);
- assertFalse(str.matches(editorRef, input));
- }
-
-
-// @Test
-// public void testJPAEditorMatchingStrategyWithFileEditorInput() {
-// IEditorReference editorRef = EasyMock.createMock(IEditorReference.class);
-// IFileEditorInput input = EasyMock.createMock(IFileEditorInput.class);
-// IJPAEditorUtil ut = EasyMock.createMock(IJPAEditorUtil.class);
-// expect(featureProvider.getJPAEditorUtil()).andStubReturn(ut);
-// JavaPersistentType jpt = EasyMock.createMock(JavaPersistentType.class);
-// ICompilationUnit cu = JavaCore.createCompilationUnitFrom(entityFile);
-// expect(ut.getJPType(cu)).andStubReturn(jpt);
-// PersistenceUnit pu = EasyMock.createMock(PersistenceUnit.class);
-// expect(jpt.getPersistenceUnit()).andStubReturn(pu);
-// expect(pu.getJpaProject()).andStubReturn(jpaProject);
-// expect(input.getFile()).andStubReturn(entityFile);
-// expect(input.getName()).andStubReturn(entityFile.getName());
-// JPAEditorMatchingStrategy str = new JPAEditorMatchingStrategy(featureProvider);
-// EasyMock.replay(editorRef, input, ut, jpt, pu, featureProvider);
-// assertFalse(str.matches(editorRef, input));
-// }
-
-
-
- public static JavaPersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node : getRootNodes(jpaFile)) {
- JavaPersistentType entity = (JavaPersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
- @After
- public void tearDown() throws Exception {
- deleteAllProjects();
- }
-
- private void deleteAllProjects() throws Exception {
- IProgressMonitor monitor= new NullProgressMonitor();
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IProject project = jpaProject.getProject();
- project.close(monitor);
- project.close(monitor);
- project.delete(true, true, monitor);
- }
- } , monitor);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/util/ModelIntegrationUtilTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/util/ModelIntegrationUtilTest.java
deleted file mode 100644
index 4d947ab6c1..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/modelintegration/util/ModelIntegrationUtilTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.modelintegration.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.ModelIntegrationUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferenceInitializer;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleListener;
-
-
-@SuppressWarnings("unchecked")
-public class ModelIntegrationUtilTest {
-
- @Test
- public void getMOINNoResourceFolderTest() {
- IProject project = EasyMock.createMock(IProject.class);
- //EList rr = new BasicInternalEList(String.class);
- EasyMock.expect(project.getProjectRelativePath()).andStubReturn(new Path("src"));
- EasyMock.replay(project);
- IPath p = ModelIntegrationUtil.getEMFResourceFolderPath(project);
- assertNotNull(p);
- assertEquals(2, p.segmentCount());
- assertEquals(p.segment(0), "src");
- }
-
- @SuppressWarnings("rawtypes")
- @Test
- public void getMOINSrcResourceFolderTest() {
- IProject project = EasyMock.createMock(IProject.class);
- EList rr = new BasicInternalEList(String.class);
- rr.add("src");
- EasyMock.expect(project.getProjectRelativePath()).andStubReturn(new Path("src"));
- EasyMock.replay(project);
- IPath p = ModelIntegrationUtil.getEMFResourceFolderPath(project);
- assertNotNull(p);
- assertEquals(2, p.segmentCount());
- assertEquals(p.segment(0), "src");
- }
-
- @Test
- public void copyExistingXMIContentAndDeleteFileTest() throws Exception {
- Bundle b = EasyMock.createMock(Bundle.class);
- BundleContext bc = EasyMock.createMock(BundleContext.class);
- EasyMock.expect(bc.getBundle()).andStubReturn(b);
- EasyMock.expect(b.getSymbolicName()).andStubReturn("jpa_editor");
- bc.addBundleListener(EasyMock.isA(BundleListener.class));
- EasyMock.replay(bc, b);
-
- JPADiagramEditorPlugin p = new JPADiagramEditorPlugin();
- p.start(bc);
- JptJpaCorePlugin.getJpaProjectManager();
-
- IPreferenceStore store = JPADiagramEditorPlugin.getDefault().getPreferenceStore();
- store.putValue(JPAEditorPreferenceInitializer.PROPERTY_DIAGRAM_FOLDER, "diagrams");
- store.getString(JPAEditorPreferenceInitializer.PROPERTY_DIAGRAM_FOLDER);
-
- JPACreateFactory factory = JPACreateFactory.instance();
- JpaProject jpaProject = factory.createJPAProject("Test_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- ModelIntegrationUtil.copyExistingXMIContentAndDeleteFile(jpaProject.getProject(), "diagram_name", null);
- }
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferenceInitializerTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferenceInitializerTest.java
deleted file mode 100644
index f34965d054..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferenceInitializerTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.preferences;
-
-import static org.junit.Assert.*;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferenceInitializer;
-import org.junit.Test;
-
-public class JPAEditorPreferenceInitializerTest {
- @Test
- public void testInitializeDefaultPreferences() {
- IPreferenceStore store = new PreferenceStore();
- AbstractPreferenceInitializer fixture = new JPAEditorPreferenceInitializer(
- store);
- fixture.initializeDefaultPreferences();
- String pack = store
- .getDefaultString(JPAEditorPreferenceInitializer.PROPERTY_ENTITY_PACKAGE);
- assertEquals(JPAEditorPreferenceInitializer.PROPERTY_VAL_ENTITY_PACKAGE, pack);
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferencesPageTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferencesPageTest.java
deleted file mode 100644
index 718896e8c3..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/preferences/JPAEditorPreferencesPageTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferenceInitializer;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.preferences.JPAEditorPreferencesPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class JPAEditorPreferencesPageTest {
-
- private IPreferenceStore store;
- private String oldValue;
-
- @Before
- public void setUp() {
- store = JPADiagramEditorPlugin.getDefault().getPreferenceStore();
- oldValue = store
- .getString(JPAEditorPreferenceInitializer.PROPERTY_ENTITY_PACKAGE);
- }
-
- @After
- public void tearDown() {
- store.setValue(JPAEditorPreferenceInitializer.PROPERTY_ENTITY_PACKAGE,
- oldValue);
- }
-
- /*
- @Test
- public void testCheckState() {
- JPAEditorPreferencesPage page = createControl();
- assertNull(page.getErrorMessage());
- }
-
- @Test
- public void testCheckStateErrorMessage() {
- store.setValue(JPAEditorPreferenceInitializer.DEFAULT_ENTITY_PACKAGE,
- "d omd");
- JPAEditorPreferencesPage page = createControl();
- assertNotNull(page.getErrorMessage());
- }
-
- @Test
- public void testCheckStateWarningMessage() {
- store.setValue(JPAEditorPreferenceInitializer.DEFAULT_ENTITY_PACKAGE,
- "CapitalLetter");
- JPAEditorPreferencesPage page = createControl();
- assertNull(page.getMessage());
- assertTrue(page.isValid());
- }
- */
-
- @Test
- public void testInit() {
- JPAEditorPreferencesPage page = new JPAEditorPreferencesPage();
- page.init(null);
- }
-
- @SuppressWarnings("unused")
- private JPAEditorPreferencesPage createControl() {
- JPAEditorPreferencesPage page = new JPAEditorPreferencesPage();
- Composite composite = new Composite(Display.getDefault()
- .getActiveShell(), SWT.NONE);
- page.createControl(composite);
- return page;
- }
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java
deleted file mode 100644
index eb46f6523d..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.provider;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import org.easymock.EasyMock;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.IDeleteFeature;
-import org.eclipse.graphiti.features.context.IDeleteContext;
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ClickRemoveAttributeButtonFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DeleteJPAEntityFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DeleteRelationFeature;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJpaSolver;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class JPAEditorFeatureProviderTest {
-
-
- private IJpaSolver solver;
- private String businessObjectKey;
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- solver = EasyMock.createMock(IJpaSolver.class);
- businessObjectKey = "someValue";
- }
-
- @Test
- public void testAttributesGroupDeleteFeature(){
- PictogramElement pe = replayPictogramElement();
-
- expect(solver.getBusinessObjectForKey(businessObjectKey)).andReturn(new Object());
- IJPAEditorFeatureProvider provider = createFeatureProvider();
-
- //test
- IDeleteContext context = replayDeleteContext(pe);
- assertNull(provider.getDeleteFeature(context));
- }
-
- @Test
- public void testAttributeDeleteFeature(){
- PictogramElement pe = replayPictogramElement();
- JavaPersistentAttribute jpa = replayAttribute();
- expect(solver.getBusinessObjectForKey(businessObjectKey)).andStubReturn(jpa);
- IJPAEditorFeatureProvider provider = createFeatureProvider();
-
- //test
- IDeleteContext context = replayDeleteContext(pe);
- assertNotNull(provider.getDeleteFeature(context));
- IDeleteFeature feature = provider.getDeleteFeature(context);
- assertTrue(feature instanceof ClickRemoveAttributeButtonFeature);
- }
-
- @Test
- public void testEntityDeleteFeature(){
- PictogramElement pe = replayPictogramElement();
- JavaPersistentType jpt = replayJPT("TestEntity");
-
- expect(solver.getBusinessObjectForKey(businessObjectKey)).andStubReturn(jpt);
- IJPAEditorFeatureProvider provider = createFeatureProvider();
-
- //test
- IDeleteContext context = replayDeleteContext(pe);
- assertNotNull(provider.getDeleteFeature(context));
- IDeleteFeature deleteFeature = provider.getDeleteFeature(context);
- assertTrue(deleteFeature instanceof DeleteJPAEntityFeature);
- }
-
- @Test
- public void testRelationDeleteFeature(){
- PictogramElement pe = replayPictogramElement();
- JavaPersistentType jpt1 = replayJPT("TestEntity1");
- JavaPersistentType jpt2 = replayJPT("TestEntity2");
- IJPAEditorFeatureProvider provider = createFeatureProvider();
-
- AbstractRelation relation = new ManyToManyUniDirRelation(provider, jpt1, jpt2, "attribute1", false, null, null);
- expect(solver.getBusinessObjectForKey(businessObjectKey)).andStubReturn(relation);
-
- //test
- IDeleteContext context = replayDeleteContext(pe);
- assertNotNull(provider.getDeleteFeature(context));
- IDeleteFeature deleteFeature = provider.getDeleteFeature(context);
- assertTrue(deleteFeature instanceof DeleteRelationFeature);
- }
-
- private JavaPersistentType replayJPT(String name){
- JavaPersistentType jpt = EasyMock.createMock(JavaPersistentType.class);
- expect(jpt.getName()).andReturn(name);
- replay(jpt);
- return jpt;
- }
-
- private JavaPersistentAttribute replayAttribute(){
- JavaPersistentAttribute attribute = EasyMock.createMock(JavaPersistentAttribute.class);
- expect(attribute.getName()).andReturn("attribute");
- replay(attribute);
- return attribute;
- }
-
- @SuppressWarnings("unchecked")
- private PictogramElement replayPictogramElement(){
- PictogramElement pe = EasyMock.createMock(PictogramElement.class);
- Resource r = EasyMock.createMock(Resource.class);
- expect(pe.eResource()).andStubReturn(r);
- //expect(pe.is___Alive()).andStubReturn(true);
- EList<Property> properties = EasyMock.createMock(EList.class);
- Property prop = EasyMock.createMock(Property.class);
- expect(prop.getKey()).andStubReturn("independentObject");
- expect(prop.getValue()).andStubReturn(businessObjectKey);
- replay(prop, r);
- properties.add(prop);
- expect(pe.getProperties()).andStubReturn(properties);
- replay(pe);
- return pe;
- }
-
- private IJPAEditorFeatureProvider createFeatureProvider() {
- IDiagramTypeProvider dtp = EasyMock.createMock(IDiagramTypeProvider.class);
- replay(dtp);
- solver.setFeatureProvider(isA(IJPAEditorFeatureProvider.class));
- replay(solver);
- IJPAEditorFeatureProvider provider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(provider.getDiagramTypeProvider()).andStubReturn(dtp);
- //provider.get
- replay(provider);
- return provider;
- }
-
- private IDeleteContext replayDeleteContext(PictogramElement pe){
- IDeleteContext context = EasyMock.createMock(IDeleteContext.class);
- expect(context.getPictogramElement()).andStubReturn(pe);
- replay(context);
- return context;
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java
deleted file mode 100644
index a987680cdb..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.provider;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.features.IFeatureProvider;
-import org.eclipse.graphiti.features.context.IDoubleClickContext;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.tb.IDecorator;
-import org.eclipse.graphiti.tb.IToolBehaviorProvider;
-import org.eclipse.graphiti.tb.ImageDecorator;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.JPAEditorMatchingStrategy;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorToolBehaviorProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IStaticIDE;
-import org.eclipse.ui.PartInitException;
-import org.junit.Before;
-import org.junit.Test;
-
-public class JPAEditorToolBehaviorProviderTest {
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- }
-
- @Test
- public void testGetRenderingDecoratorsPictogramElementError() throws Exception {
- PictogramElement pe = replayPictogramElement(100, 100);
- IMarker marker = replayMarker(IMarker.SEVERITY_ERROR, "Error message");
- JavaPersistentType jpt = replayJptWithMarker(new IMarker[] { marker });
- IDiagramTypeProvider dtp = replayDiagramProvider(pe, jpt);
-
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp);
- IDecorator[] decorators = provider.getDecorators(pe);
- assertEquals(1, decorators.length);
- assertEquals("Error message", decorators[0].getMessage());
- }
-
- @Test
- public void testGetRenderingDecoratorsPictogramElementWarning() throws Exception {
- PictogramElement pe = replayPictogramElement(100, 100);
-
- IMarker marker = replayMarker(IMarker.SEVERITY_WARNING, "Warning message");
- JavaPersistentType jpt = replayJptWithMarker(new IMarker[] { marker });
- IDiagramTypeProvider dtp = replayDiagramProvider(pe, jpt);
-
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp);
- IDecorator[] decorators = provider.getDecorators(pe);
- assertEquals(1, decorators.length);
- assertEquals("Warning message", decorators[0].getMessage());
- }
-
- @Test
- public void testGetRenderingDecoratorsPictogramElementInfo() throws Exception {
- PictogramElement pe = replayPictogramElement(100, 100);
- IMarker marker = replayMarker(IMarker.SEVERITY_INFO, "Info message");
- JavaPersistentType jpt = replayJptWithMarker(new IMarker[] { marker });
- IDiagramTypeProvider dtp = replayDiagramProvider(pe, jpt);
-
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp);
- IDecorator[] decorators = provider.getDecorators(pe);
- assertEquals(1, decorators.length);
- assertEquals("Info message", decorators[0].getMessage());
- }
-
- @Test
- public void testGetRenderingDecoratorsPictogramElementNoMarkers() throws Exception {
- PictogramElement pe = replayPictogramElement(100, 100);
- JavaPersistentType jpt = replayJptWithMarker(new IMarker[0]);
- IDiagramTypeProvider dtp = replayDiagramProvider(pe, jpt);
-
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp);
- IDecorator[] decorators = provider.getDecorators(pe);
- assertEquals(0, decorators.length);
- }
-
- @Test
- public void testGetRenderingDecoratorsPictogramElementTwoMarkers() throws Exception {
- PictogramElement pe = replayPictogramElement(100, 100);
- IMarker warningMarker = replayMarker(IMarker.SEVERITY_WARNING, "warning");
- IMarker errorMarker = replayMarker(IMarker.SEVERITY_ERROR, "error");
- JavaPersistentType jpt = replayJptWithMarker(new IMarker[] { errorMarker, warningMarker });
- IDiagramTypeProvider dtp = replayDiagramProvider(pe, jpt);
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp);
- IDecorator[] decorators = provider.getDecorators(pe);
- assertEquals(1, decorators.length);
- assertEquals("error", decorators[0].getMessage());
- }
-
- @Test
- public void testGetRenderingDecoratorsPictogramElementLocation() throws Exception {
- PictogramElement pe = replayPictogramElement(100, 100);
- IMarker marker = replayMarker(IMarker.SEVERITY_ERROR, "Error message");
- JavaPersistentType jpt = replayJptWithMarker(new IMarker[] { marker });
- IDiagramTypeProvider dtp = replayDiagramProvider(pe, jpt);
-
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp);
- IDecorator[] decorators = provider.getDecorators(pe);
- assertEquals(1, decorators.length);
- assertEquals(80, ((ImageDecorator) decorators[0]).getX());
- assertEquals(80, ((ImageDecorator) decorators[0]).getY());
- }
-
- @Test
- public void testGetDoubleClickOnJptFeature() throws PartInitException, CoreException {
- PictogramElement pe = replayPictogramElement(100, 100);
- IFile file = replayResource();
- JavaPersistentType jpt = replayJpt(pe, file);
- IDiagramTypeProvider dtp = replayDiagramProvider(pe, jpt);
-
- IEclipseFacade facade = EasyMock.createMock(IEclipseFacade.class);
- IStaticIDE ide = EasyMock.createMock(IStaticIDE.class);
- expect(facade.getIDE()).andStubReturn(ide);
- ide.openEditor(file);
- replay(facade, ide);
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp, facade);
-
- IDoubleClickContext context = replayDoubleClickContext(pe);
- provider.getDoubleClickFeature(context);
- verify(ide);
- }
-
- @Test
- public void testGetDoubleClickOnJpaFeature() throws Exception {
- PictogramElement pe = replayPictogramElement(100, 100);
- IFile file = replayResource();
- JavaPersistentAttribute jpa = replayJpa(pe, file);
- IDiagramTypeProvider dtp = replayDiagramProviderForJpa(pe, jpa);
-
- IEclipseFacade eclipseFacade = EasyMock.createMock(IEclipseFacade.class);
- IStaticIDE ide = EasyMock.createMock(IStaticIDE.class);
- expect(eclipseFacade.getIDE()).andStubReturn(ide);
- ide.openEditor(file);
- replay(eclipseFacade, ide);
- IToolBehaviorProvider provider = new JPAEditorToolBehaviorProvider(dtp, eclipseFacade);
-
- IDoubleClickContext context = replayDoubleClickContext(pe);
- provider.getDoubleClickFeature(context);
- verify(ide);
- }
-
- private IDiagramTypeProvider replayDiagramProvider(PictogramElement pe, JavaPersistentType jpt) {
- IFeatureProvider featureProvider = EasyMock.createMock(IFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(jpt);
- IDiagramTypeProvider dtp = EasyMock.createMock(IDiagramTypeProvider.class);
- expect(dtp.getFeatureProvider()).andStubReturn(featureProvider);
- replay(dtp, featureProvider);
- return dtp;
- }
-
- private IMarker replayMarker(int severity, String message) throws CoreException {
- IMarker marker = EasyMock.createMock(IMarker.class);
- expect(marker.getAttribute(IMarker.SEVERITY)).andStubReturn(severity);
- expect(marker.getAttribute(IMarker.MESSAGE)).andStubReturn(message);
- replay(marker);
- return marker;
- }
-
- private JavaPersistentType replayJptWithMarker(IMarker[] markers) throws CoreException {
- JavaPersistentType jpt = EasyMock.createMock(JavaPersistentType.class);
- IFile file = EasyMock.createMock(IFile.class);
- expect(file.exists()).andReturn(true);
- expect(file.findMarkers(null, true, IResource.DEPTH_INFINITE)).andStubReturn(markers);
- expect(jpt.getResource()).andStubReturn(file);
- replay(file, jpt);
- return jpt;
- }
-
- private IFile replayResource() throws CoreException {
- IFile file = EasyMock.createMock(IFile.class);
- file.setSessionProperty(new QualifiedName(null, JPAEditorMatchingStrategy.DOUBLE_CLICK), "true");
- EasyMock.expectLastCall().asStub();
- expect(file.getType()).andStubReturn(IResource.FILE);
- replay(file);
- return file;
- }
-
- private IDoubleClickContext replayDoubleClickContext(PictogramElement pe){
- IDoubleClickContext context = EasyMock.createMock(IDoubleClickContext.class);
- expect(context.getPictogramElements()).andStubReturn(new PictogramElement[] {pe});
- replay(context);
- return context;
- }
-
- private JavaPersistentType replayJpt(PictogramElement pe, IFile file){
- IFeatureProvider featureProvider = EasyMock.createMock(IFeatureProvider.class);
- JavaPersistentType jpt = EasyMock.createMock(JavaPersistentType.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(jpt);
- expect(jpt.getResource()).andReturn(file);
- replay(jpt, featureProvider);
- return jpt;
- }
-
- private JavaPersistentAttribute replayJpa(PictogramElement pe, IFile file){
- IFeatureProvider featureProvider = EasyMock.createMock(IFeatureProvider.class);
- JavaPersistentAttribute jpa = EasyMock.createMock(JavaPersistentAttribute.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(jpa);
- expect(jpa.getResource()).andReturn(file);
- replay(jpa, featureProvider);
- return jpa;
- }
-
- private IDiagramTypeProvider replayDiagramProviderForJpa(PictogramElement pe, JavaPersistentAttribute jpa) {
- IFeatureProvider featureProvider = EasyMock.createMock(IFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(jpa);
- IDiagramTypeProvider dtp = EasyMock.createMock(IDiagramTypeProvider.class);
- expect(dtp.getFeatureProvider()).andStubReturn(featureProvider);
- replay(dtp, featureProvider);
- return dtp;
- }
-
- private PictogramElement replayPictogramElement(int width, int height) {
- PictogramElement pe = EasyMock.createMock(PictogramElement.class);
- GraphicsAlgorithm algo = EasyMock.createMock(GraphicsAlgorithm.class);
- expect(algo.getWidth()).andStubReturn(width);
- expect(algo.getHeight()).andStubReturn(height);
- expect(pe.getGraphicsAlgorithm()).andStubReturn(algo);
- replay(pe, algo);
- return pe;
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java
deleted file mode 100644
index 5a5312c80c..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java
+++ /dev/null
@@ -1,620 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.relation;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CreateRelationAttributesTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- IEclipseFacade eclipseFacade = null;
-
- @Before
- public void setUp() throws Exception {
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- IFile entity = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- Thread.sleep(2000);
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(null)).andReturn(getPersistentType(entity));
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(JavaCore.createCompilationUnitFrom(entity)).anyTimes();
- replay(featureProvider);
- }
-
- public static PersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node : getRootNodes(jpaFile)) {
- PersistentType entity = (PersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- ICompilationUnit cu = JavaCore.createCompilationUnitFrom(file);
- if (!cu.isWorkingCopy())
- try {
- cu.becomeWorkingCopy(new NullProgressMonitor());
- } catch (JavaModelException e) {
- e.printStackTrace();
- }
- return cu;
- }
-
- @Test
- public void testAddAnnotation() throws Exception {
- assertNotNull(jpaProject);
- //jpaProject.setUpdater(new SynchronousJpaProjectUpdater(jpaProject));
- IFile customerFile = JPACreateFactory.instance().createEntityInProject(jpaProject.getProject(), new String[]{"abc"}, "Customer");
- IFile addressFile = JPACreateFactory.instance().createEntityInProject(jpaProject.getProject(), new String[]{"abc"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("abc.Customer");
- assertNotNull(customerType);
-
-
- PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("abc.Address");
- assertNotNull(customerType);
-
-
- PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
- JavaPersistentAttribute attr = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, "add", "add", false,
- createCompilationUnitFrom(customerFile),
- createCompilationUnitFrom(addressFile));
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
- PersistenceUnit pu = jpaProject.getRootContextNode().getPersistenceXml().getPersistence().getPersistenceUnits().iterator().next();
- t1 = pu.getPersistentType("abc.Customer");
- assertNotNull(attr);
-
- }
-
-
- @Test
- public void testAddOneToOneUnidirectionalRelationAttributes() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
- JavaPersistentAttribute attr = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, "address", "address", false,
- createCompilationUnitFrom((IFile)t1.getResource()),
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(attr);
-
- JpaArtifactFactory.instance().addOneToOneUnidirectionalRelation(featureProvider, (JavaPersistentType)t1, attr);
-
- PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (pt == null) {
- Thread.sleep(200);
- pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("address");
- assertNotNull(cPersistentAttribute);
-
- }
-
-
- @Test
- public void testAddOneToOneBidirectionalRelationAttributes() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Customer");
-
- IFile creditCardFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "CreditCard");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.Customer");
- assertNotNull(customerType);
-
-
- PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(creditCardFile.exists());
- JavaResourceAbstractType creditCardType = jpaProject.getJavaResourceType("com.CreditCard");
- assertNotNull(creditCardFile);
-
-
- PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName());
- }
-
- JavaPersistentAttribute attr = JpaArtifactFactory.instance().
- addAttribute( featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, "creditCard", "creditCard", false,
- createCompilationUnitFrom((IFile)t1.getResource()),
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(attr);
-
- JavaPersistentAttribute attr2 = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)t2, (JavaPersistentType)t1, "customer", "customer", false,
- createCompilationUnitFrom((IFile)t2.getResource()),
- createCompilationUnitFrom((IFile)t1.getResource()));
- assertNotNull(attr2);
-
- JpaArtifactFactory.instance().addOneToOneBidirectionalRelation(featureProvider, (JavaPersistentType)t1, attr, (JavaPersistentType)t2, attr2);
-
- PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (ownerPersistentType == null) {
- Thread.sleep(200);
- ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("creditCard");
- assertNotNull(ownerPersistentAttribute);
- assertTrue(ownerPersistentAttribute instanceof JavaPersistentAttribute);
-
- AttributeMapping ownerSideMapping = ownerPersistentAttribute.getMapping();
- assertTrue(ownerSideMapping instanceof JavaOneToOneMapping);
-
- assertTrue(((JavaOneToOneMapping)ownerSideMapping).isRelationshipOwner());
-
- PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName());
- while (inversePersistentType == null) {
- Thread.sleep(200);
- inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("customer");
- assertNotNull(inversePersistentAttribute);
- assertTrue(inversePersistentAttribute instanceof JavaPersistentAttribute);
-
- AttributeMapping inverseSideMapping = inversePersistentAttribute.getMapping();
- assertTrue(inverseSideMapping instanceof JavaOneToOneMapping);
-
- assertFalse(((JavaOneToOneMapping)inverseSideMapping).isRelationshipOwner());
- }
-
-
- @Test
- public void testAddOneToManyUnidirectionalRelationAttributes() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Customer");
-
- IFile phoneFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Phone");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.Customer");
- assertNotNull(customerType);
-
-
- PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(phoneFile.exists());
- JavaResourceAbstractType phoneType = jpaProject.getJavaResourceType("com.Phone");
- assertNotNull(customerType);
-
-
- PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getQualifiedName());
- }
-
- JavaPersistentAttribute attr = JpaArtifactFactory.instance().addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, "phones", "phones", true,
- createCompilationUnitFrom((IFile)t1.getResource()),
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(attr);
-
- JpaArtifactFactory.instance().addOneToManyUnidirectionalRelation(featureProvider, (JavaPersistentType)t1, attr, false);
-
- PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (pt == null) {
- Thread.sleep(200);
- pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("phones");
- assertNotNull(cPersistentAttribute);
-
- AttributeMapping mapping = cPersistentAttribute.getMapping();
- assertNotNull(mapping);
- assertTrue(mapping instanceof JavaOneToManyMapping);
-
- assertTrue(((JavaOneToManyMapping)mapping).isRelationshipOwner());
- }
-
-
- @Test
- public void testAddOneToManyBidirectionalRelationAttributes() throws Exception {
- assertNotNull(jpaProject);
- IFile cruiseFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Cruise");
- IFile reservationFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Reservation");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(cruiseFile.exists());
- JavaResourceAbstractType cruiseType = jpaProject.getJavaResourceType("com.Cruise");
- assertNotNull(cruiseType);
-
-
- PersistentType singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName());
- while (singleSidePersistentType == null) {
- Thread.sleep(200);
- singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName());
- }
-
- assertTrue(reservationFile.exists());
- JavaResourceAbstractType reservationType= jpaProject.getJavaResourceType("com.Reservation");
- assertNotNull(reservationFile);
-
-
- PersistentType manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- while (manySidePersistentType == null) {
- Thread.sleep(200);
- manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- }
-
- JavaPersistentAttribute singleSideAttribute = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)singleSidePersistentType, (JavaPersistentType)manySidePersistentType, "reservations", "reservations", true,
- createCompilationUnitFrom((IFile)singleSidePersistentType.getResource()),
- createCompilationUnitFrom((IFile)manySidePersistentType.getResource()));
- assertNotNull(singleSideAttribute);
-
- JavaPersistentAttribute manySideAttribute = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)manySidePersistentType, (JavaPersistentType)singleSidePersistentType, "cruise", "cruise", false,
- createCompilationUnitFrom((IFile)manySidePersistentType.getResource()),
- createCompilationUnitFrom((IFile)singleSidePersistentType.getResource()));
- assertNotNull(manySideAttribute);
-
- JpaArtifactFactory.instance().addOneToManyBidirectionalRelation(featureProvider, (JavaPersistentType)singleSidePersistentType, singleSideAttribute, (JavaPersistentType)manySidePersistentType, manySideAttribute, false);
-
- // In one-to-many bidirectional relation many side is ALWAYS owner
- PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName());
- while (inversePersistentType == null) {
- Thread.sleep(200);
- inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations");
- assertNotNull(inversePersistentAttribute);
- assertTrue(inversePersistentAttribute instanceof JavaPersistentAttribute);
-
- AttributeMapping inverseSideMapping = inversePersistentAttribute.getMapping();
- assertTrue(inverseSideMapping instanceof JavaOneToManyMapping);
-
- assertFalse(((JavaOneToManyMapping)inverseSideMapping).isRelationshipOwner());
-
- // In one-to-many bidirectional relation many side is ALWAYS owner
- PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- int c = 0;
- while ((ownerPersistentType == null) && (c < 50)) {
- Thread.sleep(200);
- ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- c++;
- }
- assertNotNull(ownerPersistentType);
-
- ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("cruise");
- c = 0;
- while ((ownerPersistentAttribute == null) && (c < 50)) {
- Thread.sleep(200);
- ownerPersistentAttribute = ownerPersistentType.resolveAttribute("cruise");
- c++;
- }
-
- assertNotNull(ownerPersistentAttribute);
- assertTrue(ownerPersistentAttribute instanceof JavaPersistentAttribute);
-
- AttributeMapping ownerSideMapping = ownerPersistentAttribute.getMapping();
- c = 0;
- while ((ownerSideMapping == null) && (c < 50)) {
- Thread.sleep(200);
- ownerSideMapping = ownerPersistentAttribute.getMapping();
- c++;
- }
- if (ownerSideMapping == null)
- return;
- assertNotNull("ownerSideMapping must not be null", ownerSideMapping);
- assertTrue("ownerSideMapping class is " + ownerSideMapping.getClass().getName(), JavaManyToOneMapping.class.isInstance(ownerSideMapping));
-
- assertTrue(((JavaManyToOneMapping)ownerSideMapping).isRelationshipOwner());
- }
-
-
- @Test
- public void testAddManyToOneUnidirectionalRelationAttributes() throws Exception {
- assertNotNull(jpaProject);
- IFile cruiseFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Cruise");
- IFile shipFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Ship");
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(cruiseFile.exists());
- JavaResourceAbstractType cruiseType = jpaProject.getJavaResourceType("com.Cruise");
- assertNotNull(cruiseType);
-
- PersistentType manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName());
- while (manySidePersistentType == null) {
- Thread.sleep(200);
- manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName());
- }
-
- assertTrue(shipFile.exists());
- JavaResourceAbstractType shipType = jpaProject.getJavaResourceType("com.Ship");
- assertNotNull(cruiseType);
-
-
- PersistentType singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getQualifiedName());
- while (singleSidePersistentType == null) {
- Thread.sleep(200);
- singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getQualifiedName());
- }
-
- JavaPersistentAttribute mappedAttribute = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)manySidePersistentType, (JavaPersistentType)singleSidePersistentType, "ship", "ship", true,
- createCompilationUnitFrom((IFile)manySidePersistentType.getResource()),
- createCompilationUnitFrom((IFile)singleSidePersistentType.getResource()));
- assertNotNull(mappedAttribute);
-
- JpaArtifactFactory.instance().addManyToOneUnidirectionalRelation(featureProvider, (JavaPersistentType)manySidePersistentType, mappedAttribute);
-
- PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName());
- while (pt == null) {
- Thread.sleep(200);
- pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("ship");
- int cnt = 0;
- while ((cPersistentAttribute == null) && (cnt < 100)) {
- Thread.sleep(250);
- cPersistentAttribute = pt.resolveAttribute("ship");
- cnt++;
- }
- assertNotNull(cPersistentAttribute);
-
- AttributeMapping mapping = cPersistentAttribute.getMapping();
- cnt = 0;
- while ((mapping == null) && (cnt < 100)) {
- Thread.sleep(250);
- mapping = cPersistentAttribute.getMapping();
- cnt++;
- }
- assertNotNull(mapping);
- assertTrue(mapping instanceof JavaManyToOneMapping);
-
- assertTrue(((JavaManyToOneMapping)mapping).isRelationshipOwner());
- }
-
-
- @Test
- public void testAddManyToManyBidirectionalRelationAttributes() throws Exception {
- assertNotNull(jpaProject);
- IFile reservationFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Reservation");
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Customer");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(reservationFile.exists());
- JavaResourceAbstractType reservationType = jpaProject.getJavaResourceType("com.Reservation");
- assertNotNull(reservationType);
-
- PersistentType ownerSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- while (ownerSidePersistentType == null) {
- Thread.sleep(200);
- ownerSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- }
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.Customer");
- assertNotNull(customerFile);
-
-
- PersistentType inverseSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (inverseSidePersistentType == null) {
- Thread.sleep(200);
- inverseSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- JavaPersistentAttribute ownerSideAttribute = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)ownerSidePersistentType, (JavaPersistentType)inverseSidePersistentType, "customers", "customers", true,
- createCompilationUnitFrom((IFile)ownerSidePersistentType.getResource()),
- createCompilationUnitFrom((IFile)inverseSidePersistentType.getResource()));
- assertNotNull(ownerSideAttribute);
-
- JavaPersistentAttribute inverseSideAttributes = JpaArtifactFactory.instance().addAttribute(featureProvider, (JavaPersistentType)inverseSidePersistentType, (JavaPersistentType)ownerSidePersistentType, "reservations", "reservations", true,
- createCompilationUnitFrom((IFile)inverseSidePersistentType.getResource()),
- createCompilationUnitFrom((IFile)ownerSidePersistentType.getResource()));
- assertNotNull(inverseSideAttributes);
-
- JpaArtifactFactory.instance().addManyToManyBidirectionalRelation(featureProvider, (JavaPersistentType)ownerSidePersistentType, ownerSideAttribute, (JavaPersistentType)inverseSidePersistentType, inverseSideAttributes, false);
-
- PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- while (ownerPersistentType == null) {
- Thread.sleep(200);
- ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("customers");
- assertNotNull(ownerPersistentAttribute);
- assertTrue(ownerPersistentAttribute instanceof JavaPersistentAttribute);
-
- AttributeMapping ownerSideMapping = ownerPersistentAttribute.getMapping();
- assertTrue(ownerSideMapping instanceof JavaManyToManyMapping);
-
- assertTrue(((JavaManyToManyMapping)ownerSideMapping).isRelationshipOwner());
-
- PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (inversePersistentType == null) {
- Thread.sleep(200);
- inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations");
- assertNotNull(inversePersistentAttribute);
- assertTrue(inversePersistentAttribute instanceof JavaPersistentAttribute);
-
- AttributeMapping inverseSideMapping = inversePersistentAttribute.getMapping();
- assertTrue(inverseSideMapping instanceof JavaManyToManyMapping);
-
- assertFalse(((JavaManyToManyMapping)inverseSideMapping).isRelationshipOwner());
- }
-
- @Test
- public void testAddManyToManyUnidirectionalRelationAttributes() throws Exception {
- assertNotNull(jpaProject);
- IFile reservationFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Reservation");
- IFile cabinFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Cabin");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(reservationFile.exists());
- JavaResourceAbstractType reservationType = jpaProject.getJavaResourceType("com.Reservation");
- assertNotNull(reservationType);
-
- PersistentType annotatedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- while (annotatedPersistentType == null) {
- Thread.sleep(200);
- annotatedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- }
-
- assertTrue(cabinFile.exists());
- JavaResourceAbstractType cabinType = jpaProject.getJavaResourceType("com.Cabin");
- assertNotNull(cabinFile);
-
-
- PersistentType referencedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cabinType.getQualifiedName());
- while (referencedPersistentType == null) {
- Thread.sleep(200);
- referencedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cabinType.getQualifiedName());
- }
-
- JavaPersistentAttribute annotatedSideAttribute = JpaArtifactFactory.instance().
- addAttribute(featureProvider, (JavaPersistentType)annotatedPersistentType, (JavaPersistentType)referencedPersistentType, "cabins", "cabins", true,
- createCompilationUnitFrom((IFile)annotatedPersistentType.getResource()),
- createCompilationUnitFrom((IFile)referencedPersistentType.getResource()));
- assertNotNull(annotatedSideAttribute);
-
- JpaArtifactFactory.instance().addManyToManyUnidirectionalRelation(featureProvider, (JavaPersistentType)annotatedPersistentType, annotatedSideAttribute, false);
-
- PersistentType persistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- while (persistentType == null) {
- Thread.sleep(200);
- persistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName());
- }
-
- ReadOnlyPersistentAttribute persistentAttribute = persistentType.resolveAttribute("cabins");
- assertNotNull(persistentAttribute);
- assertTrue(persistentAttribute instanceof JavaPersistentAttribute);
-
- AttributeMapping mapping = persistentAttribute.getMapping();
- assertTrue(mapping instanceof JavaManyToManyMapping);
-
- assertTrue(((JavaManyToManyMapping)mapping).isRelationshipOwner());
- }
-
-
-
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java
deleted file mode 100644
index 1bad2f4de7..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.relation;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Set;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class CreateRelationsInFieldAnnotatedEntitiesTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- IEclipseFacade eclipseFacade = null;
-
- @Before
- public void setUp() throws Exception {
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- IFile entity = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- Thread.sleep(2000);
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(null)).andReturn(getPersistentType(entity));
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(JavaCore.createCompilationUnitFrom(entity)).anyTimes();
- replay(featureProvider);
- }
-
- public static JavaPersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node: getRootNodes(jpaFile)) {
- JavaPersistentType entity = (JavaPersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
-
- @Test
- public void testCreateOneToOneUnidirRelation() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource());
- AbstractRelation rel = new OneToOneUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt);
- assertTrue(annotations.contains("OneToOne"));
- assertNull(((OwnableRelationshipMappingAnnotation)ownerAt.getMapping()).getMappedBy());
-
- assertTrue(cu1.isWorkingCopy());
- IType javaType = cu1.findPrimaryType();
- IField f = javaType.getField("address");
- assertTrue(f.exists());
-
- }
-
- @Test
- public void testCreateOneToOneBidirRelation() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource());
- ICompilationUnit cu2 = createCompilationUnitFrom((IFile)t2.getResource());
- AbstractRelation rel = new OneToOneBiDirRelation(featureProvider, t1, t2, "address", "customer",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt);
- assertTrue(annotations.contains("OneToOne"));
- assertNull(((OwnableRelationshipMappingAnnotation)ownerAt.getMapping()).getMappedBy());
-
- JavaPersistentAttribute inverseAt = t2.getAttributeNamed("customer");
- assertNotNull(inverseAt);
- annotations = JpaArtifactFactory.instance().getAnnotationNames(inverseAt);
- assertTrue(annotations.contains("OneToOne"));
- assertEquals("address", ((OwnableRelationshipMappingAnnotation)inverseAt.getMapping()).getMappedBy());
-
- assertTrue(cu1.isWorkingCopy());
- assertTrue(cu2.isWorkingCopy());
-
- IType javaType1 = cu1.findPrimaryType();
- IField f1 = javaType1.getField("address");
- assertTrue(f1.exists());
- IType javaType2 = cu2.findPrimaryType();
- IField f2 = javaType2.getField("customer");
- assertTrue(f2.exists());
-
- }
-
- @Test
- public void testCreateOneToManyUnidirRelation() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource());
- AbstractRelation rel = new OneToManyUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt);
- assertTrue(annotations.contains("OneToMany"));
- assertNull(((OwnableRelationshipMappingAnnotation)ownerAt.getMapping()).getMappedBy());
-
- assertTrue(cu1.isWorkingCopy());
-
- IType javaType1 = cu1.findPrimaryType();
- IField f1 = javaType1.getField("address");
- assertTrue(f1.exists());
-
- }
-
- @Test
- public void testCreateManyToOneUnidirRelation() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource());
- AbstractRelation rel = new ManyToOneUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt);
- assertTrue(annotations.contains("ManyToOne"));
-
- assertTrue(cu1.isWorkingCopy());
-
- IType javaType1 = cu1.findPrimaryType();
- IField f1 = javaType1.getField("address");
- assertTrue(f1.exists());
-
- }
-
-
- @Test
- public void testCreateManyToOneBidirRelation() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource());
- ICompilationUnit cu2 = createCompilationUnitFrom((IFile)t2.getResource());
- AbstractRelation rel = new ManyToOneBiDirRelation(featureProvider, t1, t2, "address", "customer",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt);
- assertTrue(annotations.contains("ManyToOne"));
-
- JavaPersistentAttribute inverseAt = t2.getAttributeNamed("customer");
- assertNotNull(inverseAt);
- annotations = JpaArtifactFactory.instance().getAnnotationNames(inverseAt);
- assertTrue(annotations.contains("OneToMany"));
- assertEquals("address", ((OwnableRelationshipMappingAnnotation)inverseAt.getMapping()).getMappedBy());
-
- assertTrue(cu1.isWorkingCopy());
- assertTrue(cu2.isWorkingCopy());
-
- IType javaType1 = cu1.findPrimaryType();
- IField f1 = javaType1.getField("address");
- assertTrue(f1.exists());
- IType javaType2 = cu2.findPrimaryType();
- IField f2 = javaType2.getField("customer");
- assertTrue(f2.exists());
-
- }
-
- @Test
- public void testCreateManyToManyUnidirRelation() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource());
- AbstractRelation rel = new ManyToManyUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt);
- assertTrue(annotations.contains("ManyToMany"));
- assertNull(((OwnableRelationshipMappingAnnotation)ownerAt.getMapping()).getMappedBy());
-
- assertTrue(cu1.isWorkingCopy());
-
- IType javaType1 = cu1.findPrimaryType();
- IField f1 = javaType1.getField("address");
- assertTrue(f1.exists());
-
- }
-
- @Test
- public void testCreateManyToManyBidirRelation() throws Exception {
- assertNotNull(jpaProject);
- IFile customerFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createFieldAnnotatedEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource());
- ICompilationUnit cu2 = createCompilationUnitFrom((IFile)t2.getResource());
- AbstractRelation rel = new ManyToManyBiDirRelation(featureProvider, t1, t2, "address", "customer",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt);
- assertTrue(annotations.contains("ManyToMany"));
- assertNull(((OwnableRelationshipMappingAnnotation)ownerAt.getMapping()).getMappedBy());
-
- JavaPersistentAttribute inverseAt = t2.getAttributeNamed("customer");
- assertNotNull(inverseAt);
- annotations = JpaArtifactFactory.instance().getAnnotationNames(inverseAt);
- assertTrue(annotations.contains("ManyToMany"));
- assertEquals("address", ((OwnableRelationshipMappingAnnotation)inverseAt.getMapping()).getMappedBy());
-
- assertTrue(cu1.isWorkingCopy());
- assertTrue(cu2.isWorkingCopy());
-
- IType javaType1 = cu1.findPrimaryType();
- IField f1 = javaType1.getField("address");
- assertTrue(f1.exists());
- IType javaType2 = cu2.findPrimaryType();
- IField f2 = javaType2.getField("customer");
- assertTrue(f2.exists());
-
- }
-
-
-}
-
-
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java
deleted file mode 100644
index ffcc157fed..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.relation;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.AbstractRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.ManyToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToManyUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneBiDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.relations.OneToOneUniDirRelation;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-
-@SuppressWarnings({ "unused" })
-public class CreateRelationsTest {
-
- private IJPAEditorFeatureProvider featureProvider;
- final String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- IEclipseFacade eclipseFacade = null;
- private static final int MAX_NUM_OF_ITERATIONS = 250;
- JavaPersistentType t1 = null;
- ICompilationUnit cu1 = null;
- JavaPersistentType t2 = null;
- ICompilationUnit cu2 = null;
- private IJPAEditorFeatureProvider featureProvider20;
- private JpaProject jpa20Project;
-
-
- @Before
- public void setUp() throws Exception {
-
- JptJpaCorePlugin.getJpaProjectManager();
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
-
- IFile entity = factory.createEntity(jpaProject, "org.eclipse.Entity1");
- Thread.sleep(2000);
- featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider.getBusinessObjectForPictogramElement(null)).andReturn(getPersistentType(entity));
- expect(featureProvider.getCompilationUnit(isA(JavaPersistentType.class))).andReturn(JavaCore.createCompilationUnitFrom(entity)).anyTimes();
-
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
-
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- int c = 0;
- while ((t1 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- jpaProject.update(null);
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- c++;
- }
-
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class));
- cu1 = JavaCore.createCompilationUnitFrom(customerFile);
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- c = 0;
- while ((t2 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- jpaProject.update(null);
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- c++;
- }
-
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class));
- cu2 = JavaCore.createCompilationUnitFrom(addressFile);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Properties props = new Properties();
- props.setProperty(JPADiagramPropertyPage.PROP_COLLECTION_TYPE.getLocalName(), "collection");
- expect(featureProvider.loadProperties(jpaProject.getProject())).andStubReturn(props);
-
- replay(featureProvider);
-
- jpa20Project = factory.createJPA20Project(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpa20Project);
-
- IFile entity20 = factory.createEntity(jpa20Project, "org.eclipse.Entity1");
- Thread.sleep(2000);
- featureProvider20 = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(featureProvider20.getBusinessObjectForPictogramElement(null)).andReturn(getPersistentType(entity20));
- expect(featureProvider20.getCompilationUnit(isA(JavaPersistentType.class)))
- .andReturn(JavaCore.createCompilationUnitFrom(entity20)).anyTimes();
- }
-
- public static JavaPersistentType getPersistentType(IFile file){
- JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
- for (JpaStructureNode node: getRootNodes(jpaFile)) {
- JavaPersistentType entity = (JavaPersistentType) node;
- return entity;
- }
- return null;
- }
-
- private static Iterable<JpaStructureNode> getRootNodes(JpaFile jpaFile) {
- if(jpaFile == null){
- return EmptyIterable.instance();
- }
- return jpaFile.getRootStructureNodes();
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
- @Test
- public void testCreateOneToOneUnidirRelation() throws Exception {
-
- AbstractRelation rel = new OneToOneUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- OneToOneAnnotation an = (OneToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
- assertNull(an.getMappedBy());
- }
-
-
- @Test
- public void testCreateOneToOneBidirRelation() throws Exception {
-
- AbstractRelation rel = new OneToOneBiDirRelation(featureProvider, t1, t2, "address", "customer",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- OneToOneAnnotation an = (OneToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
- assertNull(an.getMappedBy());
-
- JavaPersistentAttribute inverseAt = t2.getAttributeNamed("customer");
- assertNotNull(inverseAt);
- an = (OneToOneAnnotation)inverseAt.getResourceAttribute().getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
- assertEquals("address", an.getMappedBy());
-
- }
-
-
- @Test
- public void testCreateOneToManyUnidirRelation() throws Exception {
- AbstractRelation rel = new OneToManyUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
-
- OneToManyAnnotation an = (OneToManyAnnotation)ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNull(an.getMappedBy());
- }
-
-
-
- @Test
- public void testCreateManyToOneUnidirRelation() throws Exception {
- AbstractRelation rel = new ManyToOneUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- ManyToOneAnnotation an = (ManyToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
- }
-
- @Test
- public void testCreateManyToOneBidirRelation() throws Exception {
- AbstractRelation rel = new ManyToOneBiDirRelation(featureProvider, t1, t2, "address", "customer",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- ManyToOneAnnotation an = (ManyToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
-
- assertEquals("customer", rel.getInverseAttributeName());
- JavaPersistentAttribute inverseAt = t2.getAttributeNamed("customer");
- assertNotNull(inverseAt);
- OneToManyAnnotation an1 = (OneToManyAnnotation)inverseAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(an1);
- assertEquals("address", an1.getMappedBy());
- }
-
- @Test
- public void testCreateManyToManyUnidirRelation() throws Exception {
- AbstractRelation rel = new ManyToManyUniDirRelation(featureProvider, t1, t2, "address",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- ManyToManyAnnotation an = (ManyToManyAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
- assertNull(an.getMappedBy());
- }
-
- @Test
- public void testCreateManyToManyBidirRelation() throws Exception {
- AbstractRelation rel = new ManyToManyBiDirRelation(featureProvider, t1, t2, "address", "customer",
- true,
- createCompilationUnitFrom((IFile)t1.getResource()),
- createCompilationUnitFrom((IFile)t2.getResource()));
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
- ManyToManyAnnotation an = (ManyToManyAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
- assertNull(an.getMappedBy());
-
- JavaPersistentAttribute inverseAt = t2.getAttributeNamed("customer");
- assertNotNull(inverseAt);
- an = (ManyToManyAnnotation)inverseAt.getResourceAttribute().getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(an);
- assertEquals("address", an.getMappedBy());
-
- }
-
- @Test
- public void testCreateOneToManyUnidirRelation20() throws Exception {
-
- assertNotNull(jpa20Project);
- IFile customerFile = factory.createEntityInProject(jpa20Project.getProject(), new String[]{"com","test"}, "Customer");
-
- IFile addressFile = factory.createEntityInProject(jpa20Project.getProject(), new String[]{"com"}, "Address");
-
- jpa20Project.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpa20Project.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, customerType.getQualifiedName());
- int c = 0;
- while ((t1 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- Thread.sleep(200);
- jpa20Project.update(null);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, customerType.getQualifiedName());
- c++;
- }
-
- expect(featureProvider20.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class));
- ICompilationUnit cu1 = JavaCore.createCompilationUnitFrom(customerFile);
- expect(featureProvider20.getCompilationUnit(t1)).andStubReturn(cu1);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpa20Project.getJavaResourceType("com.Address");
- assertNotNull(customerType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, addressType.getQualifiedName());
- while ((t2 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- Thread.sleep(200);
- jpa20Project.update(null);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, addressType.getQualifiedName());
- c++;
- }
- expect(featureProvider20.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class));
- ICompilationUnit cu2 = JavaCore.createCompilationUnitFrom(addressFile);
- expect(featureProvider20.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Properties props = new Properties();
- props.setProperty(JPADiagramPropertyPage.PROP_COLLECTION_TYPE.getLocalName(), "list");
- expect(featureProvider20.loadProperties(jpa20Project.getProject())).andReturn(props);
- replay(featureProvider20);
-
- AbstractRelation rel = new OneToManyUniDirRelation(featureProvider20, t1, t2, "address",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("address", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("address");
- assertNotNull(ownerAt);
-
- Object o1 = ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(o1);
-
- Object o2 = ownerAt.getResourceAttribute().getAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
- assertNotNull(o2);
-
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) o2;
- assertNotNull(joinColumn.getName());
-
- assertNotNull(joinColumn.getReferencedColumnName());
-
- assertEquals("Customer_id", joinColumn.getName());
- assertEquals("id", joinColumn.getReferencedColumnName());
-
- }
-
-
- @Test
- public void testCreateOneToManyUnidirIDClassRelation20() throws Exception {
-
- assertNotNull(jpa20Project);
- IFile simpleEmployeeFile = factory.createIdClassInProject(jpa20Project.getProject(), new String[]{"com","test"}, "Employee");
- IFile employeeFile = factory.createEntityWithCompositePKInProject(jpa20Project.getProject(), new String[]{"com","test"}, "Employee");
-
- IFile projectFile = factory.createEntityInProject(jpa20Project.getProject(), new String[]{"com"}, "Project");
-
- jpa20Project.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(simpleEmployeeFile.exists());
- assertTrue(employeeFile.exists());
- JavaResourceAbstractType employeeType = jpa20Project.getJavaResourceType("com.test.Employee");
- assertNotNull(employeeType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getQualifiedName());
- int c = 0;
- while ((t1 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- Thread.sleep(200);
- jpa20Project.update(null);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getQualifiedName());
- c++;
- }
-
- expect(featureProvider20.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class));
- ICompilationUnit cu1 = JavaCore.createCompilationUnitFrom(employeeFile);
- expect(featureProvider20.getCompilationUnit(t1)).andStubReturn(cu1);
-
- assertTrue(projectFile.exists());
- JavaResourceAbstractType projectType = jpa20Project.getJavaResourceType("com.Project");
- assertNotNull(employeeType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getQualifiedName());
- while ((t2 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- Thread.sleep(200);
- jpa20Project.update(null);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getQualifiedName());
- c++;
- }
- expect(featureProvider20.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class));
- ICompilationUnit cu2 = JavaCore.createCompilationUnitFrom(projectFile);
- expect(featureProvider20.getCompilationUnit(t2)).andStubReturn(cu2);
- Properties props = new Properties();
- props.setProperty(JPADiagramPropertyPage.PROP_COLLECTION_TYPE.getLocalName(), "list");
- expect(featureProvider20.loadProperties(jpa20Project.getProject())).andReturn(props);
- replay(featureProvider20);
-
- AbstractRelation rel = new OneToManyUniDirRelation(featureProvider20, t1, t2, "project",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("project", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("project");
- assertNotNull(ownerAt);
-
- Object o1 = ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(o1);
-
- Object o2 = ownerAt.getResourceAttribute().getAnnotation(JPA.JOIN_COLUMNS);
- assertNotNull(o2);
-
- assertEquals(2, ownerAt.getResourceAttribute().getAnnotationsSize(JPA.JOIN_COLUMN));
-
- }
-
- @Test
- public void testCreateOneToManyUnidirEmbeddedRelation20() throws Exception {
-
- assertNotNull(jpa20Project);
- IFile simpleEmployeeFile = factory.createEmbeddedClassInProject(jpa20Project.getProject(), new String[]{"com","test"}, "EmployeerId");
- IFile employeeFile = factory.createEntityWithEmbeddedPKInProject(jpa20Project.getProject(), new String[]{"com","test"}, "Employeer");
-
- IFile projectFile = factory.createEntityInProject(jpa20Project.getProject(), new String[]{"com"}, "Person");
-
- jpa20Project.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(simpleEmployeeFile.exists());
- assertTrue(employeeFile.exists());
- JavaResourceAbstractType employeeType = jpa20Project.getJavaResourceType("com.test.Employeer");
- assertNotNull(employeeType);
-
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getQualifiedName());
- int c = 0;
- while ((t1 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- Thread.sleep(200);
- jpa20Project.update(null);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getQualifiedName());
- c++;
- }
-
- expect(featureProvider20.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class));
- ICompilationUnit cu1 = JavaCore.createCompilationUnitFrom(employeeFile);
- expect(featureProvider20.getCompilationUnit(t1)).andStubReturn(cu1);
-
-
- Embeddable emb = JpaArtifactFactory.instance().getPersistenceUnit(t1).getEmbeddable("com.test.EmployeerId");
- Iterator<AttributeMapping> embIt = emb.getAllAttributeMappings().iterator();
- int c1 = 0;
- while ((embIt.hasNext() == false) && (c1 < MAX_NUM_OF_ITERATIONS)) {
- Thread.sleep(200);
- jpa20Project.update(null);
- emb.update();
- embIt = emb.getAllAttributeMappings().iterator();
- c1++;
- }
-
- assertTrue(projectFile.exists());
- JavaResourceAbstractType projectType = jpa20Project.getJavaResourceType("com.Person");
- assertNotNull(employeeType);
-
-
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getQualifiedName());
- while ((t2 == null) && (c < MAX_NUM_OF_ITERATIONS)) {
- Thread.sleep(200);
- jpa20Project.update(null);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getQualifiedName());
- c++;
- }
-
- expect(featureProvider20.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class));
- ICompilationUnit cu2 = JavaCore.createCompilationUnitFrom(projectFile);
- expect(featureProvider20.getCompilationUnit(t2)).andStubReturn(cu2);
- Properties props = new Properties();
- props.setProperty(JPADiagramPropertyPage.PROP_COLLECTION_TYPE.getLocalName(), "list");
- expect(featureProvider20.loadProperties(jpa20Project.getProject())).andReturn(props);
- replay(featureProvider20);
-
- AbstractRelation rel = new OneToManyUniDirRelation(featureProvider20, t1, t2, "person",
- true,
- cu1,
- cu2);
- assertNotNull(rel);
- assertSame(t1, rel.getOwner());
- assertSame(t2, rel.getInverse());
- assertEquals("person", rel.getOwnerAttributeName());
- JavaPersistentAttribute ownerAt = t1.getAttributeNamed("person");
- assertNotNull(ownerAt);
-
- Object o1 = ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(o1);
-
- Object o2 = ownerAt.getResourceAttribute().getAnnotation(JPA.JOIN_COLUMNS);
- assertNotNull(o2);
-
- assertEquals(1, ownerAt.getResourceAttribute().getAnnotationsSize(JPA.JOIN_COLUMN));
- Iterable<JoinColumnAnnotation> nestedAnnotations = new SubIterableWrapper<NestableAnnotation, JoinColumnAnnotation>(ownerAt.getResourceAttribute().getAnnotations(JPA.JOIN_COLUMN));
- Iterator<JoinColumnAnnotation> nestedIterator = nestedAnnotations.iterator();
- while(nestedIterator.hasNext()){
- JoinColumnAnnotation joinColumn = nestedIterator.next();
- assertEquals("Employeer_firstName",joinColumn.getName());
- assertEquals("firstName",joinColumn.getReferencedColumnName());
- }
-
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java
deleted file mode 100644
index 79dc0715c8..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class CreateDeleteEntity {
-
- private static final String TEST_PROJECT = "Test";
- private JPACreateFactory factory = JPACreateFactory.instance();
- private JpaProject jpaProject = null;
-
- @Before
- public void setUp() throws Exception {
- JptJpaCorePlugin.getJpaProjectManager();
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- Thread.sleep(2000);
- }
-
- @Test
- public void testCreateAndDeleteEntity() throws Exception {
- assertNotNull(jpaProject);
-// SynchronousJpaProjectUpdater updater = new SynchronousJpaProjectUpdater(jpaProject);
-// updater.start();
- JpaRootContextNode jpaProjectContent = jpaProject.getRootContextNode();
- assertNotNull(jpaProjectContent);
-// if(jpaProjectContent.getPersistenceXml() == null) {
-// updater = new SynchronousJpaProjectUpdater(jpaProject);
-// updater.start();
-// }
- Thread.sleep(2000);
- PersistenceXml persistenceXml = jpaProjectContent.getPersistenceXml();
- assertNotNull(persistenceXml);
- Persistence p = persistenceXml.getPersistence();
- int cnt = 0;
- while ((p == null) && (cnt < 25)) {
- Thread.sleep(250);
- p = persistenceXml.getPersistence();
- cnt++;
- }
- assertTrue("Can't obtain persistence object", p != null);
- assertTrue(persistenceXml.getPersistence().getPersistenceUnitsSize() == 1);
- //java.lang.UnsupportedOperationException: No PersistenceUnit in this context
- //PersistenceUnit persistenceUnit = persistenceXml.getPersistence().getPersistenceUnit();
- PersistenceUnit persistenceUnit = persistenceXml.getPersistence().getPersistenceUnits().iterator().next();
- assertNotNull(persistenceUnit);
- assertTrue(persistenceUnit.getClassRefsSize() == 0);
- IFile entity1 = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com"}, "Entity1");
- assertTrue(entity1.exists());
-// if(jpaProject.getJavaResourceType("com.Entity1") == null) {
-// updater = new SynchronousJpaProjectUpdater(jpaProject);
-// updater.start();
-// }
- JavaResourceAbstractType persistenceType = jpaProject.getJavaResourceType("com.Entity1");
- int c = 0;
- while ((persistenceType == null) && (c < 100)) {
- Thread.sleep(500);
- jpaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
- persistenceType = jpaProject.getJavaResourceType("com.Entity1");
- c++;
- }
- assertNotNull(persistenceType);
- PersistentType t = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, persistenceType.getQualifiedName());
- c = 0;
- while ((t == null) && (c < 100)) {
- Thread.sleep(500);
- t = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, persistenceType.getQualifiedName());
- c++;
- }
- JpaArtifactFactory.instance().deletePersistenceTypeResource(t);
- assertFalse(entity1.exists());
-// updater = new SynchronousJpaProjectUpdater(jpaProject);
-// updater.start();
- jpaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JptJpaCorePlugin.rebuildJpaProject(jpaProject.getProject());
- persistenceType = jpaProject.getJavaResourceType("com.Entity1");
- c = 0;
- while ((persistenceType != null) && (c < 250)) {
- Thread.sleep(500);
- jpaProject = JptJpaCorePlugin.getJpaProject(jpaProject.getProject());
- persistenceType = jpaProject.getJavaResourceType("com.Entity1");
- c++;
- }
- assertNull(persistenceType);
- assertNotNull(jpaProject);
- }
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/IEditor.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/IEditor.java
deleted file mode 100644
index 4e5c9a7706..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/IEditor.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util;
-
-import org.eclipse.graphiti.platform.IDiagramEditor;
-import org.eclipse.ui.IEditorPart;
-
-public interface IEditor extends IEditorPart, IDiagramEditor {
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java
deleted file mode 100644
index 27896cb773..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
-import org.eclipse.graphiti.mm.algorithms.RoundedRectangle;
-import org.eclipse.graphiti.mm.algorithms.Text;
-import org.eclipse.graphiti.mm.pictograms.Anchor;
-import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
-import org.eclipse.graphiti.mm.pictograms.Connection;
-import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
-import org.eclipse.graphiti.mm.pictograms.Shape;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IPeServiceUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants.ShapeType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.SizePosition;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.eclipse.swt.graphics.Point;
-import org.junit.Test;
-
-public class JPAEditorUtilTest {
- @Test
- public void testCapitalizeFirstLetter() {
- String s = "abcdef";
- String res = JPAEditorUtil.capitalizeFirstLetter(s);
- assertEquals(res.substring(0, 1), "A");
- assertEquals(s.substring(1), res.substring(1));
- }
-
- @Test
- public void testDecapitalizeFirstLetter() {
- String s = "ABCDEFGHIJK";
- String res = JPAEditorUtil.decapitalizeFirstLetter(s);
- assertEquals(res.substring(0, 1), "a");
- assertEquals(s.substring(1), res.substring(1));
- }
-
- @Test
- public void testRevertFirstLetterCase() {
- String s = "ABCDEFGHIJK";
- String res = JPAEditorUtil.revertFirstLetterCase(s);
- assertEquals(res.substring(0, 1), "a");
- assertEquals(s.substring(1), res.substring(1));
- String res1 = JPAEditorUtil.revertFirstLetterCase(res);
- assertEquals(res1.substring(0, 1), "A");
- assertEquals(res1.substring(1), res.substring(1));
- }
-
- @Test
- public void testEqualsIgnoreFirstLetterCase() {
- String s1 = "abcdefg";
- String s2 = "Abcdefg";
- assertTrue(JPAEditorUtil.equalsIgnoreFirstLetterCase(s1, s2));
-
- s1 = "";
- s2 = "";
- assertTrue(JPAEditorUtil.equalsIgnoreFirstLetterCase(s1, s2));
-
- s1 = "gjgIyguiyGUYuGUYGuyg";
- s2 = "gjgIyguiyGUYuGUYGuyg";
- assertTrue(JPAEditorUtil.equalsIgnoreFirstLetterCase(s1, s2));
-
- s1 = "LjgIyguiyGUYuGUYGuyg";
- s2 = "LjgIyguiyGUYuGUYGuyg";
- assertTrue(JPAEditorUtil.equalsIgnoreFirstLetterCase(s1, s2));
-
- s1 = "gjgIyguiyGUYuGUYGuygs";
- s2 = "gjgIyguiyGUYuGUYGuyg";
- assertFalse(JPAEditorUtil.equalsIgnoreFirstLetterCase(s1, s2));
-
- s1 = "LjgIyguiyGUyuGUYGuyg";
- s2 = "LjgIyguiyGUYuGUYGuyg";
- assertFalse(JPAEditorUtil.equalsIgnoreFirstLetterCase(s1, s2));
- }
-
- @Test
- public void testReturnSimpleName() {
- String s = "";
- String res = JPAEditorUtil.returnSimpleName(s);
- assertEquals(s, res);
- s = "jdhksajhdk";
- res = JPAEditorUtil.returnSimpleName(s);
- assertEquals(s, res);
- s = "jdhksajhdk.";
- res = JPAEditorUtil.returnSimpleName(s);
- assertEquals("", res);
- s = ".jdhksajhdk";
- res = JPAEditorUtil.returnSimpleName(s);
- assertEquals("jdhksajhdk", res);
- s = "jdhks.ajhdk";
- res = JPAEditorUtil.returnSimpleName(s);
- assertEquals("ajhdk", res);
- s = "dss.dsdsd.jd.hks.ajhdk";
- res = JPAEditorUtil.returnSimpleName(s);
- assertEquals("ajhdk", res);
- }
-
-
- @Test
- public void testStripQuotes() {
- String s = "";
- String res = JPAEditorUtil.stripQuotes(s);
- assertEquals("", res);
-
- s = "\"\"";
- res = JPAEditorUtil.stripQuotes(s);
- assertEquals("", res);
-
- s = "\"fdsjfjslkdjflks\"";
- res = JPAEditorUtil.stripQuotes(s);
- assertEquals("fdsjfjslkdjflks", res);
-
- s = "\"fdsjfjslkdjflks";
- res = JPAEditorUtil.stripQuotes(s);
- assertEquals("\"fdsjfjslkdjflks", res);
-
- s = "fdsjfjslkdjflks\"";
- res = JPAEditorUtil.stripQuotes(s);
- assertEquals("fdsjfjslkdjflks\"", res);
- }
-
- //@Test
- public void testGetJPType() throws Exception {
-
- String TEST_PROJECT = "Test";
- JpaProject jpaProject = null;
- JPACreateFactory factory = null;
- String testProjectName = TEST_PROJECT + "_" + System.currentTimeMillis();
-
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(testProjectName);
- assertNotNull(jpaProject);
- Thread.sleep(2000);
-
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- ICompilationUnit cu = createCompilationUnitFrom(customerFile);
- Thread.sleep(2000);
- JavaPersistentType jpt = JPAEditorUtil.getJPType(cu);
- assertEquals(customerType.getQualifiedName(), jpt.getName());
- }
-
- @Test
- public void testProduceValidAttributeName() {
- String s = "a";
- String res = JPAEditorUtil.produceValidAttributeName(s);
- assertEquals(s, res);
-
- s = "A";
- res = JPAEditorUtil.produceValidAttributeName(s);
- assertEquals("a", res);
-
- s = "aT";
- res = JPAEditorUtil.produceValidAttributeName(s);
- assertEquals("AT", res);
-
- s = "At";
- res = JPAEditorUtil.produceValidAttributeName(s);
- assertEquals("at", res);
-
- s = "AT";
- res = JPAEditorUtil.produceValidAttributeName(s);
- assertEquals("AT", res);
-
- s = "a1";
- res = JPAEditorUtil.produceValidAttributeName(s);
- assertEquals("a1", res);
-
- s = "A1";
- res = JPAEditorUtil.produceValidAttributeName(s);
- assertEquals("a1", res);
-
- }
-
- //@Test
- public void testCreateImports() throws Exception {
- String TEST_PROJECT = "Test";
- JpaProject jpaProject = null;
- JPACreateFactory factory = null;
- String testProjectName = TEST_PROJECT + "_" + System.currentTimeMillis();
-
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(testProjectName);
- assertNotNull(jpaProject);
- Thread.sleep(2000);
-
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- ICompilationUnit cu = createCompilationUnitFrom(customerFile);
-
- JPAEditorUtil.createImports(cu, "java.util.Hashtable<java.lang.StringBuffer,java.lang.Set<java.lang.String>>");
- }
-
- @Test
- public void testSizePosition() {
- SizePosition sp = new SizePosition(1,2,3,4);
- assertTrue(sp.getWidth() == 1);
- assertTrue(sp.getHeight() == 2);
- assertTrue(sp.getX() == 3);
- assertTrue(sp.getY() == 4);
- }
-
- //@Test
- public void testGetText() throws Exception {
- String TEST_PROJECT = "Test";
- JpaProject jpaProject = null;
- JPACreateFactory factory = null;
- String testProjectName = TEST_PROJECT + "_" + System.currentTimeMillis();
-
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(testProjectName);
- assertNotNull(jpaProject);
- Thread.sleep(2000);
-
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- int cnt = 0;
- while ((cnt < 25) && (t1 == null)) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- cnt++;
- }
- if (t1 == null)
- return;
- assertNotNull(JPAEditorUtil.getText(t1));
- assertNotNull(JPAEditorUtil.getTooltipText(t1));
- JavaPersistentAttribute jpa = t1.getAttributeNamed("id");
- assertNotNull(jpa);
- assertNotNull(JPAEditorUtil.getText(jpa));
- assertNotNull(JPAEditorUtil.getTooltipText(jpa));
-
- }
-
- //@Test
- public void testSetJPTNameInShape() {
- final String NEW_NAME = "NewJPTName";
- ContainerShape cs = EasyMock.createMock(ContainerShape.class);
- Shape sh = EasyMock.createMock(Shape.class);
- GraphicsAlgorithm ga = EasyMock.createMock(GraphicsAlgorithm.class);
- IPeServiceUtil peUtil = EasyMock.createMock(IPeServiceUtil.class);
- EasyMock.expect(peUtil.getPropertyValue(sh, JPAEditorConstants.PROP_SHAPE_TYPE)).andStubReturn(ShapeType.HEADER.toString());
- EList<Shape> shapes = new BasicInternalEList<Shape>(Shape.class);
- shapes.add(sh);
- EasyMock.expect(cs.getChildren()).andStubReturn(shapes);
- Text txt = EasyMock.createMock(Text.class);
- EList<GraphicsAlgorithm> gaCh = new BasicInternalEList<GraphicsAlgorithm>(GraphicsAlgorithm.class);
- gaCh.add(txt);
- EasyMock.expect(sh.getGraphicsAlgorithm()).andStubReturn(ga);
- EasyMock.expect(ga.getGraphicsAlgorithmChildren()).andStubReturn(gaCh);
- txt.setValue(NEW_NAME);
- EasyMock.replay(cs, sh, ga, peUtil, txt);
- JPAEditorUtil.setJPTNameInShape(cs, NEW_NAME, peUtil);
- }
-
- //@Test
- public void testCreateBendPointList1() {
- FreeFormConnection c = EasyMock.createMock(FreeFormConnection.class);
- Anchor startAnchor = EasyMock.createMock(Anchor.class);
- Anchor endAnchor = EasyMock.createMock(Anchor.class);
- AnchorContainer startAnchorContainer = EasyMock.createMock(AnchorContainer.class);
- AnchorContainer endAnchorContainer = EasyMock.createMock(AnchorContainer.class);
- expect(c.getStart()).andStubReturn(startAnchor);
- expect(c.getEnd()).andStubReturn(endAnchor);
- expect(startAnchor.getParent()).andStubReturn(startAnchorContainer);
- expect(endAnchor.getParent()).andStubReturn(endAnchorContainer);
- RoundedRectangle rectStart = createMock(RoundedRectangle.class);
- RoundedRectangle rectEnd = createMock(RoundedRectangle.class);
- expect(startAnchorContainer.getGraphicsAlgorithm()).andStubReturn(rectStart);
- expect(endAnchorContainer.getGraphicsAlgorithm()).andStubReturn(rectEnd);
- expect(rectStart.getX()).andStubReturn(100);
- expect(rectStart.getY()).andStubReturn(100);
- expect(rectStart.getWidth()).andStubReturn(200);
- expect(rectStart.getHeight()).andStubReturn(120);
- expect(rectEnd.getX()).andStubReturn(100);
- expect(rectEnd.getY()).andStubReturn(800);
- expect(rectEnd.getWidth()).andStubReturn(200);
- expect(rectEnd.getHeight()).andStubReturn(120);
-
- EList<Connection> ccc = new BasicInternalEList<Connection>(Connection.class);
- expect(startAnchor.getOutgoingConnections()).andStubReturn(ccc);
- expect(endAnchor.getOutgoingConnections()).andStubReturn(ccc);
-
- EasyMock.replay(c, startAnchor, endAnchor, startAnchorContainer, endAnchorContainer, rectStart, rectEnd);
-
-
-
- List<Point> lst = JPAEditorUtil.createBendPointList(c, false);
- assertTrue(lst.size() == 2);
- for (Point p : lst) {
- assertTrue(p.x >= 0);
- assertTrue(p.y >= 0);
-
- assertTrue(p.x <= 1000000);
- assertTrue(p.y <= 1000000);
- }
-
- }
-
- //@Test
- public void testCreateBendPointList2() {
- FreeFormConnection c = EasyMock.createMock(FreeFormConnection.class);
- Anchor startAnchor = EasyMock.createMock(Anchor.class);
- Anchor endAnchor = EasyMock.createMock(Anchor.class);
- AnchorContainer startAnchorContainer = EasyMock.createMock(AnchorContainer.class);
- AnchorContainer endAnchorContainer = EasyMock.createMock(AnchorContainer.class);
- expect(c.getStart()).andStubReturn(startAnchor);
- expect(c.getEnd()).andStubReturn(endAnchor);
- expect(startAnchor.getParent()).andStubReturn(startAnchorContainer);
- expect(endAnchor.getParent()).andStubReturn(endAnchorContainer);
- RoundedRectangle rectStart = createMock(RoundedRectangle.class);
- RoundedRectangle rectEnd = createMock(RoundedRectangle.class);
- expect(startAnchorContainer.getGraphicsAlgorithm()).andStubReturn(rectStart);
- expect(endAnchorContainer.getGraphicsAlgorithm()).andStubReturn(rectEnd);
- expect(rectStart.getX()).andStubReturn(100);
- expect(rectStart.getY()).andStubReturn(100);
- expect(rectStart.getWidth()).andStubReturn(200);
- expect(rectStart.getHeight()).andStubReturn(120);
- expect(rectEnd.getX()).andStubReturn(800);
- expect(rectEnd.getY()).andStubReturn(100);
- expect(rectEnd.getWidth()).andStubReturn(200);
- expect(rectEnd.getHeight()).andStubReturn(120);
-
- EList<Connection> ccc = new BasicInternalEList<Connection>(Connection.class);
- expect(startAnchor.getOutgoingConnections()).andStubReturn(ccc);
- expect(endAnchor.getOutgoingConnections()).andStubReturn(ccc);
-
- EasyMock.replay(c, startAnchor, endAnchor, startAnchorContainer, endAnchorContainer, rectStart, rectEnd);
-
- List<Point> lst = JPAEditorUtil.createBendPointList(c, false);
- assertTrue(lst.size() == 2);
- for (Point p : lst) {
- assertTrue(p.x >= 0);
- assertTrue(p.y >= 0);
-
- assertTrue(p.x <= 1000000);
- assertTrue(p.y <= 1000000);
- }
-
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
- @Test
- public void testAreHeadersEqual() {
- assertTrue(JPAEditorUtil.areHeadersEqual("header", "header"));
- assertTrue(JPAEditorUtil.areHeadersEqual(JPAEditorConstants.HEADER_PREFIX_DIRTY + "header", "header"));
- assertTrue(JPAEditorUtil.areHeadersEqual("header", JPAEditorConstants.HEADER_PREFIX_DIRTY + "header"));
-
- assertFalse(JPAEditorUtil.areHeadersEqual("header", "headers"));
- assertFalse(JPAEditorUtil.areHeadersEqual("headers", "header"));
-
- assertFalse(JPAEditorUtil.areHeadersEqual(JPAEditorConstants.HEADER_PREFIX_DIRTY + "headers", "header"));
- assertFalse(JPAEditorUtil.areHeadersEqual(JPAEditorConstants.HEADER_PREFIX_DIRTY + "header", "headers"));
-
- assertFalse(JPAEditorUtil.areHeadersEqual("headers", JPAEditorConstants.HEADER_PREFIX_DIRTY + "header"));
- assertFalse(JPAEditorUtil.areHeadersEqual("header", JPAEditorConstants.HEADER_PREFIX_DIRTY + "headers"));
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPASolverTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPASolverTest.java
deleted file mode 100644
index d578244747..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPASolverTest.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2010 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Kiril Mitov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util;
-
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-
-import java.net.URI;
-
-import org.easymock.EasyMock;
-import org.easymock.IArgumentMatcher;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.BasicInternalEList;
-import org.eclipse.graphiti.dt.IDiagramTypeProvider;
-import org.eclipse.graphiti.mm.Property;
-import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.graphiti.mm.pictograms.PictogramsPackage;
-import org.eclipse.graphiti.platform.IDiagramEditor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IJPAEditorUtil;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPASolver;
-import org.junit.Before;
-import org.junit.Test;
-
-@SuppressWarnings("unused")
-public class JPASolverTest {
-
- private IEclipseFacade eclipseFacade;
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- eclipseFacade = createEclipseFacade();
- }
-
- @Test
- public void testResourceListenerRegistered() {
- IWorkspace workspace = EasyMock.createMock(IWorkspace.class);
- workspace.addResourceChangeListener(isA(IResourceChangeListener.class), eq(IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.POST_BUILD));
- replay(workspace);
- IEclipseFacade facade = EasyMock.createMock(IEclipseFacade.class);
- expect(facade.getWorkspace()).andStubReturn(workspace);
- replay(facade);
- new JPASolver(facade, null);
- verify(workspace, facade);
- }
-
- private IFile replayFile() {
- IFile file = EasyMock.createMock(IFile.class);
- URI uri = URI.create("file://project//aaa");
- expect(file.getLocationURI()).andStubReturn(uri);
- expect(file.exists()).andStubReturn(true);
- IProject proj = EasyMock.createMock(IProject.class);
- expect(proj.getType()).andStubReturn(IResource.PROJECT);
- expect(file.getType()).andStubReturn(IResource.FILE);
- expect(file.getFullPath()).andStubReturn(new Path("C:\\project\\aaa"));
- IFile clsPath = EasyMock.createMock(IFile.class);
- expect(proj.getFile(".classpath")).andStubReturn(clsPath);
- try {
- expect(proj.hasNature("org.eclipse.jdt.core.javanature")).andStubReturn(true);
- } catch (CoreException e) {}
- expect(file.getProject()).andStubReturn(proj);
- replay(file, proj);
- return file;
- }
-
- private JavaPersistentType createJptForResource(IFile file, String name) {
- JavaPersistentType jpt = EasyMock.createNiceMock(JavaPersistentType.class);
- JpaProject jpaProject = EasyMock.createNiceMock(JpaProject.class);
- JavaTypeMapping m = EasyMock.createNiceMock(JavaTypeMapping.class);
- expect(jpt.getResource()).andStubReturn(file);
- expect(jpt.getJpaProject()).andStubReturn(jpaProject);
- expect(jpt.getMapping()).andStubReturn(m);
- if (name != null)
- expect(jpt.getName()).andStubReturn(name);
- replay(jpt, jpaProject);
- return jpt;
- }
-
- private IEclipseFacade createEclipseFacade() {
- IEclipseFacade facade = EasyMock.createMock(IEclipseFacade.class);
- return facade;
- }
-
- private void configureForWorkspace(IEclipseFacade facade) {
- IWorkspace workspace = EasyMock.createMock(IWorkspace.class);
- workspace.addResourceChangeListener(isA(IResourceChangeListener.class), eq(IResourceChangeEvent.POST_BUILD));
- replay(workspace);
- expect(facade.getWorkspace()).andStubReturn(workspace);
- }
-
- private IJPAEditorFeatureProvider configureRefreshEditorProvider() {
- IDiagramEditor editor = EasyMock.createMock(IDiagramEditor.class);
- editor.refresh();
- replay(editor);
- IDiagramTypeProvider diagramProvider = EasyMock.createMock(IDiagramTypeProvider.class);
- expect(diagramProvider.getDiagramEditor()).andStubReturn(editor);
- replay(diagramProvider);
- IJPAEditorFeatureProvider provider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- expect(provider.getDiagramTypeProvider()).andStubReturn(diagramProvider);
- return provider;
- }
-
- private IMarkerDelta replayDelta(IResource resource) {
- IMarkerDelta delta = EasyMock.createMock(IMarkerDelta.class);
- expect(delta.getResource()).andStubReturn(resource);
- replay(delta);
- return delta;
- }
-
- private JPASolver createSolver(IEclipseFacade facade, IJPAEditorUtil util) {
- return new JPASolver(facade, util);
- }
-
- public static IResourceChangeListener eqResourceListener(IArgumentMatcher matcher) {
- EasyMock.reportMatcher(matcher);
- return null;
- }
-
- private IResourceChangeEvent replayEvent(IResource resource) {
- IResourceChangeEvent event = EasyMock.createMock(IResourceChangeEvent.class);
- expect(event.findMarkerDeltas(null, true)).andStubReturn(new IMarkerDelta[] { replayDelta(resource) });
- replay(event);
- return event;
- }
-
- private IResourceChangeEvent replayEmptyEvent() {
- IResourceChangeEvent event = EasyMock.createMock(IResourceChangeEvent.class);
- expect(event.findMarkerDeltas(null, true)).andStubReturn(new IMarkerDelta[] {});
- replay(event);
- return event;
- }
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java
deleted file mode 100644
index cae7c866ce..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * <copyright>
- *
- * Copyright (c) 2005, 2011 SAP AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stefan Dimov - initial API, implementation and documentation
- *
- * </copyright>
- *
- *******************************************************************************/
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.easymock.EasyMock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IEclipseFacade;
-import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
-import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory;
-import org.junit.Before;
-import org.junit.Test;
-
-public class JpaArtifactFactoryTest {
-
- String TEST_PROJECT = "Test";
- private JpaProject jpaProject = null;
- private JPACreateFactory factory = null;
- IEclipseFacade eclipseFacade = null;
- public static int cnt = 0;
-
- @Before
- public void setUp() throws Exception {
- factory = JPACreateFactory.instance();
- jpaProject = factory.createJPAProject(TEST_PROJECT + "_" + System.currentTimeMillis());
- assertNotNull(jpaProject);
- Thread.sleep(2000);
- }
-
- /*
- @Test
- public void testJpaArtifactoryAttributeRelatedMethods() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
- IFile addressFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Address");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- assertTrue(addressFile.exists());
- JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address");
- assertNotNull(addressType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- while (t2 == null) {
- Thread.sleep(200);
- t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName());
- }
-
-
- CreateOneToOneBiDirRelationFeature ft = new CreateOneToOneBiDirRelationFeature(featureProvider);
- ICreateConnectionContext ctx = EasyMock.createMock(ICreateConnectionContext.class);
-
- ContainerShape cs1 = EasyMock.createMock(ContainerShape.class);
- ContainerShape cs2 = EasyMock.createMock(ContainerShape.class);
-
- expect(featureProvider.getBusinessObjectForPictogramElement(cs1)).andStubReturn(t1);
- expect(featureProvider.getBusinessObjectForPictogramElement(cs2)).andStubReturn(t2);
- expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(cs1);
- expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(cs2);
-
- Anchor a1 = EasyMock.createMock(Anchor.class);
- Anchor a2 = EasyMock.createMock(Anchor.class);
- expect(a1.getParent()).andStubReturn(cs1);
- expect(a2.getParent()).andStubReturn(cs2);
- expect(ctx.getSourceAnchor()).andStubReturn(a1);
- expect(ctx.getTargetAnchor()).andStubReturn(a2);
-
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- ICompilationUnit cu2 = createCompilationUnitFrom(addressFile);
-
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- expect(featureProvider.getCompilationUnit(t2)).andStubReturn(cu2);
-
- Connection conn = EasyMock.createMock(Connection.class);
- expect(featureProvider.addIfPossible((IAddContext)EasyMock.anyObject())).andStubReturn(conn);
- replay(featureProvider, a1, a2, cs1, cs2, ctx);
- ft.create(ctx);
- OneToOneBiDirRelation rel = ft.createRelation(cs1, cs2);
- assertNotNull(rel);
- assertNotNull(rel.getId());
- assertEquals(RelType.ONE_TO_ONE, rel.getRelType());
- assertEquals(RelDir.BI, rel.getRelDir());
- assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName()));
- assertNotNull(t2.getAttributeNamed(rel.getInverseAttributeName()));
-
- JavaPersistentAttribute jpa = t1.getAttributeNamed(rel.getOwnerAttributeName());
- assertTrue(JpaArtifactFactory.instance().hasEntityAnnotation(t1));
-
- //JavaPersistentAttribute jpa1 = JpaArtifactFactory.instance().getRelatedAttribute(t1, t2);
- //assertNotNull(jpa1);
- //assertSame(jpa1, t2.getAttributeNamed(rel.getInverseAttributeName()));
-
- List<String> ans = JpaArtifactFactory.instance().getAnnotationStrings(jpa);
- assertNotNull(ans);
- assertTrue(ans.size() > 0);
- assertTrue(ans.contains("@OneToOne"));
- JpaArtifactFactory.instance().deleteAttribute(t1, rel.getOwnerAttributeName(), featureProvider);
- jpa = t1.getAttributeNamed(rel.getOwnerAttributeName());
- assertNull(jpa);
- }
- */
-
- @Test
- public void testEntityListener() throws Exception {
- IJPAEditorFeatureProvider featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class);
- assertNotNull(jpaProject);
- IFile customerFile = factory.createEntityInProject(jpaProject.getProject(), new String[]{"com","test"}, "Customer");
-
- jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
-
- assertTrue(customerFile.exists());
- JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer");
- assertNotNull(customerType);
-
- JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- while (t1 == null) {
- Thread.sleep(200);
- t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName());
- }
- ICompilationUnit cu1 = createCompilationUnitFrom(customerFile);
- expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1);
- replay(featureProvider);
-
-// Catches problem with multiple events - Eclipse bugzilla bug #259103
-
-// cnt = 0;
-// t1.addListChangeListener(new EntityAttributesChangeListener());
-// JpaArtifactFactory.instance().deleteAttribute(t1, "id", featureProvider);
-// Thread.sleep(10000);
-// assertTrue("The listener is being triggered " + cnt + " times", cnt == 1);
-
- }
-
- public ICompilationUnit createCompilationUnitFrom(IFile file) {
- return JavaCore.createCompilationUnitFrom(file);
- }
-
-
-
- public class EntityAttributesChangeListener implements ListChangeListener {
-
- public void listChanged(ListChangeEvent event) {
- }
-
- public void itemsAdded(ListAddEvent arg0) {
- }
-
- public void itemsMoved(ListMoveEvent arg0) {
- }
-
- public void itemsRemoved(ListRemoveEvent arg0) {
- cnt++;
- }
-
- public void itemsReplaced(ListReplaceEvent arg0) {
- }
-
- public void listCleared(ListClearEvent arg0) {
- }
- };
-
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/URLEscaper.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/URLEscaper.java
deleted file mode 100644
index 1a66ba2c0c..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/URLEscaper.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util;
-
-public class URLEscaper {
- private static final String specialChars = " <>#%{}|^~[]`;?@=&$";
- private static final String escapeCodes = "%20%3C%3E%23%25%7B%7D%7C%5E%7E%5B%5D%60%3B%3F%40%3D%26%24";
-
- public static String escape(String s) {
- if (s == null)
- return null;
- StringBuffer res = new StringBuffer("");
- for (int i = 0; i < s.length(); i++) {
- char ch = s.charAt(i);
- int ind = specialChars.indexOf(ch);
- res.append(((ind >= 0) ? escapeCodes.substring(ind * 3, ind * 3 + 3) : ch));
- }
- return res.toString();
- }
-}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/test.xml b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/test.xml
deleted file mode 100644
index 98ad18889a..0000000000
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/test.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jpadiagrameditor.ui.tests"/>
- <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1">
- <property file="${testRoot}/testServer.properties"/>
- <property name="jpae-folder" value="${eclipse-home}/jpae_folder"/>
- <delete dir="${jpae-folder}" quiet="true"/>
-
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jpae-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.AllJpaEditorTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
- </ant>
-</target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, cleanup">
- </target>
-</project>

Back to the top